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