@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,477 +0,0 @@
1
- import { y as e } from "./run-receipt-Bvi4-KVM.js";
2
- import { A as t, C as n, S as r, _ as i, a, b as o, h as s, k as c, s as l, t as u, v as d } from "./ui-CEhDqce8.js";
3
- import { t as f } from "./plain-words-CgvxtEOa.js";
4
- import { agentParam as p } from "./RunPage-nJwCsArn.js";
5
- import { useMemo as m, useRef as h } from "react";
6
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
7
- import { Popover as y, PopoverContent as b, PopoverTrigger as x } from "@tangle-network/ui/primitives";
8
- //#region src/workspace/run/Overview.tsx
9
- function S(e, t = Infinity) {
10
- if (!e) return "";
11
- let n = e.replace(/\/(home|mnt|Users|tmp|private)\/\S+/g, "").replace(/\s+/g, " ").trim();
12
- n = n.replace(/^(?:[\w-]+(?: [\w-]+){0,3}: )+(?=\S)/, (e) => e.split(": ").length > 2 ? "" : e), n = n.split(/(?<=[.;])\s|;\s|, the |, starting /)[0] ?? n;
13
- let r = n.split(" ");
14
- return (r.length > t ? `${r.slice(0, t).join(" ")}…` : n).replace(/[.;,]$/, "");
15
- }
16
- function C(e) {
17
- let t = e.steps.filter(({ step: e }) => e.kind !== "waiting").map(({ step: e }) => [e.t, e.t + e.d]).sort((e, t) => e[0] - t[0]), n = [];
18
- for (let [e, r] of t) {
19
- let t = n[n.length - 1];
20
- t && e <= t[1] + 3e4 ? t[1] = Math.max(t[1], r) : n.push([e, r]);
21
- }
22
- return n;
23
- }
24
- function w(r) {
25
- let { m: i, doc: o, play: s, route: c } = r, l = o.view, u = o.run, d = o.execution, f = (s?.runs ?? []).filter((e) => e.id !== o.run.id && e.startedAt && o.run.startedAt && e.startedAt > o.run.startedAt).sort((e, t) => e.startedAt < t.startedAt ? -1 : 1)[0], p = m(() => C(i), [i]), h = new Date(i.t0).toISOString().slice(0, 10) !== new Date(i.t0 + i.duration).toISOString().slice(0, 10), g = p.reduce((e, [t, n]) => e + (n - t), 0), y = i.best, b = y && y.passed !== null && y.passed !== void 0 && y.total && y.passed === y.total, x = l?.status.label ?? o.run.state, w = i.live ? `Running for ${n(i.duration)}${y ? `; best release ${y.release} passed ${y.passed}/${y.total} steps` : ", no release checked yet"}.` : b ? `Solved in ${n(i.duration)}: ${y.release} passed every step.` : `${x} after ${n(i.duration)}${y ? `; best release ${y.release} passed ${y.passed ?? 0}/${y.total ?? "?"} steps` : " with no release checked"}.`, D = S(u.ending?.reason ?? l?.blocker?.why ?? l?.blocker?.sentence, 26), k = d?.failedAttempts ?? 0, A = [D && `${D}.`, k && i.totals.lastStep !== null ? `Agents worked for ${n(g)}; ${k} later tries failed${d?.lastAttempt?.error ? `, the last on “${S(d.lastAttempt.error, 8)}”` : ""}.` : ""].filter(Boolean).join(" "), j = i.live ? "clock" : b ? "check" : "stop", M = [
26
- {
27
- at: o.run.startedAt,
28
- title: "Run started",
29
- sub: `${i.agents.length} agents${i.root?.model ? ` on ${i.root.model}` : ""}`,
30
- tone: ""
31
- },
32
- ...i.totals.lastStep === null ? [] : [{
33
- at: new Date(i.t0 + i.totals.lastStep).toISOString(),
34
- title: i.live ? "Latest agent step" : "Last agent step",
35
- sub: `+${n(i.totals.lastStep)} into the run`,
36
- tone: i.duration - i.totals.lastStep > 18e5 ? "warn" : ""
37
- }],
38
- ...d?.lastAttempt?.error ? [{
39
- at: d.lastAttempt.at ?? null,
40
- title: "Last try failed",
41
- sub: S(d.lastAttempt.error, 10),
42
- tone: "fail"
43
- }] : [],
44
- i.live ? {
45
- at: (/* @__PURE__ */ new Date()).toISOString(),
46
- title: "Running now",
47
- sub: `${i.agents.filter((e) => e.state.tone === "live").length} agents live`,
48
- tone: "next"
49
- } : {
50
- at: u.ending?.at ?? o.run.settledAt,
51
- title: x,
52
- sub: f ? `continued in run ${e(o.run.play, f.id)}` : S(u.ending?.sentence, 8),
53
- tone: "next"
54
- }
55
- ];
56
- return /* @__PURE__ */ v("div", {
57
- className: "rp-ov",
58
- children: [
59
- /* @__PURE__ */ v("section", {
60
- className: "rp-card rp-vd",
61
- "aria-label": "Verdict",
62
- children: [/* @__PURE__ */ v("div", {
63
- className: "rp-vd-top",
64
- children: [
65
- /* @__PURE__ */ _("div", {
66
- className: "rp-vd-ic",
67
- children: /* @__PURE__ */ _(a, {
68
- name: j,
69
- size: 22
70
- })
71
- }),
72
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h2", {
73
- className: "rp-verdict",
74
- children: w
75
- }), A && /* @__PURE__ */ _("p", {
76
- className: "rp-lede",
77
- children: A
78
- })] }),
79
- /* @__PURE__ */ v("div", {
80
- className: "rp-vd-act",
81
- children: [i.live ? /* @__PURE__ */ v("a", {
82
- className: "rp-btn primary",
83
- href: c.href("timeline"),
84
- children: ["Watch the timeline", /* @__PURE__ */ _(a, { name: "arrow" })]
85
- }) : f ? /* @__PURE__ */ v("a", {
86
- className: "rp-btn primary",
87
- href: `/run/${encodeURIComponent(f.id)}`,
88
- children: [
89
- "Open run ",
90
- e(o.run.play, f.id),
91
- /* @__PURE__ */ _(a, { name: "arrow" })
92
- ]
93
- }) : null, /* @__PURE__ */ _("a", {
94
- className: "rp-btn framed",
95
- href: c.href("files"),
96
- children: "Files"
97
- })]
98
- })
99
- ]
100
- }), /* @__PURE__ */ _("ol", {
101
- className: "rp-story",
102
- children: M.map((e, n) => /* @__PURE__ */ v("li", { children: [
103
- /* @__PURE__ */ _("span", { className: `sd ${e.tone}` }),
104
- /* @__PURE__ */ _("time", { children: e.at ? t(e.at, h) : "—" }),
105
- /* @__PURE__ */ _("b", { children: e.title }),
106
- /* @__PURE__ */ _("span", {
107
- title: e.sub,
108
- children: e.sub
109
- })
110
- ] }, n))
111
- })]
112
- }),
113
- /* @__PURE__ */ _(T, { ...r }),
114
- /* @__PURE__ */ v("div", {
115
- className: "rp-ov-b",
116
- children: [/* @__PURE__ */ _(E, {
117
- m: i,
118
- work: p,
119
- working: g,
120
- failed: k
121
- }), /* @__PURE__ */ _(O, { ...r })]
122
- })
123
- ]
124
- });
125
- }
126
- function T({ m: e, doc: t, route: n }) {
127
- let i = t.run.check, o = i?.checkerNames?.find((e) => e.current) ?? i?.checkerNames?.[0], s = f(t.input?.objective), c = (t.findings?.items ?? []).filter((e) => e.path), u = e.agents.filter((e) => e.node.hasCode).length, d = e.agents.reduce((e, t) => e + (t.commits ?? 0), 0), p = e.best, m = i?.latest ? i.latest.solved ? "Passed" : i.latest.known ? "Failed" : "No verdict" : "Not checked";
128
- return /* @__PURE__ */ v("section", {
129
- className: "rp-card rp-sum",
130
- "aria-label": "Summary",
131
- children: [
132
- /* @__PURE__ */ v("div", { children: [
133
- /* @__PURE__ */ _("h3", { children: "Goal" }),
134
- /* @__PURE__ */ _("div", {
135
- className: "goal",
136
- children: S(s) || "Not recorded"
137
- }),
138
- s && /* @__PURE__ */ v(y, { children: [/* @__PURE__ */ _(x, {
139
- asChild: !0,
140
- children: /* @__PURE__ */ _("button", {
141
- type: "button",
142
- className: "rp-link",
143
- children: "Read the goal"
144
- })
145
- }), /* @__PURE__ */ v(b, {
146
- className: "rp-pop wide",
147
- align: "start",
148
- children: [/* @__PURE__ */ v("div", {
149
- className: "ph",
150
- children: [/* @__PURE__ */ _("b", { children: "Goal" }), /* @__PURE__ */ _("span", { children: "as pressed" })]
151
- }), /* @__PURE__ */ _("div", {
152
- className: "rp-pop-goal",
153
- children: s
154
- })]
155
- })] })
156
- ] }),
157
- /* @__PURE__ */ v("div", { children: [
158
- /* @__PURE__ */ _("h3", { children: "Check" }),
159
- /* @__PURE__ */ v("div", {
160
- className: "v",
161
- children: [m === "Passed" ? /* @__PURE__ */ _(l, { tone: "ok" }) : m === "Failed" ? /* @__PURE__ */ _(l, { tone: "fail" }) : /* @__PURE__ */ _(l, { tone: "none" }), m]
162
- }),
163
- /* @__PURE__ */ v("div", {
164
- className: "sub",
165
- children: [i?.counts?.checks ? `${o ? `Checker ${o.label}` : "The checker"} ran ${i.counts.checks} times${i.latest?.line ? `; latest: ${S(i.latest.line, 10)}` : ""}. ` : "No check has run. ", /* @__PURE__ */ _("a", {
166
- href: n.href("checks"),
167
- children: "Checks"
168
- })]
169
- })
170
- ] }),
171
- /* @__PURE__ */ v("div", { children: [
172
- /* @__PURE__ */ _("h3", { children: "Best release" }),
173
- /* @__PURE__ */ _("div", {
174
- className: "v",
175
- children: p ? `${p.release}${p.total ? ` · ${p.passed ?? 0}/${p.total}` : ""}` : "None"
176
- }),
177
- /* @__PURE__ */ _("div", {
178
- className: "sub",
179
- children: p ? p.sentence ? S(p.sentence, 14) : `${e.releases.length} releases checked` : e.releases.length ? `${e.releases.length} releases, none scored` : `${r(d)} commits, none tagged`
180
- })
181
- ] }),
182
- /* @__PURE__ */ v("div", { children: [
183
- /* @__PURE__ */ _("h3", { children: "Work kept" }),
184
- /* @__PURE__ */ v("div", {
185
- className: "v",
186
- children: [
187
- r(c.length),
188
- " pages · ",
189
- r(u),
190
- " branches"
191
- ]
192
- }),
193
- /* @__PURE__ */ v("div", {
194
- className: "files",
195
- children: [c.slice(0, 3).map((e) => /* @__PURE__ */ v("a", {
196
- href: n.href("files", { file: `page:${e.path}` }),
197
- title: e.path,
198
- children: [/* @__PURE__ */ _(a, {
199
- name: "file",
200
- size: 14
201
- }), /* @__PURE__ */ _("span", { children: e.path.split("/").pop() })]
202
- }, e.path)), c.length > 3 && /* @__PURE__ */ _("a", {
203
- href: n.href("files"),
204
- children: /* @__PURE__ */ v("span", { children: [c.length - 3, " more"] })
205
- })]
206
- })
207
- ] })
208
- ]
209
- });
210
- }
211
- function E({ m: e, work: r, working: i, failed: a }) {
212
- let s = (t) => `${Math.max(0, Math.min(100, t / Math.max(1, e.duration) * 100))}%`, c = e.duration > 36e5 ? Math.floor(e.duration / 36e5) : 0, l = new Date(e.t0).toISOString().slice(0, 10) !== new Date(e.t0 + e.duration).toISOString().slice(0, 10), u = e.duration * (l ? .16 : .08), d = c <= 10 ? 1 : Math.ceil(c / 8), f = c ? Array.from({ length: c }, (e, t) => t + 1).filter((t) => t % d === 0 && t * 36e5 >= u && (t + d) * 36e5 <= e.duration && t * 36e5 <= e.duration - u) : [], p = e.tree.filter((e) => e.restarts.length || e.state.tone === "ok").slice(0, 14), m = (n) => l ? t(new Date(e.t0 + n).toISOString(), !0).replace(" UTC", "") : o(e.t0)(n);
213
- return /* @__PURE__ */ v("section", {
214
- className: "rp-card",
215
- "aria-label": "Where the time went",
216
- children: [/* @__PURE__ */ v("div", {
217
- className: "rp-hd sm",
218
- children: [/* @__PURE__ */ v("h2", { children: [
219
- "Where the ",
220
- n(e.duration),
221
- " went"
222
- ] }), /* @__PURE__ */ v("span", {
223
- className: "end rp-keys",
224
- children: [
225
- /* @__PURE__ */ v("span", {
226
- className: "rp-key",
227
- children: [
228
- /* @__PURE__ */ _("i", { className: "work" }),
229
- /* @__PURE__ */ _("b", { children: n(i) }),
230
- " agents working"
231
- ]
232
- }),
233
- /* @__PURE__ */ v("span", {
234
- className: "rp-key",
235
- children: [
236
- /* @__PURE__ */ _("i", { className: "hatch" }),
237
- /* @__PURE__ */ _("b", { children: n(Math.max(0, e.duration - i)) }),
238
- " idle"
239
- ]
240
- }),
241
- a > 0 && /* @__PURE__ */ v("span", {
242
- className: "rp-key",
243
- children: [
244
- /* @__PURE__ */ _("span", {
245
- className: "x",
246
- children: "✕"
247
- }),
248
- /* @__PURE__ */ _("b", { children: a }),
249
- " tries failed"
250
- ]
251
- })
252
- ]
253
- })]
254
- }), /* @__PURE__ */ _("div", {
255
- className: "rp-twrap",
256
- children: /* @__PURE__ */ v("div", {
257
- className: "rp-tg",
258
- children: [
259
- /* @__PURE__ */ _("span", {
260
- className: "nm h",
261
- children: "Whole run"
262
- }),
263
- /* @__PURE__ */ _("div", {
264
- className: "rp-strip",
265
- role: "img",
266
- "aria-label": `Agents worked ${n(i)} of ${n(e.duration)}`,
267
- children: r.map(([e, t], n) => /* @__PURE__ */ _("i", { style: {
268
- left: s(e),
269
- width: `max(1px, calc(${s(t)} - ${s(e)}))`
270
- } }, n))
271
- }),
272
- /* @__PURE__ */ _("span", {
273
- className: "ct",
274
- children: n(e.duration)
275
- }),
276
- /* @__PURE__ */ _("span", {}),
277
- /* @__PURE__ */ v("div", {
278
- className: "rp-strip-ax",
279
- children: [
280
- /* @__PURE__ */ _("span", {
281
- className: "first",
282
- style: { left: 0 },
283
- children: m(0)
284
- }),
285
- f.map((e) => /* @__PURE__ */ v("span", {
286
- className: e % 4 ? "ph-hide" : void 0,
287
- style: { left: s(e * 36e5) },
288
- children: [e, "h"]
289
- }, e)),
290
- /* @__PURE__ */ _("span", {
291
- className: "last",
292
- style: { left: "100%" },
293
- children: m(e.duration)
294
- })
295
- ]
296
- }),
297
- /* @__PURE__ */ _("span", {}),
298
- p.length > 0 && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ v("div", {
299
- className: "rp-tries-h",
300
- children: [/* @__PURE__ */ _("b", { children: "Restarts by agent" }), /* @__PURE__ */ v("span", {
301
- className: "end rp-keys",
302
- children: [/* @__PURE__ */ v("span", {
303
- className: "rp-key",
304
- children: [/* @__PURE__ */ _("span", {
305
- className: "x",
306
- children: "✕"
307
- }), "Restart"]
308
- }), /* @__PURE__ */ v("span", {
309
- className: "rp-key",
310
- children: [/* @__PURE__ */ _("span", { className: "rp-dot ok" }), "Done"]
311
- })]
312
- })]
313
- }), p.map((t) => /* @__PURE__ */ _(D, {
314
- m: e,
315
- a: t,
316
- X: s
317
- }, t.id))] })
318
- ]
319
- })
320
- })]
321
- });
322
- }
323
- function D({ m: e, a: t, X: n }) {
324
- let r = s(() => /* @__PURE__ */ _(u, {
325
- m: e,
326
- a: t
327
- }), { wide: t.tools.length > 0 });
328
- return /* @__PURE__ */ v(g, { children: [
329
- /* @__PURE__ */ _("span", {
330
- className: "nm",
331
- title: t.name,
332
- children: t.name
333
- }),
334
- /* @__PURE__ */ v("div", {
335
- className: "rp-tr-row",
336
- tabIndex: 0,
337
- "aria-label": `${t.name}: ${t.restarts.length} restarts`,
338
- ...r,
339
- children: [
340
- /* @__PURE__ */ _("span", {
341
- className: "life",
342
- style: {
343
- left: n(Math.max(0, t.start ?? 0)),
344
- right: `calc(100% - ${n(t.end ?? e.duration)})`
345
- }
346
- }),
347
- t.restarts.map((e, t) => /* @__PURE__ */ _("span", {
348
- className: "mk",
349
- style: { left: n(e) },
350
- children: "✕"
351
- }, t)),
352
- t.state.tone === "ok" && t.end !== null && /* @__PURE__ */ _("span", {
353
- className: "mk ok",
354
- style: { left: n(t.end) }
355
- })
356
- ]
357
- }),
358
- /* @__PURE__ */ _("span", {
359
- className: "ct",
360
- children: t.restarts.length || "—"
361
- })
362
- ] });
363
- }
364
- function O({ m: e, route: t, doc: n }) {
365
- let r = m(() => [...e.agents].sort((e, t) => (t.tokens ?? -1) - (e.tokens ?? -1)), [e]), o = h(null), s = i(o, r.length, 32), l = e.totals.lastStep ?? e.duration, u = m(() => {
366
- let t = 1;
367
- for (let n of e.agents) {
368
- let e = Array(28).fill(0);
369
- for (let t of n.steps) t.t <= l && e[Math.min(27, Math.floor(t.t / Math.max(1, l) * 28))]++;
370
- t = Math.max(t, ...e);
371
- }
372
- return t;
373
- }, [e, l]);
374
- return /* @__PURE__ */ v("section", {
375
- className: "rp-card",
376
- "aria-label": "Agents",
377
- children: [
378
- /* @__PURE__ */ v("div", {
379
- className: "rp-hd sm",
380
- children: [/* @__PURE__ */ v("h2", { children: ["Agents", /* @__PURE__ */ _("span", {
381
- className: "ct",
382
- children: e.agents.length
383
- })] }), /* @__PURE__ */ _("span", {
384
- className: "end",
385
- children: /* @__PURE__ */ v("a", {
386
- className: "rp-btn sm",
387
- href: t.href("topology"),
388
- children: ["Topology", /* @__PURE__ */ _(a, {
389
- name: "arrow",
390
- size: 14
391
- })]
392
- })
393
- })]
394
- }),
395
- /* @__PURE__ */ v("div", {
396
- className: "rp-agt-h",
397
- children: [
398
- /* @__PURE__ */ _("span", {}),
399
- /* @__PURE__ */ _("span", { children: "Agent" }),
400
- /* @__PURE__ */ _("span", {
401
- className: "ph-hide",
402
- children: c(e.t0, 0, l)
403
- }),
404
- /* @__PURE__ */ _("span", { children: "Steps" }),
405
- /* @__PURE__ */ _("span", { children: "Tokens" })
406
- ]
407
- }),
408
- /* @__PURE__ */ v("div", {
409
- className: "rp-scroll",
410
- ref: o,
411
- children: [
412
- /* @__PURE__ */ _("div", { style: { height: s.before } }),
413
- r.slice(s.first, s.last).map((r) => /* @__PURE__ */ _(k, {
414
- m: e,
415
- a: r,
416
- bins: 28,
417
- end: l,
418
- peak: u,
419
- href: t.href("timeline", { agent: p(n.run.id, r.id) })
420
- }, r.id)),
421
- /* @__PURE__ */ _("div", { style: { height: s.after } })
422
- ]
423
- })
424
- ]
425
- });
426
- }
427
- function k({ m: e, a: t, bins: n, end: i, peak: a, href: o }) {
428
- let c = s(() => /* @__PURE__ */ _(u, {
429
- m: e,
430
- a: t
431
- }), { wide: t.tools.length > 0 }), f = Array(n).fill(0);
432
- for (let e of t.steps) e.t <= i && f[Math.min(n - 1, Math.floor(e.t / Math.max(1, i) * n))]++;
433
- let p = 120 / n;
434
- return /* @__PURE__ */ v("a", {
435
- className: "rp-agt",
436
- href: o,
437
- ...c,
438
- children: [
439
- /* @__PURE__ */ _(l, { tone: t.state.tone }),
440
- /* @__PURE__ */ _("span", {
441
- className: "nm",
442
- children: t.name
443
- }),
444
- /* @__PURE__ */ v("svg", {
445
- className: "ph-hide",
446
- viewBox: "0 0 120 20",
447
- "aria-hidden": "true",
448
- children: [/* @__PURE__ */ _("line", {
449
- x1: "0",
450
- x2: "120",
451
- y1: "19.5",
452
- y2: "19.5",
453
- className: "base"
454
- }), f.map((e, t) => {
455
- let n = e ? Math.max(4, Math.sqrt(e / a) * 18) : 0;
456
- return n ? /* @__PURE__ */ _("rect", {
457
- x: t * p + .5,
458
- width: p - 1.2,
459
- y: 19 - n,
460
- height: n,
461
- rx: "0.8"
462
- }, t) : null;
463
- })]
464
- }),
465
- /* @__PURE__ */ _("span", {
466
- className: "v",
467
- children: t.steps.length ? r(t.steps.length) : "—"
468
- }),
469
- /* @__PURE__ */ _("span", {
470
- className: "v",
471
- children: t.tokens === null ? "—" : d(t.tokens)
472
- })
473
- ]
474
- });
475
- }
476
- //#endregion
477
- export { w as Overview, S as clause };