@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.
- package/README.md +32 -4
- package/SKILL.md +37 -5
- package/dist/graph-native-CS_TmaCK.mjs +1 -0
- package/dist/graph-viewer/Analytics-bWsqhurt.js +1001 -0
- package/dist/graph-viewer/{AnswerStrip-DhwqOyxI.js → AnswerStrip-COxV7gLW.js} +2 -2
- package/dist/graph-viewer/Checks-CQGmKcQ0.js +164 -0
- package/dist/graph-viewer/Conversations-DgCshBAf.js +627 -0
- package/dist/graph-viewer/{Files-DtZhf0ii.js → Files-CvIOGrAs.js} +81 -90
- package/dist/graph-viewer/LiveRun-DHmsr6F7.js +311 -0
- package/dist/graph-viewer/{Outputs-QET3nPPp.js → Outputs-rwBg_x36.js} +4 -4
- package/dist/graph-viewer/Overview-C150tkVa.js +194 -0
- package/dist/graph-viewer/{RunOverview-DJQDAMIx.js → RunOverview-CSqsunqf.js} +2 -2
- package/dist/graph-viewer/RunPage-F_prVwiV.js +286 -0
- package/dist/graph-viewer/Timeline-BFDywlmz.js +335 -0
- package/dist/graph-viewer/Today-BdDuqZGF.js +623 -0
- package/dist/graph-viewer/Topology-SAfGtd5u.js +238 -0
- package/dist/graph-viewer/Traces-BYqXaS_s.js +254 -0
- package/dist/graph-viewer/{WallPages-4d9QUZDq.js → WallPages-MM70VZrC.js} +48 -30
- package/dist/graph-viewer/agent-runtime.js +55 -55
- package/dist/graph-viewer/{data-BJmP7F1M.js → data-DTGmre1W.js} +31 -27
- package/dist/graph-viewer/harness-sessions.js +1 -1
- package/dist/graph-viewer/index.js +1357 -1392
- package/dist/graph-viewer/{lazy-pages-DM0cZM10.js → lazy-pages-BYuq_L_n.js} +9 -5
- package/dist/graph-viewer/{outputs-model-CGdvjkQh.js → outputs-model-CHTx8rMz.js} +2 -2
- package/dist/graph-viewer/{viewer/plain-words-CgvxtEOa.js → plain-words-BrMHl0On.js} +9 -4
- package/dist/graph-viewer/receipt.js +2 -2
- package/dist/graph-viewer/record-CsP_3NJS.js +612 -0
- package/dist/graph-viewer/record-part-CuT9Xw37.js +334 -0
- package/dist/graph-viewer/record.js +2 -336
- package/dist/graph-viewer/report-viewer.js +65 -65
- package/dist/graph-viewer/report.js +1 -1
- package/dist/graph-viewer/research-publication.js +1 -1
- package/dist/graph-viewer/{run-files-C1NgzM0l.js → run-files-BckQDdTD.js} +1 -1
- package/dist/graph-viewer/{run-receipt-Bvi4-KVM.js → run-receipt-Bt2iXJUy.js} +1 -0
- package/dist/graph-viewer/schemas/agent-workspace.play.v1.json +3 -0
- package/dist/graph-viewer/schemas/agent-workspace.plays.v1.json +2 -0
- package/dist/graph-viewer/schemas/agent-workspace.run.v1.json +1 -0
- package/dist/graph-viewer/styles.css +4559 -2385
- package/dist/graph-viewer/trace-spans.js +1 -1
- package/dist/graph-viewer/ui-xa5w5bEN.js +889 -0
- package/dist/graph-viewer/viewer/{AgentGraphCanvas-CMdOlSlh-4EervjeC.js → AgentGraphCanvas-B74GN1o6-BZEumF7-.js} +2610 -2707
- package/dist/graph-viewer/viewer/Analytics-E3XS570U.js +1002 -0
- package/dist/graph-viewer/viewer/{AnswerStrip-CGUyXuYH.js → AnswerStrip-B7xMU57A.js} +2 -2
- package/dist/graph-viewer/viewer/Checks-CJ5XSHbv.js +165 -0
- package/dist/graph-viewer/viewer/Conversations-AX8G7Qyl.js +904 -0
- package/dist/graph-viewer/viewer/Files-DxL1576V.js +630 -0
- package/dist/graph-viewer/viewer/LiveRun-B-BckyEj.js +820 -0
- package/dist/graph-viewer/viewer/{Outputs-CumGyjQo.js → Outputs-BoIpgfMv.js} +24 -23
- package/dist/graph-viewer/viewer/Overview-Dzg5XJgy.js +436 -0
- package/dist/graph-viewer/viewer/RunPage-NtevWXBs.js +285 -0
- package/dist/graph-viewer/viewer/{Scores-ZS16yk0n.js → Scores-Dgv4WePL.js} +3 -3
- package/dist/graph-viewer/viewer/Timeline-CzY3LVDu.js +335 -0
- package/dist/graph-viewer/viewer/Today-Bi9IIwuh.js +623 -0
- package/dist/graph-viewer/viewer/Topology-CzjqSFXH.js +239 -0
- package/dist/graph-viewer/viewer/Traces-CMX0H1VU.js +254 -0
- package/dist/graph-viewer/viewer/{WallPages-CzWpyIfp.js → WallPages-Clj4bORg.js} +50 -32
- package/dist/graph-viewer/viewer/addon-webgl-BSCscllv.js +4027 -0
- package/dist/graph-viewer/viewer/agent-record-BrP-ENHg.css +2 -0
- package/dist/graph-viewer/viewer/{bot-D6Nrej7Z.js → bot-BaQU59LG.js} +1 -1
- package/dist/graph-viewer/viewer/{chevron-right-D_5IKLxu.js → chevron-right-Xn05jYLT.js} +1 -1
- package/dist/graph-viewer/viewer/{createLucideIcon-yH0cxLMy.js → createLucideIcon-BSphcoOJ.js} +1 -1
- package/dist/graph-viewer/viewer/dashboard-D3JhmRhe-DSl0zhkw.js +371 -0
- package/dist/graph-viewer/viewer/{data-CkWfWr7i.js → data-CVHeKhrh.js} +144 -139
- package/dist/graph-viewer/viewer/dist-4_KJz8ZM.js +349 -0
- package/dist/graph-viewer/viewer/dist-Dy-wrdTt.js +1615 -0
- package/dist/graph-viewer/viewer/es2015-utW4DTOJ.js +3506 -0
- package/dist/graph-viewer/viewer/{final-output-kwY11u9X.js → final-output-BYT-g-9j.js} +1 -1
- package/dist/graph-viewer/viewer/flow-waterfall-model-DvrgPLGS-BdThSFH-.js +2696 -0
- package/dist/graph-viewer/viewer/git-branch-BzTbIcYL.js +28 -0
- package/dist/graph-viewer/viewer/{highlights-Btsi5OXl.js → highlights-DWeSCtiR.js} +4 -4
- package/dist/graph-viewer/viewer/jsx-runtime-DPT6sCLq.js +319 -0
- package/dist/graph-viewer/viewer/lazy-pages-ChiMJ8r_.js +803 -0
- package/dist/graph-viewer/viewer/{markdown-CX_sVrXB.js → markdown-lADwhD7y.js} +2324 -2608
- package/dist/graph-viewer/viewer/model-brand-bTcMjQtB-RSb7EbGB.js +476 -0
- package/dist/graph-viewer/viewer/{page-header-Brq611fd.js → page-header-QbUg8F8i.js} +12 -11
- package/dist/graph-viewer/{plain-words-CgvxtEOa.js → viewer/plain-words-BrMHl0On.js} +9 -4
- package/dist/graph-viewer/viewer/primitives-znfPK9NP-B6UO7uDr.js +346 -0
- package/dist/graph-viewer/viewer/react-DQ7E2Epi.js +4254 -0
- package/dist/graph-viewer/viewer/{react-dom-t1L4_-il.js → react-dom-BEusmvQH.js} +1 -1
- package/dist/graph-viewer/viewer/record-DZnT6SWN-H-ul3U3a.js +3523 -0
- package/dist/graph-viewer/viewer/record-W39D5MO-.js +1 -0
- package/dist/graph-viewer/viewer/record-part-CbweyYoV.js +335 -0
- package/dist/graph-viewer/viewer/{segmented-control-BaJmvTNd.js → segmented-control-Di1mbQlP.js} +27 -26
- package/dist/graph-viewer/viewer/{shiki-Qnby7Sh6.js → shiki-BfNNlmfZ.js} +15 -15
- package/dist/graph-viewer/viewer/status-meta-S0kV_RDp.js +273 -0
- package/dist/graph-viewer/viewer/{stream-tokenizer-CWtnjmRd.js → stream-tokenizer-B5wWaM3U.js} +12 -12
- package/dist/graph-viewer/viewer/{themes-1i1fzpRk.js → themes-DuRxHiga.js} +1 -1
- package/dist/graph-viewer/viewer/ui-Co03nZUX.js +889 -0
- package/dist/graph-viewer/viewer/utils-BuObIC0n.js +1815 -0
- package/dist/graph-viewer/viewer/workbench-E6_5q_oL.js +28351 -0
- package/dist/graph-viewer/viewer/workflows--mZpHYqo.js +3298 -0
- package/dist/graph-viewer/viewer/workspace-cKs9sGEO.js +2468 -0
- package/dist/graph-viewer/{workspace-model-Ewf17pTW.js → workspace-model-BkPl_J8E.js} +1 -1
- package/dist/graph-viewer/workspace-viewer.js +7452 -7489
- package/dist/graph-viewer/workspace.js +1 -1
- package/dist/index.mjs +27 -22
- package/package.json +14 -13
- package/dist/graph-viewer/Analytics-DFWW8Phh.js +0 -938
- package/dist/graph-viewer/Checks-qgqV4xgV.js +0 -155
- package/dist/graph-viewer/Conversations-CGB45kpj.js +0 -545
- package/dist/graph-viewer/LiveRun-C21wUKAY.js +0 -210
- package/dist/graph-viewer/Overview-BjeLsA2I.js +0 -506
- package/dist/graph-viewer/RunPage-CkkcBEUe.js +0 -258
- package/dist/graph-viewer/Timeline-C2Xolk0t.js +0 -293
- package/dist/graph-viewer/Today-BVVDtSVN.js +0 -660
- package/dist/graph-viewer/Topology-DO5XX8e4.js +0 -545
- package/dist/graph-viewer/Traces-BhMxjNgw.js +0 -259
- package/dist/graph-viewer/part-events-BrLrg_EV.js +0 -276
- package/dist/graph-viewer/record-part-CZal_IMH.js +0 -1408
- package/dist/graph-viewer/ui-D8QZRsC3.js +0 -938
- package/dist/graph-viewer/viewer/Analytics-DD__nbLm.js +0 -939
- package/dist/graph-viewer/viewer/Checks-Ds5M7eAW.js +0 -156
- package/dist/graph-viewer/viewer/Conversations-C1n0EBBd.js +0 -819
- package/dist/graph-viewer/viewer/Files-Cjr7NMU_.js +0 -448
- package/dist/graph-viewer/viewer/LiveRun-uPTkPSjo.js +0 -6772
- package/dist/graph-viewer/viewer/Overview-4Umk14_2.js +0 -507
- package/dist/graph-viewer/viewer/RunPage-DZlBW7Va.js +0 -257
- package/dist/graph-viewer/viewer/Timeline-BnK6-yBR.js +0 -294
- package/dist/graph-viewer/viewer/Today-a_-oNigi.js +0 -660
- package/dist/graph-viewer/viewer/Topology-CQPCLQT6.js +0 -546
- package/dist/graph-viewer/viewer/Traces-C0IGk0L4.js +0 -259
- package/dist/graph-viewer/viewer/WorkflowGraph-DZ3xejKE-jRXKeSrg.js +0 -1559
- package/dist/graph-viewer/viewer/agent-record-Dw772ROs.css +0 -2
- package/dist/graph-viewer/viewer/agent-timeline-Cs9Qbpvo.js +0 -1798
- package/dist/graph-viewer/viewer/dist-C1-7EfoW.js +0 -488
- package/dist/graph-viewer/viewer/file-text-m7a3piQF.js +0 -47
- package/dist/graph-viewer/viewer/jsx-runtime-DQWyJOhv.js +0 -2136
- package/dist/graph-viewer/viewer/lazy-pages-BowaGsg-.js +0 -20
- package/dist/graph-viewer/viewer/model-brand-bTcMjQtB-fagiBQam.js +0 -723
- package/dist/graph-viewer/viewer/popover-CvOAjlnk.js +0 -5329
- package/dist/graph-viewer/viewer/react-CY3IbSNO.js +0 -4262
- package/dist/graph-viewer/viewer/record-part-D3_Anfpe.js +0 -1329
- package/dist/graph-viewer/viewer/terminal-83J_I4Ne.js +0 -52
- package/dist/graph-viewer/viewer/ui-C9b1rIUH.js +0 -938
- package/dist/graph-viewer/viewer/workspace-CekmOBs3.js +0 -25100
- package/dist/graph-viewer/viewer/x-DOc2URqZ.js +0 -56
|
@@ -1,1329 +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 { d as r, f as i } from "./markdown-CX_sVrXB.js";
|
|
4
|
-
import { a, i as o, n as s, o as c, r as l, s as u } from "./agent-timeline-Cs9Qbpvo.js";
|
|
5
|
-
import { l as d, p as f } from "./data-CkWfWr7i.js";
|
|
6
|
-
//#region src/viewer/StructuredContent.tsx
|
|
7
|
-
var p = /* @__PURE__ */ e(t(), 1), m = n();
|
|
8
|
-
function h(e) {
|
|
9
|
-
try {
|
|
10
|
-
return JSON.parse(e);
|
|
11
|
-
} catch {
|
|
12
|
-
return e;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function g({ text: e, resolveHref: t }) {
|
|
16
|
-
return /* @__PURE__ */ (0, m.jsx)("div", {
|
|
17
|
-
className: "activity-prose",
|
|
18
|
-
children: /* @__PURE__ */ (0, m.jsx)(i, {
|
|
19
|
-
skipHtml: !0,
|
|
20
|
-
remarkPlugins: [r],
|
|
21
|
-
components: {
|
|
22
|
-
a: ({ href: e, children: n }) => {
|
|
23
|
-
let r = /^https?:\/\//i.test(e ?? "") ? e : t?.(e ?? "");
|
|
24
|
-
return r && (/^https?:\/\//i.test(r) || /^\/(?!\/)/.test(r)) ? /* @__PURE__ */ (0, m.jsx)("a", {
|
|
25
|
-
href: r,
|
|
26
|
-
target: "_blank",
|
|
27
|
-
rel: "noreferrer",
|
|
28
|
-
children: n
|
|
29
|
-
}) : /* @__PURE__ */ (0, m.jsx)("span", { children: n });
|
|
30
|
-
},
|
|
31
|
-
img: ({ alt: e }) => /* @__PURE__ */ (0, m.jsx)("span", { children: e || "Image omitted" }),
|
|
32
|
-
table: ({ children: e }) => /* @__PURE__ */ (0, m.jsx)("div", {
|
|
33
|
-
className: "rr-table-scroll",
|
|
34
|
-
children: /* @__PURE__ */ (0, m.jsx)("table", { children: e })
|
|
35
|
-
})
|
|
36
|
-
},
|
|
37
|
-
children: e
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function _({ value: e, depth: t = 0, field: n }) {
|
|
42
|
-
let [r, i] = (0, p.useState)(!1);
|
|
43
|
-
if (e == null) return /* @__PURE__ */ (0, m.jsx)("span", {
|
|
44
|
-
className: "small",
|
|
45
|
-
children: "Not supplied"
|
|
46
|
-
});
|
|
47
|
-
if (typeof e == "string") {
|
|
48
|
-
if (n && /^(command|cmd|code|script|stdout|stderr)$/i.test(n)) return /* @__PURE__ */ (0, m.jsx)("pre", {
|
|
49
|
-
className: "activity-code",
|
|
50
|
-
children: /* @__PURE__ */ (0, m.jsx)("code", { children: e })
|
|
51
|
-
});
|
|
52
|
-
let r = t < 3 ? h(e) : e;
|
|
53
|
-
return typeof r == "string" ? /* @__PURE__ */ (0, m.jsx)(g, { text: e }) : /* @__PURE__ */ (0, m.jsx)(_, {
|
|
54
|
-
value: r,
|
|
55
|
-
depth: t + 1
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
if (typeof e != "object") return /* @__PURE__ */ (0, m.jsx)("span", { children: String(e) });
|
|
59
|
-
if (Array.isArray(e)) {
|
|
60
|
-
let n = r ? e : e.slice(0, 12);
|
|
61
|
-
return /* @__PURE__ */ (0, m.jsxs)("div", {
|
|
62
|
-
className: "structured-items",
|
|
63
|
-
children: [n.map((e, n) => /* @__PURE__ */ (0, m.jsx)("div", { children: /* @__PURE__ */ (0, m.jsx)(_, {
|
|
64
|
-
value: e,
|
|
65
|
-
depth: t + 1
|
|
66
|
-
}) }, n)), e.length > n.length && /* @__PURE__ */ (0, m.jsxs)("button", {
|
|
67
|
-
className: "ui-button",
|
|
68
|
-
onClick: () => i(!0),
|
|
69
|
-
children: [
|
|
70
|
-
"Show all ",
|
|
71
|
-
e.length,
|
|
72
|
-
" items"
|
|
73
|
-
]
|
|
74
|
-
})]
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
let a = e;
|
|
78
|
-
if (a.type === "text" && typeof a.text == "string") return /* @__PURE__ */ (0, m.jsx)(_, {
|
|
79
|
-
value: a.text,
|
|
80
|
-
depth: t + 1
|
|
81
|
-
});
|
|
82
|
-
let o = Object.entries(a), s = r ? o : o.slice(0, 16);
|
|
83
|
-
return t > 4 ? /* @__PURE__ */ (0, m.jsxs)("details", { children: [/* @__PURE__ */ (0, m.jsx)("summary", { children: "Nested data" }), /* @__PURE__ */ (0, m.jsx)("pre", { children: JSON.stringify(e, null, 2) })] }) : /* @__PURE__ */ (0, m.jsxs)("dl", {
|
|
84
|
-
className: "structured-fields",
|
|
85
|
-
children: [s.map(([e, n]) => /* @__PURE__ */ (0, m.jsxs)("div", { children: [/* @__PURE__ */ (0, m.jsx)("dt", { children: e.replace(/([a-z])([A-Z])/g, "$1 $2").replaceAll("_", " ") }), /* @__PURE__ */ (0, m.jsx)("dd", { children: /* @__PURE__ */ (0, m.jsx)(_, {
|
|
86
|
-
value: n,
|
|
87
|
-
depth: t + 1,
|
|
88
|
-
field: e
|
|
89
|
-
}) })] }, e)), o.length > s.length && /* @__PURE__ */ (0, m.jsxs)("button", {
|
|
90
|
-
className: "ui-button",
|
|
91
|
-
onClick: () => i(!0),
|
|
92
|
-
children: [
|
|
93
|
-
"Show all ",
|
|
94
|
-
o.length,
|
|
95
|
-
" fields"
|
|
96
|
-
]
|
|
97
|
-
})]
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
function v({ text: e, rawLabel: t = "Raw data" }) {
|
|
101
|
-
let n = h(e);
|
|
102
|
-
return /* @__PURE__ */ (0, m.jsxs)("div", {
|
|
103
|
-
className: "structured-content",
|
|
104
|
-
children: [/* @__PURE__ */ (0, m.jsx)(_, { value: n }), typeof n != "string" && /* @__PURE__ */ (0, m.jsxs)("details", {
|
|
105
|
-
className: "raw-data",
|
|
106
|
-
children: [/* @__PURE__ */ (0, m.jsx)("summary", { children: t }), /* @__PURE__ */ (0, m.jsx)("pre", { children: e })]
|
|
107
|
-
})]
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
var y = /^(command|cmd|code|script|content|new_string|old_string|patch|text|stdout|stderr|output|query|prompt)$/i;
|
|
111
|
-
function b(e, t = [], n = []) {
|
|
112
|
-
if (n.length >= 24 || t.length > 8) return n;
|
|
113
|
-
if (typeof e == "string") (e.includes("\n") || e.length > 120 || y.test(t.at(-1) ?? "")) && n.push({
|
|
114
|
-
path: t.join(" › ") || "text",
|
|
115
|
-
text: e
|
|
116
|
-
});
|
|
117
|
-
else if (Array.isArray(e)) e.forEach((e, r) => b(e, [...t, String(r)], n));
|
|
118
|
-
else if (e && typeof e == "object") for (let [r, i] of Object.entries(e)) b(i, [...t, r], n);
|
|
119
|
-
return n;
|
|
120
|
-
}
|
|
121
|
-
function x({ text: e, rawLabel: t = "Raw data" }) {
|
|
122
|
-
let n = h(e);
|
|
123
|
-
if (typeof n != "object" || !n) return /* @__PURE__ */ (0, m.jsx)("pre", {
|
|
124
|
-
className: "activity-code verbatim",
|
|
125
|
-
"data-verbatim": !0,
|
|
126
|
-
children: /* @__PURE__ */ (0, m.jsx)("code", { children: e })
|
|
127
|
-
});
|
|
128
|
-
let r = b(n);
|
|
129
|
-
return /* @__PURE__ */ (0, m.jsxs)("div", {
|
|
130
|
-
className: "structured-content verbatim",
|
|
131
|
-
"data-verbatim": !0,
|
|
132
|
-
children: [r.map((e, t) => /* @__PURE__ */ (0, m.jsxs)("section", {
|
|
133
|
-
className: "verbatim-block",
|
|
134
|
-
children: [/* @__PURE__ */ (0, m.jsx)("span", {
|
|
135
|
-
className: "verbatim-path mono",
|
|
136
|
-
children: e.path
|
|
137
|
-
}), /* @__PURE__ */ (0, m.jsx)("pre", {
|
|
138
|
-
className: "activity-code",
|
|
139
|
-
children: /* @__PURE__ */ (0, m.jsx)("code", { children: e.text })
|
|
140
|
-
})]
|
|
141
|
-
}, t)), /* @__PURE__ */ (0, m.jsxs)("details", {
|
|
142
|
-
className: "raw-data",
|
|
143
|
-
open: !r.length,
|
|
144
|
-
children: [/* @__PURE__ */ (0, m.jsx)("summary", { children: t }), /* @__PURE__ */ (0, m.jsx)("pre", {
|
|
145
|
-
className: "activity-code",
|
|
146
|
-
children: /* @__PURE__ */ (0, m.jsx)("code", { children: JSON.stringify(n, null, 2) })
|
|
147
|
-
})]
|
|
148
|
-
})]
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
//#endregion
|
|
152
|
-
//#region src/viewer/model.ts
|
|
153
|
-
var S = (e) => Date.parse(e);
|
|
154
|
-
function C(e, t = !1) {
|
|
155
|
-
let n = new Date(e);
|
|
156
|
-
if (!Number.isFinite(n.valueOf())) return "Unknown time";
|
|
157
|
-
let r = n.toISOString();
|
|
158
|
-
return `${t ? r.slice(0, 19).replace("T", " ") : r.slice(11, 19)} UTC`;
|
|
159
|
-
}
|
|
160
|
-
var w = (e) => e.replace(/\s+/g, " ").trim(), T = /\/(?:home|Users)\/[^/\s"'`]+(?:\/\.cache\/disco\/host\/[^/\s"'`]+(?:\/sessions\/[^/\s"'`]+)?)?(\/?)/g;
|
|
161
|
-
function E(e) {
|
|
162
|
-
return !e || !(e.includes("/home/") || e.includes("/Users/")) ? e : e.replace(T, (e, t, n, r) => {
|
|
163
|
-
if (!e.includes("/.cache/disco/host/")) return t ? "~/" : "~";
|
|
164
|
-
let i = r[n + e.length];
|
|
165
|
-
return t && i !== void 0 && !/[\s"'`)]/.test(i) ? "" : "./";
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
function D(e) {
|
|
169
|
-
let t = e.detail, n = E(t.publicText), r = E(t.reasoning), i = t.publicToolCalls?.map((e) => e.input && E(e.input) !== e.input ? {
|
|
170
|
-
...e,
|
|
171
|
-
input: E(e.input)
|
|
172
|
-
} : e);
|
|
173
|
-
return n === t.publicText && r === t.reasoning && i?.every((e, n) => e === t.publicToolCalls[n]) !== !1 ? e : {
|
|
174
|
-
...e,
|
|
175
|
-
detail: {
|
|
176
|
-
...t,
|
|
177
|
-
...n === void 0 ? {} : { publicText: n },
|
|
178
|
-
...r === void 0 ? {} : { reasoning: r },
|
|
179
|
-
...i ? { publicToolCalls: i } : {}
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
var O = (e) => e.detail.publicText ?? e.detail.recordedClaim ?? "", k = (e, t) => JSON.stringify([e, t]);
|
|
184
|
-
function A(e) {
|
|
185
|
-
let t = e.detail.publicToolCalls ?? [], n = new Map(t.map((e) => [e.id, e]));
|
|
186
|
-
return [.../* @__PURE__ */ new Set([...e.detail.toolCallIds ?? [], ...t.map((e) => e.id)])].map((t) => n.get(t) ?? {
|
|
187
|
-
id: t,
|
|
188
|
-
name: e.detail.toolNames?.length === 1 ? e.detail.toolNames[0] : "Tool call"
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
var j = (e) => e.replace(/^[a-z0-9][\w.-]*-\d{8}[a-z]?:/i, "");
|
|
192
|
-
function M(e) {
|
|
193
|
-
if (e.input === void 0) return "args not captured";
|
|
194
|
-
try {
|
|
195
|
-
let t = JSON.parse(e.input);
|
|
196
|
-
if (t && typeof t == "object" && !Array.isArray(t)) {
|
|
197
|
-
let e = t;
|
|
198
|
-
for (let t of [
|
|
199
|
-
"command",
|
|
200
|
-
"cmd",
|
|
201
|
-
"filePath",
|
|
202
|
-
"file_path",
|
|
203
|
-
"path",
|
|
204
|
-
"query",
|
|
205
|
-
"question",
|
|
206
|
-
"pattern",
|
|
207
|
-
"url",
|
|
208
|
-
"pageId",
|
|
209
|
-
"title",
|
|
210
|
-
"task",
|
|
211
|
-
"prompt",
|
|
212
|
-
"message"
|
|
213
|
-
]) if (typeof e[t] == "string" && e[t]) return w(j(e[t]));
|
|
214
|
-
let n = Object.values(e).filter((e) => [
|
|
215
|
-
"string",
|
|
216
|
-
"number",
|
|
217
|
-
"boolean"
|
|
218
|
-
].includes(typeof e));
|
|
219
|
-
if (n.length) return w(n.map((e) => j(String(e))).join(" · "));
|
|
220
|
-
}
|
|
221
|
-
} catch {}
|
|
222
|
-
return w(e.input);
|
|
223
|
-
}
|
|
224
|
-
function N(e) {
|
|
225
|
-
let t = new Map(e.nodes.map((e) => [e.id, e])), n = (e) => t.get(e)?.agentId ?? e, r = e.nodes.filter((e) => e.kind !== "session" || !e.agentId), i = e.events.map(D).sort((e, t) => S(e.at) - S(t.at)), a = new Map(i.map((e) => [e.id, e])), o = new Map(e.events.map((e, t) => [e.id, t])), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
226
|
-
for (let e of i) {
|
|
227
|
-
let t = n(e.node), r = s.get(t) ?? [];
|
|
228
|
-
r.push(e), s.set(t, r);
|
|
229
|
-
for (let t of A(e)) {
|
|
230
|
-
let n = k(e.node, t.id), r = l.get(n) ?? [];
|
|
231
|
-
r.push({
|
|
232
|
-
event: e,
|
|
233
|
-
call: t
|
|
234
|
-
}), l.set(n, r);
|
|
235
|
-
}
|
|
236
|
-
if (e.detail.toolCallId !== void 0) {
|
|
237
|
-
let t = k(e.node, e.detail.toolCallId), n = c.get(t) ?? [];
|
|
238
|
-
n.push(e), c.set(t, n);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
let u = i.map((e) => S(e.at)), d = u[0] ?? 0;
|
|
242
|
-
return {
|
|
243
|
-
nodes: t,
|
|
244
|
-
canonical: n,
|
|
245
|
-
actors: r,
|
|
246
|
-
events: i,
|
|
247
|
-
byEvent: a,
|
|
248
|
-
recordedOrder: o,
|
|
249
|
-
byActor: s,
|
|
250
|
-
calls: l,
|
|
251
|
-
results: c,
|
|
252
|
-
start: d,
|
|
253
|
-
end: i.reduce((e, t) => Math.max(e, t.end ? S(t.end) : S(t.at)), u.at(-1) ?? d)
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
function P(e, t) {
|
|
257
|
-
return (e.byActor.get(t) ?? []).some((e) => typeof e.detail.costListUsd == "number" || Object.values(e.detail.usage ?? {}).some((e) => typeof e == "number" && e > 0));
|
|
258
|
-
}
|
|
259
|
-
function F(e, t, n) {
|
|
260
|
-
if (!e?.status && n) return n === "running" ? "working" : n.replaceAll("-", " ");
|
|
261
|
-
let r = e?.status ?? "no terminal state recorded";
|
|
262
|
-
if (t) return r;
|
|
263
|
-
let i = e?.capture?.status;
|
|
264
|
-
return `${r} · no usage recorded${i === "absent" ? "; capture missing" : i === "lossy" ? "; capture partial" : ""}`;
|
|
265
|
-
}
|
|
266
|
-
function I(e, t, n, r) {
|
|
267
|
-
return (r === "all" || r === "prompts" && (e.detail.promptKind === "initial" || e.detail.promptKind === "steering") || e.category === r || r === "findings" && (e.kind === "finding-record" || e.detail.recordedClaim !== void 0)) && (!n || JSON.stringify({
|
|
268
|
-
label: e.label,
|
|
269
|
-
node: t.nodes.get(t.canonical(e.node)),
|
|
270
|
-
detail: e.detail
|
|
271
|
-
}).toLowerCase().includes(n));
|
|
272
|
-
}
|
|
273
|
-
//#endregion
|
|
274
|
-
//#region src/viewer/VirtualList.tsx
|
|
275
|
-
function ee({ items: e, keyOf: t, render: n, scroller: r, estimate: i = 96, overscan: a = 900, target: o }) {
|
|
276
|
-
let s = (0, p.useRef)(/* @__PURE__ */ new Map()), [c, l] = (0, p.useState)(0), [u, d] = (0, p.useState)({
|
|
277
|
-
top: 0,
|
|
278
|
-
height: 900
|
|
279
|
-
}), f = (0, p.useRef)(null), h = (0, p.useRef)(/* @__PURE__ */ new Map()), g = (0, p.useRef)(0), _ = (e) => {
|
|
280
|
-
!f.current && typeof ResizeObserver < "u" && (f.current = new ResizeObserver((e) => {
|
|
281
|
-
let t = !1;
|
|
282
|
-
for (let n of e) {
|
|
283
|
-
let e = h.current.get(n.target);
|
|
284
|
-
if (!e) continue;
|
|
285
|
-
let r = Math.ceil(n.borderBoxSize?.[0]?.blockSize ?? n.target.offsetHeight);
|
|
286
|
-
r > 0 && s.current.get(e) !== r && (s.current.set(e, r), t = !0);
|
|
287
|
-
}
|
|
288
|
-
t && !g.current && (g.current = requestAnimationFrame(() => {
|
|
289
|
-
g.current = 0, l((e) => e + 1);
|
|
290
|
-
}));
|
|
291
|
-
})), f.current?.observe(e);
|
|
292
|
-
};
|
|
293
|
-
(0, p.useEffect)(() => () => {
|
|
294
|
-
cancelAnimationFrame(g.current), f.current?.disconnect(), f.current = null, h.current.clear();
|
|
295
|
-
}, []), (0, p.useEffect)(() => {
|
|
296
|
-
let e = r.current;
|
|
297
|
-
if (!e) return;
|
|
298
|
-
let t = 0, n = () => {
|
|
299
|
-
t = 0, d((t) => t.top === e.scrollTop && t.height === e.clientHeight ? t : {
|
|
300
|
-
top: e.scrollTop,
|
|
301
|
-
height: e.clientHeight
|
|
302
|
-
});
|
|
303
|
-
}, i = () => {
|
|
304
|
-
t ||= requestAnimationFrame(n);
|
|
305
|
-
};
|
|
306
|
-
n(), e.addEventListener("scroll", i, { passive: !0 });
|
|
307
|
-
let a = new ResizeObserver(i);
|
|
308
|
-
return a.observe(e), () => {
|
|
309
|
-
cancelAnimationFrame(t), e.removeEventListener("scroll", i), a.disconnect();
|
|
310
|
-
};
|
|
311
|
-
}, [r]);
|
|
312
|
-
let v = (0, p.useMemo)(() => {
|
|
313
|
-
let n = new Float64Array(e.length + 1), r = typeof i == "function" ? i : () => i;
|
|
314
|
-
for (let i = 0; i < e.length; i++) n[i + 1] = n[i] + (s.current.get(t(e[i])) ?? r(e[i]));
|
|
315
|
-
return n;
|
|
316
|
-
}, [
|
|
317
|
-
e,
|
|
318
|
-
t,
|
|
319
|
-
i,
|
|
320
|
-
c
|
|
321
|
-
]), y = (t) => {
|
|
322
|
-
let n = 0, r = e.length;
|
|
323
|
-
for (; n < r;) {
|
|
324
|
-
let e = n + r >> 1;
|
|
325
|
-
v[e + 1] <= t ? n = e + 1 : r = e;
|
|
326
|
-
}
|
|
327
|
-
return n;
|
|
328
|
-
}, b = Math.max(0, y(u.top - a)), x = Math.min(e.length, y(u.top + u.height + a) + 1), S = (0, p.useCallback)((n, i) => {
|
|
329
|
-
let a = r.current, o = e.findIndex((e) => t(e) === n);
|
|
330
|
-
if (!a || o < 0) return !1;
|
|
331
|
-
let s = v[o], c = v[o + 1];
|
|
332
|
-
return (i || s < a.scrollTop || c > a.scrollTop + a.clientHeight) && (a.scrollTop = Math.max(0, s - 8)), !0;
|
|
333
|
-
}, [
|
|
334
|
-
e,
|
|
335
|
-
t,
|
|
336
|
-
v,
|
|
337
|
-
r
|
|
338
|
-
]), C = (0, p.useRef)(null), w = (0, p.useRef)(/* @__PURE__ */ new Map()), T = () => {
|
|
339
|
-
let e = C.current;
|
|
340
|
-
if (!e) return;
|
|
341
|
-
if (performance.now() > e.until) {
|
|
342
|
-
C.current = null;
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
if (!S(e.key, !0)) return;
|
|
346
|
-
let t = w.current.get(e.key);
|
|
347
|
-
if (t?.isConnected) {
|
|
348
|
-
let e = t.getBoundingClientRect();
|
|
349
|
-
(e.top < 72 || e.top > window.innerHeight - 96) && window.scrollBy({ top: e.top - 120 });
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
(0, p.useLayoutEffect)(() => {
|
|
353
|
-
C.current = o ? {
|
|
354
|
-
key: o,
|
|
355
|
-
until: performance.now() + 2e3
|
|
356
|
-
} : null, T();
|
|
357
|
-
}, [o]), (0, p.useLayoutEffect)(T, [
|
|
358
|
-
c,
|
|
359
|
-
u,
|
|
360
|
-
e
|
|
361
|
-
]), (0, p.useEffect)(() => {
|
|
362
|
-
let e = r.current;
|
|
363
|
-
if (!e) return;
|
|
364
|
-
let t = () => {
|
|
365
|
-
C.current = null;
|
|
366
|
-
};
|
|
367
|
-
return e.addEventListener("wheel", t, { passive: !0 }), e.addEventListener("touchstart", t, { passive: !0 }), e.addEventListener("pointerdown", t), e.addEventListener("keydown", t), () => {
|
|
368
|
-
e.removeEventListener("wheel", t), e.removeEventListener("touchstart", t), e.removeEventListener("pointerdown", t), e.removeEventListener("keydown", t);
|
|
369
|
-
};
|
|
370
|
-
}, [r]);
|
|
371
|
-
let E = (e) => (t) => {
|
|
372
|
-
if (!t) {
|
|
373
|
-
w.current.delete(e);
|
|
374
|
-
return;
|
|
375
|
-
}
|
|
376
|
-
w.current.set(e, t);
|
|
377
|
-
for (let [n, r] of h.current) r === e && n !== t && (f.current?.unobserve(n), h.current.delete(n));
|
|
378
|
-
h.current.has(t) || (h.current.set(t, e), _(t));
|
|
379
|
-
};
|
|
380
|
-
return (0, p.useEffect)(() => {
|
|
381
|
-
for (let e of [...h.current.keys()]) e.isConnected || (f.current?.unobserve(e), h.current.delete(e));
|
|
382
|
-
}), /* @__PURE__ */ (0, m.jsxs)(m.Fragment, { children: [
|
|
383
|
-
/* @__PURE__ */ (0, m.jsx)("div", {
|
|
384
|
-
style: { height: v[b] },
|
|
385
|
-
"aria-hidden": "true"
|
|
386
|
-
}),
|
|
387
|
-
e.slice(b, x).map((e, r) => {
|
|
388
|
-
let i = t(e);
|
|
389
|
-
return /* @__PURE__ */ (0, m.jsx)("div", {
|
|
390
|
-
ref: E(i),
|
|
391
|
-
className: "virtual-row",
|
|
392
|
-
children: n(e, b + r)
|
|
393
|
-
}, i);
|
|
394
|
-
}),
|
|
395
|
-
/* @__PURE__ */ (0, m.jsx)("div", {
|
|
396
|
-
style: { height: v[e.length] - v[x] },
|
|
397
|
-
"aria-hidden": "true"
|
|
398
|
-
})
|
|
399
|
-
] });
|
|
400
|
-
}
|
|
401
|
-
//#endregion
|
|
402
|
-
//#region src/viewer/conversation-rows.ts
|
|
403
|
-
function L(e) {
|
|
404
|
-
let t = e.source, n = e.detail.nativeRecordId;
|
|
405
|
-
return typeof n == "string" && n ? JSON.stringify([
|
|
406
|
-
e.node,
|
|
407
|
-
"native",
|
|
408
|
-
n,
|
|
409
|
-
e.kind,
|
|
410
|
-
t?.item ?? null
|
|
411
|
-
]) : t?.path ? JSON.stringify([
|
|
412
|
-
e.node,
|
|
413
|
-
t.path,
|
|
414
|
-
t.line ?? null,
|
|
415
|
-
t.pointer ?? null,
|
|
416
|
-
t.item ?? null
|
|
417
|
-
]) : e.id;
|
|
418
|
-
}
|
|
419
|
-
function R(e) {
|
|
420
|
-
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
421
|
-
for (let r of e) {
|
|
422
|
-
let e = L(r), i = t.get(e) ?? 0;
|
|
423
|
-
t.set(e, i + 1), n.set(r.id, i ? `${e}#${i}` : e);
|
|
424
|
-
}
|
|
425
|
-
return n;
|
|
426
|
-
}
|
|
427
|
-
var z = (e) => e === void 0 || /^\s*(\{\s*\}|null)?\s*$/.test(e);
|
|
428
|
-
function B(e) {
|
|
429
|
-
return e === void 0 ? "args not captured" : z(e) ? "empty args" : null;
|
|
430
|
-
}
|
|
431
|
-
function V(e, t) {
|
|
432
|
-
switch (e) {
|
|
433
|
-
case "error": return "Error";
|
|
434
|
-
case "returned": return "Returned";
|
|
435
|
-
case "pending": return "Not returned";
|
|
436
|
-
case "ambiguous": return "Ambiguous";
|
|
437
|
-
default: return t ? "Pending" : "Result not captured";
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
function H(e) {
|
|
441
|
-
let t = e.usage;
|
|
442
|
-
return typeof t?.output == "number" && Number.isFinite(t.output) ? t.output : null;
|
|
443
|
-
}
|
|
444
|
-
function te(e) {
|
|
445
|
-
let t = H(e);
|
|
446
|
-
return t !== null && t < 2e3;
|
|
447
|
-
}
|
|
448
|
-
function U(e) {
|
|
449
|
-
let t = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.floor(e) : 0, n = t(e.reasoningOmitted), r = t(e.reasoningRedacted), i = [];
|
|
450
|
-
return n && i.push(n === 1 ? "thinking not returned by provider" : `${n} thinking blocks not returned by provider`), r && i.push(r === 1 ? "thinking redacted (encrypted)" : `${r} thinking blocks redacted (encrypted)`), i;
|
|
451
|
-
}
|
|
452
|
-
var ne = /await|wait|poll|sleep|observe|status/i;
|
|
453
|
-
function re(e) {
|
|
454
|
-
if (typeof e != "string" || !e.trimStart().startsWith("{")) return !1;
|
|
455
|
-
try {
|
|
456
|
-
let t = JSON.parse(e);
|
|
457
|
-
return !!t && typeof t == "object" && !Array.isArray(t) && t.pending === !0;
|
|
458
|
-
} catch {
|
|
459
|
-
return !1;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
var ie = (e) => (e ?? []).some((e) => !re(e.detail.publicText));
|
|
463
|
-
function ae(e, t, n) {
|
|
464
|
-
let r = e.detail;
|
|
465
|
-
if (r.role !== "assistant" || e.category === "lifecycle" || r.lifecycle !== void 0 || r.publicText || r.recordedClaim || r.reasoning || r.responseStatus === "error" || r.contentOmitted || r.publicationNote || r.clip || U(r).length || t.length !== 1) return null;
|
|
466
|
-
let i = t[0];
|
|
467
|
-
return i.clip || i.publicationNote || n(i.id) || !z(i.input) && !ne.test(i.name) ? null : i;
|
|
468
|
-
}
|
|
469
|
-
function oe(e, t, n) {
|
|
470
|
-
let r = e.detail;
|
|
471
|
-
return r.role !== "assistant" || e.category === "lifecycle" || r.lifecycle !== void 0 || r.publicText || r.recordedClaim || r.reasoning || r.responseStatus === "error" || r.contentOmitted || r.publicationNote || r.clip || U(r).length || !t.length || t.some((t) => t.input !== void 0 || t.clip || t.publicationNote || n(e, t.id)) ? null : t;
|
|
472
|
-
}
|
|
473
|
-
function se(e, { callsOf: t, captured: n, keyOf: r, min: i = 2 }) {
|
|
474
|
-
let a = [], o = null, s = () => {
|
|
475
|
-
if (o) {
|
|
476
|
-
if (o.events.length >= i) a.push({
|
|
477
|
-
kind: "hollow",
|
|
478
|
-
key: `hollow:${r(o.events[0])}`,
|
|
479
|
-
events: o.events,
|
|
480
|
-
calls: [...o.calls.entries()].map(([e, t]) => ({
|
|
481
|
-
name: e,
|
|
482
|
-
count: t
|
|
483
|
-
})),
|
|
484
|
-
spanMs: o.spanMs
|
|
485
|
-
});
|
|
486
|
-
else for (let e of o.events) a.push({
|
|
487
|
-
kind: "event",
|
|
488
|
-
key: r(e),
|
|
489
|
-
event: e
|
|
490
|
-
});
|
|
491
|
-
o = null;
|
|
492
|
-
}
|
|
493
|
-
};
|
|
494
|
-
for (let r of e) {
|
|
495
|
-
if (r.kind !== "event") {
|
|
496
|
-
s(), a.push(r);
|
|
497
|
-
continue;
|
|
498
|
-
}
|
|
499
|
-
let e = oe(r.event, t(r.event), n);
|
|
500
|
-
if (!e) {
|
|
501
|
-
s(), a.push(r);
|
|
502
|
-
continue;
|
|
503
|
-
}
|
|
504
|
-
o ??= {
|
|
505
|
-
events: [],
|
|
506
|
-
calls: /* @__PURE__ */ new Map(),
|
|
507
|
-
spanMs: 0
|
|
508
|
-
}, o.events.push(r.event);
|
|
509
|
-
for (let t of e) o.calls.set(t.name, (o.calls.get(t.name) ?? 0) + 1);
|
|
510
|
-
}
|
|
511
|
-
s();
|
|
512
|
-
for (let e of a) {
|
|
513
|
-
if (e.kind !== "hollow") continue;
|
|
514
|
-
let t = e.events.map((e) => Date.parse(e.at)).filter(Number.isFinite);
|
|
515
|
-
e.spanMs = t.length > 1 ? Math.max(...t) - Math.min(...t) : 0;
|
|
516
|
-
}
|
|
517
|
-
return a;
|
|
518
|
-
}
|
|
519
|
-
function ce(e) {
|
|
520
|
-
let t = e.reduce((e, t) => e + t.count, 0), n = e.map((e) => e.count > 1 ? `${e.name} ×${e.count}` : e.name);
|
|
521
|
-
return `${t} tool call${t === 1 ? "" : "s"} · ${n.join(" · ")}`;
|
|
522
|
-
}
|
|
523
|
-
function W(e, { callsOf: t, answered: n, keyOf: r, min: i = 2 }) {
|
|
524
|
-
let a = [], o = null, s = () => {
|
|
525
|
-
if (o) {
|
|
526
|
-
if (o.events.length >= i) a.push({
|
|
527
|
-
kind: "polls",
|
|
528
|
-
key: `polls:${r(o.events[0])}`,
|
|
529
|
-
name: o.name,
|
|
530
|
-
input: o.input,
|
|
531
|
-
events: o.events
|
|
532
|
-
});
|
|
533
|
-
else for (let e of o.events) a.push({
|
|
534
|
-
kind: "event",
|
|
535
|
-
key: r(e),
|
|
536
|
-
event: e
|
|
537
|
-
});
|
|
538
|
-
o = null;
|
|
539
|
-
}
|
|
540
|
-
};
|
|
541
|
-
for (let i of e) {
|
|
542
|
-
let e = ae(i, t(i), (e) => n(i, e));
|
|
543
|
-
if (!e) {
|
|
544
|
-
s(), a.push({
|
|
545
|
-
kind: "event",
|
|
546
|
-
key: r(i),
|
|
547
|
-
event: i
|
|
548
|
-
});
|
|
549
|
-
continue;
|
|
550
|
-
}
|
|
551
|
-
let c = z(e.input) ? "" : e.input.trim();
|
|
552
|
-
o && (o.name !== e.name || o.args !== c) && s(), o ??= {
|
|
553
|
-
name: e.name,
|
|
554
|
-
args: c,
|
|
555
|
-
input: e.input,
|
|
556
|
-
events: []
|
|
557
|
-
}, o.events.push(i);
|
|
558
|
-
}
|
|
559
|
-
return s(), a;
|
|
560
|
-
}
|
|
561
|
-
function le(e) {
|
|
562
|
-
let t = Math.max(0, Math.round(e / 1e3));
|
|
563
|
-
if (t < 60) return `${t}s`;
|
|
564
|
-
let n = Math.floor(t / 60);
|
|
565
|
-
return n < 60 ? `${n}m ${t % 60}s` : `${Math.floor(n / 60)}h ${n % 60}m`;
|
|
566
|
-
}
|
|
567
|
-
function ue(e) {
|
|
568
|
-
let t = e.map((e) => Date.parse(e.at)).filter(Number.isFinite), n = t.length ? Math.max(...t) - Math.min(...t) : 0, r = 0, i = 0;
|
|
569
|
-
for (let t of e) {
|
|
570
|
-
let e = t.detail.usage;
|
|
571
|
-
if (!e || t.detail.usageScope !== void 0) continue;
|
|
572
|
-
let n = [
|
|
573
|
-
e.input,
|
|
574
|
-
e.output,
|
|
575
|
-
e.cacheRead,
|
|
576
|
-
e.cacheWrite
|
|
577
|
-
].filter((e) => typeof e == "number");
|
|
578
|
-
n.length && (i++, r += n.reduce((e, t) => e + t, 0));
|
|
579
|
-
}
|
|
580
|
-
let a = new Intl.NumberFormat("en-US", {
|
|
581
|
-
notation: "compact",
|
|
582
|
-
maximumFractionDigits: 1
|
|
583
|
-
}), o = i ? i < e.length ? `~${a.format(r)} tokens (${i} of ${e.length} measured)` : `~${a.format(r)} tokens` : "tokens unknown";
|
|
584
|
-
return {
|
|
585
|
-
polls: e.length,
|
|
586
|
-
spanMs: n,
|
|
587
|
-
tokens: i ? r : null,
|
|
588
|
-
measured: i,
|
|
589
|
-
label: `waited ${le(n)} · ${e.length} polls · ${o}`
|
|
590
|
-
};
|
|
591
|
-
}
|
|
592
|
-
//#endregion
|
|
593
|
-
//#region src/viewer/prompt-text.ts
|
|
594
|
-
function G(e) {
|
|
595
|
-
let t = e.indexOf("[user] "), n = e.startsWith("[system] ") && t >= 0 ? e.slice(t + 7).trim() : e.trim();
|
|
596
|
-
if (!n.startsWith("{")) return n;
|
|
597
|
-
try {
|
|
598
|
-
let e = JSON.parse(n), t = ["objective", "instruction"].map((t) => e[t]).filter((e) => typeof e == "string" && e.trim().length > 0);
|
|
599
|
-
return t.length ? t.join("\n\n") : n;
|
|
600
|
-
} catch {
|
|
601
|
-
return n;
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
//#endregion
|
|
605
|
-
//#region src/viewer/ConversationRowView.tsx
|
|
606
|
-
var K = (e) => e.category === "lifecycle" || e.detail.lifecycle !== void 0, de = (e) => new Intl.NumberFormat("en-US", {
|
|
607
|
-
notation: "compact",
|
|
608
|
-
maximumFractionDigits: 1
|
|
609
|
-
}).format(e), fe = (e) => {
|
|
610
|
-
let t = Math.round(e / 1e3);
|
|
611
|
-
if (t < 60) return `${t} s`;
|
|
612
|
-
let n = Math.floor(t / 60);
|
|
613
|
-
return n < 60 ? `${n} m ${t % 60} s` : `${Math.floor(n / 60)} h ${n % 60} m`;
|
|
614
|
-
};
|
|
615
|
-
function q({ name: e }) {
|
|
616
|
-
let t = e.toLowerCase(), n = /think|reason/.test(t) ? "M8 2.5a4 4 0 0 0-2.5 7.1V11h5V9.6A4 4 0 0 0 8 2.5M6 13.5h4" : /search|grep|find/.test(t) ? "M10 10l3.5 3.5M11 7a4 4 0 1 0-8 0 4 4 0 0 0 8 0" : /bash|shell|exec|run|command/.test(t) ? "M2 3h12v10H2zM4 6l2 2-2 2M8 10h4" : /await|wait|sleep|poll/.test(t) ? "M8 2.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11M8 5v3l2 1.5" : "M10 8a2 2 0 1 0-4 0 2 2 0 0 0 4 0";
|
|
617
|
-
return /* @__PURE__ */ (0, m.jsx)("svg", {
|
|
618
|
-
viewBox: "0 0 16 16",
|
|
619
|
-
width: "14",
|
|
620
|
-
height: "14",
|
|
621
|
-
"aria-hidden": "true",
|
|
622
|
-
children: /* @__PURE__ */ (0, m.jsx)("path", {
|
|
623
|
-
d: n,
|
|
624
|
-
stroke: "currentColor",
|
|
625
|
-
strokeWidth: "1.4",
|
|
626
|
-
fill: "none",
|
|
627
|
-
strokeLinecap: "round",
|
|
628
|
-
strokeLinejoin: "round"
|
|
629
|
-
})
|
|
630
|
-
});
|
|
631
|
-
}
|
|
632
|
-
var pe = /* @__PURE__ */ new Set([
|
|
633
|
-
"bash",
|
|
634
|
-
"shell",
|
|
635
|
-
"command",
|
|
636
|
-
"execute",
|
|
637
|
-
"write",
|
|
638
|
-
"write_file",
|
|
639
|
-
"create_file",
|
|
640
|
-
"edit",
|
|
641
|
-
"patch",
|
|
642
|
-
"read",
|
|
643
|
-
"read_file",
|
|
644
|
-
"cat",
|
|
645
|
-
"grep",
|
|
646
|
-
"search",
|
|
647
|
-
"rg",
|
|
648
|
-
"glob",
|
|
649
|
-
"find",
|
|
650
|
-
"ls",
|
|
651
|
-
"web_search",
|
|
652
|
-
"web_fetch",
|
|
653
|
-
"fetch",
|
|
654
|
-
"task",
|
|
655
|
-
"agent",
|
|
656
|
-
"spawn"
|
|
657
|
-
]), me = {
|
|
658
|
-
bash: "bash",
|
|
659
|
-
shell: "bash",
|
|
660
|
-
command: "bash",
|
|
661
|
-
execute: "bash",
|
|
662
|
-
read: "read",
|
|
663
|
-
read_file: "read",
|
|
664
|
-
cat: "read",
|
|
665
|
-
write: "write",
|
|
666
|
-
write_file: "write",
|
|
667
|
-
create_file: "write",
|
|
668
|
-
edit: "edit",
|
|
669
|
-
patch: "edit",
|
|
670
|
-
grep: "grep",
|
|
671
|
-
search: "grep",
|
|
672
|
-
rg: "grep",
|
|
673
|
-
glob: "glob",
|
|
674
|
-
find: "glob",
|
|
675
|
-
ls: "list"
|
|
676
|
-
}, J = (e) => (e.startsWith("mcp__") && e.slice(e.lastIndexOf("__") + 2) || e).replace(/^agent-runtime-/, ""), he = (e) => {
|
|
677
|
-
if (e !== void 0) try {
|
|
678
|
-
let t = JSON.parse(e);
|
|
679
|
-
return t && typeof t == "object" ? t : e;
|
|
680
|
-
} catch {
|
|
681
|
-
return e;
|
|
682
|
-
}
|
|
683
|
-
}, ge = (e) => {
|
|
684
|
-
let t = e;
|
|
685
|
-
try {
|
|
686
|
-
let n = JSON.parse(e), r = typeof n?.error == "string" ? n.error : typeof n?.message == "string" ? n.message : void 0;
|
|
687
|
-
r && (t = r);
|
|
688
|
-
} catch {}
|
|
689
|
-
return w(t.split("\n").find((e) => e.trim()) ?? "").slice(0, 200);
|
|
690
|
-
};
|
|
691
|
-
function Y(e, t, n, r, i, a) {
|
|
692
|
-
let o = J(t.name), s = n ? O(n) || n.detail.contentOmitted || "" : void 0, c = r === "error" ? "error" : r === "pending" || r === "missing" && a ? "running" : "completed", l = r === "ambiguous" || r === "missing" && !a ? V(r, a) : void 0, d = {
|
|
693
|
-
type: "tool",
|
|
694
|
-
id: e,
|
|
695
|
-
tool: o,
|
|
696
|
-
state: {
|
|
697
|
-
status: c,
|
|
698
|
-
input: he(t.input),
|
|
699
|
-
...s === void 0 ? {} : { output: s },
|
|
700
|
-
...c === "error" ? { error: ge(s ?? "") || "The call failed." } : {},
|
|
701
|
-
...i !== null && i >= 0 ? { time: {
|
|
702
|
-
start: 0,
|
|
703
|
-
end: i
|
|
704
|
-
} } : {},
|
|
705
|
-
...l ? { metadata: { note: l } } : {}
|
|
706
|
-
}
|
|
707
|
-
}, f = pe.has(o.toLowerCase()), p = u(d), m = B(t.input) ?? (p.description || (f ? void 0 : M(t)));
|
|
708
|
-
return {
|
|
709
|
-
id: e,
|
|
710
|
-
kind: "tool",
|
|
711
|
-
part: d,
|
|
712
|
-
call: {
|
|
713
|
-
id: e,
|
|
714
|
-
type: me[o.toLowerCase()] ?? "unknown",
|
|
715
|
-
label: f ? p.title : o.replaceAll("_", " "),
|
|
716
|
-
status: c === "error" ? "error" : c === "running" ? "running" : "success",
|
|
717
|
-
...m ? { detail: m } : {},
|
|
718
|
-
...i !== null && i >= 0 ? { duration: i } : {}
|
|
719
|
-
}
|
|
720
|
-
};
|
|
721
|
-
}
|
|
722
|
-
var _e = (e) => {
|
|
723
|
-
let t = e.state.metadata?.note;
|
|
724
|
-
return t ? /* @__PURE__ */ (0, m.jsx)("span", {
|
|
725
|
-
className: "tool-note",
|
|
726
|
-
children: t
|
|
727
|
-
}) : null;
|
|
728
|
-
}, ve = (e) => e && typeof e == "object" && "bytes" in e ? e : void 0;
|
|
729
|
-
function X({ clip: e, open: t }) {
|
|
730
|
-
return e ? /* @__PURE__ */ (0, m.jsxs)("p", {
|
|
731
|
-
className: "clip-note",
|
|
732
|
-
children: [/* @__PURE__ */ (0, m.jsxs)("span", { children: [new Intl.NumberFormat("en-US").format(e.bytes), " bytes, middle omitted."] }), e.sha256 && t ? /* @__PURE__ */ (0, m.jsx)("button", {
|
|
733
|
-
type: "button",
|
|
734
|
-
className: "link-button",
|
|
735
|
-
"data-load-full": e.sha256,
|
|
736
|
-
onClick: () => t(e.sha256),
|
|
737
|
-
children: "Full output"
|
|
738
|
-
}) : null]
|
|
739
|
-
}) : null;
|
|
740
|
-
}
|
|
741
|
-
function ye(e) {
|
|
742
|
-
let t = ue(e.events), n = B(e.input) ?? w(e.input ?? "");
|
|
743
|
-
return {
|
|
744
|
-
id: e.key,
|
|
745
|
-
kind: "custom",
|
|
746
|
-
content: /* @__PURE__ */ (0, m.jsx)(c, {
|
|
747
|
-
icon: /* @__PURE__ */ (0, m.jsx)(q, { name: e.name }),
|
|
748
|
-
title: J(e.name),
|
|
749
|
-
description: [t.label, n].filter(Boolean).join(" · "),
|
|
750
|
-
descriptionMono: !0,
|
|
751
|
-
children: /* @__PURE__ */ (0, m.jsx)("ol", {
|
|
752
|
-
className: "poll-calls",
|
|
753
|
-
children: e.events.map((e) => /* @__PURE__ */ (0, m.jsxs)("li", {
|
|
754
|
-
"data-message": e.id,
|
|
755
|
-
children: [/* @__PURE__ */ (0, m.jsx)("time", {
|
|
756
|
-
dateTime: e.at,
|
|
757
|
-
children: C(e.at)
|
|
758
|
-
}), /* @__PURE__ */ (0, m.jsx)("span", {
|
|
759
|
-
className: "mono",
|
|
760
|
-
children: B(A(e)[0]?.input) ?? w(A(e)[0]?.input ?? "")
|
|
761
|
-
})]
|
|
762
|
-
}, e.id))
|
|
763
|
-
})
|
|
764
|
-
})
|
|
765
|
-
};
|
|
766
|
-
}
|
|
767
|
-
var be = (e) => ({
|
|
768
|
-
id: e.key,
|
|
769
|
-
kind: "custom",
|
|
770
|
-
content: /* @__PURE__ */ (0, m.jsx)(c, {
|
|
771
|
-
icon: /* @__PURE__ */ (0, m.jsx)(q, { name: e.calls[0]?.name ?? "tool" }),
|
|
772
|
-
title: ce(e.calls),
|
|
773
|
-
description: "args not captured",
|
|
774
|
-
durationMs: e.spanMs || void 0
|
|
775
|
-
})
|
|
776
|
-
});
|
|
777
|
-
function xe(e, t) {
|
|
778
|
-
if (e.kind === "polls") return [ye(e)];
|
|
779
|
-
if (e.kind === "hollow") return [be(e)];
|
|
780
|
-
let { index: n, cutoff: r, anchor: i, thinkingSpan: o, opened: s, paired: l, live: u } = t, d = e.event;
|
|
781
|
-
if (K(d)) {
|
|
782
|
-
let e = O(d);
|
|
783
|
-
return [{
|
|
784
|
-
id: d.id,
|
|
785
|
-
kind: "custom",
|
|
786
|
-
content: /* @__PURE__ */ (0, m.jsxs)("p", {
|
|
787
|
-
className: `lifecycle-note${d.detail.isError ? " lifecycle-error" : ""}`,
|
|
788
|
-
children: [/* @__PURE__ */ (0, m.jsx)("b", { children: d.label }), e && /* @__PURE__ */ (0, m.jsx)("span", { children: w(e).slice(0, 280) })]
|
|
789
|
-
})
|
|
790
|
-
}];
|
|
791
|
-
}
|
|
792
|
-
let f = O(d), p = A(d), h = typeof d.detail.reasoning == "string" ? d.detail.reasoning : "", g = U(d.detail), _ = d.detail.responseStatus === "error", v = d.detail.recordedClaim !== void 0, y = d.detail.toolCallId !== void 0 || d.detail.role === "toolResult";
|
|
793
|
-
if (d.detail.role === "user" && f && !y) {
|
|
794
|
-
let e = G(f), t = e.length > 280 && !s.has(`prompt:${i(d)}`);
|
|
795
|
-
return [{
|
|
796
|
-
id: d.id,
|
|
797
|
-
kind: "message",
|
|
798
|
-
role: "user",
|
|
799
|
-
content: t ? `${e.slice(0, 280).trimEnd()}…` : e,
|
|
800
|
-
timestamp: new Date(d.at)
|
|
801
|
-
}];
|
|
802
|
-
}
|
|
803
|
-
let b = [];
|
|
804
|
-
if (h && b.push({
|
|
805
|
-
id: `${d.id}:reasoning`,
|
|
806
|
-
kind: "custom",
|
|
807
|
-
content: /* @__PURE__ */ (0, m.jsx)(a, {
|
|
808
|
-
part: {
|
|
809
|
-
type: "reasoning",
|
|
810
|
-
text: h
|
|
811
|
-
},
|
|
812
|
-
autoCollapse: !1
|
|
813
|
-
})
|
|
814
|
-
}), g.length) {
|
|
815
|
-
let e = H(d.detail), t = o.get(d.id), n = e === null ? g.join(" · ") : `${t !== void 0 && t >= 1e3 ? `for ${fe(t)} · ` : ""}${de(e)} output tokens · ${g.join(" · ")}`;
|
|
816
|
-
b.push({
|
|
817
|
-
id: `${d.id}:thinking`,
|
|
818
|
-
kind: "custom",
|
|
819
|
-
content: /* @__PURE__ */ (0, m.jsx)("span", {
|
|
820
|
-
"data-thinking-withheld": !0,
|
|
821
|
-
children: /* @__PURE__ */ (0, m.jsx)(c, {
|
|
822
|
-
icon: /* @__PURE__ */ (0, m.jsx)(q, { name: "think" }),
|
|
823
|
-
title: "Thought",
|
|
824
|
-
description: n
|
|
825
|
-
})
|
|
826
|
-
})
|
|
827
|
-
});
|
|
828
|
-
}
|
|
829
|
-
if (_) b.push({
|
|
830
|
-
id: d.id,
|
|
831
|
-
kind: "status",
|
|
832
|
-
tone: "error",
|
|
833
|
-
label: "The request failed",
|
|
834
|
-
detail: f ? w(f).slice(0, 400) : "No assistant response is present in this record."
|
|
835
|
-
});
|
|
836
|
-
else if (v) b.push({
|
|
837
|
-
id: d.id,
|
|
838
|
-
kind: "status",
|
|
839
|
-
tone: "info",
|
|
840
|
-
label: "Recorded finding",
|
|
841
|
-
detail: w(f).slice(0, 600)
|
|
842
|
-
});
|
|
843
|
-
else if (y) {
|
|
844
|
-
let e = d.detail.toolCallId !== void 0 && (n.calls.get(k(d.node, d.detail.toolCallId))?.length ?? 0) > 1;
|
|
845
|
-
b.push(Y(d.id, {
|
|
846
|
-
id: d.id,
|
|
847
|
-
name: d.label || "Tool result"
|
|
848
|
-
}, d, e ? "ambiguous" : d.detail.isError ? "error" : "returned", null, u));
|
|
849
|
-
} else f ? b.push({
|
|
850
|
-
id: d.id,
|
|
851
|
-
kind: "message",
|
|
852
|
-
role: "assistant",
|
|
853
|
-
content: f
|
|
854
|
-
}) : !p.length && !h && !g.length && b.push({
|
|
855
|
-
id: d.id,
|
|
856
|
-
kind: "status",
|
|
857
|
-
label: d.detail.contentOmitted ?? "No text body is present in this record."
|
|
858
|
-
});
|
|
859
|
-
let x = i(d);
|
|
860
|
-
for (let e of p) {
|
|
861
|
-
let t = l(d, e), i = t.filter((e) => S(e.at) <= r).at(-1), a = (n.calls.get(k(d.node, e.id))?.length ?? 0) > 1 ? "ambiguous" : i ? i.detail.isError ? "error" : "returned" : t.some((e) => S(e.at) > r) ? "pending" : "missing", o = (typeof i?.detail.durationMs == "number" ? i.detail.durationMs : null) ?? (i && i.detail.atBasis !== "carried" ? S(i.at) - S(d.at) : null);
|
|
862
|
-
b.push(Y(`tool:${x}:${e.id}`, e, i, a, o, u));
|
|
863
|
-
}
|
|
864
|
-
return b;
|
|
865
|
-
}
|
|
866
|
-
var Se = (e) => e.length ? o(e[e.length - 1]) : void 0;
|
|
867
|
-
function Z({ row: e, items: t, previous: n, context: r }) {
|
|
868
|
-
let { selected: i, opened: a, anchor: s, setOpen: c, flagMarks: u, opener: d, flags: f } = r, p = e.kind === "event" ? [e.event] : e.events, h = p[0], g = t.map((e, r) => /* @__PURE__ */ (0, m.jsx)(l, {
|
|
869
|
-
item: e,
|
|
870
|
-
previous: r ? o(t[r - 1]) : n,
|
|
871
|
-
renderToolActions: _e
|
|
872
|
-
}, e.id)), _ = {
|
|
873
|
-
className: [
|
|
874
|
-
"chat-row",
|
|
875
|
-
p.some((e) => e.id === i) && "selected",
|
|
876
|
-
e.kind === "event" && f?.has(h.id) && "flagged"
|
|
877
|
-
].filter(Boolean).join(" "),
|
|
878
|
-
"data-entry": h.id,
|
|
879
|
-
title: C(h.at),
|
|
880
|
-
...e.kind === "polls" ? { "data-poll-group": e.events.length } : e.kind === "hollow" ? { "data-hollow-group": e.events.length } : {
|
|
881
|
-
"data-message": h.id,
|
|
882
|
-
"data-message-node": h.node
|
|
883
|
-
}
|
|
884
|
-
};
|
|
885
|
-
if (e.kind !== "event" || K(h)) return /* @__PURE__ */ (0, m.jsxs)("div", {
|
|
886
|
-
..._,
|
|
887
|
-
children: [g, e.kind === "event" && u(h)]
|
|
888
|
-
});
|
|
889
|
-
let v = O(h), y = h.detail.toolCallId !== void 0 || h.detail.role === "toolResult", b = ve(h.detail.clip);
|
|
890
|
-
if (h.detail.role === "user" && v && !y) {
|
|
891
|
-
let e = `prompt:${s(h)}`, t = G(v).length > 280, n = t && !a.has(e);
|
|
892
|
-
return /* @__PURE__ */ (0, m.jsxs)("article", {
|
|
893
|
-
..._,
|
|
894
|
-
children: [
|
|
895
|
-
g,
|
|
896
|
-
t && /* @__PURE__ */ (0, m.jsx)("p", {
|
|
897
|
-
className: "ar-prompt-more",
|
|
898
|
-
children: /* @__PURE__ */ (0, m.jsx)("button", {
|
|
899
|
-
type: "button",
|
|
900
|
-
className: "link-button",
|
|
901
|
-
"data-open-key": e,
|
|
902
|
-
"aria-expanded": !n,
|
|
903
|
-
onClick: () => c(e, n),
|
|
904
|
-
children: n ? "Full prompt" : "Shorter"
|
|
905
|
-
})
|
|
906
|
-
}),
|
|
907
|
-
!n && /* @__PURE__ */ (0, m.jsx)(X, {
|
|
908
|
-
clip: b,
|
|
909
|
-
open: d(h)
|
|
910
|
-
}),
|
|
911
|
-
u(h)
|
|
912
|
-
]
|
|
913
|
-
});
|
|
914
|
-
}
|
|
915
|
-
let x = h.detail.recordedClaim !== void 0, S = [h.detail.publicationNote, x ? h.detail.assessment : void 0].filter((e) => !!e);
|
|
916
|
-
return /* @__PURE__ */ (0, m.jsxs)("article", {
|
|
917
|
-
..._,
|
|
918
|
-
children: [
|
|
919
|
-
g,
|
|
920
|
-
v && !y && /* @__PURE__ */ (0, m.jsx)(X, {
|
|
921
|
-
clip: A(h).length ? void 0 : b,
|
|
922
|
-
open: d(h)
|
|
923
|
-
}),
|
|
924
|
-
S.map((e) => /* @__PURE__ */ (0, m.jsx)("p", {
|
|
925
|
-
className: "publication-note",
|
|
926
|
-
children: e
|
|
927
|
-
}, e)),
|
|
928
|
-
u(h)
|
|
929
|
-
]
|
|
930
|
-
});
|
|
931
|
-
}
|
|
932
|
-
//#endregion
|
|
933
|
-
//#region src/viewer/Conversation.tsx
|
|
934
|
-
function Q({ index: e, actor: t, cutoff: n, query: r, category: i, selected: a, openSource: o, flags: c, onFlag: l, lifecycle: u = !1, live: d = !1, opening: f }) {
|
|
935
|
-
let [h, g] = (0, p.useState)(() => {
|
|
936
|
-
let t = R(e.events);
|
|
937
|
-
return new Set(e.events.filter((e) => e.detail.promptKind === "initial").map((e) => `prompt:${t.get(e.id) ?? e.id}`));
|
|
938
|
-
}), _ = (0, p.useRef)(null), v = (0, p.useMemo)(() => R(e.events), [e]), y = (0, p.useCallback)((e) => v.get(e.id) ?? e.id, [v]), b = (e) => o ? (t) => o(t, e) : void 0, x = (e, t) => g((n) => {
|
|
939
|
-
if (n.has(e) === t) return n;
|
|
940
|
-
let r = new Set(n);
|
|
941
|
-
return t ? r.add(e) : r.delete(e), r;
|
|
942
|
-
}), C = (t, n) => {
|
|
943
|
-
let r = k(t.node, n.id);
|
|
944
|
-
return e.calls.get(r)?.length === 1 ? e.results.get(r) ?? [] : [];
|
|
945
|
-
}, w = (0, p.useMemo)(() => {
|
|
946
|
-
if (!a) return;
|
|
947
|
-
let t = e.byEvent.get(a);
|
|
948
|
-
if (t?.detail.toolCallId !== void 0) {
|
|
949
|
-
let n = e.calls.get(k(t.node, t.detail.toolCallId));
|
|
950
|
-
if (n?.length === 1) return n[0].event.id;
|
|
951
|
-
}
|
|
952
|
-
return a;
|
|
953
|
-
}, [a, e]), T = (0, p.useMemo)(() => (e.byActor.get(t) ?? []).filter((t) => {
|
|
954
|
-
if (S(t.at) > n) return !1;
|
|
955
|
-
if (t.id === w) return !0;
|
|
956
|
-
if (K(t)) return u && I(t, e, r, i);
|
|
957
|
-
if (t.detail.toolCallId !== void 0) {
|
|
958
|
-
let r = e.calls.get(k(t.node, t.detail.toolCallId));
|
|
959
|
-
if (r?.length === 1 && S(r[0].event.at) <= n) return !1;
|
|
960
|
-
}
|
|
961
|
-
let a = A(t);
|
|
962
|
-
return !(t.detail.role || O(t) || t.detail.reasoning || t.detail.responseStatus === "error" || a.length) || t.detail.role === "assistant" && !O(t) && !t.detail.reasoning && !a.length && t.detail.responseStatus !== "error" && !t.detail.contentOmitted && (!U(t.detail).length || te(t.detail)) ? !1 : I(t, e, r, i) ? !0 : a.some((a) => {
|
|
963
|
-
let o = k(t.node, a.id);
|
|
964
|
-
return e.calls.get(o)?.length === 1 && (e.results.get(o) ?? []).some((t) => S(t.at) <= n && I(t, e, r, i));
|
|
965
|
-
});
|
|
966
|
-
}), [
|
|
967
|
-
e,
|
|
968
|
-
t,
|
|
969
|
-
n,
|
|
970
|
-
r,
|
|
971
|
-
i,
|
|
972
|
-
u,
|
|
973
|
-
w
|
|
974
|
-
]), E = (0, p.useMemo)(() => {
|
|
975
|
-
if (!f?.text || r || i !== "all" || T.some((e) => e.detail.role === "user")) return T;
|
|
976
|
-
let e = T[0]?.at ?? f.at;
|
|
977
|
-
return [{
|
|
978
|
-
id: `${t}:opening`,
|
|
979
|
-
node: t,
|
|
980
|
-
at: e < f.at ? e : f.at,
|
|
981
|
-
kind: "message",
|
|
982
|
-
category: "other",
|
|
983
|
-
label: "prompt",
|
|
984
|
-
detail: {
|
|
985
|
-
role: "user",
|
|
986
|
-
publicText: f.text,
|
|
987
|
-
promptKind: "initial"
|
|
988
|
-
}
|
|
989
|
-
}, ...T];
|
|
990
|
-
}, [
|
|
991
|
-
T,
|
|
992
|
-
f,
|
|
993
|
-
t,
|
|
994
|
-
r,
|
|
995
|
-
i
|
|
996
|
-
]), D = (0, p.useMemo)(() => se(W(E, {
|
|
997
|
-
callsOf: A,
|
|
998
|
-
answered: (t, n) => ie(e.results.get(k(t.node, n))),
|
|
999
|
-
keyOf: y
|
|
1000
|
-
}), {
|
|
1001
|
-
callsOf: A,
|
|
1002
|
-
captured: (t, n) => (e.results.get(k(t.node, n)) ?? []).some((e) => O(e)),
|
|
1003
|
-
keyOf: y
|
|
1004
|
-
}), [
|
|
1005
|
-
E,
|
|
1006
|
-
e,
|
|
1007
|
-
y
|
|
1008
|
-
]), j = (0, p.useMemo)(() => {
|
|
1009
|
-
let n = /* @__PURE__ */ new Map(), r = null;
|
|
1010
|
-
for (let i of e.byActor.get(t) ?? []) {
|
|
1011
|
-
let e = S(i.at);
|
|
1012
|
-
r !== null && Number.isFinite(e) && U(i.detail).length && n.set(i.id, Math.max(0, e - r)), Number.isFinite(e) && (r = e);
|
|
1013
|
-
}
|
|
1014
|
-
return n;
|
|
1015
|
-
}, [e, t]), M = (0, p.useMemo)(() => {
|
|
1016
|
-
let e = /* @__PURE__ */ new Map();
|
|
1017
|
-
for (let t of D) if (t.kind === "polls") for (let n of t.events) e.set(n.id, t.key);
|
|
1018
|
-
else if (t.kind === "hollow") for (let n of t.events) e.set(n.id, t.key);
|
|
1019
|
-
else e.set(t.event.id, t.key);
|
|
1020
|
-
return e;
|
|
1021
|
-
}, [D]), N = (e.byActor.get(t) ?? []).some((e) => !K(e) && (e.detail.role || O(e) || A(e).length)), P = (0, p.useRef)(w);
|
|
1022
|
-
P.current = w;
|
|
1023
|
-
let F = (0, p.useRef)(!1);
|
|
1024
|
-
(0, p.useLayoutEffect)(() => {
|
|
1025
|
-
F.current = d && !P.current, _.current && !P.current && (_.current.scrollTop = d ? _.current.scrollHeight : 0);
|
|
1026
|
-
}, [t]), (0, p.useEffect)(() => {
|
|
1027
|
-
let e = _.current;
|
|
1028
|
-
if (!e) return;
|
|
1029
|
-
let t = () => {
|
|
1030
|
-
F.current = e.scrollHeight - e.scrollTop - e.clientHeight < 24;
|
|
1031
|
-
};
|
|
1032
|
-
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
1033
|
-
}, []), (0, p.useLayoutEffect)(() => {
|
|
1034
|
-
let e = _.current;
|
|
1035
|
-
if (!e || !F.current) return;
|
|
1036
|
-
e.scrollTop = e.scrollHeight;
|
|
1037
|
-
let t = 0, n = requestAnimationFrame(function r() {
|
|
1038
|
-
F.current && (e.scrollTop = e.scrollHeight, ++t < 20 && (n = requestAnimationFrame(r)));
|
|
1039
|
-
});
|
|
1040
|
-
return () => cancelAnimationFrame(n);
|
|
1041
|
-
}, [D]), (0, p.useEffect)(() => {
|
|
1042
|
-
if (!a) return;
|
|
1043
|
-
let t = e.byEvent.get(a);
|
|
1044
|
-
if (!t) return;
|
|
1045
|
-
let n = [`prompt:${y(t)}`, `reasoning:${y(t)}`];
|
|
1046
|
-
if (t.detail.toolCallId !== void 0) for (let r of e.calls.get(k(t.node, t.detail.toolCallId)) ?? []) n.push(`tool:${y(r.event)}:${r.call.id}`, M.get(r.event.id) ?? "");
|
|
1047
|
-
for (let e of A(t)) n.push(`tool:${y(t)}:${e.id}`);
|
|
1048
|
-
let r = M.get(a);
|
|
1049
|
-
r?.startsWith("polls:") && n.push(r), g((e) => /* @__PURE__ */ new Set([...e, ...n.filter(Boolean)]));
|
|
1050
|
-
}, [a, e]);
|
|
1051
|
-
let L = (e) => {
|
|
1052
|
-
let t = c?.get(e.id);
|
|
1053
|
-
return t?.length ? /* @__PURE__ */ (0, m.jsx)("span", {
|
|
1054
|
-
className: "event-flags",
|
|
1055
|
-
children: t.map((t) => /* @__PURE__ */ (0, m.jsx)("button", {
|
|
1056
|
-
type: "button",
|
|
1057
|
-
className: `event-flag polarity-${t.polarity}`,
|
|
1058
|
-
title: t.title,
|
|
1059
|
-
"data-flag": t.dimension,
|
|
1060
|
-
onClick: () => l?.(t, e),
|
|
1061
|
-
children: t.dimension
|
|
1062
|
-
}, `${t.dimension}:${t.label}`))
|
|
1063
|
-
}) : null;
|
|
1064
|
-
}, z = (0, p.useCallback)((e) => e.key, []), B = (0, p.useCallback)((e) => e.kind === "polls" ? 36 : e.kind === "hollow" || K(e.event) ? 26 : !O(e.event) && A(e.event).length ? 16 + 36 * A(e.event).length : 96, []), V = {
|
|
1065
|
-
index: e,
|
|
1066
|
-
cutoff: n,
|
|
1067
|
-
selected: a,
|
|
1068
|
-
opened: h,
|
|
1069
|
-
anchor: y,
|
|
1070
|
-
opener: b,
|
|
1071
|
-
setOpen: x,
|
|
1072
|
-
flagMarks: L,
|
|
1073
|
-
paired: C,
|
|
1074
|
-
thinkingSpan: j,
|
|
1075
|
-
flags: c,
|
|
1076
|
-
live: d
|
|
1077
|
-
}, H = (0, p.useMemo)(() => D.map((e) => xe(e, V)), [
|
|
1078
|
-
D,
|
|
1079
|
-
h,
|
|
1080
|
-
n,
|
|
1081
|
-
a,
|
|
1082
|
-
d,
|
|
1083
|
-
e,
|
|
1084
|
-
j
|
|
1085
|
-
]);
|
|
1086
|
-
return /* @__PURE__ */ (0, m.jsx)(m.Fragment, { children: /* @__PURE__ */ (0, m.jsxs)("div", {
|
|
1087
|
-
className: "conversation-scroll",
|
|
1088
|
-
"data-chat": !0,
|
|
1089
|
-
ref: _,
|
|
1090
|
-
tabIndex: 0,
|
|
1091
|
-
"aria-label": "Scrollable retained conversation",
|
|
1092
|
-
children: [!D.length && /* @__PURE__ */ (0, m.jsx)("p", {
|
|
1093
|
-
className: "chat-empty",
|
|
1094
|
-
children: r || i !== "all" ? "No messages match this filter." : N ? "No messages at the selected time." : "Conversation not retained. Its absence does not mean the agent did no work."
|
|
1095
|
-
}), /* @__PURE__ */ (0, m.jsx)(s, {
|
|
1096
|
-
className: "ar-chat",
|
|
1097
|
-
children: /* @__PURE__ */ (0, m.jsx)(ee, {
|
|
1098
|
-
items: D,
|
|
1099
|
-
keyOf: z,
|
|
1100
|
-
render: (e, t) => /* @__PURE__ */ (0, m.jsx)(Z, {
|
|
1101
|
-
row: e,
|
|
1102
|
-
items: H[t] ?? [],
|
|
1103
|
-
previous: t ? Se(H[t - 1] ?? []) : void 0,
|
|
1104
|
-
context: V
|
|
1105
|
-
}),
|
|
1106
|
-
scroller: _,
|
|
1107
|
-
target: w ? M.get(w) : void 0,
|
|
1108
|
-
estimate: B
|
|
1109
|
-
})
|
|
1110
|
-
})]
|
|
1111
|
-
}) });
|
|
1112
|
-
}
|
|
1113
|
-
//#endregion
|
|
1114
|
-
//#region src/viewer/prompts.ts
|
|
1115
|
-
function Ce(e) {
|
|
1116
|
-
let t = e.events.map((e) => ({
|
|
1117
|
-
...e,
|
|
1118
|
-
detail: { ...e.detail }
|
|
1119
|
-
}));
|
|
1120
|
-
for (let n of e.nodes.filter((e) => e.kind === "agent")) {
|
|
1121
|
-
let e = t.filter((e) => e.node === n.id), r = e.find((e) => e.detail.role === "assistant")?.at, i = e.filter((e) => e.detail.role === "user" && typeof e.detail.publicText == "string" && !e.detail.publicText.trimStart().startsWith("<task-notification>")), a = i.find((e) => e.detail.promptKind !== "steering" && (!r || e.at <= r));
|
|
1122
|
-
if (a) a.detail.promptKind = "initial";
|
|
1123
|
-
else if (n.assignment?.trim()) {
|
|
1124
|
-
let r = n.start ?? e[0]?.at;
|
|
1125
|
-
r && t.push({
|
|
1126
|
-
id: `prompt:${n.id}`,
|
|
1127
|
-
node: n.id,
|
|
1128
|
-
at: r,
|
|
1129
|
-
kind: "message",
|
|
1130
|
-
category: "other",
|
|
1131
|
-
label: "Prompt",
|
|
1132
|
-
source: null,
|
|
1133
|
-
detail: {
|
|
1134
|
-
role: "user",
|
|
1135
|
-
publicText: n.assignment,
|
|
1136
|
-
promptKind: "initial",
|
|
1137
|
-
promptReconstructed: !0,
|
|
1138
|
-
promptSource: "node.assignment"
|
|
1139
|
-
}
|
|
1140
|
-
});
|
|
1141
|
-
}
|
|
1142
|
-
for (let e of i) e !== a && e.detail.promptKind !== "initial" && (e.detail.promptKind ??= "steering");
|
|
1143
|
-
}
|
|
1144
|
-
return t.sort((e, t) => e.at.localeCompare(t.at) || Number(t.detail.promptKind === "initial") - Number(e.detail.promptKind === "initial")), {
|
|
1145
|
-
...e,
|
|
1146
|
-
events: t
|
|
1147
|
-
};
|
|
1148
|
-
}
|
|
1149
|
-
//#endregion
|
|
1150
|
-
//#region src/workspace/EventDetail.tsx
|
|
1151
|
-
function we({ event: e, full: t, index: n, onClose: r, load: i }) {
|
|
1152
|
-
let [a, o] = (0, p.useState)({}), [s, c] = (0, p.useState)({}), l = e.source;
|
|
1153
|
-
(0, p.useEffect)(() => {
|
|
1154
|
-
t && i(t).then((e) => c({ text: e })).catch((e) => c({ error: e instanceof Error ? e.message : "Unavailable" }));
|
|
1155
|
-
}, [t, i]);
|
|
1156
|
-
let u = (e, t) => i(`${e}${t ? `?line=${t}` : ""}`);
|
|
1157
|
-
return (0, p.useEffect)(() => {
|
|
1158
|
-
let e = (e) => {
|
|
1159
|
-
e.key === "Escape" && r();
|
|
1160
|
-
};
|
|
1161
|
-
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1162
|
-
}, [r]), /* @__PURE__ */ (0, m.jsxs)("aside", {
|
|
1163
|
-
className: "event-detail",
|
|
1164
|
-
role: "dialog",
|
|
1165
|
-
"aria-label": "Event details",
|
|
1166
|
-
"data-event-detail": e.id,
|
|
1167
|
-
children: [
|
|
1168
|
-
/* @__PURE__ */ (0, m.jsxs)("header", { children: [/* @__PURE__ */ (0, m.jsxs)("div", { children: [/* @__PURE__ */ (0, m.jsx)("h3", { children: e.label }), /* @__PURE__ */ (0, m.jsxs)("p", {
|
|
1169
|
-
className: "faint mono",
|
|
1170
|
-
children: [
|
|
1171
|
-
C(e.at, !0),
|
|
1172
|
-
" · ",
|
|
1173
|
-
n.nodes.get(n.canonical(e.node))?.label ?? e.node,
|
|
1174
|
-
" · ",
|
|
1175
|
-
e.category
|
|
1176
|
-
]
|
|
1177
|
-
})] }), /* @__PURE__ */ (0, m.jsx)("button", {
|
|
1178
|
-
type: "button",
|
|
1179
|
-
className: "ui-button",
|
|
1180
|
-
onClick: r,
|
|
1181
|
-
children: "Close"
|
|
1182
|
-
})] }),
|
|
1183
|
-
/* @__PURE__ */ (0, m.jsx)("p", {
|
|
1184
|
-
className: "mono faint event-id",
|
|
1185
|
-
children: e.id
|
|
1186
|
-
}),
|
|
1187
|
-
t ? /* @__PURE__ */ (0, m.jsxs)("section", {
|
|
1188
|
-
className: "event-full",
|
|
1189
|
-
"data-full-output": s.text === void 0 ? void 0 : t,
|
|
1190
|
-
children: [
|
|
1191
|
-
/* @__PURE__ */ (0, m.jsx)("h4", { children: "Full output" }),
|
|
1192
|
-
/* @__PURE__ */ (0, m.jsxs)("p", {
|
|
1193
|
-
className: "mono faint",
|
|
1194
|
-
children: ["sha256 ", t]
|
|
1195
|
-
}),
|
|
1196
|
-
s.error && /* @__PURE__ */ (0, m.jsx)("p", {
|
|
1197
|
-
role: "alert",
|
|
1198
|
-
children: s.error
|
|
1199
|
-
}),
|
|
1200
|
-
s.text === void 0 && !s.error && /* @__PURE__ */ (0, m.jsx)("p", {
|
|
1201
|
-
className: "faint",
|
|
1202
|
-
children: "Loading…"
|
|
1203
|
-
}),
|
|
1204
|
-
s.text !== void 0 && /* @__PURE__ */ (0, m.jsx)(x, {
|
|
1205
|
-
text: s.text,
|
|
1206
|
-
rawLabel: "Original bytes"
|
|
1207
|
-
})
|
|
1208
|
-
]
|
|
1209
|
-
}) : O(e) && (e.detail.toolCallId !== void 0 || e.category === "lifecycle" ? /* @__PURE__ */ (0, m.jsx)(x, { text: O(e) }) : /* @__PURE__ */ (0, m.jsx)(v, { text: O(e) })),
|
|
1210
|
-
/* @__PURE__ */ (0, m.jsxs)("details", {
|
|
1211
|
-
className: "raw-data",
|
|
1212
|
-
open: !t,
|
|
1213
|
-
children: [/* @__PURE__ */ (0, m.jsx)("summary", { children: "Recorded detail" }), /* @__PURE__ */ (0, m.jsx)("pre", { children: JSON.stringify(e.detail, null, 2) })]
|
|
1214
|
-
}),
|
|
1215
|
-
l?.path && /* @__PURE__ */ (0, m.jsxs)("section", {
|
|
1216
|
-
className: "event-source",
|
|
1217
|
-
children: [
|
|
1218
|
-
/* @__PURE__ */ (0, m.jsx)("h4", { children: "Source" }),
|
|
1219
|
-
/* @__PURE__ */ (0, m.jsxs)("p", {
|
|
1220
|
-
className: "mono",
|
|
1221
|
-
children: [
|
|
1222
|
-
l.path,
|
|
1223
|
-
l.line ? `:${l.line}` : "",
|
|
1224
|
-
l.pointer ? `#${l.pointer}` : ""
|
|
1225
|
-
]
|
|
1226
|
-
}),
|
|
1227
|
-
l.sha256 && /* @__PURE__ */ (0, m.jsxs)("p", {
|
|
1228
|
-
className: "mono faint",
|
|
1229
|
-
children: ["sha256 ", l.sha256]
|
|
1230
|
-
}),
|
|
1231
|
-
l.sha256 && l.line && a.text === void 0 && /* @__PURE__ */ (0, m.jsx)("button", {
|
|
1232
|
-
type: "button",
|
|
1233
|
-
className: "ui-button",
|
|
1234
|
-
onClick: () => u(l.sha256, l.line).then((e) => o({ text: e })).catch((e) => o({ error: e instanceof Error ? e.message : "Unavailable" })),
|
|
1235
|
-
children: "Original line"
|
|
1236
|
-
}),
|
|
1237
|
-
a.error && /* @__PURE__ */ (0, m.jsx)("p", {
|
|
1238
|
-
role: "alert",
|
|
1239
|
-
children: a.error
|
|
1240
|
-
}),
|
|
1241
|
-
a.text !== void 0 && /* @__PURE__ */ (0, m.jsx)(x, {
|
|
1242
|
-
text: a.text,
|
|
1243
|
-
rawLabel: "Original bytes"
|
|
1244
|
-
})
|
|
1245
|
-
]
|
|
1246
|
-
})
|
|
1247
|
-
]
|
|
1248
|
-
});
|
|
1249
|
-
}
|
|
1250
|
-
//#endregion
|
|
1251
|
-
//#region src/workspace/source-reader.ts
|
|
1252
|
-
function Te(e) {
|
|
1253
|
-
return async (t) => {
|
|
1254
|
-
let n = await fetch(`${e}/source/${t}`, { credentials: "same-origin" });
|
|
1255
|
-
if (!n.ok) throw Error(n.status === 409 ? "The source no longer matches its recorded hash." : `Source unavailable (HTTP ${n.status})`);
|
|
1256
|
-
return n.text();
|
|
1257
|
-
};
|
|
1258
|
-
}
|
|
1259
|
-
//#endregion
|
|
1260
|
-
//#region src/workspace/record-part.tsx
|
|
1261
|
-
function $(e) {
|
|
1262
|
-
let t = f(e, void 0, !0);
|
|
1263
|
-
return {
|
|
1264
|
-
...(0, p.useMemo)(() => {
|
|
1265
|
-
if (!t.data) return {
|
|
1266
|
-
record: null,
|
|
1267
|
-
index: null,
|
|
1268
|
-
stats: {},
|
|
1269
|
-
error: void 0
|
|
1270
|
-
};
|
|
1271
|
-
try {
|
|
1272
|
-
let e = Ce(d(t.data)), n = t.data.nodeStats ?? {};
|
|
1273
|
-
return {
|
|
1274
|
-
record: e,
|
|
1275
|
-
index: N(e),
|
|
1276
|
-
stats: n,
|
|
1277
|
-
error: void 0
|
|
1278
|
-
};
|
|
1279
|
-
} catch (e) {
|
|
1280
|
-
return {
|
|
1281
|
-
record: null,
|
|
1282
|
-
index: null,
|
|
1283
|
-
stats: {},
|
|
1284
|
-
error: e instanceof Error ? e.message : "Invalid record"
|
|
1285
|
-
};
|
|
1286
|
-
}
|
|
1287
|
-
}, [t.data]),
|
|
1288
|
-
loading: t.loading,
|
|
1289
|
-
fetchError: t.error,
|
|
1290
|
-
pending: !!e && t.data === void 0 && !t.error
|
|
1291
|
-
};
|
|
1292
|
-
}
|
|
1293
|
-
function Ee({ runUrl: e, version: t, index: n, actor: r, opening: i }) {
|
|
1294
|
-
let a = $(`${e}/record?node=${encodeURIComponent(r)}${t}`);
|
|
1295
|
-
return a.index ? /* @__PURE__ */ (0, m.jsx)(De, {
|
|
1296
|
-
runUrl: e,
|
|
1297
|
-
index: a.index,
|
|
1298
|
-
actor: r,
|
|
1299
|
-
opening: i
|
|
1300
|
-
}) : /* @__PURE__ */ (0, m.jsx)("p", {
|
|
1301
|
-
className: "ws-status",
|
|
1302
|
-
role: a.fetchError || a.error ? "alert" : "status",
|
|
1303
|
-
children: a.fetchError || a.error ? `This agent's record is unavailable: ${a.fetchError ?? a.error}` : `Loading ${n.nodes.get(r)?.label ?? "the agent"}'s conversation…`
|
|
1304
|
-
});
|
|
1305
|
-
}
|
|
1306
|
-
function De({ runUrl: e, index: t, actor: n, opening: r }) {
|
|
1307
|
-
let [i, a] = (0, p.useState)(null), o = (0, p.useMemo)(() => Te(e), [e]);
|
|
1308
|
-
return /* @__PURE__ */ (0, m.jsxs)(m.Fragment, { children: [/* @__PURE__ */ (0, m.jsx)(Q, {
|
|
1309
|
-
index: t,
|
|
1310
|
-
actor: n,
|
|
1311
|
-
cutoff: t.end,
|
|
1312
|
-
query: "",
|
|
1313
|
-
category: "all",
|
|
1314
|
-
lifecycle: !1,
|
|
1315
|
-
opening: r,
|
|
1316
|
-
openSource: (e, t) => a({
|
|
1317
|
-
event: t,
|
|
1318
|
-
sha: e
|
|
1319
|
-
})
|
|
1320
|
-
}), i && /* @__PURE__ */ (0, m.jsx)(we, {
|
|
1321
|
-
event: i.event,
|
|
1322
|
-
full: i.sha,
|
|
1323
|
-
index: t,
|
|
1324
|
-
onClose: () => a(null),
|
|
1325
|
-
load: o
|
|
1326
|
-
}, `${i.event.id}:${i.sha ?? ""}`)] });
|
|
1327
|
-
}
|
|
1328
|
-
//#endregion
|
|
1329
|
-
export { N as a, g as c, F as i, v as l, $ as n, P as o, Q as r, C as s, Ee as t };
|