@peasant-labs/fairtrade 0.0.16 → 0.0.17

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 { An as e, At as t, Dt as n, Et as r, Fn as i, In as a, Ln as o, Nn as s, Q as c, Tt as l, _n as u, et as d, it as f, jt as p, kt as m, nt as h, pn as g, tt as _ } from "./ui-CLo_683m.js";
1
+ import { An as e, At as t, Dt as n, Et as r, Fn as i, In as a, Ln as o, Nn as s, Q as c, Tt as l, _n as u, et as d, it as f, jt as p, kt as m, nt as h, pn as g, tt as _ } from "./ui-yIg-1YXY.js";
2
2
  import { gt as v, it as y, ot as b } from "./InUseShell-CY5Acw6t.js";
3
3
  import { useEffect as x, useId as S, useMemo as C, useRef as w, useState as T } from "react";
4
4
  import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
@@ -1,13 +1,15 @@
1
1
  /**
2
2
  * @param {object} props
3
3
  * @param {boolean} [props.checked]
4
+ * @param {boolean} [props.indeterminate] render the tri-state 'mixed' box (some children on)
4
5
  * @param {Function} [props.onChange] fired with the native change event
5
6
  * @param {*} [props.children] the row label (text, or icon + text)
6
7
  * @param {number} [props.count] optional trailing match count
7
8
  * @param {boolean} [props.disabled]
8
9
  */
9
- export default function CheckRow({ checked, onChange, children, count, disabled }: {
10
+ export default function CheckRow({ checked, indeterminate, onChange, children, count, disabled }: {
10
11
  checked?: boolean;
12
+ indeterminate?: boolean;
11
13
  onChange?: Function;
12
14
  children?: any;
13
15
  count?: number;
@@ -0,0 +1,127 @@
1
+ /** @typedef {import('./view-model.js').TurnVM} TurnVM */
2
+ /** @typedef {import('./view-model.js').ToolGroup} ToolGroup */
3
+ /** @typedef {import('./state-capabilities.js').TranscriptFilters} TranscriptFilters */
4
+ /** @typedef {'prompts' | 'responses' | 'thinking' | 'toolcalls'} Category */
5
+ /**
6
+ * Every part kind a cooked turn carries, in rail order. Empty for turns no
7
+ * category governs (system notices). A turn with text and tool calls reports
8
+ * both; the rail badges count turns per kind from this.
9
+ *
10
+ * @param {TurnVM} turn
11
+ * @returns {Category[]}
12
+ */
13
+ export function kindsOf(turn: TurnVM): Category[];
14
+ /**
15
+ * Semantic tags NARROW: with none checked every turn passes; with one or more
16
+ * checked a turn must carry at least one of them. `annotationsByTurn` is the
17
+ * adapter's index (`vm.filterIndex.annotationsByTurn`).
18
+ *
19
+ * @param {TurnVM} turn
20
+ * @param {{ errors?: boolean, retries?: boolean, revert?: boolean }} tags
21
+ * @param {Record<number, {kind?: string}[]>} annotationsByTurn
22
+ */
23
+ export function passesTags(turn: TurnVM, tags: {
24
+ errors?: boolean;
25
+ retries?: boolean;
26
+ revert?: boolean;
27
+ }, annotationsByTurn: Record<number, {
28
+ kind?: string;
29
+ }[]>): boolean;
30
+ /**
31
+ * The per-turn projection: the turn with every hidden part removed, or `null`
32
+ * when nothing would be left to render. Tags narrow at the turn level, the
33
+ * checkpoint anchor scopes to a prefix, and then each part is kept or dropped
34
+ * by its own category (tool calls also by their group). System turns carry no
35
+ * governed parts and pass the category stage untouched.
36
+ *
37
+ * The returned object keeps `index`, `role`, labels and annotations, so
38
+ * anchors, jumps and the outline resolve against it exactly as against the
39
+ * original; only `content`, `thinking` and `toolCalls` change.
40
+ *
41
+ * @param {TurnVM} turn
42
+ * @param {TranscriptFilters} filters
43
+ * @param {object} [ctx]
44
+ * @param {Record<number, {kind?: string}[]>} [ctx.annotationsByTurn]
45
+ * @param {number | null} [ctx.checkpointTurn] inclusive upper turn index, or null
46
+ * @returns {TurnVM | null}
47
+ */
48
+ export function projectTurn(turn: TurnVM, filters: TranscriptFilters, ctx?: {
49
+ annotationsByTurn?: Record<number, {
50
+ kind?: string;
51
+ }[]>;
52
+ checkpointTurn?: number | null;
53
+ }): TurnVM | null;
54
+ /**
55
+ * Whether any part of the turn survives the filters. Equivalent to
56
+ * `projectTurn(...) !== null`; kept as the yes/no form for callers that only
57
+ * need membership.
58
+ *
59
+ * @param {TurnVM} turn
60
+ * @param {TranscriptFilters} filters
61
+ * @param {Parameters<typeof projectTurn>[2]} [ctx]
62
+ * @returns {boolean}
63
+ */
64
+ export function matchesFilters(turn: TurnVM, filters: TranscriptFilters, ctx?: Parameters<typeof projectTurn>[2]): boolean;
65
+ /**
66
+ * Turn-based category counts for the rail badges: each badge counts the turns
67
+ * that carry its part kind. A turn with text and tool calls is counted under
68
+ * both, so the badges can sum to more than the turn count; each promises
69
+ * "this many turns contain this".
70
+ * (The previous `toolcalls` badge counted tool CALLS, which only coincidentally
71
+ * matches the turn count when every turn carries exactly one.)
72
+ *
73
+ * @param {TurnVM[]} turns
74
+ * @returns {Record<Category, number>}
75
+ */
76
+ export function categoryCounts(turns: TurnVM[]): Record<Category, number>;
77
+ /**
78
+ * Tri-state for the `tool calls` umbrella: `true` when every group with matches
79
+ * is on, `false` when all are off, `'mixed'` otherwise. Groups with a zero count
80
+ * are IGNORED — the rail disables them, so a permanently-unreachable group must
81
+ * not hold the umbrella in a mixed state the user cannot resolve.
82
+ *
83
+ * @param {Partial<Record<ToolGroup, boolean>>} toolGroups
84
+ * @param {Partial<Record<ToolGroup, number>>} [counts]
85
+ * @returns {true | false | 'mixed'}
86
+ */
87
+ export function toolGroupsState(toolGroups: Partial<Record<ToolGroup, boolean>>, counts?: Partial<Record<ToolGroup, number>>): true | false | "mixed";
88
+ /**
89
+ * The umbrella cascade: setting `tool calls` writes every selectable group to
90
+ * match. Groups with no matches are written too, so re-checking the umbrella
91
+ * cannot leave a hidden `false` behind that would suppress a group the moment a
92
+ * different session gives it matches.
93
+ *
94
+ * @param {boolean} next
95
+ * @returns {Record<ToolGroup, boolean>}
96
+ */
97
+ export function cascadeToolGroups(next: boolean): Record<ToolGroup, boolean>;
98
+ /**
99
+ * Toggling ONE group re-derives the umbrella, so the pair is never contradictory
100
+ * (all seven off while `tool calls` still reads checked). Unchecking the last
101
+ * live group turns the umbrella off; checking any group turns it back on.
102
+ *
103
+ * A state whose umbrella is already off is normalised first: every group is
104
+ * treated as off, whatever the map says. That covers filter state persisted by
105
+ * a consumer before the cascade existed (`toolcalls: false` over an all-true
106
+ * map), where the rail shows every child unchecked and the user's click on ONE
107
+ * child must enable that one, not the other six.
108
+ *
109
+ * @param {TranscriptFilters} filters
110
+ * @param {ToolGroup} id
111
+ * @param {Partial<Record<ToolGroup, number>>} [counts]
112
+ * @returns {TranscriptFilters}
113
+ */
114
+ export function toggleToolGroup(filters: TranscriptFilters, id: ToolGroup, counts?: Partial<Record<ToolGroup, number>>): TranscriptFilters;
115
+ /**
116
+ * Setting the umbrella cascades to the groups in the same update, so the rail
117
+ * never renders a checked child under an unchecked parent.
118
+ *
119
+ * @param {TranscriptFilters} filters
120
+ * @param {boolean} next
121
+ * @returns {TranscriptFilters}
122
+ */
123
+ export function setToolCalls(filters: TranscriptFilters, next: boolean): TranscriptFilters;
124
+ export type TurnVM = import("./view-model.js").TurnVM;
125
+ export type ToolGroup = import("./view-model.js").ToolGroup;
126
+ export type TranscriptFilters = import("./state-capabilities.js").TranscriptFilters;
127
+ export type Category = "prompts" | "responses" | "thinking" | "toolcalls";
@@ -18297,14 +18297,87 @@ function R_({ turn: e, active: i = !1, openTools: a = {}, toggleTool: o = () =>
18297
18297
  });
18298
18298
  }
18299
18299
  //#endregion
18300
- //#region src/ui/transcript/OutlineRail.jsx
18300
+ //#region src/ui/transcript/filters.js
18301
18301
  var z_ = {
18302
+ errors: "error",
18303
+ retries: "retry",
18304
+ revert: "revert"
18305
+ };
18306
+ function B_(e) {
18307
+ if (e.role === "user") return ["prompts"];
18308
+ if (e.role !== "assistant") return [];
18309
+ let t = [];
18310
+ 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"];
18311
+ }
18312
+ function V_(e, t, n) {
18313
+ let r = Object.keys(z_).filter((e) => t[e]).map((e) => z_[e]);
18314
+ 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));
18315
+ }
18316
+ function H_(e, t, n = {}) {
18317
+ let { categories: r, toolGroups: i = {}, tags: a = {} } = t, { annotationsByTurn: o = {}, checkpointTurn: s = null } = n;
18318
+ if (s != null && e.index > s || !V_(e, a, o)) return null;
18319
+ if (e.role === "user") return r.prompts ? e : null;
18320
+ if (e.role !== "assistant") return e;
18321
+ 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) : [];
18322
+ return !c && !l && u.length === 0 ? r.responses ? e : null : !d && !f && p.length === 0 ? null : d === c && f === l && p.length === u.length ? e : {
18323
+ ...e,
18324
+ content: d ? e.content : "",
18325
+ thinking: f ? e.thinking : void 0,
18326
+ toolCalls: p
18327
+ };
18328
+ }
18329
+ function U_(e) {
18330
+ let t = {
18331
+ prompts: 0,
18332
+ responses: 0,
18333
+ thinking: 0,
18334
+ toolcalls: 0
18335
+ };
18336
+ for (let n of e) for (let e of B_(n)) t[e] += 1;
18337
+ return t;
18338
+ }
18339
+ function W_(e, t = {}) {
18340
+ let n = eo.filter((e) => (t[e] ?? 0) > 0);
18341
+ if (n.length === 0) return !0;
18342
+ let r = n.filter((t) => e[t] !== !1);
18343
+ return r.length === n.length ? !0 : r.length === 0 ? !1 : "mixed";
18344
+ }
18345
+ function G_(e) {
18346
+ return Object.fromEntries(eo.map((t) => [t, e]));
18347
+ }
18348
+ function K_(e, t, n = {}) {
18349
+ let r = e.categories?.toolcalls === !1 ? G_(!1) : { ...e.toolGroups }, i = {
18350
+ ...r,
18351
+ [t]: r[t] === !1
18352
+ };
18353
+ return {
18354
+ ...e,
18355
+ toolGroups: i,
18356
+ categories: {
18357
+ ...e.categories,
18358
+ toolcalls: W_(i, n) !== !1
18359
+ }
18360
+ };
18361
+ }
18362
+ function q_(e, t) {
18363
+ return {
18364
+ ...e,
18365
+ categories: {
18366
+ ...e.categories,
18367
+ toolcalls: t
18368
+ },
18369
+ toolGroups: G_(t)
18370
+ };
18371
+ }
18372
+ //#endregion
18373
+ //#region src/ui/transcript/OutlineRail.jsx
18374
+ var J_ = {
18302
18375
  request: Ge,
18303
18376
  phase: be,
18304
18377
  error: x,
18305
18378
  checkpoint: Ce,
18306
18379
  final: at
18307
- }, B_ = {
18380
+ }, Y_ = {
18308
18381
  error: {
18309
18382
  label: "error",
18310
18383
  icon: x,
@@ -18325,13 +18398,13 @@ var z_ = {
18325
18398
  icon: de,
18326
18399
  tip: "a Task spawned a nested subagent at depth > 0"
18327
18400
  }
18328
- }, V_ = [
18401
+ }, X_ = [
18329
18402
  "error",
18330
18403
  "retry",
18331
18404
  "revert",
18332
18405
  "subagent"
18333
18406
  ];
18334
- function H_({ viewModel: e, tab: t, onJump: n = () => {} }) {
18407
+ function Z_({ viewModel: e, tab: t, onJump: n = () => {} }) {
18335
18408
  let r = e?.files ?? [], i = e?.highlights ?? [], a = e?.analytics?.patternAnnotations ?? (e?.turns ?? []).flatMap((e) => e.annotations ?? []);
18336
18409
  return t === "diffs" ? /* @__PURE__ */ y("ul", {
18337
18410
  className: "txn-outline",
@@ -18395,7 +18468,7 @@ function H_({ viewModel: e, tab: t, onJump: n = () => {} }) {
18395
18468
  }) : t === "highlights" ? /* @__PURE__ */ y("ul", {
18396
18469
  className: "txn-outline",
18397
18470
  children: i.map((e) => {
18398
- let t = z_[e.kind] ?? P, r = e.kind === "checkpoint";
18471
+ let t = J_[e.kind] ?? P, r = e.kind === "checkpoint";
18399
18472
  return /* @__PURE__ */ y("li", { children: /* @__PURE__ */ b("button", {
18400
18473
  type: "button",
18401
18474
  className: "txn-ol-row",
@@ -18413,10 +18486,10 @@ function H_({ viewModel: e, tab: t, onJump: n = () => {} }) {
18413
18486
  })
18414
18487
  }) : t === "annotations" ? /* @__PURE__ */ y("div", {
18415
18488
  className: "txn-outline-grouped",
18416
- children: V_.map((e) => {
18489
+ children: X_.map((e) => {
18417
18490
  let t = a.filter((t) => t.kind === e);
18418
18491
  if (!t.length) return null;
18419
- let r = B_[e], i = r.icon;
18492
+ let r = Y_[e], i = r.icon;
18420
18493
  return /* @__PURE__ */ b("div", {
18421
18494
  className: "txn-ol-group",
18422
18495
  children: [/* @__PURE__ */ b("div", {
@@ -18466,7 +18539,7 @@ function H_({ viewModel: e, tab: t, onJump: n = () => {} }) {
18466
18539
  }
18467
18540
  //#endregion
18468
18541
  //#region src/ui/transcript/FilterSection.jsx
18469
- function U_({ title: e, children: t, defaultOpen: n = !0 }) {
18542
+ function Q_({ title: e, children: t, defaultOpen: n = !0 }) {
18470
18543
  let [r, i] = _(n);
18471
18544
  return /* @__PURE__ */ b("div", {
18472
18545
  className: "txn-fsec",
@@ -18491,31 +18564,34 @@ function U_({ title: e, children: t, defaultOpen: n = !0 }) {
18491
18564
  }
18492
18565
  //#endregion
18493
18566
  //#region src/ui/transcript/CheckRow.jsx
18494
- function W_({ checked: e = !1, onChange: t = () => {}, children: n, count: r, disabled: i = !1 }) {
18567
+ function $_({ checked: e = !1, indeterminate: t = !1, onChange: n = () => {}, children: r, count: i, disabled: a = !1 }) {
18495
18568
  return /* @__PURE__ */ b("label", {
18496
18569
  className: "txn-checkrow",
18497
18570
  children: [
18498
18571
  /* @__PURE__ */ y("input", {
18572
+ ref: (e) => {
18573
+ e && (e.indeterminate = t);
18574
+ },
18499
18575
  type: "checkbox",
18500
18576
  className: "check-box",
18501
18577
  checked: e,
18502
- onChange: t,
18503
- disabled: i
18578
+ onChange: n,
18579
+ disabled: a
18504
18580
  }),
18505
18581
  /* @__PURE__ */ y("span", {
18506
18582
  className: "txn-cr-label",
18507
- children: n
18583
+ children: r
18508
18584
  }),
18509
- r != null && /* @__PURE__ */ y("span", {
18585
+ i != null && /* @__PURE__ */ y("span", {
18510
18586
  className: "txn-cr-count tnum",
18511
- children: r
18587
+ children: i
18512
18588
  })
18513
18589
  ]
18514
18590
  });
18515
18591
  }
18516
18592
  //#endregion
18517
18593
  //#region src/ui/transcript/ViewSwitch.jsx
18518
- function G_({ label: e = "", on: t = !1, onToggle: n = () => {} }) {
18594
+ function ev({ label: e = "", on: t = !1, onToggle: n = () => {} }) {
18519
18595
  return /* @__PURE__ */ b("div", {
18520
18596
  className: "txn-viewsw",
18521
18597
  children: [
@@ -18540,7 +18616,7 @@ function G_({ label: e = "", on: t = !1, onToggle: n = () => {} }) {
18540
18616
  }
18541
18617
  //#endregion
18542
18618
  //#region src/ui/transcript/FiltersRail.jsx
18543
- var K_ = {
18619
+ var tv = {
18544
18620
  edits: {
18545
18621
  label: "file edits",
18546
18622
  icon: We
@@ -18569,7 +18645,7 @@ var K_ = {
18569
18645
  label: "other",
18570
18646
  icon: gt
18571
18647
  }
18572
- }, q_ = {
18648
+ }, nv = {
18573
18649
  categories: {
18574
18650
  prompts: !0,
18575
18651
  responses: !0,
@@ -18589,7 +18665,7 @@ var K_ = {
18589
18665
  },
18590
18666
  checkpoint: "all"
18591
18667
  };
18592
- function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r = {
18668
+ function rv({ tab: e, filters: t = nv, onFiltersChange: n = () => {}, counts: r = {
18593
18669
  categories: {
18594
18670
  prompts: 0,
18595
18671
  responses: 0,
@@ -18616,13 +18692,7 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18616
18692
  ...g,
18617
18693
  ...e
18618
18694
  }
18619
- }), O = (e) => n({
18620
- ...t,
18621
- toolGroups: {
18622
- ...m,
18623
- [e]: !m[e]
18624
- }
18625
- }), k = (e) => n({
18695
+ }), O = (e) => n(q_(t, e)), k = (e) => n(K_(t, e, r.toolGroups)), A = W_(m, r.toolGroups), ee = (e) => n({
18626
18696
  ...t,
18627
18697
  checkpoint: e
18628
18698
  });
@@ -18631,20 +18701,20 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18631
18701
  children: "filters are not available for this view yet."
18632
18702
  }) : e === "highlights" ? /* @__PURE__ */ y("div", {
18633
18703
  className: "txn-filters",
18634
- children: /* @__PURE__ */ b(U_, {
18704
+ children: /* @__PURE__ */ b(Q_, {
18635
18705
  title: "outcome",
18636
18706
  children: [
18637
- /* @__PURE__ */ y(W_, {
18707
+ /* @__PURE__ */ y($_, {
18638
18708
  checked: h.errors,
18639
18709
  onChange: () => T({ errors: !h.errors }),
18640
18710
  children: "errors"
18641
18711
  }),
18642
- /* @__PURE__ */ y(W_, {
18712
+ /* @__PURE__ */ y($_, {
18643
18713
  checked: h.retries,
18644
18714
  onChange: () => T({ retries: !h.retries }),
18645
18715
  children: "retries"
18646
18716
  }),
18647
- /* @__PURE__ */ y(W_, {
18717
+ /* @__PURE__ */ y($_, {
18648
18718
  checked: h.revert,
18649
18719
  onChange: () => T({ revert: !h.revert }),
18650
18720
  children: "re-edit"
@@ -18673,19 +18743,19 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18673
18743
  /* @__PURE__ */ b("div", {
18674
18744
  className: "txn-catlist",
18675
18745
  children: [
18676
- /* @__PURE__ */ y(W_, {
18746
+ /* @__PURE__ */ y($_, {
18677
18747
  checked: p.prompts,
18678
18748
  onChange: () => w({ prompts: !p.prompts }),
18679
18749
  count: r.categories.prompts,
18680
18750
  children: "prompts"
18681
18751
  }),
18682
- /* @__PURE__ */ y(W_, {
18752
+ /* @__PURE__ */ y($_, {
18683
18753
  checked: p.responses,
18684
18754
  onChange: () => w({ responses: !p.responses }),
18685
18755
  count: r.categories.responses,
18686
18756
  children: "responses"
18687
18757
  }),
18688
- /* @__PURE__ */ y(W_, {
18758
+ /* @__PURE__ */ y($_, {
18689
18759
  checked: p.thinking,
18690
18760
  onChange: () => w({ thinking: !p.thinking }),
18691
18761
  count: r.categories.thinking,
@@ -18693,9 +18763,10 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18693
18763
  }),
18694
18764
  /* @__PURE__ */ b("div", {
18695
18765
  className: "txn-toolcat",
18696
- children: [/* @__PURE__ */ y(W_, {
18766
+ children: [/* @__PURE__ */ y($_, {
18697
18767
  checked: p.toolcalls,
18698
- onChange: () => w({ toolcalls: !p.toolcalls }),
18768
+ indeterminate: p.toolcalls && A === "mixed",
18769
+ onChange: () => O(!p.toolcalls),
18699
18770
  count: r.categories.toolcalls,
18700
18771
  children: /* @__PURE__ */ b("button", {
18701
18772
  type: "button",
@@ -18712,16 +18783,16 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18712
18783
  }), l && /* @__PURE__ */ y("div", {
18713
18784
  className: "txn-toolgroups",
18714
18785
  children: eo.map((e) => {
18715
- let t = K_[e], n = t.icon, i = r.toolGroups[e] ?? 0;
18786
+ let t = tv[e], n = t.icon, i = r.toolGroups[e] ?? 0;
18716
18787
  return /* @__PURE__ */ b("label", {
18717
18788
  className: "txn-checkrow txn-subcheck",
18718
18789
  children: [
18719
18790
  /* @__PURE__ */ y("input", {
18720
18791
  type: "checkbox",
18721
18792
  className: "check-box",
18722
- checked: m[e] ?? !0,
18793
+ checked: p.toolcalls && m[e] !== !1,
18723
18794
  disabled: i === 0,
18724
- onChange: () => O(e)
18795
+ onChange: () => k(e)
18725
18796
  }),
18726
18797
  /* @__PURE__ */ b("span", {
18727
18798
  className: "txn-cr-label",
@@ -18753,7 +18824,7 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18753
18824
  /* @__PURE__ */ b("div", {
18754
18825
  className: "txn-catlist",
18755
18826
  children: [
18756
- /* @__PURE__ */ b(W_, {
18827
+ /* @__PURE__ */ b($_, {
18757
18828
  checked: h.errors,
18758
18829
  onChange: () => T({ errors: !h.errors }),
18759
18830
  children: [/* @__PURE__ */ y(x, {
@@ -18762,7 +18833,7 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18762
18833
  className: "txn-tag-err"
18763
18834
  }), " errors"]
18764
18835
  }),
18765
- /* @__PURE__ */ b(W_, {
18836
+ /* @__PURE__ */ b($_, {
18766
18837
  checked: h.retries,
18767
18838
  onChange: () => T({ retries: !h.retries }),
18768
18839
  children: [/* @__PURE__ */ y(Je, {
@@ -18770,7 +18841,7 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18770
18841
  "aria-hidden": "true"
18771
18842
  }), " retries"]
18772
18843
  }),
18773
- /* @__PURE__ */ b(W_, {
18844
+ /* @__PURE__ */ b($_, {
18774
18845
  checked: h.revert,
18775
18846
  onChange: () => T({ revert: !h.revert }),
18776
18847
  children: [/* @__PURE__ */ y(z, {
@@ -18813,7 +18884,7 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18813
18884
  "aria-selected": C === "all",
18814
18885
  className: "txn-cp-opt",
18815
18886
  onClick: () => {
18816
- k("all"), f(!1);
18887
+ ee("all"), f(!1);
18817
18888
  },
18818
18889
  children: [
18819
18890
  "all checkpoints (",
@@ -18826,7 +18897,7 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18826
18897
  "aria-selected": C === e.shortHash,
18827
18898
  className: "txn-cp-opt",
18828
18899
  onClick: () => {
18829
- k(e.shortHash), f(!1);
18900
+ ee(e.shortHash), f(!1);
18830
18901
  },
18831
18902
  children: [/* @__PURE__ */ y("span", {
18832
18903
  className: "mono txn-cp-hash",
@@ -18847,17 +18918,17 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18847
18918
  /* @__PURE__ */ b("div", {
18848
18919
  className: "txn-views",
18849
18920
  children: [
18850
- /* @__PURE__ */ y(G_, {
18921
+ /* @__PURE__ */ y(ev, {
18851
18922
  label: "show hidden indicators",
18852
18923
  on: g.hidden,
18853
18924
  onToggle: () => E({ hidden: !g.hidden })
18854
18925
  }),
18855
- /* @__PURE__ */ y(G_, {
18926
+ /* @__PURE__ */ y(ev, {
18856
18927
  label: "expand all tool calls",
18857
18928
  on: g.expandAll,
18858
18929
  onToggle: () => E({ expandAll: !g.expandAll })
18859
18930
  }),
18860
- /* @__PURE__ */ y(G_, {
18931
+ /* @__PURE__ */ y(ev, {
18861
18932
  label: "compact mode",
18862
18933
  on: g.compact,
18863
18934
  onToggle: () => E({ compact: !g.compact })
@@ -18894,7 +18965,7 @@ function J_({ tab: e, filters: t = q_, onFiltersChange: n = () => {}, counts: r
18894
18965
  }
18895
18966
  //#endregion
18896
18967
  //#region src/ui/transcript/Scrubber.jsx
18897
- function Y_({ turns: e = [], active: t = 0, onSeek: n = () => {}, draggingRef: r }) {
18968
+ function iv({ turns: e = [], active: t = 0, onSeek: n = () => {}, draggingRef: r }) {
18898
18969
  let i = g(null), a = g(!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;
18899
18970
  function u(e) {
18900
18971
  o.current = !0, i.current && n(e.clientX, i.current);
@@ -18932,7 +19003,7 @@ function Y_({ turns: e = [], active: t = 0, onSeek: n = () => {}, draggingRef: r
18932
19003
  }
18933
19004
  //#endregion
18934
19005
  //#region src/ui/transcript/Scorecard.jsx
18935
- var X_ = {
19006
+ var av = {
18936
19007
  good: {
18937
19008
  label: "on track",
18938
19009
  chip: "chip-ok"
@@ -18949,12 +19020,12 @@ var X_ = {
18949
19020
  label: "off track",
18950
19021
  chip: "chip-err"
18951
19022
  }
18952
- }, Z_ = {
19023
+ }, ov = {
18953
19024
  token: ce,
18954
19025
  prompt: ve,
18955
19026
  loop: Je
18956
19027
  };
18957
- function Q_({ bands: e = [] }) {
19028
+ function sv({ bands: e = [] }) {
18958
19029
  return !e || e.length === 0 ? null : /* @__PURE__ */ b("div", {
18959
19030
  className: "txn-scorecard",
18960
19031
  children: [/* @__PURE__ */ b("div", {
@@ -18966,10 +19037,10 @@ function Q_({ bands: e = [] }) {
18966
19037
  }), /* @__PURE__ */ y("div", {
18967
19038
  className: "txn-sc-grid",
18968
19039
  children: e.map((e) => {
18969
- let t = X_[e.band] ?? {
19040
+ let t = av[e.band] ?? {
18970
19041
  label: e.band,
18971
19042
  chip: ""
18972
- }, n = e.icon ? Z_[e.icon] : null, r = e.delta ? e.delta.dir === "up" ? ut : lt : null;
19043
+ }, n = e.icon ? ov[e.icon] : null, r = e.delta ? e.delta.dir === "up" ? ut : lt : null;
18973
19044
  return /* @__PURE__ */ b("div", {
18974
19045
  className: "txn-sc-card",
18975
19046
  children: [
@@ -19018,18 +19089,18 @@ function Q_({ bands: e = [] }) {
19018
19089
  }
19019
19090
  //#endregion
19020
19091
  //#region src/ui/transcript/LabelPopover.jsx
19021
- var $_ = [
19092
+ var cv = [
19022
19093
  ["good", "good"],
19023
19094
  ["neutral", "neutral"],
19024
19095
  ["bad", "bad"]
19025
- ], ev = [
19096
+ ], lv = [
19026
19097
  ["", "none"],
19027
19098
  ["error", "error"],
19028
19099
  ["retry-loop", "retry loop"],
19029
19100
  ["revert", "revert"],
19030
19101
  ["highlight", "highlight"]
19031
19102
  ];
19032
- function tv({ turnId: e, current: t, onSave: n = () => {}, onClose: r = () => {} }) {
19103
+ function uv({ turnId: e, current: t, onSave: n = () => {}, onClose: r = () => {} }) {
19033
19104
  let [i, a] = _(t?.outcome || "neutral"), [o, s] = _(t?.flag || ""), c = g(null);
19034
19105
  return d(() => {
19035
19106
  function e(e) {
@@ -19064,7 +19135,7 @@ function tv({ turnId: e, current: t, onSave: n = () => {}, onClose: r = () => {}
19064
19135
  children: "outcome"
19065
19136
  }), /* @__PURE__ */ y("div", {
19066
19137
  className: "bs-seg txn-label-seg",
19067
- children: $_.map(([e, t]) => /* @__PURE__ */ y("button", {
19138
+ children: cv.map(([e, t]) => /* @__PURE__ */ y("button", {
19068
19139
  type: "button",
19069
19140
  className: "bs-seg-opt",
19070
19141
  "aria-pressed": i === e,
@@ -19076,7 +19147,7 @@ function tv({ turnId: e, current: t, onSave: n = () => {}, onClose: r = () => {}
19076
19147
  children: "flag"
19077
19148
  }), /* @__PURE__ */ y("div", {
19078
19149
  className: "txn-label-flags",
19079
- children: ev.map(([e, t]) => /* @__PURE__ */ y("button", {
19150
+ children: lv.map(([e, t]) => /* @__PURE__ */ y("button", {
19080
19151
  type: "button",
19081
19152
  className: "chip txn-label-flag" + (o === e ? " txn-flag-on" : ""),
19082
19153
  "aria-pressed": o === e,
@@ -19105,12 +19176,12 @@ function tv({ turnId: e, current: t, onSave: n = () => {}, onClose: r = () => {}
19105
19176
  }
19106
19177
  //#endregion
19107
19178
  //#region src/ui/transcript/initial-position.js
19108
- var nv = /* @__PURE__ */ new Set([
19179
+ var dv = /* @__PURE__ */ new Set([
19109
19180
  "pending",
19110
19181
  "applied",
19111
19182
  "discarded"
19112
- ]), rv = Symbol("fairtrade.invalid-initial-position"), iv = /* @__PURE__ */ new WeakSet();
19113
- function av(e) {
19183
+ ]), fv = Symbol("fairtrade.invalid-initial-position"), pv = /* @__PURE__ */ new WeakSet();
19184
+ function mv(e) {
19114
19185
  if (e === void 0) return "undefined";
19115
19186
  if (e === null) return "null";
19116
19187
  if (typeof e == "string") return JSON.stringify(e);
@@ -19129,7 +19200,7 @@ function av(e) {
19129
19200
  return "[object]";
19130
19201
  }
19131
19202
  }
19132
- function ov(e, t, n) {
19203
+ function hv(e, t, n) {
19133
19204
  let r = TypeError([
19134
19205
  `What went wrong: ${e}.`,
19135
19206
  `Why it happened: ${t}.`,
@@ -19138,54 +19209,54 @@ function ov(e, t, n) {
19138
19209
  "What it means for the caller: the position was rejected and no scrolling or selection side effect was performed.",
19139
19210
  `How to fix it: ${n}.`
19140
19211
  ].join(" "));
19141
- return Object.defineProperty(r, rv, { value: !0 }), iv.add(r), r;
19212
+ return Object.defineProperty(r, fv, { value: !0 }), pv.add(r), r;
19142
19213
  }
19143
- function sv(e, t) {
19214
+ function gv(e, t) {
19144
19215
  try {
19145
19216
  return t();
19146
19217
  } catch (t) {
19147
- throw typeof t == "object" && t && iv.has(t) ? t : ov(`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");
19218
+ throw typeof t == "object" && t && pv.has(t) ? t : hv(`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");
19148
19219
  }
19149
19220
  }
19150
- function cv(e, t) {
19151
- return sv("descriptor map construction", () => {
19221
+ function _v(e, t) {
19222
+ return gv("descriptor map construction", () => {
19152
19223
  let n = /* @__PURE__ */ new Map();
19153
19224
  for (let r of t) {
19154
19225
  let t = Object.getOwnPropertyDescriptor(e, r);
19155
- if (t === void 0) throw ov(`${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`);
19156
- if (!Object.prototype.hasOwnProperty.call(t, "value")) throw ov(`${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`);
19226
+ if (t === void 0) throw hv(`${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`);
19227
+ if (!Object.prototype.hasOwnProperty.call(t, "value")) throw hv(`${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`);
19157
19228
  n.set(r, t.value);
19158
19229
  }
19159
19230
  return n;
19160
19231
  });
19161
19232
  }
19162
- function lv(e) {
19163
- if (!e.has("kind")) throw ov("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'");
19233
+ function vv(e) {
19234
+ if (!e.has("kind")) throw hv("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'");
19164
19235
  return e.get("kind");
19165
19236
  }
19166
- function uv(e) {
19237
+ function yv(e) {
19167
19238
  if (e == null) return null;
19168
- if (typeof e != "object" || sv("array classification", () => Array.isArray(e))) throw ov("the position is not an object", "only the top and turn object shapes are supported", "pass { kind: 'top' } or { kind: 'turn', turnIndex: 0 }");
19169
- let t = sv("prototype inspection", () => Object.getPrototypeOf(e));
19170
- if (t !== Object.prototype && t !== null) throw ov("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");
19171
- let n = e, r = sv("own-key inspection", () => Reflect.ownKeys(n));
19172
- if (r.some((e) => typeof e != "string")) throw ov("the position contains a symbol key", "symbol keys are outside the serialized public contract", "remove symbol keys and use only documented string keys");
19173
- let i = cv(n, r), a = lv(i);
19174
- if (a !== "top" && a !== "turn") throw ov(`the kind ${av(a)} is unknown`, "the position union is closed", "use kind 'top' or kind 'turn'");
19239
+ if (typeof e != "object" || gv("array classification", () => Array.isArray(e))) throw hv("the position is not an object", "only the top and turn object shapes are supported", "pass { kind: 'top' } or { kind: 'turn', turnIndex: 0 }");
19240
+ let t = gv("prototype inspection", () => Object.getPrototypeOf(e));
19241
+ if (t !== Object.prototype && t !== null) throw hv("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");
19242
+ let n = e, r = gv("own-key inspection", () => Reflect.ownKeys(n));
19243
+ if (r.some((e) => typeof e != "string")) throw hv("the position contains a symbol key", "symbol keys are outside the serialized public contract", "remove symbol keys and use only documented string keys");
19244
+ let i = _v(n, r), a = vv(i);
19245
+ if (a !== "top" && a !== "turn") throw hv(`the kind ${mv(a)} is unknown`, "the position union is closed", "use kind 'top' or kind 'turn'");
19175
19246
  let o = a === "top" ? /* @__PURE__ */ new Set(["kind", "requestKey"]) : /* @__PURE__ */ new Set([
19176
19247
  "kind",
19177
19248
  "turnIndex",
19178
19249
  "requestKey"
19179
19250
  ]), s = [...i.keys()].filter((e) => !o.has(e)), c = a === "turn" && !i.has("turnIndex") ? ["turnIndex"] : [];
19180
- if (s.length || c.length) throw ov(`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`);
19251
+ if (s.length || c.length) throw hv(`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`);
19181
19252
  let l = i.get("requestKey");
19182
- if (l !== void 0 && (typeof l != "string" || l.trim().length === 0 || l.includes("\0"))) throw ov("requestKey is malformed", "requestKey must be a nonempty string without the token delimiter", "supply a stable nonblank request identity or omit requestKey");
19253
+ if (l !== void 0 && (typeof l != "string" || l.trim().length === 0 || l.includes("\0"))) throw hv("requestKey is malformed", "requestKey must be a nonempty string without the token delimiter", "supply a stable nonblank request identity or omit requestKey");
19183
19254
  if (a === "top") return l === void 0 ? { kind: "top" } : {
19184
19255
  kind: "top",
19185
19256
  requestKey: l
19186
19257
  };
19187
19258
  let u = i.get("turnIndex");
19188
- if (!Number.isSafeInteger(u) || u < 0) throw ov(`turnIndex ${av(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");
19259
+ if (!Number.isSafeInteger(u) || u < 0) throw hv(`turnIndex ${mv(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");
19189
19260
  return l === void 0 ? {
19190
19261
  kind: "turn",
19191
19262
  turnIndex: u
@@ -19195,18 +19266,18 @@ function uv(e) {
19195
19266
  requestKey: l
19196
19267
  };
19197
19268
  }
19198
- function dv(e) {
19269
+ function bv(e) {
19199
19270
  let t = e.explicitUsed || e.initialPosition !== void 0, n = e.fallbackUsed || !t && e.fallbackInitialPosition !== void 0;
19200
19271
  return {
19201
19272
  explicitUsed: t,
19202
19273
  fallbackUsed: n,
19203
- position: e.initialPosition === void 0 ? t ? null : e.fallbackInitialPosition === void 0 ? n ? null : uv(e.legacyInitialPosition) : uv(e.fallbackInitialPosition) : uv(e.initialPosition)
19274
+ position: e.initialPosition === void 0 ? t ? null : e.fallbackInitialPosition === void 0 ? n ? null : yv(e.legacyInitialPosition) : yv(e.fallbackInitialPosition) : yv(e.initialPosition)
19204
19275
  };
19205
19276
  }
19206
- function fv(e, t) {
19277
+ function xv(e, t) {
19207
19278
  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";
19208
19279
  }
19209
- function pv(e, t) {
19280
+ function Sv(e, t) {
19210
19281
  return t == null ? null : JSON.stringify([
19211
19282
  e ?? "",
19212
19283
  t.kind,
@@ -19214,21 +19285,21 @@ function pv(e, t) {
19214
19285
  t.requestKey ?? ""
19215
19286
  ]);
19216
19287
  }
19217
- function mv(e) {
19218
- if (!nv.has(e)) throw ov(`the layout consumer returned ${av(e)}`, "apply must report pending, applied, or discarded", "return pending while readiness is incomplete, applied after positioning, or discarded after authoritative absence");
19288
+ function Cv(e) {
19289
+ if (!dv.has(e)) throw hv(`the layout consumer returned ${mv(e)}`, "apply must report pending, applied, or discarded", "return pending while readiness is incomplete, applied after positioning, or discarded after authoritative absence");
19219
19290
  }
19220
- function hv(e, t) {
19291
+ function wv(e, t) {
19221
19292
  return t != null && e !== t;
19222
19293
  }
19223
- function gv(e, t, n) {
19224
- return mv(n), t == null ? null : n === "applied" || n === "discarded" ? t : e;
19294
+ function Tv(e, t, n) {
19295
+ return Cv(n), t == null ? null : n === "applied" || n === "discarded" ? t : e;
19225
19296
  }
19226
19297
  //#endregion
19227
19298
  //#region src/ui/transcript/useTranscriptInitialPosition.jsx
19228
- function _v(e) {
19299
+ function Ev(e) {
19229
19300
  let t = g(void 0);
19230
- t.current === void 0 && (t.current = uv(e.legacyInitialPosition));
19231
- let n = g(!1), r = g(!1), i = dv({
19301
+ t.current === void 0 && (t.current = yv(e.legacyInitialPosition));
19302
+ let n = g(!1), r = g(!1), i = bv({
19232
19303
  initialPosition: e.initialPosition,
19233
19304
  fallbackInitialPosition: e.fallbackInitialPosition,
19234
19305
  legacyInitialPosition: t.current,
@@ -19236,15 +19307,15 @@ function _v(e) {
19236
19307
  fallbackUsed: r.current
19237
19308
  });
19238
19309
  n.current = i.explicitUsed, r.current = i.fallbackUsed;
19239
- let a = i.position, o = pv(e.sessionId, a), s = g(null);
19310
+ let a = i.position, o = Sv(e.sessionId, a), s = g(null);
19240
19311
  return p(() => {
19241
19312
  if (o == null || a == null) {
19242
19313
  s.current = null;
19243
19314
  return;
19244
19315
  }
19245
- if (!hv(s.current, o)) return;
19316
+ if (!wv(s.current, o)) return;
19246
19317
  let t = e.apply(a);
19247
- s.current = gv(s.current, o, t);
19318
+ s.current = Tv(s.current, o, t);
19248
19319
  }, [
19249
19320
  o,
19250
19321
  a,
@@ -19257,8 +19328,8 @@ function _v(e) {
19257
19328
  }
19258
19329
  //#endregion
19259
19330
  //#region src/ui/transcript/TranscriptViewer.jsx
19260
- var vv = (e) => e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : String(e);
19261
- function yv(e, t, n) {
19331
+ var Dv = (e) => e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : String(e);
19332
+ function Ov(e, t, n) {
19262
19333
  let [r, i] = _(n), a = e !== void 0;
19263
19334
  return [a ? e : r, l((n) => {
19264
19335
  let o = typeof n == "function" ? n(a ? e : r) : n;
@@ -19270,31 +19341,31 @@ function yv(e, t, n) {
19270
19341
  r
19271
19342
  ])];
19272
19343
  }
19273
- var bv = 56, xv = [
19344
+ var kv = 56, Av = [
19274
19345
  "highlights",
19275
19346
  "trace",
19276
19347
  "diffs",
19277
19348
  "files",
19278
19349
  "annotations"
19279
- ], Sv = {
19350
+ ], jv = {
19280
19351
  highlights: "highlights",
19281
19352
  trace: "full trace",
19282
19353
  diffs: "diffs",
19283
19354
  files: "files",
19284
19355
  annotations: "annotations"
19285
- }, Cv = {
19356
+ }, Mv = {
19286
19357
  exploration: _e,
19287
19358
  debugging: x,
19288
19359
  implementation: We,
19289
19360
  planning: Me,
19290
19361
  review: nt
19291
- }, wv = {
19362
+ }, Nv = {
19292
19363
  request: Ge,
19293
19364
  phase: be,
19294
19365
  error: x,
19295
19366
  checkpoint: Ce,
19296
19367
  final: at
19297
- }, Tv = {
19368
+ }, Pv = {
19298
19369
  error: {
19299
19370
  label: "error",
19300
19371
  icon: x,
@@ -19319,7 +19390,7 @@ var bv = 56, xv = [
19319
19390
  chip: "",
19320
19391
  tip: "a Task spawned a nested subagent at depth > 0"
19321
19392
  }
19322
- }, Ev = Object.freeze({
19393
+ }, Fv = Object.freeze({
19323
19394
  categories: {
19324
19395
  prompts: !0,
19325
19396
  responses: !0,
@@ -19339,13 +19410,13 @@ var bv = 56, xv = [
19339
19410
  },
19340
19411
  checkpoint: "all"
19341
19412
  });
19342
- function Dv({ phase: e }) {
19413
+ function Iv({ phase: e }) {
19343
19414
  return /* @__PURE__ */ b("div", {
19344
19415
  className: "phase txn-phase",
19345
19416
  children: [/* @__PURE__ */ b("span", {
19346
19417
  className: "lbl",
19347
19418
  children: [
19348
- /* @__PURE__ */ y(Cv[e.icon] ?? Cv[e.id] ?? be, {
19419
+ /* @__PURE__ */ y(Mv[e.icon] ?? Mv[e.id] ?? be, {
19349
19420
  size: 14,
19350
19421
  "aria-hidden": "true"
19351
19422
  }),
@@ -19364,7 +19435,7 @@ function Dv({ phase: e }) {
19364
19435
  })]
19365
19436
  });
19366
19437
  }
19367
- function Ov({ task: e }) {
19438
+ function Lv({ task: e }) {
19368
19439
  let t = [
19369
19440
  e.durationMs ? vi(e.durationMs) : null,
19370
19441
  e.tools == null ? null : `${e.tools} tools`,
@@ -19381,7 +19452,7 @@ function Ov({ task: e }) {
19381
19452
  })]
19382
19453
  });
19383
19454
  }
19384
- function kv({ commit: e }) {
19455
+ function Rv({ commit: e }) {
19385
19456
  let t = e.adds != null || e.dels != null || e.files != null ? `+${e.adds ?? 0} −${e.dels ?? 0}${e.files == null ? "" : ` · ${e.files} files`}` : null;
19386
19457
  return /* @__PURE__ */ b("div", {
19387
19458
  className: "marker txn-checkpoint",
@@ -19412,8 +19483,8 @@ function kv({ commit: e }) {
19412
19483
  ]
19413
19484
  });
19414
19485
  }
19415
- function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThemeChange: o, graphSlot: s, activeTab: c, onTabChange: u, viewMode: f, onViewModeChange: h, leftRailOpen: S, onLeftRailOpenChange: C, rightRailOpen: w, onRightRailOpenChange: T, openTools: E, onOpenToolsChange: D, initialPosition: O, activeTurn: k, onActiveTurnChange: A, search: ee, onSearchChange: M, filters: te, onFiltersChange: F, savedLabels: re, onSavedLabelsChange: I, shareOpen: ie, onShareOpenChange: ae, moreOpen: oe, onMoreOpenChange: le, breadcrumb: ue, LinkComponent: de, renderTurnPanel: fe, renderTurnActions: he, anchorHref: ge, headerActions: _e, streamPrelude: be }) {
19416
- let xe = e, Se = t ?? {}, [we] = yv(i, o, "dark"), [L, Te] = yv(c, u, "trace"), [R, Ee] = yv(f, h, "list"), [De, je] = yv(S, C, !0), [Ne, Pe] = yv(w, T, !0), [Fe, Le] = yv(E, D, {}), [Ge, Ke] = yv(k, A, xe?.turns?.[0]?.index ?? 0), [qe, Je] = yv(ee, M, ""), [z, Ye] = yv(te, F, Ev), [Ze, Qe] = yv(re, I, {}), [$e, tt] = yv(ie, ae, !1), [rt, ot] = yv(oe, le, !1), [st, ct] = _(null), [lt, ut] = _(!1), [dt, pt] = _(null), [ht, vt] = _(!1), [yt, bt] = _(!1), xt = yt && L === "trace" && R === "list", [St, Ct] = _(!1), [wt, Tt] = _(0), [Et, Dt] = _("file"), [Ot, kt] = _({}), [At, jt] = _({
19486
+ function zv({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThemeChange: o, graphSlot: s, activeTab: c, onTabChange: u, viewMode: f, onViewModeChange: h, leftRailOpen: S, onLeftRailOpenChange: C, rightRailOpen: w, onRightRailOpenChange: T, openTools: E, onOpenToolsChange: D, initialPosition: O, activeTurn: k, onActiveTurnChange: A, search: ee, onSearchChange: M, filters: te, onFiltersChange: F, savedLabels: re, onSavedLabelsChange: I, shareOpen: ie, onShareOpenChange: ae, moreOpen: oe, onMoreOpenChange: le, breadcrumb: ue, LinkComponent: de, renderTurnPanel: fe, renderTurnActions: he, anchorHref: ge, headerActions: _e, streamPrelude: be }) {
19487
+ let xe = e, Se = t ?? {}, [we] = Ov(i, o, "dark"), [L, Te] = Ov(c, u, "trace"), [R, Ee] = Ov(f, h, "list"), [De, je] = Ov(S, C, !0), [Ne, Pe] = Ov(w, T, !0), [Fe, Le] = Ov(E, D, {}), [Ge, Ke] = Ov(k, A, xe?.turns?.[0]?.index ?? 0), [qe, Je] = Ov(ee, M, ""), [z, Ye] = Ov(te, F, Fv), [Ze, Qe] = Ov(re, I, {}), [$e, tt] = Ov(ie, ae, !1), [rt, ot] = Ov(oe, le, !1), [st, ct] = _(null), [lt, ut] = _(!1), [dt, pt] = _(null), [ht, vt] = _(!1), [yt, bt] = _(!1), xt = yt && L === "trace" && R === "list", [St, Ct] = _(!1), [wt, Tt] = _(0), [Et, Dt] = _("file"), [Ot, kt] = _({}), [At, jt] = _({
19417
19488
  key: "path",
19418
19489
  dir: "asc"
19419
19490
  }), [Mt, Nt] = _(null), B = xe?.session ?? {}, V = xe?.turns ?? [], Pt = g({}), Ft = g(null), It = g(null), Lt = g(0), Rt = g(null), zt = g(!1), Bt = g({}), Vt = g(0), Ht = g(null), Ut = g(null), Wt = g(!1), Gt = g(L), Kt = g(B?.id ?? ""), qt = l((e, t) => {
@@ -19429,12 +19500,16 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
19429
19500
  }
19430
19501
  return e;
19431
19502
  }, [Xt]), sn = !!Se.canLabel, cn = sn ? (e) => pt(e) : void 0, H = m(() => {
19432
- let { categories: e, tags: t, checkpoint: n } = z, r = (n === "all" ? null : tn.find((e) => e.shortHash === n || e.hash === n))?.turn;
19433
- return V.filter((n) => !(n.role === "user" && !e.prompts || n.role === "assistant" && !e.responses || t.errors && !n.isError && !(n.toolCalls && n.toolCalls.some((e) => e.isError)) || r != null && n.index > r));
19503
+ let { checkpoint: e } = z, t = e === "all" ? null : tn.find((t) => t.shortHash === e || t.hash === e), n = {
19504
+ annotationsByTurn: xe?.filterIndex?.annotationsByTurn ?? {},
19505
+ checkpointTurn: t?.turn ?? null
19506
+ };
19507
+ return V.map((e) => H_(e, z, n)).filter((e) => e != null);
19434
19508
  }, [
19435
19509
  V,
19436
19510
  z,
19437
- tn
19511
+ tn,
19512
+ xe
19438
19513
  ]), ln = l(() => {
19439
19514
  let e = Ft.current;
19440
19515
  if (!e) return null;
@@ -19500,7 +19575,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
19500
19575
  fn,
19501
19576
  Te
19502
19577
  ]), mn = l((e) => {
19503
- let t = Ft.current, n = e.kind === "turn" ? Pt.current[e.turnIndex] : null, r = fv(e, {
19578
+ let t = Ft.current, n = e.kind === "turn" ? Pt.current[e.turnIndex] : null, r = xv(e, {
19504
19579
  authoritativeTurnIndices: V.map((e) => e.index),
19505
19580
  renderedTurnIndices: H.map((e) => e.index),
19506
19581
  viewReady: L === "trace" && R === "list",
@@ -19523,7 +19598,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
19523
19598
  ]), hn = l((e) => {
19524
19599
  let t = Ut.current ?? Mt;
19525
19600
  if (!t || t.sessionId !== (B?.id ?? "") || e.requestKey !== t.requestKey) return "discarded";
19526
- let n = Ft.current, r = fv(e, {
19601
+ let n = Ft.current, r = xv(e, {
19527
19602
  authoritativeTurnIndices: V.map((e) => e.index),
19528
19603
  renderedTurnIndices: H.map((e) => e.index),
19529
19604
  viewReady: L === "trace" && R === "list",
@@ -19545,7 +19620,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
19545
19620
  R,
19546
19621
  H
19547
19622
  ]);
19548
- _v({
19623
+ Ev({
19549
19624
  sessionId: B?.id,
19550
19625
  initialPosition: O,
19551
19626
  legacyInitialPosition: k == null ? null : {
@@ -19559,7 +19634,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
19559
19634
  H
19560
19635
  ],
19561
19636
  apply: mn
19562
- }), _v({
19637
+ }), Ev({
19563
19638
  sessionId: B?.id,
19564
19639
  initialPosition: Mt?.restoreRequested ? {
19565
19640
  kind: "top",
@@ -19576,14 +19651,9 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
19576
19651
  apply: hn
19577
19652
  });
19578
19653
  let gn = m(() => ({
19579
- categories: {
19580
- prompts: V.filter((e) => e.role === "user").length,
19581
- responses: V.filter((e) => e.role === "assistant").length,
19582
- thinking: V.filter((e) => e.thinking).length,
19583
- toolcalls: V.reduce((e, t) => e + (t.toolCalls ? t.toolCalls.length : 0), 0)
19584
- },
19654
+ categories: U_(V),
19585
19655
  toolGroups: rn
19586
- }), [V, rn]), _n = +!z.categories.prompts + +!z.categories.responses + +!z.categories.thinking + +!z.categories.toolcalls + +!!z.tags.errors + +!!z.tags.retries + +!!z.tags.revert + Object.values(z.toolGroups).filter((e) => !e).length, vn = m(() => {
19656
+ }), [V, rn]), _n = +!z.categories.prompts + +!z.categories.responses + +!z.categories.thinking + +!z.categories.toolcalls + +!!z.tags.errors + +!!z.tags.retries + +!!z.tags.revert + (z.categories.toolcalls ? Object.values(z.toolGroups).filter((e) => !e).length : 0), vn = m(() => {
19587
19657
  if (!qe.trim()) return [];
19588
19658
  let e = qe.toLowerCase(), t = [];
19589
19659
  for (let n of V) {
@@ -19649,7 +19719,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
19649
19719
  }), n.onLabel && n.onLabel(dt, r), pt(null);
19650
19720
  }
19651
19721
  function Tn(e) {
19652
- let t = e.scrollTop > bv;
19722
+ let t = e.scrollTop > kv;
19653
19723
  vt(t);
19654
19724
  let n = It.current;
19655
19725
  n && n.offsetHeight > 0 && !n.closest(".txn-app-condensed") && (Lt.current = n.offsetHeight);
@@ -19680,15 +19750,15 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
19680
19750
  }), Ke(a.index));
19681
19751
  }
19682
19752
  let kn = (e) => {
19683
- let t = xv.indexOf(L);
19753
+ let t = Av.indexOf(L);
19684
19754
  if (t < 0) return;
19685
19755
  let n = t;
19686
- if (e.key === "ArrowRight" || e.key === "ArrowDown") n = (t + 1) % xv.length;
19687
- else if (e.key === "ArrowLeft" || e.key === "ArrowUp") n = (t - 1 + xv.length) % xv.length;
19756
+ if (e.key === "ArrowRight" || e.key === "ArrowDown") n = (t + 1) % Av.length;
19757
+ else if (e.key === "ArrowLeft" || e.key === "ArrowUp") n = (t - 1 + Av.length) % Av.length;
19688
19758
  else if (e.key === "Home") n = 0;
19689
- else if (e.key === "End") n = xv.length - 1;
19759
+ else if (e.key === "End") n = Av.length - 1;
19690
19760
  else return;
19691
- e.preventDefault(), dn(), pn(xv[n]), Bt.current[xv[n]]?.focus();
19761
+ e.preventDefault(), dn(), pn(Av[n]), Bt.current[Av[n]]?.focus();
19692
19762
  };
19693
19763
  d(() => {
19694
19764
  function e(e) {
@@ -20042,7 +20112,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20042
20112
  }),
20043
20113
  B.totalTokens != null && /* @__PURE__ */ b("span", {
20044
20114
  className: "metaitem",
20045
- title: vv(B.tokensIn ?? 0) + " in · " + vv(B.tokensOut ?? 0) + " out",
20115
+ title: Dv(B.tokensIn ?? 0) + " in · " + Dv(B.tokensOut ?? 0) + " out",
20046
20116
  children: [
20047
20117
  /* @__PURE__ */ y(ce, {
20048
20118
  size: 14,
@@ -20051,7 +20121,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20051
20121
  " ",
20052
20122
  /* @__PURE__ */ y("b", {
20053
20123
  className: "tnum",
20054
- children: vv(B.totalTokens)
20124
+ children: Dv(B.totalTokens)
20055
20125
  }),
20056
20126
  " tokens"
20057
20127
  ]
@@ -20111,7 +20181,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20111
20181
  role: "tablist",
20112
20182
  "aria-label": "session views",
20113
20183
  onKeyDown: kn,
20114
- children: xv.map((e) => {
20184
+ children: Av.map((e) => {
20115
20185
  let t = L === e, n = e === "highlights" ? $t.length : e === "trace" ? V.length : e === "diffs" ? Qt.length : e === "files" ? Zt.length : nn.length;
20116
20186
  return /* @__PURE__ */ b("button", {
20117
20187
  ref: (t) => Bt.current[e] = t,
@@ -20125,7 +20195,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20125
20195
  },
20126
20196
  onClick: () => pn(e),
20127
20197
  children: [
20128
- Sv[e],
20198
+ jv[e],
20129
20199
  " ",
20130
20200
  /* @__PURE__ */ y("span", {
20131
20201
  className: "cnt tnum",
@@ -20166,7 +20236,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20166
20236
  }), /* @__PURE__ */ y("div", {
20167
20237
  className: "txn-rail-body",
20168
20238
  id: "txn-rail-left-body",
20169
- children: /* @__PURE__ */ y(H_, {
20239
+ children: /* @__PURE__ */ y(Z_, {
20170
20240
  viewModel: xe,
20171
20241
  tab: L,
20172
20242
  onJump: (e) => bn(e, { switchTab: !1 })
@@ -20208,7 +20278,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20208
20278
  className: "txn-sticky-model mono",
20209
20279
  children: an
20210
20280
  }),
20211
- /* @__PURE__ */ y(Y_, {
20281
+ /* @__PURE__ */ y(iv, {
20212
20282
  turns: V,
20213
20283
  active: Ge,
20214
20284
  onSeek: On,
@@ -20308,8 +20378,8 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20308
20378
  H.map((e, t) => {
20309
20379
  let n = H[t - 1], r = Yt.find((t) => e.index >= t.from && e.index <= t.to), i = n ? Yt.find((e) => n.index >= e.from && n.index <= e.to) : null, a = z.views.hidden && r && (!i || i.id !== r.id), o = on.get(e.index), s = Mn.filter((t) => t.turn === e.index);
20310
20380
  return /* @__PURE__ */ b("div", { children: [
20311
- a && /* @__PURE__ */ y(Dv, { phase: r }),
20312
- e.role === "user" && o && /* @__PURE__ */ y(Ov, { task: o }),
20381
+ a && /* @__PURE__ */ y(Iv, { phase: r }),
20382
+ e.role === "user" && o && /* @__PURE__ */ y(Lv, { task: o }),
20313
20383
  /* @__PURE__ */ y(R_, {
20314
20384
  turn: e,
20315
20385
  active: Ge === e.index,
@@ -20325,10 +20395,10 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20325
20395
  expandAll: z.views.expandAll
20326
20396
  }),
20327
20397
  fe ? fe(e) : null,
20328
- s.map((e) => /* @__PURE__ */ y(kv, { commit: e }, e.hash))
20398
+ s.map((e) => /* @__PURE__ */ y(Rv, { commit: e }, e.hash))
20329
20399
  ] }, e.index);
20330
20400
  }),
20331
- Nn.map((e) => /* @__PURE__ */ y(kv, { commit: e }, e.hash))
20401
+ Nn.map((e) => /* @__PURE__ */ y(Rv, { commit: e }, e.hash))
20332
20402
  ]
20333
20403
  })
20334
20404
  })
@@ -20336,10 +20406,10 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20336
20406
  }),
20337
20407
  L === "highlights" && /* @__PURE__ */ b("div", {
20338
20408
  className: "txn-highlights",
20339
- children: [/* @__PURE__ */ y(Q_, { bands: en }), /* @__PURE__ */ y("div", {
20409
+ children: [/* @__PURE__ */ y(sv, { bands: en }), /* @__PURE__ */ y("div", {
20340
20410
  className: "txn-hl-cards",
20341
20411
  children: $t.map((e) => {
20342
- let t = wv[e.kind] ?? at, n = e.kind === "checkpoint";
20412
+ let t = Nv[e.kind] ?? at, n = e.kind === "checkpoint";
20343
20413
  return /* @__PURE__ */ b("button", {
20344
20414
  type: "button",
20345
20415
  className: "txn-hl-card" + (n ? " txn-hl-static" : ""),
@@ -20614,7 +20684,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20614
20684
  className: "txn-anno-intro",
20615
20685
  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."
20616
20686
  }), nn.map((e) => {
20617
- let t = Tv[e.kind] ?? {
20687
+ let t = Pv[e.kind] ?? {
20618
20688
  label: e.kind,
20619
20689
  icon: x,
20620
20690
  chip: "",
@@ -20693,7 +20763,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20693
20763
  }), /* @__PURE__ */ y("div", {
20694
20764
  className: "txn-rail-body",
20695
20765
  id: "txn-rail-right-body",
20696
- children: /* @__PURE__ */ y(J_, {
20766
+ children: /* @__PURE__ */ y(rv, {
20697
20767
  tab: L,
20698
20768
  filters: z,
20699
20769
  onFiltersChange: Ye,
@@ -20701,7 +20771,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20701
20771
  checkpoints: tn,
20702
20772
  filtersActive: _n,
20703
20773
  onClear: () => Ye({
20704
- ...Ev,
20774
+ ...Fv,
20705
20775
  toolGroups: Object.fromEntries(eo.map((e) => [e, !0]))
20706
20776
  }),
20707
20777
  onJumpStart: () => bn(H[0]?.index ?? 0, { switchTab: !1 }),
@@ -20802,7 +20872,7 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20802
20872
  yn.total
20803
20873
  ]
20804
20874
  }),
20805
- sn && dt != null && /* @__PURE__ */ y(tv, {
20875
+ sn && dt != null && /* @__PURE__ */ y(uv, {
20806
20876
  turnId: dt,
20807
20877
  current: Ze[dt],
20808
20878
  onSave: wn,
@@ -20837,22 +20907,22 @@ function Av({ viewModel: e, capabilities: t, callbacks: n = {}, theme: i, onThem
20837
20907
  }
20838
20908
  //#endregion
20839
20909
  //#region src/ui/transcript/graph/GraphTurnNode.jsx
20840
- function jv(e) {
20910
+ function Bv(e) {
20841
20911
  return e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "k" : String(e);
20842
20912
  }
20843
- function Mv(e, t) {
20913
+ function Vv(e, t) {
20844
20914
  return e === "user" ? "you" : t ? "subagent" : e === "assistant" ? "assistant" : e;
20845
20915
  }
20846
- function Nv({ role: e, agentName: t, provider: r, hasError: i }) {
20916
+ function Hv({ role: e, agentName: t, provider: r, hasError: i }) {
20847
20917
  return i ? "clay" : e === "user" ? "teal" : t ? "mauve" : e === "assistant" ? r === void 0 ? "amber" : n(r) : null;
20848
20918
  }
20849
- function Pv({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount: i, totalTokens: a, tokensIn: o, tokensOut: s, hasError: c = !1, hasRetry: l = !1, hasRevert: u = !1, isSearchMatch: d = !1, isFilteredOut: f = !1, isSelected: p = !1, provider: m, className: h = "" }) {
20850
- let g = Nv({
20919
+ function Uv({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount: i, totalTokens: a, tokensIn: o, tokensOut: s, hasError: c = !1, hasRetry: l = !1, hasRevert: u = !1, isSearchMatch: d = !1, isFilteredOut: f = !1, isSelected: p = !1, provider: m, className: h = "" }) {
20920
+ let g = Hv({
20851
20921
  role: e,
20852
20922
  agentName: t,
20853
20923
  provider: m,
20854
20924
  hasError: c
20855
- }), _ = Mv(e, t), v = c ? "error" : l ? "retry" : u ? "re-edit" : null, x = o != null || s != null ? `${o ?? 0} in · ${s ?? 0} out` : void 0;
20925
+ }), _ = Vv(e, t), v = c ? "error" : l ? "retry" : u ? "re-edit" : null, x = o != null || s != null ? `${o ?? 0} in · ${s ?? 0} out` : void 0;
20856
20926
  return /* @__PURE__ */ b("div", {
20857
20927
  className: [
20858
20928
  "ft-gnode",
@@ -20905,7 +20975,7 @@ function Pv({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount
20905
20975
  }), a > 0 && /* @__PURE__ */ y("span", {
20906
20976
  className: "ft-gnode-meta-tokens",
20907
20977
  title: x,
20908
- children: jv(a)
20978
+ children: Bv(a)
20909
20979
  })]
20910
20980
  })
20911
20981
  ]
@@ -20913,19 +20983,19 @@ function Pv({ role: e, agentName: t, turnNumber: n, contentPreview: r, toolCount
20913
20983
  }
20914
20984
  //#endregion
20915
20985
  //#region src/ui/transcript/graph/GraphToolNode.jsx
20916
- function Fv(e) {
20986
+ function Wv(e) {
20917
20987
  return e == null || e <= 0 ? "" : e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(1).replace(/\.0$/, "")}s`;
20918
20988
  }
20919
- function Iv(e) {
20989
+ function Gv(e) {
20920
20990
  if (!e) return "";
20921
20991
  let t = e.split("/");
20922
20992
  return t[t.length - 1] || e;
20923
20993
  }
20924
- function Lv(e) {
20994
+ function Kv(e) {
20925
20995
  return !!e.isError || e.exitCode != null && e.exitCode !== 0;
20926
20996
  }
20927
- function Rv({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r = !1, max: i = 4, className: a = "" }) {
20928
- let o = e.slice(0, i), s = e.length - o.length, c = Fv(t), l = e.length;
20997
+ function qv({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r = !1, max: i = 4, className: a = "" }) {
20998
+ let o = e.slice(0, i), s = e.length - o.length, c = Wv(t), l = e.length;
20929
20999
  return /* @__PURE__ */ b("div", {
20930
21000
  className: [
20931
21001
  "ft-gnode",
@@ -20946,7 +21016,7 @@ function Rv({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r =
20946
21016
  }), /* @__PURE__ */ b("ul", {
20947
21017
  className: "ft-gnode-tools-list",
20948
21018
  children: [o.map((e) => {
20949
- let t = Lv(e), n = e.preview || Iv(e.filePath);
21019
+ let t = Kv(e), n = e.preview || Gv(e.filePath);
20950
21020
  return /* @__PURE__ */ b("li", {
20951
21021
  className: `ft-gnode-tools-row${t ? " ft-gnode-tools-row-failed" : ""}`,
20952
21022
  children: [
@@ -20977,7 +21047,7 @@ function Rv({ tools: e, totalDurationMs: t, hasError: n = !1, isFilteredOut: r =
20977
21047
  }
20978
21048
  //#endregion
20979
21049
  //#region src/ui/transcript/graph/GraphSubagentBranch.jsx
20980
- function zv({ agentName: e, depth: t, className: n = "" }) {
21050
+ function Jv({ agentName: e, depth: t, className: n = "" }) {
20981
21051
  return /* @__PURE__ */ b("div", {
20982
21052
  className: ["ft-gnode-lane", n].filter(Boolean).join(" "),
20983
21053
  children: [
@@ -20998,7 +21068,7 @@ function zv({ agentName: e, depth: t, className: n = "" }) {
20998
21068
  }
20999
21069
  //#endregion
21000
21070
  //#region src/ui/transcript/graph/GraphLegend.jsx
21001
- var Bv = Object.freeze([
21071
+ var Yv = Object.freeze([
21002
21072
  {
21003
21073
  kind: "user",
21004
21074
  label: "you"
@@ -21020,7 +21090,7 @@ var Bv = Object.freeze([
21020
21090
  label: "error"
21021
21091
  }
21022
21092
  ]);
21023
- function Vv({ kind: e, provider: t }) {
21093
+ function Xv({ kind: e, provider: t }) {
21024
21094
  switch (e) {
21025
21095
  case "user": return "teal";
21026
21096
  case "assistant": return t === void 0 ? "amber" : n(t);
@@ -21029,11 +21099,11 @@ function Vv({ kind: e, provider: t }) {
21029
21099
  default: return null;
21030
21100
  }
21031
21101
  }
21032
- function Hv({ items: e = Bv, className: t = "" }) {
21102
+ function Zv({ items: e = Yv, className: t = "" }) {
21033
21103
  return /* @__PURE__ */ y("div", {
21034
21104
  className: ["ft-graph-legend", t].filter(Boolean).join(" "),
21035
21105
  children: e.map((e) => {
21036
- let t = Vv(e), n = t ? { background: `var(--${t})` } : void 0;
21106
+ let t = Xv(e), n = t ? { background: `var(--${t})` } : void 0;
21037
21107
  return /* @__PURE__ */ b("span", {
21038
21108
  className: "ft-graph-legend-item",
21039
21109
  children: [/* @__PURE__ */ y("span", {
@@ -21047,4 +21117,4 @@ function Hv({ items: e = Bv, className: t = "" }) {
21047
21117
  });
21048
21118
  }
21049
21119
  //#endregion
21050
- export { Wa as $, Kn as $t, Es as A, en as An, li as At, po as B, Gt as Bn, Rr as Bt, F_ as C, sn as Cn, wi as Ct, v_ as D, an as Dn, gi as Dt, y_ as E, tn as En, _i as Et, ho as F, Jt as Fn, Yr as Ft, $a as G, wr as Gt, bo as H, Dr as Ht, es as I, Xt as In, Xr as It, Za as J, er as Jt, Ja as K, Sr as Kt, zo as L, Yt as Ln, Kr as Lt, os as M, Qt as Mn, si as Mt, vo as N, $t as Nn, ii as Nt, __ as O, nn as On, pi as Ot, Yo as P, Kt as Pn, oi as Pt, Ha as Q, qn as Qt, $o as R, Ut as Rn, zr as Rt, R_ as S, on as Sn, Oi as St, S_ as T, cn as Tn, hi as Tt, eo as U, Tr as Ut, Lo as V, Ar as Vt, Ya as W, br as Wt, qa as X, Un as Xt, Xa as Y, tr as Yt, Ka as Z, Jn as Zt, J_ as _, mn as _n, Mi as _t, Pv as a, Dn as an, Ea as at, U_ as b, dn as bn, Fi as bt, gv as c, En as cn, Sa as ct, hv as d, Sn as dn, ca as dt, Rn as en, Ra as et, fv as f, Cn as fn, da as ft, Y_ as g, gn, Pi as gt, Q_ as h, _n as hn, Qi as ht, Rv as i, On as in, Pa as it, fs as j, Zt as jn, ci as jt, g_ as k, rn as kn, mi as kt, uv as l, bn as ln, Ca as lt, tv as m, yn as mn, aa as mt, Hv as n, Mn as nn, La as nt, Av as o, kn as on, Ta as ot, pv as p, wn as pn, fa as pt, Qa as q, hr as qt, zv as r, jn as rn, Ia as rt, _v as s, An as sn, ka as st, Bv as t, Ln as tn, za as tt, dv as u, xn as un, ga as ut, G_ as v, fn as vn, ji as vt, M_ as w, H as wn, bi as wt, H_ as x, ln as xn, Di as xt, W_ as y, un as yn, Ni as yt, uo as z, Wt as zn, Br as zt };
21120
+ export { Wa as $, Kn as $t, Es as A, en as An, li as At, po as B, Gt as Bn, Rr as Bt, F_ as C, sn as Cn, wi as Ct, v_ as D, an as Dn, gi as Dt, y_ as E, tn as En, _i as Et, ho as F, Jt as Fn, Yr as Ft, $a as G, wr as Gt, bo as H, Dr as Ht, es as I, Xt as In, Xr as It, Za as J, er as Jt, Ja as K, Sr as Kt, zo as L, Yt as Ln, Kr as Lt, os as M, Qt as Mn, si as Mt, vo as N, $t as Nn, ii as Nt, __ as O, nn as On, pi as Ot, Yo as P, Kt as Pn, oi as Pt, Ha as Q, qn as Qt, $o as R, Ut as Rn, zr as Rt, R_ as S, on as Sn, Oi as St, S_ as T, cn as Tn, hi as Tt, eo as U, Tr as Ut, Lo as V, Ar as Vt, Ya as W, br as Wt, qa as X, Un as Xt, Xa as Y, tr as Yt, Ka as Z, Jn as Zt, rv as _, mn as _n, Mi as _t, Uv as a, Dn as an, Ea as at, Q_ as b, dn as bn, Fi as bt, Tv as c, En as cn, Sa as ct, wv as d, Sn as dn, ca as dt, Rn as en, Ra as et, xv as f, Cn as fn, da as ft, iv as g, gn, Pi as gt, sv as h, _n as hn, Qi as ht, qv as i, On as in, Pa as it, fs as j, Zt as jn, ci as jt, g_ as k, rn as kn, mi as kt, yv as l, bn as ln, Ca as lt, uv as m, yn as mn, aa as mt, Zv as n, Mn as nn, La as nt, zv as o, kn as on, Ta as ot, Sv as p, wn as pn, fa as pt, Qa as q, hr as qt, Jv as r, jn as rn, Ia as rt, Ev as s, An as sn, ka as st, Yv as t, Ln as tn, za as tt, bv as u, xn as un, ga as ut, ev as v, fn as vn, ji as vt, M_ as w, H as wn, bi as wt, Z_ as x, ln as xn, Di as xt, $_ as y, un as yn, Ni as yt, uo as z, Wt as zn, Br as zt };
package/dist/lib/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as e, $t as t, A as n, An as r, At as i, B as a, Bn as o, Bt as s, C as c, Cn as l, Ct as u, D as d, Dn as f, Dt as p, E as m, En as h, Et as g, F as _, Fn as v, Ft as y, G as b, Gt as x, H as S, Ht as C, I as w, In as T, It as E, J as D, Jt as O, K as k, Kt as A, L as j, Ln as M, Lt as N, M as P, Mn as F, Mt as I, N as L, Nn as R, Nt as z, O as B, On as V, Ot as H, P as U, Pn as W, Pt as G, Q as K, Qt as q, R as J, Rn as Y, Rt as X, S as Z, Sn as Q, St as $, T as ee, Tn as te, Tt as ne, U as re, Ut as ie, V as ae, Vt as oe, W as se, Wt as ce, X as le, Xt as ue, Y as de, Yt as fe, Z as pe, Zt as me, _ as he, _n as ge, _t as _e, a as ve, an as ye, at as be, b as xe, bn as Se, bt as Ce, c as we, cn as Te, ct as Ee, d as De, dn as Oe, dt as ke, en as Ae, et as je, f as Me, fn as Ne, ft as Pe, g as Fe, gn as Ie, gt as Le, h as Re, hn as ze, ht as Be, i as Ve, in as He, it as Ue, j as We, jn as Ge, jt as Ke, k as qe, kn as Je, kt as Ye, l as Xe, ln as Ze, lt as Qe, m as $e, mn as et, mt as tt, n as nt, nn as rt, nt as it, o as at, on as ot, ot as st, p as ct, pn as lt, pt as ut, q as dt, qt as ft, r as pt, rn as mt, rt as ht, s as gt, sn as _t, st as vt, t as yt, tn as bt, tt as xt, u as St, un as Ct, ut as wt, v as Tt, vn as Et, vt as Dt, w as Ot, wn as kt, wt as At, x as jt, xn as Mt, xt as Nt, y as Pt, yn as Ft, yt as It, z as Lt, zn as Rt, zt } from "./ui-CLo_683m.js";
1
+ import { $ as e, $t as t, A as n, An as r, At as i, B as a, Bn as o, Bt as s, C as c, Cn as l, Ct as u, D as d, Dn as f, Dt as p, E as m, En as h, Et as g, F as _, Fn as v, Ft as y, G as b, Gt as x, H as S, Ht as C, I as w, In as T, It as E, J as D, Jt as O, K as k, Kt as A, L as j, Ln as M, Lt as N, M as P, Mn as F, Mt as I, N as L, Nn as R, Nt as z, O as B, On as V, Ot as H, P as U, Pn as W, Pt as G, Q as K, Qt as q, R as J, Rn as Y, Rt as X, S as Z, Sn as Q, St as $, T as ee, Tn as te, Tt as ne, U as re, Ut as ie, V as ae, Vt as oe, W as se, Wt as ce, X as le, Xt as ue, Y as de, Yt as fe, Z as pe, Zt as me, _ as he, _n as ge, _t as _e, a as ve, an as ye, at as be, b as xe, bn as Se, bt as Ce, c as we, cn as Te, ct as Ee, d as De, dn as Oe, dt as ke, en as Ae, et as je, f as Me, fn as Ne, ft as Pe, g as Fe, gn as Ie, gt as Le, h as Re, hn as ze, ht as Be, i as Ve, in as He, it as Ue, j as We, jn as Ge, jt as Ke, k as qe, kn as Je, kt as Ye, l as Xe, ln as Ze, lt as Qe, m as $e, mn as et, mt as tt, n as nt, nn as rt, nt as it, o as at, on as ot, ot as st, p as ct, pn as lt, pt as ut, q as dt, qt as ft, r as pt, rn as mt, rt as ht, s as gt, sn as _t, st as vt, t as yt, tn as bt, tt as xt, u as St, un as Ct, ut as wt, v as Tt, vn as Et, vt as Dt, w as Ot, wn as kt, wt as At, x as jt, xn as Mt, xt as Nt, y as Pt, yn as Ft, yt as It, z as Lt, zn as Rt, zt } from "./ui-yIg-1YXY.js";
2
2
  import { J as Bt, Y as Vt, _t as Ht, a as Ut, at as Wt, c as Gt, ct as Kt, dt as qt, ft as Jt, gt as Yt, ht as Xt, i as Zt, it as Qt, l as $t, lt as en, mt as tn, n as nn, nt as rn, o as an, ot as on, pt as sn, r as cn, rt as ln, s as un, st as dn, t as fn, ut as pn, vt as mn } from "./InUseShell-CY5Acw6t.js";
3
3
  import { n as hn, t as gn } from "./ChartLine-Cycmpjep.js";
4
4
  export { rn as AccentLegend, Ae as Accordion, H as ApprovalBar, Ze as Avatar, Ct as AvatarGroup, Ht as BrandMark, Ft as Breadcrumb, Y as Button, Rt as ButtonGroup, Q as Card, l as CardImg, hn as ChartBar, gn as ChartLine, Ge as Checkbox, Le as CheckpointMarker, h as Chip, be as CliSteps, st as CommandBlock, C as CommandPalette, Vt as CommitGraph, ne as ConfirmInline, ke as ConnectionPill, Ke as ConsentDialog, I as ConsentSummary, f as CountBadge, ce as DATE_PRESETS, g as DangerZone, Pe as DataState, rt as DataTable, x as DateRange, A as DateRangeCalendar, ie as Dialog, Bt as DiffView, se as ENTRY_TYPES, Te as EmptyState, Nt as EvidenceCaption, $ as EvidenceTarget, y as Explainer, Ue as FacetRail, mt as FeedbackPanel, W as Field, V as FilterChip, le as FocusedModeToggle, fn as GRAPH_APP_SECTIONS, yt as GRAPH_LEGEND_ITEMS, vt as GettingStarted, je as GovTile, nn as GraphAppShell, nt as GraphLegend, cn as GraphSectionNav, pt as GraphSubagentBranch, Ve as GraphToolNode, ve as GraphTurnNode, u as GroupedMultiSelect, b as HARNESSES, Ee as HandleClaim, dn as Heatmap, Zt as IN_USE_APPS, Ut as InUseShell, v as Input, Kt as IntensityScope, en as IntensitySwatch, Oe as Kbd, Ne as KbdChord, $t as MapCanvas, pn as MapNode, Ie as Menu, kt as MetaItem, Ye as ModerationQueue, Qe as OnboardingCard, ln as PROVIDER_ACCENT, Et as Pager, ge as Pagination, _e as Phase, Dt as PhaseDivider, i as PolicySelect, et as Popover, He as Progress, xt as ProviderBars, Qt as ProviderIcon, Wt as ProviderName, on as ProviderTag, k as ROLES, F as Radio, R as RadioGroup, an as RailSection, un as RailShell, qt as RampLegend, z as RedactionReview, p as RoleRoster, te as Row, dt as SESSION_OUTCOMES, D as STOP_REASONS, pe as ScopeChip, o as Segmented, T as Select, wt as SignInProviders, ye as Skeleton, bt as Sparkline, ot as Spinner, Gt as SplitRail, it as StatGrid, ht as StatTile, Je as StatusDot, X as StepIndicator, zt as StepWizard, Se as Steps, At as StepsWaterfall, r as Switch, de as TOOL_CALL_KINDS, re as TOOL_GROUPS, Mt as Tabs, lt as Tag, It as TaskBoundary, ut as TeachingEmptyState, E as Term, M as Textarea, ue as ThinkingBlock, N as TimeStrip, me as Timeline, q as TimelineItem, _t as Toast, O as ToastProvider, t as ToolCall, Be as ToolCallRenderer, ze as Tooltip, tt as Tour, Pt as TranscriptCheckRow, m as TranscriptDiffEntryCard, d as TranscriptDiffHunks, xe as TranscriptFilterSection, he as TranscriptFiltersRail, $e as TranscriptLabelPopover, qe as TranscriptMarkdown, jt as TranscriptOutlineRail, Re as TranscriptScorecard, Fe as TranscriptScrubber, ee as TranscriptTaskBody, B as TranscriptThinking, Ot as TranscriptToolBody, c as TranscriptToolCall, Z as TranscriptTurnCard, Tt as TranscriptViewSwitch, at as TranscriptViewer, s as Treemap, Ce as TurnContextBar, K as VisibilityEye, e as VisibilitySegmented, G as WhereDoesThisGo, n as adaptTranscript, we as advanceTranscriptInitialPositionConsumption, L as annotateTranscript, U as assessScorecard, _ as buildTaskWaterfall, w as computeAnalytics, j as computePersonalMedians, J as computeTaskGroups, Lt as computeTasks, a as computeTurnLabels, Jt as coverageLevel, ae as detectPhases, We as diffLines, sn as effortLevel, ft as formatRange, tn as locSize, Xe as normalizeTranscriptInitialPosition, S as phaseLabel, P as prefilterTurns, Xt as providerAccent, Yt as providerDisplayName, mn as resolveBrand, St as resolveTranscriptInitialPosition, De as shouldApplyTranscriptInitialPosition, oe as squarify, Me as transcriptInitialPositionReadiness, ct as transcriptInitialPositionToken, fe as useToast, gt as useTranscriptInitialPosition };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@peasant-labs/fairtrade",
3
3
  "private": false,
4
- "version": "0.0.16",
4
+ "version": "0.0.17",
5
5
  "description": "Fairtrade design-system library: canonical tokens, base styles, component CSS, and React UI exports.",
6
6
  "type": "module",
7
7
  "license": "Apache-2.0",
@@ -101,6 +101,7 @@
101
101
  "test:explore-page-intent:mutations": "node scripts/explore-page-intent.mutations.mjs",
102
102
  "test:transcript-schema-adapter": "node scripts/transcript-schema-adapter.test.mjs",
103
103
  "test:transcript-schema-adapter:mutations": "node scripts/transcript-schema-adapter.mutations.mjs",
104
+ "test:transcript-filters": "node scripts/transcript-filters.test.mjs",
104
105
  "test:transcript-turn-model": "node scripts/transcript-turn-model.test.mjs",
105
106
  "test:transcript-turn-model:mutations": "node scripts/transcript-turn-model.mutations.mjs",
106
107
  "test:provider-harnesses": "node scripts/provider-harnesses.test.mjs",
@@ -120,7 +121,7 @@
120
121
  "smoke:changes": "node scripts/smoke-changes.mjs",
121
122
  "test:changes-overflow": "node scripts/changes-overflow.test.mjs",
122
123
  "shoot:manage": "node scripts/shootmanage.mjs",
123
- "build:lib": "pnpm test:package-provenance && pnpm test:contract && pnpm test:runtime-floor && pnpm test:code-map-state && pnpm test:code-map-ranking && pnpm test:code-map-ranking:mutations && pnpm test:code-map-ranking:bench && pnpm test:timeline-encoding-channels && pnpm test:timeline-highlight && pnpm test:code-map-interactions && pnpm test:code-map-drag-smoothness && pnpm test:code-map-wheel-zoom && pnpm test:code-map-descent-feedback && pnpm test:timeline-navigation && pnpm test:transcript-initial-position && pnpm test:transcript-initial-position:render && pnpm test:transcript-initial-position:mutations && pnpm test:transcript-header-condense && pnpm test:transcript-header-condense:mutations && pnpm test:explore-page-intent && pnpm test:explore-page-intent:mutations && pnpm test:gates && node src/ui/analytics/metrics.test.mjs && node scripts/mobile-layout.test.mjs && node scripts/transcript-composite-width.test.mjs && node scripts/css-token-lint.mjs && node scripts/gen-llm-artifacts.mjs && node scripts/contrast.mjs && vite build --config vite.lib.config.js && vite build --config vite.lib-css.config.js && node scripts/finalize-lib-build.mjs && tsc -p tsconfig.lib.json && node scripts/smoke-lib.mjs && node scripts/smoke-transcript.mjs && node scripts/smoke-transcript-ui.mjs && pnpm test:transcript-markdown && pnpm test:transcript-markdown:mutations && pnpm test:graph-contract-enums && pnpm test:transcript-schema-adapter && pnpm test:transcript-schema-adapter:mutations && pnpm test:transcript-turn-model && pnpm test:transcript-turn-model:mutations && pnpm test:provider-harnesses && pnpm test:provider-harnesses:mutations && node scripts/smoke-map.mjs && node scripts/smoke-changes.mjs && pnpm test:changes-overflow && pnpm test:timeline-a11y && pnpm test:timeline-ghosts && pnpm test:insight-panel && node scripts/contrast.mjs --css dist/lib/tokens.css && node scripts/assert-pack-contents.mjs",
124
+ "build:lib": "pnpm test:package-provenance && pnpm test:contract && pnpm test:runtime-floor && pnpm test:code-map-state && pnpm test:code-map-ranking && pnpm test:code-map-ranking:mutations && pnpm test:code-map-ranking:bench && pnpm test:timeline-encoding-channels && pnpm test:timeline-highlight && pnpm test:code-map-interactions && pnpm test:code-map-drag-smoothness && pnpm test:code-map-wheel-zoom && pnpm test:code-map-descent-feedback && pnpm test:timeline-navigation && pnpm test:transcript-initial-position && pnpm test:transcript-initial-position:render && pnpm test:transcript-initial-position:mutations && pnpm test:transcript-header-condense && pnpm test:transcript-header-condense:mutations && pnpm test:explore-page-intent && pnpm test:explore-page-intent:mutations && pnpm test:gates && node src/ui/analytics/metrics.test.mjs && node scripts/mobile-layout.test.mjs && node scripts/transcript-composite-width.test.mjs && node scripts/css-token-lint.mjs && node scripts/gen-llm-artifacts.mjs && node scripts/contrast.mjs && vite build --config vite.lib.config.js && vite build --config vite.lib-css.config.js && node scripts/finalize-lib-build.mjs && tsc -p tsconfig.lib.json && node scripts/smoke-lib.mjs && node scripts/smoke-transcript.mjs && node scripts/smoke-transcript-ui.mjs && pnpm test:transcript-markdown && pnpm test:transcript-markdown:mutations && pnpm test:graph-contract-enums && pnpm test:transcript-schema-adapter && pnpm test:transcript-schema-adapter:mutations && pnpm test:transcript-filters && pnpm test:transcript-turn-model && pnpm test:transcript-turn-model:mutations && pnpm test:provider-harnesses && pnpm test:provider-harnesses:mutations && node scripts/smoke-map.mjs && node scripts/smoke-changes.mjs && pnpm test:changes-overflow && pnpm test:timeline-a11y && pnpm test:timeline-ghosts && pnpm test:insight-panel && node scripts/contrast.mjs --css dist/lib/tokens.css && node scripts/assert-pack-contents.mjs",
124
125
  "pack:check": "node scripts/assert-pack-contents.mjs",
125
126
  "smoke:tarball": "node scripts/smoke-tarball.mjs",
126
127
  "oracle:graph": "node scripts/graph-oracle.mjs",