@coreplane/switchboard 1.260.0 → 1.260.2

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.
Files changed (49) hide show
  1. package/bin/switchboard.js +15 -11
  2. package/dist/assets/config/config.example.yaml +1 -0
  3. package/dist/assets/deploy/cloudflare/worker.ts +17 -56
  4. package/dist/assets/deploy/cloudflare/wrangler.template.jsonc +6 -0
  5. package/dist/assets/deploy/cloudflare-memory/backgroundTasks.ts +25 -0
  6. package/dist/assets/deploy/cloudflare-memory/worker.ts +36 -16
  7. package/dist/assets/deploy/cloudflare-resident/worker.ts +39 -18
  8. package/dist/assets/deploy/profile.example.json +2 -1
  9. package/dist/assets/package-lock.json +3 -3
  10. package/dist/assets/package.json +1 -1
  11. package/dist/assets/source.json +3 -3
  12. package/dist/assets/src/agents/registry.ts +2 -2
  13. package/dist/assets/src/core/budgets.ts +19 -6
  14. package/dist/assets/src/core/coordinator/driver.ts +47 -9
  15. package/dist/assets/src/core/pipelineStanding.ts +2 -0
  16. package/dist/assets/src/core/reviewedHead.ts +16 -2
  17. package/dist/assets/src/core/runEvents.ts +9 -1
  18. package/dist/assets/src/core/runLedger/types.ts +3 -3
  19. package/dist/assets/src/core/runRecord.ts +28 -8
  20. package/dist/assets/src/core/ship/coordinator.ts +248 -44
  21. package/dist/assets/src/core/ship/renewal.ts +2 -0
  22. package/dist/assets/src/deploy/liveGate.ts +8 -0
  23. package/dist/assets/src/deploy/profile.ts +8 -0
  24. package/dist/assets/src/deploy/restart.ts +49 -35
  25. package/dist/assets/web/dist/.vite/manifest.json +67 -67
  26. package/dist/assets/web/dist/assets/{DeliveryPage-DvMrWUg7.js → DeliveryPage-62qCSLvk.js} +1 -1
  27. package/dist/assets/web/dist/assets/{HomePage-CcGEJ4w0.js → HomePage-Dk3HRBc3.js} +1 -1
  28. package/dist/assets/web/dist/assets/{PendingTurnRow-BzGVxDYs.js → PendingTurnRow-CeTGOXUy.js} +1 -1
  29. package/dist/assets/web/dist/assets/{PlanePage-Arj9cyd5.js → PlanePage-RD0M6O6W.js} +1 -1
  30. package/dist/assets/web/dist/assets/{ResidentDetailPage-CBPPe4Sj.js → ResidentDetailPage-Dl2KId95.js} +1 -1
  31. package/dist/assets/web/dist/assets/{ResidentsIndexPage-CEpXgGo7.js → ResidentsIndexPage-DBy43I1R.js} +1 -1
  32. package/dist/assets/web/dist/assets/{RunFoldRow-BJq7tnLr.js → RunFoldRow-CwHDL-Mo.js} +1 -1
  33. package/dist/assets/web/dist/assets/{RunRoutePage-DWiny7LN.js → RunRoutePage-Du1HqLZs.js} +3 -3
  34. package/dist/assets/web/dist/assets/{RunsIndexPage-Cxufw5sV.js → RunsIndexPage-BZphy3Hr.js} +1 -1
  35. package/dist/assets/web/dist/assets/{ScheduledPage-SBcuDdVg.js → ScheduledPage-B7jh898t.js} +1 -1
  36. package/dist/assets/web/dist/assets/{SettingsPage-DrD_vWdp.js → SettingsPage-3uLEsiiE.js} +1 -1
  37. package/dist/assets/web/dist/assets/{SilentTurn-Bjl7EPEN.js → SilentTurn-CKxSxnQC.js} +1 -1
  38. package/dist/assets/web/dist/assets/{StatusDot-BqteQTav.js → StatusDot-x7vcK0iE.js} +1 -1
  39. package/dist/assets/web/dist/assets/{Tooltip-KRqJXEPN.js → Tooltip-wVXCWhMp.js} +1 -1
  40. package/dist/assets/web/dist/assets/{UnitRoutePage-Cv28FV4I.js → UnitRoutePage-V5BXK7FH.js} +1 -1
  41. package/dist/assets/web/dist/assets/budgets-KNNkT4PZ.js +1 -0
  42. package/dist/assets/web/dist/assets/{dist-CTASUSno.js → dist-C-XGnvM4.js} +1 -1
  43. package/dist/assets/web/dist/assets/{indexRow-B1YBy_IL.js → indexRow-Dxg7C8s9.js} +1 -1
  44. package/dist/assets/web/dist/assets/{main-eTAe9-hk.js → main-DAL--hyj.js} +2 -2
  45. package/dist/assets/web/dist/assets/sseReplay-BqgOggyQ.js +11 -0
  46. package/dist/cli.js +1405 -436
  47. package/package.json +1 -1
  48. package/dist/assets/web/dist/assets/budgets-DQXVllsm.js +0 -1
  49. package/dist/assets/web/dist/assets/sseReplay-BcsNbn2j.js +0 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreplane/switchboard",
3
- "version": "1.260.0",
3
+ "version": "1.260.2",
4
4
  "description": "Mention it in Slack and an agent reviews the PR, ships the fix, or answers the question — on the model you choose, with its tools running where you decide.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://openswitchboard.dev",
@@ -1 +0,0 @@
1
- var e=6e4,t=t=>t*e,n=1440*e;7*n,10*e,15*e,5*e,60*e,10*e,60*e,30*n,10*e;var r={general:2,coding:15,review:5,research:3,explore:15,conductor:15,orchestrator:2};r.coding,r.coding,r.review;var i={marginMinutes:5,chunkMinutes:5,mergeChunkMinutes:5,busyRetryMinutes:2};t(i.chunkMinutes);export{i as n,t as r,e as t};
@@ -1,11 +0,0 @@
1
- import{An as e,Cn as t,Cr as n,Gr as r,Ii as i,Li as a,Mn as o,Pi as s,Sn as c,Zn as l,_r as u,bn as d,dr as f,ji as p,kn as m,ln as h,rn as g,xi as _,xn as v,yi as y,yn as b}from"./browser-B6T5hjfR.js";import{n as x}from"./wallClock-DmaC1sKA.js";import{B as S,G as C,H as w,K as T,V as E,W as D}from"./indexRow-B1YBy_IL.js";import{i as O,n as k,t as A}from"./format-BldUwl_R.js";import{n as j,r as M,t as N}from"./durationTone-CVpX_yIk.js";function P(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 F=o({__name:`MarkdownText`,props:{text:{}},setup(e){let n=e,i=_(null);function a(){let e=i.value;if(e)try{P(e,n.text)}catch{e.textContent=n.text}}return f(a),r(()=>n.text,a),(e,n)=>(u(),t(`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))}}),I=[`user`,`channel`,`defaults`];function L(e){return typeof e==`string`&&I.includes(e)}function ee(){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(T(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`pushed_head`:return!a(n.ref)||!a(n.sha)?[]:[{kind:`pushed_head`,ref:a(n.ref),sha:a(n.sha),at:i(n.at)}];case`ship_unit`:{if(!a(n.unit)||!a(n.state))return[];let e=a(n.report)||a(n.lead);return[{kind:`step`,step:o({text:`**${a(n.unit)} · ${a(n.state)}**${e?`
8
-
9
- `+e:``}`,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.harness)&&(e.harness=a(n.harness)),L(n.harnessScope)&&(e.harnessScope=n.harnessScope),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 `+T(f,`precise`));let p=i(u.thinkingMs);p!==void 0&&e.push(`thinking `+T(p,`precise`));let m=i(u.textMs);m!==void 0&&e.push(`writing `+T(m,`precise`));let h=a(u.model);return[{kind:`turn`,spanId:r,label:`Thought for `+T(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}}var R={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`,"checkout-stage":`staging the checkout rebuild`,"checkout-stage-clear":`removing the leftover staging tree`,"checkout-swap":`swapping in the rebuilt checkout`,"checkout-retire":`removing the replaced 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`,"break-mirror":`removing the mirror's config (fault injection)`,"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(R);function z(e){return Object.prototype.hasOwnProperty.call(R,e)?e:void 0}function B(e){let t=z(e);if(t!==void 0)return R[t];if(e.endsWith(`-stale-sweep`)){let t=z(e.slice(0,-12));if(t!==void 0)return`clearing leftovers before ${R[t]}`}}var V={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`},H=`a Switchboard step`;function U(e){if(e in V)return V[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:H}for(let t of[`dispatch.workspace.attach.`,`run.command.`])if(e.startsWith(t))return B(e.slice(t.length))??`a Switchboard step`;return H}var W=[/\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 G(e){return W.some(t=>t.test(e))}var K=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,te=/^[0-9a-f]{7,40}$/,ne=/^(?![.-])(?!.*\.\.)(?!.*\/\/)(?!.*@\{)(?!.*\.lock$)(?!.*[./]$)[\w][\w./-]*$/;function q(e){return e&&K.test(e)?`https://github.com/${e}`:void 0}function J(e,t){let n=q(e);if(!(!n||t===void 0||!Number.isInteger(t)||t<=0))return`${n}/pull/${t}`}function re(e,t){let n=q(e);if(n&&t&&ne.test(t))return`${n}/tree/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function ie(e,t){let n=q(e);if(n&&t&&te.test(t))return`${n}/commit/${t}`}function ae(e){return e.slice(0,7)}function oe(e){if(e===`slack.receive`||e.startsWith(`dispatch.`))return`getting_ready`;let t=S(e,`agent`);return t?.kind===`counted`&&t.bucket===`finishing_up`?`finishing_up`:void 0}function se(e){return e===`request`||e===`run.agent`}var ce={getting_ready:`Getting ready`,finishing_up:`Finishing up`};function le(e){let t=e.rows.length,n=`${t} step${t===1?``:`s`}`,r=ce[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} · ${T(Math.max(0,a-i),`precise`)}`}function ue(e){let t=e.split(`
10
- `),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 de(e,t){let n=t.split(`/`).map(encodeURIComponent).join(`/`);return`${e.urlBase}${n}${e.token?`?t=${encodeURIComponent(e.token)}`:``}`}function fe(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 pe(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 me(e,t,n){let r=!!e.model&&t!==null&&Ce(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 he(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 ge(e){let{meta:t,prOpened:n}=e,r=t?.repo&&q(t.repo)?t.repo:void 0;if(t?.agent===`review`){if(G(e.requestText))return{text:`verdict, Slack only`};if(r&&t.pr!==void 0){let e=J(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?J(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 Y(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:M(e.result?.exitCode),open:t}}function _e(e={}){let t=e.openTags&&e.openTags.length>0?e.openTags:[`failed`,`infra`],n=ee(),r=y({request:null,meta:null,context:[],references:[],log:[],reply:null,prOpened:null,placeholder:!0,allOpen:!1,stopMode:null,model:null,firstAt:null,lastAt:null,clockAt:null,clockWall:null,elided:[],traceVersion:0}),i=E(),a=new Map,o=new Map,s=new Map,c=new Map,l=new Map,u=new Map,d=new Map,f=new Map,p=new Set,m=null,h=!1,g=-1,_=0,v=e=>`${e}-${_++}`;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 T(e){let t=o.get(g);t&&(t.live=!1),g=e.index;let n=m;m=null;let i=y({kind:`step`,key:v(`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 O(e){return o.get(e.index)??T(e)}function k(e,t){let n=O(e);if(t.quiet){p.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=y(Y(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 A(e,t){if(p.has(t.id)){let t=o.get(e.index);t&&C(t);return}let n=u.get(t.id);if(!n){k(e,t);return}Object.assign(n,Y(t,n.open)),b(t.tags)&&(n.open=!0);let r=o.get(e.index);r&&C(r)}function j(e,t){m&&=(r.log.push({kind:`turn`,key:v(`turn`),turn:m,note:e,...t===void 0?{}:{noteHref:t}}),null)}let M=new Map,N=y([]);function P(e){if(e.direction===`in`){M.get(e.messageId)?.files.push(e);return}N.push(e);let t=u.get(e.callId);t&&((t.files??=[]).push(e),t.open=!0)}function F(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:v(`followup`),input:t}):r.request=t,M.set(t.messageId,t);return}case`step`:T(e.step);return;case`call`:k(e.step,e.call);return;case`result`:A(e.step,e.call);return;case`turn`:j(``),m=me(e,r.model,h),m.model&&(h=!0),e.model&&!(r.model!==null&&Ce(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.harness?{harness:e.harness}:{},...e.harnessScope?{harnessScope:e.harnessScope}:{},...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`:O(e.step).items.push({kind:`skill`,skill:e.skill});return;case`artifact`:P(e.artifact);return;case`context`:r.context.push({key:v(`ctx`),at:e.at,text:e.text});return;case`reference`:r.references.push({key:v(`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:v(`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`)&&G(e.mode);return;case`replay_note`:r.log.push({kind:`note`,key:v(`note`),replay:!0,text:e.text});return;case`span`:{if(se(e.name)){e.name===`run.agent`&&e.open&&L(`getting_ready`);return}e.name.startsWith(`post.`)&&e.open&&L(`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=y({kind:`span`,key:v(`span`),spanId:e.spanId,text:U(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=oe(e.name);if(i){let t=l.get(i);t||(t={group:y({kind:`phase`,phase:i,key:v(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`:j(`wrote the reply`,`#reply`),r.reply={text:e.text,at:e.at,files:N};return}}function I(e){let t=x(),n=r.clockAt===null||r.clockWall===null?null:r.clockAt+(t-r.clockWall);(n===null||e>=n)&&(r.clockAt=e,r.clockWall=t)}function L(e){let t=l.get(e);t&&!t.toggled&&(t.group.open=!1)}function R(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),D(t)&&w(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),I(t.at));for(let t of n.push(e))F(t);let c=e;if((c?.type===`tool_call`||c?.type===`tool_result`)&&typeof c.logIndex==`number`&&!f.has(c.logIndex)){let e=(typeof c.callId==`string`?d.get(c.callId):void 0)??o.get(g);e&&f.set(c.logIndex,e)}}function z(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 B(e){let t=f.get(e);if(!t){let n=-1;for(let[r,i]of f)r<e&&r>n&&(n=r,t=i)}if(!t)return;let n=z(t);return n===void 0?void 0:{step:t,anchor:n}}function V(){for(let e of u.values())if(e.status===`running`)return e;return null}function H(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 W(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 G(e){r.stopMode=e}function K(e){r.elided.push(e),r.log.push({kind:`note`,key:v(`note`),replay:!0,text:pe(e)}),r.placeholder=!1,r.traceVersion++}return{state:r,handle:R,noteElided:K,spanSet:()=>[...a.values()],losses:e=>i.losses({windowStart:e,elided:r.elided}),pendingCall:V,flushPendingTurn:j,closePhases(){L(`getting_ready`),L(`finishing_up`)},setAllOpen:H,togglePhase(e){e.open=!e.open;let t=l.get(e.phase);t&&(t.toggled=!0)},reveal:W,landing:B,callHeadline:e=>u.get(e)?.headline,toggleGroup(e){e.manual=!0,e.groupOpen=!e.groupOpen},toggleCall(e){e.open=!e.open},markStopping:G,opensByDefault:b,seedClock:I}}function X(e,t){return e.clockAt===null||e.clockWall===null?null:e.clockAt+(t-e.clockWall)}function ve(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 ye(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 be(e){return e.replyOk===!1?`reply failed`:e.replyOk!==!0||e.finishedAt===void 0||e.sealedAt===void 0?``:`delivered in ${T(Math.max(0,e.sealedAt-e.finishedAt),`clock`)}`}function xe(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 Z=Symbol(`sb-runner-clock`),Q=Symbol(`sb-artifact-links`),Se=Symbol(`sb-reply-landed`);function Ce(e,t){return e===t||!e.includes(`/`)!=!t.includes(`/`)&&$(e)===$(t)}function $(e){if(!e)return`model`;let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1))||e}var we=6e4;function Te(e,t,n){let r=X(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>=we}}var Ee=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),De=65536,Oe=new Set([`application/json`,`application/x-ndjson`,`application/xml`,`application/yaml`]);function ke(e){return Ee.has(e)?`image`:e.startsWith(`video/`)?`video`:e.startsWith(`audio/`)?`audio`:e.startsWith(`text/`)||Oe.has(e)?`text`:`other`}var Ae=[`data-open-images`],je={class:`mb-1.5 flex items-baseline gap-2 font-mono text-[0.68rem] font-medium uppercase tracking-wider text-dimmed`},Me={class:`count font-normal normal-case tracking-normal`},Ne={class:`m-0 flex list-none flex-col gap-1.5 p-0`},Pe=[`data-direction`,`data-kind`,`data-open`,`data-expired`],Fe={class:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 font-mono text-xs`},Ie=[`title`],Le=[`aria-expanded`,`aria-controls`,`onClick`],Re={key:1,class:`name font-medium text-toned`},ze={class:`fact text-dimmed`},Be={class:`fact text-dimmed`},Ve={key:2,class:`expired text-warn`},He=[`id`,`aria-hidden`],Ue={class:`min-h-0 overflow-hidden`},We=[`src`,`alt`,`onError`],Ge=[`src`,`onError`],Ke=[`src`,`onError`],qe={key:3,class:`mt-1.5`},Je={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`},Ye={key:1,class:`text-xs text-bad`},Xe={key:2,class:`mt-1 text-xs text-dimmed`},Ze={key:4,class:`other mt-1.5 flex flex-wrap items-baseline gap-x-3 gap-y-1 font-mono text-xs text-dimmed`},Qe=[`href`,`download`],$e=0,et=o({__name:`MessageFiles`,props:{files:{},openImages:{type:Boolean,default:!0}},setup(e){let o=e,f=l(Q,null),m=y(new Set),g=y(new Set),_=y(new Set),v=y(new Map);function x(){for(let e of o.files)o.openImages&&ke(e.contentType)===`image`&&!g.has(e.key)&&!_.has(e.key)&&(g.add(e.key),_.add(e.key))}x(),r(()=>[o.files,o.files.length],x),$e+=1;let S=`files-${$e}`,C=b(()=>o.files.map((e,t)=>({...e,href:f?de(f,e.key):null,kind:ke(e.contentType),open:g.has(e.key),mounted:_.has(e.key),expired:m.has(e.key),panelId:`${S}-file-${t}`})));function w(e){if(e.href&&!e.expired){if(g.has(e.key)){g.delete(e.key);return}g.add(e.key),_.add(e.key),e.kind===`text`&&!v.has(e.key)&&T(e.key,e.href)}}async function T(e,t){v.set(e,{text:``,truncated:!1});try{let n=await fetch(t,{credentials:`same-origin`});if(n.status===410){m.add(e),v.delete(e);return}if(!n.ok||!n.body)throw Error(`HTTP ${n.status}`);let r=n.body.getReader(),i=new TextDecoder,a=``,o=0,s=!1;for(;;){let{value:e,done:t}=await r.read();if(t)break;let n=De-o,c=e.byteLength>n?e.subarray(0,n):e;if(a+=i.decode(c,{stream:!0}),o+=c.byteLength,o>=65536){s=e.byteLength>n||!(await r.read()).done,await r.cancel();break}}v.set(e,{text:a,truncated:s})}catch(t){v.set(e,{text:``,truncated:!1,error:t instanceof Error?t.message:String(t)})}}function E(e){m.add(e),g.delete(e)}let D=e=>e===`out`?`↑ sent`:`↓ received`,O=e=>e===`out`?`sent by the run`:`received from the thread`;return(r,o)=>(u(),t(`div`,{class:`files mt-3 border-t border-(--ui-border) pt-2`,"data-open-images":e.openImages?`1`:`0`},[d(`h3`,je,[o[0]||=d(`span`,null,`Files`,-1),d(`span`,Me,`· `+a(e.files.length)+` file`+a(e.files.length===1?``:`s`),1)]),d(`ul`,Ne,[(u(!0),t(h,null,n(C.value,e=>(u(),t(`li`,{key:e.key,class:`artifact`,"data-direction":e.direction,"data-kind":e.kind,"data-open":e.open?`1`:`0`,"data-expired":e.expired?`1`:`0`},[d(`div`,Fe,[d(`span`,{class:`dir shrink-0 select-none text-dimmed`,title:O(e.direction)},a(D(e.direction)),9,Ie),e.href&&!e.expired?(u(),t(`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":e.open?`true`:`false`,"aria-controls":e.panelId,onClick:t=>w(e)},[d(`span`,{class:s([`chev inline-block select-none text-[0.65rem] text-dimmed transition-transform motion-reduce:transition-none`,e.open?`rotate-90`:``]),"aria-hidden":`true`},`❯`,2),d(`span`,null,a(e.name),1)],8,Le)):(u(),t(`span`,Re,a(e.name),1)),d(`span`,ze,a(p(A)(e.size)),1),d(`span`,Be,a(e.contentType),1),e.expired&&p(f)?(u(),t(`span`,Ve,`expired after `+a(p(f).retentionDays)+` days`,1)):c(``,!0)]),e.href&&!e.expired?(u(),t(`div`,{key:0,id:e.panelId,class:`panel grid transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none`,style:i({gridTemplateRows:e.open?`1fr`:`0fr`}),"aria-hidden":e.open?`false`:`true`},[d(`div`,Ue,[e.mounted?(u(),t(h,{key:0},[e.kind===`image`?(u(),t(`img`,{key:0,class:`preview mt-1.5 max-h-96 max-w-full rounded border border-(--ui-border)`,src:e.href,alt:e.name,loading:`lazy`,onError:t=>E(e.key)},null,40,We)):e.kind===`video`?(u(),t(`video`,{key:1,class:`preview mt-1.5 max-h-96 max-w-full rounded border border-(--ui-border) bg-black`,src:e.href,controls:``,playsinline:``,preload:`auto`,onError:t=>E(e.key)},null,40,Ge)):e.kind===`audio`?(u(),t(`audio`,{key:2,class:`preview mt-1.5 w-full max-w-xl`,src:e.href,controls:``,preload:`auto`,onError:t=>E(e.key)},null,40,Ke)):e.kind===`text`?(u(),t(`div`,qe,[v.get(e.key)&&!v.get(e.key).error?(u(),t(`pre`,Je,a(v.get(e.key).text),1)):c(``,!0),v.get(e.key)?.error?(u(),t(`p`,Ye,` could not read the file: `+a(v.get(e.key).error),1)):v.get(e.key)?.truncated?(u(),t(`p`,Xe,` showing the first `+a(p(A)(p(De)))+` of `+a(p(A)(e.size)),1)):c(``,!0)])):(u(),t(`div`,Ze,[d(`span`,null,`no preview for `+a(e.contentType),1),d(`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:e.href,download:e.name},`Download `+a(p(A)(e.size)),9,Qe)]))],64)):c(``,!0)])],12,He)):c(``,!0)],8,Pe))),128))])],8,Ae))}}),tt=[`id`,`open`,`title`,`data-status`,`data-heat`],nt={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`},rt={key:2,class:`dollar shrink-0 select-none text-dimmed`},it={key:3,class:`tool shrink-0 rounded bg-accented px-1.5 text-xs leading-normal text-muted`},at={key:0,class:`cmd brief min-w-0 flex-1 truncate text-info`},ot={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`},st={key:5,class:`cmd min-w-0 flex-1`},ct={class:`facts ml-auto flex shrink-0 gap-2.5 text-xs tabular-nums text-muted`},lt={key:0,class:`fact elapsed`,title:`since this call started (runner clock)`},ut={key:0,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},dt={key:1,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},ft={class:`body`},pt={key:1,class:`none px-3 py-1.5 text-xs italic text-dimmed`},mt={key:2,class:`none px-3 py-1.5 text-xs italic text-dimmed`},ht=o({__name:`CallCard`,props:{call:{}},setup(e){let r=e,o=l(Z,null),f=l(Se,null),m=b(()=>{let e=o?.value;return r.call.status!==`running`||typeof e!=`number`||r.call.startedAt===void 0?``:T(Math.max(0,e-r.call.startedAt),`clock`)}),_=b(()=>N(r.call.durationMs,`tool`,r.call.timedOut)),y=b(()=>j(_.value)),x=b(()=>r.call.durationMs===void 0?-1:r.call.facts.length-1);function S(){r.call.open=!r.call.open}return(r,o)=>(u(),t(`details`,{id:`call-${e.call.id}`,class:s([`call rounded-lg border border-default bg-elevated font-mono open:bg-accented`,e.call.status]),open:e.call.open,title:typeof e.call.startedAt==`number`?`started ${p(O)(e.call.startedAt)}`:void 0,"data-status":e.call.status,"data-heat":_.value.level},[d(`summary`,{class:s([`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`,e.call.open?`rounded-b-none border-b border-default`:``]),onClick:g(S,[`prevent`])},[d(`span`,{class:s([`chev shrink-0 select-none text-xs text-dimmed transition-transform motion-reduce:transition-none`,e.call.open?`rotate-90`:``])},`❯`,2),e.call.status===`running`?(u(),t(`span`,nt)):(u(),t(`span`,{key:1,class:s([`glyph w-[1em] shrink-0 text-center font-medium`,e.call.status===`ok`?`text-ok`:e.call.status===`failed`?`text-bad`:`text-warn`])},a(e.call.status===`ok`?`✓`:e.call.status===`failed`?`✗`:`⚠`),3)),e.call.shell?(u(),t(`span`,rt,`$`)):(u(),t(`span`,it,a(e.call.tool),1)),e.call.chipOnly?(u(),t(`span`,st)):(u(),t(h,{key:4},[e.call.open?(u(),t(`code`,ot,a(e.call.title),1)):(u(),t(`code`,at,a(e.call.headline),1))],64)),d(`span`,ct,[m.value?(u(),t(`span`,lt,a(m.value),1)):c(``,!0),(u(!0),t(h,null,n(e.call.facts,(n,r)=>(u(),t(h,{key:r},[r===x.value&&_.value.over?(u(),t(`span`,ut,`timed out`)):c(``,!0),d(`span`,{class:s([`fact`,[e.call.status!==`ok`&&r===0?`text-bad`:``,r===x.value&&_.value.over?`font-medium text-bad`:``,r===x.value&&y.value?`heat`:``,r===x.value&&_.value.level>=2&&!_.value.over?`font-medium`:``]]),style:i(r===x.value?y.value:void 0)},a(n),7)],64))),128)),_.value.over&&x.value===-1?(u(),t(`span`,dt,`timed out`)):c(``,!0)])],2),d(`div`,ft,[e.call.hasResult&&e.call.output?(u(),t(`pre`,{key:0,class:s([`out max-h-[28rem] overflow-auto whitespace-pre-wrap break-words px-3.5 py-2.5 font-mono leading-normal`,e.call.status===`failed`?`text-bad`:`text-toned`])},a(e.call.output),3)):e.call.hasResult?(u(),t(`div`,pt,`no output`)):(u(),t(`div`,mt,`no output yet`)),e.call.files&&e.call.files.length>0?(u(),v(et,{key:3,class:`mx-3.5 mb-2.5`,files:e.call.files,"open-images":!p(f)},null,8,[`files`,`open-images`])):c(``,!0)])],10,tt))}}),gt=[`title`],_t=[`title`],vt={class:`skillname whitespace-nowrap font-mono font-medium text-skill`},yt={key:0,class:`skilldesc min-w-0 flex-1 truncate text-xs text-muted`},bt={class:`facts ml-auto flex shrink-0 gap-2.5 font-mono text-xs text-muted`},xt=[`href`],St={class:`fact`},Ct=o({__name:`StepItems`,props:{items:{}},setup(e){return(r,i)=>(u(!0),t(h,null,n(e.items,(e,n)=>(u(),t(h,{key:n},[e.kind===`call`?(u(),v(ht,{key:0,call:e.call},null,8,[`call`])):e.kind===`quiet`?(u(),t(`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:p(O)(e.at)},[d(`span`,null,a(e.text),1)],8,gt)):(u(),t(`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:p(O)(e.skill.at)},[i[0]||=d(`span`,{class:`skillmark shrink-0 select-none text-xs`},`📚`,-1),d(`span`,vt,`skill `+a(e.skill.name),1),e.skill.description?(u(),t(`span`,yt,a(e.skill.description),1)):c(``,!0),d(`span`,bt,[e.skill.source?(u(),t(`a`,{key:0,class:`fact text-primary hover:underline`,href:e.skill.source,target:`_blank`,rel:`noopener noreferrer`},`source`,8,xt)):c(``,!0),d(`span`,St,a(p(A)(e.skill.bodyBytes))+` into context`,1)])],8,_t))],64))),128))}}),wt=[`id`,`data-live`],Tt={class:`head flex items-baseline gap-x-6 pb-1.5 pr-(--sb-gutter)`},Et={class:`min-w-0 flex-1`},Dt={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`},Ot=[`data-heat`,`title`],kt=[`title`],At=[`title`],jt={key:2,class:`nonar font-sans text-sm italic text-dimmed`},Mt=[`title`],Nt={key:0,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},Pt={key:1,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},Ft={class:`nonar flex-1 font-sans text-sm italic text-dimmed`},It={class:`calls flex flex-col gap-2`},Lt=[`open`,`data-group-open`],Rt=[`title`],zt=[`data-ok`,`data-bad`,`data-infra`,`data-running`],Bt=[`data-heat`],Vt={class:`gbody flex flex-col gap-2 pb-1 pt-1.5`},Ht=o({__name:`StepBlock`,props:{step:{}},emits:[`toggleGroup`],setup(r,{emit:o}){let l=r,f=o,_=b(()=>l.step.items.filter(e=>e.kind===`call`)),y=b(()=>_.value.length>=2),x=b(()=>{let e=0,t=0,n=0,r=0,i=0;for(let a of _.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}}),S=b(()=>he(x.value)),C=b(()=>_.value.some(e=>e.kind===`call`&&e.call.timedOut)),w=b(()=>N(x.value.ms,`tool`,C.value)),E=b(()=>j(w.value)),D=b(()=>l.step.turn?N(l.step.turn.durationMs,`turn`):void 0),A=b(()=>D.value?j(D.value):void 0),M=b(()=>{let e=_.value[0];return e?.kind===`call`?e.call.startedAt:void 0});return(o,l)=>(u(),t(`li`,{id:r.step.turn?`span-${r.step.turn.spanId}`:void 0,class:s([`step relative border-l-2 pb-3 pl-3 pt-2`,r.step.live?`border-ok/40`:`border-(--ui-border-accented)/50`]),"data-live":r.step.live?`1`:void 0},[d(`div`,Tt,[d(`div`,Et,[r.step.turn?(u(),t(`div`,Dt,[d(`span`,{class:s([`thought`,[A.value?`heat`:``,D.value&&D.value.level>=2?`font-medium`:``]]),style:i(A.value),"data-heat":D.value?.level,title:r.step.turn.label},`thought `+a(r.step.turn.chip),15,Ot),r.step.turn.switched?(u(),t(`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 ${r.step.turn.model}`},`⇄ `+a(p($)(r.step.turn.model)),9,kt)):r.step.turn.showModel?(u(),t(`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:r.step.turn.model},a(p($)(r.step.turn.model)),9,At)):c(``,!0),(u(!0),t(h,null,n(r.step.turn.facts,(e,n)=>(u(),t(`span`,{key:n,class:`fact`},a(e),1))),128))])):r.step.narration===null?(u(),t(`span`,jt,a(r.step.note),1)):(u(),v(F,{key:1,text:r.step.narration},null,8,[`text`]))]),r.step.at===void 0?c(``,!0):(u(),t(`span`,{key:0,class:`ts shrink-0 select-none font-mono text-xs tabular-nums text-dimmed`,title:p(O)(r.step.at)},a(p(k)(r.step.at)),9,Mt))]),r.step.turn&&r.step.narration!==null?(u(),t(`div`,Nt,[e(F,{text:r.step.narration},null,8,[`text`])])):r.step.turn&&r.step.narration===null&&!r.step.turn.facts.length?(u(),t(`div`,Pt,[d(`span`,Ft,a(r.step.note),1)])):c(``,!0),d(`div`,It,[y.value?(u(),t(`details`,{key:1,class:`grp`,open:r.step.groupOpen,"data-group-open":r.step.groupOpen?`1`:`0`},[d(`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 M.value==`number`?`calls began ${p(O)(M.value)}`:void 0,onClick:l[0]||=g(e=>f(`toggleGroup`),[`prevent`])},[d(`span`,{class:s([`gchev shrink-0 select-none transition-transform motion-reduce:transition-none`,r.step.groupOpen?`rotate-90`:``])},`❯`,2),d(`span`,{class:s([`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},a(S.value),11,zt),x.value.ms>0?(u(),t(`span`,{key:0,class:s([`gtime ml-auto tabular-nums`,[E.value?`heat`:``,w.value.over?`font-medium text-bad`:w.value.level>=2?`font-medium`:``]]),style:i(E.value),"data-heat":w.value.level},[w.value.over?(u(),t(h,{key:0},[m(`timed out · `)],64)):c(``,!0),m(a(p(T)(x.value.ms,`clock`)),1)],14,Bt)):c(``,!0)],8,Rt),d(`div`,Vt,[e(Ct,{items:r.step.items},null,8,[`items`])])],8,Lt)):(u(),v(Ct,{key:0,items:r.step.items},null,8,[`items`]))])],10,wt))}});function Ut(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(`
11
- `);if(r!==``)try{let e=JSON.parse(r);typeof e==`object`&&e&&typeof e.type==`string`&&t.push(e)}catch{}}return t}export{ae as C,re as S,F as T,ge as _,Se as a,J as b,_e as c,$ as d,ye as f,ue as g,le as h,Q as i,be as l,fe as m,Ht as n,Z as o,xe as p,et as r,ve as s,Ut as t,Te as u,X as v,U as w,q as x,ie as y};