@tangle-network/sandbox-cli 0.21.27 → 0.21.29

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 +6 -6
  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,21 +1,21 @@
1
1
  import { i as e } from "./rolldown-runtime-DArdT4gl.js";
2
- import { i as t, t as n } from "./jsx-runtime-BSzbUOFc.js";
3
- import { t as r } from "./segmented-control-ChhLMa6h.js";
4
- import { C as i, D as a, S as o, T as s, _ as c, b as l, d as u, j as d, m as f, o as p, p as m, s as h, t as g, u as _, v, w as y } from "./ui-DZiGjPwl.js";
2
+ import { i as t, t as n } from "./jsx-runtime-DQWyJOhv.js";
3
+ import { t as r } from "./segmented-control-BaJmvTNd.js";
4
+ import { C as i, D as a, E as o, M as s, O as c, _ as l, d as u, m as d, o as f, p, s as m, t as h, u as g, v as _, w as v, x as y } from "./ui-C9b1rIUH.js";
5
5
  //#region src/workspace/run/Analytics.tsx
6
6
  var b = /* @__PURE__ */ e(t(), 1), x = n();
7
7
  function S({ m: e }) {
8
- let [t, n] = (0, b.useState)(/* @__PURE__ */ new Set()), r = (0, b.useMemo)(() => t.size ? e.tree.filter((e) => t.has(e.id)) : e.tree, [e, t]), i = (0, b.useMemo)(() => s(r), [r]), a = t.size ? t.size === 1 ? e.byId.get([...t][0])?.name : `${t.size} agents` : "All";
8
+ let [t, n] = (0, b.useState)(/* @__PURE__ */ new Set()), r = (0, b.useMemo)(() => t.size ? e.tree.filter((e) => t.has(e.id)) : e.tree, [e, t]), i = (0, b.useMemo)(() => a(r), [r]), o = t.size ? t.size === 1 ? e.byId.get([...t][0])?.name : `${t.size} agents` : "All";
9
9
  return /* @__PURE__ */ (0, x.jsxs)("div", {
10
10
  className: "rp-an",
11
11
  children: [
12
- /* @__PURE__ */ (0, x.jsxs)("div", {
12
+ /* @__PURE__ */ (0, x.jsx)("div", {
13
13
  className: "rp-an-f",
14
- children: [/* @__PURE__ */ (0, x.jsxs)(p, {
14
+ children: /* @__PURE__ */ (0, x.jsx)(f, {
15
15
  label: "Agents",
16
16
  multi: !0,
17
17
  options: u(e),
18
- groups: _(e),
18
+ groups: g(e),
19
19
  all: {
20
20
  label: "All agents",
21
21
  meta: String(e.agents.length)
@@ -25,22 +25,8 @@ function S({ m: e }) {
25
25
  width: 360,
26
26
  placeholder: `Search ${e.agents.length} agents`,
27
27
  style: { width: 280 },
28
- children: [/* @__PURE__ */ (0, x.jsx)("span", {
29
- className: "dim",
30
- children: "Agents "
31
- }), a]
32
- }), /* @__PURE__ */ (0, x.jsxs)("span", {
33
- className: "scope",
34
- children: [
35
- "Every chart below covers ",
36
- t.size ? /* @__PURE__ */ (0, x.jsxs)("b", { children: [
37
- r.length,
38
- " of ",
39
- e.agents.length
40
- ] }) : /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: ["all ", /* @__PURE__ */ (0, x.jsx)("b", { children: e.agents.length })] }),
41
- " agents."
42
- ]
43
- })]
28
+ children: t.size ? o : `All ${e.agents.length} agents`
29
+ })
44
30
  }),
45
31
  /* @__PURE__ */ (0, x.jsx)(C, {
46
32
  m: e,
@@ -50,25 +36,25 @@ function S({ m: e }) {
50
36
  /* @__PURE__ */ (0, x.jsxs)("div", {
51
37
  className: "rp-an-g",
52
38
  children: [
53
- /* @__PURE__ */ (0, x.jsx)(w, {
39
+ /* @__PURE__ */ (0, x.jsx)(D, {
54
40
  m: e,
55
41
  agents: r,
56
42
  tools: i
57
43
  }),
58
- /* @__PURE__ */ (0, x.jsx)(E, {
44
+ /* @__PURE__ */ (0, x.jsx)(k, {
59
45
  m: e,
60
46
  agents: r
61
47
  }),
62
- /* @__PURE__ */ (0, x.jsx)(O, {
48
+ /* @__PURE__ */ (0, x.jsx)(j, {
63
49
  m: e,
64
50
  agents: r
65
51
  }),
66
- /* @__PURE__ */ (0, x.jsx)(k, {
52
+ /* @__PURE__ */ (0, x.jsx)(M, {
67
53
  m: e,
68
54
  agents: r,
69
55
  tools: i
70
56
  }),
71
- /* @__PURE__ */ (0, x.jsx)(j, {
57
+ /* @__PURE__ */ (0, x.jsx)(P, {
72
58
  m: e,
73
59
  agents: r,
74
60
  tools: i
@@ -79,7 +65,7 @@ function S({ m: e }) {
79
65
  });
80
66
  }
81
67
  function C({ m: e, agents: t, tools: n }) {
82
- let r = (e) => t.reduce((t, n) => t + (e(n) ?? 0), 0), a = t.length === e.agents.length && e.totals.tokens !== null ? e.totals.tokens : r((e) => e.tokens), s = t.reduce((e, t) => t.byClass ? {
68
+ let r = (e) => t.reduce((t, n) => t + (e(n) ?? 0), 0), a = t.length === e.agents.length && e.totals.tokens !== null ? e.totals.tokens : r((e) => e.tokens), o = t.reduce((e, t) => t.byClass ? {
83
69
  input: e.input + t.byClass.input,
84
70
  output: e.output + t.byClass.output,
85
71
  cacheRead: e.cacheRead + t.byClass.cacheRead
@@ -87,30 +73,31 @@ function C({ m: e, agents: t, tools: n }) {
87
73
  input: 0,
88
74
  output: 0,
89
75
  cacheRead: 0
90
- }), c = r((e) => e.modelCalls), l = r((e) => e.toolCalls), u = r((e) => e.toolFailures), f = t.some((e) => e.billedUsd !== null) ? r((e) => e.billedUsd) : null, p = t.some((e) => e.listUsd !== null) ? r((e) => e.listUsd) : null, m = [
91
- [v(a), s.input + s.output + s.cacheRead ? `in ${v(s.input)} · out ${v(s.output)} · cached ${v(s.cacheRead)}` : "tokens"],
92
- [o(c), "model calls"],
93
- [o(l), `tool calls · ${n.length} tools`],
94
- [o(u), `tool failures · ${l ? (u / l * 100).toFixed(1) : "0"}%`],
95
- [o(r((e) => e.retries)), "retried steps"],
96
- [o(r((e) => e.restarts.length)), "restarts"],
97
- [i(r((e) => e.busy)), `busy of ${i(e.duration)}`],
98
- [d(p === null ? f : p), p === null ? "billed" : `list · ${d(f ?? 0)} billed`]
76
+ }), c = r((e) => e.modelCalls), l = r((e) => e.toolCalls), u = r((e) => e.toolFailures), d = t.some((e) => e.billedUsd !== null) ? r((e) => e.billedUsd) : null, f = t.some((e) => e.listUsd !== null) ? r((e) => e.listUsd) : null, p = [
77
+ [_(a), o.input + o.output + o.cacheRead ? `in ${_(o.input)} · out ${_(o.output)} · cached ${_(o.cacheRead)}` : "tokens"],
78
+ [i(c), "model calls"],
79
+ [i(l), `tool calls · ${n.length} tools`],
80
+ [i(u), `tool failures · ${l ? (u / l * 100).toFixed(1) : "0"}%`],
81
+ [i(r((e) => e.retries)), "retried steps"],
82
+ [i(r((e) => e.restarts.length)), "restarts"],
83
+ [v(r((e) => e.busy)), `busy of ${v(e.duration)}`],
84
+ [s(f === null ? d : f), f === null ? "billed" : `list · ${s(d ?? 0)} billed`]
99
85
  ];
100
86
  return /* @__PURE__ */ (0, x.jsx)("section", {
101
87
  className: "rp-card rp-kpis",
102
88
  "aria-label": "Totals",
103
- children: m.map(([e, t]) => /* @__PURE__ */ (0, x.jsxs)("div", { children: [/* @__PURE__ */ (0, x.jsx)("b", { children: e }), /* @__PURE__ */ (0, x.jsx)("span", {
89
+ children: p.map(([e, t]) => /* @__PURE__ */ (0, x.jsxs)("div", { children: [/* @__PURE__ */ (0, x.jsx)("b", { children: e }), /* @__PURE__ */ (0, x.jsx)("span", {
104
90
  title: t,
105
91
  children: t
106
92
  })] }, t))
107
93
  });
108
94
  }
109
- function w({ m: e, agents: t, tools: n }) {
110
- let [a, s] = (0, b.useState)("calls"), l = f(), u = (0, b.useRef)(null), d = n.slice(0, 8), p = n.slice(8), g = (0, b.useMemo)(() => {
95
+ var w = 168, T = 76, E = 88;
96
+ function D({ m: e, agents: t, tools: n }) {
97
+ let [a, s] = (0, b.useState)("calls"), c = d(), u = (0, b.useRef)(null), f = (0, b.useMemo)(() => {
111
98
  let e = t.filter((e) => e.toolCalls > 0), n = a === "calls" ? (e) => -e.toolCalls : a === "fails" ? (e) => -e.toolFailures * 1e6 - e.toolCalls : null;
112
99
  return n ? [...e].sort((e, t) => n(e) - n(t)) : [...e].sort((e, t) => e.name.localeCompare(t.name));
113
- }, [t, a]), _ = c(u, g.length, 28, 6), v = Math.max(1, ...g.flatMap((e) => e.tools.map((e) => e.calls))), S = Math.max(1, ...g.map((e) => e.toolCalls)), C = (e) => e ? `color-mix(in oklab, var(--rp-tool) ${Math.round(14 + 86 * Math.sqrt(e / v))}%, hsl(var(--hsl-card)))` : void 0, w = (e) => e && Math.sqrt(e / v) > .55 ? "on" : "", T = { gridTemplateColumns: `minmax(120px, 1.3fr) repeat(${d.length + +!!p.length}, minmax(64px, 1fr)) 88px` }, E = (e, t, n, r) => l.show({
100
+ }, [t, a]), h = l(u, f.length, 28, 6), g = Math.floor(((h.width || 1e4) - 32 - w - E) / T), _ = n.length <= g ? n.length : Math.max(1, g - 1), y = n.slice(0, _), S = n.slice(_), C = Math.max(1, ...f.flatMap((e) => e.tools.map((e) => e.calls))), D = Math.max(1, ...f.map((e) => e.toolCalls)), O = (e) => e ? `color-mix(in oklab, var(--rp-tool) ${Math.round(14 + 86 * Math.sqrt(e / C))}%, hsl(var(--hsl-card)))` : void 0, k = (e) => e && Math.sqrt(e / C) > .55 ? "on" : "", A = { gridTemplateColumns: `minmax(${w}px, 1.3fr) repeat(${y.length + +!!S.length}, minmax(${T}px, 1fr)) ${E}px` }, j = (e, t, n, r) => c.show({
114
101
  rect: r.getBoundingClientRect(),
115
102
  wide: !1,
116
103
  content: /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsxs)("div", {
@@ -118,7 +105,7 @@ function w({ m: e, agents: t, tools: n }) {
118
105
  children: [/* @__PURE__ */ (0, x.jsxs)("div", {
119
106
  className: "t",
120
107
  children: [
121
- /* @__PURE__ */ (0, x.jsx)(h, { tone: e.state.tone }),
108
+ /* @__PURE__ */ (0, x.jsx)(m, { tone: e.state.tone }),
122
109
  /* @__PURE__ */ (0, x.jsx)("span", {
123
110
  className: "nm",
124
111
  children: e.name
@@ -130,13 +117,13 @@ function w({ m: e, agents: t, tools: n }) {
130
117
  ]
131
118
  }), /* @__PURE__ */ (0, x.jsx)("div", {
132
119
  className: "s",
133
- children: t ? `${o(t.calls)} calls · ${i(t.ms)} in all` : "no calls"
120
+ children: t ? `${i(t.calls)} calls · ${v(t.ms)} in all` : "no calls"
134
121
  })]
135
122
  }), t && /* @__PURE__ */ (0, x.jsx)("div", {
136
123
  className: "rp-card-cols",
137
124
  children: /* @__PURE__ */ (0, x.jsx)("section", { children: /* @__PURE__ */ (0, x.jsxs)("dl", { children: [
138
125
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "Calls" }),
139
- /* @__PURE__ */ (0, x.jsx)("dd", { children: o(t.calls) }),
126
+ /* @__PURE__ */ (0, x.jsx)("dd", { children: i(t.calls) }),
140
127
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "Failed" }),
141
128
  /* @__PURE__ */ (0, x.jsx)("dd", { children: t.failures ? /* @__PURE__ */ (0, x.jsxs)("span", {
142
129
  className: "f",
@@ -149,11 +136,11 @@ function w({ m: e, agents: t, tools: n }) {
149
136
  }) : "0" }),
150
137
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "p50 · p90 · p99" }),
151
138
  /* @__PURE__ */ (0, x.jsxs)("dd", { children: [
152
- y(t.p50),
139
+ o(t.p50),
153
140
  " · ",
154
- y(t.p90),
141
+ o(t.p90),
155
142
  " · ",
156
- y(t.p99)
143
+ o(t.p99)
157
144
  ] }),
158
145
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "Share of its tool calls" }),
159
146
  /* @__PURE__ */ (0, x.jsxs)("dd", { children: [(t.calls / Math.max(1, e.toolCalls) * 100).toFixed(0), "%"] })
@@ -168,7 +155,7 @@ function w({ m: e, agents: t, tools: n }) {
168
155
  children: [/* @__PURE__ */ (0, x.jsxs)("h3", { children: ["Tool calls by agent and tool", /* @__PURE__ */ (0, x.jsxs)("span", {
169
156
  className: "ct",
170
157
  children: [
171
- g.length,
158
+ f.length,
172
159
  " agents · ",
173
160
  n.length,
174
161
  " tools"
@@ -202,17 +189,17 @@ function w({ m: e, agents: t, tools: n }) {
202
189
  ref: u,
203
190
  children: /* @__PURE__ */ (0, x.jsxs)("div", {
204
191
  className: "rp-hm",
205
- style: T,
192
+ style: A,
206
193
  children: [
207
194
  /* @__PURE__ */ (0, x.jsx)("span", { className: "ch c0" }),
208
- d.map((e) => /* @__PURE__ */ (0, x.jsx)("span", {
195
+ y.map((e) => /* @__PURE__ */ (0, x.jsx)("span", {
209
196
  className: "ch",
210
197
  title: e.name,
211
198
  children: /* @__PURE__ */ (0, x.jsx)("span", { children: e.name.replace(/^agent-runtime-coordination_/, "").replaceAll("_", " ") })
212
199
  }, e.name)),
213
- p.length > 0 && /* @__PURE__ */ (0, x.jsx)("span", {
200
+ S.length > 0 && /* @__PURE__ */ (0, x.jsx)("span", {
214
201
  className: "ch",
215
- children: /* @__PURE__ */ (0, x.jsxs)("span", { children: [p.length, " more"] })
202
+ children: /* @__PURE__ */ (0, x.jsxs)("span", { children: [S.length, " more"] })
216
203
  }),
217
204
  /* @__PURE__ */ (0, x.jsx)("span", {
218
205
  className: "ch tot",
@@ -220,52 +207,52 @@ function w({ m: e, agents: t, tools: n }) {
220
207
  }),
221
208
  /* @__PURE__ */ (0, x.jsx)("div", {
222
209
  className: "gap",
223
- style: { height: _.before }
210
+ style: { height: h.before }
224
211
  }),
225
- g.slice(_.first, _.last).map((e) => {
226
- let t = new Map(e.tools.map((e) => [e.name, e])), n = e.tools.filter((e) => !d.some((t) => t.name === e.name)), r = n.reduce((e, t) => e + t.calls, 0), i = n.reduce((e, t) => e + t.failures, 0);
212
+ f.slice(h.first, h.last).map((e) => {
213
+ let t = new Map(e.tools.map((e) => [e.name, e])), n = e.tools.filter((e) => !y.some((t) => t.name === e.name)), r = n.reduce((e, t) => e + t.calls, 0), a = n.reduce((e, t) => e + t.failures, 0);
227
214
  return [
228
215
  /* @__PURE__ */ (0, x.jsxs)("span", {
229
216
  className: "rh",
230
217
  title: e.name,
231
- children: [/* @__PURE__ */ (0, x.jsx)(h, { tone: e.state.tone }), /* @__PURE__ */ (0, x.jsx)("span", {
218
+ children: [/* @__PURE__ */ (0, x.jsx)(m, { tone: e.state.tone }), /* @__PURE__ */ (0, x.jsx)("span", {
232
219
  className: "nm",
233
- children: m(e, 22)
220
+ children: p(e, 22)
234
221
  })]
235
222
  }, `${e.id}:n`),
236
- ...d.map((n) => {
237
- let r = t.get(n.name), i = r?.calls ?? 0;
223
+ ...y.map((n) => {
224
+ let r = t.get(n.name), a = r?.calls ?? 0;
238
225
  return /* @__PURE__ */ (0, x.jsxs)("span", {
239
- className: `c${i ? "" : " z"} ${w(i)}`,
240
- style: { background: C(i) },
241
- tabIndex: i ? 0 : -1,
242
- onPointerEnter: (t) => E(e, r ?? null, n.name, t.currentTarget),
243
- onPointerLeave: () => l.hide(),
244
- onFocus: (t) => E(e, r ?? null, n.name, t.currentTarget),
245
- onBlur: () => l.hide(),
246
- children: [i ? o(i) : "", r?.failures ? /* @__PURE__ */ (0, x.jsxs)("span", {
226
+ className: `c${a ? "" : " z"} ${k(a)}`,
227
+ style: { background: O(a) },
228
+ tabIndex: a ? 0 : -1,
229
+ onPointerEnter: (t) => j(e, r ?? null, n.name, t.currentTarget),
230
+ onPointerLeave: () => c.hide(),
231
+ onFocus: (t) => j(e, r ?? null, n.name, t.currentTarget),
232
+ onBlur: () => c.hide(),
233
+ children: [a ? i(a) : "", r?.failures ? /* @__PURE__ */ (0, x.jsxs)("span", {
247
234
  className: "xf",
248
235
  children: ["✕", r.failures]
249
236
  }) : null]
250
237
  }, `${e.id}:${n.name}`);
251
238
  }),
252
- ...p.length ? [/* @__PURE__ */ (0, x.jsxs)("span", {
253
- className: `c${r ? "" : " z"} ${w(r)}`,
254
- style: { background: C(r) },
255
- children: [r ? o(r) : "", i ? /* @__PURE__ */ (0, x.jsxs)("span", {
239
+ ...S.length ? [/* @__PURE__ */ (0, x.jsxs)("span", {
240
+ className: `c${r ? "" : " z"} ${k(r)}`,
241
+ style: { background: O(r) },
242
+ children: [r ? i(r) : "", a ? /* @__PURE__ */ (0, x.jsxs)("span", {
256
243
  className: "xf",
257
- children: ["✕", i]
244
+ children: ["✕", a]
258
245
  }) : null]
259
246
  }, `${e.id}:rest`)] : [],
260
247
  /* @__PURE__ */ (0, x.jsxs)("span", {
261
248
  className: "tot",
262
- children: [/* @__PURE__ */ (0, x.jsx)("b", { style: { width: `${e.toolCalls / S * 56}px` } }), o(e.toolCalls)]
249
+ children: [/* @__PURE__ */ (0, x.jsx)("b", { style: { width: `${e.toolCalls / D * 56}px` } }), i(e.toolCalls)]
263
250
  }, `${e.id}:t`)
264
251
  ];
265
252
  }),
266
253
  /* @__PURE__ */ (0, x.jsx)("div", {
267
254
  className: "gap",
268
- style: { height: _.after }
255
+ style: { height: h.after }
269
256
  })
270
257
  ]
271
258
  })
@@ -277,23 +264,23 @@ function w({ m: e, agents: t, tools: n }) {
277
264
  children: [
278
265
  /* @__PURE__ */ (0, x.jsx)("span", { children: "1" }),
279
266
  /* @__PURE__ */ (0, x.jsx)("i", {}),
280
- /* @__PURE__ */ (0, x.jsx)("span", { children: o(v) })
267
+ /* @__PURE__ */ (0, x.jsx)("span", { children: i(C) })
281
268
  ]
282
269
  }),
283
270
  /* @__PURE__ */ (0, x.jsxs)("span", { children: [/* @__PURE__ */ (0, x.jsx)("span", {
284
271
  className: "x",
285
272
  children: "✕"
286
273
  }), " failed calls in the cell"] }),
287
- t.length > g.length && /* @__PURE__ */ (0, x.jsxs)("span", {
274
+ t.length > f.length && /* @__PURE__ */ (0, x.jsxs)("span", {
288
275
  className: "end",
289
- children: [t.length - g.length, " agents made no tool calls"]
276
+ children: [t.length - f.length, " agents made no tool calls"]
290
277
  })
291
278
  ]
292
279
  })]
293
280
  })]
294
281
  });
295
282
  }
296
- var T = [
283
+ var O = [
297
284
  6e4,
298
285
  12e4,
299
286
  3e5,
@@ -303,36 +290,36 @@ var T = [
303
290
  36e5,
304
291
  72e5
305
292
  ];
306
- function E({ m: e, agents: t }) {
307
- let [n, i] = (0, b.useState)("calls"), a = f(), s = (0, b.useMemo)(() => t.flatMap((e) => e.steps.filter((e) => e.kind !== "waiting")), [t]), c = s.length ? Math.min(...s.map((e) => e.t)) : 0, u = s.length ? Math.max(...s.map((e) => e.t + e.d)) : 1, d = T.find((e) => (u - c) / e <= 36) ?? 144e5, p = Math.floor(c / d) * d, m = Math.max(1, Math.ceil((u - p) / d)), h = (0, b.useMemo)(() => {
308
- let e = Array.from({ length: m }, () => ({
293
+ function k({ m: e, agents: t }) {
294
+ let [n, a] = (0, b.useState)("calls"), o = d(), s = (0, b.useMemo)(() => t.flatMap((e) => e.steps.filter((e) => e.kind !== "waiting")), [t]), c = s.length ? Math.min(...s.map((e) => e.t)) : 0, l = s.length ? Math.max(...s.map((e) => e.t + e.d)) : 1, u = O.find((e) => (l - c) / e <= 36) ?? 144e5, f = Math.floor(c / u) * u, p = Math.max(1, Math.ceil((l - f) / u)), m = (0, b.useMemo)(() => {
295
+ let e = Array.from({ length: p }, () => ({
309
296
  model: 0,
310
297
  tool: 0,
311
298
  failed: 0,
312
299
  tokens: 0
313
300
  }));
314
301
  for (let t of s) {
315
- let n = e[Math.min(m - 1, Math.floor((t.t - p) / d))];
302
+ let n = e[Math.min(p - 1, Math.floor((t.t - f) / u))];
316
303
  t.kind === "model" ? n.model++ : n.tool++, t.failed && n.failed++, t.tokens && (n.tokens += t.tokens.input + t.tokens.output + t.tokens.cacheRead);
317
304
  }
318
305
  return e;
319
306
  }, [
320
307
  s,
321
- m,
322
308
  p,
323
- d
324
- ]), g = (e) => n === "calls" ? e.model + e.tool : e.tokens, _ = Math.max(1, ...h.map(g)), y = 560 / m, S = (e) => 216 - e / _ * 198, C = D(_), w = l(e.t0), E = d === 6e4 ? "minute" : d === 36e5 ? "hour" : d > 36e5 ? `${d / 36e5} h` : `${d / 6e4} min`, O = Math.max(1, Math.ceil(m / 6));
309
+ f,
310
+ u
311
+ ]), h = (e) => n === "calls" ? e.model + e.tool : e.tokens, g = Math.max(1, ...m.map(h)), v = 560 / p, S = A(g), C = (e) => 216 - e / S * 198, w = y(e.t0), T = u === 6e4 ? "minute" : u === 36e5 ? "hour" : u > 36e5 ? `${u / 36e5} h` : `${u / 6e4} min`, E = Math.max(1, Math.ceil(p / 6));
325
312
  return /* @__PURE__ */ (0, x.jsxs)("section", {
326
313
  className: "rp-card w5",
327
314
  "aria-label": n === "calls" ? "Calls over time" : "Tokens over time",
328
315
  children: [/* @__PURE__ */ (0, x.jsxs)("div", {
329
316
  className: "rp-hd sm",
330
- children: [/* @__PURE__ */ (0, x.jsx)("h3", { children: n === "calls" ? `Calls per ${E}` : `Metered tokens per ${E}` }), /* @__PURE__ */ (0, x.jsx)("span", {
317
+ children: [/* @__PURE__ */ (0, x.jsx)("h3", { children: n === "calls" ? `Calls per ${T}` : `Metered tokens per ${T}` }), /* @__PURE__ */ (0, x.jsx)("span", {
331
318
  className: "end",
332
319
  children: /* @__PURE__ */ (0, x.jsx)(r, {
333
320
  "aria-label": "Measure",
334
321
  value: n,
335
- onValueChange: i,
322
+ onValueChange: a,
336
323
  options: [{
337
324
  value: "calls",
338
325
  label: "Calls"
@@ -371,7 +358,7 @@ function E({ m: e, agents: t }) {
371
358
  viewBox: "0 0 600 240",
372
359
  preserveAspectRatio: "none",
373
360
  role: "img",
374
- "aria-label": `${n} per ${E}, peak ${o(_)}`,
361
+ "aria-label": `${n} per ${T}, peak ${i(g)}`,
375
362
  children: [[
376
363
  0,
377
364
  .5,
@@ -379,16 +366,16 @@ function E({ m: e, agents: t }) {
379
366
  ].map((e) => /* @__PURE__ */ (0, x.jsxs)("g", { children: [/* @__PURE__ */ (0, x.jsx)("line", {
380
367
  x1: 40,
381
368
  x2: 600,
382
- y1: S(C * e),
383
- y2: S(C * e),
369
+ y1: C(S * e),
370
+ y2: C(S * e),
384
371
  className: "grid"
385
372
  }), /* @__PURE__ */ (0, x.jsx)("text", {
386
373
  x: 34,
387
- y: S(C * e) + 4,
374
+ y: C(S * e) + 4,
388
375
  textAnchor: "end",
389
- children: n === "calls" ? o(Math.round(C * e)) : v(C * e)
390
- })] }, e)), h.map((e, t) => {
391
- let r = 40 + t * y + 1, i = Math.max(1, y - 2), s = n === "calls" ? e.model / _ * 198 : e.tokens / _ * 198, c = n === "calls" ? e.tool / _ * 198 : 0, l = (n) => a.show({
376
+ children: n === "calls" ? i(Math.round(S * e)) : _(S * e)
377
+ })] }, e)), m.map((e, t) => {
378
+ let r = 40 + t * v + 1, a = Math.max(1, v - 2), s = n === "calls" ? e.model / S * 198 : e.tokens / S * 198, c = n === "calls" ? e.tool / S * 198 : 0, l = (n) => o.show({
392
379
  rect: n.currentTarget.getBoundingClientRect(),
393
380
  content: /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsx)("div", {
394
381
  className: "rp-card-h",
@@ -397,9 +384,9 @@ function E({ m: e, agents: t }) {
397
384
  children: /* @__PURE__ */ (0, x.jsxs)("span", {
398
385
  className: "nm",
399
386
  children: [
400
- w(p + t * d),
387
+ w(f + t * u),
401
388
  "–",
402
- w(p + (t + 1) * d),
389
+ w(f + (t + 1) * u),
403
390
  " UTC"
404
391
  ]
405
392
  })
@@ -408,61 +395,61 @@ function E({ m: e, agents: t }) {
408
395
  className: "rp-card-cols",
409
396
  children: /* @__PURE__ */ (0, x.jsx)("section", { children: /* @__PURE__ */ (0, x.jsxs)("dl", { children: [
410
397
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "Model calls" }),
411
- /* @__PURE__ */ (0, x.jsx)("dd", { children: o(e.model) }),
398
+ /* @__PURE__ */ (0, x.jsx)("dd", { children: i(e.model) }),
412
399
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "Tool calls" }),
413
- /* @__PURE__ */ (0, x.jsx)("dd", { children: o(e.tool) }),
400
+ /* @__PURE__ */ (0, x.jsx)("dd", { children: i(e.tool) }),
414
401
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "Failed" }),
415
402
  /* @__PURE__ */ (0, x.jsx)("dd", { children: e.failed ? /* @__PURE__ */ (0, x.jsxs)("span", {
416
403
  className: "f",
417
404
  children: [e.failed, " ✕"]
418
405
  }) : "0" }),
419
406
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "Metered tokens" }),
420
- /* @__PURE__ */ (0, x.jsx)("dd", { children: e.tokens ? v(e.tokens) : "not recorded" })
407
+ /* @__PURE__ */ (0, x.jsx)("dd", { children: e.tokens ? _(e.tokens) : "not recorded" })
421
408
  ] }) })
422
409
  })] })
423
410
  });
424
411
  return /* @__PURE__ */ (0, x.jsxs)("g", {
425
- tabIndex: g(e) ? 0 : -1,
412
+ tabIndex: h(e) ? 0 : -1,
426
413
  onPointerEnter: l,
427
- onPointerLeave: () => a.hide(),
414
+ onPointerLeave: () => o.hide(),
428
415
  onFocus: l,
429
- onBlur: () => a.hide(),
416
+ onBlur: () => o.hide(),
430
417
  children: [
431
418
  /* @__PURE__ */ (0, x.jsx)("rect", {
432
- x: 40 + t * y,
419
+ x: 40 + t * v,
433
420
  y: 18,
434
- width: y,
421
+ width: v,
435
422
  height: 198,
436
423
  className: "hit"
437
424
  }),
438
425
  s > 0 && /* @__PURE__ */ (0, x.jsx)("rect", {
439
426
  x: r,
440
427
  y: 216 - s,
441
- width: i,
428
+ width: a,
442
429
  height: s,
443
- rx: Math.min(2, i / 2),
430
+ rx: Math.min(2, a / 2),
444
431
  className: "model"
445
432
  }),
446
433
  c > 0 && /* @__PURE__ */ (0, x.jsx)("rect", {
447
434
  x: r,
448
435
  y: 216 - s - c - (s > 0 ? 1.5 : 0),
449
- width: i,
436
+ width: a,
450
437
  height: c,
451
- rx: Math.min(2, i / 2),
438
+ rx: Math.min(2, a / 2),
452
439
  className: "tool"
453
440
  }),
454
441
  e.failed > 0 && n === "calls" && /* @__PURE__ */ (0, x.jsxs)("text", {
455
- x: r + i / 2,
442
+ x: r + a / 2,
456
443
  y: 216 - s - c - 6,
457
444
  textAnchor: "middle",
458
445
  className: "xf",
459
446
  children: ["✕", e.failed]
460
447
  }),
461
- t % O === 0 && /* @__PURE__ */ (0, x.jsx)("text", {
462
- x: r + i / 2,
448
+ t % E === 0 && /* @__PURE__ */ (0, x.jsx)("text", {
449
+ x: r + a / 2,
463
450
  y: 234,
464
451
  textAnchor: "middle",
465
- children: w(p + t * d)
452
+ children: w(f + t * u)
466
453
  })
467
454
  ]
468
455
  }, t);
@@ -471,7 +458,7 @@ function E({ m: e, agents: t }) {
471
458
  })]
472
459
  });
473
460
  }
474
- function D(e) {
461
+ function A(e) {
475
462
  let t = 10 ** Math.floor(Math.log10(Math.max(1, e)));
476
463
  return [
477
464
  1,
@@ -481,11 +468,11 @@ function D(e) {
481
468
  10
482
469
  ].map((e) => e * t).find((t) => t >= e) ?? e;
483
470
  }
484
- function O({ m: e, agents: t }) {
471
+ function j({ m: e, agents: t }) {
485
472
  let [n, r] = (0, b.useState)({
486
473
  k: "tokens",
487
474
  d: -1
488
- }), i = f(), a = (0, b.useRef)(null), s = (e) => ({
475
+ }), a = d(), o = (0, b.useRef)(null), c = (e) => ({
489
476
  tokens: e.tokens ?? -1,
490
477
  model: e.modelCalls,
491
478
  tool: e.toolCalls,
@@ -494,10 +481,14 @@ function O({ m: e, agents: t }) {
494
481
  spawns: e.children.length,
495
482
  cost: e.listUsd ?? e.billedUsd ?? -1,
496
483
  name: e.name
497
- })[n.k], l = (0, b.useMemo)(() => [...t].sort((e, t) => {
498
- let r = s(e), i = s(t);
484
+ })[n.k], u = (0, b.useMemo)(() => [...t].sort((e, t) => {
485
+ let r = c(e), i = c(t);
499
486
  return (typeof r == "string" ? r.localeCompare(i) : r - i) * n.d;
500
- }), [t, n]), u = c(a, l.length, 28), p = Math.max(1, ...t.map((e) => e.tokens ?? 0)), h = (e, t, i = "") => /* @__PURE__ */ (0, x.jsx)("span", {
487
+ }), [t, n]), f = l(o, u.length, 28), m = Math.max(1, ...t.map((e) => e.tokens ?? 0)), g = [
488
+ "failed",
489
+ "restarts",
490
+ "spawns"
491
+ ].filter((e) => t.some((t) => (e === "failed" ? t.failedSteps : e === "restarts" ? t.restarts.length : t.children.length) > 0)), v = { gridTemplateColumns: `minmax(96px, 1fr) 112px 52px 44px ${g.map((e) => e === "restarts" ? "72px" : e === "spawns" ? "64px" : "56px").join(" ")} 64px` }, y = (e, t, i = "") => /* @__PURE__ */ (0, x.jsx)("span", {
501
492
  role: "columnheader",
502
493
  className: i,
503
494
  "aria-sort": n.k === e ? n.d < 0 ? "descending" : "ascending" : void 0,
@@ -509,7 +500,7 @@ function O({ m: e, agents: t }) {
509
500
  })),
510
501
  children: [t, n.k === e ? n.d < 0 ? " ↓" : " ↑" : ""]
511
502
  })
512
- });
503
+ }, e);
513
504
  return /* @__PURE__ */ (0, x.jsxs)("section", {
514
505
  className: "rp-card w5",
515
506
  "aria-label": "Agents",
@@ -521,99 +512,93 @@ function O({ m: e, agents: t }) {
521
512
  })] })
522
513
  }), /* @__PURE__ */ (0, x.jsxs)("div", {
523
514
  className: "rp-at-wrap",
524
- ref: a,
515
+ ref: o,
525
516
  role: "table",
526
517
  "aria-label": "Agents",
527
- "aria-rowcount": l.length,
518
+ "aria-rowcount": u.length,
528
519
  children: [
529
520
  /* @__PURE__ */ (0, x.jsxs)("div", {
530
521
  className: "rp-at th",
531
522
  role: "row",
523
+ style: v,
532
524
  children: [
533
- h("name", "Agent"),
534
- h("tokens", "Tokens", "tk"),
535
- h("model", "Model", "r"),
536
- h("tool", "Tool", "r"),
537
- h("failed", "Failed", "r"),
538
- h("restarts", "Restarts", "r"),
539
- h("spawns", "Spawns", "r"),
540
- h("cost", "Cost", "r")
525
+ y("name", "Agent"),
526
+ y("tokens", "Tokens", "tk"),
527
+ y("model", "Model", "r"),
528
+ y("tool", "Tool", "r"),
529
+ g.map((e) => y(e, {
530
+ failed: "Failed",
531
+ restarts: "Restarts",
532
+ spawns: "Spawns"
533
+ }[e], "r")),
534
+ y("cost", "Cost", "r")
541
535
  ]
542
536
  }),
543
- /* @__PURE__ */ (0, x.jsx)("div", { style: { height: u.before } }),
544
- l.slice(u.first, u.last).map((t) => /* @__PURE__ */ (0, x.jsxs)("div", {
537
+ /* @__PURE__ */ (0, x.jsx)("div", { style: { height: f.before } }),
538
+ u.slice(f.first, f.last).map((t) => /* @__PURE__ */ (0, x.jsxs)("div", {
545
539
  className: "rp-at",
546
540
  role: "row",
547
541
  tabIndex: 0,
548
- onPointerEnter: (n) => i.show({
549
- content: /* @__PURE__ */ (0, x.jsx)(g, {
542
+ style: v,
543
+ onPointerEnter: (n) => a.show({
544
+ content: /* @__PURE__ */ (0, x.jsx)(h, {
550
545
  m: e,
551
546
  a: t
552
547
  }),
553
548
  rect: n.currentTarget.getBoundingClientRect(),
554
549
  wide: t.tools.length > 0
555
550
  }),
556
- onPointerLeave: () => i.hide(),
557
- onFocus: (n) => i.show({
558
- content: /* @__PURE__ */ (0, x.jsx)(g, {
551
+ onPointerLeave: () => a.hide(),
552
+ onFocus: (n) => a.show({
553
+ content: /* @__PURE__ */ (0, x.jsx)(h, {
559
554
  m: e,
560
555
  a: t
561
556
  }),
562
557
  rect: n.currentTarget.getBoundingClientRect(),
563
558
  wide: t.tools.length > 0
564
559
  }),
565
- onBlur: () => i.hide(),
560
+ onBlur: () => a.hide(),
566
561
  children: [
567
562
  /* @__PURE__ */ (0, x.jsx)("span", {
568
563
  className: "nm",
569
564
  role: "cell",
570
565
  title: t.name,
571
- children: m(t, 20)
566
+ children: p(t, 20)
572
567
  }),
573
568
  /* @__PURE__ */ (0, x.jsxs)("span", {
574
569
  className: "tk",
575
570
  role: "cell",
576
- children: [/* @__PURE__ */ (0, x.jsx)("b", { style: { width: `${(t.tokens ?? 0) / p * 60}px` } }), /* @__PURE__ */ (0, x.jsx)("span", { children: v(t.tokens) })]
571
+ children: [/* @__PURE__ */ (0, x.jsx)("b", { style: { width: `${(t.tokens ?? 0) / m * 48}px` } }), /* @__PURE__ */ (0, x.jsx)("span", { children: _(t.tokens) })]
577
572
  }),
578
573
  /* @__PURE__ */ (0, x.jsx)("span", {
579
574
  className: "r",
580
575
  role: "cell",
581
- children: o(t.modelCalls)
576
+ children: i(t.modelCalls)
582
577
  }),
583
578
  /* @__PURE__ */ (0, x.jsx)("span", {
584
579
  className: "r",
585
580
  role: "cell",
586
- children: o(t.toolCalls)
581
+ children: i(t.toolCalls)
587
582
  }),
588
- /* @__PURE__ */ (0, x.jsx)("span", {
583
+ g.map((e) => /* @__PURE__ */ (0, x.jsx)("span", {
589
584
  className: "r",
590
585
  role: "cell",
591
- children: t.failedSteps || ""
592
- }),
593
- /* @__PURE__ */ (0, x.jsx)("span", {
594
- className: "r",
595
- role: "cell",
596
- children: t.restarts.length || ""
597
- }),
586
+ children: (e === "failed" ? t.failedSteps : e === "restarts" ? t.restarts.length : t.children.length) || ""
587
+ }, e)),
598
588
  /* @__PURE__ */ (0, x.jsx)("span", {
599
589
  className: "r",
600
590
  role: "cell",
601
- children: t.children.length || ""
602
- }),
603
- /* @__PURE__ */ (0, x.jsx)("span", {
604
- className: "r",
605
- role: "cell",
606
- children: t.listUsd === null ? t.billedUsd === null ? "—" : d(t.billedUsd) : d(t.listUsd)
591
+ children: t.listUsd === null ? t.billedUsd === null ? "—" : s(t.billedUsd) : s(t.listUsd)
607
592
  })
608
593
  ]
609
594
  }, t.id)),
610
- /* @__PURE__ */ (0, x.jsx)("div", { style: { height: u.after } })
595
+ /* @__PURE__ */ (0, x.jsx)("div", { style: { height: f.after } })
611
596
  ]
612
597
  })]
613
598
  });
614
599
  }
615
- function k({ m: e, agents: t, tools: n }) {
616
- let [i, s] = (0, b.useState)("range"), c = f(), l = (0, b.useMemo)(() => {
600
+ function M({ m: e, agents: t, tools: n }) {
601
+ let [a, s] = (0, b.useState)("range"), l = d(), u = (0, b.useMemo)(() => {
617
602
  let e = /* @__PURE__ */ new Map();
618
603
  for (let n of t) for (let t of n.steps) if (t.kind === "model" && t.latency !== null) {
619
604
  let r = t.model?.split("/").pop() ?? n.model ?? "model";
@@ -624,11 +609,11 @@ function k({ m: e, agents: t, tools: n }) {
624
609
  model: !0,
625
610
  calls: t.length,
626
611
  values: t,
627
- p50: a(t, 50),
628
- p90: a(t, 90),
629
- p99: a(t, 99)
612
+ p50: c(t, 50),
613
+ p90: c(t, 90),
614
+ p99: c(t, 99)
630
615
  }));
631
- }, [t]), u = [...l, ...n.filter((e) => e.durations.length).slice(0, 9).map((e) => ({
616
+ }, [t]), f = [...u, ...n.filter((e) => e.durations.length).slice(0, 9).map((e) => ({
632
617
  name: e.name,
633
618
  model: !1,
634
619
  calls: e.calls,
@@ -636,14 +621,14 @@ function k({ m: e, agents: t, tools: n }) {
636
621
  p50: e.p50,
637
622
  p90: e.p90,
638
623
  p99: e.p99
639
- }))], d = u.flatMap((e) => e.values).filter((e) => e > 0), p = Math.max(1e3, ...d) * 1.2, m = (e) => (Math.log10(Math.max(10, e)) - Math.log10(10)) / (Math.log10(p) - Math.log10(10)), h = [
624
+ }))], p = f.flatMap((e) => e.values).filter((e) => e > 0), m = Math.max(1e3, ...p) * 1.2, h = (e) => (Math.log10(Math.max(10, e)) - Math.log10(10)) / (Math.log10(m) - Math.log10(10)), g = [
640
625
  10,
641
626
  100,
642
627
  1e3,
643
628
  1e4,
644
629
  1e5,
645
630
  1e6
646
- ].filter((e) => e <= p), g = (e, t) => c.show({
631
+ ].filter((e) => e <= m), _ = (e, t) => l.show({
647
632
  rect: t.getBoundingClientRect(),
648
633
  content: /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsxs)("div", {
649
634
  className: "rp-card-h",
@@ -657,7 +642,7 @@ function k({ m: e, agents: t, tools: n }) {
657
642
  }),
658
643
  /* @__PURE__ */ (0, x.jsxs)("span", {
659
644
  className: "v",
660
- children: [o(e.calls), " calls"]
645
+ children: [i(e.calls), " calls"]
661
646
  })
662
647
  ]
663
648
  }), /* @__PURE__ */ (0, x.jsx)("div", {
@@ -668,13 +653,13 @@ function k({ m: e, agents: t, tools: n }) {
668
653
  className: "rp-card-cols",
669
654
  children: /* @__PURE__ */ (0, x.jsx)("section", { children: /* @__PURE__ */ (0, x.jsxs)("dl", { children: [
670
655
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "p50" }),
671
- /* @__PURE__ */ (0, x.jsx)("dd", { children: y(e.p50) }),
656
+ /* @__PURE__ */ (0, x.jsx)("dd", { children: o(e.p50) }),
672
657
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "p90" }),
673
- /* @__PURE__ */ (0, x.jsx)("dd", { children: y(e.p90) }),
658
+ /* @__PURE__ */ (0, x.jsx)("dd", { children: o(e.p90) }),
674
659
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "p99" }),
675
- /* @__PURE__ */ (0, x.jsx)("dd", { children: y(e.p99) }),
660
+ /* @__PURE__ */ (0, x.jsx)("dd", { children: o(e.p99) }),
676
661
  /* @__PURE__ */ (0, x.jsx)("dt", { children: "Max" }),
677
- /* @__PURE__ */ (0, x.jsx)("dd", { children: y(Math.max(...e.values)) })
662
+ /* @__PURE__ */ (0, x.jsx)("dd", { children: o(Math.max(...e.values)) })
678
663
  ] }) })
679
664
  })] })
680
665
  });
@@ -687,7 +672,7 @@ function k({ m: e, agents: t, tools: n }) {
687
672
  className: "end",
688
673
  children: /* @__PURE__ */ (0, x.jsx)(r, {
689
674
  "aria-label": "Latency view",
690
- value: i,
675
+ value: a,
691
676
  onValueChange: s,
692
677
  options: [{
693
678
  value: "range",
@@ -700,15 +685,15 @@ function k({ m: e, agents: t, tools: n }) {
700
685
  })]
701
686
  }), /* @__PURE__ */ (0, x.jsx)("div", {
702
687
  className: "rp-chart",
703
- children: i === "range" ? /* @__PURE__ */ (0, x.jsxs)("div", {
688
+ children: a === "range" ? /* @__PURE__ */ (0, x.jsxs)("div", {
704
689
  className: "rp-lat",
705
- children: [u.map((e) => /* @__PURE__ */ (0, x.jsxs)("div", {
690
+ children: [f.map((e) => /* @__PURE__ */ (0, x.jsxs)("div", {
706
691
  className: "row",
707
692
  tabIndex: 0,
708
- onPointerEnter: (t) => g(e, t.currentTarget),
709
- onPointerLeave: () => c.hide(),
710
- onFocus: (t) => g(e, t.currentTarget),
711
- onBlur: () => c.hide(),
693
+ onPointerEnter: (t) => _(e, t.currentTarget),
694
+ onPointerLeave: () => l.hide(),
695
+ onFocus: (t) => _(e, t.currentTarget),
696
+ onBlur: () => l.hide(),
712
697
  children: [
713
698
  /* @__PURE__ */ (0, x.jsx)("span", {
714
699
  className: `l${e.model ? " model" : ""}`,
@@ -719,15 +704,15 @@ function k({ m: e, agents: t, tools: n }) {
719
704
  viewBox: "0 0 100 22",
720
705
  preserveAspectRatio: "none",
721
706
  "aria-hidden": "true",
722
- children: [h.map((e) => /* @__PURE__ */ (0, x.jsx)("line", {
723
- x1: m(e) * 100,
724
- x2: m(e) * 100,
707
+ children: [g.map((e) => /* @__PURE__ */ (0, x.jsx)("line", {
708
+ x1: h(e) * 100,
709
+ x2: h(e) * 100,
725
710
  y1: "2",
726
711
  y2: "20",
727
712
  className: "grid"
728
713
  }, e)), /* @__PURE__ */ (0, x.jsx)("line", {
729
- x1: m(e.p50 ?? 10) * 100,
730
- x2: m(e.p99 ?? 10) * 100,
714
+ x1: h(e.p50 ?? 10) * 100,
715
+ x2: h(e.p99 ?? 10) * 100,
731
716
  y1: "11",
732
717
  y2: "11",
733
718
  className: e.model ? "model" : "tool"
@@ -739,26 +724,26 @@ function k({ m: e, agents: t, tools: n }) {
739
724
  children: [
740
725
  /* @__PURE__ */ (0, x.jsx)("i", {
741
726
  className: `p50 ${e.model ? "model" : "tool"}`,
742
- style: { left: `${m(e.p50 ?? 10) * 100}%` }
727
+ style: { left: `${h(e.p50 ?? 10) * 100}%` }
743
728
  }),
744
729
  /* @__PURE__ */ (0, x.jsx)("i", {
745
730
  className: `p90 ${e.model ? "model" : "tool"}`,
746
- style: { left: `${m(e.p90 ?? 10) * 100}%` }
731
+ style: { left: `${h(e.p90 ?? 10) * 100}%` }
747
732
  }),
748
733
  /* @__PURE__ */ (0, x.jsx)("i", {
749
734
  className: `p99 ${e.model ? "model" : "tool"}`,
750
- style: { left: `${m(e.p99 ?? 10) * 100}%` }
735
+ style: { left: `${h(e.p99 ?? 10) * 100}%` }
751
736
  })
752
737
  ]
753
738
  }),
754
739
  /* @__PURE__ */ (0, x.jsxs)("span", {
755
740
  className: "v",
756
741
  children: [
757
- /* @__PURE__ */ (0, x.jsx)("b", { children: y(e.p50) }),
742
+ /* @__PURE__ */ (0, x.jsx)("b", { children: o(e.p50) }),
758
743
  " · ",
759
- y(e.p90),
744
+ o(e.p90),
760
745
  " · ",
761
- y(e.p99)
746
+ o(e.p99)
762
747
  ]
763
748
  })
764
749
  ]
@@ -768,9 +753,9 @@ function k({ m: e, agents: t, tools: n }) {
768
753
  /* @__PURE__ */ (0, x.jsx)("span", {}),
769
754
  /* @__PURE__ */ (0, x.jsx)("span", {
770
755
  className: "ax",
771
- children: h.map((e) => /* @__PURE__ */ (0, x.jsx)("span", {
772
- style: { left: `${m(e) * 100}%` },
773
- children: y(e)
756
+ children: g.map((e) => /* @__PURE__ */ (0, x.jsx)("span", {
757
+ style: { left: `${h(e) * 100}%` },
758
+ children: o(e)
774
759
  }, e))
775
760
  }),
776
761
  /* @__PURE__ */ (0, x.jsx)("span", {
@@ -779,44 +764,44 @@ function k({ m: e, agents: t, tools: n }) {
779
764
  })
780
765
  ]
781
766
  })]
782
- }) : /* @__PURE__ */ (0, x.jsx)(A, {
767
+ }) : /* @__PURE__ */ (0, x.jsx)(N, {
783
768
  rows: [{
784
769
  name: "Model calls",
785
770
  model: !0,
786
- values: l.flatMap((e) => e.values)
771
+ values: u.flatMap((e) => e.values)
787
772
  }, {
788
773
  name: "Tool calls",
789
774
  model: !1,
790
775
  values: n.flatMap((e) => e.durations)
791
776
  }],
792
777
  lo: 10,
793
- hi: p
778
+ hi: m
794
779
  })
795
780
  })]
796
781
  });
797
782
  }
798
- function A({ rows: e, lo: t, hi: n }) {
799
- let r = f(), i = [];
800
- for (let e = Math.log10(t); e <= Math.log10(n) + 1e-9; e += 1 / 4) i.push(10 ** e);
783
+ function N({ rows: e, lo: t, hi: n }) {
784
+ let r = d(), a = [];
785
+ for (let e = Math.log10(t); e <= Math.log10(n) + 1e-9; e += 1 / 4) a.push(10 ** e);
801
786
  let s = (e) => 34 + (Math.log10(Math.max(t, e)) - Math.log10(t)) / (Math.log10(n) - Math.log10(t)) * 366;
802
787
  return /* @__PURE__ */ (0, x.jsx)("div", {
803
788
  className: "rp-hist",
804
789
  children: e.filter((e) => e.values.length).map((e) => {
805
- let t = i.slice(0, -1).map((t, n) => ({
790
+ let t = a.slice(0, -1).map((t, n) => ({
806
791
  from: t,
807
- to: i[n + 1],
808
- n: e.values.filter((e) => e >= t && e < i[n + 1]).length
809
- })), c = Math.max(1, ...t.map((e) => e.n)), l = [
810
- ["p50", a(e.values, 50)],
811
- ["p90", a(e.values, 90)],
812
- ["p99", a(e.values, 99)]
792
+ to: a[n + 1],
793
+ n: e.values.filter((e) => e >= t && e < a[n + 1]).length
794
+ })), l = Math.max(1, ...t.map((e) => e.n)), u = [
795
+ ["p50", c(e.values, 50)],
796
+ ["p90", c(e.values, 90)],
797
+ ["p99", c(e.values, 99)]
813
798
  ];
814
799
  return /* @__PURE__ */ (0, x.jsxs)("figure", { children: [/* @__PURE__ */ (0, x.jsxs)("figcaption", { children: [
815
800
  /* @__PURE__ */ (0, x.jsx)("i", { className: `rp-sw ${e.model ? "model" : "tool"}` }),
816
801
  e.name,
817
802
  /* @__PURE__ */ (0, x.jsx)("span", {
818
803
  className: "ct",
819
- children: o(e.values.length)
804
+ children: i(e.values.length)
820
805
  })
821
806
  ] }), /* @__PURE__ */ (0, x.jsxs)("svg", {
822
807
  viewBox: "0 0 400 114",
@@ -827,7 +812,7 @@ function A({ rows: e, lo: t, hi: n }) {
827
812
  x: 28,
828
813
  y: 12,
829
814
  textAnchor: "end",
830
- children: c
815
+ children: l
831
816
  }),
832
817
  /* @__PURE__ */ (0, x.jsx)("text", {
833
818
  x: 28,
@@ -845,8 +830,8 @@ function A({ rows: e, lo: t, hi: n }) {
845
830
  t.map((t, n) => t.n ? /* @__PURE__ */ (0, x.jsx)("rect", {
846
831
  x: s(t.from) + 1,
847
832
  width: Math.max(1, s(t.to) - s(t.from) - 2),
848
- y: 96 - t.n / c * 88,
849
- height: t.n / c * 88,
833
+ y: 96 - t.n / l * 88,
834
+ height: t.n / l * 88,
850
835
  rx: "1.5",
851
836
  className: e.model ? "model" : "tool",
852
837
  tabIndex: 0,
@@ -859,9 +844,9 @@ function A({ rows: e, lo: t, hi: n }) {
859
844
  children: [/* @__PURE__ */ (0, x.jsxs)("span", {
860
845
  className: "nm",
861
846
  children: [
862
- y(t.from),
847
+ o(t.from),
863
848
  "–",
864
- y(t.to)
849
+ o(t.to)
865
850
  ]
866
851
  }), /* @__PURE__ */ (0, x.jsxs)("span", {
867
852
  className: "v",
@@ -879,7 +864,7 @@ function A({ rows: e, lo: t, hi: n }) {
879
864
  }),
880
865
  onPointerLeave: () => r.hide()
881
866
  }, n) : null),
882
- l.map(([e, t]) => t !== null && /* @__PURE__ */ (0, x.jsxs)("g", { children: [/* @__PURE__ */ (0, x.jsx)("line", {
867
+ u.map(([e, t]) => t !== null && /* @__PURE__ */ (0, x.jsxs)("g", { children: [/* @__PURE__ */ (0, x.jsx)("line", {
883
868
  x1: s(t),
884
869
  x2: s(t),
885
870
  y1: 4,
@@ -892,7 +877,7 @@ function A({ rows: e, lo: t, hi: n }) {
892
877
  children: [
893
878
  e,
894
879
  " ",
895
- y(t)
880
+ o(t)
896
881
  ]
897
882
  })] }, e)),
898
883
  [
@@ -905,17 +890,17 @@ function A({ rows: e, lo: t, hi: n }) {
905
890
  x: s(e),
906
891
  y: 110,
907
892
  textAnchor: "middle",
908
- children: y(e)
893
+ children: o(e)
909
894
  }, e))
910
895
  ]
911
896
  })] }, e.name);
912
897
  })
913
898
  });
914
899
  }
915
- function j({ agents: e, tools: t }) {
916
- let n = t.filter((e) => e.failures).sort((e, t) => t.failures - e.failures || t.calls - e.calls), r = e.filter((e) => e.failedSteps).sort((e, t) => t.failedSteps - e.failedSteps), i = (e, t, n, r, i) => /* @__PURE__ */ (0, x.jsxs)("div", {
900
+ function P({ agents: e, tools: t }) {
901
+ let n = t.filter((e) => e.failures).sort((e, t) => t.failures - e.failures || t.calls - e.calls), r = e.filter((e) => e.failedSteps).sort((e, t) => t.failedSteps - e.failedSteps), a = (e, t, n, r, a) => /* @__PURE__ */ (0, x.jsxs)("div", {
917
902
  className: "row",
918
- title: i,
903
+ title: a,
919
904
  children: [
920
905
  /* @__PURE__ */ (0, x.jsx)("span", {
921
906
  className: "l",
@@ -930,7 +915,7 @@ function j({ agents: e, tools: t }) {
930
915
  children: [
931
916
  t,
932
917
  " ",
933
- /* @__PURE__ */ (0, x.jsxs)("small", { children: ["of ", o(n)] })
918
+ /* @__PURE__ */ (0, x.jsxs)("small", { children: ["of ", i(n)] })
934
919
  ]
935
920
  })
936
921
  ]
@@ -946,7 +931,7 @@ function j({ agents: e, tools: t }) {
946
931
  children: !n.length && !r.length ? /* @__PURE__ */ (0, x.jsx)("p", {
947
932
  className: "ws-status",
948
933
  children: "No step failed."
949
- }) : /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [n.length > 0 && /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsxs)("h5", { children: ["By tool · ", n.length] }), n.slice(0, 6).map((e) => i(e.name.replace(/^agent-runtime-coordination_/, ""), e.failures, e.calls, e.name, `${e.name}: ${e.failures} of ${e.calls} calls failed`))] }), r.length > 0 && /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsxs)("h5", { children: ["By agent · ", r.length] }), r.slice(0, 6).map((e) => i(m(e, 22), e.failedSteps, e.steps.length, e.id, `${e.name}: ${e.failedSteps} of ${e.steps.length} steps failed`))] })] })
934
+ }) : /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [n.length > 0 && /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsxs)("h5", { children: ["By tool · ", n.length] }), n.slice(0, 6).map((e) => a(e.name.replace(/^agent-runtime-coordination_/, ""), e.failures, e.calls, e.name, `${e.name}: ${e.failures} of ${e.calls} calls failed`))] }), r.length > 0 && /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsxs)("h5", { children: ["By agent · ", r.length] }), r.slice(0, 6).map((e) => a(p(e, 22), e.failedSteps, e.steps.length, e.id, `${e.name}: ${e.failedSteps} of ${e.steps.length} steps failed`))] })] })
950
935
  })]
951
936
  });
952
937
  }