@tangle-network/sandbox-cli 0.21.63 → 0.21.65

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 +31 -3
  2. package/SKILL.md +29 -1
  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 +10 -9
  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
@@ -0,0 +1,239 @@
1
+ import { i as e } from "./rolldown-runtime-DArdT4gl.js";
2
+ import { n as t, t as n } from "./jsx-runtime-DPT6sCLq.js";
3
+ import { t as r } from "./workflows--mZpHYqo.js";
4
+ import { D as i, S as a, a as o, b as s, c, h as l, l as u, m as d, n as f, o as p, s as m, u as h } from "./ui-Co03nZUX.js";
5
+ import { d as g } from "./react-DQ7E2Epi.js";
6
+ import { agentParam as _ } from "./RunPage-NtevWXBs.js";
7
+ //#region src/workspace/run/Topology.tsx
8
+ var v = /* @__PURE__ */ e(t(), 1), y = n();
9
+ function b(e) {
10
+ return e.agents.map((t) => {
11
+ let n = t.events;
12
+ return {
13
+ id: t.id,
14
+ label: t.name,
15
+ status: t.status,
16
+ model: t.model,
17
+ harness: t.harness,
18
+ costUsd: t.listUsd ?? t.billedUsd,
19
+ tokens: t.tokens,
20
+ commits: t.commits,
21
+ facts: l(e, t),
22
+ startedAt: Number.isFinite(Date.parse(t.node.start ?? "")) ? Date.parse(t.node.start) : void 0,
23
+ lastActivityAt: t.lastActivityAt,
24
+ medianEventGapMs: t.medianEventGapMs,
25
+ turn: t.node.turn,
26
+ events: n,
27
+ result: t.status === "failed" ? t.node.failureReason || `Failure cause not recorded${n.at(-1)?.label ? `. Last event: ${n.at(-1).label}` : ""}` : t.commits ? `${t.commits} commits shipped` : t.state.label
28
+ };
29
+ });
30
+ }
31
+ function x({ m: e, agent: t, selectAgent: n, route: i, doc: a }) {
32
+ let o = (0, v.useMemo)(() => b(e), [e]), s = (0, v.useMemo)(() => e.agents.flatMap((e) => e.parent ? [{
33
+ from: e.parent,
34
+ to: e.id,
35
+ kind: "spawn"
36
+ }] : []), [e]), [c, l] = (0, v.useState)(0), d = (e) => {
37
+ n(e), l((e) => e + 1);
38
+ }, f = t ?? e.root?.id ?? null, m = f ? e.byId.get(f) ?? null : null;
39
+ return /* @__PURE__ */ (0, y.jsxs)("div", {
40
+ className: "rp-topo",
41
+ children: [/* @__PURE__ */ (0, y.jsxs)("section", {
42
+ className: "rp-card",
43
+ "aria-label": "Spawn tree",
44
+ children: [/* @__PURE__ */ (0, y.jsxs)("div", {
45
+ className: "rp-hd rp-hd-tools",
46
+ children: [/* @__PURE__ */ (0, y.jsx)("h2", { children: "Agents" }), /* @__PURE__ */ (0, y.jsx)("span", {
47
+ className: "end",
48
+ children: /* @__PURE__ */ (0, y.jsx)(p, {
49
+ label: "Go to agent",
50
+ options: h(e),
51
+ groups: u(e),
52
+ value: f,
53
+ placeholder: `Search ${e.agents.length} agents`,
54
+ width: 340,
55
+ onChange: (e) => {
56
+ e && d(e);
57
+ },
58
+ children: /* @__PURE__ */ (0, y.jsx)("span", {
59
+ className: "dim",
60
+ children: "Go to agent"
61
+ })
62
+ })
63
+ })]
64
+ }), /* @__PURE__ */ (0, y.jsx)(r, {
65
+ renderEventIcon: (e) => g(e.label),
66
+ nodes: o,
67
+ edges: s,
68
+ selectedId: f,
69
+ onSelect: d,
70
+ live: e.live,
71
+ showLatestEvents: !1,
72
+ title: "Agents",
73
+ className: "rp-topo-graph"
74
+ })]
75
+ }), m && /* @__PURE__ */ (0, y.jsx)(S, {
76
+ m: e,
77
+ a: m,
78
+ reveal: i.params.has("agent"),
79
+ selection: c,
80
+ onSelect: d,
81
+ href: i.href("conversations", { agent: _(a.run.id, m.id) })
82
+ })]
83
+ });
84
+ }
85
+ function S({ m: e, a: t, reveal: n, selection: r, onSelect: l, href: u }) {
86
+ let p = (0, v.useRef)(null);
87
+ (0, v.useEffect)(() => {
88
+ n && matchMedia("(max-width: 720px)").matches && (p.current?.focus({ preventScroll: !0 }), p.current?.scrollIntoView({
89
+ block: "start",
90
+ behavior: "instant"
91
+ }));
92
+ }, [
93
+ t.id,
94
+ n,
95
+ r
96
+ ]);
97
+ let h = e.duration > 72e6 || new Date(e.t0).toISOString().slice(0, 10) !== new Date(e.t0 + e.duration).toISOString().slice(0, 10), g = (e) => Number.isFinite(Date.parse(e ?? "")) ? i(e, h) : "—", _ = Math.max(1, ...t.tools.map((e) => e.calls)), b = t.parent ? e.byId.get(t.parent) : null, x = [[
98
+ t.model ?? "model",
99
+ t.latency.p50,
100
+ t.latency.p90,
101
+ t.latency.p99,
102
+ t.modelCalls
103
+ ], ...t.tools.slice(0, 5).map((e) => [
104
+ e.name,
105
+ e.p50,
106
+ e.p90,
107
+ e.p99,
108
+ e.calls
109
+ ])];
110
+ return /* @__PURE__ */ (0, y.jsxs)("aside", {
111
+ ref: p,
112
+ tabIndex: -1,
113
+ className: "rp-card",
114
+ "aria-label": t.name,
115
+ style: { scrollMarginTop: "calc(var(--ar-sticky-top, 0px) + 44px)" },
116
+ children: [/* @__PURE__ */ (0, y.jsxs)("div", {
117
+ className: "rp-hd",
118
+ children: [/* @__PURE__ */ (0, y.jsxs)("h2", { children: [/* @__PURE__ */ (0, y.jsx)(m, { tone: t.state.tone }), t.name] }), /* @__PURE__ */ (0, y.jsx)("span", {
119
+ className: "end",
120
+ children: /* @__PURE__ */ (0, y.jsx)("span", {
121
+ className: `rp-pill ${t.state.tone}`,
122
+ children: t.state.label
123
+ })
124
+ })]
125
+ }), /* @__PURE__ */ (0, y.jsxs)("div", {
126
+ className: "rp-scroll rp-tinsp",
127
+ children: [
128
+ /* @__PURE__ */ (0, y.jsxs)("dl", {
129
+ className: "rp-kv",
130
+ children: [
131
+ t.status === "failed" && /* @__PURE__ */ (0, y.jsxs)(y.Fragment, { children: [/* @__PURE__ */ (0, y.jsx)("dt", { children: "Failure" }), /* @__PURE__ */ (0, y.jsx)("dd", {
132
+ className: "f",
133
+ children: t.node.failureReason || "Cause not recorded"
134
+ })] }),
135
+ t.status === "needs-you" && /* @__PURE__ */ (0, y.jsxs)(y.Fragment, { children: [/* @__PURE__ */ (0, y.jsx)("dt", { children: "Request" }), /* @__PURE__ */ (0, y.jsx)("dd", { children: t.node.turn || "Request not recorded" })] }),
136
+ /* @__PURE__ */ (0, y.jsx)("dt", { children: "Model" }),
137
+ /* @__PURE__ */ (0, y.jsx)("dd", { children: [t.model, t.harness].filter(Boolean).join(" · ") || "—" }),
138
+ /* @__PURE__ */ (0, y.jsx)("dt", { children: "Spawned" }),
139
+ /* @__PURE__ */ (0, y.jsxs)("dd", { children: [b ? `by ${b.name} · ` : "", g(t.node.start)] }),
140
+ /* @__PURE__ */ (0, y.jsx)("dt", { children: "Ended" }),
141
+ /* @__PURE__ */ (0, y.jsx)("dd", { children: g(t.node.end) }),
142
+ /* @__PURE__ */ (0, y.jsx)("dt", { children: "Cost" }),
143
+ /* @__PURE__ */ (0, y.jsx)("dd", { children: c(t) })
144
+ ]
145
+ }),
146
+ /* @__PURE__ */ (0, y.jsx)("div", {
147
+ className: "rp-stat3",
148
+ children: [
149
+ [d(t.tokens), "tokens"],
150
+ [s(t.modelCalls), t.modelCalls === 1 ? "model call" : "model calls"],
151
+ [s(t.toolCalls), t.toolCalls === 1 ? "tool call" : "tool calls"],
152
+ [String(t.failedSteps), t.failedSteps === 1 ? "failed step" : "failed steps"],
153
+ [String(t.restarts.length), t.restarts.length === 1 ? "restart" : "restarts"],
154
+ [t.commits === null ? "—" : String(t.commits), t.commits === 1 ? "commit" : "commits"]
155
+ ].map(([e, t]) => /* @__PURE__ */ (0, y.jsxs)("div", { children: [/* @__PURE__ */ (0, y.jsx)("b", { children: e }), /* @__PURE__ */ (0, y.jsx)("span", { children: t })] }, t))
156
+ }),
157
+ (t.modelCalls ?? 0) > 0 && /* @__PURE__ */ (0, y.jsxs)(y.Fragment, { children: [/* @__PURE__ */ (0, y.jsx)("h5", {
158
+ className: "rp-subh",
159
+ children: "Latency"
160
+ }), /* @__PURE__ */ (0, y.jsxs)("table", {
161
+ className: "rp-lt",
162
+ children: [/* @__PURE__ */ (0, y.jsx)("thead", { children: /* @__PURE__ */ (0, y.jsxs)("tr", { children: [
163
+ /* @__PURE__ */ (0, y.jsx)("th", {}),
164
+ /* @__PURE__ */ (0, y.jsx)("th", { children: "calls" }),
165
+ /* @__PURE__ */ (0, y.jsx)("th", { children: "p50" }),
166
+ /* @__PURE__ */ (0, y.jsx)("th", { children: "p90" }),
167
+ /* @__PURE__ */ (0, y.jsx)("th", { children: "p99" })
168
+ ] }) }), /* @__PURE__ */ (0, y.jsx)("tbody", { children: x.map(([e, t, n, r, i]) => /* @__PURE__ */ (0, y.jsxs)("tr", { children: [
169
+ /* @__PURE__ */ (0, y.jsx)("td", {
170
+ title: e,
171
+ children: e
172
+ }),
173
+ /* @__PURE__ */ (0, y.jsx)("td", { children: s(i) }),
174
+ /* @__PURE__ */ (0, y.jsx)("td", { children: a(t) }),
175
+ /* @__PURE__ */ (0, y.jsx)("td", { children: a(n) }),
176
+ /* @__PURE__ */ (0, y.jsx)("td", { children: a(r) })
177
+ ] }, e)) })]
178
+ })] }),
179
+ t.tools.length > 0 && /* @__PURE__ */ (0, y.jsxs)(y.Fragment, { children: [/* @__PURE__ */ (0, y.jsx)("h5", {
180
+ className: "rp-subh",
181
+ children: "Tool calls"
182
+ }), /* @__PURE__ */ (0, y.jsx)("div", {
183
+ className: "rp-tbars four",
184
+ children: t.tools.slice(0, 8).map((e) => /* @__PURE__ */ (0, y.jsxs)("div", {
185
+ className: "row",
186
+ children: [
187
+ /* @__PURE__ */ (0, y.jsx)("span", {
188
+ className: "l",
189
+ title: e.name,
190
+ children: e.name
191
+ }),
192
+ /* @__PURE__ */ (0, y.jsx)(f, {
193
+ ok: e.calls - e.failures,
194
+ failed: e.failures,
195
+ max: _
196
+ }),
197
+ /* @__PURE__ */ (0, y.jsx)("span", {
198
+ className: "n",
199
+ children: s(e.calls)
200
+ }),
201
+ /* @__PURE__ */ (0, y.jsx)("span", {
202
+ className: "n f",
203
+ children: e.failures ? `${e.failures} ✕` : ""
204
+ })
205
+ ]
206
+ }, e.name))
207
+ })] }),
208
+ t.children.length > 0 && /* @__PURE__ */ (0, y.jsxs)(y.Fragment, { children: [/* @__PURE__ */ (0, y.jsxs)("h5", {
209
+ className: "rp-subh",
210
+ children: ["Spawned · ", t.children.length]
211
+ }), /* @__PURE__ */ (0, y.jsxs)("div", {
212
+ className: "rp-chips",
213
+ children: [t.children.slice(0, 14).map((t) => {
214
+ let n = e.byId.get(t);
215
+ return /* @__PURE__ */ (0, y.jsxs)("button", {
216
+ type: "button",
217
+ className: "rp-chip",
218
+ onClick: () => l(t),
219
+ children: [/* @__PURE__ */ (0, y.jsx)(m, { tone: n.state.tone }), n.name]
220
+ }, t);
221
+ }), t.children.length > 14 && /* @__PURE__ */ (0, y.jsxs)("span", {
222
+ className: "rp-chip dim",
223
+ children: [t.children.length - 14, " more"]
224
+ })]
225
+ })] }),
226
+ /* @__PURE__ */ (0, y.jsx)("p", { children: /* @__PURE__ */ (0, y.jsxs)("a", {
227
+ className: "rp-btn sm framed",
228
+ href: u,
229
+ children: ["Conversation", /* @__PURE__ */ (0, y.jsx)(o, {
230
+ name: "arrow",
231
+ size: 14
232
+ })]
233
+ }) })
234
+ ]
235
+ })]
236
+ });
237
+ }
238
+ //#endregion
239
+ export { x as Topology, b as graphNodes };
@@ -0,0 +1,254 @@
1
+ import { i as e } from "./rolldown-runtime-DArdT4gl.js";
2
+ import { n as t, t as n } from "./jsx-runtime-DPT6sCLq.js";
3
+ import { t as r } from "./segmented-control-Di1mbQlP.js";
4
+ import { O as i, S as a, b as o, c as s, l as c, m as l, o as u, p as d, u as f, y as p } from "./ui-Co03nZUX.js";
5
+ import { agentParam as m } from "./RunPage-NtevWXBs.js";
6
+ //#region src/workspace/run/Traces.tsx
7
+ var h = /* @__PURE__ */ e(t(), 1), g = n(), _ = 34;
8
+ function v({ m: e, doc: t, agent: n, route: v }) {
9
+ let y = v.params.get("agent") ? n : null, [b, x] = (0, h.useState)("all"), [S, C] = (0, h.useState)(0), w = (0, h.useMemo)(() => e.steps.filter((e) => !y || e.agent.id === y), [e, y]), T = (0, h.useMemo)(() => ({
10
+ all: w.length,
11
+ model: w.filter((e) => e.step.kind === "model").length,
12
+ tool: w.filter((e) => e.step.kind === "tool").length,
13
+ failed: w.filter((e) => e.step.failed).length
14
+ }), [w]), E = (0, h.useMemo)(() => w.filter(({ step: e }) => b === "all" || (b === "failed" ? e.failed : e.kind === b)), [w, b]), D = (0, h.useMemo)(() => Math.log10(Math.max(10, ...E.map((e) => e.step.d))), [E]), O = (0, h.useRef)(null), k = d(O, E.length, _, 8);
15
+ (0, h.useEffect)(() => {
16
+ C(0), O.current && (O.current.scrollTop = 0);
17
+ }, [b, y]);
18
+ let A = p(e.t0), j = (e, t = !1) => {
19
+ let n = Math.max(0, Math.min(E.length - 1, e));
20
+ C(n);
21
+ let r = O.current;
22
+ if (r && t) {
23
+ let e = n * _;
24
+ e < r.scrollTop ? r.scrollTop = e : e + _ + 36 > r.scrollTop + r.clientHeight && (r.scrollTop = e + _ + 36 - r.clientHeight), requestAnimationFrame(() => r.querySelector(`[data-i="${n}"]`)?.focus());
25
+ }
26
+ }, M = (e) => {
27
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), j(S + (e.key === "ArrowDown" ? 1 : -1), !0));
28
+ }, N = E[S], P = f(e, (e) => e.steps.length > 0, (e) => `${o(e.steps.length)} steps`);
29
+ return /* @__PURE__ */ (0, g.jsxs)("section", {
30
+ className: "rp-card rp-traces",
31
+ "aria-label": "Traces",
32
+ children: [/* @__PURE__ */ (0, g.jsxs)("div", {
33
+ className: "rp-hd rp-hd-tools",
34
+ style: { paddingLeft: 8 },
35
+ children: [/* @__PURE__ */ (0, g.jsx)(u, {
36
+ label: "Agent",
37
+ options: P,
38
+ groups: c(e),
39
+ all: {
40
+ label: "All agents",
41
+ meta: `${o(e.totals.steps)} steps`
42
+ },
43
+ value: y,
44
+ width: 340,
45
+ placeholder: `Search ${P.length} agents`,
46
+ style: { width: 260 },
47
+ onChange: (e) => v.go("traces", { agent: e ? m(t.run.id, e) : null }),
48
+ children: y ? e.byId.get(y)?.name : "All agents"
49
+ }), /* @__PURE__ */ (0, g.jsx)(r, {
50
+ "aria-label": "Kind",
51
+ value: b,
52
+ onValueChange: x,
53
+ options: [
54
+ "all",
55
+ "model",
56
+ "tool",
57
+ "failed"
58
+ ].map((e) => ({
59
+ value: e,
60
+ label: e === "all" ? "All" : e[0].toUpperCase() + e.slice(1),
61
+ adornment: /* @__PURE__ */ (0, g.jsx)("span", {
62
+ className: "ct",
63
+ children: o(T[e])
64
+ })
65
+ }))
66
+ })]
67
+ }), /* @__PURE__ */ (0, g.jsxs)("div", {
68
+ className: "rp-trw",
69
+ children: [/* @__PURE__ */ (0, g.jsxs)("div", {
70
+ className: "rp-tbl",
71
+ ref: O,
72
+ role: "grid",
73
+ "aria-label": "Spans",
74
+ "aria-rowcount": E.length,
75
+ onKeyDown: M,
76
+ children: [
77
+ /* @__PURE__ */ (0, g.jsxs)("div", {
78
+ className: "rp-tr th",
79
+ role: "row",
80
+ children: [
81
+ /* @__PURE__ */ (0, g.jsxs)("span", {
82
+ role: "columnheader",
83
+ children: ["Start", /* @__PURE__ */ (0, g.jsx)("span", {
84
+ className: "ph-hide",
85
+ children: " (UTC)"
86
+ })]
87
+ }),
88
+ /* @__PURE__ */ (0, g.jsx)("span", {
89
+ role: "columnheader",
90
+ children: "Agent"
91
+ }),
92
+ /* @__PURE__ */ (0, g.jsx)("span", {
93
+ role: "columnheader",
94
+ children: "Kind"
95
+ }),
96
+ /* @__PURE__ */ (0, g.jsx)("span", {
97
+ role: "columnheader",
98
+ children: "Name"
99
+ }),
100
+ /* @__PURE__ */ (0, g.jsx)("span", {
101
+ role: "columnheader",
102
+ className: "r",
103
+ children: "Duration"
104
+ }),
105
+ /* @__PURE__ */ (0, g.jsx)("span", {
106
+ role: "columnheader",
107
+ className: "sr",
108
+ children: "Status"
109
+ })
110
+ ]
111
+ }),
112
+ /* @__PURE__ */ (0, g.jsx)("div", { style: { height: k.before } }),
113
+ E.slice(k.first, k.last).map(({ agent: e, step: t }, n) => {
114
+ let r = k.first + n;
115
+ return /* @__PURE__ */ (0, g.jsxs)("div", {
116
+ "data-i": r,
117
+ className: `rp-tr${t.failed ? " failed" : ""}`,
118
+ role: "row",
119
+ "aria-selected": r === S,
120
+ tabIndex: r === S ? 0 : -1,
121
+ onClick: () => j(r),
122
+ children: [
123
+ /* @__PURE__ */ (0, g.jsx)("span", {
124
+ className: "m",
125
+ children: A(t.t)
126
+ }),
127
+ /* @__PURE__ */ (0, g.jsx)("span", {
128
+ title: e.name,
129
+ children: e.name
130
+ }),
131
+ /* @__PURE__ */ (0, g.jsxs)("span", {
132
+ className: "kind",
133
+ children: [/* @__PURE__ */ (0, g.jsx)("i", { className: t.kind }), t.kind]
134
+ }),
135
+ /* @__PURE__ */ (0, g.jsx)("span", {
136
+ className: "m nm",
137
+ title: t.kind === "tool" ? `${t.tool}${t.target ? ` ${t.target}` : ""}` : void 0,
138
+ children: t.kind === "model" ? t.model?.split("/").pop() ?? e.model ?? "model" : t.kind === "tool" ? /* @__PURE__ */ (0, g.jsxs)(g.Fragment, { children: [t.tool, t.target && /* @__PURE__ */ (0, g.jsxs)("span", {
139
+ className: "muted",
140
+ children: [" ", t.target]
141
+ })] }) : /* @__PURE__ */ (0, g.jsx)("span", {
142
+ className: "muted",
143
+ children: "waiting on a spawned agent"
144
+ })
145
+ }),
146
+ /* @__PURE__ */ (0, g.jsxs)("span", {
147
+ className: "m r dur",
148
+ children: [/* @__PURE__ */ (0, g.jsx)("b", { style: { width: Math.max(2, Math.log10(Math.max(t.d, 1)) / D * 56) } }), a(t.d)]
149
+ }),
150
+ /* @__PURE__ */ (0, g.jsx)("span", {
151
+ className: "st",
152
+ children: t.failed ? /* @__PURE__ */ (0, g.jsx)("span", {
153
+ className: "f",
154
+ title: "failed",
155
+ "aria-label": "failed",
156
+ children: "✕"
157
+ }) : null
158
+ })
159
+ ]
160
+ }, r);
161
+ }),
162
+ /* @__PURE__ */ (0, g.jsx)("div", { style: { height: k.after } })
163
+ ]
164
+ }), /* @__PURE__ */ (0, g.jsx)("aside", {
165
+ className: "rp-trd",
166
+ "aria-label": "Span",
167
+ children: /* @__PURE__ */ (0, g.jsx)("div", {
168
+ className: "rp-scroll",
169
+ children: N ? /* @__PURE__ */ (0, g.jsxs)(g.Fragment, { children: [
170
+ /* @__PURE__ */ (0, g.jsxs)("dl", {
171
+ className: "rp-kv",
172
+ children: [
173
+ /* @__PURE__ */ (0, g.jsx)("dt", { children: "Agent" }),
174
+ /* @__PURE__ */ (0, g.jsx)("dd", { children: N.agent.name }),
175
+ /* @__PURE__ */ (0, g.jsx)("dt", { children: N.step.kind === "tool" ? "Tool" : N.step.kind === "model" ? "Model" : "Kind" }),
176
+ /* @__PURE__ */ (0, g.jsx)("dd", { children: N.step.kind === "tool" ? `${N.step.tool ?? "tool"}${N.step.target ? ` ${N.step.target}` : ""}` : N.step.kind === "model" ? N.step.model ?? N.agent.node.model ?? "model" : "waiting on a spawned agent" }),
177
+ /* @__PURE__ */ (0, g.jsx)("dt", { children: "Started" }),
178
+ /* @__PURE__ */ (0, g.jsxs)("dd", { children: [new Date(e.t0 + N.step.t).toISOString().slice(0, 19).replace("T", " "), " UTC"] }),
179
+ /* @__PURE__ */ (0, g.jsx)("dt", { children: "Duration" }),
180
+ /* @__PURE__ */ (0, g.jsxs)("dd", { children: [a(N.step.d), N.step.latency === null ? "" : ` · first token ${a(N.step.latency)}`] }),
181
+ N.step.tokens && /* @__PURE__ */ (0, g.jsxs)(g.Fragment, { children: [/* @__PURE__ */ (0, g.jsx)("dt", { children: "Tokens" }), /* @__PURE__ */ (0, g.jsxs)("dd", { children: [
182
+ l(N.step.tokens.input),
183
+ " in · ",
184
+ l(N.step.tokens.output),
185
+ " out · ",
186
+ l(N.step.tokens.cacheRead),
187
+ " cached"
188
+ ] })] }),
189
+ N.step.usd !== null && /* @__PURE__ */ (0, g.jsxs)(g.Fragment, { children: [/* @__PURE__ */ (0, g.jsx)("dt", { children: "Billed" }), /* @__PURE__ */ (0, g.jsx)("dd", { children: i(N.step.usd) })] }),
190
+ N.step.failed && /* @__PURE__ */ (0, g.jsxs)(g.Fragment, { children: [/* @__PURE__ */ (0, g.jsx)("dt", { children: "Status" }), /* @__PURE__ */ (0, g.jsx)("dd", { children: /* @__PURE__ */ (0, g.jsx)("span", {
191
+ className: "f",
192
+ children: "✕ failed"
193
+ }) })] })
194
+ ]
195
+ }),
196
+ /* @__PURE__ */ (0, g.jsxs)("h5", {
197
+ className: "rp-subh",
198
+ children: [N.agent.name, ", whole run"]
199
+ }),
200
+ /* @__PURE__ */ (0, g.jsxs)("dl", {
201
+ className: "rp-kv",
202
+ children: [
203
+ /* @__PURE__ */ (0, g.jsx)("dt", { children: "Tokens" }),
204
+ /* @__PURE__ */ (0, g.jsxs)("dd", { children: [l(N.agent.tokens), N.agent.byClass ? ` · ${l(N.agent.byClass.input)} in · ${l(N.agent.byClass.output)} out · ${l(N.agent.byClass.cacheRead)} cached` : ""] }),
205
+ /* @__PURE__ */ (0, g.jsx)("dt", { children: "Cost" }),
206
+ /* @__PURE__ */ (0, g.jsx)("dd", { children: s(N.agent) }),
207
+ /* @__PURE__ */ (0, g.jsx)("dt", { children: "Model calls" }),
208
+ /* @__PURE__ */ (0, g.jsxs)("dd", { children: [
209
+ o(N.agent.modelCalls),
210
+ " · p50 ",
211
+ a(N.agent.latency.p50),
212
+ " · p99 ",
213
+ a(N.agent.latency.p99)
214
+ ] }),
215
+ /* @__PURE__ */ (0, g.jsx)("dt", { children: "Tool calls" }),
216
+ /* @__PURE__ */ (0, g.jsxs)("dd", { children: [
217
+ o(N.agent.toolCalls),
218
+ " · ",
219
+ N.agent.toolFailures,
220
+ " failed"
221
+ ] }),
222
+ /* @__PURE__ */ (0, g.jsx)("dt", { children: "Restarts" }),
223
+ /* @__PURE__ */ (0, g.jsx)("dd", { children: N.agent.restarts.length })
224
+ ]
225
+ }),
226
+ /* @__PURE__ */ (0, g.jsxs)("details", {
227
+ className: "rp-raw",
228
+ children: [/* @__PURE__ */ (0, g.jsx)("summary", { children: "Raw span" }), /* @__PURE__ */ (0, g.jsx)("pre", {
229
+ className: "rp-json",
230
+ children: JSON.stringify({
231
+ agent: N.agent.name,
232
+ kind: N.step.kind,
233
+ ...N.step.kind === "tool" ? { tool: N.step.tool } : N.step.kind === "model" ? { model: N.step.model ?? N.agent.node.model } : {},
234
+ ...N.step.target ? { target: N.step.target } : {},
235
+ startedAt: new Date(e.t0 + N.step.t).toISOString(),
236
+ durationMs: N.step.d,
237
+ failed: N.step.failed,
238
+ ...N.step.latency === null ? {} : { latencyMs: N.step.latency },
239
+ tokens: N.step.tokens,
240
+ ...N.step.usd === null ? {} : { billedUsd: N.step.usd }
241
+ }, null, 2)
242
+ })]
243
+ })
244
+ ] }) : /* @__PURE__ */ (0, g.jsx)("p", {
245
+ className: "ws-status",
246
+ children: "No span matches."
247
+ })
248
+ })
249
+ })]
250
+ })]
251
+ });
252
+ }
253
+ //#endregion
254
+ export { v as Traces };
@@ -1,9 +1,9 @@
1
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 "./page-header-Brq611fd.js";
4
- import { p as i } from "./data-CkWfWr7i.js";
5
- import { c as a, l as o, u as s } from "./react-CY3IbSNO.js";
6
- import { n as c, r as l, s as u, t as d } from "./AnswerStrip-CGUyXuYH.js";
2
+ import { n as t, t as n } from "./jsx-runtime-DPT6sCLq.js";
3
+ import { t as r } from "./page-header-QbUg8F8i.js";
4
+ import { p as i } from "./data-CVHeKhrh.js";
5
+ import { c as a, l as o, u as s } from "./react-DQ7E2Epi.js";
6
+ import { n as c, r as l, s as u, t as d } from "./AnswerStrip-B7xMU57A.js";
7
7
  //#region src/workspace/WallPages.tsx
8
8
  var f = /* @__PURE__ */ e(t(), 1), p = n(), m = {
9
9
  ok: "var(--ar-c-ok)",
@@ -97,19 +97,19 @@ function C({ h: e }) {
97
97
  used: e.load1,
98
98
  total: e.loadLimit,
99
99
  text: "",
100
- tone: t ? m.breach : "var(--ws-accent)"
100
+ tone: t ? m.breach : e.load1 !== null && e.loadLimit !== null && e.load1 >= e.loadLimit ? m.warn : "var(--wp-ink)"
101
101
  })]
102
102
  }),
103
103
  /* @__PURE__ */ (0, p.jsx)(S, { h: e }),
104
- e.breaches.length > 0 && /* @__PURE__ */ (0, p.jsx)("ul", {
105
- className: "wp-over",
106
- children: e.breaches.map((e) => /* @__PURE__ */ (0, p.jsx)("li", {
107
- "data-alarm": e.alarm || void 0,
108
- children: /* @__PURE__ */ (0, p.jsx)(c, {
109
- text: `${e.text} (${e.limit}${e.held ? `; ${e.held}` : ""})`,
110
- children: e.alarm && e.held ? `${e.label.replace(/\s*\/\s*$/, "")}: ${e.held}` : e.label
111
- })
112
- }, e.label))
104
+ e.breaches.filter((e) => e.alarm).map((e) => /* @__PURE__ */ (0, p.jsxs)(c, {
105
+ className: "wp-alarm",
106
+ text: `${e.text} (${e.limit}${e.held ? `; ${e.held}` : ""})`,
107
+ children: [/* @__PURE__ */ (0, p.jsx)("b", { children: e.label.replace(/\s*\/\s*$/, "") }), e.held ? ` ${e.held}` : ` ${e.text}`]
108
+ }, e.label)),
109
+ e.breaches.some((e) => !e.alarm) && /* @__PURE__ */ (0, p.jsxs)(c, {
110
+ className: "wp-watch",
111
+ text: e.breaches.filter((e) => !e.alarm).map((e) => `${e.label}: ${e.text} (${e.limit})`).join("; "),
112
+ children: ["Watching: ", e.breaches.filter((e) => !e.alarm).map((e) => e.label).join(", ")]
113
113
  })
114
114
  ]
115
115
  });
@@ -218,20 +218,28 @@ function E({ doc: e }) {
218
218
  l ? `, first back ${u(l, Date.now())}` : ""
219
219
  ]
220
220
  })] }),
221
- o.length > 0 && /* @__PURE__ */ (0, p.jsx)("ul", {
222
- className: "wp-back",
223
- children: o.map((e) => /* @__PURE__ */ (0, p.jsxs)("li", { children: [/* @__PURE__ */ (0, p.jsxs)("span", { children: [
224
- e.provider.toLowerCase(),
225
- " ",
226
- e.name
227
- ] }), /* @__PURE__ */ (0, p.jsxs)("span", {
228
- className: "wp-muted",
229
- children: [
230
- e.long.label ? `${e.long.label} · ` : "",
231
- "back ",
232
- e.back ? u(e.back, Date.now()) : "—"
233
- ]
234
- })] }, `${e.provider} ${e.name}`))
221
+ [...new Set(o.map((e) => e.provider))].map((e) => {
222
+ let t = o.filter((t) => t.provider === e), n = t.map((e) => e.back).filter((e) => !!e).sort()[0];
223
+ return /* @__PURE__ */ (0, p.jsxs)("details", {
224
+ className: "wp-group wp-seats",
225
+ children: [/* @__PURE__ */ (0, p.jsxs)("summary", { children: [
226
+ /* @__PURE__ */ (0, p.jsx)("b", { children: e[0].toUpperCase() + e.slice(1).toLowerCase() }),
227
+ " ",
228
+ t.length,
229
+ " at a limit",
230
+ n ? `, first back ${u(n, Date.now())}` : ""
231
+ ] }), /* @__PURE__ */ (0, p.jsx)("ul", {
232
+ className: "wp-back",
233
+ children: t.map((e) => /* @__PURE__ */ (0, p.jsxs)("li", { children: [/* @__PURE__ */ (0, p.jsx)("span", { children: e.name }), /* @__PURE__ */ (0, p.jsxs)("span", {
234
+ className: "wp-muted",
235
+ children: [
236
+ e.long.label ? `${e.long.label} · ` : "",
237
+ "back ",
238
+ e.back ? u(e.back, Date.now()) : "—"
239
+ ]
240
+ })] }, e.name))
241
+ })]
242
+ }, e);
235
243
  }),
236
244
  c.length > 0 && /* @__PURE__ */ (0, p.jsxs)("details", {
237
245
  className: "wp-group",
@@ -246,9 +254,19 @@ function E({ doc: e }) {
246
254
  }))
247
255
  })]
248
256
  }),
249
- i.length > 0 && /* @__PURE__ */ (0, p.jsxs)("p", {
250
- className: "wp-muted wp-line",
251
- children: ["Not reported: ", i.map((e) => `${e.provider.toLowerCase()} ${e.name}${e.long.why ? ` (${e.long.why})` : ""}`).join(", ")]
257
+ i.length > 0 && /* @__PURE__ */ (0, p.jsxs)("details", {
258
+ className: "wp-group",
259
+ children: [/* @__PURE__ */ (0, p.jsxs)("summary", { children: [i.length, " not reported"] }), /* @__PURE__ */ (0, p.jsx)("ul", {
260
+ className: "wp-back",
261
+ children: i.map((e) => /* @__PURE__ */ (0, p.jsxs)("li", { children: [/* @__PURE__ */ (0, p.jsxs)("span", { children: [
262
+ e.provider.toLowerCase(),
263
+ " ",
264
+ e.name
265
+ ] }), /* @__PURE__ */ (0, p.jsx)("span", {
266
+ className: "wp-muted",
267
+ children: e.long.why ?? "no reading"
268
+ })] }, `${e.provider} ${e.name}`))
269
+ })]
252
270
  })
253
271
  ]
254
272
  })]