@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,103 +1,103 @@
1
- import { C as e, S as t, a as n, b as r, l as i, n as a, s as o, v as s, w as c } from "./ui-CEhDqce8.js";
2
- import { agentParam as l } from "./RunPage-nJwCsArn.js";
1
+ import { C as e, E as t, a as n, l as r, n as i, s as a, v as o, w as s, x as c } from "./ui-D8QZRsC3.js";
2
+ import { agentParam as l } from "./RunPage-CkkcBEUe.js";
3
3
  import { useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
4
4
  import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
5
5
  import { FlowWaterfall as _ } from "@tangle-network/charts/react";
6
6
  //#region src/workspace/run/Timeline.tsx
7
- function v(t) {
8
- let n = t.root?.model ?? null, i = [];
9
- for (let e of t.agents) {
10
- if (e.start === null) continue;
11
- let a = e.state.tone === "live", o = a ? t.duration : Math.max(e.start, e.end ?? e.last ?? e.start);
12
- i.push({
13
- id: e.id,
14
- ...e.parent ? { parentId: e.parent } : {},
7
+ function v(e) {
8
+ let t = e.root?.model ?? null, n = [];
9
+ for (let r of e.agents) {
10
+ if (r.start === null) continue;
11
+ let i = r.state.tone === "live", a = i ? e.duration : Math.max(r.start, r.end ?? r.last ?? r.start);
12
+ n.push({
13
+ id: r.id,
14
+ ...r.parent ? { parentId: r.parent } : {},
15
15
  kind: "pipeline",
16
- name: e.name,
17
- ...e.model && e.model !== n ? { detail: e.model } : {},
18
- startMs: Math.max(0, e.start),
19
- endMs: o,
20
- status: a ? "running" : e.status === "failed" ? "failed" : "done",
21
- ...e.commits === null ? {} : { outcome: e.commits ? {
16
+ name: r.name,
17
+ ...r.model && r.model !== t ? { detail: r.model } : {},
18
+ startMs: Math.max(0, r.start),
19
+ endMs: a,
20
+ status: i ? "running" : r.status === "failed" ? "failed" : "done",
21
+ ...r.commits === null ? {} : { outcome: r.commits ? {
22
22
  tone: "ok",
23
23
  label: "Shipped"
24
- } : e.status === "failed" ? {
24
+ } : r.status === "failed" ? {
25
25
  tone: "failed",
26
26
  label: "Failed"
27
- } : a ? {
27
+ } : i ? {
28
28
  tone: "warn",
29
29
  label: "Running"
30
30
  } : {
31
31
  tone: "neutral",
32
32
  label: "Nothing shipped"
33
33
  } },
34
- ...e.listUsd ? { costUsd: e.listUsd } : e.billedUsd ? { costUsd: e.billedUsd } : {},
35
- ...e.byClass ? {
36
- promptTokens: e.byClass.input + e.byClass.cacheRead,
37
- completionTokens: e.byClass.output,
38
- cachedTokens: e.byClass.cacheRead
34
+ ...r.listUsd ? { costUsd: r.listUsd } : r.billedUsd ? { costUsd: r.billedUsd } : {},
35
+ ...r.byClass ? {
36
+ promptTokens: r.byClass.input + r.byClass.cacheRead,
37
+ completionTokens: r.byClass.output,
38
+ cachedTokens: r.byClass.cacheRead
39
39
  } : {},
40
- marks: e.restarts.map((e) => ({
41
- at: e,
40
+ marks: r.restarts.map((t) => ({
41
+ at: t,
42
42
  kind: "restart",
43
- label: `Restarted ${r(t.t0)(e)} UTC`
43
+ label: `Restarted ${c(e.t0)(t)} UTC`
44
44
  })),
45
45
  facts: [
46
46
  {
47
47
  label: "Commits",
48
- value: e.commits === null ? "—" : String(e.commits)
48
+ value: r.commits === null ? "—" : String(r.commits)
49
49
  },
50
50
  {
51
51
  label: "Restarts",
52
- value: String(e.restarts.length)
52
+ value: String(r.restarts.length)
53
53
  },
54
- ...e.turns === null ? [] : [{
54
+ ...r.turns === null ? [] : [{
55
55
  label: "Turns",
56
- value: String(e.turns)
56
+ value: String(r.turns)
57
57
  }],
58
- ...e.harness ? [{
58
+ ...r.harness ? [{
59
59
  label: "Harness",
60
- value: e.harness
60
+ value: r.harness
61
61
  }] : []
62
62
  ]
63
- }), e.steps.forEach((t, n) => {
64
- i.push({
65
- id: `${e.id}#${n}`,
66
- parentId: e.id,
67
- kind: t.kind,
68
- name: t.kind === "model" ? t.model ? t.model.split("/").pop() ?? "model call" : "model call" : t.kind === "tool" ? t.tool ?? "tool" : "waiting",
69
- ...t.target ? { detail: t.target } : {},
70
- startMs: Math.max(0, t.t),
71
- endMs: Math.max(0, t.t + t.d),
72
- status: t.failed ? "failed" : "done",
73
- ...t.tokens ? {
74
- promptTokens: t.tokens.input + t.tokens.cacheRead,
75
- completionTokens: t.tokens.output,
76
- cachedTokens: t.tokens.cacheRead
63
+ }), r.steps.forEach((e, t) => {
64
+ n.push({
65
+ id: `${r.id}#${t}`,
66
+ parentId: r.id,
67
+ kind: e.kind,
68
+ name: e.kind === "model" ? e.model ? e.model.split("/").pop() ?? "model call" : "model call" : e.kind === "tool" ? e.tool ?? "tool" : "waiting",
69
+ ...e.target ? { detail: e.target } : {},
70
+ startMs: Math.max(0, e.t),
71
+ endMs: Math.max(0, e.t + e.d),
72
+ status: e.failed ? "failed" : "done",
73
+ ...e.tokens ? {
74
+ promptTokens: e.tokens.input + e.tokens.cacheRead,
75
+ completionTokens: e.tokens.output,
76
+ cachedTokens: e.tokens.cacheRead
77
77
  } : {},
78
- ...t.usd ? { costUsd: t.usd } : {}
78
+ ...e.usd ? { costUsd: e.usd } : {}
79
79
  });
80
80
  });
81
81
  }
82
- let a = t.totals.byClass;
82
+ let r = e.totals.byClass;
83
83
  return {
84
- spans: i,
85
- totalMs: t.duration,
86
- promptTokens: a ? a.input + a.cacheRead : t.totals.tokens ?? 0,
87
- completionTokens: a?.output ?? 0,
88
- ...t.totals.listUsd === null ? {} : {
89
- costUsd: t.totals.listUsd,
84
+ spans: n,
85
+ totalMs: e.duration,
86
+ promptTokens: r ? r.input + r.cacheRead : e.totals.tokens ?? 0,
87
+ completionTokens: r?.output ?? 0,
88
+ ...e.totals.listUsd === null ? {} : {
89
+ costUsd: e.totals.listUsd,
90
90
  costBasis: "list"
91
91
  },
92
- ...t.totals.billedUsd === null ? {} : { billedUsd: t.totals.billedUsd },
93
- modelCalls: t.totals.model,
94
- toolCalls: t.totals.tool,
95
- errors: t.totals.failed,
96
- pauses: t.pauses.map((t) => ({
97
- startMs: t.from,
98
- endMs: t.to,
99
- label: `No agent turn ${e(t.to - t.from)}`,
100
- detail: t.reason
92
+ ...e.totals.billedUsd === null ? {} : { billedUsd: e.totals.billedUsd },
93
+ modelCalls: e.totals.model,
94
+ toolCalls: e.totals.tool,
95
+ errors: e.totals.failed,
96
+ pauses: e.pauses.map((e) => ({
97
+ startMs: e.from,
98
+ endMs: e.to,
99
+ label: `No agent turn ${s(e.to - e.from)}`,
100
+ detail: e.reason
101
101
  }))
102
102
  };
103
103
  }
@@ -144,14 +144,14 @@ function y({ m: e, agent: t, selectAgent: n, route: r, doc: i }) {
144
144
  });
145
145
  }
146
146
  function b({ m: l, a: u, href: d }) {
147
- let f = r(l.t0), p = Math.max(1, ...u.tools.map((e) => e.calls));
147
+ let f = c(l.t0), p = Math.max(1, ...u.tools.map((e) => e.calls));
148
148
  return /* @__PURE__ */ g("section", {
149
149
  className: "rp-card rp-insp",
150
150
  "aria-label": `${u.name}: whole run`,
151
151
  children: [/* @__PURE__ */ g("div", {
152
152
  className: "rp-hd sm",
153
153
  children: [
154
- /* @__PURE__ */ g("h2", { children: [/* @__PURE__ */ h(o, { tone: u.state.tone }), u.name] }),
154
+ /* @__PURE__ */ g("h2", { children: [/* @__PURE__ */ h(a, { tone: u.state.tone }), u.name] }),
155
155
  /* @__PURE__ */ h("span", {
156
156
  className: `rp-pill ${u.state.tone}`,
157
157
  children: u.state.label
@@ -186,46 +186,46 @@ function b({ m: l, a: u, href: d }) {
186
186
  /* @__PURE__ */ h("h4", { children: "Tokens" }),
187
187
  /* @__PURE__ */ h("div", {
188
188
  className: "big",
189
- children: u.tokens === null ? "—" : s(u.tokens)
189
+ children: u.tokens === null ? "—" : o(u.tokens)
190
190
  }),
191
191
  /* @__PURE__ */ g("dl", { children: [
192
192
  u.byClass ? /* @__PURE__ */ g(m, { children: [
193
193
  /* @__PURE__ */ h("dt", { children: "In" }),
194
- /* @__PURE__ */ h("dd", { children: s(u.byClass.input) }),
194
+ /* @__PURE__ */ h("dd", { children: o(u.byClass.input) }),
195
195
  /* @__PURE__ */ h("dt", { children: "Out" }),
196
- /* @__PURE__ */ h("dd", { children: s(u.byClass.output) }),
196
+ /* @__PURE__ */ h("dd", { children: o(u.byClass.output) }),
197
197
  /* @__PURE__ */ h("dt", { children: "Cached" }),
198
- /* @__PURE__ */ h("dd", { children: s(u.byClass.cacheRead) })
198
+ /* @__PURE__ */ h("dd", { children: o(u.byClass.cacheRead) })
199
199
  ] }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("dt", { children: "In · out split" }), /* @__PURE__ */ h("dd", {
200
200
  className: "dim",
201
201
  children: "not recorded"
202
202
  })] }),
203
203
  /* @__PURE__ */ h("dt", { children: "Cost" }),
204
- /* @__PURE__ */ h("dd", { children: i(u) })
204
+ /* @__PURE__ */ h("dd", { children: r(u) })
205
205
  ] })
206
206
  ] }),
207
207
  /* @__PURE__ */ g("div", { children: [
208
208
  /* @__PURE__ */ h("h4", { children: "Model calls" }),
209
209
  /* @__PURE__ */ h("div", {
210
210
  className: "big",
211
- children: t(u.modelCalls)
211
+ children: e(u.modelCalls)
212
212
  }),
213
213
  /* @__PURE__ */ g("dl", { children: [
214
214
  /* @__PURE__ */ h("dt", { children: "p50" }),
215
- /* @__PURE__ */ h("dd", { children: c(u.latency.p50) }),
215
+ /* @__PURE__ */ h("dd", { children: t(u.latency.p50) }),
216
216
  /* @__PURE__ */ h("dt", { children: "p90" }),
217
- /* @__PURE__ */ h("dd", { children: c(u.latency.p90) }),
217
+ /* @__PURE__ */ h("dd", { children: t(u.latency.p90) }),
218
218
  /* @__PURE__ */ h("dt", { children: "p99" }),
219
- /* @__PURE__ */ h("dd", { children: c(u.latency.p99) }),
219
+ /* @__PURE__ */ h("dd", { children: t(u.latency.p99) }),
220
220
  /* @__PURE__ */ h("dt", { children: "Busy" }),
221
- /* @__PURE__ */ h("dd", { children: e(u.busy) })
221
+ /* @__PURE__ */ h("dd", { children: s(u.busy) })
222
222
  ] })
223
223
  ] }),
224
224
  /* @__PURE__ */ g("div", { children: [
225
225
  /* @__PURE__ */ h("h4", { children: "Tool calls" }),
226
226
  /* @__PURE__ */ g("div", {
227
227
  className: "big",
228
- children: [t(u.toolCalls), u.toolFailures ? /* @__PURE__ */ g("small", {
228
+ children: [e(u.toolCalls), u.toolFailures ? /* @__PURE__ */ g("small", {
229
229
  className: "f",
230
230
  children: [
231
231
  " ",
@@ -236,25 +236,25 @@ function b({ m: l, a: u, href: d }) {
236
236
  }),
237
237
  u.tools.length ? /* @__PURE__ */ h("div", {
238
238
  className: "rp-tbars",
239
- children: u.tools.slice(0, 4).map((e) => /* @__PURE__ */ g("div", {
239
+ children: u.tools.slice(0, 4).map((t) => /* @__PURE__ */ g("div", {
240
240
  className: "row",
241
241
  children: [
242
242
  /* @__PURE__ */ h("span", {
243
243
  className: "l",
244
- title: e.name,
245
- children: e.name
244
+ title: t.name,
245
+ children: t.name
246
246
  }),
247
- /* @__PURE__ */ h(a, {
248
- ok: e.calls - e.failures,
249
- failed: e.failures,
247
+ /* @__PURE__ */ h(i, {
248
+ ok: t.calls - t.failures,
249
+ failed: t.failures,
250
250
  max: p
251
251
  }),
252
252
  /* @__PURE__ */ h("span", {
253
253
  className: "n",
254
- children: t(e.calls)
254
+ children: e(t.calls)
255
255
  })
256
256
  ]
257
- }, e.name))
257
+ }, t.name))
258
258
  }) : /* @__PURE__ */ h("span", {
259
259
  className: "dim",
260
260
  children: "No tool calls"
@@ -1,6 +1,6 @@
1
1
  import { A as e, y as t } from "./run-receipt-Bvi4-KVM.js";
2
2
  import { n, p as r } from "./data-BJmP7F1M.js";
3
- import { a as i, o as a } from "./ui-CEhDqce8.js";
3
+ import { a as i, o as a } from "./ui-D8QZRsC3.js";
4
4
  import { useEffect as o, useMemo as s, useState as c } from "react";
5
5
  import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
6
6
  import { PageHeader as f, SegmentedControl as p } from "@tangle-network/ui/primitives";
@@ -107,12 +107,8 @@ function T(e, n, r) {
107
107
  text: /* @__PURE__ */ d(l, { children: [
108
108
  e.view.blocker.kind === "stopped" ? "Stopped" : "Held",
109
109
  ": ",
110
- /* @__PURE__ */ u("b", { children: D(e.view.blocker.sentence ?? e.view.blocker.text) })
111
- ] }),
112
- badge: {
113
- text: e.view.blocker.kind === "stopped" ? "stopped" : "held",
114
- tone: "neutral"
115
- }
110
+ O((e.view.blocker.sentence ?? e.view.blocker.text).replace(/^(?:Stopped|Held) by [\w ]+: /, ""), 12)
111
+ ] })
116
112
  });
117
113
  }
118
114
  for (let n of e.now ?? []) a(n.startedAt) && i.push({
@@ -135,23 +131,35 @@ function T(e, n, r) {
135
131
  });
136
132
  return i.sort((e, t) => e.at < t.at ? 1 : -1);
137
133
  }
138
- var E = (e) => e.replace(/\/(home|mnt|Users)\/\S+/g, "").replace(/\bkey_[A-Za-z0-9]+\b\s*·?\s*/g, "").replace(/\s{2,}/g, " ").trim(), D = (e, t = 14) => {
139
- let n = E(e).split(/\s+/);
134
+ function E(e) {
135
+ let t = /* @__PURE__ */ new Map();
136
+ for (let n of e) {
137
+ let e = t.get(n.play) ?? {
138
+ play: n.play,
139
+ title: n.title,
140
+ moves: []
141
+ };
142
+ e.moves.push(n), t.set(n.play, e);
143
+ }
144
+ return [...t.values()];
145
+ }
146
+ var D = (e) => e.replace(/\/(home|mnt|Users)\/\S+/g, "").replace(/\bkey_[A-Za-z0-9]+\b\s*·?\s*/g, "").replace(/\s{2,}/g, " ").trim(), O = (e, t = 14) => {
147
+ let n = D(e).split(/\s+/);
140
148
  return n.length > t ? `${n.slice(0, t).join(" ")}…` : n.join(" ");
141
149
  };
142
- function O({ api: e }) {
150
+ function k({ api: e }) {
143
151
  let t = r(`${e}/overview`, 6e4, !0);
144
152
  return t.error && !t.data ? /* @__PURE__ */ d("p", {
145
153
  className: "ws-status",
146
154
  role: "alert",
147
155
  children: ["Today is unavailable: ", t.error]
148
- }) : t.data ? /* @__PURE__ */ u(k, { doc: t.data }) : /* @__PURE__ */ u("p", {
156
+ }) : t.data ? /* @__PURE__ */ u(A, { doc: t.data }) : /* @__PURE__ */ u("p", {
149
157
  className: "ws-status",
150
158
  role: "status",
151
159
  children: "Reading what needs you…"
152
160
  });
153
161
  }
154
- function k({ doc: e }) {
162
+ function A({ doc: e }) {
155
163
  let t = Date.parse(e.composedAt) || Date.now(), n = b(t), r = e.plays ?? [], o = s(() => new Map(r.map((t) => [t.play, (e.now ?? []).filter((e) => e.play === t.play)])), [e, r]), c = s(() => new Map((e.week ?? []).map((e) => [e.play, e])), [e]), l = (e.attention ?? []).filter((e) => e.needsYou || e.tone === "crit" || e.tone === "warn"), p = l.filter((e) => e.needsYou || !e.owner || e.owner === "The operator"), g = l.length - p.length, v = s(() => T(e, r, n.at), [
156
164
  e,
157
165
  r,
@@ -192,22 +200,17 @@ function k({ doc: e }) {
192
200
  }),
193
201
  actions: /* @__PURE__ */ d("ul", {
194
202
  className: "rp-stats",
195
- children: [
196
- /* @__PURE__ */ d("li", { children: [/* @__PURE__ */ u("b", { children: p.length }), " need you"] }),
197
- /* @__PURE__ */ d("li", { children: [/* @__PURE__ */ u("b", { children: v.length }), " changes"] }),
198
- /* @__PURE__ */ d("li", { children: [
199
- /* @__PURE__ */ u("b", { children: x }),
200
- " ",
201
- x === 1 ? "play" : "plays",
202
- " running"
203
- ] }),
204
- /* @__PURE__ */ d("li", { children: [
205
- /* @__PURE__ */ u("b", { children: (e.now ?? []).length }),
206
- " runs · ",
207
- /* @__PURE__ */ u("b", { children: y }),
208
- " agents live"
209
- ] })
210
- ]
203
+ children: [/* @__PURE__ */ d("li", { children: [
204
+ /* @__PURE__ */ u("b", { children: x }),
205
+ " ",
206
+ x === 1 ? "play" : "plays",
207
+ " running"
208
+ ] }), /* @__PURE__ */ d("li", { children: [
209
+ /* @__PURE__ */ u("b", { children: y }),
210
+ " ",
211
+ y === 1 ? "agent" : "agents",
212
+ " live"
213
+ ] })]
211
214
  })
212
215
  }),
213
216
  /* @__PURE__ */ d("div", {
@@ -225,7 +228,7 @@ function k({ doc: e }) {
225
228
  }),
226
229
  /* @__PURE__ */ u("ul", {
227
230
  className: "td2-needs rp-scroll",
228
- children: p.length ? p.map((e, t) => /* @__PURE__ */ u(A, { item: e }, t)) : /* @__PURE__ */ d("li", {
231
+ children: p.length ? p.map((e, t) => /* @__PURE__ */ u(j, { item: e }, t)) : /* @__PURE__ */ d("li", {
229
232
  className: "td2-none",
230
233
  children: [/* @__PURE__ */ u(i, { name: "check" }), "Nothing needs you."]
231
234
  })
@@ -255,24 +258,25 @@ function k({ doc: e }) {
255
258
  children: v.length
256
259
  })
257
260
  ] })
258
- }), /* @__PURE__ */ u("ol", {
261
+ }), /* @__PURE__ */ u("div", {
259
262
  className: "td2-moves rp-scroll",
260
- children: v.length ? v.slice(0, 60).map((e, t) => /* @__PURE__ */ d("li", { children: [
263
+ children: v.length ? E(v.slice(0, 60)).map((e) => /* @__PURE__ */ d("section", { children: [/* @__PURE__ */ d("h3", { children: [/* @__PURE__ */ u("a", {
264
+ href: h(e.play),
265
+ children: e.title
266
+ }), /* @__PURE__ */ u("span", {
267
+ className: "ct",
268
+ children: e.moves.length
269
+ })] }), /* @__PURE__ */ u("ol", { children: e.moves.map((e, t) => /* @__PURE__ */ d("li", { children: [
261
270
  /* @__PURE__ */ u("time", { children: _(e.at) }),
262
- /* @__PURE__ */ u("a", {
263
- className: "pl",
264
- href: h(e.play),
265
- children: e.title
266
- }),
267
271
  /* @__PURE__ */ u("span", {
268
272
  className: "tx",
269
273
  children: e.text
270
274
  }),
271
- e.badge && /* @__PURE__ */ u("span", {
275
+ /* @__PURE__ */ u("span", { children: e.badge && /* @__PURE__ */ u("span", {
272
276
  className: `td2-badge ${e.badge.tone}`,
273
277
  children: e.badge.text
274
- })
275
- ] }, t)) : /* @__PURE__ */ d("li", {
278
+ }) })
279
+ ] }, t)) })] }, e.play)) : /* @__PURE__ */ d("p", {
276
280
  className: "td2-none",
277
281
  children: [
278
282
  "Nothing moved since ",
@@ -283,7 +287,7 @@ function k({ doc: e }) {
283
287
  })]
284
288
  })]
285
289
  }),
286
- /* @__PURE__ */ u(M, {
290
+ /* @__PURE__ */ u(N, {
287
291
  plays: r,
288
292
  live: o,
289
293
  week: c,
@@ -292,7 +296,7 @@ function k({ doc: e }) {
292
296
  ]
293
297
  });
294
298
  }
295
- function A({ item: e }) {
299
+ function j({ item: e }) {
296
300
  let t = /* @__PURE__ */ d(l, { children: [
297
301
  /* @__PURE__ */ u(i, {
298
302
  name: "alert",
@@ -300,7 +304,7 @@ function A({ item: e }) {
300
304
  }),
301
305
  /* @__PURE__ */ d("span", { children: [/* @__PURE__ */ u("b", { children: e.text }), (e.next || e.detail) && /* @__PURE__ */ u("span", {
302
306
  className: "sub",
303
- children: E([e.next, e.detail].filter(Boolean).join(" · "))
307
+ children: D([e.next, e.detail].filter(Boolean).join(" · "))
304
308
  })] }),
305
309
  e.href && /* @__PURE__ */ u(i, {
306
310
  name: "chevron",
@@ -312,8 +316,8 @@ function A({ item: e }) {
312
316
  children: t
313
317
  }) : /* @__PURE__ */ u("div", { children: t }) });
314
318
  }
315
- var j = 6;
316
- function M({ plays: e, live: t, week: n, now: r }) {
319
+ var M = 6;
320
+ function N({ plays: e, live: t, week: n, now: r }) {
317
321
  let [a, o] = c("all"), [l, f] = c(""), [h, g] = c({
318
322
  running: !0,
319
323
  stopped: !0,
@@ -416,7 +420,7 @@ function M({ plays: e, live: t, week: n, now: r }) {
416
420
  "stopped",
417
421
  "solved"
418
422
  ].filter((e) => (a === "all" || a === e) && y[e].length).map((e) => {
419
- let a = y[e], o = _[e] || l ? a : a.slice(0, j);
423
+ let a = y[e], o = _[e] || l ? a : a.slice(0, M);
420
424
  return /* @__PURE__ */ d("div", {
421
425
  className: "td2-group",
422
426
  children: [
@@ -437,7 +441,7 @@ function M({ plays: e, live: t, week: n, now: r }) {
437
441
  })
438
442
  ]
439
443
  }),
440
- h[e] && o.map((i) => /* @__PURE__ */ u(N, {
444
+ h[e] && o.map((i) => /* @__PURE__ */ u(P, {
441
445
  p: i,
442
446
  group: e,
443
447
  runs: t.get(i.play) ?? [],
@@ -464,7 +468,7 @@ function M({ plays: e, live: t, week: n, now: r }) {
464
468
  ]
465
469
  });
466
470
  }
467
- function N({ p: r, group: i, runs: a, week: o, now: s }) {
471
+ function P({ p: r, group: i, runs: a, week: o, now: s }) {
468
472
  let c = r.view.trend, f = c?.newest, p = c && f ? f.passed - c.best : 0, m = a.reduce((e, t) => e + (t.agents ?? 0), 0), y = (r.view.bars ?? []).filter((e) => e.latest);
469
473
  return /* @__PURE__ */ d("div", {
470
474
  className: `td2-row ${i}`,
@@ -476,7 +480,10 @@ function N({ p: r, group: i, runs: a, week: o, now: s }) {
476
480
  children: r.title
477
481
  }), /* @__PURE__ */ u("span", {
478
482
  className: "sub",
479
- children: o ? `${o.runCount ?? o.runs.length} runs this week${o.lostHours >= .1 ? ` · ${o.lostHours.toFixed(+(o.lostHours < 10))} h lost` : ""}` : /* @__PURE__ */ u(n, { status: e(r.view.status) })
483
+ children: i === "stopped" && r.view.blocker && y.length ? /* @__PURE__ */ d("span", {
484
+ title: D(r.view.blocker.sentence ?? r.view.blocker.text),
485
+ children: ["Stopped ", _(r.view.blocker.since)]
486
+ }) : o ? `${o.runCount ?? o.runs.length} ${(o.runCount ?? o.runs.length) === 1 ? "run" : "runs"} this week${o.lostHours >= .1 ? ` · ${o.lostHours.toFixed(+(o.lostHours < 10))} h lost` : ""}` : /* @__PURE__ */ u(n, { status: e(r.view.status) })
480
487
  })]
481
488
  }),
482
489
  /* @__PURE__ */ u("div", {
@@ -489,7 +496,7 @@ function N({ p: r, group: i, runs: a, week: o, now: s }) {
489
496
  "/",
490
497
  c.total
491
498
  ] }),
492
- /* @__PURE__ */ u(P, {
499
+ /* @__PURE__ */ u(F, {
493
500
  passed: f.passed,
494
501
  total: c.total
495
502
  }),
@@ -514,7 +521,7 @@ function N({ p: r, group: i, runs: a, week: o, now: s }) {
514
521
  }),
515
522
  /* @__PURE__ */ u("div", {
516
523
  className: "metrics",
517
- children: i === "stopped" && r.view.blocker ? /* @__PURE__ */ d("p", {
524
+ children: i === "stopped" && r.view.blocker && !y.length ? /* @__PURE__ */ d("p", {
518
525
  className: "hold",
519
526
  children: [
520
527
  /* @__PURE__ */ d("b", { children: [
@@ -523,20 +530,20 @@ function N({ p: r, group: i, runs: a, week: o, now: s }) {
523
530
  ":"
524
531
  ] }),
525
532
  " ",
526
- D((r.view.blocker.sentence ?? r.view.blocker.text).replace(/^Stopped by [\w ]+: /, ""), 22)
533
+ O((r.view.blocker.sentence ?? r.view.blocker.text).replace(/^Stopped by [\w ]+: /, ""), 22)
527
534
  ]
528
- }) : y.length ? y.map((e) => /* @__PURE__ */ u(F, { bar: e }, e.metric)) : i === "running" && r.view.blocker ? /* @__PURE__ */ d("p", {
535
+ }) : y.length ? y.map((e) => /* @__PURE__ */ u(I, { bar: e }, e.metric)) : i === "running" && r.view.blocker ? /* @__PURE__ */ d("p", {
529
536
  className: "hold",
530
537
  children: [
531
538
  /* @__PURE__ */ u("b", { children: "Held:" }),
532
539
  " ",
533
- D(r.view.blocker.sentence ?? r.view.blocker.text, 18)
540
+ O(r.view.blocker.sentence ?? r.view.blocker.text, 18)
534
541
  ]
535
542
  }) : null
536
543
  }),
537
544
  /* @__PURE__ */ u("div", {
538
545
  className: "trend",
539
- children: c && /* @__PURE__ */ u(I, { trend: c })
546
+ children: c && /* @__PURE__ */ u(L, { trend: c })
540
547
  }),
541
548
  /* @__PURE__ */ u("div", {
542
549
  className: "live",
@@ -567,14 +574,14 @@ function N({ p: r, group: i, runs: a, week: o, now: s }) {
567
574
  ]
568
575
  });
569
576
  }
570
- function P({ passed: e, total: t }) {
577
+ function F({ passed: e, total: t }) {
571
578
  return /* @__PURE__ */ u("span", {
572
579
  className: "td2-meter",
573
580
  "aria-hidden": "true",
574
581
  children: Array.from({ length: Math.min(t, 12) }, (t, n) => /* @__PURE__ */ u("i", { className: n < e ? "on" : "" }, n))
575
582
  });
576
583
  }
577
- function F({ bar: e }) {
584
+ function I({ bar: e }) {
578
585
  let t = !e.ratio || e.ratio.side === "met", n = t ? 0 : Math.min(w, Math.log10(Math.max(1, e.ratio.x)));
579
586
  return /* @__PURE__ */ d("div", {
580
587
  className: "td2-metric",
@@ -617,7 +624,7 @@ function F({ bar: e }) {
617
624
  ]
618
625
  });
619
626
  }
620
- function I({ trend: e }) {
627
+ function L({ trend: e }) {
621
628
  let t = e.passed.length, n = (e) => t <= 1 ? 168 : e / (t - 1) * 162 + 3, r = (t) => 27 - t / Math.max(1, e.total) * 22, i = "";
622
629
  e.passed.forEach((e, t) => {
623
630
  e !== null && (i += `${i ? "L" : "M"}${n(t).toFixed(1)} ${r(e).toFixed(1)}`);
@@ -650,4 +657,4 @@ function I({ trend: e }) {
650
657
  });
651
658
  }
652
659
  //#endregion
653
- export { O as TodayPage, x as measure };
660
+ export { k as TodayPage, x as measure };