@coreplane/switchboard 1.259.0 → 1.260.1
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 +17 -24
- package/dist/assets/deploy/cloudflare/worker.ts +17 -56
- package/dist/assets/deploy/cloudflare/wrangler.template.jsonc +6 -0
- package/dist/assets/deploy/cloudflare-memory/worker.ts +178 -27
- package/dist/assets/deploy/cloudflare-resident/worker.ts +74 -52
- package/dist/assets/deploy/cloudflare-sandbox/Dockerfile +6 -3
- package/dist/assets/deploy/profile.example.json +2 -1
- package/dist/assets/package-lock.json +3 -3
- package/dist/assets/package.json +1 -1
- package/dist/assets/source.json +3 -3
- package/dist/assets/src/agents/registry.ts +3 -5
- package/dist/assets/src/core/authz/policy.ts +5 -0
- package/dist/assets/src/core/budgets.ts +19 -6
- package/dist/assets/src/core/coordinator/contract.ts +93 -5
- package/dist/assets/src/core/coordinator/driver.ts +395 -128
- package/dist/assets/src/core/memory/types.ts +5 -0
- package/dist/assets/src/core/pipelineStanding.ts +13 -4
- package/dist/assets/src/core/plane/decide.ts +53 -12
- package/dist/assets/src/core/provider.ts +5 -0
- package/dist/assets/src/core/runEvents.ts +22 -15
- package/dist/assets/src/core/runLedger/types.ts +3 -3
- package/dist/assets/src/core/runRecord.ts +64 -11
- package/dist/assets/src/core/ship/coordinator.ts +202 -53
- package/dist/assets/src/core/ship/renewal.ts +23 -8
- package/dist/assets/src/core/types.ts +11 -0
- package/dist/assets/src/deploy/liveGate.ts +8 -0
- package/dist/assets/src/deploy/profile.ts +8 -0
- package/dist/assets/src/deploy/restart.ts +49 -35
- package/dist/assets/web/dist/.vite/manifest.json +67 -67
- package/dist/assets/web/dist/assets/{DeliveryPage-DadntjSp.js → DeliveryPage-62qCSLvk.js} +1 -1
- package/dist/assets/web/dist/assets/HomePage-Dk3HRBc3.js +1 -0
- package/dist/assets/web/dist/assets/{PendingTurnRow-DBPMLVsm.js → PendingTurnRow-CeTGOXUy.js} +1 -1
- package/dist/assets/web/dist/assets/{PlanePage-DLusMGQ0.js → PlanePage-RD0M6O6W.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentDetailPage-CPnHnrxy.js → ResidentDetailPage-Dl2KId95.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentsIndexPage-C9hASwHL.js → ResidentsIndexPage-DBy43I1R.js} +1 -1
- package/dist/assets/web/dist/assets/RunFoldRow-CwHDL-Mo.js +1 -0
- package/dist/assets/web/dist/assets/{RunRoutePage-o1xzkTGZ.js → RunRoutePage-Du1HqLZs.js} +4 -4
- package/dist/assets/web/dist/assets/RunsIndexPage-BZphy3Hr.js +1 -0
- package/dist/assets/web/dist/assets/{ScheduledPage-BIdfC0V3.js → ScheduledPage-B7jh898t.js} +1 -1
- package/dist/assets/web/dist/assets/{SettingsPage-CnqWAjl3.js → SettingsPage-3uLEsiiE.js} +1 -1
- package/dist/assets/web/dist/assets/{SilentTurn-DGNg0sIZ.js → SilentTurn-CKxSxnQC.js} +1 -1
- package/dist/assets/web/dist/assets/{StatusDot-D_D_iJS8.js → StatusDot-x7vcK0iE.js} +1 -1
- package/dist/assets/web/dist/assets/{Tooltip-DVFmM7on.js → Tooltip-wVXCWhMp.js} +1 -1
- package/dist/assets/web/dist/assets/{UnitRoutePage-7fAXFoB_.js → UnitRoutePage-V5BXK7FH.js} +1 -1
- package/dist/assets/web/dist/assets/budgets-KNNkT4PZ.js +1 -0
- package/dist/assets/web/dist/assets/{dist-C1VX-_mm.js → dist-C-XGnvM4.js} +1 -1
- package/dist/assets/web/dist/assets/{indexRow-BO_GIdF6.js → indexRow-Dxg7C8s9.js} +1 -1
- package/dist/assets/web/dist/assets/{main-Cl7xHG34.js → main-DAL--hyj.js} +2 -2
- package/dist/assets/web/dist/assets/sseReplay-BqgOggyQ.js +11 -0
- package/dist/cli.js +9136 -8197
- package/package.json +1 -1
- package/dist/assets/web/dist/assets/HomePage-BEEpTnVT.js +0 -1
- package/dist/assets/web/dist/assets/RunFoldRow-OPe7Z0Cz.js +0 -1
- package/dist/assets/web/dist/assets/RunsIndexPage-0YAClYQh.js +0 -1
- package/dist/assets/web/dist/assets/budgets-BRLm6oID.js +0 -1
- package/dist/assets/web/dist/assets/sseReplay-BjlKmQsY.js +0 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreplane/switchboard",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.260.1",
|
|
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
|
-
import{i as e,r as t,t as n}from"./AppShell-CSXDCV4x.js";import{An as r,Cn as i,Cr as a,Ft as o,Gr as s,Ii as c,Li as l,Mn as u,Pi as d,Pt as ee,Qr as f,Sn as p,Tr as m,Xr as h,_r as g,bn as _,c as v,dr as te,en as ne,hr as re,ir as ie,ji as y,kn as b,l as ae,ln as x,o as oe,sr as se,t as S,wr as ce,xi as C,xn as w,y as T,yi as E,yn as D,yr as le}from"./browser-B6T5hjfR.js";import{t as O}from"./Tooltip-DVFmM7on.js";import{i as ue}from"./PendingTurnRow-DBPMLVsm.js";import{b as de,x as fe}from"./main-Cl7xHG34.js";import{t as pe}from"./eventSource-Bj_dZf6M.js";import{t as me}from"./wallClock-DmaC1sKA.js";import{r as he}from"./indexFormat-B-pd4r7Y.js";import{K as ge,i as _e}from"./indexRow-BO_GIdF6.js";import"./format-BldUwl_R.js";import{S as k,_ as ve,a as ye,b as be,c as A,d as j,f as xe,g as Se,h as M,i as Ce,l as we,m as N,n as Te,o as Ee,p as De,r as Oe,s as P,t as ke,u as Ae,v as je,x as Me,y as Ne}from"./SilentTurn-DGNg0sIZ.js";import{t as F}from"./SlackMark-CtiHrNjr.js";import{T as Pe}from"./sseReplay-BjlKmQsY.js";var I={class:`thread-tip flex max-w-xs flex-col gap-1 text-xs`},Fe={class:`tip-title leading-snug text-highlighted`},L={class:`flex flex-wrap items-center gap-x-1.5 gap-y-0.5 font-mono text-[0.68rem] text-muted`},Ie={class:`tip-when tabular-nums`},Le={class:`tip-source inline-flex items-center gap-1`},Re={class:`tip-runs`},ze={key:0,class:`tip-live inline-flex items-center gap-1 text-toned`},R=u({__name:`ThreadTip`,props:{row:{},now:{}},setup(e){let t=e,n=D(()=>k(t.row,t.now));return(t,r)=>(g(),i(`div`,I,[_(`p`,Fe,l(n.value.title),1),_(`p`,L,[_(`span`,Ie,l(n.value.when),1),r[1]||=_(`span`,{"aria-hidden":`true`},`·`,-1),_(`span`,Le,[e.row.surface===`slack`?(g(),w(F,{key:0})):p(``,!0),b(l(n.value.source),1)]),r[2]||=_(`span`,{"aria-hidden":`true`},`·`,-1),_(`span`,Re,l(n.value.runs),1),n.value.live?(g(),i(`span`,ze,[...r[0]||=[_(`span`,{class:`size-1.5 rounded-full bg-ok`,"aria-hidden":`true`},null,-1),b(`live`,-1)]])):p(``,!0)])]))}}),z={class:`rail flex flex-col gap-1 text-[0.8rem]`,"aria-label":`Recent threads`},B={class:`filter mb-2 flex items-center gap-2 rounded-lg border border-default px-2.5 py-1.5 transition-colors duration-150 ease-out focus-within:border-primary hover:border-accented`},V={key:0,class:`rounded border border-default px-1 font-mono text-[0.65rem] text-dimmed`},Be={key:0,class:`empty px-3 py-1 text-xs text-dimmed`},H={key:1,class:`nomatch px-3 py-1 text-xs text-dimmed`},U={key:0,class:`dot mt-px size-1.5 shrink-0 self-center rounded-full bg-ok motion-safe:animate-pulse`,"aria-label":`a run is in flight`},Ve={class:`title min-w-0 flex-1 truncate text-toned group-hover:text-highlighted group-aria-[current=page]:text-highlighted`},He={class:`when shrink-0 font-mono text-[0.7rem] tabular-nums text-dimmed`},W={class:`retention px-3 pt-1 text-[0.7rem] leading-relaxed text-dimmed`},G={class:`model px-3 pt-2 text-[0.7rem] leading-relaxed text-dimmed`,"data-testid":`what-is-a-thread`},K=500,Ue=u({__name:`ConversationRail`,props:{rows:{},current:{},now:{},retention:{}},setup(e,{expose:t}){let n=e,s=C(``),c=C(null),u=D(()=>N(n.rows,s.value));function d(){c.value?.focus(),c.value?.select()}function ee(e){e.key===`Escape`&&(s.value=``,c.value?.blur())}return t({focusFilter:d}),(t,n)=>{let d=T,v=m(`RouterLink`),te=O;return g(),i(`nav`,z,[r(v,{class:`new group mb-3 flex items-center gap-2 rounded-xl bg-inverted px-3 py-2 font-medium text-inverted no-underline transition-[transform,opacity] duration-150 ease-out hover:-translate-y-px hover:opacity-90 active:translate-y-0 active:opacity-100`,to:`/threads`,"aria-current":e.current===``?`page`:void 0,"data-testid":`new-thread`},{default:h(()=>[r(d,{name:`i-lucide-plus`,class:`size-4 shrink-0 transition-transform duration-150 ease-out group-hover:rotate-90`,"aria-hidden":`true`}),n[1]||=_(`span`,null,`New thread`,-1),n[2]||=_(`span`,{class:`kbd ml-auto flex gap-0.5 font-mono text-[0.65rem] opacity-70`,"aria-label":`shortcut shift command O`},[_(`kbd`,{class:`rounded border border-current/30 px-1`},`⇧`),_(`kbd`,{class:`rounded border border-current/30 px-1`},`⌘`),_(`kbd`,{class:`rounded border border-current/30 px-1`},`O`)],-1)]),_:1},8,[`aria-current`]),_(`label`,B,[r(d,{name:`i-lucide-search`,class:`size-3.5 shrink-0 text-dimmed`,"aria-hidden":`true`}),f(_(`input`,{ref_key:`filter`,ref:c,"onUpdate:modelValue":n[0]||=e=>s.value=e,class:`min-w-0 flex-1 bg-transparent text-[0.8rem] text-highlighted outline-none placeholder:text-dimmed`,type:`text`,placeholder:`Filter recent`,"aria-label":`Filter recent threads`,autocomplete:`off`,onKeydown:ee},null,544),[[ne,s.value]]),s.value?p(``,!0):(g(),i(`kbd`,V,`⌘K`))]),n[8]||=_(`p`,{class:`label px-3 pb-1 font-mono text-[0.65rem] font-medium uppercase tracking-wider text-dimmed`},`Recent`,-1),e.rows.length===0?(g(),i(`p`,Be,`Nothing yet. Ask something.`)):u.value.length===0?(g(),i(`p`,H,`Nothing matches "`+l(s.value)+`".`,1)):p(``,!0),r(o,{name:`sb-rise`,tag:`div`,class:`rows flex flex-col gap-0.5`},{default:h(()=>[(g(!0),i(x,null,a(u.value,t=>(g(),i(`div`,{key:t.id},[r(te,{"delay-duration":K,content:{side:`right`,sideOffset:12,align:`start`},ui:{content:`h-auto max-w-xs px-2.5 py-2`}},{content:h(()=>[r(R,{row:t,now:e.now},null,8,[`row`,`now`])]),default:h(()=>[r(v,{class:`row group relative flex items-baseline gap-2 rounded-lg px-3 py-1.5 no-underline transition-colors duration-150 ease-out hover:bg-(--ui-bg-muted) aria-[current=page]:bg-(--ui-bg-accented)`,to:`/threads/${encodeURIComponent(t.id)}`,"aria-current":t.id===e.current?`page`:void 0,"data-surface":t.surface},{default:h(()=>[n[3]||=_(`span`,{class:`bar absolute left-0 top-1/2 h-4 w-0.5 -translate-y-1/2 rounded-full bg-primary opacity-0 transition-opacity duration-150 ease-out group-aria-[current=page]:opacity-100`,"aria-hidden":`true`},null,-1),t.live?(g(),i(`span`,U)):p(``,!0),_(`span`,Ve,l(t.title),1),_(`span`,He,l(y(j)(t.lastAt,e.now)),1)]),_:2},1032,[`to`,`aria-current`,`data-surface`])]),_:2},1024)]))),128))]),_:1}),r(v,{class:`all mt-3 flex items-center gap-1.5 px-3 py-1 text-xs font-medium text-muted no-underline transition-colors duration-150 ease-out hover:text-highlighted`,to:`/runs`,"data-testid":`all-runs`},{default:h(()=>[n[4]||=b(` All runs `,-1),r(d,{name:`i-lucide-arrow-right`,class:`size-3 transition-transform duration-150 ease-out group-hover:translate-x-0.5`,"aria-hidden":`true`})]),_:1}),_(`p`,W,l(e.retention),1),_(`p`,G,[n[6]||=b(` A thread is a conversation; each message you send is a run. `,-1),r(v,{class:`text-muted hover:text-highlighted`,to:`/runs`},{default:h(()=>[...n[5]||=[b(`Runs`,-1)]]),_:1}),n[7]||=b(` lists every run across everyone's threads. `,-1)])])}}}),We={class:`empty mx-auto flex w-full max-w-2xl flex-col items-center gap-5 px-3 py-6 text-center`},Ge={class:`flex flex-col gap-1.5`},Ke={class:`greeting sb-stagger text-xl font-medium tracking-tight text-highlighted`,style:{"--sb-i":`1`}},qe={class:`sb-stagger w-full text-left`,style:{"--sb-i":`3`}},q={key:0,class:`chips flex flex-wrap justify-center gap-2`,"aria-label":`Suggestions`},J=[`onClick`],Je=u({__name:`EmptyState`,props:{name:{},hour:{},suggestions:{}},emits:[`pick`],setup(e,{emit:n}){let o=n;return(n,s)=>(g(),i(`section`,We,[r(t,{draw:``,idle:``,class:`mark-lg sb-stagger text-highlighted`,style:{"font-size":`3.25rem`,"--sb-i":`0`}}),_(`div`,Ge,[_(`h2`,Ke,l(y(M)(e.hour,e.name)),1),s[0]||=_(`p`,{class:`sub sb-stagger text-[0.875rem] text-muted`,style:{"--sb-i":`2`}},` Ask in plain words. The right agent picks it up, and you watch it work here. `,-1)]),_(`div`,qe,[ce(n.$slots,`default`)]),e.suggestions.length>0?(g(),i(`ul`,q,[(g(!0),i(x,null,a(e.suggestions,(e,t)=>(g(),i(`li`,{key:e,class:`sb-stagger`,style:c({"--sb-i":t+4})},[_(`button`,{type:`button`,class:`chip rounded-full border border-default px-3 py-1 text-[0.8rem] text-toned transition-[color,border-color,background-color,transform] duration-150 ease-out hover:-translate-y-px hover:border-accented hover:bg-(--ui-bg-muted) hover:text-highlighted focus-visible:outline-2 focus-visible:outline-primary active:translate-y-0`,onClick:t=>o(`pick`,e)},l(e),9,J)],4))),128))])):p(``,!0)]))}});function Ye(){return{runs:new Map,connected:!1}}function Xe(e,t){t.type===`upsert`&&t.run?t.run.finished||!t.run.threadKey?e.runs.delete(t.run.id):e.runs.set(t.run.id,{threadKey:t.run.threadKey,startedAt:t.run.startedAt,...t.run.label===void 0?{}:{label:t.run.label},...t.run.channelId===void 0?{}:{channelId:t.run.channelId}}):t.type===`removed`&&t.id&&e.runs.delete(t.id)}function Y(e){let t=new Map;for(let n of e.runs.values()){let e=t.get(n.threadKey)??[];e.push(n),t.set(n.threadKey,e)}return t}function Ze(e,t){return t.includes(`:`)?t:`${e}:${t}`}function Qe(e){let t=e.indexOf(`:`);return t>0?e.slice(0,t):`unknown`}function $e(e,t,n){if(!t.connected)return[...e];let r=Y(t),i=new Set,a=e.map(e=>{let t=Ze(n,e.id);i.add(t);let a=r.get(t);if(!a)return e.live?{...e,live:!1}:e;let o=e.live?0:a.length;return{...e,live:!0,runs:e.runs+o,lastAt:Math.max(e.lastAt,...a.map(e=>e.startedAt))}}),o=[];for(let[e,t]of r){if(i.has(e))continue;let r=t.reduce((e,t)=>t.startedAt>e.startedAt?t:e),a=r.label?he(r.label).snippet:void 0;o.push({id:e.startsWith(`${n}:`)?e.slice(n.length+1):e,title:a??r.label??e,excerpt:a??r.label??e,lastAt:r.startedAt,runs:t.length,live:!0,surface:Qe(r.channelId??e)})}return o.sort((e,t)=>t.lastAt-e.lastAt),[...o,...a]}var et={key:0,class:`mx-auto my-12 max-w-xl text-center text-toned`},tt=[`data-rail`],nt={key:0,class:`relative hidden md:block`},rt=[`aria-valuemin`,`aria-valuemax`,`aria-valuenow`],it={class:`thread mx-auto flex min-h-[calc(100vh-8rem)] w-full max-w-3xl flex-col`},at={key:4,class:`inline text-[0.875rem] text-toned`,"data-testid":`inline`},ot={key:2,class:`elsewhere sticky bottom-0 z-10 -mx-3 mt-auto bg-default/85 px-3 py-4 text-center text-[0.8rem] text-toned backdrop-blur sm:-mx-5 sm:px-5`,"data-testid":`elsewhere`},st=[`href`],ct={key:3,class:`composer-dock sticky bottom-0 z-10 -mx-3 mt-auto bg-default/85 px-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-3 backdrop-blur sm:-mx-5 sm:px-5`},X=`(min-width: 48rem)`,Z=u({__name:`HomePage`,setup(t){let u=oe(`home`),f=me(u?.now),m=u?.conversation??``,ne=v(u?.retentionDays??null),ce=0,T=e=>`${e}-${++ce}`,O=E([]);for(let e of u?.turns??[]){if(`kind`in e){e.kind===`receipt`?O.push({key:T(`s`),kind:`silent`,reason:e.reason,at:e.decidedAt}):O.push({key:T(`w`),kind:`parent`,turn:e});continue}O.push({key:T(`p`),kind:`person`,text:e.request,at:e.receivedAt??e.startedAt,pending:!1});let t=!e.finished&&e.token?{eventsUrl:`/runs/${encodeURIComponent(e.id)}/events?t=${e.token}`,stopUrl:`/runs/${encodeURIComponent(e.id)}/stop?t=${e.token}`,serverNow:u?.now}:null;O.push({key:T(`a`),kind:`assistant`,turn:e,live:t,ended:e.finished})}let he=D(()=>{for(let e=O.length-1;e>=0;e--){let t=O[e];if(t.kind===`assistant`&&t.live&&!t.ended&&t.turn.hosted!==!0)return t}return null}),k=C(null),j=C(0);le(e,j);let M=C(``),N=C(void 0),F=D(()=>xe(he.value!==null,M.value)),I=C(!1);s(M,()=>{N.value&&M.value===``&&(N.value=void 0)});function Fe(e){M.value=e,L()}async function L(){if(!u||I.value)return;let e=Ee(M.value.trim(),u.commands);if(e===``)return;let t=E({key:T(`p`),kind:`person`,text:e,at:f.value,pending:!0});O.push(t),M.value=``,N.value=void 0,I.value=!0,j.value++;try{let n=await fetch(u.sendUrl,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({text:e})}),r=await n.json().catch(()=>({}));if(n.status===202&&typeof r.viewPath==`string`&&typeof r.runId==`string`){let n=Se(r.viewPath);if(!n)throw Error(`the run's view path was not one`);t.pending=!1,S.pathname()===`/threads`&&S.replaceUrl(`/threads/${encodeURIComponent(m)}`),O.push({key:T(`a`),kind:`assistant`,turn:{id:r.runId,request:e,startedAt:f.value,receivedAt:f.value,finished:!1,eventCount:0},live:{eventsUrl:n.eventsUrl,stopUrl:n.stopUrl},ended:!1});return}if(n.ok&&r.offer&&typeof r.offer.line==`string`){t.pending=!1;let e=je({line:r.offer.line,...r.offer});M.value=e.command,N.value=e.hint;return}if(n.ok&&typeof r.reply==`string`){t.pending=!1;let e=Ae(r.reply);e.kind===`inline`&&O.push({key:T(`i`),kind:`inline`,text:e.text});return}throw Error(r.error??`HTTP ${n.status}`)}catch(e){t.pending=!1,t.failed=`not sent: ${e instanceof Error?e.message:`error`}`}finally{I.value=!1}}function Ie(){let e=k.value;e&&fetch(`${e}${e.includes(`?`)?`&`:`?`}mode=soft`,{method:`POST`,credentials:`same-origin`})}function Le(e,t,n){let r=O.filter(e=>e.kind===`person`),i=ve(r.map(e=>({text:e.text,folded:e.folded!==void 0,ref:e})),t);if(!i)return;let a=e.turn.receivedAt??e.turn.startedAt;i.ref.folded=n===void 0?``:`at ${ge(Math.max(0,n-a),`clock`)}`}function Re(e){e.ended=!0,k.value=null}let ze=Ne({width:S.readPref(P.width),collapsed:S.readPref(P.collapsed)}),R=C(ze.width),z=C(ze.collapsed),B=C(!1),V=C(S.mediaMatches(X)),Be=S.onMediaChange(X,e=>{V.value=e}),H=C(null),U=C(null),Ve=D(()=>V.value?z.value?`Show recent threads`:`Hide recent threads`:`Recent threads`);function He(){if(V.value=S.mediaMatches(X),V.value){z.value=!z.value,S.writePref(P.collapsed,z.value?`1`:`0`);return}B.value=!0}function W(e,t){R.value=we(e),t&&S.writePref(P.width,String(R.value))}let G=null;function K(e){G&&W(G.startWidth+(e.clientX-G.startX),!1)}function We(){window.removeEventListener(`pointermove`,K),G&&(G=null,S.writePref(P.width,String(R.value)))}function Ge(e){e.button===0&&(e.preventDefault(),G={startX:e.clientX,startWidth:R.value},e.currentTarget?.setPointerCapture?.(e.pointerId),window.addEventListener(`pointermove`,K),window.addEventListener(`pointerup`,We,{once:!0}))}function Ke(e){if(e.key===`ArrowRight`)W(R.value+A.step,!0);else if(e.key===`ArrowLeft`)W(R.value-A.step,!0);else if(e.key===`Home`)W(A.min,!0);else if(e.key===`End`)W(A.max,!0);else return;e.preventDefault()}se(()=>{window.removeEventListener(`pointermove`,K),window.removeEventListener(`pointerup`,We),Be()});function qe(e){let t=be(e);if(t){if(e.preventDefault(),t===`newThread`){S.navigate(`/threads`);return}if(H.value){H.value.focusFilter();return}if(z.value&&S.mediaMatches(X)){z.value=!1,S.writePref(P.collapsed,`0`),ie().then(()=>H.value?.focusFilter());return}B.value=!0,ie().then(()=>U.value?.focusFilter())}}let q=C(null),J=C(!1);function Y(){return document.body.scrollHeight-(window.innerHeight+window.scrollY)}s(()=>O.length,()=>{let e=Me(Y());ie().then(()=>{e?q.value?.scrollIntoView?.({block:`end`}):J.value=!0})});function Ze(){Me(Y())&&(J.value=!1)}function Qe(){q.value?.scrollIntoView?.({block:`end`,behavior:`smooth`}),J.value=!1}te(()=>{window.addEventListener(`scroll`,Ze,{passive:!0}),window.addEventListener(`keydown`,qe),u&&ft()}),re(()=>{window.removeEventListener(`scroll`,Ze),window.removeEventListener(`keydown`,qe),Q?.close()});let Z=E(Ye()),lt=D(()=>$e(u?.conversations??[],Z,u?.lane??``)),ut=D(()=>{let e=he.value?.turn.id;return Z.runs.size+(e&&!Z.runs.has(e)?1:0)}),dt=pe(),Q=null;function ft(){Q=dt(`/runs?stream=1&mine=1`);let e=!1;Q.onopen=()=>{e&&Z.runs.clear(),e=!0,Z.connected=!0},Q.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}Xe(Z,t)}}let pt=D(()=>{let e=O.find(e=>e.kind===`person`);return e?De(e.text):`Switchboard`});s([pt,ut],([e,t])=>{S.setTitle(t>0?`(${t}) ${e}`:e),S.setFavicon(t>0?fe:de)},{immediate:!0});let mt=D(()=>new Date(f.value).getHours()),ht=D(()=>O.length===0),$=u?.elsewhere,gt=$?$.surface===`web`?`This thread is another person's conversation. You can read it here.`:`This thread lives in ${_e[$.surface]??$.surface}.`:``;return(e,t)=>{let s=ae,v=ue;return g(),w(n,{title:`Threads`,nav:`home`},{leading:h(()=>[r(s,{class:`rail-toggle -ml-1`,size:`xs`,color:`neutral`,variant:`ghost`,icon:V.value&&!z.value?`i-lucide-panel-left-close`:`i-lucide-panel-left`,"aria-label":Ve.value,"aria-expanded":V.value?!z.value:void 0,onClick:He},null,8,[`icon`,`aria-label`,`aria-expanded`])]),default:h(()=>[y(u)?(g(),i(`div`,{key:1,class:d([`home gap-8 md:grid`,z.value?`md:grid-cols-[minmax(0,1fr)]`:`md:grid-cols-[var(--rail-w)_minmax(0,1fr)]`]),style:c({"--rail-w":`${R.value}px`}),"data-rail":z.value?`hidden`:`shown`},[z.value?p(``,!0):(g(),i(`aside`,nt,[r(Ue,{ref_key:`rail`,ref:H,class:`sticky top-20`,rows:lt.value,current:y(m),now:y(f),retention:y(ne)},null,8,[`rows`,`current`,`now`,`retention`]),_(`div`,{class:`handle group/handle absolute inset-y-0 -right-5 flex w-3 cursor-col-resize touch-none select-none justify-center outline-none`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize the recent threads column`,"aria-valuemin":y(A).min,"aria-valuemax":y(A).max,"aria-valuenow":R.value,tabindex:`0`,"data-testid":`rail-handle`,onPointerdown:Ge,onKeydown:Ke,onDblclick:t[0]||=e=>W(y(A).default,!0)},[...t[5]||=[_(`span`,{class:`w-px rounded-full bg-(--ui-border-accented) opacity-0 transition-opacity duration-150 ease-out group-hover/handle:opacity-100 group-focus-visible/handle:opacity-100`,"aria-hidden":`true`},null,-1)]],40,rt)])),r(v,{open:B.value,"onUpdate:open":t[1]||=e=>B.value=e,side:`left`,title:`Recent threads`,ui:{content:`max-w-xs`}},{body:h(()=>[r(Ue,{ref_key:`sheetRail`,ref:U,rows:lt.value,current:y(m),now:y(f),retention:y(ne)},null,8,[`rows`,`current`,`now`,`retention`])]),_:1},8,[`open`]),_(`section`,it,[ht.value?(g(),w(Je,{key:0,class:`mb-auto mt-[clamp(1.5rem,14vh,9rem)]`,name:y(u).viewer.name,hour:mt.value,suggestions:y(u).suggestions,onPick:Fe},{default:h(()=>[r(ye,{modelValue:M.value,"onUpdate:modelValue":t[2]||=e=>M.value=e,mode:F.value,hint:N.value,commands:y(u).commands,autofocus:``,"sweep-on-mount":``,onSubmit:L,onStop:Ie},null,8,[`modelValue`,`mode`,`hint`,`commands`])]),_:1},8,[`name`,`hour`,`suggestions`])):(g(),w(o,{key:1,name:`sb-rise`,"move-class":`sb-move-move`,tag:`ol`,class:`transcript m-0 flex list-none flex-col gap-6 p-0 pb-32 pt-2`},{default:h(()=>[(g(!0),i(x,null,a(O,e=>(g(),i(`li`,{key:e.key},[e.kind===`person`?(g(),w(Ce,{key:0,text:e.text,at:e.at,now:y(f),pending:e.pending,folded:e.folded,failed:e.failed},null,8,[`text`,`at`,`now`,`pending`,`folded`,`failed`])):e.kind===`assistant`?(g(),w(Oe,{key:1,turn:e.turn,live:e.live,now:y(f),onInput:(t,n)=>Le(e,t,n),onEnded:t=>Re(e),onStop:t[3]||=e=>k.value=e},null,8,[`turn`,`live`,`now`,`onInput`,`onEnded`])):e.kind===`silent`?(g(),w(ke,{key:2,reason:e.reason,"decided-at":e.at,now:y(f)},null,8,[`reason`,`decided-at`,`now`])):e.kind===`parent`?(g(),w(Te,{key:3,turn:e.turn,now:y(f)},null,8,[`turn`,`now`])):(g(),i(`div`,at,[r(Pe,{text:e.text},null,8,[`text`])]))]))),128))]),_:1})),_(`div`,{ref_key:`end`,ref:q,class:`end`,"aria-hidden":`true`},null,512),!ht.value&&y($)?(g(),i(`p`,ot,[b(l(y(gt))+` `,1),y($).url?(g(),i(`a`,{key:0,href:y($).url,target:`_blank`,rel:`noopener`,class:`text-highlighted`},`Reply there ↗`,8,st)):y($).surface===`web`?p(``,!0):(g(),i(x,{key:1},[b(`Reply there.`)],64))])):ht.value?p(``,!0):(g(),i(`div`,ct,[r(ee,{name:`sb-rise`},{default:h(()=>[J.value?(g(),i(`button`,{key:0,type:`button`,class:`new-pill absolute -top-9 left-1/2 -translate-x-1/2 rounded-full border border-default bg-(--ui-bg-elevated) px-3 py-1 font-mono text-[0.7rem] text-toned shadow-sm hover:text-highlighted`,onClick:Qe},` ↓ new `)):p(``,!0)]),_:1}),r(ye,{modelValue:M.value,"onUpdate:modelValue":t[4]||=e=>M.value=e,mode:F.value,hint:N.value,commands:y(u).commands,autofocus:``,onSubmit:L,onStop:Ie},null,8,[`modelValue`,`mode`,`hint`,`commands`])]))])],14,tt)):(g(),i(`div`,et,`This page needs its seed.`))]),_:1})}}});export{Z as default};
|
|
@@ -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-B6T5hjfR.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-BO_GIdF6.js";import"./format-BldUwl_R.js";import{n as ae}from"./SlackMark-CtiHrNjr.js";import{c as oe,l as se,n as ce,t as le,w as z}from"./sseReplay-BjlKmQsY.js";import{n as ue,t as de}from"./durationTone-CVpX_yIk.js";import{t as B}from"./StatusDot-D_D_iJS8.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`,blocked:`blocked`};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
|
-
import{n as e,o as t,t as n}from"./AppShell-CSXDCV4x.js";import{An as r,Cn as i,Cr as a,Gr as o,Ii as s,Li as c,Mn as l,Pi as u,Sn as d,Tr as ee,Xr as f,_r as p,bn as m,c as h,dr as g,hr as _,ji as v,kn as y,l as b,ln as x,o as S,t as C,xi as w,xn as T,yi as E,yn as D}from"./browser-B6T5hjfR.js";import{t as O}from"./Tooltip-DVFmM7on.js";import{t as k}from"./InputMenu-BdZXnibG.js";import{b as A,x as j}from"./main-Cl7xHG34.js";import{t as M}from"./eventSource-Bj_dZf6M.js";import{t as N}from"./wallClock-DmaC1sKA.js";import{n as te,r as P,t as ne}from"./indexFormat-B-pd4r7Y.js";import{A as F,C as I,D as L,E as R,M as z,N as B,O as re,S as V,T as ie,_ as H,a as U,b as ae,c as oe,d as W,f as G,g as se,h as K,i as q,j as J,k as ce,l as le,m as ue,o as de,p as fe,r as Y,s as pe,t as me,u as he,v as ge,w as _e,x as ve,y as ye}from"./indexRow-BO_GIdF6.js";import{i as be}from"./format-BldUwl_R.js";import{t as X}from"./SlackMark-CtiHrNjr.js";import{n as xe,t as Se}from"./durationTone-CVpX_yIk.js";import{t as Z}from"./RunsTabs-kHbbxVHx.js";import{t as Ce}from"./StatusDot-D_D_iJS8.js";var Q={class:`flex items-baseline gap-1.5 whitespace-pre-line px-2 py-1 text-xs`},we=[`data-kind`,`aria-label`,`href`],Te=[`data-kind`],Ee=l({__name:`SourceMark`,props:{kind:{},tip:{},url:{}},setup(e){let t=e,n=()=>q[t.kind]??t.kind;return(t,r)=>{let a=O;return e.url?(p(),T(a,{key:0},{content:f(()=>[m(`span`,Q,[e.kind===`slack`?(p(),T(X,{key:0})):d(``,!0),m(`span`,null,c(e.tip),1)])]),default:f(()=>[m(`a`,{class:`source linked pointer-events-auto w-[1.6em] shrink-0 rounded border border-transparent text-center text-[0.8rem] text-toned opacity-0 transition-opacity hover:border-primary/30 hover:bg-primary/10 hover:text-primary focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 motion-reduce:transition-none`,"data-kind":e.kind,"aria-label":`open the ${n()} thread (new tab)`,href:e.url,target:`_blank`,rel:`noopener noreferrer`},`↗`,8,we)]),_:1})):(p(),i(`span`,{key:1,class:`source w-[1.6em] shrink-0`,"data-kind":e.kind,"aria-hidden":`true`},null,8,Te))}}}),De=[`data-run-id`,`data-parent-id`,`data-started-at`,`data-persisted`,`data-stalled`,`data-expires-at`],Oe={class:`pointer-events-auto flex items-center max-sm:order-1`},ke=[`data-user-id`,`data-surface`],Ae={class:`surface mr-1.5 inline-block w-[3.6em] rounded border border-accented text-center font-mono text-[0.62rem] text-dimmed`},je={class:`name`},Me={key:1,class:`who shrink-0 max-sm:hidden sm:w-[14em]`,"aria-hidden":`true`},Ne=[`data-agent-hue`],Pe=[`href`],Fe={class:`owner font-normal text-dimmed`},Ie={class:`name`},Le={key:5,class:`snippet min-w-0 truncate text-muted max-sm:order-6 max-sm:basis-full max-sm:whitespace-normal max-sm:pl-5 max-sm:text-[0.8rem] max-sm:leading-snug max-sm:line-clamp-2 sm:flex-1`},Re={class:`hidden sm:contents`},ze={class:`expires pointer-events-auto shrink-0 font-mono text-xs tabular-nums text-warn max-sm:order-11`},Be=[`data-heat`],Ve={class:`count shrink-0 text-right font-mono text-xs tabular-nums max-sm:order-9 max-sm:text-dimmed sm:min-w-[6em] sm:text-muted`},He=[`data-inherited`],Ue={class:`actions flex shrink-0 justify-end max-sm:order-5 sm:w-[2em]`},$=l({__name:`RunRow`,props:{run:{},now:{},retentionMs:{},nestedUnder:{},children:{}},setup(e){let n=e,a=D(()=>P(n.run.label||I(n.run.id))),o=D(()=>H(n.run,a.value.scope)),l=D(()=>ie(n.run)),h=D(()=>ve(n.run)),g=D(()=>F(n.run)),_=D(()=>B(n.run)),y=D(()=>V(n.run)),x=D(()=>n.run.threadKey?J(n.run.threadKey):null),S=D(()=>he(n.run,n.retentionMs)),w=D(()=>S.value!==void 0&&S.value-n.now<=864e5),k=D(()=>!n.run.finished&&!n.run.stop),A=D(()=>Se(n.run.finished&&typeof n.run.finishedAt==`number`?n.run.finishedAt-n.run.startedAt:void 0,`run`)),j=D(()=>xe(A.value)),M=D(()=>n.run.finished&&n.run.status&&n.run.status!==`completed`?R(n.run.status):``),N=D(()=>n.run.stop&&!(n.run.finished&&n.run.status)?ce(n.run.stop):``),W=D(()=>ge(n.run,n.now)),G=D(()=>n.run.hosted&&n.children!==void 0?fe({head:n.run,children:n.children},n.now):void 0),K=D(()=>W.value??G.value?.text??ye(n.run,n.now)),Y=D(()=>ae(n.run,n.now)),X=E({soft:!1,hard:!1}),Z=D(()=>[...x.value?[{label:`Open thread`,icon:`i-lucide-messages-square`,to:x.value}]:[],...y.value?[{label:`Open in ${q[g.value.kind]??g.value.kind}`,icon:`i-lucide-external-link`,to:y.value,target:`_blank`}]:[],...k.value?[{label:`Stop (soft)`,icon:`i-lucide-octagon-pause`,disabled:X.soft,onSelect:()=>Q(`soft`)},{label:`Kill (hard)`,icon:`i-lucide-octagon-x`,color:`error`,disabled:X.hard,onSelect:()=>Q(`hard`)}]:[]]);function Q(e){(e!==`hard`||C.confirm(`Hard stop: abort this run now with no summary and free its sandbox?`))&&(X[e]=!0,fetch(re(n.run,e),{method:`POST`,credentials:`same-origin`}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`)}).catch(()=>{X[e]=!1}))}function we(e){e.target?.closest(`a, button`)||C.navigate(h.value)}return(n,x)=>{let C=ee(`RouterLink`),E=O,D=b,k=t;return p(),i(`li`,{class:u([`run group relative isolate rounded-md border-b border-muted hover:bg-(--ui-bg-muted) focus-within:bg-(--ui-bg-muted)`,[e.run.finished?`finished`:`live`,w.value?`leaving`:``,e.nestedUnder?`nested ml-4 border-l-2 border-accented sm:ml-6`:``]]),"data-run-id":e.run.id,"data-parent-id":e.nestedUnder,"data-started-at":String(e.run.startedAt),"data-persisted":e.run.persisted?`1`:void 0,"data-stalled":Y.value?`1`:void 0,"data-expires-at":S.value===void 0?void 0:String(S.value),onClick:we},[r(C,{class:`row absolute inset-0 rounded-md focus-visible:outline-2 focus-visible:outline-primary`,to:h.value,"aria-label":`open run ${e.run.label||v(I)(e.run.id)}`},null,8,[`to`,`aria-label`]),m(`div`,{class:u([`body pointer-events-none relative z-[1] flex min-w-0 flex-wrap items-center gap-x-2.5 px-2 max-sm:gap-y-1.5 max-sm:py-3 sm:flex-nowrap sm:py-2`,[e.run.finished?`text-muted`:``,w.value?`opacity-85`:``]])},[m(`span`,Oe,[r(Ce,{tone:l.value,label:v(L)(e.run),tip:v(oe)(e.run),pulse:!e.run.finished},null,8,[`tone`,`label`,`tip`,`pulse`])]),r(E,{text:v(z)(e.run),ui:{text:`whitespace-pre-line`}},{default:f(()=>[m(`span`,{class:u([`when pointer-events-auto shrink-0 font-mono tabular-nums max-sm:order-7 max-sm:pl-5 max-sm:text-xs max-sm:text-dimmed sm:min-w-[8.5em] sm:text-[0.8rem]`,e.run.finished?`text-dimmed`:`text-muted`])},c(v(te)(e.run.startedAt,e.now)),3)]),_:1},8,[`text`]),_.value?(p(),T(E,{key:0,text:v(_e)(e.run)},{default:f(()=>[m(`span`,{class:u([`who pointer-events-auto min-w-0 shrink-0 truncate text-[0.8rem] max-sm:order-7 max-sm:text-xs sm:w-[14em]`,e.run.finished?`text-dimmed`:`text-muted`]),"data-user-id":e.run.userId,"data-surface":g.value.kind},[m(`span`,Ae,c(g.value.kind),1),m(`span`,je,c(_.value),1)],10,ke)]),_:1},8,[`text`])):(p(),i(`span`,Me)),a.value.agent?(p(),i(`span`,{key:2,class:u([`agent shrink-0 rounded border px-1.5 font-mono text-[0.68rem] font-medium uppercase tracking-wider max-sm:order-2`,[v(me)[v(U)(a.value.agent)],e.run.finished?`opacity-55`:``]]),"data-agent-hue":v(U)(a.value.agent)},c(a.value.agent),11,Ne)):d(``,!0),o.value?(p(),T(E,{key:3,text:o.value},{default:f(()=>[m(`a`,{class:`repo pointer-events-auto min-w-0 shrink-0 rounded border border-accented bg-accented/50 px-1.5 font-mono text-[0.72rem] font-medium leading-normal text-toned no-underline hover:border-(--ui-text-dimmed) hover:text-highlighted max-sm:order-3`,href:`https://github.com/${o.value}`,target:`_blank`,rel:`noopener noreferrer`},[m(`span`,Fe,c(o.value.slice(0,o.value.indexOf(`/`)+1)),1),m(`span`,Ie,c(o.value.slice(o.value.indexOf(`/`)+1)),1)],8,Pe)]),_:1},8,[`text`])):(p(),i(`span`,{key:4,class:u([`scope min-w-0 shrink-0 truncate font-medium max-sm:order-3`,e.run.finished?`text-toned`:`text-highlighted`])},c(a.value.scope),3)),a.value.snippet===void 0?d(``,!0):(p(),i(`span`,Le,c(a.value.snippet),1)),M.value?(p(),i(`span`,{key:6,class:u([`outcome shrink-0 rounded border px-1.5 font-mono text-[0.7rem] max-sm:order-10`,l.value===`red`?`border-bad/30 text-bad`:`border-warn/30 text-warn`])},c(M.value),3)):d(``,!0),N.value?(p(),i(`span`,{key:7,class:u([`stopbadge shrink-0 rounded border px-1.5 font-mono text-[0.7rem] max-sm:order-10`,e.run.stop?.state===`stopped`?`border-accented text-muted`:`border-warn/30 text-warn`])},c(N.value),3)):d(``,!0),Y.value?(p(),i(`span`,{key:8,class:u([`stalled shrink-0 rounded border px-1.5 font-mono text-[0.7rem] max-sm:order-10`,W.value?`border-bad/30 text-bad`:`border-warn/30 text-warn`])},`stalled`,2)):d(``,!0),m(`span`,Re,[r(Ee,{kind:g.value.kind,tip:v(_e)(e.run),url:y.value||void 0},null,8,[`kind`,`tip`,`url`])]),w.value&&S.value!==void 0?(p(),T(E,{key:9,text:`removed at ${v(be)(S.value)}`},{default:f(()=>[m(`span`,ze,`gone `+c(v(ne)(S.value,e.now)),1)]),_:1},8,[`text`])):d(``,!0),r(E,{text:e.run.finished?`start to finish`:`running for`},{default:f(()=>[m(`span`,{class:u([`elapsed pointer-events-auto ml-auto shrink-0 text-right font-mono text-xs tabular-nums max-sm:order-4 sm:min-w-[4.5em]`,e.run.finished?[j.value?`heat`:`text-muted`,A.value.level>=2?`font-medium`:``]:`text-ok`]),style:s(e.run.finished?j.value:void 0),"data-heat":e.run.finished?A.value.level:void 0},c(v(le)(e.run,e.now)),15,Be)]),_:1},8,[`text`]),x[0]||=m(`span`,{class:`hidden text-xs text-dimmed max-sm:order-8 max-sm:inline`,"aria-hidden":`true`},`·`,-1),r(E,{text:v(pe)(e.run)},{default:f(()=>[m(`span`,Ve,c(v(de)(e.run)),1)]),_:1},8,[`text`]),K.value?(p(),T(E,{key:10,text:G.value&&!W.value?v(ue)(G.value):v(se)(e.run,e.now)},{default:f(()=>[m(`span`,{class:u([`pace pointer-events-auto shrink-0 text-right font-mono text-xs tabular-nums max-sm:order-9`,W.value?`text-bad font-medium`:Y.value?`text-warn`:`text-dimmed`]),"data-inherited":G.value&&!W.value?G.value.child?`child`:`waiting`:void 0},c(K.value),11,He)]),_:1},8,[`text`])):d(``,!0),m(`span`,Ue,[Z.value.length>0?(p(),T(k,{key:0,items:Z.value,content:{align:`end`}},{default:f(()=>[r(D,{class:`pointer-events-auto -my-1.5 -mr-1`,size:`sm`,color:`neutral`,variant:`ghost`,icon:`i-lucide-ellipsis-vertical`,"aria-label":`Run actions`})]),_:1},8,[`items`])):d(``,!0)])],2)],10,De)}}}),We={class:`view-as-picker inline-flex items-center gap-2`},Ge={key:0,class:`ml-2 truncate font-mono text-[0.6875rem] text-dimmed`},Ke={class:`font-mono`},qe={key:0,class:`text-bad`},Je=l({__name:`ViewAsPicker`,props:{people:{}},setup(t){let n=t,a=w(!1),o=w(``),s=D(()=>n.people.map(e=>({label:e.name??e.id,value:e.id,...e.name?{suffix:e.id}:{}})));async function l(t){let n=typeof t==`string`?t.trim():``;if(!n)return;a.value=!0,o.value=``;let r=await e(n);r.ok||(a.value=!1,o.value=r.message)}return(e,t)=>{let n=k;return p(),i(`span`,We,[r(n,{id:`view-as-pick`,"model-value":``,items:s.value,"value-key":`value`,"filter-fields":[`label`,`value`],"create-item":``,placeholder:`View as…`,"aria-label":`view the dashboard as a person`,disabled:a.value,size:`xs`,class:`w-60 text-xs`,ui:{itemTrailing:`min-w-0`},"onUpdate:modelValue":l,onCreate:l},{"item-trailing":f(({item:e})=>[e.suffix?(p(),i(`span`,Ge,c(e.suffix),1)):d(``,!0)]),"create-item-label":f(({item:e})=>[t[0]||=y(` View as `,-1),m(`span`,Ke,c(e),1)]),_:1},8,[`items`,`disabled`]),o.value?(p(),i(`span`,qe,c(o.value),1)):d(``,!0)])}}}),Ye={class:`conn flex items-center gap-1.5`},Xe={id:`state`,class:`text-xs text-muted`},Ze={class:`toolbar mb-1.5 flex items-center gap-4 px-2 text-xs text-muted`},Qe={id:`livecount`,class:`count font-mono tabular-nums`},$e={class:`filter ml-auto inline-flex items-center gap-4`},et={class:`toggle inline-flex cursor-pointer select-none items-center gap-1.5 text-toned hover:text-highlighted`},tt=[`checked`],nt={id:`minehint`,class:`sr-only`},rt={class:`toggle inline-flex cursor-pointer select-none items-center gap-1.5 text-toned hover:text-highlighted`},it=[`checked`],at={id:`retention`,class:`sr-only`},ot={key:0,class:`banner mb-3 rounded-md border border-warn px-2.5 py-1.5 text-[0.8rem] text-warn`,role:`status`},st={id:`runs`,class:`m-0 list-none border-t border-muted p-0`},ct={key:0,id:`leaving`,class:`divider flex items-baseline gap-2 border-b border-dashed border-warn/40 px-2 pb-1.5 pt-3 font-mono text-[0.72rem] uppercase tracking-wider text-warn`,role:`separator`},lt={key:1,id:`empty`,class:`empty px-2 py-2 text-muted`},ut={key:1,class:`pager mt-3 flex items-baseline gap-2 px-2 text-[0.8rem] text-muted`,"aria-label":`Completed runs pages`},dt={class:`range font-mono tabular-nums text-dimmed`},ft=l({__name:`RunsIndexPage`,setup(e){let t=S(`runs`),s=t?.all??!1,l=t?.mine??!1,u=new URLSearchParams(C.search());if(!u.has(`mine`)&&!u.has(`all`)&&t){let e=C.readPref(Y.mine)===`1`,t=C.readPref(Y.all)===`1`;(e||t)&&C.navigate(k(t,e))}let b=t?.asUser?`Only the runs ${t.asUser.name??`you`} requested`:`Only the runs this session requested from Threads. Sign in with the email of your Slack account to see your Slack runs too.`;function k(e,t){let n=[e?`all=1`:``,t?`mine=1`:``].filter(Boolean).join(`&`);return n?`/runs?${n}`:`/runs`}let te=t?.olderThan!==void 0,P=t?.retentionDays??null,F=P===null?void 0:P*864e5,I=h(P),L=E(new Map);for(let e of t?.rows??[])L.set(e.id,e);let R=N(t?.now),z=w({tone:`amber`,text:`connecting…`}),B=D(()=>G([...L.values()],R.value)),re=D(()=>[...L.values()].filter(e=>!e.finished).length),V=D(()=>F===void 0?-1:B.value.findIndex(e=>{let t=he(e.head,F);return t!==void 0&&t-R.value<=864e5})),ie=D(()=>V.value===-1?B.value:B.value.slice(0,V.value)),H=D(()=>V.value===-1?[]:B.value.slice(V.value)),U=s?`All runs`:`Live runs`;o(re,e=>{C.setTitle((e>0?`(${e}) `:``)+U),C.setFavicon(e>0?j:A)},{immediate:!0});function ae(e){let t=e.target.checked;C.writePref(Y.all,t?`1`:`0`),C.navigate(k(t,l))}function oe(e){let t=e.target.checked;C.writePref(Y.mine,t?`1`:`0`),C.navigate(k(s,t))}let se=D(()=>t?.olderThan===void 0?``:ne(t.olderThan,R.value)),q=M(),J=null;return g(()=>{J=q(`/runs?stream=1${s?`&all=1`:``}${l?`&mine=1`:``}`);let e=!1;J.onopen=()=>{if(e){C.reload();return}e=!0,z.value={tone:`green`,text:`connected`}},J.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}let n=t.type===`removed`?t.id:t.run?.id,r=n?L.get(n):void 0;if(te&&!r)return;let i=W(t,s,r?.persisted===!0);i.op===`upsert`?L.set(i.run.id,K(L.get(i.run.id),i.run)):i.op===`remove`&&L.delete(i.id)},J.onerror=()=>{J&&J.readyState===2?z.value={tone:`red`,text:`disconnected`}:z.value={tone:`amber`,text:`connecting…`}}}),_(()=>{J?.close()}),(e,o)=>{let u=O,h=ee(`RouterLink`);return p(),T(n,{title:v(U),nav:`runs`},{status:f(()=>[m(`span`,Ye,[r(Ce,{tone:z.value.tone,label:z.value.text},null,8,[`tone`,`label`]),m(`span`,Xe,c(z.value.text),1)])]),default:f(()=>[r(Z,{current:`runs`}),m(`div`,Ze,[m(`span`,Qe,c(re.value)+` running`,1),m(`span`,$e,[v(t)?.viewAs?(p(),T(Je,{key:0,people:v(t).viewAs.people},null,8,[`people`])):d(``,!0),r(u,{text:v(b)},{default:f(()=>[m(`label`,et,[m(`input`,{id:`showmine`,type:`checkbox`,class:`accent-(--ui-bg-inverted)`,checked:v(l),"aria-describedby":`minehint`,onChange:oe},null,40,tt),o[0]||=y(` Show only mine `,-1)])]),_:1},8,[`text`]),m(`span`,nt,c(v(b)),1),m(`label`,rt,[m(`input`,{id:`showdone`,type:`checkbox`,class:`accent-(--ui-bg-inverted)`,checked:v(s),"aria-describedby":`retention`,onChange:ae},null,40,it),o[1]||=y(` Show completed `,-1)]),r(u,{text:v(I)},{default:f(()=>[...o[2]||=[m(`span`,{class:`help inline-flex size-[1.1em] cursor-help items-center justify-center rounded-full border border-accented text-[0.7rem] leading-none text-dimmed hover:border-(--ui-text-dimmed) hover:text-toned`,tabindex:`0`},`?`,-1)]]),_:1},8,[`text`]),m(`span`,at,c(v(I)),1)])]),v(t)?.storeUnavailable?(p(),i(`p`,ot,c(v(t).storeUnavailable),1)):d(``,!0),m(`ul`,st,[(p(!0),i(x,null,a(ie.value,e=>(p(),i(x,{key:e.head.id},[r($,{run:e.head,now:v(R),"retention-ms":v(F),children:e.children},null,8,[`run`,`now`,`retention-ms`,`children`]),(p(!0),i(x,null,a(e.children,t=>(p(),T($,{key:t.id,run:t,now:v(R),"retention-ms":v(F),"nested-under":e.head.id},null,8,[`run`,`now`,`retention-ms`,`nested-under`]))),128))],64))),128)),H.value.length>0?(p(),i(`li`,ct,[...o[3]||=[m(`span`,{"aria-hidden":`true`,class:`text-sm tracking-normal`},`⏳`,-1),m(`span`,{class:`whitespace-nowrap`},`Leaving within a day`,-1),m(`span`,{class:`normal-case tracking-normal text-dimmed max-sm:hidden`},`— each row says when it is removed`,-1)]])):d(``,!0),(p(!0),i(x,null,a(H.value,e=>(p(),i(x,{key:e.head.id},[r($,{run:e.head,now:v(R),"retention-ms":v(F),children:e.children},null,8,[`run`,`now`,`retention-ms`,`children`]),(p(!0),i(x,null,a(e.children,t=>(p(),T($,{key:t.id,run:t,now:v(R),"retention-ms":v(F),"nested-under":e.head.id},null,8,[`run`,`now`,`retention-ms`,`nested-under`]))),128))],64))),128)),B.value.length===0?(p(),i(`li`,lt,c(v(l)?v(s)?`No runs of yours.`:`No active runs of yours.`:v(s)?`No runs.`:`No active runs.`),1)):d(``,!0)]),v(s)&&(v(t)?.olderHref||v(t)?.olderThan!==void 0)?(p(),i(`nav`,ut,[v(t)?.olderThan===void 0?d(``,!0):(p(),i(x,{key:0},[r(h,{class:`text-primary hover:underline`,to:k(!0,v(l))},{default:f(()=>[...o[4]||=[y(`← Newest runs`,-1)]]),_:1},8,[`to`]),m(`span`,dt,`· runs finished before `+c(se.value),1)],64)),v(t)?.olderHref?(p(),T(h,{key:1,class:`older ml-auto text-primary hover:underline`,to:v(t).olderHref},{default:f(()=>[...o[5]||=[y(`Older runs →`,-1)]]),_:1},8,[`to`])):d(``,!0)])):d(``,!0)]),_:1},8,[`title`])}}});export{ft as default};
|
|
@@ -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};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-BO_GIdF6.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};
|