openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 1.96 kB
JavaScript
import{a as e,i as t}from"./transcript-record-coerce-CPLgmAk9.mjs";import{t as n}from"./transcript-chat-message-content-DeOIjx3p.mjs";import{c as r}from"./transcript-url-protocol-BKapech5.mjs";import{i,r as a}from"./transcript-transcript-events-BDUVmbAW.mjs";import{a as o,i as s}from"./transcript-transcript-only-openclaw-assistant-DcGn8i-E.mjs";import{t as c}from"./transcript-session-entry-navigation-D3XW1J9y.mjs";var TranscriptReportNavigation=class extends c{constructor(e){super();for(let{seq:t,facts:n}of e)switch(n.kind){case`canonical`:this.appendCanonicalNavigationEntry({...n.entry,parentId:n.entry.parentId??null,seq:t},n.hasParentId);break;case`leaf`:this.appendOpaqueNavigationRecord({...n.entry,type:`leaf`});break;case`link`:this.appendOpaqueNavigationRecord(n)}this.finishNavigation()}facts(){return{appendParentId:this.appendParentId,path:this.getBranch()}}readCustomBranch(e,t,n){if(e===null)return[];if(!this.byId.has(e))return;let r=[];for(let i of this.getBranch(e)){if(i.type!==`custom`)continue;let e=n(i.seq);e?.customType===t&&r.push(e)}return r}};function latestCustomReport(e,t,n){for(let r of e.path.toReversed()){if(r.type!==`custom_message`||r.customType===void 0||!n.includes(r.customType))continue;let e=t(r.seq);if(e)return{customType:r.customType,content:e.content,details:e.details}}}function selectTranscriptReport(e,t,n){let r=n.kind===`assistant`&&e.path.some(e=>e.assistantResponseId===n.responseId);return{appendParentId:e.appendParentId,suppressed:r,latest:n.kind===`custom`&&!r?latestCustomReport(e,t,n.customTypes):void 0}}function hasSettledTranscriptAssistant(c,l,u){return c.path.toReversed().some(c=>{if(c.assistantRunId!==u)return!1;let d=l(c.seq)?.message;if(!e(d)||a(d)!==u||i(d,u)===void 0||s(d)||o(d))return!1;let f=t(d.__openclaw);return(f?.mirrorOrigin===void 0||f.runTerminal===!0)&&!!n(r(d))?.trim()})}export{hasSettledTranscriptAssistant as n,selectTranscriptReport as r,TranscriptReportNavigation as t};