@peasant-labs/fairtrade 0.0.47 → 0.0.49
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.
- package/dist/lib/abnfDiagram-WEYOIA3C-D4LMNFIJ.js +89 -0
- package/dist/lib/{adapter-Dulh38C2.js → adapter-CVKibszh.js} +209 -186
- package/dist/lib/arc-1xTxsoRi.js +80 -0
- package/dist/lib/architecture-WOLXFQ4H-c6RsZuzu.js +3 -0
- package/dist/lib/architectureDiagram-ZHVYKT53-DTINqD5R.js +4145 -0
- package/dist/lib/array-CApNbSU9.js +6 -0
- package/dist/lib/blockDiagram-RJAE7QA3-CUYHoR3g.js +1946 -0
- package/dist/lib/c4Diagram-XDPPPE54-Cdx6_DsI.js +2990 -0
- package/dist/lib/channel-DagAO2vE.js +5 -0
- package/dist/lib/chunk-2E7WHVMD-BzhgXW3b.js +490 -0
- package/dist/lib/chunk-2Q5K7J3B-DWNwIK5Y.js +15 -0
- package/dist/lib/chunk-4EMNKR2T-DhFrQz9k.js +236 -0
- package/dist/lib/chunk-55XCU76K-CI0GXDkJ.js +61 -0
- package/dist/lib/chunk-5VM5RSS4-BAQ-46g4.js +5 -0
- package/dist/lib/chunk-7S6XSTFO-CMt_p-O6.js +1373 -0
- package/dist/lib/chunk-AQDTSKZB-DrZccIQa.js +1847 -0
- package/dist/lib/chunk-DSNLSHJZ-CpA9d2CJ.js +4044 -0
- package/dist/lib/chunk-DUW6YSOI-C-tN4Kiv.js +10 -0
- package/dist/lib/chunk-EJLWFMJV-B30MNYvY.js +75 -0
- package/dist/lib/chunk-HAGFOTED-DMU2JNZM.js +4487 -0
- package/dist/lib/chunk-HNE4Q36P-BIA0n2gA.js +363 -0
- package/dist/lib/chunk-J5ZVWO5B-CA_-jk8G.js +12 -0
- package/dist/lib/chunk-JWPE2WC7-KRpHbrIX.js +8 -0
- package/dist/lib/chunk-LNGE3PJU-CMGaAEAh.js +1513 -0
- package/dist/lib/chunk-NGNAAXSQ-D7Dvct7J.js +19774 -0
- package/dist/lib/chunk-NQOKRVIF-MK9F46y3.js +4258 -0
- package/dist/lib/chunk-OYAV6JZA-B1yICcbU.js +10 -0
- package/dist/lib/chunk-UHW7PFBP-CLrOaA0y.js +67 -0
- package/dist/lib/chunk-VQ5W62QI-_ZR3gKe4.js +26 -0
- package/dist/lib/chunk-WQQL4CDK-DFtyhYZq.js +693 -0
- package/dist/lib/chunk-XXDRQBXY-uzyNBbgx.js +9 -0
- package/dist/lib/chunk-Y2CYZVJY-BYzrzvCI.js +12 -0
- package/dist/lib/chunk-YZO67HFG-D1jKt78p.js +275 -0
- package/dist/lib/chunk-ZAUX2LTX-7XO0Yj1z.js +37 -0
- package/dist/lib/chunk-ZCHMQSOR-CxoKltfF.js +349 -0
- package/dist/lib/classDiagram-v2-4MYWR3UA-BPvwhZqw.js +3397 -0
- package/dist/lib/commons.js +729 -729
- package/dist/lib/components.css +1 -1
- package/dist/lib/cose-bilkent-JH36ORCC-Oj79uOIQ.js +2250 -0
- package/dist/lib/cynefin-EF2NZ3EQ-COX3NRum.js +3 -0
- package/dist/lib/cynefinDiagram-WF24UDRP-UzTptNAX.js +349 -0
- package/dist/lib/cytoscape.esm-0ojxgO9x.js +18161 -0
- package/dist/lib/dagre-NK4GIZVX-DWZr-NGm.js +2356 -0
- package/dist/lib/defaultLocale-BbgDuMnp.js +201 -0
- package/dist/lib/diagram-CBK3MWTC-CsyKuv-w.js +525 -0
- package/dist/lib/diagram-I5XIIV2D-DWY2JSPC.js +134 -0
- package/dist/lib/diagram-ODIL2UCW-DUptj0JZ.js +301 -0
- package/dist/lib/diagram-PFBEJUXE-N5XnIBqM.js +447 -0
- package/dist/lib/diagram-RJA3I4VV-B9XgohYo.js +214 -0
- package/dist/lib/diagram-TYUNFSNR-XnsJIeAd.js +5084 -0
- package/dist/lib/dist-AMlsjiDX.js +59 -0
- package/dist/lib/ebnfDiagram-V4P3TTPT-BssHqFox.js +100 -0
- package/dist/lib/elk-QONTBCTQ-DwmwqYgP.js +47944 -0
- package/dist/lib/erDiagram-KYQIGQAA-BQiXw1Tw.js +1970 -0
- package/dist/lib/eventmodeling-K75KTNOO-DDb--yMc.js +3 -0
- package/dist/lib/flowDiagram-IUGLLWBU-BEqqF1y2.js +17 -0
- package/dist/lib/ganttDiagram-R7GPNTJY-BWtGXxEF.js +3094 -0
- package/dist/lib/gitGraph-VSP46ZUC-BSwOaak_.js +3 -0
- package/dist/lib/gitGraphDiagram-PDYL7XHY-CHGNuGbk.js +729 -0
- package/dist/lib/graphlib-Dndp26xU.js +1267 -0
- package/dist/lib/info-OHQRW6UA-Dk06sZRe.js +3 -0
- package/dist/lib/infoDiagram-MVDRKAX5-Cdhxnjmi.js +20 -0
- package/dist/lib/init-Bwwdo3M6.js +15 -0
- package/dist/lib/ishikawaDiagram-HPEHV2GE-Dzhti-GJ.js +719 -0
- package/dist/lib/journeyDiagram-BOSHW7O7-C3_vsSjw.js +884 -0
- package/dist/lib/kanban-definition-FNSA4HC5-XsfCEsjn.js +976 -0
- package/dist/lib/katex-Dw0PnoPU.js +21850 -0
- package/dist/lib/line-C9krU3Sv.js +34 -0
- package/dist/lib/linear-Cvilv3OA.js +289 -0
- package/dist/lib/mermaid-parser.core-I7qQ_fxz.js +638 -0
- package/dist/lib/mermaid.core-UNHMAbBP.js +1126 -0
- package/dist/lib/mindmap-definition-6OY57UG3-CAua-JvB.js +1011 -0
- package/dist/lib/ordinal-C55HfHHp.js +65 -0
- package/dist/lib/packet-JDAUHWVQ-DZ-MKx4I.js +3 -0
- package/dist/lib/path-DNvJyUE8.js +85 -0
- package/dist/lib/pegDiagram-ECIUJNBX-BCxa_IO0.js +94 -0
- package/dist/lib/pie-XZMESJXO-DpCa-Nnq.js +3 -0
- package/dist/lib/pieDiagram-GNMPY74T-CE_C3dCB.js +205 -0
- package/dist/lib/quadrantDiagram-D57K4MC3-CDgzdMoL.js +2001 -0
- package/dist/lib/radar-ABXABTNO-BOVK7L9p.js +3 -0
- package/dist/lib/railroad-I3PHUGI6-B6spKM0Z.js +3 -0
- package/dist/lib/railroad-abnf-LNEFI6M7-DEWqfByZ.js +3 -0
- package/dist/lib/railroad-ebnf-DWYD2UWJ-CWRLtxHB.js +3 -0
- package/dist/lib/railroad-peg-JR7BVNR7-C-3NHSsk.js +3 -0
- package/dist/lib/railroadDiagram-Y72NRBL7-a8YVk8LT.js +76 -0
- package/dist/lib/requirementDiagram-EQYSW5RA-B9HolqxU.js +2228 -0
- package/dist/lib/rough.esm-a8mysczE.js +1352 -0
- package/dist/lib/sankeyDiagram-SY24JHO5-CLFMtMJG.js +970 -0
- package/dist/lib/sequenceDiagram-BLEHNHQU-B5wfSV85.js +4253 -0
- package/dist/lib/share.js +1 -1
- package/dist/lib/sizeCapture-INFHLROL-BWGCc9aa.js +46 -0
- package/dist/lib/src-Dcy0zUZH.js +2153 -0
- package/dist/lib/stateDiagram-v2-A6IESKWZ-C92vye4N.js +2143 -0
- package/dist/lib/swimlanes-B3ENRKFQ-B6-i-tPc.js +4764 -0
- package/dist/lib/swimlanesDiagram-AYQRV4AK-CbkBeql-.js +28 -0
- package/dist/lib/timeline-definition-JXYKGLGB-D2Ip4r72.js +1073 -0
- package/dist/lib/treeView-D4JQ5SDB-CFaKQ_2T.js +3 -0
- package/dist/lib/treemap-SAJKECNS-BQ6z7Z3g.js +3 -0
- package/dist/lib/types/AppSidebar.d.ts +14 -1
- package/dist/lib/types/transcript/Collapsible.d.ts +10 -0
- package/dist/lib/types/transcript/FiltersRail.d.ts +1 -0
- package/dist/lib/types/transcript/MermaidBlock.d.ts +3 -0
- package/dist/lib/types/transcript/Thinking.d.ts +1 -1
- package/dist/lib/types/transcript/ToolCall.d.ts +1 -1
- package/dist/lib/types/transcript/TranscriptViewer.d.ts +2 -2
- package/dist/lib/types/transcript/TurnCard.d.ts +3 -1
- package/dist/lib/types/transcript/UnverifiedPullRequests.d.ts +12 -0
- package/dist/lib/types/transcript/WorkGroup.d.ts +9 -0
- package/dist/lib/types/transcript/action-groups.d.ts +9 -0
- package/dist/lib/types/transcript/adapter.d.ts +12 -0
- package/dist/lib/types/transcript/filters.d.ts +5 -5
- package/dist/lib/types/transcript/index.d.ts +2 -1
- package/dist/lib/types/transcript/mermaidSource.d.ts +2 -0
- package/dist/lib/types/transcript/mermaidSvg.d.ts +1 -0
- package/dist/lib/types/transcript/state-capabilities.d.ts +38 -11
- package/dist/lib/types/transcript/tool-state-key.d.ts +2 -0
- package/dist/lib/types/transcript/useReaderWidthAnchor.d.ts +20 -0
- package/dist/lib/types/transcript/view-model.d.ts +19 -0
- package/dist/lib/types/transcript/work-summary.d.ts +8 -0
- package/dist/lib/types/ui/transcript/adapter.d.ts +12 -0
- package/dist/lib/types/ui/transcript/view-model.d.ts +19 -0
- package/dist/lib/{ui-CrH0SVd_.js → ui-Beoq-HpN.js} +5345 -4232
- package/dist/lib/ui.js +6 -6
- package/dist/lib/usecaseDiagram-WPOLBNNX-BK1Anch1.js +7190 -0
- package/dist/lib/vennDiagram-Q3Y3IDCW-B6YTBqTS.js +1880 -0
- package/dist/lib/wardley-7MLQ67FV-DChYwu4i.js +3 -0
- package/dist/lib/wardleyDiagram-IVAIDKWA-D5I1qLUK.js +645 -0
- package/dist/lib/xychartDiagram-4URNHDU4-B6RXyhTO.js +2218 -0
- package/package.json +3 -2
|
@@ -126,11 +126,11 @@ function y(e) {
|
|
|
126
126
|
let n = [];
|
|
127
127
|
for (let r = 0; r < t.length; r++) {
|
|
128
128
|
let i = t[r], a = (r + 1 < t.length ? t[r + 1] : e.length) - 1;
|
|
129
|
-
n.push(
|
|
129
|
+
n.push(b(e, i, a));
|
|
130
130
|
}
|
|
131
131
|
return n;
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function b(e, t, n) {
|
|
134
134
|
let r = e[t], i = 0, a = /* @__PURE__ */ new Set(), o = 0, s = 0, c = !1, l = 0, u;
|
|
135
135
|
for (let r = t; r <= n; r++) {
|
|
136
136
|
let t = e[r];
|
|
@@ -158,23 +158,23 @@ function ee(e, t, n) {
|
|
|
158
158
|
};
|
|
159
159
|
return u !== void 0 && (h.finalEntryIndex = u), h;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function x(e) {
|
|
162
162
|
if (e.length === 0) return [];
|
|
163
163
|
let t = y(e), n = /* @__PURE__ */ new Map();
|
|
164
164
|
for (let e = 0; e < t.length; e++) n.set(t[e].startIndex, e + 1);
|
|
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}${
|
|
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
|
|
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
|
|
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 ne(e) {
|
|
|
186
186
|
};
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
|
-
var
|
|
189
|
+
var ee = /* @__PURE__ */ new Set([
|
|
190
190
|
"Task",
|
|
191
191
|
"EnterWorktree",
|
|
192
192
|
"SendMessage",
|
|
193
193
|
"TeamCreate"
|
|
194
|
-
]),
|
|
194
|
+
]), te = /* @__PURE__ */ new Set([
|
|
195
195
|
"Write",
|
|
196
196
|
"Edit",
|
|
197
197
|
"NotebookEdit"
|
|
198
198
|
]);
|
|
199
|
-
function
|
|
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 x(e) {
|
|
|
206
206
|
type: "error",
|
|
207
207
|
label: `${e.name} failed`,
|
|
208
208
|
severity: "error"
|
|
209
|
-
}),
|
|
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
|
-
}),
|
|
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 x(e) {
|
|
|
240
240
|
}
|
|
241
241
|
return t.sort((e, t) => e.turnIndex - t.turnIndex);
|
|
242
242
|
}
|
|
243
|
-
var
|
|
243
|
+
var ne = {
|
|
244
244
|
planning: "Planning",
|
|
245
245
|
exploration: "Exploration",
|
|
246
246
|
implementation: "Implementation",
|
|
@@ -252,20 +252,20 @@ var ae = {
|
|
|
252
252
|
recovery: "Recovery",
|
|
253
253
|
abandonment: "Abandonment"
|
|
254
254
|
};
|
|
255
|
-
function
|
|
256
|
-
return
|
|
255
|
+
function T(e) {
|
|
256
|
+
return ne[e] ?? String(e);
|
|
257
257
|
}
|
|
258
|
-
var
|
|
258
|
+
var E = /* @__PURE__ */ new Set([
|
|
259
259
|
"Read",
|
|
260
260
|
"Glob",
|
|
261
261
|
"Grep",
|
|
262
262
|
"WebSearch",
|
|
263
263
|
"WebFetch"
|
|
264
|
-
]),
|
|
264
|
+
]), D = /* @__PURE__ */ new Set([
|
|
265
265
|
"Write",
|
|
266
266
|
"Edit",
|
|
267
267
|
"NotebookEdit"
|
|
268
|
-
]),
|
|
268
|
+
]), re = [
|
|
269
269
|
/\btest\b/i,
|
|
270
270
|
/\bjest\b/i,
|
|
271
271
|
/\bpytest\b/i,
|
|
@@ -278,21 +278,21 @@ var C = /* @__PURE__ */ new Set([
|
|
|
278
278
|
/\bmocha\b/i,
|
|
279
279
|
/\brspec\b/i
|
|
280
280
|
];
|
|
281
|
-
function
|
|
281
|
+
function ie(e, t) {
|
|
282
282
|
return e.toolCalls?.some((e) => t.has(e.name)) ?? !1;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function ae(e, t) {
|
|
285
285
|
return e.toolCalls?.length ? e.toolCalls.every((e) => t.has(e.name)) : !1;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
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
|
|
292
|
-
for (let t of e.toolCalls ?? []) if (t.name === "Bash" &&
|
|
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
|
|
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 ue(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) =>
|
|
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 ue(e) {
|
|
|
310
310
|
}
|
|
311
311
|
return t;
|
|
312
312
|
}
|
|
313
|
-
function
|
|
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
|
|
318
|
-
let t =
|
|
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 &&
|
|
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
|
|
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 pe = [
|
|
|
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
|
-
],
|
|
335
|
-
function
|
|
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" ?
|
|
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
|
|
339
|
+
var pe = /* @__PURE__ */ new Set([
|
|
340
340
|
"error",
|
|
341
341
|
"user-correction",
|
|
342
342
|
"retry-loop",
|
|
343
343
|
"abandonment"
|
|
344
344
|
]);
|
|
345
|
-
function
|
|
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 _e(e) {
|
|
|
351
351
|
a.endTurn = r.endTurn;
|
|
352
352
|
continue;
|
|
353
353
|
}
|
|
354
|
-
if (i < 3 && !
|
|
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 _e(e) {
|
|
|
379
379
|
}
|
|
380
380
|
return t;
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function he(e) {
|
|
383
383
|
if (e.length === 0) return [];
|
|
384
|
-
let t =
|
|
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++)
|
|
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:
|
|
390
|
+
type: fe(e[r], r, a, i, t),
|
|
391
391
|
turn: r
|
|
392
392
|
});
|
|
393
393
|
}
|
|
@@ -399,8 +399,8 @@ function ve(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 =
|
|
403
|
-
if ((i || a || o && n.type !== "planning") && (e.filter(
|
|
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 ve(e) {
|
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
return
|
|
413
|
+
return me(r);
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
return
|
|
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] &&
|
|
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:
|
|
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 E(e) {
|
|
|
426
426
|
return r > 0 && (i.errors = r), i;
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
|
-
function
|
|
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
|
|
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 =
|
|
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
|
|
443
|
-
function
|
|
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
|
|
446
|
+
function z(e) {
|
|
447
447
|
return e === "bad" ? 2 : +(e === "watch");
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
return e.reduce((e, t) =>
|
|
449
|
+
function B(e) {
|
|
450
|
+
return e.reduce((e, t) => z(t) > z(e) ? t : e, "good");
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function V(e, t = {}) {
|
|
453
453
|
if (!e) return [];
|
|
454
454
|
let n = [];
|
|
455
455
|
{
|
|
456
|
-
let r = [], i = [], a =
|
|
457
|
-
if (a !== void 0 && (r.push(a >
|
|
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 >
|
|
459
|
+
r.push(t > M ? "watch" : "good"), t > M && i.push(`Context ${Math.round(t)}% full`);
|
|
460
460
|
}
|
|
461
|
-
if (
|
|
461
|
+
if (R(e.m6OutputSurvivalPct)) {
|
|
462
462
|
let t = e.m6OutputSurvivalPct ?? 0;
|
|
463
|
-
r.push(t <
|
|
463
|
+
r.push(t < N ? "watch" : "good"), t < N && i.push(`Only ${Math.round(t)}% of output survived`);
|
|
464
464
|
}
|
|
465
|
-
e.outcome === "failed" &&
|
|
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 (
|
|
469
|
+
if (R(e.specQualityScore)) {
|
|
470
470
|
let n = e.specQualityScore ?? 0;
|
|
471
|
-
t.push(n <
|
|
471
|
+
t.push(n < P ? "bad" : "good"), n < P && r.push(`Spec quality low (${Math.round(n)}/100)`);
|
|
472
472
|
}
|
|
473
|
-
if (
|
|
473
|
+
if (R(e.signalDensity)) {
|
|
474
474
|
let n = e.signalDensity ?? 0;
|
|
475
|
-
t.push(n <
|
|
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")), (
|
|
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 (
|
|
481
|
+
if (R(e.m4ConsecutiveErrorMax)) {
|
|
482
482
|
let n = e.m4ConsecutiveErrorMax ?? 0;
|
|
483
|
-
t.push(n >=
|
|
483
|
+
t.push(n >= I ? "bad" : "good"), n >= I && r.push(`${n} errors in a row`);
|
|
484
484
|
}
|
|
485
|
-
if (
|
|
485
|
+
if (R(e.withinSessionReverts)) {
|
|
486
486
|
let n = e.withinSessionReverts ?? 0;
|
|
487
|
-
t.push(n >=
|
|
487
|
+
t.push(n >= L ? "bad" : "good"), n >= L && r.push(`${n} reverts mid-session`);
|
|
488
488
|
}
|
|
489
|
-
(
|
|
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
|
|
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 z(e, t, n, r, i) {
|
|
|
500
500
|
};
|
|
501
501
|
return i.length && (a.flags = i, a.detail = i.join(", ")), a;
|
|
502
502
|
}
|
|
503
|
-
function
|
|
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 be(e, t) {
|
|
|
509
509
|
label: e.label
|
|
510
510
|
};
|
|
511
511
|
}
|
|
512
|
-
function
|
|
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 xe(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
|
|
530
|
-
return y(e).map((t, n) =>
|
|
529
|
+
function U(e) {
|
|
530
|
+
return y(e).map((t, n) => ve(t, n, e));
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
let n =
|
|
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
|
|
538
|
+
var G = Object.freeze({
|
|
539
539
|
input: "input",
|
|
540
540
|
output: "output",
|
|
541
541
|
cacheRead: "cache read",
|
|
@@ -543,14 +543,14 @@ var H = Object.freeze({
|
|
|
543
543
|
cacheWrite1h: "cache write 1h (subset)",
|
|
544
544
|
reasoning: "reasoning (subset)",
|
|
545
545
|
totalTokens: "total tokens"
|
|
546
|
-
}),
|
|
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
|
|
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 Se(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
|
|
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 =
|
|
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,41 +582,41 @@ function W(e) {
|
|
|
582
582
|
return [{
|
|
583
583
|
scope: e,
|
|
584
584
|
ownerCount: t.length,
|
|
585
|
-
tokens: r("tokens",
|
|
586
|
-
cost: r("cost",
|
|
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
|
|
593
|
-
function
|
|
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 =
|
|
595
|
+
let t = we.exec(e);
|
|
596
596
|
if (!t) return e;
|
|
597
|
-
let n = t[0].length, r = e.indexOf(
|
|
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(
|
|
600
|
+
return a && !a.startsWith(Se) ? `${i}\n\n${a}` : i;
|
|
601
601
|
}
|
|
602
|
-
function
|
|
603
|
-
return
|
|
602
|
+
function Te(e) {
|
|
603
|
+
return q(e).replace(/\s+/g, " ").trim();
|
|
604
604
|
}
|
|
605
|
-
var
|
|
606
|
-
function
|
|
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 <=
|
|
609
|
-
let o = (a.codePointAt(
|
|
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
|
|
612
|
+
function De(e, t = xe) {
|
|
613
613
|
if (!e) return "";
|
|
614
|
-
let n = Ae(
|
|
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) : "";
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function Oe(e) {
|
|
620
620
|
if (!e) return "";
|
|
621
621
|
let t = e.trim().replace(/[\\/]+$/, "");
|
|
622
622
|
if (!t) return "";
|
|
@@ -624,7 +624,7 @@ function J(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 =
|
|
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 {
|
|
@@ -701,25 +701,33 @@ function Ie(e) {
|
|
|
701
701
|
let t = e.trim().match(/\S+/g);
|
|
702
702
|
return t ? t.length : 0;
|
|
703
703
|
}
|
|
704
|
-
function Le(
|
|
704
|
+
function Le(t, n) {
|
|
705
|
+
if (!t || !e(t.timestamp) || !e(n.timestamp)) return;
|
|
706
|
+
let r = (t.toolCalls ?? []).reduce((e, t) => {
|
|
707
|
+
let n = t?.durationMs;
|
|
708
|
+
return e + (typeof n == "number" && Number.isFinite(n) && n > 0 ? n : 0);
|
|
709
|
+
}, 0), i = Date.parse(n.timestamp) - (Date.parse(t.timestamp) + r);
|
|
710
|
+
return i > 0 ? i : void 0;
|
|
711
|
+
}
|
|
712
|
+
function Re(e) {
|
|
705
713
|
if (!e || e <= 0) return "0";
|
|
706
714
|
if (e < 1e3) return String(e);
|
|
707
715
|
let t = e / 1e3;
|
|
708
716
|
return (t >= 10 ? Math.round(t) : Math.round(t * 10) / 10) + "k";
|
|
709
717
|
}
|
|
710
|
-
function
|
|
718
|
+
function ze(e) {
|
|
711
719
|
return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
|
|
712
720
|
}
|
|
713
721
|
var X = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
714
722
|
function Z(e) {
|
|
715
723
|
return !!e.sourceEntryRef || X(e, "provenance") || !!e.usage || !!e.toolCalls?.some((e) => e.callEntryRef || e.resultEntryRef || e.usage || X(e, "callProvenance") || X(e, "resultProvenance"));
|
|
716
724
|
}
|
|
717
|
-
function
|
|
725
|
+
function Be(e, t, n) {
|
|
718
726
|
if (n !== "cursor" || e !== "user") return;
|
|
719
|
-
let r =
|
|
727
|
+
let r = q(t);
|
|
720
728
|
return r === t ? void 0 : r;
|
|
721
729
|
}
|
|
722
|
-
function
|
|
730
|
+
function Ve(e, t) {
|
|
723
731
|
let n = new Map(t.filter((e) => e.displayContent !== void 0).map((e) => [e.index, e.displayContent]));
|
|
724
732
|
return n.size === 0 ? e : e.map((e) => {
|
|
725
733
|
let t = n.get(e.turnIndices?.[0]);
|
|
@@ -729,7 +737,7 @@ function Be(e, t) {
|
|
|
729
737
|
};
|
|
730
738
|
});
|
|
731
739
|
}
|
|
732
|
-
function
|
|
740
|
+
function He(e) {
|
|
733
741
|
return X(e, "sourceEntryRef") && e.sourceEntryRef !== "" || X(e, "provenance") || X(e, "usage") || !!e.toolCalls?.some((e) => X(e, "callEntryRef") && e.callEntryRef !== "" || X(e, "resultEntryRef") && e.resultEntryRef !== "" || [
|
|
734
742
|
"callProvenance",
|
|
735
743
|
"resultProvenance",
|
|
@@ -738,13 +746,13 @@ function Ve(e) {
|
|
|
738
746
|
].some((t) => X(e, t)));
|
|
739
747
|
}
|
|
740
748
|
function Q(e) {
|
|
741
|
-
let t =
|
|
749
|
+
let t = ze(e);
|
|
742
750
|
if (t?.submissionRef === "") {
|
|
743
751
|
let { submissionRef: e, ...n } = t;
|
|
744
752
|
r.parse(n);
|
|
745
753
|
} else r.parse(e);
|
|
746
754
|
}
|
|
747
|
-
function
|
|
755
|
+
function Ue(e) {
|
|
748
756
|
e.forEach((e, t) => {
|
|
749
757
|
try {
|
|
750
758
|
X(e, "sourceEntryRef") && e.sourceEntryRef !== "" && o.parse(e.sourceEntryRef), X(e, "provenance") && Q(e.provenance);
|
|
@@ -754,19 +762,19 @@ function He(e) {
|
|
|
754
762
|
}
|
|
755
763
|
});
|
|
756
764
|
}
|
|
757
|
-
var
|
|
758
|
-
function
|
|
765
|
+
var We = /^(custom-title|agent name|session title): \S/, Ge = /* @__PURE__ */ new Set(["agent renamed", "session title set"]);
|
|
766
|
+
function Ke(e, t) {
|
|
759
767
|
if (t !== "claude-code" || e.role !== "system" || (e.depth ?? 0) !== 0 || (e.toolCalls?.length ?? 0) > 0) return !1;
|
|
760
768
|
let n = (e.content ?? "").trim();
|
|
761
|
-
return n === "" || n.includes("\n") ? !1 :
|
|
769
|
+
return n === "" || n.includes("\n") ? !1 : We.test(n) || Ge.has(n);
|
|
762
770
|
}
|
|
763
|
-
function
|
|
771
|
+
function qe(t) {
|
|
764
772
|
if (t.timestamp === void 0 || t.timestamp === null || e(t.timestamp)) return t;
|
|
765
773
|
let { timestamp: n, ...r } = t;
|
|
766
774
|
return r;
|
|
767
775
|
}
|
|
768
|
-
function
|
|
769
|
-
|
|
776
|
+
function Je(e) {
|
|
777
|
+
Ue(e);
|
|
770
778
|
let t = e.filter((e) => {
|
|
771
779
|
if (Z(e)) return !0;
|
|
772
780
|
let t = !!e.content?.trim(), n = (e.toolCalls?.length ?? 0) > 0;
|
|
@@ -783,15 +791,15 @@ function qe(e) {
|
|
|
783
791
|
}
|
|
784
792
|
return n;
|
|
785
793
|
}
|
|
786
|
-
function
|
|
794
|
+
function Ye(e) {
|
|
787
795
|
if (e.role !== "assistant") return;
|
|
788
796
|
let t = i.safeParse(e.observedModel);
|
|
789
797
|
return t.success ? t.data : void 0;
|
|
790
798
|
}
|
|
791
|
-
function
|
|
799
|
+
function Xe(e, t) {
|
|
792
800
|
let n = /* @__PURE__ */ new Map(), r = typeof t == "string" && t.length > 0 ? t : void 0;
|
|
793
801
|
for (let t of e) {
|
|
794
|
-
let e = t.depth ?? 0, i =
|
|
802
|
+
let e = t.depth ?? 0, i = Ye(t);
|
|
795
803
|
if (t.role !== "assistant") {
|
|
796
804
|
n.set(t.index, {});
|
|
797
805
|
continue;
|
|
@@ -807,12 +815,12 @@ function Ye(e, t) {
|
|
|
807
815
|
}
|
|
808
816
|
return n;
|
|
809
817
|
}
|
|
810
|
-
function
|
|
818
|
+
function Ze(e) {
|
|
811
819
|
if (e.toolKind) return e.toolKind;
|
|
812
820
|
let t = e.name.toLowerCase();
|
|
813
821
|
return t === "read" || t === "notebookread" ? "read" : t === "edit" || t === "multiedit" || t === "notebookedit" || t === "write" ? "edit" : t === "bash" || t === "runcommand" || t === "run_command" || t === "shell" ? "execute" : t === "grep" || t === "glob" || t === "globsearch" || t === "websearch" || t === "web_search" ? "search" : t === "webfetch" || t === "web_fetch" || t === "fetch" || t === "readwebsite" ? "fetch" : t === "delete" || t === "remove" ? "delete" : t === "move" || t === "rename" ? "move" : "other";
|
|
814
822
|
}
|
|
815
|
-
function
|
|
823
|
+
function Qe(e) {
|
|
816
824
|
let t = e.name.toLowerCase();
|
|
817
825
|
if (t === "read" || t === "notebookread") return "read";
|
|
818
826
|
if (t === "edit" || t === "multiedit" || t === "notebookedit" || t === "write") return "edits";
|
|
@@ -829,8 +837,8 @@ function Ze(e) {
|
|
|
829
837
|
default: return "other";
|
|
830
838
|
}
|
|
831
839
|
}
|
|
832
|
-
function
|
|
833
|
-
let t =
|
|
840
|
+
function $e(e) {
|
|
841
|
+
let t = ze(c(e.arguments)), n = e.filePath ?? (t && typeof t.file_path == "string" ? t.file_path : void 0);
|
|
834
842
|
if (n) return n;
|
|
835
843
|
if (!t) return Y(e.arguments, 80);
|
|
836
844
|
if (typeof t.command == "string") return Y(t.command, 100);
|
|
@@ -847,7 +855,7 @@ function Qe(e) {
|
|
|
847
855
|
let r = typeof t.subagent_type == "string" ? t.subagent_type : typeof t.subagent == "string" ? t.subagent : typeof t.agent == "string" ? t.agent : void 0;
|
|
848
856
|
return r && typeof t.description == "string" ? `${r}, ${t.description}` : typeof t.description == "string" ? Y(t.description, 100) : typeof t.subject == "string" ? Y(t.subject, 100) : typeof t.prompt == "string" ? Y(t.prompt, 100) : Y(e.arguments, 80);
|
|
849
857
|
}
|
|
850
|
-
function
|
|
858
|
+
function et(e) {
|
|
851
859
|
let t = _(e);
|
|
852
860
|
if (t) return {
|
|
853
861
|
hunks: t.spans.map((e) => ({ lines: e })),
|
|
@@ -855,13 +863,13 @@ function $e(e) {
|
|
|
855
863
|
dels: t.dels
|
|
856
864
|
};
|
|
857
865
|
}
|
|
858
|
-
function
|
|
866
|
+
function tt(e) {
|
|
859
867
|
let t = {
|
|
860
868
|
id: e.id,
|
|
861
869
|
name: e.name,
|
|
862
|
-
kind:
|
|
863
|
-
group:
|
|
864
|
-
preview:
|
|
870
|
+
kind: Ze(e),
|
|
871
|
+
group: Qe(e),
|
|
872
|
+
preview: $e(e)
|
|
865
873
|
};
|
|
866
874
|
e.namespace !== void 0 && (t.namespace = e.namespace);
|
|
867
875
|
let n = c(e.arguments);
|
|
@@ -870,10 +878,10 @@ function et(e) {
|
|
|
870
878
|
i !== void 0 && (t.output = i);
|
|
871
879
|
let a = f(e);
|
|
872
880
|
a && (t.filePath = a), e.durationMs != null && (t.durationMs = e.durationMs), e.exitCode != null && (t.exitCode = e.exitCode), e.isError && (t.isError = !0), e.usage && (t.usage = e.usage), e.callEntryRef && (t.callEntryRef = e.callEntryRef), e.resultEntryRef && (t.resultEntryRef = e.resultEntryRef), e.callProvenance && (t.callProvenance = e.callProvenance), e.resultProvenance && (t.resultProvenance = e.resultProvenance), e.callEntryRef && !e.resultEntryRef && (t.pending = !0);
|
|
873
|
-
let o =
|
|
881
|
+
let o = et(e);
|
|
874
882
|
return o && (t.diff = o.hunks, t.adds = o.adds, t.dels = o.dels), t;
|
|
875
883
|
}
|
|
876
|
-
function
|
|
884
|
+
function nt(e) {
|
|
877
885
|
let t = e.hash, n = e.message.split("\n")[0], r = {
|
|
878
886
|
hash: t,
|
|
879
887
|
shortHash: t.slice(0, 7),
|
|
@@ -883,7 +891,7 @@ function tt(e) {
|
|
|
883
891
|
let i = "commitTime" in e ? Number(e.commitTime) : Date.parse(e.timestamp);
|
|
884
892
|
return Number.isFinite(i) && (r.commitTime = i), "session" in e && e.session === !0 && (r.session = !0), "insertions" in e && (r.adds = e.insertions), "deletions" in e && (r.dels = e.deletions), "filesChanged" in e && (r.files = e.filesChanged), r;
|
|
885
893
|
}
|
|
886
|
-
function
|
|
894
|
+
function rt(e, t) {
|
|
887
895
|
let n = t.map((e) => ({
|
|
888
896
|
index: e.index,
|
|
889
897
|
ms: e.timestamp ? Date.parse(e.timestamp) : NaN
|
|
@@ -896,13 +904,13 @@ function nt(e, t) {
|
|
|
896
904
|
t.turn = e;
|
|
897
905
|
}
|
|
898
906
|
}
|
|
899
|
-
function
|
|
907
|
+
function it(e) {
|
|
900
908
|
let t = e.gitContext, n = e.gitBranch ?? t?.branch ?? void 0, r = e.gitRemote ?? t?.remote ?? void 0, i = t?.user, a = Array.isArray(t?.commits) ? t.commits : [], o = [], s = 0, c = 0, l = 0;
|
|
901
|
-
for (let e of a) o.push(
|
|
909
|
+
for (let e of a) o.push(nt(e)), "filesChanged" in e && (s += e.filesChanged), "insertions" in e && (c += e.insertions), "deletions" in e && (l += e.deletions);
|
|
902
910
|
let u = {};
|
|
903
911
|
return n && (u.branch = n), r && (u.remote = r), i && (u.author = i), o.length && (u.commits = o), s > 0 && (u.filesChanged = s), c > 0 && (u.insertions = c), l > 0 && (u.deletions = l), Object.keys(u).length > 0 ? u : void 0;
|
|
904
912
|
}
|
|
905
|
-
function
|
|
913
|
+
function at(t, n) {
|
|
906
914
|
let r = {
|
|
907
915
|
id: t.id,
|
|
908
916
|
harness: t.harness,
|
|
@@ -915,11 +923,11 @@ function it(t, n) {
|
|
|
915
923
|
turnCount: t.turnCount,
|
|
916
924
|
toolCallCount: t.toolCallCount
|
|
917
925
|
};
|
|
918
|
-
t.project && (r.project = t.project), t.model && (r.model = t.model), t.inputSubmissionCount !== void 0 && (r.inputSubmissionCount = t.inputSubmissionCount), t.purpose && (r.purpose = t.purpose), t.rootSessionId && (r.rootSessionId = t.rootSessionId),
|
|
926
|
+
t.project && (r.project = t.project), t.model && (r.model = t.model), t.inputSubmissionCount !== void 0 && (r.inputSubmissionCount = t.inputSubmissionCount), t.purpose && (r.purpose = t.purpose), t.rootSessionId && (r.rootSessionId = t.rootSessionId), mt(t) && (r.hasNormalizedEvidence = !0);
|
|
919
927
|
let i = t.workingDirectory ?? t.gitContext?.workingDirectory;
|
|
920
928
|
return i && (r.workingDirectory = i), t.outcome && (r.outcome = t.outcome), t.scorecard !== void 0 && (r.scorecard = t.scorecard), n && (r.git = n), r;
|
|
921
929
|
}
|
|
922
|
-
function
|
|
930
|
+
function ot(e) {
|
|
923
931
|
let t = [];
|
|
924
932
|
for (let n of e) {
|
|
925
933
|
if (n.targetEntryIndex == null) continue;
|
|
@@ -933,7 +941,7 @@ function at(e) {
|
|
|
933
941
|
}
|
|
934
942
|
return t;
|
|
935
943
|
}
|
|
936
|
-
function
|
|
944
|
+
function st(e, t) {
|
|
937
945
|
let n = {};
|
|
938
946
|
for (let t of e) {
|
|
939
947
|
let e = n[t.turn] ?? [];
|
|
@@ -945,7 +953,7 @@ function ot(e, t) {
|
|
|
945
953
|
}
|
|
946
954
|
return n;
|
|
947
955
|
}
|
|
948
|
-
function
|
|
956
|
+
function ct(e) {
|
|
949
957
|
let t = [];
|
|
950
958
|
for (let n of e) for (let e of n.toolCalls) {
|
|
951
959
|
if (!e.diff) continue;
|
|
@@ -962,7 +970,7 @@ function st(e) {
|
|
|
962
970
|
}
|
|
963
971
|
return t;
|
|
964
972
|
}
|
|
965
|
-
function
|
|
973
|
+
function lt(e) {
|
|
966
974
|
let t = /* @__PURE__ */ new Map();
|
|
967
975
|
for (let n of e) for (let e of n.toolCalls) {
|
|
968
976
|
let r = e.filePath;
|
|
@@ -987,7 +995,7 @@ function ct(e) {
|
|
|
987
995
|
for (let e of n) e.edited = e.writes + e.edits > 0;
|
|
988
996
|
return n;
|
|
989
997
|
}
|
|
990
|
-
function
|
|
998
|
+
function ut(e, t, n) {
|
|
991
999
|
let r = [], i = e.find((e) => e.role === "user" && e.content.trim() !== "");
|
|
992
1000
|
i && r.push({
|
|
993
1001
|
id: "hl-request",
|
|
@@ -1041,17 +1049,17 @@ function lt(e, t, n) {
|
|
|
1041
1049
|
title: "final response",
|
|
1042
1050
|
sub: Y(c.content, 200)
|
|
1043
1051
|
};
|
|
1044
|
-
c.tokens && (e.tokens =
|
|
1052
|
+
c.tokens && (e.tokens = Re(c.tokens.in + c.tokens.out)), r.push(e);
|
|
1045
1053
|
}
|
|
1046
1054
|
return r;
|
|
1047
1055
|
}
|
|
1048
|
-
function
|
|
1056
|
+
function dt(e) {
|
|
1049
1057
|
if (e === "error") return "errors";
|
|
1050
1058
|
if (e === "retry") return "retries";
|
|
1051
1059
|
if (e === "revert") return "re-edit";
|
|
1052
1060
|
if (e === "subagent") return "subagent";
|
|
1053
1061
|
}
|
|
1054
|
-
function
|
|
1062
|
+
function ft(e, t) {
|
|
1055
1063
|
let n = {
|
|
1056
1064
|
edits: 0,
|
|
1057
1065
|
bash: 0,
|
|
@@ -1066,7 +1074,7 @@ function dt(e, t) {
|
|
|
1066
1074
|
for (let e of Object.keys(t)) {
|
|
1067
1075
|
let n = t[e] ?? [], i = /* @__PURE__ */ new Set();
|
|
1068
1076
|
for (let e of n) {
|
|
1069
|
-
let t =
|
|
1077
|
+
let t = dt(e.kind);
|
|
1070
1078
|
t && i.add(t);
|
|
1071
1079
|
}
|
|
1072
1080
|
for (let e of i) r[e] = (r[e] ?? 0) + 1;
|
|
@@ -1079,8 +1087,8 @@ function dt(e, t) {
|
|
|
1079
1087
|
totalTurns: e.length
|
|
1080
1088
|
};
|
|
1081
1089
|
}
|
|
1082
|
-
function
|
|
1083
|
-
let a =
|
|
1090
|
+
function pt(e, t, r, i) {
|
|
1091
|
+
let a = mt(e);
|
|
1084
1092
|
if (a) try {
|
|
1085
1093
|
e = {
|
|
1086
1094
|
...n(e),
|
|
@@ -1089,20 +1097,20 @@ function ft(e, t, r, i) {
|
|
|
1089
1097
|
} catch (e) {
|
|
1090
1098
|
throw Object.assign(/* @__PURE__ */ TypeError(`Fairtrade adaptTranscript refused the durable payload during main/earlier evidence validation: ${e instanceof Error ? e.message : "canonical validation failed"}. No transcript was cooked. Correct the producer using the canonical schema and retry.`), { cause: e });
|
|
1091
1099
|
}
|
|
1092
|
-
let o = e.turns ?? [], { turns: s, toolCallsById: c, analytics: l, annotationsByTurn: u, filteredTurns: d } = $(e, o, e.nativeMetadata, "main", t, r, i?.visibleTurnIndices), f =
|
|
1093
|
-
f?.commits &&
|
|
1100
|
+
let o = e.turns ?? [], { turns: s, toolCallsById: c, analytics: l, annotationsByTurn: u, filteredTurns: d } = $(e, o, e.nativeMetadata, "main", t, r, i?.visibleTurnIndices), f = it(e);
|
|
1101
|
+
f?.commits && rt(f.commits, s);
|
|
1094
1102
|
let p = l.phases ?? [], m = {
|
|
1095
|
-
session:
|
|
1103
|
+
session: at(e, f),
|
|
1096
1104
|
turns: s,
|
|
1097
1105
|
toolCallsById: c,
|
|
1098
|
-
diffs:
|
|
1099
|
-
files:
|
|
1100
|
-
tasks:
|
|
1101
|
-
highlights:
|
|
1102
|
-
filterIndex:
|
|
1106
|
+
diffs: ct(s),
|
|
1107
|
+
files: lt(s),
|
|
1108
|
+
tasks: Ve(l.taskGroups ?? U(d), s),
|
|
1109
|
+
highlights: ut(s, p, f),
|
|
1110
|
+
filterIndex: ft(s, u),
|
|
1103
1111
|
analytics: l
|
|
1104
1112
|
};
|
|
1105
|
-
return e.nativeMetadata && (m.nativeMetadata = e.nativeMetadata), a && (m.usageScopes =
|
|
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) => {
|
|
1106
1114
|
let r = `earlier-${n}`, i = $(e, t.turns, t.nativeMetadata, r);
|
|
1107
1115
|
return {
|
|
1108
1116
|
id: r,
|
|
@@ -1110,11 +1118,11 @@ function ft(e, t, r, i) {
|
|
|
1110
1118
|
explanation: "ownership of this earlier history is uncertain. it is retained here, separate from current turns and input submissions.",
|
|
1111
1119
|
turns: i.turns,
|
|
1112
1120
|
nativeMetadata: t.nativeMetadata,
|
|
1113
|
-
usageScopes:
|
|
1121
|
+
usageScopes: be(t.turns)
|
|
1114
1122
|
};
|
|
1115
1123
|
}), m;
|
|
1116
1124
|
}
|
|
1117
|
-
function
|
|
1125
|
+
function mt(e) {
|
|
1118
1126
|
return e.harness === "pi" || [
|
|
1119
1127
|
"nativeMetadata",
|
|
1120
1128
|
"inputSubmissionCount",
|
|
@@ -1122,9 +1130,9 @@ function pt(e) {
|
|
|
1122
1130
|
"purpose",
|
|
1123
1131
|
"relationships",
|
|
1124
1132
|
"earlierHistory"
|
|
1125
|
-
].some((t) => X(e, t)) || !!e.turns?.some(
|
|
1133
|
+
].some((t) => X(e, t)) || !!e.turns?.some(He);
|
|
1126
1134
|
}
|
|
1127
|
-
function
|
|
1135
|
+
function ht(e, t) {
|
|
1128
1136
|
let n;
|
|
1129
1137
|
try {
|
|
1130
1138
|
n = a.array().parse(t === void 0 ? [] : t);
|
|
@@ -1153,26 +1161,40 @@ function mt(e, t) {
|
|
|
1153
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;
|
|
1154
1162
|
}
|
|
1155
1163
|
function $(e, t, n, r, i, a, o) {
|
|
1156
|
-
let s =
|
|
1157
|
-
for (let e
|
|
1158
|
-
|
|
1159
|
-
|
|
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);
|
|
1160
1168
|
}
|
|
1161
|
-
let
|
|
1162
|
-
for (let e = 0; e <
|
|
1163
|
-
let t =
|
|
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);
|
|
1173
|
+
}
|
|
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
|
+
}));
|
|
1164
1181
|
for (let e of i) {
|
|
1165
1182
|
e.partition = r;
|
|
1166
1183
|
let i = n?.filter((n) => n.attachment?.turnIndex === t.index && n.attachment?.toolCallId === e.id);
|
|
1167
1184
|
i?.length && (e.nativeMetadata = i);
|
|
1168
1185
|
}
|
|
1169
|
-
for (let e of i)
|
|
1186
|
+
for (let e of i) v.set(e.id, e);
|
|
1170
1187
|
let a = t.content ?? "", o;
|
|
1171
|
-
if (t.entryType === "thinking" && (Z(t) || a.trim() !== ""))
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1188
|
+
if (t.entryType === "thinking" && (Z(t) || a.trim() !== "")) {
|
|
1189
|
+
o = {
|
|
1190
|
+
text: a,
|
|
1191
|
+
words: Ie(a)
|
|
1192
|
+
};
|
|
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]);
|
|
1195
|
+
let r = Le(n, t);
|
|
1196
|
+
r !== void 0 && (o.durationMs = r), a = "";
|
|
1197
|
+
} else if (!Z(t)) {
|
|
1176
1198
|
let e = a.match(/^\s*<thinking>([\s\S]*?)<\/thinking>\s*/);
|
|
1177
1199
|
if (e) {
|
|
1178
1200
|
let t = e[1].trim();
|
|
@@ -1182,33 +1204,34 @@ function $(e, t, n, r, i, a, o) {
|
|
|
1182
1204
|
}, a = a.slice(e[0].length));
|
|
1183
1205
|
}
|
|
1184
1206
|
}
|
|
1185
|
-
let
|
|
1207
|
+
let d = t.depth ?? 0, h = t.entryType === "error" || i.some((e) => e.isError), x = {
|
|
1186
1208
|
index: t.index,
|
|
1209
|
+
sourceIndexUnique: s.get(t.index) === 1,
|
|
1187
1210
|
identity: `${r}:${t.sourceEntryRef || t.index}`,
|
|
1188
1211
|
partition: r,
|
|
1189
1212
|
role: t.role,
|
|
1190
|
-
label:
|
|
1213
|
+
label: p[e] ?? String(e + 1),
|
|
1191
1214
|
content: a,
|
|
1192
|
-
depth:
|
|
1215
|
+
depth: d,
|
|
1193
1216
|
toolCalls: i,
|
|
1194
|
-
annotations:
|
|
1217
|
+
annotations: g[t.index] ?? []
|
|
1195
1218
|
};
|
|
1196
|
-
|
|
1197
|
-
let
|
|
1198
|
-
|
|
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 = {
|
|
1199
1222
|
in: t.tokensIn ?? 0,
|
|
1200
1223
|
out: t.tokensOut ?? 0
|
|
1201
|
-
}), t.timestamp && (
|
|
1202
|
-
let
|
|
1203
|
-
|
|
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);
|
|
1204
1227
|
}
|
|
1205
1228
|
return {
|
|
1206
|
-
turns:
|
|
1207
|
-
toolCallsById:
|
|
1208
|
-
analytics:
|
|
1209
|
-
annotationsByTurn:
|
|
1210
|
-
filteredTurns:
|
|
1229
|
+
turns: y,
|
|
1230
|
+
toolCallsById: v,
|
|
1231
|
+
analytics: h,
|
|
1232
|
+
annotationsByTurn: g,
|
|
1233
|
+
filteredTurns: f
|
|
1211
1234
|
};
|
|
1212
1235
|
}
|
|
1213
1236
|
//#endregion
|
|
1214
|
-
export { h as S,
|
|
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 };
|