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{Gx as t,Ka as n,ak as r,ck as i,lk as a,ok as o,qa as s,uk as c,zx as l}from"./_2_____________________________.js";import{B as u,H as d,V as f,z as p}from"./control-ui-boot-new-pHXPNTZp.js";import{cn as m,ln as h}from"./control-ui-boot-chat-CqvkfPXD.js";async function g(e,i,o,s){let l=e.gateway.snapshot.client;if(!l||e.gateway.snapshot.phase!==`connected`)return!1;let u=r(e.gateway).key,d=e.router.getState().location,m=e.agentSelection.intentRevision,g=h(o.content,e);if(g.attachments.length&&!c(e.config))throw t(g.attachments),Error(a());let _=()=>!s?.aborted&&e.gateway.snapshot.client===l&&r(e.gateway).key===u&&e.router.getState().location===d&&e.agentSelection.intentRevision===m,v=!1;try{let r=await e.sessions.createResult({agentId:i,message:g.text,attachments:n(g.attachments)},{signal:s});return r?(await f({context:e,client:l,agentId:i,result:r,turn:g,navigation:new p,instant:void 0,isCurrent:_,clearDraft:async e=>{v=!0,e&&t(g.attachments)},completeInBackground:()=>!1,finishNavigation:()=>{}}),r.initialRun.status===`started`):!1}finally{v||t(g.attachments)}}function _(){return(_=e((()=>{o(),s(),l(),d(),u(),m(),i()})))()}_();export{g as sendMcpAppNewConversation};