@ashlr/hub 3.4.0 → 3.5.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/CHANGELOG.md +56 -1
- package/README.md +3 -0
- package/dist/build-identity.json +2 -2
- package/dist/cli/index.js +11 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/local-runtime.js +40 -9
- package/dist/cli/local-runtime.js.map +1 -1
- package/dist/core/local-eval/classify.d.ts +57 -0
- package/dist/core/local-eval/classify.js +121 -0
- package/dist/core/local-eval/classify.js.map +1 -0
- package/dist/core/local-eval/configuration.d.ts +37 -0
- package/dist/core/local-eval/configuration.js +171 -0
- package/dist/core/local-eval/configuration.js.map +1 -0
- package/dist/core/local-eval/index.d.ts +15 -0
- package/dist/core/local-eval/index.js +16 -0
- package/dist/core/local-eval/index.js.map +1 -0
- package/dist/core/local-eval/main.d.ts +31 -0
- package/dist/core/local-eval/main.js +174 -0
- package/dist/core/local-eval/main.js.map +1 -0
- package/dist/core/local-eval/report.d.ts +25 -0
- package/dist/core/local-eval/report.js +157 -0
- package/dist/core/local-eval/report.js.map +1 -0
- package/dist/core/local-eval/runner.d.ts +55 -0
- package/dist/core/local-eval/runner.js +290 -0
- package/dist/core/local-eval/runner.js.map +1 -0
- package/dist/core/local-eval/tasks.d.ts +22 -0
- package/dist/core/local-eval/tasks.js +303 -0
- package/dist/core/local-eval/tasks.js.map +1 -0
- package/dist/core/local-eval/trace.d.ts +67 -0
- package/dist/core/local-eval/trace.js +309 -0
- package/dist/core/local-eval/trace.js.map +1 -0
- package/dist/core/local-eval/types.d.ts +262 -0
- package/dist/core/local-eval/types.js +23 -0
- package/dist/core/local-eval/types.js.map +1 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-host.d.ts +68 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-host.js +120 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-host.js.map +1 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-process.d.ts +15 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-process.js +21 -0
- package/dist/core/local-runtime/llama/anthropic-proxy-process.js.map +1 -0
- package/dist/core/local-runtime/llama/anthropic-proxy.d.ts +2 -1
- package/dist/core/local-runtime/llama/anthropic-proxy.js +14 -6
- package/dist/core/local-runtime/llama/anthropic-proxy.js.map +1 -1
- package/dist/core/local-runtime/llama/anthropic-shim.d.ts +33 -0
- package/dist/core/local-runtime/llama/anthropic-shim.js +59 -0
- package/dist/core/local-runtime/llama/anthropic-shim.js.map +1 -1
- package/dist/core/local-runtime/llama/config.d.ts +101 -6
- package/dist/core/local-runtime/llama/config.js +174 -6
- package/dist/core/local-runtime/llama/config.js.map +1 -1
- package/dist/core/local-runtime/llama/index.d.ts +15 -0
- package/dist/core/local-runtime/llama/index.js +13 -0
- package/dist/core/local-runtime/llama/index.js.map +1 -1
- package/dist/core/local-runtime/llama/paths.d.ts +17 -0
- package/dist/core/local-runtime/llama/paths.js +25 -0
- package/dist/core/local-runtime/llama/paths.js.map +1 -1
- package/dist/core/local-runtime/llama/proxy-invocation.d.ts +101 -0
- package/dist/core/local-runtime/llama/proxy-invocation.js +134 -0
- package/dist/core/local-runtime/llama/proxy-invocation.js.map +1 -0
- package/dist/core/local-runtime/llama/proxy-launchd.d.ts +83 -0
- package/dist/core/local-runtime/llama/proxy-launchd.js +216 -0
- package/dist/core/local-runtime/llama/proxy-launchd.js.map +1 -0
- package/dist/core/local-runtime/llama/shapes.d.ts +2 -1
- package/dist/core/local-runtime/llama/shapes.js +2 -1
- package/dist/core/local-runtime/llama/shapes.js.map +1 -1
- package/dist/core/verse/adapters/claude.js +16 -0
- package/dist/core/verse/adapters/claude.js.map +1 -1
- package/dist/core/verse/adapters/codex.js +60 -2
- package/dist/core/verse/adapters/codex.js.map +1 -1
- package/dist/core/verse/adapters/grok.js +13 -0
- package/dist/core/verse/adapters/grok.js.map +1 -1
- package/dist/core/verse/control-api.d.ts +8 -9
- package/dist/core/verse/control-api.js +14 -114
- package/dist/core/verse/control-api.js.map +1 -1
- package/dist/core/verse/github-api.d.ts +50 -0
- package/dist/core/verse/github-api.js +211 -0
- package/dist/core/verse/github-api.js.map +1 -0
- package/dist/core/verse/github-proposal.d.ts +64 -0
- package/dist/core/verse/github-proposal.js +186 -0
- package/dist/core/verse/github-proposal.js.map +1 -0
- package/dist/core/verse/github-repo.d.ts +104 -0
- package/dist/core/verse/github-repo.js +476 -0
- package/dist/core/verse/github-repo.js.map +1 -0
- package/dist/core/verse/github-types.d.ts +174 -0
- package/dist/core/verse/github-types.js +31 -0
- package/dist/core/verse/github-types.js.map +1 -0
- package/dist/core/verse/mcp-cli-health.d.ts +149 -0
- package/dist/core/verse/mcp-cli-health.js +227 -0
- package/dist/core/verse/mcp-cli-health.js.map +1 -0
- package/dist/core/verse/mcp-control-api.d.ts +68 -0
- package/dist/core/verse/mcp-control-api.js +322 -0
- package/dist/core/verse/mcp-control-api.js.map +1 -0
- package/dist/core/verse/mcp-mutation.d.ts +187 -0
- package/dist/core/verse/mcp-mutation.js +471 -0
- package/dist/core/verse/mcp-mutation.js.map +1 -0
- package/dist/core/verse/mcp-scope.d.ts +114 -0
- package/dist/core/verse/mcp-scope.js +149 -0
- package/dist/core/verse/mcp-scope.js.map +1 -0
- package/dist/core/verse/mcp-seat-view.d.ts +197 -0
- package/dist/core/verse/mcp-seat-view.js +322 -0
- package/dist/core/verse/mcp-seat-view.js.map +1 -0
- package/dist/core/verse/path-guard.d.ts +115 -0
- package/dist/core/verse/path-guard.js +171 -0
- package/dist/core/verse/path-guard.js.map +1 -0
- package/dist/core/verse/seats.js +30 -2
- package/dist/core/verse/seats.js.map +1 -1
- package/dist/core/verse/session-engine.js +60 -1
- package/dist/core/verse/session-engine.js.map +1 -1
- package/dist/core/verse/session-store.js +20 -0
- package/dist/core/verse/session-store.js.map +1 -1
- package/dist/core/verse/types.d.ts +225 -1
- package/dist/core/verse/types.js +26 -0
- package/dist/core/verse/types.js.map +1 -1
- package/dist/core/verse/verse-api.d.ts +16 -1
- package/dist/core/verse/verse-api.js +338 -16
- package/dist/core/verse/verse-api.js.map +1 -1
- package/dist/core/verse/workspaces.d.ts +130 -0
- package/dist/core/verse/workspaces.js +501 -0
- package/dist/core/verse/workspaces.js.map +1 -0
- package/dist/core/web/api.js +23 -0
- package/dist/core/web/api.js.map +1 -1
- package/dist/core/web/public/next/assets/{App-LuILXjWG.js → App-CsbPYQqy.js} +2 -2
- package/dist/core/web/public/next/assets/{App-LuILXjWG.js.map → App-CsbPYQqy.js.map} +1 -1
- package/dist/core/web/public/next/assets/{ApprovalsSection-B_Xor8JH.js → ApprovalsSection-CBZquyLK.js} +2 -2
- package/dist/core/web/public/next/assets/{ApprovalsSection-B_Xor8JH.js.map → ApprovalsSection-CBZquyLK.js.map} +1 -1
- package/dist/core/web/public/next/assets/AutonomySection-CQVpEdCE.js +2 -0
- package/dist/core/web/public/next/assets/{AutonomySection-BEwITtPJ.js.map → AutonomySection-CQVpEdCE.js.map} +1 -1
- package/dist/core/web/public/next/assets/AutonomySection-DTN6m6QE.css +1 -0
- package/dist/core/web/public/next/assets/ChatSection-DiRvNX3Q.css +1 -0
- package/dist/core/web/public/next/assets/ChatSection-DmE9K0Tg.js +77 -0
- package/dist/core/web/public/next/assets/ChatSection-DmE9K0Tg.js.map +1 -0
- package/dist/core/web/public/next/assets/{ConfirmDialog-BqkZdPs_.js → ConfirmDialog-deO0C0iY.js} +2 -2
- package/dist/core/web/public/next/assets/{ConfirmDialog-BqkZdPs_.js.map → ConfirmDialog-deO0C0iY.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Dialog-CPmedg4S.js → Dialog-CNd7q89m.js} +2 -2
- package/dist/core/web/public/next/assets/{Dialog-CPmedg4S.js.map → Dialog-CNd7q89m.js.map} +1 -1
- package/dist/core/web/public/next/assets/{DiffViewer-DmPJbeM_.js → DiffViewer-DTO0KRuG.js} +2 -2
- package/dist/core/web/public/next/assets/{DiffViewer-DmPJbeM_.js.map → DiffViewer-DTO0KRuG.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Epistemic-M3SxLHjq.js → Epistemic-53PikaUI.js} +2 -2
- package/dist/core/web/public/next/assets/{Epistemic-M3SxLHjq.js.map → Epistemic-53PikaUI.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Meter-D_X7c9U3.js → Meter-DRWZQgr1.js} +2 -2
- package/dist/core/web/public/next/assets/{Meter-D_X7c9U3.js.map → Meter-DRWZQgr1.js.map} +1 -1
- package/dist/core/web/public/next/assets/{MutationTokenDialog-Ba5ZHu-8.js → MutationTokenDialog-DYF8n_RD.js} +2 -2
- package/dist/core/web/public/next/assets/{MutationTokenDialog-Ba5ZHu-8.js.map → MutationTokenDialog-DYF8n_RD.js.map} +1 -1
- package/dist/core/web/public/next/assets/{RefreshIndicator-vHGpmyzb.js → RefreshIndicator-DXJQXKyA.js} +2 -2
- package/dist/core/web/public/next/assets/{RefreshIndicator-vHGpmyzb.js.map → RefreshIndicator-DXJQXKyA.js.map} +1 -1
- package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-B5g6JEVk.js → ResourcePoolConsoleApp-hDSEFdLU.js} +2 -2
- package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-B5g6JEVk.js.map → ResourcePoolConsoleApp-hDSEFdLU.js.map} +1 -1
- package/dist/core/web/public/next/assets/{RouteErrorBoundary-CroxuKoi.js → RouteErrorBoundary-CZd7ln8v.js} +2 -2
- package/dist/core/web/public/next/assets/{RouteErrorBoundary-CroxuKoi.js.map → RouteErrorBoundary-CZd7ln8v.js.map} +1 -1
- package/dist/core/web/public/next/assets/{SettingsSection-p-7FCGfn.js → SettingsSection-C9Qs9JWW.js} +2 -2
- package/dist/core/web/public/next/assets/{SettingsSection-p-7FCGfn.js.map → SettingsSection-C9Qs9JWW.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Skeleton-4qq4HuJO.js → Skeleton-YkcOpgFb.js} +2 -2
- package/dist/core/web/public/next/assets/{Skeleton-4qq4HuJO.js.map → Skeleton-YkcOpgFb.js.map} +1 -1
- package/dist/core/web/public/next/assets/{StatusBadge-BbEdqEGn.js → StatusBadge-DJw0LSPg.js} +2 -2
- package/dist/core/web/public/next/assets/{StatusBadge-BbEdqEGn.js.map → StatusBadge-DJw0LSPg.js.map} +1 -1
- package/dist/core/web/public/next/assets/{TableView-nyYs7Sv1.js → TableView-Bj-w1O6o.js} +2 -2
- package/dist/core/web/public/next/assets/{TableView-nyYs7Sv1.js.map → TableView-Bj-w1O6o.js.map} +1 -1
- package/dist/core/web/public/next/assets/{UniverseConsoleApp-DjTpQUrA.js → UniverseConsoleApp-Bs2fxaen.js} +2 -2
- package/dist/core/web/public/next/assets/{UniverseConsoleApp-DjTpQUrA.js.map → UniverseConsoleApp-Bs2fxaen.js.map} +1 -1
- package/dist/core/web/public/next/assets/{UniverseView-BtApwayT.js → UniverseView-B6b2hw-8.js} +2 -2
- package/dist/core/web/public/next/assets/{UniverseView-BtApwayT.js.map → UniverseView-B6b2hw-8.js.map} +1 -1
- package/dist/core/web/public/next/assets/{UsageSection-Db99N6ao.js → UsageSection-C__ziNkV.js} +2 -2
- package/dist/core/web/public/next/assets/{UsageSection-Db99N6ao.js.map → UsageSection-C__ziNkV.js.map} +1 -1
- package/dist/core/web/public/next/assets/{VerseConsoleApp-COa3J2dO.js → VerseConsoleApp-Cu5aG6J6.js} +3 -3
- package/dist/core/web/public/next/assets/VerseConsoleApp-Cu5aG6J6.js.map +1 -0
- package/dist/core/web/public/next/assets/{global-CNVapoV1.js → global-BHjd6fVZ.js} +2 -2
- package/dist/core/web/public/next/assets/{global-CNVapoV1.js.map → global-BHjd6fVZ.js.map} +1 -1
- package/dist/core/web/public/next/assets/index-CJ-e8YA9.js +2 -0
- package/dist/core/web/public/next/assets/index-CJ-e8YA9.js.map +1 -0
- package/dist/core/web/public/next/assets/{index-BkUlX2Se.js → index-CpgkRaTi.js} +3 -3
- package/dist/core/web/public/next/assets/{index-BkUlX2Se.js.map → index-CpgkRaTi.js.map} +1 -1
- package/dist/core/web/public/next/assets/{queries-C9XS4SYq.js → queries-856qUN3Y.js} +2 -2
- package/dist/core/web/public/next/assets/{queries-C9XS4SYq.js.map → queries-856qUN3Y.js.map} +1 -1
- package/dist/core/web/public/next/assets/{use-guarded-action-Bql1nA-z.js → use-guarded-action-DwaESKVy.js} +2 -2
- package/dist/core/web/public/next/assets/{use-guarded-action-Bql1nA-z.js.map → use-guarded-action-DwaESKVy.js.map} +1 -1
- package/dist/core/web/public/next/assets/verse-model-Dllo8rRt.js +2 -0
- package/dist/core/web/public/next/assets/{verse-model-IrNQKtER.js.map → verse-model-Dllo8rRt.js.map} +1 -1
- package/dist/core/web/public/next/assets/workspace-model-JgmWDKt4.js +2 -0
- package/dist/core/web/public/next/assets/workspace-model-JgmWDKt4.js.map +1 -0
- package/dist/core/web/public/next/index.html +1 -1
- package/dist/release-dependency-inventory.json +1 -1
- package/docs/README.md +4 -0
- package/package.json +1 -1
- package/dist/cli/activation.d.ts +0 -41
- package/dist/cli/activation.js +0 -485
- package/dist/cli/activation.js.map +0 -1
- package/dist/core/fleet/generated-repair-resolution.d.ts +0 -36
- package/dist/core/fleet/generated-repair-resolution.js +0 -245
- package/dist/core/fleet/generated-repair-resolution.js.map +0 -1
- package/dist/core/local-runtime/llama/port.d.ts +0 -17
- package/dist/core/local-runtime/llama/port.js +0 -47
- package/dist/core/local-runtime/llama/port.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-host.d.ts +0 -54
- package/dist/core/local-runtime/llama/proxy-host.js +0 -159
- package/dist/core/local-runtime/llama/proxy-host.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-process.d.ts +0 -148
- package/dist/core/local-runtime/llama/proxy-process.js +0 -250
- package/dist/core/local-runtime/llama/proxy-process.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-record.d.ts +0 -40
- package/dist/core/local-runtime/llama/proxy-record.js +0 -133
- package/dist/core/local-runtime/llama/proxy-record.js.map +0 -1
- package/dist/core/local-runtime/llama/proxy-supervisor.d.ts +0 -118
- package/dist/core/local-runtime/llama/proxy-supervisor.js +0 -511
- package/dist/core/local-runtime/llama/proxy-supervisor.js.map +0 -1
- package/dist/core/web/public/next/assets/AutonomySection-BB8RD-tv.css +0 -1
- package/dist/core/web/public/next/assets/AutonomySection-BEwITtPJ.js +0 -2
- package/dist/core/web/public/next/assets/ChatSection-DrxqhBPK.css +0 -1
- package/dist/core/web/public/next/assets/ChatSection-bRAzlMth.js +0 -77
- package/dist/core/web/public/next/assets/ChatSection-bRAzlMth.js.map +0 -1
- package/dist/core/web/public/next/assets/VerseConsoleApp-COa3J2dO.js.map +0 -1
- package/dist/core/web/public/next/assets/index-YNTgDG2b.js +0 -2
- package/dist/core/web/public/next/assets/index-YNTgDG2b.js.map +0 -1
- package/dist/core/web/public/next/assets/verse-model-IrNQKtER.js +0 -2
- package/node_modules/which/CHANGELOG.md +0 -166
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as c,j as e}from"./index-
|
|
1
|
+
import{r as c,j as e}from"./index-CpgkRaTi.js";import{f as q,k as Sn,u as Bs,i as at,r as ft,q as Cn,v as He,d as Rn,j as Os,A as Ln,D as Fs,h as Tn,S as En,l as An,m as Dn}from"./global-BHjd6fVZ.js";import{D as Jt}from"./Dialog-CNd7q89m.js";import{E as O,a as Mn,i as _t}from"./Epistemic-53PikaUI.js";import{S as U,P as In,s as Pn}from"./StatusBadge-DJw0LSPg.js";import{c as kt,f as Us,r as Ge,a as Hs,g as bt,i as Yt,d as Me,b as Gs,p as Ws,e as hs,h as Qs,j as qn,k as Bn,l as On,m as Fn,n as Un,s as Hn,o as Gn,q as Wn,v as Qn,t as Vn}from"./queries-856qUN3Y.js";import{r as zn}from"./index-CJ-e8YA9.js";import{a as Xt,r as Zt,p as Vs,b as zs,C as es}from"./ConfirmDialog-deO0C0iY.js";import{M as $t}from"./MutationTokenDialog-DYF8n_RD.js";import{u as Kn,R as Jn,T as Yn}from"./RouteErrorBoundary-CZd7ln8v.js";import{u as Ne,a as Xn}from"./UniverseView-B6b2hw-8.js";import{R as ae}from"./RefreshIndicator-DXJQXKyA.js";import{a as rt,b as te,S as K}from"./Skeleton-YkcOpgFb.js";import{S as re,f as ge,a as st,C as Le,L as Zn,T as Ie,B as Pe,b as ea,c as xt}from"./TableView-Bj-w1O6o.js";import{D as ta}from"./DiffViewer-DTO0KRuG.js";/**
|
|
2
2
|
* react-router v7.18.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
@@ -13,4 +13,4 @@ Please change the parent <Route path="${p}"> to <Route path="${p==="/"?"*":`${p}
|
|
|
13
13
|
`).length," lines)"]}),e.jsx("pre",{className:Ae.diff,children:n.diff})]}):e.jsx("p",{className:Ae.error,children:"No diff recorded for this proposal."})]}):null}function cc({drillIn:t}){return t.runId?e.jsx(yn,{runId:t.runId}):t.proposalId?e.jsx(ic,{proposalId:t.proposalId}):null}const dc="_row_194dy_1",uc="_summary_194dy_9",hc="_sourceTag_194dy_31",mc="_when_194dy_53",pc="_repo_194dy_61",fc="_title_194dy_70",_c="_expandHint_194dy_80",xc="_body_194dy_86",gc="_detailText_194dy_90",$e={row:dc,summary:uc,sourceTag:hc,when:mc,repo:pc,title:fc,expandHint:_c,body:xc,detailText:gc},jc={"daemon-tick":"Daemon",merge:"Merge","agent-action":"Agent",run:"Run",proposal:"Proposal"};function vc(t){const s=new Date(t);return`${s.toLocaleDateString(void 0,{month:"short",day:"numeric"})} ${s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`}function bc({entry:t}){const s=!!t.drillIn,[n,a]=c.useState(!1);return e.jsxs("details",{className:$e.row,"data-state-key":`journal-${t.id}`,onToggle:r=>a(r.currentTarget.open),children:[e.jsxs("summary",{className:$e.summary,"data-focus-key":`journal-${t.id}`,children:[e.jsx("span",{className:$e.sourceTag,"data-source":t.source,children:jc[t.source]}),e.jsx("span",{className:$e.when,title:t.ts,children:vc(t.ts)}),e.jsx(U,{status:t.statusLabel}),t.repo?e.jsx("span",{className:$e.repo,children:t.repo}):null,e.jsx("span",{className:$e.title,children:t.title}),e.jsx(Mn,{quality:t.sourceQuality}),s?e.jsx("span",{className:$e.expandHint,"aria-hidden":"true",children:"why? ▾"}):null]}),e.jsxs("div",{className:$e.body,children:[e.jsx("p",{className:$e.detailText,children:t.detail}),n&&t.drillIn?e.jsx(cc,{drillIn:t.drillIn}):null]})]})}const yc="_view_1omi1_1",wc="_header_1omi1_9",Nc="_title_1omi1_16",kc="_windowNote_1omi1_23",$c="_freshness_1omi1_30",Sc="_freshnessLabel_1omi1_37",Cc="_errorBanner_1omi1_42",Rc="_panel_1omi1_50",Lc="_list_1omi1_57",Tc="_empty_1omi1_63",xe={view:yc,header:wc,title:Nc,windowNote:kc,freshness:$c,freshnessLabel:Sc,errorBanner:Cc,panel:Rc,list:Lc,empty:Tc},Ec=8e3;function Ac(t){const s=Math.max(0,Math.round((Date.now()-t)/1e3));return s<5?"just now":s<60?`${s}s ago`:`${Math.round(s/60)}m ago`}function Dc(){const s=ue().state?.windowToday===!0,n=q(hs),a=q(Qs),r=q(Ge),l=q(Hs),o=Os(hs);c.useEffect(()=>{const A=setInterval(o,Ec);return()=>clearInterval(A)},[o]);const[d,i]=c.useState(new Set(Yi)),[u,h]=c.useState(""),[m,f]=c.useState(s?"today":"24h"),[j,b]=c.useState(s?wn():1440*60*1e3),_=c.useMemo(()=>Ui({logs:n.data,fleetActivity:a.data,runs:r.data,inbox:l.data}),[n.data,a.data,r.data,l.data]),p=c.useMemo(()=>Hi(_,{sources:d,query:u,windowMs:j}),[_,d,u,j]),x=c.useRef(new Map);function v(A){const C=p.find(oe=>new Date(oe.ts).getTime()<=A+36e5);C&&x.current.get(C.id)?.scrollIntoView({behavior:"smooth",block:"center"})}const w=n.status==="loading"&&a.status==="loading"&&r.status==="loading"&&l.status==="loading",L=[n,a,r,l].some(A=>A.status==="refreshing"),g=Math.max(n.updatedAt??0,a.updatedAt??0,r.updatedAt??0,l.updatedAt??0),H=[n.status==="error"?`daemon log: ${n.error?.message}`:null,a.status==="error"?`fleet activity: ${a.error?.message}`:null,r.status==="error"?`runs: ${r.error?.message}`:null,l.status==="error"?`inbox: ${l.error?.message}`:null].filter(A=>A!==null);return e.jsxs("div",{className:xe.view,children:[e.jsxs("header",{className:xe.header,children:[e.jsxs("div",{children:[e.jsx("h1",{className:xe.title,children:"Work Journal"}),e.jsx("p",{className:xe.windowNote,children:"Merges the daemon log (last 200 lines), fleet activity (last ~20 merges/ticks/agent actions), recent runs (last 200), and the pending-proposal inbox. The read API does not expose the full on-disk history beyond this window."})]}),e.jsxs("div",{className:xe.freshness,"aria-live":"polite",children:[L?e.jsx(ae,{}):null,g>0?e.jsxs("span",{className:xe.freshnessLabel,children:["Updated ",Ac(g)]}):null]})]}),H.length>0?e.jsxs("div",{className:xe.errorBanner,role:"alert",children:["Some sources failed to load: ",H.join("; ")]}):null,e.jsx(Oi,{}),w?e.jsxs("div",{className:xe.panel,children:[e.jsx(te,{}),e.jsx(te,{}),e.jsx(te,{}),e.jsx(te,{})]}):e.jsxs(e.Fragment,{children:[e.jsx(tc,{entries:_,hours:24,onScrubTo:v}),e.jsx(Ji,{sources:d,onSourcesChange:i,query:u,onQueryChange:h,windowValue:m,onWindowChange:(A,N)=>{f(A),b(N)}}),e.jsx("div",{className:xe.panel,children:p.length===0?e.jsx("p",{className:xe.empty,children:"Nothing matches the current filters in this window."}):e.jsx("ul",{className:xe.list,children:p.map(A=>e.jsx("li",{ref:N=>{N?x.current.set(A.id,N):x.current.delete(A.id)},children:e.jsx(bc,{entry:A})},A.id))})})]})]})}const Mc="_view_7836g_1",Ic="_header_7836g_7",Pc="_title_7836g_15",qc="_freshness_7836g_21",Bc="_freshnessLabel_7836g_27",Oc="_filterRow_7836g_32",Fc="_windowGroup_7836g_38",Uc="_windowButton_7836g_45",Hc="_windowButtonActive_7836g_64",Gc="_kpiGrid_7836g_70",Wc="_chartsGrid_7836g_76",Qc="_error_7836g_82",me={view:Mc,header:Ic,title:Pc,freshness:qc,freshnessLabel:Bc,filterRow:Oc,windowGroup:Fc,windowButton:Uc,windowButtonActive:Hc,kpiGrid:Gc,chartsGrid:Wc,error:Qc},Vc=["1d","7d","30d"],zc={ok:"success",warn:"warning",over:"danger"};function $s(t){const s=t.replace(/\/+$/,"").split("/");return s[s.length-1]||t}function Kc(){const[t,s]=c.useState("7d"),n=q(qn(t));return e.jsxs("div",{className:me.view,children:[e.jsxs("header",{className:me.header,children:[e.jsx("h1",{className:me.title,children:"Pulse"}),e.jsxs("div",{className:me.freshness,"aria-live":"polite",children:[n.status==="refreshing"?e.jsx(ae,{}):null,n.updatedAt?e.jsxs("span",{className:me.freshnessLabel,children:["Updated ",Yc(n.updatedAt)]}):null]})]}),e.jsxs("div",{className:me.filterRow,role:"group","aria-label":"Time window",children:[e.jsx("div",{className:me.windowGroup,children:Vc.map(a=>e.jsx("button",{type:"button",className:`${me.windowButton} ${a===t?me.windowButtonActive:""}`,"aria-pressed":a===t,onClick:()=>s(a),children:a},a))}),n.data?e.jsx(U,{status:n.data.budget.level,tone:zc[n.data.budget.level],children:n.data.budget.message}):null]}),n.status==="loading"?e.jsx(rt,{count:4}):n.status==="error"?e.jsx("div",{className:me.error,role:"alert",children:n.error?.message??"Failed to load pulse data."}):n.data?e.jsx(Jc,{rollup:n.data}):null]})}function Jc({rollup:t}){const s=[{id:"cost",label:"Est. cost (USD)",points:t.byDay.map(i=>({x:Date.parse(`${i.day}T00:00:00Z`),y:i.estCostUsd}))}],n=[...t.byProject].sort((i,u)=>u.estCostUsd-i.estCostUsd).slice(0,8),a=n.map(i=>({label:$s(i.project),value:i.estCostUsd})),r=[...t.byModel].sort((i,u)=>u.estCostUsd-i.estCostUsd).slice(0,8),l=r.map(i=>({label:i.model,value:i.estCostUsd})),o=[{key:"project",label:"Project",render:i=>$s(i.project)},{key:"sessions",label:"Sessions",numeric:!0,render:i=>String(i.sessions)},{key:"commits",label:"Commits",numeric:!0,render:i=>String(i.commits)},{key:"cost",label:"Cost",numeric:!0,render:i=>ge(i.estCostUsd)}],d=[{key:"model",label:"Model",render:i=>i.model},{key:"calls",label:"Calls",numeric:!0,render:i=>String(i.calls)},{key:"tokens",label:"Tokens",numeric:!0,render:i=>st(i.tokensIn+i.tokensOut)},{key:"cost",label:"Cost",numeric:!0,render:i=>ge(i.estCostUsd)}];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:me.kpiGrid,children:[e.jsx(re,{label:"Est. cost",value:ge(t.totals.estCostUsd),caption:t.window}),e.jsx(re,{label:"Tokens",value:st(t.totals.tokensIn+t.totals.tokensOut),caption:`${st(t.totals.tokensIn)} in / ${st(t.totals.tokensOut)} out`}),e.jsx(re,{label:"Sessions",value:String(t.totals.sessions)}),e.jsx(re,{label:"Commits",value:String(t.totals.commits)})]}),e.jsxs("div",{className:me.chartsGrid,children:[e.jsx(Le,{title:"Cost over time",description:`since ${new Date(t.since).toLocaleDateString()}`,empty:t.byDay.length===0,emptyMessage:"No activity recorded in this window.",table:e.jsx(Ie,{caption:"Daily cost",rowKey:i=>i.day,rows:t.byDay,columns:[{key:"day",label:"Day",render:i=>i.day},{key:"cost",label:"Cost",numeric:!0,render:i=>ge(i.estCostUsd)},{key:"sessions",label:"Sessions",numeric:!0,render:i=>String(i.sessions)}]}),children:e.jsx(Zn,{series:s,area:!0,ariaLabel:"Estimated cost over time",formatX:i=>new Date(i).toLocaleDateString(void 0,{month:"short",day:"numeric"}),formatY:i=>ge(i)})}),e.jsx(Le,{title:"Top projects by cost",empty:a.length===0,emptyMessage:"No project activity in this window.",table:e.jsx(Ie,{caption:"Cost by project",rowKey:i=>i.project,rows:n,columns:o}),children:e.jsx(Pe,{data:a,orientation:"horizontal",ariaLabel:"Top projects by estimated cost",formatValue:i=>ge(i)})}),e.jsx(Le,{title:"Cost by model",empty:l.length===0,emptyMessage:"No model activity in this window.",table:e.jsx(Ie,{caption:"Cost by model",rowKey:i=>i.model,rows:r,columns:d}),children:e.jsx(Pe,{data:l,ariaLabel:"Cost by model",formatValue:i=>ge(i)})})]})]})}function Yc(t){const s=Math.max(0,Math.round((Date.now()-t)/1e3));return s<5?"just now":s<60?`${s}s ago`:`${Math.round(s/60)}m ago`}const Xc="_view_44i9i_1",Zc="_header_44i9i_7",ed="_title_44i9i_15",td="_searchRow_44i9i_21",sd="_searchInput_44i9i_27",nd="_resultCount_44i9i_43",ad="_results_44i9i_48",rd="_row_44i9i_57",ld="_rowHeader_44i9i_64",od="_rowTitle_44i9i_72",id="_rowMeta_44i9i_78",cd="_badge_44i9i_87",dd="_snippet_44i9i_97",ud="_tags_44i9i_107",hd="_tag_44i9i_107",md="_skeletons_44i9i_123",pd="_empty_44i9i_129",fd="_error_44i9i_136",ee={view:Xc,header:Zc,title:ed,searchRow:td,searchInput:sd,resultCount:nd,results:ad,row:rd,rowHeader:ld,rowTitle:od,rowMeta:id,badge:cd,snippet:dd,tags:ud,tag:hd,skeletons:md,empty:pd,error:fd},_d=50,xd=300;function gd(t,s){const[n,a]=c.useState(t);return c.useEffect(()=>{const r=setTimeout(()=>a(t),s);return()=>clearTimeout(r)},[t,s]),n}function jd(t,s=220){const n=t.trim();return n.length>s?`${n.slice(0,s-1)}…`:n}function vd(t){const s=Date.parse(t);if(Number.isNaN(s))return t;const n=Math.floor((Date.now()-s)/864e5);return n<=0?"today":n===1?"yesterday":n<30?`${n}d ago`:`${Math.floor(n/30)}mo ago`}function bd(){const[t,s]=c.useState(""),n=gd(t,xd),a=q(Bn(n)),r=n.trim().length>0,l=a.data,{rows:o,totalCount:d}=c.useMemo(()=>{if(!l)return{rows:[],totalCount:0};if(r)return{rows:l,totalCount:l.length};const u=l;return{rows:[...u].sort((m,f)=>Date.parse(f.ts)-Date.parse(m.ts)).slice(0,_d),totalCount:u.length}},[l,r]),i=c.useMemo(()=>{if(!l||r)return[];const u=l,h=new Map;for(const m of u){const f=m.project??"(unscoped)";h.set(f,(h.get(f)??0)+1)}return[...h.entries()].sort((m,f)=>f[1]-m[1]).slice(0,8).map(([m,f])=>({label:m,value:f}))},[l,r]);return e.jsxs("div",{className:ee.view,children:[e.jsxs("header",{className:ee.header,children:[e.jsx("h1",{className:ee.title,children:"Genome"}),e.jsx("div",{"aria-live":"polite",children:a.status==="refreshing"?e.jsx(ae,{}):null})]}),e.jsxs("div",{className:ee.searchRow,children:[e.jsx("input",{type:"search",className:ee.searchInput,placeholder:"Search the genome (title, tags, body text)…",value:t,onChange:u=>s(u.target.value),"aria-label":"Search cross-repo knowledge"}),l?e.jsx("span",{className:ee.resultCount,children:r?`${d} match${d===1?"":"es"}`:`showing ${o.length} of ${d}`}):null]}),!r&&i.length>0?e.jsx(Le,{title:"Top projects by genome entries",description:"browse mode — all loaded entries",children:e.jsx(Pe,{data:i,orientation:"horizontal",ariaLabel:"Top projects by genome entry count",formatValue:u=>st(u)})}):null,a.status==="loading"?e.jsxs("div",{className:ee.skeletons,"aria-hidden":"true",children:[e.jsx(te,{}),e.jsx(te,{}),e.jsx(te,{}),e.jsx(te,{})]}):a.status==="error"?e.jsx("div",{className:ee.error,role:"alert",children:a.error?.message??"Failed to load genome data."}):o.length===0?e.jsx("p",{className:ee.empty,children:r?`No genome entries match "${n}".`:"No genome entries recorded yet."}):e.jsx("ul",{className:ee.results,children:o.map(u=>{const h=On(u)?u:null,m=h?h.entry:u;return e.jsxs("li",{className:ee.row,children:[e.jsxs("div",{className:ee.rowHeader,children:[e.jsx("span",{className:ee.rowTitle,children:m.title}),e.jsxs("span",{className:ee.rowMeta,children:[h?e.jsxs("span",{className:ee.badge,children:[h.method," · ",h.score.toFixed(2)]}):null,e.jsx("span",{children:vd(m.ts)})]})]}),e.jsxs("div",{className:ee.rowMeta,children:[e.jsx("span",{className:ee.badge,children:m.project??"unscoped"}),e.jsx("span",{className:ee.badge,children:m.source})]}),e.jsx("p",{className:ee.snippet,children:jd(m.text)}),m.tags.length>0?e.jsx("div",{className:ee.tags,children:m.tags.map(f=>e.jsx("span",{className:ee.tag,children:f},f))}):null]},m.id)})})]})}const yd="_view_1frm3_1",wd="_header_1frm3_7",Nd="_title_1frm3_15",kd="_filterRow_1frm3_21",$d="_windowGroup_1frm3_27",Sd="_windowButton_1frm3_34",Cd="_windowButtonActive_1frm3_53",Rd="_kpiGrid_1frm3_59",Ld="_chartsGrid_1frm3_65",Td="_section_1frm3_71",Ed="_sectionTitle_1frm3_77",Ad="_goalsList_1frm3_83",Dd="_goalRow_1frm3_92",Md="_goalObjective_1frm3_102",Id="_meterTrack_1frm3_107",Pd="_meterFill_1frm3_115",qd="_goalMeta_1frm3_121",Bd="_error_1frm3_126",Od="_notAvailable_1frm3_135",J={view:yd,header:wd,title:Nd,filterRow:kd,windowGroup:$d,windowButton:Sd,windowButtonActive:Cd,kpiGrid:Rd,chartsGrid:Ld,section:Td,sectionTitle:Ed,goalsList:Ad,goalRow:Dd,goalObjective:Md,meterTrack:Id,meterFill:Pd,goalMeta:qd,error:Bd,notAvailable:Od},Fd=["7d","30d","all"];function Ut(t){return`${t.engine}:${t.model}`}function Ud(){const[t,s]=c.useState("30d"),n=q(Me),a=q(Fn(t)),r=n.data?.production;return e.jsxs("div",{className:J.view,children:[e.jsxs("header",{className:J.header,children:[e.jsx("h1",{className:J.title,children:"Production"}),e.jsx("div",{"aria-live":"polite",children:n.status==="refreshing"||a.status==="refreshing"?e.jsx(ae,{}):null})]}),n.status==="loading"?e.jsx(rt,{count:4}):n.status==="error"?e.jsx("div",{className:J.error,role:"alert",children:n.error?.message??"Failed to load production summary."}):r?e.jsx(Hd,{production:r}):e.jsx("p",{className:J.notAvailable,children:"Production summary not available on this server (older producer, or not yet populated)."}),e.jsx("div",{className:J.filterRow,role:"group","aria-label":"Model stats window",children:e.jsx("div",{className:J.windowGroup,children:Fd.map(l=>e.jsx("button",{type:"button",className:`${J.windowButton} ${l===t?J.windowButtonActive:""}`,"aria-pressed":l===t,onClick:()=>s(l),children:l},l))})}),a.status==="loading"?e.jsx(rt,{count:3}):a.status==="error"?e.jsx("div",{className:J.error,role:"alert",children:a.error?.message??"Failed to load per-model stats."}):a.data?e.jsx(Gd,{result:a.data}):null]})}function Hd({production:t}){const s=t.judgeVerdicts24h,n=t.judgeFailures24h??{total:0,parse:0,network:0},a=[{label:"ship",value:s.ship},{label:"review",value:s.review},{label:"noise",value:s.noise},{label:"harmful",value:s.harmful}],r=t.shipsPerDayTrend.map(i=>({label:ea(i.date),value:i.count})),l=t.shipsPerDayTrend.reduce((i,u)=>i+u.count,0),o=_t(t.proposalSourceQuality),d=_t(t.judgeTraceSourceQuality);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:J.kpiGrid,children:[e.jsx(re,{label:"Proposals (24h)",value:e.jsx(O,{quality:t.proposalSourceQuality,label:"proposals",children:String(t.proposals24h.total)}),caption:e.jsx(O,{quality:t.proposalSourceQuality,label:"pending proposals",children:`${t.proposals24h.pending} pending`})}),e.jsx(re,{label:"Auto-merges today",value:e.jsx(O,{quality:t.proposalSourceQuality,label:"auto-merges",children:String(t.autoMergesToday.count)})}),e.jsx(re,{label:"Judged (24h)",value:e.jsx(O,{quality:t.judgeTraceSourceQuality,label:"judge verdicts",children:String(s.total)})}),e.jsx(re,{label:"Judge failures (24h)",value:e.jsx(O,{quality:t.judgeFailureSourceQuality,label:"judge failures",children:String(n.total)}),caption:e.jsx(O,{quality:t.judgeFailureSourceQuality,children:`${n.parse} parse · ${n.network} network`})}),e.jsx(re,{label:"Active goals",value:e.jsx(O,{quality:t.activeGoalsSourceQuality,label:"active goals",children:String(t.activeGoals.length)})})]}),e.jsxs("div",{className:J.chartsGrid,children:[e.jsxs(Le,{title:"Ships per day",description:"last 7 days",empty:o&&r.length===0,emptyMessage:"No ship history recorded yet.",table:o?e.jsx(Ie,{caption:"Ships per day",rowKey:i=>i.label,rows:r,columns:[{key:"day",label:"Day",render:i=>i.label},{key:"count",label:"Ships",numeric:!0,render:i=>String(i.value??0)}]}):void 0,children:[o?l===0?e.jsx("p",{className:J.notAvailable,children:"0 ships in the last 7 days — this is the real number, not a loading state."}):null:e.jsx(O,{quality:t.proposalSourceQuality,label:"ship history",children:"ship history"}),o?e.jsx(Pe,{data:r,ariaLabel:"Ships per day, last 7 days",formatValue:i=>String(i)}):null]}),e.jsx(Le,{title:"Judge verdict breakdown",description:"last 24h",empty:d&&s.total===0,emptyMessage:"No judge verdicts recorded in the last 24h.",children:d?e.jsx(Pe,{data:a,ariaLabel:"Judge verdict breakdown, last 24h",formatValue:i=>String(i)}):e.jsx(O,{quality:t.judgeTraceSourceQuality,label:"judge verdicts",children:"judge verdicts"})})]}),_t(t.activeGoalsSourceQuality)?t.activeGoals.length>0?e.jsxs("div",{className:J.section,children:[e.jsx("h2",{className:J.sectionTitle,children:"Active goals"}),e.jsx("ul",{className:J.goalsList,children:t.activeGoals.map(i=>{const u=i.totalMilestones>0?i.doneMilestones/i.totalMilestones:0;return e.jsxs("li",{className:J.goalRow,children:[e.jsx("span",{className:J.goalObjective,children:i.objective}),e.jsx("div",{className:J.meterTrack,children:e.jsx("div",{className:J.meterFill,style:{width:`${Math.round(u*100)}%`}})}),e.jsxs("span",{className:J.goalMeta,children:[i.doneMilestones," / ",i.totalMilestones," milestones"]})]},i.goalId)})})]}):null:e.jsxs("div",{className:J.section,children:[e.jsx("h2",{className:J.sectionTitle,children:"Active goals"}),e.jsx(O,{quality:t.activeGoalsSourceQuality,label:"active goals",children:"active goals"})]})]})}function Gd({result:t}){const s=[...t.models].sort((r,l)=>l.dispatches-r.dispatches).slice(0,12),n=s.map(r=>({label:Ut(r),value:r.judged>0?r.shipRate:null})),a=[{key:"model",label:"Model",render:r=>Ut(r)},{key:"dispatches",label:"Dispatches",numeric:!0,render:r=>String(r.dispatches)},{key:"shipRate",label:"Ship rate",numeric:!0,render:r=>r.judged>0?xt(r.shipRate):"—"},{key:"merged",label:"Merged",numeric:!0,render:r=>String(r.merged)},{key:"costPerMerged",label:"Cost / merge",numeric:!0,render:r=>r.costPerMergedUsd!==null?ge(r.costPerMergedUsd):"—"},{key:"bestOfN",label:"Best-of-N win rate",numeric:!0,render:r=>r.bestOfNAvailable?e.jsx(O,{quality:t.bestOfNSource,label:"best-of-N win rate",children:xt(r.bestOfN.winRate)}):"—"}];return e.jsx("div",{className:J.chartsGrid,children:e.jsx(Le,{title:"Ship rate by model",description:"judged proposals in the selected window",empty:s.length===0,emptyMessage:"No dispatch history for this window.",table:e.jsx(Ie,{caption:"Per-model economics",rowKey:Ut,rows:s,columns:a}),children:e.jsx(Pe,{data:n,ariaLabel:"Ship rate by model",formatValue:r=>xt(r)})})})}const Wd="_view_ruego_1",Qd="_header_ruego_7",Vd="_title_ruego_15",zd="_freshness_ruego_21",Kd="_freshnessLabel_ruego_27",Jd="_kpiGrid_ruego_32",Yd="_chartsGrid_ruego_38",Xd="_section_ruego_44",Zd="_sectionTitle_ruego_50",eu="_list_ruego_56",tu="_row_ruego_65",su="_rowTitle_ruego_75",nu="_meterTrack_ruego_84",au="_meterFill_ruego_92",ru="_rowMeta_ruego_98",lu="_effectiveness_ruego_103",ou="_effectivenessHeadline_ruego_110",iu="_error_ruego_116",cu="_notAvailable_ruego_125",z={view:Wd,header:Qd,title:Vd,freshness:zd,freshnessLabel:Kd,kpiGrid:Jd,chartsGrid:Yd,section:Xd,sectionTitle:Zd,list:eu,row:tu,rowTitle:su,meterTrack:nu,meterFill:au,rowMeta:ru,effectiveness:lu,effectivenessHeadline:ou,error:iu,notAvailable:cu};function du(t){const s=Math.max(0,Math.round((Date.now()-t)/1e3));return s<5?"just now":s<60?`${s}s ago`:`${Math.round(s/60)}m ago`}function uu(){const t=q(Un),s=q(Me);return e.jsxs("div",{className:z.view,children:[e.jsxs("header",{className:z.header,children:[e.jsx("h1",{className:z.title,children:"Portfolio"}),e.jsxs("div",{className:z.freshness,"aria-live":"polite",children:[t.status==="refreshing"||s.status==="refreshing"?e.jsx(ae,{}):null,t.updatedAt?e.jsxs("span",{className:z.freshnessLabel,children:["Updated ",du(t.updatedAt)]}):null]})]}),t.status==="loading"?e.jsx(rt,{count:6}):t.status==="error"?e.jsx("div",{className:z.error,role:"alert",children:t.error?.message??"Failed to load portfolio."}):t.data===null?e.jsx("p",{className:z.notAvailable,children:"No portfolio roll-up available — either this server has no enrolled repos, or it predates the portfolio feature."}):t.data?e.jsx(hu,{portfolio:t.data}):null]})}function hu({portfolio:t}){const{health:s,goalsInFlight:n,backlogTop:a,cost:r,effectiveness:l,today:o}=t,d=s.worstRepos.map(u=>({label:u.repo.split("/").filter(Boolean).pop()??u.repo,value:u.score})),i=[{key:"title",label:"Item",render:u=>u.title},{key:"repo",label:"Repo",render:u=>u.repo??"—"},{key:"score",label:"Score",numeric:!0,render:u=>u.score.toFixed(1)}];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:z.kpiGrid,children:[e.jsx(re,{label:"Portfolio health",value:`${s.averageScore.toFixed(0)} (${s.averageGrade})`,caption:`${s.reposScored} repos scored`,delta:o.healthScoreDelta!==null?{value:o.healthScoreDelta,goodWhenPositive:!0}:null}),e.jsx(re,{label:"Goals in flight",value:String(n.length)}),e.jsx(re,{label:"Backlog top items",value:String(a.length),delta:o.pendingProposalsDelta!==null?{value:o.pendingProposalsDelta,versus:"pending proposals"}:null}),e.jsx(re,{label:"Spend",value:ge(r.spentUsd),caption:`${r.window} window`,delta:o.spendUsdDelta!==null?{value:o.spendUsdDelta,goodWhenPositive:!1}:null}),e.jsx(re,{label:"Local savings",value:ge(r.localSavingsUsd)}),e.jsx(re,{label:"Projected monthly",value:ge(r.projectedMonthlyUsd)})]}),l?e.jsxs("div",{className:z.effectiveness,children:[e.jsx("p",{className:z.effectivenessHeadline,children:l.headline}),e.jsxs("span",{className:z.rowMeta,children:["Success rate ",xt(l.successRate),l.effectivenessDeltaPct!==null?` (${l.effectivenessDeltaPct>=0?"+":""}${l.effectivenessDeltaPct.toFixed(1)}pp)`:""]})]}):null,e.jsxs("div",{className:z.chartsGrid,children:[e.jsx(Le,{title:"Worst-scoring repos",empty:d.length===0,emptyMessage:"No enrolled repos scored yet.",table:e.jsx(Ie,{caption:"Worst-scoring repos",rowKey:u=>u.repo,rows:s.worstRepos,columns:[{key:"repo",label:"Repo",render:u=>u.repo},{key:"score",label:"Score",numeric:!0,render:u=>u.score.toFixed(0)},{key:"grade",label:"Grade",render:u=>u.grade}]}),children:e.jsx(Pe,{data:d,orientation:"horizontal",ariaLabel:"Worst-scoring repos by health score",formatValue:u=>u.toFixed(0)})}),e.jsxs("div",{className:z.section,children:[e.jsx("h2",{className:z.sectionTitle,children:"In-flight goals"}),n.length===0?e.jsx("p",{className:z.notAvailable,children:"No goals currently in flight."}):e.jsx("ul",{className:z.list,children:n.map(u=>e.jsxs("li",{className:z.row,children:[e.jsxs("span",{className:z.rowTitle,children:[u.objective,e.jsxs("span",{className:z.rowMeta,children:[Math.round(u.fractionDone*100),"%"]})]}),e.jsx("div",{className:z.meterTrack,children:e.jsx("div",{className:z.meterFill,style:{width:`${Math.round(u.fractionDone*100)}%`}})}),e.jsx("span",{className:z.rowMeta,children:u.nextActionable?`Next: ${u.nextActionable}`:"Nothing actionable queued"})]},u.goalId))})]})]}),e.jsxs("div",{className:z.section,children:[e.jsx("h2",{className:z.sectionTitle,children:"Top backlog"}),a.length===0?e.jsx("p",{className:z.notAvailable,children:"Backlog is empty."}):e.jsx(Ie,{caption:"Top backlog items",rowKey:u=>u.title,rows:a,columns:i})]})]})}const mu="_view_1eb19_1",pu="_header_1eb19_8",fu="_title_1eb19_16",_u="_freshness_1eb19_22",xu="_count_1eb19_28",gu="_filters_1eb19_34",ju="_field_1eb19_45",vu="_fieldLabel_1eb19_51",bu="_input_1eb19_56",yu="_select_1eb19_57",wu="_clear_1eb19_74",Nu="_tableWrap_1eb19_87",ku="_table_1eb19_87",$u="_statusCol_1eb19_101",Su="_engineCol_1eb19_104",Cu="_providerCol_1eb19_107",Ru="_tokensCol_1eb19_110",Lu="_costCol_1eb19_113",Tu="_stepsCol_1eb19_116",Eu="_createdCol_1eb19_119",Au="_row_1eb19_143",Du="_sortHeader_1eb19_151",Mu="_goalLink_1eb19_168",Iu="_numeric_1eb19_180",Pu="_date_1eb19_186",qu="_empty_1eb19_192",Bu="_error_1eb19_199",$={view:mu,header:pu,title:fu,freshness:_u,count:xu,filters:gu,field:ju,fieldLabel:vu,input:bu,select:yu,clear:wu,tableWrap:Nu,table:ku,statusCol:$u,engineCol:Su,providerCol:Cu,tokensCol:Ru,costCol:Lu,stepsCol:Tu,createdCol:Eu,row:Au,sortHeader:Du,goalLink:Mu,numeric:Iu,date:Pu,empty:qu,error:Bu};function Ss(t){return t.usage.tokensIn+t.usage.tokensOut}function Ou(t,s){if(!s)return!0;const n=s.toLowerCase();return t.id.toLowerCase().includes(n)||t.goal.toLowerCase().includes(n)}function Fu(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Uu(){const t=c.useRef(null);Ne("/work/runs",t);const s=dt(),n=q(Ge),[a,r]=c.useState(0),l=c.useRef(new Map),[o,d]=c.useState(""),[i,u]=c.useState("all"),[h,m]=c.useState("all"),[f,j]=c.useState("all"),[b,_]=c.useState(""),[p,x]=c.useState("createdAt"),[v,w]=c.useState("desc"),L=c.useMemo(()=>n.data??[],[n.data]),{statuses:g,engines:H,providers:A}=c.useMemo(()=>{const y=new Set,P=new Set,G=new Set;for(const le of L)y.add(le.status),P.add(le.engine),G.add(le.provider);return{statuses:Array.from(y).sort(),engines:Array.from(P).sort(),providers:Array.from(G).sort()}},[L]),N=b?new Date(b).getTime():null,C=c.useMemo(()=>{let y=L.filter(P=>{if(i!=="all"&&P.status!==i||h!=="all"&&P.engine!==h||f!=="all"&&P.provider!==f)return!1;if(N!==null){const G=new Date(P.createdAt).getTime();if(Number.isNaN(G)||G<N)return!1}return!!Ou(P,o.trim())});return y=[...y].sort((P,G)=>{let le=0;switch(p){case"createdAt":le=P.createdAt.localeCompare(G.createdAt);break;case"updatedAt":le=P.updatedAt.localeCompare(G.updatedAt);break;case"tokens":le=Ss(P)-Ss(G);break;case"estCostUsd":le=P.usage.estCostUsd-G.usage.estCostUsd;break;case"steps":le=P.steps.length-G.steps.length;break;case"status":le=P.status.localeCompare(G.status);break}return v==="asc"?le:-le}),y},[L,i,h,f,N,o,p,v]);c.useEffect(()=>{r(y=>Math.min(y,Math.max(C.length-1,0)))},[C.length]);function oe(y){if(C.length!==0){if(y.key==="ArrowDown"){y.preventDefault();const P=Math.min(a+1,C.length-1);r(P),l.current.get(C[P].id)?.focus()}else if(y.key==="ArrowUp"){y.preventDefault();const P=Math.max(a-1,0);r(P),l.current.get(C[P].id)?.focus()}else if(y.key==="Enter"){const P=C[a];P&&s(`/work/runs/${P.id}`)}}}function ne(y){y===p?w(P=>P==="asc"?"desc":"asc"):(x(y),w("desc"))}function se(y){return y!==p?"":v==="asc"?" ↑":" ↓"}return e.jsxs("div",{ref:t,className:$.view,children:[e.jsxs("header",{className:$.header,children:[e.jsx("h1",{className:$.title,children:"Runs"}),e.jsxs("div",{className:$.freshness,"aria-live":"polite",children:[n.status==="refreshing"?e.jsx(ae,{}):null,e.jsxs("span",{className:$.count,children:[C.length," of ",L.length," runs (server caps at 200 most recent)"]})]})]}),e.jsxs("form",{className:$.filters,role:"search","aria-label":"Filter runs",onSubmit:y=>y.preventDefault(),children:[e.jsxs("label",{className:$.field,children:[e.jsx("span",{className:$.fieldLabel,children:"Search"}),e.jsx("input",{type:"text",className:$.input,placeholder:"goal or run id (e.g. repo/project name)",value:o,onChange:y=>d(y.target.value)})]}),e.jsxs("label",{className:$.field,children:[e.jsx("span",{className:$.fieldLabel,children:"Status"}),e.jsxs("select",{className:$.select,value:i,onChange:y=>u(y.target.value),children:[e.jsx("option",{value:"all",children:"All"}),g.map(y=>e.jsx("option",{value:y,children:y},y))]})]}),e.jsxs("label",{className:$.field,children:[e.jsx("span",{className:$.fieldLabel,children:"Engine"}),e.jsxs("select",{className:$.select,value:h,onChange:y=>m(y.target.value),children:[e.jsx("option",{value:"all",children:"All"}),H.map(y=>e.jsx("option",{value:y,children:y},y))]})]}),e.jsxs("label",{className:$.field,children:[e.jsx("span",{className:$.fieldLabel,children:"Provider"}),e.jsxs("select",{className:$.select,value:f,onChange:y=>j(y.target.value),children:[e.jsx("option",{value:"all",children:"All"}),A.map(y=>e.jsx("option",{value:y,children:y},y))]})]}),e.jsxs("label",{className:$.field,children:[e.jsx("span",{className:$.fieldLabel,children:"Since"}),e.jsx("input",{type:"date",className:$.input,value:b,onChange:y=>_(y.target.value)})]}),(i!=="all"||h!=="all"||f!=="all"||b||o)&&e.jsx("button",{type:"button",className:$.clear,onClick:()=>{d(""),u("all"),m("all"),j("all"),_("")},children:"Clear filters"})]}),n.status==="loading"?e.jsxs("div",{className:$.tableWrap,children:[e.jsx(te,{}),e.jsx(te,{}),e.jsx(te,{})]}):n.status==="error"?e.jsx("div",{className:$.error,role:"alert",children:n.error?.message??"Failed to load runs."}):C.length===0?e.jsx("p",{className:$.empty,children:"No runs match the current filters."}):e.jsx("div",{className:$.tableWrap,children:e.jsxs("table",{className:$.table,onKeyDown:oe,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Goal"}),e.jsx("th",{scope:"col",className:$.statusCol,children:e.jsxs("button",{type:"button",className:$.sortHeader,onClick:()=>ne("status"),children:["Status",se("status")]})}),e.jsx("th",{scope:"col",className:$.engineCol,children:"Engine"}),e.jsx("th",{scope:"col",className:$.providerCol,children:"Provider"}),e.jsx("th",{scope:"col",className:$.tokensCol,children:e.jsxs("button",{type:"button",className:$.sortHeader,onClick:()=>ne("tokens"),children:["Tokens in/out",se("tokens")]})}),e.jsx("th",{scope:"col",className:$.costCol,children:e.jsxs("button",{type:"button",className:$.sortHeader,onClick:()=>ne("estCostUsd"),children:["Est cost",se("estCostUsd")]})}),e.jsx("th",{scope:"col",className:$.stepsCol,children:e.jsxs("button",{type:"button",className:$.sortHeader,onClick:()=>ne("steps"),children:["Steps",se("steps")]})}),e.jsx("th",{scope:"col",className:$.createdCol,children:e.jsxs("button",{type:"button",className:$.sortHeader,onClick:()=>ne("createdAt"),children:["Created",se("createdAt")]})})]})}),e.jsx("tbody",{children:C.map((y,P)=>e.jsxs("tr",{ref:G=>{G?l.current.set(y.id,G):l.current.delete(y.id)},tabIndex:P===a?0:-1,onFocus:()=>r(P),"aria-current":P===a?"true":void 0,className:$.row,children:[e.jsx("td",{children:e.jsx(ht,{to:`/work/runs/${y.id}`,"data-focus-key":`run-${y.id}`,className:$.goalLink,title:y.goal,tabIndex:-1,children:y.goal})}),e.jsx("td",{children:e.jsx(U,{status:y.status})}),e.jsx("td",{children:y.engine}),e.jsx("td",{children:y.provider}),e.jsxs("td",{className:$.numeric,children:[y.usage.tokensIn.toLocaleString()," / ",y.usage.tokensOut.toLocaleString()]}),e.jsxs("td",{className:$.numeric,children:["$",y.usage.estCostUsd.toFixed(4)]}),e.jsx("td",{className:$.numeric,children:y.steps.length}),e.jsx("td",{className:$.date,children:Fu(y.createdAt)})]},y.id))})]})})]})}const Hu="_view_16nop_1",Gu="_header_16nop_8",Wu="_eyebrow_16nop_16",Qu="_title_16nop_22",Vu="_freshness_16nop_29",zu="_metaGrid_16nop_35",Ku="_numeric_16nop_55",Ju="_section_16nop_59",Yu="_sectionTitle_16nop_65",Xu="_resultText_16nop_70",Zu="_taskList_16nop_79",eh="_taskItem_16nop_85",th="_taskHeader_16nop_98",sh="_taskId_16nop_105",nh="_taskGoal_16nop_111",ah="_taskDeps_16nop_116",rh="_depLink_16nop_122",lh="_depMissing_16nop_127",oh="_taskError_16nop_132",ih="_taskUsage_16nop_141",ch="_stepList_16nop_148",dh="_stepItem_16nop_155",uh="_stepTs_16nop_164",hh="_stepKind_16nop_170",mh="_stepTask_16nop_176",ph="_stepSummary_16nop_180",fh="_empty_16nop_185",_h="_error_16nop_190",R={view:Hu,header:Gu,eyebrow:Wu,title:Qu,freshness:Vu,metaGrid:zu,numeric:Ku,section:Ju,sectionTitle:Yu,resultText:Xu,taskList:Zu,taskItem:eh,taskHeader:th,taskId:sh,taskGoal:nh,taskDeps:ah,depLink:rh,depMissing:lh,taskError:oh,taskUsage:ih,stepList:ch,stepItem:dh,stepTs:uh,stepKind:hh,stepTask:mh,stepSummary:ph,empty:fh,error:_h};function Ht(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString()}function Gt(t){return`task-${encodeURIComponent(t)}`}function xh(){const{id:t}=as(),s=c.useRef(null);Ne(`/work/runs/${t??""}`,s);const n=q(Gs(t??""));if(!t)return e.jsx("div",{className:R.view,children:e.jsx("p",{className:R.error,role:"alert",children:"No run id in URL."})});if(n.status==="loading")return e.jsxs("div",{ref:s,className:R.view,children:[e.jsx(K,{width:"60%"}),e.jsx(K,{width:"30%"}),e.jsx(K,{width:"80%"})]});if(n.status==="error"||!n.data)return e.jsx("div",{ref:s,className:R.view,children:e.jsx("p",{className:R.error,role:"alert",children:n.error?.message??`Run ${t} not found.`})});const a=n.data,r=new Map(a.tasks.map(l=>[l.id,l]));return e.jsxs("div",{ref:s,className:R.view,children:[e.jsxs("header",{className:R.header,children:[e.jsxs("div",{children:[e.jsxs("p",{className:R.eyebrow,children:["Run ",a.id]}),e.jsx("h1",{className:R.title,children:a.goal})]}),e.jsxs("div",{className:R.freshness,"aria-live":"polite",children:[n.status==="refreshing"?e.jsx(ae,{}):null,e.jsx(U,{status:a.status})]})]}),e.jsxs("dl",{className:R.metaGrid,children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Engine"}),e.jsx("dd",{children:a.engine})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Provider"}),e.jsx("dd",{children:a.provider})]}),a.engineModel?e.jsxs("div",{children:[e.jsx("dt",{children:"Model"}),e.jsx("dd",{children:a.engineModel})]}):null,e.jsxs("div",{children:[e.jsx("dt",{children:"Tokens in / out"}),e.jsxs("dd",{className:R.numeric,children:[a.usage.tokensIn.toLocaleString()," / ",a.usage.tokensOut.toLocaleString()]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Est cost"}),e.jsxs("dd",{className:R.numeric,children:["$",a.usage.estCostUsd.toFixed(4)]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Steps"}),e.jsx("dd",{className:R.numeric,children:a.usage.steps})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Budget (tokens / steps)"}),e.jsxs("dd",{className:R.numeric,children:[a.budget.maxTokens.toLocaleString()," / ",a.budget.maxSteps]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Created"}),e.jsx("dd",{children:Ht(a.createdAt)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Updated"}),e.jsx("dd",{children:Ht(a.updatedAt)})]}),a.terminationReason?e.jsxs("div",{children:[e.jsx("dt",{children:"Termination reason"}),e.jsx("dd",{children:a.terminationReason})]}):null]}),a.result?e.jsxs("section",{className:R.section,children:[e.jsx("h2",{className:R.sectionTitle,children:"Result"}),e.jsx("p",{className:R.resultText,children:a.result})]}):null,e.jsxs("section",{className:R.section,children:[e.jsxs("h2",{className:R.sectionTitle,children:["Tasks (",a.tasks.length,")"]}),a.tasks.length===0?e.jsx("p",{className:R.empty,children:"No tasks recorded."}):e.jsx("ul",{className:R.taskList,children:a.tasks.map(l=>e.jsxs("li",{id:Gt(l.id),className:R.taskItem,tabIndex:-1,children:[e.jsxs("div",{className:R.taskHeader,children:[e.jsx("span",{className:R.taskId,children:l.id}),e.jsx(U,{status:l.status})]}),e.jsx("p",{className:R.taskGoal,children:l.goal}),l.deps.length>0?e.jsxs("p",{className:R.taskDeps,children:["depends on:"," ",l.deps.map((o,d)=>e.jsxs("span",{children:[d>0?", ":"",r.has(o)?e.jsx("a",{href:`#${Gt(o)}`,className:R.depLink,children:o}):e.jsxs("span",{className:R.depMissing,children:[o," (unresolved)"]})]},o))]}):null,l.error?e.jsx("p",{className:R.taskError,role:"alert",children:l.error}):null,l.usage?e.jsxs("p",{className:R.taskUsage,children:[l.usage.tokensIn.toLocaleString()," / ",l.usage.tokensOut.toLocaleString()," tokens · $",l.usage.estCostUsd.toFixed(4)]}):null]},l.id))})]}),e.jsxs("section",{className:R.section,children:[e.jsxs("h2",{className:R.sectionTitle,children:["Step log (",a.steps.length,")"]}),a.steps.length===0?e.jsx("p",{className:R.empty,children:"No steps recorded."}):e.jsx("ol",{className:R.stepList,children:a.steps.map((l,o)=>e.jsxs("li",{className:R.stepItem,children:[e.jsx("span",{className:R.stepTs,children:Ht(l.ts)}),e.jsx("span",{className:R.stepKind,children:l.kind}),e.jsx("span",{className:R.stepTask,children:l.taskId?e.jsx("a",{href:`#${Gt(l.taskId)}`,className:R.depLink,children:l.taskId}):null}),e.jsx("span",{className:R.stepSummary,children:l.summary})]},`${l.ts}-${o}`))})]})]})}const gh="_view_1kj6a_1",jh="_header_1kj6a_8",vh="_title_1kj6a_16",bh="_freshness_1kj6a_22",yh="_count_1kj6a_28",wh="_filters_1kj6a_34",Nh="_field_1kj6a_45",kh="_fieldLabel_1kj6a_51",$h="_input_1kj6a_56",Sh="_select_1kj6a_57",Ch="_listWrap_1kj6a_73",Rh="_listHeader_1kj6a_80",Lh="_sortHeader_1kj6a_90",Th="_list_1kj6a_73",Eh="_item_1kj6a_112",Ah="_goalLink_1kj6a_124",Dh="_goalText_1kj6a_140",Mh="_burndown_1kj6a_150",Ih="_burndownTrack_1kj6a_156",Ph="_burndownFill_1kj6a_164",qh="_burndownLabel_1kj6a_170",Bh="_numeric_1kj6a_177",Oh="_date_1kj6a_184",Fh="_empty_1kj6a_191",Uh="_error_1kj6a_198",B={view:gh,header:jh,title:vh,freshness:bh,count:yh,filters:wh,field:Nh,fieldLabel:kh,input:$h,select:Sh,listWrap:Ch,listHeader:Rh,sortHeader:Lh,list:Th,item:Eh,goalLink:Ah,goalText:Dh,burndown:Mh,burndownTrack:Ih,burndownFill:Ph,burndownLabel:qh,numeric:Bh,date:Oh,empty:Fh,error:Uh};function Wt(t){return t.tasks.filter(s=>s.status==="done").length}function Xe(t){return Math.max(t.plan?.tasks.length??0,t.tasks.length)}function vt(t){return t.usage??{tokensIn:0,tokensOut:0,estCostUsd:0}}function Cs(t){const s=vt(t);return s.tokensIn+s.tokensOut}function Hh(t){const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Gh(){const t=c.useRef(null);Ne("/work/swarms",t);const s=q(Hn),n=c.useMemo(()=>s.data??[],[s.data]),[a,r]=c.useState(""),[l,o]=c.useState("all"),[d,i]=c.useState("createdAt"),[u,h]=c.useState("desc"),m=c.useMemo(()=>Array.from(new Set(n.map(_=>_.status))).sort(),[n]),f=c.useMemo(()=>{let _=n.filter(p=>{if(l!=="all"&&p.status!==l)return!1;if(!a.trim())return!0;const x=a.trim().toLowerCase();return p.id.toLowerCase().includes(x)||p.goal.toLowerCase().includes(x)});return _=[..._].sort((p,x)=>{let v=0;switch(d){case"createdAt":v=p.createdAt.localeCompare(x.createdAt);break;case"updatedAt":v=p.updatedAt.localeCompare(x.updatedAt);break;case"progress":{const w=Xe(p)>0?Wt(p)/Xe(p):0,L=Xe(x)>0?Wt(x)/Xe(x):0;v=w-L;break}case"tokens":v=Cs(p)-Cs(x);break;case"estCostUsd":v=vt(p).estCostUsd-vt(x).estCostUsd;break}return u==="asc"?v:-v}),_},[n,l,a,d,u]);function j(_){_===d?h(p=>p==="asc"?"desc":"asc"):(i(_),h("desc"))}function b(_){return _!==d?"":u==="asc"?" ↑":" ↓"}return e.jsxs("div",{ref:t,className:B.view,children:[e.jsxs("header",{className:B.header,children:[e.jsx("h1",{className:B.title,children:"Swarms"}),e.jsxs("div",{className:B.freshness,"aria-live":"polite",children:[s.status==="refreshing"?e.jsx(ae,{}):null,e.jsxs("span",{className:B.count,children:[f.length," of ",n.length," swarms"]})]})]}),e.jsxs("form",{className:B.filters,role:"search","aria-label":"Filter swarms",onSubmit:_=>_.preventDefault(),children:[e.jsxs("label",{className:B.field,children:[e.jsx("span",{className:B.fieldLabel,children:"Search"}),e.jsx("input",{type:"text",className:B.input,placeholder:"goal or swarm id",value:a,onChange:_=>r(_.target.value)})]}),e.jsxs("label",{className:B.field,children:[e.jsx("span",{className:B.fieldLabel,children:"Status"}),e.jsxs("select",{className:B.select,value:l,onChange:_=>o(_.target.value),children:[e.jsx("option",{value:"all",children:"All"}),m.map(_=>e.jsx("option",{value:_,children:_},_))]})]})]}),s.status==="loading"?e.jsxs("div",{className:B.listWrap,children:[e.jsx(te,{}),e.jsx(te,{}),e.jsx(te,{})]}):s.status==="error"?e.jsx("div",{className:B.error,role:"alert",children:s.error?.message??"Failed to load swarms."}):f.length===0?e.jsx("p",{className:B.empty,children:"No swarms match the current filters."}):e.jsxs("div",{className:B.listWrap,children:[e.jsxs("div",{className:B.listHeader,children:[e.jsx("span",{children:"Goal"}),e.jsxs("button",{type:"button",className:B.sortHeader,onClick:()=>j("progress"),children:["Progress",b("progress")]}),e.jsxs("button",{type:"button",className:B.sortHeader,onClick:()=>j("tokens"),children:["Tokens",b("tokens")]}),e.jsxs("button",{type:"button",className:B.sortHeader,onClick:()=>j("estCostUsd"),children:["Cost",b("estCostUsd")]}),e.jsxs("button",{type:"button",className:B.sortHeader,onClick:()=>j("createdAt"),children:["Created",b("createdAt")]})]}),e.jsx("ul",{className:B.list,children:f.map(_=>{const p=Wt(_),x=Xe(_),v=x>0?Math.round(p/x*100):0,w=vt(_);return e.jsxs("li",{className:B.item,children:[e.jsxs(ht,{to:`/work/swarms/${_.id}`,"data-focus-key":`swarm-${_.id}`,className:B.goalLink,title:_.goal,children:[e.jsx("span",{className:B.goalText,children:_.goal}),e.jsx(U,{status:_.status})]}),e.jsxs("div",{className:B.burndown,children:[e.jsx("div",{className:B.burndownTrack,children:e.jsx("div",{className:B.burndownFill,style:{width:`${v}%`}})}),e.jsxs("span",{className:B.burndownLabel,children:[p,"/",x]})]}),e.jsxs("span",{className:B.numeric,children:[w.tokensIn.toLocaleString(),"/",w.tokensOut.toLocaleString()]}),e.jsxs("span",{className:B.numeric,children:["$",w.estCostUsd.toFixed(4)]}),e.jsx("span",{className:B.date,children:Hh(_.createdAt)})]},_.id)})})]})]})}const Wh="_svg_2w2xr_1",Qh="_phaseLabel_2w2xr_7",Vh="_edge_2w2xr_14",zh="_arrowHead_2w2xr_19",Kh="_nodeLink_2w2xr_23",Jh="_nodeRect_2w2xr_26",Yh="_nodeId_2w2xr_31",Xh="_nodeGoal_2w2xr_37",Zh="_neutral_2w2xr_45",em="_statusDot_2w2xr_49",tm="_info_2w2xr_53",sm="_running_2w2xr_61",nm="_success_2w2xr_69",am="_warning_2w2xr_77",rm="_danger_2w2xr_85",lm="_unknown_2w2xr_93",om="_empty_2w2xr_105",he={svg:Wh,phaseLabel:Qh,edge:Vh,arrowHead:zh,nodeLink:Kh,nodeRect:Jh,nodeId:Yh,nodeGoal:Xh,neutral:Zh,statusDot:em,info:tm,running:sm,success:nm,warning:am,danger:rm,unknown:lm,empty:om},Rs={scaffold:0,build:1,integrate:2,verify:3,review:4};function im(t,s){const n=new Map;for(const a of t?.tasks??[])n.set(a.id,{id:a.id,phase:a.phase,goal:a.goal,deps:a.deps,status:"pending"});for(const a of s){const r=n.get(a.id);n.set(a.id,{id:a.id,phase:a.phase||r?.phase||"build",goal:r?.goal??"",deps:r?.deps??[],status:a.status})}return Array.from(n.values())}function Ls(t,s){return t.length>s?`${t.slice(0,s-1)}…`:t}const Ze=140,et=48,cm=60,dm=20,tt=20;function um({tasks:t,taskAnchorPrefix:s="dag-task"}){if(t.length===0)return e.jsx("p",{className:he.empty,children:"No tasks in this swarm."});const n=new Map;for(const h of t){const m=h.phase||"build",f=n.get(m)??[];f.push(h),n.set(m,f)}const a=Array.from(n.keys()).sort((h,m)=>(Rs[h]??99)-(Rs[m]??99)),r=new Map;let l=tt;for(const h of a)r.set(h,l),l+=Ze+cm;const o=l+tt,d=new Map;for(const h of a){let m=tt;for(const f of n.get(h)){const j=r.get(h);d.set(f.id,{x:j,y:m,cx:j+Ze/2,cy:m+et/2}),m+=et+dm}}const i=Math.max(...Array.from(d.values()).map(h=>h.y+et))+tt*2,u=[];for(const h of t){const m=d.get(h.id);if(m)for(const f of h.deps){const j=d.get(f);if(!j)continue;const b=j.x+Ze,_=j.cy,p=m.x,x=m.cy,v=(b+p)/2;u.push({key:`${f}->${h.id}`,d:`M ${b} ${_} C ${v} ${_}, ${v} ${x}, ${p} ${x}`})}}return e.jsxs("svg",{width:o,height:i,viewBox:`0 0 ${o} ${i}`,className:he.svg,role:"img","aria-label":"Swarm task dependency graph",children:[e.jsx("defs",{children:e.jsx("marker",{id:"dag-arrow",markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:e.jsx("path",{d:"M0,0 L0,6 L8,3 z",className:he.arrowHead})})}),a.map(h=>e.jsx("text",{x:r.get(h)+Ze/2,y:tt-6,textAnchor:"middle",className:he.phaseLabel,children:h},h)),u.map(h=>e.jsx("path",{d:h.d,className:he.edge,fill:"none",markerEnd:"url(#dag-arrow)"},h.key)),t.map(h=>{const m=d.get(h.id);if(!m)return null;const f=Pn(h.status);return e.jsx("g",{transform:`translate(${m.x},${m.y})`,children:e.jsxs("a",{href:`#${s}-${encodeURIComponent(h.id)}`,className:he.nodeLink,children:[e.jsx("title",{children:`${h.id} — ${h.goal} (${h.status})`}),e.jsx("rect",{width:Ze,height:et,rx:6,ry:6,className:`${he.nodeRect} ${he[f]}`}),e.jsx("circle",{cx:10,cy:et/2,r:4,className:`${he.statusDot} ${he[f]}`}),e.jsx("text",{x:20,y:17,className:he.nodeId,children:Ls(h.id,18)}),e.jsx("text",{x:20,y:33,className:he.nodeGoal,children:Ls(h.goal,20)})]})},h.id)})]})}const hm="_view_19up6_1",mm="_header_19up6_8",pm="_eyebrow_19up6_16",fm="_title_19up6_22",_m="_freshness_19up6_29",xm="_burndownRow_19up6_35",gm="_burndownTrack_19up6_41",jm="_burndownFill_19up6_49",vm="_burndownLabel_19up6_55",bm="_metaGrid_19up6_62",ym="_numeric_19up6_80",wm="_mono_19up6_84",Nm="_section_19up6_90",km="_sectionTitle_19up6_96",$m="_resultText_19up6_101",Sm="_escalationList_19up6_110",Cm="_escalationItem_19up6_115",Rm="_escalationJson_19up6_120",Lm="_dagWrap_19up6_130",Tm="_taskList_19up6_138",Em="_taskItem_19up6_144",Am="_taskHeader_19up6_157",Dm="_taskId_19up6_163",Mm="_taskPhase_19up6_169",Im="_taskGoal_19up6_176",Pm="_taskDeps_19up6_181",qm="_error_19up6_188",T={view:hm,header:mm,eyebrow:pm,title:fm,freshness:_m,burndownRow:xm,burndownTrack:gm,burndownFill:jm,burndownLabel:vm,metaGrid:bm,numeric:ym,mono:wm,section:Nm,sectionTitle:km,resultText:$m,escalationList:Sm,escalationItem:Cm,escalationJson:Rm,dagWrap:Lm,taskList:Tm,taskItem:Em,taskHeader:Am,taskId:Dm,taskPhase:Mm,taskGoal:Im,taskDeps:Pm,error:qm},Ts="dag-task";function Es(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString()}function Bm(){const{id:t}=as(),s=c.useRef(null);Ne(`/work/swarms/${t??""}`,s);const n=q(Gn(t??""));if(!t)return e.jsx("div",{className:T.view,children:e.jsx("p",{className:T.error,role:"alert",children:"No swarm id in URL."})});if(n.status==="loading")return e.jsxs("div",{ref:s,className:T.view,children:[e.jsx(K,{width:"60%"}),e.jsx(K,{width:"30%"}),e.jsx(K,{width:"80%"})]});if(n.status==="error"||!n.data)return e.jsx("div",{ref:s,className:T.view,children:e.jsx("p",{className:T.error,role:"alert",children:n.error?.message??`Swarm ${t} not found.`})});const a=n.data,r=a.tasks.filter(u=>u.status==="done").length,l=Math.max(a.plan?.tasks.length??0,a.tasks.length),o=l>0?Math.round(r/l*100):0,d=im(a.plan,a.tasks),i=a.usage??{tokensIn:0,tokensOut:0,estCostUsd:0};return e.jsxs("div",{ref:s,className:T.view,children:[e.jsxs("header",{className:T.header,children:[e.jsxs("div",{children:[e.jsxs("p",{className:T.eyebrow,children:["Swarm ",a.id]}),e.jsx("h1",{className:T.title,children:a.goal})]}),e.jsxs("div",{className:T.freshness,"aria-live":"polite",children:[n.status==="refreshing"?e.jsx(ae,{}):null,e.jsx(U,{status:a.status})]})]}),e.jsxs("div",{className:T.burndownRow,children:[e.jsx("div",{className:T.burndownTrack,children:e.jsx("div",{className:T.burndownFill,style:{width:`${o}%`}})}),e.jsxs("span",{className:T.burndownLabel,children:[r,"/",l," tasks done (",o,"%)"]})]}),e.jsxs("dl",{className:T.metaGrid,children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Tokens in / out"}),e.jsxs("dd",{className:T.numeric,children:[i.tokensIn.toLocaleString()," / ",i.tokensOut.toLocaleString()]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Est cost"}),e.jsxs("dd",{className:T.numeric,children:["$",i.estCostUsd.toFixed(4)]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Parallelism"}),e.jsx("dd",{className:T.numeric,children:a.parallel})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Created"}),e.jsx("dd",{children:Es(a.createdAt)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Updated"}),e.jsx("dd",{children:Es(a.updatedAt)})]}),a.project?e.jsxs("div",{children:[e.jsx("dt",{children:"Project"}),e.jsx("dd",{className:T.mono,children:a.project})]}):null]}),a.escalations&&a.escalations.length>0?e.jsxs("section",{className:T.section,children:[e.jsxs("h2",{className:T.sectionTitle,children:["Escalations (",a.escalations.length,")"]}),e.jsx("ul",{className:T.escalationList,children:a.escalations.map((u,h)=>e.jsx("li",{className:T.escalationItem,children:e.jsx("pre",{className:T.escalationJson,children:JSON.stringify(u,null,2)})},h))})]}):null,a.result?e.jsxs("section",{className:T.section,children:[e.jsx("h2",{className:T.sectionTitle,children:"Result"}),e.jsx("p",{className:T.resultText,children:a.result})]}):null,e.jsxs("section",{className:T.section,children:[e.jsx("h2",{className:T.sectionTitle,children:"Task graph"}),e.jsx("div",{className:T.dagWrap,children:e.jsx(um,{tasks:d,taskAnchorPrefix:Ts})})]}),e.jsxs("section",{className:T.section,children:[e.jsxs("h2",{className:T.sectionTitle,children:["Tasks (",d.length,")"]}),e.jsx("ul",{className:T.taskList,children:d.map(u=>e.jsxs("li",{id:`${Ts}-${u.id}`,"data-focus-key":`swarm-task-${u.id}`,className:T.taskItem,tabIndex:-1,children:[e.jsxs("div",{className:T.taskHeader,children:[e.jsx("span",{className:T.taskId,children:u.id}),e.jsx("span",{className:T.taskPhase,children:u.phase}),e.jsx(U,{status:u.status})]}),e.jsx("p",{className:T.taskGoal,children:u.goal}),u.deps.length>0?e.jsxs("p",{className:T.taskDeps,children:["depends on: ",u.deps.join(", ")]}):null]},u.id))})]})]})}const Om="_view_1bwoy_1",Fm="_header_1bwoy_8",Um="_title_1bwoy_16",Hm="_freshness_1bwoy_22",Gm="_callout_1bwoy_28",Wm="_calloutTitle_1bwoy_39",Qm="_calloutBody_1bwoy_44",Vm="_calloutCommand_1bwoy_48",zm="_metaGrid_1bwoy_59",Km="_section_1bwoy_77",Jm="_sectionTitle_1bwoy_83",Ym="_serviceError_1bwoy_88",Xm="_tickTableWrap_1bwoy_96",Zm="_tickTable_1bwoy_96",ep="_date_1bwoy_124",tp="_numeric_1bwoy_130",sp="_dryRun_1bwoy_135",np="_empty_1bwoy_140",ap="_error_1bwoy_145",W={view:Om,header:Fm,title:Um,freshness:Hm,callout:Gm,calloutTitle:Wm,calloutBody:Qm,calloutCommand:Vm,metaGrid:zm,section:Km,sectionTitle:Jm,serviceError:Ym,tickTableWrap:Xm,tickTable:Zm,date:ep,numeric:tp,dryRun:sp,empty:np,error:ap},rp={missing:"No daemon state file has been written yet — the daemon may never have run on this machine.",malformed:"The daemon state file exists but failed to parse.",unreadable:'The daemon state file could not be read. This is also the exact signal produced when a state-recovery marker is present (a prior repair left a quarantine in progress) — the API does not distinguish the two cases, so treat this as "inspect before trusting displayed daemon state."',inconsistent:"The daemon state file and the live lock/activity check disagree — the daemon may be mid-restart.",unavailable:"The daemon state read path itself failed (I/O error or similar)."};function As(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString()}function lp({quality:t}){const s=t.reason,n=rp[s]??"Daemon state could not be verified.";return e.jsxs("section",{className:W.callout,role:"alert",children:[e.jsxs("p",{className:W.calloutTitle,children:["Daemon state is unknown (",s,")"]}),e.jsx("p",{className:W.calloutBody,children:n}),e.jsx("p",{className:W.calloutBody,children:"Real remedy — preview or execute a state recovery from a terminal on this machine:"}),e.jsx("pre",{className:W.calloutCommand,children:`ashlr daemon recover-state --dry-run --expected-sha256 <sha256> [--json]
|
|
14
14
|
ashlr daemon recover-state --execute --plan-id <uuid> --plan-sha256 <sha256> --authorize <plan-sha256> [--json]`}),e.jsx("p",{className:W.calloutBody,children:"If a quarantine already exists and needs resolving instead:"}),e.jsx("pre",{className:W.calloutCommand,children:`ashlr daemon resolve-state --dry-run --quarantine-plan-id <uuid> --quarantine-receipt-sha256 <sha256> [--json]
|
|
15
15
|
ashlr daemon resolve-state --execute --plan-id <uuid> --plan-sha256 <sha256> --authorize <plan-sha256> --confirm <plan-sha256> [--json]`})]})}function op(){const t=c.useRef(null);Ne("/control/daemon",t);const s=q(kt),n=q(Wn),a=s.data?.daemon,r=n.data;return e.jsxs("div",{ref:t,className:W.view,children:[e.jsxs("header",{className:W.header,children:[e.jsx("h1",{className:W.title,children:"Daemon"}),e.jsxs("div",{className:W.freshness,"aria-live":"polite",children:[s.status==="refreshing"||n.status==="refreshing"?e.jsx(ae,{}):null,a?e.jsx(O,{quality:a.sourceQuality,label:"daemon state",children:e.jsx(U,{status:a.running?"running":"pending",children:a.running?"running":"stopped"})}):null]})]}),s.status==="loading"?e.jsx(K,{width:"60%"}):s.status==="error"||!a?e.jsx("p",{className:W.error,role:"alert",children:s.error?.message??"Failed to load control snapshot."}):e.jsxs(e.Fragment,{children:[_t(a.sourceQuality)?null:e.jsx(lp,{quality:a.sourceQuality}),e.jsxs("dl",{className:W.metaGrid,children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Runtime state"}),e.jsx("dd",{children:e.jsx(O,{quality:a.sourceQuality,label:"runtime state",children:a.runtimeState})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"PID"}),e.jsx("dd",{children:e.jsx(O,{quality:a.sourceQuality,label:"pid",children:a.pid??"—"})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Last tick"}),e.jsx("dd",{children:e.jsx(O,{quality:a.sourceQuality,label:"last tick",children:As(a.lastTickAt)})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Today's spend"}),e.jsx("dd",{children:e.jsxs(O,{quality:a.sourceQuality,label:"spend",children:["$",a.todaySpentUsd.toFixed(2)]})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Direction mode"}),e.jsx("dd",{children:e.jsx(O,{quality:a.sourceQuality,label:"direction mode",children:a.activeDirectionMode??"none"})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Direction reason"}),e.jsx("dd",{children:e.jsx(O,{quality:a.sourceQuality,label:"direction reason",children:a.activeDirectionReason??"—"})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Autonomy control loop"}),e.jsx("dd",{children:e.jsx(O,{quality:a.sourceQuality,label:"autonomy control loop",children:a.autonomyControlLoop?"enabled":"disabled"})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Autonomy control mode"}),e.jsx("dd",{children:e.jsx(O,{quality:a.sourceQuality,label:"autonomy control mode",children:a.autonomyControlMode})})]})]}),e.jsxs("section",{className:W.section,children:[e.jsx("h2",{className:W.sectionTitle,children:"OS service"}),e.jsxs("dl",{className:W.metaGrid,children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Registration state"}),e.jsx("dd",{children:a.service.registrationState})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Installed"}),e.jsx("dd",{children:a.service.installed?"yes":"no"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Running"}),e.jsx("dd",{children:a.service.running?"yes":"no"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Runtime state"}),e.jsx("dd",{children:a.service.runtimeState??"unknown"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Platform"}),e.jsx("dd",{children:a.service.platformSpec})]})]}),a.service.errorLog?e.jsx("p",{className:W.serviceError,role:"alert",children:a.service.errorLog}):null]})]}),e.jsxs("section",{className:W.section,children:[e.jsx("h2",{className:W.sectionTitle,children:"Recent ticks"}),n.status==="loading"?e.jsx(K,{width:"80%"}):!r||!r.ticks||r.ticks.length===0?e.jsx("p",{className:W.empty,children:"No tick history available."}):e.jsx("div",{className:W.tickTableWrap,children:e.jsxs("table",{className:W.tickTable,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Time"}),e.jsx("th",{scope:"col",children:"Reason"}),e.jsx("th",{scope:"col",children:"Items"}),e.jsx("th",{scope:"col",children:"Proposals"}),e.jsx("th",{scope:"col",children:"Spend"})]})}),e.jsx("tbody",{children:[...r.ticks].reverse().slice(0,20).map((l,o)=>e.jsxs("tr",{children:[e.jsx("td",{className:W.date,children:As(l.ts)}),e.jsxs("td",{children:[l.reason,l.dryRun?e.jsx("span",{className:W.dryRun,children:" (dry-run)"}):null]}),e.jsx("td",{className:W.numeric,children:l.itemsConsidered}),e.jsx("td",{className:W.numeric,children:l.proposalsCreated}),e.jsxs("td",{className:W.numeric,children:["$",l.spentUsd.toFixed(4)]})]},`${l.ts}-${o}`))})]})})]})]})}const ip="_view_ssrhq_1",cp="_header_ssrhq_8",dp="_title_ssrhq_14",up="_freshness_ssrhq_20",hp="_section_ssrhq_26",mp="_sectionTitle_ssrhq_32",pp="_killSwitchRow_ssrhq_37",fp="_pauseButton_ssrhq_47",_p="_resumeButton_ssrhq_65",xp="_mutationError_ssrhq_83",gp="_metaGrid_ssrhq_91",jp="_numeric_ssrhq_109",vp="_lockWarning_ssrhq_113",bp="_tableWrap_ssrhq_117",yp="_table_ssrhq_117",wp="_mono_ssrhq_144",Np="_empty_ssrhq_149",kp="_error_ssrhq_154",$p="_confirmBody_ssrhq_162",Sp="_confirmActions_ssrhq_168",Cp="_cancelButton_ssrhq_174",Rp="_confirmButton_ssrhq_186",S={view:ip,header:cp,title:dp,freshness:up,section:hp,sectionTitle:mp,killSwitchRow:pp,pauseButton:fp,resumeButton:_p,mutationError:xp,metaGrid:gp,numeric:jp,lockWarning:vp,tableWrap:bp,table:yp,mono:wp,empty:Np,error:kp,confirmBody:$p,confirmActions:Sp,cancelButton:Cp,confirmButton:Rp};function Ds(t){if(!t)return"—";const s=new Date(t);return Number.isNaN(s.getTime())?t:s.toLocaleString()}function Lp(){const t=c.useRef(null);Ne("/control/fleet",t);const s=q(Us),n=q(Qs),a=Bs(),[r,l]=c.useState(null),[o,d]=c.useState(!1),[i,u]=c.useState(!1),[h,m]=c.useState(!1),[f,j]=c.useState(null);async function b(g){m(!0),j(null);try{g==="pause"?await Vs():await zs()}catch(H){j(H instanceof Error?H.message:String(H))}finally{m(!1),l(null)}}function _(g){j(null),l(g),d(!0)}function p(){d(!1),a.hasHold?r&&b(r):u(!0)}c.useEffect(()=>{i||r&&(a.hasHold?b(r):l(null))},[i]);const x=s.data,v=x?.killSwitch,w=v?{sourceState:v.sourceState,complete:v.sourceState==="healthy",reason:v.reason}:void 0,L=x?.killed===!0;return e.jsxs("div",{ref:t,className:S.view,children:[e.jsxs("header",{className:S.header,children:[e.jsx("h1",{className:S.title,children:"Fleet"}),e.jsx("div",{className:S.freshness,"aria-live":"polite",children:s.status==="refreshing"||n.status==="refreshing"?e.jsx(ae,{}):null})]}),s.status==="loading"?e.jsx(K,{width:"60%"}):s.status==="error"||!x?e.jsx("p",{className:S.error,role:"alert",children:s.error?.message??"Failed to load fleet status."}):e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:S.section,children:[e.jsx("h2",{className:S.sectionTitle,children:"Kill switch"}),e.jsx("div",{className:S.killSwitchRow,children:e.jsx(O,{quality:w,label:"kill switch",renderControl:()=>e.jsx("button",{type:"button",className:L?S.resumeButton:S.pauseButton,onClick:()=>_(L?"resume":"pause"),disabled:h,children:h?"Working…":L?"Resume fleet":"Pause fleet"}),children:e.jsx(U,{status:L?"paused":"running",children:L?"engaged — fleet paused":"clear — fleet active"})})}),f?e.jsx("p",{className:S.mutationError,role:"alert",children:f}):null]}),e.jsxs("section",{className:S.section,children:[e.jsx("h2",{className:S.sectionTitle,children:"Queue depth"}),e.jsxs("dl",{className:S.metaGrid,children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Backlog items"}),e.jsx("dd",{className:S.numeric,children:x.queue.backlogItems})]}),x.queue.eligibleBacklogItems!==void 0?e.jsxs("div",{children:[e.jsx("dt",{children:"Eligible"}),e.jsx("dd",{className:S.numeric,children:x.queue.eligibleBacklogItems})]}):null,x.queue.cooldownItems!==void 0?e.jsxs("div",{children:[e.jsx("dt",{children:"Cooldown"}),e.jsx("dd",{className:S.numeric,children:x.queue.cooldownItems})]}):null,x.queue.pendingItems!==void 0?e.jsxs("div",{children:[e.jsx("dt",{children:"Pending"}),e.jsx("dd",{className:S.numeric,children:x.queue.pendingItems})]}):null,x.queue.nextEligibleAt!==void 0?e.jsxs("div",{children:[e.jsx("dt",{children:"Next eligible"}),e.jsx("dd",{children:Ds(x.queue.nextEligibleAt)})]}):null]})]}),e.jsxs("section",{className:S.section,children:[e.jsx("h2",{className:S.sectionTitle,children:"Lease health"}),x.queue.shared?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:S.metaGrid,children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Active claims"}),e.jsx("dd",{className:S.numeric,children:x.queue.shared.activeClaims})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Owned by this machine"}),e.jsx("dd",{className:S.numeric,children:x.queue.shared.ownedClaims})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Reclaimable (expired)"}),e.jsx("dd",{className:S.numeric,children:x.queue.shared.reclaimableClaims})]}),x.queue.shared.executingClaims!==void 0?e.jsxs("div",{children:[e.jsx("dt",{children:"Executing"}),e.jsx("dd",{className:S.numeric,children:x.queue.shared.executingClaims})]}):null,x.queue.shared.ambiguousClaims!==void 0?e.jsxs("div",{children:[e.jsx("dt",{children:"Ambiguous (needs reconciliation)"}),e.jsx("dd",{className:S.numeric,children:x.queue.shared.ambiguousClaims})]}):null,e.jsxs("div",{children:[e.jsx("dt",{children:"Next lease expiry"}),e.jsx("dd",{children:Ds(x.queue.shared.nextLeaseExpiryAt)})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Advisory lock"}),e.jsxs("dd",{children:[x.queue.shared.lock.present?x.queue.shared.lock.stale?"present, stale":"present, healthy":"absent",x.queue.shared.lock.recoveryRequired?e.jsx("span",{className:S.lockWarning,children:" — recovery required"}):null]})]})]}),x.queue.shared.claimsByMachine.length>0?e.jsx("div",{className:S.tableWrap,children:e.jsxs("table",{className:S.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Machine"}),e.jsx("th",{scope:"col",children:"Active"}),e.jsx("th",{scope:"col",children:"Expired"}),e.jsx("th",{scope:"col",children:"Executing"})]})}),e.jsx("tbody",{children:x.queue.shared.claimsByMachine.map(g=>e.jsxs("tr",{children:[e.jsx("td",{className:S.mono,children:g.machineId}),e.jsx("td",{className:S.numeric,children:g.active}),e.jsx("td",{className:S.numeric,children:g.expired}),e.jsx("td",{className:S.numeric,children:g.executing??"—"})]},g.machineId))})]})}):null]}):e.jsx("p",{className:S.empty,children:"Shared fleet queue is not in use on this deployment."})]})]}),e.jsxs("section",{className:S.section,children:[e.jsx("h2",{className:S.sectionTitle,children:"Recent activity"}),n.status==="loading"?e.jsx(K,{width:"70%"}):n.status==="error"||!n.data?e.jsx("p",{className:S.error,role:"alert",children:n.error?.message??"Failed to load fleet activity."}):e.jsxs("dl",{className:S.metaGrid,children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Cooldown items"}),e.jsx("dd",{className:S.numeric,children:n.data.cooldownCount})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Engines ready"}),e.jsxs("dd",{className:S.numeric,children:[n.data.engineReadiness.filter(g=>g.installed&&g.authed===!0).length," /"," ",n.data.engineReadiness.length]})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Recent auto-merges"}),e.jsx("dd",{className:S.numeric,children:x?.merges.recent??"—"})]})]})]}),e.jsxs(Jt,{open:o,onClose:()=>{d(!1),l(null)},titleId:"fleet-kill-switch-confirm",title:r==="resume"?"Resume the fleet?":"Pause the fleet?",children:[e.jsx("p",{className:S.confirmBody,children:r==="resume"?"This clears the global kill switch. Autonomous dispatch will resume across the fleet.":"This engages the global kill switch. Autonomous dispatch halts fleet-wide until explicitly resumed."}),e.jsxs("div",{className:S.confirmActions,children:[e.jsx("button",{type:"button",className:S.cancelButton,onClick:()=>{d(!1),l(null)},children:"Cancel"}),e.jsx("button",{type:"button",className:S.confirmButton,onClick:p,children:r==="resume"?"Yes, resume":"Yes, pause"})]})]}),e.jsx($t,{open:i,onClose:()=>u(!1),reason:r==="resume"?"Resuming the fleet requires the dispatch token.":"Pausing the fleet requires the dispatch token."})]})}const Tp="_view_1fet3_1",Ep="_header_1fet3_8",Ap="_title_1fet3_14",Dp="_freshness_1fet3_20",Mp="_unavailable_1fet3_26",Ip="_counts_1fet3_35",Pp="_countTile_1fet3_41",qp="_countValue_1fet3_51",Bp="_countLabel_1fet3_57",Op="_critical_1fet3_64",Fp="_high_1fet3_65",Up="_medium_1fet3_68",Hp="_low_1fet3_71",Gp="_filters_1fet3_75",Wp="_field_1fet3_86",Qp="_fieldLabel_1fet3_92",Vp="_input_1fet3_97",zp="_select_1fet3_98",Kp="_tableWrap_1fet3_114",Jp="_table_1fet3_114",Yp="_mono_1fet3_141",Xp="_empty_1fet3_146",Zp="_error_1fet3_153",D={view:Tp,header:Ep,title:Ap,freshness:Dp,unavailable:Mp,counts:Ip,countTile:Pp,countValue:qp,countLabel:Bp,critical:Op,high:Fp,medium:Up,low:Hp,filters:Gp,field:Wp,fieldLabel:Qp,input:Vp,select:zp,tableWrap:Kp,table:Jp,mono:Yp,empty:Xp,error:Zp},ef={critical:"danger",high:"danger",medium:"warning",low:"neutral"},Ms={critical:0,high:1,medium:2,low:3};function tf(){const t=c.useRef(null);Ne("/control/security",t);const s=q(kt),n=s.data?.security,[a,r]=c.useState(""),[l,o]=c.useState("all"),[d,i]=c.useState("all"),u=c.useMemo(()=>Array.from(new Set((n?.findings??[]).map(m=>m.repo))).sort(),[n]),h=c.useMemo(()=>(n?.findings??[]).filter(f=>l==="all"?!0:f.severity===l).filter(f=>d==="all"?!0:f.repo===d).filter(f=>{if(!a.trim())return!0;const j=a.trim().toLowerCase();return f.title.toLowerCase().includes(j)||f.repo.toLowerCase().includes(j)}).sort((f,j)=>(Ms[f.severity]??9)-(Ms[j.severity]??9)),[n,l,d,a]);return e.jsxs("div",{ref:t,className:D.view,children:[e.jsxs("header",{className:D.header,children:[e.jsx("h1",{className:D.title,children:"Security"}),e.jsx("div",{className:D.freshness,"aria-live":"polite",children:s.status==="refreshing"?e.jsx(ae,{}):null})]}),s.status==="loading"?e.jsx(K,{width:"60%"}):s.status==="error"||!n?e.jsx("p",{className:D.error,role:"alert",children:s.error?.message??"Failed to load control snapshot."}):n.available?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:D.counts,children:[e.jsxs("div",{className:`${D.countTile} ${D.critical}`,children:[e.jsx("span",{className:D.countValue,children:n.counts.critical}),e.jsx("span",{className:D.countLabel,children:"Critical"})]}),e.jsxs("div",{className:`${D.countTile} ${D.high}`,children:[e.jsx("span",{className:D.countValue,children:n.counts.high}),e.jsx("span",{className:D.countLabel,children:"High"})]}),e.jsxs("div",{className:`${D.countTile} ${D.medium}`,children:[e.jsx("span",{className:D.countValue,children:n.counts.medium}),e.jsx("span",{className:D.countLabel,children:"Medium"})]}),e.jsxs("div",{className:`${D.countTile} ${D.low}`,children:[e.jsx("span",{className:D.countValue,children:n.counts.low}),e.jsx("span",{className:D.countLabel,children:"Low"})]})]}),e.jsxs("form",{className:D.filters,role:"search","aria-label":"Filter findings",onSubmit:m=>m.preventDefault(),children:[e.jsxs("label",{className:D.field,children:[e.jsx("span",{className:D.fieldLabel,children:"Search"}),e.jsx("input",{type:"text",className:D.input,placeholder:"title or repo",value:a,onChange:m=>r(m.target.value)})]}),e.jsxs("label",{className:D.field,children:[e.jsx("span",{className:D.fieldLabel,children:"Severity"}),e.jsxs("select",{className:D.select,value:l,onChange:m=>o(m.target.value),children:[e.jsx("option",{value:"all",children:"All"}),e.jsx("option",{value:"critical",children:"Critical"}),e.jsx("option",{value:"high",children:"High"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"low",children:"Low"})]})]}),e.jsxs("label",{className:D.field,children:[e.jsx("span",{className:D.fieldLabel,children:"Repo"}),e.jsxs("select",{className:D.select,value:d,onChange:m=>i(m.target.value),children:[e.jsx("option",{value:"all",children:"All"}),u.map(m=>e.jsx("option",{value:m,children:m},m))]})]})]}),h.length===0?e.jsx("p",{className:D.empty,children:"No findings match the current filters."}):e.jsx("div",{className:D.tableWrap,children:e.jsxs("table",{className:D.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",children:"Severity"}),e.jsx("th",{scope:"col",children:"Repo"}),e.jsx("th",{scope:"col",children:"Finding"})]})}),e.jsx("tbody",{children:h.map((m,f)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx(U,{status:m.severity,tone:ef[m.severity]??"neutral"})}),e.jsx("td",{className:D.mono,children:m.repo}),e.jsx("td",{children:m.title})]},`${m.repo}-${m.title}-${f}`))})]})})]}):e.jsx("p",{className:D.unavailable,children:`No cached security data available — the backlog is absent, empty, or has no security-source findings. This is not the same as "clean": it means binshield hasn't produced cached findings for this fleet yet.`})]})}const sf="_view_1yeql_1",nf="_header_1yeql_8",af="_title_1yeql_14",rf="_freshness_1yeql_20",lf="_count_1yeql_26",of="_missionCard_1yeql_31",cf="_sectionTitle_1yeql_41",df="_missionState_1yeql_49",uf="_sourceGrid_1yeql_54",hf="_list_1yeql_68",mf="_goalCard_1yeql_74",pf="_goalHeader_1yeql_88",ff="_goalObjective_1yeql_95",_f="_progressRow_1yeql_100",xf="_progressTrack_1yeql_106",gf="_progressFill_1yeql_114",jf="_progressLabel_1yeql_120",vf="_nextActionable_1yeql_127",bf="_mono_1yeql_132",yf="_milestoneList_1yeql_136",wf="_milestoneItem_1yeql_142",Nf="_milestoneTitle_1yeql_149",kf="_noMilestones_1yeql_153",$f="_empty_1yeql_158",Sf="_error_1yeql_165",V={view:sf,header:nf,title:af,freshness:rf,count:lf,missionCard:of,sectionTitle:cf,missionState:df,sourceGrid:uf,list:hf,goalCard:mf,goalHeader:pf,goalObjective:ff,progressRow:_f,progressTrack:xf,progressFill:gf,progressLabel:jf,nextActionable:vf,mono:bf,milestoneList:yf,milestoneItem:wf,milestoneTitle:Nf,noMilestones:kf,empty:$f,error:Sf};function Cf(){const t=c.useRef(null);Ne("/goals",t);const s=q(bt),n=q(Qn),a=s.data??[],r=n.data;return e.jsxs("div",{ref:t,className:V.view,children:[e.jsxs("header",{className:V.header,children:[e.jsx("h1",{className:V.title,children:"Goals"}),e.jsxs("div",{className:V.freshness,"aria-live":"polite",children:[s.status==="refreshing"||n.status==="refreshing"?e.jsx(ae,{}):null,e.jsxs("span",{className:V.count,children:[a.length," goals"]})]})]}),n.status==="loading"?e.jsx(K,{width:"50%"}):n.status==="success"&&r?e.jsxs("section",{className:V.missionCard,children:[e.jsx("h2",{className:V.sectionTitle,children:"Mission state"}),e.jsx("p",{className:V.missionState,children:r.state}),e.jsxs("dl",{className:V.sourceGrid,children:[e.jsxs("div",{children:[e.jsx("dt",{children:"Briefing"}),e.jsx("dd",{children:e.jsx(O,{quality:r.sources.briefing??void 0,label:"briefing source",children:"available"})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Goals source"}),e.jsx("dd",{children:e.jsx(O,{quality:r.sources.goals??void 0,label:"goals source",children:"available"})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Enrollment"}),e.jsx("dd",{children:e.jsx(O,{quality:r.sources.enrollment??void 0,label:"enrollment source",children:"available"})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:"Proposals"}),e.jsx("dd",{children:e.jsx(O,{quality:r.sources.proposals??void 0,label:"proposals source",children:"available"})})]})]})]}):null,s.status==="loading"?e.jsxs("div",{className:V.list,children:[e.jsx(K,{width:"90%"}),e.jsx(K,{width:"70%"})]}):s.status==="error"?e.jsx("p",{className:V.error,role:"alert",children:s.error?.message??"Failed to load goals."}):a.length===0?e.jsx("p",{className:V.empty,children:"No active goals."}):e.jsx("ul",{className:V.list,children:a.map(l=>{const o=Math.round((l.progress.fractionDone??0)*100);return e.jsxs("li",{className:V.goalCard,"data-focus-key":`goal-${l.id}`,tabIndex:0,children:[e.jsxs("div",{className:V.goalHeader,children:[e.jsx("h3",{className:V.goalObjective,children:l.objective}),e.jsx(U,{status:l.status})]}),e.jsxs("div",{className:V.progressRow,children:[e.jsx("div",{className:V.progressTrack,children:e.jsx("div",{className:V.progressFill,style:{width:`${o}%`}})}),e.jsxs("span",{className:V.progressLabel,children:[o,"%"]})]}),l.progress.nextActionableId?e.jsxs("p",{className:V.nextActionable,children:["Next actionable milestone id: ",e.jsx("span",{className:V.mono,children:l.progress.nextActionableId})]}):null,l.milestones.length>0?e.jsx("ol",{className:V.milestoneList,children:[...l.milestones].sort((d,i)=>d.order-i.order).map(d=>e.jsxs("li",{className:V.milestoneItem,children:[e.jsx(U,{status:d.status}),e.jsx("span",{className:V.milestoneTitle,children:d.title})]},d.title))}):e.jsx("p",{className:V.noMilestones,children:"No milestones yet."})]},l.id)})})]})}const Rf="_list_1nh33_1",Lf="_filters_1nh33_8",Tf="_filterField_1nh33_14",Ef="_filterLabel_1nh33_21",Af="_summary_1nh33_36",Df="_batchBar_1nh33_44",Mf="_batchApprove_1nh33_61",If="_batchReject_1nh33_66",Pf="_skeletons_1nh33_71",qf="_error_1nh33_77",Bf="_empty_1nh33_85",Of="_table_1nh33_94",Ff="_checkboxCol_1nh33_121",Uf="_repoCol_1nh33_125",Hf="_kindCol_1nh33_129",Gf="_ageCol_1nh33_133",Wf="_statusCol_1nh33_137",Qf="_whyCol_1nh33_141",Vf="_row_1nh33_145",zf="_rowActive_1nh33_155",Kf="_titleLink_1nh33_159",Jf="_repoCell_1nh33_172",Yf="_age_1nh33_133",Xf="_why_1nh33_141",F={list:Rf,filters:Lf,filterField:Tf,filterLabel:Ef,summary:Af,batchBar:Df,batchApprove:Mf,batchReject:If,skeletons:Pf,error:qf,empty:Bf,table:Of,checkboxCol:Ff,repoCol:Uf,kindCol:Hf,ageCol:Gf,statusCol:Wf,whyCol:Qf,row:Vf,rowActive:zf,titleLink:Kf,repoCell:Jf,age:Yf,why:Xf},Zf=[{value:"pending",label:"Pending"},{value:"rejected",label:"Rejected"},{value:"approved",label:"Approved"},{value:"applied",label:"Applied"},{value:"failed",label:"Failed"},{value:"awaiting-host-merge",label:"Awaiting host merge"},{value:"all",label:"All statuses"}];function e_(t){const s=Date.parse(t);if(Number.isNaN(s))return"—";const n=Math.max(0,Math.round((Date.now()-s)/1e3));if(n<60)return`${n}s`;const a=Math.round(n/60);if(a<60)return`${a}m`;const r=Math.round(a/60);return r<24?`${r}h`:`${Math.round(r/24)}d`}function t_({selectedId:t,onDispatchDisabled:s}){const[n,a]=c.useState("pending"),[r,l]=c.useState(""),[o,d]=c.useState(""),[i,u]=c.useState(""),[h,m]=c.useState(new Set),[f,j]=c.useState(0),[b,_]=c.useState(null),[p,x]=c.useState(!1),[v,w]=c.useState(!1),[L,g]=c.useState(!1),[H,A]=c.useState(null),N=c.useRef(null),C=c.useRef(new Map),oe=dt(),ne=q(Yt({status:n,since:r||void 0,limit:500})),se=c.useMemo(()=>{const k=ne.data?.proposals??[],Q=o.trim().toLowerCase(),ie=i.trim().toLowerCase();return k.filter(ve=>!(Q&&!ve.title.toLowerCase().includes(Q)&&!(ve.summary??"").toLowerCase().includes(Q)||ie&&!(ve.repo??"").toLowerCase().includes(ie)))},[ne.data,o,i]);c.useEffect(()=>{j(k=>Math.min(k,Math.max(se.length-1,0)))},[se.length]);function y(k,Q){Q==="pending"&&m(ie=>{const ve=new Set(ie);return ve.has(k)?ve.delete(k):ve.add(k),ve})}function P(k){if(se.length!==0)if(k.key==="ArrowDown"){k.preventDefault();const Q=Math.min(f+1,se.length-1);j(Q),C.current.get(se[Q].id)?.focus()}else if(k.key==="ArrowUp"){k.preventDefault();const Q=Math.max(f-1,0);j(Q),C.current.get(se[Q].id)?.focus()}else if(k.key==="Enter"){const Q=se[f];Q&&oe(`/inbox/${encodeURIComponent(Q.id)}`)}else if(k.key===" "){const Q=se[f];Q&&(k.preventDefault(),y(Q.id,Q.status))}else k.key==="/"&&(k.preventDefault(),N.current?.focus())}function G(k){h.size!==0&&(A(null),_(k),He()?w(!0):x(!0))}function le(){x(!1),He()?w(!0):_(null)}async function $n(){if(!b)return;g(!0),A(null);const k=Array.from(h),Q=[];for(const ie of k)try{b==="approve"?await Xt(ie):await Zt(ie)}catch(ve){if(ve instanceof Fs){g(!1),w(!1),_(null),s();return}Q.push(ie)}g(!1),Q.length>0?(A(`${Q.length} of ${k.length} failed (already decided, or a transient error). Selection kept for retry.`),m(new Set(Q))):(w(!1),_(null),m(new Set))}const _e=h.size;return e.jsxs("div",{className:F.list,children:[e.jsxs("div",{className:F.filters,children:[e.jsxs("label",{className:F.filterField,children:[e.jsx("span",{className:F.filterLabel,children:"Status"}),e.jsx("select",{value:n,onChange:k=>a(k.target.value),children:Zf.map(k=>e.jsx("option",{value:k.value,children:k.label},k.value))})]}),e.jsxs("label",{className:F.filterField,children:[e.jsx("span",{className:F.filterLabel,children:"Since"}),e.jsx("input",{type:"date",value:r,onChange:k=>l(k.target.value)})]}),e.jsxs("label",{className:F.filterField,children:[e.jsx("span",{className:F.filterLabel,children:"Repo"}),e.jsx("input",{type:"text",placeholder:"filter by repo",value:i,onChange:k=>u(k.target.value)})]}),e.jsxs("label",{className:F.filterField,children:[e.jsx("span",{className:F.filterLabel,children:"Search"}),e.jsx("input",{ref:N,type:"search",placeholder:"title or summary — press / to focus",value:o,onChange:k=>d(k.target.value)})]})]}),e.jsxs("div",{className:F.summary,"aria-live":"polite",children:[ne.status==="refreshing"?e.jsx(ae,{}):null,ne.data?e.jsxs("span",{children:[se.length," shown of ",ne.data.total," total",ne.data.truncated?" · narrow filters to see more":""]}):null]}),_e>0?e.jsxs("div",{className:F.batchBar,children:[e.jsxs("span",{children:[_e," selected"]}),e.jsx("button",{type:"button",onClick:()=>m(new Set),children:"Clear"}),e.jsxs("button",{type:"button",className:F.batchReject,onClick:()=>G("reject"),children:["Reject ",_e]}),e.jsxs("button",{type:"button",className:F.batchApprove,onClick:()=>G("approve"),children:["Approve ",_e]})]}):null,ne.status==="loading"?e.jsxs("div",{className:F.skeletons,children:[e.jsx(te,{}),e.jsx(te,{}),e.jsx(te,{}),e.jsx(te,{})]}):ne.status==="error"?e.jsx("div",{className:F.error,role:"alert",children:ne.error?.message??"Failed to load proposals."}):se.length===0?e.jsxs("p",{className:F.empty,children:["No ",n==="all"?"":n+" ","proposals match",o||i?" this filter":"","."]}):e.jsxs("table",{className:F.table,role:"grid","aria-label":"Proposals",onKeyDown:P,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{scope:"col",className:F.checkboxCol}),e.jsx("th",{scope:"col",children:"Title"}),e.jsx("th",{scope:"col",className:F.repoCol,children:"Repo"}),e.jsx("th",{scope:"col",className:F.kindCol,children:"Kind"}),e.jsx("th",{scope:"col",className:F.ageCol,children:"Age"}),e.jsx("th",{scope:"col",className:F.statusCol,children:"Status"}),e.jsx("th",{scope:"col",className:F.whyCol,children:"Why"})]})}),e.jsx("tbody",{children:se.map((k,Q)=>e.jsxs("tr",{ref:ie=>{ie?C.current.set(k.id,ie):C.current.delete(k.id)},"data-focus-key":`proposal-${k.id}`,tabIndex:Q===f?0:-1,className:`${F.row} ${k.id===t?F.rowActive:""}`,onFocus:()=>j(Q),"aria-selected":k.id===t,children:[e.jsx("td",{className:F.checkboxCol,children:e.jsx("input",{type:"checkbox",checked:h.has(k.id),disabled:k.status!=="pending",title:k.status!=="pending"?"Only pending proposals can be approved/rejected":void 0,onChange:()=>y(k.id,k.status),onClick:ie=>ie.stopPropagation()})}),e.jsx("td",{children:e.jsx(ht,{to:`/inbox/${encodeURIComponent(k.id)}`,className:F.titleLink,title:k.title,children:k.title})}),e.jsx("td",{className:F.repoCell,title:k.repo??void 0,children:k.repo?k.repo.split("/").pop():"—"}),e.jsx("td",{children:k.kind}),e.jsx("td",{className:F.age,children:e_(k.createdAt)}),e.jsx("td",{children:e.jsx(U,{status:k.status})}),e.jsx("td",{className:F.why,title:k.decisionReason??void 0,children:k.decisionReason??"—"})]},k.id))})]}),e.jsx($t,{open:p,onClose:le,reason:`${b==="approve"?"Approving":"Rejecting"} ${_e} proposals requires the dispatch token.`}),e.jsx(es,{open:v,onClose:()=>{w(!1),_(null),A(null)},title:b==="approve"?`Approve ${_e} proposals?`:`Reject ${_e} proposals?`,body:b==="approve"?e.jsxs(e.Fragment,{children:["This applies all ",_e," selected proposals to their repos now, one at a time. This cannot be undone from this dialog."]}):e.jsxs(e.Fragment,{children:["This rejects all ",_e," selected proposals. They stay visible in history as rejected."]}),confirmLabel:b==="approve"?`Approve ${_e}`:`Reject ${_e}`,destructive:b==="reject",busy:L,error:H,onConfirm:()=>void $n()})]})}const s_="_panel_1n6q8_1",n_="_error_1n6q8_8",a_="_header_1n6q8_16",r_="_titleRow_1n6q8_22",l_="_title_1n6q8_22",o_="_metaRow_1n6q8_35",i_="_metaItem_1n6q8_44",c_="_riskBadge_1n6q8_48",d_="_risk_low_1n6q8_54",u_="_risk_medium_1n6q8_55",h_="_risk_high_1n6q8_56",m_="_summary_1n6q8_58",p_="_evidence_1n6q8_64",f_="_evidenceRow_1n6q8_74",__="_evidenceLabel_1n6q8_81",x_="_muted_1n6q8_89",g_="_rationaleNote_1n6q8_94",j_="_failedChecks_1n6q8_101",v_="_diffSection_1n6q8_107",b_="_actions_1n6q8_111",y_="_actionConsequence_1n6q8_124",w_="_actionError_1n6q8_133",N_="_rejectButton_1n6q8_144",k_="_approveButton_1n6q8_165",$_="_decided_1n6q8_176",M={panel:s_,error:n_,header:a_,titleRow:r_,title:l_,metaRow:o_,metaItem:i_,riskBadge:c_,risk_low:d_,risk_medium:u_,risk_high:h_,summary:m_,evidence:p_,evidenceRow:f_,evidenceLabel:__,muted:x_,rationaleNote:g_,failedChecks:j_,diffSection:v_,actions:b_,actionConsequence:y_,actionError:w_,rejectButton:N_,approveButton:k_,decided:$_},S_={"judge-ship-would-merge":{label:"Ship (would merge)",tone:"success"},"judge-ship-review-required":{label:"Ship (review required)",tone:"success"},"judge-review":{label:"Review",tone:"warning"},"judge-noise":{label:"Noise",tone:"neutral"},"judge-harmful":{label:"Harmful",tone:"danger"},"judge-verdict-unrecognized":{label:"Unrecognized verdict",tone:"unknown"},"judge-parse-failure":{label:"Judge parse failure — not a review",tone:"unknown"},"judge-network-failure":{label:"Judge network failure — not a review",tone:"unknown"}};function C_(t){const s=t.filter(n=>n.action==="judged"&&n.judgeReasonCode);return s.length===0?null:s.reduce((n,a)=>Date.parse(a.ts)>Date.parse(n.ts)?a:n)}function Is(t){if(!t)return"—";const s=Date.parse(t);if(Number.isNaN(s))return"—";const n=Math.max(0,Math.round((Date.now()-s)/1e3));if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const r=Math.round(a/60);return r<24?`${r}h ago`:`${Math.round(r/24)}d ago`}function Ps(t,s){const n=s&&s.length>0?s:"the target repository";return t==="pr"?`Approving pushes a branch to ${n}'s remote and opens a real pull request. Other people can see it immediately, and it cannot be undone from here.`:t==="patch"?`Approving writes this diff to ${n} on disk now. Nothing is pushed, but the working tree changes.`:`Approving applies this ${t} proposal to ${n} now.`}function R_({id:t,onDispatchDisabled:s}){const n=q(Ws(t)),[a,r]=c.useState(null),[l,o]=c.useState(!1),[d,i]=c.useState(!1),[u,h]=c.useState(!1),[m,f]=c.useState(null);function j(g){f(null),r(g),He()?i(!0):o(!0)}function b(){o(!1),He()?i(!0):r(null)}async function _(){if(a){h(!0),f(null);try{a==="approve"?await Xt(t):await Zt(t),i(!1),r(null)}catch(g){g instanceof Fs?(i(!1),r(null),s()):f(g instanceof Error?g.message:"Action failed. Try again.")}finally{h(!1)}}}if(n.status==="loading")return e.jsxs("div",{className:M.panel,children:[e.jsx(K,{width:"60%"}),e.jsx(K,{width:"30%"}),e.jsx(K,{width:"90%"})]});if(n.status==="error"||!n.data)return e.jsx("div",{className:M.error,role:"alert",children:n.error?.message??"Failed to load this proposal."});const p=n.data,x=p.decisionEvidence,v=C_(x.decisions),w=v?.judgeReasonCode?S_[v.judgeReasonCode]:null,L=p.status==="pending";return e.jsxs("div",{className:M.panel,children:[e.jsxs("header",{className:M.header,children:[e.jsxs("div",{className:M.titleRow,children:[e.jsx("h2",{className:M.title,children:p.title}),n.status==="refreshing"?e.jsx(ae,{}):null]}),e.jsxs("div",{className:M.metaRow,children:[e.jsx(U,{status:p.status}),e.jsx("span",{className:M.metaItem,children:p.kind}),e.jsx("span",{className:M.metaItem,title:p.repo??void 0,children:p.repo??"no repo"}),e.jsxs("span",{className:M.metaItem,children:["created ",Is(p.createdAt)]}),p.decidedAt?e.jsxs("span",{className:M.metaItem,children:["decided ",Is(p.decidedAt)]}):null,p.riskClass?e.jsxs("span",{className:`${M.riskBadge} ${M[`risk_${p.riskClass}`]}`,children:[p.riskClass," risk"]}):null]}),p.summary?e.jsx("p",{className:M.summary,children:p.summary}):null]}),e.jsxs("section",{className:M.evidence,"aria-label":"Evidence",children:[e.jsxs("div",{className:M.evidenceRow,children:[e.jsx("span",{className:M.evidenceLabel,children:"Judge verdict"}),e.jsx(O,{quality:x.sourceQuality,label:"judge verdict",children:w?e.jsx(U,{status:v.judgeReasonCode,tone:w.tone,children:w.label}):e.jsx("span",{className:M.muted,children:"not yet judged"})})]}),v?.judgeRationaleState?e.jsxs("p",{className:M.rationaleNote,children:["Model rationale:"," ",v.judgeRationaleState==="not-persisted"?"not persisted":"legacy (redacted)"]}):null,p.decisionReason?e.jsxs("div",{className:M.evidenceRow,children:[e.jsx("span",{className:M.evidenceLabel,children:"Decision reason"}),e.jsx("span",{children:p.decisionReason})]}):null,p.verifyResult?e.jsxs("div",{className:M.evidenceRow,children:[e.jsx("span",{className:M.evidenceLabel,children:"Verification"}),e.jsxs("div",{children:[e.jsx(U,{status:p.verifyResult.passed?"success":"failed",children:p.verifyResult.passed?"passed":"failed"}),p.verifyResult.ran&&p.verifyResult.ran.length>0?e.jsxs("span",{className:M.muted,children:[" · ran ",p.verifyResult.ran.map(g=>g.kind).join(", ")]}):null,p.verifyResult.failed&&p.verifyResult.failed.length>0?e.jsxs("p",{className:M.failedChecks,children:["Failed: ",p.verifyResult.failed.join(", ")]}):null]})]}):null,p.evidenceOutcome?e.jsxs("div",{className:M.evidenceRow,children:[e.jsx("span",{className:M.evidenceLabel,children:"Gates"}),e.jsxs("span",{className:M.muted,children:[p.evidenceOutcome.gateCount??0," gate",p.evidenceOutcome.gateCount===1?"":"s",p.evidenceOutcome.policyAction?` · policy: ${p.evidenceOutcome.policyAction}`:"",p.evidenceOutcome.trustBasis?` · trust: ${p.evidenceOutcome.trustBasis}`:""]})]}):null,p.result?e.jsxs("div",{className:M.evidenceRow,children:[e.jsx("span",{className:M.evidenceLabel,children:"Result"}),e.jsx("span",{children:p.result})]}):null]}),e.jsx("section",{className:M.diffSection,"aria-label":"Diff",children:e.jsx(ta,{diff:p.diff,proposalKind:p.kind})}),L?e.jsxs("footer",{className:M.actions,children:[m&&!d?e.jsx("p",{className:M.actionError,role:"alert",children:m}):null,e.jsx("p",{className:M.actionConsequence,children:Ps(p.kind,p.repo)}),e.jsx("button",{type:"button",className:M.rejectButton,onClick:()=>j("reject"),children:"Reject"}),e.jsx("button",{type:"button",className:M.approveButton,onClick:()=>j("approve"),children:"Approve"})]}):e.jsxs("footer",{className:M.decided,children:["This proposal is already ",e.jsx("strong",{children:p.status})," — no further action available."]}),e.jsx($t,{open:l,onClose:b,reason:a==="approve"?"Approving a proposal mutates the fleet and requires the dispatch token.":"Rejecting a proposal requires the dispatch token."}),e.jsx(es,{open:d,onClose:()=>{i(!1),r(null),f(null)},title:a==="approve"?"Approve this proposal?":"Reject this proposal?",body:a==="approve"?e.jsxs(e.Fragment,{children:["This applies ",e.jsx("strong",{children:p.title})," to ",e.jsx("code",{children:p.repo})," now."," ",Ps(p.kind,p.repo)," Review the diff above before confirming."]}):e.jsxs(e.Fragment,{children:["This rejects ",e.jsx("strong",{children:p.title})," and discards it. It stays visible in history (status: rejected) but will never be applied. Nothing is written to ",e.jsx("code",{children:p.repo}),"."]}),confirmLabel:a==="approve"?p.kind==="pr"?"Approve and open the pull request":"Approve and apply":"Reject",destructive:a==="approve",busy:u,error:m,onConfirm:()=>void _()})]})}const L_="_view_19z5m_1",T_="_header_19z5m_8",E_="_title_19z5m_14",A_="_subtitle_19z5m_20",D_="_dispatchBanner_19z5m_25",M_="_layout_19z5m_39",I_="_listPane_19z5m_57",P_="_detailPane_19z5m_61",q_="_emptyDetail_19z5m_69",B_="_hint_19z5m_81",we={view:L_,header:T_,title:E_,subtitle:A_,dispatchBanner:D_,layout:M_,listPane:I_,detailPane:P_,emptyDetail:q_,hint:B_};function qs(){const{id:t}=as(),[s,n]=c.useState(!1);return e.jsxs("div",{className:we.view,children:[e.jsxs("header",{className:we.header,children:[e.jsx("h1",{className:we.title,children:"Inbox"}),e.jsx("p",{className:we.subtitle,children:"Review proposals, inspect diffs and judge evidence, approve or reject."})]}),s?e.jsxs("div",{className:we.dispatchBanner,role:"alert",children:["This server was started without ",e.jsx("code",{children:"--allow-dispatch"}),", so approve/reject are read-only right now. Restart ",e.jsx("code",{children:"ashlr serve --allow-dispatch"})," to enable them. Browsing and diff review still work."]}):null,e.jsxs("div",{className:we.layout,children:[e.jsx("div",{className:we.listPane,children:e.jsx(t_,{selectedId:t??null,onDispatchDisabled:()=>n(!0)})}),e.jsx("div",{className:we.detailPane,children:t?e.jsx(R_,{id:t,onDispatchDisabled:()=>n(!0)}):e.jsxs("div",{className:we.emptyDetail,children:[e.jsx("p",{children:"Select a proposal to review its diff and evidence."}),e.jsx("p",{className:we.hint,children:"↑/↓ to move · Enter to open · Space to select · / to search"})]})})]})]})}const O_="_cockpit_1km3b_1",F_="_decisionSpine_1km3b_9",U_="_mission_1km3b_18",H_="_titleLine_1km3b_25",G_="_revision_1km3b_39",W_="_northStar_1km3b_44",Q_="_bottleneck_1km3b_52",V_="_nextActionLabel_1km3b_60",z_="_fieldLabel_1km3b_61",K_="_nextAction_1km3b_60",J_="_exception_1km3b_79",Y_="_attention_1km3b_84",X_="_clear_1km3b_89",Z_="_spectrum_1km3b_106",ex="_bets_1km3b_107",tx="_sectionHeading_1km3b_113",sx="_capabilityList_1km3b_133",nx="_betList_1km3b_134",ax="_capabilityLane_1km3b_141",rx="_bet_1km3b_107",lx="_laneIdentity_1km3b_155",ox="_laneName_1km3b_162",ix="_headroomTrack_1km3b_167",cx="_headroomFill_1km3b_174",dx="_ample_1km3b_181",ux="_usable_1km3b_182",hx="_tight_1km3b_183",mx="_none_1km3b_184",px="_unknown_1km3b_185",fx="_allocation_1km3b_187",_x="_reset_1km3b_188",xx="_betAllocation_1km3b_189",gx="_assurance_1km3b_190",jx="_betDecision_1km3b_216",vx="_betEvidence_1km3b_217",bx="_betThesis_1km3b_227",yx="_empty_1km3b_251",wx="_omitted_1km3b_252",Nx="_authorityNote_1km3b_253",I={cockpit:O_,decisionSpine:F_,mission:U_,titleLine:H_,revision:G_,northStar:W_,bottleneck:Q_,nextActionLabel:V_,fieldLabel:z_,nextAction:K_,exception:J_,attention:Y_,clear:X_,spectrum:Z_,bets:ex,sectionHeading:tx,capabilityList:sx,betList:nx,capabilityLane:ax,bet:rx,laneIdentity:lx,laneName:ox,headroomTrack:ix,headroomFill:cx,ample:dx,usable:ux,tight:hx,none:mx,unknown:px,allocation:fx,reset:_x,betAllocation:xx,assurance:gx,betDecision:jx,betEvidence:vx,betThesis:bx,empty:yx,omitted:wx,authorityNote:Nx},kx=3;function kn(t){return t==="complete"?"success":t==="pending"?"running":t==="incomplete"?"warning":"unknown"}function $x(t){return t==="ready"?"success":t==="tight"?"warning":t==="unavailable"?"danger":"unknown"}function Sx(t){return t==="continue"?"running":t==="observing"?"info":"warning"}function Cx(t){return t==="effective"?"success":t==="refuted"?"danger":t==="pending"?"running":"unknown"}function Rx({capability:t}){return e.jsxs("li",{className:I.capabilityLane,children:[e.jsxs("div",{className:I.laneIdentity,children:[e.jsx("span",{className:I.laneName,children:t.label}),e.jsx(U,{status:t.state,tone:$x(t.state)})]}),e.jsx("div",{className:I.headroomTrack,role:"img","aria-label":`${t.label} headroom: ${t.headroom}`,children:e.jsx("span",{className:`${I.headroomFill} ${I[t.headroom]}`})}),e.jsx("span",{className:I.allocation,children:t.allocationLabel}),e.jsx("span",{className:I.reset,"data-urgency":t.resetUrgency,children:t.resetLabel})]})}function Lx({bet:t}){return e.jsxs("li",{className:I.bet,children:[e.jsxs("div",{className:I.betDecision,children:[e.jsx(U,{status:t.decision,tone:Sx(t.decision)}),e.jsx("span",{className:I.assurance,children:t.assurance})]}),e.jsxs("div",{className:I.betThesis,children:[e.jsx("h3",{children:t.title}),e.jsx("p",{children:t.valueCase})]}),e.jsx("span",{className:I.betAllocation,children:t.allocationLabel}),e.jsxs("div",{className:I.betEvidence,children:[e.jsxs("span",{children:[e.jsx("span",{className:I.fieldLabel,children:"Outcome"}),e.jsx(U,{status:t.outcome.state,tone:Cx(t.outcome.state),children:t.outcome.label})]}),e.jsxs("span",{children:[e.jsx("span",{className:I.fieldLabel,children:"Evidence"}),e.jsx(U,{status:t.evidence.state,tone:kn(t.evidence.state),children:t.evidence.label})]})]})]})}function Tx({snapshot:t}){const s=t.activeValueBets.slice(0,kx),n=Math.max(0,t.activeValueBets.length-s.length),a=t.nextAction;return e.jsxs("section",{className:I.cockpit,"aria-labelledby":"agent-os-title",children:[e.jsxs("header",{className:I.decisionSpine,children:[e.jsxs("div",{className:I.mission,children:[e.jsxs("div",{className:I.titleLine,children:[e.jsx("h2",{id:"agent-os-title",children:"Agent OS"}),e.jsx(U,{status:t.sourceState,tone:t.sourceState==="healthy"?"success":t.sourceState==="degraded"?"warning":"unknown"}),e.jsx("span",{className:I.revision,children:t.livingEndState.revisionLabel})]}),e.jsx("p",{className:I.northStar,children:t.livingEndState.northStar}),e.jsxs("p",{className:I.bottleneck,children:[e.jsx("span",{children:"Current bottleneck"}),t.livingEndState.currentBottleneck]})]}),e.jsxs("aside",{className:`${I.nextAction} ${a?I[a.kind]:I.clear}`,"aria-label":"Exception-first next action",children:[e.jsx("span",{className:I.nextActionLabel,children:"Next action"}),e.jsx("strong",{children:a?.title??"No verified next action available"}),e.jsx("p",{children:a?.reason??"No exception or clearance evidence was provided."}),a?e.jsxs(U,{status:a.evidenceState,tone:kn(a.evidenceState),children:[a.evidenceState," evidence"]}):null]})]}),e.jsxs("section",{className:I.spectrum,"aria-labelledby":"capability-spectrum-title",children:[e.jsxs("div",{className:I.sectionHeading,children:[e.jsx("h3",{id:"capability-spectrum-title",children:"Capability spectrum"}),e.jsx("p",{children:"Usable model runway, ordered by reset urgency"})]}),t.capabilitySpectrum.length>0?e.jsx("ul",{className:I.capabilityList,children:t.capabilitySpectrum.map(r=>e.jsx(Rx,{capability:r},r.lane))}):e.jsx("p",{className:I.empty,children:"Capability evidence is not available."})]}),e.jsxs("section",{className:I.bets,"aria-labelledby":"active-value-bets-title",children:[e.jsxs("div",{className:I.sectionHeading,children:[e.jsx("h3",{id:"active-value-bets-title",children:"Active value bets"}),e.jsxs("p",{children:[s.length," of 3 portfolio slots visible"]})]}),s.length>0?e.jsx("ol",{className:I.betList,children:s.map(r=>e.jsx(Lx,{bet:r},r.key))}):e.jsx("p",{className:I.empty,children:"No active value bet is verified."}),n>0?e.jsxs("p",{className:I.omitted,children:[n," lower-ranked ",n===1?"bet is":"bets are"," held outside this view."]}):null]}),e.jsx("p",{className:I.authorityNote,children:"Observation only. This view cannot dispatch, merge, release, deploy, or change policy."})]})}const Ex="_view_k4f4y_1",Ax="_header_k4f4y_8",Dx="_eyebrow_k4f4y_15",Mx="_title_k4f4y_24",Ix="_subtitle_k4f4y_31",Px="_freshness_k4f4y_37",qx="_loading_k4f4y_44",Bx="_unavailable_k4f4y_45",Ox="_unavailableHeading_k4f4y_75",Fx="_boundary_k4f4y_82",ce={view:Ex,header:Ax,eyebrow:Dx,title:Mx,subtitle:Ix,freshness:Px,loading:qx,unavailable:Bx,unavailableHeading:Ox,boundary:Fx};function Nt(t){return t.authority==="observation-only"&&t.sameUserTamperResistant===!1&&t.rollbackProtected===!1&&t.historicalAuthority===!1&&t.executionAuthority===!1&&t.proposalAuthority===!1&&t.mergeAuthority===!1&&t.deployAuthority===!1&&t.publicationAuthority===!1&&t.externalMutationAuthority===!1}function Ux(t){return t.reason?t.reason:t.sourceState==="missing"?"No authenticated Agent OS snapshot has been recorded.":t.authentication!=="authenticated"?"Snapshot authentication is unavailable or invalid.":t.sameUserTamperResistant!==!1?"The response made an unsupported same-user tamper-resistance claim.":Nt(t)?t.complete?t.snapshot?"The Agent OS snapshot is degraded.":"No verified Agent OS snapshot is available.":"The snapshot chain is incomplete.":"The response crossed the observation-only authority boundary."}function Hx(t){return t.sourceState==="healthy"&&t.complete&&t.authentication==="authenticated"&&Nt(t)&&t.snapshot!==null?"success":t.sourceState==="degraded"||t.authentication==="invalid"||!Nt(t)?"warning":"unknown"}function Gx(){const t=c.useRef(null);Ne("/agent-os",t);const s=q(Vn),n=s.data,a=n?.sourceState==="healthy"&&n.complete&&n.authentication==="authenticated"&&Nt(n)&&n.snapshot!==null;return e.jsxs("div",{ref:t,className:ce.view,children:[e.jsxs("header",{className:ce.header,children:[e.jsxs("div",{children:[e.jsx("p",{className:ce.eyebrow,children:"Overview"}),e.jsx("h1",{className:ce.title,children:"Agent-native engineering OS"}),e.jsx("p",{className:ce.subtitle,children:"Authenticated fleet intelligence. Observation only."})]}),e.jsxs("div",{className:ce.freshness,"aria-live":"polite",children:[s.status==="refreshing"?e.jsx(ae,{}):null,n?e.jsx(U,{status:n.sourceState,tone:Hx(n),children:n.sourceState}):null]})]}),s.status==="loading"?e.jsxs("section",{className:ce.loading,"aria-label":"Loading Agent OS snapshot",children:[e.jsx(K,{width:"65%"}),e.jsx(K,{width:"90%"}),e.jsx(K,{width:"75%"})]}):s.status==="error"?e.jsxs("section",{className:ce.unavailable,role:"alert",children:[e.jsx("h2",{children:"Agent OS snapshot unavailable"}),e.jsx("p",{children:s.error?.message??"The read-only Agent OS endpoint could not be reached."}),e.jsx("p",{className:ce.boundary,children:"No capability, value, or next-action values are inferred when the source cannot be read."})]}):n&&a&&n.snapshot?e.jsx(Tx,{snapshot:n.snapshot}):n?e.jsxs("section",{className:ce.unavailable,role:"status",children:[e.jsxs("div",{className:ce.unavailableHeading,children:[e.jsx("h2",{children:n.sourceState==="missing"?"No Agent OS snapshot yet":"Agent OS snapshot degraded"}),e.jsx(U,{status:n.authentication,tone:n.authentication==="authenticated"?"success":"warning"})]}),e.jsx("p",{children:Ux(n)}),e.jsx("p",{className:ce.boundary,children:"The cockpit remains hidden until a complete authenticated observation-only snapshot is available."})]}):e.jsxs("section",{className:ce.unavailable,role:"status",children:[e.jsx("h2",{children:"Agent OS snapshot unavailable"}),e.jsx("p",{children:"No response was provided by the read-only Agent OS endpoint."})]})]})}function Wx(){return e.jsx(nr,{children:e.jsxs(X,{element:e.jsx(po,{}),children:[e.jsx(X,{index:!0,element:e.jsx(js,{to:"/overview",replace:!0})}),gn.map(t=>t.implemented?null:e.jsx(X,{path:t.path,element:e.jsx(jo,{title:t.label,description:t.description})},t.path)),e.jsx(X,{path:"/overview",element:e.jsx(ri,{})}),e.jsx(X,{path:"/agent-os",element:e.jsx(Gx,{})}),e.jsx(X,{path:"/universe",element:e.jsx(Xn,{})}),e.jsx(X,{path:"/journal",element:e.jsx(Dc,{})}),e.jsx(X,{path:"/intelligence/pulse",element:e.jsx(Kc,{})}),e.jsx(X,{path:"/intelligence/genome",element:e.jsx(bd,{})}),e.jsx(X,{path:"/intelligence/production",element:e.jsx(Ud,{})}),e.jsx(X,{path:"/portfolio",element:e.jsx(uu,{})}),e.jsx(X,{path:"/work/runs",element:e.jsx(Uu,{})}),e.jsx(X,{path:"/work/runs/:id",element:e.jsx(xh,{})}),e.jsx(X,{path:"/work/swarms",element:e.jsx(Gh,{})}),e.jsx(X,{path:"/work/swarms/:id",element:e.jsx(Bm,{})}),e.jsx(X,{path:"/control/daemon",element:e.jsx(op,{})}),e.jsx(X,{path:"/control/fleet",element:e.jsx(Lp,{})}),e.jsx(X,{path:"/control/security",element:e.jsx(tf,{})}),e.jsx(X,{path:"/goals",element:e.jsx(Cf,{})}),e.jsx(X,{path:"/inbox",element:e.jsx(qs,{})}),e.jsx(X,{path:"/inbox/:id",element:e.jsx(qs,{})}),e.jsx(X,{path:"*",element:e.jsx(js,{to:"/overview",replace:!0})})]})})}function Qx(t){c.useEffect(()=>{if(t!=="checking")return;let s=!1;return ft(Me.key,Me.fetch).then(()=>{if(s)return;const n=at(Me.key);Dn(n.status==="success")}),()=>{s=!0}},[t])}function ig(){const t=Tn();return Qx(t),e.jsx(Yn,{children:t==="checking"?e.jsx("div",{"aria-live":"polite",className:"visually-hidden",children:"Checking for an existing session…"}):t==="unauthenticated"?e.jsx(En,{}):e.jsxs(Sr,{children:[e.jsx(An,{}),e.jsx(Wx,{})]})})}export{ig as App};
|
|
16
|
-
//# sourceMappingURL=App-
|
|
16
|
+
//# sourceMappingURL=App-CsbPYQqy.js.map
|