UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 1.24 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Di as t,Ei as n,Qb as r,_D as i,fD as a,gD as o,hD as s,ix as c,pD as l}from"./control-ui-boot-shared-DFTSUQQ0.js";import{Mr as u,Nr as d}from"./control-ui-boot-chat-DewxEbIm.js";import{M as f,N as p,P as m,j as h}from"./control-ui-boot-new-BsNYv3zK.js";async function g(e,t,r,s){let l=e.gateway.snapshot.client;if(!l||e.gateway.snapshot.phase!==`connected`)return!1;let u=a(e.gateway).key,f=e.router.getState().location,m=e.agentSelection.intentRevision,g=d(r.content,e);if(g.attachments.length&&!i(e.config))throw c(g.attachments),Error(o());let _=()=>!s?.aborted&&e.gateway.snapshot.client===l&&a(e.gateway).key===u&&e.router.getState().location===f&&e.agentSelection.intentRevision===m,v=!1;try{let r=await e.sessions.createResult({agentId:t,message:g.text,attachments:n(g.attachments)},{signal:s});return r?(await p({context:e,client:l,agentId:t,result:r,turn:g,navigation:new h,instant:void 0,isCurrent:_,clearDraft:async e=>{v=!0,e&&c(g.attachments)},completeInBackground:()=>!1,finishNavigation:()=>{}}),r.initialRun.status===`started`):!1}finally{v||c(g.attachments)}}function _(){return(_=e((()=>{l(),t(),r(),m(),f(),u(),s()})))()}_();export{g as sendMcpAppNewConversation};