@coreplane/switchboard 1.240.0 → 1.242.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/config/config.example.yaml +40 -8
- package/dist/assets/deploy/cloudflare/worker.ts +77 -18
- package/dist/assets/deploy/cloudflare-resident/worker.ts +198 -15
- package/dist/assets/deploy/cloudflare-sandbox/worker.ts +38 -5
- package/dist/assets/deploy/secrets.manifest.json +6 -0
- package/dist/assets/package-lock.json +3 -3
- package/dist/assets/package.json +1 -1
- package/dist/assets/project.json +2 -2
- package/dist/assets/source.json +3 -3
- package/dist/assets/src/agents/registry.ts +58 -22
- package/dist/assets/src/core/authz/actor.ts +17 -9
- package/dist/assets/src/core/authz/authorize.ts +17 -4
- package/dist/assets/src/core/authz/grants.ts +20 -9
- package/dist/assets/src/core/authz/types.ts +12 -0
- package/dist/assets/src/core/coordinator/contract.ts +40 -1
- package/dist/assets/src/core/coordinator/driver.ts +17 -1
- package/dist/assets/src/core/coordinator/instancesRoute.ts +72 -0
- package/dist/assets/src/core/costs.ts +22 -9
- package/dist/assets/src/core/harness/scope.ts +21 -0
- package/dist/assets/src/core/runEvents.ts +20 -1
- package/dist/assets/src/core/runLedger/types.ts +2 -0
- package/dist/assets/src/core/runRecord.ts +4 -0
- package/dist/assets/src/core/ship/contract.ts +4 -2
- package/dist/assets/src/core/ship/coordinator.ts +22 -7
- package/dist/assets/src/core/trace/attrs.ts +1 -1
- package/dist/assets/src/execution/bindingPurge.ts +2 -2
- package/dist/assets/src/execution/residentAutoRebuild.ts +4 -2
- package/dist/assets/src/execution/residentHead.ts +23 -10
- package/dist/assets/src/execution/residentInfraStreak.ts +89 -0
- package/dist/assets/src/execution/residentRefresh.ts +15 -1
- package/dist/assets/src/execution/residentSteps.ts +1 -0
- package/dist/assets/src/execution/sandboxErrors.ts +6 -0
- package/dist/assets/src/execution/seedPlan.ts +17 -0
- package/dist/assets/web/dist/.vite/manifest.json +435 -439
- package/dist/assets/web/dist/assets/AppShell-IDMGG6yi.js +1 -0
- package/dist/assets/web/dist/assets/{CostsPage-BD3w5j_S.js → CostsPage-CtmKhhOF.js} +2 -2
- package/dist/assets/web/dist/assets/{DeliveryPage-BtvzKA1m.js → DeliveryPage-n1tz5I_v.js} +1 -1
- package/dist/assets/web/dist/assets/HomePage-QtH1EwYF.js +2 -0
- package/dist/assets/web/dist/assets/{NotFoundPage-DwOX1HaZ.js → NotFoundPage-C97EhJcQ.js} +1 -1
- package/dist/assets/web/dist/assets/PendingTurnRow-BZA_vQt3.js +1 -0
- package/dist/assets/web/dist/assets/{ResidentDetailPage-CUAOh5d9.js → ResidentDetailPage-DTMBgnIW.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentsIndexPage-B3KUlYy2.js → ResidentsIndexPage-CaDvXhzJ.js} +1 -1
- package/dist/assets/web/dist/assets/RunFoldRow-mgyLW0oV.js +1 -0
- package/dist/assets/web/dist/assets/RunRoutePage-DypJYMQa.js +6 -0
- package/dist/assets/web/dist/assets/RunsIndexPage-DYraPoWD.js +1 -0
- package/dist/assets/web/dist/assets/{RunsTabs-BnkvCBrM.js → RunsTabs-BUfdk0lH.js} +1 -1
- package/dist/assets/web/dist/assets/{ScheduledPage-C1y9jgAk.js → ScheduledPage-DXD2gLJk.js} +1 -1
- package/dist/assets/web/dist/assets/SettingsPage-BIGio8Y0.js +1 -0
- package/dist/assets/web/dist/assets/{StatusDot-CiByEtoR.js → StatusDot-ELoXHlFt.js} +1 -1
- package/dist/assets/web/dist/assets/{Tooltip-DyRxk8A8.js → Tooltip-BoeFwYP2.js} +1 -1
- package/dist/assets/web/dist/assets/UnitRoutePage-jhCrWW3i.js +1 -0
- package/dist/assets/web/dist/assets/{angular-html-DAQ_1T1v.js → angular-html-oBNfPJR0.js} +1 -1
- package/dist/assets/web/dist/assets/{angular-ts-D4kxRVp1.js → angular-ts-BvNwsyWA.js} +1 -1
- package/dist/assets/web/dist/assets/{apl-Dy07l64y.js → apl-CNUdRlYf.js} +1 -1
- package/dist/assets/web/dist/assets/{astro-DZIbTlc7.js → astro-Zb0NriSe.js} +1 -1
- package/dist/assets/web/dist/assets/{blade-CmSXWX3l.js → blade-qPRVheqq.js} +1 -1
- package/dist/assets/web/dist/assets/{c-ggzVdJLK.js → c-D8Awx4YO.js} +1 -1
- package/dist/assets/web/dist/assets/{chapel-Bo1wktsG.js → chapel-Bt72Mhsx.js} +1 -1
- package/dist/assets/web/dist/assets/{cobol-DJUmtKM2.js → cobol-BOBacexg.js} +1 -1
- package/dist/assets/web/dist/assets/{coffee-BZWOVz4C.js → coffee-E4u0liHW.js} +1 -1
- package/dist/assets/web/dist/assets/{cpp-Dtk39yMw.js → cpp-q2sLNlul.js} +1 -1
- package/dist/assets/web/dist/assets/{crystal-CGf_-Zoj.js → crystal-DyWqUnlb.js} +1 -1
- package/dist/assets/web/dist/assets/{css-CX2fcL4u.js → css-CQY0hFsD.js} +1 -1
- package/dist/assets/web/dist/assets/{dist-D8TaC961.js → dist-BU5UivXC.js} +2 -2
- package/dist/assets/web/dist/assets/durationTone-BobbycC-.js +1 -0
- package/dist/assets/web/dist/assets/{edge-BYS8FtgQ.js → edge-C1MwhJkX.js} +1 -1
- package/dist/assets/web/dist/assets/{elixir-fhUpi3nO.js → elixir-Bb3YbHfn.js} +1 -1
- package/dist/assets/web/dist/assets/{elm-DAQNiwsN.js → elm-DAN9IGQw.js} +1 -1
- package/dist/assets/web/dist/assets/{erb-CWzEys6U.js → erb-BEB8Xlsj.js} +1 -1
- package/dist/assets/web/dist/assets/{git-rebase-9rY3p-Rw.js → git-rebase-tqpjRfxO.js} +1 -1
- package/dist/assets/web/dist/assets/{glimmer-js-tY7hy0nE.js → glimmer-js-Ccbo65zR.js} +1 -1
- package/dist/assets/web/dist/assets/{glimmer-ts-CTrLv5JF.js → glimmer-ts-B6WBVMpE.js} +1 -1
- package/dist/assets/web/dist/assets/{glsl-BRJbiDfq.js → glsl-tRec3Fcu.js} +1 -1
- package/dist/assets/web/dist/assets/{graphql-B-MtVLh2.js → graphql-P8kbxT4F.js} +1 -1
- package/dist/assets/web/dist/assets/{hack-BtIkOypQ.js → hack-H9Zhkagy.js} +1 -1
- package/dist/assets/web/dist/assets/{haml-CoOH6gfa.js → haml-DtEnpn7Z.js} +1 -1
- package/dist/assets/web/dist/assets/{handlebars-DgrRu-GP.js → handlebars-DkgPfoAz.js} +1 -1
- package/dist/assets/web/dist/assets/{html-DZaaI7ca.js → html-D30RXpIs.js} +1 -1
- package/dist/assets/web/dist/assets/{html-derivative-DgHvT-qZ.js → html-derivative-DwozLrEx.js} +1 -1
- package/dist/assets/web/dist/assets/{http-CvAd51yz.js → http-DXuzBAPm.js} +1 -1
- package/dist/assets/web/dist/assets/{hurl-CXGqAfzx.js → hurl-d1UUJIt_.js} +1 -1
- package/dist/assets/web/dist/assets/{indexRow-Cse3JGb0.js → indexRow-BD1VT8o8.js} +1 -1
- package/dist/assets/web/dist/assets/{java-CIQStIXF.js → java-DL0gWf34.js} +1 -1
- package/dist/assets/web/dist/assets/{javascript-WbH8s7E3.js → javascript-Cl7vavnS.js} +1 -1
- package/dist/assets/web/dist/assets/{jinja-DzyWEVKC.js → jinja-CfQOWMX9.js} +1 -1
- package/dist/assets/web/dist/assets/{jison-CrT-zCa-.js → jison-KdYirlqm.js} +1 -1
- package/dist/assets/web/dist/assets/{json-lHjpjXMQ.js → json-C9cDQ-Qj.js} +1 -1
- package/dist/assets/web/dist/assets/{jsx-WTwYCHW6.js → jsx-CRx5NItd.js} +1 -1
- package/dist/assets/web/dist/assets/{julia-Bqpk9H7E.js → julia-CmsQsZQl.js} +1 -1
- package/dist/assets/web/dist/assets/{just-LdXk1r3m.js → just-CsM3Q8TE.js} +1 -1
- package/dist/assets/web/dist/assets/{latex-h_y2A5KD.js → latex-BXCh5YRX.js} +1 -1
- package/dist/assets/web/dist/assets/{liquid-CY7bF2_p.js → liquid-BF2vwK8p.js} +1 -1
- package/dist/assets/web/dist/assets/{lua-oQ7XVZOY.js → lua-DcMBATrl.js} +1 -1
- package/dist/assets/web/dist/assets/main-B2fX10aW.css +1 -0
- package/dist/assets/web/dist/assets/{main-CGO6fQ8k.js → main-D4EA1g6n.js} +2 -2
- package/dist/assets/web/dist/assets/{marko-zv_qZ4QV.js → marko-88MndKvG.js} +1 -1
- package/dist/assets/web/dist/assets/{mdc-Dl4kL_YK.js → mdc-DJ4kVAd8.js} +1 -1
- package/dist/assets/web/dist/assets/{nginx-CAHCZj4F.js → nginx-CP6mRgtV.js} +1 -1
- package/dist/assets/web/dist/assets/{nim-BOtmwCJH.js → nim-QQfj3fpF.js} +1 -1
- package/dist/assets/web/dist/assets/{org-DspQk3HQ.js → org-Bke3eBzc.js} +1 -1
- package/dist/assets/web/dist/assets/{perl-CAXmvVl0.js → perl-Bkh0N7Kz.js} +1 -1
- package/dist/assets/web/dist/assets/{php-CMUx4VyM.js → php-Dnv1Piya.js} +1 -1
- package/dist/assets/web/dist/assets/{pug-B55xVJTv.js → pug-D6peFFI7.js} +1 -1
- package/dist/assets/web/dist/assets/{qml-DsNKCCRk.js → qml-D8PEs-C-.js} +1 -1
- package/dist/assets/web/dist/assets/{r-DbhP0VvO.js → r-B1EL9b_j.js} +1 -1
- package/dist/assets/web/dist/assets/{razor-BCpE6P-p.js → razor-BsMTIh2b.js} +1 -1
- package/dist/assets/web/dist/assets/{regexp-BllsjiN4.js → regexp-HhvC8spD.js} +1 -1
- package/dist/assets/web/dist/assets/{rst-CO5Rpq9V.js → rst-D5paAxpg.js} +1 -1
- package/dist/assets/web/dist/assets/{ruby-C2A4OgQq.js → ruby-BrQwhLrl.js} +1 -1
- package/dist/assets/web/dist/assets/{sas-Butzoyql.js → sas-afot2B1o.js} +1 -1
- package/dist/assets/web/dist/assets/{scss-PEUwJBpf.js → scss-Efm-mwuG.js} +1 -1
- package/dist/assets/web/dist/assets/{shellscript-3Yhq0khE.js → shellscript-BK0Vv5fT.js} +1 -1
- package/dist/assets/web/dist/assets/{shellsession-04Hkb7m3.js → shellsession-BGqlMC7N.js} +1 -1
- package/dist/assets/web/dist/assets/{soy-BnId73cP.js → soy-M0b4UwGM.js} +1 -1
- package/dist/assets/web/dist/assets/{sql-BKwdc0ch.js → sql-sxe6IE9j.js} +1 -1
- package/dist/assets/web/dist/assets/sseReplay-g7ml86LM.js +9 -0
- package/dist/assets/web/dist/assets/{stata-BPPtNkay.js → stata-nPF_ddLP.js} +1 -1
- package/dist/assets/web/dist/assets/{surrealql-CDPChcYP.js → surrealql-D_GrC6u7.js} +1 -1
- package/dist/assets/web/dist/assets/{svelte-B15DIQ-z.js → svelte-DwL1AtNP.js} +1 -1
- package/dist/assets/web/dist/assets/{templ-D-rp_AiB.js → templ-7s7LTDkc.js} +1 -1
- package/dist/assets/web/dist/assets/{tex-BnVDCD7p.js → tex-Bx-5fMxe.js} +1 -1
- package/dist/assets/web/dist/assets/{ts-tags-cpujdyAR.js → ts-tags-DUMJnke_.js} +1 -1
- package/dist/assets/web/dist/assets/{tsx-D1vO4L72.js → tsx-BN8biPDe.js} +1 -1
- package/dist/assets/web/dist/assets/{twig-oQGnQGRc.js → twig-8nIu84TN.js} +1 -1
- package/dist/assets/web/dist/assets/{typescript-CKSFpXiH.js → typescript-BooSPq_S.js} +1 -1
- package/dist/assets/web/dist/assets/{typst-DKHFo8BF.js → typst-CTBiBsem.js} +1 -1
- package/dist/assets/web/dist/assets/{vue-BstokpiS.js → vue-C6Ft4Lea.js} +1 -1
- package/dist/assets/web/dist/assets/{vue-html-DpCp0_Sz.js → vue-html-Ba36dD5D.js} +1 -1
- package/dist/assets/web/dist/assets/{vue-vine-y5d5wUb1.js → vue-vine-NkFexVo2.js} +1 -1
- package/dist/assets/web/dist/assets/{xml-Br2hx5Ax.js → xml-C_THnHXZ.js} +1 -1
- package/dist/assets/web/dist/assets/{xsl-Bc8Cobap.js → xsl-D8G5xqjY.js} +1 -1
- package/dist/assets/web/dist/assets/{yaml-LOITy_I1.js → yaml-jAMIJzge.js} +1 -1
- package/dist/cli.js +4632 -817
- package/package.json +1 -1
- package/dist/assets/web/dist/assets/AppShell-CM_fh-WW.js +0 -1
- package/dist/assets/web/dist/assets/HomePage-BU6aRCSe.js +0 -2
- package/dist/assets/web/dist/assets/RunFoldRow-Dulcbg25.js +0 -1
- package/dist/assets/web/dist/assets/RunRoutePage-DGoGrQZq.js +0 -6
- package/dist/assets/web/dist/assets/RunsIndexPage-37W7OZbC.js +0 -1
- package/dist/assets/web/dist/assets/SettingsPage-ggfB-Rqr.js +0 -1
- package/dist/assets/web/dist/assets/SlackMark-VDNs7Vjh.js +0 -1
- package/dist/assets/web/dist/assets/Slideover-CX-LEklF.js +0 -1
- package/dist/assets/web/dist/assets/UnitRoutePage-CnWyOizV.js +0 -1
- package/dist/assets/web/dist/assets/durationTone-DXG-3R7_.js +0 -1
- package/dist/assets/web/dist/assets/main-O8UXRuEv.css +0 -1
- package/dist/assets/web/dist/assets/sseReplay-DutHNghE.js +0 -9
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{Ci as e,Mr as t,Qn as n,Rn as r,Wt as i,Xt as a,_n as o,ci as s,cn as c,gn as l,ir as u,ln as d,oi as f,on as p,sn as m,un as h,ur as g,vi as _,wi as v,xi as y,yn as b}from"./seed-DeKSHrt2.js";import{n as x}from"./wallClock-61NpVkY6.js";import{D as S,E as C}from"./indexRow-Cse3JGb0.js";import{t as w}from"./localIso-L06jV29p.js";import{n as T,r as E,t as D}from"./durationTone-DXG-3R7_.js";function O(e){let t=new Date(e),n=t.getHours(),r=e=>String(e).padStart(2,`0`),i=new Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value;return`${n%12==0?12:n%12}:${r(t.getMinutes())}:${r(t.getSeconds())} ${n<12?`AM`:`PM`}${i?` ${i}`:``}`}function k(e){return e>0?e<1024?`${e} B`:e<1048576?`${(Math.round(e/102.4)/10).toFixed(1)} KB`:e<1073741824?`${(Math.round(e/104857.6)/10).toFixed(1)} MB`:`${(Math.round(e/107374182.4)/10).toFixed(1)} GB`:`0 B`}var A=`A-Za-z0-9:@._-`;RegExp(`^[${A}]{1,128}$`),RegExp(`[^${A}]`,`g`);function j(e){return e.type===`span_start`||e.type===`span_end`}function M(e,t){return/^[A-Za-z0-9_-]{1,64}$/.test(e)?`synth:${e}`:`synth:${t}`}function N(e){let t=[];for(let n of e)n.type===`span_end`&&n.name===`run.agent`&&t.push({spanId:n.spanId,startedAt:n.startedAt,endedAt:n.startedAt+n.durationMs});return t}function P(e,t){let n;for(let r of e)r.startedAt<=t&&t<=r.endedAt&&(!n||r.endedAt-r.startedAt<n.endedAt-n.startedAt)&&(n=r);return n?.spanId}function F(e){let t=N(e),n=new Set;for(let t of e){if(!j(t))continue;let e=t.attrs??{};t.name.startsWith(`tool.`)&&typeof e.callId==`string`&&n.add(e.callId)}let r=[],i=new Map;return e.forEach((e,a)=>{switch(e.type){case`tool_call`:{let o=e.callId;if(o===void 0||e.at===void 0||n.has(o)){r.push(e);return}let s=M(o,a);r.push(ee(s,`tool.${e.tool}`,e.at,P(t,e.at),{callId:o}),e),i.set(o,{spanId:s,startedAt:e.at});return}case`tool_result`:{if(r.push(e),e.callId===void 0)return;let n=i.get(e.callId);if(!n)return;i.delete(e.callId);let a=e.at??n.startedAt,o={ok:e.ok,callId:e.callId};e.exitCode!==void 0&&(o.exitCode=e.exitCode),e.infra&&(o.infra=!0),r.push(I(n.spanId,`tool.${e.tool}`,n.startedAt,Math.max(0,a-n.startedAt),P(t,n.startedAt),o,e.ok?`ok`:`error`));return}default:r.push(e)}}),r}function ee(e,t,n,r,i){return{type:`span_start`,spanId:e,...r===void 0?{}:{parentSpanId:r},name:t,...i?{attrs:i}:{},at:n}}function I(e,t,n,r,i,a,o=`ok`){return{type:`span_end`,spanId:e,...i===void 0?{}:{parentSpanId:i},name:t,startedAt:n,durationMs:r,status:o,...a?{attrs:a}:{},at:n+r}}function te(e,t,n){let r=e.get(t.spanId);if(t.type===`span_start`){if(r)return;e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?{}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.at??0,attrs:t.attrs??{}});return}e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?r?.parentSpanId===void 0?{}:{parentSpanId:r.parentSpanId}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.startedAt,endedAt:t.startedAt+t.durationMs,durationMs:t.durationMs,status:t.status,...t.error===void 0?{}:{errorMessage:t.error},attrs:{...r?.attrs??{},...t.attrs??{}}})}function ne(){let e,t,n=[];return{push(r){e?t&&r.seq!==void 0&&t.seq!==void 0&&r.seq>t.seq+1&&t.at!==void 0&&r.at!==void 0&&n.push({kind:`gap`,fromSeq:t.seq+1,toSeq:r.seq-1,from:Math.min(t.at,r.at),to:Math.max(t.at,r.at)}):e={seq:r.seq??1,at:r.at},r.type===`run_note`&&r.kind===`spans_dropped`&&r.from!==void 0&&r.to!==void 0&&r.to>=r.from&&n.push({kind:`note`,from:r.from,to:r.to}),t={seq:r.seq,at:r.at}},losses(t={}){let r=t.elided??[],i=(e,t)=>r.some(n=>n.fromSeq<=e&&t<=n.toSeq),a=[];e&&e.seq>1&&t.windowStart!==void 0&&e.at!==void 0&&e.at>t.windowStart&&a.push({from:t.windowStart,to:e.at,kind:`lost`});for(let e of n)a.push(e.kind===`note`?{from:e.from,to:e.to,kind:`lost`}:{from:e.from,to:e.to,kind:i(e.fromSeq,e.toSeq)?`elided`:`lost`});return a}}}function L(e,t){let n=e.ownerDocument;e.textContent=``;let r=String(t??``).replace(/\r\n?/g,`
|
|
2
|
-
`).split(`
|
|
3
|
-
`),i=/^(\s*)([-*]|\d+[.)])\s+(.*)$/,a=/^(```|#{1,6}\s|>)/;function o(e,t){let r=n.createElement(t);return e.appendChild(r),r}function s(e,t){t&&e.appendChild(n.createTextNode(t))}function c(e){let t=e.trim();return t[0]===`|`&&(t=t.slice(1)),t[t.length-1]===`|`&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())}function l(e){let t=e.trim();return t.indexOf(`|`)<0||!/^[\s:|-]+$/.test(t)?!1:c(t).every(e=>/^:?-+:?$/.test(e))}function u(e,t){let n=e[t];return n.indexOf(`|`)<0||l(n)||t+1>=e.length||!l(e[t+1])?!1:c(n).length===c(e[t+1]).length}function d(e,t){let n=0,r=``,i=()=>{s(e,r),r=``};for(;n<t.length;){let a=t[n];if(a==="`"){let r=t.indexOf("`",n+1);if(r>n+1){i(),o(e,`code`).textContent=t.slice(n+1,r),n=r+1;continue}}else if(a===`*`&&t[n+1]===`*`){let r=t.indexOf(`**`,n+2);if(r>n+2){i(),d(o(e,`strong`),t.slice(n+2,r)),n=r+2;continue}}else if(a===`*`||a===`_`){let r=n>0?t[n-1]:``;if(/\S/.test(t[n+1]||``)&&!/\w/.test(r)){let r=-1;for(let e=n+2;e<t.length;e++)if(t[e]===a&&/\S/.test(t[e-1])&&!/\w/.test(t[e+1]||``)){r=e;break}if(r>0){i(),d(o(e,`em`),t.slice(n+1,r)),n=r+1;continue}}}else if(a===`[`){let r=/^\[([^\]\n]+)\]\(([^)\s]+)\)/.exec(t.slice(n));if(r&&/^https?:\/\//i.test(r[2])){i();let t=o(e,`a`);t.setAttribute(`href`,r[2]),t.setAttribute(`rel`,`noopener noreferrer`),t.setAttribute(`target`,`_blank`),d(t,r[1]),n+=r[0].length;continue}}r+=a,n++}i()}function f(e,t,n=0){let r=0;for(;r<t.length;){let s=t[r];if(/^\s*$/.test(s)){r++;continue}if(/^```/.test(s)){let n=[];for(r++;r<t.length&&!/^```\s*$/.test(t[r]);)n.push(t[r++]);r++,o(o(e,`pre`),`code`).textContent=n.join(`
|
|
4
|
-
`);continue}let l=/^(#{1,6})\s+(\S.*?)\s*$/.exec(s);if(l){d(o(e,`h`+l[1].length),l[2]),r++;continue}if(s[0]===`>`&&n<8){let i=[];for(;r<t.length&&t[r][0]===`>`;)i.push(t[r++].replace(/^>\s?/,``));f(o(e,`blockquote`),i,n+1);continue}if(u(t,r)){let n=c(s),i=o(e,`table`),a=o(o(i,`thead`),`tr`);for(let e of n)d(o(a,`th`),e);r+=2;let l=null;for(;r<t.length&&t[r].indexOf(`|`)>=0&&!u(t,r);){l||=o(i,`tbody`);let e=c(t[r]),a=o(l,`tr`);for(let t=0;t<n.length;t++)d(o(a,`td`),t<e.length?e[t]:``);r++}continue}if(i.test(s)){let n=[],a;for(;r<t.length&&(a=i.exec(t[r]))!==null;)n.push({indent:a[1].length,ordered:/^\d/.test(a[2]),text:a[3]}),r++;let s=n[0].indent,c=o(e,n[0].ordered?`ol`:`ul`),l=null,u=null;for(let e of n)e.indent>s&&l?(u||=o(l,e.ordered?`ol`:`ul`),d(o(u,`li`),e.text)):(l=o(c,`li`),u=null,d(l,e.text));continue}let p=[];for(;r<t.length&&!/^\s*$/.test(t[r])&&!a.test(t[r])&&!i.test(t[r])&&!u(t,r);)p.push(t[r++]);p.length===0&&p.push(t[r++]),d(o(e,`p`),p.join(`
|
|
5
|
-
`))}}f(e,r)}var R=b({__name:`MarkdownText`,props:{text:{}},setup(e){let r=e,i=s(null);function a(){let e=i.value;if(e)try{L(e,r.text)}catch{e.textContent=r.text}}return n(a),t(()=>r.text,a),(e,t)=>(u(),h(`div`,{ref_key:`root`,ref:i,class:`md prose prose-sm prose-neutral dark:prose-invert min-w-0 max-w-none flex-1 whitespace-pre-wrap break-words font-sans text-[0.875rem] leading-normal [&_a]:font-medium [&_a]:decoration-(--ui-text-dimmed) [&_a]:underline-offset-[3px] [&_a:hover]:decoration-current [&_blockquote]:my-1.5 [&_h1]:font-medium [&_h1]:tracking-tight [&_h2]:font-medium [&_h2]:tracking-tight [&_h3]:font-medium [&_h3]:tracking-tight [&_h4]:font-medium [&_strong]:font-medium [&_li>ol]:my-0.5 [&_li>ul]:my-0.5 [&_li]:my-0.5 [&_li]:whitespace-pre-wrap [&_ol]:my-1.5 [&_ol]:whitespace-normal [&_p]:my-1.5 [&_pre]:my-2 [&_pre]:whitespace-pre [&_table]:whitespace-normal [&_ul]:my-1.5 [&_ul]:whitespace-normal`},null,512))}});function re(){let e=[],t=null,n=0,r=[];function i(e){return typeof e==`number`&&isFinite(e)?e:void 0}function a(e){return typeof e==`string`?e:``}function o(n){let r={index:e.length,calls:[]};return n&&(r.narration=n),e.push(r),t=r,r}function s(e){return e<1e3?String(e):e<1e6?(Math.round(e/100)/10).toFixed(1)+`k`:(Math.round(e/1e5)/10).toFixed(1)+`M`}function c(e){let t=/\((\d+) chars(?:, (\d+) lines)?\)$/.exec(e.summary);if(t)return t[2]?Number(t[2]):1;if(e.output)return e.output.split(`
|
|
6
|
-
`).length}function l(e){let t=[],n=e.result;if(!n)return t;n.infra?t.push(`sandbox error`):e.shell?t.push(n.exitCode===void 0?n.ok?`exit 0`:`error`:`exit `+n.exitCode):n.ok||t.push(`error`);let r=c(n);return r!==void 0&&r>1&&t.push(r+` lines`),e.durationMs!==void 0&&t.push(S(e.durationMs,`precise`)),t}function u(e,t){let n={ok:t.ok===!0,infra:t.infra===!0,summary:a(t.summary),output:a(t.output),at:i(t.at)},o=i(t.exitCode);o!==void 0&&(n.exitCode=o),e.result=n;let s=r.indexOf(e);s!==-1&&r.splice(s,1),e.status=n.infra?`infra`:n.ok?`ok`:`failed`,e.status!==`ok`&&(e.tags=e.tags.concat(e.status)),e.startedAt!==void 0&&n.at!==void 0&&n.at>=e.startedAt&&(e.durationMs=n.at-e.startedAt),e.facts=l(e)}let d=[[`tests`,/\b(npm|pnpm|yarn|bun)\s+(run\s+)?test\b|\b(vitest|jest|pytest|mocha|go test|cargo test)\b/],[`build`,/\b(npm|pnpm|yarn|bun)\s+run\s+(build|typecheck|lint)\b|\b(tsc|make|cargo build|go build|eslint|prettier)\b/],[`install`,/\b(npm|pnpm|yarn|bun)\s+(i|install|ci|add)\b|\bpip3?\s+install\b|\bapt(-get)?\s+install\b|\bbrew\s+install\b/],[`git`,/(^|[\s;&|(])(git|gh)\s/],[`network`,/(^|[\s;&|(])(curl|wget)\s/],[`read`,/(^|[\s;&|(])(cat|sed|head|tail|less|ls|find|grep|rg|wc|tree|pwd|echo|env|which|stat|file|diff)\b/]];function f(e){let t=e.replace(/^(\s*cd\s+("[^"]*"|'[^']*'|\S+)\s*(&&|;)\s*)+/,``);return t.trim()?t:e}function p(e){let t=f(e);for(let[e,n]of d)if(n.test(t))return e;return`shell`}function m(e,t){let n=t?f(e):e,r=n.indexOf(`
|
|
7
|
-
`),i=r===-1?n:n.slice(0,r).trimEnd();return i.length<e.length?i+` …`:i}function h(e,t){let o=a(e.tool),s=o===`bash`,c=t||o,l=s&&c.startsWith(`$ `)?c.slice(2):!s&&c.startsWith(o+` `)?c.slice(o.length+1):c,u={id:a(e.callId)||`c`+ ++n,tool:o,title:l,headline:m(l,s),shell:s,quiet:o===`update_status`,tags:[s?p(l):o],status:`running`,startedAt:i(e.at),facts:[]};return r.push(u),u}function g(t){for(let n=e.length-1;n>=0;n--)for(let r of e[n].calls)if(r.id===t)return{step:e[n],call:r};return null}function _(t){let n=a(t.callId);if(!n)return null;for(let t=e.length-1;t>=0;t--)for(let r of e[t].calls)if(r.id===n&&!r.result)return{step:e[t],call:r};return null}function v(e){if(!e||typeof e!=`object`)return[];let n=e;switch(n.type){case`input`:{let e={kind:`input`,text:a(n.text),messageId:a(n.messageId),at:i(n.at)},t=n.source;if(t&&typeof t==`object`){let n=t,r={};a(n.url)&&(r.url=a(n.url)),a(n.channel)&&(r.channel=a(n.channel)),a(n.user)&&(r.user=a(n.user)),a(n.run)&&(r.run=a(n.run)),Object.keys(r).length>0&&(e.source=r)}return[e]}case`answer`:return[{kind:`answer`,text:a(n.text),at:i(n.at)}];case`pr_opened`:{let e=i(n.number);return!a(n.url)||e===void 0||!Number.isInteger(e)||e<=0?[]:[{kind:`pr_opened`,url:a(n.url),number:e,created:n.created===!0,at:i(n.at)}]}case`run_meta`:{if(!a(n.agent))return[];let e={kind:`meta`,agent:a(n.agent),model:a(n.model),at:i(n.at)};return a(n.effort)&&(e.effort=a(n.effort)),a(n.repo)&&(e.repo=a(n.repo)),a(n.ref)&&(e.ref=a(n.ref)),i(n.pr)!==void 0&&Number.isInteger(n.pr)&&n.pr>0&&(e.pr=n.pr),/^[0-9a-f]{7,40}$/i.test(a(n.headSha))&&(e.headSha=a(n.headSha)),[e]}case`context`:return[{kind:`context`,text:a(n.text),at:i(n.at)}];case`reference`:{let e=i(n.messages);return!a(n.url)||!a(n.channelName)||e===void 0?[]:[{kind:`reference`,url:a(n.url),channelName:a(n.channelName),messages:e,text:a(n.text),at:i(n.at)}]}case`notes`:return[{kind:`note`,text:a(n.text),noteKind:`notes`,at:i(n.at)}];case`replay_note`:return[{kind:`replay_note`,text:a(n.summary)}];case`run_note`:return[{kind:`note`,text:a(n.summary),noteKind:a(n.kind),mode:a(n.mode)||void 0,at:i(n.at)}];case`assistant`:return[{kind:`step`,step:o({text:a(n.text),at:i(n.at)})}];case`review_artifact`:return[];case`span_start`:{let e=a(n.name),t=a(n.spanId);return!e||!t||e.startsWith(`tool.`)||e.startsWith(`mcp.`)||e===`model.turn`?[]:[{kind:`span`,spanId:t,name:e,open:!0,at:i(n.at)}]}case`span_end`:{let e=a(n.name),r=a(n.spanId),o=i(n.durationMs);if(!e||!r||o===void 0)return[];let c=n.status===`error`?`error`:`ok`,u=typeof n.attrs==`object`&&n.attrs!==null?n.attrs:{};if(e===`model.turn`){t=null;let e=[],c=i(u.inputTokens),l=i(u.outputTokens),d=i(u.cacheReadTokens);c!==void 0&&e.push(s(c)+` in`),l!==void 0&&e.push(s(l)+` out`),d!==void 0&&e.push(s(d)+` cached`);let f=i(u.ttftMs);f!==void 0&&e.push(`first token `+S(f,`precise`));let p=i(u.thinkingMs);p!==void 0&&e.push(`thinking `+S(p,`precise`));let m=i(u.textMs);m!==void 0&&e.push(`writing `+S(m,`precise`));let h=a(u.model);return[{kind:`turn`,spanId:r,label:`Thought for `+S(o,`precise`),facts:e,durationMs:o,...h?{model:h}:{},at:i(n.at)}]}if(e.startsWith(`tool.`)||e.startsWith(`mcp.`)){if(!e.startsWith(`tool.`))return[];let t=a(u.callId);if(!t)return[];let n=g(t);return!n||n.call.durationMs!==void 0?[]:(n.call.durationMs=o,n.call.facts=l(n.call),[{kind:`result`,step:n.step,call:n.call}])}let d=i(n.startedAt);return[{kind:`span`,spanId:r,name:e,open:!1,durationMs:o,status:c,at:i(n.at),...d===void 0?{}:{startedAt:d}}]}case`artifact`:{let e=a(n.key),t=a(n.name);if(!e||!t)return[];let r={key:e,name:t,size:i(n.size)??0,contentType:a(n.contentType),at:i(n.at)},o=a(n.messageId),s=a(n.callId),c=n.direction===`in`&&o?{...r,direction:`in`,messageId:o}:n.direction===`out`&&s?{...r,direction:`out`,callId:s}:void 0;return c?[{kind:`artifact`,artifact:c}]:[]}case`skill_use`:{let e=a(n.skill);if(!e)return[];let r=[];t||r.push({kind:`step`,step:o()});let s=a(n.source),c={name:e,description:a(n.description),agent:a(n.agent),bodyBytes:i(n.bodyBytes)??0,at:i(n.at)};return/^https?:\/\//.test(s)&&(c.source=s),r.push({kind:`skill`,step:t,skill:c}),r}case`tool_call`:{let e=[];t||e.push({kind:`step`,step:o()});let r=h(n,a(n.summary));return t.calls.push(r),e.push({kind:`call`,step:t,call:r}),e}case`tool_result`:{let e=_(n);if(e)return u(e.call,n),[{kind:`result`,step:e.step,call:e.call}];let r=[];t||r.push({kind:`step`,step:o()});let i=h(n,``);return i.startedAt=void 0,u(i,n),t.calls.push(i),r.push({kind:`call`,step:t,call:i}),r}default:return[]}}function y(){return r.length>0?r[0]:null}return{push:v,pending:y,steps:()=>e}}new Set(`request,slack.receive,dispatch.history,dispatch.admission,dispatch.ack_card,dispatch.gate.repo,dispatch.gate.pr_head,dispatch.workspace.attach,dispatch.gate.attached_head,dispatch.mcp_discovery,dispatch.compose,dispatch.channel_visibility,dispatch.repo_context,dispatch.memory_read,dispatch.refuse,dispatch.ship_preflight,dispatch.ledger_claim,dispatch.route,run.agent,run.command,run.reading_diff,run.settle_reviewed_head,run.description_turn,run.verdict_turn,run.observe_workspace,run.pr_post_step,run.review_post_step,run.reading_diff_join,run.pr_description_join,model.turn,ship.round,post.card_close,post.reply`.split(`,`));var ie=new Set([`slack.receive`,`dispatch.history`,`dispatch.admission`,`dispatch.ack_card`,`dispatch.gate.repo`,`dispatch.gate.pr_head`,`dispatch.workspace.attach`,`dispatch.gate.attached_head`,`dispatch.mcp_discovery`,`dispatch.compose`,`dispatch.channel_visibility`,`dispatch.repo_context`,`dispatch.memory_read`,`dispatch.refuse`,`dispatch.ship_preflight`,`dispatch.ledger_claim`,`dispatch.route`]),z=new Set([`run.observe_workspace`,`run.pr_post_step`,`run.review_post_step`,`run.reading_diff_join`,`run.pr_description_join`]),ae=new Set([`request`,`run.agent`,`ship.round`,`run.settle_reviewed_head`,`run.description_turn`,`run.verdict_turn`,`post.card_close`,`post.reply`]),oe=new Set([`run.reading_diff`]);function B(e,t){if(oe.has(e))return{kind:`background`};if(ae.has(e))return{kind:`uncounted`};if(e===`model.turn`)return{kind:`counted`,bucket:`thinking`};if(e===`run.command`||e.startsWith(`run.command.`))return{kind:`counted`,bucket:t===`command`?`tools`:`getting_ready`};if(ie.has(e)||e.startsWith(`dispatch.workspace.attach.`))return{kind:`counted`,bucket:`getting_ready`};if(z.has(e))return{kind:`counted`,bucket:`finishing_up`};if(e.startsWith(`tool.`)||e.startsWith(`mcp.`))return{kind:`counted`,bucket:`tools`}}var V={clone:`cloning the repo`,"checkout-clone":`cloning the checkout`,"worktree-clone":`cloning the worktree`,"worktree-detach":`checking out the expected commit`,"op-clone":`cloning the op tree`,fetch:`fetching the branch`,"wake-fetch":`fetching the latest commits`,"reclaim-fetch":`fetching to reclaim the mirror`,"for-each-ref":`listing the branches`,checkout:`checking out the branch`,"checkout-update":`updating the checkout`,"rev-parse":`reading the commit`,"cat-file":`checking the mirror for the commit`,"show-ref":`reading the branch tip`,"detect-default-branch":`detecting the default branch`,git:`a git command`,"git-setup":`configuring git`,"stage-perms":`securing the credential stage`,install:`installing dependencies`,build:`building`,test:`running the tests`,"clear-markers":`clearing the build markers`,"lockfile-key":`hashing the lockfile`,"deps-store-dir":`preparing the dependency store`,"deps-scratch":`cloning a scratch tree for the dependency install`,"deps-install":`installing the dependency store`,"deps-harden":`locking down the installed dependencies`,"deps-commit":`recording the installed dependencies`,"deps-adopt":`adopting the dependency store`,"deps-restore-scratch":`restoring dependencies to scratch`,"deps-restore-chown":`setting the restored dependencies' owner`,"deps-restore-commit":`recording the restored dependencies`,"deps-scratch-chown":`setting the dependency scratch owner`,"deps-evict":`evicting an old dependency store`,"unlink-deps-view":`unlinking the dependency view`,"clear-installing-marker":`clearing the install marker`,chown:`setting the workspace owner`,"worktree-chown":`setting the worktree owner`,"op-chown":`setting the op tree's owner`,"worktree-clean":`cleaning the worktree`,"clean-workspace":`cleaning the workspace`,"clean-before-restore":`cleaning before the restore`,"unmount-restores":`unmounting earlier restores`,"mirror-restore-extract":`extracting the mirror snapshot`,"checkout-restore-extract":`extracting the checkout snapshot`,"deps-restore-extract":`extracting the dependency snapshot`,evict:`evicting a stale tree`,"thread-dir":`preparing a directory`,"threads-dir":`preparing a directory`,"op-dir":`preparing a directory`,"ops-dir":`preparing a directory`,"stage-dir":`preparing a directory`,stat:`checking a file`,"boot-id":`reading the container's identity`,touch:`touching a marker`,nproc:`counting CPUs`,mutex_wait:`waiting for the workspace`,kill:`stopping the previous step`};Object.keys(V);function H(e){return Object.prototype.hasOwnProperty.call(V,e)?e:void 0}function se(e){let t=H(e);if(t!==void 0)return V[t];if(e.endsWith(`-stale-sweep`)){let t=H(e.slice(0,-12));if(t!==void 0)return`clearing leftovers before ${V[t]}`}}var U={request:`the request`,"slack.receive":`receiving`,"dispatch.history":`reading the thread`,"dispatch.admission":`checking the thread`,"dispatch.ack_card":`posting the status card`,"dispatch.gate.repo":`checking the repo`,"dispatch.gate.pr_head":`checking the PR`,"dispatch.workspace.attach":`attaching the workspace`,"dispatch.gate.attached_head":`checking out the branch`,"dispatch.mcp_discovery":`loading tools`,"dispatch.compose":`preparing the prompt`,"dispatch.channel_visibility":`checking the channel`,"dispatch.repo_context":`reading the repo's context`,"dispatch.memory_read":`recalling memory`,"dispatch.refuse":`refusing`,"dispatch.ship_preflight":`checking the ship request`,"dispatch.ledger_claim":`claiming the run's row`,"dispatch.route":`picking the preset`,"run.agent":`the agent loop`,"run.command":`the command`,"run.reading_diff":`reading the diff (in parallel)`,"run.settle_reviewed_head":`re-checking the moved branch`,"run.description_turn":`asking for the PR description`,"run.verdict_turn":`asking for the verdict`,"run.observe_workspace":`checking the workspace`,"run.pr_post_step":`posting the PR`,"run.review_post_step":`posting the review`,"run.reading_diff_join":`waiting for the diff`,"run.pr_description_join":`waiting for the PR description`,"model.turn":`a model turn`,"ship.round":`a ship round`,"post.card_close":`closing the card`,"post.reply":`posting the reply`},W=`a Switchboard step`;function G(e){if(e in U)return U[e];if(e.startsWith(`tool.`))return e.slice(5)||`a Switchboard step`;if(e.startsWith(`mcp.`)){let t=e.slice(e.lastIndexOf(`.`)+1);return t&&t!==`mcp`?t:W}for(let t of[`dispatch.workspace.attach.`,`run.command.`])if(e.startsWith(t))return se(e.slice(t.length))??`a Switchboard step`;return W}var ce=[/\bslack[\s-]?only\b/i,/\bpost\s*[:=]\s*(?:off|no|false|none)\b/i,/\bno[\s-]post\b/i,/\b(?:don['’]?t|do\s+not|never|skip|without)\s+(?:\w+\s+){0,2}?(?:post|comment)(?:ing|s)?\b/i,/\bno\s+need\s+to\s+(?:post|comment)\b/i];function le(e){return ce.some(t=>t.test(e))}var ue=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,de=/^[0-9a-f]{7,40}$/,fe=/^(?![.-])(?!.*\.\.)(?!.*\/\/)(?!.*@\{)(?!.*\.lock$)(?!.*[./]$)[\w][\w./-]*$/;function K(e){return e&&ue.test(e)?`https://github.com/${e}`:void 0}function q(e,t){let n=K(e);if(!(!n||t===void 0||!Number.isInteger(t)||t<=0))return`${n}/pull/${t}`}function pe(e,t){let n=K(e);if(n&&t&&fe.test(t))return`${n}/tree/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function me(e,t){let n=K(e);if(n&&t&&de.test(t))return`${n}/commit/${t}`}function he(e){return e.slice(0,7)}function ge(e){if(e===`slack.receive`||e.startsWith(`dispatch.`))return`getting_ready`;let t=B(e,`agent`);return t?.kind===`counted`&&t.bucket===`finishing_up`?`finishing_up`:void 0}function _e(e){return e===`request`||e===`run.agent`}var ve={getting_ready:`Getting ready`,finishing_up:`Finishing up`};function ye(e){let t=e.rows.length,n=`${t} step${t===1?``:`s`}`,r=ve[e.phase];if(t===0||e.rows.some(e=>e.open||e.at===void 0||e.durationMs===void 0))return`${r} · ${n}`;let i=Math.min(...e.rows.map(e=>e.at)),a=Math.max(...e.rows.map(e=>e.at+e.durationMs));return`${r} · ${n} · ${S(Math.max(0,a-i),`precise`)}`}function be(e){let t=e.split(`
|
|
8
|
-
`),n=t.indexOf(`<<<UNTRUSTED`),r=t.lastIndexOf(`UNTRUSTED>>>`);return(n>=0&&r>n?t.slice(n+1,r):t.slice(1)).filter(e=>e.length>0)}function xe(e,t){let n=t.split(`/`).map(encodeURIComponent).join(`/`);return`${e.urlBase}${n}${e.token?`?t=${encodeURIComponent(e.token)}`:``}`}function Se(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{fromSeq:n,toSeq:r}=t,i=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;return!i(n)||!i(r)||n>r?null:{fromSeq:n,toSeq:r}}function Ce(e){let t=e.toSeq-e.fromSeq+1,n=t===1?`event ${e.fromSeq}`:`events ${e.fromSeq}–${e.toSeq}`;return`${t} ${t===1?`event`:`events`} not loaded (${n}) — the record has them`}function we(e,t,n){let r=!!e.model&&t!==null&&Ne(e.model,t),i=r?t:e.model??t??void 0,a=!!e.model&&t!==null&&!r;return{spanId:e.spanId,label:e.label,chip:e.label.replace(/^Thought for /,``),quick:e.durationMs<6e4,durationMs:e.durationMs,facts:e.facts,...i?{model:i}:{},switched:a,showModel:!!i&&(!n||a),at:e.at}}function Te(e){let t=`${e.n} tool call${e.n===1?``:`s`}`;if(e.n===0)return`no tool calls`;if(e.ok===e.n)return`${t}, all succeeded`;if(e.running===e.n)return`${t}, all running`;let n=[];return e.bad&&n.push(`${e.bad} failed`),e.infra&&n.push(`${e.infra} sandbox error${e.infra===1?``:`s`}`),e.running&&n.push(`${e.running} still running`),`${t}, ${n.join(`, `)}`}function Ee(e){let{meta:t,prOpened:n}=e,r=t?.repo&&K(t.repo)?t.repo:void 0;if(t?.agent===`review`){if(le(e.requestText))return{text:`verdict, Slack only`};if(r&&t.pr!==void 0){let e=q(r,t.pr);return e?{text:`verdict for ${r}#${t.pr}`,href:e}:{text:`verdict`}}return{text:`verdict`}}if(t?.agent===`coding`&&n){let e=n.created?`pull request opened`:`pull request updated`,t=r?q(r,n.number):void 0;return t?{text:`${e} ${r}#${n.number}`,href:t}:{text:e}}return t?.agent===`command`?{text:`output`}:{text:`answer`}}function J(e,t){return{id:e.id,tool:e.tool,title:e.title,headline:e.headline,shell:e.shell,status:e.status,facts:[...e.facts],startedAt:e.startedAt,output:e.result?e.result.output||e.result.summary:``,hasResult:e.result!==void 0,chipOnly:!e.shell&&e.title===e.tool,durationMs:e.durationMs,exitCode:e.result?.exitCode,timedOut:E(e.result?.exitCode),open:t}}function De(e={}){let t=e.openTags&&e.openTags.length>0?e.openTags:[`failed`,`infra`],n=re(),r=f({request:null,meta:null,context:[],references:[],log:[],reply:null,prOpened:null,placeholder:!0,allOpen:!1,stopMode:null,model:null,firstAt:null,lastAt:null,lastAtWall:null,elided:[],traceVersion:0}),i=ne(),a=new Map,o=new Map,s=new Map,c=new Map,l=new Map,u=new Map,d=new Map,p=new Map,m=new Set,h=null,g=!1,_=-1,v=0,y=e=>`${e}-${v++}`;function b(e){return t.includes(`all`)?!0:e.some(e=>t.includes(e))}function S(e){let t=0,n=0,r=0;for(let i of e.items)i.kind===`call`&&(i.call.status===`failed`?t++:i.call.status===`infra`?n++:i.call.status===`running`&&r++);return{bad:t,infra:n,running:r}}function C(e){let{bad:t,infra:n,running:r}=S(e);(t||n||r)&&(e.groupOpen=!0)}function w(e){let t=o.get(_);t&&(t.live=!1),_=e.index;let n=h;h=null;let i=f({kind:`step`,key:y(`step`),index:e.index,at:e.narration?e.narration.at:n?.at,turn:n,narration:e.narration?e.narration.text:null,note:`no commentary`,items:[],live:!0,manual:!1,groupOpen:!0});return o.set(e.index,i),r.log.push(i),i}function T(e){return o.get(e.index)??w(e)}function E(e,t){let n=T(e);if(t.quiet){m.add(t.id),n.items.push({kind:`quiet`,at:t.startedAt,text:`✎ ${t.tool===`update_status`?`status checklist updated`:t.title}`}),C(n);return}let i=f(J(t,r.allOpen||b(t.tags)));u.set(t.id,i),d.set(t.id,n),n.items.push({kind:`call`,call:i}),C(n)}function D(e,t){if(m.has(t.id)){let t=o.get(e.index);t&&C(t);return}let n=u.get(t.id);if(!n){E(e,t);return}Object.assign(n,J(t,n.open)),b(t.tags)&&(n.open=!0);let r=o.get(e.index);r&&C(r)}function O(e,t){h&&=(r.log.push({kind:`turn`,key:y(`turn`),turn:h,note:e,...t===void 0?{}:{noteHref:t}}),null)}let k=new Map,A=f([]);function M(e){if(e.direction===`in`){k.get(e.messageId)?.files.push(e);return}A.push(e);let t=u.get(e.callId);t&&((t.files??=[]).push(e),t.open=!0)}function N(e){switch(r.placeholder=!1,e.kind){case`input`:{let t={text:e.text,messageId:e.messageId,at:e.at,...e.source?{source:e.source}:{},files:[]};r.request?r.log.push({kind:`followup`,key:y(`followup`),input:t}):r.request=t,k.set(t.messageId,t);return}case`step`:w(e.step);return;case`call`:E(e.step,e.call);return;case`result`:D(e.step,e.call);return;case`turn`:O(``),h=we(e,r.model,g),h.model&&(g=!0),e.model&&!(r.model!==null&&Ne(e.model,r.model))&&(r.model=e.model);return;case`meta`:r.model===null&&e.model&&(r.model=e.model),r.meta={agent:e.agent,model:e.model,...e.effort?{effort:e.effort}:{},...e.repo?{repo:e.repo}:{},...e.ref?{ref:e.ref}:{},...e.pr===void 0?{}:{pr:e.pr},...e.headSha?{headSha:e.headSha}:{}};return;case`pr_opened`:r.prOpened={url:e.url,number:e.number,created:e.created};return;case`skill`:T(e.step).items.push({kind:`skill`,skill:e.skill});return;case`artifact`:M(e.artifact);return;case`context`:r.context.push({key:y(`ctx`),at:e.at,text:e.text});return;case`reference`:r.references.push({key:y(`ref`),at:e.at,url:e.url,channelName:e.channelName,messages:e.messages,text:e.text});return;case`note`:if(e.noteKind===`follow_up`)return;r.log.push({kind:`note`,key:y(`note`),at:e.at,replay:!1,text:e.text,noteKind:e.noteKind}),(e.noteKind===`stop_requested`||e.noteKind===`stopped`)&&(e.mode===`soft`||e.mode===`hard`)&&z(e.mode);return;case`replay_note`:r.log.push({kind:`note`,key:y(`note`),replay:!0,text:e.text});return;case`span`:{if(_e(e.name)){e.name===`run.agent`&&e.open&&P(`getting_ready`);return}e.name.startsWith(`post.`)&&e.open&&P(`finishing_up`);let t=s.get(e.spanId);if(t){t.open=e.open,e.durationMs!==void 0&&(t.durationMs=e.durationMs),e.status&&(t.status=e.status);return}let n=f({kind:`span`,key:y(`span`),spanId:e.spanId,text:G(e.name),open:e.open,...e.durationMs===void 0?{}:{durationMs:e.durationMs},...e.status?{status:e.status}:{},at:e.open?e.at:e.startedAt??e.at});s.set(e.spanId,n);let i=ge(e.name);if(i){let t=l.get(i);t||(t={group:f({kind:`phase`,phase:i,key:y(i),rows:[],open:!0}),toggled:!1},l.set(i,t),r.log.push(t.group)),t.group.rows.push(n),c.set(e.spanId,t.group);return}r.log.push(n);return}case`answer`:O(`wrote the reply`,`#reply`),r.reply={text:e.text,at:e.at,files:A};return}}function P(e){let t=l.get(e);t&&!t.toggled&&(t.group.open=!1)}function F(e){let t=e,s=t?.type===`span_start`||t?.type===`span_end`;if(t&&typeof t.type==`string`){let t=e;i.push(t),j(t)&&te(a,t,``),r.traceVersion++}t&&!s&&typeof t.at==`number`&&((r.firstAt===null||t.at<r.firstAt)&&(r.firstAt=t.at),(r.lastAt===null||t.at>=r.lastAt)&&(r.lastAt=t.at,r.lastAtWall=x()));for(let t of n.push(e))N(t);let c=e;if((c?.type===`tool_call`||c?.type===`tool_result`)&&typeof c.logIndex==`number`&&!p.has(c.logIndex)){let e=(typeof c.callId==`string`?d.get(c.callId):void 0)??o.get(_);e&&p.set(c.logIndex,e)}}function ee(e){if(e.turn)return`span-${e.turn.spanId}`;let t=e.items.find(e=>e.kind===`call`);return t?.kind===`call`?`call-${t.call.id}`:void 0}function I(e){let t=p.get(e);if(!t){let n=-1;for(let[r,i]of p)r<e&&r>n&&(n=r,t=i)}if(!t)return;let n=ee(t);return n===void 0?void 0:{step:t,anchor:n}}function L(){for(let e of u.values())if(e.status===`running`)return e;return null}function R(e){r.allOpen=e;for(let t of l.values())t.group.open=e,t.toggled=!0;for(let t of u.values())t.open=e}function ie(e){if(e.startsWith(`call-`)){let t=e.slice(5),n=d.get(t);return!n||!u.has(t)?!1:(n.manual=!0,n.groupOpen=!0,!0)}if(e.startsWith(`span-`)){let t=e.slice(5),n=c.get(t);if(n){n.open=!0;let e=l.get(n.phase);return e&&(e.toggled=!0),!0}if(s.has(t))return!0;for(let e of r.log)if(e.kind===`step`&&e.turn?.spanId===t||e.kind===`turn`&&e.turn.spanId===t)return!0}return!1}function z(e){r.stopMode=e}function ae(e){r.elided.push(e),r.log.push({kind:`note`,key:y(`note`),replay:!0,text:Ce(e)}),r.placeholder=!1,r.traceVersion++}return{state:r,handle:F,noteElided:ae,spanSet:()=>[...a.values()],losses:e=>i.losses({windowStart:e,elided:r.elided}),pendingCall:L,flushPendingTurn:O,closePhases(){P(`getting_ready`),P(`finishing_up`)},setAllOpen:R,togglePhase(e){e.open=!e.open;let t=l.get(e.phase);t&&(t.toggled=!0)},reveal:ie,landing:I,callHeadline:e=>u.get(e)?.headline,toggleGroup(e){e.manual=!0,e.groupOpen=!e.groupOpen},toggleCall(e){e.open=!e.open},markStopping:z,opensByDefault:b}}function Y(e,t){return e.lastAt===null||e.lastAtWall===null?null:e.lastAt+(t-e.lastAtWall)}function Oe(e,t){return{now:n=>e.serverNow+(n-t),elapsedMs(t){return C(e,this.now(t))??0},elapsedAt(t){return C({receivedAt:e.receivedAt,startedAt:e.startedAt,finishedAt:t})??0}}}function ke(e){if(typeof e!=`string`)return{};let t;try{t=JSON.parse(e)}catch{return{}}if(typeof t!=`object`||!t)return{};let{sealedAt:n,replyOk:r}=t;return{...typeof n==`number`&&Number.isFinite(n)&&n>0?{sealedAt:n}:{},...typeof r==`boolean`?{replyOk:r}:{}}}function Ae(e){return e.replyOk===!1?`reply failed`:e.replyOk!==!0||e.finishedAt===void 0||e.sealedAt===void 0?``:`delivered in ${S(Math.max(0,e.sealedAt-e.finishedAt),`clock`)}`}function je(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{finishedAt:n}=t;return typeof n==`number`&&Number.isFinite(n)&&n>0?{finishedAt:n}:null}var X=Symbol(`sb-runner-clock`),Z=Symbol(`sb-artifact-links`),Me=Symbol(`sb-reply-landed`);function Ne(e,t){return e===t||!e.includes(`/`)!=!t.includes(`/`)&&Q(e)===Q(t)}function Q(e){if(!e)return`model`;let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1))||e}var Pe=6e4;function Fe(e,t,n){let r=Y(e,n);if(r===null||e.lastAt===null)return{kind:`starting`};if(t)return{kind:`call`,call:t,elapsedMs:Math.max(0,r-(t.startedAt??e.lastAt))};let i=Math.max(0,r-e.lastAt);return{kind:`thinking`,elapsedMs:i,slow:i>=Pe}}var Ie=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),$=65536,Le=new Set([`application/json`,`application/x-ndjson`,`application/xml`,`application/yaml`]);function Re(e){return Ie.has(e)?`image`:e.startsWith(`video/`)?`video`:e.startsWith(`audio/`)?`audio`:e.startsWith(`text/`)||Le.has(e)?`text`:`other`}var ze=[`data-open-images`],Be={class:`mb-1.5 flex items-baseline gap-2 font-mono text-[0.68rem] font-medium uppercase tracking-wider text-dimmed`},Ve={class:`count font-normal normal-case tracking-normal`},He={class:`m-0 flex list-none flex-col gap-1.5 p-0`},Ue=[`data-direction`,`data-kind`,`data-open`,`data-expired`],We={class:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 font-mono text-xs`},Ge=[`title`],Ke=[`aria-expanded`,`aria-controls`,`onClick`],qe={key:1,class:`name font-medium text-toned`},Je={class:`fact text-dimmed`},Ye={class:`fact text-dimmed`},Xe={key:2,class:`expired text-warn`},Ze=[`id`,`aria-hidden`],Qe={class:`min-h-0 overflow-hidden`},$e=[`src`,`alt`,`onError`],et=[`src`,`onError`],tt=[`src`,`onError`],nt={key:3,class:`mt-1.5`},rt={key:0,class:`text max-h-96 overflow-auto rounded border border-(--ui-border) bg-elevated p-2.5 font-mono text-xs whitespace-pre-wrap break-words text-toned`},it={key:1,class:`text-xs text-bad`},at={key:2,class:`mt-1 text-xs text-dimmed`},ot={key:4,class:`other mt-1.5 flex flex-wrap items-baseline gap-x-3 gap-y-1 font-mono text-xs text-dimmed`},st=[`href`,`download`],ct=0,lt=b({__name:`MessageFiles`,props:{files:{},openImages:{type:Boolean,default:!0}},setup(n){let i=n,o=r(Z,null),s=f(new Set),c=f(new Set),l=f(new Set),b=f(new Map);function x(){for(let e of i.files)i.openImages&&Re(e.contentType)===`image`&&!c.has(e.key)&&!l.has(e.key)&&(c.add(e.key),l.add(e.key))}x(),t(()=>[i.files,i.files.length],x),ct+=1;let S=`files-${ct}`,C=p(()=>i.files.map((e,t)=>({...e,href:o?xe(o,e.key):null,kind:Re(e.contentType),open:c.has(e.key),mounted:l.has(e.key),expired:s.has(e.key),panelId:`${S}-file-${t}`})));function w(e){if(e.href&&!e.expired){if(c.has(e.key)){c.delete(e.key);return}c.add(e.key),l.add(e.key),e.kind===`text`&&!b.has(e.key)&&T(e.key,e.href)}}async function T(e,t){b.set(e,{text:``,truncated:!1});try{let n=await fetch(t,{credentials:`same-origin`});if(n.status===410){s.add(e),b.delete(e);return}if(!n.ok||!n.body)throw Error(`HTTP ${n.status}`);let r=n.body.getReader(),i=new TextDecoder,a=``,o=0,c=!1;for(;;){let{value:e,done:t}=await r.read();if(t)break;let n=$-o,s=e.byteLength>n?e.subarray(0,n):e;if(a+=i.decode(s,{stream:!0}),o+=s.byteLength,o>=65536){c=e.byteLength>n||!(await r.read()).done,await r.cancel();break}}b.set(e,{text:a,truncated:c})}catch(t){b.set(e,{text:``,truncated:!1,error:t instanceof Error?t.message:String(t)})}}function E(e){s.add(e),c.delete(e)}let D=e=>e===`out`?`↑ sent`:`↓ received`,O=e=>e===`out`?`sent by the run`:`received from the thread`;return(t,r)=>(u(),h(`div`,{class:`files mt-3 border-t border-(--ui-border) pt-2`,"data-open-images":n.openImages?`1`:`0`},[m(`h3`,Be,[r[0]||=m(`span`,null,`Files`,-1),m(`span`,Ve,`· `+v(n.files.length)+` file`+v(n.files.length===1?``:`s`),1)]),m(`ul`,He,[(u(!0),h(a,null,g(C.value,t=>(u(),h(`li`,{key:t.key,class:`artifact`,"data-direction":t.direction,"data-kind":t.kind,"data-open":t.open?`1`:`0`,"data-expired":t.expired?`1`:`0`},[m(`div`,We,[m(`span`,{class:`dir shrink-0 select-none text-dimmed`,title:O(t.direction)},v(D(t.direction)),9,Ge),t.href&&!t.expired?(u(),h(`button`,{key:0,type:`button`,class:`name flex cursor-pointer items-baseline gap-1.5 border-0 bg-transparent p-0 font-mono text-xs font-medium text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"aria-expanded":t.open?`true`:`false`,"aria-controls":t.panelId,onClick:e=>w(t)},[m(`span`,{class:y([`chev inline-block select-none text-[0.65rem] text-dimmed transition-transform motion-reduce:transition-none`,t.open?`rotate-90`:``]),"aria-hidden":`true`},`❯`,2),m(`span`,null,v(t.name),1)],8,Ke)):(u(),h(`span`,qe,v(t.name),1)),m(`span`,Je,v(_(k)(t.size)),1),m(`span`,Ye,v(t.contentType),1),t.expired&&_(o)?(u(),h(`span`,Xe,`expired after `+v(_(o).retentionDays)+` days`,1)):d(``,!0)]),t.href&&!t.expired?(u(),h(`div`,{key:0,id:t.panelId,class:`panel grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`,style:e({gridTemplateRows:t.open?`1fr`:`0fr`}),"aria-hidden":t.open?`false`:`true`},[m(`div`,Qe,[t.mounted?(u(),h(a,{key:0},[t.kind===`image`?(u(),h(`img`,{key:0,class:`preview mt-1.5 max-h-96 max-w-full rounded border border-(--ui-border)`,src:t.href,alt:t.name,loading:`lazy`,onError:e=>E(t.key)},null,40,$e)):t.kind===`video`?(u(),h(`video`,{key:1,class:`preview mt-1.5 max-h-96 max-w-full rounded border border-(--ui-border) bg-black`,src:t.href,controls:``,playsinline:``,preload:`auto`,onError:e=>E(t.key)},null,40,et)):t.kind===`audio`?(u(),h(`audio`,{key:2,class:`preview mt-1.5 w-full max-w-xl`,src:t.href,controls:``,preload:`auto`,onError:e=>E(t.key)},null,40,tt)):t.kind===`text`?(u(),h(`div`,nt,[b.get(t.key)&&!b.get(t.key).error?(u(),h(`pre`,rt,v(b.get(t.key).text),1)):d(``,!0),b.get(t.key)?.error?(u(),h(`p`,it,` could not read the file: `+v(b.get(t.key).error),1)):b.get(t.key)?.truncated?(u(),h(`p`,at,` showing the first `+v(_(k)(_($)))+` of `+v(_(k)(t.size)),1)):d(``,!0)])):(u(),h(`div`,ot,[m(`span`,null,`no preview for `+v(t.contentType),1),m(`a`,{class:`download inline-block rounded border border-default px-2 py-0.5 font-medium text-toned no-underline hover:bg-accented hover:text-primary focus-visible:outline-2 focus-visible:outline-primary`,href:t.href,download:t.name},`Download `+v(_(k)(t.size)),9,st)]))],64)):d(``,!0)])],12,Ze)):d(``,!0)],8,Ue))),128))])],8,ze))}}),ut=[`id`,`open`,`title`,`data-status`,`data-heat`],dt={key:0,class:`spin inline-block size-[0.7em] shrink-0 animate-spin self-center rounded-full border-2 border-accented border-t-info motion-reduce:animate-none`,role:`img`,"aria-label":`running`},ft={key:2,class:`dollar shrink-0 select-none text-dimmed`},pt={key:3,class:`tool shrink-0 rounded bg-accented px-1.5 text-xs leading-normal text-muted`},mt={key:0,class:`cmd brief min-w-0 flex-1 truncate text-info`},ht={key:1,class:`cmd full min-w-0 flex-1 whitespace-pre-wrap break-words text-info max-sm:order-last max-sm:basis-full`},gt={key:5,class:`cmd min-w-0 flex-1`},_t={class:`facts ml-auto flex shrink-0 gap-2.5 text-xs tabular-nums text-muted`},vt={key:0,class:`fact elapsed`,title:`since this call started (runner clock)`},yt={key:0,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},bt={key:1,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},xt={class:`body`},St={key:1,class:`none px-3 py-1.5 text-xs italic text-dimmed`},Ct={key:2,class:`none px-3 py-1.5 text-xs italic text-dimmed`},wt=b({__name:`CallCard`,props:{call:{}},setup(t){let n=t,o=r(X,null),s=r(Me,null),l=p(()=>{let e=o?.value;return n.call.status!==`running`||typeof e!=`number`||n.call.startedAt===void 0?``:S(Math.max(0,e-n.call.startedAt),`clock`)}),f=p(()=>D(n.call.durationMs,`tool`,n.call.timedOut)),b=p(()=>T(f.value)),x=p(()=>n.call.durationMs===void 0?-1:n.call.facts.length-1);function C(){n.call.open=!n.call.open}return(n,r)=>(u(),h(`details`,{id:`call-${t.call.id}`,class:y([`call rounded-lg border border-default bg-elevated font-mono open:bg-accented`,t.call.status]),open:t.call.open,title:typeof t.call.startedAt==`number`?`started ${_(w)(t.call.startedAt)}`:void 0,"data-status":t.call.status,"data-heat":f.value.level},[m(`summary`,{class:y([`flex min-w-0 cursor-pointer list-none items-baseline gap-3 rounded-lg pl-3 pr-[calc(var(--sb-gutter)-1px)] py-2 hover:bg-accented/60 focus-visible:outline-2 focus-visible:outline-primary max-sm:flex-wrap [&::-webkit-details-marker]:hidden`,t.call.open?`rounded-b-none border-b border-default`:``]),onClick:i(C,[`prevent`])},[m(`span`,{class:y([`chev shrink-0 select-none text-xs text-dimmed transition-transform motion-reduce:transition-none`,t.call.open?`rotate-90`:``])},`❯`,2),t.call.status===`running`?(u(),h(`span`,dt)):(u(),h(`span`,{key:1,class:y([`glyph w-[1em] shrink-0 text-center font-medium`,t.call.status===`ok`?`text-ok`:t.call.status===`failed`?`text-bad`:`text-warn`])},v(t.call.status===`ok`?`✓`:t.call.status===`failed`?`✗`:`⚠`),3)),t.call.shell?(u(),h(`span`,ft,`$`)):(u(),h(`span`,pt,v(t.call.tool),1)),t.call.chipOnly?(u(),h(`span`,gt)):(u(),h(a,{key:4},[t.call.open?(u(),h(`code`,ht,v(t.call.title),1)):(u(),h(`code`,mt,v(t.call.headline),1))],64)),m(`span`,_t,[l.value?(u(),h(`span`,vt,v(l.value),1)):d(``,!0),(u(!0),h(a,null,g(t.call.facts,(n,r)=>(u(),h(a,{key:r},[r===x.value&&f.value.over?(u(),h(`span`,yt,`timed out`)):d(``,!0),m(`span`,{class:y([`fact`,[t.call.status!==`ok`&&r===0?`text-bad`:``,r===x.value&&f.value.over?`font-medium text-bad`:``,r===x.value&&b.value?`heat`:``,r===x.value&&f.value.level>=2&&!f.value.over?`font-medium`:``]]),style:e(r===x.value?b.value:void 0)},v(n),7)],64))),128)),f.value.over&&x.value===-1?(u(),h(`span`,bt,`timed out`)):d(``,!0)])],2),m(`div`,xt,[t.call.hasResult&&t.call.output?(u(),h(`pre`,{key:0,class:y([`out max-h-[28rem] overflow-auto whitespace-pre-wrap break-words px-3.5 py-2.5 font-mono leading-normal`,t.call.status===`failed`?`text-bad`:`text-toned`])},v(t.call.output),3)):t.call.hasResult?(u(),h(`div`,St,`no output`)):(u(),h(`div`,Ct,`no output yet`)),t.call.files&&t.call.files.length>0?(u(),c(lt,{key:3,class:`mx-3.5 mb-2.5`,files:t.call.files,"open-images":!_(s)},null,8,[`files`,`open-images`])):d(``,!0)])],10,ut))}}),Tt=[`title`],Et=[`title`],Dt={class:`skillname whitespace-nowrap font-mono font-medium text-skill`},Ot={key:0,class:`skilldesc min-w-0 flex-1 truncate text-xs text-muted`},kt={class:`facts ml-auto flex shrink-0 gap-2.5 font-mono text-xs text-muted`},At=[`href`],jt={class:`fact`},Mt=b({__name:`StepItems`,props:{items:{}},setup(e){return(t,n)=>(u(!0),h(a,null,g(e.items,(e,t)=>(u(),h(a,{key:t},[e.kind===`call`?(u(),c(wt,{key:0,call:e.call},null,8,[`call`])):e.kind===`quiet`?(u(),h(`div`,{key:1,class:`quiet flex items-baseline gap-3 pl-3 pr-(--sb-gutter) py-0.5 font-mono text-xs text-dimmed`,title:e.at===void 0?void 0:_(w)(e.at)},[m(`span`,null,v(e.text),1)],8,Tt)):(u(),h(`div`,{key:2,class:`skill flex items-baseline gap-2.5 pl-3 pr-(--sb-gutter) py-0.5`,title:e.skill.at===void 0?void 0:_(w)(e.skill.at)},[n[0]||=m(`span`,{class:`skillmark shrink-0 select-none text-xs`},`📚`,-1),m(`span`,Dt,`skill `+v(e.skill.name),1),e.skill.description?(u(),h(`span`,Ot,v(e.skill.description),1)):d(``,!0),m(`span`,kt,[e.skill.source?(u(),h(`a`,{key:0,class:`fact text-primary hover:underline`,href:e.skill.source,target:`_blank`,rel:`noopener noreferrer`},`source`,8,At)):d(``,!0),m(`span`,jt,v(_(k)(e.skill.bodyBytes))+` into context`,1)])],8,Et))],64))),128))}}),Nt=[`id`,`data-live`],Pt={class:`head flex items-baseline gap-x-6 pb-1.5 pr-(--sb-gutter)`},Ft={class:`min-w-0 flex-1`},It={key:0,class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 font-mono text-xs tabular-nums text-dimmed`},Lt=[`data-heat`,`title`],Rt=[`title`],zt=[`title`],Bt={key:2,class:`nonar font-sans text-sm italic text-dimmed`},Vt=[`title`],Ht={key:0,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},Ut={key:1,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},Wt={class:`nonar flex-1 font-sans text-sm italic text-dimmed`},Gt={class:`calls flex flex-col gap-2`},Kt=[`open`,`data-group-open`],qt=[`title`],Jt=[`data-ok`,`data-bad`,`data-infra`,`data-running`],Yt=[`data-heat`],Xt={class:`gbody flex flex-col gap-2 pb-1 pt-1.5`},Zt=b({__name:`StepBlock`,props:{step:{}},emits:[`toggleGroup`],setup(t,{emit:n}){let r=t,s=n,f=p(()=>r.step.items.filter(e=>e.kind===`call`)),b=p(()=>f.value.length>=2),x=p(()=>{let e=0,t=0,n=0,r=0,i=0;for(let a of f.value){if(a.kind!==`call`)continue;let o=a.call;o.status===`ok`?e++:o.status===`failed`?t++:o.status===`infra`?n++:r++,typeof o.durationMs==`number`&&(i+=o.durationMs)}return{n:e+t+n+r,ok:e,bad:t,infra:n,running:r,ms:i}}),C=p(()=>Te(x.value)),E=p(()=>f.value.some(e=>e.kind===`call`&&e.call.timedOut)),k=p(()=>D(x.value.ms,`tool`,E.value)),A=p(()=>T(k.value)),j=p(()=>r.step.turn?D(r.step.turn.durationMs,`turn`):void 0),M=p(()=>j.value?T(j.value):void 0),N=p(()=>{let e=f.value[0];return e?.kind===`call`?e.call.startedAt:void 0});return(n,r)=>(u(),h(`li`,{id:t.step.turn?`span-${t.step.turn.spanId}`:void 0,class:y([`step relative border-l-2 pb-3 pl-3 pt-2`,t.step.live?`border-ok/40`:`border-(--ui-border-accented)/50`]),"data-live":t.step.live?`1`:void 0},[m(`div`,Pt,[m(`div`,Ft,[t.step.turn?(u(),h(`div`,It,[m(`span`,{class:y([`thought`,[M.value?`heat`:``,j.value&&j.value.level>=2?`font-medium`:``]]),style:e(M.value),"data-heat":j.value?.level,title:t.step.turn.label},`thought `+v(t.step.turn.chip),15,Lt),t.step.turn.switched?(u(),h(`span`,{key:0,class:`model-switch order-first rounded border border-warn/40 bg-warn/10 px-1.5 font-medium text-warn`,title:`model changed: this turn ran on ${t.step.turn.model}`},`⇄ `+v(_(Q)(t.step.turn.model)),9,Rt)):t.step.turn.showModel?(u(),h(`span`,{key:1,class:`model-badge order-first rounded bg-accented px-1.5 text-[0.68rem] font-medium leading-normal tracking-wider text-muted`,title:t.step.turn.model},v(_(Q)(t.step.turn.model)),9,zt)):d(``,!0),(u(!0),h(a,null,g(t.step.turn.facts,(e,t)=>(u(),h(`span`,{key:t,class:`fact`},v(e),1))),128))])):t.step.narration===null?(u(),h(`span`,Bt,v(t.step.note),1)):(u(),c(R,{key:1,text:t.step.narration},null,8,[`text`]))]),t.step.at===void 0?d(``,!0):(u(),h(`span`,{key:0,class:`ts shrink-0 select-none font-mono text-xs tabular-nums text-dimmed`,title:_(w)(t.step.at)},v(_(O)(t.step.at)),9,Vt))]),t.step.turn&&t.step.narration!==null?(u(),h(`div`,Ht,[o(R,{text:t.step.narration},null,8,[`text`])])):t.step.turn&&t.step.narration===null&&!t.step.turn.facts.length?(u(),h(`div`,Ut,[m(`span`,Wt,v(t.step.note),1)])):d(``,!0),m(`div`,Gt,[b.value?(u(),h(`details`,{key:1,class:`grp`,open:t.step.groupOpen,"data-group-open":t.step.groupOpen?`1`:`0`},[m(`summary`,{class:`gsummary flex cursor-pointer list-none items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1 font-mono text-xs text-dimmed hover:bg-accented/40 hover:text-muted focus-visible:outline-2 focus-visible:outline-primary [&::-webkit-details-marker]:hidden`,title:typeof N.value==`number`?`calls began ${_(w)(N.value)}`:void 0,onClick:r[0]||=i(e=>s(`toggleGroup`),[`prevent`])},[m(`span`,{class:y([`gchev shrink-0 select-none transition-transform motion-reduce:transition-none`,t.step.groupOpen?`rotate-90`:``])},`❯`,2),m(`span`,{class:y([`gcount`,x.value.bad||x.value.infra?`text-bad`:``]),"data-ok":x.value.ok,"data-bad":x.value.bad,"data-infra":x.value.infra,"data-running":x.value.running},v(C.value),11,Jt),x.value.ms>0?(u(),h(`span`,{key:0,class:y([`gtime ml-auto tabular-nums`,[A.value?`heat`:``,k.value.over?`font-medium text-bad`:k.value.level>=2?`font-medium`:``]]),style:e(A.value),"data-heat":k.value.level},[k.value.over?(u(),h(a,{key:0},[l(`timed out · `)],64)):d(``,!0),l(v(_(S)(x.value.ms,`clock`)),1)],14,Yt)):d(``,!0)],8,qt),m(`div`,Xt,[o(Mt,{items:t.step.items},null,8,[`items`])])],8,Kt)):(u(),c(Mt,{key:0,items:t.step.items},null,8,[`items`]))])],10,Nt))}});function Qt(e){let t=[];for(let n of e.split(/\r?\n\r?\n/)){let e=n.split(/\r?\n/);if(e.some(e=>e.startsWith(`event:`)))continue;let r=e.filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).replace(/^ /,``)).join(`
|
|
9
|
-
`);if(r!==``)try{let e=JSON.parse(r);typeof e==`object`&&e&&typeof e.type==`string`&&t.push(e)}catch{}}return t}export{he as C,F as D,R as E,O,pe as S,B as T,Ee as _,Me as a,q as b,De as c,Q as d,ke as f,be as g,ye as h,Z as i,Ae as l,Se as m,Zt as n,X as o,je as p,lt as r,Oe as s,Qt as t,Fe as u,Y as v,G as w,K as x,me as y};
|