@peasant-labs/fairtrade 0.0.38 → 0.0.39

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.
@@ -1,4 +1,4 @@
1
- import { At as e, Dt as t, Mt as n, Tt as r, pt as i, wt as a } from "./GraphLegend-7PmEpBZQ.js";
1
+ import { At as e, Dt as t, Mt as n, Tt as r, pt as i, wt as a } from "./GraphLegend-DwLFq2JU.js";
2
2
  import { r as o } from "./ChartLine-MZVbpUu1.js";
3
3
  import { Children as s, Fragment as c, createContext as l, useCallback as u, useContext as d, useEffect as f, useId as p, useLayoutEffect as m, useMemo as h, useReducer as g, useRef as _, useState as v } from "react";
4
4
  import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
@@ -3908,14 +3908,16 @@ function Ni({ match: e, onToggle: t, readOnly: n = !1 }) {
3908
3908
  className: "rdx-badge-warn",
3909
3909
  "aria-hidden": "true"
3910
3910
  }),
3911
- /* @__PURE__ */ b("span", {
3912
- className: "rdx-badge-cat",
3913
- children: Vt(i)
3914
- }),
3915
- /* @__PURE__ */ b("span", {
3916
- className: "rdx-badge-dot",
3917
- "aria-hidden": "true",
3918
- children: ","
3911
+ /* @__PURE__ */ x("span", {
3912
+ className: "rdx-badge-lead",
3913
+ children: [/* @__PURE__ */ b("span", {
3914
+ className: "rdx-badge-cat",
3915
+ children: Vt(i)
3916
+ }), /* @__PURE__ */ b("span", {
3917
+ className: "rdx-badge-dot",
3918
+ "aria-hidden": "true",
3919
+ children: ","
3920
+ })]
3919
3921
  }),
3920
3922
  /* @__PURE__ */ x("span", {
3921
3923
  className: "rdx-badge-conf tnum",
@@ -5191,18 +5193,20 @@ function ya({ app: e, apps: t = Ji, groups: n = [], currentId: r, homeHref: i, b
5191
5193
  n,
5192
5194
  I
5193
5195
  ]);
5194
- let ue = u((e = !0) => {
5196
+ let ue = u((e) => {
5197
+ e.currentTarget.scrollLeft !== 0 && (e.currentTarget.scrollLeft = 0);
5198
+ }, []), de = u((e = !0) => {
5195
5199
  L(!1), e && requestAnimationFrame(() => ae.current?.focus());
5196
- }, []), de = u(() => {
5197
- I && ue(!1);
5198
- }, [I, ue]);
5200
+ }, []), H = u(() => {
5201
+ I && de(!1);
5202
+ }, [I, de]);
5199
5203
  f(() => {
5200
5204
  if (!I) return;
5201
5205
  let e = re.current, t = ae.current;
5202
5206
  t?.focus();
5203
5207
  let n = (n) => n === t || e.contains(n), r = () => [t, ...e.querySelectorAll("a[href], button:not([disabled]), [tabindex]:not([tabindex=\"-1\"])")].filter((e) => e && (e.getClientRects().length > 0 || e === document.activeElement)), i = (e) => {
5204
5208
  if (e.key === "Escape") {
5205
- e.preventDefault(), ue();
5209
+ e.preventDefault(), de();
5206
5210
  return;
5207
5211
  }
5208
5212
  if (e.key !== "Tab") return;
@@ -5215,13 +5219,13 @@ function ya({ app: e, apps: t = Ji, groups: n = [], currentId: r, homeHref: i, b
5215
5219
  let a = document.body.style.overflow;
5216
5220
  document.body.style.overflow = "hidden";
5217
5221
  let o = window.matchMedia?.("(width >= 768px)"), s = (e) => {
5218
- e.matches && ue(!1);
5222
+ e.matches && de(!1);
5219
5223
  };
5220
5224
  return o?.addEventListener?.("change", s), () => {
5221
5225
  document.removeEventListener("keydown", i), document.body.style.overflow = a, o?.removeEventListener?.("change", s);
5222
5226
  };
5223
- }, [I, ue]);
5224
- let H = (e) => {
5227
+ }, [I, de]);
5228
+ let fe = (e) => {
5225
5229
  let t;
5226
5230
  if (e.key === "ArrowRight") t = M + Qi;
5227
5231
  else if (e.key === "ArrowLeft") t = M - Qi;
@@ -5229,27 +5233,27 @@ function ya({ app: e, apps: t = Ji, groups: n = [], currentId: r, homeHref: i, b
5229
5233
  else if (e.key === "End") t = T;
5230
5234
  else return;
5231
5235
  e.preventDefault(), t = ia(t, w, T), N(t), ce(t);
5232
- }, fe = (e) => {
5236
+ }, pe = (e) => {
5233
5237
  e.button !== void 0 && e.button !== 0 || (e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId), oe.current = {
5234
5238
  x: e.clientX,
5235
5239
  width: se.current
5236
5240
  }, F(!0));
5237
- }, pe = (e) => {
5241
+ }, me = (e) => {
5238
5242
  let t = oe.current;
5239
5243
  t && N(ia(t.width + e.clientX - t.x, w, T));
5240
- }, me = (e) => {
5244
+ }, he = (e) => {
5241
5245
  oe.current && (oe.current = null, e.currentTarget.releasePointerCapture?.(e.pointerId), F(!1), ce(se.current));
5242
- }, he = ["asb", O].filter(Boolean).join(" "), ge = [], _e = null, ve = n.map((e) => ({
5246
+ }, ge = ["asb", O].filter(Boolean).join(" "), _e = [], ve = null, ye = n.map((e) => ({
5243
5247
  ...e,
5244
- items: e.items.filter((e) => e.id === "settings" && e.href ? (_e ??= e, !1) : e.external ? (ge.push(e), !1) : !0)
5245
- })).filter((e) => e.items.length > 0), ye = fa(e, t), be = [...ge, ...s], U = c ?? _e?.href, xe = +!!o + ye.length + be.length, W = h ?? (m ? /* @__PURE__ */ b(va, {
5248
+ items: e.items.filter((e) => e.id === "settings" && e.href ? (ve ??= e, !1) : e.external ? (_e.push(e), !1) : !0)
5249
+ })).filter((e) => e.items.length > 0), be = fa(e, t), U = [..._e, ...s], xe = c ?? ve?.href, W = +!!o + be.length + U.length, Se = h ?? (m ? /* @__PURE__ */ b(va, {
5246
5250
  account: m,
5247
5251
  Link: k,
5248
- onNavigate: de,
5252
+ onNavigate: H,
5249
5253
  collapsed: A
5250
- }) : null), Se = (l === "light" || l === "dark") && typeof d == "function";
5254
+ }) : null), Ce = (l === "light" || l === "dark") && typeof d == "function";
5251
5255
  return /* @__PURE__ */ x("div", {
5252
- className: he,
5256
+ className: ge,
5253
5257
  "data-collapsed": A ? "true" : "false",
5254
5258
  "data-drawer-open": I ? "true" : "false",
5255
5259
  "data-resizing": P ? "true" : void 0,
@@ -5264,7 +5268,7 @@ function ya({ app: e, apps: t = Ji, groups: n = [], currentId: r, homeHref: i, b
5264
5268
  brand: a,
5265
5269
  homeHref: i,
5266
5270
  Link: k,
5267
- onNavigate: de
5271
+ onNavigate: H
5268
5272
  }), /* @__PURE__ */ b("button", {
5269
5273
  ref: ae,
5270
5274
  type: "button",
@@ -5272,14 +5276,14 @@ function ya({ app: e, apps: t = Ji, groups: n = [], currentId: r, homeHref: i, b
5272
5276
  "aria-label": I ? "close the menu" : "open the menu",
5273
5277
  "aria-expanded": I ? "true" : "false",
5274
5278
  "aria-controls": ne,
5275
- onClick: () => I ? ue() : L(!0),
5279
+ onClick: () => I ? de() : L(!0),
5276
5280
  children: /* @__PURE__ */ b(la, {})
5277
5281
  })]
5278
5282
  }),
5279
5283
  /* @__PURE__ */ b("div", {
5280
5284
  className: "asb-scrim",
5281
5285
  "aria-hidden": "true",
5282
- onClick: () => ue()
5286
+ onClick: () => de()
5283
5287
  }),
5284
5288
  /* @__PURE__ */ x("aside", {
5285
5289
  id: ne,
@@ -5293,7 +5297,7 @@ function ya({ app: e, apps: t = Ji, groups: n = [], currentId: r, homeHref: i, b
5293
5297
  brand: a,
5294
5298
  homeHref: i,
5295
5299
  Link: k,
5296
- onNavigate: de
5300
+ onNavigate: H
5297
5301
  }), /* @__PURE__ */ b("button", {
5298
5302
  type: "button",
5299
5303
  className: "asb-toggle",
@@ -5308,6 +5312,7 @@ function ya({ app: e, apps: t = Ji, groups: n = [], currentId: r, homeHref: i, b
5308
5312
  /* @__PURE__ */ x("div", {
5309
5313
  ref: ie,
5310
5314
  className: "asb-scroll",
5315
+ onScroll: ue,
5311
5316
  children: [
5312
5317
  /* @__PURE__ */ b("span", {
5313
5318
  className: "asb-indicator",
@@ -5323,14 +5328,14 @@ function ya({ app: e, apps: t = Ji, groups: n = [], currentId: r, homeHref: i, b
5323
5328
  }),
5324
5329
  /* @__PURE__ */ b(ha, {
5325
5330
  search: o,
5326
- entries: ye,
5327
- elsewhere: be,
5331
+ entries: be,
5332
+ elsewhere: U,
5328
5333
  Link: k,
5329
- onNavigate: de,
5334
+ onNavigate: H,
5330
5335
  collapsed: A,
5331
5336
  currentId: r
5332
5337
  }),
5333
- ve.map((e) => /* @__PURE__ */ x("nav", {
5338
+ ye.map((e) => /* @__PURE__ */ x("nav", {
5334
5339
  className: "asb-group",
5335
5340
  "aria-label": e.ariaLabel ?? e.label ?? e.id,
5336
5341
  children: [e.label ? /* @__PURE__ */ b("span", {
@@ -5339,12 +5344,12 @@ function ya({ app: e, apps: t = Ji, groups: n = [], currentId: r, homeHref: i, b
5339
5344
  }) : null, /* @__PURE__ */ b("ul", {
5340
5345
  className: "asb-list",
5341
5346
  children: e.items.map((e) => /* @__PURE__ */ b("li", {
5342
- style: { "--asb-i": xe++ },
5347
+ style: { "--asb-i": W++ },
5343
5348
  children: /* @__PURE__ */ b(da, {
5344
5349
  item: e,
5345
5350
  current: e.id === r,
5346
5351
  Link: k,
5347
- onNavigate: de,
5352
+ onNavigate: H,
5348
5353
  collapsed: A
5349
5354
  })
5350
5355
  }, e.id))
@@ -5352,20 +5357,20 @@ function ya({ app: e, apps: t = Ji, groups: n = [], currentId: r, homeHref: i, b
5352
5357
  }, e.id))
5353
5358
  ]
5354
5359
  }),
5355
- Se || W || U ? /* @__PURE__ */ x("div", {
5360
+ Ce || Se || xe ? /* @__PURE__ */ x("div", {
5356
5361
  className: "asb-foot",
5357
5362
  children: [
5358
- W ? /* @__PURE__ */ b("div", {
5363
+ Se ? /* @__PURE__ */ b("div", {
5359
5364
  className: "asb-me",
5360
- children: W
5365
+ children: Se
5361
5366
  }) : null,
5362
- U ? /* @__PURE__ */ b(_a, {
5363
- href: U,
5364
- current: r === (_e?.id ?? "settings"),
5367
+ xe ? /* @__PURE__ */ b(_a, {
5368
+ href: xe,
5369
+ current: r === (ve?.id ?? "settings"),
5365
5370
  Link: k,
5366
- onNavigate: de
5371
+ onNavigate: H
5367
5372
  }) : null,
5368
- Se ? /* @__PURE__ */ b(ga, {
5373
+ Ce ? /* @__PURE__ */ b(ga, {
5369
5374
  theme: l,
5370
5375
  onThemeChange: d
5371
5376
  }) : null
@@ -5381,11 +5386,11 @@ function ya({ app: e, apps: t = Ji, groups: n = [], currentId: r, homeHref: i, b
5381
5386
  "aria-valuenow": M,
5382
5387
  "aria-valuemin": w,
5383
5388
  "aria-valuemax": T,
5384
- onKeyDown: H,
5385
- onPointerDown: fe,
5386
- onPointerMove: pe,
5387
- onPointerUp: me,
5388
- onPointerCancel: me
5389
+ onKeyDown: fe,
5390
+ onPointerDown: pe,
5391
+ onPointerMove: me,
5392
+ onPointerUp: he,
5393
+ onPointerCancel: he
5389
5394
  })
5390
5395
  ]
5391
5396
  })
@@ -9824,34 +9829,73 @@ function wc(e) {
9824
9829
  let t = bc(vc(e.arguments));
9825
9830
  return (t && xc(t.content)) ?? "";
9826
9831
  }
9827
- function Tc(e) {
9828
- let t = e.name.toLowerCase();
9829
- if (t === "write") {
9830
- let t = wc(e);
9831
- return {
9832
- adds: t ? t.split("\n").length : 0,
9833
- dels: 0
9834
- };
9832
+ function Tc(e, t) {
9833
+ let n = e === "" ? [] : e.split("\n"), r = t === "" ? [] : t.split("\n"), i = n.length, a = r.length, o = Array.from({ length: i + 1 }, () => Array(a + 1).fill(0));
9834
+ for (let e = i - 1; e >= 0; e--) for (let t = a - 1; t >= 0; t--) o[e][t] = n[e] === r[t] ? o[e + 1][t + 1] + 1 : Math.max(o[e + 1][t], o[e][t + 1]);
9835
+ let s = [], c = 0, l = 0, u = 1, d = 1;
9836
+ for (; c < i && l < a;) n[c] === r[l] ? (s.push({
9837
+ sign: "ctx",
9838
+ oldNo: String(u++),
9839
+ newNo: String(d++),
9840
+ text: n[c]
9841
+ }), c++, l++) : o[c + 1][l] >= o[c][l + 1] ? (s.push({
9842
+ sign: "del",
9843
+ oldNo: String(u++),
9844
+ text: n[c]
9845
+ }), c++) : (s.push({
9846
+ sign: "add",
9847
+ newNo: String(d++),
9848
+ text: r[l]
9849
+ }), l++);
9850
+ for (; c < i;) s.push({
9851
+ sign: "del",
9852
+ oldNo: String(u++),
9853
+ text: n[c++]
9854
+ });
9855
+ for (; l < a;) s.push({
9856
+ sign: "add",
9857
+ newNo: String(d++),
9858
+ text: r[l++]
9859
+ });
9860
+ return s;
9861
+ }
9862
+ var Ec = /* @__PURE__ */ new WeakMap();
9863
+ function Dc(e) {
9864
+ if (Ec.has(e)) return Ec.get(e);
9865
+ let t = e.name.toLowerCase(), n;
9866
+ if (t === "write") n = [Tc("", wc(e))];
9867
+ else if (t === "edit" || t === "multiedit" || t === "notebookedit") {
9868
+ let t = Cc(e);
9869
+ t.length && (n = t.map((e) => Tc(e.old_string, e.new_string)));
9835
9870
  }
9836
- if (t === "edit" || t === "multiedit" || t === "notebookedit") {
9837
- let t = 0, n = 0;
9838
- for (let r of Cc(e)) {
9839
- let e = (r.new_string || "").split("\n").length, i = (r.old_string || "").split("\n").length;
9840
- e > i && (t += e - i), i > e && (n += i - e);
9871
+ let r;
9872
+ if (n) {
9873
+ let e = 0, t = 0;
9874
+ for (let r of n) {
9875
+ let n = r.length > 0 && r[r.length - 1].text === "" ? r.slice(0, -1) : r;
9876
+ for (let r of n) r.sign === "add" ? e++ : r.sign === "del" && t++;
9841
9877
  }
9842
- return {
9843
- adds: t,
9844
- dels: n
9878
+ r = {
9879
+ spans: n,
9880
+ adds: e,
9881
+ dels: t
9845
9882
  };
9846
9883
  }
9847
- return {
9884
+ return Ec.set(e, r), r;
9885
+ }
9886
+ function Oc(e) {
9887
+ let t = Dc(e);
9888
+ return t ? {
9889
+ adds: t.adds,
9890
+ dels: t.dels
9891
+ } : {
9848
9892
  adds: 0,
9849
9893
  dels: 0
9850
9894
  };
9851
9895
  }
9852
9896
  //#endregion
9853
9897
  //#region src/ui/transcript/analytics.js
9854
- function Ec(e) {
9898
+ function kc(e) {
9855
9899
  if (e.length === 0) return [];
9856
9900
  let t = [];
9857
9901
  for (let n = 0; n < e.length; n++) {
@@ -9862,11 +9906,11 @@ function Ec(e) {
9862
9906
  let n = [];
9863
9907
  for (let r = 0; r < t.length; r++) {
9864
9908
  let i = t[r], a = (r + 1 < t.length ? t[r + 1] : e.length) - 1;
9865
- n.push(Dc(e, i, a));
9909
+ n.push(Ac(e, i, a));
9866
9910
  }
9867
9911
  return n;
9868
9912
  }
9869
- function Dc(e, t, n) {
9913
+ function Ac(e, t, n) {
9870
9914
  let r = e[t], i = 0, a = /* @__PURE__ */ new Set(), o = 0, s = 0, c = !1, l = 0, u;
9871
9915
  for (let r = t; r <= n; r++) {
9872
9916
  let t = e[r];
@@ -9875,7 +9919,7 @@ function Dc(e, t, n) {
9875
9919
  i++, e.isError && (c = !0);
9876
9920
  let t = Sc(e);
9877
9921
  t && a.add(t);
9878
- let { adds: n, dels: r } = Tc(e);
9922
+ let { adds: n, dels: r } = Oc(e);
9879
9923
  o += n, s += r;
9880
9924
  }
9881
9925
  }
@@ -9894,23 +9938,23 @@ function Dc(e, t, n) {
9894
9938
  };
9895
9939
  return u !== void 0 && (m.finalEntryIndex = u), m;
9896
9940
  }
9897
- function Oc(e) {
9941
+ function jc(e) {
9898
9942
  if (e.length === 0) return [];
9899
- let t = Ec(e), n = /* @__PURE__ */ new Map();
9943
+ let t = kc(e), n = /* @__PURE__ */ new Map();
9900
9944
  for (let e = 0; e < t.length; e++) n.set(t[e].startIndex, e + 1);
9901
9945
  let r = Array(e.length), i = 0, a = 0;
9902
9946
  for (let t = 0; t < e.length; t++) {
9903
9947
  let e = n.get(t);
9904
- e === void 0 ? i === 0 ? r[t] = `${t + 1}` : (a += 1, r[t] = `${i}${kc(a)}`) : (i = e, a = 0, r[t] = `${i}`);
9948
+ e === void 0 ? i === 0 ? r[t] = `${t + 1}` : (a += 1, r[t] = `${i}${Mc(a)}`) : (i = e, a = 0, r[t] = `${i}`);
9905
9949
  }
9906
9950
  return r;
9907
9951
  }
9908
- function kc(e) {
9952
+ function Mc(e) {
9909
9953
  let t = "", n = e;
9910
9954
  for (; n > 0;) t = String.fromCharCode(97 + (n - 1) % 26) + t, n = Math.floor((n - 1) / 26);
9911
9955
  return t;
9912
9956
  }
9913
- function Ac(e) {
9957
+ function Nc(e) {
9914
9958
  let t = e.reduce((e, t) => e + Math.max(0, t.durationMs), 0), n = 0;
9915
9959
  return e.map((e) => {
9916
9960
  let r = Math.max(0, e.durationMs), i = t > 0 ? n / t * 100 : 0, a = t > 0 ? r / t * 100 : 0;
@@ -9922,17 +9966,17 @@ function Ac(e) {
9922
9966
  };
9923
9967
  });
9924
9968
  }
9925
- var jc = /* @__PURE__ */ new Set([
9969
+ var Pc = /* @__PURE__ */ new Set([
9926
9970
  "Task",
9927
9971
  "EnterWorktree",
9928
9972
  "SendMessage",
9929
9973
  "TeamCreate"
9930
- ]), Mc = /* @__PURE__ */ new Set([
9974
+ ]), Fc = /* @__PURE__ */ new Set([
9931
9975
  "Write",
9932
9976
  "Edit",
9933
9977
  "NotebookEdit"
9934
9978
  ]);
9935
- function Nc(e) {
9979
+ function Ic(e) {
9936
9980
  let t = [], n = [], r = /* @__PURE__ */ new Map();
9937
9981
  for (let i = 0; i < e.length; i++) {
9938
9982
  let a = e[i];
@@ -9942,12 +9986,12 @@ function Nc(e) {
9942
9986
  type: "error",
9943
9987
  label: `${e.name} failed`,
9944
9988
  severity: "error"
9945
- }), jc.has(e.name) && t.push({
9989
+ }), Pc.has(e.name) && t.push({
9946
9990
  turnIndex: i,
9947
9991
  type: "subagent",
9948
9992
  label: `Subagent: ${e.name}`,
9949
9993
  severity: "info"
9950
- }), Mc.has(e.name)) {
9994
+ }), Fc.has(e.name)) {
9951
9995
  let t = Sc(e);
9952
9996
  if (t) {
9953
9997
  let e = r.get(t) ?? [];
@@ -9976,7 +10020,7 @@ function Nc(e) {
9976
10020
  }
9977
10021
  return t.sort((e, t) => e.turnIndex - t.turnIndex);
9978
10022
  }
9979
- var Pc = {
10023
+ var Lc = {
9980
10024
  planning: "Planning",
9981
10025
  exploration: "Exploration",
9982
10026
  implementation: "Implementation",
@@ -9988,20 +10032,20 @@ var Pc = {
9988
10032
  recovery: "Recovery",
9989
10033
  abandonment: "Abandonment"
9990
10034
  };
9991
- function Fc(e) {
9992
- return Pc[e] ?? String(e);
10035
+ function Rc(e) {
10036
+ return Lc[e] ?? String(e);
9993
10037
  }
9994
- var Ic = /* @__PURE__ */ new Set([
10038
+ var zc = /* @__PURE__ */ new Set([
9995
10039
  "Read",
9996
10040
  "Glob",
9997
10041
  "Grep",
9998
10042
  "WebSearch",
9999
10043
  "WebFetch"
10000
- ]), Lc = /* @__PURE__ */ new Set([
10044
+ ]), Bc = /* @__PURE__ */ new Set([
10001
10045
  "Write",
10002
10046
  "Edit",
10003
10047
  "NotebookEdit"
10004
- ]), Rc = [
10048
+ ]), Vc = [
10005
10049
  /\btest\b/i,
10006
10050
  /\bjest\b/i,
10007
10051
  /\bpytest\b/i,
@@ -10014,21 +10058,21 @@ var Ic = /* @__PURE__ */ new Set([
10014
10058
  /\bmocha\b/i,
10015
10059
  /\brspec\b/i
10016
10060
  ];
10017
- function zc(e, t) {
10061
+ function Hc(e, t) {
10018
10062
  return e.toolCalls?.some((e) => t.has(e.name)) ?? !1;
10019
10063
  }
10020
- function Bc(e, t) {
10064
+ function Uc(e, t) {
10021
10065
  return e.toolCalls?.length ? e.toolCalls.every((e) => t.has(e.name)) : !1;
10022
10066
  }
10023
- function Vc(e) {
10067
+ function Wc(e) {
10024
10068
  for (let t of e.toolCalls ?? []) if (t.isError || t.exitCode !== void 0 && t.exitCode !== null && t.exitCode !== 0) return !0;
10025
10069
  return !1;
10026
10070
  }
10027
- function Hc(e) {
10028
- for (let t of e.toolCalls ?? []) if (t.name === "Bash" && Rc.some((e) => e.test(t.arguments))) return !0;
10071
+ function Gc(e) {
10072
+ for (let t of e.toolCalls ?? []) if (t.name === "Bash" && Vc.some((e) => e.test(t.arguments))) return !0;
10029
10073
  return !1;
10030
10074
  }
10031
- function Uc(e) {
10075
+ function Kc(e) {
10032
10076
  let t = [], n = [], r = -1;
10033
10077
  for (let i = 0; i < e.length; i++) {
10034
10078
  let a = e[i];
@@ -10038,7 +10082,7 @@ function Uc(e) {
10038
10082
  }
10039
10083
  if (a.toolCalls?.length) {
10040
10084
  r < 0 && (r = i);
10041
- for (let e of a.toolCalls) n.push(e.name), (e.isError || e.exitCode !== void 0 && e.exitCode !== null && e.exitCode !== 0) && n.length > 0 && (n.some((e) => Lc.has(e) || e === "Bash") && t.push({
10085
+ for (let e of a.toolCalls) n.push(e.name), (e.isError || e.exitCode !== void 0 && e.exitCode !== null && e.exitCode !== 0) && n.length > 0 && (n.some((e) => Bc.has(e) || e === "Bash") && t.push({
10042
10086
  tools: [...n],
10043
10087
  turnRange: [r, i]
10044
10088
  }), n = [], r = -1);
@@ -10046,20 +10090,20 @@ function Uc(e) {
10046
10090
  }
10047
10091
  return t;
10048
10092
  }
10049
- function Wc(e, t) {
10093
+ function qc(e, t) {
10050
10094
  let n = new Set(e), r = new Set(t), i = [...n].filter((e) => r.has(e)).length, a = (/* @__PURE__ */ new Set([...n, ...r])).size;
10051
10095
  return a > 0 ? i / a : 0;
10052
10096
  }
10053
- function Gc(e) {
10054
- let t = Uc(e), n = [], r = 0;
10097
+ function Jc(e) {
10098
+ let t = Kc(e), n = [], r = 0;
10055
10099
  for (; r < t.length;) {
10056
10100
  let e = r + 1;
10057
- for (; e < t.length && Wc(t[r].tools, t[e].tools) >= .5;) e++;
10101
+ for (; e < t.length && qc(t[r].tools, t[e].tools) >= .5;) e++;
10058
10102
  e - r >= 2 && n.push([t[r].turnRange[0], t[e - 1].turnRange[1]]), r = e;
10059
10103
  }
10060
10104
  return n;
10061
10105
  }
10062
- var Kc = [
10106
+ var Yc = [
10063
10107
  /\bi already said\b/i,
10064
10108
  /\bi told you\b/i,
10065
10109
  /\bno,?\s+not that\b/i,
@@ -10067,18 +10111,18 @@ var Kc = [
10067
10111
  /\bnot what i asked\b/i,
10068
10112
  /\bwrong,?\s+i\b/i,
10069
10113
  /\bplease (re-?read|read again)\b/i
10070
- ], qc = /\b(let'?s move on|forget it|different approach|never mind)\b/i;
10071
- function Jc(e, t, n, r, i) {
10114
+ ], Xc = /\b(let'?s move on|forget it|different approach|never mind)\b/i;
10115
+ function Zc(e, t, n, r, i) {
10072
10116
  for (let [e, n] of i) if (t >= e && t <= n) return "retry-loop";
10073
- return e.role === "user" ? Kc.some((t) => t.test(e.content)) ? "user-correction" : n ?? "planning" : Vc(e) ? "error" : Hc(e) ? "testing" : r > 0 && Bc(e, Ic) ? "debug" : zc(e, Lc) ? n === "retry-loop" || n === "user-correction" ? "recovery" : "implementation" : Bc(e, Ic) && r === 0 ? "exploration" : e.role === "assistant" && !e.toolCalls?.length && e.content.length > 100 ? "planning" : n ?? "planning";
10117
+ return e.role === "user" ? Yc.some((t) => t.test(e.content)) ? "user-correction" : n ?? "planning" : Wc(e) ? "error" : Gc(e) ? "testing" : r > 0 && Uc(e, zc) ? "debug" : Hc(e, Bc) ? n === "retry-loop" || n === "user-correction" ? "recovery" : "implementation" : Uc(e, zc) && r === 0 ? "exploration" : e.role === "assistant" && !e.toolCalls?.length && e.content.length > 100 ? "planning" : n ?? "planning";
10074
10118
  }
10075
- var Yc = /* @__PURE__ */ new Set([
10119
+ var Qc = /* @__PURE__ */ new Set([
10076
10120
  "error",
10077
10121
  "user-correction",
10078
10122
  "retry-loop",
10079
10123
  "abandonment"
10080
10124
  ]);
10081
- function Xc(e) {
10125
+ function $c(e) {
10082
10126
  if (e.length <= 1) return e;
10083
10127
  let t = [];
10084
10128
  for (let n = 0; n < e.length; n++) {
@@ -10087,7 +10131,7 @@ function Xc(e) {
10087
10131
  a.endTurn = r.endTurn;
10088
10132
  continue;
10089
10133
  }
10090
- if (i < 3 && !Yc.has(r.type) && a) {
10134
+ if (i < 3 && !Qc.has(r.type) && a) {
10091
10135
  a.endTurn = r.endTurn;
10092
10136
  let e = a.badges.find((e) => e.type === r.type);
10093
10137
  e ? e.count += i : a.badges.push({
@@ -10115,15 +10159,15 @@ function Xc(e) {
10115
10159
  }
10116
10160
  return t;
10117
10161
  }
10118
- function Zc(e) {
10162
+ function el(e) {
10119
10163
  if (e.length === 0) return [];
10120
- let t = Gc(e), n = [];
10164
+ let t = Jc(e), n = [];
10121
10165
  for (let r = 0; r < e.length; r++) {
10122
10166
  let i = 0;
10123
- for (let t = Math.max(0, r - 3); t < r; t++) Vc(e[t]) && i++;
10167
+ for (let t = Math.max(0, r - 3); t < r; t++) Wc(e[t]) && i++;
10124
10168
  let a = n.length > 0 ? n[n.length - 1].type : null;
10125
10169
  n.push({
10126
- type: Jc(e[r], r, a, i, t),
10170
+ type: Zc(e[r], r, a, i, t),
10127
10171
  turn: r
10128
10172
  });
10129
10173
  }
@@ -10135,8 +10179,8 @@ function Zc(e) {
10135
10179
  badges: []
10136
10180
  });
10137
10181
  if (i && r.push(i), r.length > 0) {
10138
- let t = e[e.length - 1], n = r[r.length - 1], i = Vc(t) && t.role === "assistant", a = t.role === "user" && qc.test(t.content), o = !e.slice(Math.floor(e.length * .8)).some((e) => zc(e, Lc));
10139
- if ((i || a || o && n.type !== "planning") && (e.filter(Vc).length > 0 || a) && n.type !== "abandonment") {
10182
+ let t = e[e.length - 1], n = r[r.length - 1], i = Wc(t) && t.role === "assistant", a = t.role === "user" && Xc.test(t.content), o = !e.slice(Math.floor(e.length * .8)).some((e) => Hc(e, Bc));
10183
+ if ((i || a || o && n.type !== "planning") && (e.filter(Wc).length > 0 || a) && n.type !== "abandonment") {
10140
10184
  let t = e.length - 1;
10141
10185
  r.push({
10142
10186
  type: "abandonment",
@@ -10146,15 +10190,15 @@ function Zc(e) {
10146
10190
  });
10147
10191
  }
10148
10192
  }
10149
- return Xc(r);
10193
+ return $c(r);
10150
10194
  }
10151
- function Qc(e) {
10152
- return Zc(e).map((t, n) => {
10195
+ function tl(e) {
10196
+ return el(e).map((t, n) => {
10153
10197
  let r = 0;
10154
- for (let n = t.startTurn; n <= t.endTurn; n++) e[n] && Vc(e[n]) && r++;
10198
+ for (let n = t.startTurn; n <= t.endTurn; n++) e[n] && Wc(e[n]) && r++;
10155
10199
  let i = {
10156
10200
  id: `phase-${n + 1}`,
10157
- label: Fc(t.type),
10201
+ label: Rc(t.type),
10158
10202
  from: e[t.startTurn]?.index ?? t.startTurn,
10159
10203
  to: e[t.endTurn]?.index ?? t.endTurn,
10160
10204
  icon: t.type
@@ -10162,71 +10206,71 @@ function Qc(e) {
10162
10206
  return r > 0 && (i.errors = r), i;
10163
10207
  });
10164
10208
  }
10165
- function $c(e) {
10209
+ function nl(e) {
10166
10210
  let t = e.filter((e) => Number.isFinite(e)).sort((e, t) => e - t);
10167
10211
  if (t.length === 0) return;
10168
10212
  let n = Math.floor(t.length / 2);
10169
10213
  return t.length % 2 == 0 ? (t[n - 1] + t[n]) / 2 : t[n];
10170
10214
  }
10171
- function el(e) {
10215
+ function rl(e) {
10172
10216
  if (!e || e.length === 0) return {};
10173
10217
  let t = [], n = [], r = [];
10174
10218
  for (let i of e) i.totalTokens > 0 && Number.isFinite(i.retryTokensWasted) && t.push(i.retryTokensWasted / i.totalTokens), Number.isFinite(i.specQualityScore) && i.specQualityScore > 0 && n.push(i.specQualityScore), Number.isFinite(i.withinSessionReverts) && r.push(i.withinSessionReverts);
10175
- let i = {}, a = $c(t), o = $c(n), s = $c(r);
10219
+ let i = {}, a = nl(t), o = nl(n), s = nl(r);
10176
10220
  return a !== void 0 && (i.retryShare = a), o !== void 0 && (i.specQualityScore = o), s !== void 0 && (i.withinSessionReverts = s), i;
10177
10221
  }
10178
- var tl = .2, nl = 70, rl = 50, il = 40, al = 30, ol = 4, sl = 3;
10222
+ var il = .2, al = 70, ol = 50, sl = 40, cl = 30, ll = 4, ul = 3;
10179
10223
  function $(e) {
10180
10224
  return e != null;
10181
10225
  }
10182
- function cl(e) {
10226
+ function dl(e) {
10183
10227
  return e === "bad" ? 2 : +(e === "watch");
10184
10228
  }
10185
- function ll(e) {
10186
- return e.reduce((e, t) => cl(t) > cl(e) ? t : e, "good");
10229
+ function fl(e) {
10230
+ return e.reduce((e, t) => dl(t) > dl(e) ? t : e, "good");
10187
10231
  }
10188
- function ul(e, t = {}) {
10232
+ function pl(e, t = {}) {
10189
10233
  if (!e) return [];
10190
10234
  let n = [];
10191
10235
  {
10192
10236
  let r = [], i = [], a = $(e.totalTokens) && (e.totalTokens ?? 0) > 0 && $(e.retryTokensWasted) ? (e.retryTokensWasted ?? 0) / (e.totalTokens ?? 1) : void 0;
10193
- if (a !== void 0 && (r.push(a > tl ? "bad" : "good"), a > tl && i.push(`${Math.round(a * 100)}% of tokens spent on retries`)), $(e.m5ContextUtilizationPct)) {
10237
+ if (a !== void 0 && (r.push(a > il ? "bad" : "good"), a > il && i.push(`${Math.round(a * 100)}% of tokens spent on retries`)), $(e.m5ContextUtilizationPct)) {
10194
10238
  let t = e.m5ContextUtilizationPct ?? 0;
10195
- r.push(t > nl ? "watch" : "good"), t > nl && i.push(`Context ${Math.round(t)}% full`);
10239
+ r.push(t > al ? "watch" : "good"), t > al && i.push(`Context ${Math.round(t)}% full`);
10196
10240
  }
10197
10241
  if ($(e.m6OutputSurvivalPct)) {
10198
10242
  let t = e.m6OutputSurvivalPct ?? 0;
10199
- r.push(t < rl ? "watch" : "good"), t < rl && i.push(`Only ${Math.round(t)}% of output survived`);
10243
+ r.push(t < ol ? "watch" : "good"), t < ol && i.push(`Only ${Math.round(t)}% of output survived`);
10200
10244
  }
10201
- e.outcome === "failed" && $(e.costTotalUsd) && a !== void 0 && t.retryShare !== void 0 && a > t.retryShare && (r.push("bad"), i.push("Failed outcome with above-median spend")), (a !== void 0 || $(e.m5ContextUtilizationPct) || $(e.m6OutputSurvivalPct)) && n.push(dl("token", "Token efficiency", a === void 0 ? $(e.m5ContextUtilizationPct) ? `${Math.round(e.m5ContextUtilizationPct ?? 0)}% context used` : "—" : `${Math.round(a * 100)}% retry tokens`, ll(r), i));
10245
+ e.outcome === "failed" && $(e.costTotalUsd) && a !== void 0 && t.retryShare !== void 0 && a > t.retryShare && (r.push("bad"), i.push("Failed outcome with above-median spend")), (a !== void 0 || $(e.m5ContextUtilizationPct) || $(e.m6OutputSurvivalPct)) && n.push(ml("token", "Token efficiency", a === void 0 ? $(e.m5ContextUtilizationPct) ? `${Math.round(e.m5ContextUtilizationPct ?? 0)}% context used` : "—" : `${Math.round(a * 100)}% retry tokens`, fl(r), i));
10202
10246
  }
10203
10247
  {
10204
10248
  let t = [], r = [];
10205
10249
  if ($(e.specQualityScore)) {
10206
10250
  let n = e.specQualityScore ?? 0;
10207
- t.push(n < il ? "bad" : "good"), n < il && r.push(`Spec quality low (${Math.round(n)}/100)`);
10251
+ t.push(n < sl ? "bad" : "good"), n < sl && r.push(`Spec quality low (${Math.round(n)}/100)`);
10208
10252
  }
10209
10253
  if ($(e.signalDensity)) {
10210
10254
  let n = e.signalDensity ?? 0;
10211
- t.push(n < al ? "watch" : "good"), n < al && r.push(`Sparse direction (${Math.round(n)}% signal)`);
10255
+ t.push(n < cl ? "watch" : "good"), n < cl && r.push(`Sparse direction (${Math.round(n)}% signal)`);
10212
10256
  }
10213
- e.m7SpecHasExamples === !1 && (t.push("watch"), r.push("No examples in the prompt")), e.m7SpecHasConstraints === !1 && (t.push("watch"), r.push("No constraints in the prompt")), ($(e.specQualityScore) || $(e.signalDensity) || $(e.m7SpecHasExamples) || $(e.m7SpecHasConstraints)) && n.push(dl("prompt", "Prompt quality", $(e.specQualityScore) ? `Spec ${Math.round(e.specQualityScore ?? 0)}/100` : $(e.signalDensity) ? `${Math.round(e.signalDensity ?? 0)}% signal` : "—", ll(t), r));
10257
+ e.m7SpecHasExamples === !1 && (t.push("watch"), r.push("No examples in the prompt")), e.m7SpecHasConstraints === !1 && (t.push("watch"), r.push("No constraints in the prompt")), ($(e.specQualityScore) || $(e.signalDensity) || $(e.m7SpecHasExamples) || $(e.m7SpecHasConstraints)) && n.push(ml("prompt", "Prompt quality", $(e.specQualityScore) ? `Spec ${Math.round(e.specQualityScore ?? 0)}/100` : $(e.signalDensity) ? `${Math.round(e.signalDensity ?? 0)}% signal` : "—", fl(t), r));
10214
10258
  }
10215
10259
  {
10216
10260
  let t = [], r = [];
10217
10261
  if ($(e.m4ConsecutiveErrorMax)) {
10218
10262
  let n = e.m4ConsecutiveErrorMax ?? 0;
10219
- t.push(n >= ol ? "bad" : "good"), n >= ol && r.push(`${n} errors in a row`);
10263
+ t.push(n >= ll ? "bad" : "good"), n >= ll && r.push(`${n} errors in a row`);
10220
10264
  }
10221
10265
  if ($(e.withinSessionReverts)) {
10222
10266
  let n = e.withinSessionReverts ?? 0;
10223
- t.push(n >= sl ? "bad" : "good"), n >= sl && r.push(`${n} reverts mid-session`);
10267
+ t.push(n >= ul ? "bad" : "good"), n >= ul && r.push(`${n} reverts mid-session`);
10224
10268
  }
10225
- ($(e.m4ConsecutiveErrorMax) || $(e.withinSessionReverts)) && n.push(dl("loop", "Loop efficiency", $(e.m4ConsecutiveErrorMax) ? `${e.m4ConsecutiveErrorMax ?? 0} max error streak` : $(e.withinSessionReverts) ? `${e.withinSessionReverts ?? 0} reverts` : "—", ll(t), r));
10269
+ ($(e.m4ConsecutiveErrorMax) || $(e.withinSessionReverts)) && n.push(ml("loop", "Loop efficiency", $(e.m4ConsecutiveErrorMax) ? `${e.m4ConsecutiveErrorMax ?? 0} max error streak` : $(e.withinSessionReverts) ? `${e.withinSessionReverts ?? 0} reverts` : "—", fl(t), r));
10226
10270
  }
10227
10271
  return n;
10228
10272
  }
10229
- function dl(e, t, n, r, i) {
10273
+ function ml(e, t, n, r, i) {
10230
10274
  let a = {
10231
10275
  id: e,
10232
10276
  label: t,
@@ -10236,7 +10280,7 @@ function dl(e, t, n, r, i) {
10236
10280
  };
10237
10281
  return i.length && (a.flags = i, a.detail = i.join(", ")), a;
10238
10282
  }
10239
- function fl(e, t) {
10283
+ function hl(e, t) {
10240
10284
  let n = t[e.turnIndex]?.index ?? e.turnIndex;
10241
10285
  return {
10242
10286
  id: `pattern-${e.type}-${e.turnIndex}`,
@@ -10245,7 +10289,7 @@ function fl(e, t) {
10245
10289
  label: e.label
10246
10290
  };
10247
10291
  }
10248
- function pl(e, t, n) {
10292
+ function gl(e, t, n) {
10249
10293
  let r = [];
10250
10294
  for (let t = e.startIndex; t <= e.endIndex; t++) {
10251
10295
  let e = n[t];
@@ -10262,16 +10306,16 @@ function pl(e, t, n) {
10262
10306
  let a = e.filesTouched.length, o = [];
10263
10307
  return a > 0 && o.push(`${a} ${a === 1 ? "file" : "files"}`), (e.insertions > 0 || e.deletions > 0) && o.push(`+${e.insertions} −${e.deletions}`), o.length && (i.stat = o.join(", ")), i;
10264
10308
  }
10265
- function ml(e) {
10266
- return Ec(e).map((t, n) => pl(t, n, e));
10309
+ function _l(e) {
10310
+ return kc(e).map((t, n) => gl(t, n, e));
10267
10311
  }
10268
- function hl(e, t = {}) {
10269
- let n = Qc(e), r = Nc(e).map((t) => fl(t, e)), i = ml(e), a = ul(t.scorecard, t.medians), o = {};
10312
+ function vl(e, t = {}) {
10313
+ let n = tl(e), r = Ic(e).map((t) => hl(t, e)), i = _l(e), a = pl(t.scorecard, t.medians), o = {};
10270
10314
  return n.length && (o.phases = n), a.length && (o.scorecardBands = a), r.length && (o.patternAnnotations = r), i.length && (o.taskGroups = i), o;
10271
10315
  }
10272
10316
  //#endregion
10273
10317
  //#region src/ui/transcript/usage.js
10274
- var gl = Object.freeze({
10318
+ var yl = Object.freeze({
10275
10319
  input: "input",
10276
10320
  output: "output",
10277
10321
  cacheRead: "cache read",
@@ -10279,14 +10323,14 @@ var gl = Object.freeze({
10279
10323
  cacheWrite1h: "cache write 1h (subset)",
10280
10324
  reasoning: "reasoning (subset)",
10281
10325
  totalTokens: "total tokens"
10282
- }), _l = Object.freeze({
10326
+ }), bl = Object.freeze({
10283
10327
  input: "input",
10284
10328
  output: "output",
10285
10329
  cacheRead: "cache read",
10286
10330
  cacheWrite: "cache write",
10287
10331
  total: "total"
10288
10332
  });
10289
- function vl(e) {
10333
+ function xl(e) {
10290
10334
  if (e.length === 1) return e[0];
10291
10335
  let t = e.map((e) => {
10292
10336
  let [t, n = "0"] = e.toLowerCase().split("e"), [r, i = ""] = t.split(".");
@@ -10297,14 +10341,14 @@ function vl(e) {
10297
10341
  }), n = Math.max(0, ...t.map((e) => e.scale)), r = t.reduce((e, t) => e + t.coefficient * 10n ** BigInt(n - t.scale), 0n).toString().padStart(n + 1, "0");
10298
10342
  return n ? (r.slice(0, -n) + "." + r.slice(-n)).replace(/\.?0+$/, "") || "0" : r;
10299
10343
  }
10300
- function yl(e) {
10344
+ function Sl(e) {
10301
10345
  let t = e.flatMap((e) => [e.usage, ...(e.toolCalls ?? []).map((e) => e.usage)]).filter((e) => e != null);
10302
10346
  return Object.values(It).flatMap((e) => {
10303
10347
  let n = t.filter((t) => t.scope === e);
10304
10348
  if (!n.length) return [];
10305
10349
  let r = (t, r) => Object.entries(r).map(([r, i]) => {
10306
10350
  let a = n.map((e) => e[t]?.[r]).filter((e) => e != null), o = "unknown";
10307
- if (a.length && t === "cost" && (o = vl(a.map(String))), a.length && t === "tokens") {
10351
+ if (a.length && t === "cost" && (o = xl(a.map(String))), a.length && t === "tokens") {
10308
10352
  let t = a.reduce((e, t) => e + BigInt(t), 0n);
10309
10353
  if (t > BigInt(2 ** 53 - 1)) throw RangeError(`Detailed usage aggregate failed in Fairtrade adaptTranscript during ${e} ${r} summation: the known token sum exceeds the JS-safe contract bound; no trustworthy total can be displayed. Reduce the session scope or repair the producer accounting and retry.`);
10310
10354
  o = String(t);
@@ -10318,86 +10362,192 @@ function yl(e) {
10318
10362
  return [{
10319
10363
  scope: e,
10320
10364
  ownerCount: n.length,
10321
- tokens: r("tokens", gl),
10322
- cost: r("cost", _l)
10365
+ tokens: r("tokens", yl),
10366
+ cost: r("cost", bl)
10323
10367
  }];
10324
10368
  });
10325
10369
  }
10326
10370
  //#endregion
10371
+ //#region src/ui/transcript/title.js
10372
+ var Cl = 80, wl = "<user_query>", Tl = "</user_query>", El = /^\s*(?:<([a-z][a-z0-9_-]*)>[\s\S]*?<\/\1>\s*)*<user_query>/;
10373
+ function Dl(e) {
10374
+ if (!e) return "";
10375
+ let t = El.exec(e);
10376
+ if (!t) return e;
10377
+ let n = t[0].length, r = e.indexOf(Tl, n);
10378
+ if (r === -1) return e.slice(n).trim();
10379
+ let i = e.slice(n, r).trim(), a = e.slice(r + 13).trim();
10380
+ return a && !a.startsWith(wl) ? `${i}\n\n${a}` : i;
10381
+ }
10382
+ function Ol(e) {
10383
+ return Dl(e).replace(/\s+/g, " ").trim();
10384
+ }
10385
+ function kl(e, t = Cl) {
10386
+ if (!e) return "";
10387
+ let n = Ml(Dl(e)), { slashCommand: r, rest: i } = Nl(n);
10388
+ n = i;
10389
+ let a = n.replace(/<\/?[a-zA-Z][a-zA-Z0-9-]*[^>]*>/g, " ").replace(/[ \t\r\f\v]+/g, " ").trim();
10390
+ return a ? Il(Fl(Pl(a).replace(/\s+/g, " ").trim()), t) : r ? Il(r, t) : "";
10391
+ }
10392
+ function Al(e) {
10393
+ if (!e) return "";
10394
+ let t = e.trim().replace(/[\\/]+$/, "");
10395
+ if (!t) return "";
10396
+ let n = t.split(/[\\/]/).filter(Boolean);
10397
+ return n.length > 0 ? n[n.length - 1] : t;
10398
+ }
10399
+ function jl(e) {
10400
+ let t = e.id.slice(0, 8), n = Al(e.project), r = kl(e.promptContent, e.limit), i;
10401
+ i = n && r ? `${n}: ${r}` : n ? `${n}, ${t}` : r ? `${t} — ${r}` : `Session ${t}`;
10402
+ let a = (e.promptContent ?? i).trim() || i;
10403
+ return {
10404
+ title: i,
10405
+ tooltip: a
10406
+ };
10407
+ }
10408
+ function Ml(e) {
10409
+ let t = e.replace(/^\s+/, "");
10410
+ for (;;) {
10411
+ let e = t.match(/^<system-reminder>[\s\S]*?<\/system-reminder>\s*/i);
10412
+ if (!e) break;
10413
+ t = t.slice(e[0].length);
10414
+ }
10415
+ let n = t.match(/^```[\s\S]*?```\s*/);
10416
+ return n && (t = t.slice(n[0].length)), t;
10417
+ }
10418
+ function Nl(e) {
10419
+ if (!/^\s*<command-[a-z-]+>/i.test(e)) return {
10420
+ slashCommand: null,
10421
+ rest: e
10422
+ };
10423
+ let t = null, n = "", r = e.replace(/^\s+/, ""), i = /^<command-([a-z-]+)>([\s\S]*?)<\/command-\1>\s*/i;
10424
+ for (;;) {
10425
+ let e = r.match(i);
10426
+ if (!e) break;
10427
+ let a = e[1].toLowerCase(), o = e[2].trim();
10428
+ if (a === "name" && o) {
10429
+ let e = o.replace(/^\/+/, "");
10430
+ e && (t = `/${e}`);
10431
+ } else a === "args" && o && t ? t = `${t} ${o}` : a === "message" && o && (n = n ? `${n} ${o}` : o);
10432
+ r = r.slice(e[0].length);
10433
+ }
10434
+ let a = r.trim(), o = n ? a ? `${n} ${a}` : n : a;
10435
+ return {
10436
+ slashCommand: t,
10437
+ rest: o
10438
+ };
10439
+ }
10440
+ function Pl(e) {
10441
+ let t = -1, n = "";
10442
+ for (let r = 0; r < e.length; r++) {
10443
+ let i = e[r];
10444
+ if (i === "\n" || i === "." || i === "?" || i === "!") {
10445
+ t = r, n = i;
10446
+ break;
10447
+ }
10448
+ }
10449
+ if (t === -1) return e;
10450
+ let r = e.slice(0, t).trim();
10451
+ return r ? n === "?" || n === "!" ? r + n : r : e.trim();
10452
+ }
10453
+ function Fl(e) {
10454
+ if (!e) return e;
10455
+ let t = e.charAt(0);
10456
+ return t >= "a" && t <= "z" ? t.toUpperCase() + e.slice(1) : e;
10457
+ }
10458
+ function Il(e, t) {
10459
+ return e.length <= t ? e : e.slice(0, t - 1).trimEnd() + "…";
10460
+ }
10461
+ //#endregion
10327
10462
  //#region src/ui/transcript/adapter.js
10328
- function bl(e, t = 80) {
10463
+ function Ll(e, t = 80) {
10329
10464
  if (!e) return "";
10330
10465
  let n = e.replace(/\s+/g, " ").trim();
10331
10466
  return n.length > t ? n.slice(0, t - 1) + "…" : n;
10332
10467
  }
10333
- function xl(e) {
10468
+ function Rl(e) {
10334
10469
  if (!e) return "";
10335
10470
  let t = e.replace(/\/+$/, ""), n = t.lastIndexOf("/");
10336
10471
  return n === -1 ? t : t.slice(n + 1);
10337
10472
  }
10338
- function Sl(e) {
10473
+ function zl(e) {
10339
10474
  let t = e.trim().match(/\S+/g);
10340
10475
  return t ? t.length : 0;
10341
10476
  }
10342
- function Cl(e) {
10477
+ function Bl(e) {
10343
10478
  if (!e || e <= 0) return "0";
10344
10479
  if (e < 1e3) return String(e);
10345
10480
  let t = e / 1e3;
10346
10481
  return (t >= 10 ? Math.round(t) : Math.round(t * 10) / 10) + "k";
10347
10482
  }
10348
- function wl(e) {
10483
+ function Vl(e) {
10349
10484
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
10350
10485
  }
10351
- var Tl = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
10352
- function El(e) {
10353
- return !!e.sourceEntryRef || Tl(e, "provenance") || !!e.usage || !!e.toolCalls?.some((e) => e.callEntryRef || e.resultEntryRef || e.usage || Tl(e, "callProvenance") || Tl(e, "resultProvenance"));
10486
+ var Hl = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
10487
+ function Ul(e) {
10488
+ return !!e.sourceEntryRef || Hl(e, "provenance") || !!e.usage || !!e.toolCalls?.some((e) => e.callEntryRef || e.resultEntryRef || e.usage || Hl(e, "callProvenance") || Hl(e, "resultProvenance"));
10489
+ }
10490
+ function Wl(e, t, n) {
10491
+ if (n !== "cursor" || e !== "user") return;
10492
+ let r = Dl(t);
10493
+ return r === t ? void 0 : r;
10494
+ }
10495
+ function Gl(e, t) {
10496
+ let n = new Map(t.filter((e) => e.displayContent !== void 0).map((e) => [e.index, e.displayContent]));
10497
+ return n.size === 0 ? e : e.map((e) => {
10498
+ let t = n.get(e.turnIndices?.[0]);
10499
+ return t === void 0 ? e : {
10500
+ ...e,
10501
+ displayPrompt: t
10502
+ };
10503
+ });
10354
10504
  }
10355
- function Dl(e) {
10356
- return Tl(e, "sourceEntryRef") && e.sourceEntryRef !== "" || Tl(e, "provenance") || Tl(e, "usage") || !!e.toolCalls?.some((e) => Tl(e, "callEntryRef") && e.callEntryRef !== "" || Tl(e, "resultEntryRef") && e.resultEntryRef !== "" || [
10505
+ function Kl(e) {
10506
+ return Hl(e, "sourceEntryRef") && e.sourceEntryRef !== "" || Hl(e, "provenance") || Hl(e, "usage") || !!e.toolCalls?.some((e) => Hl(e, "callEntryRef") && e.callEntryRef !== "" || Hl(e, "resultEntryRef") && e.resultEntryRef !== "" || [
10357
10507
  "callProvenance",
10358
10508
  "resultProvenance",
10359
10509
  "usage",
10360
10510
  "namespace"
10361
- ].some((t) => Tl(e, t)));
10511
+ ].some((t) => Hl(e, t)));
10362
10512
  }
10363
- function Ol(e) {
10364
- let t = wl(e);
10513
+ function ql(e) {
10514
+ let t = Vl(e);
10365
10515
  if (t?.submissionRef === "") {
10366
10516
  let { submissionRef: e, ...n } = t;
10367
10517
  Ut.parse(n);
10368
10518
  } else Ut.parse(e);
10369
10519
  }
10370
- function kl(e) {
10520
+ function Jl(e) {
10371
10521
  e.forEach((e, t) => {
10372
10522
  try {
10373
- Tl(e, "sourceEntryRef") && e.sourceEntryRef !== "" && Kt.parse(e.sourceEntryRef), Tl(e, "provenance") && Ol(e.provenance);
10374
- for (let t of e.toolCalls ?? []) Tl(t, "callEntryRef") && t.callEntryRef !== "" && Kt.parse(t.callEntryRef), Tl(t, "resultEntryRef") && t.resultEntryRef !== "" && Kt.parse(t.resultEntryRef), Tl(t, "callProvenance") && Ol(t.callProvenance), Tl(t, "resultProvenance") && Ol(t.resultProvenance);
10523
+ Hl(e, "sourceEntryRef") && e.sourceEntryRef !== "" && Kt.parse(e.sourceEntryRef), Hl(e, "provenance") && ql(e.provenance);
10524
+ for (let t of e.toolCalls ?? []) Hl(t, "callEntryRef") && t.callEntryRef !== "" && Kt.parse(t.callEntryRef), Hl(t, "resultEntryRef") && t.resultEntryRef !== "" && Kt.parse(t.resultEntryRef), Hl(t, "callProvenance") && ql(t.callProvenance), Hl(t, "resultProvenance") && ql(t.resultProvenance);
10375
10525
  } catch (e) {
10376
10526
  throw Object.assign(/* @__PURE__ */ TypeError(`Fairtrade prefilterTurns refused turn at position ${t} during evidence validation: a source reference or provenance field is malformed. No turns were filtered. Correct the producer using the canonical schema and retry.`), { cause: e });
10377
10527
  }
10378
10528
  });
10379
10529
  }
10380
- var Al = /^(custom-title|agent name|session title): \S/, jl = /* @__PURE__ */ new Set(["agent renamed", "session title set"]);
10381
- function Ml(e, t) {
10530
+ var Yl = /^(custom-title|agent name|session title): \S/, Xl = /* @__PURE__ */ new Set(["agent renamed", "session title set"]);
10531
+ function Zl(e, t) {
10382
10532
  if (t !== "claude-code" || e.role !== "system" || (e.depth ?? 0) !== 0 || (e.toolCalls?.length ?? 0) > 0) return !1;
10383
10533
  let n = (e.content ?? "").trim();
10384
- return n === "" || n.includes("\n") ? !1 : Al.test(n) || jl.has(n);
10534
+ return n === "" || n.includes("\n") ? !1 : Yl.test(n) || Xl.has(n);
10385
10535
  }
10386
- function Nl(e) {
10536
+ function Ql(e) {
10387
10537
  if (e.timestamp === void 0 || e.timestamp === null || Sa(e.timestamp)) return e;
10388
10538
  let { timestamp: t, ...n } = e;
10389
10539
  return n;
10390
10540
  }
10391
- function Pl(e) {
10392
- kl(e);
10541
+ function $l(e) {
10542
+ Jl(e);
10393
10543
  let t = e.filter((e) => {
10394
- if (El(e)) return !0;
10544
+ if (Ul(e)) return !0;
10395
10545
  let t = !!e.content?.trim(), n = (e.toolCalls?.length ?? 0) > 0;
10396
10546
  return !(!t && !n || e.role === "system" && !n && (!e.content || e.content.trim().length < 8));
10397
10547
  }), n = [];
10398
10548
  for (let e of t) {
10399
10549
  let t = n[n.length - 1];
10400
- if (t && !El(t) && !El(e) && t.role === e.role && t.content === e.content && t.content.trim() !== "") {
10550
+ if (t && !Ul(t) && !Ul(e) && t.role === e.role && t.content === e.content && t.content.trim() !== "") {
10401
10551
  let r = (t.toolCalls?.length ?? 0) > 0;
10402
10552
  (e.toolCalls?.length ?? 0) > 0 && !r && (n[n.length - 1] = e);
10403
10553
  continue;
@@ -10406,15 +10556,15 @@ function Pl(e) {
10406
10556
  }
10407
10557
  return n;
10408
10558
  }
10409
- function Fl(e) {
10559
+ function eu(e) {
10410
10560
  if (e.role !== "assistant") return;
10411
10561
  let t = Wt.safeParse(e.observedModel);
10412
10562
  return t.success ? t.data : void 0;
10413
10563
  }
10414
- function Il(e, t) {
10564
+ function tu(e, t) {
10415
10565
  let n = /* @__PURE__ */ new Map(), r = typeof t == "string" && t.length > 0 ? t : void 0;
10416
10566
  for (let t of e) {
10417
- let e = t.depth ?? 0, i = Fl(t);
10567
+ let e = t.depth ?? 0, i = eu(t);
10418
10568
  if (t.role !== "assistant") {
10419
10569
  n.set(t.index, {});
10420
10570
  continue;
@@ -10430,12 +10580,12 @@ function Il(e, t) {
10430
10580
  }
10431
10581
  return n;
10432
10582
  }
10433
- function Ll(e) {
10583
+ function nu(e) {
10434
10584
  if (e.toolKind) return e.toolKind;
10435
10585
  let t = e.name.toLowerCase();
10436
10586
  return t === "read" || t === "notebookread" ? "read" : t === "edit" || t === "multiedit" || t === "notebookedit" || t === "write" ? "edit" : t === "bash" || t === "runcommand" || t === "run_command" || t === "shell" ? "execute" : t === "grep" || t === "glob" || t === "globsearch" || t === "websearch" || t === "web_search" ? "search" : t === "webfetch" || t === "web_fetch" || t === "fetch" || t === "readwebsite" ? "fetch" : t === "delete" || t === "remove" ? "delete" : t === "move" || t === "rename" ? "move" : "other";
10437
10587
  }
10438
- function Rl(e) {
10588
+ function ru(e) {
10439
10589
  let t = e.name.toLowerCase();
10440
10590
  if (t === "read" || t === "notebookread") return "read";
10441
10591
  if (t === "edit" || t === "multiedit" || t === "notebookedit" || t === "write") return "edits";
@@ -10452,11 +10602,11 @@ function Rl(e) {
10452
10602
  default: return "other";
10453
10603
  }
10454
10604
  }
10455
- function zl(e) {
10456
- let t = wl(vc(e.arguments)), n = e.filePath ?? (t && typeof t.file_path == "string" ? t.file_path : void 0);
10605
+ function iu(e) {
10606
+ let t = Vl(vc(e.arguments)), n = e.filePath ?? (t && typeof t.file_path == "string" ? t.file_path : void 0);
10457
10607
  if (n) return n;
10458
- if (!t) return bl(e.arguments, 80);
10459
- if (typeof t.command == "string") return bl(t.command, 100);
10608
+ if (!t) return Ll(e.arguments, 80);
10609
+ if (typeof t.command == "string") return Ll(t.command, 100);
10460
10610
  if (typeof t.pattern == "string") {
10461
10611
  let n = typeof t.path == "string" ? t.path : typeof t.glob == "string" ? t.glob : void 0, r = yc(e.result), i = Array.isArray(r) ? r.length : typeof r == "string" && r.trim() !== "" ? r.split("\n").filter((e) => e.trim() !== "").length : void 0;
10462
10612
  return [
@@ -10466,68 +10616,25 @@ function zl(e) {
10466
10616
  ].filter(Boolean).join(", ");
10467
10617
  }
10468
10618
  if (typeof t.url == "string") return t.url;
10469
- if (typeof t.query == "string") return bl(t.query, 100);
10619
+ if (typeof t.query == "string") return Ll(t.query, 100);
10470
10620
  let r = typeof t.subagent_type == "string" ? t.subagent_type : typeof t.subagent == "string" ? t.subagent : typeof t.agent == "string" ? t.agent : void 0;
10471
- return r && typeof t.description == "string" ? `${r}, ${t.description}` : typeof t.description == "string" ? bl(t.description, 100) : typeof t.subject == "string" ? bl(t.subject, 100) : typeof t.prompt == "string" ? bl(t.prompt, 100) : bl(e.arguments, 80);
10472
- }
10473
- function Bl(e, t) {
10474
- let n = e === "" ? [] : e.split("\n"), r = t === "" ? [] : t.split("\n"), i = n.length, a = r.length, o = Array.from({ length: i + 1 }, () => Array(a + 1).fill(0));
10475
- for (let e = i - 1; e >= 0; e--) for (let t = a - 1; t >= 0; t--) o[e][t] = n[e] === r[t] ? o[e + 1][t + 1] + 1 : Math.max(o[e + 1][t], o[e][t + 1]);
10476
- let s = [], c = 0, l = 0, u = 1, d = 1;
10477
- for (; c < i && l < a;) n[c] === r[l] ? (s.push({
10478
- sign: "ctx",
10479
- oldNo: String(u++),
10480
- newNo: String(d++),
10481
- text: n[c]
10482
- }), c++, l++) : o[c + 1][l] >= o[c][l + 1] ? (s.push({
10483
- sign: "del",
10484
- oldNo: String(u++),
10485
- text: n[c]
10486
- }), c++) : (s.push({
10487
- sign: "add",
10488
- newNo: String(d++),
10489
- text: r[l]
10490
- }), l++);
10491
- for (; c < i;) s.push({
10492
- sign: "del",
10493
- oldNo: String(u++),
10494
- text: n[c++]
10495
- });
10496
- for (; l < a;) s.push({
10497
- sign: "add",
10498
- newNo: String(d++),
10499
- text: r[l++]
10500
- });
10501
- return s;
10502
- }
10503
- function Vl(e) {
10504
- let t = e.name.toLowerCase();
10505
- if (t === "write") {
10506
- let t = wc(e);
10507
- return {
10508
- hunks: [{ lines: Bl("", t) }],
10509
- adds: t ? t.split("\n").length : 0,
10510
- dels: 0
10511
- };
10512
- }
10513
- if (t === "edit" || t === "multiedit" || t === "notebookedit") {
10514
- let t = Cc(e);
10515
- if (t.length === 0) return;
10516
- let n = t.map((e) => ({ lines: Bl(e.old_string, e.new_string) })), { adds: r, dels: i } = Tc(e);
10517
- return {
10518
- hunks: n,
10519
- adds: r,
10520
- dels: i
10521
- };
10522
- }
10621
+ return r && typeof t.description == "string" ? `${r}, ${t.description}` : typeof t.description == "string" ? Ll(t.description, 100) : typeof t.subject == "string" ? Ll(t.subject, 100) : typeof t.prompt == "string" ? Ll(t.prompt, 100) : Ll(e.arguments, 80);
10622
+ }
10623
+ function au(e) {
10624
+ let t = Dc(e);
10625
+ if (t) return {
10626
+ hunks: t.spans.map((e) => ({ lines: e })),
10627
+ adds: t.adds,
10628
+ dels: t.dels
10629
+ };
10523
10630
  }
10524
- function Hl(e) {
10631
+ function ou(e) {
10525
10632
  let t = {
10526
10633
  id: e.id,
10527
10634
  name: e.name,
10528
- kind: Ll(e),
10529
- group: Rl(e),
10530
- preview: zl(e)
10635
+ kind: nu(e),
10636
+ group: ru(e),
10637
+ preview: iu(e)
10531
10638
  };
10532
10639
  e.namespace !== void 0 && (t.namespace = e.namespace);
10533
10640
  let n = vc(e.arguments);
@@ -10536,10 +10643,10 @@ function Hl(e) {
10536
10643
  i !== void 0 && (t.output = i);
10537
10644
  let a = Sc(e);
10538
10645
  a && (t.filePath = a), e.durationMs != null && (t.durationMs = e.durationMs), e.exitCode != null && (t.exitCode = e.exitCode), e.isError && (t.isError = !0), e.usage && (t.usage = e.usage), e.callEntryRef && (t.callEntryRef = e.callEntryRef), e.resultEntryRef && (t.resultEntryRef = e.resultEntryRef), e.callProvenance && (t.callProvenance = e.callProvenance), e.resultProvenance && (t.resultProvenance = e.resultProvenance), e.callEntryRef && !e.resultEntryRef && (t.pending = !0);
10539
- let o = Vl(e);
10646
+ let o = au(e);
10540
10647
  return o && (t.diff = o.hunks, t.adds = o.adds, t.dels = o.dels), t;
10541
10648
  }
10542
- function Ul(e) {
10649
+ function su(e) {
10543
10650
  let t = e.hash, n = e.message.split("\n")[0], r = {
10544
10651
  hash: t,
10545
10652
  shortHash: t.slice(0, 7),
@@ -10549,7 +10656,7 @@ function Ul(e) {
10549
10656
  let i = "commitTime" in e ? Number(e.commitTime) : Date.parse(e.timestamp);
10550
10657
  return Number.isFinite(i) && (r.commitTime = i), "session" in e && e.session === !0 && (r.session = !0), "insertions" in e && (r.adds = e.insertions), "deletions" in e && (r.dels = e.deletions), "filesChanged" in e && (r.files = e.filesChanged), r;
10551
10658
  }
10552
- function Wl(e, t) {
10659
+ function cu(e, t) {
10553
10660
  let n = t.map((e) => ({
10554
10661
  index: e.index,
10555
10662
  ms: e.timestamp ? Date.parse(e.timestamp) : NaN
@@ -10562,13 +10669,13 @@ function Wl(e, t) {
10562
10669
  t.turn = e;
10563
10670
  }
10564
10671
  }
10565
- function Gl(e) {
10672
+ function lu(e) {
10566
10673
  let t = e.gitContext, n = e.gitBranch ?? t?.branch ?? void 0, r = e.gitRemote ?? t?.remote ?? void 0, i = t?.user, a = Array.isArray(t?.commits) ? t.commits : [], o = [], s = 0, c = 0, l = 0;
10567
- for (let e of a) o.push(Ul(e)), "filesChanged" in e && (s += e.filesChanged), "insertions" in e && (c += e.insertions), "deletions" in e && (l += e.deletions);
10674
+ for (let e of a) o.push(su(e)), "filesChanged" in e && (s += e.filesChanged), "insertions" in e && (c += e.insertions), "deletions" in e && (l += e.deletions);
10568
10675
  let u = {};
10569
10676
  return n && (u.branch = n), r && (u.remote = r), i && (u.author = i), o.length && (u.commits = o), s > 0 && (u.filesChanged = s), c > 0 && (u.insertions = c), l > 0 && (u.deletions = l), Object.keys(u).length > 0 ? u : void 0;
10570
10677
  }
10571
- function Kl(e, t) {
10678
+ function uu(e, t) {
10572
10679
  let n = {
10573
10680
  id: e.id,
10574
10681
  harness: e.harness,
@@ -10581,11 +10688,11 @@ function Kl(e, t) {
10581
10688
  turnCount: e.turnCount,
10582
10689
  toolCallCount: e.toolCallCount
10583
10690
  };
10584
- e.project && (n.project = e.project), e.model && (n.model = e.model), e.inputSubmissionCount !== void 0 && (n.inputSubmissionCount = e.inputSubmissionCount), e.purpose && (n.purpose = e.purpose), e.rootSessionId && (n.rootSessionId = e.rootSessionId), tu(e) && (n.hasNormalizedEvidence = !0);
10691
+ e.project && (n.project = e.project), e.model && (n.model = e.model), e.inputSubmissionCount !== void 0 && (n.inputSubmissionCount = e.inputSubmissionCount), e.purpose && (n.purpose = e.purpose), e.rootSessionId && (n.rootSessionId = e.rootSessionId), yu(e) && (n.hasNormalizedEvidence = !0);
10585
10692
  let r = e.workingDirectory ?? e.gitContext?.workingDirectory;
10586
10693
  return r && (n.workingDirectory = r), e.outcome && (n.outcome = e.outcome), e.scorecard !== void 0 && (n.scorecard = e.scorecard), t && (n.git = t), n;
10587
10694
  }
10588
- function ql(e) {
10695
+ function du(e) {
10589
10696
  let t = [];
10590
10697
  for (let n of e) {
10591
10698
  if (n.targetEntryIndex == null) continue;
@@ -10599,7 +10706,7 @@ function ql(e) {
10599
10706
  }
10600
10707
  return t;
10601
10708
  }
10602
- function Jl(e, t) {
10709
+ function fu(e, t) {
10603
10710
  let n = {};
10604
10711
  for (let t of e) {
10605
10712
  let e = n[t.turn] ?? [];
@@ -10611,13 +10718,13 @@ function Jl(e, t) {
10611
10718
  }
10612
10719
  return n;
10613
10720
  }
10614
- function Yl(e) {
10721
+ function pu(e) {
10615
10722
  let t = [];
10616
10723
  for (let n of e) for (let e of n.toolCalls) {
10617
10724
  if (!e.diff) continue;
10618
10725
  let r = e.filePath ?? "(unknown)", i = {
10619
10726
  path: r,
10620
- leaf: xl(r) || r,
10727
+ leaf: Rl(r) || r,
10621
10728
  adds: e.adds ?? 0,
10622
10729
  dels: e.dels ?? 0,
10623
10730
  hunks: e.diff,
@@ -10628,7 +10735,7 @@ function Yl(e) {
10628
10735
  }
10629
10736
  return t;
10630
10737
  }
10631
- function Xl(e) {
10738
+ function mu(e) {
10632
10739
  let t = /* @__PURE__ */ new Map();
10633
10740
  for (let n of e) for (let e of n.toolCalls) {
10634
10741
  let r = e.filePath;
@@ -10636,7 +10743,7 @@ function Xl(e) {
10636
10743
  let i = t.get(r);
10637
10744
  i || (i = {
10638
10745
  path: r,
10639
- leaf: xl(r) || r,
10746
+ leaf: Rl(r) || r,
10640
10747
  reads: 0,
10641
10748
  writes: 0,
10642
10749
  edits: 0,
@@ -10653,7 +10760,7 @@ function Xl(e) {
10653
10760
  for (let e of n) e.edited = e.writes + e.edits > 0;
10654
10761
  return n;
10655
10762
  }
10656
- function Zl(e, t, n) {
10763
+ function hu(e, t, n) {
10657
10764
  let r = [], i = e.find((e) => e.role === "user" && e.content.trim() !== "");
10658
10765
  i && r.push({
10659
10766
  id: "hl-request",
@@ -10661,7 +10768,7 @@ function Zl(e, t, n) {
10661
10768
  turn: i.index,
10662
10769
  icon: "request",
10663
10770
  title: "initial request",
10664
- sub: bl(i.content, 160)
10771
+ sub: Ll(i.displayContent ?? i.content, 160)
10665
10772
  }), t.slice(1).forEach((t, n) => {
10666
10773
  let i = e.find((e) => e.index === t.from), a = {
10667
10774
  id: `hl-phase-${n}`,
@@ -10670,7 +10777,7 @@ function Zl(e, t, n) {
10670
10777
  icon: "phase",
10671
10778
  title: `${t.label} begins`,
10672
10779
  tag: t.label
10673
- }, o = bl(i ? i.content : "", 200);
10780
+ }, o = Ll(i ? i.displayContent ?? i.content : "", 200);
10674
10781
  o && (a.sub = o), r.push(a);
10675
10782
  });
10676
10783
  let a = 0;
@@ -10685,7 +10792,7 @@ function Zl(e, t, n) {
10685
10792
  icon: "error",
10686
10793
  title: e ? `${e.name} failed` : "Error",
10687
10794
  err: !0
10688
- }, i = bl(e && typeof e.output == "string" ? e.output : t.content, 200);
10795
+ }, i = Ll(e && typeof e.output == "string" ? e.output : t.content, 200);
10689
10796
  i && (n.sub = i), r.push(n), a++;
10690
10797
  }
10691
10798
  let o = e[e.length - 1], s = o ? o.index : 0;
@@ -10705,19 +10812,19 @@ function Zl(e, t, n) {
10705
10812
  turn: c.index,
10706
10813
  icon: "final",
10707
10814
  title: "final response",
10708
- sub: bl(c.content, 200)
10815
+ sub: Ll(c.content, 200)
10709
10816
  };
10710
- c.tokens && (e.tokens = Cl(c.tokens.in + c.tokens.out)), r.push(e);
10817
+ c.tokens && (e.tokens = Bl(c.tokens.in + c.tokens.out)), r.push(e);
10711
10818
  }
10712
10819
  return r;
10713
10820
  }
10714
- function Ql(e) {
10821
+ function gu(e) {
10715
10822
  if (e === "error") return "errors";
10716
10823
  if (e === "retry") return "retries";
10717
10824
  if (e === "revert") return "re-edit";
10718
10825
  if (e === "subagent") return "subagent";
10719
10826
  }
10720
- function $l(e, t) {
10827
+ function _u(e, t) {
10721
10828
  let n = {
10722
10829
  edits: 0,
10723
10830
  bash: 0,
@@ -10732,7 +10839,7 @@ function $l(e, t) {
10732
10839
  for (let e of Object.keys(t)) {
10733
10840
  let n = t[e] ?? [], i = /* @__PURE__ */ new Set();
10734
10841
  for (let e of n) {
10735
- let t = Ql(e.kind);
10842
+ let t = gu(e.kind);
10736
10843
  t && i.add(t);
10737
10844
  }
10738
10845
  for (let e of i) r[e] = (r[e] ?? 0) + 1;
@@ -10745,8 +10852,8 @@ function $l(e, t) {
10745
10852
  totalTurns: e.length
10746
10853
  };
10747
10854
  }
10748
- function eu(e, t, n, r) {
10749
- let i = tu(e);
10855
+ function vu(e, t, n, r) {
10856
+ let i = yu(e);
10750
10857
  if (i) try {
10751
10858
  e = {
10752
10859
  ...zt(e),
@@ -10755,32 +10862,32 @@ function eu(e, t, n, r) {
10755
10862
  } catch (e) {
10756
10863
  throw Object.assign(/* @__PURE__ */ TypeError(`Fairtrade adaptTranscript refused the durable payload during main/earlier evidence validation: ${e instanceof Error ? e.message : "canonical validation failed"}. No transcript was cooked. Correct the producer using the canonical schema and retry.`), { cause: e });
10757
10864
  }
10758
- let a = e.turns ?? [], { turns: o, toolCallsById: s, analytics: c, annotationsByTurn: l, filteredTurns: u } = ru(e, a, e.nativeMetadata, "main", t, n, r?.visibleTurnIndices), d = Gl(e);
10759
- d?.commits && Wl(d.commits, o);
10865
+ let a = e.turns ?? [], { turns: o, toolCallsById: s, analytics: c, annotationsByTurn: l, filteredTurns: u } = xu(e, a, e.nativeMetadata, "main", t, n, r?.visibleTurnIndices), d = lu(e);
10866
+ d?.commits && cu(d.commits, o);
10760
10867
  let f = c.phases ?? [], p = {
10761
- session: Kl(e, d),
10868
+ session: uu(e, d),
10762
10869
  turns: o,
10763
10870
  toolCallsById: s,
10764
- diffs: Yl(o),
10765
- files: Xl(o),
10766
- tasks: c.taskGroups ?? ml(u),
10767
- highlights: Zl(o, f, d),
10768
- filterIndex: $l(o, l),
10871
+ diffs: pu(o),
10872
+ files: mu(o),
10873
+ tasks: Gl(c.taskGroups ?? _l(u), o),
10874
+ highlights: hu(o, f, d),
10875
+ filterIndex: _u(o, l),
10769
10876
  analytics: c
10770
10877
  };
10771
- return e.nativeMetadata && (p.nativeMetadata = e.nativeMetadata), i && (p.usageScopes = yl(a)), p.relationships = nu(e.relationships ?? [], r?.relationshipNavigation), p.earlierHistory = (e.earlierHistory ?? []).map((t, n) => {
10772
- let r = `earlier-${n}`, i = ru(e, t.turns, t.nativeMetadata, r);
10878
+ return e.nativeMetadata && (p.nativeMetadata = e.nativeMetadata), i && (p.usageScopes = Sl(a)), p.relationships = bu(e.relationships ?? [], r?.relationshipNavigation), p.earlierHistory = (e.earlierHistory ?? []).map((t, n) => {
10879
+ let r = `earlier-${n}`, i = xu(e, t.turns, t.nativeMetadata, r);
10773
10880
  return {
10774
10881
  id: r,
10775
10882
  state: t.state,
10776
10883
  explanation: "ownership of this earlier history is uncertain. it is retained here, separate from current turns and input submissions.",
10777
10884
  turns: i.turns,
10778
10885
  nativeMetadata: t.nativeMetadata,
10779
- usageScopes: yl(t.turns)
10886
+ usageScopes: Sl(t.turns)
10780
10887
  };
10781
10888
  }), p;
10782
10889
  }
10783
- function tu(e) {
10890
+ function yu(e) {
10784
10891
  return e.harness === "pi" || [
10785
10892
  "nativeMetadata",
10786
10893
  "inputSubmissionCount",
@@ -10788,9 +10895,9 @@ function tu(e) {
10788
10895
  "purpose",
10789
10896
  "relationships",
10790
10897
  "earlierHistory"
10791
- ].some((t) => Tl(e, t)) || !!e.turns?.some(Dl);
10898
+ ].some((t) => Hl(e, t)) || !!e.turns?.some(Kl);
10792
10899
  }
10793
- function nu(e, t) {
10900
+ function bu(e, t) {
10794
10901
  let n;
10795
10902
  try {
10796
10903
  n = Gt.array().parse(t === void 0 ? [] : t);
@@ -10818,15 +10925,15 @@ function nu(e, t) {
10818
10925
  });
10819
10926
  return r?.targetLocalId && r.targetLocalId === i?.targetLocalId && a.length === 2 && a[0].statusLabel === a[1].statusLabel && a[0].navigation?.localId === a[1].navigation?.localId && a[0].navigation?.transcriptId === a[1].navigation?.transcriptId ? (a[0].label = "context inherited from and started by", [a[0]]) : a;
10820
10927
  }
10821
- function ru(e, t, n, r, i, a, o) {
10822
- let s = Il(t, e.model), c = (e.harness === "pi" ? t : Pl(t)).filter((t) => !Ml(t, e.harness)).map(Nl), l = o === void 0 ? null : new Set(o), u = l === null ? c : c.filter((e) => l.has(e.index)), d = Oc(u), f = e.harness, p = a ?? hl(u, { scorecard: e.scorecard ?? void 0 }), m = Jl(p.patternAnnotations ?? [], ql(i ?? [])), h = -1;
10928
+ function xu(e, t, n, r, i, a, o) {
10929
+ let s = tu(t, e.model), c = (e.harness === "pi" ? t : $l(t)).filter((t) => !Zl(t, e.harness)).map(Ql), l = o === void 0 ? null : new Set(o), u = l === null ? c : c.filter((e) => l.has(e.index)), d = jc(u), f = e.harness, p = a ?? vl(u, { scorecard: e.scorecard ?? void 0 }), m = fu(p.patternAnnotations ?? [], du(i ?? [])), h = -1;
10823
10930
  for (let e = 0; e < u.length; e++) {
10824
10931
  let t = u[e];
10825
10932
  t.role === "assistant" && (t.depth ?? 0) === 0 && t.content?.trim() && (h = e);
10826
10933
  }
10827
10934
  let g = /* @__PURE__ */ new Map(), _ = [];
10828
10935
  for (let e = 0; e < u.length; e++) {
10829
- let t = u[e], i = (t.toolCalls ?? []).map(Hl);
10936
+ let t = u[e], i = (t.toolCalls ?? []).map(ou);
10830
10937
  for (let e of i) {
10831
10938
  e.partition = r;
10832
10939
  let i = n?.filter((n) => n.attachment?.turnIndex === t.index && n.attachment?.toolCallId === e.id);
@@ -10834,17 +10941,17 @@ function ru(e, t, n, r, i, a, o) {
10834
10941
  }
10835
10942
  for (let e of i) g.set(e.id, e);
10836
10943
  let a = t.content ?? "", o;
10837
- if (t.entryType === "thinking" && (El(t) || a.trim() !== "")) o = {
10944
+ if (t.entryType === "thinking" && (Ul(t) || a.trim() !== "")) o = {
10838
10945
  text: a,
10839
- words: Sl(a)
10946
+ words: zl(a)
10840
10947
  }, a = "";
10841
- else if (!El(t)) {
10948
+ else if (!Ul(t)) {
10842
10949
  let e = a.match(/^\s*<thinking>([\s\S]*?)<\/thinking>\s*/);
10843
10950
  if (e) {
10844
10951
  let t = e[1].trim();
10845
10952
  t !== "" && (o = {
10846
10953
  text: t,
10847
- words: Sl(t)
10954
+ words: zl(t)
10848
10955
  }, a = a.slice(e[0].length));
10849
10956
  }
10850
10957
  }
@@ -10859,12 +10966,14 @@ function ru(e, t, n, r, i, a, o) {
10859
10966
  toolCalls: i,
10860
10967
  annotations: m[t.index] ?? []
10861
10968
  };
10862
- c === 0 && t.role === "assistant" && (p.provider = f), t.agentName && (p.agentName = t.agentName), o && (p.thinking = o), t.usage && (p.usage = t.usage), t.sourceEntryRef && (p.sourceEntryRef = t.sourceEntryRef), t.provenance && (p.provenance = t.provenance), t.entryType && (p.entryType = t.entryType), t.stopReason !== void 0 && t.stopReason !== null && (p.stopReason = t.stopReason), l && (p.isError = !0), e === h && (p.isFinal = !0), !t.usage && (t.tokensIn != null || t.tokensOut != null) && (p.tokens = {
10969
+ c === 0 && t.role === "assistant" && (p.provider = f), t.agentName && (p.agentName = t.agentName), o && (p.thinking = o);
10970
+ let v = Wl(t.role, a, f);
10971
+ v !== void 0 && (p.displayContent = v), t.usage && (p.usage = t.usage), t.sourceEntryRef && (p.sourceEntryRef = t.sourceEntryRef), t.provenance && (p.provenance = t.provenance), t.entryType && (p.entryType = t.entryType), t.stopReason !== void 0 && t.stopReason !== null && (p.stopReason = t.stopReason), l && (p.isError = !0), e === h && (p.isFinal = !0), !t.usage && (t.tokensIn != null || t.tokensOut != null) && (p.tokens = {
10863
10972
  in: t.tokensIn ?? 0,
10864
10973
  out: t.tokensOut ?? 0
10865
10974
  }), t.timestamp && (p.timestamp = t.timestamp);
10866
- let v = s.get(t.index);
10867
- v?.effectiveModel !== void 0 && (p.effectiveModel = v.effectiveModel), v?.modelChangedFrom !== void 0 && (p.modelChangedFrom = v.modelChangedFrom), _.push(p);
10975
+ let y = s.get(t.index);
10976
+ y?.effectiveModel !== void 0 && (p.effectiveModel = y.effectiveModel), y?.modelChangedFrom !== void 0 && (p.modelChangedFrom = y.modelChangedFrom), _.push(p);
10868
10977
  }
10869
10978
  return {
10870
10979
  turns: _,
@@ -10876,7 +10985,7 @@ function ru(e, t, n, r, i, a, o) {
10876
10985
  }
10877
10986
  //#endregion
10878
10987
  //#region src/ui/transcript/turnNav.js
10879
- function iu(e, t, n) {
10988
+ function Su(e, t, n) {
10880
10989
  if (e.length === 0) return;
10881
10990
  let r = n > 0 ? e[0] : e[e.length - 1];
10882
10991
  if (t === void 0) return r;
@@ -10886,106 +10995,27 @@ function iu(e, t, n) {
10886
10995
  return a < 0 || a >= e.length ? e[i] : e[a];
10887
10996
  }
10888
10997
  //#endregion
10889
- //#region src/ui/transcript/title.js
10890
- var au = 80;
10891
- function ou(e, t = au) {
10892
- if (!e) return "";
10893
- let n = lu(e), { slashCommand: r, rest: i } = uu(n);
10894
- n = i;
10895
- let a = n.replace(/<\/?[a-zA-Z][a-zA-Z0-9-]*[^>]*>/g, " ").replace(/[ \t\r\f\v]+/g, " ").trim();
10896
- return a ? pu(fu(du(a).replace(/\s+/g, " ").trim()), t) : r ? pu(r, t) : "";
10897
- }
10898
- function su(e) {
10899
- if (!e) return "";
10900
- let t = e.trim().replace(/[\\/]+$/, "");
10901
- if (!t) return "";
10902
- let n = t.split(/[\\/]/).filter(Boolean);
10903
- return n.length > 0 ? n[n.length - 1] : t;
10904
- }
10905
- function cu(e) {
10906
- let t = e.id.slice(0, 8), n = su(e.project), r = ou(e.promptContent, e.limit), i;
10907
- i = n && r ? `${n}: ${r}` : n ? `${n}, ${t}` : r ? `${t} — ${r}` : `Session ${t}`;
10908
- let a = (e.promptContent ?? i).trim() || i;
10909
- return {
10910
- title: i,
10911
- tooltip: a
10912
- };
10913
- }
10914
- function lu(e) {
10915
- let t = e.replace(/^\s+/, "");
10916
- for (;;) {
10917
- let e = t.match(/^<system-reminder>[\s\S]*?<\/system-reminder>\s*/i);
10918
- if (!e) break;
10919
- t = t.slice(e[0].length);
10920
- }
10921
- let n = t.match(/^```[\s\S]*?```\s*/);
10922
- return n && (t = t.slice(n[0].length)), t;
10923
- }
10924
- function uu(e) {
10925
- if (!/^\s*<command-[a-z-]+>/i.test(e)) return {
10926
- slashCommand: null,
10927
- rest: e
10928
- };
10929
- let t = null, n = "", r = e.replace(/^\s+/, ""), i = /^<command-([a-z-]+)>([\s\S]*?)<\/command-\1>\s*/i;
10930
- for (;;) {
10931
- let e = r.match(i);
10932
- if (!e) break;
10933
- let a = e[1].toLowerCase(), o = e[2].trim();
10934
- if (a === "name" && o) {
10935
- let e = o.replace(/^\/+/, "");
10936
- e && (t = `/${e}`);
10937
- } else a === "args" && o && t ? t = `${t} ${o}` : a === "message" && o && (n = n ? `${n} ${o}` : o);
10938
- r = r.slice(e[0].length);
10939
- }
10940
- let a = r.trim(), o = n ? a ? `${n} ${a}` : n : a;
10941
- return {
10942
- slashCommand: t,
10943
- rest: o
10944
- };
10945
- }
10946
- function du(e) {
10947
- let t = -1, n = "";
10948
- for (let r = 0; r < e.length; r++) {
10949
- let i = e[r];
10950
- if (i === "\n" || i === "." || i === "?" || i === "!") {
10951
- t = r, n = i;
10952
- break;
10953
- }
10954
- }
10955
- if (t === -1) return e;
10956
- let r = e.slice(0, t).trim();
10957
- return r ? n === "?" || n === "!" ? r + n : r : e.trim();
10958
- }
10959
- function fu(e) {
10960
- if (!e) return e;
10961
- let t = e.charAt(0);
10962
- return t >= "a" && t <= "z" ? t.toUpperCase() + e.slice(1) : e;
10963
- }
10964
- function pu(e, t) {
10965
- return e.length <= t ? e : e.slice(0, t - 1).trimEnd() + "…";
10966
- }
10967
- //#endregion
10968
10998
  //#region src/ui/transcript/Markdown.jsx
10969
- var mu = /* @__PURE__ */ new Set([
10999
+ var Cu = /* @__PURE__ */ new Set([
10970
11000
  "http:",
10971
11001
  "https:",
10972
11002
  "mailto:"
10973
- ]), hu = "https://fairtrade.invalid", gu = /%(?:0[0-9a-f]|1[0-9a-f]|7f)/i;
10974
- function _u(e) {
11003
+ ]), wu = "https://fairtrade.invalid", Tu = /%(?:0[0-9a-f]|1[0-9a-f]|7f)/i;
11004
+ function Eu(e) {
10975
11005
  if (typeof e != "string") return "";
10976
11006
  let t = e.trim();
10977
11007
  if (!t) return "";
10978
11008
  try {
10979
- let e = [new URL(t, hu).protocol.toLowerCase()];
10980
- return gu.test(t) && e.push(new URL(decodeURIComponent(t), hu).protocol.toLowerCase()), e.some((e) => !mu.has(e)) ? "" : t;
11009
+ let e = [new URL(t, wu).protocol.toLowerCase()];
11010
+ return Tu.test(t) && e.push(new URL(decodeURIComponent(t), wu).protocol.toLowerCase()), e.some((e) => !Cu.has(e)) ? "" : t;
10981
11011
  } catch {
10982
11012
  return "";
10983
11013
  }
10984
11014
  }
10985
- function vu(e, t) {
11015
+ function Du(e, t) {
10986
11016
  return [e, t].filter(Boolean).join(" ");
10987
11017
  }
10988
- var yu = {
11018
+ var Ou = {
10989
11019
  p: ({ children: e, node: t, ...n }) => /* @__PURE__ */ b("p", {
10990
11020
  className: "txn-md-prose",
10991
11021
  ...n,
@@ -11007,12 +11037,12 @@ var yu = {
11007
11037
  children: e
11008
11038
  }),
11009
11039
  ul: ({ children: e, className: t, node: n, ...r }) => /* @__PURE__ */ b("ul", {
11010
- className: vu("txn-md-list txn-md-list-ul", t),
11040
+ className: Du("txn-md-list txn-md-list-ul", t),
11011
11041
  ...r,
11012
11042
  children: e
11013
11043
  }),
11014
11044
  ol: ({ children: e, className: t, node: n, ...r }) => /* @__PURE__ */ b("ol", {
11015
- className: vu("txn-md-list txn-md-list-ol", t),
11045
+ className: Du("txn-md-list txn-md-list-ol", t),
11016
11046
  ...r,
11017
11047
  children: e
11018
11048
  }),
@@ -11069,12 +11099,12 @@ var yu = {
11069
11099
  })
11070
11100
  }),
11071
11101
  code: ({ children: e, className: t, node: n, ...r }) => /* @__PURE__ */ b("code", {
11072
- className: vu("txn-inlinecode", t),
11102
+ className: Du("txn-inlinecode", t),
11073
11103
  ...r,
11074
11104
  children: e
11075
11105
  }),
11076
11106
  a: ({ children: e, href: t, node: n, ...r }) => {
11077
- let i = _u(t);
11107
+ let i = Eu(t);
11078
11108
  return i ? /* @__PURE__ */ b("a", {
11079
11109
  className: "txn-md-link",
11080
11110
  href: i,
@@ -11097,20 +11127,20 @@ var yu = {
11097
11127
  children: e
11098
11128
  })
11099
11129
  };
11100
- function bu({ text: e, source: t }) {
11130
+ function ku({ text: e, source: t }) {
11101
11131
  return /* @__PURE__ */ b("div", {
11102
11132
  className: "body txn-body",
11103
11133
  children: /* @__PURE__ */ b(an, {
11104
11134
  remarkPlugins: [sn, on],
11105
- urlTransform: _u,
11106
- components: yu,
11135
+ urlTransform: Eu,
11136
+ components: Ou,
11107
11137
  children: typeof e == "string" ? e : typeof t == "string" ? t : ""
11108
11138
  })
11109
11139
  });
11110
11140
  }
11111
11141
  //#endregion
11112
11142
  //#region src/ui/transcript/Thinking.jsx
11113
- function xu({ block: e }) {
11143
+ function Au({ block: e }) {
11114
11144
  let [t, n] = v(!1);
11115
11145
  return e ? /* @__PURE__ */ x("div", {
11116
11146
  className: "txn-thinking",
@@ -11130,8 +11160,15 @@ function xu({ block: e }) {
11130
11160
  }),
11131
11161
  /* @__PURE__ */ b("i", { children: "thinking" }),
11132
11162
  /* @__PURE__ */ x("span", {
11133
- className: "txn-thinking-wc tnum",
11134
- children: [e.words ?? 0, "w"]
11163
+ className: "txn-thinking-wc",
11164
+ children: [
11165
+ /* @__PURE__ */ b("span", {
11166
+ className: "tnum",
11167
+ children: e.words ?? 0
11168
+ }),
11169
+ " ",
11170
+ (e.words ?? 0) === 1 ? "word" : "words"
11171
+ ]
11135
11172
  })
11136
11173
  ]
11137
11174
  }), t && /* @__PURE__ */ b("div", {
@@ -11142,7 +11179,7 @@ function xu({ block: e }) {
11142
11179
  }
11143
11180
  //#endregion
11144
11181
  //#region src/ui/transcript/DiffEntryCard.jsx
11145
- function Su({ hunks: e }) {
11182
+ function ju({ hunks: e }) {
11146
11183
  return /* @__PURE__ */ b("div", {
11147
11184
  className: "diff txn-diff",
11148
11185
  children: (Array.isArray(e) ? e : []).flatMap((e) => {
@@ -11172,7 +11209,7 @@ function Su({ hunks: e }) {
11172
11209
  }, t))
11173
11210
  });
11174
11211
  }
11175
- function Cu({ entry: e, byTurn: t = !1, onJump: n }) {
11212
+ function Mu({ entry: e, byTurn: t = !1, onJump: n }) {
11176
11213
  return e ? /* @__PURE__ */ x("div", {
11177
11214
  className: "txn-diffentry",
11178
11215
  children: [/* @__PURE__ */ x("div", {
@@ -11210,21 +11247,21 @@ function Cu({ entry: e, byTurn: t = !1, onJump: n }) {
11210
11247
  })]
11211
11248
  })
11212
11249
  ]
11213
- }), /* @__PURE__ */ b(Su, { hunks: e.hunks })]
11250
+ }), /* @__PURE__ */ b(ju, { hunks: e.hunks })]
11214
11251
  }) : null;
11215
11252
  }
11216
11253
  //#endregion
11217
11254
  //#region src/ui/transcript/TaskBody.jsx
11218
- function wu(e) {
11255
+ function Nu(e) {
11219
11256
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
11220
11257
  }
11221
- function Tu(e) {
11258
+ function Pu(e) {
11222
11259
  return typeof e == "string" ? e : void 0;
11223
11260
  }
11224
- function Eu({ tool: e }) {
11261
+ function Fu({ tool: e }) {
11225
11262
  let [t, n] = v(!1);
11226
11263
  if (!e) return null;
11227
- let r = wu(e.args), i = Tu(r?.subagent_type) ?? Tu(r?.subagent) ?? Tu(r?.agent), a = Tu(r?.status) ?? (e.isError ? "failed" : "done"), o = Tu(r?.description) ?? Tu(r?.task) ?? e.preview, s = Tu(r?.owner), c = Tu(r?.prompt), l = Tu(e.output) ?? "";
11264
+ let r = Nu(e.args), i = Pu(r?.subagent_type) ?? Pu(r?.subagent) ?? Pu(r?.agent), a = Pu(r?.status) ?? (e.isError ? "failed" : "done"), o = Pu(r?.description) ?? Pu(r?.task) ?? e.preview, s = Pu(r?.owner), c = Pu(r?.prompt), l = Pu(e.output) ?? "";
11228
11265
  return /* @__PURE__ */ x("div", {
11229
11266
  className: "txn-tcbody",
11230
11267
  children: [
@@ -11268,18 +11305,18 @@ function Eu({ tool: e }) {
11268
11305
  }
11269
11306
  //#endregion
11270
11307
  //#region src/ui/transcript/ToolBody.jsx
11271
- function Du(e) {
11308
+ function Iu(e) {
11272
11309
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
11273
11310
  }
11274
- function Ou(e) {
11311
+ function Lu(e) {
11275
11312
  return typeof e == "string" ? e : void 0;
11276
11313
  }
11277
- function ku(e) {
11314
+ function Ru(e) {
11278
11315
  return typeof e == "number" ? e : void 0;
11279
11316
  }
11280
- var Au = Oa;
11281
- function ju({ tool: e }) {
11282
- let t = Du(e.args), n = e.filePath ?? Ou(t?.file_path) ?? Ou(t?.path) ?? "", r = Ou(e.output) ?? "", i = ku(t?.offset), a = ku(t?.limit), o = i != null && a != null ? `${i}–${i + a - 1}` : r ? String(r.split("\n").length) : "";
11317
+ var zu = Oa;
11318
+ function Bu({ tool: e }) {
11319
+ let t = Iu(e.args), n = e.filePath ?? Lu(t?.file_path) ?? Lu(t?.path) ?? "", r = Lu(e.output) ?? "", i = Ru(t?.offset), a = Ru(t?.limit), o = i != null && a != null ? `${i}–${i + a - 1}` : r ? String(r.split("\n").length) : "";
11283
11320
  return /* @__PURE__ */ x("div", {
11284
11321
  className: "txn-tcbody",
11285
11322
  children: [/* @__PURE__ */ x("div", {
@@ -11299,15 +11336,15 @@ function ju({ tool: e }) {
11299
11336
  })]
11300
11337
  });
11301
11338
  }
11302
- function Mu({ tool: e }) {
11303
- let t = Du(e.args);
11339
+ function Vu({ tool: e }) {
11340
+ let t = Iu(e.args);
11304
11341
  return /* @__PURE__ */ x("div", {
11305
11342
  className: "txn-tcbody",
11306
11343
  children: [/* @__PURE__ */ x("div", {
11307
11344
  className: "txn-diff-head",
11308
11345
  children: [/* @__PURE__ */ b("span", {
11309
11346
  className: "mono txn-code-path",
11310
- children: e.filePath ?? Ou(t?.file_path) ?? Ou(t?.path) ?? ""
11347
+ children: e.filePath ?? Lu(t?.file_path) ?? Lu(t?.path) ?? ""
11311
11348
  }), /* @__PURE__ */ x("span", {
11312
11349
  className: "txn-churn tnum",
11313
11350
  children: [
@@ -11322,11 +11359,11 @@ function Mu({ tool: e }) {
11322
11359
  })
11323
11360
  ]
11324
11361
  })]
11325
- }), /* @__PURE__ */ b(Su, { hunks: e.diff })]
11362
+ }), /* @__PURE__ */ b(ju, { hunks: e.diff })]
11326
11363
  });
11327
11364
  }
11328
- function Nu({ tool: e }) {
11329
- let t = Du(e.args), n = Ou(t?.description), r = Ou(t?.command) ?? "", i = Ou(e.output) ?? "", a = e.exitCode ?? 0, o = e.exitCode != null && e.exitCode !== 0, s = Au(e.durationMs);
11365
+ function Hu({ tool: e }) {
11366
+ let t = Iu(e.args), n = Lu(t?.description), r = Lu(t?.command) ?? "", i = Lu(e.output) ?? "", a = e.exitCode ?? 0, o = e.exitCode != null && e.exitCode !== 0, s = zu(e.durationMs);
11330
11367
  return /* @__PURE__ */ x("div", {
11331
11368
  className: "txn-tcbody",
11332
11369
  children: [
@@ -11377,8 +11414,8 @@ function Nu({ tool: e }) {
11377
11414
  ]
11378
11415
  });
11379
11416
  }
11380
- function Pu({ tool: e }) {
11381
- let t = Du(e.args), n = Ou(t?.pattern) ?? Ou(t?.query) ?? "", r = Ou(t?.path) ?? Ou(t?.glob) ?? ".", i = Ou(t?.type), a = Ou(e.output) ?? "", o = Array.isArray(e.output) ? e.output.length : a ? a.split("\n").filter((e) => e.trim() !== "").length : 0;
11417
+ function Uu({ tool: e }) {
11418
+ let t = Iu(e.args), n = Lu(t?.pattern) ?? Lu(t?.query) ?? "", r = Lu(t?.path) ?? Lu(t?.glob) ?? ".", i = Lu(t?.type), a = Lu(e.output) ?? "", o = Array.isArray(e.output) ? e.output.length : a ? a.split("\n").filter((e) => e.trim() !== "").length : 0;
11382
11419
  return /* @__PURE__ */ x("div", {
11383
11420
  className: "txn-tcbody",
11384
11421
  children: [/* @__PURE__ */ x("div", {
@@ -11412,8 +11449,8 @@ function Pu({ tool: e }) {
11412
11449
  })]
11413
11450
  });
11414
11451
  }
11415
- function Fu({ tool: e }) {
11416
- let t = Du(e.args), n = Ou(t?.url) ?? "", r = Ou(t?.prompt), i = Ou(e.output) ?? "";
11452
+ function Wu({ tool: e }) {
11453
+ let t = Iu(e.args), n = Lu(t?.url) ?? "", r = Lu(t?.prompt), i = Lu(e.output) ?? "";
11417
11454
  return /* @__PURE__ */ x("div", {
11418
11455
  className: "txn-tcbody",
11419
11456
  children: [
@@ -11442,8 +11479,8 @@ function Fu({ tool: e }) {
11442
11479
  ]
11443
11480
  });
11444
11481
  }
11445
- function Iu({ tool: e }) {
11446
- let t = Ou(e.output) ?? (e.output == null ? "" : JSON.stringify(e.output, null, 2));
11482
+ function Gu({ tool: e }) {
11483
+ let t = Lu(e.output) ?? (e.output == null ? "" : JSON.stringify(e.output, null, 2));
11447
11484
  return /* @__PURE__ */ x("div", {
11448
11485
  className: "txn-tcbody txn-generic",
11449
11486
  children: [
@@ -11479,22 +11516,22 @@ function Iu({ tool: e }) {
11479
11516
  ]
11480
11517
  });
11481
11518
  }
11482
- function Lu({ tool: e }) {
11519
+ function Ku({ tool: e }) {
11483
11520
  if (!e) return null;
11484
- if (e.pending) return /* @__PURE__ */ b(Iu, { tool: e });
11521
+ if (e.pending) return /* @__PURE__ */ b(Gu, { tool: e });
11485
11522
  switch (e.group) {
11486
- case "read": return /* @__PURE__ */ b(ju, { tool: e });
11487
- case "edits": return /* @__PURE__ */ b(Mu, { tool: e });
11488
- case "bash": return /* @__PURE__ */ b(Nu, { tool: e });
11489
- case "search": return /* @__PURE__ */ b(Pu, { tool: e });
11490
- case "fetch": return /* @__PURE__ */ b(Fu, { tool: e });
11491
- case "tasks": return /* @__PURE__ */ b(Eu, { tool: e });
11492
- default: return /* @__PURE__ */ b(Iu, { tool: e });
11523
+ case "read": return /* @__PURE__ */ b(Bu, { tool: e });
11524
+ case "edits": return /* @__PURE__ */ b(Vu, { tool: e });
11525
+ case "bash": return /* @__PURE__ */ b(Hu, { tool: e });
11526
+ case "search": return /* @__PURE__ */ b(Uu, { tool: e });
11527
+ case "fetch": return /* @__PURE__ */ b(Wu, { tool: e });
11528
+ case "tasks": return /* @__PURE__ */ b(Fu, { tool: e });
11529
+ default: return /* @__PURE__ */ b(Gu, { tool: e });
11493
11530
  }
11494
11531
  }
11495
11532
  //#endregion
11496
11533
  //#region src/ui/transcript/UsageDisclosure.jsx
11497
- function Ru({ usage: e }) {
11534
+ function qu({ usage: e }) {
11498
11535
  return e ? /* @__PURE__ */ x("details", {
11499
11536
  className: "txn-usage",
11500
11537
  children: [
@@ -11512,7 +11549,7 @@ function Ru({ usage: e }) {
11512
11549
  ] }),
11513
11550
  /* @__PURE__ */ b("dl", {
11514
11551
  className: "txn-usage-fields",
11515
- children: Object.entries(gl).map(([t, n]) => /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", { children: n }), /* @__PURE__ */ b("dd", {
11552
+ children: Object.entries(yl).map(([t, n]) => /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", { children: n }), /* @__PURE__ */ b("dd", {
11516
11553
  className: "tnum",
11517
11554
  children: e.tokens?.[t] ?? "unknown"
11518
11555
  })] }, t))
@@ -11523,7 +11560,7 @@ function Ru({ usage: e }) {
11523
11560
  }),
11524
11561
  /* @__PURE__ */ b("dl", {
11525
11562
  className: "txn-usage-fields",
11526
- children: Object.entries(_l).map(([t, n]) => /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("dt", { children: [n, " cost"] }), /* @__PURE__ */ b("dd", {
11563
+ children: Object.entries(bl).map(([t, n]) => /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("dt", { children: [n, " cost"] }), /* @__PURE__ */ b("dd", {
11527
11564
  className: "tnum",
11528
11565
  children: e.cost?.[t] ?? "unknown"
11529
11566
  })] }, t))
@@ -11531,7 +11568,7 @@ function Ru({ usage: e }) {
11531
11568
  ]
11532
11569
  }) : null;
11533
11570
  }
11534
- function zu({ scopes: e, label: t = "session usage by scope" }) {
11571
+ function Ju({ scopes: e, label: t = "session usage by scope" }) {
11535
11572
  return e?.length ? /* @__PURE__ */ x("details", {
11536
11573
  className: "txn-usage txn-usage-scopes",
11537
11574
  children: [
@@ -11584,7 +11621,7 @@ function zu({ scopes: e, label: t = "session usage by scope" }) {
11584
11621
  }
11585
11622
  //#endregion
11586
11623
  //#region src/ui/transcript/ToolCall.jsx
11587
- var Bu = {
11624
+ var Yu = {
11588
11625
  read: A,
11589
11626
  edits: Je,
11590
11627
  bash: ht,
@@ -11592,10 +11629,10 @@ var Bu = {
11592
11629
  fetch: G,
11593
11630
  tasks: Me,
11594
11631
  other: wt
11595
- }, Vu = Oa;
11596
- function Hu({ tool: e, open: t = !1, onToggle: n }) {
11632
+ }, Xu = Oa;
11633
+ function Zu({ tool: e, open: t = !1, onToggle: n }) {
11597
11634
  if (!e) return null;
11598
- let r = e.group === "edits" && /^write$/i.test(e.name) ? _e : Bu[e.group] || wt, i = e.isError || e.group === "bash" && e.exitCode != null && e.exitCode !== 0, a = Vu(e.durationMs);
11635
+ let r = e.group === "edits" && /^write$/i.test(e.name) ? _e : Yu[e.group] || wt, i = e.isError || e.group === "bash" && e.exitCode != null && e.exitCode !== 0, a = Xu(e.durationMs);
11599
11636
  return /* @__PURE__ */ x("div", {
11600
11637
  className: "toolcall txn-toolcall",
11601
11638
  children: [/* @__PURE__ */ x("button", {
@@ -11662,21 +11699,21 @@ function Hu({ tool: e, open: t = !1, onToggle: n }) {
11662
11699
  ]
11663
11700
  })
11664
11701
  ]
11665
- }), t && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(Lu, { tool: e }), /* @__PURE__ */ b(Ru, { usage: e.usage })] })]
11702
+ }), t && /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(Ku, { tool: e }), /* @__PURE__ */ b(qu, { usage: e.usage })] })]
11666
11703
  });
11667
11704
  }
11668
11705
  //#endregion
11669
11706
  //#region src/ui/transcript/TurnCard.jsx
11670
- var Uu = (e) => e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : String(e);
11671
- function Wu(e) {
11707
+ var Qu = (e) => e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : String(e), $u = (e) => String(e ?? "").split("/").pop();
11708
+ function ed(e) {
11672
11709
  return e ? Number.isFinite(Date.parse(e)) ? Sa(e) ? Ta(e) : "" : e : "";
11673
11710
  }
11674
- function Gu({ turn: t, active: n = !1, openTools: o = {}, toggleTool: s = () => {}, onCopyAnchor: c = () => {}, copied: l = !1, registerRef: u = () => {}, onLabel: d, renderActions: f, savedLabel: h, compact: g = !1, expandAll: _ = !1, revealRequest: C = 0 }) {
11711
+ function td({ turn: t, active: n = !1, openTools: o = {}, toggleTool: s = () => {}, onCopyAnchor: c = () => {}, copied: l = !1, registerRef: u = () => {}, onLabel: d, renderActions: f, savedLabel: h, compact: g = !1, expandAll: _ = !1, revealRequest: C = 0 }) {
11675
11712
  let [w, T] = v(!0), E = p(), D = p();
11676
11713
  if (m(() => {
11677
11714
  C && T(!0);
11678
11715
  }, [C]), !t) return null;
11679
- let O = t.role === "user", k = !!t.partition && t.partition !== "main", A = t.time || Wu(t.timestamp), j = !!t.depth && t.depth > 0, M = t.provider, N = M === void 0 ? void 0 : r(M), P = j ? "subagent" : t.role, I = `var(--${M === void 0 ? "amber" : a(M)})`, L = /* @__PURE__ */ x("div", {
11716
+ let O = t.role === "user", k = !!t.partition && t.partition !== "main", A = t.time || ed(t.timestamp), j = !!t.depth && t.depth > 0, M = t.provider, N = M === void 0 ? void 0 : r(M), P = j ? "subagent" : t.role, I = `var(--${M === void 0 ? "amber" : a(M)})`, L = /* @__PURE__ */ x("div", {
11680
11717
  className: "txn-turnhead",
11681
11718
  children: [
11682
11719
  /* @__PURE__ */ x("h4", {
@@ -11756,14 +11793,14 @@ function Gu({ turn: t, active: n = !1, openTools: o = {}, toggleTool: s = () =>
11756
11793
  }),
11757
11794
  t.tokens && /* @__PURE__ */ x(Ti, {
11758
11795
  className: "txn-tokbadge tnum",
11759
- def: Uu(t.tokens.in) + " input tokens, " + Uu(t.tokens.out) + " output tokens",
11796
+ def: Qu(t.tokens.in) + " input tokens, " + Qu(t.tokens.out) + " output tokens",
11760
11797
  children: [
11761
11798
  /* @__PURE__ */ b(le, {
11762
11799
  size: 14,
11763
11800
  "aria-hidden": "true"
11764
11801
  }),
11765
11802
  " ",
11766
- Uu(t.tokens.in + t.tokens.out),
11803
+ Qu(t.tokens.in + t.tokens.out),
11767
11804
  " tokens"
11768
11805
  ]
11769
11806
  })
@@ -11777,10 +11814,10 @@ function Gu({ turn: t, active: n = !1, openTools: o = {}, toggleTool: s = () =>
11777
11814
  children: [h.outcome, h.flag ? ", " + h.flag : ""]
11778
11815
  })
11779
11816
  }),
11780
- /* @__PURE__ */ b(bu, { text: t.content }),
11781
- t.thinking && /* @__PURE__ */ b(xu, { block: t.thinking }),
11782
- /* @__PURE__ */ b(Ru, { usage: t.usage }),
11783
- t.toolCalls && t.toolCalls.map((e) => /* @__PURE__ */ b(Hu, {
11817
+ /* @__PURE__ */ b(ku, { text: t.displayContent ?? t.content }),
11818
+ t.thinking && /* @__PURE__ */ b(Au, { block: t.thinking }),
11819
+ /* @__PURE__ */ b(qu, { usage: t.usage }),
11820
+ t.toolCalls && t.toolCalls.map((e) => /* @__PURE__ */ b(Zu, {
11784
11821
  tool: e,
11785
11822
  open: _ || !!o[e.id],
11786
11823
  onToggle: () => s(e.id)
@@ -11798,9 +11835,18 @@ function Gu({ turn: t, active: n = !1, openTools: o = {}, toggleTool: s = () =>
11798
11835
  className: "txn-modelchange mono",
11799
11836
  children: [
11800
11837
  "model changed: ",
11801
- t.modelChangedFrom,
11802
- " -> ",
11803
- t.effectiveModel
11838
+ $u(t.modelChangedFrom),
11839
+ " ",
11840
+ /* @__PURE__ */ b("span", {
11841
+ "aria-hidden": "true",
11842
+ children: "→"
11843
+ }),
11844
+ /* @__PURE__ */ b("span", {
11845
+ className: "txn-sr",
11846
+ children: " to"
11847
+ }),
11848
+ " ",
11849
+ $u(t.effectiveModel)
11804
11850
  ]
11805
11851
  }), j ? /* @__PURE__ */ x("div", {
11806
11852
  className: "subtask txn-subtask",
@@ -11856,7 +11902,7 @@ function Gu({ turn: t, active: n = !1, openTools: o = {}, toggleTool: s = () =>
11856
11902
  }
11857
11903
  //#endregion
11858
11904
  //#region src/ui/transcript/OutcomeChip.jsx
11859
- var Ku = {
11905
+ var nd = {
11860
11906
  resolved: {
11861
11907
  icon: ct,
11862
11908
  chipTone: "ok",
@@ -11888,8 +11934,8 @@ var Ku = {
11888
11934
  label: "not resolved"
11889
11935
  }
11890
11936
  };
11891
- function qu({ outcome: e, className: t = "" }) {
11892
- let n = e ? Ku[e] : void 0;
11937
+ function rd({ outcome: e, className: t = "" }) {
11938
+ let n = e ? nd[e] : void 0;
11893
11939
  if (!n) return null;
11894
11940
  let r = n.icon;
11895
11941
  return /* @__PURE__ */ x("span", {
@@ -11911,24 +11957,24 @@ function qu({ outcome: e, className: t = "" }) {
11911
11957
  }
11912
11958
  //#endregion
11913
11959
  //#region src/ui/transcript/filters.js
11914
- var Ju = {
11960
+ var id = {
11915
11961
  errors: "error",
11916
11962
  retries: "retry",
11917
11963
  revert: "revert"
11918
11964
  };
11919
- function Yu(e) {
11965
+ function ad(e) {
11920
11966
  if (e.role === "user") return ["prompts"];
11921
11967
  if (e.role !== "assistant") return [];
11922
11968
  let t = [];
11923
11969
  return (e.content ?? "").trim() !== "" && t.push("responses"), e.thinking && t.push("thinking"), e.toolCalls && e.toolCalls.length > 0 && t.push("toolcalls"), t.length ? t : ["responses"];
11924
11970
  }
11925
- function Xu(e, t, n) {
11926
- let r = Object.keys(Ju).filter((e) => t[e]).map((e) => Ju[e]);
11971
+ function od(e, t, n) {
11972
+ let r = Object.keys(id).filter((e) => t[e]).map((e) => id[e]);
11927
11973
  return r.length === 0 || t.errors && (e.isError || (e.toolCalls ?? []).some((e) => e.isError)) ? !0 : (n?.[e.index] ?? []).some((e) => e.kind != null && r.includes(e.kind));
11928
11974
  }
11929
- function Zu(e, t, n = {}) {
11975
+ function sd(e, t, n = {}) {
11930
11976
  let { categories: r, toolGroups: i = {}, tags: a = {} } = t, { annotationsByTurn: o = {}, checkpointTurn: s = null } = n;
11931
- if (s != null && e.index > s || !Xu(e, a, o)) return null;
11977
+ if (s != null && e.index > s || !od(e, a, o)) return null;
11932
11978
  if (e.role === "user") return r.prompts ? e : null;
11933
11979
  if (e.role !== "assistant") return e;
11934
11980
  let c = (e.content ?? "").trim() !== "", l = !!e.thinking, u = e.toolCalls ?? [], d = c && r.responses, f = l && r.thinking, p = r.toolcalls ? u.filter((e) => i[e.group] !== !1) : [];
@@ -11939,27 +11985,27 @@ function Zu(e, t, n = {}) {
11939
11985
  toolCalls: p
11940
11986
  };
11941
11987
  }
11942
- function Qu(e) {
11988
+ function cd(e) {
11943
11989
  let t = {
11944
11990
  prompts: 0,
11945
11991
  responses: 0,
11946
11992
  thinking: 0,
11947
11993
  toolcalls: 0
11948
11994
  };
11949
- for (let n of e) for (let e of Yu(n)) t[e] += 1;
11995
+ for (let n of e) for (let e of ad(n)) t[e] += 1;
11950
11996
  return t;
11951
11997
  }
11952
- function $u(e, t = {}) {
11998
+ function ld(e, t = {}) {
11953
11999
  let n = gc.filter((e) => (t[e] ?? 0) > 0);
11954
12000
  if (n.length === 0) return !0;
11955
12001
  let r = n.filter((t) => e[t] !== !1);
11956
12002
  return r.length === n.length ? !0 : r.length === 0 ? !1 : "mixed";
11957
12003
  }
11958
- function ed(e) {
12004
+ function ud(e) {
11959
12005
  return Object.fromEntries(gc.map((t) => [t, e]));
11960
12006
  }
11961
- function td(e, t, n = {}) {
11962
- let r = e.categories?.toolcalls === !1 ? ed(!1) : { ...e.toolGroups }, i = {
12007
+ function dd(e, t, n = {}) {
12008
+ let r = e.categories?.toolcalls === !1 ? ud(!1) : { ...e.toolGroups }, i = {
11963
12009
  ...r,
11964
12010
  [t]: r[t] === !1
11965
12011
  };
@@ -11968,23 +12014,23 @@ function td(e, t, n = {}) {
11968
12014
  toolGroups: i,
11969
12015
  categories: {
11970
12016
  ...e.categories,
11971
- toolcalls: $u(i, n) !== !1
12017
+ toolcalls: ld(i, n) !== !1
11972
12018
  }
11973
12019
  };
11974
12020
  }
11975
- function nd(e, t) {
12021
+ function fd(e, t) {
11976
12022
  return {
11977
12023
  ...e,
11978
12024
  categories: {
11979
12025
  ...e.categories,
11980
12026
  toolcalls: t
11981
12027
  },
11982
- toolGroups: ed(t)
12028
+ toolGroups: ud(t)
11983
12029
  };
11984
12030
  }
11985
12031
  //#endregion
11986
12032
  //#region src/ui/transcript/scroll-position.js
11987
- function rd(e, t, n) {
12033
+ function pd(e, t, n) {
11988
12034
  let r = 0, i = e.length;
11989
12035
  for (; r < i;) {
11990
12036
  let a = Math.floor((r + i) / 2);
@@ -11994,7 +12040,7 @@ function rd(e, t, n) {
11994
12040
  }
11995
12041
  //#endregion
11996
12042
  //#region src/ui/transcript/TranscriptContext.jsx
11997
- function id({ relationships: e = [], earlierHistory: t = [], onNavigate: n, open: r, toggle: i, openTools: a, toggleTool: o }) {
12043
+ function md({ relationships: e = [], earlierHistory: t = [], onNavigate: n, open: r, toggle: i, openTools: a, toggleTool: o }) {
11998
12044
  let s = p();
11999
12045
  return !e.length && !t.length ? null : /* @__PURE__ */ x("section", {
12000
12046
  className: "txn-context",
@@ -12051,11 +12097,11 @@ function id({ relationships: e = [], earlierHistory: t = [], onNavigate: n, open
12051
12097
  className: "txn-context-note",
12052
12098
  children: e.explanation
12053
12099
  }),
12054
- /* @__PURE__ */ b(zu, {
12100
+ /* @__PURE__ */ b(Ju, {
12055
12101
  scopes: e.usageScopes,
12056
12102
  label: "earlier history usage by scope"
12057
12103
  }),
12058
- r[e.id] && e.turns.map((e) => /* @__PURE__ */ b(Gu, {
12104
+ r[e.id] && e.turns.map((e) => /* @__PURE__ */ b(td, {
12059
12105
  turn: e,
12060
12106
  openTools: a,
12061
12107
  toggleTool: o
@@ -12067,13 +12113,13 @@ function id({ relationships: e = [], earlierHistory: t = [], onNavigate: n, open
12067
12113
  }
12068
12114
  //#endregion
12069
12115
  //#region src/ui/transcript/OutlineRail.jsx
12070
- var ad = {
12116
+ var hd = {
12071
12117
  request: Ye,
12072
12118
  phase: U,
12073
12119
  error: S,
12074
12120
  checkpoint: Se,
12075
12121
  final: dt
12076
- }, od = {
12122
+ }, gd = {
12077
12123
  error: {
12078
12124
  label: "error",
12079
12125
  icon: S,
@@ -12094,13 +12140,13 @@ var ad = {
12094
12140
  icon: H,
12095
12141
  tip: "a Task spawned a nested subagent at depth > 0"
12096
12142
  }
12097
- }, sd = [
12143
+ }, _d = [
12098
12144
  "error",
12099
12145
  "retry",
12100
12146
  "revert",
12101
12147
  "subagent"
12102
12148
  ];
12103
- function cd({ viewModel: e, tab: t, onJump: n = () => {} }) {
12149
+ function vd({ viewModel: e, tab: t, onJump: n = () => {} }) {
12104
12150
  let r = e?.files ?? [], i = e?.highlights ?? [], a = e?.analytics?.patternAnnotations ?? (e?.turns ?? []).flatMap((e) => e.annotations ?? []);
12105
12151
  return t === "diffs" ? /* @__PURE__ */ b("ul", {
12106
12152
  className: "txn-outline",
@@ -12164,7 +12210,7 @@ function cd({ viewModel: e, tab: t, onJump: n = () => {} }) {
12164
12210
  }) : t === "highlights" ? /* @__PURE__ */ b("ul", {
12165
12211
  className: "txn-outline",
12166
12212
  children: i.map((e) => {
12167
- let t = ad[e.kind] ?? z, r = e.kind === "checkpoint";
12213
+ let t = hd[e.kind] ?? z, r = e.kind === "checkpoint";
12168
12214
  return /* @__PURE__ */ b("li", { children: /* @__PURE__ */ x("button", {
12169
12215
  type: "button",
12170
12216
  className: "txn-ol-row",
@@ -12182,10 +12228,10 @@ function cd({ viewModel: e, tab: t, onJump: n = () => {} }) {
12182
12228
  })
12183
12229
  }) : t === "annotations" ? /* @__PURE__ */ b("div", {
12184
12230
  className: "txn-outline-grouped",
12185
- children: sd.map((e) => {
12231
+ children: _d.map((e) => {
12186
12232
  let t = a.filter((t) => t.kind === e);
12187
12233
  if (!t.length) return null;
12188
- let r = od[e], i = r.icon;
12234
+ let r = gd[e], i = r.icon;
12189
12235
  return /* @__PURE__ */ x("div", {
12190
12236
  className: "txn-ol-group",
12191
12237
  children: [/* @__PURE__ */ b("div", {
@@ -12225,7 +12271,7 @@ function cd({ viewModel: e, tab: t, onJump: n = () => {} }) {
12225
12271
  tasks: (e?.tasks ?? []).map((e) => ({
12226
12272
  id: String(e.turnIndices?.[0] ?? e.index),
12227
12273
  index: e.index,
12228
- prompt: e.prompt,
12274
+ prompt: e.displayPrompt ?? e.prompt,
12229
12275
  durationMs: e.durationMs ?? 0,
12230
12276
  tools: e.tools,
12231
12277
  outcome: e.outcome,
@@ -12237,7 +12283,7 @@ function cd({ viewModel: e, tab: t, onJump: n = () => {} }) {
12237
12283
  }
12238
12284
  //#endregion
12239
12285
  //#region src/ui/transcript/FilterSection.jsx
12240
- function ld({ title: e, children: t, defaultOpen: n = !0 }) {
12286
+ function yd({ title: e, children: t, defaultOpen: n = !0 }) {
12241
12287
  let [r, i] = v(n);
12242
12288
  return /* @__PURE__ */ x("div", {
12243
12289
  className: "txn-fsec",
@@ -12262,7 +12308,7 @@ function ld({ title: e, children: t, defaultOpen: n = !0 }) {
12262
12308
  }
12263
12309
  //#endregion
12264
12310
  //#region src/ui/transcript/CheckRow.jsx
12265
- function ud({ checked: e = !1, indeterminate: t = !1, onChange: n = () => {}, children: r, count: i, disabled: a = !1 }) {
12311
+ function bd({ checked: e = !1, indeterminate: t = !1, onChange: n = () => {}, children: r, count: i, disabled: a = !1 }) {
12266
12312
  return /* @__PURE__ */ x("label", {
12267
12313
  className: "txn-checkrow",
12268
12314
  children: [
@@ -12289,7 +12335,7 @@ function ud({ checked: e = !1, indeterminate: t = !1, onChange: n = () => {}, ch
12289
12335
  }
12290
12336
  //#endregion
12291
12337
  //#region src/ui/transcript/ViewSwitch.jsx
12292
- function dd({ label: e = "", on: t = !1, onToggle: n = () => {} }) {
12338
+ function xd({ label: e = "", on: t = !1, onToggle: n = () => {} }) {
12293
12339
  return /* @__PURE__ */ x("div", {
12294
12340
  className: "txn-viewsw",
12295
12341
  children: [
@@ -12314,7 +12360,7 @@ function dd({ label: e = "", on: t = !1, onToggle: n = () => {} }) {
12314
12360
  }
12315
12361
  //#endregion
12316
12362
  //#region src/ui/transcript/FiltersRail.jsx
12317
- var fd = {
12363
+ var Sd = {
12318
12364
  edits: {
12319
12365
  label: "file edits",
12320
12366
  icon: Je
@@ -12343,7 +12389,7 @@ var fd = {
12343
12389
  label: "other",
12344
12390
  icon: wt
12345
12391
  }
12346
- }, pd = {
12392
+ }, Cd = {
12347
12393
  categories: {
12348
12394
  prompts: !0,
12349
12395
  responses: !0,
@@ -12363,7 +12409,7 @@ var fd = {
12363
12409
  },
12364
12410
  checkpoint: "all"
12365
12411
  };
12366
- function md({ tab: e, filters: t = pd, onFiltersChange: n = () => {}, counts: r = {
12412
+ function wd({ tab: e, filters: t = Cd, onFiltersChange: n = () => {}, counts: r = {
12367
12413
  categories: {
12368
12414
  prompts: 0,
12369
12415
  responses: 0,
@@ -12402,29 +12448,26 @@ function md({ tab: e, filters: t = pd, onFiltersChange: n = () => {}, counts: r
12402
12448
  ..._,
12403
12449
  ...e
12404
12450
  }
12405
- }), O = (e) => n(nd(t, e)), A = (e) => n(td(t, e, r.toolGroups)), j = $u(h, r.toolGroups), M = (e) => n({
12451
+ }), O = (e) => n(fd(t, e)), A = (e) => n(dd(t, e, r.toolGroups)), j = ld(h, r.toolGroups), M = (e) => n({
12406
12452
  ...t,
12407
12453
  checkpoint: e
12408
12454
  });
12409
- return e !== "trace" && e !== "highlights" ? /* @__PURE__ */ b("div", {
12410
- className: "txn-filter-ph",
12411
- children: "filters are not available for this view yet."
12412
- }) : e === "highlights" ? /* @__PURE__ */ b("div", {
12455
+ return e !== "trace" && e !== "highlights" ? null : e === "highlights" ? /* @__PURE__ */ b("div", {
12413
12456
  className: "txn-filters",
12414
- children: /* @__PURE__ */ x(ld, {
12457
+ children: /* @__PURE__ */ x(yd, {
12415
12458
  title: "outcome",
12416
12459
  children: [
12417
- /* @__PURE__ */ b(ud, {
12460
+ /* @__PURE__ */ b(bd, {
12418
12461
  checked: g.errors,
12419
12462
  onChange: () => E({ errors: !g.errors }),
12420
12463
  children: "errors"
12421
12464
  }),
12422
- /* @__PURE__ */ b(ud, {
12465
+ /* @__PURE__ */ b(bd, {
12423
12466
  checked: g.retries,
12424
12467
  onChange: () => E({ retries: !g.retries }),
12425
12468
  children: "retries"
12426
12469
  }),
12427
- /* @__PURE__ */ b(ud, {
12470
+ /* @__PURE__ */ b(bd, {
12428
12471
  checked: g.revert,
12429
12472
  onChange: () => E({ revert: !g.revert }),
12430
12473
  children: "re-edit"
@@ -12453,19 +12496,19 @@ function md({ tab: e, filters: t = pd, onFiltersChange: n = () => {}, counts: r
12453
12496
  /* @__PURE__ */ x("div", {
12454
12497
  className: "txn-catlist",
12455
12498
  children: [
12456
- /* @__PURE__ */ b(ud, {
12499
+ /* @__PURE__ */ b(bd, {
12457
12500
  checked: m.prompts,
12458
12501
  onChange: () => T({ prompts: !m.prompts }),
12459
12502
  count: r.categories.prompts,
12460
12503
  children: "prompts"
12461
12504
  }),
12462
- /* @__PURE__ */ b(ud, {
12505
+ /* @__PURE__ */ b(bd, {
12463
12506
  checked: m.responses,
12464
12507
  onChange: () => T({ responses: !m.responses }),
12465
12508
  count: r.categories.responses,
12466
12509
  children: "responses"
12467
12510
  }),
12468
- /* @__PURE__ */ b(ud, {
12511
+ /* @__PURE__ */ b(bd, {
12469
12512
  checked: m.thinking,
12470
12513
  onChange: () => T({ thinking: !m.thinking }),
12471
12514
  count: r.categories.thinking,
@@ -12473,7 +12516,7 @@ function md({ tab: e, filters: t = pd, onFiltersChange: n = () => {}, counts: r
12473
12516
  }),
12474
12517
  /* @__PURE__ */ x("div", {
12475
12518
  className: "txn-toolcat",
12476
- children: [/* @__PURE__ */ b(ud, {
12519
+ children: [/* @__PURE__ */ b(bd, {
12477
12520
  checked: m.toolcalls,
12478
12521
  indeterminate: m.toolcalls && j === "mixed",
12479
12522
  onChange: () => O(!m.toolcalls),
@@ -12493,7 +12536,7 @@ function md({ tab: e, filters: t = pd, onFiltersChange: n = () => {}, counts: r
12493
12536
  }), l && /* @__PURE__ */ b("div", {
12494
12537
  className: "txn-toolgroups",
12495
12538
  children: gc.map((e) => {
12496
- let t = fd[e], n = t.icon, i = r.toolGroups[e] ?? 0;
12539
+ let t = Sd[e], n = t.icon, i = r.toolGroups[e] ?? 0;
12497
12540
  return /* @__PURE__ */ x("label", {
12498
12541
  className: "txn-checkrow txn-subcheck",
12499
12542
  children: [
@@ -12534,7 +12577,7 @@ function md({ tab: e, filters: t = pd, onFiltersChange: n = () => {}, counts: r
12534
12577
  /* @__PURE__ */ x("div", {
12535
12578
  className: "txn-catlist",
12536
12579
  children: [
12537
- /* @__PURE__ */ x(ud, {
12580
+ /* @__PURE__ */ x(bd, {
12538
12581
  checked: g.errors,
12539
12582
  onChange: () => E({ errors: !g.errors }),
12540
12583
  children: [/* @__PURE__ */ b(S, {
@@ -12543,7 +12586,7 @@ function md({ tab: e, filters: t = pd, onFiltersChange: n = () => {}, counts: r
12543
12586
  className: "txn-tag-err"
12544
12587
  }), " errors"]
12545
12588
  }),
12546
- /* @__PURE__ */ x(ud, {
12589
+ /* @__PURE__ */ x(bd, {
12547
12590
  checked: g.retries,
12548
12591
  onChange: () => E({ retries: !g.retries }),
12549
12592
  children: [/* @__PURE__ */ b(Ze, {
@@ -12551,7 +12594,7 @@ function md({ tab: e, filters: t = pd, onFiltersChange: n = () => {}, counts: r
12551
12594
  "aria-hidden": "true"
12552
12595
  }), " retries"]
12553
12596
  }),
12554
- /* @__PURE__ */ x(ud, {
12597
+ /* @__PURE__ */ x(bd, {
12555
12598
  checked: g.revert,
12556
12599
  onChange: () => E({ revert: !g.revert }),
12557
12600
  children: [/* @__PURE__ */ b($e, {
@@ -12628,17 +12671,17 @@ function md({ tab: e, filters: t = pd, onFiltersChange: n = () => {}, counts: r
12628
12671
  /* @__PURE__ */ x("div", {
12629
12672
  className: "txn-views",
12630
12673
  children: [
12631
- /* @__PURE__ */ b(dd, {
12674
+ /* @__PURE__ */ b(xd, {
12632
12675
  label: "show hidden indicators",
12633
12676
  on: _.hidden,
12634
12677
  onToggle: () => D({ hidden: !_.hidden })
12635
12678
  }),
12636
- /* @__PURE__ */ b(dd, {
12679
+ /* @__PURE__ */ b(xd, {
12637
12680
  label: "expand all tool calls",
12638
12681
  on: _.expandAll,
12639
12682
  onToggle: () => D({ expandAll: !_.expandAll })
12640
12683
  }),
12641
- /* @__PURE__ */ b(dd, {
12684
+ /* @__PURE__ */ b(xd, {
12642
12685
  label: "compact mode",
12643
12686
  on: _.compact,
12644
12687
  onToggle: () => D({ compact: !_.compact })
@@ -12675,7 +12718,7 @@ function md({ tab: e, filters: t = pd, onFiltersChange: n = () => {}, counts: r
12675
12718
  }
12676
12719
  //#endregion
12677
12720
  //#region src/ui/transcript/Scrubber.jsx
12678
- function hd({ turns: e = [], active: t = 0, onSeek: n = () => {}, draggingRef: r }) {
12721
+ function Td({ turns: e = [], active: t = 0, onSeek: n = () => {}, draggingRef: r }) {
12679
12722
  let i = _(null), a = _(!1), o = r ?? a, s = e.length - 1, c = Math.max(0, e.findIndex((e) => e.index === t)), l = s > 0 ? c / s * 100 : 0;
12680
12723
  function u(e) {
12681
12724
  o.current = !0, i.current && n(e.clientX, i.current);
@@ -12713,7 +12756,7 @@ function hd({ turns: e = [], active: t = 0, onSeek: n = () => {}, draggingRef: r
12713
12756
  }
12714
12757
  //#endregion
12715
12758
  //#region src/ui/transcript/Scorecard.jsx
12716
- var gd = {
12759
+ var Ed = {
12717
12760
  good: {
12718
12761
  label: "on track",
12719
12762
  chip: "chip-ok"
@@ -12730,12 +12773,12 @@ var gd = {
12730
12773
  label: "off track",
12731
12774
  chip: "chip-err"
12732
12775
  }
12733
- }, _d = {
12776
+ }, Dd = {
12734
12777
  token: le,
12735
12778
  prompt: ye,
12736
12779
  loop: Ze
12737
12780
  };
12738
- function vd({ bands: e = [] }) {
12781
+ function Od({ bands: e = [] }) {
12739
12782
  return !e || e.length === 0 ? null : /* @__PURE__ */ x("div", {
12740
12783
  className: "txn-scorecard",
12741
12784
  children: [/* @__PURE__ */ x("div", {
@@ -12747,10 +12790,10 @@ function vd({ bands: e = [] }) {
12747
12790
  }), /* @__PURE__ */ b("div", {
12748
12791
  className: "txn-sc-grid",
12749
12792
  children: e.map((e) => {
12750
- let t = gd[e.band] ?? {
12793
+ let t = Ed[e.band] ?? {
12751
12794
  label: e.band,
12752
12795
  chip: ""
12753
- }, n = e.icon ? _d[e.icon] : null, r = e.delta ? e.delta.dir === "up" ? _t : gt : null;
12796
+ }, n = e.icon ? Dd[e.icon] : null, r = e.delta ? e.delta.dir === "up" ? _t : gt : null;
12754
12797
  return /* @__PURE__ */ x("div", {
12755
12798
  className: "txn-sc-card",
12756
12799
  children: [
@@ -12799,18 +12842,18 @@ function vd({ bands: e = [] }) {
12799
12842
  }
12800
12843
  //#endregion
12801
12844
  //#region src/ui/transcript/LabelPopover.jsx
12802
- var yd = [
12845
+ var kd = [
12803
12846
  ["good", "good"],
12804
12847
  ["neutral", "neutral"],
12805
12848
  ["bad", "bad"]
12806
- ], bd = [
12849
+ ], Ad = [
12807
12850
  ["", "none"],
12808
12851
  ["error", "error"],
12809
12852
  ["retry-loop", "retry loop"],
12810
12853
  ["revert", "revert"],
12811
12854
  ["highlight", "highlight"]
12812
12855
  ];
12813
- function xd({ turnId: e, current: t, onSave: n = () => {}, onClose: r = () => {} }) {
12856
+ function jd({ turnId: e, current: t, onSave: n = () => {}, onClose: r = () => {} }) {
12814
12857
  let [i, a] = v(t?.outcome || "neutral"), [o, s] = v(t?.flag || ""), c = _(null);
12815
12858
  return f(() => {
12816
12859
  function e(e) {
@@ -12845,7 +12888,7 @@ function xd({ turnId: e, current: t, onSave: n = () => {}, onClose: r = () => {}
12845
12888
  children: "outcome"
12846
12889
  }), /* @__PURE__ */ b("div", {
12847
12890
  className: "bs-seg txn-label-seg",
12848
- children: yd.map(([e, t]) => /* @__PURE__ */ b("button", {
12891
+ children: kd.map(([e, t]) => /* @__PURE__ */ b("button", {
12849
12892
  type: "button",
12850
12893
  className: "bs-seg-opt",
12851
12894
  "aria-pressed": i === e,
@@ -12857,7 +12900,7 @@ function xd({ turnId: e, current: t, onSave: n = () => {}, onClose: r = () => {}
12857
12900
  children: "flag"
12858
12901
  }), /* @__PURE__ */ b("div", {
12859
12902
  className: "txn-label-flags",
12860
- children: bd.map(([e, t]) => /* @__PURE__ */ b("button", {
12903
+ children: Ad.map(([e, t]) => /* @__PURE__ */ b("button", {
12861
12904
  type: "button",
12862
12905
  className: "chip txn-label-flag" + (o === e ? " txn-flag-on" : ""),
12863
12906
  "aria-pressed": o === e,
@@ -12886,12 +12929,12 @@ function xd({ turnId: e, current: t, onSave: n = () => {}, onClose: r = () => {}
12886
12929
  }
12887
12930
  //#endregion
12888
12931
  //#region src/ui/transcript/initial-position.js
12889
- var Sd = /* @__PURE__ */ new Set([
12932
+ var Md = /* @__PURE__ */ new Set([
12890
12933
  "pending",
12891
12934
  "applied",
12892
12935
  "discarded"
12893
- ]), Cd = Symbol("fairtrade.invalid-initial-position"), wd = /* @__PURE__ */ new WeakSet();
12894
- function Td(e) {
12936
+ ]), Nd = Symbol("fairtrade.invalid-initial-position"), Pd = /* @__PURE__ */ new WeakSet();
12937
+ function Fd(e) {
12895
12938
  if (e === void 0) return "undefined";
12896
12939
  if (e === null) return "null";
12897
12940
  if (typeof e == "string") return JSON.stringify(e);
@@ -12910,7 +12953,7 @@ function Td(e) {
12910
12953
  return "[object]";
12911
12954
  }
12912
12955
  }
12913
- function Ed(e, t, n) {
12956
+ function Id(e, t, n) {
12914
12957
  let r = TypeError([
12915
12958
  `What went wrong: ${e}.`,
12916
12959
  `Why it happened: ${t}.`,
@@ -12919,54 +12962,54 @@ function Ed(e, t, n) {
12919
12962
  "What it means for the caller: the position was rejected and no scrolling or selection side effect was performed.",
12920
12963
  `How to fix it: ${n}.`
12921
12964
  ].join(" "));
12922
- return Object.defineProperty(r, Cd, { value: !0 }), wd.add(r), r;
12965
+ return Object.defineProperty(r, Nd, { value: !0 }), Pd.add(r), r;
12923
12966
  }
12924
- function Dd(e, t) {
12967
+ function Ld(e, t) {
12925
12968
  try {
12926
12969
  return t();
12927
12970
  } catch (t) {
12928
- throw typeof t == "object" && t && wd.has(t) ? t : Ed(`the position could not be safely inspected during ${e}`, "the untrusted container interrupted reflection", "pass a plain object whose documented fields are own data properties");
12971
+ throw typeof t == "object" && t && Pd.has(t) ? t : Id(`the position could not be safely inspected during ${e}`, "the untrusted container interrupted reflection", "pass a plain object whose documented fields are own data properties");
12929
12972
  }
12930
12973
  }
12931
- function Od(e, t) {
12932
- return Dd("descriptor map construction", () => {
12974
+ function Rd(e, t) {
12975
+ return Ld("descriptor map construction", () => {
12933
12976
  let n = /* @__PURE__ */ new Map();
12934
12977
  for (let r of t) {
12935
12978
  let t = Object.getOwnPropertyDescriptor(e, r);
12936
- if (t === void 0) throw Ed(`${r} was reported without an own descriptor`, "the own-key and descriptor views of the untrusted container disagree", `report ${r} only when it has an exact own data descriptor`);
12937
- if (!Object.prototype.hasOwnProperty.call(t, "value")) throw Ed(`${r} is an accessor rather than an own data property`, "reading an accessor could execute untrusted code during validation", `define ${r} as an own data property`);
12979
+ if (t === void 0) throw Id(`${r} was reported without an own descriptor`, "the own-key and descriptor views of the untrusted container disagree", `report ${r} only when it has an exact own data descriptor`);
12980
+ if (!Object.prototype.hasOwnProperty.call(t, "value")) throw Id(`${r} is an accessor rather than an own data property`, "reading an accessor could execute untrusted code during validation", `define ${r} as an own data property`);
12938
12981
  n.set(r, t.value);
12939
12982
  }
12940
12983
  return n;
12941
12984
  });
12942
12985
  }
12943
- function kd(e) {
12944
- if (!e.has("kind")) throw Ed("kind is missing from the reported own keys", "the position union cannot be selected without an own kind data field", "report an own kind data field containing 'top' or 'turn'");
12986
+ function zd(e) {
12987
+ if (!e.has("kind")) throw Id("kind is missing from the reported own keys", "the position union cannot be selected without an own kind data field", "report an own kind data field containing 'top' or 'turn'");
12945
12988
  return e.get("kind");
12946
12989
  }
12947
- function Ad(e) {
12990
+ function Bd(e) {
12948
12991
  if (e == null) return null;
12949
- if (typeof e != "object" || Dd("array classification", () => Array.isArray(e))) throw Ed("the position is not an object", "only the top and turn object shapes are supported", "pass { kind: 'top' } or { kind: 'turn', turnIndex: 0 }");
12950
- let t = Dd("prototype inspection", () => Object.getPrototypeOf(e));
12951
- if (t !== Object.prototype && t !== null) throw Ed("the position has a non-plain prototype", "class instances and inherited state can hide unvalidated fields", "pass a plain object containing only the documented own keys");
12952
- let n = e, r = Dd("own-key inspection", () => Reflect.ownKeys(n));
12953
- if (r.some((e) => typeof e != "string")) throw Ed("the position contains a symbol key", "symbol keys are outside the serialized public contract", "remove symbol keys and use only documented string keys");
12954
- let i = Od(n, r), a = kd(i);
12955
- if (a !== "top" && a !== "turn") throw Ed(`the kind ${Td(a)} is unknown`, "the position union is closed", "use kind 'top' or kind 'turn'");
12992
+ if (typeof e != "object" || Ld("array classification", () => Array.isArray(e))) throw Id("the position is not an object", "only the top and turn object shapes are supported", "pass { kind: 'top' } or { kind: 'turn', turnIndex: 0 }");
12993
+ let t = Ld("prototype inspection", () => Object.getPrototypeOf(e));
12994
+ if (t !== Object.prototype && t !== null) throw Id("the position has a non-plain prototype", "class instances and inherited state can hide unvalidated fields", "pass a plain object containing only the documented own keys");
12995
+ let n = e, r = Ld("own-key inspection", () => Reflect.ownKeys(n));
12996
+ if (r.some((e) => typeof e != "string")) throw Id("the position contains a symbol key", "symbol keys are outside the serialized public contract", "remove symbol keys and use only documented string keys");
12997
+ let i = Rd(n, r), a = zd(i);
12998
+ if (a !== "top" && a !== "turn") throw Id(`the kind ${Fd(a)} is unknown`, "the position union is closed", "use kind 'top' or kind 'turn'");
12956
12999
  let o = a === "top" ? /* @__PURE__ */ new Set(["kind", "requestKey"]) : /* @__PURE__ */ new Set([
12957
13000
  "kind",
12958
13001
  "turnIndex",
12959
13002
  "requestKey"
12960
13003
  ]), s = [...i.keys()].filter((e) => !o.has(e)), c = a === "turn" && !i.has("turnIndex") ? ["turnIndex"] : [];
12961
- if (s.length || c.length) throw Ed(`the ${a} position has an inexact key set (extra: ${s.join(", ") || "none"}; missing: ${c.join(", ") || "none"})`, "unknown or missing fields would make host intent ambiguous", `use exactly ${[...o].join(", ")} with requestKey omitted when unnecessary`);
13004
+ if (s.length || c.length) throw Id(`the ${a} position has an inexact key set (extra: ${s.join(", ") || "none"}; missing: ${c.join(", ") || "none"})`, "unknown or missing fields would make host intent ambiguous", `use exactly ${[...o].join(", ")} with requestKey omitted when unnecessary`);
12962
13005
  let l = i.get("requestKey");
12963
- if (l !== void 0 && (typeof l != "string" || l.trim().length === 0 || l.includes("\0"))) throw Ed("requestKey is malformed", "requestKey must be a nonempty string without the token delimiter", "supply a stable nonblank request identity or omit requestKey");
13006
+ if (l !== void 0 && (typeof l != "string" || l.trim().length === 0 || l.includes("\0"))) throw Id("requestKey is malformed", "requestKey must be a nonempty string without the token delimiter", "supply a stable nonblank request identity or omit requestKey");
12964
13007
  if (a === "top") return l === void 0 ? { kind: "top" } : {
12965
13008
  kind: "top",
12966
13009
  requestKey: l
12967
13010
  };
12968
13011
  let u = i.get("turnIndex");
12969
- if (!Number.isSafeInteger(u) || u < 0) throw Ed(`turnIndex ${Td(u)} is not a safe nonnegative integer`, "turn identities are sparse integer identities rather than array offsets or arbitrary numbers", "supply the exact safe nonnegative turn identity from the transcript wire");
13012
+ if (!Number.isSafeInteger(u) || u < 0) throw Id(`turnIndex ${Fd(u)} is not a safe nonnegative integer`, "turn identities are sparse integer identities rather than array offsets or arbitrary numbers", "supply the exact safe nonnegative turn identity from the transcript wire");
12970
13013
  return l === void 0 ? {
12971
13014
  kind: "turn",
12972
13015
  turnIndex: u
@@ -12976,18 +13019,18 @@ function Ad(e) {
12976
13019
  requestKey: l
12977
13020
  };
12978
13021
  }
12979
- function jd(e) {
13022
+ function Vd(e) {
12980
13023
  let t = e.explicitUsed || e.initialPosition !== void 0, n = e.fallbackUsed || !t && e.fallbackInitialPosition !== void 0;
12981
13024
  return {
12982
13025
  explicitUsed: t,
12983
13026
  fallbackUsed: n,
12984
- position: e.initialPosition === void 0 ? t ? null : e.fallbackInitialPosition === void 0 ? n ? null : Ad(e.legacyInitialPosition) : Ad(e.fallbackInitialPosition) : Ad(e.initialPosition)
13027
+ position: e.initialPosition === void 0 ? t ? null : e.fallbackInitialPosition === void 0 ? n ? null : Bd(e.legacyInitialPosition) : Bd(e.fallbackInitialPosition) : Bd(e.initialPosition)
12985
13028
  };
12986
13029
  }
12987
- function Md(e, t) {
13030
+ function Hd(e, t) {
12988
13031
  return e.kind === "turn" && !t.authoritativeTurnIndices.includes(e.turnIndex) ? "discarded" : e.kind === "turn" && !t.renderedTurnIndices.includes(e.turnIndex) || !t.viewReady || !t.scrollerReady || e.kind === "turn" && !t.targetReady ? "pending" : "applied";
12989
13032
  }
12990
- function Nd(e, t) {
13033
+ function Ud(e, t) {
12991
13034
  return t == null ? null : JSON.stringify([
12992
13035
  e ?? "",
12993
13036
  t.kind,
@@ -12995,21 +13038,21 @@ function Nd(e, t) {
12995
13038
  t.requestKey ?? ""
12996
13039
  ]);
12997
13040
  }
12998
- function Pd(e) {
12999
- if (!Sd.has(e)) throw Ed(`the layout consumer returned ${Td(e)}`, "apply must report pending, applied, or discarded", "return pending while readiness is incomplete, applied after positioning, or discarded after authoritative absence");
13041
+ function Wd(e) {
13042
+ if (!Md.has(e)) throw Id(`the layout consumer returned ${Fd(e)}`, "apply must report pending, applied, or discarded", "return pending while readiness is incomplete, applied after positioning, or discarded after authoritative absence");
13000
13043
  }
13001
- function Fd(e, t) {
13044
+ function Gd(e, t) {
13002
13045
  return t != null && e !== t;
13003
13046
  }
13004
- function Id(e, t, n) {
13005
- return Pd(n), t == null ? null : n === "applied" || n === "discarded" ? t : e;
13047
+ function Kd(e, t, n) {
13048
+ return Wd(n), t == null ? null : n === "applied" || n === "discarded" ? t : e;
13006
13049
  }
13007
13050
  //#endregion
13008
13051
  //#region src/ui/transcript/useTranscriptInitialPosition.jsx
13009
- function Ld(e) {
13052
+ function qd(e) {
13010
13053
  let t = _(void 0);
13011
- t.current === void 0 && (t.current = Ad(e.legacyInitialPosition));
13012
- let n = _(!1), r = _(!1), i = jd({
13054
+ t.current === void 0 && (t.current = Bd(e.legacyInitialPosition));
13055
+ let n = _(!1), r = _(!1), i = Vd({
13013
13056
  initialPosition: e.initialPosition,
13014
13057
  fallbackInitialPosition: e.fallbackInitialPosition,
13015
13058
  legacyInitialPosition: t.current,
@@ -13017,15 +13060,15 @@ function Ld(e) {
13017
13060
  fallbackUsed: r.current
13018
13061
  });
13019
13062
  n.current = i.explicitUsed, r.current = i.fallbackUsed;
13020
- let a = i.position, o = Nd(e.sessionId, a), s = _(null);
13063
+ let a = i.position, o = Ud(e.sessionId, a), s = _(null);
13021
13064
  return m(() => {
13022
13065
  if (o == null || a == null) {
13023
13066
  s.current = null;
13024
13067
  return;
13025
13068
  }
13026
- if (!Fd(s.current, o)) return;
13069
+ if (!Gd(s.current, o)) return;
13027
13070
  let t = e.apply(a);
13028
- s.current = Id(s.current, o, t);
13071
+ s.current = Kd(s.current, o, t);
13029
13072
  }, [
13030
13073
  o,
13031
13074
  a,
@@ -13038,8 +13081,8 @@ function Ld(e) {
13038
13081
  }
13039
13082
  //#endregion
13040
13083
  //#region src/ui/transcript/TranscriptViewer.jsx
13041
- var Rd = (e) => e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : String(e);
13042
- function zd(e, t, n) {
13084
+ var Jd = (e) => e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : String(e);
13085
+ function Yd(e, t, n) {
13043
13086
  let [r, i] = v(n), a = e !== void 0;
13044
13087
  return [a ? e : r, u((n) => {
13045
13088
  let o = typeof n == "function" ? n(a ? e : r) : n;
@@ -13051,31 +13094,31 @@ function zd(e, t, n) {
13051
13094
  r
13052
13095
  ])];
13053
13096
  }
13054
- var Bd = 56, Vd = [
13097
+ var Xd = 56, Zd = [
13055
13098
  "highlights",
13056
13099
  "trace",
13057
13100
  "diffs",
13058
13101
  "files",
13059
13102
  "annotations"
13060
- ], Hd = {
13103
+ ], Qd = {
13061
13104
  highlights: "highlights",
13062
13105
  trace: "full trace",
13063
13106
  diffs: "diffs",
13064
13107
  files: "files",
13065
13108
  annotations: "annotations"
13066
- }, Ud = {
13109
+ }, $d = {
13067
13110
  exploration: ve,
13068
13111
  debugging: S,
13069
13112
  implementation: Je,
13070
13113
  planning: Ne,
13071
13114
  review: ct
13072
- }, Wd = {
13115
+ }, ef = {
13073
13116
  request: Ye,
13074
13117
  phase: U,
13075
13118
  error: S,
13076
13119
  checkpoint: Se,
13077
13120
  final: dt
13078
- }, Gd = {
13121
+ }, tf = {
13079
13122
  error: {
13080
13123
  label: "error",
13081
13124
  icon: S,
@@ -13100,7 +13143,7 @@ var Bd = 56, Vd = [
13100
13143
  chip: "",
13101
13144
  tip: "a Task spawned a nested subagent at depth > 0"
13102
13145
  }
13103
- }, Kd = Object.freeze({
13146
+ }, nf = Object.freeze({
13104
13147
  categories: {
13105
13148
  prompts: !0,
13106
13149
  responses: !0,
@@ -13120,17 +13163,17 @@ var Bd = 56, Vd = [
13120
13163
  },
13121
13164
  checkpoint: "all"
13122
13165
  });
13123
- function qd(e, t) {
13166
+ function rf(e, t) {
13124
13167
  let n = Number.parseFloat(getComputedStyle(e).scrollPaddingTop);
13125
13168
  return t.offsetTop - (Number.isFinite(n) ? n : 12);
13126
13169
  }
13127
- function Jd({ phase: e }) {
13170
+ function af({ phase: e }) {
13128
13171
  return /* @__PURE__ */ x("div", {
13129
13172
  className: "phase txn-phase",
13130
13173
  children: [/* @__PURE__ */ x("h3", {
13131
13174
  className: "lbl",
13132
13175
  children: [
13133
- /* @__PURE__ */ b(Ud[e.icon] ?? Ud[e.id] ?? U, {
13176
+ /* @__PURE__ */ b($d[e.icon] ?? $d[e.id] ?? U, {
13134
13177
  size: 14,
13135
13178
  "aria-hidden": "true"
13136
13179
  }),
@@ -13149,7 +13192,7 @@ function Jd({ phase: e }) {
13149
13192
  })]
13150
13193
  });
13151
13194
  }
13152
- function Yd({ task: e }) {
13195
+ function of({ task: e }) {
13153
13196
  let t = [
13154
13197
  Oa(e.durationMs) || null,
13155
13198
  e.tools == null ? null : `${e.tools} tools`,
@@ -13166,7 +13209,7 @@ function Yd({ task: e }) {
13166
13209
  })]
13167
13210
  });
13168
13211
  }
13169
- function Xd({ commit: e }) {
13212
+ function sf({ commit: e }) {
13170
13213
  let t = e.adds != null || e.dels != null || e.files != null ? `+${e.adds ?? 0} −${e.dels ?? 0}${e.files == null ? "" : `, ${e.files} files`}` : null;
13171
13214
  return /* @__PURE__ */ x("div", {
13172
13215
  className: "marker txn-checkpoint",
@@ -13197,8 +13240,8 @@ function Xd({ commit: e }) {
13197
13240
  ]
13198
13241
  });
13199
13242
  }
13200
- function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThemeChange: o, graphSlot: s, activeTab: l, onTabChange: d, viewMode: g, onViewModeChange: C, leftRailOpen: w, onLeftRailOpenChange: T, rightRailOpen: E, onRightRailOpenChange: D, openTools: O, onOpenToolsChange: k, earlierHistoryOpen: A, onEarlierHistoryOpenChange: j, initialPosition: M, activeTurn: N, onActiveTurnChange: P, search: I, onSearchChange: R, filters: V, onFiltersChange: ee, savedLabels: te, onSavedLabelsChange: ne, shareOpen: re, onShareOpenChange: ie, moreOpen: ae, onMoreOpenChange: oe, breadcrumb: se, LinkComponent: ue, renderTurnPanel: de, renderTurnActions: H, anchorHref: fe, headerActions: me, streamPrelude: ge, showTail: _e = !1, showOutcome: ve = !0, showSearchTrigger: U = !1, pullRequests: xe }) {
13201
- let W = e, Ce = p(), G = n ?? {}, [we] = zd(a, o, "dark"), [K, Te] = zd(l, d, "trace"), [q, Ee] = zd(g, C, "list"), [De, Oe] = zd(w, T, !0), [Me, Pe] = zd(E, D, !0), [Fe, Ie] = zd(O, k, {}), [Le, ze] = zd(A, j, {}), [Be, Ve] = zd(N, P, W?.turns?.[0]?.index ?? 0), [Ye, Xe] = zd(I, R, ""), [J, Ze] = zd(V, ee, Kd), [Qe, $e] = zd(te, ne, {}), [et, nt] = zd(re, ie, !1), [rt, it] = zd(ae, oe, !1);
13243
+ function cf({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThemeChange: o, graphSlot: s, activeTab: l, onTabChange: d, viewMode: g, onViewModeChange: C, leftRailOpen: w, onLeftRailOpenChange: T, rightRailOpen: E, onRightRailOpenChange: D, openTools: O, onOpenToolsChange: k, earlierHistoryOpen: A, onEarlierHistoryOpenChange: j, initialPosition: M, activeTurn: N, onActiveTurnChange: P, search: I, onSearchChange: R, filters: V, onFiltersChange: ee, savedLabels: te, onSavedLabelsChange: ne, shareOpen: re, onShareOpenChange: ie, moreOpen: ae, onMoreOpenChange: oe, breadcrumb: se, LinkComponent: ue, renderTurnPanel: de, renderTurnActions: H, anchorHref: fe, headerActions: me, streamPrelude: ge, showTail: _e = !1, showOutcome: ve = !0, showSearchTrigger: U = !1, pullRequests: xe }) {
13244
+ let W = e, Ce = p(), G = n ?? {}, [we] = Yd(a, o, "dark"), [K, Te] = Yd(l, d, "trace"), [q, Ee] = Yd(g, C, "list"), [De, Oe] = Yd(w, T, !0), [Me, Pe] = Yd(E, D, !0), [Fe, Ie] = Yd(O, k, {}), [Le, ze] = Yd(A, j, {}), [Be, Ve] = Yd(N, P, W?.turns?.[0]?.index ?? 0), [Ye, Xe] = Yd(I, R, ""), [J, Ze] = Yd(V, ee, nf), [Qe, $e] = Yd(te, ne, {}), [et, nt] = Yd(re, ie, !1), [rt, it] = Yd(ae, oe, !1);
13202
13245
  f(() => {
13203
13246
  A === void 0 && ze({});
13204
13247
  }, [W?.session?.id]);
@@ -13222,7 +13265,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13222
13265
  annotationsByTurn: W?.filterIndex?.annotationsByTurn ?? {},
13223
13266
  checkpointTurn: t?.turn ?? null
13224
13267
  };
13225
- return X.map((e) => Zu(e, J, n)).filter((e) => e != null);
13268
+ return X.map((e) => sd(e, J, n)).filter((e) => e != null);
13226
13269
  }, [
13227
13270
  X,
13228
13271
  J,
@@ -13293,7 +13336,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13293
13336
  _n,
13294
13337
  Te
13295
13338
  ]), yn = u((e) => {
13296
- let t = Bt.current, n = e.kind === "turn" ? zt.current[e.turnIndex] : null, r = Md(e, {
13339
+ let t = Bt.current, n = e.kind === "turn" ? zt.current[e.turnIndex] : null, r = Hd(e, {
13297
13340
  authoritativeTurnIndices: X.map((e) => e.index),
13298
13341
  renderedTurnIndices: Z.map((e) => e.index),
13299
13342
  viewReady: K === "trace" && q === "list",
@@ -13316,7 +13359,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13316
13359
  ]), bn = u((e) => {
13317
13360
  let t = Jt.current ?? Lt;
13318
13361
  if (!t || t.sessionId !== (Y?.id ?? "") || e.requestKey !== t.requestKey) return "discarded";
13319
- let n = Bt.current, r = Md(e, {
13362
+ let n = Bt.current, r = Hd(e, {
13320
13363
  authoritativeTurnIndices: X.map((e) => e.index),
13321
13364
  renderedTurnIndices: Z.map((e) => e.index),
13322
13365
  viewReady: K === "trace" && q === "list",
@@ -13338,7 +13381,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13338
13381
  q,
13339
13382
  Z
13340
13383
  ]);
13341
- Ld({
13384
+ qd({
13342
13385
  sessionId: Y?.id,
13343
13386
  initialPosition: M,
13344
13387
  legacyInitialPosition: N == null ? null : {
@@ -13352,7 +13395,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13352
13395
  Z
13353
13396
  ],
13354
13397
  apply: yn
13355
- }), Ld({
13398
+ }), qd({
13356
13399
  sessionId: Y?.id,
13357
13400
  initialPosition: Lt?.restoreRequested ? {
13358
13401
  kind: "top",
@@ -13369,7 +13412,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13369
13412
  apply: bn
13370
13413
  });
13371
13414
  let xn = h(() => ({
13372
- categories: Qu(X),
13415
+ categories: cd(X),
13373
13416
  toolGroups: ln
13374
13417
  }), [X, ln]), Sn = +!J.categories.prompts + +!J.categories.responses + +!J.categories.thinking + +!J.categories.toolcalls + +!!J.tags.errors + +!!J.tags.retries + +!!J.tags.revert + (J.categories.toolcalls ? Object.values(J.toolGroups).filter((e) => !e).length : 0), Cn = h(() => {
13375
13418
  if (!Ye.trim()) return [];
@@ -13401,7 +13444,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13401
13444
  if (t && n) {
13402
13445
  let e = typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
13403
13446
  n.scrollTo({
13404
- top: qd(n, t),
13447
+ top: rf(n, t),
13405
13448
  behavior: e ? "auto" : "smooth"
13406
13449
  });
13407
13450
  }
@@ -13437,7 +13480,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13437
13480
  }), r.onLabel && r.onLabel(ft, n), pt(null);
13438
13481
  }
13439
13482
  function An(e) {
13440
- let t = e.scrollTop > Bd;
13483
+ let t = e.scrollTop > Xd;
13441
13484
  ht(t);
13442
13485
  let n = Vt.current;
13443
13486
  n && n.offsetHeight > 0 && !n.closest(".txn-app-condensed") && (Ht.current = n.offsetHeight);
@@ -13446,7 +13489,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13446
13489
  }
13447
13490
  function jn() {
13448
13491
  let e = Bt.current;
13449
- e && (qt.current = mn(), An(e), Ve(rd(Z, (e) => zt.current[e]?.offsetTop ?? Infinity, e.scrollTop + e.clientHeight * .4)));
13492
+ e && (qt.current = mn(), An(e), Ve(pd(Z, (e) => zt.current[e]?.offsetTop ?? Infinity, e.scrollTop + e.clientHeight * .4)));
13450
13493
  }
13451
13494
  function Mn(e) {
13452
13495
  e.edited ? vn("diffs") : Tn(e.turn ?? 0);
@@ -13456,20 +13499,20 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13456
13499
  if (!a) return;
13457
13500
  let o = zt.current[a.index], s = Bt.current;
13458
13501
  o && s && (s.scrollTo({
13459
- top: qd(s, o),
13502
+ top: rf(s, o),
13460
13503
  behavior: "auto"
13461
13504
  }), Ve(a.index));
13462
13505
  }
13463
13506
  let Pn = (e) => {
13464
- let t = Vd.indexOf(K);
13507
+ let t = Zd.indexOf(K);
13465
13508
  if (t < 0) return;
13466
13509
  let n = t;
13467
- if (e.key === "ArrowRight" || e.key === "ArrowDown") n = (t + 1) % Vd.length;
13468
- else if (e.key === "ArrowLeft" || e.key === "ArrowUp") n = (t - 1 + Vd.length) % Vd.length;
13510
+ if (e.key === "ArrowRight" || e.key === "ArrowDown") n = (t + 1) % Zd.length;
13511
+ else if (e.key === "ArrowLeft" || e.key === "ArrowUp") n = (t - 1 + Zd.length) % Zd.length;
13469
13512
  else if (e.key === "Home") n = 0;
13470
- else if (e.key === "End") n = Vd.length - 1;
13513
+ else if (e.key === "End") n = Zd.length - 1;
13471
13514
  else return;
13472
- e.preventDefault(), gn(), vn(Vd[n]), Gt.current[Vd[n]]?.focus();
13515
+ e.preventDefault(), gn(), vn(Zd[n]), Gt.current[Zd[n]]?.focus();
13473
13516
  };
13474
13517
  function Fn() {
13475
13518
  xt(!0), vn("trace"), Ot((e) => e + 1), setTimeout(() => Ut.current?.focus(), 0);
@@ -13511,7 +13554,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13511
13554
  if (e && t) {
13512
13555
  let n = typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
13513
13556
  t.scrollTo({
13514
- top: qd(t, e),
13557
+ top: rf(t, e),
13515
13558
  behavior: n ? "auto" : "smooth"
13516
13559
  }), Ve(kt.turn);
13517
13560
  }
@@ -13526,12 +13569,12 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13526
13569
  let e = /* @__PURE__ */ new Map();
13527
13570
  for (let t of rn) e.has(t.path) || e.set(t.path, []), e.get(t.path).push(t);
13528
13571
  return [...e.entries()];
13529
- }, [rn]), zn = sn.filter((e) => e.turn != null), Bn = sn.filter((e) => e.turn == null), Vn = Y.title ?? (Y.hasNormalizedEvidence ? void 0 : tn[0]?.prompt ?? X.find((e) => e.role === "user")?.content) ?? Y.id ?? "transcript", Hn = (Vn.codePointAt(158) ?? 0) > 65535 ? 158 : 159, Un = Vn.length > 160 ? Vn.slice(0, Hn).trimEnd() + "…" : Vn, Wn = /* @__PURE__ */ b("div", {
13572
+ }, [rn]), zn = sn.filter((e) => e.turn != null), Bn = sn.filter((e) => e.turn == null), Vn = Y.title ?? (Y.hasNormalizedEvidence ? void 0 : tn[0]?.prompt ?? X.find((e) => e.role === "user")?.content) ?? Y.id ?? "transcript", Hn = (Vn.codePointAt(158) ?? 0) > 65535 ? 158 : 159, Un = Vn.length > 160 ? Vn.slice(0, Hn).trimEnd() + "…" : Vn, Wn = K === "trace" || K === "highlights", Gn = /* @__PURE__ */ b("div", {
13530
13573
  className: "tabs txn-tabs",
13531
13574
  role: "tablist",
13532
13575
  "aria-label": "session views",
13533
13576
  onKeyDown: Pn,
13534
- children: Vd.map((e) => {
13577
+ children: Zd.map((e) => {
13535
13578
  let t = K === e, n = e === "highlights" ? an.length : e === "trace" ? X.length : e === "diffs" ? rn.length : e === "files" ? nn.length : cn.length;
13536
13579
  return /* @__PURE__ */ x("button", {
13537
13580
  ref: (t) => Gt.current[e] = t,
@@ -13547,7 +13590,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13547
13590
  },
13548
13591
  onClick: () => vn(e),
13549
13592
  children: [
13550
- Hd[e],
13593
+ Qd[e],
13551
13594
  " ",
13552
13595
  /* @__PURE__ */ b("span", {
13553
13596
  className: "cnt tnum",
@@ -13585,13 +13628,14 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13585
13628
  return /* @__PURE__ */ x(c, { children: [t > 0 && /* @__PURE__ */ b(z, {
13586
13629
  size: 14,
13587
13630
  "aria-hidden": "true"
13588
- }), !i && e.href != null ? /* @__PURE__ */ b(r, {
13631
+ }), e.href == null ? /* @__PURE__ */ b("span", {
13632
+ className: i ? "cur" : "link",
13633
+ "aria-current": i ? "page" : void 0,
13634
+ children: e.label
13635
+ }) : /* @__PURE__ */ b(r, {
13589
13636
  className: "link",
13590
13637
  href: e.href,
13591
13638
  children: e.label
13592
- }) : /* @__PURE__ */ b("span", {
13593
- className: i ? "cur" : "link",
13594
- children: e.label
13595
13639
  })] }, `${e.label}-${t}`);
13596
13640
  })
13597
13641
  }), /* @__PURE__ */ x("div", {
@@ -13755,7 +13799,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13755
13799
  role: "region",
13756
13800
  "aria-label": "session metadata",
13757
13801
  children: [
13758
- ve && Y.outcome && /* @__PURE__ */ b(qu, { outcome: Y.outcome }),
13802
+ ve && Y.outcome && /* @__PURE__ */ b(rd, { outcome: Y.outcome }),
13759
13803
  Y.harness && /* @__PURE__ */ x("span", {
13760
13804
  className: "chip",
13761
13805
  children: [
@@ -13845,7 +13889,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13845
13889
  }),
13846
13890
  !W.usageScopes?.length && Y.totalTokens != null && /* @__PURE__ */ x(Ti, {
13847
13891
  className: "metaitem",
13848
- def: Rd(Y.tokensIn ?? 0) + " input tokens, " + Rd(Y.tokensOut ?? 0) + " output tokens",
13892
+ def: Jd(Y.tokensIn ?? 0) + " input tokens, " + Jd(Y.tokensOut ?? 0) + " output tokens",
13849
13893
  children: [
13850
13894
  /* @__PURE__ */ b(le, {
13851
13895
  size: 14,
@@ -13854,7 +13898,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13854
13898
  " ",
13855
13899
  /* @__PURE__ */ b("b", {
13856
13900
  className: "tnum",
13857
- children: Rd(Y.totalTokens)
13901
+ children: Jd(Y.totalTokens)
13858
13902
  }),
13859
13903
  " tokens"
13860
13904
  ]
@@ -13875,43 +13919,49 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13875
13919
  sn.length === 1 ? "commit" : "commits"
13876
13920
  ]
13877
13921
  }),
13878
- Y.git?.filesChanged != null && /* @__PURE__ */ x("span", {
13879
- className: "metaitem",
13880
- children: [
13881
- /* @__PURE__ */ b(ye, {
13882
- size: 14,
13883
- "aria-hidden": "true"
13884
- }),
13885
- " ",
13886
- /* @__PURE__ */ b("b", {
13887
- className: "tnum",
13888
- children: Y.git.filesChanged
13889
- }),
13890
- " ",
13891
- Y.git.filesChanged === 1 ? "file" : "files"
13892
- ]
13893
- }),
13894
- Y.git && (Y.git.insertions != null || Y.git.deletions != null) && /* @__PURE__ */ x("span", {
13895
- className: "metaitem txn-churn-meta tnum",
13896
- children: [
13897
- /* @__PURE__ */ x("span", {
13898
- className: "txn-churn-add",
13899
- children: ["+", Y.git.insertions ?? 0]
13900
- }),
13901
- " ",
13902
- /* @__PURE__ */ x("span", {
13903
- className: "txn-churn-del",
13904
- children: ["−", Y.git.deletions ?? 0]
13905
- })
13906
- ]
13907
- })
13922
+ (() => {
13923
+ let e = Y.git && (Y.git.insertions != null || Y.git.deletions != null) ? /* @__PURE__ */ x("span", {
13924
+ className: "txn-churn-meta tnum",
13925
+ children: [
13926
+ /* @__PURE__ */ x("span", {
13927
+ className: "txn-churn-add",
13928
+ children: ["+", Y.git.insertions ?? 0]
13929
+ }),
13930
+ " ",
13931
+ /* @__PURE__ */ x("span", {
13932
+ className: "txn-churn-del",
13933
+ children: ["−", Y.git.deletions ?? 0]
13934
+ })
13935
+ ]
13936
+ }) : null;
13937
+ return Y.git?.filesChanged == null ? e ? /* @__PURE__ */ b("span", {
13938
+ className: "metaitem",
13939
+ children: e
13940
+ }) : null : /* @__PURE__ */ x("span", {
13941
+ className: "metaitem txn-files-meta",
13942
+ children: [
13943
+ /* @__PURE__ */ b(ye, {
13944
+ size: 14,
13945
+ "aria-hidden": "true"
13946
+ }),
13947
+ " ",
13948
+ /* @__PURE__ */ b("b", {
13949
+ className: "tnum",
13950
+ children: Y.git.filesChanged
13951
+ }),
13952
+ " ",
13953
+ Y.git.filesChanged === 1 ? "file" : "files",
13954
+ e ? /* @__PURE__ */ x(y, { children: [" ", e] }) : null
13955
+ ]
13956
+ });
13957
+ })()
13908
13958
  ]
13909
13959
  }),
13910
13960
  xe != null && /* @__PURE__ */ b("div", {
13911
13961
  className: "txn-prs",
13912
13962
  children: xe
13913
13963
  }),
13914
- /* @__PURE__ */ b(zu, { scopes: W.usageScopes })
13964
+ /* @__PURE__ */ b(Ju, { scopes: W.usageScopes })
13915
13965
  ]
13916
13966
  }),
13917
13967
  yt && /* @__PURE__ */ x("div", {
@@ -13979,7 +14029,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
13979
14029
  }),
13980
14030
  U ? /* @__PURE__ */ x("div", {
13981
14031
  className: "txn-tabbar",
13982
- children: [Wn, /* @__PURE__ */ x("button", {
14032
+ children: [Gn, /* @__PURE__ */ x("button", {
13983
14033
  type: "button",
13984
14034
  className: "btn btn-secondary txn-search-trigger",
13985
14035
  "aria-keyshortcuts": "Meta+F Control+F",
@@ -14000,11 +14050,11 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14000
14050
  })
14001
14051
  ]
14002
14052
  })]
14003
- }) : Wn,
14053
+ }) : Gn,
14004
14054
  /* @__PURE__ */ x("div", {
14005
14055
  className: "txn-body-grid",
14006
14056
  "data-left-rail": De ? "open" : "closed",
14007
- "data-right-rail": Me ? "open" : "closed",
14057
+ "data-right-rail": Wn ? Me ? "open" : "closed" : "none",
14008
14058
  children: [
14009
14059
  De ? /* @__PURE__ */ x("aside", {
14010
14060
  className: "txn-rail txn-rail-left",
@@ -14032,7 +14082,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14032
14082
  }), /* @__PURE__ */ b("div", {
14033
14083
  className: "txn-rail-body",
14034
14084
  id: "txn-rail-left-body",
14035
- children: /* @__PURE__ */ b(cd, {
14085
+ children: /* @__PURE__ */ b(vd, {
14036
14086
  viewModel: W,
14037
14087
  tab: K,
14038
14088
  onJump: (e) => Tn(e, { switchTab: !1 })
@@ -14075,7 +14125,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14075
14125
  className: "txn-sticky-model mono",
14076
14126
  children: un
14077
14127
  }),
14078
- /* @__PURE__ */ b(hd, {
14128
+ /* @__PURE__ */ b(Td, {
14079
14129
  turns: X,
14080
14130
  active: Be,
14081
14131
  onSeek: Nn,
@@ -14158,7 +14208,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14158
14208
  className: "txn-stream-prelude",
14159
14209
  children: ge
14160
14210
  }),
14161
- /* @__PURE__ */ b(id, {
14211
+ /* @__PURE__ */ b(md, {
14162
14212
  relationships: W.relationships,
14163
14213
  earlierHistory: W.earlierHistory,
14164
14214
  onNavigate: r.onNavigateRelationship,
@@ -14187,9 +14237,9 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14187
14237
  Z.map((e, t) => {
14188
14238
  let n = Z[t - 1], r = en.find((t) => e.index >= t.from && e.index <= t.to), i = n ? en.find((e) => n.index >= e.from && n.index <= e.to) : null, a = J.views.hidden && r && (!i || i.id !== r.id), o = dn.get(e.index), s = zn.filter((t) => t.turn === e.index);
14189
14239
  return /* @__PURE__ */ x("div", { children: [
14190
- a && /* @__PURE__ */ b(Jd, { phase: r }),
14191
- e.role === "user" && o && /* @__PURE__ */ b(Yd, { task: o }),
14192
- /* @__PURE__ */ b(Gu, {
14240
+ a && /* @__PURE__ */ b(af, { phase: r }),
14241
+ e.role === "user" && o && /* @__PURE__ */ b(of, { task: o }),
14242
+ /* @__PURE__ */ b(td, {
14193
14243
  turn: e,
14194
14244
  active: Be === e.index,
14195
14245
  revealRequest: kt?.turn === e.index ? kt.sequence : 0,
@@ -14205,10 +14255,10 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14205
14255
  expandAll: J.views.expandAll
14206
14256
  }),
14207
14257
  de ? de(e) : null,
14208
- s.map((e) => /* @__PURE__ */ b(Xd, { commit: e }, e.hash))
14258
+ s.map((e) => /* @__PURE__ */ b(sf, { commit: e }, e.hash))
14209
14259
  ] }, e.identity ?? e.index);
14210
14260
  }),
14211
- Bn.map((e) => /* @__PURE__ */ b(Xd, { commit: e }, e.hash))
14261
+ Bn.map((e) => /* @__PURE__ */ b(sf, { commit: e }, e.hash))
14212
14262
  ]
14213
14263
  })
14214
14264
  })
@@ -14216,10 +14266,10 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14216
14266
  }),
14217
14267
  K === "highlights" && /* @__PURE__ */ x("div", {
14218
14268
  className: "txn-highlights",
14219
- children: [/* @__PURE__ */ b(vd, { bands: on }), /* @__PURE__ */ b("div", {
14269
+ children: [/* @__PURE__ */ b(Od, { bands: on }), /* @__PURE__ */ b("div", {
14220
14270
  className: "txn-hl-cards",
14221
14271
  children: an.map((e) => {
14222
- let t = Wd[e.kind] ?? dt, n = e.kind === "checkpoint";
14272
+ let t = ef[e.kind] ?? dt, n = e.kind === "checkpoint";
14223
14273
  return /* @__PURE__ */ x("button", {
14224
14274
  type: "button",
14225
14275
  className: "txn-hl-card" + (n ? " txn-hl-static" : ""),
@@ -14376,14 +14426,14 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14376
14426
  ]
14377
14427
  })
14378
14428
  ]
14379
- }), i && t.map((e, t) => /* @__PURE__ */ b(Cu, {
14429
+ }), i && t.map((e, t) => /* @__PURE__ */ b(Mu, {
14380
14430
  entry: e,
14381
14431
  onJump: () => e.turn != null && Tn(e.turn)
14382
14432
  }, t))]
14383
14433
  }, e);
14384
14434
  }) : /* @__PURE__ */ b("div", {
14385
14435
  className: "txn-difflist",
14386
- children: rn.map((e, t) => /* @__PURE__ */ b(Cu, {
14436
+ children: rn.map((e, t) => /* @__PURE__ */ b(Mu, {
14387
14437
  entry: e,
14388
14438
  byTurn: !0,
14389
14439
  onJump: () => e.turn != null && Tn(e.turn)
@@ -14494,7 +14544,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14494
14544
  className: "txn-anno-intro",
14495
14545
  children: "auto-detected friction moments: tool errors and non-zero exits, retry loops, edits that re-touch a file, and subagent spawns. click a row to jump to the turn."
14496
14546
  }), cn.map((e) => {
14497
- let n = Gd[e.kind] ?? {
14547
+ let n = tf[e.kind] ?? {
14498
14548
  label: e.kind,
14499
14549
  icon: S,
14500
14550
  chip: "",
@@ -14545,7 +14595,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14545
14595
  })
14546
14596
  ]
14547
14597
  }),
14548
- Me ? /* @__PURE__ */ x("aside", {
14598
+ Wn ? Me ? /* @__PURE__ */ x("aside", {
14549
14599
  className: "txn-rail txn-rail-right",
14550
14600
  "aria-label": "filters",
14551
14601
  children: [/* @__PURE__ */ x("div", {
@@ -14575,7 +14625,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14575
14625
  }), /* @__PURE__ */ b("div", {
14576
14626
  className: "txn-rail-body",
14577
14627
  id: "txn-rail-right-body",
14578
- children: /* @__PURE__ */ b(md, {
14628
+ children: /* @__PURE__ */ b(wd, {
14579
14629
  tab: K,
14580
14630
  filters: J,
14581
14631
  onFiltersChange: Ze,
@@ -14583,7 +14633,7 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14583
14633
  checkpoints: sn,
14584
14634
  filtersActive: Sn,
14585
14635
  onClear: () => Ze({
14586
- ...Kd,
14636
+ ...nf,
14587
14637
  toolGroups: Object.fromEntries(gc.map((e) => [e, !0]))
14588
14638
  }),
14589
14639
  onJumpStart: () => Tn(Z[0]?.index ?? 0, { switchTab: !1 }),
@@ -14609,10 +14659,10 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14609
14659
  }) : null]
14610
14660
  })]
14611
14661
  })
14612
- })
14662
+ }) : null
14613
14663
  ]
14614
14664
  }),
14615
- fn && ft != null && /* @__PURE__ */ b(xd, {
14665
+ fn && ft != null && /* @__PURE__ */ b(jd, {
14616
14666
  turnId: ft,
14617
14667
  current: Qe[ft],
14618
14668
  onSave: kn,
@@ -14657,4 +14707,4 @@ function Zd({ viewModel: e, capabilities: n, callbacks: r = {}, theme: a, onThem
14657
14707
  });
14658
14708
  }
14659
14709
  //#endregion
14660
- export { gc as $, Bn as $n, Ma as $t, Eu as A, $r as An, dn as Ar, ms as At, Bl as B, Qn as Bn, Wo as Bt, ud as C, mi as Cn, hn as Cr, Ds as Ct, Gu as D, ni as Dn, cn as Dr, gs as Dt, qu as E, ai as En, mn as Er, ys as Et, cu as F, vr as Fn, es as Ft, Ac as G, sr as Gn, oo as Gt, Pl as H, pr as Hn, Po as Ht, su as I, Cr as In, ts as It, ml as J, Zn as Jn, lo as Jt, hl as K, or as Kn, ao as Kt, ou as L, Sr as Ln, Jo as Lt, Su as M, Wr as Mn, is as Mt, xu as N, kr as Nn, rs as Nt, Hu as O, ei as On, un as Or, _s as Ot, bu as P, Ar as Pn, ss as Pt, Fc as Q, Vn as Qn, La as Qt, iu as R, xr as Rn, Ro as Rt, dd as S, xi as Sn, vn as Sr, Ls as St, cd as T, pi as Tn, Z as Tr, xs as Tt, Nc as U, cr as Un, Do as Ut, Ml as V, fr as Vn, Ho as Vt, ul as W, ar as Wn, co as Wt, Oc as X, Yn as Xn, Ba as Xt, Ec as Y, Xn as Yn, no as Yt, Qc as Z, Hn as Zn, Va as Zt, Nd as _, Li as _n, Cn as _r, js as _t, Rt as a, Sa as an, Pn as ar, fc as at, hd as b, wi as bn, yn as br, ks as bt, Bt as c, ya as cn, An as cr, ic as ct, Ld as d, qi as dn, Dn as dr, $s as dt, ka as en, zn as er, dc as et, Id as f, Ki as fn, En as fr, Qs as ft, Md as g, Ri as gn, xn as gr, Hs as gt, Fd as h, zi as hn, bn as hr, Js as ht, jt as i, Ta as in, Rn as ir, pc as it, Cu as j, Zr as jn, fs as jt, Lu as k, Yr as kn, fn as kr, hs as kt, Ht as l, ba as ln, jn as lr, oc as lt, jd as m, Wi as mn, Tn as mr, Ys as mt, Dt as n, Oa as nn, Fn as nr, uc as nt, Y as o, Ji as on, On as or, lc as ot, Ad as p, Ui as pn, wn as pr, zs as pt, el as q, lr as qn, so as qt, At as r, Ea as rn, Ln as rr, mc as rt, X as s, xa as sn, kn as sr, cc as st, Et as t, Da as tn, In as tr, hc as tt, Zd as u, Gi as un, Mn as ur, tc as ut, xd as v, Pi as vn, Sn as vr, Ms as vt, ld as w, hi as wn, pn as wr, Ss as wt, md as x, Ti as xn, _n as xr, Os as xt, vd as y, Ii as yn, gn as yr, Ns as yt, eu as z, ir as zn, Vo as zt };
14710
+ export { Rc as $, Hn as $n, Va as $t, Fu as A, ei as An, un as Ar, _s as At, jl as B, xr as Bn, Ro as Bt, bd as C, Ti as Cn, _n as Cr, Os as Ct, td as D, pi as Dn, Z as Dr, xs as Dt, rd as E, hi as En, pn as Er, Ss as Et, Su as F, kr as Fn, rs as Ft, pl as G, cr as Gn, Do as Gt, kl as H, Qn as Hn, Wo as Ht, vu as I, Ar as In, ss as It, rl as J, or as Jn, ao as Jt, Nc as K, ar as Kn, co as Kt, Zl as L, vr as Ln, es as Lt, ju as M, $r as Mn, dn as Mr, ms as Mt, Au as N, Zr as Nn, fs as Nt, Zu as O, ai as On, mn as Or, ys as Ot, ku as P, Wr as Pn, is as Pt, tl as Q, Yn as Qn, Ba as Qt, $l as R, Cr as Rn, ts as Rt, xd as S, wi as Sn, yn as Sr, ks as St, vd as T, mi as Tn, hn as Tr, Ds as Tt, Dl as U, fr as Un, Ho as Ut, Al as V, ir as Vn, Vo as Vt, Ic as W, pr as Wn, Po as Wt, kc as X, Zn as Xn, lo as Xt, _l as Y, lr as Yn, so as Yt, jc as Z, Xn as Zn, no as Zt, Ud as _, zi as _n, bn as _r, Js as _t, Rt as a, Ea as an, Ln as ar, mc as at, Td as b, Pi as bn, Sn as br, Ms as bt, Bt as c, Ji as cn, On as cr, lc as ct, qd as d, ba as dn, jn as dr, oc as dt, La as en, Vn as er, Tc as et, Kd as f, Gi as fn, Mn as fr, tc as ft, Hd as g, Wi as gn, Tn as gr, Ys as gt, Gd as h, Ui as hn, wn as hr, zs as ht, jt as i, Oa as in, Fn as ir, uc as it, Mu as j, Yr as jn, fn as jr, hs as jt, Ku as k, ni as kn, cn as kr, gs as kt, Ht as l, xa as ln, kn as lr, cc as lt, Vd as m, Ki as mn, En as mr, Qs as mt, Dt as n, ka as nn, zn as nr, dc as nt, Y as o, Ta as on, Rn as or, pc as ot, Bd as p, qi as pn, Dn as pr, $s as pt, vl as q, sr as qn, oo as qt, At as r, Da as rn, In as rr, hc as rt, X as s, Sa as sn, Pn as sr, fc as st, Et as t, Ma as tn, Bn as tr, gc as tt, cf as u, ya as un, An as ur, ic as ut, jd as v, Ri as vn, xn as vr, Hs as vt, yd as w, xi as wn, vn as wr, Ls as wt, wd as x, Ii as xn, gn as xr, Ns as xt, Od as y, Li as yn, Cn as yr, js as yt, Ol as z, Sr as zn, Jo as zt };