@tangle-network/sandbox-cli 0.21.27 → 0.21.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/graph-viewer/{Analytics-DocMpB6T.js → Analytics-DFWW8Phh.js} +260 -275
  2. package/dist/graph-viewer/Checks-qgqV4xgV.js +155 -0
  3. package/dist/graph-viewer/{Conversations-CISiWrR9.js → Conversations-CGB45kpj.js} +112 -80
  4. package/dist/graph-viewer/{Files-Dh8p_Fpw.js → Files-DtZhf0ii.js} +121 -106
  5. package/dist/graph-viewer/LiveRun-C21wUKAY.js +210 -0
  6. package/dist/graph-viewer/Overview-BjeLsA2I.js +506 -0
  7. package/dist/graph-viewer/{RunPage-nJwCsArn.js → RunPage-CkkcBEUe.js} +22 -22
  8. package/dist/graph-viewer/{Timeline-bPjhV3il.js → Timeline-C2Xolk0t.js} +84 -84
  9. package/dist/graph-viewer/{Today-pebCsPJ1.js → Today-BVVDtSVN.js} +65 -58
  10. package/dist/graph-viewer/Topology-DO5XX8e4.js +545 -0
  11. package/dist/graph-viewer/{Traces-C5x2UvJh.js → Traces-BhMxjNgw.js} +79 -52
  12. package/dist/graph-viewer/{WallPages-DSmRm2v3.js → WallPages-4d9QUZDq.js} +3 -3
  13. package/dist/graph-viewer/index.js +103 -102
  14. package/dist/graph-viewer/{lazy-pages-CpmkG5o2.js → lazy-pages-DM0cZM10.js} +4 -4
  15. package/dist/graph-viewer/{record-part-Cx9GDQeo.js → record-part-CZal_IMH.js} +382 -352
  16. package/dist/graph-viewer/report-viewer.js +7 -7
  17. package/dist/graph-viewer/styles.css +596 -284
  18. package/dist/graph-viewer/{ui-CEhDqce8.js → ui-D8QZRsC3.js} +143 -111
  19. package/dist/graph-viewer/viewer/{AgentGraphCanvas-D7jjAE6i-DecKyUGA.js → AgentGraphCanvas-CMdOlSlh-4EervjeC.js} +54 -48
  20. package/dist/graph-viewer/viewer/{Analytics-CtKucZjs.js → Analytics-DD__nbLm.js} +203 -218
  21. package/dist/graph-viewer/viewer/{AnswerStrip-DsI9aF-i.js → AnswerStrip-CGUyXuYH.js} +2 -2
  22. package/dist/graph-viewer/viewer/Checks-Ds5M7eAW.js +156 -0
  23. package/dist/graph-viewer/viewer/{Conversations-DQBCyko6.js → Conversations-C1n0EBBd.js} +124 -92
  24. package/dist/graph-viewer/viewer/{Files-B-g25gSO.js → Files-Cjr7NMU_.js} +63 -48
  25. package/dist/graph-viewer/viewer/{LiveRun-BMQnTpTZ.js → LiveRun-uPTkPSjo.js} +1223 -1164
  26. package/dist/graph-viewer/viewer/{Outputs-DXnN1wEQ.js → Outputs-CumGyjQo.js} +6 -6
  27. package/dist/graph-viewer/viewer/Overview-4Umk14_2.js +507 -0
  28. package/dist/graph-viewer/viewer/{RunPage-ChipoSdO.js → RunPage-DZlBW7Va.js} +28 -28
  29. package/dist/graph-viewer/viewer/{Scores-CjriXjf_.js → Scores-ZS16yk0n.js} +3 -3
  30. package/dist/graph-viewer/viewer/{Timeline-DzEzobA0.js → Timeline-BnK6-yBR.js} +24 -24
  31. package/dist/graph-viewer/viewer/{Today-DLHe_wTA.js → Today-a_-oNigi.js} +69 -62
  32. package/dist/graph-viewer/viewer/Topology-CQPCLQT6.js +546 -0
  33. package/dist/graph-viewer/viewer/{Traces-BWBulSPE.js → Traces-C0IGk0L4.js} +75 -48
  34. package/dist/graph-viewer/viewer/{WallPages-Crj-qPoK.js → WallPages-CzWpyIfp.js} +8 -8
  35. package/dist/graph-viewer/viewer/{WorkflowGraph-DYsP_Kcg-C0O7M5iH.js → WorkflowGraph-DZ3xejKE-jRXKeSrg.js} +6 -6
  36. package/dist/graph-viewer/viewer/{agent-timeline-C-UIhXgu.js → agent-timeline-Cs9Qbpvo.js} +437 -425
  37. package/dist/graph-viewer/viewer/{bot-Bivadvxn.js → bot-D6Nrej7Z.js} +1 -1
  38. package/dist/graph-viewer/viewer/{chevron-right-WW7tFY6B.js → chevron-right-D_5IKLxu.js} +1 -1
  39. package/dist/graph-viewer/viewer/{createLucideIcon-Z6KTw8ff.js → createLucideIcon-yH0cxLMy.js} +1 -1
  40. package/dist/graph-viewer/viewer/{data-azhapQrS.js → data-CkWfWr7i.js} +1 -1
  41. package/dist/graph-viewer/viewer/{dist-CyOc-K4O.js → dist-C1-7EfoW.js} +3 -3
  42. package/dist/graph-viewer/viewer/{file-text-B34N7Soo.js → file-text-m7a3piQF.js} +1 -1
  43. package/dist/graph-viewer/viewer/{final-output-Db2D9cMT.js → final-output-kwY11u9X.js} +1 -1
  44. package/dist/graph-viewer/viewer/{highlights-Bgg6O5ub.js → highlights-Btsi5OXl.js} +2 -2
  45. package/dist/graph-viewer/viewer/{jsx-runtime-BSzbUOFc.js → jsx-runtime-DQWyJOhv.js} +1 -1
  46. package/dist/graph-viewer/viewer/{lazy-pages-fgtpXQ00.js → lazy-pages-BowaGsg-.js} +6 -6
  47. package/dist/graph-viewer/viewer/{markdown-BpJEJUTW.js → markdown-CX_sVrXB.js} +17 -17
  48. package/dist/graph-viewer/viewer/{model-brand-bTcMjQtB-C9bHPsPk.js → model-brand-bTcMjQtB-fagiBQam.js} +3 -3
  49. package/dist/graph-viewer/viewer/{page-header-C6YCPkzJ.js → page-header-Brq611fd.js} +3 -3
  50. package/dist/graph-viewer/viewer/{popover-DrLB9iar.js → popover-CvOAjlnk.js} +4 -4
  51. package/dist/graph-viewer/viewer/{react-CisnW4fB.js → react-CY3IbSNO.js} +24 -24
  52. package/dist/graph-viewer/viewer/{react-dom-C5NDYQCD.js → react-dom-t1L4_-il.js} +1 -1
  53. package/dist/graph-viewer/viewer/{record-part-d0gKKrMI.js → record-part-D3_Anfpe.js} +455 -425
  54. package/dist/graph-viewer/viewer/{segmented-control-ChhLMa6h.js → segmented-control-BaJmvTNd.js} +39 -39
  55. package/dist/graph-viewer/viewer/{shiki-BwlTRTY6.js → shiki-Qnby7Sh6.js} +2 -2
  56. package/dist/graph-viewer/viewer/{stream-tokenizer-CaVb21TO.js → stream-tokenizer-CWtnjmRd.js} +1 -1
  57. package/dist/graph-viewer/viewer/{terminal-BxRacTx0.js → terminal-83J_I4Ne.js} +1 -1
  58. package/dist/graph-viewer/viewer/{themes-BxrCCwH5.js → themes-1i1fzpRk.js} +1 -1
  59. package/dist/graph-viewer/viewer/{ui-DZiGjPwl.js → ui-C9b1rIUH.js} +222 -190
  60. package/dist/graph-viewer/viewer/{workspace-DalRxssx.js → workspace-CekmOBs3.js} +76 -76
  61. package/dist/graph-viewer/viewer/{x-B_F8B4lq.js → x-DOc2URqZ.js} +1 -1
  62. package/dist/graph-viewer/workspace-viewer.js +103 -102
  63. package/package.json +5 -5
  64. package/dist/graph-viewer/Checks-CbnY4tuh.js +0 -113
  65. package/dist/graph-viewer/LiveRun-C-yKwkKs.js +0 -190
  66. package/dist/graph-viewer/Overview-BaXPdCFC.js +0 -477
  67. package/dist/graph-viewer/Topology-CyhuK6XW.js +0 -550
  68. package/dist/graph-viewer/viewer/Checks-DZTgeYlV.js +0 -114
  69. package/dist/graph-viewer/viewer/Overview-u7-8-rGx.js +0 -478
  70. package/dist/graph-viewer/viewer/Topology-Dsmuu27J.js +0 -551
@@ -1,30 +1,30 @@
1
1
  import { i as e } from "./rolldown-runtime-DArdT4gl.js";
2
- import { i as t, t as n } from "./jsx-runtime-BSzbUOFc.js";
3
- import { t as r } from "./react-dom-C5NDYQCD.js";
2
+ import { i as t, t as n } from "./jsx-runtime-DQWyJOhv.js";
3
+ import { t as r } from "./react-dom-t1L4_-il.js";
4
4
  //#region src/workspace/run/model.ts
5
- var i = /* @__PURE__ */ e(t(), 1), a = /* @__PURE__ */ e(r(), 1), o = (e) => e ? Date.parse(e) : NaN;
6
- function s(e, t) {
5
+ var i = /* @__PURE__ */ e(t(), 1), a = /* @__PURE__ */ e(r(), 1), o = (e) => e === "ok" || e === "done", s = (e) => e ? Date.parse(e) : NaN;
6
+ function c(e, t) {
7
7
  if (!e.length) return null;
8
8
  let n = [...e].sort((e, t) => e - t);
9
9
  return n[Math.min(n.length - 1, Math.max(0, Math.ceil(t / 100 * n.length) - 1))];
10
10
  }
11
- function c(e, t, n, r) {
11
+ function l(e, t, n, r) {
12
12
  return {
13
13
  name: e,
14
14
  calls: t.length,
15
15
  failures: n,
16
16
  ms: r,
17
17
  durations: t,
18
- p50: s(t, 50),
19
- p90: s(t, 90),
20
- p99: s(t, 99)
18
+ p50: c(t, 50),
19
+ p90: c(t, 90),
20
+ p99: c(t, 99)
21
21
  };
22
22
  }
23
- var l = (e) => e ? e.split("/").pop() ?? e : null, u = (e) => {
23
+ var u = (e) => e ? e.split("/").pop() ?? e : null, d = (e) => {
24
24
  let t = e.name ?? "", n = t.indexOf(" · ");
25
25
  return n >= 0 ? t.slice(n + 3) : null;
26
26
  };
27
- function d(e, t, n) {
27
+ function f(e, t, n) {
28
28
  return e.status === "running" || t && e.status === "waiting" ? {
29
29
  label: e.status === "waiting" ? "Waiting" : "Running",
30
30
  tone: "live"
@@ -33,7 +33,7 @@ function d(e, t, n) {
33
33
  tone: "ok"
34
34
  } : e.status === "succeeded" ? {
35
35
  label: "Done",
36
- tone: "ok"
36
+ tone: "done"
37
37
  } : e.status === "failed" ? {
38
38
  label: "Failed",
39
39
  tone: "fail"
@@ -45,20 +45,20 @@ function d(e, t, n) {
45
45
  tone: ""
46
46
  };
47
47
  }
48
- function f(e, t) {
49
- let n = e.nodes, r = new Map(e.edges.filter((e) => e.kind === "spawn").map((e) => [e.to, e.from])), i = new Set(n.map((e) => e.id)), a = n.map((e) => o(e.start)).filter(Number.isFinite), f = Number.isFinite(o(t.startedAt)) ? o(t.startedAt) : a.length ? Math.min(...a) : Date.now(), p = n.map((e) => o(e.end ?? e.lastAt)).filter(Number.isFinite), m = e.live ? Math.max(0, Date.now() - f) : t.durationMs ?? Math.max(0, (p.length ? Math.max(...p) : f) - f), h = (e) => {
48
+ function p(e, t) {
49
+ let n = e.nodes, r = new Map(e.edges.filter((e) => e.kind === "spawn").map((e) => [e.to, e.from])), i = new Set(n.map((e) => e.id)), a = n.map((e) => s(e.start)).filter(Number.isFinite), o = Number.isFinite(s(t.startedAt)) ? s(t.startedAt) : a.length ? Math.min(...a) : Date.now(), p = n.map((e) => s(e.end ?? e.lastAt)).filter(Number.isFinite), m = e.live ? Math.max(0, Date.now() - o) : t.durationMs ?? Math.max(0, (p.length ? Math.max(...p) : o) - o), h = (e) => {
50
50
  let t = r.get(e.id);
51
51
  if (t && i.has(t)) return t;
52
52
  let n = e.id.lastIndexOf(":"), a = n > 0 ? e.id.slice(0, n) : null;
53
53
  return a && i.has(a) ? a : null;
54
54
  }, g = n.map((t) => {
55
55
  let n = t.usage ?? null, r = (n?.steps ?? []).map((e) => ({
56
- t: e.startMs - f,
56
+ t: e.startMs - o,
57
57
  d: Math.max(0, e.endMs - e.startMs),
58
58
  kind: e.kind,
59
59
  failed: !!e.failed,
60
60
  tool: e.kind === "tool" ? e.tool ?? e.name?.split(" · ")[0] ?? "tool" : null,
61
- target: e.kind === "tool" ? u(e) : null,
61
+ target: e.kind === "tool" ? d(e) : null,
62
62
  model: e.model ?? null,
63
63
  latency: e.kind === "model" ? e.latencyMs ?? Math.max(0, e.endMs - e.startMs) : null,
64
64
  tokens: e.byClass ? {
@@ -79,12 +79,12 @@ function f(e, t) {
79
79
  };
80
80
  t.d.push(e.d), t.f += +!!e.failed, t.ms += e.d, a.set(e.tool, t);
81
81
  }
82
- let p = a.size ? [...a].map(([e, t]) => c(e, t.d, t.f, t.ms)) : Object.entries(n?.tools ?? {}).map(([e, t]) => ({
83
- ...c(e, [], t.failures, t.ms),
82
+ let p = a.size ? [...a].map(([e, t]) => l(e, t.d, t.f, t.ms)) : Object.entries(n?.tools ?? {}).map(([e, t]) => ({
83
+ ...l(e, [], t.failures, t.ms),
84
84
  calls: t.calls
85
85
  }));
86
86
  p.sort((e, t) => t.calls - e.calls || e.name.localeCompare(t.name));
87
- let m = i.map((e) => e.latency).filter((e) => Number.isFinite(e)), g = r.map((e) => e.t + e.d), _ = Number.isFinite(o(t.start)) ? o(t.start) - f : r[0]?.t ?? null, v = Number.isFinite(o(t.end)) ? o(t.end) - f : g.length ? Math.max(...g) : null, y = a.size ? r.filter((e) => e.kind === "tool").length : p.reduce((e, t) => e + t.calls, 0);
87
+ let m = i.map((e) => e.latency).filter((e) => Number.isFinite(e)), g = r.map((e) => e.t + e.d), _ = Number.isFinite(s(t.start)) ? s(t.start) - o : r[0]?.t ?? null, v = Number.isFinite(s(t.end)) ? s(t.end) - o : g.length ? Math.max(...g) : null, y = a.size ? r.filter((e) => e.kind === "tool").length : p.reduce((e, t) => e + t.calls, 0);
88
88
  return {
89
89
  id: t.id,
90
90
  name: t.role ?? t.label,
@@ -95,8 +95,8 @@ function f(e, t) {
95
95
  depth: 0,
96
96
  team: null,
97
97
  status: t.status,
98
- state: d(t, e.live, r.length),
99
- model: l(t.model ?? Object.keys(n?.models ?? {})[0]),
98
+ state: f(t, e.live, r.length),
99
+ model: u(t.model ?? Object.keys(n?.models ?? {})[0]),
100
100
  harness: t.harness,
101
101
  start: _,
102
102
  end: v,
@@ -111,9 +111,9 @@ function f(e, t) {
111
111
  toolFailures: r.length ? r.filter((e) => e.kind === "tool" && e.failed).length : n?.failures?.tool ?? 0,
112
112
  retries: (n?.retries?.model ?? 0) + (n?.retries?.tool ?? 0),
113
113
  latency: m.length ? {
114
- p50: s(m, 50),
115
- p90: s(m, 90),
116
- p99: s(m, 99)
114
+ p50: c(m, 50),
115
+ p90: c(m, 90),
116
+ p99: c(m, 99)
117
117
  } : {
118
118
  p50: n?.latencyMs?.p50 ?? null,
119
119
  p90: n?.latencyMs?.p90 ?? null,
@@ -123,7 +123,7 @@ function f(e, t) {
123
123
  busy: r.filter((e) => e.kind !== "waiting").reduce((e, t) => e + t.d, 0),
124
124
  first: r.length ? r[0].t : null,
125
125
  last: g.length ? Math.max(...g) : null,
126
- restarts: (t.restarts ?? []).map((e) => o(e) - f).filter(Number.isFinite),
126
+ restarts: (t.restarts ?? []).map((e) => s(e) - o).filter(Number.isFinite),
127
127
  turns: t.turns ?? null,
128
128
  commits: typeof t.shipped == "number" ? t.shipped : null
129
129
  };
@@ -163,13 +163,13 @@ function f(e, t) {
163
163
  };
164
164
  t.d.push(e.d), t.f += +!!e.failed, t.ms += e.d, D.set(e.tool, t);
165
165
  }
166
- let O = [...D].map(([e, t]) => c(e, t.d, t.f, t.ms)).sort((e, t) => t.calls - e.calls), k = e.runUsage ?? null, A = (e) => g.some((t) => e(t) !== null) ? g.reduce((t, n) => t + (e(n) ?? 0), 0) : null, j = E.map(({ step: e }) => e.t + e.d), M = e.releases.map((e) => ({
166
+ let O = [...D].map(([e, t]) => l(e, t.d, t.f, t.ms)).sort((e, t) => t.calls - e.calls), k = e.runUsage ?? null, A = (e) => g.some((t) => e(t) !== null) ? g.reduce((t, n) => t + (e(n) ?? 0), 0) : null, j = E.map(({ step: e }) => e.t + e.d), M = e.releases.map((e) => ({
167
167
  ...e,
168
168
  tagged: !!e.taggedAt,
169
169
  taggedAt: e.taggedAt ?? e.at ?? null
170
170
  }));
171
171
  return {
172
- t0: f,
172
+ t0: o,
173
173
  duration: m,
174
174
  live: e.live,
175
175
  agents: g,
@@ -194,8 +194,8 @@ function f(e, t) {
194
194
  lastStep: j.length ? Math.max(...j) : null
195
195
  },
196
196
  pauses: (e.pauses ?? []).map((e) => ({
197
- from: o(e.from) - f,
198
- to: o(e.to) - f,
197
+ from: s(e.from) - o,
198
+ to: s(e.to) - o,
199
199
  reason: e.reason
200
200
  })).filter((e) => Number.isFinite(e.from) && Number.isFinite(e.to)),
201
201
  releases: M,
@@ -203,7 +203,7 @@ function f(e, t) {
203
203
  ws: e
204
204
  };
205
205
  }
206
- function p(e) {
206
+ function m(e) {
207
207
  let t = /* @__PURE__ */ new Map();
208
208
  for (let n of e) for (let e of n.tools) {
209
209
  let n = t.get(e.name) ?? {
@@ -215,50 +215,79 @@ function p(e) {
215
215
  n.d.push(...e.durations), n.f += e.failures, n.ms += e.ms, n.calls += e.calls, t.set(e.name, n);
216
216
  }
217
217
  return [...t].map(([e, t]) => ({
218
- ...c(e, t.d, t.f, t.ms),
218
+ ...l(e, t.d, t.f, t.ms),
219
219
  calls: t.calls
220
220
  })).sort((e, t) => t.calls - e.calls);
221
221
  }
222
- var m = (e) => String(e).padStart(2, "0"), h = (e) => (t) => {
222
+ var h = (e) => String(e).padStart(2, "0"), g = (e) => (t) => {
223
223
  let n = new Date(e + t);
224
- return `${m(n.getUTCHours())}:${m(n.getUTCMinutes())}`;
225
- }, g = (e) => (t) => {
224
+ return `${h(n.getUTCHours())}:${h(n.getUTCMinutes())}`;
225
+ }, _ = (e) => (t) => {
226
226
  let n = new Date(e + t);
227
- return `${m(n.getUTCHours())}:${m(n.getUTCMinutes())}:${m(n.getUTCSeconds())}`;
228
- }, _ = (e, t, n = `${t}s`) => `${e.toLocaleString("en-US")} ${e === 1 ? t : n}`, v = (e, t, n) => {
229
- let r = h(e);
230
- return n === "now" ? `${r(t)}–now` : new Date(e + t).toISOString().slice(0, 10) === new Date(e + n).toISOString().slice(0, 10) ? `${r(t)}–${r(n)}` : `${r(t)}, ${b(n - t)}`;
231
- }, y = (e, t) => `${t ? `${new Date(e).toLocaleDateString("en-US", {
227
+ return `${h(n.getUTCHours())}:${h(n.getUTCMinutes())}:${h(n.getUTCSeconds())}`;
228
+ }, v = (e, t, n = `${t}s`) => `${e.toLocaleString("en-US")} ${e === 1 ? t : n}`, y = (e, t, n) => {
229
+ let r = g(e);
230
+ return n === "now" ? `${r(t)}–now` : new Date(e + t).toISOString().slice(0, 10) === new Date(e + n).toISOString().slice(0, 10) ? `${r(t)}–${r(n)}` : `${r(t)}, ${x(n - t)}`;
231
+ }, b = (e, t) => `${t ? `${new Date(e).toLocaleDateString("en-US", {
232
232
  month: "short",
233
233
  day: "numeric",
234
234
  timeZone: "UTC"
235
235
  })} ` : ""}${e.slice(11, 16)} UTC`;
236
- function b(e) {
236
+ function x(e) {
237
237
  if (e == null || !Number.isFinite(e)) return "—";
238
238
  if (e < 1e3) return `${Math.round(e)} ms`;
239
239
  if (e < 59500) return `${(e / 1e3).toFixed(+(e < 9950))} s`;
240
240
  if (e < 36e5) {
241
241
  let t = Math.round(e / 1e3);
242
- if (t < 3600) return t % 60 ? `${Math.floor(t / 60)}m ${m(t % 60)}s` : `${t / 60} min`;
242
+ if (t < 3600) return t % 60 ? `${Math.floor(t / 60)}m ${h(t % 60)}s` : `${t / 60} min`;
243
243
  }
244
244
  let t = Math.round(e / 6e4);
245
- return `${Math.floor(t / 60)}h ${m(t % 60)}m`;
245
+ return `${Math.floor(t / 60)}h ${h(t % 60)}m`;
246
246
  }
247
- function x(e) {
247
+ function S(e) {
248
248
  if (e == null || !Number.isFinite(e)) return "—";
249
249
  if (e < 1e3) return `${Math.round(e)}ms`;
250
250
  if (e < 59500) return `${(e / 1e3).toFixed(+(e < 9950))}s`;
251
251
  let t = Math.round(e / 1e3);
252
- return t < 3600 ? `${Math.floor(t / 60)}m${m(t % 60)}s` : b(e);
253
- }
254
- function S(e) {
255
- let t = Math.max(0, Math.round(e / 1e3)), n = Math.floor(t / 3600), r = Math.floor(t % 3600 / 60);
256
- return `+${n ? `${n}:${m(r)}` : r}:${m(t % 60)}`;
252
+ return t < 3600 ? `${Math.floor(t / 60)}m${h(t % 60)}s` : x(e);
257
253
  }
258
254
  var C = (e) => e == null ? "—" : e.toLocaleString("en-US"), w = (e) => e == null ? "—" : new Intl.NumberFormat("en-US", {
259
255
  notation: "compact",
260
256
  maximumFractionDigits: e >= 1e8 ? 0 : e >= 1e6 ? 2 : 1
261
- }).format(e), T = (e) => e == null ? "—" : e >= 100 ? `$${e.toFixed(0)}` : `$${e.toFixed(2)}`, E = n(), D = {
257
+ }).format(e), T = (e) => e == null ? "—" : e >= 100 ? `$${e.toFixed(0)}` : `$${e.toFixed(2)}`, E = (e) => e.length < 2 ? e.join("") : `${e.slice(0, -1).join(", ")} and ${e.at(-1)}`;
258
+ function D(e) {
259
+ let t = e?.latest;
260
+ if (!t) return {
261
+ word: "Not checked",
262
+ tone: "none",
263
+ note: null
264
+ };
265
+ if (t.solved) return {
266
+ word: "Passed",
267
+ tone: "ok",
268
+ note: t.tag ? `${t.tag} passed the check` : null
269
+ };
270
+ if (e?.held && (!e.held.tag || e.held.tag === t.tag)) {
271
+ let n = e.calibration?.uncalibrated ?? e.calibration?.stages?.filter((e) => e.state !== "calibrated").map((e) => e.name) ?? [];
272
+ return {
273
+ word: "Held",
274
+ tone: "held",
275
+ note: `${t.tag ? `${t.tag} passed; it` : "It"} counts once ${n.length ? `${E(n)} ${n.length === 1 ? "has" : "have"} a known-good fixture` : "its checker is calibrated"}`
276
+ };
277
+ }
278
+ return t.known ? {
279
+ word: "Not solved",
280
+ tone: "fail",
281
+ note: null
282
+ } : {
283
+ word: "No verdict",
284
+ tone: "none",
285
+ note: null
286
+ };
287
+ }
288
+ //#endregion
289
+ //#region src/workspace/run/ui.tsx
290
+ var O = n(), k = {
262
291
  search: "M11 11l3.5 3.5M7 12.5a5.5 5.5 0 1 0 0-11 5.5 5.5 0 0 0 0 11z",
263
292
  chevron: "M4 6l4 4 4-4",
264
293
  arrow: "M3 8h10M9 4l4 4-4 4",
@@ -278,36 +307,36 @@ var C = (e) => e == null ? "—" : e.toLocaleString("en-US"), w = (e) => e == nu
278
307
  down: "M8 2.5v11M3.5 9L8 13.5 12.5 9",
279
308
  file: "M9.5 1.8h-5a1.5 1.5 0 0 0-1.5 1.5v9.4a1.5 1.5 0 0 0 1.5 1.5h7a1.5 1.5 0 0 0 1.5-1.5V5.3zM9.5 1.8v3.5H13M5.5 8.5h5M5.5 11h3.5"
280
309
  };
281
- function O({ name: e, size: t = 16, className: n }) {
282
- return /* @__PURE__ */ (0, E.jsx)("svg", {
310
+ function A({ name: e, size: t = 16, className: n }) {
311
+ return /* @__PURE__ */ (0, O.jsx)("svg", {
283
312
  className: `rp-i${n ? ` ${n}` : ""}`,
284
313
  width: t,
285
314
  height: t,
286
315
  viewBox: "0 0 16 16",
287
316
  "aria-hidden": "true",
288
- children: /* @__PURE__ */ (0, E.jsx)("path", { d: D[e] })
317
+ children: /* @__PURE__ */ (0, O.jsx)("path", { d: k[e] })
289
318
  });
290
319
  }
291
- var k = ({ tone: e }) => /* @__PURE__ */ (0, E.jsx)("span", {
320
+ var j = ({ tone: e }) => /* @__PURE__ */ (0, O.jsx)("span", {
292
321
  className: `rp-dot${e ? ` ${e}` : ""}`,
293
322
  "aria-hidden": "true"
294
323
  });
295
- function A(e, t) {
324
+ function M(e, t) {
296
325
  if (e.length <= t) return e;
297
326
  let n = Math.ceil((t - 1) * .55);
298
327
  return `${e.slice(0, n)}…${e.slice(e.length - (t - 1 - n))}`;
299
328
  }
300
- var j = (e, t) => e.name.length <= t ? e.name : A(e.short, t);
301
- function M({ text: e, query: t }) {
329
+ var N = (e, t) => e.name.length <= t ? e.name : M(e.short, t);
330
+ function P({ text: e, query: t }) {
302
331
  let n = t.trim().toLowerCase(), r = n ? e.toLowerCase().indexOf(n) : -1;
303
- return r < 0 ? /* @__PURE__ */ (0, E.jsx)(E.Fragment, { children: e }) : /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [
332
+ return r < 0 ? /* @__PURE__ */ (0, O.jsx)(O.Fragment, { children: e }) : /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [
304
333
  e.slice(0, r),
305
- /* @__PURE__ */ (0, E.jsx)("mark", { children: e.slice(r, r + n.length) }),
334
+ /* @__PURE__ */ (0, O.jsx)("mark", { children: e.slice(r, r + n.length) }),
306
335
  e.slice(r + n.length)
307
336
  ] });
308
337
  }
309
- var N = (0, i.createContext)(null), P = () => (0, i.useContext)(N);
310
- function F({ children: e }) {
338
+ var F = (0, i.createContext)(null), I = () => (0, i.useContext)(F);
339
+ function L({ children: e }) {
311
340
  let [t, n] = (0, i.useState)(null), r = (0, i.useRef)(!1), o = (0, i.useRef)(0), s = (0, i.useRef)(null), c = (0, i.useMemo)(() => ({
312
341
  show: (e) => {
313
342
  r.current || (window.clearTimeout(o.current), n(e));
@@ -358,9 +387,9 @@ function F({ children: e }) {
358
387
  l = s + 14, l + n > e.r && (l = d - 14 - n), l < e.l && (l = Math.max(12, Math.min(i - n - 12, s + 14))), u = o.top + (o.bottom - o.top) / 2 - r / 2, u = r <= e.b - e.t ? Math.max(e.t, Math.min(u, e.b - r)) : Math.max(12, Math.min(u, a - r - 12));
359
388
  }
360
389
  e.style.left = `${Math.round(Math.max(12, l))}px`, e.style.top = `${Math.round(Math.max(12, Math.min(u, a - r - 12)))}px`;
361
- }, [t]), /* @__PURE__ */ (0, E.jsxs)(N.Provider, {
390
+ }, [t]), /* @__PURE__ */ (0, O.jsxs)(F.Provider, {
362
391
  value: c,
363
- children: [e, t && typeof document < "u" && (0, a.createPortal)(/* @__PURE__ */ (0, E.jsxs)("div", {
392
+ children: [e, t && typeof document < "u" && (0, a.createPortal)(/* @__PURE__ */ (0, O.jsxs)("div", {
364
393
  ref: s,
365
394
  className: `rp-hc${t.wide ? " wide" : ""}${t.follow ? " follow" : ""}`,
366
395
  role: t.pinned ? "dialog" : "tooltip",
@@ -368,12 +397,12 @@ function F({ children: e }) {
368
397
  onPointerLeave: () => {
369
398
  r.current || n(null);
370
399
  },
371
- children: [t.pinned && /* @__PURE__ */ (0, E.jsx)("button", {
400
+ children: [t.pinned && /* @__PURE__ */ (0, O.jsx)("button", {
372
401
  type: "button",
373
402
  className: "rp-card-x",
374
403
  "aria-label": "Close",
375
404
  onClick: c.hideNow,
376
- children: /* @__PURE__ */ (0, E.jsx)(O, {
405
+ children: /* @__PURE__ */ (0, O.jsx)(A, {
377
406
  name: "x",
378
407
  size: 14
379
408
  })
@@ -381,8 +410,8 @@ function F({ children: e }) {
381
410
  }), document.querySelector(".agent-record") ?? document.body)]
382
411
  });
383
412
  }
384
- function I(e, t = {}) {
385
- let n = P(), r = (r) => {
413
+ function R(e, t = {}) {
414
+ let n = I(), r = (r) => {
386
415
  let i = r.getBoundingClientRect();
387
416
  n.show({
388
417
  content: e(),
@@ -399,116 +428,116 @@ function I(e, t = {}) {
399
428
  onBlur: () => n.hide()
400
429
  };
401
430
  }
402
- function L({ tools: e, rows: t = 9 }) {
431
+ function z({ tools: e, rows: t = 9 }) {
403
432
  let n = Math.max(1, ...e.map((e) => e.calls));
404
- return /* @__PURE__ */ (0, E.jsxs)("div", {
433
+ return /* @__PURE__ */ (0, O.jsxs)("div", {
405
434
  className: "rp-tt",
406
435
  children: [
407
- /* @__PURE__ */ (0, E.jsx)("span", {
436
+ /* @__PURE__ */ (0, O.jsx)("span", {
408
437
  className: "h",
409
438
  children: "Tool"
410
439
  }),
411
- /* @__PURE__ */ (0, E.jsx)("span", { className: "h" }),
412
- /* @__PURE__ */ (0, E.jsx)("span", {
440
+ /* @__PURE__ */ (0, O.jsx)("span", { className: "h" }),
441
+ /* @__PURE__ */ (0, O.jsx)("span", {
413
442
  className: "h r",
414
443
  children: "calls"
415
444
  }),
416
- /* @__PURE__ */ (0, E.jsx)("span", {
445
+ /* @__PURE__ */ (0, O.jsx)("span", {
417
446
  className: "h r",
418
447
  children: "✕ · p50"
419
448
  }),
420
- e.slice(0, t).map((e) => /* @__PURE__ */ (0, E.jsx)(R, {
449
+ e.slice(0, t).map((e) => /* @__PURE__ */ (0, O.jsx)(B, {
421
450
  t: e,
422
451
  max: n
423
452
  }, e.name)),
424
- e.length > t && /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [
425
- /* @__PURE__ */ (0, E.jsxs)("span", {
453
+ e.length > t && /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [
454
+ /* @__PURE__ */ (0, O.jsxs)("span", {
426
455
  className: "l",
427
456
  children: [e.length - t, " more tools"]
428
457
  }),
429
- /* @__PURE__ */ (0, E.jsx)("span", {}),
430
- /* @__PURE__ */ (0, E.jsx)("span", {
458
+ /* @__PURE__ */ (0, O.jsx)("span", {}),
459
+ /* @__PURE__ */ (0, O.jsx)("span", {
431
460
  className: "r",
432
461
  children: C(e.slice(t).reduce((e, t) => e + t.calls, 0))
433
462
  }),
434
- /* @__PURE__ */ (0, E.jsx)("span", {})
463
+ /* @__PURE__ */ (0, O.jsx)("span", {})
435
464
  ] })
436
465
  ]
437
466
  });
438
467
  }
439
- function R({ t: e, max: t }) {
440
- return /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [
441
- /* @__PURE__ */ (0, E.jsx)("span", {
468
+ function B({ t: e, max: t }) {
469
+ return /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [
470
+ /* @__PURE__ */ (0, O.jsx)("span", {
442
471
  className: "l",
443
472
  title: e.name,
444
473
  children: e.name
445
474
  }),
446
- /* @__PURE__ */ (0, E.jsx)(z, {
475
+ /* @__PURE__ */ (0, O.jsx)(V, {
447
476
  ok: e.calls - e.failures,
448
477
  failed: e.failures,
449
478
  max: t
450
479
  }),
451
- /* @__PURE__ */ (0, E.jsx)("span", {
480
+ /* @__PURE__ */ (0, O.jsx)("span", {
452
481
  className: "r",
453
482
  children: C(e.calls)
454
483
  }),
455
- /* @__PURE__ */ (0, E.jsx)("span", {
484
+ /* @__PURE__ */ (0, O.jsx)("span", {
456
485
  className: e.failures ? "f" : "r",
457
- children: e.failures ? `${e.failures} ✕` : x(e.p50)
486
+ children: e.failures ? `${e.failures} ✕` : S(e.p50)
458
487
  })
459
488
  ] });
460
489
  }
461
- function z({ ok: e, failed: t = 0, max: n }) {
462
- return /* @__PURE__ */ (0, E.jsxs)("span", {
490
+ function V({ ok: e, failed: t = 0, max: n }) {
491
+ return /* @__PURE__ */ (0, O.jsxs)("span", {
463
492
  className: "rp-bar",
464
493
  "aria-hidden": "true",
465
- children: [/* @__PURE__ */ (0, E.jsx)("b", { style: { width: `${Math.max(0, e) / n * 100}%` } }), t > 0 && /* @__PURE__ */ (0, E.jsx)("b", {
494
+ children: [/* @__PURE__ */ (0, O.jsx)("b", { style: { width: `${Math.max(0, e) / n * 100}%` } }), t > 0 && /* @__PURE__ */ (0, O.jsx)("b", {
466
495
  className: "f",
467
496
  style: { width: `${t / n * 100}%` }
468
497
  })]
469
498
  });
470
499
  }
471
- var B = (e) => e.listUsd === null ? e.billedUsd === null ? "not recorded" : `${T(e.billedUsd)} billed` : `${T(e.listUsd)} list · ${T(e.billedUsd ?? 0)} billed`;
472
- function V({ m: e, a: t, head: n }) {
500
+ var H = (e) => e.listUsd === null ? e.billedUsd === null ? "not recorded" : `${T(e.billedUsd)} billed` : `${T(e.listUsd)} list · ${T(e.billedUsd ?? 0)} billed`;
501
+ function U({ m: e, a: t, head: n }) {
473
502
  let r = (t) => new Date(e.t0 + t).toISOString().slice(11, 16), i = t.parent ? e.byId.get(t.parent) : null;
474
- return /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [n ?? /* @__PURE__ */ (0, E.jsxs)("div", {
503
+ return /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [n ?? /* @__PURE__ */ (0, O.jsxs)("div", {
475
504
  className: "rp-card-h",
476
- children: [/* @__PURE__ */ (0, E.jsxs)("div", {
505
+ children: [/* @__PURE__ */ (0, O.jsxs)("div", {
477
506
  className: "t",
478
507
  children: [
479
- /* @__PURE__ */ (0, E.jsx)(k, { tone: t.state.tone }),
480
- /* @__PURE__ */ (0, E.jsx)("span", {
508
+ /* @__PURE__ */ (0, O.jsx)(j, { tone: t.state.tone }),
509
+ /* @__PURE__ */ (0, O.jsx)("span", {
481
510
  className: "nm",
482
511
  children: t.name
483
512
  }),
484
- /* @__PURE__ */ (0, E.jsx)("span", {
513
+ /* @__PURE__ */ (0, O.jsx)("span", {
485
514
  className: "v",
486
515
  children: t.state.label
487
516
  })
488
517
  ]
489
- }), /* @__PURE__ */ (0, E.jsx)("div", {
518
+ }), /* @__PURE__ */ (0, O.jsx)("div", {
490
519
  className: "s",
491
520
  children: i ? `spawned by ${i.name}${t.start === null ? "" : ` at ${r(Math.max(0, t.start))} UTC`}` : `run root · ${r(0)} UTC`
492
521
  })]
493
- }), /* @__PURE__ */ (0, E.jsxs)("div", {
522
+ }), /* @__PURE__ */ (0, O.jsxs)("div", {
494
523
  className: `rp-card-cols${t.tools.length ? " two" : ""}`,
495
- children: [/* @__PURE__ */ (0, E.jsxs)("section", { children: [/* @__PURE__ */ (0, E.jsxs)("h6", { children: ["Whole run", t.model ? ` · ${t.model}` : ""] }), /* @__PURE__ */ (0, E.jsxs)("dl", { children: [
496
- /* @__PURE__ */ (0, E.jsx)("dt", { children: "Tokens" }),
497
- /* @__PURE__ */ (0, E.jsx)("dd", { children: t.tokens === null ? "not recorded" : w(t.tokens) }),
498
- t.tokens !== null && /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [/* @__PURE__ */ (0, E.jsx)("dt", { children: "In · out · cached" }), /* @__PURE__ */ (0, E.jsx)("dd", { children: t.byClass ? `${w(t.byClass.input)} · ${w(t.byClass.output)} · ${w(t.byClass.cacheRead)}` : /* @__PURE__ */ (0, E.jsx)("small", { children: "not recorded" }) })] }),
499
- /* @__PURE__ */ (0, E.jsx)("dt", { children: "Cost" }),
500
- /* @__PURE__ */ (0, E.jsx)("dd", { children: B(t) }),
501
- /* @__PURE__ */ (0, E.jsx)("dt", { children: "Model calls" }),
502
- /* @__PURE__ */ (0, E.jsx)("dd", { children: C(t.modelCalls) }),
503
- t.latency.p50 !== null && /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [/* @__PURE__ */ (0, E.jsx)("dt", { children: "Model p50 · p90 · p99" }), /* @__PURE__ */ (0, E.jsxs)("dd", { children: [
504
- x(t.latency.p50),
524
+ children: [/* @__PURE__ */ (0, O.jsxs)("section", { children: [/* @__PURE__ */ (0, O.jsxs)("h6", { children: ["Whole run", t.model ? ` · ${t.model}` : ""] }), /* @__PURE__ */ (0, O.jsxs)("dl", { children: [
525
+ /* @__PURE__ */ (0, O.jsx)("dt", { children: "Tokens" }),
526
+ /* @__PURE__ */ (0, O.jsx)("dd", { children: t.tokens === null ? "not recorded" : w(t.tokens) }),
527
+ t.tokens !== null && /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [/* @__PURE__ */ (0, O.jsx)("dt", { children: "In · out · cached" }), /* @__PURE__ */ (0, O.jsx)("dd", { children: t.byClass ? `${w(t.byClass.input)} · ${w(t.byClass.output)} · ${w(t.byClass.cacheRead)}` : /* @__PURE__ */ (0, O.jsx)("small", { children: "not recorded" }) })] }),
528
+ /* @__PURE__ */ (0, O.jsx)("dt", { children: "Cost" }),
529
+ /* @__PURE__ */ (0, O.jsx)("dd", { children: H(t) }),
530
+ /* @__PURE__ */ (0, O.jsx)("dt", { children: "Model calls" }),
531
+ /* @__PURE__ */ (0, O.jsx)("dd", { children: C(t.modelCalls) }),
532
+ t.latency.p50 !== null && /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [/* @__PURE__ */ (0, O.jsx)("dt", { children: "Model p50 · p90 · p99" }), /* @__PURE__ */ (0, O.jsxs)("dd", { children: [
533
+ S(t.latency.p50),
505
534
  " · ",
506
- x(t.latency.p90),
535
+ S(t.latency.p90),
507
536
  " · ",
508
- x(t.latency.p99)
537
+ S(t.latency.p99)
509
538
  ] })] }),
510
- /* @__PURE__ */ (0, E.jsx)("dt", { children: "Tool calls" }),
511
- /* @__PURE__ */ (0, E.jsxs)("dd", { children: [C(t.toolCalls), t.toolFailures ? /* @__PURE__ */ (0, E.jsxs)("span", {
539
+ /* @__PURE__ */ (0, O.jsx)("dt", { children: "Tool calls" }),
540
+ /* @__PURE__ */ (0, O.jsxs)("dd", { children: [C(t.toolCalls), t.toolFailures ? /* @__PURE__ */ (0, O.jsxs)("span", {
512
541
  className: "f",
513
542
  children: [
514
543
  " · ",
@@ -516,22 +545,22 @@ function V({ m: e, a: t, head: n }) {
516
545
  " failed"
517
546
  ]
518
547
  }) : null] }),
519
- t.retries > 0 && /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [/* @__PURE__ */ (0, E.jsx)("dt", { children: "Retried steps" }), /* @__PURE__ */ (0, E.jsx)("dd", { children: t.retries })] }),
520
- /* @__PURE__ */ (0, E.jsx)("dt", { children: "Restarts" }),
521
- /* @__PURE__ */ (0, E.jsx)("dd", { children: t.restarts.length }),
522
- /* @__PURE__ */ (0, E.jsx)("dt", { children: "Spawned · commits" }),
523
- /* @__PURE__ */ (0, E.jsxs)("dd", { children: [
548
+ t.retries > 0 && /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [/* @__PURE__ */ (0, O.jsx)("dt", { children: "Retried steps" }), /* @__PURE__ */ (0, O.jsx)("dd", { children: t.retries })] }),
549
+ /* @__PURE__ */ (0, O.jsx)("dt", { children: "Restarts" }),
550
+ /* @__PURE__ */ (0, O.jsx)("dd", { children: t.restarts.length }),
551
+ /* @__PURE__ */ (0, O.jsx)("dt", { children: "Spawned · commits" }),
552
+ /* @__PURE__ */ (0, O.jsxs)("dd", { children: [
524
553
  t.children.length,
525
554
  " · ",
526
555
  t.commits ?? "—"
527
556
  ] }),
528
- /* @__PURE__ */ (0, E.jsx)("dt", { children: "Active" }),
529
- /* @__PURE__ */ (0, E.jsx)("dd", { children: t.first === null ? "never" : `${r(t.first)}–${t.state.tone === "live" ? "now" : r(t.last ?? t.first)} UTC` }),
530
- t.first !== null && /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [/* @__PURE__ */ (0, E.jsx)("dt", { children: "Busy" }), /* @__PURE__ */ (0, E.jsx)("dd", { children: b(t.busy) })] })
531
- ] })] }), t.tools.length > 0 && /* @__PURE__ */ (0, E.jsxs)("section", { children: [/* @__PURE__ */ (0, E.jsx)("h6", { children: "Tool calls by tool" }), /* @__PURE__ */ (0, E.jsx)(L, { tools: t.tools })] })]
557
+ /* @__PURE__ */ (0, O.jsx)("dt", { children: "Active" }),
558
+ /* @__PURE__ */ (0, O.jsx)("dd", { children: t.first === null ? "never" : `${r(t.first)}–${t.state.tone === "live" ? "now" : r(t.last ?? t.first)} UTC` }),
559
+ t.first !== null && /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [/* @__PURE__ */ (0, O.jsx)("dt", { children: "Busy" }), /* @__PURE__ */ (0, O.jsx)("dd", { children: x(t.busy) })] })
560
+ ] })] }), t.tools.length > 0 && /* @__PURE__ */ (0, O.jsxs)("section", { children: [/* @__PURE__ */ (0, O.jsx)("h6", { children: "Tool calls by tool" }), /* @__PURE__ */ (0, O.jsx)(z, { tools: t.tools })] })]
532
561
  })] });
533
562
  }
534
- function H({ m: e, team: t }) {
563
+ function W({ m: e, team: t }) {
535
564
  let n = t.members.map((t) => e.byId.get(t)).filter(Boolean), r = /* @__PURE__ */ new Map();
536
565
  for (let e of n) for (let t of e.tools) {
537
566
  let e = r.get(t.name) ?? {
@@ -550,39 +579,39 @@ function H({ m: e, team: t }) {
550
579
  });
551
580
  }
552
581
  let i = (e) => n.reduce((t, n) => t + e(n), 0), a = n.filter((e) => e.state.tone === "live").length;
553
- return /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [/* @__PURE__ */ (0, E.jsxs)("div", {
582
+ return /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [/* @__PURE__ */ (0, O.jsxs)("div", {
554
583
  className: "rp-card-h",
555
- children: [/* @__PURE__ */ (0, E.jsxs)("div", {
584
+ children: [/* @__PURE__ */ (0, O.jsxs)("div", {
556
585
  className: "t",
557
586
  children: [
558
- /* @__PURE__ */ (0, E.jsx)(O, { name: "users" }),
559
- /* @__PURE__ */ (0, E.jsx)("span", {
587
+ /* @__PURE__ */ (0, O.jsx)(A, { name: "users" }),
588
+ /* @__PURE__ */ (0, O.jsx)("span", {
560
589
  className: "nm",
561
590
  children: t.label
562
591
  }),
563
- /* @__PURE__ */ (0, E.jsxs)("span", {
592
+ /* @__PURE__ */ (0, O.jsxs)("span", {
564
593
  className: "v",
565
594
  children: [n.length, " agents"]
566
595
  })
567
596
  ]
568
- }), /* @__PURE__ */ (0, E.jsxs)("div", {
597
+ }), /* @__PURE__ */ (0, O.jsxs)("div", {
569
598
  className: "s",
570
599
  children: [
571
600
  a,
572
601
  " running · ",
573
- n.filter((e) => e.state.tone === "ok").length,
602
+ n.filter((e) => o(e.state.tone)).length,
574
603
  " done"
575
604
  ]
576
605
  })]
577
- }), /* @__PURE__ */ (0, E.jsxs)("div", {
606
+ }), /* @__PURE__ */ (0, O.jsxs)("div", {
578
607
  className: "rp-card-cols two",
579
- children: [/* @__PURE__ */ (0, E.jsxs)("section", { children: [/* @__PURE__ */ (0, E.jsx)("h6", { children: "Team totals" }), /* @__PURE__ */ (0, E.jsxs)("dl", { children: [
580
- /* @__PURE__ */ (0, E.jsx)("dt", { children: "Tokens" }),
581
- /* @__PURE__ */ (0, E.jsx)("dd", { children: w(i((e) => e.tokens ?? 0)) }),
582
- /* @__PURE__ */ (0, E.jsx)("dt", { children: "Model calls" }),
583
- /* @__PURE__ */ (0, E.jsx)("dd", { children: C(i((e) => e.modelCalls)) }),
584
- /* @__PURE__ */ (0, E.jsx)("dt", { children: "Tool calls" }),
585
- /* @__PURE__ */ (0, E.jsxs)("dd", { children: [C(i((e) => e.toolCalls)), /* @__PURE__ */ (0, E.jsxs)("span", {
608
+ children: [/* @__PURE__ */ (0, O.jsxs)("section", { children: [/* @__PURE__ */ (0, O.jsx)("h6", { children: "Team totals" }), /* @__PURE__ */ (0, O.jsxs)("dl", { children: [
609
+ /* @__PURE__ */ (0, O.jsx)("dt", { children: "Tokens" }),
610
+ /* @__PURE__ */ (0, O.jsx)("dd", { children: w(i((e) => e.tokens ?? 0)) }),
611
+ /* @__PURE__ */ (0, O.jsx)("dt", { children: "Model calls" }),
612
+ /* @__PURE__ */ (0, O.jsx)("dd", { children: C(i((e) => e.modelCalls)) }),
613
+ /* @__PURE__ */ (0, O.jsx)("dt", { children: "Tool calls" }),
614
+ /* @__PURE__ */ (0, O.jsxs)("dd", { children: [C(i((e) => e.toolCalls)), /* @__PURE__ */ (0, O.jsxs)("span", {
586
615
  className: "f",
587
616
  children: [
588
617
  " · ",
@@ -590,15 +619,15 @@ function H({ m: e, team: t }) {
590
619
  " failed"
591
620
  ]
592
621
  })] }),
593
- /* @__PURE__ */ (0, E.jsx)("dt", { children: "Commits" }),
594
- /* @__PURE__ */ (0, E.jsx)("dd", { children: i((e) => e.commits ?? 0) })
595
- ] })] }), /* @__PURE__ */ (0, E.jsxs)("section", { children: [/* @__PURE__ */ (0, E.jsx)("h6", { children: "Tool calls by tool" }), /* @__PURE__ */ (0, E.jsx)(L, { tools: [...r.values()].sort((e, t) => t.calls - e.calls) })] })]
622
+ /* @__PURE__ */ (0, O.jsx)("dt", { children: "Commits" }),
623
+ /* @__PURE__ */ (0, O.jsx)("dd", { children: i((e) => e.commits ?? 0) })
624
+ ] })] }), /* @__PURE__ */ (0, O.jsxs)("section", { children: [/* @__PURE__ */ (0, O.jsx)("h6", { children: "Tool calls by tool" }), /* @__PURE__ */ (0, O.jsx)(z, { tools: [...r.values()].sort((e, t) => t.calls - e.calls) })] })]
596
625
  })] });
597
626
  }
598
- var U = 36;
599
- function W(e) {
627
+ var G = 36;
628
+ function K(e) {
600
629
  let [t, n] = (0, i.useState)(!1), r = (0, i.useRef)(null);
601
- return /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [/* @__PURE__ */ (0, E.jsxs)("button", {
630
+ return /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [/* @__PURE__ */ (0, O.jsxs)("button", {
602
631
  ref: r,
603
632
  type: "button",
604
633
  className: `rp-cbx${e.className ? ` ${e.className}` : ""}`,
@@ -607,17 +636,17 @@ function W(e) {
607
636
  "aria-expanded": t,
608
637
  "aria-label": e.label,
609
638
  onClick: () => n(!t),
610
- children: [/* @__PURE__ */ (0, E.jsx)("span", {
639
+ children: [/* @__PURE__ */ (0, O.jsx)("span", {
611
640
  className: "lbl",
612
641
  children: e.children
613
- }), /* @__PURE__ */ (0, E.jsx)("span", {
642
+ }), /* @__PURE__ */ (0, O.jsx)("span", {
614
643
  className: "cv",
615
- children: /* @__PURE__ */ (0, E.jsx)(O, {
644
+ children: /* @__PURE__ */ (0, O.jsx)(A, {
616
645
  name: "chevron",
617
646
  size: 14
618
647
  })
619
648
  })]
620
- }), t && /* @__PURE__ */ (0, E.jsx)(G, {
649
+ }), t && /* @__PURE__ */ (0, O.jsx)(q, {
621
650
  ...e,
622
651
  anchor: r.current,
623
652
  onClose: (e) => {
@@ -625,7 +654,7 @@ function W(e) {
625
654
  }
626
655
  })] });
627
656
  }
628
- function G(e) {
657
+ function q(e) {
629
658
  let { options: t, groups: n, all: r, multi: o, anchor: s, onClose: c } = e, [l, u] = (0, i.useState)(""), [d, f] = (0, i.useState)(0), [p, m] = (0, i.useState)(0), h = (0, i.useRef)(null), g = (0, i.useRef)(null), _ = (0, i.useMemo)(() => `pk-${Math.random().toString(36).slice(2, 8)}`, []), v = (t) => o ? e.value.has(t) : e.value === t, y = (0, i.useMemo)(() => {
630
659
  let e = l.trim().toLowerCase(), i = (t) => !e || `${t.label} ${t.find ?? ""}`.toLowerCase().includes(e), a = [];
631
660
  r && !e && a.push({ kind: "all" });
@@ -691,13 +720,13 @@ function G(e) {
691
720
  }, x = (e) => {
692
721
  let t = g.current;
693
722
  if (!t) return;
694
- let n = e * U;
695
- n < t.scrollTop ? t.scrollTop = n : n + U > t.scrollTop + t.clientHeight && (t.scrollTop = n + U - t.clientHeight);
723
+ let n = e * G;
724
+ n < t.scrollTop ? t.scrollTop = n : n + G > t.scrollTop + t.clientHeight && (t.scrollTop = n + G - t.clientHeight);
696
725
  }, S = (e) => {
697
726
  let t = Math.max(0, Math.min(y.length - 1, e));
698
727
  f(t), x(t);
699
728
  }, C = (e) => {
700
- let t = Math.max(1, Math.floor((g.current?.clientHeight ?? 360) / U) - 1), n = {
729
+ let t = Math.max(1, Math.floor((g.current?.clientHeight ?? 360) / G) - 1), n = {
701
730
  ArrowDown: () => S(d + 1),
702
731
  ArrowUp: () => S(d - 1),
703
732
  PageDown: () => S(d + t),
@@ -709,17 +738,17 @@ function G(e) {
709
738
  Tab: () => c(!1)
710
739
  }[e.key];
711
740
  n && (e.key !== "Tab" && e.preventDefault(), n());
712
- }, w = Math.min(y.length * U + 8, 296), T = Math.max(0, Math.floor(p / U) - 4), D = Math.min(y.length, Math.ceil((p + w) / U) + 4), A = o ? e.value.size === 0 : e.value === null;
713
- return (0, a.createPortal)(/* @__PURE__ */ (0, E.jsxs)("div", {
741
+ }, w = Math.min(y.length * G + 8, 296), T = Math.max(0, Math.floor(p / G) - 4), E = Math.min(y.length, Math.ceil((p + w) / G) + 4), D = o ? e.value.size === 0 : e.value === null;
742
+ return (0, a.createPortal)(/* @__PURE__ */ (0, O.jsxs)("div", {
714
743
  ref: h,
715
744
  className: "rp-lb",
716
745
  role: "presentation",
717
746
  children: [
718
- /* @__PURE__ */ (0, E.jsxs)("div", {
747
+ /* @__PURE__ */ (0, O.jsxs)("div", {
719
748
  className: "rp-lb-s",
720
749
  children: [
721
- /* @__PURE__ */ (0, E.jsx)(O, { name: "search" }),
722
- /* @__PURE__ */ (0, E.jsx)("input", {
750
+ /* @__PURE__ */ (0, O.jsx)(A, { name: "search" }),
751
+ /* @__PURE__ */ (0, O.jsx)("input", {
723
752
  autoFocus: !0,
724
753
  value: l,
725
754
  onChange: (e) => u(e.target.value),
@@ -732,10 +761,10 @@ function G(e) {
732
761
  "aria-activedescendant": y[d] ? `${_}-${d}` : void 0,
733
762
  "aria-autocomplete": "list"
734
763
  }),
735
- /* @__PURE__ */ (0, E.jsx)("kbd", { children: "Esc" })
764
+ /* @__PURE__ */ (0, O.jsx)("kbd", { children: "Esc" })
736
765
  ]
737
766
  }),
738
- y.length ? /* @__PURE__ */ (0, E.jsx)("div", {
767
+ y.length ? /* @__PURE__ */ (0, O.jsx)("div", {
739
768
  ref: g,
740
769
  id: _,
741
770
  className: "rp-lb-l",
@@ -744,16 +773,16 @@ function G(e) {
744
773
  "aria-label": e.label,
745
774
  style: { height: w },
746
775
  onScroll: (e) => m(e.currentTarget.scrollTop),
747
- children: /* @__PURE__ */ (0, E.jsx)("div", {
776
+ children: /* @__PURE__ */ (0, O.jsx)("div", {
748
777
  style: {
749
- height: y.length * U,
778
+ height: y.length * G,
750
779
  position: "relative"
751
780
  },
752
- children: y.slice(T, D).map((e, t) => {
753
- let n = T + t, i = { top: n * U + 4 }, a = `rp-lb-r${n === d ? " active" : ""}`;
781
+ children: y.slice(T, E).map((e, t) => {
782
+ let n = T + t, i = { top: n * G + 4 }, a = `rp-lb-r${n === d ? " active" : ""}`;
754
783
  if (e.kind === "group") {
755
784
  let t = e.members.filter((e) => v(e)).length;
756
- return /* @__PURE__ */ (0, E.jsxs)("div", {
785
+ return /* @__PURE__ */ (0, O.jsxs)("div", {
757
786
  id: `${_}-${n}`,
758
787
  role: "option",
759
788
  "aria-selected": o ? t === e.members.length : v(e.id),
@@ -762,30 +791,30 @@ function G(e) {
762
791
  onPointerEnter: () => f(n),
763
792
  onClick: () => b(e),
764
793
  children: [
765
- o ? /* @__PURE__ */ (0, E.jsx)("span", {
794
+ o ? /* @__PURE__ */ (0, O.jsx)("span", {
766
795
  className: `box${t && t < e.members.length ? " part" : ""}`,
767
- children: t === e.members.length ? /* @__PURE__ */ (0, E.jsx)(O, {
796
+ children: t === e.members.length ? /* @__PURE__ */ (0, O.jsx)(A, {
768
797
  name: "check",
769
798
  size: 12
770
799
  }) : t ? "–" : null
771
- }) : /* @__PURE__ */ (0, E.jsx)("span", { className: "ck" }),
772
- /* @__PURE__ */ (0, E.jsx)(O, {
800
+ }) : /* @__PURE__ */ (0, O.jsx)("span", { className: "ck" }),
801
+ /* @__PURE__ */ (0, O.jsx)(A, {
773
802
  name: "users",
774
803
  size: 14
775
804
  }),
776
- /* @__PURE__ */ (0, E.jsx)("span", {
805
+ /* @__PURE__ */ (0, O.jsx)("span", {
777
806
  className: "nm",
778
807
  children: e.label
779
808
  }),
780
- /* @__PURE__ */ (0, E.jsx)("span", {
809
+ /* @__PURE__ */ (0, O.jsx)("span", {
781
810
  className: "mt",
782
811
  children: e.members.length
783
812
  })
784
813
  ]
785
814
  }, `g:${e.id}`);
786
815
  }
787
- let s = e.kind === "all" ? A : v(e.option.id), c = e.kind === "all" ? r.label : e.option.label, u = e.kind === "all" ? r.meta : e.option.meta;
788
- return /* @__PURE__ */ (0, E.jsxs)("div", {
816
+ let s = e.kind === "all" ? D : v(e.option.id), c = e.kind === "all" ? r.label : e.option.label, u = e.kind === "all" ? r.meta : e.option.meta;
817
+ return /* @__PURE__ */ (0, O.jsxs)("div", {
789
818
  id: `${_}-${n}`,
790
819
  role: "option",
791
820
  "aria-selected": s,
@@ -794,28 +823,28 @@ function G(e) {
794
823
  onPointerEnter: () => f(n),
795
824
  onClick: () => b(e),
796
825
  children: [
797
- o ? /* @__PURE__ */ (0, E.jsx)("span", {
826
+ o ? /* @__PURE__ */ (0, O.jsx)("span", {
798
827
  className: "box",
799
- children: s ? /* @__PURE__ */ (0, E.jsx)(O, {
828
+ children: s ? /* @__PURE__ */ (0, O.jsx)(A, {
800
829
  name: "check",
801
830
  size: 12
802
831
  }) : null
803
- }) : /* @__PURE__ */ (0, E.jsx)("span", {
832
+ }) : /* @__PURE__ */ (0, O.jsx)("span", {
804
833
  className: "ck",
805
- children: s ? /* @__PURE__ */ (0, E.jsx)(O, {
834
+ children: s ? /* @__PURE__ */ (0, O.jsx)(A, {
806
835
  name: "check",
807
836
  size: 14
808
837
  }) : null
809
838
  }),
810
- e.kind === "option" && e.option.tone !== void 0 && /* @__PURE__ */ (0, E.jsx)(k, { tone: e.option.tone }),
811
- /* @__PURE__ */ (0, E.jsx)("span", {
839
+ e.kind === "option" && e.option.tone !== void 0 && /* @__PURE__ */ (0, O.jsx)(j, { tone: e.option.tone }),
840
+ /* @__PURE__ */ (0, O.jsx)("span", {
812
841
  className: "nm",
813
- children: /* @__PURE__ */ (0, E.jsx)(M, {
842
+ children: /* @__PURE__ */ (0, O.jsx)(P, {
814
843
  text: c,
815
844
  query: l
816
845
  })
817
846
  }),
818
- u && /* @__PURE__ */ (0, E.jsx)("span", {
847
+ u && /* @__PURE__ */ (0, O.jsx)("span", {
819
848
  className: "mt",
820
849
  children: u
821
850
  })
@@ -823,7 +852,7 @@ function G(e) {
823
852
  }, e.kind === "all" ? "all" : e.option.id);
824
853
  })
825
854
  })
826
- }) : /* @__PURE__ */ (0, E.jsxs)("div", {
855
+ }) : /* @__PURE__ */ (0, O.jsxs)("div", {
827
856
  className: "rp-lb-e",
828
857
  children: [
829
858
  "Nothing matches “",
@@ -831,16 +860,16 @@ function G(e) {
831
860
  "”"
832
861
  ]
833
862
  }),
834
- o && /* @__PURE__ */ (0, E.jsxs)("div", {
863
+ o && /* @__PURE__ */ (0, O.jsxs)("div", {
835
864
  className: "rp-lb-f",
836
- children: [/* @__PURE__ */ (0, E.jsx)("span", { children: e.value.size ? `${e.value.size} selected` : "All" }), /* @__PURE__ */ (0, E.jsxs)("span", {
865
+ children: [/* @__PURE__ */ (0, O.jsx)("span", { children: e.value.size ? `${e.value.size} selected` : "All" }), /* @__PURE__ */ (0, O.jsxs)("span", {
837
866
  className: "end",
838
- children: [/* @__PURE__ */ (0, E.jsx)("button", {
867
+ children: [/* @__PURE__ */ (0, O.jsx)("button", {
839
868
  type: "button",
840
869
  className: "rp-btn sm",
841
870
  onClick: () => e.onChange(/* @__PURE__ */ new Set()),
842
871
  children: "Clear"
843
- }), /* @__PURE__ */ (0, E.jsx)("button", {
872
+ }), /* @__PURE__ */ (0, O.jsx)("button", {
844
873
  type: "button",
845
874
  className: "rp-btn sm framed",
846
875
  onClick: () => c(!0),
@@ -851,7 +880,7 @@ function G(e) {
851
880
  ]
852
881
  }), s.closest(".agent-record") ?? document.body);
853
882
  }
854
- function K(e, t = () => !0, n = (e) => e.tokens === null ? "—" : w(e.tokens)) {
883
+ function J(e, t = () => !0, n = (e) => e.tokens === null ? "—" : w(e.tokens)) {
855
884
  return e.tree.filter(t).map((t) => ({
856
885
  id: t.id,
857
886
  label: t.name,
@@ -861,14 +890,15 @@ function K(e, t = () => !0, n = (e) => e.tokens === null ? "—" : w(e.tokens))
861
890
  group: e.teams.length && t.team && t.team !== t.id ? t.team : null
862
891
  }));
863
892
  }
864
- var q = (e) => e.teams.length ? e.teams.map((e) => ({
893
+ var Y = (e) => e.teams.length ? e.teams.map((e) => ({
865
894
  id: e.id,
866
895
  label: e.label
867
896
  })) : void 0;
868
- function J(e, t, n, r = 6) {
897
+ function X(e, t, n, r = 6) {
869
898
  let [a, o] = (0, i.useState)({
870
899
  top: 0,
871
- height: 800
900
+ height: 800,
901
+ width: 0
872
902
  });
873
903
  (0, i.useEffect)(() => {
874
904
  let t = e.current;
@@ -876,7 +906,8 @@ function J(e, t, n, r = 6) {
876
906
  let n = 0, r = () => {
877
907
  n = 0, o({
878
908
  top: t.scrollTop,
879
- height: t.clientHeight || 800
909
+ height: t.clientHeight || 800,
910
+ width: t.clientWidth
880
911
  });
881
912
  }, i = () => {
882
913
  n ||= requestAnimationFrame(r);
@@ -892,10 +923,11 @@ function J(e, t, n, r = 6) {
892
923
  first: s,
893
924
  last: c,
894
925
  before: s * n,
895
- after: Math.max(0, (t - c) * n)
926
+ after: Math.max(0, (t - c) * n),
927
+ width: a.width
896
928
  };
897
929
  }
898
- function Y() {
930
+ function Z() {
899
931
  let e = "(max-width: 720px)", [t, n] = (0, i.useState)(() => typeof window < "u" && window.matchMedia(e).matches);
900
932
  return (0, i.useEffect)(() => {
901
933
  let t = window.matchMedia(e), r = () => n(t.matches);
@@ -903,4 +935,4 @@ function Y() {
903
935
  }, []), t;
904
936
  }
905
937
  //#endregion
906
- export { y as A, b as C, s as D, S as E, _ as O, C as S, p as T, J as _, O as a, h as b, H as c, K as d, A as f, Y as g, I as h, M as i, T as j, v as k, B as l, P as m, z as n, W as o, j as p, F as r, k as s, V as t, q as u, w as v, x as w, g as x, f as y };
938
+ export { y as A, C, m as D, S as E, T as M, c as O, _ as S, o as T, X as _, A as a, D as b, W as c, J as d, M as f, Z as g, R as h, P as i, b as j, v as k, H as l, I as m, V as n, K as o, N as p, L as r, j as s, U as t, Y as u, w as v, x as w, g as x, p as y };