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