@tangle-network/sandbox-cli 0.21.27 → 0.21.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graph-viewer/{Analytics-DocMpB6T.js → Analytics-DFWW8Phh.js} +260 -275
- package/dist/graph-viewer/Checks-qgqV4xgV.js +155 -0
- package/dist/graph-viewer/{Conversations-CISiWrR9.js → Conversations-CGB45kpj.js} +112 -80
- package/dist/graph-viewer/{Files-Dh8p_Fpw.js → Files-DtZhf0ii.js} +121 -106
- package/dist/graph-viewer/LiveRun-C21wUKAY.js +210 -0
- package/dist/graph-viewer/Overview-BjeLsA2I.js +506 -0
- package/dist/graph-viewer/{RunPage-nJwCsArn.js → RunPage-CkkcBEUe.js} +22 -22
- package/dist/graph-viewer/{Timeline-bPjhV3il.js → Timeline-C2Xolk0t.js} +84 -84
- package/dist/graph-viewer/{Today-pebCsPJ1.js → Today-BVVDtSVN.js} +65 -58
- package/dist/graph-viewer/Topology-DO5XX8e4.js +545 -0
- package/dist/graph-viewer/{Traces-C5x2UvJh.js → Traces-BhMxjNgw.js} +79 -52
- package/dist/graph-viewer/{WallPages-DSmRm2v3.js → WallPages-4d9QUZDq.js} +3 -3
- package/dist/graph-viewer/index.js +103 -102
- package/dist/graph-viewer/{lazy-pages-CpmkG5o2.js → lazy-pages-DM0cZM10.js} +4 -4
- package/dist/graph-viewer/{record-part-Cx9GDQeo.js → record-part-CZal_IMH.js} +382 -352
- package/dist/graph-viewer/report-viewer.js +7 -7
- package/dist/graph-viewer/styles.css +596 -284
- package/dist/graph-viewer/{ui-CEhDqce8.js → ui-D8QZRsC3.js} +143 -111
- package/dist/graph-viewer/viewer/{AgentGraphCanvas-D7jjAE6i-DecKyUGA.js → AgentGraphCanvas-CMdOlSlh-4EervjeC.js} +54 -48
- package/dist/graph-viewer/viewer/{Analytics-CtKucZjs.js → Analytics-DD__nbLm.js} +203 -218
- package/dist/graph-viewer/viewer/{AnswerStrip-DsI9aF-i.js → AnswerStrip-CGUyXuYH.js} +2 -2
- package/dist/graph-viewer/viewer/Checks-Ds5M7eAW.js +156 -0
- package/dist/graph-viewer/viewer/{Conversations-DQBCyko6.js → Conversations-C1n0EBBd.js} +124 -92
- package/dist/graph-viewer/viewer/{Files-B-g25gSO.js → Files-Cjr7NMU_.js} +63 -48
- package/dist/graph-viewer/viewer/{LiveRun-BMQnTpTZ.js → LiveRun-uPTkPSjo.js} +1223 -1164
- package/dist/graph-viewer/viewer/{Outputs-DXnN1wEQ.js → Outputs-CumGyjQo.js} +6 -6
- package/dist/graph-viewer/viewer/Overview-4Umk14_2.js +507 -0
- package/dist/graph-viewer/viewer/{RunPage-ChipoSdO.js → RunPage-DZlBW7Va.js} +28 -28
- package/dist/graph-viewer/viewer/{Scores-CjriXjf_.js → Scores-ZS16yk0n.js} +3 -3
- package/dist/graph-viewer/viewer/{Timeline-DzEzobA0.js → Timeline-BnK6-yBR.js} +24 -24
- package/dist/graph-viewer/viewer/{Today-DLHe_wTA.js → Today-a_-oNigi.js} +69 -62
- package/dist/graph-viewer/viewer/Topology-CQPCLQT6.js +546 -0
- package/dist/graph-viewer/viewer/{Traces-BWBulSPE.js → Traces-C0IGk0L4.js} +75 -48
- package/dist/graph-viewer/viewer/{WallPages-Crj-qPoK.js → WallPages-CzWpyIfp.js} +8 -8
- package/dist/graph-viewer/viewer/{WorkflowGraph-DYsP_Kcg-C0O7M5iH.js → WorkflowGraph-DZ3xejKE-jRXKeSrg.js} +6 -6
- package/dist/graph-viewer/viewer/{agent-timeline-C-UIhXgu.js → agent-timeline-Cs9Qbpvo.js} +437 -425
- package/dist/graph-viewer/viewer/{bot-Bivadvxn.js → bot-D6Nrej7Z.js} +1 -1
- package/dist/graph-viewer/viewer/{chevron-right-WW7tFY6B.js → chevron-right-D_5IKLxu.js} +1 -1
- package/dist/graph-viewer/viewer/{createLucideIcon-Z6KTw8ff.js → createLucideIcon-yH0cxLMy.js} +1 -1
- package/dist/graph-viewer/viewer/{data-azhapQrS.js → data-CkWfWr7i.js} +1 -1
- package/dist/graph-viewer/viewer/{dist-CyOc-K4O.js → dist-C1-7EfoW.js} +3 -3
- package/dist/graph-viewer/viewer/{file-text-B34N7Soo.js → file-text-m7a3piQF.js} +1 -1
- package/dist/graph-viewer/viewer/{final-output-Db2D9cMT.js → final-output-kwY11u9X.js} +1 -1
- package/dist/graph-viewer/viewer/{highlights-Bgg6O5ub.js → highlights-Btsi5OXl.js} +2 -2
- package/dist/graph-viewer/viewer/{jsx-runtime-BSzbUOFc.js → jsx-runtime-DQWyJOhv.js} +1 -1
- package/dist/graph-viewer/viewer/{lazy-pages-fgtpXQ00.js → lazy-pages-BowaGsg-.js} +6 -6
- package/dist/graph-viewer/viewer/{markdown-BpJEJUTW.js → markdown-CX_sVrXB.js} +17 -17
- package/dist/graph-viewer/viewer/{model-brand-bTcMjQtB-C9bHPsPk.js → model-brand-bTcMjQtB-fagiBQam.js} +3 -3
- package/dist/graph-viewer/viewer/{page-header-C6YCPkzJ.js → page-header-Brq611fd.js} +3 -3
- package/dist/graph-viewer/viewer/{popover-DrLB9iar.js → popover-CvOAjlnk.js} +4 -4
- package/dist/graph-viewer/viewer/{react-CisnW4fB.js → react-CY3IbSNO.js} +24 -24
- package/dist/graph-viewer/viewer/{react-dom-C5NDYQCD.js → react-dom-t1L4_-il.js} +1 -1
- package/dist/graph-viewer/viewer/{record-part-d0gKKrMI.js → record-part-D3_Anfpe.js} +455 -425
- package/dist/graph-viewer/viewer/{segmented-control-ChhLMa6h.js → segmented-control-BaJmvTNd.js} +39 -39
- package/dist/graph-viewer/viewer/{shiki-BwlTRTY6.js → shiki-Qnby7Sh6.js} +2 -2
- package/dist/graph-viewer/viewer/{stream-tokenizer-CaVb21TO.js → stream-tokenizer-CWtnjmRd.js} +1 -1
- package/dist/graph-viewer/viewer/{terminal-BxRacTx0.js → terminal-83J_I4Ne.js} +1 -1
- package/dist/graph-viewer/viewer/{themes-BxrCCwH5.js → themes-1i1fzpRk.js} +1 -1
- package/dist/graph-viewer/viewer/{ui-DZiGjPwl.js → ui-C9b1rIUH.js} +222 -190
- package/dist/graph-viewer/viewer/{workspace-DalRxssx.js → workspace-CekmOBs3.js} +76 -76
- package/dist/graph-viewer/viewer/{x-B_F8B4lq.js → x-DOc2URqZ.js} +1 -1
- package/dist/graph-viewer/workspace-viewer.js +103 -102
- package/package.json +6 -6
- package/dist/graph-viewer/Checks-CbnY4tuh.js +0 -113
- package/dist/graph-viewer/LiveRun-C-yKwkKs.js +0 -190
- package/dist/graph-viewer/Overview-BaXPdCFC.js +0 -477
- package/dist/graph-viewer/Topology-CyhuK6XW.js +0 -550
- package/dist/graph-viewer/viewer/Checks-DZTgeYlV.js +0 -114
- package/dist/graph-viewer/viewer/Overview-u7-8-rGx.js +0 -478
- package/dist/graph-viewer/viewer/Topology-Dsmuu27J.js +0 -551
|
@@ -3,29 +3,29 @@ import { useCallback as n, useEffect as r, useLayoutEffect as i, useMemo as a, u
|
|
|
3
3
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
4
4
|
import d from "react-markdown";
|
|
5
5
|
import f from "remark-gfm";
|
|
6
|
-
import {
|
|
7
|
-
import { InlineThinkingItem as
|
|
8
|
-
import { getToolDisplayMetadata as
|
|
6
|
+
import { AgentTimelineColumn as p, AgentTimelineStep as m, agentTimelineStepKind as h } from "@tangle-network/ui/chat";
|
|
7
|
+
import { InlineThinkingItem as g, RunRowShell as _ } from "@tangle-network/ui/run";
|
|
8
|
+
import { getToolDisplayMetadata as v } from "@tangle-network/ui/utils";
|
|
9
9
|
//#region src/viewer/model.ts
|
|
10
|
-
var
|
|
11
|
-
function
|
|
10
|
+
var y = (e) => Date.parse(e);
|
|
11
|
+
function b(e, t = !1) {
|
|
12
12
|
let n = new Date(e);
|
|
13
13
|
if (!Number.isFinite(n.valueOf())) return "Unknown time";
|
|
14
14
|
let r = n.toISOString();
|
|
15
15
|
return `${t ? r.slice(0, 19).replace("T", " ") : r.slice(11, 19)} UTC`;
|
|
16
16
|
}
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
return !e || !(e.includes("/home/") || e.includes("/Users/")) ? e : e.replace(
|
|
17
|
+
var x = (e) => e.replace(/\s+/g, " ").trim(), S = /\/(?:home|Users)\/[^/\s"'`]+(?:\/\.cache\/disco\/host\/[^/\s"'`]+(?:\/sessions\/[^/\s"'`]+)?)?(\/?)/g;
|
|
18
|
+
function C(e) {
|
|
19
|
+
return !e || !(e.includes("/home/") || e.includes("/Users/")) ? e : e.replace(S, (e, t, n, r) => {
|
|
20
20
|
if (!e.includes("/.cache/disco/host/")) return t ? "~/" : "~";
|
|
21
21
|
let i = r[n + e.length];
|
|
22
22
|
return t && i !== void 0 && !/[\s"'`)]/.test(i) ? "" : "./";
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
let t = e.detail, n =
|
|
25
|
+
function w(e) {
|
|
26
|
+
let t = e.detail, n = C(t.publicText), r = C(t.reasoning), i = t.publicToolCalls?.map((e) => e.input && C(e.input) !== e.input ? {
|
|
27
27
|
...e,
|
|
28
|
-
input:
|
|
28
|
+
input: C(e.input)
|
|
29
29
|
} : e);
|
|
30
30
|
return n === t.publicText && r === t.reasoning && i?.every((e, n) => e === t.publicToolCalls[n]) !== !1 ? e : {
|
|
31
31
|
...e,
|
|
@@ -37,19 +37,19 @@ function C(e) {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
var
|
|
40
|
+
var T = (e) => new Intl.NumberFormat("en-US", {
|
|
41
41
|
notation: "compact",
|
|
42
42
|
maximumFractionDigits: 1
|
|
43
|
-
}).format(e),
|
|
44
|
-
function
|
|
43
|
+
}).format(e), E = (e) => e < 1e3 ? `${Math.round(e)} ms` : e < 6e4 ? `${(e / 1e3).toFixed(1)} s` : `${(e / 6e4).toFixed(1)} min`, D = (e) => e?.role ?? (e?.kind === "session" ? "Session" : e?.kind === "finding" ? "Finding" : "Agent"), O = (e) => e.detail.publicText ?? e.detail.recordedClaim ?? "", k = (e, t) => JSON.stringify([e, t]);
|
|
44
|
+
function A(e) {
|
|
45
45
|
let t = e.detail.publicToolCalls ?? [], n = new Map(t.map((e) => [e.id, e]));
|
|
46
46
|
return [.../* @__PURE__ */ new Set([...e.detail.toolCallIds ?? [], ...t.map((e) => e.id)])].map((t) => n.get(t) ?? {
|
|
47
47
|
id: t,
|
|
48
48
|
name: e.detail.toolNames?.length === 1 ? e.detail.toolNames[0] : "Tool call"
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
var
|
|
52
|
-
function
|
|
51
|
+
var j = (e) => e.replace(/^[a-z0-9][\w.-]*-\d{8}[a-z]?:/i, "");
|
|
52
|
+
function M(e) {
|
|
53
53
|
if (e.input === void 0) return "args not captured";
|
|
54
54
|
try {
|
|
55
55
|
let t = JSON.parse(e.input);
|
|
@@ -70,35 +70,35 @@ function j(e) {
|
|
|
70
70
|
"task",
|
|
71
71
|
"prompt",
|
|
72
72
|
"message"
|
|
73
|
-
]) if (typeof e[t] == "string" && e[t]) return
|
|
73
|
+
]) if (typeof e[t] == "string" && e[t]) return x(j(e[t]));
|
|
74
74
|
let n = Object.values(e).filter((e) => [
|
|
75
75
|
"string",
|
|
76
76
|
"number",
|
|
77
77
|
"boolean"
|
|
78
78
|
].includes(typeof e));
|
|
79
|
-
if (n.length) return
|
|
79
|
+
if (n.length) return x(n.map((e) => j(String(e))).join(" · "));
|
|
80
80
|
}
|
|
81
81
|
} catch {}
|
|
82
|
-
return
|
|
82
|
+
return x(e.input);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
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(
|
|
84
|
+
function N(e) {
|
|
85
|
+
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(w).sort((e, t) => y(e.at) - y(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();
|
|
86
86
|
for (let e of i) {
|
|
87
87
|
let t = n(e.node), r = s.get(t) ?? [];
|
|
88
88
|
r.push(e), s.set(t, r);
|
|
89
|
-
for (let t of
|
|
90
|
-
let n =
|
|
89
|
+
for (let t of A(e)) {
|
|
90
|
+
let n = k(e.node, t.id), r = l.get(n) ?? [];
|
|
91
91
|
r.push({
|
|
92
92
|
event: e,
|
|
93
93
|
call: t
|
|
94
94
|
}), l.set(n, r);
|
|
95
95
|
}
|
|
96
96
|
if (e.detail.toolCallId !== void 0) {
|
|
97
|
-
let t =
|
|
97
|
+
let t = k(e.node, e.detail.toolCallId), n = c.get(t) ?? [];
|
|
98
98
|
n.push(e), c.set(t, n);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
let u = i.map((e) =>
|
|
101
|
+
let u = i.map((e) => y(e.at)), d = u[0] ?? 0;
|
|
102
102
|
return {
|
|
103
103
|
nodes: t,
|
|
104
104
|
canonical: n,
|
|
@@ -110,27 +110,27 @@ function M(e) {
|
|
|
110
110
|
calls: l,
|
|
111
111
|
results: c,
|
|
112
112
|
start: d,
|
|
113
|
-
end: i.reduce((e, t) => Math.max(e, t.end ?
|
|
113
|
+
end: i.reduce((e, t) => Math.max(e, t.end ? y(t.end) : y(t.at)), u.at(-1) ?? d)
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function P(e, t) {
|
|
117
117
|
return (e.byActor.get(t) ?? []).some((e) => typeof e.detail.costListUsd == "number" || Object.values(e.detail.usage ?? {}).some((e) => typeof e == "number" && e > 0));
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function F(e, t, n) {
|
|
120
120
|
if (!e?.status && n) return n === "running" ? "working" : n.replaceAll("-", " ");
|
|
121
121
|
let r = e?.status ?? "no terminal state recorded";
|
|
122
122
|
if (t) return r;
|
|
123
123
|
let i = e?.capture?.status;
|
|
124
124
|
return `${r} · no usage recorded${i === "absent" ? "; capture missing" : i === "lossy" ? "; capture partial" : ""}`;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function I(e, t, n, r) {
|
|
127
127
|
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({
|
|
128
128
|
label: e.label,
|
|
129
129
|
node: t.nodes.get(t.canonical(e.node)),
|
|
130
130
|
detail: e.detail
|
|
131
131
|
}).toLowerCase().includes(n));
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function L(e, t, n) {
|
|
134
134
|
let r = n.nodes.get(e.node);
|
|
135
135
|
return {
|
|
136
136
|
...e.source,
|
|
@@ -143,18 +143,18 @@ function I(e, t, n) {
|
|
|
143
143
|
joinProof: r?.joinProof ?? null
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
function
|
|
146
|
+
function R(e, t) {
|
|
147
147
|
if (!e) return null;
|
|
148
148
|
let n = [...new Set(t.nodes.filter((t) => t.agentId === e.id || t.id === e.id).map((e) => e.servedModel).filter((e) => !!e))];
|
|
149
149
|
return n.length ? `${n.join(", ")} (served)` : e.model ? `${e.model} (declared; served model unknown)` : null;
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function z(e, t, n) {
|
|
152
152
|
let r = t.nodes.get(t.canonical(e.node)), i = e.detail.isError === !0 || e.detail.responseStatus === "error", a = e.detail.role ?? e.kind, o = e.label || a, s = [{
|
|
153
153
|
kind: "header",
|
|
154
|
-
value: `${r?.label ?? e.node} · ${
|
|
154
|
+
value: `${r?.label ?? e.node} · ${b(e.at)}`,
|
|
155
155
|
tone: "muted"
|
|
156
156
|
}];
|
|
157
|
-
if (
|
|
157
|
+
if (y(e.at) > n) return s.push({
|
|
158
158
|
kind: "note",
|
|
159
159
|
value: "After the selected time. Select this event to advance."
|
|
160
160
|
}), {
|
|
@@ -172,21 +172,21 @@ function R(e, t, n) {
|
|
|
172
172
|
value: "Request failed",
|
|
173
173
|
tone: "error"
|
|
174
174
|
});
|
|
175
|
-
let c =
|
|
175
|
+
let c = O(e);
|
|
176
176
|
c && s.push({
|
|
177
177
|
kind: "body",
|
|
178
178
|
value: c.slice(0, 200) + (c.length > 200 ? "…" : "")
|
|
179
179
|
});
|
|
180
|
-
let l =
|
|
180
|
+
let l = A(e);
|
|
181
181
|
for (let e of l.slice(0, 2)) s.push({
|
|
182
182
|
kind: "body",
|
|
183
183
|
label: e.name,
|
|
184
|
-
value:
|
|
184
|
+
value: M(e).slice(0, 160)
|
|
185
185
|
});
|
|
186
186
|
let u = e.detail.usage;
|
|
187
187
|
if (u && !e.detail.usageScope) {
|
|
188
188
|
let e = [];
|
|
189
|
-
u.input !== void 0 && e.push(`↑ ${
|
|
189
|
+
u.input !== void 0 && e.push(`↑ ${T(u.input)}`), u.output !== void 0 && e.push(`↓ ${T(u.output)}`), u.cacheRead !== void 0 && e.push(`⟳ ${T(u.cacheRead)}`), u.cacheWrite !== void 0 && e.push(`→ ${T(u.cacheWrite)}`), e.length && s.push({
|
|
190
190
|
kind: "usage",
|
|
191
191
|
value: e.join(" "),
|
|
192
192
|
tone: "accent"
|
|
@@ -206,14 +206,14 @@ function R(e, t, n) {
|
|
|
206
206
|
}
|
|
207
207
|
//#endregion
|
|
208
208
|
//#region src/viewer/StructuredContent.tsx
|
|
209
|
-
function
|
|
209
|
+
function B(e) {
|
|
210
210
|
try {
|
|
211
211
|
return JSON.parse(e);
|
|
212
212
|
} catch {
|
|
213
213
|
return e;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function V({ text: e, resolveHref: t }) {
|
|
217
217
|
return /* @__PURE__ */ l("div", {
|
|
218
218
|
className: "activity-prose",
|
|
219
219
|
children: /* @__PURE__ */ l(d, {
|
|
@@ -239,7 +239,7 @@ function B({ text: e, resolveHref: t }) {
|
|
|
239
239
|
})
|
|
240
240
|
});
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function H({ value: e, depth: t = 0, field: n }) {
|
|
243
243
|
let [r, i] = s(!1);
|
|
244
244
|
if (e == null) return /* @__PURE__ */ l("span", {
|
|
245
245
|
className: "small",
|
|
@@ -250,8 +250,8 @@ function V({ value: e, depth: t = 0, field: n }) {
|
|
|
250
250
|
className: "activity-code",
|
|
251
251
|
children: /* @__PURE__ */ l("code", { children: e })
|
|
252
252
|
});
|
|
253
|
-
let r = t < 3 ?
|
|
254
|
-
return typeof r == "string" ? /* @__PURE__ */ l(
|
|
253
|
+
let r = t < 3 ? B(e) : e;
|
|
254
|
+
return typeof r == "string" ? /* @__PURE__ */ l(V, { text: e }) : /* @__PURE__ */ l(H, {
|
|
255
255
|
value: r,
|
|
256
256
|
depth: t + 1
|
|
257
257
|
});
|
|
@@ -261,7 +261,7 @@ function V({ value: e, depth: t = 0, field: n }) {
|
|
|
261
261
|
let n = r ? e : e.slice(0, 12);
|
|
262
262
|
return /* @__PURE__ */ u("div", {
|
|
263
263
|
className: "structured-items",
|
|
264
|
-
children: [n.map((e, n) => /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
|
|
264
|
+
children: [n.map((e, n) => /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(H, {
|
|
265
265
|
value: e,
|
|
266
266
|
depth: t + 1
|
|
267
267
|
}) }, n)), e.length > n.length && /* @__PURE__ */ u("button", {
|
|
@@ -276,14 +276,14 @@ function V({ value: e, depth: t = 0, field: n }) {
|
|
|
276
276
|
});
|
|
277
277
|
}
|
|
278
278
|
let a = e;
|
|
279
|
-
if (a.type === "text" && typeof a.text == "string") return /* @__PURE__ */ l(
|
|
279
|
+
if (a.type === "text" && typeof a.text == "string") return /* @__PURE__ */ l(H, {
|
|
280
280
|
value: a.text,
|
|
281
281
|
depth: t + 1
|
|
282
282
|
});
|
|
283
283
|
let o = Object.entries(a), c = r ? o : o.slice(0, 16);
|
|
284
284
|
return t > 4 ? /* @__PURE__ */ u("details", { children: [/* @__PURE__ */ l("summary", { children: "Nested data" }), /* @__PURE__ */ l("pre", { children: JSON.stringify(e, null, 2) })] }) : /* @__PURE__ */ u("dl", {
|
|
285
285
|
className: "structured-fields",
|
|
286
|
-
children: [c.map(([e, n]) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("dt", { children: e.replace(/([a-z])([A-Z])/g, "$1 $2").replaceAll("_", " ") }), /* @__PURE__ */ l("dd", { children: /* @__PURE__ */ l(
|
|
286
|
+
children: [c.map(([e, n]) => /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("dt", { children: e.replace(/([a-z])([A-Z])/g, "$1 $2").replaceAll("_", " ") }), /* @__PURE__ */ l("dd", { children: /* @__PURE__ */ l(H, {
|
|
287
287
|
value: n,
|
|
288
288
|
depth: t + 1,
|
|
289
289
|
field: e
|
|
@@ -298,35 +298,35 @@ function V({ value: e, depth: t = 0, field: n }) {
|
|
|
298
298
|
})]
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
let n =
|
|
301
|
+
function U({ text: e, rawLabel: t = "Raw data" }) {
|
|
302
|
+
let n = B(e);
|
|
303
303
|
return /* @__PURE__ */ u("div", {
|
|
304
304
|
className: "structured-content",
|
|
305
|
-
children: [/* @__PURE__ */ l(
|
|
305
|
+
children: [/* @__PURE__ */ l(H, { value: n }), typeof n != "string" && /* @__PURE__ */ u("details", {
|
|
306
306
|
className: "raw-data",
|
|
307
307
|
children: [/* @__PURE__ */ l("summary", { children: t }), /* @__PURE__ */ l("pre", { children: e })]
|
|
308
308
|
})]
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
|
-
var
|
|
312
|
-
function
|
|
311
|
+
var W = /^(command|cmd|code|script|content|new_string|old_string|patch|text|stdout|stderr|output|query|prompt)$/i;
|
|
312
|
+
function G(e, t = [], n = []) {
|
|
313
313
|
if (n.length >= 24 || t.length > 8) return n;
|
|
314
|
-
if (typeof e == "string") (e.includes("\n") || e.length > 120 ||
|
|
314
|
+
if (typeof e == "string") (e.includes("\n") || e.length > 120 || W.test(t.at(-1) ?? "")) && n.push({
|
|
315
315
|
path: t.join(" › ") || "text",
|
|
316
316
|
text: e
|
|
317
317
|
});
|
|
318
|
-
else if (Array.isArray(e)) e.forEach((e, r) =>
|
|
319
|
-
else if (e && typeof e == "object") for (let [r, i] of Object.entries(e))
|
|
318
|
+
else if (Array.isArray(e)) e.forEach((e, r) => G(e, [...t, String(r)], n));
|
|
319
|
+
else if (e && typeof e == "object") for (let [r, i] of Object.entries(e)) G(i, [...t, r], n);
|
|
320
320
|
return n;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
let n =
|
|
322
|
+
function K({ text: e, rawLabel: t = "Raw data" }) {
|
|
323
|
+
let n = B(e);
|
|
324
324
|
if (typeof n != "object" || !n) return /* @__PURE__ */ l("pre", {
|
|
325
325
|
className: "activity-code verbatim",
|
|
326
326
|
"data-verbatim": !0,
|
|
327
327
|
children: /* @__PURE__ */ l("code", { children: e })
|
|
328
328
|
});
|
|
329
|
-
let r =
|
|
329
|
+
let r = G(n);
|
|
330
330
|
return /* @__PURE__ */ u("div", {
|
|
331
331
|
className: "structured-content verbatim",
|
|
332
332
|
"data-verbatim": !0,
|
|
@@ -479,7 +479,7 @@ function ee({ items: e, keyOf: t, render: d, scroller: f, estimate: p = 96, over
|
|
|
479
479
|
}
|
|
480
480
|
//#endregion
|
|
481
481
|
//#region src/viewer/conversation-rows.ts
|
|
482
|
-
function
|
|
482
|
+
function q(e) {
|
|
483
483
|
let t = e.source, n = e.detail.nativeRecordId;
|
|
484
484
|
return typeof n == "string" && n ? JSON.stringify([
|
|
485
485
|
e.node,
|
|
@@ -495,19 +495,19 @@ function te(e) {
|
|
|
495
495
|
t.item ?? null
|
|
496
496
|
]) : e.id;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function J(e) {
|
|
499
499
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
500
500
|
for (let r of e) {
|
|
501
|
-
let e =
|
|
501
|
+
let e = q(r), i = t.get(e) ?? 0;
|
|
502
502
|
t.set(e, i + 1), n.set(r.id, i ? `${e}#${i}` : e);
|
|
503
503
|
}
|
|
504
504
|
return n;
|
|
505
505
|
}
|
|
506
|
-
var
|
|
507
|
-
function
|
|
508
|
-
return e === void 0 ? "args not captured" :
|
|
506
|
+
var Y = (e) => e === void 0 || /^\s*(\{\s*\}|null)?\s*$/.test(e);
|
|
507
|
+
function X(e) {
|
|
508
|
+
return e === void 0 ? "args not captured" : Y(e) ? "empty args" : null;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function te(e, t) {
|
|
511
511
|
switch (e) {
|
|
512
512
|
case "error": return "Error";
|
|
513
513
|
case "returned": return "Returned";
|
|
@@ -516,15 +516,15 @@ function ne(e, t) {
|
|
|
516
516
|
default: return t ? "Pending" : "Result not captured";
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function ne(e) {
|
|
520
520
|
let t = e.usage;
|
|
521
521
|
return typeof t?.output == "number" && Number.isFinite(t.output) ? t.output : null;
|
|
522
522
|
}
|
|
523
523
|
function re(e) {
|
|
524
|
-
let t =
|
|
524
|
+
let t = ne(e);
|
|
525
525
|
return t !== null && t < 2e3;
|
|
526
526
|
}
|
|
527
|
-
function
|
|
527
|
+
function Z(e) {
|
|
528
528
|
let t = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.floor(e) : 0, n = t(e.reasoningOmitted), r = t(e.reasoningRedacted), i = [];
|
|
529
529
|
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;
|
|
530
530
|
}
|
|
@@ -541,13 +541,13 @@ function ae(e) {
|
|
|
541
541
|
var oe = (e) => (e ?? []).some((e) => !ae(e.detail.publicText));
|
|
542
542
|
function se(e, t, n) {
|
|
543
543
|
let r = e.detail;
|
|
544
|
-
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 ||
|
|
544
|
+
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 || Z(r).length || t.length !== 1) return null;
|
|
545
545
|
let i = t[0];
|
|
546
|
-
return i.clip || i.publicationNote || n(i.id) || !
|
|
546
|
+
return i.clip || i.publicationNote || n(i.id) || !Y(i.input) && !ie.test(i.name) ? null : i;
|
|
547
547
|
}
|
|
548
548
|
function ce(e, t, n) {
|
|
549
549
|
let r = e.detail;
|
|
550
|
-
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 ||
|
|
550
|
+
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 || Z(r).length || !t.length || t.some((t) => t.input !== void 0 || t.clip || t.publicationNote || n(e, t.id)) ? null : t;
|
|
551
551
|
}
|
|
552
552
|
function le(e, { callsOf: t, captured: n, keyOf: r, min: i = 2 }) {
|
|
553
553
|
let a = [], o = null, s = () => {
|
|
@@ -627,7 +627,7 @@ function de(e, { callsOf: t, answered: n, keyOf: r, min: i = 2 }) {
|
|
|
627
627
|
});
|
|
628
628
|
continue;
|
|
629
629
|
}
|
|
630
|
-
let c =
|
|
630
|
+
let c = Y(e.input) ? "" : e.input.trim();
|
|
631
631
|
o && (o.name !== e.name || o.args !== c) && s(), o ??= {
|
|
632
632
|
name: e.name,
|
|
633
633
|
args: c,
|
|
@@ -682,7 +682,7 @@ function me(e) {
|
|
|
682
682
|
}
|
|
683
683
|
//#endregion
|
|
684
684
|
//#region src/viewer/ConversationRowView.tsx
|
|
685
|
-
var
|
|
685
|
+
var Q = (e) => e.category === "lifecycle" || e.detail.lifecycle !== void 0, he = (e) => new Intl.NumberFormat("en-US", {
|
|
686
686
|
notation: "compact",
|
|
687
687
|
maximumFractionDigits: 1
|
|
688
688
|
}).format(e), ge = (e) => {
|
|
@@ -691,7 +691,7 @@ var Z = (e) => e.category === "lifecycle" || e.detail.lifecycle !== void 0, he =
|
|
|
691
691
|
let n = Math.floor(t / 60);
|
|
692
692
|
return n < 60 ? `${n} m ${t % 60} s` : `${Math.floor(n / 60)} h ${n % 60} m`;
|
|
693
693
|
};
|
|
694
|
-
function
|
|
694
|
+
function $({ name: e }) {
|
|
695
695
|
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";
|
|
696
696
|
return /* @__PURE__ */ l("svg", {
|
|
697
697
|
viewBox: "0 0 16 16",
|
|
@@ -752,38 +752,38 @@ var _e = /* @__PURE__ */ new Set([
|
|
|
752
752
|
glob: "glob",
|
|
753
753
|
find: "glob",
|
|
754
754
|
ls: "list"
|
|
755
|
-
},
|
|
755
|
+
}, ye = (e) => (e.startsWith("mcp__") && e.slice(e.lastIndexOf("__") + 2) || e).replace(/^agent-runtime-/, ""), be = (e) => {
|
|
756
756
|
if (e !== void 0) try {
|
|
757
757
|
let t = JSON.parse(e);
|
|
758
758
|
return t && typeof t == "object" ? t : e;
|
|
759
759
|
} catch {
|
|
760
760
|
return e;
|
|
761
761
|
}
|
|
762
|
-
},
|
|
762
|
+
}, xe = (e) => {
|
|
763
763
|
let t = e;
|
|
764
764
|
try {
|
|
765
765
|
let n = JSON.parse(e), r = typeof n?.error == "string" ? n.error : typeof n?.message == "string" ? n.message : void 0;
|
|
766
766
|
r && (t = r);
|
|
767
767
|
} catch {}
|
|
768
|
-
return
|
|
768
|
+
return x(t.split("\n").find((e) => e.trim()) ?? "").slice(0, 200);
|
|
769
769
|
};
|
|
770
|
-
function
|
|
771
|
-
let o =
|
|
770
|
+
function Se(e, t, n, r, i, a) {
|
|
771
|
+
let o = ye(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 ? te(r, a) : void 0, u = {
|
|
772
772
|
type: "tool",
|
|
773
773
|
id: e,
|
|
774
774
|
tool: o,
|
|
775
775
|
state: {
|
|
776
776
|
status: c,
|
|
777
|
-
input:
|
|
777
|
+
input: be(t.input),
|
|
778
778
|
...s === void 0 ? {} : { output: s },
|
|
779
|
-
...c === "error" ? { error:
|
|
779
|
+
...c === "error" ? { error: xe(s ?? "") || "The call failed." } : {},
|
|
780
780
|
...i !== null && i >= 0 ? { time: {
|
|
781
781
|
start: 0,
|
|
782
782
|
end: i
|
|
783
783
|
} } : {},
|
|
784
784
|
...l ? { metadata: { note: l } } : {}
|
|
785
785
|
}
|
|
786
|
-
}, d = _e.has(o.toLowerCase()), f =
|
|
786
|
+
}, d = _e.has(o.toLowerCase()), f = v(u), p = X(t.input) ?? (f.description || (d ? void 0 : M(t)));
|
|
787
787
|
return {
|
|
788
788
|
id: e,
|
|
789
789
|
kind: "tool",
|
|
@@ -798,20 +798,13 @@ function xe(e, t, n, r, i, a) {
|
|
|
798
798
|
}
|
|
799
799
|
};
|
|
800
800
|
}
|
|
801
|
-
var
|
|
801
|
+
var Ce = (e) => {
|
|
802
802
|
let t = e.state.metadata?.note;
|
|
803
803
|
return t ? /* @__PURE__ */ l("span", {
|
|
804
804
|
className: "tool-note",
|
|
805
805
|
children: t
|
|
806
806
|
}) : null;
|
|
807
|
-
},
|
|
808
|
-
className: "ar-tl",
|
|
809
|
-
items: [{
|
|
810
|
-
id: e,
|
|
811
|
-
kind: "custom",
|
|
812
|
-
content: t
|
|
813
|
-
}]
|
|
814
|
-
}), we = (e) => e && typeof e == "object" && "bytes" in e ? e : void 0;
|
|
807
|
+
}, we = (e) => e && typeof e == "object" && "bytes" in e ? e : void 0;
|
|
815
808
|
function Te({ clip: e, open: t }) {
|
|
816
809
|
return e ? /* @__PURE__ */ u("p", {
|
|
817
810
|
className: "clip-note",
|
|
@@ -824,296 +817,318 @@ function Te({ clip: e, open: t }) {
|
|
|
824
817
|
}) : null]
|
|
825
818
|
}) : null;
|
|
826
819
|
}
|
|
827
|
-
function Ee(
|
|
828
|
-
let
|
|
829
|
-
return
|
|
830
|
-
|
|
831
|
-
"
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
className: "mono",
|
|
850
|
-
children: J(k(e)[0]?.input) ?? b(k(e)[0]?.input ?? "")
|
|
851
|
-
})]
|
|
852
|
-
}, e.id))
|
|
853
|
-
})
|
|
820
|
+
function Ee(e) {
|
|
821
|
+
let t = pe(e.events), n = X(e.input) ?? x(e.input ?? "");
|
|
822
|
+
return {
|
|
823
|
+
id: e.key,
|
|
824
|
+
kind: "custom",
|
|
825
|
+
content: /* @__PURE__ */ l(_, {
|
|
826
|
+
icon: /* @__PURE__ */ l($, { name: e.name }),
|
|
827
|
+
title: ye(e.name),
|
|
828
|
+
description: [t.label, n].filter(Boolean).join(" · "),
|
|
829
|
+
descriptionMono: !0,
|
|
830
|
+
children: /* @__PURE__ */ l("ol", {
|
|
831
|
+
className: "poll-calls",
|
|
832
|
+
children: e.events.map((e) => /* @__PURE__ */ u("li", {
|
|
833
|
+
"data-message": e.id,
|
|
834
|
+
children: [/* @__PURE__ */ l("time", {
|
|
835
|
+
dateTime: e.at,
|
|
836
|
+
children: b(e.at)
|
|
837
|
+
}), /* @__PURE__ */ l("span", {
|
|
838
|
+
className: "mono",
|
|
839
|
+
children: X(A(e)[0]?.input) ?? x(A(e)[0]?.input ?? "")
|
|
840
|
+
})]
|
|
841
|
+
}, e.id))
|
|
854
842
|
})
|
|
855
843
|
})
|
|
856
|
-
}
|
|
844
|
+
};
|
|
857
845
|
}
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
title:
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
846
|
+
var De = (e) => ({
|
|
847
|
+
id: e.key,
|
|
848
|
+
kind: "custom",
|
|
849
|
+
content: /* @__PURE__ */ l(_, {
|
|
850
|
+
icon: /* @__PURE__ */ l($, { name: e.calls[0]?.name ?? "tool" }),
|
|
851
|
+
title: ue(e.calls),
|
|
852
|
+
description: "args not captured",
|
|
853
|
+
durationMs: e.spanMs || void 0
|
|
854
|
+
})
|
|
855
|
+
});
|
|
856
|
+
function Oe(e, t) {
|
|
857
|
+
if (e.kind === "polls") return [Ee(e)];
|
|
858
|
+
if (e.kind === "hollow") return [De(e)];
|
|
859
|
+
let { index: n, cutoff: r, anchor: i, thinkingSpan: a, opened: o, paired: s, live: c } = t, d = e.event;
|
|
860
|
+
if (Q(d)) {
|
|
861
|
+
let e = O(d);
|
|
862
|
+
return [{
|
|
863
|
+
id: d.id,
|
|
864
|
+
kind: "custom",
|
|
865
|
+
content: /* @__PURE__ */ u("p", {
|
|
866
|
+
className: `lifecycle-note${d.detail.isError ? " lifecycle-error" : ""}`,
|
|
867
|
+
children: [/* @__PURE__ */ l("b", { children: d.label }), e && /* @__PURE__ */ l("span", { children: x(e).slice(0, 280) })]
|
|
871
868
|
})
|
|
872
|
-
}
|
|
873
|
-
});
|
|
874
|
-
}
|
|
875
|
-
function Oe({ row: e, context: t }) {
|
|
876
|
-
if (e.kind === "polls") return /* @__PURE__ */ l(Ee, {
|
|
877
|
-
row: e,
|
|
878
|
-
context: t
|
|
879
|
-
});
|
|
880
|
-
if (e.kind === "hollow") return /* @__PURE__ */ l(De, {
|
|
881
|
-
row: e,
|
|
882
|
-
context: t
|
|
883
|
-
});
|
|
884
|
-
let { index: n, cutoff: r, selected: i, anchor: a, thinkingSpan: o, opened: s, setOpen: c, flagMarks: d, opener: f, flags: _, paired: x, live: S } = t, C = e.event, w = {
|
|
885
|
-
className: [
|
|
886
|
-
"chat-row",
|
|
887
|
-
i === C.id && "selected",
|
|
888
|
-
_?.has(C.id) && "flagged"
|
|
889
|
-
].filter(Boolean).join(" "),
|
|
890
|
-
"data-entry": C.id,
|
|
891
|
-
"data-message": C.id,
|
|
892
|
-
"data-message-node": C.node,
|
|
893
|
-
title: y(C.at)
|
|
894
|
-
};
|
|
895
|
-
if (Z(C)) {
|
|
896
|
-
let e = D(C);
|
|
897
|
-
return /* @__PURE__ */ u("p", {
|
|
898
|
-
...w,
|
|
899
|
-
className: `${w.className} lifecycle-note${C.detail.isError ? " lifecycle-error" : ""}`,
|
|
900
|
-
children: [
|
|
901
|
-
/* @__PURE__ */ l("b", { children: C.label }),
|
|
902
|
-
e && /* @__PURE__ */ l("span", { children: b(e).slice(0, 280) }),
|
|
903
|
-
d(C)
|
|
904
|
-
]
|
|
905
|
-
});
|
|
869
|
+
}];
|
|
906
870
|
}
|
|
907
|
-
let
|
|
908
|
-
if (
|
|
909
|
-
let e = me(
|
|
910
|
-
return
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
timestamp: new Date(C.at),
|
|
918
|
-
actions: n ? /* @__PURE__ */ l("button", {
|
|
919
|
-
type: "button",
|
|
920
|
-
className: "link-button",
|
|
921
|
-
"data-open-key": t,
|
|
922
|
-
"aria-expanded": !r,
|
|
923
|
-
onClick: () => c(t, r),
|
|
924
|
-
children: r ? "Full prompt" : "Shorter"
|
|
925
|
-
}) : void 0
|
|
926
|
-
})
|
|
927
|
-
}),
|
|
928
|
-
!r && /* @__PURE__ */ l(Te, {
|
|
929
|
-
clip: I,
|
|
930
|
-
open: f(C)
|
|
931
|
-
}),
|
|
932
|
-
d(C)
|
|
933
|
-
]
|
|
934
|
-
});
|
|
871
|
+
let f = O(d), p = A(d), m = typeof d.detail.reasoning == "string" ? d.detail.reasoning : "", h = Z(d.detail), v = d.detail.responseStatus === "error", b = d.detail.recordedClaim !== void 0, S = d.detail.toolCallId !== void 0 || d.detail.role === "toolResult";
|
|
872
|
+
if (d.detail.role === "user" && f && !S) {
|
|
873
|
+
let e = me(f), t = e.length > 280 && !o.has(`prompt:${i(d)}`);
|
|
874
|
+
return [{
|
|
875
|
+
id: d.id,
|
|
876
|
+
kind: "message",
|
|
877
|
+
role: "user",
|
|
878
|
+
content: t ? `${e.slice(0, 280).trimEnd()}…` : e,
|
|
879
|
+
timestamp: new Date(d.at)
|
|
880
|
+
}];
|
|
935
881
|
}
|
|
936
|
-
let
|
|
937
|
-
if (
|
|
938
|
-
id: `${
|
|
882
|
+
let C = [];
|
|
883
|
+
if (m && C.push({
|
|
884
|
+
id: `${d.id}:reasoning`,
|
|
939
885
|
kind: "custom",
|
|
940
|
-
content: /* @__PURE__ */ l(
|
|
886
|
+
content: /* @__PURE__ */ l(g, {
|
|
941
887
|
part: {
|
|
942
888
|
type: "reasoning",
|
|
943
|
-
text:
|
|
889
|
+
text: m
|
|
944
890
|
},
|
|
945
891
|
autoCollapse: !1
|
|
946
892
|
})
|
|
947
|
-
}),
|
|
948
|
-
let e =
|
|
949
|
-
|
|
950
|
-
id: `${
|
|
893
|
+
}), h.length) {
|
|
894
|
+
let e = ne(d.detail), t = a.get(d.id), n = e === null ? h.join(" · ") : `${t !== void 0 && t >= 1e3 ? `for ${ge(t)} · ` : ""}${he(e)} output tokens · ${h.join(" · ")}`;
|
|
895
|
+
C.push({
|
|
896
|
+
id: `${d.id}:thinking`,
|
|
951
897
|
kind: "custom",
|
|
952
898
|
content: /* @__PURE__ */ l("span", {
|
|
953
899
|
"data-thinking-withheld": !0,
|
|
954
|
-
children: /* @__PURE__ */ l(
|
|
955
|
-
icon: /* @__PURE__ */ l(
|
|
900
|
+
children: /* @__PURE__ */ l(_, {
|
|
901
|
+
icon: /* @__PURE__ */ l($, { name: "think" }),
|
|
956
902
|
title: "Thought",
|
|
957
903
|
description: n
|
|
958
904
|
})
|
|
959
905
|
})
|
|
960
906
|
});
|
|
961
907
|
}
|
|
962
|
-
if (
|
|
963
|
-
id:
|
|
908
|
+
if (v) C.push({
|
|
909
|
+
id: d.id,
|
|
964
910
|
kind: "status",
|
|
965
911
|
tone: "error",
|
|
966
912
|
label: "The request failed",
|
|
967
|
-
detail:
|
|
913
|
+
detail: f ? x(f).slice(0, 400) : "No assistant response is present in this record."
|
|
968
914
|
});
|
|
969
|
-
else if (
|
|
970
|
-
id:
|
|
915
|
+
else if (b) C.push({
|
|
916
|
+
id: d.id,
|
|
971
917
|
kind: "status",
|
|
972
918
|
tone: "info",
|
|
973
919
|
label: "Recorded finding",
|
|
974
|
-
detail:
|
|
920
|
+
detail: x(f).slice(0, 600)
|
|
975
921
|
});
|
|
976
|
-
else if (
|
|
977
|
-
let e =
|
|
978
|
-
|
|
979
|
-
id:
|
|
980
|
-
name:
|
|
981
|
-
},
|
|
982
|
-
} else
|
|
983
|
-
id:
|
|
922
|
+
else if (S) {
|
|
923
|
+
let e = d.detail.toolCallId !== void 0 && (n.calls.get(k(d.node, d.detail.toolCallId))?.length ?? 0) > 1;
|
|
924
|
+
C.push(Se(d.id, {
|
|
925
|
+
id: d.id,
|
|
926
|
+
name: d.label || "Tool result"
|
|
927
|
+
}, d, e ? "ambiguous" : d.detail.isError ? "error" : "returned", null, c));
|
|
928
|
+
} else f ? C.push({
|
|
929
|
+
id: d.id,
|
|
984
930
|
kind: "message",
|
|
985
931
|
role: "assistant",
|
|
986
|
-
content:
|
|
987
|
-
}) : !
|
|
988
|
-
id:
|
|
932
|
+
content: f
|
|
933
|
+
}) : !p.length && !m && !h.length && C.push({
|
|
934
|
+
id: d.id,
|
|
989
935
|
kind: "status",
|
|
990
|
-
label:
|
|
936
|
+
label: d.detail.contentOmitted ?? "No text body is present in this record."
|
|
991
937
|
});
|
|
992
|
-
let
|
|
993
|
-
for (let e of
|
|
994
|
-
let t =
|
|
995
|
-
|
|
938
|
+
let w = i(d);
|
|
939
|
+
for (let e of p) {
|
|
940
|
+
let t = s(d, e), i = t.filter((e) => y(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) => y(e.at) > r) ? "pending" : "missing", o = (typeof i?.detail.durationMs == "number" ? i.detail.durationMs : null) ?? (i && i.detail.atBasis !== "carried" ? y(i.at) - y(d.at) : null);
|
|
941
|
+
C.push(Se(`tool:${w}:${e.id}`, e, i, a, o, c));
|
|
942
|
+
}
|
|
943
|
+
return C;
|
|
944
|
+
}
|
|
945
|
+
var ke = (e) => e.length ? h(e[e.length - 1]) : void 0;
|
|
946
|
+
function Ae({ row: e, items: t, previous: n, context: r }) {
|
|
947
|
+
let { selected: i, opened: a, anchor: o, setOpen: s, flagMarks: c, opener: d, flags: f } = r, p = e.kind === "event" ? [e.event] : e.events, g = p[0], _ = t.map((e, r) => /* @__PURE__ */ l(m, {
|
|
948
|
+
item: e,
|
|
949
|
+
previous: r ? h(t[r - 1]) : n,
|
|
950
|
+
renderToolActions: Ce
|
|
951
|
+
}, e.id)), v = {
|
|
952
|
+
className: [
|
|
953
|
+
"chat-row",
|
|
954
|
+
p.some((e) => e.id === i) && "selected",
|
|
955
|
+
e.kind === "event" && f?.has(g.id) && "flagged"
|
|
956
|
+
].filter(Boolean).join(" "),
|
|
957
|
+
"data-entry": g.id,
|
|
958
|
+
title: b(g.at),
|
|
959
|
+
...e.kind === "polls" ? { "data-poll-group": e.events.length } : e.kind === "hollow" ? { "data-hollow-group": e.events.length } : {
|
|
960
|
+
"data-message": g.id,
|
|
961
|
+
"data-message-node": g.node
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
if (e.kind !== "event" || Q(g)) return /* @__PURE__ */ u("div", {
|
|
965
|
+
...v,
|
|
966
|
+
children: [_, e.kind === "event" && c(g)]
|
|
967
|
+
});
|
|
968
|
+
let y = O(g), x = g.detail.toolCallId !== void 0 || g.detail.role === "toolResult", S = we(g.detail.clip);
|
|
969
|
+
if (g.detail.role === "user" && y && !x) {
|
|
970
|
+
let e = `prompt:${o(g)}`, t = me(y).length > 280, n = t && !a.has(e);
|
|
971
|
+
return /* @__PURE__ */ u("article", {
|
|
972
|
+
...v,
|
|
973
|
+
children: [
|
|
974
|
+
_,
|
|
975
|
+
t && /* @__PURE__ */ l("p", {
|
|
976
|
+
className: "ar-prompt-more",
|
|
977
|
+
children: /* @__PURE__ */ l("button", {
|
|
978
|
+
type: "button",
|
|
979
|
+
className: "link-button",
|
|
980
|
+
"data-open-key": e,
|
|
981
|
+
"aria-expanded": !n,
|
|
982
|
+
onClick: () => s(e, n),
|
|
983
|
+
children: n ? "Full prompt" : "Shorter"
|
|
984
|
+
})
|
|
985
|
+
}),
|
|
986
|
+
!n && /* @__PURE__ */ l(Te, {
|
|
987
|
+
clip: S,
|
|
988
|
+
open: d(g)
|
|
989
|
+
}),
|
|
990
|
+
c(g)
|
|
991
|
+
]
|
|
992
|
+
});
|
|
996
993
|
}
|
|
997
|
-
let
|
|
994
|
+
let C = g.detail.recordedClaim !== void 0, w = [g.detail.publicationNote, C ? g.detail.assessment : void 0].filter((e) => !!e);
|
|
998
995
|
return /* @__PURE__ */ u("article", {
|
|
999
|
-
...
|
|
996
|
+
...v,
|
|
1000
997
|
children: [
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
}),
|
|
1006
|
-
T && !F && /* @__PURE__ */ l(Te, {
|
|
1007
|
-
clip: E.length ? void 0 : I,
|
|
1008
|
-
open: f(C)
|
|
998
|
+
_,
|
|
999
|
+
y && !x && /* @__PURE__ */ l(Te, {
|
|
1000
|
+
clip: A(g).length ? void 0 : S,
|
|
1001
|
+
open: d(g)
|
|
1009
1002
|
}),
|
|
1010
|
-
|
|
1003
|
+
w.map((e) => /* @__PURE__ */ l("p", {
|
|
1011
1004
|
className: "publication-note",
|
|
1012
1005
|
children: e
|
|
1013
1006
|
}, e)),
|
|
1014
|
-
|
|
1007
|
+
c(g)
|
|
1015
1008
|
]
|
|
1016
1009
|
});
|
|
1017
1010
|
}
|
|
1018
1011
|
//#endregion
|
|
1019
1012
|
//#region src/viewer/Conversation.tsx
|
|
1020
|
-
function
|
|
1021
|
-
let [
|
|
1022
|
-
let t =
|
|
1013
|
+
function je({ index: e, actor: t, cutoff: d, query: f, category: m, selected: h, openSource: g, flags: _, onFlag: v, lifecycle: b = !1, live: x = !1, opening: S }) {
|
|
1014
|
+
let [C, w] = s(() => {
|
|
1015
|
+
let t = J(e.events);
|
|
1023
1016
|
return new Set(e.events.filter((e) => e.detail.promptKind === "initial").map((e) => `prompt:${t.get(e.id) ?? e.id}`));
|
|
1024
|
-
}),
|
|
1017
|
+
}), T = o(null), E = a(() => J(e.events), [e]), D = n((e) => E.get(e.id) ?? e.id, [E]), j = (e) => g ? (t) => g(t, e) : void 0, M = (e, t) => w((n) => {
|
|
1025
1018
|
if (n.has(e) === t) return n;
|
|
1026
1019
|
let r = new Set(n);
|
|
1027
1020
|
return t ? r.add(e) : r.delete(e), r;
|
|
1028
|
-
}),
|
|
1029
|
-
let r =
|
|
1021
|
+
}), N = (t, n) => {
|
|
1022
|
+
let r = k(t.node, n.id);
|
|
1030
1023
|
return e.calls.get(r)?.length === 1 ? e.results.get(r) ?? [] : [];
|
|
1031
|
-
},
|
|
1032
|
-
if (!
|
|
1033
|
-
let t = e.byEvent.get(
|
|
1024
|
+
}, P = a(() => {
|
|
1025
|
+
if (!h) return;
|
|
1026
|
+
let t = e.byEvent.get(h);
|
|
1034
1027
|
if (t?.detail.toolCallId !== void 0) {
|
|
1035
|
-
let n = e.calls.get(
|
|
1028
|
+
let n = e.calls.get(k(t.node, t.detail.toolCallId));
|
|
1036
1029
|
if (n?.length === 1) return n[0].event.id;
|
|
1037
1030
|
}
|
|
1038
|
-
return
|
|
1039
|
-
}, [
|
|
1040
|
-
if (
|
|
1041
|
-
if (t.id ===
|
|
1042
|
-
if (
|
|
1031
|
+
return h;
|
|
1032
|
+
}, [h, e]), F = a(() => (e.byActor.get(t) ?? []).filter((t) => {
|
|
1033
|
+
if (y(t.at) > d) return !1;
|
|
1034
|
+
if (t.id === P) return !0;
|
|
1035
|
+
if (Q(t)) return b && I(t, e, f, m);
|
|
1043
1036
|
if (t.detail.toolCallId !== void 0) {
|
|
1044
|
-
let n = e.calls.get(
|
|
1045
|
-
if (n?.length === 1 &&
|
|
1037
|
+
let n = e.calls.get(k(t.node, t.detail.toolCallId));
|
|
1038
|
+
if (n?.length === 1 && y(n[0].event.at) <= d) return !1;
|
|
1046
1039
|
}
|
|
1047
|
-
let n =
|
|
1048
|
-
return !(t.detail.role ||
|
|
1049
|
-
let r =
|
|
1050
|
-
return e.calls.get(r)?.length === 1 && (e.results.get(r) ?? []).some((t) =>
|
|
1040
|
+
let n = A(t);
|
|
1041
|
+
return !(t.detail.role || O(t) || t.detail.reasoning || t.detail.responseStatus === "error" || n.length) || t.detail.role === "assistant" && !O(t) && !t.detail.reasoning && !n.length && t.detail.responseStatus !== "error" && !t.detail.contentOmitted && (!Z(t.detail).length || re(t.detail)) ? !1 : I(t, e, f, m) ? !0 : n.some((n) => {
|
|
1042
|
+
let r = k(t.node, n.id);
|
|
1043
|
+
return e.calls.get(r)?.length === 1 && (e.results.get(r) ?? []).some((t) => y(t.at) <= d && I(t, e, f, m));
|
|
1051
1044
|
});
|
|
1052
1045
|
}), [
|
|
1053
1046
|
e,
|
|
1054
1047
|
t,
|
|
1055
1048
|
d,
|
|
1056
1049
|
f,
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
]),
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1050
|
+
m,
|
|
1051
|
+
b,
|
|
1052
|
+
P
|
|
1053
|
+
]), L = a(() => {
|
|
1054
|
+
if (!S?.text || f || m !== "all" || F.some((e) => e.detail.role === "user")) return F;
|
|
1055
|
+
let e = F[0]?.at ?? S.at;
|
|
1056
|
+
return [{
|
|
1057
|
+
id: `${t}:opening`,
|
|
1058
|
+
node: t,
|
|
1059
|
+
at: e < S.at ? e : S.at,
|
|
1060
|
+
kind: "message",
|
|
1061
|
+
category: "other",
|
|
1062
|
+
label: "prompt",
|
|
1063
|
+
detail: {
|
|
1064
|
+
role: "user",
|
|
1065
|
+
publicText: S.text,
|
|
1066
|
+
promptKind: "initial"
|
|
1067
|
+
}
|
|
1068
|
+
}, ...F];
|
|
1069
|
+
}, [
|
|
1070
|
+
F,
|
|
1071
|
+
S,
|
|
1072
|
+
t,
|
|
1073
|
+
f,
|
|
1074
|
+
m
|
|
1075
|
+
]), R = a(() => le(de(L, {
|
|
1076
|
+
callsOf: A,
|
|
1077
|
+
answered: (t, n) => oe(e.results.get(k(t.node, n))),
|
|
1078
|
+
keyOf: D
|
|
1064
1079
|
}), {
|
|
1065
|
-
callsOf:
|
|
1066
|
-
captured: (t, n) => (e.results.get(
|
|
1067
|
-
keyOf:
|
|
1080
|
+
callsOf: A,
|
|
1081
|
+
captured: (t, n) => (e.results.get(k(t.node, n)) ?? []).some((e) => O(e)),
|
|
1082
|
+
keyOf: D
|
|
1068
1083
|
}), [
|
|
1069
|
-
|
|
1084
|
+
L,
|
|
1070
1085
|
e,
|
|
1071
|
-
|
|
1072
|
-
]),
|
|
1086
|
+
D
|
|
1087
|
+
]), z = a(() => {
|
|
1073
1088
|
let n = /* @__PURE__ */ new Map(), r = null;
|
|
1074
1089
|
for (let i of e.byActor.get(t) ?? []) {
|
|
1075
|
-
let e =
|
|
1076
|
-
r !== null && Number.isFinite(e) &&
|
|
1090
|
+
let e = y(i.at);
|
|
1091
|
+
r !== null && Number.isFinite(e) && Z(i.detail).length && n.set(i.id, Math.max(0, e - r)), Number.isFinite(e) && (r = e);
|
|
1077
1092
|
}
|
|
1078
1093
|
return n;
|
|
1079
|
-
}, [e, t]),
|
|
1094
|
+
}, [e, t]), B = a(() => {
|
|
1080
1095
|
let e = /* @__PURE__ */ new Map();
|
|
1081
|
-
for (let t of
|
|
1096
|
+
for (let t of R) if (t.kind === "polls") for (let n of t.events) e.set(n.id, t.key);
|
|
1082
1097
|
else if (t.kind === "hollow") for (let n of t.events) e.set(n.id, t.key);
|
|
1083
1098
|
else e.set(t.event.id, t.key);
|
|
1084
1099
|
return e;
|
|
1085
|
-
}, [
|
|
1086
|
-
|
|
1087
|
-
let
|
|
1100
|
+
}, [R]), V = (e.byActor.get(t) ?? []).some((e) => !Q(e) && (e.detail.role || O(e) || A(e).length)), H = o(P);
|
|
1101
|
+
H.current = P;
|
|
1102
|
+
let U = o(!1);
|
|
1088
1103
|
i(() => {
|
|
1089
|
-
|
|
1104
|
+
U.current = x && !H.current, T.current && !H.current && (T.current.scrollTop = x ? T.current.scrollHeight : 0);
|
|
1090
1105
|
}, [t]), r(() => {
|
|
1091
|
-
let e =
|
|
1106
|
+
let e = T.current;
|
|
1092
1107
|
if (!e) return;
|
|
1093
1108
|
let t = () => {
|
|
1094
|
-
|
|
1109
|
+
U.current = e.scrollHeight - e.scrollTop - e.clientHeight < 24;
|
|
1095
1110
|
};
|
|
1096
1111
|
return e.addEventListener("scroll", t, { passive: !0 }), () => e.removeEventListener("scroll", t);
|
|
1097
1112
|
}, []), i(() => {
|
|
1098
|
-
let e =
|
|
1099
|
-
if (!e || !
|
|
1113
|
+
let e = T.current;
|
|
1114
|
+
if (!e || !U.current) return;
|
|
1100
1115
|
e.scrollTop = e.scrollHeight;
|
|
1101
1116
|
let t = 0, n = requestAnimationFrame(function r() {
|
|
1102
|
-
|
|
1117
|
+
U.current && (e.scrollTop = e.scrollHeight, ++t < 20 && (n = requestAnimationFrame(r)));
|
|
1103
1118
|
});
|
|
1104
1119
|
return () => cancelAnimationFrame(n);
|
|
1105
|
-
}, [
|
|
1106
|
-
if (!
|
|
1107
|
-
let t = e.byEvent.get(
|
|
1120
|
+
}, [R]), r(() => {
|
|
1121
|
+
if (!h) return;
|
|
1122
|
+
let t = e.byEvent.get(h);
|
|
1108
1123
|
if (!t) return;
|
|
1109
|
-
let n = [`prompt:${
|
|
1110
|
-
if (t.detail.toolCallId !== void 0) for (let r of e.calls.get(
|
|
1111
|
-
for (let e of
|
|
1112
|
-
let r =
|
|
1113
|
-
r?.startsWith("polls:") && n.push(r),
|
|
1114
|
-
}, [
|
|
1115
|
-
let
|
|
1116
|
-
let t =
|
|
1124
|
+
let n = [`prompt:${D(t)}`, `reasoning:${D(t)}`];
|
|
1125
|
+
if (t.detail.toolCallId !== void 0) for (let r of e.calls.get(k(t.node, t.detail.toolCallId)) ?? []) n.push(`tool:${D(r.event)}:${r.call.id}`, B.get(r.event.id) ?? "");
|
|
1126
|
+
for (let e of A(t)) n.push(`tool:${D(t)}:${e.id}`);
|
|
1127
|
+
let r = B.get(h);
|
|
1128
|
+
r?.startsWith("polls:") && n.push(r), w((e) => /* @__PURE__ */ new Set([...e, ...n.filter(Boolean)]));
|
|
1129
|
+
}, [h, e]);
|
|
1130
|
+
let W = (e) => {
|
|
1131
|
+
let t = _?.get(e.id);
|
|
1117
1132
|
return t?.length ? /* @__PURE__ */ l("span", {
|
|
1118
1133
|
className: "event-flags",
|
|
1119
1134
|
children: t.map((t) => /* @__PURE__ */ l("button", {
|
|
@@ -1121,49 +1136,62 @@ function ke({ index: e, actor: t, cutoff: d, query: f, category: p, selected: m,
|
|
|
1121
1136
|
className: `event-flag polarity-${t.polarity}`,
|
|
1122
1137
|
title: t.title,
|
|
1123
1138
|
"data-flag": t.dimension,
|
|
1124
|
-
onClick: () =>
|
|
1139
|
+
onClick: () => v?.(t, e),
|
|
1125
1140
|
children: t.dimension
|
|
1126
1141
|
}, `${t.dimension}:${t.label}`))
|
|
1127
1142
|
}) : null;
|
|
1128
|
-
},
|
|
1143
|
+
}, G = n((e) => e.key, []), K = n((e) => e.kind === "polls" ? 36 : e.kind === "hollow" || Q(e.event) ? 26 : !O(e.event) && A(e.event).length ? 16 + 36 * A(e.event).length : 96, []), q = {
|
|
1144
|
+
index: e,
|
|
1145
|
+
cutoff: d,
|
|
1146
|
+
selected: h,
|
|
1147
|
+
opened: C,
|
|
1148
|
+
anchor: D,
|
|
1149
|
+
opener: j,
|
|
1150
|
+
setOpen: M,
|
|
1151
|
+
flagMarks: W,
|
|
1152
|
+
paired: N,
|
|
1153
|
+
thinkingSpan: z,
|
|
1154
|
+
flags: _,
|
|
1155
|
+
live: x
|
|
1156
|
+
}, Y = a(() => R.map((e) => Oe(e, q)), [
|
|
1157
|
+
R,
|
|
1158
|
+
C,
|
|
1159
|
+
d,
|
|
1160
|
+
h,
|
|
1161
|
+
x,
|
|
1162
|
+
e,
|
|
1163
|
+
z
|
|
1164
|
+
]);
|
|
1129
1165
|
return /* @__PURE__ */ l(c, { children: /* @__PURE__ */ u("div", {
|
|
1130
1166
|
className: "conversation-scroll",
|
|
1131
1167
|
"data-chat": !0,
|
|
1132
|
-
ref:
|
|
1168
|
+
ref: T,
|
|
1133
1169
|
tabIndex: 0,
|
|
1134
1170
|
"aria-label": "Scrollable retained conversation",
|
|
1135
|
-
children: [!
|
|
1171
|
+
children: [!R.length && /* @__PURE__ */ l("p", {
|
|
1136
1172
|
className: "chat-empty",
|
|
1137
|
-
children: f ||
|
|
1138
|
-
}), /* @__PURE__ */ l(
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
thinkingSpan: I,
|
|
1154
|
-
flags: g,
|
|
1155
|
-
live: b
|
|
1156
|
-
}
|
|
1157
|
-
}),
|
|
1158
|
-
scroller: C,
|
|
1159
|
-
target: M ? L.get(M) : void 0,
|
|
1160
|
-
estimate: U
|
|
1173
|
+
children: f || m !== "all" ? "No messages match this filter." : V ? "No messages at the selected time." : "Conversation not retained. Its absence does not mean the agent did no work."
|
|
1174
|
+
}), /* @__PURE__ */ l(p, {
|
|
1175
|
+
className: "ar-chat",
|
|
1176
|
+
children: /* @__PURE__ */ l(ee, {
|
|
1177
|
+
items: R,
|
|
1178
|
+
keyOf: G,
|
|
1179
|
+
render: (e, t) => /* @__PURE__ */ l(Ae, {
|
|
1180
|
+
row: e,
|
|
1181
|
+
items: Y[t] ?? [],
|
|
1182
|
+
previous: t ? ke(Y[t - 1] ?? []) : void 0,
|
|
1183
|
+
context: q
|
|
1184
|
+
}),
|
|
1185
|
+
scroller: T,
|
|
1186
|
+
target: P ? B.get(P) : void 0,
|
|
1187
|
+
estimate: K
|
|
1188
|
+
})
|
|
1161
1189
|
})]
|
|
1162
1190
|
}) });
|
|
1163
1191
|
}
|
|
1164
1192
|
//#endregion
|
|
1165
1193
|
//#region src/viewer/prompts.ts
|
|
1166
|
-
function
|
|
1194
|
+
function Me(e) {
|
|
1167
1195
|
let t = e.events.map((e) => ({
|
|
1168
1196
|
...e,
|
|
1169
1197
|
detail: { ...e.detail }
|
|
@@ -1199,7 +1227,7 @@ function Ae(e) {
|
|
|
1199
1227
|
}
|
|
1200
1228
|
//#endregion
|
|
1201
1229
|
//#region src/workspace/EventDetail.tsx
|
|
1202
|
-
function
|
|
1230
|
+
function Ne({ event: e, full: t, index: n, onClose: i, load: a }) {
|
|
1203
1231
|
let [o, c] = s({}), [d, f] = s({}), p = e.source;
|
|
1204
1232
|
r(() => {
|
|
1205
1233
|
t && a(t).then((e) => f({ text: e })).catch((e) => f({ error: e instanceof Error ? e.message : "Unavailable" }));
|
|
@@ -1219,7 +1247,7 @@ function je({ event: e, full: t, index: n, onClose: i, load: a }) {
|
|
|
1219
1247
|
/* @__PURE__ */ u("header", { children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h3", { children: e.label }), /* @__PURE__ */ u("p", {
|
|
1220
1248
|
className: "faint mono",
|
|
1221
1249
|
children: [
|
|
1222
|
-
|
|
1250
|
+
b(e.at, !0),
|
|
1223
1251
|
" · ",
|
|
1224
1252
|
n.nodes.get(n.canonical(e.node))?.label ?? e.node,
|
|
1225
1253
|
" · ",
|
|
@@ -1252,12 +1280,12 @@ function je({ event: e, full: t, index: n, onClose: i, load: a }) {
|
|
|
1252
1280
|
className: "faint",
|
|
1253
1281
|
children: "Loading…"
|
|
1254
1282
|
}),
|
|
1255
|
-
d.text !== void 0 && /* @__PURE__ */ l(
|
|
1283
|
+
d.text !== void 0 && /* @__PURE__ */ l(K, {
|
|
1256
1284
|
text: d.text,
|
|
1257
1285
|
rawLabel: "Original bytes"
|
|
1258
1286
|
})
|
|
1259
1287
|
]
|
|
1260
|
-
}) :
|
|
1288
|
+
}) : O(e) && (e.detail.toolCallId !== void 0 || e.category === "lifecycle" ? /* @__PURE__ */ l(K, { text: O(e) }) : /* @__PURE__ */ l(U, { text: O(e) })),
|
|
1261
1289
|
/* @__PURE__ */ u("details", {
|
|
1262
1290
|
className: "raw-data",
|
|
1263
1291
|
open: !t,
|
|
@@ -1289,7 +1317,7 @@ function je({ event: e, full: t, index: n, onClose: i, load: a }) {
|
|
|
1289
1317
|
role: "alert",
|
|
1290
1318
|
children: o.error
|
|
1291
1319
|
}),
|
|
1292
|
-
o.text !== void 0 && /* @__PURE__ */ l(
|
|
1320
|
+
o.text !== void 0 && /* @__PURE__ */ l(K, {
|
|
1293
1321
|
text: o.text,
|
|
1294
1322
|
rawLabel: "Original bytes"
|
|
1295
1323
|
})
|
|
@@ -1300,7 +1328,7 @@ function je({ event: e, full: t, index: n, onClose: i, load: a }) {
|
|
|
1300
1328
|
}
|
|
1301
1329
|
//#endregion
|
|
1302
1330
|
//#region src/workspace/source-reader.ts
|
|
1303
|
-
function
|
|
1331
|
+
function Pe(e) {
|
|
1304
1332
|
return async (t) => {
|
|
1305
1333
|
let n = await fetch(`${e}/source/${t}`, { credentials: "same-origin" });
|
|
1306
1334
|
if (!n.ok) throw Error(n.status === 409 ? "The source no longer matches its recorded hash." : `Source unavailable (HTTP ${n.status})`);
|
|
@@ -1309,7 +1337,7 @@ function Me(e) {
|
|
|
1309
1337
|
}
|
|
1310
1338
|
//#endregion
|
|
1311
1339
|
//#region src/workspace/record-part.tsx
|
|
1312
|
-
function
|
|
1340
|
+
function Fe(n) {
|
|
1313
1341
|
let r = t(n, void 0, !0);
|
|
1314
1342
|
return {
|
|
1315
1343
|
...a(() => {
|
|
@@ -1320,10 +1348,10 @@ function Ne(n) {
|
|
|
1320
1348
|
error: void 0
|
|
1321
1349
|
};
|
|
1322
1350
|
try {
|
|
1323
|
-
let t =
|
|
1351
|
+
let t = Me(e(r.data)), n = r.data.nodeStats ?? {};
|
|
1324
1352
|
return {
|
|
1325
1353
|
record: t,
|
|
1326
|
-
index:
|
|
1354
|
+
index: N(t),
|
|
1327
1355
|
stats: n,
|
|
1328
1356
|
error: void 0
|
|
1329
1357
|
};
|
|
@@ -1341,38 +1369,40 @@ function Ne(n) {
|
|
|
1341
1369
|
pending: !!n && r.data === void 0 && !r.error
|
|
1342
1370
|
};
|
|
1343
1371
|
}
|
|
1344
|
-
function
|
|
1345
|
-
let
|
|
1346
|
-
return
|
|
1372
|
+
function Ie({ runUrl: e, version: t, index: n, actor: r, opening: i }) {
|
|
1373
|
+
let a = Fe(`${e}/record?node=${encodeURIComponent(r)}${t}`);
|
|
1374
|
+
return a.index ? /* @__PURE__ */ l(Le, {
|
|
1347
1375
|
runUrl: e,
|
|
1348
|
-
index:
|
|
1349
|
-
actor: r
|
|
1376
|
+
index: a.index,
|
|
1377
|
+
actor: r,
|
|
1378
|
+
opening: i
|
|
1350
1379
|
}) : /* @__PURE__ */ l("p", {
|
|
1351
1380
|
className: "ws-status",
|
|
1352
|
-
role:
|
|
1353
|
-
children:
|
|
1381
|
+
role: a.fetchError || a.error ? "alert" : "status",
|
|
1382
|
+
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…`
|
|
1354
1383
|
});
|
|
1355
1384
|
}
|
|
1356
|
-
function
|
|
1357
|
-
let [
|
|
1358
|
-
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(
|
|
1385
|
+
function Le({ runUrl: e, index: t, actor: n, opening: r }) {
|
|
1386
|
+
let [i, o] = s(null), d = a(() => Pe(e), [e]);
|
|
1387
|
+
return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(je, {
|
|
1359
1388
|
index: t,
|
|
1360
1389
|
actor: n,
|
|
1361
1390
|
cutoff: t.end,
|
|
1362
1391
|
query: "",
|
|
1363
1392
|
category: "all",
|
|
1364
1393
|
lifecycle: !1,
|
|
1365
|
-
|
|
1394
|
+
opening: r,
|
|
1395
|
+
openSource: (e, t) => o({
|
|
1366
1396
|
event: t,
|
|
1367
1397
|
sha: e
|
|
1368
1398
|
})
|
|
1369
|
-
}),
|
|
1370
|
-
event:
|
|
1371
|
-
full:
|
|
1399
|
+
}), i && /* @__PURE__ */ l(Ne, {
|
|
1400
|
+
event: i.event,
|
|
1401
|
+
full: i.sha,
|
|
1372
1402
|
index: t,
|
|
1373
|
-
onClose: () =>
|
|
1374
|
-
load:
|
|
1375
|
-
}, `${
|
|
1403
|
+
onClose: () => o(null),
|
|
1404
|
+
load: d
|
|
1405
|
+
}, `${i.event.id}:${i.sha ?? ""}`)] });
|
|
1376
1406
|
}
|
|
1377
1407
|
//#endregion
|
|
1378
|
-
export {
|
|
1408
|
+
export { O as _, U as a, b, I as c, N as d, E as f, D as g, y as h, V as i, L as l, R as m, Fe as n, F as o, P as p, je as r, x as s, Ie as t, T as u, k as v, z as y };
|