@peasant-labs/fairtrade 0.0.48 → 0.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/dist/lib/abnfDiagram-WEYOIA3C-D4LMNFIJ.js +89 -0
  2. package/dist/lib/{adapter-DnCl_ddK.js → adapter-CVKibszh.js} +136 -126
  3. package/dist/lib/arc-1xTxsoRi.js +80 -0
  4. package/dist/lib/architecture-WOLXFQ4H-c6RsZuzu.js +3 -0
  5. package/dist/lib/architectureDiagram-ZHVYKT53-DTINqD5R.js +4145 -0
  6. package/dist/lib/array-CApNbSU9.js +6 -0
  7. package/dist/lib/blockDiagram-RJAE7QA3-CUYHoR3g.js +1946 -0
  8. package/dist/lib/c4Diagram-XDPPPE54-Cdx6_DsI.js +2990 -0
  9. package/dist/lib/channel-DagAO2vE.js +5 -0
  10. package/dist/lib/chunk-2E7WHVMD-BzhgXW3b.js +490 -0
  11. package/dist/lib/chunk-2Q5K7J3B-DWNwIK5Y.js +15 -0
  12. package/dist/lib/chunk-4EMNKR2T-DhFrQz9k.js +236 -0
  13. package/dist/lib/chunk-55XCU76K-CI0GXDkJ.js +61 -0
  14. package/dist/lib/chunk-5VM5RSS4-BAQ-46g4.js +5 -0
  15. package/dist/lib/chunk-7S6XSTFO-CMt_p-O6.js +1373 -0
  16. package/dist/lib/chunk-AQDTSKZB-DrZccIQa.js +1847 -0
  17. package/dist/lib/chunk-DSNLSHJZ-CpA9d2CJ.js +4044 -0
  18. package/dist/lib/chunk-DUW6YSOI-C-tN4Kiv.js +10 -0
  19. package/dist/lib/chunk-EJLWFMJV-B30MNYvY.js +75 -0
  20. package/dist/lib/chunk-HAGFOTED-DMU2JNZM.js +4487 -0
  21. package/dist/lib/chunk-HNE4Q36P-BIA0n2gA.js +363 -0
  22. package/dist/lib/chunk-J5ZVWO5B-CA_-jk8G.js +12 -0
  23. package/dist/lib/chunk-JWPE2WC7-KRpHbrIX.js +8 -0
  24. package/dist/lib/chunk-LNGE3PJU-CMGaAEAh.js +1513 -0
  25. package/dist/lib/chunk-NGNAAXSQ-D7Dvct7J.js +19774 -0
  26. package/dist/lib/chunk-NQOKRVIF-MK9F46y3.js +4258 -0
  27. package/dist/lib/chunk-OYAV6JZA-B1yICcbU.js +10 -0
  28. package/dist/lib/chunk-UHW7PFBP-CLrOaA0y.js +67 -0
  29. package/dist/lib/chunk-VQ5W62QI-_ZR3gKe4.js +26 -0
  30. package/dist/lib/chunk-WQQL4CDK-DFtyhYZq.js +693 -0
  31. package/dist/lib/chunk-XXDRQBXY-uzyNBbgx.js +9 -0
  32. package/dist/lib/chunk-Y2CYZVJY-BYzrzvCI.js +12 -0
  33. package/dist/lib/chunk-YZO67HFG-D1jKt78p.js +275 -0
  34. package/dist/lib/chunk-ZAUX2LTX-7XO0Yj1z.js +37 -0
  35. package/dist/lib/chunk-ZCHMQSOR-CxoKltfF.js +349 -0
  36. package/dist/lib/classDiagram-v2-4MYWR3UA-BPvwhZqw.js +3397 -0
  37. package/dist/lib/commons.js +729 -729
  38. package/dist/lib/components.css +1 -1
  39. package/dist/lib/cose-bilkent-JH36ORCC-Oj79uOIQ.js +2250 -0
  40. package/dist/lib/cynefin-EF2NZ3EQ-COX3NRum.js +3 -0
  41. package/dist/lib/cynefinDiagram-WF24UDRP-UzTptNAX.js +349 -0
  42. package/dist/lib/cytoscape.esm-0ojxgO9x.js +18161 -0
  43. package/dist/lib/dagre-NK4GIZVX-DWZr-NGm.js +2356 -0
  44. package/dist/lib/defaultLocale-BbgDuMnp.js +201 -0
  45. package/dist/lib/diagram-CBK3MWTC-CsyKuv-w.js +525 -0
  46. package/dist/lib/diagram-I5XIIV2D-DWY2JSPC.js +134 -0
  47. package/dist/lib/diagram-ODIL2UCW-DUptj0JZ.js +301 -0
  48. package/dist/lib/diagram-PFBEJUXE-N5XnIBqM.js +447 -0
  49. package/dist/lib/diagram-RJA3I4VV-B9XgohYo.js +214 -0
  50. package/dist/lib/diagram-TYUNFSNR-XnsJIeAd.js +5084 -0
  51. package/dist/lib/dist-AMlsjiDX.js +59 -0
  52. package/dist/lib/ebnfDiagram-V4P3TTPT-BssHqFox.js +100 -0
  53. package/dist/lib/elk-QONTBCTQ-DwmwqYgP.js +47944 -0
  54. package/dist/lib/erDiagram-KYQIGQAA-BQiXw1Tw.js +1970 -0
  55. package/dist/lib/eventmodeling-K75KTNOO-DDb--yMc.js +3 -0
  56. package/dist/lib/flowDiagram-IUGLLWBU-BEqqF1y2.js +17 -0
  57. package/dist/lib/ganttDiagram-R7GPNTJY-BWtGXxEF.js +3094 -0
  58. package/dist/lib/gitGraph-VSP46ZUC-BSwOaak_.js +3 -0
  59. package/dist/lib/gitGraphDiagram-PDYL7XHY-CHGNuGbk.js +729 -0
  60. package/dist/lib/graphlib-Dndp26xU.js +1267 -0
  61. package/dist/lib/info-OHQRW6UA-Dk06sZRe.js +3 -0
  62. package/dist/lib/infoDiagram-MVDRKAX5-Cdhxnjmi.js +20 -0
  63. package/dist/lib/init-Bwwdo3M6.js +15 -0
  64. package/dist/lib/ishikawaDiagram-HPEHV2GE-Dzhti-GJ.js +719 -0
  65. package/dist/lib/journeyDiagram-BOSHW7O7-C3_vsSjw.js +884 -0
  66. package/dist/lib/kanban-definition-FNSA4HC5-XsfCEsjn.js +976 -0
  67. package/dist/lib/katex-Dw0PnoPU.js +21850 -0
  68. package/dist/lib/line-C9krU3Sv.js +34 -0
  69. package/dist/lib/linear-Cvilv3OA.js +289 -0
  70. package/dist/lib/mermaid-parser.core-I7qQ_fxz.js +638 -0
  71. package/dist/lib/mermaid.core-UNHMAbBP.js +1126 -0
  72. package/dist/lib/mindmap-definition-6OY57UG3-CAua-JvB.js +1011 -0
  73. package/dist/lib/ordinal-C55HfHHp.js +65 -0
  74. package/dist/lib/packet-JDAUHWVQ-DZ-MKx4I.js +3 -0
  75. package/dist/lib/path-DNvJyUE8.js +85 -0
  76. package/dist/lib/pegDiagram-ECIUJNBX-BCxa_IO0.js +94 -0
  77. package/dist/lib/pie-XZMESJXO-DpCa-Nnq.js +3 -0
  78. package/dist/lib/pieDiagram-GNMPY74T-CE_C3dCB.js +205 -0
  79. package/dist/lib/quadrantDiagram-D57K4MC3-CDgzdMoL.js +2001 -0
  80. package/dist/lib/radar-ABXABTNO-BOVK7L9p.js +3 -0
  81. package/dist/lib/railroad-I3PHUGI6-B6spKM0Z.js +3 -0
  82. package/dist/lib/railroad-abnf-LNEFI6M7-DEWqfByZ.js +3 -0
  83. package/dist/lib/railroad-ebnf-DWYD2UWJ-CWRLtxHB.js +3 -0
  84. package/dist/lib/railroad-peg-JR7BVNR7-C-3NHSsk.js +3 -0
  85. package/dist/lib/railroadDiagram-Y72NRBL7-a8YVk8LT.js +76 -0
  86. package/dist/lib/requirementDiagram-EQYSW5RA-B9HolqxU.js +2228 -0
  87. package/dist/lib/rough.esm-a8mysczE.js +1352 -0
  88. package/dist/lib/sankeyDiagram-SY24JHO5-CLFMtMJG.js +970 -0
  89. package/dist/lib/sequenceDiagram-BLEHNHQU-B5wfSV85.js +4253 -0
  90. package/dist/lib/share.js +1 -1
  91. package/dist/lib/sizeCapture-INFHLROL-BWGCc9aa.js +46 -0
  92. package/dist/lib/src-Dcy0zUZH.js +2153 -0
  93. package/dist/lib/stateDiagram-v2-A6IESKWZ-C92vye4N.js +2143 -0
  94. package/dist/lib/swimlanes-B3ENRKFQ-B6-i-tPc.js +4764 -0
  95. package/dist/lib/swimlanesDiagram-AYQRV4AK-CbkBeql-.js +28 -0
  96. package/dist/lib/timeline-definition-JXYKGLGB-D2Ip4r72.js +1073 -0
  97. package/dist/lib/treeView-D4JQ5SDB-CFaKQ_2T.js +3 -0
  98. package/dist/lib/treemap-SAJKECNS-BQ6z7Z3g.js +3 -0
  99. package/dist/lib/types/AppSidebar.d.ts +14 -1
  100. package/dist/lib/types/transcript/Collapsible.d.ts +2 -1
  101. package/dist/lib/types/transcript/Markdown.d.ts +1 -0
  102. package/dist/lib/types/transcript/MermaidBlock.d.ts +3 -0
  103. package/dist/lib/types/transcript/SearchHighlights.d.ts +7 -0
  104. package/dist/lib/types/transcript/ToolBody.d.ts +1 -0
  105. package/dist/lib/types/transcript/TranscriptViewer.d.ts +1 -1
  106. package/dist/lib/types/transcript/UnverifiedPullRequests.d.ts +12 -0
  107. package/dist/lib/types/transcript/index.d.ts +1 -0
  108. package/dist/lib/types/transcript/mermaidSource.d.ts +2 -0
  109. package/dist/lib/types/transcript/mermaidSvg.d.ts +1 -0
  110. package/dist/lib/types/transcript/search-highlights.d.ts +2 -0
  111. package/dist/lib/types/transcript/state-capabilities.d.ts +28 -8
  112. package/dist/lib/types/transcript/tool-state-key.d.ts +2 -0
  113. package/dist/lib/types/transcript/useReaderWidthAnchor.d.ts +20 -0
  114. package/dist/lib/types/transcript/view-model.d.ts +14 -0
  115. package/dist/lib/types/ui/transcript/view-model.d.ts +14 -0
  116. package/dist/lib/{ui-BLiaBlAK.js → ui-BOGaFxV-.js} +5212 -4194
  117. package/dist/lib/ui.js +6 -6
  118. package/dist/lib/usecaseDiagram-WPOLBNNX-BK1Anch1.js +7190 -0
  119. package/dist/lib/vennDiagram-Q3Y3IDCW-B6YTBqTS.js +1880 -0
  120. package/dist/lib/wardley-7MLQ67FV-DChYwu4i.js +3 -0
  121. package/dist/lib/wardleyDiagram-IVAIDKWA-D5I1qLUK.js +645 -0
  122. package/dist/lib/xychartDiagram-4URNHDU4-B6RXyhTO.js +2218 -0
  123. package/package.json +4 -3
@@ -165,16 +165,16 @@ function x(e) {
165
165
  let r = Array(e.length), i = 0, a = 0;
166
166
  for (let t = 0; t < e.length; t++) {
167
167
  let e = n.get(t);
168
- e === void 0 ? i === 0 ? r[t] = `${t + 1}` : (a += 1, r[t] = `${i}${ee(a)}`) : (i = e, a = 0, r[t] = `${i}`);
168
+ e === void 0 ? i === 0 ? r[t] = `${t + 1}` : (a += 1, r[t] = `${i}${S(a)}`) : (i = e, a = 0, r[t] = `${i}`);
169
169
  }
170
170
  return r;
171
171
  }
172
- function ee(e) {
172
+ function S(e) {
173
173
  let t = "", n = e;
174
174
  for (; n > 0;) t = String.fromCharCode(97 + (n - 1) % 26) + t, n = Math.floor((n - 1) / 26);
175
175
  return t;
176
176
  }
177
- function te(e) {
177
+ function C(e) {
178
178
  let t = e.reduce((e, t) => e + Math.max(0, t.durationMs), 0), n = 0;
179
179
  return e.map((e) => {
180
180
  let r = Math.max(0, e.durationMs), i = t > 0 ? n / t * 100 : 0, a = t > 0 ? r / t * 100 : 0;
@@ -186,17 +186,17 @@ function te(e) {
186
186
  };
187
187
  });
188
188
  }
189
- var ne = /* @__PURE__ */ new Set([
189
+ var ee = /* @__PURE__ */ new Set([
190
190
  "Task",
191
191
  "EnterWorktree",
192
192
  "SendMessage",
193
193
  "TeamCreate"
194
- ]), re = /* @__PURE__ */ new Set([
194
+ ]), te = /* @__PURE__ */ new Set([
195
195
  "Write",
196
196
  "Edit",
197
197
  "NotebookEdit"
198
198
  ]);
199
- function S(e) {
199
+ function w(e) {
200
200
  let t = [], n = [], r = /* @__PURE__ */ new Map();
201
201
  for (let i = 0; i < e.length; i++) {
202
202
  let a = e[i];
@@ -206,12 +206,12 @@ function S(e) {
206
206
  type: "error",
207
207
  label: `${e.name} failed`,
208
208
  severity: "error"
209
- }), ne.has(e.name) && t.push({
209
+ }), ee.has(e.name) && t.push({
210
210
  turnIndex: i,
211
211
  type: "subagent",
212
212
  label: `Subagent: ${e.name}`,
213
213
  severity: "info"
214
- }), re.has(e.name)) {
214
+ }), te.has(e.name)) {
215
215
  let t = f(e);
216
216
  if (t) {
217
217
  let e = r.get(t) ?? [];
@@ -240,7 +240,7 @@ function S(e) {
240
240
  }
241
241
  return t.sort((e, t) => e.turnIndex - t.turnIndex);
242
242
  }
243
- var ie = {
243
+ var ne = {
244
244
  planning: "Planning",
245
245
  exploration: "Exploration",
246
246
  implementation: "Implementation",
@@ -252,20 +252,20 @@ var ie = {
252
252
  recovery: "Recovery",
253
253
  abandonment: "Abandonment"
254
254
  };
255
- function C(e) {
256
- return ie[e] ?? String(e);
255
+ function T(e) {
256
+ return ne[e] ?? String(e);
257
257
  }
258
- var w = /* @__PURE__ */ new Set([
258
+ var E = /* @__PURE__ */ new Set([
259
259
  "Read",
260
260
  "Glob",
261
261
  "Grep",
262
262
  "WebSearch",
263
263
  "WebFetch"
264
- ]), T = /* @__PURE__ */ new Set([
264
+ ]), D = /* @__PURE__ */ new Set([
265
265
  "Write",
266
266
  "Edit",
267
267
  "NotebookEdit"
268
- ]), ae = [
268
+ ]), re = [
269
269
  /\btest\b/i,
270
270
  /\bjest\b/i,
271
271
  /\bpytest\b/i,
@@ -278,21 +278,21 @@ var w = /* @__PURE__ */ new Set([
278
278
  /\bmocha\b/i,
279
279
  /\brspec\b/i
280
280
  ];
281
- function oe(e, t) {
281
+ function ie(e, t) {
282
282
  return e.toolCalls?.some((e) => t.has(e.name)) ?? !1;
283
283
  }
284
- function se(e, t) {
284
+ function ae(e, t) {
285
285
  return e.toolCalls?.length ? e.toolCalls.every((e) => t.has(e.name)) : !1;
286
286
  }
287
- function E(e) {
287
+ function O(e) {
288
288
  for (let t of e.toolCalls ?? []) if (t.isError || t.exitCode !== void 0 && t.exitCode !== null && t.exitCode !== 0) return !0;
289
289
  return !1;
290
290
  }
291
- function ce(e) {
292
- for (let t of e.toolCalls ?? []) if (t.name === "Bash" && ae.some((e) => e.test(t.arguments))) return !0;
291
+ function oe(e) {
292
+ for (let t of e.toolCalls ?? []) if (t.name === "Bash" && re.some((e) => e.test(t.arguments))) return !0;
293
293
  return !1;
294
294
  }
295
- function le(e) {
295
+ function se(e) {
296
296
  let t = [], n = [], r = -1;
297
297
  for (let i = 0; i < e.length; i++) {
298
298
  let a = e[i];
@@ -302,7 +302,7 @@ function le(e) {
302
302
  }
303
303
  if (a.toolCalls?.length) {
304
304
  r < 0 && (r = i);
305
- 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) => T.has(e) || e === "Bash") && t.push({
305
+ 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) => D.has(e) || e === "Bash") && t.push({
306
306
  tools: [...n],
307
307
  turnRange: [r, i]
308
308
  }), n = [], r = -1);
@@ -310,20 +310,20 @@ function le(e) {
310
310
  }
311
311
  return t;
312
312
  }
313
- function ue(e, t) {
313
+ function ce(e, t) {
314
314
  let n = new Set(e), r = new Set(t), i = [...n].filter((e) => r.has(e)).length, a = (/* @__PURE__ */ new Set([...n, ...r])).size;
315
315
  return a > 0 ? i / a : 0;
316
316
  }
317
- function de(e) {
318
- let t = le(e), n = [], r = 0;
317
+ function le(e) {
318
+ let t = se(e), n = [], r = 0;
319
319
  for (; r < t.length;) {
320
320
  let e = r + 1;
321
- for (; e < t.length && ue(t[r].tools, t[e].tools) >= .5;) e++;
321
+ for (; e < t.length && ce(t[r].tools, t[e].tools) >= .5;) e++;
322
322
  e - r >= 2 && n.push([t[r].turnRange[0], t[e - 1].turnRange[1]]), r = e;
323
323
  }
324
324
  return n;
325
325
  }
326
- var fe = [
326
+ var ue = [
327
327
  /\bi already said\b/i,
328
328
  /\bi told you\b/i,
329
329
  /\bno,?\s+not that\b/i,
@@ -331,18 +331,18 @@ var fe = [
331
331
  /\bnot what i asked\b/i,
332
332
  /\bwrong,?\s+i\b/i,
333
333
  /\bplease (re-?read|read again)\b/i
334
- ], pe = /\b(let'?s move on|forget it|different approach|never mind)\b/i;
335
- function me(e, t, n, r, i) {
334
+ ], de = /\b(let'?s move on|forget it|different approach|never mind)\b/i;
335
+ function fe(e, t, n, r, i) {
336
336
  for (let [e, n] of i) if (t >= e && t <= n) return "retry-loop";
337
- return e.role === "user" ? fe.some((t) => t.test(e.content)) ? "user-correction" : n ?? "planning" : E(e) ? "error" : ce(e) ? "testing" : r > 0 && se(e, w) ? "debug" : oe(e, T) ? n === "retry-loop" || n === "user-correction" ? "recovery" : "implementation" : se(e, w) && r === 0 ? "exploration" : e.role === "assistant" && !e.toolCalls?.length && e.content.length > 100 ? "planning" : n ?? "planning";
337
+ return e.role === "user" ? ue.some((t) => t.test(e.content)) ? "user-correction" : n ?? "planning" : O(e) ? "error" : oe(e) ? "testing" : r > 0 && ae(e, E) ? "debug" : ie(e, D) ? n === "retry-loop" || n === "user-correction" ? "recovery" : "implementation" : ae(e, E) && r === 0 ? "exploration" : e.role === "assistant" && !e.toolCalls?.length && e.content.length > 100 ? "planning" : n ?? "planning";
338
338
  }
339
- var he = /* @__PURE__ */ new Set([
339
+ var pe = /* @__PURE__ */ new Set([
340
340
  "error",
341
341
  "user-correction",
342
342
  "retry-loop",
343
343
  "abandonment"
344
344
  ]);
345
- function ge(e) {
345
+ function me(e) {
346
346
  if (e.length <= 1) return e;
347
347
  let t = [];
348
348
  for (let n = 0; n < e.length; n++) {
@@ -351,7 +351,7 @@ function ge(e) {
351
351
  a.endTurn = r.endTurn;
352
352
  continue;
353
353
  }
354
- if (i < 3 && !he.has(r.type) && a) {
354
+ if (i < 3 && !pe.has(r.type) && a) {
355
355
  a.endTurn = r.endTurn;
356
356
  let e = a.badges.find((e) => e.type === r.type);
357
357
  e ? e.count += i : a.badges.push({
@@ -379,15 +379,15 @@ function ge(e) {
379
379
  }
380
380
  return t;
381
381
  }
382
- function _e(e) {
382
+ function he(e) {
383
383
  if (e.length === 0) return [];
384
- let t = de(e), n = [];
384
+ let t = le(e), n = [];
385
385
  for (let r = 0; r < e.length; r++) {
386
386
  let i = 0;
387
- for (let t = Math.max(0, r - 3); t < r; t++) E(e[t]) && i++;
387
+ for (let t = Math.max(0, r - 3); t < r; t++) O(e[t]) && i++;
388
388
  let a = n.length > 0 ? n[n.length - 1].type : null;
389
389
  n.push({
390
- type: me(e[r], r, a, i, t),
390
+ type: fe(e[r], r, a, i, t),
391
391
  turn: r
392
392
  });
393
393
  }
@@ -399,8 +399,8 @@ function _e(e) {
399
399
  badges: []
400
400
  });
401
401
  if (i && r.push(i), r.length > 0) {
402
- let t = e[e.length - 1], n = r[r.length - 1], i = E(t) && t.role === "assistant", a = t.role === "user" && pe.test(t.content), o = !e.slice(Math.floor(e.length * .8)).some((e) => oe(e, T));
403
- if ((i || a || o && n.type !== "planning") && (e.filter(E).length > 0 || a) && n.type !== "abandonment") {
402
+ let t = e[e.length - 1], n = r[r.length - 1], i = O(t) && t.role === "assistant", a = t.role === "user" && de.test(t.content), o = !e.slice(Math.floor(e.length * .8)).some((e) => ie(e, D));
403
+ if ((i || a || o && n.type !== "planning") && (e.filter(O).length > 0 || a) && n.type !== "abandonment") {
404
404
  let t = e.length - 1;
405
405
  r.push({
406
406
  type: "abandonment",
@@ -410,15 +410,15 @@ function _e(e) {
410
410
  });
411
411
  }
412
412
  }
413
- return ge(r);
413
+ return me(r);
414
414
  }
415
- function D(e) {
416
- return _e(e).map((t, n) => {
415
+ function k(e) {
416
+ return he(e).map((t, n) => {
417
417
  let r = 0;
418
- for (let n = t.startTurn; n <= t.endTurn; n++) e[n] && E(e[n]) && r++;
418
+ for (let n = t.startTurn; n <= t.endTurn; n++) e[n] && O(e[n]) && r++;
419
419
  let i = {
420
420
  id: `phase-${n + 1}`,
421
- label: C(t.type),
421
+ label: T(t.type),
422
422
  from: e[t.startTurn]?.index ?? t.startTurn,
423
423
  to: e[t.endTurn]?.index ?? t.endTurn,
424
424
  icon: t.type
@@ -426,71 +426,71 @@ function D(e) {
426
426
  return r > 0 && (i.errors = r), i;
427
427
  });
428
428
  }
429
- function O(e) {
429
+ function A(e) {
430
430
  let t = e.filter((e) => Number.isFinite(e)).sort((e, t) => e - t);
431
431
  if (t.length === 0) return;
432
432
  let n = Math.floor(t.length / 2);
433
433
  return t.length % 2 == 0 ? (t[n - 1] + t[n]) / 2 : t[n];
434
434
  }
435
- function ve(e) {
435
+ function ge(e) {
436
436
  if (!e || e.length === 0) return {};
437
437
  let t = [], n = [], r = [];
438
438
  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);
439
- let i = {}, a = O(t), o = O(n), s = O(r);
439
+ let i = {}, a = A(t), o = A(n), s = A(r);
440
440
  return a !== void 0 && (i.retryShare = a), o !== void 0 && (i.specQualityScore = o), s !== void 0 && (i.withinSessionReverts = s), i;
441
441
  }
442
- var k = .2, A = 70, j = 50, M = 40, N = 30, P = 4, F = 3;
443
- function I(e) {
442
+ var j = .2, M = 70, N = 50, P = 40, F = 30, I = 4, L = 3;
443
+ function R(e) {
444
444
  return e != null;
445
445
  }
446
- function L(e) {
446
+ function z(e) {
447
447
  return e === "bad" ? 2 : +(e === "watch");
448
448
  }
449
- function R(e) {
450
- return e.reduce((e, t) => L(t) > L(e) ? t : e, "good");
449
+ function B(e) {
450
+ return e.reduce((e, t) => z(t) > z(e) ? t : e, "good");
451
451
  }
452
- function z(e, t = {}) {
452
+ function V(e, t = {}) {
453
453
  if (!e) return [];
454
454
  let n = [];
455
455
  {
456
- let r = [], i = [], a = I(e.totalTokens) && (e.totalTokens ?? 0) > 0 && I(e.retryTokensWasted) ? (e.retryTokensWasted ?? 0) / (e.totalTokens ?? 1) : void 0;
457
- if (a !== void 0 && (r.push(a > k ? "bad" : "good"), a > k && i.push(`${Math.round(a * 100)}% of tokens spent on retries`)), I(e.m5ContextUtilizationPct)) {
456
+ let r = [], i = [], a = R(e.totalTokens) && (e.totalTokens ?? 0) > 0 && R(e.retryTokensWasted) ? (e.retryTokensWasted ?? 0) / (e.totalTokens ?? 1) : void 0;
457
+ if (a !== void 0 && (r.push(a > j ? "bad" : "good"), a > j && i.push(`${Math.round(a * 100)}% of tokens spent on retries`)), R(e.m5ContextUtilizationPct)) {
458
458
  let t = e.m5ContextUtilizationPct ?? 0;
459
- r.push(t > A ? "watch" : "good"), t > A && i.push(`Context ${Math.round(t)}% full`);
459
+ r.push(t > M ? "watch" : "good"), t > M && i.push(`Context ${Math.round(t)}% full`);
460
460
  }
461
- if (I(e.m6OutputSurvivalPct)) {
461
+ if (R(e.m6OutputSurvivalPct)) {
462
462
  let t = e.m6OutputSurvivalPct ?? 0;
463
- r.push(t < j ? "watch" : "good"), t < j && i.push(`Only ${Math.round(t)}% of output survived`);
463
+ r.push(t < N ? "watch" : "good"), t < N && i.push(`Only ${Math.round(t)}% of output survived`);
464
464
  }
465
- e.outcome === "failed" && I(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 || I(e.m5ContextUtilizationPct) || I(e.m6OutputSurvivalPct)) && n.push(B("token", "Token efficiency", a === void 0 ? I(e.m5ContextUtilizationPct) ? `${Math.round(e.m5ContextUtilizationPct ?? 0)}% context used` : "—" : `${Math.round(a * 100)}% retry tokens`, R(r), i));
465
+ e.outcome === "failed" && R(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 || R(e.m5ContextUtilizationPct) || R(e.m6OutputSurvivalPct)) && n.push(H("token", "Token efficiency", a === void 0 ? R(e.m5ContextUtilizationPct) ? `${Math.round(e.m5ContextUtilizationPct ?? 0)}% context used` : "—" : `${Math.round(a * 100)}% retry tokens`, B(r), i));
466
466
  }
467
467
  {
468
468
  let t = [], r = [];
469
- if (I(e.specQualityScore)) {
469
+ if (R(e.specQualityScore)) {
470
470
  let n = e.specQualityScore ?? 0;
471
- t.push(n < M ? "bad" : "good"), n < M && r.push(`Spec quality low (${Math.round(n)}/100)`);
471
+ t.push(n < P ? "bad" : "good"), n < P && r.push(`Spec quality low (${Math.round(n)}/100)`);
472
472
  }
473
- if (I(e.signalDensity)) {
473
+ if (R(e.signalDensity)) {
474
474
  let n = e.signalDensity ?? 0;
475
- t.push(n < N ? "watch" : "good"), n < N && r.push(`Sparse direction (${Math.round(n)}% signal)`);
475
+ t.push(n < F ? "watch" : "good"), n < F && r.push(`Sparse direction (${Math.round(n)}% signal)`);
476
476
  }
477
- 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")), (I(e.specQualityScore) || I(e.signalDensity) || I(e.m7SpecHasExamples) || I(e.m7SpecHasConstraints)) && n.push(B("prompt", "Prompt quality", I(e.specQualityScore) ? `Spec ${Math.round(e.specQualityScore ?? 0)}/100` : I(e.signalDensity) ? `${Math.round(e.signalDensity ?? 0)}% signal` : "—", R(t), r));
477
+ 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")), (R(e.specQualityScore) || R(e.signalDensity) || R(e.m7SpecHasExamples) || R(e.m7SpecHasConstraints)) && n.push(H("prompt", "Prompt quality", R(e.specQualityScore) ? `Spec ${Math.round(e.specQualityScore ?? 0)}/100` : R(e.signalDensity) ? `${Math.round(e.signalDensity ?? 0)}% signal` : "—", B(t), r));
478
478
  }
479
479
  {
480
480
  let t = [], r = [];
481
- if (I(e.m4ConsecutiveErrorMax)) {
481
+ if (R(e.m4ConsecutiveErrorMax)) {
482
482
  let n = e.m4ConsecutiveErrorMax ?? 0;
483
- t.push(n >= P ? "bad" : "good"), n >= P && r.push(`${n} errors in a row`);
483
+ t.push(n >= I ? "bad" : "good"), n >= I && r.push(`${n} errors in a row`);
484
484
  }
485
- if (I(e.withinSessionReverts)) {
485
+ if (R(e.withinSessionReverts)) {
486
486
  let n = e.withinSessionReverts ?? 0;
487
- t.push(n >= F ? "bad" : "good"), n >= F && r.push(`${n} reverts mid-session`);
487
+ t.push(n >= L ? "bad" : "good"), n >= L && r.push(`${n} reverts mid-session`);
488
488
  }
489
- (I(e.m4ConsecutiveErrorMax) || I(e.withinSessionReverts)) && n.push(B("loop", "Loop efficiency", I(e.m4ConsecutiveErrorMax) ? `${e.m4ConsecutiveErrorMax ?? 0} max error streak` : I(e.withinSessionReverts) ? `${e.withinSessionReverts ?? 0} reverts` : "—", R(t), r));
489
+ (R(e.m4ConsecutiveErrorMax) || R(e.withinSessionReverts)) && n.push(H("loop", "Loop efficiency", R(e.m4ConsecutiveErrorMax) ? `${e.m4ConsecutiveErrorMax ?? 0} max error streak` : R(e.withinSessionReverts) ? `${e.withinSessionReverts ?? 0} reverts` : "—", B(t), r));
490
490
  }
491
491
  return n;
492
492
  }
493
- function B(e, t, n, r, i) {
493
+ function H(e, t, n, r, i) {
494
494
  let a = {
495
495
  id: e,
496
496
  label: t,
@@ -500,7 +500,7 @@ function B(e, t, n, r, i) {
500
500
  };
501
501
  return i.length && (a.flags = i, a.detail = i.join(", ")), a;
502
502
  }
503
- function ye(e, t) {
503
+ function _e(e, t) {
504
504
  let n = t[e.turnIndex]?.index ?? e.turnIndex;
505
505
  return {
506
506
  id: `pattern-${e.type}-${e.turnIndex}`,
@@ -509,7 +509,7 @@ function ye(e, t) {
509
509
  label: e.label
510
510
  };
511
511
  }
512
- function be(e, t, n) {
512
+ function ve(e, t, n) {
513
513
  let r = [];
514
514
  for (let t = e.startIndex; t <= e.endIndex; t++) {
515
515
  let e = n[t];
@@ -526,16 +526,16 @@ function be(e, t, n) {
526
526
  let a = e.filesTouched.length, o = [];
527
527
  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;
528
528
  }
529
- function V(e) {
530
- return y(e).map((t, n) => be(t, n, e));
529
+ function U(e) {
530
+ return y(e).map((t, n) => ve(t, n, e));
531
531
  }
532
- function H(e, t = {}) {
533
- let n = D(e), r = S(e).map((t) => ye(t, e)), i = V(e), a = z(t.scorecard, t.medians), o = {};
532
+ function W(e, t = {}) {
533
+ let n = k(e), r = w(e).map((t) => _e(t, e)), i = U(e), a = V(t.scorecard, t.medians), o = {};
534
534
  return n.length && (o.phases = n), a.length && (o.scorecardBands = a), r.length && (o.patternAnnotations = r), i.length && (o.taskGroups = i), o;
535
535
  }
536
536
  //#endregion
537
537
  //#region src/ui/transcript/usage.js
538
- var U = Object.freeze({
538
+ var G = Object.freeze({
539
539
  input: "input",
540
540
  output: "output",
541
541
  cacheRead: "cache read",
@@ -543,14 +543,14 @@ var U = Object.freeze({
543
543
  cacheWrite1h: "cache write 1h (subset)",
544
544
  reasoning: "reasoning (subset)",
545
545
  totalTokens: "total tokens"
546
- }), W = Object.freeze({
546
+ }), K = Object.freeze({
547
547
  input: "input",
548
548
  output: "output",
549
549
  cacheRead: "cache read",
550
550
  cacheWrite: "cache write",
551
551
  total: "total"
552
552
  });
553
- function xe(e) {
553
+ function ye(e) {
554
554
  if (e.length === 1) return e[0];
555
555
  let t = e.map((e) => {
556
556
  let [t, n = "0"] = e.toLowerCase().split("e"), [r, i = ""] = t.split(".");
@@ -561,14 +561,14 @@ function xe(e) {
561
561
  }), 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");
562
562
  return n ? (r.slice(0, -n) + "." + r.slice(-n)).replace(/\.?0+$/, "") || "0" : r;
563
563
  }
564
- function G(e) {
564
+ function be(e) {
565
565
  let n = e.flatMap((e) => [e.usage, ...(e.toolCalls ?? []).map((e) => e.usage)]).filter((e) => e != null);
566
566
  return Object.values(t).flatMap((e) => {
567
567
  let t = n.filter((t) => t.scope === e);
568
568
  if (!t.length) return [];
569
569
  let r = (n, r) => Object.entries(r).map(([r, i]) => {
570
570
  let a = t.map((e) => e[n]?.[r]).filter((e) => e != null), o = "unknown";
571
- if (a.length && n === "cost" && (o = xe(a.map(String))), a.length && n === "tokens") {
571
+ if (a.length && n === "cost" && (o = ye(a.map(String))), a.length && n === "tokens") {
572
572
  let t = a.reduce((e, t) => e + BigInt(t), 0n);
573
573
  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.`);
574
574
  o = String(t);
@@ -582,36 +582,36 @@ function G(e) {
582
582
  return [{
583
583
  scope: e,
584
584
  ownerCount: t.length,
585
- tokens: r("tokens", U),
586
- cost: r("cost", W)
585
+ tokens: r("tokens", G),
586
+ cost: r("cost", K)
587
587
  }];
588
588
  });
589
589
  }
590
590
  //#endregion
591
591
  //#region src/ui/transcript/title.js
592
- var Se = 80, Ce = "<user_query>", we = "</user_query>", Te = /^\s*(?:<([a-z][a-z0-9_-]*)>[\s\S]*?<\/\1>\s*)*<user_query>/;
593
- function K(e) {
592
+ var xe = 80, Se = "<user_query>", Ce = "</user_query>", we = /^\s*(?:<([a-z][a-z0-9_-]*)>[\s\S]*?<\/\1>\s*)*<user_query>/;
593
+ function q(e) {
594
594
  if (!e) return "";
595
- let t = Te.exec(e);
595
+ let t = we.exec(e);
596
596
  if (!t) return e;
597
- let n = t[0].length, r = e.indexOf(we, n);
597
+ let n = t[0].length, r = e.indexOf(Ce, n);
598
598
  if (r === -1) return e.slice(n).trim();
599
599
  let i = e.slice(n, r).trim(), a = e.slice(r + 13).trim();
600
- return a && !a.startsWith(Ce) ? `${i}\n\n${a}` : i;
600
+ return a && !a.startsWith(Se) ? `${i}\n\n${a}` : i;
601
601
  }
602
- function Ee(e) {
603
- return K(e).replace(/\s+/g, " ").trim();
602
+ function Te(e) {
603
+ return q(e).replace(/\s+/g, " ").trim();
604
604
  }
605
- var q = 160;
606
- function De({ title: e, hasNormalizedEvidence: t, firstTaskPrompt: n, firstUserContent: r, id: i }) {
605
+ var J = 160;
606
+ function Ee({ title: e, hasNormalizedEvidence: t, firstTaskPrompt: n, firstUserContent: r, id: i }) {
607
607
  let a = String(e ?? (t ? void 0 : n ?? r) ?? i ?? "transcript");
608
- if (a.length <= q) return a;
609
- let o = (a.codePointAt(q - 2) ?? 0) > 65535 ? q - 2 : q - 1;
608
+ if (a.length <= J) return a;
609
+ let o = (a.codePointAt(J - 2) ?? 0) > 65535 ? J - 2 : J - 1;
610
610
  return a.slice(0, o).trimEnd() + "…";
611
611
  }
612
- function J(e, t = Se) {
612
+ function De(e, t = xe) {
613
613
  if (!e) return "";
614
- let n = Ae(K(e)), { slashCommand: r, rest: i } = je(n);
614
+ let n = Ae(q(e)), { slashCommand: r, rest: i } = je(n);
615
615
  n = i;
616
616
  let a = n.replace(/<\/?[a-zA-Z][a-zA-Z0-9-]*[^>]*>/g, " ").replace(/[ \t\r\f\v]+/g, " ").trim();
617
617
  return a ? Pe(Ne(Me(a).replace(/\s+/g, " ").trim()), t) : r ? Pe(r, t) : "";
@@ -624,7 +624,7 @@ function Oe(e) {
624
624
  return n.length > 0 ? n[n.length - 1] : t;
625
625
  }
626
626
  function ke(e) {
627
- let t = e.id.slice(0, 8), n = Oe(e.project), r = J(e.promptContent, e.limit), i;
627
+ let t = e.id.slice(0, 8), n = Oe(e.project), r = De(e.promptContent, e.limit), i;
628
628
  i = n && r ? `${n}: ${r}` : n ? `${n}, ${t}` : r ? `${t} — ${r}` : `Session ${t}`;
629
629
  let a = (e.promptContent ?? i).trim() || i;
630
630
  return {
@@ -724,7 +724,7 @@ function Z(e) {
724
724
  }
725
725
  function Be(e, t, n) {
726
726
  if (n !== "cursor" || e !== "user") return;
727
- let r = K(t);
727
+ let r = q(t);
728
728
  return r === t ? void 0 : r;
729
729
  }
730
730
  function Ve(e, t) {
@@ -1105,12 +1105,12 @@ function pt(e, t, r, i) {
1105
1105
  toolCallsById: c,
1106
1106
  diffs: ct(s),
1107
1107
  files: lt(s),
1108
- tasks: Ve(l.taskGroups ?? V(d), s),
1108
+ tasks: Ve(l.taskGroups ?? U(d), s),
1109
1109
  highlights: ut(s, p, f),
1110
1110
  filterIndex: ft(s, u),
1111
1111
  analytics: l
1112
1112
  };
1113
- return e.nativeMetadata && (m.nativeMetadata = e.nativeMetadata), a && (m.usageScopes = G(o)), m.relationships = ht(e.relationships ?? [], i?.relationshipNavigation), m.earlierHistory = (e.earlierHistory ?? []).map((t, n) => {
1113
+ return e.nativeMetadata && (m.nativeMetadata = e.nativeMetadata), a && (m.usageScopes = be(o)), m.relationships = ht(e.relationships ?? [], i?.relationshipNavigation), m.earlierHistory = (e.earlierHistory ?? []).map((t, n) => {
1114
1114
  let r = `earlier-${n}`, i = $(e, t.turns, t.nativeMetadata, r);
1115
1115
  return {
1116
1116
  id: r,
@@ -1118,7 +1118,7 @@ function pt(e, t, r, i) {
1118
1118
  explanation: "ownership of this earlier history is uncertain. it is retained here, separate from current turns and input submissions.",
1119
1119
  turns: i.turns,
1120
1120
  nativeMetadata: t.nativeMetadata,
1121
- usageScopes: G(t.turns)
1121
+ usageScopes: be(t.turns)
1122
1122
  };
1123
1123
  }), m;
1124
1124
  }
@@ -1161,28 +1161,37 @@ function ht(e, t) {
1161
1161
  return r?.targetLocalId && r.targetLocalId === i?.targetLocalId && o.length === 2 && o[0].statusLabel === o[1].statusLabel && o[0].navigation?.localId === o[1].navigation?.localId && o[0].navigation?.transcriptId === o[1].navigation?.transcriptId ? (o[0].label = "context inherited from and started by", [o[0]]) : o;
1162
1162
  }
1163
1163
  function $(e, t, n, r, i, a, o) {
1164
- let s = Xe(t, e.model), c = (e.harness === "pi" ? t : Je(t)).filter((t) => !Ke(t, e.harness)).map(qe), l = o === void 0 ? null : new Set(o), u = l === null ? c : c.filter((e) => l.has(e.index)), d = x(u), f = e.harness, p = a ?? H(u, { scorecard: e.scorecard ?? void 0 }), m = st(p.patternAnnotations ?? [], ot(i ?? [])), h = -1;
1165
- for (let e = 0; e < u.length; e++) {
1166
- let t = u[e];
1167
- t.role === "assistant" && (t.depth ?? 0) === 0 && t.content?.trim() && (h = e);
1164
+ let s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
1165
+ for (let e of t) {
1166
+ s.set(e.index, (s.get(e.index) ?? 0) + 1);
1167
+ for (let t of e.toolCalls ?? []) t.id && c.set(t.id, (c.get(t.id) ?? 0) + 1);
1168
+ }
1169
+ let l = Xe(t, e.model), u = (e.harness === "pi" ? t : Je(t)).filter((t) => !Ke(t, e.harness)).map(qe), d = o === void 0 ? null : new Set(o), f = d === null ? u : u.filter((e) => d.has(e.index)), p = x(f), m = e.harness, h = a ?? W(f, { scorecard: e.scorecard ?? void 0 }), g = st(h.patternAnnotations ?? [], ot(i ?? [])), _ = -1;
1170
+ for (let e = 0; e < f.length; e++) {
1171
+ let t = f[e];
1172
+ t.role === "assistant" && (t.depth ?? 0) === 0 && t.content?.trim() && (_ = e);
1168
1173
  }
1169
- let g = /* @__PURE__ */ new Map(), _ = [], v = new Map(c.map((e, t) => [e, t]));
1170
- for (let e = 0; e < u.length; e++) {
1171
- let t = u[e], i = (t.toolCalls ?? []).map(tt);
1174
+ let v = /* @__PURE__ */ new Map(), y = [], b = new Map(u.map((e, t) => [e, t]));
1175
+ for (let e = 0; e < f.length; e++) {
1176
+ let t = f[e], i = (t.toolCalls ?? []).map((e, t) => ({
1177
+ ...tt(e),
1178
+ sourceIndex: t,
1179
+ sourceIdUnique: !e.id || c.get(e.id) === 1
1180
+ }));
1172
1181
  for (let e of i) {
1173
1182
  e.partition = r;
1174
1183
  let i = n?.filter((n) => n.attachment?.turnIndex === t.index && n.attachment?.toolCallId === e.id);
1175
1184
  i?.length && (e.nativeMetadata = i);
1176
1185
  }
1177
- for (let e of i) g.set(e.id, e);
1186
+ for (let e of i) v.set(e.id, e);
1178
1187
  let a = t.content ?? "", o;
1179
1188
  if (t.entryType === "thinking" && (Z(t) || a.trim() !== "")) {
1180
1189
  o = {
1181
1190
  text: a,
1182
1191
  words: Ie(a)
1183
1192
  };
1184
- let e = v.get(t) ?? -1, n;
1185
- for (let r = e - 1; r >= 0 && !n; r--) (c[r].depth ?? 0) === (t.depth ?? 0) && (n = c[r]);
1193
+ let e = b.get(t) ?? -1, n;
1194
+ for (let r = e - 1; r >= 0 && !n; r--) (u[r].depth ?? 0) === (t.depth ?? 0) && (n = u[r]);
1186
1195
  let r = Le(n, t);
1187
1196
  r !== void 0 && (o.durationMs = r), a = "";
1188
1197
  } else if (!Z(t)) {
@@ -1195,33 +1204,34 @@ function $(e, t, n, r, i, a, o) {
1195
1204
  }, a = a.slice(e[0].length));
1196
1205
  }
1197
1206
  }
1198
- let l = t.depth ?? 0, p = t.entryType === "error" || i.some((e) => e.isError), y = {
1207
+ let d = t.depth ?? 0, h = t.entryType === "error" || i.some((e) => e.isError), x = {
1199
1208
  index: t.index,
1209
+ sourceIndexUnique: s.get(t.index) === 1,
1200
1210
  identity: `${r}:${t.sourceEntryRef || t.index}`,
1201
1211
  partition: r,
1202
1212
  role: t.role,
1203
- label: d[e] ?? String(e + 1),
1213
+ label: p[e] ?? String(e + 1),
1204
1214
  content: a,
1205
- depth: l,
1215
+ depth: d,
1206
1216
  toolCalls: i,
1207
- annotations: m[t.index] ?? []
1217
+ annotations: g[t.index] ?? []
1208
1218
  };
1209
- l === 0 && t.role === "assistant" && (y.provider = f), t.agentName && (y.agentName = t.agentName), o && (y.thinking = o);
1210
- let b = Be(t.role, a, f);
1211
- b !== void 0 && (y.displayContent = b), t.usage && (y.usage = t.usage), t.sourceEntryRef && (y.sourceEntryRef = t.sourceEntryRef), t.provenance && (y.provenance = t.provenance), t.entryType && (y.entryType = t.entryType), t.stopReason !== void 0 && t.stopReason !== null && (y.stopReason = t.stopReason), p && (y.isError = !0), e === h && (y.isFinal = !0), !t.usage && (t.tokensIn != null || t.tokensOut != null) && (y.tokens = {
1219
+ d === 0 && t.role === "assistant" && (x.provider = m), t.agentName && (x.agentName = t.agentName), o && (x.thinking = o);
1220
+ let S = Be(t.role, a, m);
1221
+ S !== void 0 && (x.displayContent = S), t.usage && (x.usage = t.usage), t.sourceEntryRef && (x.sourceEntryRef = t.sourceEntryRef), t.provenance && (x.provenance = t.provenance), t.entryType && (x.entryType = t.entryType), t.stopReason !== void 0 && t.stopReason !== null && (x.stopReason = t.stopReason), h && (x.isError = !0), e === _ && (x.isFinal = !0), !t.usage && (t.tokensIn != null || t.tokensOut != null) && (x.tokens = {
1212
1222
  in: t.tokensIn ?? 0,
1213
1223
  out: t.tokensOut ?? 0
1214
- }), t.timestamp && (y.timestamp = t.timestamp);
1215
- let x = s.get(t.index);
1216
- x?.effectiveModel !== void 0 && (y.effectiveModel = x.effectiveModel), x?.modelChangedFrom !== void 0 && (y.modelChangedFrom = x.modelChangedFrom), _.push(y);
1224
+ }), t.timestamp && (x.timestamp = t.timestamp);
1225
+ let C = l.get(t.index);
1226
+ C?.effectiveModel !== void 0 && (x.effectiveModel = C.effectiveModel), C?.modelChangedFrom !== void 0 && (x.modelChangedFrom = C.modelChangedFrom), y.push(x);
1217
1227
  }
1218
1228
  return {
1219
- turns: _,
1220
- toolCallsById: g,
1221
- analytics: p,
1222
- annotationsByTurn: m,
1223
- filteredTurns: u
1229
+ turns: y,
1230
+ toolCallsById: v,
1231
+ analytics: h,
1232
+ annotationsByTurn: g,
1233
+ filteredTurns: f
1224
1234
  };
1225
1235
  }
1226
1236
  //#endregion
1227
- export { h as S, V as _, ke as a, D as b, De as c, U as d, S as f, ve as g, H as h, Ee as i, K as l, te as m, Ke as n, Oe as o, z as p, Je as r, J as s, pt as t, W as u, y as v, C as x, x as y };
1237
+ export { h as S, U as _, ke as a, k as b, Ee as c, G as d, w as f, ge as g, W as h, Te as i, q as l, C as m, Ke as n, Oe as o, V as p, Je as r, De as s, pt as t, K as u, y as v, T as x, x as y };