@tangle-network/sandbox-cli 0.21.64 → 0.21.66

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 (136) hide show
  1. package/README.md +32 -4
  2. package/SKILL.md +37 -5
  3. package/dist/graph-native-CS_TmaCK.mjs +1 -0
  4. package/dist/graph-viewer/Analytics-bWsqhurt.js +1001 -0
  5. package/dist/graph-viewer/{AnswerStrip-DhwqOyxI.js → AnswerStrip-COxV7gLW.js} +2 -2
  6. package/dist/graph-viewer/Checks-CQGmKcQ0.js +164 -0
  7. package/dist/graph-viewer/Conversations-DgCshBAf.js +627 -0
  8. package/dist/graph-viewer/{Files-DtZhf0ii.js → Files-CvIOGrAs.js} +81 -90
  9. package/dist/graph-viewer/LiveRun-DHmsr6F7.js +311 -0
  10. package/dist/graph-viewer/{Outputs-QET3nPPp.js → Outputs-rwBg_x36.js} +4 -4
  11. package/dist/graph-viewer/Overview-C150tkVa.js +194 -0
  12. package/dist/graph-viewer/{RunOverview-DJQDAMIx.js → RunOverview-CSqsunqf.js} +2 -2
  13. package/dist/graph-viewer/RunPage-F_prVwiV.js +286 -0
  14. package/dist/graph-viewer/Timeline-BFDywlmz.js +335 -0
  15. package/dist/graph-viewer/Today-BdDuqZGF.js +623 -0
  16. package/dist/graph-viewer/Topology-SAfGtd5u.js +238 -0
  17. package/dist/graph-viewer/Traces-BYqXaS_s.js +254 -0
  18. package/dist/graph-viewer/{WallPages-4d9QUZDq.js → WallPages-MM70VZrC.js} +48 -30
  19. package/dist/graph-viewer/agent-runtime.js +55 -55
  20. package/dist/graph-viewer/{data-BJmP7F1M.js → data-DTGmre1W.js} +31 -27
  21. package/dist/graph-viewer/harness-sessions.js +1 -1
  22. package/dist/graph-viewer/index.js +1357 -1392
  23. package/dist/graph-viewer/{lazy-pages-DM0cZM10.js → lazy-pages-BYuq_L_n.js} +9 -5
  24. package/dist/graph-viewer/{outputs-model-CGdvjkQh.js → outputs-model-CHTx8rMz.js} +2 -2
  25. package/dist/graph-viewer/{viewer/plain-words-CgvxtEOa.js → plain-words-BrMHl0On.js} +9 -4
  26. package/dist/graph-viewer/receipt.js +2 -2
  27. package/dist/graph-viewer/record-CsP_3NJS.js +612 -0
  28. package/dist/graph-viewer/record-part-CuT9Xw37.js +334 -0
  29. package/dist/graph-viewer/record.js +2 -336
  30. package/dist/graph-viewer/report-viewer.js +65 -65
  31. package/dist/graph-viewer/report.js +1 -1
  32. package/dist/graph-viewer/research-publication.js +1 -1
  33. package/dist/graph-viewer/{run-files-C1NgzM0l.js → run-files-BckQDdTD.js} +1 -1
  34. package/dist/graph-viewer/{run-receipt-Bvi4-KVM.js → run-receipt-Bt2iXJUy.js} +1 -0
  35. package/dist/graph-viewer/schemas/agent-workspace.play.v1.json +3 -0
  36. package/dist/graph-viewer/schemas/agent-workspace.plays.v1.json +2 -0
  37. package/dist/graph-viewer/schemas/agent-workspace.run.v1.json +1 -0
  38. package/dist/graph-viewer/styles.css +4559 -2385
  39. package/dist/graph-viewer/trace-spans.js +1 -1
  40. package/dist/graph-viewer/ui-xa5w5bEN.js +889 -0
  41. package/dist/graph-viewer/viewer/{AgentGraphCanvas-CMdOlSlh-4EervjeC.js → AgentGraphCanvas-B74GN1o6-BZEumF7-.js} +2610 -2707
  42. package/dist/graph-viewer/viewer/Analytics-E3XS570U.js +1002 -0
  43. package/dist/graph-viewer/viewer/{AnswerStrip-CGUyXuYH.js → AnswerStrip-B7xMU57A.js} +2 -2
  44. package/dist/graph-viewer/viewer/Checks-CJ5XSHbv.js +165 -0
  45. package/dist/graph-viewer/viewer/Conversations-AX8G7Qyl.js +904 -0
  46. package/dist/graph-viewer/viewer/Files-DxL1576V.js +630 -0
  47. package/dist/graph-viewer/viewer/LiveRun-B-BckyEj.js +820 -0
  48. package/dist/graph-viewer/viewer/{Outputs-CumGyjQo.js → Outputs-BoIpgfMv.js} +24 -23
  49. package/dist/graph-viewer/viewer/Overview-Dzg5XJgy.js +436 -0
  50. package/dist/graph-viewer/viewer/RunPage-NtevWXBs.js +285 -0
  51. package/dist/graph-viewer/viewer/{Scores-ZS16yk0n.js → Scores-Dgv4WePL.js} +3 -3
  52. package/dist/graph-viewer/viewer/Timeline-CzY3LVDu.js +335 -0
  53. package/dist/graph-viewer/viewer/Today-Bi9IIwuh.js +623 -0
  54. package/dist/graph-viewer/viewer/Topology-CzjqSFXH.js +239 -0
  55. package/dist/graph-viewer/viewer/Traces-CMX0H1VU.js +254 -0
  56. package/dist/graph-viewer/viewer/{WallPages-CzWpyIfp.js → WallPages-Clj4bORg.js} +50 -32
  57. package/dist/graph-viewer/viewer/addon-webgl-BSCscllv.js +4027 -0
  58. package/dist/graph-viewer/viewer/agent-record-BrP-ENHg.css +2 -0
  59. package/dist/graph-viewer/viewer/{bot-D6Nrej7Z.js → bot-BaQU59LG.js} +1 -1
  60. package/dist/graph-viewer/viewer/{chevron-right-D_5IKLxu.js → chevron-right-Xn05jYLT.js} +1 -1
  61. package/dist/graph-viewer/viewer/{createLucideIcon-yH0cxLMy.js → createLucideIcon-BSphcoOJ.js} +1 -1
  62. package/dist/graph-viewer/viewer/dashboard-D3JhmRhe-DSl0zhkw.js +371 -0
  63. package/dist/graph-viewer/viewer/{data-CkWfWr7i.js → data-CVHeKhrh.js} +144 -139
  64. package/dist/graph-viewer/viewer/dist-4_KJz8ZM.js +349 -0
  65. package/dist/graph-viewer/viewer/dist-Dy-wrdTt.js +1615 -0
  66. package/dist/graph-viewer/viewer/es2015-utW4DTOJ.js +3506 -0
  67. package/dist/graph-viewer/viewer/{final-output-kwY11u9X.js → final-output-BYT-g-9j.js} +1 -1
  68. package/dist/graph-viewer/viewer/flow-waterfall-model-DvrgPLGS-BdThSFH-.js +2696 -0
  69. package/dist/graph-viewer/viewer/git-branch-BzTbIcYL.js +28 -0
  70. package/dist/graph-viewer/viewer/{highlights-Btsi5OXl.js → highlights-DWeSCtiR.js} +4 -4
  71. package/dist/graph-viewer/viewer/jsx-runtime-DPT6sCLq.js +319 -0
  72. package/dist/graph-viewer/viewer/lazy-pages-ChiMJ8r_.js +803 -0
  73. package/dist/graph-viewer/viewer/{markdown-CX_sVrXB.js → markdown-lADwhD7y.js} +2324 -2608
  74. package/dist/graph-viewer/viewer/model-brand-bTcMjQtB-RSb7EbGB.js +476 -0
  75. package/dist/graph-viewer/viewer/{page-header-Brq611fd.js → page-header-QbUg8F8i.js} +12 -11
  76. package/dist/graph-viewer/{plain-words-CgvxtEOa.js → viewer/plain-words-BrMHl0On.js} +9 -4
  77. package/dist/graph-viewer/viewer/primitives-znfPK9NP-B6UO7uDr.js +346 -0
  78. package/dist/graph-viewer/viewer/react-DQ7E2Epi.js +4254 -0
  79. package/dist/graph-viewer/viewer/{react-dom-t1L4_-il.js → react-dom-BEusmvQH.js} +1 -1
  80. package/dist/graph-viewer/viewer/record-DZnT6SWN-H-ul3U3a.js +3523 -0
  81. package/dist/graph-viewer/viewer/record-W39D5MO-.js +1 -0
  82. package/dist/graph-viewer/viewer/record-part-CbweyYoV.js +335 -0
  83. package/dist/graph-viewer/viewer/{segmented-control-BaJmvTNd.js → segmented-control-Di1mbQlP.js} +27 -26
  84. package/dist/graph-viewer/viewer/{shiki-Qnby7Sh6.js → shiki-BfNNlmfZ.js} +15 -15
  85. package/dist/graph-viewer/viewer/status-meta-S0kV_RDp.js +273 -0
  86. package/dist/graph-viewer/viewer/{stream-tokenizer-CWtnjmRd.js → stream-tokenizer-B5wWaM3U.js} +12 -12
  87. package/dist/graph-viewer/viewer/{themes-1i1fzpRk.js → themes-DuRxHiga.js} +1 -1
  88. package/dist/graph-viewer/viewer/ui-Co03nZUX.js +889 -0
  89. package/dist/graph-viewer/viewer/utils-BuObIC0n.js +1815 -0
  90. package/dist/graph-viewer/viewer/workbench-E6_5q_oL.js +28351 -0
  91. package/dist/graph-viewer/viewer/workflows--mZpHYqo.js +3298 -0
  92. package/dist/graph-viewer/viewer/workspace-cKs9sGEO.js +2468 -0
  93. package/dist/graph-viewer/{workspace-model-Ewf17pTW.js → workspace-model-BkPl_J8E.js} +1 -1
  94. package/dist/graph-viewer/workspace-viewer.js +7452 -7489
  95. package/dist/graph-viewer/workspace.js +1 -1
  96. package/dist/index.mjs +27 -22
  97. package/package.json +14 -13
  98. package/dist/graph-viewer/Analytics-DFWW8Phh.js +0 -938
  99. package/dist/graph-viewer/Checks-qgqV4xgV.js +0 -155
  100. package/dist/graph-viewer/Conversations-CGB45kpj.js +0 -545
  101. package/dist/graph-viewer/LiveRun-C21wUKAY.js +0 -210
  102. package/dist/graph-viewer/Overview-BjeLsA2I.js +0 -506
  103. package/dist/graph-viewer/RunPage-CkkcBEUe.js +0 -258
  104. package/dist/graph-viewer/Timeline-C2Xolk0t.js +0 -293
  105. package/dist/graph-viewer/Today-BVVDtSVN.js +0 -660
  106. package/dist/graph-viewer/Topology-DO5XX8e4.js +0 -545
  107. package/dist/graph-viewer/Traces-BhMxjNgw.js +0 -259
  108. package/dist/graph-viewer/part-events-BrLrg_EV.js +0 -276
  109. package/dist/graph-viewer/record-part-CZal_IMH.js +0 -1408
  110. package/dist/graph-viewer/ui-D8QZRsC3.js +0 -938
  111. package/dist/graph-viewer/viewer/Analytics-DD__nbLm.js +0 -939
  112. package/dist/graph-viewer/viewer/Checks-Ds5M7eAW.js +0 -156
  113. package/dist/graph-viewer/viewer/Conversations-C1n0EBBd.js +0 -819
  114. package/dist/graph-viewer/viewer/Files-Cjr7NMU_.js +0 -448
  115. package/dist/graph-viewer/viewer/LiveRun-uPTkPSjo.js +0 -6772
  116. package/dist/graph-viewer/viewer/Overview-4Umk14_2.js +0 -507
  117. package/dist/graph-viewer/viewer/RunPage-DZlBW7Va.js +0 -257
  118. package/dist/graph-viewer/viewer/Timeline-BnK6-yBR.js +0 -294
  119. package/dist/graph-viewer/viewer/Today-a_-oNigi.js +0 -660
  120. package/dist/graph-viewer/viewer/Topology-CQPCLQT6.js +0 -546
  121. package/dist/graph-viewer/viewer/Traces-C0IGk0L4.js +0 -259
  122. package/dist/graph-viewer/viewer/WorkflowGraph-DZ3xejKE-jRXKeSrg.js +0 -1559
  123. package/dist/graph-viewer/viewer/agent-record-Dw772ROs.css +0 -2
  124. package/dist/graph-viewer/viewer/agent-timeline-Cs9Qbpvo.js +0 -1798
  125. package/dist/graph-viewer/viewer/dist-C1-7EfoW.js +0 -488
  126. package/dist/graph-viewer/viewer/file-text-m7a3piQF.js +0 -47
  127. package/dist/graph-viewer/viewer/jsx-runtime-DQWyJOhv.js +0 -2136
  128. package/dist/graph-viewer/viewer/lazy-pages-BowaGsg-.js +0 -20
  129. package/dist/graph-viewer/viewer/model-brand-bTcMjQtB-fagiBQam.js +0 -723
  130. package/dist/graph-viewer/viewer/popover-CvOAjlnk.js +0 -5329
  131. package/dist/graph-viewer/viewer/react-CY3IbSNO.js +0 -4262
  132. package/dist/graph-viewer/viewer/record-part-D3_Anfpe.js +0 -1329
  133. package/dist/graph-viewer/viewer/terminal-83J_I4Ne.js +0 -52
  134. package/dist/graph-viewer/viewer/ui-C9b1rIUH.js +0 -938
  135. package/dist/graph-viewer/viewer/workspace-CekmOBs3.js +0 -25100
  136. package/dist/graph-viewer/viewer/x-DOc2URqZ.js +0 -56
@@ -1,939 +0,0 @@
1
- import { i as e } from "./rolldown-runtime-DArdT4gl.js";
2
- import { i as t, t as n } from "./jsx-runtime-DQWyJOhv.js";
3
- import { 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
- //#region src/workspace/run/Analytics.tsx
6
- var b = /* @__PURE__ */ e(t(), 1), x = n();
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)(() => a(r), [r]), o = t.size ? t.size === 1 ? e.byId.get([...t][0])?.name : `${t.size} agents` : "All";
9
- return /* @__PURE__ */ (0, x.jsxs)("div", {
10
- className: "rp-an",
11
- children: [
12
- /* @__PURE__ */ (0, x.jsx)("div", {
13
- className: "rp-an-f",
14
- children: /* @__PURE__ */ (0, x.jsx)(f, {
15
- label: "Agents",
16
- multi: !0,
17
- options: u(e),
18
- groups: g(e),
19
- all: {
20
- label: "All agents",
21
- meta: String(e.agents.length)
22
- },
23
- value: t,
24
- onChange: n,
25
- width: 360,
26
- placeholder: `Search ${e.agents.length} agents`,
27
- style: { width: 280 },
28
- children: t.size ? o : `All ${e.agents.length} agents`
29
- })
30
- }),
31
- /* @__PURE__ */ (0, x.jsx)(C, {
32
- m: e,
33
- agents: r,
34
- tools: i
35
- }),
36
- /* @__PURE__ */ (0, x.jsxs)("div", {
37
- className: "rp-an-g",
38
- children: [
39
- /* @__PURE__ */ (0, x.jsx)(D, {
40
- m: e,
41
- agents: r,
42
- tools: i
43
- }),
44
- /* @__PURE__ */ (0, x.jsx)(k, {
45
- m: e,
46
- agents: r
47
- }),
48
- /* @__PURE__ */ (0, x.jsx)(j, {
49
- m: e,
50
- agents: r
51
- }),
52
- /* @__PURE__ */ (0, x.jsx)(M, {
53
- m: e,
54
- agents: r,
55
- tools: i
56
- }),
57
- /* @__PURE__ */ (0, x.jsx)(P, {
58
- m: e,
59
- agents: r,
60
- tools: i
61
- })
62
- ]
63
- })
64
- ]
65
- });
66
- }
67
- function C({ m: e, agents: t, tools: n }) {
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 ? {
69
- input: e.input + t.byClass.input,
70
- output: e.output + t.byClass.output,
71
- cacheRead: e.cacheRead + t.byClass.cacheRead
72
- } : e, {
73
- input: 0,
74
- output: 0,
75
- cacheRead: 0
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`]
85
- ];
86
- return /* @__PURE__ */ (0, x.jsx)("section", {
87
- className: "rp-card rp-kpis",
88
- "aria-label": "Totals",
89
- children: p.map(([e, t]) => /* @__PURE__ */ (0, x.jsxs)("div", { children: [/* @__PURE__ */ (0, x.jsx)("b", { children: e }), /* @__PURE__ */ (0, x.jsx)("span", {
90
- title: t,
91
- children: t
92
- })] }, t))
93
- });
94
- }
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)(() => {
98
- let e = t.filter((e) => e.toolCalls > 0), n = a === "calls" ? (e) => -e.toolCalls : a === "fails" ? (e) => -e.toolFailures * 1e6 - e.toolCalls : null;
99
- return n ? [...e].sort((e, t) => n(e) - n(t)) : [...e].sort((e, t) => e.name.localeCompare(t.name));
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({
101
- rect: r.getBoundingClientRect(),
102
- wide: !1,
103
- content: /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsxs)("div", {
104
- className: "rp-card-h",
105
- children: [/* @__PURE__ */ (0, x.jsxs)("div", {
106
- className: "t",
107
- children: [
108
- /* @__PURE__ */ (0, x.jsx)(m, { tone: e.state.tone }),
109
- /* @__PURE__ */ (0, x.jsx)("span", {
110
- className: "nm",
111
- children: e.name
112
- }),
113
- /* @__PURE__ */ (0, x.jsx)("span", {
114
- className: "v",
115
- children: n
116
- })
117
- ]
118
- }), /* @__PURE__ */ (0, x.jsx)("div", {
119
- className: "s",
120
- children: t ? `${i(t.calls)} calls · ${v(t.ms)} in all` : "no calls"
121
- })]
122
- }), t && /* @__PURE__ */ (0, x.jsx)("div", {
123
- className: "rp-card-cols",
124
- children: /* @__PURE__ */ (0, x.jsx)("section", { children: /* @__PURE__ */ (0, x.jsxs)("dl", { children: [
125
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "Calls" }),
126
- /* @__PURE__ */ (0, x.jsx)("dd", { children: i(t.calls) }),
127
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "Failed" }),
128
- /* @__PURE__ */ (0, x.jsx)("dd", { children: t.failures ? /* @__PURE__ */ (0, x.jsxs)("span", {
129
- className: "f",
130
- children: [
131
- t.failures,
132
- " ✕ · ",
133
- (t.failures / t.calls * 100).toFixed(0),
134
- "%"
135
- ]
136
- }) : "0" }),
137
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "p50 · p90 · p99" }),
138
- /* @__PURE__ */ (0, x.jsxs)("dd", { children: [
139
- o(t.p50),
140
- " · ",
141
- o(t.p90),
142
- " · ",
143
- o(t.p99)
144
- ] }),
145
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "Share of its tool calls" }),
146
- /* @__PURE__ */ (0, x.jsxs)("dd", { children: [(t.calls / Math.max(1, e.toolCalls) * 100).toFixed(0), "%"] })
147
- ] }) })
148
- })] })
149
- });
150
- return /* @__PURE__ */ (0, x.jsxs)("section", {
151
- className: "rp-card w7",
152
- "aria-label": "Tool calls by agent and tool",
153
- children: [/* @__PURE__ */ (0, x.jsxs)("div", {
154
- className: "rp-hd sm",
155
- children: [/* @__PURE__ */ (0, x.jsxs)("h3", { children: ["Tool calls by agent and tool", /* @__PURE__ */ (0, x.jsxs)("span", {
156
- className: "ct",
157
- children: [
158
- f.length,
159
- " agents · ",
160
- n.length,
161
- " tools"
162
- ]
163
- })] }), /* @__PURE__ */ (0, x.jsx)("span", {
164
- className: "end",
165
- children: /* @__PURE__ */ (0, x.jsx)(r, {
166
- "aria-label": "Sort",
167
- value: a,
168
- onValueChange: s,
169
- options: [
170
- {
171
- value: "calls",
172
- label: "By calls"
173
- },
174
- {
175
- value: "fails",
176
- label: "By failures"
177
- },
178
- {
179
- value: "name",
180
- label: "By name"
181
- }
182
- ]
183
- })
184
- })]
185
- }), /* @__PURE__ */ (0, x.jsxs)("div", {
186
- className: "rp-chart",
187
- children: [/* @__PURE__ */ (0, x.jsx)("div", {
188
- className: "rp-hm-wrap",
189
- ref: u,
190
- children: /* @__PURE__ */ (0, x.jsxs)("div", {
191
- className: "rp-hm",
192
- style: A,
193
- children: [
194
- /* @__PURE__ */ (0, x.jsx)("span", { className: "ch c0" }),
195
- y.map((e) => /* @__PURE__ */ (0, x.jsx)("span", {
196
- className: "ch",
197
- title: e.name,
198
- children: /* @__PURE__ */ (0, x.jsx)("span", { children: e.name.replace(/^agent-runtime-coordination_/, "").replaceAll("_", " ") })
199
- }, e.name)),
200
- S.length > 0 && /* @__PURE__ */ (0, x.jsx)("span", {
201
- className: "ch",
202
- children: /* @__PURE__ */ (0, x.jsxs)("span", { children: [S.length, " more"] })
203
- }),
204
- /* @__PURE__ */ (0, x.jsx)("span", {
205
- className: "ch tot",
206
- children: "Total"
207
- }),
208
- /* @__PURE__ */ (0, x.jsx)("div", {
209
- className: "gap",
210
- style: { height: h.before }
211
- }),
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);
214
- return [
215
- /* @__PURE__ */ (0, x.jsxs)("span", {
216
- className: "rh",
217
- title: e.name,
218
- children: [/* @__PURE__ */ (0, x.jsx)(m, { tone: e.state.tone }), /* @__PURE__ */ (0, x.jsx)("span", {
219
- className: "nm",
220
- children: p(e, 22)
221
- })]
222
- }, `${e.id}:n`),
223
- ...y.map((n) => {
224
- let r = t.get(n.name), a = r?.calls ?? 0;
225
- return /* @__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", {
234
- className: "xf",
235
- children: ["✕", r.failures]
236
- }) : null]
237
- }, `${e.id}:${n.name}`);
238
- }),
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", {
243
- className: "xf",
244
- children: ["✕", a]
245
- }) : null]
246
- }, `${e.id}:rest`)] : [],
247
- /* @__PURE__ */ (0, x.jsxs)("span", {
248
- className: "tot",
249
- children: [/* @__PURE__ */ (0, x.jsx)("b", { style: { width: `${e.toolCalls / D * 56}px` } }), i(e.toolCalls)]
250
- }, `${e.id}:t`)
251
- ];
252
- }),
253
- /* @__PURE__ */ (0, x.jsx)("div", {
254
- className: "gap",
255
- style: { height: h.after }
256
- })
257
- ]
258
- })
259
- }), /* @__PURE__ */ (0, x.jsxs)("div", {
260
- className: "rp-hm-foot",
261
- children: [
262
- /* @__PURE__ */ (0, x.jsxs)("span", {
263
- className: "ramp",
264
- children: [
265
- /* @__PURE__ */ (0, x.jsx)("span", { children: "1" }),
266
- /* @__PURE__ */ (0, x.jsx)("i", {}),
267
- /* @__PURE__ */ (0, x.jsx)("span", { children: i(C) })
268
- ]
269
- }),
270
- /* @__PURE__ */ (0, x.jsxs)("span", { children: [/* @__PURE__ */ (0, x.jsx)("span", {
271
- className: "x",
272
- children: "✕"
273
- }), " failed calls in the cell"] }),
274
- t.length > f.length && /* @__PURE__ */ (0, x.jsxs)("span", {
275
- className: "end",
276
- children: [t.length - f.length, " agents made no tool calls"]
277
- })
278
- ]
279
- })]
280
- })]
281
- });
282
- }
283
- var O = [
284
- 6e4,
285
- 12e4,
286
- 3e5,
287
- 6e5,
288
- 9e5,
289
- 18e5,
290
- 36e5,
291
- 72e5
292
- ];
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 }, () => ({
296
- model: 0,
297
- tool: 0,
298
- failed: 0,
299
- tokens: 0
300
- }));
301
- for (let t of s) {
302
- let n = e[Math.min(p - 1, Math.floor((t.t - f) / u))];
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);
304
- }
305
- return e;
306
- }, [
307
- s,
308
- p,
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));
312
- return /* @__PURE__ */ (0, x.jsxs)("section", {
313
- className: "rp-card w5",
314
- "aria-label": n === "calls" ? "Calls over time" : "Tokens over time",
315
- children: [/* @__PURE__ */ (0, x.jsxs)("div", {
316
- className: "rp-hd sm",
317
- children: [/* @__PURE__ */ (0, x.jsx)("h3", { children: n === "calls" ? `Calls per ${T}` : `Metered tokens per ${T}` }), /* @__PURE__ */ (0, x.jsx)("span", {
318
- className: "end",
319
- children: /* @__PURE__ */ (0, x.jsx)(r, {
320
- "aria-label": "Measure",
321
- value: n,
322
- onValueChange: a,
323
- options: [{
324
- value: "calls",
325
- label: "Calls"
326
- }, {
327
- value: "tokens",
328
- label: "Tokens"
329
- }]
330
- })
331
- })]
332
- }), /* @__PURE__ */ (0, x.jsxs)("div", {
333
- className: "rp-chart",
334
- children: [/* @__PURE__ */ (0, x.jsx)("div", {
335
- className: "rp-legend sm",
336
- children: n === "calls" ? /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [
337
- /* @__PURE__ */ (0, x.jsxs)("span", {
338
- className: "rp-key",
339
- children: [/* @__PURE__ */ (0, x.jsx)("i", { className: "model" }), "Model call"]
340
- }),
341
- /* @__PURE__ */ (0, x.jsxs)("span", {
342
- className: "rp-key",
343
- children: [/* @__PURE__ */ (0, x.jsx)("i", { className: "tool" }), "Tool call"]
344
- }),
345
- /* @__PURE__ */ (0, x.jsxs)("span", {
346
- className: "rp-key",
347
- children: [/* @__PURE__ */ (0, x.jsx)("span", {
348
- className: "x",
349
- children: "✕"
350
- }), "failed"]
351
- })
352
- ] }) : /* @__PURE__ */ (0, x.jsxs)("span", {
353
- className: "rp-key",
354
- children: [/* @__PURE__ */ (0, x.jsx)("i", { className: "model" }), "Tokens on calls that recorded them"]
355
- })
356
- }), /* @__PURE__ */ (0, x.jsxs)("svg", {
357
- className: "rp-cpm",
358
- viewBox: "0 0 600 240",
359
- preserveAspectRatio: "none",
360
- role: "img",
361
- "aria-label": `${n} per ${T}, peak ${i(g)}`,
362
- children: [[
363
- 0,
364
- .5,
365
- 1
366
- ].map((e) => /* @__PURE__ */ (0, x.jsxs)("g", { children: [/* @__PURE__ */ (0, x.jsx)("line", {
367
- x1: 40,
368
- x2: 600,
369
- y1: C(S * e),
370
- y2: C(S * e),
371
- className: "grid"
372
- }), /* @__PURE__ */ (0, x.jsx)("text", {
373
- x: 34,
374
- y: C(S * e) + 4,
375
- textAnchor: "end",
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({
379
- rect: n.currentTarget.getBoundingClientRect(),
380
- content: /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsx)("div", {
381
- className: "rp-card-h",
382
- children: /* @__PURE__ */ (0, x.jsx)("div", {
383
- className: "t",
384
- children: /* @__PURE__ */ (0, x.jsxs)("span", {
385
- className: "nm",
386
- children: [
387
- w(f + t * u),
388
- "–",
389
- w(f + (t + 1) * u),
390
- " UTC"
391
- ]
392
- })
393
- })
394
- }), /* @__PURE__ */ (0, x.jsx)("div", {
395
- className: "rp-card-cols",
396
- children: /* @__PURE__ */ (0, x.jsx)("section", { children: /* @__PURE__ */ (0, x.jsxs)("dl", { children: [
397
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "Model calls" }),
398
- /* @__PURE__ */ (0, x.jsx)("dd", { children: i(e.model) }),
399
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "Tool calls" }),
400
- /* @__PURE__ */ (0, x.jsx)("dd", { children: i(e.tool) }),
401
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "Failed" }),
402
- /* @__PURE__ */ (0, x.jsx)("dd", { children: e.failed ? /* @__PURE__ */ (0, x.jsxs)("span", {
403
- className: "f",
404
- children: [e.failed, " ✕"]
405
- }) : "0" }),
406
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "Metered tokens" }),
407
- /* @__PURE__ */ (0, x.jsx)("dd", { children: e.tokens ? _(e.tokens) : "not recorded" })
408
- ] }) })
409
- })] })
410
- });
411
- return /* @__PURE__ */ (0, x.jsxs)("g", {
412
- tabIndex: h(e) ? 0 : -1,
413
- onPointerEnter: l,
414
- onPointerLeave: () => o.hide(),
415
- onFocus: l,
416
- onBlur: () => o.hide(),
417
- children: [
418
- /* @__PURE__ */ (0, x.jsx)("rect", {
419
- x: 40 + t * v,
420
- y: 18,
421
- width: v,
422
- height: 198,
423
- className: "hit"
424
- }),
425
- s > 0 && /* @__PURE__ */ (0, x.jsx)("rect", {
426
- x: r,
427
- y: 216 - s,
428
- width: a,
429
- height: s,
430
- rx: Math.min(2, a / 2),
431
- className: "model"
432
- }),
433
- c > 0 && /* @__PURE__ */ (0, x.jsx)("rect", {
434
- x: r,
435
- y: 216 - s - c - (s > 0 ? 1.5 : 0),
436
- width: a,
437
- height: c,
438
- rx: Math.min(2, a / 2),
439
- className: "tool"
440
- }),
441
- e.failed > 0 && n === "calls" && /* @__PURE__ */ (0, x.jsxs)("text", {
442
- x: r + a / 2,
443
- y: 216 - s - c - 6,
444
- textAnchor: "middle",
445
- className: "xf",
446
- children: ["✕", e.failed]
447
- }),
448
- t % E === 0 && /* @__PURE__ */ (0, x.jsx)("text", {
449
- x: r + a / 2,
450
- y: 234,
451
- textAnchor: "middle",
452
- children: w(f + t * u)
453
- })
454
- ]
455
- }, t);
456
- })]
457
- })]
458
- })]
459
- });
460
- }
461
- function A(e) {
462
- let t = 10 ** Math.floor(Math.log10(Math.max(1, e)));
463
- return [
464
- 1,
465
- 2,
466
- 2.5,
467
- 5,
468
- 10
469
- ].map((e) => e * t).find((t) => t >= e) ?? e;
470
- }
471
- function j({ m: e, agents: t }) {
472
- let [n, r] = (0, b.useState)({
473
- k: "tokens",
474
- d: -1
475
- }), a = d(), o = (0, b.useRef)(null), c = (e) => ({
476
- tokens: e.tokens ?? -1,
477
- model: e.modelCalls,
478
- tool: e.toolCalls,
479
- failed: e.failedSteps,
480
- restarts: e.restarts.length,
481
- spawns: e.children.length,
482
- cost: e.listUsd ?? e.billedUsd ?? -1,
483
- name: e.name
484
- })[n.k], u = (0, b.useMemo)(() => [...t].sort((e, t) => {
485
- let r = c(e), i = c(t);
486
- return (typeof r == "string" ? r.localeCompare(i) : r - i) * n.d;
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", {
492
- role: "columnheader",
493
- className: i,
494
- "aria-sort": n.k === e ? n.d < 0 ? "descending" : "ascending" : void 0,
495
- children: /* @__PURE__ */ (0, x.jsxs)("button", {
496
- type: "button",
497
- onClick: () => r((t) => ({
498
- k: e,
499
- d: t.k === e ? t.d === 1 ? -1 : 1 : e === "name" ? 1 : -1
500
- })),
501
- children: [t, n.k === e ? n.d < 0 ? " ↓" : " ↑" : ""]
502
- })
503
- }, e);
504
- return /* @__PURE__ */ (0, x.jsxs)("section", {
505
- className: "rp-card w5",
506
- "aria-label": "Agents",
507
- children: [/* @__PURE__ */ (0, x.jsx)("div", {
508
- className: "rp-hd sm",
509
- children: /* @__PURE__ */ (0, x.jsxs)("h3", { children: ["Agents", /* @__PURE__ */ (0, x.jsx)("span", {
510
- className: "ct",
511
- children: t.length
512
- })] })
513
- }), /* @__PURE__ */ (0, x.jsxs)("div", {
514
- className: "rp-at-wrap",
515
- ref: o,
516
- role: "table",
517
- "aria-label": "Agents",
518
- "aria-rowcount": u.length,
519
- children: [
520
- /* @__PURE__ */ (0, x.jsxs)("div", {
521
- className: "rp-at th",
522
- role: "row",
523
- style: v,
524
- children: [
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")
535
- ]
536
- }),
537
- /* @__PURE__ */ (0, x.jsx)("div", { style: { height: f.before } }),
538
- u.slice(f.first, f.last).map((t) => /* @__PURE__ */ (0, x.jsxs)("div", {
539
- className: "rp-at",
540
- role: "row",
541
- tabIndex: 0,
542
- style: v,
543
- onPointerEnter: (n) => a.show({
544
- content: /* @__PURE__ */ (0, x.jsx)(h, {
545
- m: e,
546
- a: t
547
- }),
548
- rect: n.currentTarget.getBoundingClientRect(),
549
- wide: t.tools.length > 0
550
- }),
551
- onPointerLeave: () => a.hide(),
552
- onFocus: (n) => a.show({
553
- content: /* @__PURE__ */ (0, x.jsx)(h, {
554
- m: e,
555
- a: t
556
- }),
557
- rect: n.currentTarget.getBoundingClientRect(),
558
- wide: t.tools.length > 0
559
- }),
560
- onBlur: () => a.hide(),
561
- children: [
562
- /* @__PURE__ */ (0, x.jsx)("span", {
563
- className: "nm",
564
- role: "cell",
565
- title: t.name,
566
- children: p(t, 20)
567
- }),
568
- /* @__PURE__ */ (0, x.jsxs)("span", {
569
- className: "tk",
570
- role: "cell",
571
- children: [/* @__PURE__ */ (0, x.jsx)("b", { style: { width: `${(t.tokens ?? 0) / m * 48}px` } }), /* @__PURE__ */ (0, x.jsx)("span", { children: _(t.tokens) })]
572
- }),
573
- /* @__PURE__ */ (0, x.jsx)("span", {
574
- className: "r",
575
- role: "cell",
576
- children: i(t.modelCalls)
577
- }),
578
- /* @__PURE__ */ (0, x.jsx)("span", {
579
- className: "r",
580
- role: "cell",
581
- children: i(t.toolCalls)
582
- }),
583
- g.map((e) => /* @__PURE__ */ (0, x.jsx)("span", {
584
- className: "r",
585
- role: "cell",
586
- children: (e === "failed" ? t.failedSteps : e === "restarts" ? t.restarts.length : t.children.length) || ""
587
- }, e)),
588
- /* @__PURE__ */ (0, x.jsx)("span", {
589
- className: "r",
590
- role: "cell",
591
- children: t.listUsd === null ? t.billedUsd === null ? "—" : s(t.billedUsd) : s(t.listUsd)
592
- })
593
- ]
594
- }, t.id)),
595
- /* @__PURE__ */ (0, x.jsx)("div", { style: { height: f.after } })
596
- ]
597
- })]
598
- });
599
- }
600
- function M({ m: e, agents: t, tools: n }) {
601
- let [a, s] = (0, b.useState)("range"), l = d(), u = (0, b.useMemo)(() => {
602
- let e = /* @__PURE__ */ new Map();
603
- for (let n of t) for (let t of n.steps) if (t.kind === "model" && t.latency !== null) {
604
- let r = t.model?.split("/").pop() ?? n.model ?? "model";
605
- (e.get(r) ?? e.set(r, []).get(r)).push(t.latency);
606
- }
607
- return [...e].map(([e, t]) => ({
608
- name: e,
609
- model: !0,
610
- calls: t.length,
611
- values: t,
612
- p50: c(t, 50),
613
- p90: c(t, 90),
614
- p99: c(t, 99)
615
- }));
616
- }, [t]), f = [...u, ...n.filter((e) => e.durations.length).slice(0, 9).map((e) => ({
617
- name: e.name,
618
- model: !1,
619
- calls: e.calls,
620
- values: e.durations,
621
- p50: e.p50,
622
- p90: e.p90,
623
- p99: e.p99
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 = [
625
- 10,
626
- 100,
627
- 1e3,
628
- 1e4,
629
- 1e5,
630
- 1e6
631
- ].filter((e) => e <= m), _ = (e, t) => l.show({
632
- rect: t.getBoundingClientRect(),
633
- content: /* @__PURE__ */ (0, x.jsxs)(x.Fragment, { children: [/* @__PURE__ */ (0, x.jsxs)("div", {
634
- className: "rp-card-h",
635
- children: [/* @__PURE__ */ (0, x.jsxs)("div", {
636
- className: "t",
637
- children: [
638
- /* @__PURE__ */ (0, x.jsx)("i", { className: `rp-sw ${e.model ? "model" : "tool"}` }),
639
- /* @__PURE__ */ (0, x.jsx)("span", {
640
- className: "nm",
641
- children: e.name
642
- }),
643
- /* @__PURE__ */ (0, x.jsxs)("span", {
644
- className: "v",
645
- children: [i(e.calls), " calls"]
646
- })
647
- ]
648
- }), /* @__PURE__ */ (0, x.jsx)("div", {
649
- className: "s",
650
- children: e.model ? "model call latency" : "tool call duration"
651
- })]
652
- }), /* @__PURE__ */ (0, x.jsx)("div", {
653
- className: "rp-card-cols",
654
- children: /* @__PURE__ */ (0, x.jsx)("section", { children: /* @__PURE__ */ (0, x.jsxs)("dl", { children: [
655
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "p50" }),
656
- /* @__PURE__ */ (0, x.jsx)("dd", { children: o(e.p50) }),
657
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "p90" }),
658
- /* @__PURE__ */ (0, x.jsx)("dd", { children: o(e.p90) }),
659
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "p99" }),
660
- /* @__PURE__ */ (0, x.jsx)("dd", { children: o(e.p99) }),
661
- /* @__PURE__ */ (0, x.jsx)("dt", { children: "Max" }),
662
- /* @__PURE__ */ (0, x.jsx)("dd", { children: o(Math.max(...e.values)) })
663
- ] }) })
664
- })] })
665
- });
666
- return /* @__PURE__ */ (0, x.jsxs)("section", {
667
- className: "rp-card w4",
668
- "aria-label": "Latency",
669
- children: [/* @__PURE__ */ (0, x.jsxs)("div", {
670
- className: "rp-hd sm",
671
- children: [/* @__PURE__ */ (0, x.jsx)("h3", { children: "Latency" }), /* @__PURE__ */ (0, x.jsx)("span", {
672
- className: "end",
673
- children: /* @__PURE__ */ (0, x.jsx)(r, {
674
- "aria-label": "Latency view",
675
- value: a,
676
- onValueChange: s,
677
- options: [{
678
- value: "range",
679
- label: "p50 · p90 · p99"
680
- }, {
681
- value: "dist",
682
- label: "Distribution"
683
- }]
684
- })
685
- })]
686
- }), /* @__PURE__ */ (0, x.jsx)("div", {
687
- className: "rp-chart",
688
- children: a === "range" ? /* @__PURE__ */ (0, x.jsxs)("div", {
689
- className: "rp-lat",
690
- children: [f.map((e) => /* @__PURE__ */ (0, x.jsxs)("div", {
691
- className: "row",
692
- tabIndex: 0,
693
- onPointerEnter: (t) => _(e, t.currentTarget),
694
- onPointerLeave: () => l.hide(),
695
- onFocus: (t) => _(e, t.currentTarget),
696
- onBlur: () => l.hide(),
697
- children: [
698
- /* @__PURE__ */ (0, x.jsx)("span", {
699
- className: `l${e.model ? " model" : ""}`,
700
- title: e.name,
701
- children: e.name.replace(/^agent-runtime-coordination_/, "")
702
- }),
703
- /* @__PURE__ */ (0, x.jsxs)("svg", {
704
- viewBox: "0 0 100 22",
705
- preserveAspectRatio: "none",
706
- "aria-hidden": "true",
707
- children: [g.map((e) => /* @__PURE__ */ (0, x.jsx)("line", {
708
- x1: h(e) * 100,
709
- x2: h(e) * 100,
710
- y1: "2",
711
- y2: "20",
712
- className: "grid"
713
- }, e)), /* @__PURE__ */ (0, x.jsx)("line", {
714
- x1: h(e.p50 ?? 10) * 100,
715
- x2: h(e.p99 ?? 10) * 100,
716
- y1: "11",
717
- y2: "11",
718
- className: e.model ? "model" : "tool"
719
- })]
720
- }),
721
- /* @__PURE__ */ (0, x.jsxs)("span", {
722
- className: "dots",
723
- "aria-hidden": "true",
724
- children: [
725
- /* @__PURE__ */ (0, x.jsx)("i", {
726
- className: `p50 ${e.model ? "model" : "tool"}`,
727
- style: { left: `${h(e.p50 ?? 10) * 100}%` }
728
- }),
729
- /* @__PURE__ */ (0, x.jsx)("i", {
730
- className: `p90 ${e.model ? "model" : "tool"}`,
731
- style: { left: `${h(e.p90 ?? 10) * 100}%` }
732
- }),
733
- /* @__PURE__ */ (0, x.jsx)("i", {
734
- className: `p99 ${e.model ? "model" : "tool"}`,
735
- style: { left: `${h(e.p99 ?? 10) * 100}%` }
736
- })
737
- ]
738
- }),
739
- /* @__PURE__ */ (0, x.jsxs)("span", {
740
- className: "v",
741
- children: [
742
- /* @__PURE__ */ (0, x.jsx)("b", { children: o(e.p50) }),
743
- " · ",
744
- o(e.p90),
745
- " · ",
746
- o(e.p99)
747
- ]
748
- })
749
- ]
750
- }, `${e.model}:${e.name}`)), /* @__PURE__ */ (0, x.jsxs)("div", {
751
- className: "row axis",
752
- children: [
753
- /* @__PURE__ */ (0, x.jsx)("span", {}),
754
- /* @__PURE__ */ (0, x.jsx)("span", {
755
- className: "ax",
756
- children: g.map((e) => /* @__PURE__ */ (0, x.jsx)("span", {
757
- style: { left: `${h(e) * 100}%` },
758
- children: o(e)
759
- }, e))
760
- }),
761
- /* @__PURE__ */ (0, x.jsx)("span", {
762
- className: "v dim",
763
- children: "● p50 ○ p90 | p99"
764
- })
765
- ]
766
- })]
767
- }) : /* @__PURE__ */ (0, x.jsx)(N, {
768
- rows: [{
769
- name: "Model calls",
770
- model: !0,
771
- values: u.flatMap((e) => e.values)
772
- }, {
773
- name: "Tool calls",
774
- model: !1,
775
- values: n.flatMap((e) => e.durations)
776
- }],
777
- lo: 10,
778
- hi: m
779
- })
780
- })]
781
- });
782
- }
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);
786
- let s = (e) => 34 + (Math.log10(Math.max(t, e)) - Math.log10(t)) / (Math.log10(n) - Math.log10(t)) * 366;
787
- return /* @__PURE__ */ (0, x.jsx)("div", {
788
- className: "rp-hist",
789
- children: e.filter((e) => e.values.length).map((e) => {
790
- let t = a.slice(0, -1).map((t, n) => ({
791
- from: t,
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)]
798
- ];
799
- return /* @__PURE__ */ (0, x.jsxs)("figure", { children: [/* @__PURE__ */ (0, x.jsxs)("figcaption", { children: [
800
- /* @__PURE__ */ (0, x.jsx)("i", { className: `rp-sw ${e.model ? "model" : "tool"}` }),
801
- e.name,
802
- /* @__PURE__ */ (0, x.jsx)("span", {
803
- className: "ct",
804
- children: i(e.values.length)
805
- })
806
- ] }), /* @__PURE__ */ (0, x.jsxs)("svg", {
807
- viewBox: "0 0 400 114",
808
- role: "img",
809
- "aria-label": `${e.name} by duration`,
810
- children: [
811
- /* @__PURE__ */ (0, x.jsx)("text", {
812
- x: 28,
813
- y: 12,
814
- textAnchor: "end",
815
- children: l
816
- }),
817
- /* @__PURE__ */ (0, x.jsx)("text", {
818
- x: 28,
819
- y: 96,
820
- textAnchor: "end",
821
- children: "0"
822
- }),
823
- /* @__PURE__ */ (0, x.jsx)("line", {
824
- x1: 34,
825
- x2: 400,
826
- y1: 96,
827
- y2: 96,
828
- className: "grid"
829
- }),
830
- t.map((t, n) => t.n ? /* @__PURE__ */ (0, x.jsx)("rect", {
831
- x: s(t.from) + 1,
832
- width: Math.max(1, s(t.to) - s(t.from) - 2),
833
- y: 96 - t.n / l * 88,
834
- height: t.n / l * 88,
835
- rx: "1.5",
836
- className: e.model ? "model" : "tool",
837
- tabIndex: 0,
838
- onPointerEnter: (n) => r.show({
839
- rect: n.currentTarget.getBoundingClientRect(),
840
- content: /* @__PURE__ */ (0, x.jsxs)("div", {
841
- className: "rp-card-h",
842
- children: [/* @__PURE__ */ (0, x.jsxs)("div", {
843
- className: "t",
844
- children: [/* @__PURE__ */ (0, x.jsxs)("span", {
845
- className: "nm",
846
- children: [
847
- o(t.from),
848
- "–",
849
- o(t.to)
850
- ]
851
- }), /* @__PURE__ */ (0, x.jsxs)("span", {
852
- className: "v",
853
- children: [t.n, " calls"]
854
- })]
855
- }), /* @__PURE__ */ (0, x.jsxs)("div", {
856
- className: "s",
857
- children: [
858
- (t.n / e.values.length * 100).toFixed(1),
859
- "% of ",
860
- e.name.toLowerCase()
861
- ]
862
- })]
863
- })
864
- }),
865
- onPointerLeave: () => r.hide()
866
- }, n) : null),
867
- u.map(([e, t]) => t !== null && /* @__PURE__ */ (0, x.jsxs)("g", { children: [/* @__PURE__ */ (0, x.jsx)("line", {
868
- x1: s(t),
869
- x2: s(t),
870
- y1: 4,
871
- y2: 96,
872
- className: "rule"
873
- }), /* @__PURE__ */ (0, x.jsxs)("text", {
874
- x: s(t) + 3,
875
- y: 12,
876
- className: "rl",
877
- children: [
878
- e,
879
- " ",
880
- o(t)
881
- ]
882
- })] }, e)),
883
- [
884
- 10,
885
- 100,
886
- 1e3,
887
- 1e4,
888
- 1e5
889
- ].filter((e) => e <= n).map((e) => /* @__PURE__ */ (0, x.jsx)("text", {
890
- x: s(e),
891
- y: 110,
892
- textAnchor: "middle",
893
- children: o(e)
894
- }, e))
895
- ]
896
- })] }, e.name);
897
- })
898
- });
899
- }
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", {
902
- className: "row",
903
- title: a,
904
- children: [
905
- /* @__PURE__ */ (0, x.jsx)("span", {
906
- className: "l",
907
- children: e
908
- }),
909
- /* @__PURE__ */ (0, x.jsx)("span", {
910
- className: "track",
911
- children: /* @__PURE__ */ (0, x.jsx)("b", { style: { width: `${t / Math.max(1, n) * 100}%` } })
912
- }),
913
- /* @__PURE__ */ (0, x.jsxs)("span", {
914
- className: "n",
915
- children: [
916
- t,
917
- " ",
918
- /* @__PURE__ */ (0, x.jsxs)("small", { children: ["of ", i(n)] })
919
- ]
920
- })
921
- ]
922
- }, r);
923
- return /* @__PURE__ */ (0, x.jsxs)("section", {
924
- className: "rp-card w3",
925
- "aria-label": "Failed steps",
926
- children: [/* @__PURE__ */ (0, x.jsx)("div", {
927
- className: "rp-hd sm",
928
- children: /* @__PURE__ */ (0, x.jsx)("h3", { children: "Failed steps" })
929
- }), /* @__PURE__ */ (0, x.jsx)("div", {
930
- className: "rp-chart rp-fb",
931
- children: !n.length && !r.length ? /* @__PURE__ */ (0, x.jsx)("p", {
932
- className: "ws-status",
933
- children: "No step 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`))] })] })
935
- })]
936
- });
937
- }
938
- //#endregion
939
- export { S as Analytics };