@tangle-network/sandbox-cli 0.21.26 → 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 +9 -9
  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,6 +1,6 @@
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 { I as r, v as i } from "./data-azhapQrS.js";
2
+ import { i as t, t as n } from "./jsx-runtime-DQWyJOhv.js";
3
+ import { I as r, v as i } from "./data-CkWfWr7i.js";
4
4
  //#region src/workspace/answers.ts
5
5
  var a = /* @__PURE__ */ e(t(), 1), o = (e) => e ? Date.parse(e) : NaN, s = (e) => String(e).padStart(2, "0"), c = (e) => {
6
6
  let t = new Date(e);
@@ -0,0 +1,156 @@
1
+ import { t as e } from "./jsx-runtime-DQWyJOhv.js";
2
+ import { C as t, b as n, k as r, n as i, s as a } from "./ui-C9b1rIUH.js";
3
+ import { clause as o } from "./Overview-4Umk14_2.js";
4
+ //#region src/workspace/run/Checks.tsx
5
+ var s = e();
6
+ function c(e) {
7
+ let t = [];
8
+ for (let n of [...e].reverse()) {
9
+ let e = t[t.length - 1];
10
+ n.total ? t.push({
11
+ kind: "release",
12
+ r: n
13
+ }) : e?.kind === "unscored" ? (e.to = n.release, e.n++) : t.push({
14
+ kind: "unscored",
15
+ from: n.release,
16
+ to: n.release,
17
+ n: 1
18
+ });
19
+ }
20
+ return t;
21
+ }
22
+ function l({ m: e, doc: l }) {
23
+ let u = l.run.check, d = u?.latest, f = n(u), p = u?.checkerNames?.find((e) => e.current) ?? u?.checkerNames?.[0], m = u?.calibration?.stages ?? [], h = e.best, g = e.tree.filter((e) => (e.commits ?? 0) > 0).sort((e, t) => (t.commits ?? 0) - (e.commits ?? 0)), _ = Math.max(1, ...g.map((e) => e.commits ?? 0));
24
+ return /* @__PURE__ */ (0, s.jsxs)("div", {
25
+ className: "rp-ck",
26
+ children: [/* @__PURE__ */ (0, s.jsx)("section", {
27
+ className: "rp-card",
28
+ "aria-label": "Checks",
29
+ children: /* @__PURE__ */ (0, s.jsxs)("div", {
30
+ className: "rp-scroll rp-ck-in",
31
+ children: [
32
+ /* @__PURE__ */ (0, s.jsxs)("h2", {
33
+ className: "rp-ck-h",
34
+ children: [/* @__PURE__ */ (0, s.jsx)(a, { tone: f.tone }), f.word]
35
+ }),
36
+ f.note && /* @__PURE__ */ (0, s.jsxs)("p", {
37
+ className: "rp-ck-note",
38
+ children: [f.note, "."]
39
+ }),
40
+ /* @__PURE__ */ (0, s.jsxs)("div", {
41
+ className: "rp-ck-stats",
42
+ children: [
43
+ /* @__PURE__ */ (0, s.jsxs)("div", { children: [/* @__PURE__ */ (0, s.jsx)("b", { children: t(u?.counts?.checks ?? 0) }), /* @__PURE__ */ (0, s.jsxs)("span", { children: [
44
+ "checks run, ",
45
+ t(u?.counts?.known ?? 0),
46
+ " with a verdict"
47
+ ] })] }),
48
+ /* @__PURE__ */ (0, s.jsxs)("div", { children: [/* @__PURE__ */ (0, s.jsx)("b", { children: p?.label ?? "—" }), /* @__PURE__ */ (0, s.jsx)("span", { children: p ? `checker, ${p.ruling ?? "as pressed"}` : "no checker recorded" })] }),
49
+ /* @__PURE__ */ (0, s.jsxs)("div", { children: [/* @__PURE__ */ (0, s.jsx)("b", { children: h ? `${h.release}${h.total ? ` · ${h.passed ?? 0}/${h.total}` : ""}` : "None" }), /* @__PURE__ */ (0, s.jsx)("span", { children: e.releases.length ? `best of ${r(e.releases.length, "release")}` : "no release tagged" })] })
50
+ ]
51
+ }),
52
+ d?.line && /* @__PURE__ */ (0, s.jsxs)("p", {
53
+ className: "rp-ck-line",
54
+ children: [
55
+ /* @__PURE__ */ (0, s.jsx)("span", {
56
+ className: "lbl",
57
+ children: "Latest"
58
+ }),
59
+ /* @__PURE__ */ (0, s.jsx)("span", { children: o(d.line, 28) }),
60
+ /* @__PURE__ */ (0, s.jsxs)("time", { children: [d.at ? `${d.at.slice(5, 10)} ${d.at.slice(11, 16)} UTC` : "", d.tag ? ` · ${d.tag}` : ""] })
61
+ ]
62
+ }),
63
+ m.some((e) => e.state !== "calibrated") && /* @__PURE__ */ (0, s.jsxs)("p", {
64
+ className: "rp-ck-line",
65
+ children: [/* @__PURE__ */ (0, s.jsx)("span", {
66
+ className: "lbl",
67
+ children: "Calibrated"
68
+ }), /* @__PURE__ */ (0, s.jsx)("span", {
69
+ className: "rp-ck-cal",
70
+ children: m.map((e) => /* @__PURE__ */ (0, s.jsxs)("span", {
71
+ className: e.state === "calibrated" ? "ok" : "",
72
+ children: [
73
+ e.state === "calibrated" ? "✓" : "○",
74
+ " ",
75
+ e.name
76
+ ]
77
+ }, e.name))
78
+ })]
79
+ }),
80
+ e.releases.length > 0 && /* @__PURE__ */ (0, s.jsxs)(s.Fragment, { children: [/* @__PURE__ */ (0, s.jsx)("h3", {
81
+ className: "rp-subh",
82
+ children: "Releases"
83
+ }), /* @__PURE__ */ (0, s.jsx)("ol", {
84
+ className: "rp-rel",
85
+ children: c(e.releases).map((e) => e.kind === "unscored" ? /* @__PURE__ */ (0, s.jsxs)("li", {
86
+ className: "gap",
87
+ children: [/* @__PURE__ */ (0, s.jsx)("b", { children: e.n > 1 ? `${e.from}–${e.to}` : e.from }), /* @__PURE__ */ (0, s.jsx)("span", {
88
+ className: "sub",
89
+ children: e.n > 1 ? `${e.n} releases the checker did not score` : "not scored"
90
+ })]
91
+ }, e.from) : /* @__PURE__ */ (0, s.jsxs)("li", { children: [
92
+ /* @__PURE__ */ (0, s.jsx)("b", { children: e.r.release }),
93
+ /* @__PURE__ */ (0, s.jsxs)("span", {
94
+ className: "score",
95
+ children: [
96
+ e.r.passed ?? 0,
97
+ "/",
98
+ e.r.total
99
+ ]
100
+ }),
101
+ /* @__PURE__ */ (0, s.jsx)("span", {
102
+ className: "steps",
103
+ children: (e.r.steps ?? []).map((e, t) => /* @__PURE__ */ (0, s.jsx)("i", {
104
+ className: e.state,
105
+ title: `${e.label}: ${e.state}`
106
+ }, t))
107
+ }),
108
+ /* @__PURE__ */ (0, s.jsx)("span", {
109
+ className: "when",
110
+ children: e.r.taggedAt ? `${e.r.taggedAt.slice(5, 10)} ${e.r.taggedAt.slice(11, 16)}` : "—"
111
+ }),
112
+ e.r.sentence && /* @__PURE__ */ (0, s.jsx)("span", {
113
+ className: "sub",
114
+ children: o(e.r.sentence, 20)
115
+ })
116
+ ] }, e.r.release))
117
+ })] })
118
+ ]
119
+ })
120
+ }), /* @__PURE__ */ (0, s.jsxs)("section", {
121
+ className: "rp-card",
122
+ "aria-label": "Commits by agent",
123
+ children: [/* @__PURE__ */ (0, s.jsx)("div", {
124
+ className: "rp-hd sm",
125
+ children: /* @__PURE__ */ (0, s.jsxs)("h2", { children: ["Commits by agent", /* @__PURE__ */ (0, s.jsx)("span", {
126
+ className: "ct",
127
+ children: t(g.reduce((e, t) => e + (t.commits ?? 0), 0))
128
+ })] })
129
+ }), /* @__PURE__ */ (0, s.jsx)("div", {
130
+ className: "rp-scroll rp-commits",
131
+ children: g.length ? g.map((e) => /* @__PURE__ */ (0, s.jsxs)("div", {
132
+ className: "row",
133
+ children: [
134
+ /* @__PURE__ */ (0, s.jsxs)("span", {
135
+ className: "l",
136
+ children: [/* @__PURE__ */ (0, s.jsx)(a, { tone: e.state.tone }), e.name]
137
+ }),
138
+ /* @__PURE__ */ (0, s.jsx)(i, {
139
+ ok: e.commits ?? 0,
140
+ max: _
141
+ }),
142
+ /* @__PURE__ */ (0, s.jsx)("span", {
143
+ className: "n",
144
+ children: e.commits
145
+ })
146
+ ]
147
+ }, e.id)) : /* @__PURE__ */ (0, s.jsx)("p", {
148
+ className: "ws-status",
149
+ children: "No agent's commits reached the run's deliverables."
150
+ })
151
+ })]
152
+ })]
153
+ });
154
+ }
155
+ //#endregion
156
+ export { l as Checks };
@@ -1,7 +1,7 @@
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 { C as r, O as i, _ as a, a as o, b as s, i as c, k as l, p as u, s as d, v as f } from "./ui-DZiGjPwl.js";
4
- import { a as p, n as m, r as h, t as g } from "./record-part-d0gKKrMI.js";
2
+ import { i as t, t as n } from "./jsx-runtime-DQWyJOhv.js";
3
+ import { A as r, _ as i, a, i as o, k as s, p as c, s as l, v as u, w as d, x as f } from "./ui-C9b1rIUH.js";
4
+ import { a as p, n as m, r as h, t as g } from "./record-part-D3_Anfpe.js";
5
5
  //#region src/adapters/part-events.ts
6
6
  var _ = /* @__PURE__ */ e(t(), 1), v = (e) => typeof e == "string" ? e : e == null ? "" : JSON.stringify(e), y = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, b = (e) => {
7
7
  if (typeof e != "string" && typeof e != "number") return null;
@@ -391,18 +391,19 @@ function T(e, t, n, r) {
391
391
  }
392
392
  };
393
393
  }
394
- function E({ runUrl: e, runId: t, alive: n, selected: r, onSelect: i, onRecorded: a, onEmpty: o, chooser: s = !0 }) {
395
- let c = r ?? t, [l, u] = (0, _.useState)({
394
+ function E({ runUrl: e, runId: t, alive: n, selected: r, onSelect: i, onRecorded: a, onEmpty: o, chooser: s = !0, opening: c }) {
395
+ let l = r ?? t, [u, d] = (0, _.useState)({
396
396
  rows: [],
397
397
  nodes: [],
398
398
  earlier: !1,
399
+ more: !1,
399
400
  loading: !0,
400
401
  error: null,
401
402
  trimmed: !1,
402
403
  history: !1,
403
404
  emptyTail: !1
404
- }), [d, f] = (0, _.useState)(0), m = (0, _.useRef)(null), g = (0, _.useRef)(n), v = (0, _.useRef)({
405
- node: c,
405
+ }), [f, m] = (0, _.useState)(0), g = (0, _.useRef)(null), v = (0, _.useRef)(null), y = (0, _.useRef)(n), b = (0, _.useRef)({
406
+ node: l,
406
407
  rows: [],
407
408
  earlier: !1,
408
409
  generation: void 0,
@@ -410,91 +411,99 @@ function E({ runUrl: e, runId: t, alive: n, selected: r, onSelect: i, onRecorded
410
411
  last: null
411
412
  });
412
413
  (0, _.useEffect)(() => {
413
- let t = !1, r = 0, i = new AbortController(), a = v.current.node === c && g.current && !n;
414
- g.current = n;
415
- let o = a ? v.current.rows : [], s = a ? v.current.earlier : !1, l = a ? v.current.generation : void 0, d = a ? v.current.first : null, f = a ? v.current.last : null, p = !1, h = !1, _ = !1;
416
- u((e) => ({
414
+ let t = !1, r = 0, i = new AbortController(), a = b.current.node === l && y.current && !n;
415
+ y.current = n;
416
+ let o = a ? b.current.rows : [], s = a ? b.current.earlier : !1, c = a ? b.current.generation : void 0, u = a ? b.current.first : null, f = a ? b.current.last : null, p = !1, m = !1, h = !1, _ = !n && !a;
417
+ d((e) => ({
417
418
  ...e,
418
419
  rows: o,
419
420
  earlier: s,
421
+ more: !1,
420
422
  loading: !0,
421
423
  error: null,
422
424
  trimmed: a && e.trimmed,
423
425
  history: !1,
424
426
  emptyTail: !1
425
427
  }));
426
- let y = async (a) => {
427
- if (t || (a === "before" ? _ : h)) return;
428
- a === "before" ? _ = !0 : h = !0;
429
- let m = a === "after" ? f : a === "before" ? d : null;
428
+ let x = async (a) => {
429
+ if (t || (a === "before" ? h : m)) return;
430
+ a === "before" ? h = !0 : m = !0;
431
+ let g = a === "after" ? f : a === "before" ? u : a === "head" ? C : null;
430
432
  try {
431
- let h = new URLSearchParams({
432
- node: c,
433
+ let m = new URLSearchParams({
434
+ node: l,
433
435
  limit: String(C)
434
436
  });
435
- m !== null && h.set(a, String(m)), l && m !== null && h.set("generation", l);
436
- let g = await fetch(`${e}/transcript?${h}`, {
437
+ g !== null && m.set(a === "head" ? "before" : a, String(g)), c && g !== null && m.set("generation", c);
438
+ let h = await fetch(`${e}/transcript?${m}`, {
437
439
  signal: i.signal,
438
440
  credentials: "same-origin"
439
441
  });
440
- if (!g.ok) throw Error(`Transcript unavailable (HTTP ${g.status})`);
441
- let _ = await g.json();
442
+ if (!h.ok) throw Error(`Transcript unavailable (HTTP ${h.status})`);
443
+ let v = await h.json();
442
444
  if (t) return;
443
- let b = a === "tail" || _.reset ? _.events : a === "before" ? [..._.events, ...o] : [...o, ..._.events];
444
- l = _.generation, a === "tail" || _.reset ? (d = _.firstSeq, f = _.lastSeq) : a === "before" ? d = _.firstSeq ?? d : f = _.lastSeq ?? f, o = [...new Map(b.map((e) => [e.seq, e])).values()].sort((e, t) => e.seq - t.seq);
445
- let x = o.length > w;
446
- x && (o = p ? o.slice(0, w) : o.slice(-2e3)), x && !p && (d = o[0]?.seq ?? d), (a !== "after" || _.reset) && (s = _.hasEarlier), x && a !== "before" && (s = !0), v.current = {
447
- node: c,
445
+ if (a === "head" && !v.events.length) {
446
+ r = window.setTimeout(() => void x("tail"), 0);
447
+ return;
448
+ }
449
+ let y = a === "tail" || a === "head" || v.reset, S = y ? v.events : a === "before" ? [...v.events, ...o] : [...o, ...v.events];
450
+ c = v.generation, y ? (u = v.firstSeq, f = v.lastSeq) : a === "before" ? u = v.firstSeq ?? u : f = v.lastSeq ?? f, o = [...new Map(S.map((e) => [e.seq, e])).values()].sort((e, t) => e.seq - t.seq);
451
+ let T = o.length > w;
452
+ T && (o = p ? o.slice(0, w) : o.slice(-2e3)), T && !p && (u = o[0]?.seq ?? u), (a !== "after" || v.reset) && (s = v.hasEarlier), T && a !== "before" && (s = !0), b.current = {
453
+ node: l,
448
454
  rows: o,
449
455
  earlier: s,
450
- generation: l,
451
- first: d,
456
+ generation: c,
457
+ first: u,
452
458
  last: f
453
- }, u((e) => ({
459
+ };
460
+ let E = _ && a !== "before" ? v.hasMore : !1;
461
+ d((e) => ({
454
462
  rows: o,
455
- nodes: _.nodes,
463
+ nodes: v.nodes,
456
464
  earlier: s,
465
+ more: a === "before" ? e.more : E,
457
466
  loading: !1,
458
467
  error: null,
459
- trimmed: x || e.trimmed,
468
+ trimmed: T || e.trimmed,
460
469
  history: p,
461
- emptyTail: !_.alive && o.length === 0 && d === null && f === null
462
- })), a !== "before" && _.hasMore && f !== m ? r = window.setTimeout(() => void y("after"), 0) : a !== "before" && _.alive && n && (r = window.setTimeout(() => void y("after"), 3e3));
470
+ emptyTail: !v.alive && o.length === 0 && u === null && f === null
471
+ })), !_ && a !== "before" && v.hasMore && f !== g ? r = window.setTimeout(() => void x("after"), 0) : a !== "before" && v.alive && n && (r = window.setTimeout(() => void x("after"), 3e3));
463
472
  } catch (e) {
464
- !t && !i.signal.aborted && (u((t) => ({
473
+ !t && !i.signal.aborted && (d((t) => ({
465
474
  ...t,
466
475
  loading: !1,
467
476
  error: e instanceof Error ? e.message : "Transcript unavailable"
468
- })), n && a !== "before" && (r = window.setTimeout(() => void y("after"), 3e3)));
477
+ })), n && a !== "before" && (r = window.setTimeout(() => void x("after"), 3e3)));
469
478
  } finally {
470
- a === "before" ? _ = !1 : h = !1;
479
+ a === "before" ? h = !1 : m = !1;
471
480
  }
472
481
  };
473
- return m.current = () => {
474
- p = !0, u((e) => ({
482
+ return g.current = () => {
483
+ p = !0, d((e) => ({
475
484
  ...e,
476
- history: !0
477
- })), y("before");
478
- }, y(a && f !== null ? "after" : "tail"), () => {
479
- t = !0, i.abort(), window.clearTimeout(r), m.current = null;
485
+ history: !_
486
+ })), x("before");
487
+ }, v.current = () => void x("after"), x(a && f !== null ? "after" : _ ? "head" : "tail"), () => {
488
+ t = !0, i.abort(), window.clearTimeout(r), g.current = null, v.current = null;
480
489
  };
481
490
  }, [
482
491
  e,
483
- c,
492
+ l,
484
493
  n,
485
- d
494
+ f
486
495
  ]), (0, _.useEffect)(() => {
487
- l.emptyTail && o && o();
488
- }, [l.emptyTail, o]);
489
- let y = l.nodes.some((e) => e.id === c) ? l.nodes : [...l.nodes, {
490
- id: c,
491
- label: c === t ? "Root" : c,
496
+ u.emptyTail && o && o();
497
+ }, [u.emptyTail, o]);
498
+ let x = u.nodes.some((e) => e.id === l) ? u.nodes : [...u.nodes, {
499
+ id: l,
500
+ label: l === t ? "Root" : l,
492
501
  parent: null
493
- }], b = (0, _.useMemo)(() => p(T(t, c, y, l.rows)), [
502
+ }], E = (0, _.useMemo)(() => p(T(t, l, x, u.rows)), [
494
503
  t,
495
- c,
496
- l.nodes,
497
- l.rows
504
+ l,
505
+ u.nodes,
506
+ u.rows
498
507
  ]);
499
508
  return /* @__PURE__ */ (0, S.jsxs)("section", {
500
509
  className: "run-panel live-transcript",
@@ -504,9 +513,9 @@ function E({ runUrl: e, runId: t, alive: n, selected: r, onSelect: i, onRecorded
504
513
  className: "message-filters",
505
514
  children: [s && /* @__PURE__ */ (0, S.jsxs)("label", { children: ["Agent ", /* @__PURE__ */ (0, S.jsx)("select", {
506
515
  "aria-label": "Agent conversation",
507
- value: c,
516
+ value: l,
508
517
  onChange: (e) => i(e.target.value),
509
- children: y.map((e) => /* @__PURE__ */ (0, S.jsxs)("option", {
518
+ children: x.map((e) => /* @__PURE__ */ (0, S.jsxs)("option", {
510
519
  value: e.id,
511
520
  children: [e.label, e.parent ? " (child)" : " (root)"]
512
521
  }, e.id))
@@ -517,42 +526,53 @@ function E({ runUrl: e, runId: t, alive: n, selected: r, onSelect: i, onRecorded
517
526
  children: "Timeline and usage"
518
527
  })]
519
528
  }),
520
- (l.earlier || l.history) && /* @__PURE__ */ (0, S.jsxs)("p", {
529
+ (u.earlier || u.history) && /* @__PURE__ */ (0, S.jsxs)("p", {
521
530
  className: "transcript-edge",
522
- children: [l.earlier && /* @__PURE__ */ (0, S.jsx)("button", {
531
+ children: [u.earlier && /* @__PURE__ */ (0, S.jsx)("button", {
523
532
  type: "button",
524
533
  className: "link-button",
525
- disabled: l.loading,
526
- onClick: () => m.current?.(),
534
+ disabled: u.loading,
535
+ onClick: () => g.current?.(),
527
536
  children: "Load older"
528
- }), l.history && /* @__PURE__ */ (0, S.jsx)("button", {
537
+ }), u.history && /* @__PURE__ */ (0, S.jsx)("button", {
529
538
  type: "button",
530
539
  className: "link-button",
531
- onClick: () => f((e) => e + 1),
540
+ onClick: () => m((e) => e + 1),
532
541
  children: "Latest"
533
542
  })]
534
543
  }),
535
- l.loading && /* @__PURE__ */ (0, S.jsx)("p", {
544
+ u.loading && /* @__PURE__ */ (0, S.jsx)("p", {
536
545
  role: "status",
537
546
  children: "Loading transcript…"
538
547
  }),
539
- l.error && /* @__PURE__ */ (0, S.jsx)("p", {
548
+ u.error && /* @__PURE__ */ (0, S.jsx)("p", {
540
549
  role: "alert",
541
- children: l.error
550
+ children: u.error
542
551
  }),
543
- l.rows.filter((e) => e.event?.kind === "capture_gap" && (!e.at || !Number.isFinite(Date.parse(e.at)))).map((e) => /* @__PURE__ */ (0, S.jsx)("p", {
552
+ u.rows.filter((e) => e.event?.kind === "capture_gap" && (!e.at || !Number.isFinite(Date.parse(e.at)))).map((e) => /* @__PURE__ */ (0, S.jsx)("p", {
544
553
  className: "faint",
545
554
  children: e.event?.text ?? "A stream record could not be displayed."
546
555
  }, e.seq)),
547
- !l.loading && !l.rows.length && !l.error && /* @__PURE__ */ (0, S.jsx)("p", { children: "No stream events have been retained for this agent." }),
548
- (!l.loading || l.rows.length > 0) && /* @__PURE__ */ (0, S.jsx)(h, {
549
- index: b,
550
- actor: c,
556
+ !u.loading && !u.rows.length && !u.error && /* @__PURE__ */ (0, S.jsx)("p", { children: "No stream events have been retained for this agent." }),
557
+ (!u.loading || u.rows.length > 0) && /* @__PURE__ */ (0, S.jsx)(h, {
558
+ index: E,
559
+ actor: l,
551
560
  cutoff: Infinity,
552
561
  query: "",
553
562
  category: "all",
554
563
  lifecycle: !0,
555
- live: n
564
+ live: n,
565
+ opening: u.earlier ? void 0 : c
566
+ }),
567
+ u.more && /* @__PURE__ */ (0, S.jsx)("p", {
568
+ className: "transcript-edge",
569
+ children: /* @__PURE__ */ (0, S.jsx)("button", {
570
+ type: "button",
571
+ className: "link-button",
572
+ disabled: u.loading,
573
+ onClick: () => v.current?.(),
574
+ children: "Load more"
575
+ })
556
576
  })
557
577
  ]
558
578
  });
@@ -586,8 +606,18 @@ function D(e, t) {
586
606
  }
587
607
  return i;
588
608
  }
589
- function O({ m: e, doc: t, runUrl: n, agent: r, selectAgent: s, route: p }) {
590
- let [h, v] = (0, _.useState)(""), y = (0, _.useMemo)(() => D(e, h), [e, h]), b = (0, _.useRef)(null), x = a(b, y.length, 52), C = (r ? e.byId.get(r) : null) ?? e.root, w = t.run.record.digest ?? null, T = t.run.record.status === "ready" || !!w, O = w ? `&digest=${w}` : "", A = m(T ? `${n}/record?part=nodes${O}` : null), j = A.index, M = !!t.execution?.alive, N = (0, _.useMemo)(() => e.tree.filter((e) => e.steps.length || e.turns).length, [e]), P = !!p.params.get("agent"), F = C && j && j.nodes.has(j.canonical(C.id)), [I, L] = (0, _.useState)(/* @__PURE__ */ new Set());
609
+ function O({ m: e, doc: t, runUrl: n, agent: d, selectAgent: f, route: p }) {
610
+ let [h, v] = (0, _.useState)(""), y = (0, _.useMemo)(() => D(e, h), [e, h]), b = (0, _.useRef)(null), x = i(b, y.length, 52), C = (d ? e.byId.get(d) : null) ?? e.root, w = t.run.record.digest ?? null, T = t.run.record.status === "ready" || !!w, O = w ? `&digest=${w}` : "", A = m(T ? `${n}/record?part=nodes${O}` : null), j = A.index, M = !!t.execution?.alive, N = (0, _.useMemo)(() => e.tree.filter((e) => e.steps.length || e.turns).length, [e]), P = !!p.params.get("agent"), F = C && j && j.nodes.has(j.canonical(C.id)), [I, L] = (0, _.useState)(/* @__PURE__ */ new Set()), R = (0, _.useMemo)(() => {
611
+ let n = [t.input?.objective, t.input?.instruction].filter((e) => typeof e == "string" && e.trim().length > 0).join("\n\n");
612
+ return C && C.id === e.root?.id && n ? {
613
+ text: n,
614
+ at: t.run.startedAt ?? new Date(e.t0).toISOString()
615
+ } : void 0;
616
+ }, [
617
+ t,
618
+ C,
619
+ e
620
+ ]);
591
621
  return (0, _.useEffect)(() => L(/* @__PURE__ */ new Set()), [t.run.id]), /* @__PURE__ */ (0, S.jsxs)("div", {
592
622
  className: "rp-conv",
593
623
  "data-picked": P ? "" : void 0,
@@ -606,7 +636,7 @@ function O({ m: e, doc: t, runUrl: n, agent: r, selectAgent: s, route: p }) {
606
636
  className: "rp-fbar",
607
637
  children: /* @__PURE__ */ (0, S.jsxs)("label", {
608
638
  className: "rp-field",
609
- children: [/* @__PURE__ */ (0, S.jsx)(o, { name: "search" }), /* @__PURE__ */ (0, S.jsx)("input", {
639
+ children: [/* @__PURE__ */ (0, S.jsx)(a, { name: "search" }), /* @__PURE__ */ (0, S.jsx)("input", {
610
640
  value: h,
611
641
  onChange: (e) => v(e.target.value),
612
642
  placeholder: `Search ${N} agents`,
@@ -624,7 +654,7 @@ function O({ m: e, doc: t, runUrl: n, agent: r, selectAgent: s, route: p }) {
624
654
  className: "ag",
625
655
  style: { height: 52 },
626
656
  children: [
627
- /* @__PURE__ */ (0, S.jsx)(o, {
657
+ /* @__PURE__ */ (0, S.jsx)(a, {
628
658
  name: "users",
629
659
  size: 14
630
660
  }),
@@ -639,24 +669,24 @@ function O({ m: e, doc: t, runUrl: n, agent: r, selectAgent: s, route: p }) {
639
669
  role: "listitem",
640
670
  "aria-current": t.a.id === C?.id,
641
671
  style: { height: 52 },
642
- onClick: () => s(t.a.id),
672
+ onClick: () => f(t.a.id),
643
673
  children: [
644
- /* @__PURE__ */ (0, S.jsx)(d, { tone: t.a.state.tone }),
674
+ /* @__PURE__ */ (0, S.jsx)(l, { tone: t.a.state.tone }),
645
675
  /* @__PURE__ */ (0, S.jsx)("span", {
646
676
  className: "nm",
647
677
  title: t.a.name,
648
- children: /* @__PURE__ */ (0, S.jsx)(c, {
649
- text: h.trim() ? t.a.name : u(t.a, 30),
678
+ children: /* @__PURE__ */ (0, S.jsx)(o, {
679
+ text: h.trim() ? t.a.name : c(t.a, 30),
650
680
  query: h
651
681
  })
652
682
  }),
653
683
  /* @__PURE__ */ (0, S.jsxs)("span", {
654
684
  className: "sb",
655
- children: [i(t.a.steps.length, "step"), t.a.first === null ? "" : ` · ${l(e.t0, t.a.first, t.a.state.tone === "live" ? "now" : t.a.last ?? t.a.first)}`]
685
+ children: [s(t.a.steps.length, "step"), t.a.first === null ? "" : ` · ${r(e.t0, t.a.first, t.a.state.tone === "live" ? "now" : t.a.last ?? t.a.first)}`]
656
686
  }),
657
687
  /* @__PURE__ */ (0, S.jsx)("span", {
658
688
  className: "n",
659
- children: f(t.a.tokens)
689
+ children: u(t.a.tokens)
660
690
  })
661
691
  ]
662
692
  }, t.a.id)),
@@ -681,14 +711,14 @@ function O({ m: e, doc: t, runUrl: n, agent: r, selectAgent: s, route: p }) {
681
711
  /* @__PURE__ */ (0, S.jsx)("button", {
682
712
  type: "button",
683
713
  className: "rp-back",
684
- onClick: () => s(null),
714
+ onClick: () => f(null),
685
715
  "aria-label": "All agents",
686
- children: /* @__PURE__ */ (0, S.jsx)(o, {
716
+ children: /* @__PURE__ */ (0, S.jsx)(a, {
687
717
  name: "arrow",
688
718
  size: 16
689
719
  })
690
720
  }),
691
- /* @__PURE__ */ (0, S.jsxs)("h2", { children: [/* @__PURE__ */ (0, S.jsx)(d, { tone: C.state.tone }), C.name] }),
721
+ /* @__PURE__ */ (0, S.jsxs)("h2", { children: [/* @__PURE__ */ (0, S.jsx)(l, { tone: C.state.tone }), C.name] }),
692
722
  /* @__PURE__ */ (0, S.jsx)("span", {
693
723
  className: "muted ph-hide",
694
724
  children: [C.model, C.harness].filter(Boolean).join(" · ")
@@ -704,7 +734,8 @@ function O({ m: e, doc: t, runUrl: n, agent: r, selectAgent: s, route: p }) {
704
734
  runUrl: n,
705
735
  version: O,
706
736
  index: j,
707
- actor: j.canonical(C.id)
737
+ actor: j.canonical(C.id),
738
+ opening: R
708
739
  }, C.id) : !M && (A.loading || A.pending) ? /* @__PURE__ */ (0, S.jsx)("p", {
709
740
  className: "ws-status",
710
741
  role: "status",
@@ -717,8 +748,9 @@ function O({ m: e, doc: t, runUrl: n, agent: r, selectAgent: s, route: p }) {
717
748
  runId: t.run.id,
718
749
  alive: M,
719
750
  selected: C.id,
720
- onSelect: (e) => s(e),
751
+ onSelect: (e) => f(e),
721
752
  chooser: !1,
753
+ opening: R,
722
754
  onEmpty: () => L((e) => /* @__PURE__ */ new Set([...e, C.id]))
723
755
  }, C.id)
724
756
  })]
@@ -726,11 +758,11 @@ function O({ m: e, doc: t, runUrl: n, agent: r, selectAgent: s, route: p }) {
726
758
  });
727
759
  }
728
760
  function k({ m: e, a: t }) {
729
- let n = s(e.t0), a = [];
761
+ let n = f(e.t0), r = [];
730
762
  for (let e of t.steps) {
731
763
  if (e.kind === "waiting") continue;
732
- let t = e.kind === "model" ? "model call" : e.tool ?? "tool", n = a[a.length - 1];
733
- n && n.name === t && e.t - n.end < 6e4 ? (n.n++, n.end = e.t + e.d, n.failed += +!!e.failed, e.target && n.targets.add(e.target)) : a.push({
764
+ let t = e.kind === "model" ? "model call" : e.tool ?? "tool", n = r[r.length - 1];
765
+ n && n.name === t && e.t - n.end < 6e4 ? (n.n++, n.end = e.t + e.d, n.failed += +!!e.failed, e.target && n.targets.add(e.target)) : r.push({
734
766
  name: t,
735
767
  model: e.kind === "model",
736
768
  n: 1,
@@ -740,14 +772,14 @@ function k({ m: e, a: t }) {
740
772
  targets: new Set(e.target ? [e.target] : [])
741
773
  });
742
774
  }
743
- return a.length ? /* @__PURE__ */ (0, S.jsxs)(S.Fragment, { children: [/* @__PURE__ */ (0, S.jsxs)("p", {
775
+ return r.length ? /* @__PURE__ */ (0, S.jsxs)(S.Fragment, { children: [/* @__PURE__ */ (0, S.jsxs)("p", {
744
776
  className: "rp-note",
745
777
  children: [
746
778
  "No conversation was recorded for this agent; these are its ",
747
- i(t.steps.length, "recorded step"),
779
+ s(t.steps.length, "recorded step"),
748
780
  "."
749
781
  ]
750
- }), a.map((e, t) => /* @__PURE__ */ (0, S.jsxs)("div", {
782
+ }), r.map((e, t) => /* @__PURE__ */ (0, S.jsxs)("div", {
751
783
  className: "rp-msg",
752
784
  children: [/* @__PURE__ */ (0, S.jsx)("time", { children: n(e.at) }), /* @__PURE__ */ (0, S.jsxs)("div", { children: [/* @__PURE__ */ (0, S.jsxs)("span", {
753
785
  className: `rp-tchip${e.failed ? " fail" : ""}`,
@@ -763,7 +795,7 @@ function k({ m: e, a: t }) {
763
795
  }),
764
796
  /* @__PURE__ */ (0, S.jsx)("span", {
765
797
  className: "dim",
766
- children: r(e.end - e.at)
798
+ children: d(e.end - e.at)
767
799
  })
768
800
  ]
769
801
  }), e.failed > 0 && /* @__PURE__ */ (0, S.jsxs)("span", {