@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
@@ -0,0 +1,546 @@
1
+ import { i as e } from "./rolldown-runtime-DArdT4gl.js";
2
+ import { i as t, t as n } from "./jsx-runtime-DQWyJOhv.js";
3
+ import { C as r, E as i, T as a, a as o, c as s, d as c, f as l, g as u, l as d, m as f, n as p, o as m, s as h, t as g, u as _, v, x as y } from "./ui-C9b1rIUH.js";
4
+ import { agentParam as b } from "./RunPage-DZlBW7Va.js";
5
+ //#region src/workspace/run/Topology.tsx
6
+ var x = /* @__PURE__ */ e(t(), 1), S = n();
7
+ function C(e, t, n, r, i) {
8
+ let a = new Set(e.teams.map((e) => e.id)), o = i ? Math.min(280, t - 32) : a.size ? 216 : 272, s = o + (a.size ? 56 : 72), c = /* @__PURE__ */ new Map(), l = [], u = (i, d, f) => {
9
+ let p = 24 + d * s;
10
+ if (i.children.length > 8 && a.has(i.id)) {
11
+ let e = 24 + (d + 1) * s, n = Math.max(1, Math.floor((t - e - 48 + 8) / 248)), a = r.has(i.id), u = Math.ceil(i.children.length / n), m = a ? 48 + u * 52 - 8 + 12 : 48;
12
+ return l.push({
13
+ id: i.id,
14
+ x: e,
15
+ y: f,
16
+ w: n * 248 - 8 + 24,
17
+ h: m,
18
+ open: a
19
+ }), a && i.children.forEach((t, r) => c.set(t, {
20
+ x: e + 12 + r % n * 248,
21
+ y: f + 48 + Math.floor(r / n) * 52,
22
+ w: 240,
23
+ h: 44,
24
+ sm: !0,
25
+ team: i.id
26
+ })), c.set(i.id, {
27
+ x: p,
28
+ y: f + 24 - 29 + 4,
29
+ w: o,
30
+ h: 58
31
+ }), Math.max(m, 58) + 16;
32
+ }
33
+ if (!i.children.length) return c.set(i.id, {
34
+ x: p,
35
+ y: f,
36
+ w: o,
37
+ h: 58
38
+ }), 68;
39
+ let m = f;
40
+ for (let t of i.children) m += u(e.byId.get(t), d + 1, m);
41
+ let h = m - f - 10, g = c.get(i.children[0]);
42
+ return c.set(i.id, {
43
+ x: p,
44
+ y: h > n - 48 ? g.y : f + Math.max(0, h / 2 - 29),
45
+ w: o,
46
+ h: 58
47
+ }), Math.max(m - f, 68);
48
+ };
49
+ if (i) {
50
+ let t = 16;
51
+ for (let n of e.tree) c.set(n.id, {
52
+ x: 12 + Math.min(n.depth, 4) * 20,
53
+ y: t,
54
+ w: o - Math.min(n.depth, 4) * 20,
55
+ h: 58
56
+ }), t += 66;
57
+ } else {
58
+ let t = 24;
59
+ for (let n of e.agents.filter((e) => !e.parent)) t += u(n, 0, t);
60
+ }
61
+ let d = [...c.values(), ...l], f = Math.max(0, ...d.map((e) => e.x + e.w)) + 24, p = Math.max(0, ...d.map((e) => e.y + e.h)) + 24, m = i ? 0 : Math.max(0, (t - f) / 2);
62
+ for (let e of d) e.x += m;
63
+ return {
64
+ pos: c,
65
+ frames: l,
66
+ W: Math.max(t, f + m),
67
+ H: Math.max(n, p),
68
+ over: p > n + 160 || f > t + 160
69
+ };
70
+ }
71
+ function w({ m: e, agent: t, selectAgent: n, route: i, doc: d }) {
72
+ let p = (0, x.useRef)(null), y = u(), [w, D] = (0, x.useState)({
73
+ w: 1e3,
74
+ h: 700
75
+ }), [O, k] = (0, x.useState)({
76
+ top: 0,
77
+ left: 0
78
+ }), [A, j] = (0, x.useState)(() => new Set(e.teams.length === 1 ? [e.teams[0].id] : [])), M = f();
79
+ (0, x.useLayoutEffect)(() => {
80
+ let e = p.current;
81
+ if (!e) return;
82
+ let t = () => D({
83
+ w: e.clientWidth,
84
+ h: e.clientHeight
85
+ });
86
+ t();
87
+ let n = new ResizeObserver(t);
88
+ return n.observe(e), () => n.disconnect();
89
+ }, []);
90
+ let N = (0, x.useMemo)(() => C(e, w.w, w.h, A, y), [
91
+ e,
92
+ w,
93
+ A,
94
+ y
95
+ ]), P = t ?? e.root?.id ?? null, { anc: F, desc: I } = (0, x.useMemo)(() => {
96
+ let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
97
+ for (let n = P ? e.byId.get(P)?.parent : null; n; n = e.byId.get(n)?.parent ?? null) t.add(n);
98
+ let r = (t) => {
99
+ for (let i of e.byId.get(t)?.children ?? []) n.add(i), r(i);
100
+ };
101
+ return P && r(P), {
102
+ anc: t,
103
+ desc: n
104
+ };
105
+ }, [e, P]), L = P !== null && P !== e.root?.id, R = (e) => !L || e === P || F.has(e) || I.has(e), z = (e) => {
106
+ let t = N.pos.get(e);
107
+ t && p.current && p.current.scrollTo({
108
+ left: t.x + t.w / 2 - w.w / 2,
109
+ top: t.y + t.h / 2 - w.h / 2,
110
+ behavior: "smooth"
111
+ });
112
+ };
113
+ (0, x.useEffect)(() => {
114
+ if (P) {
115
+ let t = e.byId.get(P)?.team;
116
+ t && t !== P && !A.has(t) && j(/* @__PURE__ */ new Set([...A, t]));
117
+ }
118
+ }, [P]);
119
+ let B = (e) => [e.x + e.w, e.y + e.h / 2], V = (e) => [e.x, e.y + e.h / 2], H = (e, t, n, r) => {
120
+ if (y) {
121
+ let [i, a] = V(t);
122
+ return /* @__PURE__ */ (0, S.jsx)("path", {
123
+ d: `M${e.x + 16} ${e.y + e.h} V${a - 8} q0 8 8 8 H${i}`,
124
+ className: n ? "hot" : ""
125
+ }, r);
126
+ }
127
+ let [i, a] = B(e), [o, s] = V(t), c = (i + o) / 2;
128
+ return /* @__PURE__ */ (0, S.jsx)("path", {
129
+ d: `M${i} ${a} C${c} ${a} ${c} ${s} ${o} ${s}`,
130
+ className: n ? "hot" : L ? "fade" : ""
131
+ }, r);
132
+ }, U = [];
133
+ for (let t of e.agents) {
134
+ let e = N.pos.get(t.id), n = t.parent ? N.pos.get(t.parent) : null;
135
+ e && n && !e.team && U.push(H(n, e, t.id === P || t.parent === P || F.has(t.id) && (F.has(t.parent) || t.parent === P), t.id));
136
+ }
137
+ for (let e of N.frames) {
138
+ let t = N.pos.get(e.id);
139
+ t && U.push(H(t, {
140
+ x: e.x,
141
+ y: e.y,
142
+ w: e.w,
143
+ h: 48
144
+ }, e.id === P || N.pos.get(P ?? "")?.team === e.id, `f:${e.id}`));
145
+ }
146
+ let W = e.agents.filter((e) => {
147
+ let t = N.pos.get(e.id);
148
+ return t && t.y + t.h >= O.top - 400 && t.y <= O.top + w.h + 400 && t.x + t.w >= O.left - 400 && t.x <= O.left + w.w + 400;
149
+ }), G = () => p.current?.getBoundingClientRect(), K = P ? e.byId.get(P) ?? null : null, q = (0, x.useMemo)(() => {
150
+ let t = /* @__PURE__ */ new Map();
151
+ for (let n of e.agents) t.has(n.state.label) || t.set(n.state.label, n.state);
152
+ return [...t.values()];
153
+ }, [e]);
154
+ return /* @__PURE__ */ (0, S.jsxs)("div", {
155
+ className: "rp-topo",
156
+ children: [/* @__PURE__ */ (0, S.jsxs)("section", {
157
+ className: "rp-card",
158
+ "aria-label": "Spawn tree",
159
+ children: [/* @__PURE__ */ (0, S.jsxs)("div", {
160
+ className: "rp-hd rp-hd-tools",
161
+ children: [/* @__PURE__ */ (0, S.jsx)("div", {
162
+ className: "rp-legend",
163
+ children: q.map((e) => /* @__PURE__ */ (0, S.jsxs)("span", {
164
+ className: "rp-key",
165
+ children: [/* @__PURE__ */ (0, S.jsx)(h, { tone: e.tone }), e.label]
166
+ }, e.label))
167
+ }), /* @__PURE__ */ (0, S.jsxs)("span", {
168
+ className: "end",
169
+ children: [e.teams.length > 0 && !y && /* @__PURE__ */ (0, S.jsxs)("span", {
170
+ className: "rp-group",
171
+ role: "group",
172
+ "aria-label": "Teams",
173
+ children: [/* @__PURE__ */ (0, S.jsx)("button", {
174
+ type: "button",
175
+ className: "rp-btn",
176
+ onClick: () => j(new Set(e.teams.map((e) => e.id))),
177
+ children: "Expand all"
178
+ }), /* @__PURE__ */ (0, S.jsx)("button", {
179
+ type: "button",
180
+ className: "rp-btn",
181
+ onClick: () => j(/* @__PURE__ */ new Set()),
182
+ children: "Collapse all"
183
+ })]
184
+ }), /* @__PURE__ */ (0, S.jsx)(m, {
185
+ label: "Go to agent",
186
+ options: c(e),
187
+ groups: _(e),
188
+ value: P,
189
+ placeholder: `Search ${e.agents.length} agents`,
190
+ width: 340,
191
+ style: { width: 220 },
192
+ onChange: (e) => {
193
+ e && (n(e), window.setTimeout(() => z(e), 60));
194
+ },
195
+ children: /* @__PURE__ */ (0, S.jsx)("span", {
196
+ className: "dim",
197
+ children: "Go to agent"
198
+ })
199
+ })]
200
+ })]
201
+ }), /* @__PURE__ */ (0, S.jsxs)("div", {
202
+ className: "rp-topo-wrap",
203
+ children: [/* @__PURE__ */ (0, S.jsxs)("div", {
204
+ className: "rp-topo-canvas",
205
+ ref: p,
206
+ onScroll: (e) => k({
207
+ top: e.currentTarget.scrollTop,
208
+ left: e.currentTarget.scrollLeft
209
+ }),
210
+ children: [
211
+ /* @__PURE__ */ (0, S.jsx)("svg", {
212
+ className: "edges",
213
+ width: N.W,
214
+ height: N.H,
215
+ "aria-hidden": "true",
216
+ children: U
217
+ }),
218
+ N.frames.map((t) => {
219
+ let n = e.teams.find((e) => e.id === t.id), r = n.members.map((t) => e.byId.get(t)), i = r.filter((e) => e.state.tone === "live").length, c = r.filter((e) => a(e.state.tone)).length, l = L && !(t.id === P || F.has(t.id) || N.pos.get(P ?? "")?.team === t.id);
220
+ return /* @__PURE__ */ (0, S.jsx)("div", {
221
+ className: `rp-team${l ? " fade" : ""}`,
222
+ style: {
223
+ left: t.x,
224
+ top: t.y,
225
+ width: t.w,
226
+ height: t.h
227
+ },
228
+ children: /* @__PURE__ */ (0, S.jsxs)("button", {
229
+ type: "button",
230
+ className: "rp-team-h",
231
+ "aria-expanded": t.open,
232
+ onClick: () => j((e) => {
233
+ let n = new Set(e);
234
+ return n.has(t.id) ? n.delete(t.id) : n.add(t.id), n;
235
+ }),
236
+ onPointerEnter: (t) => M.show({
237
+ content: /* @__PURE__ */ (0, S.jsx)(s, {
238
+ m: e,
239
+ team: n
240
+ }),
241
+ rect: t.currentTarget.getBoundingClientRect(),
242
+ bounds: G(),
243
+ vertical: !0,
244
+ wide: !0
245
+ }),
246
+ onPointerLeave: () => M.hide(),
247
+ children: [
248
+ /* @__PURE__ */ (0, S.jsx)("span", {
249
+ className: "cv",
250
+ children: /* @__PURE__ */ (0, S.jsx)(o, { name: "chevron" })
251
+ }),
252
+ /* @__PURE__ */ (0, S.jsx)("b", { children: n.label }),
253
+ /* @__PURE__ */ (0, S.jsx)("span", {
254
+ className: "ct",
255
+ children: r.length
256
+ }),
257
+ /* @__PURE__ */ (0, S.jsxs)("span", {
258
+ className: "st",
259
+ children: [
260
+ /* @__PURE__ */ (0, S.jsxs)("span", {
261
+ className: "mb",
262
+ children: [/* @__PURE__ */ (0, S.jsx)("i", {
263
+ className: "ok",
264
+ style: { width: `${c / r.length * 100}%` }
265
+ }), /* @__PURE__ */ (0, S.jsx)("i", {
266
+ className: "live",
267
+ style: { width: `${i / r.length * 100}%` }
268
+ })]
269
+ }),
270
+ i ? `${i} running · ` : "",
271
+ v(r.reduce((e, t) => e + (t.tokens ?? 0), 0))
272
+ ]
273
+ })
274
+ ]
275
+ })
276
+ }, t.id);
277
+ }),
278
+ W.map((t) => {
279
+ let i = N.pos.get(t.id), a = `rp-node${i.sm ? " sm" : ""}${t.id === P ? " sel" : ""}${R(t.id) || i.team && N.pos.get(P ?? "")?.team === i.team ? "" : " fade"}${t.state.tone === "none" ? " ghost" : ""}`;
280
+ return /* @__PURE__ */ (0, S.jsxs)("button", {
281
+ type: "button",
282
+ className: a,
283
+ style: {
284
+ left: i.x,
285
+ top: i.y,
286
+ width: i.w
287
+ },
288
+ "aria-pressed": t.id === P,
289
+ onClick: () => n(t.id),
290
+ onPointerEnter: (n) => M.show({
291
+ content: /* @__PURE__ */ (0, S.jsx)(g, {
292
+ m: e,
293
+ a: t
294
+ }),
295
+ rect: n.currentTarget.getBoundingClientRect(),
296
+ bounds: G(),
297
+ vertical: !0,
298
+ wide: t.tools.length > 0
299
+ }),
300
+ onPointerLeave: () => M.hide(),
301
+ onFocus: (n) => M.show({
302
+ content: /* @__PURE__ */ (0, S.jsx)(g, {
303
+ m: e,
304
+ a: t
305
+ }),
306
+ rect: n.currentTarget.getBoundingClientRect(),
307
+ bounds: G(),
308
+ vertical: !0,
309
+ wide: t.tools.length > 0
310
+ }),
311
+ onBlur: () => M.hide(),
312
+ children: [/* @__PURE__ */ (0, S.jsxs)("span", {
313
+ className: "r1",
314
+ children: [
315
+ /* @__PURE__ */ (0, S.jsx)(h, { tone: t.state.tone }),
316
+ /* @__PURE__ */ (0, S.jsx)("span", {
317
+ className: "nm",
318
+ title: t.name,
319
+ children: l(i.sm && t.parent && t.name.startsWith(`${e.byId.get(t.parent)?.name}-`) ? t.name.slice((e.byId.get(t.parent)?.name.length ?? 0) + 1) : t.name.length <= (i.sm ? 18 : 24) ? t.name : t.short, i.sm ? 18 : 24)
320
+ }),
321
+ i.sm && /* @__PURE__ */ (0, S.jsx)("span", {
322
+ className: "dim",
323
+ children: v(t.tokens)
324
+ })
325
+ ]
326
+ }), !i.sm && /* @__PURE__ */ (0, S.jsx)("span", {
327
+ className: "r2",
328
+ children: [
329
+ t.state.label,
330
+ t.tokens === null ? "no usage recorded" : `${v(t.tokens)} tokens`,
331
+ t.tokens === null ? "" : `${r(t.steps.length)} steps`,
332
+ t.failedSteps ? `${t.failedSteps} failed` : ""
333
+ ].filter(Boolean).join(" · ")
334
+ })]
335
+ }, t.id);
336
+ }),
337
+ /* @__PURE__ */ (0, S.jsx)("div", { style: {
338
+ position: "absolute",
339
+ left: 0,
340
+ top: N.H - 1,
341
+ width: N.W,
342
+ height: 1
343
+ } })
344
+ ]
345
+ }), N.over && !y && /* @__PURE__ */ (0, S.jsx)(T, {
346
+ m: e,
347
+ L: N,
348
+ view: O,
349
+ size: w,
350
+ selected: P,
351
+ onJump: (e, t) => p.current?.scrollTo({
352
+ left: e - w.w / 2,
353
+ top: t - w.h / 2
354
+ })
355
+ })]
356
+ })]
357
+ }), K && /* @__PURE__ */ (0, S.jsx)(E, {
358
+ m: e,
359
+ a: K,
360
+ onSelect: (e) => {
361
+ n(e), window.setTimeout(() => z(e), 60);
362
+ },
363
+ href: i.href("conversations", { agent: b(d.run.id, K.id) })
364
+ })]
365
+ });
366
+ }
367
+ function T({ m: e, L: t, view: n, size: r, selected: i, onJump: a }) {
368
+ let o = 184 / t.W, s = Math.min(160, t.H * o);
369
+ return /* @__PURE__ */ (0, S.jsxs)("div", {
370
+ className: "rp-mm",
371
+ onClick: (e) => {
372
+ let t = e.currentTarget.querySelector("svg").getBoundingClientRect();
373
+ a((e.clientX - t.left) / o, (e.clientY - t.top) / o);
374
+ },
375
+ children: [/* @__PURE__ */ (0, S.jsxs)("div", {
376
+ className: "mm-h",
377
+ children: [/* @__PURE__ */ (0, S.jsx)("span", { children: "Map" }), /* @__PURE__ */ (0, S.jsxs)("span", { children: [e.agents.length, " agents"] })]
378
+ }), /* @__PURE__ */ (0, S.jsxs)("svg", {
379
+ viewBox: `0 0 184 ${s}`,
380
+ style: { height: s },
381
+ "aria-hidden": "true",
382
+ children: [
383
+ t.frames.map((e) => /* @__PURE__ */ (0, S.jsx)("rect", {
384
+ x: e.x * o,
385
+ y: e.y * o,
386
+ width: e.w * o,
387
+ height: e.h * o,
388
+ rx: "1.5",
389
+ className: "fr"
390
+ }, e.id)),
391
+ [...t.pos].map(([t, n]) => /* @__PURE__ */ (0, S.jsx)("rect", {
392
+ x: n.x * o,
393
+ y: n.y * o,
394
+ width: Math.max(1.5, n.w * o),
395
+ height: Math.max(1.5, n.h * o),
396
+ rx: "1.5",
397
+ className: t === i ? "sel" : e.byId.get(t)?.state.tone === "live" ? "live" : ""
398
+ }, t)),
399
+ /* @__PURE__ */ (0, S.jsx)("rect", {
400
+ x: n.left * o,
401
+ y: n.top * o,
402
+ width: r.w * o,
403
+ height: r.h * o,
404
+ rx: "2",
405
+ className: "vp"
406
+ })
407
+ ]
408
+ })]
409
+ });
410
+ }
411
+ function E({ m: e, a: t, onSelect: n, href: a }) {
412
+ let s = y(e.t0), c = Math.max(1, ...t.tools.map((e) => e.calls)), l = t.parent ? e.byId.get(t.parent) : null, u = [[
413
+ t.model ?? "model",
414
+ t.latency.p50,
415
+ t.latency.p90,
416
+ t.latency.p99,
417
+ t.modelCalls
418
+ ], ...t.tools.slice(0, 5).map((e) => [
419
+ e.name,
420
+ e.p50,
421
+ e.p90,
422
+ e.p99,
423
+ e.calls
424
+ ])];
425
+ return /* @__PURE__ */ (0, S.jsxs)("aside", {
426
+ className: "rp-card",
427
+ "aria-label": t.name,
428
+ children: [/* @__PURE__ */ (0, S.jsxs)("div", {
429
+ className: "rp-hd",
430
+ children: [/* @__PURE__ */ (0, S.jsxs)("h2", { children: [/* @__PURE__ */ (0, S.jsx)(h, { tone: t.state.tone }), t.name] }), /* @__PURE__ */ (0, S.jsx)("span", {
431
+ className: "end",
432
+ children: /* @__PURE__ */ (0, S.jsx)("span", {
433
+ className: `rp-pill ${t.state.tone}`,
434
+ children: t.state.label
435
+ })
436
+ })]
437
+ }), /* @__PURE__ */ (0, S.jsxs)("div", {
438
+ className: "rp-scroll rp-tinsp",
439
+ children: [
440
+ /* @__PURE__ */ (0, S.jsxs)("dl", {
441
+ className: "rp-kv",
442
+ children: [
443
+ /* @__PURE__ */ (0, S.jsx)("dt", { children: "Model" }),
444
+ /* @__PURE__ */ (0, S.jsx)("dd", { children: [t.model, t.harness].filter(Boolean).join(" · ") || "—" }),
445
+ /* @__PURE__ */ (0, S.jsx)("dt", { children: "Spawned" }),
446
+ /* @__PURE__ */ (0, S.jsxs)("dd", { children: [l ? `by ${l.name} · ` : "", t.start === null ? "—" : `${s(Math.max(0, t.start))} UTC`] }),
447
+ /* @__PURE__ */ (0, S.jsx)("dt", { children: "Ended" }),
448
+ /* @__PURE__ */ (0, S.jsx)("dd", { children: t.state.tone === "live" ? "running" : t.end === null ? "—" : `${s(t.end)} UTC` }),
449
+ /* @__PURE__ */ (0, S.jsx)("dt", { children: "Cost" }),
450
+ /* @__PURE__ */ (0, S.jsx)("dd", { children: d(t) })
451
+ ]
452
+ }),
453
+ /* @__PURE__ */ (0, S.jsxs)("div", {
454
+ className: "rp-stat3",
455
+ children: [
456
+ /* @__PURE__ */ (0, S.jsxs)("div", { children: [/* @__PURE__ */ (0, S.jsx)("b", { children: v(t.tokens) }), /* @__PURE__ */ (0, S.jsx)("span", { children: "tokens" })] }),
457
+ /* @__PURE__ */ (0, S.jsxs)("div", { children: [/* @__PURE__ */ (0, S.jsx)("b", { children: r(t.modelCalls) }), /* @__PURE__ */ (0, S.jsx)("span", { children: "model calls" })] }),
458
+ /* @__PURE__ */ (0, S.jsxs)("div", { children: [/* @__PURE__ */ (0, S.jsx)("b", { children: r(t.toolCalls) }), /* @__PURE__ */ (0, S.jsx)("span", { children: "tool calls" })] }),
459
+ /* @__PURE__ */ (0, S.jsxs)("div", { children: [/* @__PURE__ */ (0, S.jsx)("b", { children: t.failedSteps }), /* @__PURE__ */ (0, S.jsx)("span", { children: "failed steps" })] }),
460
+ /* @__PURE__ */ (0, S.jsxs)("div", { children: [/* @__PURE__ */ (0, S.jsx)("b", { children: t.restarts.length }), /* @__PURE__ */ (0, S.jsx)("span", { children: "restarts" })] }),
461
+ /* @__PURE__ */ (0, S.jsxs)("div", { children: [/* @__PURE__ */ (0, S.jsx)("b", { children: t.commits ?? "—" }), /* @__PURE__ */ (0, S.jsx)("span", { children: "commits" })] })
462
+ ]
463
+ }),
464
+ t.modelCalls > 0 && /* @__PURE__ */ (0, S.jsxs)(S.Fragment, { children: [/* @__PURE__ */ (0, S.jsx)("h5", {
465
+ className: "rp-subh",
466
+ children: "Latency"
467
+ }), /* @__PURE__ */ (0, S.jsxs)("table", {
468
+ className: "rp-lt",
469
+ children: [/* @__PURE__ */ (0, S.jsx)("thead", { children: /* @__PURE__ */ (0, S.jsxs)("tr", { children: [
470
+ /* @__PURE__ */ (0, S.jsx)("th", {}),
471
+ /* @__PURE__ */ (0, S.jsx)("th", { children: "calls" }),
472
+ /* @__PURE__ */ (0, S.jsx)("th", { children: "p50" }),
473
+ /* @__PURE__ */ (0, S.jsx)("th", { children: "p90" }),
474
+ /* @__PURE__ */ (0, S.jsx)("th", { children: "p99" })
475
+ ] }) }), /* @__PURE__ */ (0, S.jsx)("tbody", { children: u.map(([e, t, n, a, o]) => /* @__PURE__ */ (0, S.jsxs)("tr", { children: [
476
+ /* @__PURE__ */ (0, S.jsx)("td", {
477
+ title: e,
478
+ children: e
479
+ }),
480
+ /* @__PURE__ */ (0, S.jsx)("td", { children: r(o) }),
481
+ /* @__PURE__ */ (0, S.jsx)("td", { children: i(t) }),
482
+ /* @__PURE__ */ (0, S.jsx)("td", { children: i(n) }),
483
+ /* @__PURE__ */ (0, S.jsx)("td", { children: i(a) })
484
+ ] }, e)) })]
485
+ })] }),
486
+ t.tools.length > 0 && /* @__PURE__ */ (0, S.jsxs)(S.Fragment, { children: [/* @__PURE__ */ (0, S.jsx)("h5", {
487
+ className: "rp-subh",
488
+ children: "Tool calls"
489
+ }), /* @__PURE__ */ (0, S.jsx)("div", {
490
+ className: "rp-tbars four",
491
+ children: t.tools.slice(0, 8).map((e) => /* @__PURE__ */ (0, S.jsxs)("div", {
492
+ className: "row",
493
+ children: [
494
+ /* @__PURE__ */ (0, S.jsx)("span", {
495
+ className: "l",
496
+ title: e.name,
497
+ children: e.name
498
+ }),
499
+ /* @__PURE__ */ (0, S.jsx)(p, {
500
+ ok: e.calls - e.failures,
501
+ failed: e.failures,
502
+ max: c
503
+ }),
504
+ /* @__PURE__ */ (0, S.jsx)("span", {
505
+ className: "n",
506
+ children: r(e.calls)
507
+ }),
508
+ /* @__PURE__ */ (0, S.jsx)("span", {
509
+ className: "n f",
510
+ children: e.failures ? `${e.failures} ✕` : ""
511
+ })
512
+ ]
513
+ }, e.name))
514
+ })] }),
515
+ t.children.length > 0 && /* @__PURE__ */ (0, S.jsxs)(S.Fragment, { children: [/* @__PURE__ */ (0, S.jsxs)("h5", {
516
+ className: "rp-subh",
517
+ children: ["Spawned · ", t.children.length]
518
+ }), /* @__PURE__ */ (0, S.jsxs)("div", {
519
+ className: "rp-chips",
520
+ children: [t.children.slice(0, 14).map((t) => {
521
+ let r = e.byId.get(t);
522
+ return /* @__PURE__ */ (0, S.jsxs)("button", {
523
+ type: "button",
524
+ className: "rp-chip",
525
+ onClick: () => n(t),
526
+ children: [/* @__PURE__ */ (0, S.jsx)(h, { tone: r.state.tone }), r.name]
527
+ }, t);
528
+ }), t.children.length > 14 && /* @__PURE__ */ (0, S.jsxs)("span", {
529
+ className: "rp-chip dim",
530
+ children: [t.children.length - 14, " more"]
531
+ })]
532
+ })] }),
533
+ /* @__PURE__ */ (0, S.jsx)("p", { children: /* @__PURE__ */ (0, S.jsxs)("a", {
534
+ className: "rp-btn sm framed",
535
+ href: a,
536
+ children: ["Conversation", /* @__PURE__ */ (0, S.jsx)(o, {
537
+ name: "arrow",
538
+ size: 14
539
+ })]
540
+ }) })
541
+ ]
542
+ })]
543
+ });
544
+ }
545
+ //#endregion
546
+ export { w as Topology };