@tangle-network/sandbox-cli 0.21.27 → 0.21.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/graph-viewer/{Analytics-DocMpB6T.js → Analytics-DFWW8Phh.js} +260 -275
  2. package/dist/graph-viewer/Checks-qgqV4xgV.js +155 -0
  3. package/dist/graph-viewer/{Conversations-CISiWrR9.js → Conversations-CGB45kpj.js} +112 -80
  4. package/dist/graph-viewer/{Files-Dh8p_Fpw.js → Files-DtZhf0ii.js} +121 -106
  5. package/dist/graph-viewer/LiveRun-C21wUKAY.js +210 -0
  6. package/dist/graph-viewer/Overview-BjeLsA2I.js +506 -0
  7. package/dist/graph-viewer/{RunPage-nJwCsArn.js → RunPage-CkkcBEUe.js} +22 -22
  8. package/dist/graph-viewer/{Timeline-bPjhV3il.js → Timeline-C2Xolk0t.js} +84 -84
  9. package/dist/graph-viewer/{Today-pebCsPJ1.js → Today-BVVDtSVN.js} +65 -58
  10. package/dist/graph-viewer/Topology-DO5XX8e4.js +545 -0
  11. package/dist/graph-viewer/{Traces-C5x2UvJh.js → Traces-BhMxjNgw.js} +79 -52
  12. package/dist/graph-viewer/{WallPages-DSmRm2v3.js → WallPages-4d9QUZDq.js} +3 -3
  13. package/dist/graph-viewer/index.js +103 -102
  14. package/dist/graph-viewer/{lazy-pages-CpmkG5o2.js → lazy-pages-DM0cZM10.js} +4 -4
  15. package/dist/graph-viewer/{record-part-Cx9GDQeo.js → record-part-CZal_IMH.js} +382 -352
  16. package/dist/graph-viewer/report-viewer.js +7 -7
  17. package/dist/graph-viewer/styles.css +596 -284
  18. package/dist/graph-viewer/{ui-CEhDqce8.js → ui-D8QZRsC3.js} +143 -111
  19. package/dist/graph-viewer/viewer/{AgentGraphCanvas-D7jjAE6i-DecKyUGA.js → AgentGraphCanvas-CMdOlSlh-4EervjeC.js} +54 -48
  20. package/dist/graph-viewer/viewer/{Analytics-CtKucZjs.js → Analytics-DD__nbLm.js} +203 -218
  21. package/dist/graph-viewer/viewer/{AnswerStrip-DsI9aF-i.js → AnswerStrip-CGUyXuYH.js} +2 -2
  22. package/dist/graph-viewer/viewer/Checks-Ds5M7eAW.js +156 -0
  23. package/dist/graph-viewer/viewer/{Conversations-DQBCyko6.js → Conversations-C1n0EBBd.js} +124 -92
  24. package/dist/graph-viewer/viewer/{Files-B-g25gSO.js → Files-Cjr7NMU_.js} +63 -48
  25. package/dist/graph-viewer/viewer/{LiveRun-BMQnTpTZ.js → LiveRun-uPTkPSjo.js} +1223 -1164
  26. package/dist/graph-viewer/viewer/{Outputs-DXnN1wEQ.js → Outputs-CumGyjQo.js} +6 -6
  27. package/dist/graph-viewer/viewer/Overview-4Umk14_2.js +507 -0
  28. package/dist/graph-viewer/viewer/{RunPage-ChipoSdO.js → RunPage-DZlBW7Va.js} +28 -28
  29. package/dist/graph-viewer/viewer/{Scores-CjriXjf_.js → Scores-ZS16yk0n.js} +3 -3
  30. package/dist/graph-viewer/viewer/{Timeline-DzEzobA0.js → Timeline-BnK6-yBR.js} +24 -24
  31. package/dist/graph-viewer/viewer/{Today-DLHe_wTA.js → Today-a_-oNigi.js} +69 -62
  32. package/dist/graph-viewer/viewer/Topology-CQPCLQT6.js +546 -0
  33. package/dist/graph-viewer/viewer/{Traces-BWBulSPE.js → Traces-C0IGk0L4.js} +75 -48
  34. package/dist/graph-viewer/viewer/{WallPages-Crj-qPoK.js → WallPages-CzWpyIfp.js} +8 -8
  35. package/dist/graph-viewer/viewer/{WorkflowGraph-DYsP_Kcg-C0O7M5iH.js → WorkflowGraph-DZ3xejKE-jRXKeSrg.js} +6 -6
  36. package/dist/graph-viewer/viewer/{agent-timeline-C-UIhXgu.js → agent-timeline-Cs9Qbpvo.js} +437 -425
  37. package/dist/graph-viewer/viewer/{bot-Bivadvxn.js → bot-D6Nrej7Z.js} +1 -1
  38. package/dist/graph-viewer/viewer/{chevron-right-WW7tFY6B.js → chevron-right-D_5IKLxu.js} +1 -1
  39. package/dist/graph-viewer/viewer/{createLucideIcon-Z6KTw8ff.js → createLucideIcon-yH0cxLMy.js} +1 -1
  40. package/dist/graph-viewer/viewer/{data-azhapQrS.js → data-CkWfWr7i.js} +1 -1
  41. package/dist/graph-viewer/viewer/{dist-CyOc-K4O.js → dist-C1-7EfoW.js} +3 -3
  42. package/dist/graph-viewer/viewer/{file-text-B34N7Soo.js → file-text-m7a3piQF.js} +1 -1
  43. package/dist/graph-viewer/viewer/{final-output-Db2D9cMT.js → final-output-kwY11u9X.js} +1 -1
  44. package/dist/graph-viewer/viewer/{highlights-Bgg6O5ub.js → highlights-Btsi5OXl.js} +2 -2
  45. package/dist/graph-viewer/viewer/{jsx-runtime-BSzbUOFc.js → jsx-runtime-DQWyJOhv.js} +1 -1
  46. package/dist/graph-viewer/viewer/{lazy-pages-fgtpXQ00.js → lazy-pages-BowaGsg-.js} +6 -6
  47. package/dist/graph-viewer/viewer/{markdown-BpJEJUTW.js → markdown-CX_sVrXB.js} +17 -17
  48. package/dist/graph-viewer/viewer/{model-brand-bTcMjQtB-C9bHPsPk.js → model-brand-bTcMjQtB-fagiBQam.js} +3 -3
  49. package/dist/graph-viewer/viewer/{page-header-C6YCPkzJ.js → page-header-Brq611fd.js} +3 -3
  50. package/dist/graph-viewer/viewer/{popover-DrLB9iar.js → popover-CvOAjlnk.js} +4 -4
  51. package/dist/graph-viewer/viewer/{react-CisnW4fB.js → react-CY3IbSNO.js} +24 -24
  52. package/dist/graph-viewer/viewer/{react-dom-C5NDYQCD.js → react-dom-t1L4_-il.js} +1 -1
  53. package/dist/graph-viewer/viewer/{record-part-d0gKKrMI.js → record-part-D3_Anfpe.js} +455 -425
  54. package/dist/graph-viewer/viewer/{segmented-control-ChhLMa6h.js → segmented-control-BaJmvTNd.js} +39 -39
  55. package/dist/graph-viewer/viewer/{shiki-BwlTRTY6.js → shiki-Qnby7Sh6.js} +2 -2
  56. package/dist/graph-viewer/viewer/{stream-tokenizer-CaVb21TO.js → stream-tokenizer-CWtnjmRd.js} +1 -1
  57. package/dist/graph-viewer/viewer/{terminal-BxRacTx0.js → terminal-83J_I4Ne.js} +1 -1
  58. package/dist/graph-viewer/viewer/{themes-BxrCCwH5.js → themes-1i1fzpRk.js} +1 -1
  59. package/dist/graph-viewer/viewer/{ui-DZiGjPwl.js → ui-C9b1rIUH.js} +222 -190
  60. package/dist/graph-viewer/viewer/{workspace-DalRxssx.js → workspace-CekmOBs3.js} +76 -76
  61. package/dist/graph-viewer/viewer/{x-B_F8B4lq.js → x-DOc2URqZ.js} +1 -1
  62. package/dist/graph-viewer/workspace-viewer.js +103 -102
  63. package/package.json +5 -5
  64. package/dist/graph-viewer/Checks-CbnY4tuh.js +0 -113
  65. package/dist/graph-viewer/LiveRun-C-yKwkKs.js +0 -190
  66. package/dist/graph-viewer/Overview-BaXPdCFC.js +0 -477
  67. package/dist/graph-viewer/Topology-CyhuK6XW.js +0 -550
  68. package/dist/graph-viewer/viewer/Checks-DZTgeYlV.js +0 -114
  69. package/dist/graph-viewer/viewer/Overview-u7-8-rGx.js +0 -478
  70. package/dist/graph-viewer/viewer/Topology-Dsmuu27J.js +0 -551
@@ -1,17 +1,17 @@
1
1
  import { p as e } from "./data-BJmP7F1M.js";
2
- import { a as t, d as n, o as r } from "./ui-CEhDqce8.js";
2
+ import { a as t, d as n, o as r } from "./ui-D8QZRsC3.js";
3
3
  import { n as i } from "./use-file-text-BaE98QxE.js";
4
4
  import { o as a } from "./RunOverview-DJQDAMIx.js";
5
5
  import { r as o, t as s } from "./run-files-C1NgzM0l.js";
6
- import { agentFromParam as c, agentParam as l } from "./RunPage-nJwCsArn.js";
7
- import { useEffect as u, useMemo as d, useState as f } from "react";
8
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
9
- import { Popover as g, PopoverContent as _, PopoverTrigger as v, SegmentedControl as y } from "@tangle-network/ui/primitives";
10
- import { DiffView as b } from "@tangle-network/sandbox-ui/workbench";
11
- import { FilePreview as x, resolveFilePreviewKind as S } from "@tangle-network/sandbox-ui/files";
12
- import { WorkspaceFilesPane as C } from "@tangle-network/sandbox-ui/workspace";
6
+ import { agentFromParam as c, agentParam as l } from "./RunPage-CkkcBEUe.js";
7
+ import { useEffect as u, useMemo as d, useState as f, useSyncExternalStore as p } from "react";
8
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
9
+ import { Popover as _, PopoverContent as v, PopoverTrigger as y, SegmentedControl as b } from "@tangle-network/ui/primitives";
10
+ import { DiffView as x } from "@tangle-network/sandbox-ui/workbench";
11
+ import { FilePreview as S, resolveFilePreviewKind as C } from "@tangle-network/sandbox-ui/files";
12
+ import { WorkspaceFilesPane as w } from "@tangle-network/sandbox-ui/workspace";
13
13
  //#region src/workspace/ref-file.tsx
14
- var w = /* @__PURE__ */ new Set([
14
+ var T = /* @__PURE__ */ new Set([
15
15
  "image",
16
16
  "pdf",
17
17
  "video",
@@ -19,11 +19,11 @@ var w = /* @__PURE__ */ new Set([
19
19
  "spreadsheet",
20
20
  "binary"
21
21
  ]);
22
- function T(t, n, r, a) {
22
+ function E(t, n, r, a) {
23
23
  let o = e(!a && n && r ? `${t}/tree?ref=${encodeURIComponent(n)}` : null), s = a ? {
24
24
  data: a,
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 && w.has(S(r))), d = i(u ? null : l, s.data?.commit);
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 = i(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}`
@@ -50,14 +50,14 @@ function T(t, n, r, a) {
50
50
  commit: s.data.commit
51
51
  } : { state: "loading" };
52
52
  }
53
- function E({ runUrl: e, base: t, head: n, path: r, headTree: i }) {
54
- let a = T(e, t, r), o = T(e, n, r, i), s = [a, o].find((e) => e.state === "error");
55
- if (s) return /* @__PURE__ */ m("p", {
53
+ function D({ runUrl: e, base: t, head: n, path: r, headTree: i }) {
54
+ let a = E(e, t, r), o = E(e, n, r, i), s = [a, o].find((e) => e.state === "error");
55
+ if (s) return /* @__PURE__ */ h("p", {
56
56
  className: "rj-muted",
57
57
  role: "alert",
58
58
  children: s.error
59
59
  });
60
- if (o.state === "loading" || a.state === "loading" || o.state === "idle") return /* @__PURE__ */ h("p", {
60
+ if (o.state === "loading" || a.state === "loading" || o.state === "idle") return /* @__PURE__ */ g("p", {
61
61
  className: "rj-muted",
62
62
  role: "status",
63
63
  children: [
@@ -66,7 +66,7 @@ function E({ runUrl: e, base: t, head: n, path: r, headTree: i }) {
66
66
  "…"
67
67
  ]
68
68
  });
69
- if (o.state === "absent" && (a.state === "absent" || a.state === "idle")) return /* @__PURE__ */ h("p", {
69
+ if (o.state === "absent" && (a.state === "absent" || a.state === "idle")) return /* @__PURE__ */ g("p", {
70
70
  className: "rj-muted",
71
71
  role: "alert",
72
72
  children: [
@@ -78,11 +78,11 @@ function E({ runUrl: e, base: t, head: n, path: r, headTree: i }) {
78
78
  ]
79
79
  });
80
80
  let c = [a, o].find((e) => e.state === "binary");
81
- if (c) return /* @__PURE__ */ h("p", {
81
+ if (c) return /* @__PURE__ */ g("p", {
82
82
  className: "rj-muted",
83
83
  children: [
84
84
  "A binary file has no text diff. ",
85
- /* @__PURE__ */ h("a", {
85
+ /* @__PURE__ */ g("a", {
86
86
  href: c.href,
87
87
  download: r.split("/").pop(),
88
88
  children: ["Download it at ", c.commit.slice(0, 12)]
@@ -91,12 +91,12 @@ function E({ runUrl: e, base: t, head: n, path: r, headTree: i }) {
91
91
  ]
92
92
  });
93
93
  let l = !t || a.state === "absent", u = o.state === "absent";
94
- return /* @__PURE__ */ h(p, { children: [(l || u) && /* @__PURE__ */ m("p", {
94
+ return /* @__PURE__ */ g(m, { children: [(l || u) && /* @__PURE__ */ h("p", {
95
95
  className: "rj-muted",
96
96
  children: u ? `Not in ${n}: removed since ${t}.` : t ? `Not in ${t}: added in ${n}.` : `No earlier release: every line is new in ${n}.`
97
- }), /* @__PURE__ */ m("div", {
97
+ }), /* @__PURE__ */ h("div", {
98
98
  className: "rj-diff",
99
- children: /* @__PURE__ */ m(b, {
99
+ children: /* @__PURE__ */ h(x, {
100
100
  filename: r,
101
101
  baseline: a.state === "ready" ? a.text : "",
102
102
  current: o.state === "ready" ? o.text : "",
@@ -105,9 +105,18 @@ function E({ 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
108
117
  //#region src/workspace/run/Files.tsx
109
- var D = "Pages", O = "Code", k = (e) => e.name.replaceAll("/", "∕");
110
- function A(e, t) {
118
+ var A = "Pages", j = "Code", M = (e) => e.name.replaceAll("/", "∕");
119
+ function N(e, t) {
111
120
  let [n, r] = f(/* @__PURE__ */ new Map()), i = t.map((e) => e.id).join("|");
112
121
  return u(() => {
113
122
  let n = new AbortController(), i = !0;
@@ -122,7 +131,7 @@ function A(e, t) {
122
131
  };
123
132
  }, [e, i]), n;
124
133
  }
125
- function j({ api: t, runUrl: i, doc: a, m: o, route: u }) {
134
+ function P({ api: t, runUrl: i, doc: a, m: o, route: u }) {
126
135
  let f = e(`${i}/files`, o.live ? 15e3 : void 0), p = d(() => {
127
136
  if (!f.data) return null;
128
137
  try {
@@ -134,12 +143,12 @@ function j({ api: t, runUrl: i, doc: a, m: o, route: u }) {
134
143
  f.data,
135
144
  a.run.id,
136
145
  t
137
- ]), h = d(() => o.tree.filter((e) => e.node.hasCode).slice(0, 40), [o]), g = c(o, a.run.id, u.params.get("scope")) ?? (u.params.get("scope") === "pages" ? "pages" : null), _ = d(() => g === "pages" ? [] : g ? h.filter((e) => e.id === g) : h, [h, g]), v = A(i, _), y = e(`${i}/tree?ref=main`), b = d(() => {
146
+ ]), m = d(() => o.tree.filter((e) => e.node.hasCode).slice(0, 40), [o]), g = c(o, a.run.id, u.params.get("scope")) ?? (u.params.get("scope") === "pages" ? "pages" : null), _ = d(() => g === "pages" ? [] : g ? m.filter((e) => e.id === g) : m, [m, g]), v = N(i, _), y = e(`${i}/tree?ref=main`), b = d(() => {
138
147
  let e = [];
139
148
  if (g === null || g === "pages") for (let t of p?.items ?? []) e.push({
140
149
  key: `page:${t.path}`,
141
150
  kind: "page",
142
- tree: `${D}/${t.path.replace(/^pages\//, "")}`,
151
+ tree: `${A}/${t.path.replace(/^pages\//, "")}`,
143
152
  path: t.path,
144
153
  file: t
145
154
  });
@@ -149,7 +158,7 @@ function j({ api: t, runUrl: i, doc: a, m: o, route: u }) {
149
158
  if (!(!r || "error" in r)) for (let i of r.files) e.push({
150
159
  key: `code:${l(a.run.id, n.id)}:${i.path}`,
151
160
  kind: "code",
152
- tree: `${O}/${k(n)}/${i.path}`,
161
+ tree: `${j}/${M(n)}/${i.path}`,
153
162
  path: i.path,
154
163
  agent: n,
155
164
  status: t.has(i.path) ? "M" : "A",
@@ -166,69 +175,69 @@ function j({ api: t, runUrl: i, doc: a, m: o, route: u }) {
166
175
  y.data,
167
176
  g,
168
177
  a.run.id
169
- ]), x = d(() => new Map(b.map((e) => [e.tree, e])), [b]), S = d(() => Object.fromEntries(b.filter((e) => e.kind === "code").map((e) => [e.tree, e.kind === "code" && e.status === "A" ? "added" : "modified"])), [b]), w = u.params.get("file"), T = b.find((e) => e.key === w) ?? (w ? null : b[0] ?? null), E = !p && !f.error ? "Reading the retained files…" : _.some((e) => !v.has(e.id)) && !b.length ? "Reading the agent branches…" : null, j = n(o, (e) => e.node.hasCode, (e) => {
178
+ ]), x = d(() => new Map(b.map((e) => [e.tree, e])), [b]), S = d(() => Object.fromEntries(b.filter((e) => e.kind === "code").map((e) => [e.tree, e.kind === "code" && e.status === "A" ? "added" : "modified"])), [b]), C = u.params.get("file"), T = k("(max-width: 720px)"), E = b.find((e) => e.key === C) ?? (C || T ? null : b[0] ?? null), D = !p && !f.error ? "Reading the retained files…" : _.some((e) => !v.has(e.id)) && !b.length ? "Reading the agent branches…" : null, O = n(o, (e) => e.node.hasCode, (e) => {
170
179
  let t = v.get(e.id);
171
- return t && !("error" in t) ? `${t.files.length} files` : "";
172
- }), N = /* @__PURE__ */ m(r, {
180
+ return t && !("error" in t) ? `${t.files.length} changed` : "";
181
+ }), P = /* @__PURE__ */ h(r, {
173
182
  label: "Files written by",
174
183
  options: [{
175
184
  id: "pages",
176
185
  label: "Pages",
177
- meta: p ? `${p.items.length}` : ""
178
- }, ...j],
179
- all: { label: "All agents" },
186
+ meta: p ? `${p.items.length} pages` : ""
187
+ }, ...O],
188
+ all: { label: "Pages and every branch" },
180
189
  value: g,
181
- placeholder: `Search ${h.length} branches`,
190
+ placeholder: `Search ${m.length} branches`,
182
191
  width: 300,
183
192
  className: "rp-fscope",
184
193
  onChange: (e) => u.go("files", {
185
194
  scope: e === "pages" ? "pages" : e ? l(a.run.id, e) : null,
186
195
  file: null
187
196
  }),
188
- children: g === "pages" ? "Pages" : g ? o.byId.get(g)?.name ?? "Agent" : "All agents"
197
+ children: g === "pages" ? "Pages" : g ? o.byId.get(g)?.name ?? "Branch" : "All files"
189
198
  });
190
- return /* @__PURE__ */ m("div", {
199
+ return /* @__PURE__ */ h("div", {
191
200
  className: "rp-files",
192
- children: /* @__PURE__ */ m(C, {
201
+ children: /* @__PURE__ */ h(w, {
193
202
  paths: b.map((e) => e.tree),
194
203
  status: S,
195
- selectedPath: T?.tree,
204
+ selectedPath: E?.tree,
196
205
  onSelect: (e) => {
197
206
  let t = x.get(e);
198
207
  t && u.go("files", { file: t.key });
199
208
  },
200
209
  onBack: () => u.go("files", { file: null }),
201
- headerActions: N,
210
+ headerActions: P,
202
211
  search: !0,
203
212
  label: "Files",
204
213
  expansionKey: `${a.run.id}:files`,
205
- emptyState: /* @__PURE__ */ m("p", {
214
+ emptyState: /* @__PURE__ */ h("p", {
206
215
  className: "ws-status",
207
216
  role: f.error ? "alert" : "status",
208
- children: f.error ? `The retained files are unavailable: ${f.error}` : E ?? "This run left no pages and no branch changed a file."
217
+ children: f.error ? `The retained files are unavailable: ${f.error}` : D ?? "This run left no pages and no branch changed a file."
209
218
  }),
210
- preview: T ? {
211
- path: T.tree,
212
- ...M(T, i, u.href("files", { file: T.key }))
219
+ preview: E ? {
220
+ path: E.tree,
221
+ ...F(E, i, u.href("files", { file: E.key }))
213
222
  } : void 0,
214
223
  style: { height: "100%" }
215
224
  })
216
225
  });
217
226
  }
218
- function M(e, t, n) {
227
+ function F(e, t, n) {
219
228
  return {
220
- actions: /* @__PURE__ */ m(P, {
229
+ actions: /* @__PURE__ */ h(L, {
221
230
  entry: e,
222
231
  runUrl: t,
223
232
  link: n
224
233
  }),
225
- content: /* @__PURE__ */ m(I, {
234
+ content: /* @__PURE__ */ h(z, {
226
235
  entry: e,
227
236
  runUrl: t
228
237
  }, e.key)
229
238
  };
230
239
  }
231
- var N = () => {
240
+ var I = () => {
232
241
  let [e, t] = f(() => {
233
242
  let e = new URLSearchParams(window.location.search).get("fileView");
234
243
  return e === "source" || e === "diff" ? e : "preview";
@@ -241,8 +250,8 @@ var N = () => {
241
250
  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 }));
242
251
  }];
243
252
  };
244
- function P({ entry: e, runUrl: n, link: r }) {
245
- let [i, a] = N(), [s, c] = f(!1), l = e.path.split("/").pop() ?? e.path, u = S(e.path), d = [...u === "markdown" || u === "csv" ? [{
253
+ function L({ entry: e, runUrl: n, link: r }) {
254
+ let [i, a] = I(), [s, c] = f(!1), l = e.path.split("/").pop() ?? e.path, u = C(e.path), d = [...u === "markdown" || u === "csv" ? [{
246
255
  value: "preview",
247
256
  label: "Preview"
248
257
  }, {
@@ -252,99 +261,105 @@ function P({ entry: e, runUrl: n, link: r }) {
252
261
  value: "diff",
253
262
  label: "Changes"
254
263
  }] : []], p = e.kind === "page" ? o(e.file) : `${n}/blob?ref=${encodeURIComponent(e.agent.id)}&path=${encodeURIComponent(e.path)}`;
255
- return /* @__PURE__ */ h("span", {
264
+ return /* @__PURE__ */ g("span", {
256
265
  className: "rp-factions",
257
- children: [d.length > 1 && /* @__PURE__ */ m(y, {
266
+ children: [d.length > 1 && /* @__PURE__ */ h(b, {
258
267
  "aria-label": "File view",
259
268
  value: d.some((e) => e.value === i) ? i : d[0].value,
260
269
  onValueChange: a,
261
270
  options: d
262
- }), /* @__PURE__ */ h("span", {
271
+ }), /* @__PURE__ */ g("span", {
263
272
  className: "rp-group ph-hide",
264
273
  children: [
265
274
  p && /* @__PURE__ */ h("a", {
266
- className: "rp-btn",
275
+ className: "rp-btn ic",
267
276
  href: p,
268
277
  download: l,
269
- children: [/* @__PURE__ */ m(t, { name: "download" }), /* @__PURE__ */ m("span", { children: "Download" })]
278
+ "aria-label": `Download ${l}`,
279
+ title: "Download",
280
+ children: /* @__PURE__ */ h(t, { name: "download" })
270
281
  }),
271
282
  /* @__PURE__ */ h("button", {
272
283
  type: "button",
273
- className: "rp-btn",
284
+ className: "rp-btn ic",
285
+ "aria-label": s ? "Link copied" : "Copy link",
286
+ title: s ? "Copied" : "Copy link",
274
287
  onClick: () => {
275
288
  navigator.clipboard?.writeText(new URL(r, window.location.href).toString()).then(() => {
276
289
  c(!0), window.setTimeout(() => c(!1), 1500);
277
290
  });
278
291
  },
279
- children: [/* @__PURE__ */ m(t, { name: s ? "check" : "link" }), /* @__PURE__ */ m("span", { children: s ? "Copied" : "Copy link" })]
292
+ children: /* @__PURE__ */ h(t, { name: s ? "check" : "link" })
280
293
  }),
281
- /* @__PURE__ */ h(g, { children: [/* @__PURE__ */ m(v, {
294
+ /* @__PURE__ */ g(_, { children: [/* @__PURE__ */ h(y, {
282
295
  asChild: !0,
283
296
  children: /* @__PURE__ */ h("button", {
284
297
  type: "button",
285
- className: "rp-btn",
286
- children: [/* @__PURE__ */ m(t, { name: "info" }), /* @__PURE__ */ m("span", { children: "Provenance" })]
298
+ className: "rp-btn ic",
299
+ "aria-label": "Provenance",
300
+ title: "Provenance",
301
+ children: /* @__PURE__ */ h(t, { name: "info" })
287
302
  })
288
- }), /* @__PURE__ */ m(_, {
303
+ }), /* @__PURE__ */ h(v, {
289
304
  className: "rp-pop",
290
305
  align: "end",
291
- children: /* @__PURE__ */ m(F, { entry: e })
306
+ children: /* @__PURE__ */ h(R, { entry: e })
292
307
  })] })
293
308
  ]
294
309
  })]
295
310
  });
296
311
  }
297
- function F({ entry: e }) {
312
+ function R({ entry: e }) {
298
313
  let t = e.path.split("/").pop();
299
314
  if (e.kind === "page") {
300
315
  let n = e.file;
301
- return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", {
316
+ return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
302
317
  className: "ph",
303
- children: [/* @__PURE__ */ m("b", { children: t }), /* @__PURE__ */ m("span", { children: e.path })]
304
- }), /* @__PURE__ */ m("div", {
318
+ children: [/* @__PURE__ */ h("b", { children: t }), /* @__PURE__ */ h("span", { children: e.path })]
319
+ }), /* @__PURE__ */ h("div", {
305
320
  className: "pb",
306
- children: /* @__PURE__ */ h("dl", { children: [
307
- /* @__PURE__ */ m("dt", { children: "Source" }),
308
- /* @__PURE__ */ m("dd", { children: n.source === "knowledge" ? "Knowledge page in the run's pages" : n.source }),
309
- /* @__PURE__ */ m("dt", { children: "Size" }),
310
- /* @__PURE__ */ m("dd", { children: a(n.bytes) }),
311
- /* @__PURE__ */ m("dt", { children: n.sha256 ? "SHA-256" : "Git blob" }),
312
- /* @__PURE__ */ m("dd", {
321
+ children: /* @__PURE__ */ g("dl", { children: [
322
+ /* @__PURE__ */ h("dt", { children: "Source" }),
323
+ /* @__PURE__ */ h("dd", { children: n.source === "knowledge" ? "Knowledge page in the run's pages" : n.source }),
324
+ /* @__PURE__ */ h("dt", { children: "Size" }),
325
+ /* @__PURE__ */ h("dd", { children: a(n.bytes) }),
326
+ /* @__PURE__ */ h("dt", { children: n.sha256 ? "SHA-256" : "Git blob" }),
327
+ /* @__PURE__ */ h("dd", {
313
328
  className: "mono",
314
329
  children: n.sha256 ?? n.objectId ?? "not recorded"
315
330
  }),
316
- (n.alternates?.length ?? 0) > 0 && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("dt", { children: "Versions" }), /* @__PURE__ */ h("dd", { children: [(n.alternates?.length ?? 0) + 1, " retained copies share this path"] })] })
331
+ (n.alternates?.length ?? 0) > 0 && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("dt", { children: "Versions" }), /* @__PURE__ */ g("dd", { children: [(n.alternates?.length ?? 0) + 1, " retained copies share this path"] })] })
317
332
  ] })
318
333
  })] });
319
334
  }
320
- return /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", {
335
+ return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g("div", {
321
336
  className: "ph",
322
- children: [/* @__PURE__ */ m("b", { children: t }), /* @__PURE__ */ m("span", { children: e.path })]
323
- }), /* @__PURE__ */ m("div", {
337
+ children: [/* @__PURE__ */ h("b", { children: t }), /* @__PURE__ */ h("span", { children: e.path })]
338
+ }), /* @__PURE__ */ h("div", {
324
339
  className: "pb",
325
- children: /* @__PURE__ */ h("dl", { children: [
326
- /* @__PURE__ */ m("dt", { children: "Branch" }),
327
- /* @__PURE__ */ m("dd", { children: e.agent.name }),
328
- /* @__PURE__ */ m("dt", { children: "Commit" }),
329
- /* @__PURE__ */ m("dd", {
340
+ children: /* @__PURE__ */ g("dl", { children: [
341
+ /* @__PURE__ */ h("dt", { children: "Branch" }),
342
+ /* @__PURE__ */ h("dd", { children: e.agent.name }),
343
+ /* @__PURE__ */ h("dt", { children: "Commit" }),
344
+ /* @__PURE__ */ h("dd", {
330
345
  className: "mono",
331
346
  children: e.diff.commit.slice(0, 12)
332
347
  }),
333
- /* @__PURE__ */ m("dt", { children: "Against main" }),
334
- /* @__PURE__ */ h("dd", { children: [
348
+ /* @__PURE__ */ h("dt", { children: "Against main" }),
349
+ /* @__PURE__ */ g("dd", { children: [
335
350
  e.status === "A" ? "added" : "modified",
336
351
  " · ",
337
- /* @__PURE__ */ h("span", {
352
+ /* @__PURE__ */ g("span", {
338
353
  className: "ok",
339
354
  children: ["+", e.additions.toLocaleString("en-US")]
340
355
  }),
341
356
  " ",
342
- /* @__PURE__ */ h("span", {
357
+ /* @__PURE__ */ g("span", {
343
358
  className: "f",
344
359
  children: ["−", e.deletions.toLocaleString("en-US")]
345
360
  }),
346
361
  " · base ",
347
- /* @__PURE__ */ m("span", {
362
+ /* @__PURE__ */ h("span", {
348
363
  className: "mono",
349
364
  children: e.diff.baseCommit.slice(0, 8)
350
365
  })
@@ -352,36 +367,36 @@ function F({ entry: e }) {
352
367
  ] })
353
368
  })] });
354
369
  }
355
- function I({ entry: e, runUrl: t }) {
356
- let [n] = N(), r = e.path.split("/").pop() ?? e.path, a = S(e.path), s = a === "markdown" || a === "csv", c = [
370
+ function z({ entry: e, runUrl: t }) {
371
+ let [n] = I(), r = e.path.split("/").pop() ?? e.path, a = C(e.path), s = a === "markdown" || a === "csv", c = [
357
372
  "image",
358
373
  "pdf",
359
374
  "video",
360
375
  "audio",
361
376
  "spreadsheet",
362
377
  "binary"
363
- ].includes(a), l = e.kind === "page" ? o(e.file) : null, u = i(e.kind === "page" && !c ? l : null), d = T(t, e.kind === "code" ? e.agent.id : null, e.kind === "code" ? e.path : null), f = n === "source" && s ? `${r}.txt` : r;
364
- return e.kind === "code" && n === "diff" ? /* @__PURE__ */ m("div", {
378
+ ].includes(a), l = e.kind === "page" ? o(e.file) : null, u = i(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" && s ? `${r}.txt` : r;
379
+ return e.kind === "code" && n === "diff" ? /* @__PURE__ */ h("div", {
365
380
  className: "rp-doc",
366
- children: /* @__PURE__ */ m(E, {
381
+ children: /* @__PURE__ */ h(D, {
367
382
  runUrl: t,
368
383
  base: e.status === "A" ? null : "main",
369
384
  head: e.agent.id,
370
385
  path: e.path
371
386
  })
372
- }) : e.kind === "page" ? c && l ? /* @__PURE__ */ m("div", {
387
+ }) : e.kind === "page" ? c && l ? /* @__PURE__ */ h("div", {
373
388
  className: "rp-doc",
374
- children: /* @__PURE__ */ m(x, {
389
+ children: /* @__PURE__ */ h(S, {
375
390
  filename: r,
376
391
  blobUrl: l,
377
392
  size: e.file.bytes ?? void 0,
378
393
  hideHeader: !0
379
394
  })
380
- }) : u.error ? /* @__PURE__ */ m("p", {
395
+ }) : u.error ? /* @__PURE__ */ h("p", {
381
396
  className: "ws-status",
382
397
  role: "alert",
383
398
  children: u.error
384
- }) : u.text === void 0 ? /* @__PURE__ */ h("p", {
399
+ }) : u.text === void 0 ? /* @__PURE__ */ g("p", {
385
400
  className: "ws-status",
386
401
  role: "status",
387
402
  children: [
@@ -389,39 +404,39 @@ function I({ entry: e, runUrl: t }) {
389
404
  r,
390
405
  "…"
391
406
  ]
392
- }) : /* @__PURE__ */ m("div", {
407
+ }) : /* @__PURE__ */ h("div", {
393
408
  className: `rp-doc${n === "source" || !s ? " code" : ""}`,
394
- children: /* @__PURE__ */ m(x, {
409
+ children: /* @__PURE__ */ h(S, {
395
410
  filename: f,
396
411
  content: u.text,
397
412
  hideHeader: !0
398
413
  })
399
- }) : d.state === "error" ? /* @__PURE__ */ m("p", {
414
+ }) : d.state === "error" ? /* @__PURE__ */ h("p", {
400
415
  className: "ws-status",
401
416
  role: "alert",
402
417
  children: d.error
403
- }) : d.state === "absent" ? /* @__PURE__ */ m("p", {
418
+ }) : d.state === "absent" ? /* @__PURE__ */ h("p", {
404
419
  className: "ws-status",
405
420
  children: "This file is not on the branch any more."
406
- }) : d.state === "binary" ? /* @__PURE__ */ h("p", {
421
+ }) : d.state === "binary" ? /* @__PURE__ */ g("p", {
407
422
  className: "ws-status",
408
423
  children: [
409
424
  "This file is not text. ",
410
- /* @__PURE__ */ h("a", {
425
+ /* @__PURE__ */ g("a", {
411
426
  href: d.href,
412
427
  download: r,
413
428
  children: ["Download it at ", d.commit.slice(0, 12)]
414
429
  }),
415
430
  "."
416
431
  ]
417
- }) : d.state === "ready" ? /* @__PURE__ */ m("div", {
432
+ }) : d.state === "ready" ? /* @__PURE__ */ h("div", {
418
433
  className: `rp-doc${n === "source" || !s ? " code" : ""}`,
419
- children: /* @__PURE__ */ m(x, {
434
+ children: /* @__PURE__ */ h(S, {
420
435
  filename: f,
421
436
  content: d.text,
422
437
  hideHeader: !0
423
438
  })
424
- }) : /* @__PURE__ */ h("p", {
439
+ }) : /* @__PURE__ */ g("p", {
425
440
  className: "ws-status",
426
441
  role: "status",
427
442
  children: [
@@ -432,4 +447,4 @@ function I({ entry: e, runUrl: t }) {
432
447
  });
433
448
  }
434
449
  //#endregion
435
- export { j as Files };
450
+ export { P as Files };