@coreplane/switchboard 1.260.4 → 1.260.6

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 (51) hide show
  1. package/dist/assets/deploy/cloudflare/package.json +2 -2
  2. package/dist/assets/deploy/cloudflare-docs/package.json +1 -1
  3. package/dist/assets/deploy/cloudflare-memory/package.json +2 -2
  4. package/dist/assets/deploy/cloudflare-memory/worker.ts +222 -11
  5. package/dist/assets/deploy/cloudflare-resident/package.json +2 -2
  6. package/dist/assets/deploy/cloudflare-resident/worker.ts +124 -40
  7. package/dist/assets/deploy/cloudflare-sandbox/package.json +2 -2
  8. package/dist/assets/package-lock.json +712 -97
  9. package/dist/assets/package.json +4 -4
  10. package/dist/assets/source.json +3 -3
  11. package/dist/assets/src/core/budgets.ts +10 -0
  12. package/dist/assets/src/core/coordinator/contract.ts +5 -0
  13. package/dist/assets/src/core/coordinator/driver.ts +155 -29
  14. package/dist/assets/src/core/pipelineStanding.ts +2 -0
  15. package/dist/assets/src/core/plane/decide.ts +19 -2
  16. package/dist/assets/src/core/provider.ts +380 -0
  17. package/dist/assets/src/core/refusal.ts +2 -1
  18. package/dist/assets/src/core/runEvents.ts +8 -0
  19. package/dist/assets/src/core/runLedger/decisions.ts +10 -1
  20. package/dist/assets/src/core/runLedger/types.ts +13 -1
  21. package/dist/assets/src/core/runRecord.ts +31 -0
  22. package/dist/assets/src/core/ship/contract.ts +2 -0
  23. package/dist/assets/src/core/ship/coordinator.ts +515 -30
  24. package/dist/assets/src/core/types.ts +6 -0
  25. package/dist/assets/src/execution/residentRebind.ts +15 -0
  26. package/dist/assets/src/execution/residentReuse.ts +23 -2
  27. package/dist/assets/web/dist/.vite/manifest.json +67 -67
  28. package/dist/assets/web/dist/assets/{DeliveryPage-BaemWKW8.js → DeliveryPage-BUJckSuW.js} +1 -1
  29. package/dist/assets/web/dist/assets/{HomePage-fgKQHLaO.js → HomePage-CBQpcnaW.js} +1 -1
  30. package/dist/assets/web/dist/assets/{PendingTurnRow-vuWiDzvz.js → PendingTurnRow-DIC86uWA.js} +1 -1
  31. package/dist/assets/web/dist/assets/{PlanePage-DXMJf8FB.js → PlanePage-CfrbMh8t.js} +1 -1
  32. package/dist/assets/web/dist/assets/{ResidentDetailPage-DdC8yU_S.js → ResidentDetailPage-C-SgOUTl.js} +1 -1
  33. package/dist/assets/web/dist/assets/{ResidentsIndexPage-CSM-KODv.js → ResidentsIndexPage-CiDhvXok.js} +1 -1
  34. package/dist/assets/web/dist/assets/RunFoldRow-DZ8huwUU.js +1 -0
  35. package/dist/assets/web/dist/assets/{RunRoutePage-jo6NZxsP.js → RunRoutePage-Cp6wicYc.js} +3 -3
  36. package/dist/assets/web/dist/assets/{RunsIndexPage-Dx1Y4sSq.js → RunsIndexPage-BPXtfwwx.js} +1 -1
  37. package/dist/assets/web/dist/assets/{ScheduledPage-BuB_NZyR.js → ScheduledPage-DbvP48HI.js} +1 -1
  38. package/dist/assets/web/dist/assets/{SettingsPage-Cn96jB6Q.js → SettingsPage-B87lZaiN.js} +1 -1
  39. package/dist/assets/web/dist/assets/{SilentTurn-D2cJfpEq.js → SilentTurn-CPED_XCV.js} +1 -1
  40. package/dist/assets/web/dist/assets/{StatusDot-DDHUCPVJ.js → StatusDot-CFLn-DZ2.js} +1 -1
  41. package/dist/assets/web/dist/assets/{Tooltip-B4VIHkAI.js → Tooltip-Dx9YBVEx.js} +1 -1
  42. package/dist/assets/web/dist/assets/{UnitRoutePage-C-2DfjLI.js → UnitRoutePage-d4A2X_o7.js} +1 -1
  43. package/dist/assets/web/dist/assets/budgets-BQgcCyvb.js +1 -0
  44. package/dist/assets/web/dist/assets/{dist-Cf1CmCSK.js → dist-Cn51vWpw.js} +11 -11
  45. package/dist/assets/web/dist/assets/{indexRow-Dxg7C8s9.js → indexRow-BsWcHHVh.js} +1 -1
  46. package/dist/assets/web/dist/assets/{main-DxPqaFu9.js → main-DYwRHh0F.js} +2 -2
  47. package/dist/assets/web/dist/assets/{sseReplay-BzoeVxZB.js → sseReplay-DGRDRLua.js} +1 -1
  48. package/dist/cli.js +2550 -924
  49. package/package.json +4 -4
  50. package/dist/assets/web/dist/assets/RunFoldRow-Csik3wD6.js +0 -1
  51. package/dist/assets/web/dist/assets/budgets-KNNkT4PZ.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreplane/switchboard",
3
- "version": "1.260.4",
3
+ "version": "1.260.6",
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",
@@ -37,11 +37,11 @@
37
37
  "@earendil-works/pi-ai": "0.85.1",
38
38
  "@slack/bolt": "^5.1.0",
39
39
  "aws4fetch": "^1.0.20",
40
- "e2b": "^2.46.1",
40
+ "e2b": "^2.49.1",
41
41
  "mdast-util-from-markdown": "^2.0.3",
42
42
  "undici": "^8.10.2",
43
- "yaml": "^2.7.0",
44
- "zod": "^4.5.4"
43
+ "yaml": "^2.9.1",
44
+ "zod": "^4.6.5"
45
45
  },
46
46
  "devDependencies": {
47
47
  "esbuild": "^0.28.2",
@@ -1 +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,Tr as l,Xr as u,_r as d,bn as f,dr as p,ir as m,ji as h,kn as g,ln as _,rn as v,t as y,xi as b,xn as x,yn as S}from"./browser-CCImen5O.js";import{r as C,t as w}from"./indexFormat-B-pd4r7Y.js";import{B as T,C as E,D,E as O,G as k,I as A,K as j,L as M,M as N,R as ee,T as te,U as ne,a as P,c as F,l as I,o as L,t as R,x as re,z as ie}from"./indexRow-Dxg7C8s9.js";import"./format-BldUwl_R.js";import{n as ae}from"./SlackMark-DB0MGiF5.js";import{c as oe,l as se,n as ce,t as le,w as z}from"./sseReplay-BzoeVxZB.js";import{n as ue,t as de}from"./durationTone-CVpX_yIk.js";import{t as B}from"./StatusDot-DDHUCPVJ.js";var fe={merged:`merged`,already_landed:`merged`,merge_ready:`merge-ready`,held:`held`,merge_refused:`not merged`,round_cap:`round cap reached`,wall_clock_cap:`out of budget`,review_pending:`review pending`,stopped:`stopped`,aborted:`aborted`,transient:`aborted`,continued:`continuing`,no_verdict:`no verdict`,interrupted:`interrupted`,refused:`refused`,idle:`idle`,idle_expired:`idle expired`,blocked:`blocked`,failed:`failed`};function pe(e){return fe[e]??e}var me={},he={viewBox:`0 0 16 16`,class:`inline-block size-[1em] shrink-0`,"aria-hidden":`true`};function ge(e,n){return d(),t(`svg`,he,[...n[0]||=[f(`path`,{fill:`currentColor`,d:`M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z`},null,-1)]])}var _e=ae(me,[[`render`,ge]]),V={"getting ready":`paint-ready`,thinking:`paint-thinking`,"in tools":`paint-tools`,"finishing up":`paint-finishing`,"Switchboard overhead":`paint-overhead`,"not recorded":`paint-lost`,"not loaded":`paint-elided`},ve={getting_ready:`getting ready`,finishing_up:`finishing up`};function ye(e){return V[ve[e]]}var be={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},xe={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Se={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},Ce=[`href`],we={class:`lede font-mono text-sm text-toned`},Te={class:`shape tabular-nums`},Ee={key:0,class:`current text-muted`},De={key:0,class:`note mt-0.5 text-xs text-muted`},Oe=[`aria-label`],ke=[`title`,`data-term`],Ae={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs`},je=[`title`,`data-term`],Me={class:`term text-muted`},Ne={class:`ms tabular-nums text-toned`},Pe=[`title`],Fe={class:`ranked mt-1 flex flex-col gap-1 font-mono text-xs`},Ie={class:`ms w-14 shrink-0 tabular-nums text-toned`},Le=[`href`,`data-anchor`,`onClick`],Re=[`title`],ze={class:`cut mt-1 flex flex-col gap-1 font-mono text-xs`},Be={class:`ms w-14 shrink-0 tabular-nums text-toned`},Ve=[`href`,`data-anchor`,`onClick`],H=o({__name:`TimelineSection`,props:{vm:{},eventsHref:{}},emits:[`reveal`],setup(e,{emit:r}){let o=e,l=r;function u(e){return`${j(e.ms,`clock`)} ${e.term}${e.hatched?` (in flight)`:``}`}function p(){y.copyText(JSON.stringify(o.vm.debug,null,2))}return(r,o)=>(d(),t(`section`,be,[f(`h2`,xe,[o[0]||=f(`span`,null,`Where the time went`,-1),f(`span`,Se,[e.eventsHref?(d(),t(`a`,{key:0,class:`text-dimmed no-underline hover:text-primary hover:underline`,href:e.eventsHref,title:`the stored events, as JSON lines`},`raw events`,8,Ce)):c(``,!0),f(`button`,{type:`button`,class:`debug cursor-pointer text-dimmed hover:text-toned`,title:`the partition and the raw span names, for a bug report`,onClick:p},` Copy debug JSON `)])]),f(`p`,we,[f(`span`,Te,a(e.vm.shown?e.vm.total:e.vm.lede),1),e.vm.current?(d(),t(`span`,Ee,` · `+a(e.vm.current),1)):c(``,!0)]),(d(!0),t(_,null,n(e.vm.captions,e=>(d(),t(`p`,{key:e,class:`caption mt-0.5 text-xs text-muted`},a(e),1))),128)),e.vm.note?(d(),t(`p`,De,a(e.vm.note),1)):c(``,!0),e.vm.shown?(d(),t(_,{key:1},[f(`div`,{class:`bar mt-2.5 flex h-2 w-full overflow-hidden rounded-sm`,role:`img`,"aria-label":e.vm.lede},[(d(!0),t(_,null,n(e.vm.bar,(e,n)=>(d(),t(`div`,{key:n,class:s([`seg h-full`,[h(V)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:i({width:`${e.pct}%`}),title:u(e),"data-term":e.term},null,14,ke))),128))],8,Oe),f(`ul`,Ae,[(d(!0),t(_,null,n(e.vm.legend,e=>(d(),t(`li`,{key:e.term,class:`flex items-baseline gap-1.5 cursor-help`,title:e.definition,"data-term":e.term},[f(`span`,{class:s([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,h(V)[e.term]])},null,2),f(`span`,Me,a(e.term),1),f(`span`,Ne,a(e.text),1)],8,je))),128))]),e.vm.ranked.length>0?(d(),t(_,{key:0},[f(`h3`,{class:`ranked-head mt-3 inline-block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.rankedNote},` Longest steps `,8,Pe),f(`ol`,Fe,[(d(!0),t(_,null,n(e.vm.ranked,(e,r)=>(d(),t(`li`,{key:r,class:`flex items-baseline gap-2`},[f(`span`,Ie,a(h(j)(e.ms,`clock`)),1),f(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:v(t=>l(`reveal`,e.anchor),[`prevent`])},a(e.label),9,Le),(d(!0),t(_,null,n(e.facts,e=>(d(),t(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},a(e),1))),128))]))),128))])],64)):c(``,!0),e.vm.cut.length>0?(d(),t(_,{key:1},[f(`h3`,{class:`cut-head mt-3 block cursor-help text-xs font-medium text-muted underline decoration-dotted decoration-(--ui-border-accented) underline-offset-2`,title:e.vm.cutNote},` Cut steps `,8,Re),f(`ol`,ze,[(d(!0),t(_,null,n(e.vm.cut,(e,r)=>(d(),t(`li`,{key:r,class:`flex items-baseline gap-2`},[f(`span`,Be,a(h(j)(e.ms,`clock`)),1),f(`a`,{class:`label min-w-0 truncate text-muted no-underline hover:text-primary hover:underline`,href:`#${e.anchor}`,"data-anchor":e.anchor,title:`scroll to this step`,onClick:v(t=>l(`reveal`,e.anchor),[`prevent`])},a(e.label),9,Ve),(d(!0),t(_,null,n(e.facts,e=>(d(),t(`span`,{key:e,class:`fact shrink-0 rounded border border-accented px-1 text-dimmed`},a(e),1))),128))]))),128))])],64)):c(``,!0)],64)):c(``,!0)]))}}),U={"getting ready":`before the agent's first turn: reading the thread, finding the repo, checking out, loading tools`,thinking:`the model's turns — from a request to the model until its reply came back`,"in tools":`the commands and tool calls the model ran`,"finishing up":`after the agent's last turn: posting the PR, checking the workspace`,"Switchboard overhead":`orchestration between steps, and moments when only a background read was running — the time no step claims`,"not recorded":`a stretch of the run the record does not carry`,"not loaded":`a stretch of the run this page did not load — the record has the full shape`},W=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,G=`Steps still open when the run ended: closed at the run's terminal event and left out of the ranking — the time shown is the cut, not a measurement.`;function He(e){let t=e===`interrupted`?`the interruption`:e===`failed`?`the failure`:e===`stopped_hard`?`the hard stop`:e===`stopped_soft`?`the stop`:void 0;return t?`cut by ${t}`:`cut at the run's end`}var Ue=`currently delivering`,We=`getting ready: not recorded (too large)`,Ge=`no timing data`,Ke=`not loaded (the record has the full shape)`,K={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function q(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=ee(t,{window:n,owner:r,finished:i,losses:e.losses}),o=ie(a),s=j(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?Je(t,r,n):void 0,u=Ye(e,l),d=l?z(l.name):``,f={window:n,owner:r,phase:e.phase,partition:a,spans:t.map(e=>({spanId:e.spanId,parentSpanId:e.parentSpanId,name:e.name,startedAt:e.startedAt,endedAt:e.endedAt,status:e.status,attrs:e.attrs}))};if(e.untimed)return{total:s,current:u,openStep:d,captions:[],rankedNote:W,cut:[],cutNote:G,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:Ge};let p=qe(c,`restartOfRunId`),m={total:s,current:u,openStep:d,captions:[p===void 0?void 0:`restarted from run ${p}`,A(`before`,J(c,`queuedBeforeMs`)),p===void 0?A(`behind`,J(c,`queuedBehindMs`)):void 0].filter(e=>e!==void 0),rankedNote:W,cutNote:G,debug:f};if(!c)return{...m,lede:s,shown:!1,bar:[],legend:[],ranked:[],cut:[],note:i?We:``};let h=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?Ke:t,g=M(a)&&o.items.length>0,_=g?`${s} — ${o.items.map(({term:e,s:t})=>`${j(t*1e3,`clock`)} ${h(e)}`).join(` · `)}`:a.windowMs>0?`${s} — ${h(Xe(a))}`:s,v=g?o.items.map(({term:t,s:n})=>({term:t,text:j(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${U[t]} (too large)`:U[t]})):[],y=g?Qe(t,c,r,n,e.callTitle,e.phase===`ended`,He(e.endedBy)):{ranked:[],cut:[]};return{...m,lede:_,shown:g,bar:g?Ze(a,l):[],legend:v,ranked:y.ranked,cut:y.cut,note:``}}function J(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function qe(e,t){let n=e?.attrs[t];return typeof n==`string`&&n!==``?n:void 0}function Je(e,t,n){let r=new Map(e.map(e=>[e.spanId,e])),i=e=>{let t=1,n=new Set([e.spanId]),i=e.parentSpanId?r.get(e.parentSpanId):void 0;for(;i&&!n.has(i.spanId);)n.add(i.spanId),t++,i=i.parentSpanId?r.get(i.parentSpanId):void 0;return t},a;for(let o of e){if(o.endedAt!==void 0||o.startedAt>=n.end)continue;let e=T(o.name,t);if(e?.kind!==`counted`||Y(o,r,t))continue;let s=i(o);(!a||s>a.depth||s===a.depth&&o.startedAt>a.span.startedAt)&&(a={span:o,depth:s,bucket:e.bucket})}if(a)return{bucket:a.bucket,name:a.span.name,elapsedMs:Math.max(0,n.end-Math.max(n.start,a.span.startedAt))}}function Y(e,t,n){let r=e,i=new Set;for(;r&&!i.has(r.spanId);){if(i.add(r.spanId),T(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function Ye(e,t){return e.phase===`delivering`?Ue:e.phase===`ended`?se(e.delivery??{}):t?`currently ${K[t.bucket]} ${j(t.elapsedMs,`clock`)}`:``}function X(e){return[[`getting ready`,e.gettingReadyMs],[`thinking`,e.thinkingMs],[`in tools`,e.toolsMs],[`finishing up`,e.finishingUpMs],[`Switchboard overhead`,e.overheadMs],[`not recorded`,e.notRecordedMs],[`not loaded`,e.notLoadedMs]]}function Xe(e){let t=[`getting ready`,-1];for(let n of X(e))n[1]>t[1]&&(t=n);return t[0]}function Ze(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of X(e))if(!(a<=0)){if(t&&K[t.bucket]===i){let e=Math.min(t.elapsedMs,a);a-e>0&&n.push({term:i,ms:a-e,pct:r(a-e),hatched:!1}),e>0&&n.push({term:i,ms:e,pct:r(e),hatched:!0});continue}n.push({term:i,ms:a,pct:r(a),hatched:!1})}return n}function Qe(e,t,n,r,i,a,o){let s=new Map(e.map(e=>[e.spanId,e])),c=new Map;for(let t of e){if(t.parentSpanId===void 0)continue;let e=c.get(t.parentSpanId);e?e.push(t):c.set(t.parentSpanId,[t])}let l=e=>[Math.max(r.start,e.startedAt),Math.min(r.end,e.endedAt??r.end)],u=[],d=[];for(let r of e){if(r===t||r.name===`run.agent`||T(r.name,n)===void 0||Y(r,s,n))continue;let[e,f]=l(r);if(f<=e)continue;let p=(c.get(r.spanId)??[]).map(l).map(([t,n])=>[Math.max(e,t),Math.min(f,n)]).filter(([e,t])=>t>e),m=f-e-$e(p);if(m<=0)continue;let h=r.name.startsWith(`tool.`)&&typeof r.attrs.callId==`string`?r.attrs.callId:void 0,g=h?i?.(h):void 0,_=a&&r.endedAt===void 0;(_?d:u).push({label:g??z(r.name),ms:m,facts:_?[o,...Z(r)]:Z(r),anchor:h?`call-${h}`:`span-${r.spanId}`,startedAt:r.startedAt})}let f=(e,t)=>t.ms-e.ms||e.startedAt-t.startedAt;u.sort(f),d.sort(f);let p=({label:e,ms:t,facts:n,anchor:r})=>({label:e,ms:t,facts:n,anchor:r});return{ranked:u.slice(0,3).map(p),cut:d.map(p)}}function $e(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=0,r;for(let[e,i]of t)!r||e>r[1]?(r&&(n+=r[1]-r[0]),r=[e,i]):i>r[1]&&(r[1]=i);return r&&(n+=r[1]-r[0]),n}function Z(e){let t=e.attrs,n=[];return(t.token===`expired`||t.token===`expiring`)&&n.push(`token ${t.token}`),t.budget===`clipped`&&n.push(`budget clipped`),typeof t.timeoutMs==`number`&&n.push(`timeout ${j(t.timeoutMs,`clock`)}`),typeof t.waitedMs==`number`&&n.push(`waited ${j(t.waitedMs,`clock`)}`),typeof t.exitCode==`number`&&t.exitCode!==0&&n.push(`exit ${t.exitCode}`),t.timedOut===!0&&n.push(`timed out`),typeof t.attempts==`number`&&t.attempts>1&&n.push(`${t.attempts} attempts`),e.status===`error`&&n.length===0&&n.push(`failed`),n}function Q(e){return e===`command`?`command`:`agent`}var et=[`data-state`],tt={key:0,class:`loading py-2 font-mono text-xs text-dimmed`},nt={key:1,class:`failed py-2 font-mono text-xs text-warn`},rt=[`data-turn`,`data-anchor`],it={class:`landing-head flex flex-wrap items-baseline gap-x-2 font-mono text-xs text-muted`},at={class:`turn tabular-nums`},ot={class:`what min-w-0 truncate text-toned`},st={key:0,class:`m-0 mt-1 list-none p-0`},ct=o({__name:`RunTimeline`,props:{run:{},land:{},fetch:{}},setup(n){let i=n,o=b(`loading`),s=oe(),v=S(()=>{if(o.value!==`ready`)return null;s.state.traceVersion;let e=i.run,t=e.receivedAt??e.startedAt,n=k(e)??(e.finishedAt===void 0?0:Math.max(0,e.finishedAt-t));return q({spans:s.spanSet(),losses:s.losses(t),window:{start:t,end:t+n},owner:Q(e.agent),totalMs:n,phase:`ended`,delivery:{finishedAt:e.finishedAt,sealedAt:e.sealedAt,replyOk:e.replyOk},...e.truncated===void 0?{}:{truncated:e.truncated},...(e.schema??0)>=2?{}:{untimed:!0},callTitle:s.callHeadline})}),x=S(()=>`/runs/${encodeURIComponent(i.run.id)}/events`),C=e=>`/runs/${encodeURIComponent(i.run.id)}#${e}`;function w(e){y.navigate(C(e))}let T=S(()=>{if(o.value!==`ready`||i.land===void 0)return null;s.state.traceVersion;let e=i.land,t=i.run.session;if(t&&e===t.request)return{anchor:`request`,what:`the request`};let n=t&&t.range!==`broken`?t.range.to:void 0;if(n!==void 0&&e===n&&s.state.reply)return{anchor:`reply`,what:`the reply`};let r=s.landing(e);return r?{anchor:r.anchor,what:E(r.step),step:r.step}:null});function E(e){let t=e.items.find(e=>e.kind===`call`),n=t?.kind===`call`?t.call.headline:void 0;return[e.turn?`thought ${e.turn.chip}`:void 0,n].filter(e=>e!==void 0).join(` · `)||`step ${e.index+1}`}let D=b(null),O=S(()=>T.value?`${i.land}@${T.value.anchor}`:null);return r(O,e=>{e!==null&&m().then(()=>{let e=(T.value?.step?D.value?.querySelector(`li.step`):null)??D.value;e&&(e.scrollIntoView?.({block:`center`}),e.classList.add(`revealed`),setTimeout(()=>e.classList.remove(`revealed`),1500))})}),p(async()=>{let e=i.fetch??((...e)=>globalThis.fetch(...e));try{let t=await e(x.value,{credentials:`same-origin`});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=le(await t.text()).filter(e=>e.type!==`replay_note`);for(let e of(i.run.schema??0)>=2?ne(n):n)s.handle(e);s.closePhases(),o.value=`ready`}catch{o.value=`failed`}}),(r,i)=>{let p=l(`RouterLink`);return d(),t(`div`,{class:`runtimeline pl-5`,"data-state":o.value},[o.value===`loading`?(d(),t(`p`,tt,`reading the run's record…`)):o.value===`failed`?(d(),t(`p`,nt,[i[2]||=g(` the run's record could not be read — `,-1),e(p,{class:`text-primary no-underline hover:underline`,to:`/runs/${encodeURIComponent(n.run.id)}`},{default:u(()=>[...i[1]||=[g(`open the run`,-1)]]),_:1},8,[`to`])])):v.value?(d(),t(_,{key:2},[e(H,{vm:v.value,"events-href":x.value,onReveal:w},null,8,[`vm`,`events-href`]),T.value?(d(),t(`div`,{key:0,ref_key:`landingEl`,ref:D,class:`landing mb-4 rounded-lg border border-default px-(--sb-gutter) py-2`,"data-turn":n.land,"data-anchor":T.value.anchor},[f(`p`,it,[f(`span`,at,`turn `+a(n.land),1),f(`span`,ot,`· `+a(T.value.what),1),e(p,{class:`page ml-auto shrink-0 text-primary no-underline hover:underline`,to:C(T.value.anchor),title:`the same step on the run's own page`},{default:u(()=>[...i[3]||=[g(`open on the run's page ↗`,-1)]]),_:1},8,[`to`])]),T.value.step?(d(),t(`ol`,st,[e(ce,{step:T.value.step,onToggleGroup:i[0]||=e=>h(s).toggleGroup(T.value.step)},null,8,[`step`])])):c(``,!0)],8,rt)):c(``,!0)],64)):c(``,!0)],8,et)}}}),lt=[`id`,`data-run-id`,`data-round`,`data-thread`],ut=[`open`],dt={class:`row flex min-w-0 cursor-pointer list-none flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted) [&::-webkit-details-marker]:hidden`},ft={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},$={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},pt={key:3,class:`scope min-w-0 flex-1 truncate text-toned`},mt=[`title`],ht=[`data-heat`],gt={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},_t={key:1,class:`row flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 px-2 py-2 hover:bg-(--ui-bg-muted)`},vt={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},yt={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},bt={key:3,class:`scope min-w-0 flex-1 truncate text-highlighted`},xt=[`title`],St={class:`elapsed shrink-0 text-right font-mono text-xs tabular-nums text-ok sm:min-w-[4.5em]`,title:`running for`},Ct={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},wt=o({__name:`RunFoldRow`,props:{run:{},now:{},label:{},open:{type:Boolean},land:{}},setup(n){let o=n,p=b(o.open===!0);r(()=>o.open,e=>{e&&(p.value=!0)});let m=S(()=>C(o.run.label||E(o.run.id))),_=S(()=>te(o.run)),y=S(()=>re(o.run)),T=S(()=>o.run.finished),k=S(()=>o.run.finished&&o.run.status&&o.run.status!==`completed`?O(o.run.status):``),A=S(()=>de(o.run.finished&&typeof o.run.finishedAt==`number`?o.run.finishedAt-o.run.startedAt:void 0,`run`)),j=S(()=>ue(A.value));function M(e){p.value=e.target.open}return(r,o)=>{let b=l(`RouterLink`);return d(),t(`li`,{id:`run-${n.run.id}`,class:s([`fold group border-b border-muted`,n.run.finished?`finished`:`live`]),"data-run-id":n.run.id,"data-round":n.run.round,"data-thread":n.run.thread},[T.value?(d(),t(`details`,{key:0,class:`group/fold`,open:p.value,onToggle:M},[f(`summary`,dt,[o[2]||=f(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open/fold:rotate-90 motion-reduce:transition-none`,"aria-hidden":`true`},`❯`,-1),e(B,{tone:_.value,label:h(D)(n.run),tip:h(F)(n.run)},null,8,[`tone`,`label`,`tip`]),n.label?(d(),t(`span`,ft,a(n.label),1)):c(``,!0),m.value.agent?(d(),t(`span`,{key:1,class:s([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider opacity-55`,h(R)[h(P)(m.value.agent)]])},a(m.value.agent),3)):c(``,!0),m.value.snippet===void 0?(d(),t(`span`,pt,a(m.value.scope),1)):(d(),t(`span`,$,a(m.value.snippet),1)),k.value?(d(),t(`span`,{key:4,class:s([`outcome shrink-0 rounded border px-1.5 font-mono text-[0.7rem]`,_.value===`red`?`border-bad/30 text-bad`:`border-warn/30 text-warn`])},a(k.value),3)):c(``,!0),f(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-dimmed`,title:h(N)(n.run)},a(h(w)(n.run.startedAt,n.now)),9,mt),f(`span`,{class:s([`elapsed shrink-0 text-right font-mono text-xs tabular-nums sm:min-w-[4.5em]`,[j.value?`heat`:`text-muted`,A.value.level>=2?`font-medium`:``]]),style:i(j.value),"data-heat":A.value.level,title:`start to finish`},a(h(I)(n.run,n.now)),15,ht),f(`span`,gt,a(h(L)(n.run)),1),e(b,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,to:y.value,"aria-label":`open run ${n.run.label||h(E)(n.run.id)}`,onClick:o[0]||=v(()=>{},[`stop`])},{default:u(()=>[...o[1]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]),p.value?(d(),x(ct,{key:0,run:n.run,land:n.land},null,8,[`run`,`land`])):c(``,!0)],40,ut)):(d(),t(`div`,_t,[o[4]||=f(`span`,{class:`chev select-none text-xs text-transparent`,"aria-hidden":`true`},`❯`,-1),e(B,{tone:_.value,label:h(D)(n.run),tip:h(F)(n.run),pulse:``},null,8,[`tone`,`label`,`tip`]),n.label?(d(),t(`span`,vt,a(n.label),1)):c(``,!0),m.value.agent?(d(),t(`span`,{key:1,class:s([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider`,h(R)[h(P)(m.value.agent)]])},a(m.value.agent),3)):c(``,!0),m.value.snippet===void 0?(d(),t(`span`,bt,a(m.value.scope),1)):(d(),t(`span`,yt,a(m.value.snippet),1)),f(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-muted`,title:h(N)(n.run)},a(h(w)(n.run.startedAt,n.now)),9,xt),f(`span`,St,a(h(I)(n.run,n.now)),1),f(`span`,Ct,a(h(L)(n.run)),1),e(b,{class:`open shrink-0 font-mono text-xs text-primary no-underline hover:underline`,to:y.value,"aria-label":`open run ${n.run.label||h(E)(n.run.id)}`},{default:u(()=>[...o[3]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]))],10,lt)}}});export{ye as a,H as i,Q as n,_e as o,q as r,pe as s,wt as t};
@@ -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,3*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};