UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

2 lines • 2.47 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{Ic as t,Oa as n,Tc as r,au as i,ka as a,wa as o,xa as s}from"./control-ui-connection-Bfj9beF_.js";import{bh as c,xh as l}from"./control-ui-boot-shared-DFTSUQQ0.js";import{Dt as u,Et as d,Tt as f,bt as p,xt as m}from"./markdown-runtime-DmM7zNej.js";var h,g;function _(){return(_=e((()=>{c(),a(),h={chat:{toolCards:{providerResponse:`Provider tool response`,executionOutput:`Execution output`,showFullOutput:`Show full output`,fullOutputUnavailable:`Full output unavailable. Only the captured output is shown.`,copyOutput:`Copy available output`,downloadOutput:`Download available output`,outputLoadFailed:`Could not load the full output. Try again.`,outputDownloadFailed:`Could not download the output. Try again.`,toolError:`Tool error`,viewMode:`Tool detail view`,diff:`Diff`,raw:`Raw`,openDetails:`Open tool details in side panel`,noOutputFailed:`No output — tool failed.`}}},g=Object.assign(()=>{l(),Object.assign(n.chat.toolCards,h.chat.toolCards)},{catalog:h})})))()}function v(e){return!e.outputTruncated&&(e.toolOutput?.captureTruncated===!0||!e.toolOutput&&/\n\.\.\.\(OpenClaw truncated Codex native tool output: original \d+ chars, showing \d+; rerun with narrower args\.\)\s*$/u.test(e.outputText??``))}function y(e){return o(e.toolOutput?.source===`provider-response`?`chat.toolCards.providerResponse`:e.toolOutput?.source===`execution`?`chat.toolCards.executionOutput`:`chat.toolCards.toolOutput`)}function b(e){let n=e.outputText;if(n===void 0||e.preview||e.toolOutput?.source!==`provider-response`||e.name!==`exec`||!i(e.args)||typeof e.args.input!=`string`)return n;let r=t(n);return!Array.isArray(r)||r.length===0||!r.every(e=>i(e)&&e.type===`input_text`&&typeof e.text==`string`)?n:r.filter((e,t)=>t!==0||r.length===1||!/^Script completed\nWall time [\d.]+ seconds\nOutput:\n$/u.test(e.text)).map(({text:e})=>{let n=t(e),r=i(n)&&typeof n.wall_time_seconds==`number`&&typeof n.exit_code==`number`&&typeof n.output==`string`&&Object.keys(n).every(e=>[`chunk_id`,`wall_time_seconds`,`exit_code`,`original_token_count`,`output`].includes(e))?{text:n.output,exitCode:n.exit_code}:void 0,a=r?.text??e,s=m(a)?.root?f(a,d(a,void 0,{insertSpaces:!0,tabSize:2})):a;return r&&r.exitCode!==0?`${o(`chat.toolCards.exitCode`,{code:String(r.exitCode)})}\n${s}`:s}).join(` `)}var x;function S(){return(S=e((()=>{r(),u(),p(),s(),c(),l(),x=8e3})))()}export{y as a,v as i,b as n,_ as o,S as r,g as s,x as t};