UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 1.18 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Qo as t,li as n,oi as r,us as i}from"./_4____________________________.js";import{HA as a,Hv as o,JO as s,Vv as c,YO as l,zA as u}from"./_2_____________________________.js";import{a as d,i as f,r as p}from"./chat-export-runtime-DYWmnegH.js";import{n as m,t as h}from"./complete-history-Dj6yyv5c.js";async function g(e){if(!e.isCurrent())throw Error(n(`sessionsView.copyTranscriptChanged`));let{context:t,session:r}=e,o=t.gateway,s=o.snapshot.client,u=l(o.snapshot,{method:`chat.history`,requiredScope:`operator.read`,sessionScope:!0});if(!u.allowed||!s)throw Error(u.allowed?n(`sessionsView.actionRequiresConnection`):u.reason);let f=i(r.key)?.agentId??a(t,e.agentId),h=o.snapshot.hello,g=()=>e.isCurrent()&&o.snapshot.client===s&&o.snapshot.phase===`connected`&&o.snapshot.hello===h,_=await m({client:s,sessionKey:r.key,sessionId:r.sessionId,agentId:f,isCurrent:g},d),v=t.agents.state.agentsList?.agents.find(e=>e.id===f)?.name??`OpenClaw`,y=p(_,v);if(!y)throw Error(n(`chat.commandResults.emptyExport`));return c(y,g)}function _(){return(_=e((()=>{r(),f(),h(),o(),s(),u(),t()})))()}_();export{g as copySessionMarkdown};