@tangle-network/sandbox-cli 0.21.64 → 0.21.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -3
- package/SKILL.md +29 -1
- 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 +9 -8
- 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,10 +1,10 @@
|
|
|
1
|
-
import { p as e } from "./data-
|
|
2
|
-
import { a as t,
|
|
3
|
-
import { n as
|
|
4
|
-
import { o
|
|
5
|
-
import { r as
|
|
6
|
-
import { agentFromParam as
|
|
7
|
-
import { useEffect as
|
|
1
|
+
import { p as e } from "./data-DTGmre1W.js";
|
|
2
|
+
import { a as t, k as n, o as r, u as i } from "./ui-xa5w5bEN.js";
|
|
3
|
+
import { n as a } from "./use-file-text-BaE98QxE.js";
|
|
4
|
+
import { o } from "./RunOverview-CSqsunqf.js";
|
|
5
|
+
import { r as s, t as c } from "./run-files-BckQDdTD.js";
|
|
6
|
+
import { agentFromParam as l, agentParam as u } from "./RunPage-F_prVwiV.js";
|
|
7
|
+
import { useEffect as d, useMemo as f, useState as p } from "react";
|
|
8
8
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
9
9
|
import { Popover as _, PopoverContent as v, PopoverTrigger as y, SegmentedControl as b } from "@tangle-network/ui/primitives";
|
|
10
10
|
import { DiffView as x } from "@tangle-network/sandbox-ui/workbench";
|
|
@@ -19,11 +19,11 @@ var T = /* @__PURE__ */ new Set([
|
|
|
19
19
|
"spreadsheet",
|
|
20
20
|
"binary"
|
|
21
21
|
]);
|
|
22
|
-
function E(t, n, r,
|
|
23
|
-
let o = e(!
|
|
24
|
-
data:
|
|
22
|
+
function E(t, n, r, i) {
|
|
23
|
+
let o = e(!i && n && r ? `${t}/tree?ref=${encodeURIComponent(n)}` : null), s = i ? {
|
|
24
|
+
data: i,
|
|
25
25
|
error: void 0
|
|
26
|
-
} : o, c = !!(s.data && r && s.data.paths.includes(r)), l = s.data && c && n && r ? `${t}/blob?ref=${encodeURIComponent(n)}&path=${encodeURIComponent(r)}&expectedCommit=${s.data.commit}` : null, u = !!(r && T.has(C(r))), d =
|
|
26
|
+
} : o, c = !!(s.data && r && s.data.paths.includes(r)), l = s.data && c && n && r ? `${t}/blob?ref=${encodeURIComponent(n)}&path=${encodeURIComponent(r)}&expectedCommit=${s.data.commit}` : null, u = !!(r && T.has(C(r))), d = a(u ? null : l, s.data?.commit);
|
|
27
27
|
return !n || !r ? { state: "idle" } : s.error ? {
|
|
28
28
|
state: "error",
|
|
29
29
|
error: `The code at ${n} is unavailable: ${s.error}`
|
|
@@ -105,20 +105,11 @@ function D({ runUrl: e, base: t, head: n, path: r, headTree: i }) {
|
|
|
105
105
|
})] });
|
|
106
106
|
}
|
|
107
107
|
//#endregion
|
|
108
|
-
//#region src/workspace/use-phone.ts
|
|
109
|
-
var O = "(max-width: 1023px)";
|
|
110
|
-
function k(e = O) {
|
|
111
|
-
return p((t) => {
|
|
112
|
-
let n = window.matchMedia(e);
|
|
113
|
-
return n.addEventListener("change", t), () => n.removeEventListener("change", t);
|
|
114
|
-
}, () => window.matchMedia(e).matches, () => !1);
|
|
115
|
-
}
|
|
116
|
-
//#endregion
|
|
117
108
|
//#region src/workspace/run/Files.tsx
|
|
118
|
-
var
|
|
119
|
-
function
|
|
120
|
-
let [n, r] =
|
|
121
|
-
return
|
|
109
|
+
var O = "Pages", k = "Code", A = (e) => e.name.replaceAll("/", "∕");
|
|
110
|
+
function j(e, t) {
|
|
111
|
+
let [n, r] = p(/* @__PURE__ */ new Map()), i = t.map((e) => e.id).join("|");
|
|
112
|
+
return d(() => {
|
|
122
113
|
let n = new AbortController(), i = !0;
|
|
123
114
|
for (let a of t) fetch(`${e}/diff?base=main&head=${encodeURIComponent(a.id)}`, {
|
|
124
115
|
credentials: "same-origin",
|
|
@@ -131,34 +122,34 @@ function N(e, t) {
|
|
|
131
122
|
};
|
|
132
123
|
}, [e, i]), n;
|
|
133
124
|
}
|
|
134
|
-
function
|
|
135
|
-
let
|
|
136
|
-
if (!
|
|
125
|
+
function M({ api: t, runUrl: a, doc: o, m: s, route: d }) {
|
|
126
|
+
let p = e(`${a}/files`, s.live ? 15e3 : void 0), m = f(() => {
|
|
127
|
+
if (!p.data) return null;
|
|
137
128
|
try {
|
|
138
|
-
return
|
|
129
|
+
return c(p.data, o.run.id, null, t);
|
|
139
130
|
} catch {
|
|
140
131
|
return null;
|
|
141
132
|
}
|
|
142
133
|
}, [
|
|
143
|
-
|
|
144
|
-
|
|
134
|
+
p.data,
|
|
135
|
+
o.run.id,
|
|
145
136
|
t
|
|
146
|
-
]),
|
|
137
|
+
]), g = f(() => s.tree.filter((e) => e.node.hasCode).slice(0, 40), [s]), _ = l(s, o.run.id, d.params.get("scope")) ?? (d.params.get("scope") === "pages" ? "pages" : null), v = f(() => _ === "pages" ? [] : _ ? g.filter((e) => e.id === _) : g, [g, _]), y = j(a, v), b = e(`${a}/tree?ref=main`), x = f(() => {
|
|
147
138
|
let e = [];
|
|
148
|
-
if (
|
|
139
|
+
if (_ === null || _ === "pages") for (let t of m?.items ?? []) e.push({
|
|
149
140
|
key: `page:${t.path}`,
|
|
150
141
|
kind: "page",
|
|
151
|
-
tree: `${
|
|
142
|
+
tree: `${O}/${t.path.replace(/^pages\//, "")}`,
|
|
152
143
|
path: t.path,
|
|
153
144
|
file: t
|
|
154
145
|
});
|
|
155
|
-
let t = new Set(
|
|
156
|
-
for (let n of
|
|
157
|
-
let r =
|
|
146
|
+
let t = new Set(b.data?.paths ?? []);
|
|
147
|
+
for (let n of v) {
|
|
148
|
+
let r = y.get(n.id);
|
|
158
149
|
if (!(!r || "error" in r)) for (let i of r.files) e.push({
|
|
159
|
-
key: `code:${
|
|
150
|
+
key: `code:${u(o.run.id, n.id)}:${i.path}`,
|
|
160
151
|
kind: "code",
|
|
161
|
-
tree: `${
|
|
152
|
+
tree: `${k}/${A(n)}/${i.path}`,
|
|
162
153
|
path: i.path,
|
|
163
154
|
agent: n,
|
|
164
155
|
status: t.has(i.path) ? "M" : "A",
|
|
@@ -169,80 +160,80 @@ function P({ api: t, runUrl: i, doc: a, m: o, route: u }) {
|
|
|
169
160
|
}
|
|
170
161
|
return e;
|
|
171
162
|
}, [
|
|
172
|
-
|
|
173
|
-
_,
|
|
163
|
+
m,
|
|
174
164
|
v,
|
|
175
|
-
y
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
165
|
+
y,
|
|
166
|
+
b.data,
|
|
167
|
+
_,
|
|
168
|
+
o.run.id
|
|
169
|
+
]), S = f(() => new Map(x.map((e) => [e.tree, e])), [x]), C = f(() => Object.fromEntries(x.filter((e) => e.kind === "code").map((e) => [e.tree, e.kind === "code" && e.status === "A" ? "added" : "modified"])), [x]), T = d.params.get("file"), E = n("(max-width: 720px)"), D = x.find((e) => e.key === T) ?? (T || E ? null : x[0] ?? null), M = !m && !p.error ? "Reading the retained files…" : v.some((e) => !y.has(e.id)) && !x.length ? "Reading the agent branches…" : null, P = i(s, (e) => e.node.hasCode, (e) => {
|
|
170
|
+
let t = y.get(e.id);
|
|
171
|
+
return t ? "error" in t ? "not retained" : `${t.files.length} changed` : "";
|
|
172
|
+
}), F = /* @__PURE__ */ h(r, {
|
|
182
173
|
label: "Files written by",
|
|
183
174
|
options: [{
|
|
184
175
|
id: "pages",
|
|
185
176
|
label: "Pages",
|
|
186
|
-
meta:
|
|
187
|
-
}, ...
|
|
177
|
+
meta: m ? `${m.items.length} pages` : ""
|
|
178
|
+
}, ...P],
|
|
188
179
|
all: { label: "Pages and every branch" },
|
|
189
|
-
value:
|
|
190
|
-
placeholder: `Search ${
|
|
180
|
+
value: _,
|
|
181
|
+
placeholder: `Search ${g.length} branches`,
|
|
191
182
|
width: 300,
|
|
192
183
|
className: "rp-fscope",
|
|
193
|
-
onChange: (e) =>
|
|
194
|
-
scope: e === "pages" ? "pages" : e ?
|
|
184
|
+
onChange: (e) => d.go("files", {
|
|
185
|
+
scope: e === "pages" ? "pages" : e ? u(o.run.id, e) : null,
|
|
195
186
|
file: null
|
|
196
187
|
}),
|
|
197
|
-
children:
|
|
188
|
+
children: _ === "pages" ? "Pages" : _ ? s.byId.get(_)?.name ?? "Branch" : "All files"
|
|
198
189
|
});
|
|
199
190
|
return /* @__PURE__ */ h("div", {
|
|
200
191
|
className: "rp-files",
|
|
201
192
|
children: /* @__PURE__ */ h(w, {
|
|
202
|
-
paths:
|
|
203
|
-
status:
|
|
204
|
-
selectedPath:
|
|
193
|
+
paths: x.map((e) => e.tree),
|
|
194
|
+
status: C,
|
|
195
|
+
selectedPath: D?.tree,
|
|
205
196
|
onSelect: (e) => {
|
|
206
|
-
let t =
|
|
207
|
-
t &&
|
|
197
|
+
let t = S.get(e);
|
|
198
|
+
t && d.go("files", { file: t.key });
|
|
208
199
|
},
|
|
209
|
-
onBack: () =>
|
|
210
|
-
headerActions:
|
|
200
|
+
onBack: () => d.go("files", { file: null }),
|
|
201
|
+
headerActions: F,
|
|
211
202
|
search: !0,
|
|
212
203
|
label: "Files",
|
|
213
|
-
expansionKey: `${
|
|
204
|
+
expansionKey: `${o.run.id}:files`,
|
|
214
205
|
emptyState: /* @__PURE__ */ h("p", {
|
|
215
206
|
className: "ws-status",
|
|
216
|
-
role:
|
|
217
|
-
children:
|
|
207
|
+
role: p.error ? "alert" : "status",
|
|
208
|
+
children: p.error ? `The retained files are unavailable: ${p.error}` : M ?? "This run left no pages and no branch changed a file."
|
|
218
209
|
}),
|
|
219
|
-
preview:
|
|
220
|
-
path:
|
|
221
|
-
...
|
|
210
|
+
preview: D ? {
|
|
211
|
+
path: D.tree,
|
|
212
|
+
...N(D, a, d.href("files", { file: D.key }))
|
|
222
213
|
} : void 0,
|
|
223
214
|
style: { height: "100%" }
|
|
224
215
|
})
|
|
225
216
|
});
|
|
226
217
|
}
|
|
227
|
-
function
|
|
218
|
+
function N(e, t, n) {
|
|
228
219
|
return {
|
|
229
|
-
actions: /* @__PURE__ */ h(
|
|
220
|
+
actions: /* @__PURE__ */ h(F, {
|
|
230
221
|
entry: e,
|
|
231
222
|
runUrl: t,
|
|
232
223
|
link: n
|
|
233
224
|
}),
|
|
234
|
-
content: /* @__PURE__ */ h(
|
|
225
|
+
content: /* @__PURE__ */ h(L, {
|
|
235
226
|
entry: e,
|
|
236
227
|
runUrl: t
|
|
237
228
|
}, e.key)
|
|
238
229
|
};
|
|
239
230
|
}
|
|
240
|
-
var
|
|
241
|
-
let [e, t] =
|
|
231
|
+
var P = () => {
|
|
232
|
+
let [e, t] = p(() => {
|
|
242
233
|
let e = new URLSearchParams(window.location.search).get("fileView");
|
|
243
234
|
return e === "source" || e === "diff" ? e : "preview";
|
|
244
235
|
});
|
|
245
|
-
return
|
|
236
|
+
return d(() => {
|
|
246
237
|
let e = (e) => t(e.detail);
|
|
247
238
|
return window.addEventListener("rp-file-view", e), () => window.removeEventListener("rp-file-view", e);
|
|
248
239
|
}, []), [e, (e) => {
|
|
@@ -250,8 +241,8 @@ var I = () => {
|
|
|
250
241
|
e === "preview" ? t.delete("fileView") : t.set("fileView", e), window.history.replaceState(null, "", `${window.location.pathname}${t.size ? `?${t}` : ""}`), window.dispatchEvent(new CustomEvent("rp-file-view", { detail: e }));
|
|
251
242
|
}];
|
|
252
243
|
};
|
|
253
|
-
function
|
|
254
|
-
let [i, a] =
|
|
244
|
+
function F({ entry: e, runUrl: n, link: r }) {
|
|
245
|
+
let [i, a] = P(), [o, c] = p(!1), l = e.path.split("/").pop() ?? e.path, u = C(e.path), d = [...u === "markdown" || u === "csv" ? [{
|
|
255
246
|
value: "preview",
|
|
256
247
|
label: "Preview"
|
|
257
248
|
}, {
|
|
@@ -260,7 +251,7 @@ function L({ entry: e, runUrl: n, link: r }) {
|
|
|
260
251
|
}] : [], ...e.kind === "code" ? [{
|
|
261
252
|
value: "diff",
|
|
262
253
|
label: "Changes"
|
|
263
|
-
}] : []],
|
|
254
|
+
}] : []], f = e.kind === "page" ? s(e.file) : `${n}/blob?ref=${encodeURIComponent(e.agent.id)}&path=${encodeURIComponent(e.path)}`;
|
|
264
255
|
return /* @__PURE__ */ g("span", {
|
|
265
256
|
className: "rp-factions",
|
|
266
257
|
children: [d.length > 1 && /* @__PURE__ */ h(b, {
|
|
@@ -271,9 +262,9 @@ function L({ entry: e, runUrl: n, link: r }) {
|
|
|
271
262
|
}), /* @__PURE__ */ g("span", {
|
|
272
263
|
className: "rp-group ph-hide",
|
|
273
264
|
children: [
|
|
274
|
-
|
|
265
|
+
f && /* @__PURE__ */ h("a", {
|
|
275
266
|
className: "rp-btn ic",
|
|
276
|
-
href:
|
|
267
|
+
href: f,
|
|
277
268
|
download: l,
|
|
278
269
|
"aria-label": `Download ${l}`,
|
|
279
270
|
title: "Download",
|
|
@@ -282,14 +273,14 @@ function L({ entry: e, runUrl: n, link: r }) {
|
|
|
282
273
|
/* @__PURE__ */ h("button", {
|
|
283
274
|
type: "button",
|
|
284
275
|
className: "rp-btn ic",
|
|
285
|
-
"aria-label":
|
|
286
|
-
title:
|
|
276
|
+
"aria-label": o ? "Link copied" : "Copy link",
|
|
277
|
+
title: o ? "Copied" : "Copy link",
|
|
287
278
|
onClick: () => {
|
|
288
279
|
navigator.clipboard?.writeText(new URL(r, window.location.href).toString()).then(() => {
|
|
289
280
|
c(!0), window.setTimeout(() => c(!1), 1500);
|
|
290
281
|
});
|
|
291
282
|
},
|
|
292
|
-
children: /* @__PURE__ */ h(t, { name:
|
|
283
|
+
children: /* @__PURE__ */ h(t, { name: o ? "check" : "link" })
|
|
293
284
|
}),
|
|
294
285
|
/* @__PURE__ */ g(_, { children: [/* @__PURE__ */ h(y, {
|
|
295
286
|
asChild: !0,
|
|
@@ -303,13 +294,13 @@ function L({ entry: e, runUrl: n, link: r }) {
|
|
|
303
294
|
}), /* @__PURE__ */ h(v, {
|
|
304
295
|
className: "rp-pop",
|
|
305
296
|
align: "end",
|
|
306
|
-
children: /* @__PURE__ */ h(
|
|
297
|
+
children: /* @__PURE__ */ h(I, { entry: e })
|
|
307
298
|
})] })
|
|
308
299
|
]
|
|
309
300
|
})]
|
|
310
301
|
});
|
|
311
302
|
}
|
|
312
|
-
function
|
|
303
|
+
function I({ entry: e }) {
|
|
313
304
|
let t = e.path.split("/").pop();
|
|
314
305
|
if (e.kind === "page") {
|
|
315
306
|
let n = e.file;
|
|
@@ -322,7 +313,7 @@ function R({ entry: e }) {
|
|
|
322
313
|
/* @__PURE__ */ h("dt", { children: "Source" }),
|
|
323
314
|
/* @__PURE__ */ h("dd", { children: n.source === "knowledge" ? "Knowledge page in the run's pages" : n.source }),
|
|
324
315
|
/* @__PURE__ */ h("dt", { children: "Size" }),
|
|
325
|
-
/* @__PURE__ */ h("dd", { children:
|
|
316
|
+
/* @__PURE__ */ h("dd", { children: o(n.bytes) }),
|
|
326
317
|
/* @__PURE__ */ h("dt", { children: n.sha256 ? "SHA-256" : "Git blob" }),
|
|
327
318
|
/* @__PURE__ */ h("dd", {
|
|
328
319
|
className: "mono",
|
|
@@ -367,15 +358,15 @@ function R({ entry: e }) {
|
|
|
367
358
|
] })
|
|
368
359
|
})] });
|
|
369
360
|
}
|
|
370
|
-
function
|
|
371
|
-
let [n] =
|
|
361
|
+
function L({ entry: e, runUrl: t }) {
|
|
362
|
+
let [n] = P(), r = e.path.split("/").pop() ?? e.path, i = C(e.path), o = i === "markdown" || i === "csv", c = [
|
|
372
363
|
"image",
|
|
373
364
|
"pdf",
|
|
374
365
|
"video",
|
|
375
366
|
"audio",
|
|
376
367
|
"spreadsheet",
|
|
377
368
|
"binary"
|
|
378
|
-
].includes(
|
|
369
|
+
].includes(i), l = e.kind === "page" ? s(e.file) : null, u = a(e.kind === "page" && !c ? l : null), d = E(t, e.kind === "code" ? e.agent.id : null, e.kind === "code" ? e.path : null), f = n === "source" && o ? `${r}.txt` : r;
|
|
379
370
|
return e.kind === "code" && n === "diff" ? /* @__PURE__ */ h("div", {
|
|
380
371
|
className: "rp-doc",
|
|
381
372
|
children: /* @__PURE__ */ h(D, {
|
|
@@ -405,7 +396,7 @@ function z({ entry: e, runUrl: t }) {
|
|
|
405
396
|
"…"
|
|
406
397
|
]
|
|
407
398
|
}) : /* @__PURE__ */ h("div", {
|
|
408
|
-
className: `rp-doc${n === "source" || !
|
|
399
|
+
className: `rp-doc${n === "source" || !o ? " code" : ""}`,
|
|
409
400
|
children: /* @__PURE__ */ h(S, {
|
|
410
401
|
filename: f,
|
|
411
402
|
content: u.text,
|
|
@@ -430,7 +421,7 @@ function z({ entry: e, runUrl: t }) {
|
|
|
430
421
|
"."
|
|
431
422
|
]
|
|
432
423
|
}) : d.state === "ready" ? /* @__PURE__ */ h("div", {
|
|
433
|
-
className: `rp-doc${n === "source" || !
|
|
424
|
+
className: `rp-doc${n === "source" || !o ? " code" : ""}`,
|
|
434
425
|
children: /* @__PURE__ */ h(S, {
|
|
435
426
|
filename: f,
|
|
436
427
|
content: d.text,
|
|
@@ -447,4 +438,4 @@ function z({ entry: e, runUrl: t }) {
|
|
|
447
438
|
});
|
|
448
439
|
}
|
|
449
440
|
//#endregion
|
|
450
|
-
export {
|
|
441
|
+
export { M as Files };
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { p as e } from "./data-DTGmre1W.js";
|
|
2
|
+
import { useEffect as t, useMemo as n, useState as r } from "react";
|
|
3
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
+
import { runStatus as s } from "@tangle-network/ui/run";
|
|
5
|
+
import { TraceWorkspace as c } from "@tangle-network/sandbox-ui/run";
|
|
6
|
+
import "@tangle-network/sandbox-ui/workflows";
|
|
7
|
+
import { SandboxArtifactPane as l } from "@tangle-network/sandbox-ui/workbench";
|
|
8
|
+
//#region src/workspace/LiveInspection.tsx
|
|
9
|
+
function u(n, s, c) {
|
|
10
|
+
let u = e(n ?? null, s ? 3e3 : void 0, !1, c), [d, f] = r(), [p, m] = r(), h = u.data?.files?.entries ?? [], g = h.find((e) => e.path === d) ?? h[0], _ = g && n ? `${n}/file?path=${encodeURIComponent(g.path)}` : null, v = e(_, s ? 3e3 : void 0, !1, c), y = v.data?.file, b = y && g && y.path === g.path && y.sha256 === g.sha256 && y.byteLength === g.byteLength, x = b ? `${g.path}:${g.sha256}` : void 0;
|
|
11
|
+
t(() => {
|
|
12
|
+
if (!x || !y) return;
|
|
13
|
+
let e = URL.createObjectURL(new Blob([y.content], { type: "text/plain;charset=utf-8" }));
|
|
14
|
+
return m({
|
|
15
|
+
key: x,
|
|
16
|
+
href: e
|
|
17
|
+
}), () => URL.revokeObjectURL(e);
|
|
18
|
+
}, [x, y?.content]);
|
|
19
|
+
let S = u.data?.coverage, C = u.status === 404 ? void 0 : S ? /* @__PURE__ */ o("details", {
|
|
20
|
+
className: "ws-status",
|
|
21
|
+
open: S.status !== "complete",
|
|
22
|
+
"data-capture-status": S.status,
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ a("summary", { children: S.status === "complete" ? "Conversation retained" : "Conversation incomplete" }),
|
|
25
|
+
/* @__PURE__ */ a("p", { children: S.reason ?? S.source }),
|
|
26
|
+
!!u.data?.context?.length && /* @__PURE__ */ o("details", { children: [/* @__PURE__ */ a("summary", { children: "Recorded context" }), u.data.context.map((e, t) => /* @__PURE__ */ a("pre", {
|
|
27
|
+
className: "ws-code",
|
|
28
|
+
children: e.event.text
|
|
29
|
+
}, `${e.at}:${t}`))] }),
|
|
30
|
+
u.data?.files?.scope === "none" && /* @__PURE__ */ a("p", { children: u.data.files.reason ?? "No workspace inventory was captured." })
|
|
31
|
+
]
|
|
32
|
+
}) : u.error ? /* @__PURE__ */ o("p", {
|
|
33
|
+
className: "ws-status",
|
|
34
|
+
role: "alert",
|
|
35
|
+
children: ["Conversation inspection unavailable: ", u.error]
|
|
36
|
+
}) : void 0;
|
|
37
|
+
return {
|
|
38
|
+
scoreboard: /* @__PURE__ */ o(i, { children: [C, u.data?.files && !u.data.files.complete && /* @__PURE__ */ o("p", {
|
|
39
|
+
className: "ws-status",
|
|
40
|
+
role: "alert",
|
|
41
|
+
children: ["Workspace inventory incomplete: ", u.data.files.reason ?? "Some files could not be retained."]
|
|
42
|
+
})] }),
|
|
43
|
+
files: g ? /* @__PURE__ */ a("section", {
|
|
44
|
+
"aria-label": "Retained files",
|
|
45
|
+
className: "flex min-h-0 flex-1 flex-col",
|
|
46
|
+
"data-file-scope": u.data?.files?.scope,
|
|
47
|
+
"data-file-complete": u.data?.files?.complete,
|
|
48
|
+
"data-file": g.path,
|
|
49
|
+
"data-file-hash": g.sha256,
|
|
50
|
+
children: b ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(l, {
|
|
51
|
+
className: "min-h-0 flex-1",
|
|
52
|
+
artifact: {
|
|
53
|
+
id: `${g.path}:${g.sha256}`,
|
|
54
|
+
path: g.path,
|
|
55
|
+
filename: g.path.split("/").at(-1) ?? g.path,
|
|
56
|
+
content: y.content,
|
|
57
|
+
...y.before ? { baselineContent: y.before.content } : {}
|
|
58
|
+
},
|
|
59
|
+
paths: h.map((e) => e.path),
|
|
60
|
+
showTree: !0,
|
|
61
|
+
onFileSelect: f
|
|
62
|
+
}), /* @__PURE__ */ o("details", {
|
|
63
|
+
className: "ws-status",
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ a("summary", { children: "Provenance" }),
|
|
66
|
+
/* @__PURE__ */ a("code", { children: g.sha256 }),
|
|
67
|
+
y.before && /* @__PURE__ */ o("p", { children: [
|
|
68
|
+
"Compared with ",
|
|
69
|
+
y.before.source.kind,
|
|
70
|
+
" ",
|
|
71
|
+
/* @__PURE__ */ a("code", { children: y.before.source.ref }),
|
|
72
|
+
": ",
|
|
73
|
+
/* @__PURE__ */ a("code", { children: y.before.sha256 })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ a("p", { children: /* @__PURE__ */ a("a", {
|
|
76
|
+
href: p && p.key === x ? p.href : void 0,
|
|
77
|
+
download: g.path.split("/").at(-1),
|
|
78
|
+
children: "Download"
|
|
79
|
+
}) })
|
|
80
|
+
]
|
|
81
|
+
})] }) : /* @__PURE__ */ a("p", {
|
|
82
|
+
className: "ws-status",
|
|
83
|
+
role: v.loading ? "status" : "alert",
|
|
84
|
+
children: v.loading ? `Reading ${g.path}…` : `This retained file is unavailable: ${v.error ?? "its content identity did not match the inventory"}`
|
|
85
|
+
})
|
|
86
|
+
}) : void 0
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/workspace/LiveRun.tsx
|
|
91
|
+
var d = (e) => {
|
|
92
|
+
let t = e ? Date.parse(e) : NaN;
|
|
93
|
+
return Number.isFinite(t) ? t : void 0;
|
|
94
|
+
}, f = (e) => e !== void 0 && Number.isFinite(e) ? new Date(e).toISOString() : void 0, p = (e, t) => [...e.workers.map((e) => {
|
|
95
|
+
let n = t.find((t) => t.id === e.id);
|
|
96
|
+
return {
|
|
97
|
+
...e,
|
|
98
|
+
startedAt: e.startedAt ?? f(n?.timing?.startedAt),
|
|
99
|
+
endedAt: e.endedAt ?? f(n?.timing?.settledAt ?? n?.settledAt)
|
|
100
|
+
};
|
|
101
|
+
}), ...t.filter((t) => t.id !== e.id && !e.workers.some((e) => e.id === t.id)).map((e) => ({
|
|
102
|
+
id: e.id,
|
|
103
|
+
parent: e.parentId,
|
|
104
|
+
label: e.label ?? e.id,
|
|
105
|
+
runtime: e.runtime,
|
|
106
|
+
status: e.status ?? "unknown",
|
|
107
|
+
startedAt: f(e.timing?.startedAt),
|
|
108
|
+
endedAt: f(e.timing?.settledAt ?? e.settledAt)
|
|
109
|
+
}))], m = (...e) => e.every((e) => e && e.usdKnown !== !1 && Number.isFinite(e.usd) && e.usd >= 0) ? e.reduce((e, t) => e + (t?.usd ?? 0), 0) : void 0, h = (e) => s(e === "down" ? "failed" : e === "cancelled" ? "stopped" : e), g = (e) => {
|
|
110
|
+
let t = h(e);
|
|
111
|
+
return t === "done" ? "succeeded" : t;
|
|
112
|
+
}, _ = (e) => [
|
|
113
|
+
"running",
|
|
114
|
+
"waiting",
|
|
115
|
+
"needs-you"
|
|
116
|
+
].includes(h(e));
|
|
117
|
+
function v({ api: e, transport: i }) {
|
|
118
|
+
let [s, l] = r([]), [f, v] = r(null), [y, b] = r(!1), [x, S] = r(!1), [C, w] = r(""), [T, E] = r(0), [D, O] = r(), [k, A] = r(!0);
|
|
119
|
+
t(() => {
|
|
120
|
+
let t = i?.openEventSource ? i.openEventSource(`${e}/events`, b) : new EventSource(`${e}/events`);
|
|
121
|
+
return t.addEventListener("snapshot", (e) => {
|
|
122
|
+
try {
|
|
123
|
+
let t = JSON.parse(e.data);
|
|
124
|
+
if (!Array.isArray(t.snapshots)) throw Error("Invalid snapshot stream");
|
|
125
|
+
l((e) => {
|
|
126
|
+
let n = new Map((t.reset ? [] : e).map((e) => [e.root, e]));
|
|
127
|
+
for (let e of t.snapshots) n.set(e.root, e);
|
|
128
|
+
return [...n.values()];
|
|
129
|
+
}), E(t.sequence), v(null), b(!0);
|
|
130
|
+
} catch (e) {
|
|
131
|
+
v(String(e));
|
|
132
|
+
}
|
|
133
|
+
}), t.addEventListener("unavailable", () => v("The run snapshot is unavailable")), t.addEventListener("end", () => {
|
|
134
|
+
t.close(), S(!0);
|
|
135
|
+
}), i?.openEventSource || (t.onerror = () => b(!1)), () => t.close();
|
|
136
|
+
}, [e, i?.openEventSource]);
|
|
137
|
+
let j = s.flatMap((e, t) => e.supervisors.map((n) => ({
|
|
138
|
+
snapshot: e,
|
|
139
|
+
root: t,
|
|
140
|
+
run: n,
|
|
141
|
+
key: JSON.stringify([e.root, n.id])
|
|
142
|
+
}))), M = j.find((e) => e.key === C) ?? j[0], N = M?.snapshot.pursuit?.nodes.filter((e) => e.runId === M.run.id) ?? [], P = (e) => {
|
|
143
|
+
let t = N.find((t) => t.id === e), n = M?.run.workers.find((t) => t.id === e)?.materialization;
|
|
144
|
+
return [t?.model ?? (n?.model?.status === "known" ? n.model.id : void 0), t?.backend ?? n?.backend].filter(Boolean).join(" · ") || void 0;
|
|
145
|
+
}, F = M && {
|
|
146
|
+
...M.run,
|
|
147
|
+
workers: p(M.run, N)
|
|
148
|
+
}, I = F ? Math.min(...[F.startedAt, ...F.workers.map((e) => e.startedAt)].flatMap((e) => e && Number.isFinite(Date.parse(e)) ? [Date.parse(e)] : [])) : void 0, L = n(() => {
|
|
149
|
+
let e = M?.snapshot.generatedAt ?? Date.now(), t = I !== void 0 && Number.isFinite(I) ? I : e, n = (F?.workers ?? []).flatMap((n) => {
|
|
150
|
+
if (!n.startedAt || !Number.isFinite(Date.parse(n.startedAt))) return [];
|
|
151
|
+
let r = Math.max(0, Date.parse(n.startedAt) - t), i = d(n.endedAt) ?? (_(n.status) ? e : Date.parse(n.startedAt)), a = m(n.spend, n.metered);
|
|
152
|
+
return [{
|
|
153
|
+
id: n.id,
|
|
154
|
+
parentId: n.parent && n.parent !== n.id ? n.parent : F.id,
|
|
155
|
+
name: n.label,
|
|
156
|
+
kind: "pipeline",
|
|
157
|
+
startMs: r,
|
|
158
|
+
endMs: Math.max(r, i - t),
|
|
159
|
+
status: h(n.status),
|
|
160
|
+
...a === void 0 ? {} : { costUsd: a },
|
|
161
|
+
...n.lastActivityAt === void 0 ? {} : {
|
|
162
|
+
activityAt: [n.lastActivityAt - t],
|
|
163
|
+
medianEventGapMs: n.medianEventGapMs
|
|
164
|
+
},
|
|
165
|
+
...P(n.id) ? { detail: P(n.id) } : {},
|
|
166
|
+
...h(n.status) === "failed" && n.reason ? { facts: [{
|
|
167
|
+
label: "Failure",
|
|
168
|
+
value: n.reason
|
|
169
|
+
}] } : {},
|
|
170
|
+
...n.status === "cancelled" ? { outcome: {
|
|
171
|
+
tone: "neutral",
|
|
172
|
+
label: "Cancelled"
|
|
173
|
+
} } : {}
|
|
174
|
+
}];
|
|
175
|
+
});
|
|
176
|
+
F?.startedAt && F.status !== "unobserved" && !n.some((e) => e.id === F.id) && n.unshift({
|
|
177
|
+
id: F.id,
|
|
178
|
+
name: "root",
|
|
179
|
+
kind: "pipeline",
|
|
180
|
+
detail: P(F.id),
|
|
181
|
+
startMs: Math.max(0, Date.parse(F.startedAt) - t),
|
|
182
|
+
endMs: Math.max(0, Date.parse(F.completedAt ?? new Date(e).toISOString()) - t),
|
|
183
|
+
status: h(F.status),
|
|
184
|
+
...h(F.status) === "failed" && F.reason ? { facts: [{
|
|
185
|
+
label: "Failure",
|
|
186
|
+
value: F.reason
|
|
187
|
+
}] } : {},
|
|
188
|
+
...F.lastActivityAt === void 0 ? {} : {
|
|
189
|
+
activityAt: [F.lastActivityAt - t],
|
|
190
|
+
medianEventGapMs: F.medianEventGapMs
|
|
191
|
+
},
|
|
192
|
+
...m(F.driverSpend) === void 0 ? {} : { costUsd: m(F.driverSpend) },
|
|
193
|
+
...F.status === "cancelled" ? { outcome: {
|
|
194
|
+
tone: "neutral",
|
|
195
|
+
label: "Cancelled"
|
|
196
|
+
} } : {}
|
|
197
|
+
});
|
|
198
|
+
let r = F?.totals;
|
|
199
|
+
return {
|
|
200
|
+
spans: n,
|
|
201
|
+
totalMs: Math.max(0, ...n.map((e) => e.endMs)),
|
|
202
|
+
...r?.tokensKnown !== !1 && typeof r?.tokensInput == "number" && Number.isFinite(r.tokensInput) && r.tokensInput >= 0 ? { promptTokens: r.tokensInput } : {},
|
|
203
|
+
...r?.tokensKnown !== !1 && typeof r?.tokensOutput == "number" && Number.isFinite(r.tokensOutput) && r.tokensOutput >= 0 ? { completionTokens: r.tokensOutput } : {},
|
|
204
|
+
errors: n.filter((e) => e.status === "failed").length
|
|
205
|
+
};
|
|
206
|
+
}, [
|
|
207
|
+
M?.snapshot,
|
|
208
|
+
M?.run,
|
|
209
|
+
I
|
|
210
|
+
]), R = F?.workers.filter((e) => e.id !== F.id) ?? [], z = F ? [{
|
|
211
|
+
id: F.id,
|
|
212
|
+
label: "root",
|
|
213
|
+
status: g(F.status),
|
|
214
|
+
model: P(F.id),
|
|
215
|
+
costUsd: m(F.driverSpend),
|
|
216
|
+
startedAt: d(F.startedAt),
|
|
217
|
+
lastActivityAt: F.lastActivityAt,
|
|
218
|
+
medianEventGapMs: F.medianEventGapMs,
|
|
219
|
+
result: F.status === "cancelled" ? "Cancelled" : g(F.status) === "failed" ? F.reason || "Failure cause not recorded" : void 0
|
|
220
|
+
}, ...R.map((e) => ({
|
|
221
|
+
id: e.id,
|
|
222
|
+
label: e.label,
|
|
223
|
+
harness: e.runtime,
|
|
224
|
+
model: P(e.id),
|
|
225
|
+
status: g(e.status),
|
|
226
|
+
costUsd: m(e.spend, e.metered),
|
|
227
|
+
startedAt: d(e.startedAt),
|
|
228
|
+
lastActivityAt: e.lastActivityAt,
|
|
229
|
+
medianEventGapMs: e.medianEventGapMs,
|
|
230
|
+
turn: e.liveTail?.at(-1),
|
|
231
|
+
events: e.liveTail?.slice(-3).map((t, n) => ({
|
|
232
|
+
id: `${e.id}:${n}:${t}`,
|
|
233
|
+
label: t
|
|
234
|
+
})),
|
|
235
|
+
result: e.status === "cancelled" ? "Cancelled" : g(e.status) === "failed" ? e.reason || "Failure cause not recorded" : e.verdict
|
|
236
|
+
}))] : [], B = D, V = u(M && B ? `${e}/agents/${M.root}/${encodeURIComponent(M.run.id)}/${encodeURIComponent(B)}` : void 0, !!F && _(F.status), i?.fetch), H = new Set(z.map((e) => e.id)), U = R.map((e) => ({
|
|
237
|
+
from: e.parent && e.parent !== e.id && H.has(e.parent) ? e.parent : F.id,
|
|
238
|
+
to: e.id,
|
|
239
|
+
kind: "spawn"
|
|
240
|
+
})), W = Object.fromEntries(z.map(({ id: e, label: t, harness: n, model: r, turn: i, events: a, result: o, status: s, costUsd: c, startedAt: l, lastActivityAt: u, medianEventGapMs: d }) => [e, {
|
|
241
|
+
label: t,
|
|
242
|
+
harness: n,
|
|
243
|
+
model: r,
|
|
244
|
+
turn: i,
|
|
245
|
+
events: a,
|
|
246
|
+
result: o,
|
|
247
|
+
...l === void 0 ? {
|
|
248
|
+
status: s,
|
|
249
|
+
costUsd: c,
|
|
250
|
+
lastActivityAt: u,
|
|
251
|
+
medianEventGapMs: d
|
|
252
|
+
} : {}
|
|
253
|
+
}]));
|
|
254
|
+
return /* @__PURE__ */ o("main", {
|
|
255
|
+
className: "ws-live",
|
|
256
|
+
"data-api": e,
|
|
257
|
+
"data-top-sequence": T,
|
|
258
|
+
children: [
|
|
259
|
+
/* @__PURE__ */ o("header", { children: [/* @__PURE__ */ o("label", { children: ["Run", /* @__PURE__ */ a("select", {
|
|
260
|
+
"aria-label": "Run",
|
|
261
|
+
value: M?.key ?? "",
|
|
262
|
+
onChange: (e) => {
|
|
263
|
+
w(e.target.value), O(void 0);
|
|
264
|
+
},
|
|
265
|
+
children: j.map((e) => /* @__PURE__ */ a("option", {
|
|
266
|
+
value: e.key,
|
|
267
|
+
children: e.run.id
|
|
268
|
+
}, e.key))
|
|
269
|
+
})] }), /* @__PURE__ */ a("span", {
|
|
270
|
+
role: "status",
|
|
271
|
+
children: x ? "Finished · viewer closed" : y ? "● Connected" : s.length ? "○ Reconnecting" : "Connecting…"
|
|
272
|
+
})] }),
|
|
273
|
+
M?.run.task && M.run.task !== M.run.id && /* @__PURE__ */ a("p", { children: M.run.task }),
|
|
274
|
+
f && /* @__PURE__ */ a("p", {
|
|
275
|
+
role: "alert",
|
|
276
|
+
children: f
|
|
277
|
+
}),
|
|
278
|
+
(M ? [M.snapshot] : s).filter((e) => e.completeness === "partial").map((e) => /* @__PURE__ */ o("p", {
|
|
279
|
+
role: "alert",
|
|
280
|
+
children: ["Partial capture: ", e.diagnostics.map((e) => `${e.source}: ${e.reason}`).join(" · ")]
|
|
281
|
+
}, e.root)),
|
|
282
|
+
M ? /* @__PURE__ */ a(c, {
|
|
283
|
+
trace: L,
|
|
284
|
+
label: "Run",
|
|
285
|
+
selectedAgentId: B,
|
|
286
|
+
conversationOpen: k,
|
|
287
|
+
openEventSource: i?.openEventSource,
|
|
288
|
+
onSelectAgent: (e) => {
|
|
289
|
+
e && O(e), A(e !== void 0);
|
|
290
|
+
},
|
|
291
|
+
live: _(M.run.status) || F.workers.some((e) => _(e.status)),
|
|
292
|
+
startedAt: Number.isFinite(I) ? I : void 0,
|
|
293
|
+
agentCards: W,
|
|
294
|
+
agentGraph: {
|
|
295
|
+
defaultLayout: "tree",
|
|
296
|
+
edges: U
|
|
297
|
+
},
|
|
298
|
+
defaultView: "graph",
|
|
299
|
+
maxHeight: 650,
|
|
300
|
+
files: V.files,
|
|
301
|
+
scoreboard: V.scoreboard,
|
|
302
|
+
streamUrl: (t) => `${e}/agents/${M.root}/${encodeURIComponent(M.run.id)}/${encodeURIComponent(t)}/stream`
|
|
303
|
+
}, M.key) : y && !s.some((e) => e.completeness === "partial") && /* @__PURE__ */ a("p", {
|
|
304
|
+
role: "status",
|
|
305
|
+
children: "No recorded agents in these roots."
|
|
306
|
+
})
|
|
307
|
+
]
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
//#endregion
|
|
311
|
+
export { v as LiveRun };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { m as e, p as t } from "./data-
|
|
1
|
+
import { m as e, p as t } from "./data-DTGmre1W.js";
|
|
2
2
|
import { n } from "./use-file-text-BaE98QxE.js";
|
|
3
|
-
import { c as r, f as i, o as a } from "./RunOverview-
|
|
4
|
-
import { a as o, c as s, f as c, i as l, l as u, o as d, r as f, s as p, t as m } from "./outputs-model-
|
|
5
|
-
import { n as h, r as g, t as _ } from "./run-files-
|
|
3
|
+
import { c as r, f as i, o as a } from "./RunOverview-CSqsunqf.js";
|
|
4
|
+
import { a as o, c as s, f as c, i as l, l as u, o as d, r as f, s as p, t as m } from "./outputs-model-CHTx8rMz.js";
|
|
5
|
+
import { n as h, r as g, t as _ } from "./run-files-BckQDdTD.js";
|
|
6
6
|
import { useMemo as v, useRef as y, useState as b } from "react";
|
|
7
7
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
8
8
|
import { DiffView as w } from "@tangle-network/sandbox-ui/workbench";
|