UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

4 lines (3 loc) • 1.34 kB
import{n as e,r as t}from"./rolldown-runtime-CNOWq4Kh.js";import{Ml as n,wa as r,xa as i,zl as a}from"./control-ui-connection-Bfj9beF_.js";import{AS as o,DS as s,Nu as c,ju as l}from"./control-ui-boot-shared-DFTSUQQ0.js";import{fu as u,ia as d,lu as f,ou as p,pu as m,ra as h,ru as g}from"./control-ui-boot-chat-DewxEbIm.js";import{Kn as _}from"./deferred-ui-support-D-VedBtc.js";import{n as v,t as y}from"./complete-history-BDb5r4-2.js";function b(e,t){let n=x(e,t);return n?(_(`chat-${t}-${Date.now()}.md`,n,`text/markdown`),`downloaded`):`empty`}function x(e,t){let n=p(e),i=[],s=new Set;for(let[e,c]of n.entries()){let n=l(c)??``,f=d({kind:`message`,key:`export:`+e,message:c},s).map(e=>l(e.message)??``).filter(e=>e!==n.trim()),p=f.length?[n,...f].filter(Boolean).join(` `):n;if(!p.trim())continue;let h=c,g=u(m(c)),_=g===`user`?o(c)??r(`chat.messages.unattributedSender`):g===`assistant`?o(c)??t:`Tool`,v=a(h.timestamp)??``;i.push(`## ${_}${v?` (${v})`:``}`,``,p,``)}return i.length>0?[`# Chat with ${t}`,``,...i].join(` `):null}function S(){return(S=e((()=>{n(),i(),c(),f(),g(),h(),s()})))()}var C=t({exportCapturedChat:()=>w});async function w(e,t){let n=await v(e);if(!e.isCurrent())throw Error(r(`sessionsView.copyTranscriptChanged`));return b(n,t)}function T(){return(T=e((()=>{i(),y(),S()})))()}export{S as i,T as n,x as r,C as t};