UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 1.17 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Ai as t,vi as n,wa as r,xa as i}from"./control-ui-connection-Bfj9beF_.js";import{$O as a,Ev as o,Tv as s,XO as c,nD as l,tD as u}from"./control-ui-boot-shared-DFTSUQQ0.js";import{i as d,r as f}from"./chat-export-runtime-xsSw0FMa.js";import{n as p,t as m}from"./complete-history-BDb5r4-2.js";async function h(e){if(!e.isCurrent())throw Error(r(`sessionsView.copyTranscriptChanged`));let{context:n,session:i}=e,o=n.gateway,c=o.snapshot.client,u=l(o.snapshot,{method:`chat.history`,requiredScope:`operator.read`,sessionScope:!0});if(!u.allowed||!c)throw Error(u.allowed?r(`sessionsView.actionRequiresConnection`):u.reason);let d=t(i.key)?.agentId??a(n,e.agentId),m=o.snapshot.hello,h=()=>e.isCurrent()&&o.snapshot.client===c&&o.snapshot.phase===`connected`&&o.snapshot.hello===m,g=await p({client:c,sessionKey:i.key,sessionId:i.sessionId,agentId:d,isCurrent:h}),_=n.agents.state.agentsList?.agents.find(e=>e.id===d)?.name??`OpenClaw`,v=f(g,_);if(!v)throw Error(r(`chat.commandResults.emptyExport`));return s(v,h)}function g(){return(g=e((()=>{i(),d(),m(),o(),u(),c(),n()})))()}g();export{h as copySessionMarkdown};