@coreplane/switchboard 1.250.0 → 1.252.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/config/config.example.yaml +13 -2
- package/dist/assets/deploy/cloudflare/preflight.mjs +19 -21
- package/dist/assets/deploy/cloudflare/worker.ts +6 -3
- package/dist/assets/deploy/cloudflare-memory/worker.ts +108 -12
- package/dist/assets/deploy/cloudflare-resident/memoryGuard.ts +212 -0
- package/dist/assets/deploy/cloudflare-resident/refresh.ts +1 -1
- package/dist/assets/deploy/cloudflare-resident/worker.ts +317 -56
- package/dist/assets/deploy/cloudflare-sandbox/Dockerfile +4 -2
- package/dist/assets/deploy/cloudflare-sandbox/runtime-supervisor.d.mts +31 -0
- package/dist/assets/deploy/cloudflare-sandbox/runtime-supervisor.mjs +119 -0
- package/dist/assets/package-lock.json +3 -3
- package/dist/assets/package.json +3 -2
- package/dist/assets/project.json +13 -9
- package/dist/assets/source.json +3 -3
- package/dist/assets/src/agents/registry.ts +5 -5
- package/dist/assets/src/core/authz/policy.ts +4 -0
- package/dist/assets/src/core/authz/resource.ts +6 -2
- package/dist/assets/src/core/authz/types.ts +2 -0
- package/dist/assets/src/core/budgets.ts +22 -0
- package/dist/assets/src/core/coordinator/contract.ts +42 -0
- package/dist/assets/src/core/coordinator/driver.ts +150 -12
- package/dist/assets/src/core/drain.ts +50 -0
- package/dist/assets/src/core/memory/engine.ts +98 -0
- package/dist/assets/src/core/memory/scorer.ts +12 -4
- package/dist/assets/src/core/memory/types.ts +69 -12
- package/dist/assets/src/core/modelCard.ts +51 -7
- package/dist/assets/src/core/modelPricing.ts +111 -1
- package/dist/assets/src/core/modelProxy/usage.ts +88 -0
- package/dist/assets/src/core/modelRegistry.ts +15 -1
- package/dist/assets/src/core/provider.ts +49 -0
- package/dist/assets/src/core/refusal.ts +6 -6
- package/dist/assets/src/core/reviewVerdict.ts +4 -0
- package/dist/assets/src/core/runEvents.ts +51 -2
- package/dist/assets/src/core/runFriction.ts +7 -2
- package/dist/assets/src/core/runLedger/types.ts +23 -4
- package/dist/assets/src/core/runRecord.ts +16 -0
- package/dist/assets/src/core/runUsage.ts +67 -13
- package/dist/assets/src/core/schedules.ts +3 -0
- package/dist/assets/src/core/ship/contract.ts +45 -5
- package/dist/assets/src/core/ship/coordinator.ts +441 -48
- package/dist/assets/src/core/ship/renewal.ts +10 -5
- package/dist/assets/src/core/trace/attrs.ts +24 -0
- package/dist/assets/src/core/types.ts +5 -5
- package/dist/assets/src/core/verbosity.ts +48 -0
- package/dist/assets/src/deploy/liveGate.ts +40 -13
- package/dist/assets/src/deploy/restart.ts +11 -12
- package/dist/assets/src/execution/residentDepCache.ts +50 -1
- package/dist/assets/src/execution/residentDepsStore.ts +40 -2
- package/dist/assets/src/execution/residentRefresh.ts +55 -3
- package/dist/assets/src/execution/residentSteps.ts +4 -0
- package/dist/assets/src/execution/sandboxErrors.ts +8 -0
- package/dist/assets/web/dist/.vite/manifest.json +58 -52
- package/dist/assets/web/dist/assets/DeliveryPage-3ELQWM0r.js +1 -0
- package/dist/assets/web/dist/assets/{HomePage-AnycA57D.js → HomePage-BG_ok-K2.js} +2 -2
- package/dist/assets/web/dist/assets/{PendingTurnRow-BuRre8it.js → PendingTurnRow-ChCQOLgZ.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentDetailPage-Cb3sFkfj.js → ResidentDetailPage-C9y3nbo8.js} +1 -1
- package/dist/assets/web/dist/assets/{ResidentsIndexPage-BZ6n6UxF.js → ResidentsIndexPage-i1RG9e7g.js} +1 -1
- package/dist/assets/web/dist/assets/RunFoldRow-D3wVpzBa.js +1 -0
- package/dist/assets/web/dist/assets/RunRoutePage-B3IirUVi.js +9 -0
- package/dist/assets/web/dist/assets/RunsIndexPage-DiFmtGaJ.js +1 -0
- package/dist/assets/web/dist/assets/{ScheduledPage-CBUxbeqN.js → ScheduledPage-DvYwM2TE.js} +1 -1
- package/dist/assets/web/dist/assets/{SettingsPage-CBTnZ9Qv.js → SettingsPage-Bo6yCyXZ.js} +1 -1
- package/dist/assets/web/dist/assets/{StatusDot-BnRjWzFN.js → StatusDot-CAfS1AUi.js} +1 -1
- package/dist/assets/web/dist/assets/{Tooltip-Brge0wnd.js → Tooltip-tZoum_T-.js} +1 -1
- package/dist/assets/web/dist/assets/{UnitRoutePage-o6sLju16.js → UnitRoutePage-BmdOHwNn.js} +1 -1
- package/dist/assets/web/dist/assets/budgets-CbIyPAER.js +1 -0
- package/dist/assets/web/dist/assets/{dist-rgAhsmE-.js → dist-DfbEpHXR.js} +1 -1
- package/dist/assets/web/dist/assets/indexRow-BT0cPVRw.js +1 -0
- package/dist/assets/web/dist/assets/{main-CeRuGONy.js → main-5Gm_1Gv8.js} +2 -2
- package/dist/assets/web/dist/assets/sseReplay-DmyMXfRC.js +11 -0
- package/dist/cli.js +3319 -1015
- package/package.json +1 -1
- package/dist/assets/deploy/cloudflare-sandbox/runtime-supervisor.sh +0 -68
- package/dist/assets/web/dist/assets/DeliveryPage-CIfBiINK.js +0 -1
- package/dist/assets/web/dist/assets/RunFoldRow-BRXkjkgO.js +0 -1
- package/dist/assets/web/dist/assets/RunRoutePage-psSMI3fN.js +0 -9
- package/dist/assets/web/dist/assets/RunsIndexPage-68YT_RWt.js +0 -1
- package/dist/assets/web/dist/assets/indexRow-BmK74Vp1.js +0 -1
- package/dist/assets/web/dist/assets/sseReplay-DXC7kGbN.js +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreplane/switchboard",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.252.0",
|
|
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,68 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
# The cold sandbox's process supervisor, run by tini (PID 1): keeps the
|
|
3
|
-
# container alive across a crash of the SDK's container server
|
|
4
|
-
# (/container-server/sandbox). That server calls process.exit(1) on any
|
|
5
|
-
# uncaught exception, and the base image runs it as tini's one child — so one
|
|
6
|
-
# uncaught error ended the whole container: /workspace gone, a detached pi
|
|
7
|
-
# with it, every later /exec a failure until the platform noticed. Started
|
|
8
|
-
# here as a child instead, the server's exit is a restart a second later; the
|
|
9
|
-
# disk, the detached processes and the Durable Object's view of a running
|
|
10
|
-
# container all survive, and the next command starts a fresh process on the
|
|
11
|
-
# new server (docs/reference/specs/execution.md item 21).
|
|
12
|
-
#
|
|
13
|
-
# A stop from the platform is SIGTERM, which tini forwards here: forwarded to the server, and
|
|
14
|
-
# nothing starts again — a stop that lands during the pause between two
|
|
15
|
-
# starts, or before the new pid is known, still ends here — and the server's
|
|
16
|
-
# own exit status becomes this script's. A terminal's INT is forwarded as
|
|
17
|
-
# TERM too: a child started with `&` by a non-interactive shell ignores INT
|
|
18
|
-
# (POSIX), so INT itself would stop nothing. A server that cannot stay up —
|
|
19
|
-
# QUICK_EXIT_LIMIT exits in a row, each within QUICK_EXIT_SECS of starting —
|
|
20
|
-
# ends the container with the last status instead of looping forever.
|
|
21
|
-
# src/deploy/sandboxRuntimeSupervisor.test.ts holds the shape and drives it.
|
|
22
|
-
set -u
|
|
23
|
-
RUNTIME=${SANDBOX_RUNTIME:-/container-server/sandbox}
|
|
24
|
-
QUICK_EXIT_SECS=10
|
|
25
|
-
QUICK_EXIT_LIMIT=5
|
|
26
|
-
pid=
|
|
27
|
-
stopping=
|
|
28
|
-
quick=0
|
|
29
|
-
code=0
|
|
30
|
-
|
|
31
|
-
on_signal() {
|
|
32
|
-
stopping=1
|
|
33
|
-
if [ -n "$pid" ]; then kill -TERM "$pid" 2>/dev/null; fi
|
|
34
|
-
}
|
|
35
|
-
trap on_signal TERM INT
|
|
36
|
-
|
|
37
|
-
while :; do
|
|
38
|
-
started=$(date +%s)
|
|
39
|
-
"$RUNTIME" "$@" &
|
|
40
|
-
pid=$!
|
|
41
|
-
# A stop that landed between the start and this line found no pid to
|
|
42
|
-
# forward to; the server it missed gets it here.
|
|
43
|
-
if [ -n "$stopping" ]; then kill -TERM "$pid" 2>/dev/null; fi
|
|
44
|
-
wait "$pid"
|
|
45
|
-
code=$?
|
|
46
|
-
# A trapped signal ends `wait` early (status > 128) while the server still
|
|
47
|
-
# runs; wait again until it is really gone, so the status is its own.
|
|
48
|
-
while kill -0 "$pid" 2>/dev/null; do
|
|
49
|
-
wait "$pid"
|
|
50
|
-
code=$?
|
|
51
|
-
done
|
|
52
|
-
pid=
|
|
53
|
-
if [ -n "$stopping" ]; then exit "$code"; fi
|
|
54
|
-
if [ $(( $(date +%s) - started )) -lt "$QUICK_EXIT_SECS" ]; then
|
|
55
|
-
quick=$((quick + 1))
|
|
56
|
-
else
|
|
57
|
-
quick=0
|
|
58
|
-
fi
|
|
59
|
-
if [ "$quick" -ge "$QUICK_EXIT_LIMIT" ]; then
|
|
60
|
-
echo "sandbox-runtime-supervisor: the runtime exited with status $code, $quick times in a row within ${QUICK_EXIT_SECS}s of starting; giving up" >&2
|
|
61
|
-
exit "$code"
|
|
62
|
-
fi
|
|
63
|
-
echo "sandbox-runtime-supervisor: the runtime exited with status $code; starting it again" >&2
|
|
64
|
-
sleep 1
|
|
65
|
-
# A stop that landed during the pause: the last status is the answer, and
|
|
66
|
-
# nothing starts again.
|
|
67
|
-
if [ -n "$stopping" ]; then exit "$code"; fi
|
|
68
|
-
done
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./AppShell-DAtHiuI6.js";import{An as t,Cn as n,Cr as r,Li as i,Mn as ee,Pi as a,Sn as o,Tr as s,Xr as c,_r as l,bn as u,ji as d,kn as f,ln as p,o as m,xn as h,yn as g}from"./browser-B6T5hjfR.js";import{a as _,c as te,d as ne,i as re,l as v,n as y,o as b,r as x,s as S,t as C,u as ie}from"./delivery-CTdOqpVK.js";import{t as ae}from"./wallClock-DmaC1sKA.js";var w=6e4,T=1440*w;10*w,5*w,60*w,10*w,60*w,30*T;var E={general:2,coding:15,review:5,research:3,explore:15,conductor:15};E.coding,E.coding,E.review;function D(e,t){return e.truncated&&e.completeFrom!==void 0&&Date.parse(`${t}T00:00:00Z`)<Date.parse(e.completeFrom)}Object.freeze({reviewers:[],agentLogins:[],agentCoauthors:[]}),Object.freeze({default:60,min:5,max:1440});var O={class:`text-xs text-muted`},k={key:1,class:`text-highlighted`},A={class:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-2`},j={key:0,class:`flex items-center gap-1`,"aria-label":`Repositories`},M={key:0,class:`rounded-md bg-accented px-2.5 py-1 text-xs font-medium text-highlighted`,"aria-current":`page`},N={class:`font-mono text-sm tabular-nums text-muted`},P={class:`mb-5 grid gap-3`},F={key:0,class:`text-sm text-muted`},I={class:`grid grid-cols-[repeat(auto-fit,minmax(190px,1fr))] gap-3`},L={class:`font-mono text-[0.6875rem] font-medium uppercase tracking-widest text-dimmed`},R={class:`font-mono text-2xl font-medium tabular-nums`},z={class:`text-xs text-muted`},B={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},V={class:`overflow-x-auto`},H={class:`weeks w-full min-w-[52rem] border-collapse whitespace-nowrap font-mono text-[0.8125rem] tabular-nums`},U=[`title`],W={key:0,class:`ml-1 text-xs`},oe={key:0,class:`text-xs text-muted`},G={class:`mb-5 grid gap-3 rounded-lg border border-default bg-elevated px-5 py-4`},K={key:0,class:`text-sm text-muted`},q={key:1,class:`overflow-x-auto`},se={class:`units w-full min-w-[52rem] border-collapse font-mono text-[0.8125rem] tabular-nums`},ce=[`href`],le={key:1,class:`text-dimmed`},ue=[`title`],de=[`href`],fe={class:`text-xs text-muted`},pe={class:`rounded bg-accented px-1 py-0.5`},me={class:`border-t border-default pt-3.5 text-xs text-dimmed`},he={key:0,class:`mb-2 font-mono tabular-nums text-muted`},ge={class:`mt-2 grid gap-1.5`},J=`border-b border-muted bg-(--ui-bg-muted) px-2.5 py-1.5 text-xs font-medium text-muted whitespace-nowrap`,Y=`border-b border-muted px-2.5 py-1.5`,X=ee({__name:`DeliveryPage`,setup(ee){let w=m(`delivery`),T=g(()=>w?.report??null),E=g(()=>w?.repos??[]),X=g(()=>T.value?ie(T.value):[]),Z=g(()=>T.value?y(T.value):void 0),Q=e=>T.value?D(T.value,e):!1,$=g(()=>T.value?.weeks.some(e=>Q(e.week))??!1),_e=[1,2,4,8,13],ve=ae(void 0,6e4),ye=typeof window>`u`?``:window.location.search;return(ee,m)=>{let g=s(`RouterLink`);return T.value?(l(),h(e,{key:0,title:`${T.value.repo} delivery`,nav:`delivery`},{actions:c(()=>[u(`span`,O,[(l(),n(p,null,r(_e,(e,t)=>(l(),n(p,{key:e},[t>0?(l(),n(p,{key:0},[f(` · `)],64)):o(``,!0),e===T.value.range.weeks?(l(),n(`b`,k,i(e)+`w`,1)):(l(),h(g,{key:2,class:`text-primary hover:underline`,to:`/delivery/${T.value.repo}?weeks=${e}`},{default:c(()=>[f(i(e)+`w`,1)]),_:2},1032,[`to`]))],64))),64))])]),default:c(()=>[u(`div`,A,[E.value.length>1?(l(),n(`nav`,j,[(l(!0),n(p,null,r(E.value,e=>(l(),n(p,{key:e},[e===T.value.repo?(l(),n(`span`,M,i(e),1)):(l(),h(g,{key:1,class:`rounded-md px-2.5 py-1 text-xs text-muted no-underline hover:bg-elevated hover:text-highlighted`,to:`/delivery/${e}`},{default:c(()=>[f(i(e),1)]),_:2},1032,[`to`]))],64))),128))])):o(``,!0),u(`p`,N,i(d(b)(T.value.range.since))+` → `+i(d(b)(T.value.range.until))+` · `+i(T.value.range.weeks)+`w · weeks start Monday, UTC `,1)]),u(`section`,P,[Z.value?(l(),n(`p`,F,i(Z.value),1)):o(``,!0),u(`div`,I,[(l(!0),n(p,null,r(X.value,e=>(l(),n(`div`,{key:e.label,class:`grid gap-0.5 rounded-lg border border-default bg-elevated px-4 py-3.5`},[u(`span`,L,i(e.label),1),u(`span`,R,i(e.value),1),u(`span`,z,i(e.note),1)]))),128))])]),u(`section`,B,[m[0]||=u(`div`,null,[u(`h2`,{class:`text-[0.9375rem] font-medium`},`By week`),u(`p`,{class:`text-sm text-muted`},`One row per Monday-start week · merged pull requests only`)],-1),u(`div`,V,[u(`table`,H,[u(`thead`,null,[u(`tr`,null,[u(`th`,{class:a([J,`text-left`])},`Week`,2),u(`th`,{class:a([J,`text-right`])},`Merged`,2),u(`th`,{class:a([J,`text-right`])},`Agent-authored`,2),u(`th`,{class:a([J,`text-right`])},`Issue → merge`,2),u(`th`,{class:a([J,`text-right`])},`First-pass CI`,2),u(`th`,{class:a([J,`text-right`])},`Rounds / PR`,2),u(`th`,{class:a([J,`text-right`])},`Findings`,2),u(`th`,{class:a([J,`text-right`])},`No human edit`,2),u(`th`,{class:a([J,`text-right`])},`Agent run min`,2)])]),u(`tbody`,null,[(l(!0),n(p,null,r(T.value.weeks,e=>(l(),n(`tr`,{key:e.week,class:a(Q(e.week)?`text-dimmed`:``)},[u(`td`,{class:a(Y),title:`${e.week} → ${e.until}`},[f(i(d(b)(e.week))+` – `+i(d(b)(e.until))+` `,1),Q(e.week)?(l(),n(`span`,W,`(incomplete)`)):o(``,!0)],8,U),u(`td`,{class:a([Y,`text-right font-medium`])},i(e.prsMerged),3),u(`td`,{class:a([Y,`text-right`])},i(e.agentAuthoredPrs),3),u(`td`,{class:a([Y,`text-right`])},i(d(_)(e.leadTimeHours.median)),3),u(`td`,{class:a([Y,`text-right`])},i(d(C)(e)),3),u(`td`,{class:a([Y,`text-right`])},i(d(te)(e.reviewRounds.perPr)),3),u(`td`,{class:a([Y,`text-right`])},i(d(x)(e)),3),u(`td`,{class:a([Y,`text-right`])},i(d(S)(e.findings.noHumanEditShare)),3),u(`td`,{class:a([Y,`text-right`])},i(e.agentRuns.minutes.toFixed(0)),3)],2))),128))])])]),$.value&&T.value.completeFrom?(l(),n(`p`,oe,` Incomplete weeks hold the newest pull requests the read reached — it is complete from `+i(d(v)(T.value.completeFrom))+` — so their numbers are a floor on the merges, not the week's. `,1)):o(``,!0)]),u(`section`,G,[m[3]||=u(`div`,null,[u(`h2`,{class:`text-[0.9375rem] font-medium`},`By unit`),u(`p`,{class:`text-sm text-muted`},` One row per board issue the pull requests link · the issue's opening starts the clock `)],-1),T.value.units.length===0?(l(),n(`p`,K,`Nothing merged in range.`)):(l(),n(`div`,q,[u(`table`,se,[u(`thead`,null,[u(`tr`,null,[u(`th`,{class:a([J,`text-left`])},`Issue`,2),u(`th`,{class:a([J,`text-left`])},`Unit`,2),u(`th`,{class:a([J,`text-left`])},`PRs`,2),u(`th`,{class:a([J,`text-right`])},`Issue → merge`,2),u(`th`,{class:a([J,`text-right`])},`First-pass CI`,2),u(`th`,{class:a([J,`text-right`])},`Rounds`,2),u(`th`,{class:a([J,`text-right`])},`Findings`,2),u(`th`,{class:a([J,`text-right`])},`No human edit`,2)])]),u(`tbody`,null,[(l(!0),n(p,null,r(T.value.units,e=>(l(),n(`tr`,{key:e.issue??`none`},[u(`td`,{class:a([Y,`whitespace-nowrap`])},[e.issue===null?(l(),n(`span`,le,`—`)):(l(),n(`a`,{key:0,class:`text-primary hover:underline`,href:`https://github.com/${T.value.repo}/issues/${e.issue}`},`#`+i(e.issue),9,ce))],2),u(`td`,{class:a([Y,`max-w-[28rem] truncate font-sans`]),title:e.title},i(e.title),11,ue),u(`td`,{class:a([Y,`whitespace-nowrap`])},[(l(!0),n(p,null,r(e.prs,(e,t)=>(l(),n(p,{key:e},[t>0?(l(),n(p,{key:0},[f(`, `)],64)):o(``,!0),u(`a`,{class:`text-primary hover:underline`,href:`https://github.com/${T.value.repo}/pull/${e}`},i(e),9,de)],64))),128))],2),u(`td`,{class:a([Y,`text-right`])},i(d(_)(e.leadTimeHours.median)),3),u(`td`,{class:a([Y,`text-right`])},i(d(C)(e)),3),u(`td`,{class:a([Y,`text-right`])},i(e.reviewRounds.verdicts),3),u(`td`,{class:a([Y,`text-right`])},i(d(x)(e)),3),u(`td`,{class:a([Y,`text-right`])},i(d(S)(e.findings.noHumanEditShare)),3)]))),128))])])])),u(`p`,fe,[m[1]||=f(` Machine-readable twin: `,-1),u(`code`,pe,`GET /delivery/`+i(T.value.repo)+`.json`,1),m[2]||=f(` (same gate). `,-1)])]),u(`footer`,me,[T.value.snapshotAt?(l(),n(`p`,he,[f(` As of `+i(d(v)(T.value.snapshotAt))+`, `+i(d(ne)(T.value.snapshotAt,d(ve)))+` · `,1),t(g,{class:`text-primary hover:underline`,to:`/delivery/${T.value.repo}${d(re)(d(ye))}`},{default:c(()=>[...m[4]||=[f(`read GitHub now`,-1)]]),_:1},8,[`to`])])):o(``,!0),u(`details`,null,[m[14]||=u(`summary`,{class:`cursor-pointer text-muted`},`How these numbers are computed`,-1),u(`div`,ge,[m[12]||=u(`div`,null,[u(`b`,null,`Snapshot.`),f(` GitHub's record of the merged pull requests (each one's timeline and its branch's workflow runs, the board issue its body links) is read on an interval and kept as a snapshot the page, its JSON twin and `),u(`code`,null,`delivery report`),f(` serve; `),u(`code`,null,`?fresh=1`),f(` reads GitHub now. The run history you may see joins on every load. `)],-1),m[13]||=u(`div`,null,[u(`b`,null,`Issue → merge`),f(` runs from the linked board issue's opening (a closing keyword or a `),u(`code`,null,`board item`),f(` reference in the body) to the merge; a pull request that links no issue counts from its own opening. `),u(`b`,null,`First-pass CI`),f(` is green when every pull-request-triggered workflow run (`),u(`code`,null,`pull_request`),f(`, `),u(`code`,null,`pull_request_target`),f(`) on the first head succeeded at its first attempt — a rerun or a red run fails it; a head with no such run is not counted. `),u(`b`,null,`Review rounds`),f(` are the review agent's verdicts; a `),u(`i`,null,`fix round`),f(` is a verdict that followed a push. `),u(`b`,null,`No human edit`),f(` is the share of the agent's findings on pull requests where every push after the first verdict was an agent's: a bot login, or a commit co-authored by an agent. `),u(`b`,null,`Agent run minutes`),f(` are the finished runs of this repository that named a pull request. `)],-1),u(`div`,null,[m[6]||=u(`b`,null,`Identities.`,-1),m[7]||=f(` Verdicts by `,-1),u(`code`,null,i(T.value.identities.reviewers.join(`, `)||`(none configured)`),1),m[8]||=f(`; agent logins end in `,-1),m[9]||=u(`code`,null,`[bot]`,-1),T.value.identities.agentLogins.length?(l(),n(p,{key:0},[m[5]||=f(`, plus `,-1),u(`code`,null,i(T.value.identities.agentLogins.join(`, `)),1)],64)):o(``,!0),m[10]||=f(`; agent co-authors named `,-1),u(`code`,null,i(T.value.identities.agentCoauthors.join(`, `)||`(none)`),1),m[11]||=f(`. `,-1)])])])])]),_:1},8,[`title`])):o(``,!0)}}});export{X 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{D as T,O as E,T as D,a as O,b as k,c as A,g as j,l as M,m as ee,o as N,t as P,v as te,y as ne}from"./indexRow-BmK74Vp1.js";import"./format-BldUwl_R.js";import{a as F,n as re,t as ie}from"./durationTone-U_rOqo6r.js";import{D as I,T as L,c as ae,l as oe,n as se,t as ce,w as R}from"./sseReplay-DXC7kGbN.js";import{t as z}from"./StatusDot-BnRjWzFN.js";var le={},ue={viewBox:`0 0 16 16`,class:`inline-block size-[1em] shrink-0`,"aria-hidden":`true`};function de(e,n){return d(),t(`svg`,ue,[...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 fe=F(le,[[`render`,de]]),B={"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`},V={getting_ready:`getting ready`,finishing_up:`finishing up`};function pe(e){return B[V[e]]}var me={id:`timeline`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,"data-testid":`timeline`},he={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},ge={class:`ml-auto flex items-baseline gap-3 font-normal normal-case tracking-normal`},_e=[`href`],ve={class:`lede font-mono text-sm text-toned`},ye={class:`shape tabular-nums`},be={key:0,class:`current text-muted`},xe={key:0,class:`note mt-0.5 text-xs text-muted`},Se=[`aria-label`],Ce=[`title`,`data-term`],we={class:`legend mt-2 flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs`},Te=[`title`,`data-term`],Ee={class:`term text-muted`},De={class:`ms tabular-nums text-toned`},Oe=[`title`],ke={class:`ranked mt-1 flex flex-col gap-1 font-mono text-xs`},Ae={class:`ms w-14 shrink-0 tabular-nums text-toned`},je=[`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`${E(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`,me,[f(`h2`,he,[o[0]||=f(`span`,null,`Where the time went`,-1),f(`span`,ge,[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,_e)):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`,ve,[f(`span`,ye,a(e.vm.shown?e.vm.total:e.vm.lede),1),e.vm.current?(d(),t(`span`,be,` · `+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`,xe,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(B)[e.term],e.hatched?`paint-hatched hatched`:``]]),style:i({width:`${e.pct}%`}),title:u(e),"data-term":e.term},null,14,Ce))),128))],8,Se),f(`ul`,we,[(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(B)[e.term]])},null,2),f(`span`,Ee,a(e.term),1),f(`span`,De,a(e.text),1)],8,Te))),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,Oe),f(`ol`,ke,[(d(!0),t(_,null,n(e.vm.ranked,(e,r)=>(d(),t(`li`,{key:r,class:`flex items-baseline gap-2`},[f(`span`,Ae,a(h(E)(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,je),(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)]))}});function Me(e,t){let{window:n,owner:r,finished:i}=t,a=Math.max(0,n.end-n.start),o=new Map(e.map(e=>[e.spanId,e])),s=new Map,c=e=>{let t=s.get(e.spanId);if(t!==void 0)return t;s.set(e.spanId,1);let n=e.parentSpanId?o.get(e.parentSpanId):void 0,r=n?c(n)+1:1;return s.set(e.spanId,r),r},l=e=>{let t=e,n=new Set;for(;t&&!n.has(t.spanId);){if(n.add(t.spanId),L(t.name,r)?.kind===`background`)return!0;t=t.parentSpanId?o.get(t.parentSpanId):void 0}return!1},u=t.losses.map(e=>Math.max(n.start,e.from)).sort((e,t)=>e-t),d=e=>{if(e.endedAt!==void 0)return Math.min(n.end,e.endedAt);if(!i)return n.end;let t=u.find(t=>t>e.startedAt);return t===void 0?n.end:Math.min(n.end,t)},f=[],p=[];for(let t of e){let e=L(t.name,r);if(!e)continue;let i=Math.max(n.start,t.startedAt);if(e.kind===`background`){let e=Math.min(n.end,t.endedAt??n.end);e>i&&p.push([i,e]);continue}if(e.kind!==`counted`||l(t))continue;let a=d(t);a<=i||f.push({start:i,end:a,bucket:e.bucket,depth:c(t),startedAt:t.startedAt,spanId:t.spanId})}f.sort((e,t)=>t.depth-e.depth||e.startedAt-t.startedAt||(e.spanId<t.spanId?-1:+(e.spanId>t.spanId)));let m=new Set([n.start,n.end]);for(let e of f)m.add(e.start),m.add(e.end);for(let e of t.losses)m.add(U(e.from,n)),m.add(U(e.to,n));for(let[e,t]of p)m.add(e),m.add(t);let h=[...m].filter(e=>e>=n.start&&e<=n.end).sort((e,t)=>e-t),g={getting_ready:0,thinking:0,tools:0,finishing_up:0},_=0,v=0,y=0;for(let e=0;e+1<h.length;e++){let r=h[e],i=h[e+1],a=i-r;if(a<=0)continue;let o=f.find(e=>e.start<=r&&e.end>=i);if(o){g[o.bucket]+=a;continue}if(t.losses.some(e=>e.kind===`lost`&&U(e.from,n)<=r&&U(e.to,n)>=i)){_+=a;continue}if(t.losses.some(e=>e.kind===`elided`&&U(e.from,n)<=r&&U(e.to,n)>=i)){v+=a;continue}p.some(([e,t])=>e<=r&&t>=i)&&(y+=a)}let b=g.getting_ready+g.thinking+g.tools+g.finishing_up;return{windowMs:a,gettingReadyMs:g.getting_ready,thinkingMs:g.thinking,toolsMs:g.tools,finishingUpMs:g.finishing_up,overheadMs:Math.max(0,a-b-_-v),notRecordedMs:_,notLoadedMs:v,backgroundOnlyMs:y}}function U(e,t){return Math.min(t.end,Math.max(t.start,e))}function Ne(e){let t=Math.floor(e.windowMs/1e3),n=[[`getting ready`,Math.floor(e.gettingReadyMs/1e3)],[`thinking`,Math.floor(e.thinkingMs/1e3)],[`in tools`,Math.floor(e.toolsMs/1e3)],[`finishing up`,Math.floor(e.finishingUpMs/1e3)],[`not recorded`,Math.floor(e.notRecordedMs/1e3)],[`not loaded`,Math.floor(e.notLoadedMs/1e3)]],r=n.reduce((e,[,t])=>e+t,0),i=n.filter(([,e])=>e>0).map(([e,t])=>({term:e,s:t})),a=t-r;a>0&&i.push({term:`Switchboard overhead`,s:a});let o=[`getting ready`,`thinking`,`in tools`,`finishing up`,`Switchboard overhead`,`not recorded`,`not loaded`];return i.sort((e,t)=>o.indexOf(e.term)-o.indexOf(t.term)),{totalS:t,items:i}}function Pe(e){return[e.gettingReadyMs,e.thinkingMs,e.toolsMs,e.finishingUpMs,e.overheadMs,e.notRecordedMs,e.notLoadedMs].filter(t=>t>=2e3||e.windowMs>0&&t/e.windowMs>=.05).length>=2}function W(e,t){if(t===void 0||t<6e4)return;let n=E(t,`clock`);return e===`before`?`queued ${n} before we saw it`:`queued ${n} behind the previous run`}var G={"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`},K=`Ranked by each step's own time, its children excluded — the bar counts every instant once.`,Fe=`currently delivering`,Ie=`getting ready: not recorded (too large)`,Le=`no timing data`,Re=`not loaded (the record has the full shape)`,q={getting_ready:`getting ready`,thinking:`thinking`,tools:`in tools`,finishing_up:`finishing up`};function J(e){let{spans:t,window:n,owner:r}=e,i=e.phase!==`live`,a=Me(t,{window:n,owner:r,finished:i,losses:e.losses}),o=Ne(a),s=E(o.totalS*1e3,`clock`),c=t.find(e=>e.name===`request`&&e.parentSpanId===void 0),l=e.phase===`live`?ze(t,r,n):void 0,u=Be(e,l),d=l?R(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:K,debug:f,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:Le};let p={total:s,current:u,openStep:d,captions:[W(`before`,Y(c,`queuedBeforeMs`)),W(`behind`,Y(c,`queuedBehindMs`))].filter(e=>e!==void 0),rankedNote:K,debug:f};if(!c)return{...p,lede:s,shown:!1,bar:[],legend:[],ranked:[],note:i?Ie:``};let m=t=>t===`not recorded`?`not recorded${e.truncated?` (too large)`:``}`:t===`not loaded`?Re:t,h=Pe(a)&&o.items.length>0,g=h?`${s} — ${o.items.map(({term:e,s:t})=>`${E(t*1e3,`clock`)} ${m(e)}`).join(` · `)}`:a.windowMs>0?`${s} — ${m(Ve(a))}`:s,_=h?o.items.map(({term:t,s:n})=>({term:t,text:E(n*1e3,`clock`),definition:t===`not recorded`&&e.truncated?`${G[t]} (too large)`:G[t]})):[];return{...p,lede:g,shown:h,bar:h?He(a,l):[],legend:_,ranked:h?Ue(t,c,r,n,e.callTitle):[],note:``}}function Y(e,t){let n=e?.attrs[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function ze(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=L(o.name,t);if(e?.kind!==`counted`||X(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 X(e,t,n){let r=e,i=new Set;for(;r&&!i.has(r.spanId);){if(i.add(r.spanId),L(r.name,n)?.kind===`background`)return!0;r=r.parentSpanId?t.get(r.parentSpanId):void 0}return!1}function Be(e,t){return e.phase===`delivering`?Fe:e.phase===`ended`?oe(e.delivery??{}):t?`currently ${q[t.bucket]} ${E(t.elapsedMs,`clock`)}`:``}function Z(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 Ve(e){let t=[`getting ready`,-1];for(let n of Z(e))n[1]>t[1]&&(t=n);return t[0]}function He(e,t){let n=[],r=t=>e.windowMs>0?t/e.windowMs*100:0;for(let[i,a]of Z(e))if(!(a<=0)){if(t&&q[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 Ue(e,t,n,r,i){let a=new Map(e.map(e=>[e.spanId,e])),o=new Map;for(let t of e){if(t.parentSpanId===void 0)continue;let e=o.get(t.parentSpanId);e?e.push(t):o.set(t.parentSpanId,[t])}let s=e=>[Math.max(r.start,e.startedAt),Math.min(r.end,e.endedAt??r.end)],c=[];for(let r of e){if(r===t||r.name===`run.agent`||L(r.name,n)===void 0||X(r,a,n))continue;let[e,l]=s(r);if(l<=e)continue;let u=(o.get(r.spanId)??[]).map(s).map(([t,n])=>[Math.max(e,t),Math.min(l,n)]).filter(([e,t])=>t>e),d=l-e-We(u);if(d<=0)continue;let f=r.name.startsWith(`tool.`)&&typeof r.attrs.callId==`string`?r.attrs.callId:void 0,p=f?i?.(f):void 0;c.push({label:p??R(r.name),ms:d,facts:Ge(r),anchor:f?`call-${f}`:`span-${r.spanId}`,startedAt:r.startedAt})}return c.sort((e,t)=>t.ms-e.ms||e.startedAt-t.startedAt),c.slice(0,3).map(({label:e,ms:t,facts:n,anchor:r})=>({label:e,ms:t,facts:n,anchor:r}))}function We(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 Ge(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 ${E(t.timeoutMs,`clock`)}`),typeof t.waitedMs==`number`&&n.push(`waited ${E(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 Ke=[`data-state`],qe={key:0,class:`loading py-2 font-mono text-xs text-dimmed`},Je={key:1,class:`failed py-2 font-mono text-xs text-warn`},Ye=[`data-turn`,`data-anchor`],Xe={class:`landing-head flex flex-wrap items-baseline gap-x-2 font-mono text-xs text-muted`},Ze={class:`turn tabular-nums`},Qe={class:`what min-w-0 truncate text-toned`},$e={key:0,class:`m-0 mt-1 list-none p-0`},et=o({__name:`RunTimeline`,props:{run:{},land:{},fetch:{}},setup(n){let i=n,o=b(`loading`),s=ae(),v=S(()=>{if(o.value!==`ready`)return null;s.state.traceVersion;let e=i.run,t=e.receivedAt??e.startedAt,n=T(e)??(e.finishedAt===void 0?0:Math.max(0,e.finishedAt-t));return J({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 E=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:D(r.step),step:r.step}:null});function D(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 O=b(null),k=S(()=>E.value?`${i.land}@${E.value.anchor}`:null);return r(k,e=>{e!==null&&m().then(()=>{let e=(E.value?.step?O.value?.querySelector(`li.step`):null)??O.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=ce(await t.text()).filter(e=>e.type!==`replay_note`);for(let e of(i.run.schema??0)>=2?I(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`,qe,`reading the run's record…`)):o.value===`failed`?(d(),t(`p`,Je,[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`]),E.value?(d(),t(`div`,{key:0,ref_key:`landingEl`,ref:O,class:`landing mb-4 rounded-lg border border-default px-(--sb-gutter) py-2`,"data-turn":n.land,"data-anchor":E.value.anchor},[f(`p`,Xe,[f(`span`,Ze,`turn `+a(n.land),1),f(`span`,Qe,`· `+a(E.value.what),1),e(p,{class:`page ml-auto shrink-0 text-primary no-underline hover:underline`,to:C(E.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`])]),E.value.step?(d(),t(`ol`,$e,[e(se,{step:E.value.step,onToggleGroup:i[0]||=e=>h(s).toggleGroup(E.value.step)},null,8,[`step`])])):c(``,!0)],8,Ye)):c(``,!0)],64)):c(``,!0)],8,Ke)}}}),tt=[`id`,`data-run-id`,`data-round`,`data-thread`],$=[`open`],nt={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`},rt={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},it={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},at={key:3,class:`scope min-w-0 flex-1 truncate text-toned`},ot=[`title`],st=[`data-heat`],ct={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},lt={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)`},ut={key:0,class:`round shrink-0 rounded border border-accented px-1.5 font-mono text-[0.7rem] font-medium tabular-nums text-toned`},dt={key:2,class:`snippet min-w-0 flex-1 truncate text-muted`},ft={key:3,class:`scope min-w-0 flex-1 truncate text-highlighted`},pt=[`title`],mt={class:`elapsed shrink-0 text-right font-mono text-xs tabular-nums text-ok sm:min-w-[4.5em]`,title:`running for`},ht={class:`count shrink-0 text-right font-mono text-xs tabular-nums text-dimmed sm:min-w-[6em]`},gt=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||j(o.run.id))),_=S(()=>te(o.run)),y=S(()=>ee(o.run)),T=S(()=>o.run.finished),E=S(()=>o.run.finished&&o.run.status&&o.run.status!==`completed`?ne(o.run.status):``),F=S(()=>ie(o.run.finished&&typeof o.run.finishedAt==`number`?o.run.finishedAt-o.run.startedAt:void 0,`run`)),I=S(()=>re(F.value));function L(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:L},[f(`summary`,nt,[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(z,{tone:_.value,label:h(k)(n.run),tip:h(A)(n.run)},null,8,[`tone`,`label`,`tip`]),n.label?(d(),t(`span`,rt,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(P)[h(O)(m.value.agent)]])},a(m.value.agent),3)):c(``,!0),m.value.snippet===void 0?(d(),t(`span`,at,a(m.value.scope),1)):(d(),t(`span`,it,a(m.value.snippet),1)),E.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(E.value),3)):c(``,!0),f(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-dimmed`,title:h(D)(n.run)},a(h(w)(n.run.startedAt,n.now)),9,ot),f(`span`,{class:s([`elapsed shrink-0 text-right font-mono text-xs tabular-nums sm:min-w-[4.5em]`,[I.value?`heat`:`text-muted`,F.value.level>=2?`font-medium`:``]]),style:i(I.value),"data-heat":F.value.level,title:`start to finish`},a(h(M)(n.run,n.now)),15,st),f(`span`,ct,a(h(N)(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(j)(n.run.id)}`,onClick:o[0]||=v(()=>{},[`stop`])},{default:u(()=>[...o[1]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]),p.value?(d(),x(et,{key:0,run:n.run,land:n.land},null,8,[`run`,`land`])):c(``,!0)],40,$)):(d(),t(`div`,lt,[o[4]||=f(`span`,{class:`chev select-none text-xs text-transparent`,"aria-hidden":`true`},`❯`,-1),e(z,{tone:_.value,label:h(k)(n.run),tip:h(A)(n.run),pulse:``},null,8,[`tone`,`label`,`tip`]),n.label?(d(),t(`span`,ut,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(P)[h(O)(m.value.agent)]])},a(m.value.agent),3)):c(``,!0),m.value.snippet===void 0?(d(),t(`span`,ft,a(m.value.scope),1)):(d(),t(`span`,dt,a(m.value.snippet),1)),f(`span`,{class:`when shrink-0 font-mono text-xs tabular-nums text-muted`,title:h(D)(n.run)},a(h(w)(n.run.startedAt,n.now)),9,pt),f(`span`,mt,a(h(M)(n.run,n.now)),1),f(`span`,ht,a(h(N)(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(j)(n.run.id)}`},{default:u(()=>[...o[3]||=[g(`open ↗`,-1)]]),_:1},8,[`to`,`aria-label`])]))],10,tt)}}});export{pe as a,H as i,Q as n,fe as o,J as r,gt as t};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dist-rgAhsmE-.js","assets/AppShell-DAtHiuI6.js","assets/browser-B6T5hjfR.js","assets/main-CeRuGONy.js","assets/main-zbP_dTjR.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{D as e,M as t,b as n,d as r,f as i,t as a,v as o,y as s}from"./AppShell-DAtHiuI6.js";import{An as c,Br as l,Cn as u,Cr as d,Ct as f,E as p,Gr as m,I as h,Ii as g,K as _,L as v,Li as y,Mn as b,Oi as x,Pi as S,S as C,Sn as w,Tr as ee,Vr as T,X as E,Xr as D,Zn as O,_ as te,_r as k,b as A,bn as j,dr as M,ft as ne,g as re,gt as N,h as ie,hr as ae,ht as oe,ir as se,ji as P,kn as F,l as ce,ln as I,lt as le,nn as ue,o as de,qr as fe,r as pe,rn as me,rr as L,rt as he,sr as R,st as ge,t as _e,wi as ve,wr as z,x as B,xi as V,xn as H,y as U,yi as ye,yn as W,yr as be,z as G}from"./browser-B6T5hjfR.js";import{t as xe}from"./Tooltip-Brge0wnd.js";import{i as Se,n as Ce,r as we,t as Te}from"./PendingTurnRow-BuRre8it.js";import{b as Ee,t as De,x as Oe}from"./main-CeRuGONy.js";import{t as ke}from"./eventSource-Bj_dZf6M.js";import{t as Ae}from"./wallClock-DmaC1sKA.js";import{t as je}from"./indexFormat-B-pd4r7Y.js";import{O as Me,w as Ne,y as Pe}from"./indexRow-BmK74Vp1.js";import{i as Fe,n as Ie,r as Le}from"./format-BldUwl_R.js";import{a as Re,i as ze,n as Be,t as Ve}from"./durationTone-U_rOqo6r.js";import{C as He,E as K,S as Ue,_ as We,a as Ge,b as Ke,c as qe,d as Je,g as Ye,h as Xe,i as Ze,l as Qe,n as $e,o as et,r as tt,s as nt,u as rt,v as it,x as at,y as ot}from"./sseReplay-DXC7kGbN.js";import{t as q}from"./NotFoundPage-DtE-GgTk.js";import{a as st,i as ct,n as lt,o as ut,r as dt,t as ft}from"./RunFoldRow-BRXkjkgO.js";var pt=b({__name:`RovingFocusItem`,props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(t){let r=t,a=i(),l=e(),u=W(()=>r.tabStopId||l),d=W(()=>a.currentTabStopId.value===u.value),{getItems:f,CollectionItem:g}=p();M(()=>{r.focusable&&a.onFocusableItemAdd()}),ae(()=>{r.focusable&&a.onFocusableItemRemove()}),m(()=>r.focusable,(e,t)=>{e!==t&&(e?a.onFocusableItemAdd():a.onFocusableItemRemove())});function _(e){if(e.key===`Tab`&&e.shiftKey){a.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=s(e,a.orientation.value,a.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!r.allowShiftKey&&e.shiftKey)return;e.preventDefault();let i=[...f().map(e=>e.ref).filter(e=>e.dataset.disabled!==``)];if(t===`last`)i.reverse();else if(t===`prev`||t===`next`){t===`prev`&&i.reverse();let r=i.indexOf(e.currentTarget);i=a.loop.value?n(i,r+1):i.slice(r+1)}se(()=>o(i))}}return(e,t)=>(k(),H(P(g),null,{default:D(()=>[c(P(h),{tabindex:d.value?0:-1,"data-orientation":P(a).orientation.value,"data-active":e.active?``:void 0,"data-disabled":e.focusable?void 0:``,as:e.as,"as-child":e.asChild,onMousedown:t[0]||=t=>{e.focusable?P(a).onItemFocus(u.value):t.preventDefault()},onFocus:t[1]||=e=>P(a).onItemFocus(u.value),onKeydown:_},{default:D(()=>[z(e.$slots,`default`)]),_:3},8,[`tabindex`,`data-orientation`,`data-active`,`data-disabled`,`as`,`as-child`])]),_:3}))}}),[J,mt]=_(`TabsRoot`),ht=b({__name:`TabsRoot`,props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:`horizontal`},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:`automatic`},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`],setup(n,{emit:r}){let i=n,a=r,{orientation:o,unmountOnHide:s,dir:c}=x(i),l=t(c);G();let u=N(i,`modelValue`,a,{defaultValue:i.defaultValue,passive:i.modelValue===void 0}),d=V(),f=ve(new Set);return mt({modelValue:u,changeModelValue:e=>{u.value=e},orientation:o,dir:l,unmountOnHide:s,activationMode:i.activationMode,baseId:e(void 0,`reka-tabs`),tabsList:d,contentIds:f,registerContent:e=>{f.value=new Set([...f.value,e])},unregisterContent:e=>{let t=new Set(f.value);t.delete(e),f.value=t}}),(e,t)=>(k(),H(P(h),{dir:P(l),"data-orientation":P(o),"as-child":e.asChild,as:e.as},{default:D(()=>[z(e.$slots,`default`,{modelValue:P(u)})]),_:3},8,[`dir`,`data-orientation`,`as-child`,`as`]))}});function gt(e,t){return`${e}-trigger-${t}`}function Y(e,t){return`${e}-content-${t}`}var _t=b({__name:`TabsContent`,props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,{forwardRef:n}=G(),r=J(),i=W(()=>gt(r.baseId,t.value)),a=W(()=>Y(r.baseId,t.value)),o=W(()=>t.value===r.modelValue.value),s=V(o.value);return M(()=>{r.registerContent(t.value),requestAnimationFrame(()=>{s.value=!1})}),R(()=>{r.unregisterContent(t.value)}),(e,t)=>(k(),H(P(v),{present:e.forceMount||o.value,"force-mount":``},{default:D(({present:t})=>[c(P(h),{id:a.value,ref:P(n),"as-child":e.asChild,as:e.as,role:`tabpanel`,"data-state":o.value?`active`:`inactive`,"data-orientation":P(r).orientation.value,"aria-labelledby":i.value,hidden:!t,tabindex:`0`,style:g({animationDuration:s.value?`0s`:void 0})},{default:D(()=>[!P(r).unmountOnHide.value||t?z(e.$slots,`default`,{key:0}):w(`v-if`,!0)]),_:2},1032,[`id`,`as-child`,`as`,`data-state`,`data-orientation`,`aria-labelledby`,`hidden`,`style`])]),_:3},8,[`present`]))}}),vt=b({__name:`TabsIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e,{expose:t}){let n=e,r=J();t({updateIndicatorStyle:s}),G();let i=ne(),a=V({size:null,thickness:null,position:null}),o=V([]);m(()=>[r.modelValue.value,r?.dir.value],()=>{s()},{immediate:!0,flush:`post`}),fe(()=>{o.value=Array.from(r.tabsList.value?.querySelectorAll(`[role="tab"]`)||[])}),oe(W(()=>[r.tabsList.value,...o.value]),s);function s(){let e=r.tabsList.value?.querySelector(`[role="tab"][data-state="active"]`);e&&(r.orientation.value===`horizontal`?a.value={size:e.offsetWidth,thickness:e.offsetHeight,position:e.offsetLeft}:a.value={size:e.offsetHeight,thickness:e.offsetWidth,position:e.offsetTop})}return(e,t)=>P(i)&&typeof a.value.size==`number`?(k(),H(P(h),L({key:0},n,{style:{"--reka-tabs-indicator-size":`${a.value.size}px`,"--reka-tabs-indicator-thickness":`${a.value.thickness}px`,"--reka-tabs-indicator-position":`${a.value.position}px`}}),{default:D(()=>[z(e.$slots,`default`)]),_:3},16,[`style`])):w(`v-if`,!0)}}),yt=b({__name:`TabsList`,props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let{loop:t}=x(e),{forwardRef:n,currentElement:i}=G(),a=J();return a.tabsList=i,(e,i)=>(k(),H(P(r),{"as-child":``,orientation:P(a).orientation.value,dir:P(a).dir.value,loop:P(t)},{default:D(()=>[c(P(h),{ref:P(n),role:`tablist`,"as-child":e.asChild,as:e.as,"aria-orientation":P(a).orientation.value},{default:D(()=>[z(e.$slots,`default`)]),_:3},8,[`as-child`,`as`,`aria-orientation`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),bt=b({__name:`TabsTrigger`,props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e,{forwardRef:n}=G(),r=J(),i=W(()=>gt(r.baseId,t.value)),a=W(()=>r.contentIds.value.has(t.value)?Y(r.baseId,t.value):void 0),o=W(()=>t.value===r.modelValue.value);return(e,t)=>(k(),H(P(pt),{"as-child":``,focusable:!e.disabled,active:o.value},{default:D(()=>[c(P(h),{id:i.value,ref:P(n),role:`tab`,type:e.as===`button`?`button`:void 0,as:e.as,"as-child":e.asChild,"aria-selected":o.value?`true`:`false`,"aria-controls":a.value,"data-state":o.value?`active`:`inactive`,disabled:e.disabled,"data-disabled":e.disabled?``:void 0,"data-orientation":P(r).orientation.value,onMousedown:t[0]||=me(t=>{!e.disabled&&t.ctrlKey===!1?P(r).changeModelValue(e.value):t.preventDefault()},[`left`]),onKeydown:t[1]||=ue(t=>P(r).changeModelValue(e.value),[`enter`,`space`]),onFocus:t[2]||=()=>{let t=P(r).activationMode!==`manual`;!o.value&&!e.disabled&&t&&P(r).changeModelValue(e.value)}},{default:D(()=>[z(e.$slots,`default`)]),_:3},8,[`id`,`type`,`as`,`as-child`,`aria-selected`,`aria-controls`,`data-state`,`disabled`,`data-disabled`,`data-orientation`])]),_:3},8,[`focusable`,`active`]))}}),xt=[`data-expanded`,`data-overflowing`],St={key:0,class:`fade pointer-events-none absolute inset-x-0 bottom-6 h-10`},Ct={key:1,class:`mt-1 flex justify-start`},wt=[`aria-expanded`],Tt=Re(b({__name:`ExpandableText`,props:{lines:{default:5}},setup(e){let t=e,n=V(!1),r=V(!1),i=V(null),a=`expandable-${Math.random().toString(36).slice(2,8)}`;function o(){let e=i.value;e&&!n.value&&(r.value=e.scrollHeight>e.clientHeight+1)}let s=null;M(()=>{o(),typeof ResizeObserver<`u`&&i.value&&(s=new ResizeObserver(()=>o()),s.observe(i.value))}),R(()=>s?.disconnect()),m(n,e=>{e||Promise.resolve().then(o)});function c(){n.value=!n.value}function l(e){!n.value&&r.value&&(e.target?.closest?.(`a`)||(n.value=!0))}return(e,o)=>(k(),u(`div`,{class:S([`expandable group relative`,!n.value&&r.value?`cursor-pointer`:``]),"data-expanded":n.value?`1`:`0`,"data-overflowing":r.value?`1`:`0`,onClick:l},[j(`div`,{id:a,ref_key:`body`,ref:i,class:S([`body`,n.value?``:`clamped`]),style:g(n.value?void 0:{"--expandable-lines":String(t.lines)})},[z(e.$slots,`default`,{},void 0,!0)],6),!n.value&&r.value?(k(),u(`div`,St)):w(``,!0),r.value||n.value?(k(),u(`div`,Ct,[j(`button`,{type:`button`,class:`more cursor-pointer text-xs text-dimmed group-hover:text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"aria-expanded":n.value?`true`:`false`,"aria-controls":a,onClick:me(c,[`stop`])},y(n.value?`Show less`:`Show more`),9,wt)])):w(``,!0)],10,xt))}}),[[`__scopeId`,`data-v-ce3bfa89`]]),X=[`id`],Et={class:`what`},Dt={key:0,class:`text-dimmed`},Z={key:1,class:`dur tabular-nums text-dimmed`},Q=[`title`],Ot=b({__name:`SpanRow`,props:{item:{}},setup(e){return(t,n)=>(k(),u(`li`,{id:`span-${e.item.spanId}`,class:`span flex items-baseline gap-2 py-0.5 pr-(--sb-gutter) font-mono text-xs text-muted`},[j(`span`,{class:S([`glyph select-none`,e.item.status===`error`?`text-bad`:`text-dimmed`])},y(e.item.open?`◌`:e.item.status===`error`?`✗`:`◷`),3),j(`span`,Et,y(e.item.text),1),e.item.open?(k(),u(`span`,Dt,`…`)):e.item.durationMs===void 0?w(``,!0):(k(),u(`span`,Z,y(P(Me)(e.item.durationMs,`precise`)),1)),e.item.at===void 0?w(``,!0):(k(),u(`span`,{key:2,class:`ts ml-auto select-none text-dimmed`,title:P(Fe)(e.item.at)},y(P(Ie)(e.item.at)),9,Q))],8,X))}}),kt=[`data-position`],At={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-ok`},jt=[`href`],Mt={key:1,class:`caption font-normal normal-case tracking-normal text-dimmed`},Nt=[`title`],Pt=b({__name:`ReplyBlock`,props:{text:{},caption:{},when:{},whenTitle:{},position:{},files:{}},setup(e){return(t,n)=>(k(),u(`section`,{id:`reply`,class:S([`block rounded-lg border border-ok/40 bg-(--ui-bg-muted) px-(--sb-gutter) py-3`,e.position===`first`?`mb-4`:`mt-6`]),"data-position":e.position},[j(`h2`,At,[n[0]||=j(`span`,null,`Reply`,-1),e.caption.href?(k(),u(`a`,{key:0,class:`caption font-normal normal-case tracking-normal text-dimmed no-underline hover:text-primary hover:underline`,href:e.caption.href,target:`_blank`,rel:`noopener noreferrer`},y(e.caption.text),9,jt)):(k(),u(`span`,Mt,y(e.caption.text),1)),j(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:e.whenTitle},y(e.when),9,Nt)]),c(K,{text:e.text},null,8,[`text`]),e.files.length>0?(k(),H(tt,{key:0,files:e.files},null,8,[`files`])):w(``,!0)],10,kt))}}),Ft={id:`units`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},It={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Lt={class:`count font-normal normal-case tracking-normal text-dimmed`},Rt={class:`m-0 list-none p-0`},zt=[`data-unit`],Bt=[`href`],Vt=b({__name:`RunUnitsBlock`,props:{units:{}},setup(e){let t={merged:`border-ok/30 text-ok`,merge_ready:`border-ok/30 text-ok`,done:`border-ok/30 text-ok`};function n(e){return e.ending?e.ending.kind:e.threads.coding===void 0?`not started`:`round ${e.rounds.at(-1)?.index??0} · ${e.rounds.at(-1)?.agent??`in flight`}`}return(r,i)=>{let a=ee(`RouterLink`);return k(),u(`section`,Ft,[j(`h2`,It,[i[0]||=j(`span`,null,`Units`,-1),j(`span`,Lt,`· `+y(e.units.length)+` unit`+y(e.units.length===1?``:`s`)+` — each opens to its runs in round order`,1)]),j(`ol`,Rt,[(k(!0),u(I,null,d(e.units,e=>(k(),u(`li`,{key:e.unit,class:`unit flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 border-t border-default py-1.5 first:border-t-0`,"data-unit":e.unit},[c(a,{class:`key shrink-0 rounded border border-accented px-1.5 font-mono text-[0.72rem] font-medium text-toned no-underline hover:border-primary hover:text-primary`,to:`/runs/unit/${encodeURIComponent(e.unit)}`},{default:D(()=>[F(y(e.id),1)]),_:2},1032,[`to`]),c(a,{class:`title min-w-0 flex-1 truncate text-sm text-highlighted no-underline hover:underline`,to:`/runs/unit/${encodeURIComponent(e.unit)}`},{default:D(()=>[F(y(e.title??e.branch),1)]),_:2},1032,[`to`]),j(`span`,{class:S([`standing shrink-0 rounded border px-1.5 font-mono text-[0.7rem]`,t[e.ending?.kind??``]??`border-accented text-muted`])},y(n(e)),3),e.pr?(k(),u(`a`,{key:0,class:`prlink shrink-0 whitespace-nowrap font-mono text-xs text-primary no-underline hover:underline`,href:e.pr.url,target:`_blank`,rel:`noopener noreferrer`},[c(ut,{class:`mr-1 align-[-0.125em]`}),F(`#`+y(e.pr.number),1)],8,Bt)):w(``,!0)],8,zt))),128))])])}}}),Ht={id:`children`,class:`block mb-4 px-(--sb-gutter)`},Ut={class:`mb-1 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Wt={class:`count font-normal normal-case tracking-normal text-dimmed`},Gt={class:`m-0 list-none border-t border-muted p-0`},Kt=b({__name:`RunChildrenBlock`,props:{children:{},now:{}},setup(e){return(t,n)=>(k(),u(`section`,Ht,[j(`h2`,Ut,[n[0]||=j(`span`,null,`Spawned runs`,-1),j(`span`,Wt,`· `+y(e.children.length)+` run`+y(e.children.length===1?``:`s`)+`, in the order they started`,1)]),j(`ol`,Gt,[(k(!0),u(I,null,d(e.children,t=>(k(),H(ft,{key:t.id,run:t,now:e.now},null,8,[`run`,`now`]))),128))])]))}});function qt(e){return e.description?.title?e.description.title:e.pr.repo&&e.pr.number!==void 0?`${e.pr.repo}#${e.pr.number}`:e.pr.repo??`PR review`}var Jt=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Yt=/^[0-9a-f]{7,40}$/;function Xt(e){if(!e.repo||!Jt.test(e.repo))return{};let t=`https://github.com/${e.repo}`,n={};return e.number!==void 0&&Number.isInteger(e.number)&&e.number>0&&(n.pr=`${t}/pull/${e.number}`,n.files=`${t}/pull/${e.number}/files`),e.headSha&&Yt.test(e.headSha)&&(n.commit=e.number!==void 0&&n.pr?`${t}/pull/${e.number}/commits/${e.headSha}`:`${t}/commit/${e.headSha}`),n}function Zt(e){return e.find(e=>e.poweredBy===`meat`)??e.find(e=>e.poweredBy===`git`)??null}function Qt(e){return e===`meat`?`An abridged reading of the change: a model dropped what a reviewer need not read (style, imports, boilerplate) and kept the concepts`:`The complete change, base…head, as git reports it`}function $t(e){return`The recorded diff was cut at ${e.toLocaleString(`en-US`)} characters; open the full diff on GitHub for the rest`}function en(e){return e===`meat`?`reading diff · meat`:`full diff · git`}function tn(e){let t=[];return e.origin===`parsed`&&!e.complete&&t.push(`read back from the PR body`),e.truncated&&t.push(`the body was cut before it was read`),t.length>0?t.join(`; `):void 0}var nn=e=>typeof e==`object`&&!!e,$=e=>typeof e==`string`&&e!==``,rn=e=>typeof e==`number`&&Number.isInteger(e)&&e>0;function an(e){for(let t of e.split(/\n\s*\n/)){let e=t.split(`
|
|
3
|
-
`).map(e=>e.trim()).filter(e=>e!==``);if(!(e.length===0||e.every(e=>e.startsWith(`#`))))return e.join(`
|
|
4
|
-
`)}}function on(e,t){let n=t.trim().toLowerCase(),r=[],i=!1,a=!1;for(let t of e.split(`
|
|
5
|
-
`)){/^\s*```/.test(t)&&(i=!i);let e=i?null:/^##\s+(.+?)\s*$/.exec(t);if(e){if(a)break;a=e[1].toLowerCase()===n;continue}a&&r.push(t)}let o=r.join(`
|
|
6
|
-
`).trim();return o===``?void 0:o}function sn(e,t){let n=t.trim().toLowerCase(),r=[],i=!1,a=!1;for(let t of e.split(`
|
|
7
|
-
`)){/^\s*```/.test(t)&&(i=!i);let e=t.trim();if(!i&&a&&e===`<details>`)break;let o=i?null:/^\*\*([^*]+?):?\*\*\s*(.*)$/.exec(e);if(o){let e=o[1].trim().toLowerCase(),t=[`why`,`where to look`,`feedback wanted`,`risk`,`verified`].includes(e);if(a&&t)break;if(e===n){a=!0,o[2]&&r.push(o[2]);continue}}a&&r.push(t)}let o=r.join(`
|
|
8
|
-
`).trim();return o===``?void 0:o}function cn(e){if(!$(e.title)||e.origin!==`submitted`&&e.origin!==`parsed`)return;let t=typeof e.body==`string`?e.body:``,n=$(e.tldr)?e.tldr:an(t),r=$(e.why)?e.why:sn(t,`Why`)??on(t,`What & why`);return{title:e.title,...n===void 0?{}:{tldr:n},...r===void 0?{}:{why:r},origin:e.origin,complete:e.complete===!0,truncated:e.truncated===!0}}function ln(){let e=ye({pr:{},readingDiffs:[],ready:!1});return{state:e,handle(t){if(!nn(t))return;let n=t;if(n.type===`run_meta`)$(n.repo)&&(e.pr.repo=n.repo),rn(n.pr)&&(e.pr.number=n.pr),typeof n.headSha==`string`&&Yt.test(n.headSha)&&(e.pr.headSha=n.headSha);else if(n.type===`review_artifact`&&n.artifact===`reading_diff`){if(!$(n.diff)||n.poweredBy!==`git`&&n.poweredBy!==`meat`)return;let t={poweredBy:n.poweredBy,baseRef:$(n.baseRef)?n.baseRef:`HEAD`,diff:n.diff,truncated:n.truncated===!0,...$(n.summary)?{summary:n.summary}:{}},r=e.readingDiffs.findIndex(e=>e.poweredBy===t.poweredBy);r>=0?e.readingDiffs.splice(r,1,t):e.readingDiffs.push(t),e.ready=!0}else if(n.type===`review_artifact`&&n.artifact===`pr_description`){let t=cn(n);t&&(e.description=t)}}}}var un=3e3,dn={fetch:(...e)=>globalThis.fetch(...e),delay:e=>new Promise(t=>setTimeout(t,e))};function fn(e,t,n={}){let{fetch:r,delay:i}={...dn,...n},a=ye({state:{state:`absent`}}),o=!1,s=!1;async function c(t){let n=await r(`/api/review.abridge`,{method:`POST`,credentials:`same-origin`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e,...t?{force:!0}:{}})}),i=await n.json().catch(()=>null);if(!n.ok)throw Error(typeof i?.error==`string`?i.error:`HTTP ${n.status}`);return i??{}}async function l(){let n=!1,i;for(let a=0;a<50;a++){let a=`id=${encodeURIComponent(e)}${i===void 0?``:`&after-seq=${i}`}`,s=await r(`/api/runs.events?${a}`,{credentials:`same-origin`});if(o)return`disposed`;if(!s.ok)throw Error(`HTTP ${s.status}`);let c=await s.json();if(o)return`disposed`;for(let e of c.events??[]){t(e);let r=e;r.type===`review_artifact`&&r.artifact===`reading_diff`&&r.poweredBy===`meat`&&(n=!0)}if(typeof c.nextAfterSeq!=`number`)return n?`found`:`missing`;if(i!==void 0&&c.nextAfterSeq<=i)return`stuck`;i=c.nextAfterSeq}return`stuck`}async function u(e){try{let t=await c(e);for(let e=0;t.state===`running`;e++){if(e>=200){s=!1,a.state={state:`failed`,reason:`still running after the page stopped waiting; ask again later`};return}if(await i(un),o)return;t=await c(!1)}if(o)return;if(t.state===`failed`)s=!0,a.state={state:`failed`,reason:typeof t.reason==`string`?t.reason:`unknown reason`};else if(t.state===`done`){let e=await l();if(e===`disposed`)return;s=!1,a.state=e===`found`?{state:`done`}:{state:`failed`,reason:e===`stuck`?`the run's record did not page to its end`:`the abridged diff did not appear on the run's record`}}else s=!1,a.state={state:`failed`,reason:`unexpected answer: ${String(t.state)}`}}catch(e){if(o)return;s=!1,a.state={state:`failed`,reason:e instanceof Error?e.message:String(e)}}}return{get state(){return a.state},start(){if(a.state.state===`running`||o)return;let e=a.state.state===`failed`&&s;a.state={state:`running`},u(e)},dispose(){o=!0}}}var pn={slots:{base:`font-medium inline-flex items-center`,label:`truncate`,leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,trailingIcon:`shrink-0`},variants:{fieldGroup:{horizontal:`not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]`,vertical:`not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]`},color:{primary:``,secondary:``,success:``,info:``,warning:``,error:``,neutral:``},variant:{solid:``,outline:``,soft:``,subtle:``},size:{xs:{base:`text-[8px]/3 px-1 py-0.5 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},sm:{base:`text-[10px]/3 px-1.5 py-1 gap-1 rounded-sm`,leadingIcon:`size-3`,leadingAvatarSize:`3xs`,trailingIcon:`size-3`},md:{base:`text-xs px-2 py-1 gap-1 rounded-md`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`,trailingIcon:`size-4`},lg:{base:`text-sm px-2 py-1 gap-1.5 rounded-md`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`,trailingIcon:`size-5`},xl:{base:`text-base px-2.5 py-1 gap-1.5 rounded-md`,leadingIcon:`size-6`,leadingAvatarSize:`2xs`,trailingIcon:`size-6`}},square:{true:``}},compoundVariants:[{color:`primary`,variant:`solid`,class:`bg-primary text-inverted`},{color:`secondary`,variant:`solid`,class:`bg-secondary text-inverted`},{color:`success`,variant:`solid`,class:`bg-success text-inverted`},{color:`info`,variant:`solid`,class:`bg-info text-inverted`},{color:`warning`,variant:`solid`,class:`bg-warning text-inverted`},{color:`error`,variant:`solid`,class:`bg-error text-inverted`},{color:`primary`,variant:`outline`,class:`text-primary ring ring-inset ring-primary/50`},{color:`secondary`,variant:`outline`,class:`text-secondary ring ring-inset ring-secondary/50`},{color:`success`,variant:`outline`,class:`text-success ring ring-inset ring-success/50`},{color:`info`,variant:`outline`,class:`text-info ring ring-inset ring-info/50`},{color:`warning`,variant:`outline`,class:`text-warning ring ring-inset ring-warning/50`},{color:`error`,variant:`outline`,class:`text-error ring ring-inset ring-error/50`},{color:`primary`,variant:`soft`,class:`bg-primary/10 text-primary`},{color:`secondary`,variant:`soft`,class:`bg-secondary/10 text-secondary`},{color:`success`,variant:`soft`,class:`bg-success/10 text-success`},{color:`info`,variant:`soft`,class:`bg-info/10 text-info`},{color:`warning`,variant:`soft`,class:`bg-warning/10 text-warning`},{color:`error`,variant:`soft`,class:`bg-error/10 text-error`},{color:`primary`,variant:`subtle`,class:`bg-primary/10 text-primary ring ring-inset ring-primary/25`},{color:`secondary`,variant:`subtle`,class:`bg-secondary/10 text-secondary ring ring-inset ring-secondary/25`},{color:`success`,variant:`subtle`,class:`bg-success/10 text-success ring ring-inset ring-success/25`},{color:`info`,variant:`subtle`,class:`bg-info/10 text-info ring ring-inset ring-info/25`},{color:`warning`,variant:`subtle`,class:`bg-warning/10 text-warning ring ring-inset ring-warning/25`},{color:`error`,variant:`subtle`,class:`bg-error/10 text-error ring ring-inset ring-error/25`},{color:`neutral`,variant:`solid`,class:`text-inverted bg-inverted`},{color:`neutral`,variant:`outline`,class:`ring ring-inset ring-accented text-default bg-default`},{color:`neutral`,variant:`soft`,class:`text-default bg-elevated`},{color:`neutral`,variant:`subtle`,class:`ring ring-inset ring-accented text-default bg-elevated`},{size:`xs`,square:!0,class:`p-0.5`},{size:`sm`,square:!0,class:`p-1`},{size:`md`,square:!0,class:`p-1`},{size:`lg`,square:!0,class:`p-1`},{size:`xl`,square:!0,class:`p-1`}],defaultVariants:{color:`primary`,variant:`solid`,size:`md`}},mn={__name:`Badge`,props:{as:{type:null,required:!1,default:`span`},label:{type:[String,Number],required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1}},setup(e){let t=e,n=l(),r=C(`badge`,t),i=he(),{orientation:a,size:o}=ie(t),{isLeading:s,isTrailing:c,leadingIconName:d,trailingIconName:f}=re(r),p=W(()=>A({extend:pn,...i.ui?.badge||{}})({color:r.color,variant:r.variant,size:o.value??r.size,square:r.square||!n.default&&!r.label,fieldGroup:a.value}));return(e,t)=>(k(),H(P(h),{as:P(r).as,"data-slot":`base`,class:S(p.value.base({class:[P(r).ui?.base,P(r).class]}))},{default:D(()=>[z(e.$slots,`leading`,{ui:p.value},()=>[P(s)&&P(d)?(k(),H(U,{key:0,name:P(d),"data-slot":`leadingIcon`,class:S(p.value.leadingIcon({class:P(r).ui?.leadingIcon}))},null,8,[`name`,`class`])):P(r).avatar?(k(),H(te,L({key:1,size:P(r).ui?.leadingAvatarSize||p.value.leadingAvatarSize()},P(r).avatar,{"data-slot":`leadingAvatar`,class:p.value.leadingAvatar({class:P(r).ui?.leadingAvatar})}),null,16,[`size`,`class`])):w(``,!0)]),z(e.$slots,`default`,{ui:p.value},()=>[P(r).label!==void 0&&P(r).label!==null?(k(),u(`span`,{key:0,"data-slot":`label`,class:S(p.value.label({class:P(r).ui?.label}))},y(P(r).label),3)):w(``,!0)]),z(e.$slots,`trailing`,{ui:p.value},()=>[P(c)&&P(f)?(k(),H(U,{key:0,name:P(f),"data-slot":`trailingIcon`,class:S(p.value.trailingIcon({class:P(r).ui?.trailingIcon}))},null,8,[`name`,`class`])):w(``,!0)])]),_:3},8,[`as`,`class`]))}},hn={slots:{root:`flex items-center gap-2`,list:`relative flex p-1 group`,indicator:`absolute transition-[translate,width] duration-200 ease-out motion-reduce:transition-none`,trigger:[`group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75`,`transition-colors`],leadingIcon:`shrink-0`,leadingAvatar:`shrink-0`,leadingAvatarSize:``,label:`truncate`,trailingBadge:`shrink-0`,trailingBadgeSize:`sm`,content:`w-full rounded-md focus-visible:outline-3`},variants:{color:{primary:{content:`outline-primary/25`},secondary:{content:`outline-secondary/25`},success:{content:`outline-success/25`},info:{content:`outline-info/25`},warning:{content:`outline-warning/25`},error:{content:`outline-error/25`},neutral:{content:`outline-inverted/25`}},variant:{pill:{list:`bg-elevated rounded-lg`,trigger:[`grow`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate`],indicator:`rounded-md shadow-xs`},link:{list:`border-default`,indicator:`rounded-full`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full`}},orientation:{horizontal:{root:`flex-col`,list:`w-full`,indicator:`left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)`,trigger:`justify-center`},vertical:{list:`flex-col`,indicator:`top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)`}},size:{xs:{trigger:`px-2 py-1 text-xs gap-1`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},sm:{trigger:`px-2.5 py-1.5 text-xs gap-1.5`,leadingIcon:`size-4`,leadingAvatarSize:`3xs`},md:{trigger:`px-3 py-1.5 text-sm gap-1.5`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},lg:{trigger:`px-3 py-2 text-sm gap-2`,leadingIcon:`size-5`,leadingAvatarSize:`2xs`},xl:{trigger:`px-3 py-2 text-base gap-2`,leadingIcon:`size-6`,leadingAvatarSize:`xs`}}},compoundVariants:[{orientation:`horizontal`,variant:`pill`,class:{indicator:`inset-y-1`}},{orientation:`horizontal`,variant:`link`,class:{list:`border-b -mb-px`,indicator:`-bottom-px h-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px`}},{orientation:`vertical`,variant:`pill`,class:{indicator:`inset-x-1`,list:`items-center`,trigger:`w-full justify-center`}},{orientation:`vertical`,variant:`link`,class:{list:`border-s -ms-px`,indicator:`-start-px w-px`,trigger:`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px`}},{color:`primary`,variant:`pill`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary`]}},{color:`secondary`,variant:`pill`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary`]}},{color:`success`,variant:`pill`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success`]}},{color:`info`,variant:`pill`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info`]}},{color:`warning`,variant:`pill`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning`]}},{color:`error`,variant:`pill`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error`]}},{color:`neutral`,variant:`pill`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted`]}},{color:`primary`,variant:`link`,class:{indicator:`bg-primary`,trigger:[`data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary`]}},{color:`secondary`,variant:`link`,class:{indicator:`bg-secondary`,trigger:[`data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary`]}},{color:`success`,variant:`link`,class:{indicator:`bg-success`,trigger:[`data-[state=active]:text-success outline-success/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success`]}},{color:`info`,variant:`link`,class:{indicator:`bg-info`,trigger:[`data-[state=active]:text-info outline-info/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info`]}},{color:`warning`,variant:`link`,class:{indicator:`bg-warning`,trigger:[`data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning`]}},{color:`error`,variant:`link`,class:{indicator:`bg-error`,trigger:[`data-[state=active]:text-error outline-error/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error`]}},{color:`neutral`,variant:`link`,class:{indicator:`bg-inverted`,trigger:[`data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3`,`in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted`]}}],defaultVariants:{color:`primary`,variant:`pill`,size:`md`}},gn={__name:`Tabs`,props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:`horizontal`},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:`value`},labelKey:{type:null,required:!1,default:`label`},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:`0`},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=l(),o=C(`tabs`,r),s=he(),p=B(f(o,`as`,`unmountOnHide`),i),m=W(()=>A({extend:hn,...s.ui?.tabs||{}})({color:o.color,variant:o.variant,size:o.size,orientation:o.orientation})),h=V([]);function g(e,t){h.value[e]=t}return t({triggersRef:h}),(e,t)=>(k(),H(P(ht),L(P(p),{"model-value":P(o).modelValue,"default-value":P(o).defaultValue,orientation:P(o).orientation,"activation-mode":P(o).activationMode,"data-slot":`root`,class:m.value.root({class:[P(o).ui?.root,P(o).class]})}),{default:D(()=>[c(P(yt),{"data-slot":`list`,class:S(m.value.list({class:P(o).ui?.list}))},{default:D(()=>[c(P(vt),{"data-slot":`indicator`,class:S(m.value.indicator({class:P(o).ui?.indicator}))},null,8,[`class`]),z(e.$slots,`list-leading`),(k(!0),u(I,null,d(P(o).items,(t,n)=>(k(),H(P(bt),{key:P(E)(t,P(o).valueKey)??n,ref_for:!0,ref:e=>g(n,e),value:P(E)(t,P(o).valueKey)??String(n),disabled:t.disabled,"data-slot":`trigger`,class:S(m.value.trigger({class:[P(o).ui?.trigger,t.ui?.trigger]}))},{default:D(()=>[z(e.$slots,`leading`,{item:t,index:n,ui:m.value},()=>[t.icon?(k(),H(U,{key:0,name:t.icon,"data-slot":`leadingIcon`,class:S(m.value.leadingIcon({class:[P(o).ui?.leadingIcon,t.ui?.leadingIcon]}))},null,8,[`name`,`class`])):t.avatar?(k(),H(te,L({key:1,size:t.ui?.leadingAvatarSize||P(o).ui?.leadingAvatarSize||m.value.leadingAvatarSize()},{ref_for:!0},t.avatar,{"data-slot":`leadingAvatar`,class:m.value.leadingAvatar({class:[P(o).ui?.leadingAvatar,t.ui?.leadingAvatar]})}),null,16,[`size`,`class`])):w(``,!0)]),P(E)(t,P(o).labelKey)||a.default?(k(),u(`span`,{key:0,"data-slot":`label`,class:S(m.value.label({class:[P(o).ui?.label,t.ui?.label]}))},[z(e.$slots,`default`,{item:t,index:n},()=>[F(y(P(E)(t,P(o).labelKey)),1)])],2)):w(``,!0),z(e.$slots,`trailing`,{item:t,index:n,ui:m.value},()=>[t.badge||t.badge===0?(k(),H(mn,L({key:0,color:`neutral`,variant:`outline`,size:t.ui?.trailingBadgeSize||P(o).ui?.trailingBadgeSize||m.value.trailingBadgeSize()},{ref_for:!0},typeof t.badge==`string`||typeof t.badge==`number`?{label:t.badge}:t.badge,{"data-slot":`trailingBadge`,class:m.value.trailingBadge({class:[P(o).ui?.trailingBadge,t.ui?.trailingBadge]})}),null,16,[`size`,`class`])):w(``,!0)])]),_:2},1032,[`value`,`disabled`,`class`]))),128)),z(e.$slots,`list-trailing`)]),_:3},8,[`class`]),P(o).content?(k(!0),u(I,{key:0},d(P(o).items,(t,n)=>(k(),H(P(_t),{key:P(E)(t,P(o).valueKey)??n,value:P(E)(t,P(o).valueKey)??String(n),"data-slot":`content`,class:S(m.value.content({class:[P(o).ui?.content,t.ui?.content,t.class]}))},{default:D(()=>[z(e.$slots,t.slot||`content`,{item:t,index:n,ui:m.value},()=>[F(y(t.content),1)])]),_:2},1032,[`value`,`class`]))),128)):w(``,!0)]),_:3},16,[`model-value`,`default-value`,`orientation`,`activation-mode`,`class`]))}},_n;function vn(){return _n??=De(()=>import(`./dist-rgAhsmE-.js`),__vite__mapDeps([0,1,2,3,4])),_n}var yn={key:0,class:`overflow-x-auto rounded-lg border border-(--ui-border) p-3 font-mono text-xs whitespace-pre text-(--ui-text)`,"data-testid":`diff-raw`},bn=b({__name:`FileDiffs`,props:{diff:{},theme:{},diffStyle:{}},setup(e){let t=e,n=V(null),r=V(!1),i=[],a=0;function o(){for(let e of i)try{e.cleanUp()}catch{}i=[],n.value&&(n.value.innerHTML=``)}async function s(){let e=++a;r.value=!1;try{let{FileDiff:r,parsePatchFiles:s}=await vn();if(e!==a||!n.value)return;o();let c=s(t.diff).flatMap(e=>e.files);for(let e of c){let a=document.createElement(`diffs-container`);a.dataset.file=e.name,n.value.appendChild(a);let o=new r({themeType:t.theme,diffStyle:t.diffStyle??`unified`});o.render({fileDiff:e,fileContainer:a}),i.push(o)}}catch{e===a&&(r.value=!0)}}return M(s),m(()=>t.diff,s),m(()=>t.theme,s),m(()=>t.diffStyle,s),ae(()=>{a++,o()}),(t,i)=>r.value?(k(),u(`pre`,yn,y(e.diff),1)):(k(),u(`div`,{key:1,ref_key:`container`,ref:n,class:`space-y-4`,"data-testid":`file-diffs`},null,512))}});async function xn(e){let{parsePatchFiles:t}=await vn(),n=t(e).flatMap(e=>e.files).map(e=>({path:e.name,additions:e.hunks.reduce((e,t)=>e+t.additionLines,0),deletions:e.hunks.reduce((e,t)=>e+t.deletionLines,0)}));return{files:n,additions:n.reduce((e,t)=>e+t.additions,0),deletions:n.reduce((e,t)=>e+t.deletions,0)}}function Sn(e,t){if(e.length<=t)return e;let n=Math.max(1,t-1),r=Math.ceil(n/2),i=Math.floor(n/2);return`${e.slice(0,r)}…${e.slice(e.length-i)}`}var Cn={dockerfile:`docker`,makefile:`makefile`,"go.mod":`go`,"go.sum":`go`,".gitignore":`gitignore`,".dockerignore":`dockerignore`},wn={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,vue:`vue`,svelte:`svelte`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,hpp:`cpp`,cs:`csharp`,php:`php`,scala:`scala`,ex:`elixir`,exs:`elixir`,json:`json`,jsonc:`json`,yaml:`yaml`,yml:`yaml`,toml:`toml`,xml:`xml`,html:`html`,css:`css`,scss:`scss`,sass:`sass`,less:`less`,md:`markdown`,mdx:`mdx`,sh:`bash`,bash:`bash`,zsh:`zsh`,sql:`sql`,tf:`terraform`,hcl:`hcl`,dockerfile:`docker`};function Tn(e){let t=(e.split(`/`).pop()||e).toLowerCase(),n=Cn[t];if(n)return n;let r=t.lastIndexOf(`.`);return r===-1?`text`:wn[t.slice(r+1)]??`text`}var En={javascript:`i-simple-icons-javascript`,typescript:`i-simple-icons-typescript`,vue:`i-simple-icons-vuedotjs`,jsx:`i-simple-icons-react`,tsx:`i-simple-icons-react`,svelte:`i-simple-icons-svelte`,html:`i-simple-icons-html5`,css:`i-simple-icons-css`,scss:`i-simple-icons-sass`,sass:`i-simple-icons-sass`,less:`i-simple-icons-less`,python:`i-simple-icons-python`,go:`i-simple-icons-go`,rust:`i-simple-icons-rust`,java:`i-simple-icons-openjdk`,c:`i-simple-icons-c`,cpp:`i-simple-icons-cplusplus`,csharp:`i-simple-icons-csharp`,php:`i-simple-icons-php`,ruby:`i-simple-icons-ruby`,elixir:`i-simple-icons-elixir`,scala:`i-simple-icons-scala`,swift:`i-simple-icons-swift`,kotlin:`i-simple-icons-kotlin`,json:`i-simple-icons-json`,yaml:`i-simple-icons-yaml`,toml:`i-simple-icons-toml`,xml:`i-simple-icons-xml`,sql:`i-lucide-database`,markdown:`i-simple-icons-markdown`,mdx:`i-simple-icons-mdx`,bash:`i-simple-icons-gnubash`,zsh:`i-simple-icons-gnubash`,docker:`i-simple-icons-docker`,dockerignore:`i-simple-icons-docker`,terraform:`i-simple-icons-terraform`,hcl:`i-simple-icons-terraform`,makefile:`i-lucide-hammer`,gitignore:`i-simple-icons-git`,text:`i-lucide-file-text`};function Dn(e){return En[e]??En.text}function On(e){return Dn(Tn(e))}var kn={key:0,class:`flex items-center gap-2 p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`files-loading`},An={key:1,class:`p-4 text-sm text-(--ui-text-muted) sm:p-5`,"data-testid":`no-files`},jn={class:`shrink-0 border-b border-(--ui-border) @2xl:w-72 @2xl:border-b-0 @2xl:border-r`,"data-testid":`file-list`},Mn={class:`@2xl:sticky @2xl:top-0 @2xl:max-h-[calc(100dvh-11rem)] @2xl:overflow-y-auto @2xl:py-3`},Nn=[`aria-expanded`],Pn={class:`ml-auto tabular-nums`,"data-testid":`pr-totals`},Fn={class:`text-(--ui-success)`},In={class:`text-(--ui-error)`},Ln={key:1,class:`flex items-center justify-between gap-2 px-3 pb-2 text-xs text-(--ui-text-dimmed)`},Rn={"data-testid":`file-count`},zn={class:`tabular-nums`,"data-testid":`pr-totals`},Bn={class:`text-(--ui-success)`},Vn={class:`text-(--ui-error)`},Hn=[`title`,`aria-current`,`onClick`],Un={class:`min-w-0 flex-1 whitespace-nowrap`},Wn={class:`shrink-0 text-[11px] tabular-nums`},Gn={class:`text-(--ui-success)`},Kn={class:`text-(--ui-error)`},qn=34,Jn=b({__name:`FilesChanged`,props:{diff:{},notes:{},diffStyle:{}},setup(e){let t=e,n=ge(),r=W(()=>n.value===`dark`?`dark`:`light`),i=V([]),a=V(!0),o=V(null),s=T(`panel`),l=T(`root`),{width:f}=le(l);m(l,e=>{e&&(f.value=e.getBoundingClientRect().width)});let p=W(()=>f.value>0&&f.value<672),h=V(!1),g=W(()=>p.value?`unified`:t.diffStyle??`unified`),_=0;async function v(){let e=++_;a.value=!0;let n=await xn(t.diff);e===_&&(i.value=n.files,o.value=null,a.value=!1)}m(()=>t.diff,v,{immediate:!0});let b=W(()=>i.value.reduce((e,t)=>({additions:e.additions+t.additions,deletions:e.deletions+t.deletions}),{additions:0,deletions:0}));function x(e){o.value=e,p.value&&(h.value=!1);let t=s.value?.querySelectorAll(`[data-file]`)??[];Array.from(t).find(t=>t.dataset.file===e)?.scrollIntoView({block:`start`,behavior:`smooth`})}return(t,n)=>{let f=U;return a.value?(k(),u(`div`,kn,[c(f,{name:`i-lucide-loader-circle`,class:`size-4 animate-spin`}),n[1]||=j(`span`,null,`Loading diff…`,-1)])):i.value.length===0?(k(),u(`p`,An,` Nothing in this diff parsed as a file. `)):(k(),u(`div`,{key:2,ref_key:`root`,ref:l,class:`@container flex min-h-full flex-col @2xl:flex-row`,"data-testid":`files-changed`},[j(`aside`,jn,[j(`div`,Mn,[p.value?(k(),u(`button`,{key:0,type:`button`,class:`flex w-full items-center gap-2 px-3 py-2.5 text-xs text-(--ui-text-muted)`,"aria-expanded":h.value,"data-testid":`files-fold`,onClick:n[0]||=e=>h.value=!h.value},[c(f,{name:h.value?`i-lucide-chevron-down`:`i-lucide-chevron-right`,class:`size-3.5 shrink-0 text-(--ui-text-dimmed)`},null,8,[`name`]),j(`span`,null,y(i.value.length)+` `+y(i.value.length===1?`file`:`files`)+` changed`,1),j(`span`,Pn,[j(`span`,Fn,`+`+y(b.value.additions),1),j(`span`,In,`−`+y(b.value.deletions),1)])],8,Nn)):(k(),u(`div`,Ln,[j(`span`,Rn,y(i.value.length)+` `+y(i.value.length===1?`file`:`files`),1),j(`span`,zn,[j(`span`,Bn,`+`+y(b.value.additions),1),j(`span`,Vn,`−`+y(b.value.deletions),1)])])),!p.value||h.value?(k(),u(`ul`,{key:2,class:S([`flex flex-col`,p.value?`pb-2`:``])},[(k(!0),u(I,null,d(i.value,e=>(k(),u(`li`,{key:e.path},[j(`button`,{type:`button`,class:S([`flex w-full min-w-0 items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors hover:bg-accented/50 dark:hover:bg-(--ui-bg)`,o.value===e.path?`bg-accented/50 text-(--ui-text) dark:bg-(--ui-bg)`:`text-(--ui-text-muted)`]),title:e.path,"aria-current":o.value===e.path?`true`:void 0,"data-testid":`file-entry`,onClick:t=>x(e.path)},[c(f,{name:P(On)(e.path),class:`size-3.5 shrink-0`},null,8,[`name`]),j(`span`,Un,y(P(Sn)(e.path,qn)),1),j(`span`,Wn,[j(`span`,Gn,`+`+y(e.additions),1),j(`span`,Kn,`−`+y(e.deletions),1)])],10,Hn)]))),128))],2)):w(``,!0)])]),j(`div`,{ref_key:`panel`,ref:s,class:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`diff-column`},[(k(!0),u(I,null,d(e.notes,e=>(k(),u(`p`,{key:e,class:`px-3 pt-3 text-xs text-(--ui-text-muted)`,"data-testid":`diff-note`},y(e),1))),128)),c(bn,{diff:e.diff,theme:r.value,"diff-style":g.value},null,8,[`diff`,`theme`,`diff-style`])],512)],512))}}}),Yn=b({__name:`LabelTip`,props:{text:{},disabled:{type:Boolean,default:!1}},setup(e){return(t,n)=>{let r=xe;return k(),H(r,{text:e.text,disabled:e.disabled,"delay-duration":250,content:{side:`bottom`,align:`end`,sideOffset:6,collisionPadding:8},ui:{content:`h-auto max-w-[28rem] px-2.5 py-1.5`,text:`text-clip whitespace-normal leading-snug`}},{default:D(()=>[z(t.$slots,`default`)]),_:3},8,[`text`,`disabled`])}}}),Xn={class:`pr-review-panel @container flex h-full min-h-0 min-w-0 flex-col`,"data-testid":`pr-review-panel`},Zn={class:`shrink-0 border-b border-(--ui-border) px-4 pt-5 pb-4 sm:px-6`},Qn={class:`flex flex-col gap-3 @2xl:flex-row @2xl:items-start @2xl:justify-between @2xl:gap-4`},$n={class:`min-w-0`},er={class:`line-clamp-2 text-lg leading-snug font-semibold text-(--ui-text) @2xl:line-clamp-none @2xl:truncate`,"data-testid":`pr-title`},tr={class:`mt-1.5 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-(--ui-text-muted)`,"data-testid":`pr-facts`},nr=[`href`],rr={key:1,class:`inline-flex items-center gap-1.5`},ir=[`href`],ar={title:`the base the diff is against`},or={"data-testid":`producer-label`},sr={class:`inline-flex items-center gap-1 text-(--ui-warning)`,"data-testid":`truncated-label`},cr={class:`flex shrink-0 flex-wrap items-center gap-2`},lr={key:1,class:`inline-flex shrink-0 items-center gap-1.5 text-xs text-(--ui-text-muted)`,"data-testid":`abridge-running`},ur={key:2,class:`inline-flex min-w-0 shrink items-center gap-1.5 text-xs text-(--ui-error)`,"data-testid":`abridge-failed`},dr=[`title`],fr={key:0,class:`flex shrink-0 items-center justify-between gap-3 border-b border-(--ui-border) px-4 py-2 sm:px-6`},pr={class:`tabs-scroll min-w-0 overflow-x-auto`},mr={class:`min-h-0 flex-1 overflow-y-auto`},hr={key:1,class:`mx-auto max-w-3xl p-4 sm:p-6`,"data-testid":`pr-description`},gr={key:2,class:`mt-4 text-xs text-(--ui-text-dimmed) italic`,"data-testid":`description-origin`},_r={key:2,class:`px-4 py-3 text-sm text-(--ui-text-muted) sm:px-6`,"data-testid":`no-diff`},vr=`switchboard:diffStyle`,yr=`Abridge the full diff with meat.dev: a model keeps the concepts and drops what a reviewer need not read. One model call; usually a minute or three.`,br=b({__name:`PrReviewPanel`,props:{data:{},closable:{type:Boolean,default:!1},abridge:{default:void 0}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=W(()=>Xt(n.data.pr)),a=W(()=>qt(n.data)),o=W(()=>n.data.readingDiffs),s=W(()=>n.data.description),l=W(()=>o.value.find(e=>e.poweredBy===`git`)),d=W(()=>o.value.find(e=>e.poweredBy===`meat`)),f=W(()=>n.data.pr.headSha?.slice(0,7)),p=W(()=>{let e=[];return l.value&&e.push({label:`Files changed`,value:`files`}),d.value&&e.push({label:`Reading diff`,value:`reading`}),(s.value?.tldr||s.value?.why)&&e.push({label:`Description`,value:`description`}),e}),h=()=>Zt(o.value)?.poweredBy===`meat`?`reading`:`files`,g=V(h());m(()=>Zt(o.value),()=>g.value=h()),m(p,e=>{e.some(e=>e.value===g.value)||(g.value=e[0]?.value??`files`)},{immediate:!0});let _=W(()=>g.value===`files`?l.value:g.value===`reading`?d.value:void 0),v=W(()=>{let e=_.value;if(!e)return[];let t=[];return e.summary&&t.push(e.summary),e.truncated&&t.push(`${$t(e.diff.length)}.`),t}),b=W(()=>s.value?tn(s.value):void 0),x=[{label:`Inline`,value:`unified`,icon:`i-lucide-rows-3`},{label:`Side by side`,value:`split`,icon:`i-lucide-columns-2`}],S=V(`unified`);M(()=>{try{localStorage.getItem(vr)===`split`&&(S.value=`split`)}catch{}});function C(e){S.value=e===`split`?`split`:`unified`;try{localStorage.setItem(vr,S.value)}catch{}}let ee=W(()=>n.abridge!==void 0&&n.abridge.state.state!==`done`&&l.value!==void 0&&!d.value);return(t,n)=>{let o=U,l=ce,d=gn;return k(),u(`div`,Xn,[j(`header`,Zn,[j(`div`,Qn,[j(`div`,$n,[j(`h1`,er,y(a.value),1),j(`div`,tr,[i.value.pr?(k(),u(`a`,{key:0,href:i.value.pr,target:`_blank`,rel:`noopener noreferrer`,class:`inline-flex items-center gap-1.5 hover:text-(--ui-text)`,"data-testid":`pr-link`},[c(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),j(`span`,null,y(e.data.pr.repo)+`#`+y(e.data.pr.number),1)],8,nr)):e.data.pr.repo?(k(),u(`span`,rr,[c(o,{name:`i-simple-icons-github`,class:`size-3.5 shrink-0`}),j(`span`,null,y(e.data.pr.repo),1)])):w(``,!0),i.value.commit?(k(),u(`a`,{key:2,href:i.value.commit,target:`_blank`,rel:`noopener noreferrer`,class:`font-mono hover:text-(--ui-text)`,"data-testid":`commit-link`},y(f.value),9,ir)):w(``,!0),_.value?(k(),u(I,{key:3},[j(`span`,ar,`against origin/`+y(_.value.baseRef),1),c(Yn,{text:P(Qt)(_.value.poweredBy)},{default:D(()=>[j(`span`,or,y(P(en)(_.value.poweredBy)),1)]),_:1},8,[`text`]),_.value.truncated?(k(),H(Yn,{key:0,text:P($t)(_.value.diff.length)},{default:D(()=>[j(`span`,sr,[c(o,{name:`i-lucide-scissors`,class:`size-3.5`}),n[4]||=F(`truncated `,-1)])]),_:1},8,[`text`])):w(``,!0)],64)):w(``,!0)])]),j(`div`,cr,[i.value.pr?(k(),H(l,{key:0,label:`View on GitHub`,icon:`i-simple-icons-github`,color:`neutral`,variant:`ghost`,size:`sm`,to:i.value.pr,target:`_blank`,"data-testid":`github-button`},null,8,[`to`])):w(``,!0),ee.value&&e.abridge?(k(),u(I,{key:1},[e.abridge.state.state===`absent`?(k(),H(Yn,{key:0,text:yr},{default:D(()=>[c(l,{label:`Abridge with meat`,icon:`i-lucide-scissors`,size:`sm`,"data-testid":`abridge-button`,onClick:n[0]||=t=>e.abridge.start()})]),_:1})):e.abridge.state.state===`running`?(k(),u(`span`,lr,[c(o,{name:`i-lucide-loader-circle`,class:`size-3.5 animate-spin`}),n[5]||=F(` Abridging… usually 1–3 minutes `,-1)])):e.abridge.state.state===`failed`?(k(),u(`span`,ur,[c(o,{name:`i-lucide-circle-alert`,class:`size-3.5 shrink-0`}),j(`span`,{class:`truncate`,title:e.abridge.state.reason},`Abridging failed: `+y(e.abridge.state.reason),9,dr),c(l,{size:`xs`,color:`neutral`,variant:`outline`,label:`Retry`,"data-testid":`abridge-retry`,onClick:n[1]||=t=>e.abridge.start()})])):w(``,!0)],64)):w(``,!0),e.closable?(k(),H(l,{key:2,icon:`i-lucide-x`,color:`neutral`,variant:`ghost`,size:`sm`,"aria-label":`Close`,"data-testid":`panel-close`,onClick:n[2]||=e=>r(`close`)})):w(``,!0)])])]),p.value.length>0?(k(),u(`div`,fr,[j(`div`,pr,[c(d,{modelValue:g.value,"onUpdate:modelValue":n[3]||=e=>g.value=e,items:p.value,size:`sm`,class:`w-fit gap-0`,content:!1,"data-testid":`panel-tabs`},null,8,[`modelValue`,`items`])]),_.value?(k(),H(d,{key:0,"model-value":S.value,items:x,color:`neutral`,size:`xs`,content:!1,class:`hidden w-fit @2xl:flex`,"data-testid":`diff-style`,"onUpdate:modelValue":C},null,8,[`model-value`])):w(``,!0)])):w(``,!0),j(`div`,mr,[_.value?(k(),H(Jn,{key:_.value.poweredBy,diff:_.value.diff,notes:v.value,"diff-style":S.value},null,8,[`diff`,`notes`,`diff-style`])):g.value===`description`&&s.value?(k(),u(`div`,hr,[n[7]||=j(`div`,{class:`mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`What the pull request says about itself`,-1),s.value.tldr?(k(),H(K,{key:0,text:s.value.tldr,class:`text-sm`,"data-testid":`description-tldr`},null,8,[`text`])):w(``,!0),s.value.why?(k(),u(I,{key:1},[n[6]||=j(`div`,{class:`mt-4 mb-2 text-xs font-medium text-(--ui-text-dimmed)`},`Why`,-1),c(K,{text:s.value.why,class:`text-sm`,"data-testid":`description-why`},null,8,[`text`])],64)):w(``,!0),b.value?(k(),u(`p`,gr,y(b.value),1)):w(``,!0)])):(k(),u(`p`,_r,` No reading diff was produced for this review. `))])])}}}),xr={class:`conn flex items-center gap-2 font-mono`},Sr={key:0,class:`ok text-ok`,role:`img`,"aria-label":`succeeded`},Cr=[`data-heat`],wr=[`title`],Tr={key:3,id:`delivery`,class:`text-xs text-muted`},Er=[`title`],Dr={key:0,id:`actions`,class:`actions flex gap-1.5`},Or={class:`mx-auto max-w-6xl`},kr={key:0,id:`runmeta`,class:`runmeta facts mb-3 flex flex-wrap items-baseline gap-x-3 gap-y-1.5 px-(--sb-gutter) font-mono text-xs text-dimmed`},Ar={class:`agent text-[0.68rem] font-medium uppercase tracking-wider text-toned`},jr={class:`model`},Mr={key:0,class:`effort`},Nr={key:1,class:`harness`},Pr=[`href`],Fr={key:3,class:`repo`},Ir=[`href`],Lr={key:5,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned`},Rr=[`href`,`title`],zr=[`href`],Br={key:1,id:`request`,class:`block mb-4 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Vr={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Hr={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},Ur=[`href`],Wr={key:1},Gr={key:1},Kr=[`href`],qr=[`title`],Jr={key:5,id:`references`,class:`group mb-4 px-(--sb-gutter)`},Yr={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},Xr={class:`count font-normal normal-case tracking-normal text-dimmed`},Zr={id:`referencedthreads`,class:`pb-1 pl-5`},Qr={class:`flex items-baseline gap-2 font-mono text-xs text-dimmed`},$r=[`href`],ei=[`title`],ti={class:`quoted mt-1 whitespace-pre-wrap break-words font-mono text-xs opacity-85`},ni={key:6,id:`context`,class:`group mb-4 px-(--sb-gutter)`},ri={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},ii={class:`count font-normal normal-case tracking-normal text-dimmed`},ai={id:`contextturns`,class:`pb-1 pl-5`},oi=[`title`],si={id:`thisrun`,class:`mb-2 flex items-baseline gap-2.5 px-(--sb-gutter) font-mono text-xs font-medium uppercase tracking-wider text-muted`},ci={key:0,class:`count font-normal normal-case tracking-normal text-dimmed`},li=[`aria-pressed`,`data-open`,`title`],ui={id:`log`,class:`m-0 list-none p-0`},di={key:0,id:`placeholder`,class:`empty text-muted`},fi=[`id`],pi={class:`meta flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 pr-(--sb-gutter) font-mono text-xs tabular-nums text-dimmed`},mi=[`title`],hi=[`title`],gi=[`title`],_i=[`href`],vi={key:3,class:`nonar font-sans italic`},yi=[`title`],bi=[`data-phase`],xi=[`aria-expanded`,`onClick`],Si={class:`glyph select-none text-dimmed`},Ci={class:`what`},wi={key:0,class:`m-0 list-none p-0 pl-4`},Ti={key:4,class:`followup block mt-5 rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-3`},Ei={class:`mb-2 flex items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted`},Di={key:0,class:`source flex items-center gap-2 font-normal normal-case tracking-normal text-dimmed`},Oi=[`href`],ki={key:1},Ai=[`title`],ji={key:5,class:`mt-5`},Mi=[`open`],Ni={class:`flex min-h-6 cursor-pointer list-none items-baseline gap-2.5 font-mono text-xs font-medium uppercase tracking-wider text-muted hover:text-toned [&::-webkit-details-marker]:hidden`},Pi={key:0,class:`font-normal normal-case tracking-normal text-dimmed`},Fi=[`title`],Ii=[`title`],Li=b({__name:`RunPage`,setup(e){let t=de(`run`),n=t?.mode===`history`,r=n?`Run`:`Live run`,i=n,o=t?.artifacts??null,s=t?.children??[],l=(t?.mode===`history`?t.units:void 0)??[],f=t?.mode===`history`?t.findingsLedger:void 0,p=W(()=>f?`/runs/unit/${encodeURIComponent(f.unit)}#findings`:void 0),h=typeof window<`u`?new URLSearchParams(window.location.search).get(`open`):null,_=qe({openTags:h?h.split(`,`).map(e=>e.trim()).filter(Boolean):void 0}),v=_.state,b=V(n?`ended`:`connecting`),x=V(``),C=Ae(),T=t?.mode===`live`?nt(t,C.value):null,E=V(void 0),O=V({}),te=W(()=>{if(n&&t?.mode===`history`)return t.status===`completed`?{ok:!0,cls:``,word:`succeeded`}:{ok:!1,cls:t.status===`failed`||t.status===`stopped_hard`||t.status===`interrupted`?`red`:t.status===`stopped_soft`?`amber`:`grey`,word:t.status?Pe(t.status):`ended`};let e=v.stopMode;return{ok:!1,cls:e===`hard`?`red`:e===`soft`?`amber`:`grey`,word:e===`hard`?`killed`:e===`soft`?`stopped early`:`ended`}}),A=W(()=>n&&t?.mode===`history`?t.durationMs:E.value),ne=W(()=>Qe(n&&t?.mode===`history`?{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk}:O.value)),re=W(()=>A.value===void 0?``:Me(A.value,`clock`)),N=W(()=>n&&t?.mode===`history`?t.cost:void 0),ie=e=>e===null?`unpriced`:Le(e),oe=W(()=>N.value?ie(N.value.usd):``),le=W(()=>N.value?Object.entries(N.value.byModel).map(([e,t])=>`${e} ${ie(t.usd)}`).join(`
|
|
9
|
-
`):void 0),ue=W(()=>Ve(A.value,`run`)),fe=W(()=>Be(ue.value)),pe={red:`border-bad/30 text-bad`,amber:`border-warn/30 text-warn`,grey:`border-accented text-muted`},L=W(()=>x.value?x.value:b.value===`connecting`?`connecting…`:b.value===`disconnected`?`disconnected`:b.value===`stopping`?`stopping (${v.stopMode??`soft`})`:b.value===`finished`?E.value===void 0?`delivering…`:`delivering… · ${Me(E.value,`clock`)}`:T?`running · ${Me(T.elapsedMs(C.value),`clock`)}`:`running`),he=W(()=>x.value||b.value===`disconnected`?`text-bad`:b.value===`running`?`text-ok motion-safe:animate-pulse`:b.value===`finished`?`text-ok`:`text-warn motion-safe:animate-pulse`),R=W(()=>{if(!t||t.mode!==`live`&&t.mode!==`history`)return null;v.traceVersion;let e=t.receivedAt??t.startedAt,n=lt(v.meta?.agent);if(t.mode===`history`){let r=t.durationMs??(t.finishedAt===void 0?0:Math.max(0,t.finishedAt-e));return dt({spans:_.spanSet(),losses:_.losses(e),window:{start:e,end:e+r},owner:n,totalMs:r,phase:`ended`,delivery:{finishedAt:t.finishedAt,sealedAt:t.sealedAt,replyOk:t.replyOk},...t.truncated===void 0?{}:{truncated:t.truncated},...t.untimed?{untimed:!0}:{},callTitle:_.callHeadline})}if(!T)return null;let r=b.value===`ended`?`ended`:b.value===`finished`?`delivering`:`live`,i=r===`live`?T.elapsedMs(C.value):E.value??T.elapsedMs(C.value);return dt({spans:_.spanSet(),losses:_.losses(e),window:{start:e,end:e+i},owner:n,totalMs:i,phase:r,delivery:O.value,callTitle:_.callHeadline})}),ge=n&&t?.mode===`history`?`/runs/${encodeURIComponent(t.id)}/events`:void 0;function ve(e){_.reveal(e)&&se().then(()=>{let t=document.getElementById(e);t&&(t.scrollIntoView?.({block:`center`}),t.classList.add(`revealed`),setTimeout(()=>t.classList.remove(`revealed`),1500))})}let z=V(n),B=V(!1);function ye(e){t?.mode===`live`&&(e!==`hard`||_e.confirm(`Hard stop: abort the run now with no summary and free its sandbox?`))&&(B.value=!0,fetch(`${t.stopUrl}&mode=${encodeURIComponent(e)}`,{method:`POST`,credentials:`same-origin`}).then(async t=>{if(!t.ok){let e=await t.json?.().catch(()=>null);throw Error(typeof e?.message==`string`?e.message:`HTTP ${t.status}`)}G(e)}).catch(e=>{B.value=!1,x.value=`stop failed: ${e instanceof Error?e.message:`error`}`}))}function G(e){_.markStopping(e),z.value=!0,(b.value===`connecting`||b.value===`running`)&&(b.value=`stopping`)}m(()=>v.stopMode,e=>{e&&b.value!==`ended`&&b.value!==`disconnected`&&b.value!==`finished`&&G(e)}),n||m(b,e=>_e.setFavicon(e===`ended`||e===`disconnected`||e===`finished`?Ee:Oe),{immediate:!0});let De=W(()=>!n&&b.value!==`ended`&&b.value!==`disconnected`&&b.value!==`finished`),Re=W(()=>De.value?it(v,C.value):null);be(et,Re),be(Ze,o),be(Ge,W(()=>v.reply!==null));let q=W(()=>De.value?rt(v,_.pendingCall(),C.value):null),ft=W(()=>q.value?.kind===`thinking`?R.value?.openStep||Ce(q.value.elapsedMs):``);function pt(){_.setAllOpen(!v.allOpen)}let J=W(()=>v.log.filter(e=>e.kind===`step`).length),mt=W(()=>{for(let e=v.log.length-1;e>=0;e--){let t=v.log[e];if(t.kind===`note`&&t.noteKind===`notes`)return t.key}}),ht=V(null);function gt(){return window.innerHeight+window.scrollY>=document.body.scrollHeight-60}let Y=ln(),_t=V(!1),vt=t?.mode===`history`&&t.capabilities.readingDiffAbridge?fn(t.id,e=>Y.handle(e)):void 0;ae(()=>vt?.dispose());function yt(e){let t=gt();_.handle(e),Y.handle(e),t&&requestAnimationFrame(()=>ht.value?.scrollIntoView?.({block:`nearest`}))}let bt=ke(),xt=null;if(t?.mode===`history`){for(let e of t.events)_.handle(e),Y.handle(e);_.closePhases()}M(()=>{t?.mode===`live`&&(xt=we({url:t.eventsUrl,factory:bt,model:_,handle:yt,onFinished:e=>{z.value=!0,e&&(T&&(E.value=T.elapsedAt(e.finishedAt)),O.value={...O.value,finishedAt:e.finishedAt})},onEnd:e=>{z.value=!0,E.value??=T?.elapsedMs(C.value),O.value={...O.value,...e}}}),m(xt.phase,e=>{(b.value!==`stopping`||e!==`running`&&e!==`connecting`)&&(b.value=e)},{immediate:!0}))}),ae(()=>{xt?.close()});function St(e){return e&&/^https?:\/\//.test(e)?e:``}let Ct=W(()=>St(v.request?.source?.url)),wt=W(()=>t&&(t.mode===`live`||t.mode===`history`)&&t.threadKey?Ne(t.threadKey):null),X=W(()=>{let e=v.meta;return{repo:at(e?.repo),tree:Ue(e?.repo,e?.ref),commit:ot(e?.repo,e?.headSha),pr:Ke(e?.repo,e?.pr)}}),Et=W(()=>{let e=v.meta;if(!e?.harness)return``;let t=e.harnessScope===`defaults`?`defaults`:e.harnessScope?`${e.harnessScope} scope`:``;return t?`${e.harness} harness (${t})`:`${e.harness} harness`}),Dt=W(()=>We({meta:v.meta,requestText:v.request?.text??``,prOpened:v.prOpened}));function Z(e){return typeof e==`number`?je(e,C.value):``}function Q(e){return typeof e==`number`?Fe(e):void 0}return(e,t)=>{let n=ee(`RouterLink`),o=ce,m=xe,h=U,T=Se;return k(),H(a,{title:P(r),nav:`runs`},{leading:D(()=>[c(n,{class:`back text-sm text-primary no-underline hover:underline`,to:`/runs`},{default:D(()=>[...t[4]||=[F(`← All runs`,-1)]]),_:1})]),status:D(()=>[j(`span`,xr,[b.value===`ended`?(k(),u(I,{key:0},[te.value.ok?(k(),u(`span`,Sr,`✓`)):(k(),u(`span`,{key:1,class:S([`chip rounded border px-1.5 text-[0.7rem]`,pe[te.value.cls]])},y(te.value.word),3)),j(`span`,{id:`state`,class:S([`dur text-xs tabular-nums`,[fe.value?`heat`:`text-muted`,ue.value.level>=2?`font-medium`:``]]),style:g(fe.value),"data-heat":ue.value.level},y(re.value),15,Cr),oe.value?(k(),u(`span`,{key:2,id:`cost`,class:`cost text-xs tabular-nums text-muted`,title:le.value},`· `+y(oe.value),9,wr)):w(``,!0),ne.value?(k(),u(`span`,Tr,`· `+y(ne.value),1)):w(``,!0)],64)):(k(),u(I,{key:1},[j(`span`,{id:`statedot`,class:S([`pulse text-[1.1em] leading-none`,he.value])},`∿`,2),j(`span`,{id:`state`,class:S([`text-xs tabular-nums`,x.value?`text-bad`:`text-muted`]),title:b.value===`running`&&!x.value?`the whole run, since we received the message`:b.value===`finished`?`the agent stopped; the reply is being posted`:void 0},y(L.value),11,Er)],64))])]),actions:D(()=>[z.value?w(``,!0):(k(),u(`span`,Dr,[c(m,{text:`Soft stop: no new steps, the agent writes up what it has`},{default:D(()=>[c(o,{size:`xs`,color:`neutral`,variant:`outline`,label:`Stop`,disabled:B.value,onClick:t[0]||=e=>ye(`soft`)},null,8,[`disabled`])]),_:1}),c(m,{text:`Hard stop: abort now, no summary, free the sandbox`},{default:D(()=>[c(o,{size:`xs`,color:`error`,variant:`outline`,label:`Kill`,disabled:B.value,onClick:t[1]||=e=>ye(`hard`)},null,8,[`disabled`])]),_:1})]))]),default:D(()=>[j(`div`,Or,[P(v).meta?(k(),u(`div`,kr,[j(`span`,Ar,y(P(v).meta.agent),1),j(`span`,jr,y(P(v).meta.model),1),P(v).meta.effort?(k(),u(`span`,Mr,y(P(v).meta.effort)+` effort`,1)):w(``,!0),Et.value?(k(),u(`span`,Nr,y(Et.value),1)):w(``,!0),X.value.repo?(k(),u(`a`,{key:2,class:`text-primary no-underline hover:underline`,href:X.value.repo,target:`_blank`,rel:`noopener noreferrer`},y(P(v).meta.repo),9,Pr)):P(v).meta.repo?(k(),u(`span`,Fr,y(P(v).meta.repo),1)):w(``,!0),X.value.tree?(k(),u(`a`,{key:4,class:`reftag rounded border border-accented px-1.5 text-[0.75rem] text-toned no-underline hover:border-primary hover:text-primary`,href:X.value.tree,target:`_blank`,rel:`noopener noreferrer`,title:`the branch on GitHub`},y(P(v).meta.ref),9,Ir)):P(v).meta.ref?(k(),u(`span`,Lr,y(P(v).meta.ref),1)):w(``,!0),X.value.commit&&P(v).meta.headSha?(k(),u(`a`,{key:6,class:`sha tabular-nums text-toned no-underline hover:text-primary hover:underline`,href:X.value.commit,target:`_blank`,rel:`noopener noreferrer`,title:`the head commit ${P(v).meta.headSha}`},y(P(He)(P(v).meta.headSha)),9,Rr)):w(``,!0),X.value.pr?(k(),u(`a`,{key:7,class:`prlink whitespace-nowrap text-primary no-underline hover:underline`,href:X.value.pr,target:`_blank`,rel:`noopener noreferrer`},[c(ut,{class:`mr-1 align-[-0.125em]`}),F(`#`+y(P(v).meta.pr),1)],8,zr)):w(``,!0),p.value&&P(f)?(k(),H(n,{key:8,class:`findings whitespace-nowrap text-primary no-underline hover:underline`,to:p.value,title:`the pull request's findings ledger on its unit's page`},{default:D(()=>[F(`Findings · `+y(P(f).rows),1)]),_:1},8,[`to`])):w(``,!0),P(Y).state.ready?(k(),u(`button`,{key:9,type:`button`,class:`reading-diff ml-auto inline-flex cursor-pointer items-center gap-1 whitespace-nowrap text-primary hover:underline focus-visible:outline-2 focus-visible:outline-primary`,"data-testid":`reading-diff-button`,onClick:t[2]||=e=>_t.value=!0},[c(h,{name:`i-lucide-git-compare`,class:`size-3.5 shrink-0`,"aria-hidden":`true`}),t[5]||=F(` Reading diff `,-1)])):w(``,!0)])):w(``,!0),P(v).request?(k(),u(`section`,Br,[j(`h2`,Vr,[t[6]||=j(`span`,null,`Request`,-1),P(v).request.source?(k(),u(`span`,Hr,[P(v).request.source.channel?(k(),u(I,{key:0},[c(ze),Ct.value?(k(),u(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:Ct.value,target:`_blank`,rel:`noopener noreferrer`,title:`open the thread`},`#`+y(P(v).request.source.channel),9,Ur)):(k(),u(`span`,Wr,`#`+y(P(v).request.source.channel),1))],64)):w(``,!0),P(v).request.source.user?(k(),u(`span`,Gr,y(P(v).request.source.user),1)):w(``,!0)])):w(``,!0),wt.value?(k(),u(`a`,{key:1,class:`thread font-normal normal-case tracking-normal text-muted no-underline hover:text-primary hover:underline`,href:wt.value,title:`the thread this run is a turn of`,"data-testid":`thread-link`},`in thread ›`,8,Kr)):w(``,!0),j(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:Q(P(v).request.at)},y(Z(P(v).request.at)),9,qr)]),c(Tt,{lines:3},{default:D(()=>[c(K,{text:P(v).request.text},null,8,[`text`])]),_:1}),P(v).request.files.length>0?(k(),H(tt,{key:0,files:P(v).request.files},null,8,[`files`])):w(``,!0)])):w(``,!0),P(v).reply&&P(i)?(k(),H(Pt,{key:2,position:`first`,text:P(v).reply.text,caption:Dt.value,when:Z(P(v).reply.at),"when-title":Q(P(v).reply.at),files:P(v).reply.files},null,8,[`text`,`caption`,`when`,`when-title`,`files`])):w(``,!0),P(l).length>0?(k(),H(Vt,{key:3,units:P(l)},null,8,[`units`])):w(``,!0),P(s).length>0?(k(),H(Kt,{key:4,children:P(s),now:P(C)},null,8,[`children`,`now`])):w(``,!0),P(v).references.length>0?(k(),u(`details`,Jr,[j(`summary`,Yr,[t[7]||=j(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),j(`span`,null,`Referenced thread`+y(P(v).references.length===1?``:`s`),1),j(`span`,Xr,`· `+y(P(v).references.length)+` thread`+y(P(v).references.length===1?``:`s`),1)]),j(`div`,Zr,[(k(!0),u(I,null,d(P(v).references,e=>(k(),u(`div`,{key:e.key,class:`reference border-t border-default py-1.5 first-of-type:border-t-0`},[j(`div`,Qr,[j(`a`,{class:`text-muted no-underline hover:text-primary hover:underline`,href:e.url,target:`_blank`,rel:`noopener noreferrer`},`#`+y(e.channelName),9,$r),j(`span`,null,`· `+y(e.messages)+` message`+y(e.messages===1?``:`s`),1),j(`span`,{class:`ts ml-auto shrink-0 select-none`,title:Q(e.at)},y(Z(e.at)),9,ei)]),j(`div`,ti,[(k(!0),u(I,null,d(P(Ye)(e.text),(e,t)=>(k(),u(`div`,{key:t},y(e),1))),128))])]))),128))])])):w(``,!0),P(v).context.length>0?(k(),u(`details`,ni,[j(`summary`,ri,[t[8]||=j(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),t[9]||=j(`span`,null,`Earlier in this thread`,-1),j(`span`,ii,`· `+y(P(v).context.length)+` turn`+y(P(v).context.length===1?``:`s`),1)]),j(`div`,ai,[(k(!0),u(I,null,d(P(v).context,e=>(k(),u(`div`,{key:e.key,class:`turn flex items-baseline gap-3 border-t border-default py-1.5 opacity-85 first-of-type:border-t-0`},[c(K,{text:e.text},null,8,[`text`]),j(`span`,{class:`ts ml-auto shrink-0 select-none font-mono text-xs text-dimmed`,title:Q(e.at)},y(Z(e.at)),9,oi)]))),128))])])):w(``,!0),j(`h2`,si,[t[10]||=j(`span`,null,`This run`,-1),J.value>0?(k(),u(`span`,ci,`· `+y(J.value)+` step`+y(J.value===1?``:`s`),1)):w(``,!0),j(`button`,{id:`fold`,type:`button`,class:`ml-auto cursor-pointer font-normal normal-case tracking-normal text-dimmed hover:text-toned focus-visible:outline-2 focus-visible:outline-primary`,"aria-pressed":P(v).allOpen?`true`:`false`,"data-open":P(v).allOpen?`1`:`0`,title:P(v).allOpen?`Close every call card`:`Open every call card`,onClick:pt},y(P(v).allOpen?`Collapse all`:`Expand all`),9,li)]),R.value?(k(),H(ct,{key:7,vm:R.value,"events-href":P(ge),onReveal:ve},null,8,[`vm`,`events-href`])):w(``,!0),j(`ol`,ui,[P(v).placeholder?(k(),u(`li`,di,`Waiting for activity…`)):w(``,!0),(k(!0),u(I,null,d(P(v).log,e=>(k(),u(I,{key:e.key},[e.kind===`step`?(k(),H($e,{key:0,step:e,class:`mt-5 first:mt-0`,onToggleGroup:t=>P(_).toggleGroup(e)},null,8,[`step`,`onToggleGroup`])):e.kind===`turn`?(k(),u(`li`,{key:1,id:`span-${e.turn.spanId}`,class:`turn mt-5 border-l-2 border-(--ui-border-accented)/50 pb-3 pl-3 pt-2`},[j(`div`,pi,[j(`span`,{class:S([`thought`,e.turn.quick?``:`text-warn`]),title:e.turn.label},`thought `+y(e.turn.chip),11,mi),e.turn.switched?(k(),u(`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 ${e.turn.model}`},`⇄ `+y(P(Je)(e.turn.model)),9,hi)):e.turn.showModel?(k(),u(`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:e.turn.model},y(P(Je)(e.turn.model)),9,gi)):w(``,!0),(k(!0),u(I,null,d(e.turn.facts,(e,t)=>(k(),u(`span`,{key:t,class:`fact`},y(e),1))),128)),e.note&&e.noteHref?(k(),u(`a`,{key:2,class:`nonar font-sans italic text-dimmed no-underline hover:text-primary hover:underline`,href:e.noteHref},y(e.note),9,_i)):e.note?(k(),u(`span`,vi,y(e.note),1)):w(``,!0),e.turn.at===void 0?w(``,!0):(k(),u(`span`,{key:4,class:`ts ml-auto select-none`,title:P(Fe)(e.turn.at)},y(P(Ie)(e.turn.at)),9,yi))])],8,fi)):e.kind===`span`?(k(),H(Ot,{key:2,item:e},null,8,[`item`])):e.kind===`phase`?(k(),u(`li`,{key:3,class:`phase py-0.5 font-mono text-xs`,"data-phase":e.phase},[j(`button`,{type:`button`,class:`phase-head flex w-full cursor-pointer items-baseline gap-2 text-left text-muted hover:text-toned`,"aria-expanded":e.open,onClick:me(t=>P(_).togglePhase(e),[`prevent`])},[j(`span`,Si,y(e.open?`▾`:`▸`),1),j(`span`,{class:S([`swatch inline-block size-2 shrink-0 self-center rounded-[2px]`,P(st)(e.phase)]),"aria-hidden":`true`},null,2),j(`span`,Ci,y(P(Xe)(e)),1)],8,xi),e.open?(k(),u(`ul`,wi,[(k(!0),u(I,null,d(e.rows,e=>(k(),H(Ot,{key:e.key,item:e},null,8,[`item`]))),128))])):w(``,!0)],8,bi)):e.kind===`followup`?(k(),u(`li`,Ti,[j(`h2`,Ei,[t[11]||=j(`span`,null,`↪ Follow-up`,-1),e.input.source?.user?(k(),u(`span`,Di,[St(e.input.source.url)?(k(),u(`a`,{key:0,class:`text-muted no-underline hover:text-primary hover:underline`,href:e.input.source.url,target:`_blank`,rel:`noopener noreferrer`,title:`open the message`},y(e.input.source.user),9,Oi)):(k(),u(`span`,ki,y(e.input.source.user),1))])):w(``,!0),j(`span`,{class:`ts ml-auto select-none text-xs font-normal normal-case tracking-normal text-dimmed`,title:Q(e.input.at)},y(Z(e.input.at)),9,Ai)]),c(K,{text:e.input.text},null,8,[`text`]),e.input.files.length>0?(k(),H(tt,{key:0,files:e.input.files},null,8,[`files`])):w(``,!0)])):e.noteKind===`notes`?(k(),u(`li`,ji,[j(`details`,{class:`notepad group rounded-lg border border-default bg-(--ui-bg-muted) px-(--sb-gutter) py-2`,open:e.key===mt.value},[j(`summary`,Ni,[t[12]||=j(`span`,{class:`chev select-none text-xs text-dimmed transition-transform group-open:rotate-90 motion-reduce:transition-none`},`❯`,-1),t[13]||=j(`span`,null,`📝 Notes for this thread`,-1),e.key===mt.value?w(``,!0):(k(),u(`span`,Pi,`· superseded`)),e.at===void 0?w(``,!0):(k(),u(`span`,{key:1,class:`ts ml-auto select-none font-normal normal-case tracking-normal text-dimmed`,title:P(Fe)(e.at)},y(P(Ie)(e.at)),9,Fi))]),c(K,{text:e.text,class:`mt-1 [&_h1]:mb-1.5 [&_h1]:mt-4 [&_h1]:font-mono [&_h1]:text-xs [&_h1]:font-medium [&_h1]:uppercase [&_h1]:tracking-wider [&_h1]:text-muted [&_h2]:mb-1.5 [&_h2]:mt-4 [&_h2]:font-mono [&_h2]:text-xs [&_h2]:font-medium [&_h2]:uppercase [&_h2]:tracking-wider [&_h2]:text-muted [&_h3]:mb-1.5 [&_h3]:mt-4 [&_h3]:font-mono [&_h3]:text-xs [&_h3]:font-medium [&_h3]:uppercase [&_h3]:tracking-wider [&_h3]:text-muted [&>:first-child]:mt-1`},null,8,[`text`])],8,Mi)])):(k(),u(`li`,{key:6,class:S([`note mt-4 flex items-baseline gap-3 rounded-md pl-3 pr-(--sb-gutter) py-1.5`,e.replay?`text-dimmed`:`bg-warn/10 text-warn`])},[j(`span`,null,y((e.replay?`… `:`⏱ `)+e.text),1),e.at===void 0?w(``,!0):(k(),u(`span`,{key:0,class:`ts ml-auto select-none font-mono text-xs text-dimmed`,title:P(Fe)(e.at)},y(P(Ie)(e.at)),9,Ii))],2))],64))),128)),q.value?.kind===`thinking`?(k(),H(Te,{key:1,id:`thinking`,class:`ml-3.5 mt-5 first:mt-0`,verb:ft.value,"elapsed-ms":q.value.elapsedMs,slow:q.value.slow,model:P(v).model},null,8,[`verb`,`elapsed-ms`,`slow`,`model`])):w(``,!0),j(`li`,{ref_key:`logEnd`,ref:ht,"aria-hidden":`true`},null,512)]),P(v).reply&&!P(i)?(k(),H(Pt,{key:8,position:`last`,text:P(v).reply.text,caption:Dt.value,when:Z(P(v).reply.at),"when-title":Q(P(v).reply.at),files:P(v).reply.files},null,8,[`text`,`caption`,`when`,`when-title`,`files`])):w(``,!0)]),c(T,{open:_t.value,"onUpdate:open":t[3]||=e=>_t.value=e,title:P(qt)(P(Y).state),ui:{overlay:`z-30`,content:`z-30 w-[min(96vw,90rem)] max-w-none`}},{content:D(({close:e})=>[c(br,{data:P(Y).state,abridge:P(vt),closable:``,onClose:t=>e()},null,8,[`data`,`abridge`,`onClose`])]),_:1},8,[`open`,`title`])]),_:1},8,[`title`])}}}),Ri=b({__name:`RunRoutePage`,setup(e){let t=O(pe,null);return(e,n)=>!P(t)||P(t).page===`runNotFound`?(k(),H(q,{key:0})):(k(),H(Li,{key:1}))}});export{Ri as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,o as t,t as n}from"./AppShell-DAtHiuI6.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 f,Xr as p,_r as m,bn as h,c as g,dr as _,hr as v,ji as y,kn as b,l as x,ln as S,o as C,t as w,xi as T,xn as E,yi as D,yn as O}from"./browser-B6T5hjfR.js";import{t as k}from"./Tooltip-Brge0wnd.js";import{t as A}from"./InputMenu-C6aPpe30.js";import{b as j,x as M}from"./main-CeRuGONy.js";import{t as N}from"./eventSource-Bj_dZf6M.js";import{t as P}from"./wallClock-DmaC1sKA.js";import{n as ee,r as F,t as te}from"./indexFormat-B-pd4r7Y.js";import{C as I,E as L,S as R,T as z,_ as B,a as V,b as H,c as U,d as W,f as G,g as K,h as q,i as J,l as Y,m as X,o as Z,p as ne,r as Q,s as $,t as re,u as ie,v as ae,w as oe,x as se,y as ce}from"./indexRow-BmK74Vp1.js";import{i as le}from"./format-BldUwl_R.js";import{i as ue,n as de,t as fe}from"./durationTone-U_rOqo6r.js";import{t as pe}from"./RunsTabs-YSbUu5py.js";import{t as me}from"./StatusDot-BnRjWzFN.js";var he={class:`flex items-baseline gap-1.5 whitespace-pre-line px-2 py-1 text-xs`},ge=[`data-kind`,`aria-label`,`href`],_e=[`data-kind`],ve=l({__name:`SourceMark`,props:{kind:{},tip:{},url:{}},setup(e){let t=e,n=()=>J[t.kind]??t.kind;return(t,r)=>{let a=k;return e.url?(m(),E(a,{key:0},{content:p(()=>[h(`span`,he,[e.kind===`slack`?(m(),E(ue,{key:0})):d(``,!0),h(`span`,null,c(e.tip),1)])]),default:p(()=>[h(`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,ge)]),_:1})):(m(),i(`span`,{key:1,class:`source w-[1.6em] shrink-0`,"data-kind":e.kind,"aria-hidden":`true`},null,8,_e))}}}),ye=[`data-run-id`,`data-started-at`,`data-persisted`,`data-expires-at`],be={class:`pointer-events-auto flex items-center max-sm:order-1`},xe=[`data-user-id`,`data-surface`],Se={class:`surface mr-1.5 inline-block w-[3.6em] rounded border border-accented text-center font-mono text-[0.62rem] text-dimmed`},Ce={class:`name`},we={key:1,class:`who shrink-0 max-sm:hidden sm:w-[14em]`,"aria-hidden":`true`},Te=[`data-agent-hue`],Ee=[`href`],De={class:`owner font-normal text-dimmed`},Oe={class:`name`},ke={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`},Ae={class:`hidden sm:contents`},je={class:`expires pointer-events-auto shrink-0 font-mono text-xs tabular-nums text-warn max-sm:order-11`},Me=[`data-heat`],Ne={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`},Pe={class:`actions flex shrink-0 justify-end max-sm:order-5 sm:w-[2em]`},Fe=l({__name:`RunRow`,props:{run:{},now:{},retentionMs:{}},setup(e){let n=e,a=O(()=>F(n.run.label||K(n.run.id))),o=O(()=>ne(n.run,a.value.scope)),l=O(()=>ae(n.run)),g=O(()=>X(n.run)),_=O(()=>I(n.run)),v=O(()=>L(n.run)),b=O(()=>q(n.run)),S=O(()=>n.run.threadKey?oe(n.run.threadKey):null),C=O(()=>ie(n.run,n.retentionMs)),T=O(()=>C.value!==void 0&&C.value-n.now<=864e5),A=O(()=>!n.run.finished&&!n.run.stop),j=O(()=>fe(n.run.finished&&typeof n.run.finishedAt==`number`?n.run.finishedAt-n.run.startedAt:void 0,`run`)),M=O(()=>de(j.value)),N=O(()=>n.run.finished&&n.run.status&&n.run.status!==`completed`?ce(n.run.status):``),P=O(()=>n.run.stop&&!(n.run.finished&&n.run.status)?R(n.run.stop):``),W=D({soft:!1,hard:!1}),G=O(()=>[...S.value?[{label:`Open thread`,icon:`i-lucide-messages-square`,to:S.value}]:[],...b.value?[{label:`Open in ${J[_.value.kind]??_.value.kind}`,icon:`i-lucide-external-link`,to:b.value,target:`_blank`}]:[],...A.value?[{label:`Stop (soft)`,icon:`i-lucide-octagon-pause`,disabled:W.soft,onSelect:()=>Q(`soft`)},{label:`Kill (hard)`,icon:`i-lucide-octagon-x`,color:`error`,disabled:W.hard,onSelect:()=>Q(`hard`)}]:[]]);function Q(e){(e!==`hard`||w.confirm(`Hard stop: abort this run now with no summary and free its sandbox?`))&&(W[e]=!0,fetch(se(n.run,e),{method:`POST`,credentials:`same-origin`}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`)}).catch(()=>{W[e]=!1}))}function ue(e){e.target?.closest(`a, button`)||w.navigate(g.value)}return(n,S)=>{let w=f(`RouterLink`),D=k,O=x,A=t;return m(),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`,T.value?`leaving`:``]]),"data-run-id":e.run.id,"data-started-at":String(e.run.startedAt),"data-persisted":e.run.persisted?`1`:void 0,"data-expires-at":C.value===void 0?void 0:String(C.value),onClick:ue},[r(w,{class:`row absolute inset-0 rounded-md focus-visible:outline-2 focus-visible:outline-primary`,to:g.value,"aria-label":`open run ${e.run.label||y(K)(e.run.id)}`},null,8,[`to`,`aria-label`]),h(`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`:``,T.value?`opacity-85`:``]])},[h(`span`,be,[r(me,{tone:l.value,label:y(H)(e.run),tip:y(U)(e.run),pulse:!e.run.finished},null,8,[`tone`,`label`,`tip`,`pulse`])]),r(D,{text:y(z)(e.run),ui:{text:`whitespace-pre-line`}},{default:p(()=>[h(`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(y(ee)(e.run.startedAt,e.now)),3)]),_:1},8,[`text`]),v.value?(m(),E(D,{key:0,text:y(B)(e.run)},{default:p(()=>[h(`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":_.value.kind},[h(`span`,Se,c(_.value.kind),1),h(`span`,Ce,c(v.value),1)],10,xe)]),_:1},8,[`text`])):(m(),i(`span`,we)),a.value.agent?(m(),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`,[y(re)[y(V)(a.value.agent)],e.run.finished?`opacity-55`:``]]),"data-agent-hue":y(V)(a.value.agent)},c(a.value.agent),11,Te)):d(``,!0),o.value?(m(),E(D,{key:3,text:o.value},{default:p(()=>[h(`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`},[h(`span`,De,c(o.value.slice(0,o.value.indexOf(`/`)+1)),1),h(`span`,Oe,c(o.value.slice(o.value.indexOf(`/`)+1)),1)],8,Ee)]),_:1},8,[`text`])):(m(),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):(m(),i(`span`,ke,c(a.value.snippet),1)),N.value?(m(),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(N.value),3)):d(``,!0),P.value?(m(),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(P.value),3)):d(``,!0),h(`span`,Ae,[r(ve,{kind:_.value.kind,tip:y(B)(e.run),url:b.value||void 0},null,8,[`kind`,`tip`,`url`])]),T.value&&C.value!==void 0?(m(),E(D,{key:8,text:`removed at ${y(le)(C.value)}`},{default:p(()=>[h(`span`,je,`gone `+c(y(te)(C.value,e.now)),1)]),_:1},8,[`text`])):d(``,!0),r(D,{text:e.run.finished?`start to finish`:`running for`},{default:p(()=>[h(`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?[M.value?`heat`:`text-muted`,j.value.level>=2?`font-medium`:``]:`text-ok`]),style:s(e.run.finished?M.value:void 0),"data-heat":e.run.finished?j.value.level:void 0},c(y(Y)(e.run,e.now)),15,Me)]),_:1},8,[`text`]),S[0]||=h(`span`,{class:`hidden text-xs text-dimmed max-sm:order-8 max-sm:inline`,"aria-hidden":`true`},`·`,-1),r(D,{text:y($)(e.run)},{default:p(()=>[h(`span`,Ne,c(y(Z)(e.run)),1)]),_:1},8,[`text`]),h(`span`,Pe,[G.value.length>0?(m(),E(A,{key:0,items:G.value,content:{align:`end`}},{default:p(()=>[r(O,{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,ye)}}}),Ie={class:`view-as-picker inline-flex items-center gap-2`},Le={key:0,class:`ml-2 truncate font-mono text-[0.6875rem] text-dimmed`},Re={class:`font-mono`},ze={key:0,class:`text-bad`},Be=l({__name:`ViewAsPicker`,props:{people:{}},setup(t){let n=t,a=T(!1),o=T(``),s=O(()=>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=A;return m(),i(`span`,Ie,[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":p(({item:e})=>[e.suffix?(m(),i(`span`,Le,c(e.suffix),1)):d(``,!0)]),"create-item-label":p(({item:e})=>[t[0]||=b(` View as `,-1),h(`span`,Re,c(e),1)]),_:1},8,[`items`,`disabled`]),o.value?(m(),i(`span`,ze,c(o.value),1)):d(``,!0)])}}}),Ve={class:`conn flex items-center gap-1.5`},He={id:`state`,class:`text-xs text-muted`},Ue={class:`toolbar mb-1.5 flex items-center gap-4 px-2 text-xs text-muted`},We={id:`livecount`,class:`count font-mono tabular-nums`},Ge={class:`filter ml-auto inline-flex items-center gap-4`},Ke={class:`toggle inline-flex cursor-pointer select-none items-center gap-1.5 text-toned hover:text-highlighted`},qe=[`checked`],Je={id:`minehint`,class:`sr-only`},Ye={class:`toggle inline-flex cursor-pointer select-none items-center gap-1.5 text-toned hover:text-highlighted`},Xe=[`checked`],Ze={id:`retention`,class:`sr-only`},Qe={key:0,class:`banner mb-3 rounded-md border border-warn px-2.5 py-1.5 text-[0.8rem] text-warn`,role:`status`},$e={id:`runs`,class:`m-0 list-none border-t border-muted p-0`},et={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`},tt={key:1,id:`empty`,class:`empty px-2 py-2 text-muted`},nt={key:1,class:`pager mt-3 flex items-baseline gap-2 px-2 text-[0.8rem] text-muted`,"aria-label":`Completed runs pages`},rt={class:`range font-mono tabular-nums text-dimmed`},it=l({__name:`RunsIndexPage`,setup(e){let t=C(`runs`),s=t?.all??!1,l=t?.mine??!1,u=new URLSearchParams(w.search());if(!u.has(`mine`)&&!u.has(`all`)&&t){let e=w.readPref(Q.mine)===`1`,t=w.readPref(Q.all)===`1`;(e||t)&&w.navigate(A(t,e))}let x=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 A(e,t){let n=[e?`all=1`:``,t?`mine=1`:``].filter(Boolean).join(`&`);return n?`/runs?${n}`:`/runs`}let ee=t?.olderThan!==void 0,F=t?.retentionDays??null,I=F===null?void 0:F*864e5,L=g(F),R=D(new Map);for(let e of t?.rows??[])R.set(e.id,e);let z=P(t?.now),B=T({tone:`amber`,text:`connecting…`}),V=O(()=>[...R.values()].sort((e,t)=>t.startedAt-e.startedAt)),H=O(()=>V.value.filter(e=>!e.finished).length),U=O(()=>I===void 0?-1:V.value.findIndex(e=>{let t=ie(e,I);return t!==void 0&&t-z.value<=864e5})),K=O(()=>U.value===-1?V.value:V.value.slice(0,U.value)),q=O(()=>U.value===-1?[]:V.value.slice(U.value)),J=s?`All runs`:`Live runs`;o(H,e=>{w.setTitle((e>0?`(${e}) `:``)+J),w.setFavicon(e>0?M:j)},{immediate:!0});function Y(e){let t=e.target.checked;w.writePref(Q.all,t?`1`:`0`),w.navigate(A(t,l))}function X(e){let t=e.target.checked;w.writePref(Q.mine,t?`1`:`0`),w.navigate(A(s,t))}let Z=O(()=>t?.olderThan===void 0?``:te(t.olderThan,z.value)),ne=N(),$=null;return _(()=>{$=ne(`/runs?stream=1${s?`&all=1`:``}${l?`&mine=1`:``}`);let e=!1;$.onopen=()=>{if(e){w.reload();return}e=!0,B.value={tone:`green`,text:`connected`}},$.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}let n=t.type===`removed`?t.id:t.run?.id,r=n?R.get(n):void 0;if(ee&&!r)return;let i=W(t,s,r?.persisted===!0);i.op===`upsert`?R.set(i.run.id,G(R.get(i.run.id),i.run)):i.op===`remove`&&R.delete(i.id)},$.onerror=()=>{$&&$.readyState===2?B.value={tone:`red`,text:`disconnected`}:B.value={tone:`amber`,text:`connecting…`}}}),v(()=>{$?.close()}),(e,o)=>{let u=k,g=f(`RouterLink`);return m(),E(n,{title:y(J),nav:`runs`},{status:p(()=>[h(`span`,Ve,[r(me,{tone:B.value.tone,label:B.value.text},null,8,[`tone`,`label`]),h(`span`,He,c(B.value.text),1)])]),default:p(()=>[r(pe,{current:`runs`}),h(`div`,Ue,[h(`span`,We,c(H.value)+` running`,1),h(`span`,Ge,[y(t)?.viewAs?(m(),E(Be,{key:0,people:y(t).viewAs.people},null,8,[`people`])):d(``,!0),r(u,{text:y(x)},{default:p(()=>[h(`label`,Ke,[h(`input`,{id:`showmine`,type:`checkbox`,class:`accent-(--ui-bg-inverted)`,checked:y(l),"aria-describedby":`minehint`,onChange:X},null,40,qe),o[0]||=b(` Show only mine `,-1)])]),_:1},8,[`text`]),h(`span`,Je,c(y(x)),1),h(`label`,Ye,[h(`input`,{id:`showdone`,type:`checkbox`,class:`accent-(--ui-bg-inverted)`,checked:y(s),"aria-describedby":`retention`,onChange:Y},null,40,Xe),o[1]||=b(` Show completed `,-1)]),r(u,{text:y(L)},{default:p(()=>[...o[2]||=[h(`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`]),h(`span`,Ze,c(y(L)),1)])]),y(t)?.storeUnavailable?(m(),i(`p`,Qe,c(y(t).storeUnavailable),1)):d(``,!0),h(`ul`,$e,[(m(!0),i(S,null,a(K.value,e=>(m(),E(Fe,{key:e.id,run:e,now:y(z),"retention-ms":y(I)},null,8,[`run`,`now`,`retention-ms`]))),128)),q.value.length>0?(m(),i(`li`,et,[...o[3]||=[h(`span`,{"aria-hidden":`true`,class:`text-sm tracking-normal`},`⏳`,-1),h(`span`,{class:`whitespace-nowrap`},`Leaving within a day`,-1),h(`span`,{class:`normal-case tracking-normal text-dimmed max-sm:hidden`},`— each row says when it is removed`,-1)]])):d(``,!0),(m(!0),i(S,null,a(q.value,e=>(m(),E(Fe,{key:e.id,run:e,now:y(z),"retention-ms":y(I)},null,8,[`run`,`now`,`retention-ms`]))),128)),V.value.length===0?(m(),i(`li`,tt,c(y(l)?y(s)?`No runs of yours.`:`No active runs of yours.`:y(s)?`No runs.`:`No active runs.`),1)):d(``,!0)]),y(s)&&(y(t)?.olderHref||y(t)?.olderThan!==void 0)?(m(),i(`nav`,nt,[y(t)?.olderThan===void 0?d(``,!0):(m(),i(S,{key:0},[r(g,{class:`text-primary hover:underline`,to:A(!0,y(l))},{default:p(()=>[...o[4]||=[b(`← Newest runs`,-1)]]),_:1},8,[`to`]),h(`span`,rt,`· runs finished before `+c(Z.value),1)],64)),y(t)?.olderHref?(m(),E(g,{key:1,class:`older ml-auto text-primary hover:underline`,to:y(t).olderHref},{default:p(()=>[...o[5]||=[b(`Older runs →`,-1)]]),_:1},8,[`to`])):d(``,!0)])):d(``,!0)]),_:1},8,[`title`])}}});export{it as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./format-BldUwl_R.js";function t(e,t){if(e===void 0)return``;switch(t){case`precise`:return n(e);case`clock`:return r(e);case`report`:return i(e)}}function n(e){if(!(e>=0))return`0ms`;if(e<1e3)return`${Math.round(e)}ms`;let t=Math.round(e/100);if(t<600)return`${(t/10).toFixed(1)}s`;let n=Math.round(e/1e3);return`${Math.floor(n/60)}m ${a(n%60)}s`}function r(e){if(!(e>0))return`0s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${a(t%60)}s`:`${Math.floor(n/60)}h ${a(n%60)}m`}function i(e){if(!(e>=0))return`0ms`;if(e<1e3)return`${Math.round(e)}ms`;let t=Math.round(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${a(t%60)}s`:`${Math.floor(n/60)}h ${a(n%60)}m`}function a(e){return e<10?`0${e}`:String(e)}function o(e,t){let n=e.finishedAt??t;if(n!==void 0)return Math.max(0,n-(e.receivedAt??e.startedAt))}function s(e){return e===`completed`?`succeeded`:e===`stopped_soft`?`stopped early`:e===`stopped_hard`?`killed`:e}function c(e){return e.state===`stopped`?s(`stopped_${e.mode}`):`${e.state} (${e.mode})`}function l(e){return e.finished?e.status?s(e.status):`finished`:`live`}function u(e){return e.finished&&!e.persisted&&e.sealedAt===void 0}function d(e){return e.finished?u(e)?`amber`:e.status===`failed`||e.status===`stopped_hard`||e.status===`interrupted`?`red`:e.status===`stopped_soft`?`amber`:`grey`:`green`}function f(e){return e===`coding`||e===`review`||e===`research`||e===`general`?e:`other`}var p={coding:`text-ok bg-ok/8 border-ok/25`,review:`text-review bg-review/8 border-review/25`,research:`text-research bg-research/8 border-research/25`,general:`text-info bg-info/8 border-info/25`,other:`text-toned bg-accented/60 border-accented`};function m(e){let t=e.stepCount??e.eventCount;return`${t} event${t===1?``:`s`}`}function h(e){return e.stepCount===void 0?`events published, span records included`:`content events; span records excluded`}function g(e){return`/runs/${encodeURIComponent(e.id)}${!e.finished&&e.token?`?t=${encodeURIComponent(e.token)}`:``}`}function _(e,t){return`/runs/${encodeURIComponent(e.id)}/stop?t=${encodeURIComponent(e.token??``)}&mode=${encodeURIComponent(t)}`}function v(e){return e.length>8?`${e.slice(0,8)}…`:e}function y(e,n){let r=o(e,e.finished?void 0:n);return r===void 0?``:t(r,`clock`)}function b(e){return typeof e.receivedAt==`number`?` (received to finish)`:``}function x(e){let t=e.channelId??``,n=t.indexOf(`:`),r=n===-1?`unknown`:t.slice(0,n);if(e.userName)return{kind:r,identity:e.userName};let i=e.userId??``,a=i.indexOf(`:`);return{kind:r,identity:a===-1?i:i.slice(a+1)}}function S(e){return`/threads/${encodeURIComponent(e)}`}var C={mine:`sb.runs.mine`,all:`sb.runs.all`},w={slack:`Slack`,http:`HTTP ingress`,mcp:`MCP`,cli:`CLI`,web:`Web`};function T(e){if(!e.finished)return e.activity?`now: ${e.activity}`:`starting…`;let n=l(e),r=o(e);return r!==void 0&&(n+=` in ${t(r,`clock`)}${b(e)}`),u(e)&&(n+=` · delivering the reply`),e.status&&e.status!==`completed`&&e.activity&&(n+=`\n${e.activity}`),n}function E(t){let n=typeof t.receivedAt==`number`?`received ${e(t.receivedAt)}\n`:``;return n+=`started ${e(t.startedAt)}`,t.finished&&typeof t.finishedAt==`number`&&(n+=`\nfinished ${e(t.finishedAt)}`),n}function D(e){let t=x(e);return`via ${w[t.kind]??t.kind}${t.identity?` · ${t.identity}`:``}`}function O(e){return x(e).identity}function k(e,t){return e.repo??(/^[\w.-]+\/[\w.-]+$/.test(t)?t:``)}function A(e){return e.sourceUrl&&/^https?:\/\//.test(e.sourceUrl)?e.sourceUrl:``}function j(e,t,n){return e.type===`upsert`&&e.run?!t&&e.run.finished?{op:`remove`,id:e.run.id}:{op:`upsert`,run:e.run}:e.type===`removed`&&e.id?t&&n?{op:`keep`}:{op:`remove`,id:e.id}:{op:`keep`}}function M(e,t){if(!e||!e.finished)return t;let n={...t};return n.finishedAt===void 0&&e.finishedAt!==void 0&&(n.finishedAt=e.finishedAt),n.status===void 0&&e.status!==void 0&&(n.status=e.status),n.receivedAt===void 0&&e.receivedAt!==void 0&&(n.receivedAt=e.receivedAt),n.sealedAt===void 0&&e.sealedAt!==void 0&&(n.sealedAt=e.sealedAt),n.replyOk===void 0&&e.replyOk!==void 0&&(n.replyOk=e.replyOk),n}function N(e,t){return e.finished&&typeof e.finishedAt==`number`&&typeof t==`number`?e.finishedAt+t:void 0}var P=864e5;export{x as C,o as D,O as E,t as O,c as S,E as T,D as _,f as a,l as b,T as c,j as d,M as f,v as g,A as h,w as i,y as l,g as m,P as n,m as o,k as p,C as r,h as s,p as t,N as u,d as v,S as w,_ as x,s as y};
|
|
@@ -1,9 +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{D as S,O as C}from"./indexRow-BmK74Vp1.js";import{i as w,n as T,t as E}from"./format-BldUwl_R.js";import{n as D,r as O,t as k}from"./durationTone-U_rOqo6r.js";var A=`A-Za-z0-9:@._-`;RegExp(`^[${A}]{1,128}$`),RegExp(`[^${A}]`,`g`);function j(e){return e.type===`span_start`||e.type===`span_end`}function M(e,t){return/^[A-Za-z0-9_-]{1,64}$/.test(e)?`synth:${e}`:`synth:${t}`}function N(e){let t=[];for(let n of e)n.type===`span_end`&&n.name===`run.agent`&&t.push({spanId:n.spanId,startedAt:n.startedAt,endedAt:n.startedAt+n.durationMs});return t}function P(e,t){let n;for(let r of e)r.startedAt<=t&&t<=r.endedAt&&(!n||r.endedAt-r.startedAt<n.endedAt-n.startedAt)&&(n=r);return n?.spanId}function ee(e){let t=N(e),n=new Set;for(let t of e){if(!j(t))continue;let e=t.attrs??{};t.name.startsWith(`tool.`)&&typeof e.callId==`string`&&n.add(e.callId)}let r=[],i=new Map;return e.forEach((e,a)=>{switch(e.type){case`tool_call`:{let o=e.callId;if(o===void 0||e.at===void 0||n.has(o)){r.push(e);return}let s=M(o,a);r.push(F(s,`tool.${e.tool}`,e.at,P(t,e.at),{callId:o}),e),i.set(o,{spanId:s,startedAt:e.at});return}case`tool_result`:{if(r.push(e),e.callId===void 0)return;let n=i.get(e.callId);if(!n)return;i.delete(e.callId);let a=e.at??n.startedAt,o={ok:e.ok,callId:e.callId};e.exitCode!==void 0&&(o.exitCode=e.exitCode),e.infra&&(o.infra=!0),r.push(I(n.spanId,`tool.${e.tool}`,n.startedAt,Math.max(0,a-n.startedAt),P(t,n.startedAt),o,e.ok?`ok`:`error`));return}default:r.push(e)}}),r}function F(e,t,n,r,i){return{type:`span_start`,spanId:e,...r===void 0?{}:{parentSpanId:r},name:t,...i?{attrs:i}:{},at:n}}function I(e,t,n,r,i,a,o=`ok`){return{type:`span_end`,spanId:e,...i===void 0?{}:{parentSpanId:i},name:t,startedAt:n,durationMs:r,status:o,...a?{attrs:a}:{},at:n+r}}function te(e,t,n){let r=e.get(t.spanId);if(t.type===`span_start`){if(r)return;e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?{}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.at??0,attrs:t.attrs??{}});return}e.set(t.spanId,{traceId:n,spanId:t.spanId,...t.parentSpanId===void 0?r?.parentSpanId===void 0?{}:{parentSpanId:r.parentSpanId}:{parentSpanId:t.parentSpanId},name:t.name,startedAt:t.startedAt,endedAt:t.startedAt+t.durationMs,durationMs:t.durationMs,status:t.status,...t.error===void 0?{}:{errorMessage:t.error},attrs:{...r?.attrs??{},...t.attrs??{}}})}function ne(){let e,t,n=[];return{push(r){e?t&&r.seq!==void 0&&t.seq!==void 0&&r.seq>t.seq+1&&t.at!==void 0&&r.at!==void 0&&n.push({kind:`gap`,fromSeq:t.seq+1,toSeq:r.seq-1,from:Math.min(t.at,r.at),to:Math.max(t.at,r.at)}):e={seq:r.seq??1,at:r.at},r.type===`run_note`&&r.kind===`spans_dropped`&&r.from!==void 0&&r.to!==void 0&&r.to>=r.from&&n.push({kind:`note`,from:r.from,to:r.to}),t={seq:r.seq,at:r.at}},losses(t={}){let r=t.elided??[],i=(e,t)=>r.some(n=>n.fromSeq<=e&&t<=n.toSeq),a=[];e&&e.seq>1&&t.windowStart!==void 0&&e.at!==void 0&&e.at>t.windowStart&&a.push({from:t.windowStart,to:e.at,kind:`lost`});for(let e of n)a.push(e.kind===`note`?{from:e.from,to:e.to,kind:`lost`}:{from:e.from,to:e.to,kind:i(e.fromSeq,e.toSeq)?`elided`:`lost`});return a}}}function re(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 L=o({__name:`MarkdownText`,props:{text:{}},setup(e){let n=e,i=_(null);function a(){let e=i.value;if(e)try{re(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))}}),ie=[`user`,`channel`,`defaults`];function R(e){return typeof e==`string`&&ie.includes(e)}function ae(){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(C(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`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)),R(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 `+C(f,`precise`));let p=i(u.thinkingMs);p!==void 0&&e.push(`thinking `+C(p,`precise`));let m=i(u.textMs);m!==void 0&&e.push(`writing `+C(m,`precise`));let h=a(u.model);return[{kind:`turn`,spanId:r,label:`Thought for `+C(o,`precise`),facts:e,durationMs:o,...h?{model:h}:{},at:i(n.at)}]}if(e.startsWith(`tool.`)||e.startsWith(`mcp.`)){if(!e.startsWith(`tool.`))return[];let t=a(u.callId);if(!t)return[];let n=g(t);return!n||n.call.durationMs!==void 0?[]:(n.call.durationMs=o,n.call.facts=l(n.call),[{kind:`result`,step:n.step,call:n.call}])}let d=i(n.startedAt);return[{kind:`span`,spanId:r,name:e,open:!1,durationMs:o,status:c,at:i(n.at),...d===void 0?{}:{startedAt:d}}]}case`artifact`:{let e=a(n.key),t=a(n.name);if(!e||!t)return[];let r={key:e,name:t,size:i(n.size)??0,contentType:a(n.contentType),at:i(n.at)},o=a(n.messageId),s=a(n.callId),c=n.direction===`in`&&o?{...r,direction:`in`,messageId:o}:n.direction===`out`&&s?{...r,direction:`out`,callId:s}:void 0;return c?[{kind:`artifact`,artifact:c}]:[]}case`skill_use`:{let e=a(n.skill);if(!e)return[];let r=[];t||r.push({kind:`step`,step:o()});let s=a(n.source),c={name:e,description:a(n.description),agent:a(n.agent),bodyBytes:i(n.bodyBytes)??0,at:i(n.at)};return/^https?:\/\//.test(s)&&(c.source=s),r.push({kind:`skill`,step:t,skill:c}),r}case`tool_call`:{let e=[];t||e.push({kind:`step`,step:o()});let r=h(n,a(n.summary));return t.calls.push(r),e.push({kind:`call`,step:t,call:r}),e}case`tool_result`:{let e=_(n);if(e)return u(e.call,n),[{kind:`result`,step:e.step,call:e.call}];let r=[];t||r.push({kind:`step`,step:o()});let i=h(n,``);return i.startedAt=void 0,u(i,n),t.calls.push(i),r.push({kind:`call`,step:t,call:i}),r}default:return[]}}function y(){return r.length>0?r[0]:null}return{push:v,pending:y,steps:()=>e}}new Set(`request,slack.receive,dispatch.history,dispatch.admission,dispatch.ack_card,dispatch.gate.repo,dispatch.gate.pr_head,dispatch.workspace.attach,dispatch.gate.attached_head,dispatch.mcp_discovery,dispatch.compose,dispatch.channel_visibility,dispatch.repo_context,dispatch.memory_read,dispatch.refuse,dispatch.ship_preflight,dispatch.ledger_claim,dispatch.route,run.agent,run.command,run.reading_diff,run.settle_reviewed_head,run.description_turn,run.verdict_turn,run.observe_workspace,run.pr_post_step,run.review_post_step,run.reading_diff_join,run.pr_description_join,model.turn,ship.round,post.card_close,post.reply`.split(`,`));var z=new Set([`slack.receive`,`dispatch.history`,`dispatch.admission`,`dispatch.ack_card`,`dispatch.gate.repo`,`dispatch.gate.pr_head`,`dispatch.workspace.attach`,`dispatch.gate.attached_head`,`dispatch.mcp_discovery`,`dispatch.compose`,`dispatch.channel_visibility`,`dispatch.repo_context`,`dispatch.memory_read`,`dispatch.refuse`,`dispatch.ship_preflight`,`dispatch.ledger_claim`,`dispatch.route`]),oe=new Set([`run.observe_workspace`,`run.pr_post_step`,`run.review_post_step`,`run.reading_diff_join`,`run.pr_description_join`]),se=new Set([`request`,`run.agent`,`ship.round`,`run.settle_reviewed_head`,`run.description_turn`,`run.verdict_turn`,`post.card_close`,`post.reply`]),ce=new Set([`run.reading_diff`]);function B(e,t){if(ce.has(e))return{kind:`background`};if(se.has(e))return{kind:`uncounted`};if(e===`model.turn`)return{kind:`counted`,bucket:`thinking`};if(e===`run.command`||e.startsWith(`run.command.`))return{kind:`counted`,bucket:t===`command`?`tools`:`getting_ready`};if(z.has(e)||e.startsWith(`dispatch.workspace.attach.`))return{kind:`counted`,bucket:`getting_ready`};if(oe.has(e))return{kind:`counted`,bucket:`finishing_up`};if(e.startsWith(`tool.`)||e.startsWith(`mcp.`))return{kind:`counted`,bucket:`tools`}}var V={clone:`cloning the repo`,"checkout-clone":`cloning the checkout`,"worktree-clone":`cloning the worktree`,"worktree-detach":`checking out the expected commit`,"op-clone":`cloning the op tree`,fetch:`fetching the branch`,"wake-fetch":`fetching the latest commits`,"reclaim-fetch":`fetching to reclaim the mirror`,"for-each-ref":`listing the branches`,checkout:`checking out the branch`,"checkout-update":`updating the checkout`,"rev-parse":`reading the commit`,"cat-file":`checking the mirror for the commit`,"show-ref":`reading the branch tip`,"detect-default-branch":`detecting the default branch`,git:`a git command`,"git-setup":`configuring git`,"stage-perms":`securing the credential stage`,install:`installing dependencies`,build:`building`,test:`running the tests`,"clear-markers":`clearing the build markers`,"lockfile-key":`hashing the lockfile`,"deps-store-dir":`preparing the dependency store`,"deps-scratch":`cloning a scratch tree for the dependency install`,"deps-install":`installing the dependency store`,"deps-harden":`locking down the installed dependencies`,"deps-commit":`recording the installed dependencies`,"deps-adopt":`adopting the dependency store`,"deps-restore-scratch":`restoring dependencies to scratch`,"deps-restore-chown":`setting the restored dependencies' owner`,"deps-restore-commit":`recording the restored dependencies`,"deps-scratch-chown":`setting the dependency scratch owner`,"deps-evict":`evicting an old dependency store`,"unlink-deps-view":`unlinking the dependency view`,"clear-installing-marker":`clearing the install marker`,chown:`setting the workspace owner`,"worktree-chown":`setting the worktree owner`,"op-chown":`setting the op tree's owner`,"worktree-clean":`cleaning the worktree`,"clean-workspace":`cleaning the workspace`,"clean-before-restore":`cleaning before the restore`,"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(V);function H(e){return Object.prototype.hasOwnProperty.call(V,e)?e:void 0}function le(e){let t=H(e);if(t!==void 0)return V[t];if(e.endsWith(`-stale-sweep`)){let t=H(e.slice(0,-12));if(t!==void 0)return`clearing leftovers before ${V[t]}`}}var U={request:`the request`,"slack.receive":`receiving`,"dispatch.history":`reading the thread`,"dispatch.admission":`checking the thread`,"dispatch.ack_card":`posting the status card`,"dispatch.gate.repo":`checking the repo`,"dispatch.gate.pr_head":`checking the PR`,"dispatch.workspace.attach":`attaching the workspace`,"dispatch.gate.attached_head":`checking out the branch`,"dispatch.mcp_discovery":`loading tools`,"dispatch.compose":`preparing the prompt`,"dispatch.channel_visibility":`checking the channel`,"dispatch.repo_context":`reading the repo's context`,"dispatch.memory_read":`recalling memory`,"dispatch.refuse":`refusing`,"dispatch.ship_preflight":`checking the ship request`,"dispatch.ledger_claim":`claiming the run's row`,"dispatch.route":`picking the preset`,"run.agent":`the agent loop`,"run.command":`the command`,"run.reading_diff":`reading the diff (in parallel)`,"run.settle_reviewed_head":`re-checking the moved branch`,"run.description_turn":`asking for the PR description`,"run.verdict_turn":`asking for the verdict`,"run.observe_workspace":`checking the workspace`,"run.pr_post_step":`posting the PR`,"run.review_post_step":`posting the review`,"run.reading_diff_join":`waiting for the diff`,"run.pr_description_join":`waiting for the PR description`,"model.turn":`a model turn`,"ship.round":`a ship round`,"post.card_close":`closing the card`,"post.reply":`posting the reply`},W=`a Switchboard step`;function G(e){if(e in U)return U[e];if(e.startsWith(`tool.`))return e.slice(5)||`a Switchboard step`;if(e.startsWith(`mcp.`)){let t=e.slice(e.lastIndexOf(`.`)+1);return t&&t!==`mcp`?t:W}for(let t of[`dispatch.workspace.attach.`,`run.command.`])if(e.startsWith(t))return le(e.slice(t.length))??`a Switchboard step`;return W}var ue=[/\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 de(e){return ue.some(t=>t.test(e))}var fe=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,pe=/^[0-9a-f]{7,40}$/,me=/^(?![.-])(?!.*\.\.)(?!.*\/\/)(?!.*@\{)(?!.*\.lock$)(?!.*[./]$)[\w][\w./-]*$/;function K(e){return e&&fe.test(e)?`https://github.com/${e}`:void 0}function q(e,t){let n=K(e);if(!(!n||t===void 0||!Number.isInteger(t)||t<=0))return`${n}/pull/${t}`}function he(e,t){let n=K(e);if(n&&t&&me.test(t))return`${n}/tree/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function ge(e,t){let n=K(e);if(n&&t&&pe.test(t))return`${n}/commit/${t}`}function _e(e){return e.slice(0,7)}function ve(e){if(e===`slack.receive`||e.startsWith(`dispatch.`))return`getting_ready`;let t=B(e,`agent`);return t?.kind===`counted`&&t.bucket===`finishing_up`?`finishing_up`:void 0}function ye(e){return e===`request`||e===`run.agent`}var be={getting_ready:`Getting ready`,finishing_up:`Finishing up`};function xe(e){let t=e.rows.length,n=`${t} step${t===1?``:`s`}`,r=be[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} · ${C(Math.max(0,a-i),`precise`)}`}function Se(e){let t=e.split(`
|
|
8
|
-
`),n=t.indexOf(`<<<UNTRUSTED`),r=t.lastIndexOf(`UNTRUSTED>>>`);return(n>=0&&r>n?t.slice(n+1,r):t.slice(1)).filter(e=>e.length>0)}function Ce(e,t){let n=t.split(`/`).map(encodeURIComponent).join(`/`);return`${e.urlBase}${n}${e.token?`?t=${encodeURIComponent(e.token)}`:``}`}function we(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 Te(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 Ee(e,t,n){let r=!!e.model&&t!==null&&Fe(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 De(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 Oe(e){let{meta:t,prOpened:n}=e,r=t?.repo&&K(t.repo)?t.repo:void 0;if(t?.agent===`review`){if(de(e.requestText))return{text:`verdict, Slack only`};if(r&&t.pr!==void 0){let e=q(r,t.pr);return e?{text:`verdict for ${r}#${t.pr}`,href:e}:{text:`verdict`}}return{text:`verdict`}}if(t?.agent===`coding`&&n){let e=n.created?`pull request opened`:`pull request updated`,t=r?q(r,n.number):void 0;return t?{text:`${e} ${r}#${n.number}`,href:t}:{text:e}}return t?.agent===`command`?{text:`output`}:{text:`answer`}}function J(e,t){return{id:e.id,tool:e.tool,title:e.title,headline:e.headline,shell:e.shell,status:e.status,facts:[...e.facts],startedAt:e.startedAt,output:e.result?e.result.output||e.result.summary:``,hasResult:e.result!==void 0,chipOnly:!e.shell&&e.title===e.tool,durationMs:e.durationMs,exitCode:e.result?.exitCode,timedOut:O(e.result?.exitCode),open:t}}function ke(e={}){let t=e.openTags&&e.openTags.length>0?e.openTags:[`failed`,`infra`],n=ae(),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,lastAtWall:null,elided:[],traceVersion:0}),i=ne(),a=new Map,o=new Map,s=new Map,c=new Map,l=new Map,u=new Map,d=new Map,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 w(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 T(e){return o.get(e.index)??w(e)}function E(e,t){let n=T(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(J(t,r.allOpen||b(t.tags)));u.set(t.id,i),d.set(t.id,n),n.items.push({kind:`call`,call:i}),C(n)}function D(e,t){if(p.has(t.id)){let t=o.get(e.index);t&&C(t);return}let n=u.get(t.id);if(!n){E(e,t);return}Object.assign(n,J(t,n.open)),b(t.tags)&&(n.open=!0);let r=o.get(e.index);r&&C(r)}function O(e,t){m&&=(r.log.push({kind:`turn`,key:v(`turn`),turn:m,note:e,...t===void 0?{}:{noteHref:t}}),null)}let k=new Map,A=y([]);function M(e){if(e.direction===`in`){k.get(e.messageId)?.files.push(e);return}A.push(e);let t=u.get(e.callId);t&&((t.files??=[]).push(e),t.open=!0)}function N(e){switch(r.placeholder=!1,e.kind){case`input`:{let t={text:e.text,messageId:e.messageId,at:e.at,...e.source?{source:e.source}:{},files:[]};r.request?r.log.push({kind:`followup`,key:v(`followup`),input:t}):r.request=t,k.set(t.messageId,t);return}case`step`:w(e.step);return;case`call`:E(e.step,e.call);return;case`result`:D(e.step,e.call);return;case`turn`:O(``),m=Ee(e,r.model,h),m.model&&(h=!0),e.model&&!(r.model!==null&&Fe(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`:T(e.step).items.push({kind:`skill`,skill:e.skill});return;case`artifact`:M(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`)&&R(e.mode);return;case`replay_note`:r.log.push({kind:`note`,key:v(`note`),replay:!0,text:e.text});return;case`span`:{if(ye(e.name)){e.name===`run.agent`&&e.open&&P(`getting_ready`);return}e.name.startsWith(`post.`)&&e.open&&P(`finishing_up`);let t=s.get(e.spanId);if(t){t.open=e.open,e.durationMs!==void 0&&(t.durationMs=e.durationMs),e.status&&(t.status=e.status);return}let n=y({kind:`span`,key:v(`span`),spanId:e.spanId,text:G(e.name),open:e.open,...e.durationMs===void 0?{}:{durationMs:e.durationMs},...e.status?{status:e.status}:{},at:e.open?e.at:e.startedAt??e.at});s.set(e.spanId,n);let i=ve(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`:O(`wrote the reply`,`#reply`),r.reply={text:e.text,at:e.at,files:A};return}}function P(e){let t=l.get(e);t&&!t.toggled&&(t.group.open=!1)}function ee(e){let t=e,s=t?.type===`span_start`||t?.type===`span_end`;if(t&&typeof t.type==`string`){let t=e;i.push(t),j(t)&&te(a,t,``),r.traceVersion++}t&&!s&&typeof t.at==`number`&&((r.firstAt===null||t.at<r.firstAt)&&(r.firstAt=t.at),(r.lastAt===null||t.at>=r.lastAt)&&(r.lastAt=t.at,r.lastAtWall=x()));for(let t of n.push(e))N(t);let c=e;if((c?.type===`tool_call`||c?.type===`tool_result`)&&typeof c.logIndex==`number`&&!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 F(e){if(e.turn)return`span-${e.turn.spanId}`;let t=e.items.find(e=>e.kind===`call`);return t?.kind===`call`?`call-${t.call.id}`:void 0}function I(e){let t=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=F(t);return n===void 0?void 0:{step:t,anchor:n}}function re(){for(let e of u.values())if(e.status===`running`)return e;return null}function L(e){r.allOpen=e;for(let t of l.values())t.group.open=e,t.toggled=!0;for(let t of u.values())t.open=e}function ie(e){if(e.startsWith(`call-`)){let t=e.slice(5),n=d.get(t);return!n||!u.has(t)?!1:(n.manual=!0,n.groupOpen=!0,!0)}if(e.startsWith(`span-`)){let t=e.slice(5),n=c.get(t);if(n){n.open=!0;let e=l.get(n.phase);return e&&(e.toggled=!0),!0}if(s.has(t))return!0;for(let e of r.log)if(e.kind===`step`&&e.turn?.spanId===t||e.kind===`turn`&&e.turn.spanId===t)return!0}return!1}function R(e){r.stopMode=e}function z(e){r.elided.push(e),r.log.push({kind:`note`,key:v(`note`),replay:!0,text:Te(e)}),r.placeholder=!1,r.traceVersion++}return{state:r,handle:ee,noteElided:z,spanSet:()=>[...a.values()],losses:e=>i.losses({windowStart:e,elided:r.elided}),pendingCall:re,flushPendingTurn:O,closePhases(){P(`getting_ready`),P(`finishing_up`)},setAllOpen:L,togglePhase(e){e.open=!e.open;let t=l.get(e.phase);t&&(t.toggled=!0)},reveal:ie,landing:I,callHeadline:e=>u.get(e)?.headline,toggleGroup(e){e.manual=!0,e.groupOpen=!e.groupOpen},toggleCall(e){e.open=!e.open},markStopping:R,opensByDefault:b}}function Y(e,t){return e.lastAt===null||e.lastAtWall===null?null:e.lastAt+(t-e.lastAtWall)}function Ae(e,t){return{now:n=>e.serverNow+(n-t),elapsedMs(t){return S(e,this.now(t))??0},elapsedAt(t){return S({receivedAt:e.receivedAt,startedAt:e.startedAt,finishedAt:t})??0}}}function je(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 Me(e){return e.replyOk===!1?`reply failed`:e.replyOk!==!0||e.finishedAt===void 0||e.sealedAt===void 0?``:`delivered in ${C(Math.max(0,e.sealedAt-e.finishedAt),`clock`)}`}function Ne(e){if(typeof e!=`string`)return null;let t;try{t=JSON.parse(e)}catch{return null}if(typeof t!=`object`||!t)return null;let{finishedAt:n}=t;return typeof n==`number`&&Number.isFinite(n)&&n>0?{finishedAt:n}:null}var X=Symbol(`sb-runner-clock`),Z=Symbol(`sb-artifact-links`),Pe=Symbol(`sb-reply-landed`);function Fe(e,t){return e===t||!e.includes(`/`)!=!t.includes(`/`)&&Q(e)===Q(t)}function Q(e){if(!e)return`model`;let t=e.lastIndexOf(`/`);return(t===-1?e:e.slice(t+1))||e}var Ie=6e4;function Le(e,t,n){let r=Y(e,n);if(r===null||e.lastAt===null)return{kind:`starting`};if(t)return{kind:`call`,call:t,elapsedMs:Math.max(0,r-(t.startedAt??e.lastAt))};let i=Math.max(0,r-e.lastAt);return{kind:`thinking`,elapsedMs:i,slow:i>=Ie}}var Re=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]),ze=65536,Be=new Set([`application/json`,`application/x-ndjson`,`application/xml`,`application/yaml`]);function $(e){return Re.has(e)?`image`:e.startsWith(`video/`)?`video`:e.startsWith(`audio/`)?`audio`:e.startsWith(`text/`)||Be.has(e)?`text`:`other`}var Ve=[`data-open-images`],He={class:`mb-1.5 flex items-baseline gap-2 font-mono text-[0.68rem] font-medium uppercase tracking-wider text-dimmed`},Ue={class:`count font-normal normal-case tracking-normal`},We={class:`m-0 flex list-none flex-col gap-1.5 p-0`},Ge=[`data-direction`,`data-kind`,`data-open`,`data-expired`],Ke={class:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5 font-mono text-xs`},qe=[`title`],Je=[`aria-expanded`,`aria-controls`,`onClick`],Ye={key:1,class:`name font-medium text-toned`},Xe={class:`fact text-dimmed`},Ze={class:`fact text-dimmed`},Qe={key:2,class:`expired text-warn`},$e=[`id`,`aria-hidden`],et={class:`min-h-0 overflow-hidden`},tt=[`src`,`alt`,`onError`],nt=[`src`,`onError`],rt=[`src`,`onError`],it={key:3,class:`mt-1.5`},at={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`},ot={key:1,class:`text-xs text-bad`},st={key:2,class:`mt-1 text-xs text-dimmed`},ct={key:4,class:`other mt-1.5 flex flex-wrap items-baseline gap-x-3 gap-y-1 font-mono text-xs text-dimmed`},lt=[`href`,`download`],ut=0,dt=o({__name:`MessageFiles`,props:{files:{},openImages:{type:Boolean,default:!0}},setup(e){let o=e,f=l(Z,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&&$(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),ut+=1;let S=`files-${ut}`,C=b(()=>o.files.map((e,t)=>({...e,href:f?Ce(f,e.key):null,kind:$(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=ze-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 D(e){m.add(e),g.delete(e)}let O=e=>e===`out`?`↑ sent`:`↓ received`,k=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`,He,[o[0]||=d(`span`,null,`Files`,-1),d(`span`,Ue,`· `+a(e.files.length)+` file`+a(e.files.length===1?``:`s`),1)]),d(`ul`,We,[(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`,Ke,[d(`span`,{class:`dir shrink-0 select-none text-dimmed`,title:k(e.direction)},a(O(e.direction)),9,qe),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,Je)):(u(),t(`span`,Ye,a(e.name),1)),d(`span`,Xe,a(p(E)(e.size)),1),d(`span`,Ze,a(e.contentType),1),e.expired&&p(f)?(u(),t(`span`,Qe,`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`,et,[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=>D(e.key)},null,40,tt)):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=>D(e.key)},null,40,nt)):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=>D(e.key)},null,40,rt)):e.kind===`text`?(u(),t(`div`,it,[v.get(e.key)&&!v.get(e.key).error?(u(),t(`pre`,at,a(v.get(e.key).text),1)):c(``,!0),v.get(e.key)?.error?(u(),t(`p`,ot,` could not read the file: `+a(v.get(e.key).error),1)):v.get(e.key)?.truncated?(u(),t(`p`,st,` showing the first `+a(p(E)(p(ze)))+` of `+a(p(E)(e.size)),1)):c(``,!0)])):(u(),t(`div`,ct,[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(E)(e.size)),9,lt)]))],64)):c(``,!0)])],12,$e)):c(``,!0)],8,Ge))),128))])],8,Ve))}}),ft=[`id`,`open`,`title`,`data-status`,`data-heat`],pt={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`},mt={key:2,class:`dollar shrink-0 select-none text-dimmed`},ht={key:3,class:`tool shrink-0 rounded bg-accented px-1.5 text-xs leading-normal text-muted`},gt={key:0,class:`cmd brief min-w-0 flex-1 truncate text-info`},_t={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`},vt={key:5,class:`cmd min-w-0 flex-1`},yt={class:`facts ml-auto flex shrink-0 gap-2.5 text-xs tabular-nums text-muted`},bt={key:0,class:`fact elapsed`,title:`since this call started (runner clock)`},xt={key:0,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},St={key:1,class:`over rounded bg-bad/15 px-1 font-medium text-bad`},Ct={class:`body`},wt={key:1,class:`none px-3 py-1.5 text-xs italic text-dimmed`},Tt={key:2,class:`none px-3 py-1.5 text-xs italic text-dimmed`},Et=o({__name:`CallCard`,props:{call:{}},setup(e){let r=e,o=l(X,null),f=l(Pe,null),m=b(()=>{let e=o?.value;return r.call.status!==`running`||typeof e!=`number`||r.call.startedAt===void 0?``:C(Math.max(0,e-r.call.startedAt),`clock`)}),_=b(()=>k(r.call.durationMs,`tool`,r.call.timedOut)),y=b(()=>D(_.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(w)(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`,pt)):(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`,mt,`$`)):(u(),t(`span`,ht,a(e.call.tool),1)),e.call.chipOnly?(u(),t(`span`,vt)):(u(),t(h,{key:4},[e.call.open?(u(),t(`code`,_t,a(e.call.title),1)):(u(),t(`code`,gt,a(e.call.headline),1))],64)),d(`span`,yt,[m.value?(u(),t(`span`,bt,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`,xt,`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`,St,`timed out`)):c(``,!0)])],2),d(`div`,Ct,[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`,wt,`no output`)):(u(),t(`div`,Tt,`no output yet`)),e.call.files&&e.call.files.length>0?(u(),v(dt,{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,ft))}}),Dt=[`title`],Ot=[`title`],kt={class:`skillname whitespace-nowrap font-mono font-medium text-skill`},At={key:0,class:`skilldesc min-w-0 flex-1 truncate text-xs text-muted`},jt={class:`facts ml-auto flex shrink-0 gap-2.5 font-mono text-xs text-muted`},Mt=[`href`],Nt={class:`fact`},Pt=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(Et,{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(w)(e.at)},[d(`span`,null,a(e.text),1)],8,Dt)):(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(w)(e.skill.at)},[i[0]||=d(`span`,{class:`skillmark shrink-0 select-none text-xs`},`📚`,-1),d(`span`,kt,`skill `+a(e.skill.name),1),e.skill.description?(u(),t(`span`,At,a(e.skill.description),1)):c(``,!0),d(`span`,jt,[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,Mt)):c(``,!0),d(`span`,Nt,a(p(E)(e.skill.bodyBytes))+` into context`,1)])],8,Ot))],64))),128))}}),Ft=[`id`,`data-live`],It={class:`head flex items-baseline gap-x-6 pb-1.5 pr-(--sb-gutter)`},Lt={class:`min-w-0 flex-1`},Rt={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`},zt=[`data-heat`,`title`],Bt=[`title`],Vt=[`title`],Ht={key:2,class:`nonar font-sans text-sm italic text-dimmed`},Ut=[`title`],Wt={key:0,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},Gt={key:1,class:`narration flex items-baseline gap-3 pb-1.5 pr-(--sb-gutter)`},Kt={class:`nonar flex-1 font-sans text-sm italic text-dimmed`},qt={class:`calls flex flex-col gap-2`},Jt=[`open`,`data-group-open`],Yt=[`title`],Xt=[`data-ok`,`data-bad`,`data-infra`,`data-running`],Zt=[`data-heat`],Qt={class:`gbody flex flex-col gap-2 pb-1 pt-1.5`},$t=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(()=>De(x.value)),E=b(()=>_.value.some(e=>e.kind===`call`&&e.call.timedOut)),O=b(()=>k(x.value.ms,`tool`,E.value)),A=b(()=>D(O.value)),j=b(()=>l.step.turn?k(l.step.turn.durationMs,`turn`):void 0),M=b(()=>j.value?D(j.value):void 0),N=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`,It,[d(`div`,Lt,[r.step.turn?(u(),t(`div`,Rt,[d(`span`,{class:s([`thought`,[M.value?`heat`:``,j.value&&j.value.level>=2?`font-medium`:``]]),style:i(M.value),"data-heat":j.value?.level,title:r.step.turn.label},`thought `+a(r.step.turn.chip),15,zt),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(Q)(r.step.turn.model)),9,Bt)):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(Q)(r.step.turn.model)),9,Vt)):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`,Ht,a(r.step.note),1)):(u(),v(L,{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(w)(r.step.at)},a(p(T)(r.step.at)),9,Ut))]),r.step.turn&&r.step.narration!==null?(u(),t(`div`,Wt,[e(L,{text:r.step.narration},null,8,[`text`])])):r.step.turn&&r.step.narration===null&&!r.step.turn.facts.length?(u(),t(`div`,Gt,[d(`span`,Kt,a(r.step.note),1)])):c(``,!0),d(`div`,qt,[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 N.value==`number`?`calls began ${p(w)(N.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,Xt),x.value.ms>0?(u(),t(`span`,{key:0,class:s([`gtime ml-auto tabular-nums`,[A.value?`heat`:``,O.value.over?`font-medium text-bad`:O.value.level>=2?`font-medium`:``]]),style:i(A.value),"data-heat":O.value.level},[O.value.over?(u(),t(h,{key:0},[m(`timed out · `)],64)):c(``,!0),m(a(p(C)(x.value.ms,`clock`)),1)],14,Zt)):c(``,!0)],8,Yt),d(`div`,Qt,[e(Pt,{items:r.step.items},null,8,[`items`])])],8,Jt)):(u(),v(Pt,{key:0,items:r.step.items},null,8,[`items`]))])],10,Ft))}});function en(e){let t=[];for(let n of e.split(/\r?\n\r?\n/)){let e=n.split(/\r?\n/);if(e.some(e=>e.startsWith(`event:`)))continue;let r=e.filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).replace(/^ /,``)).join(`
|
|
9
|
-
`);if(r!==``)try{let e=JSON.parse(r);typeof e==`object`&&e&&typeof e.type==`string`&&t.push(e)}catch{}}return t}export{_e as C,ee as D,L as E,he as S,B as T,Oe as _,Pe as a,q as b,ke as c,Q as d,je as f,Se as g,xe as h,Z as i,Me as l,we as m,$t as n,X as o,Ne as p,dt as r,Ae as s,en as t,Le as u,Y as v,G as w,K as x,ge as y};
|