@peasant-labs/fairtrade 0.0.50 → 0.0.51
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/{adapter-CVKibszh.js → adapter-VlAohr64.js} +107 -102
- package/dist/lib/commons.js +1 -1
- package/dist/lib/components.css +1 -1
- package/dist/lib/share.js +1 -1
- package/dist/lib/types/transcript/IntegrityBadge.d.ts +21 -0
- package/dist/lib/types/transcript/TranscriptViewer.d.ts +1 -1
- package/dist/lib/types/transcript/TurnCard.d.ts +7 -1
- package/dist/lib/types/transcript/WorkGroup.d.ts +3 -1
- package/dist/lib/types/transcript/integrity.d.ts +36 -0
- package/dist/lib/types/transcript/state-capabilities.d.ts +12 -0
- package/dist/lib/types/transcript/view-model.d.ts +4 -0
- package/dist/lib/types/transcript/work-summary.d.ts +9 -0
- package/dist/lib/types/ui/transcript/view-model.d.ts +4 -0
- package/dist/lib/{ui-BOGaFxV-.js → ui-Do7A_I-0.js} +2409 -2217
- package/dist/lib/ui.js +2 -2
- package/package.json +8 -4
|
@@ -186,17 +186,17 @@ function C(e) {
|
|
|
186
186
|
};
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
|
-
var
|
|
189
|
+
var w = /* @__PURE__ */ new Set([
|
|
190
190
|
"Task",
|
|
191
191
|
"EnterWorktree",
|
|
192
192
|
"SendMessage",
|
|
193
193
|
"TeamCreate"
|
|
194
|
-
]),
|
|
194
|
+
]), ee = /* @__PURE__ */ new Set([
|
|
195
195
|
"Write",
|
|
196
196
|
"Edit",
|
|
197
197
|
"NotebookEdit"
|
|
198
198
|
]);
|
|
199
|
-
function
|
|
199
|
+
function T(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 w(e) {
|
|
|
206
206
|
type: "error",
|
|
207
207
|
label: `${e.name} failed`,
|
|
208
208
|
severity: "error"
|
|
209
|
-
}),
|
|
209
|
+
}), w.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
|
+
}), ee.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 w(e) {
|
|
|
240
240
|
}
|
|
241
241
|
return t.sort((e, t) => e.turnIndex - t.turnIndex);
|
|
242
242
|
}
|
|
243
|
-
var
|
|
243
|
+
var te = {
|
|
244
244
|
planning: "Planning",
|
|
245
245
|
exploration: "Exploration",
|
|
246
246
|
implementation: "Implementation",
|
|
@@ -252,20 +252,20 @@ var ne = {
|
|
|
252
252
|
recovery: "Recovery",
|
|
253
253
|
abandonment: "Abandonment"
|
|
254
254
|
};
|
|
255
|
-
function
|
|
256
|
-
return
|
|
255
|
+
function E(e) {
|
|
256
|
+
return te[e] ?? String(e);
|
|
257
257
|
}
|
|
258
|
-
var
|
|
258
|
+
var D = /* @__PURE__ */ new Set([
|
|
259
259
|
"Read",
|
|
260
260
|
"Glob",
|
|
261
261
|
"Grep",
|
|
262
262
|
"WebSearch",
|
|
263
263
|
"WebFetch"
|
|
264
|
-
]),
|
|
264
|
+
]), O = /* @__PURE__ */ new Set([
|
|
265
265
|
"Write",
|
|
266
266
|
"Edit",
|
|
267
267
|
"NotebookEdit"
|
|
268
|
-
]),
|
|
268
|
+
]), ne = [
|
|
269
269
|
/\btest\b/i,
|
|
270
270
|
/\bjest\b/i,
|
|
271
271
|
/\bpytest\b/i,
|
|
@@ -278,21 +278,21 @@ var E = /* @__PURE__ */ new Set([
|
|
|
278
278
|
/\bmocha\b/i,
|
|
279
279
|
/\brspec\b/i
|
|
280
280
|
];
|
|
281
|
-
function
|
|
281
|
+
function re(e, t) {
|
|
282
282
|
return e.toolCalls?.some((e) => t.has(e.name)) ?? !1;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function ie(e, t) {
|
|
285
285
|
return e.toolCalls?.length ? e.toolCalls.every((e) => t.has(e.name)) : !1;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function k(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 ae(e) {
|
|
292
|
+
for (let t of e.toolCalls ?? []) if (t.name === "Bash" && ne.some((e) => e.test(t.arguments))) return !0;
|
|
293
293
|
return !1;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function oe(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 se(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) => O.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 se(e) {
|
|
|
310
310
|
}
|
|
311
311
|
return t;
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function se(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 ce(e) {
|
|
318
|
+
let t = oe(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 && se(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 le = [
|
|
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 ue = [
|
|
|
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
|
+
], ue = /\b(let'?s move on|forget it|different approach|never mind)\b/i;
|
|
335
|
+
function de(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" ? le.some((t) => t.test(e.content)) ? "user-correction" : n ?? "planning" : k(e) ? "error" : ae(e) ? "testing" : r > 0 && ie(e, D) ? "debug" : re(e, O) ? n === "retry-loop" || n === "user-correction" ? "recovery" : "implementation" : ie(e, D) && r === 0 ? "exploration" : e.role === "assistant" && !e.toolCalls?.length && e.content.length > 100 ? "planning" : n ?? "planning";
|
|
338
338
|
}
|
|
339
|
-
var
|
|
339
|
+
var fe = /* @__PURE__ */ new Set([
|
|
340
340
|
"error",
|
|
341
341
|
"user-correction",
|
|
342
342
|
"retry-loop",
|
|
343
343
|
"abandonment"
|
|
344
344
|
]);
|
|
345
|
-
function
|
|
345
|
+
function pe(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 me(e) {
|
|
|
351
351
|
a.endTurn = r.endTurn;
|
|
352
352
|
continue;
|
|
353
353
|
}
|
|
354
|
-
if (i < 3 && !
|
|
354
|
+
if (i < 3 && !fe.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 me(e) {
|
|
|
379
379
|
}
|
|
380
380
|
return t;
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function me(e) {
|
|
383
383
|
if (e.length === 0) return [];
|
|
384
|
-
let t =
|
|
384
|
+
let t = ce(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++) k(e[t]) && i++;
|
|
388
388
|
let a = n.length > 0 ? n[n.length - 1].type : null;
|
|
389
389
|
n.push({
|
|
390
|
-
type:
|
|
390
|
+
type: de(e[r], r, a, i, t),
|
|
391
391
|
turn: r
|
|
392
392
|
});
|
|
393
393
|
}
|
|
@@ -399,8 +399,8 @@ function he(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 = k(t) && t.role === "assistant", a = t.role === "user" && ue.test(t.content), o = !e.slice(Math.floor(e.length * .8)).some((e) => re(e, O));
|
|
403
|
+
if ((i || a || o && n.type !== "planning") && (e.filter(k).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 he(e) {
|
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
return
|
|
413
|
+
return pe(r);
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
return
|
|
415
|
+
function A(e) {
|
|
416
|
+
return me(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] && k(e[n]) && r++;
|
|
419
419
|
let i = {
|
|
420
420
|
id: `phase-${n + 1}`,
|
|
421
|
-
label:
|
|
421
|
+
label: E(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 k(e) {
|
|
|
426
426
|
return r > 0 && (i.errors = r), i;
|
|
427
427
|
});
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function j(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 he(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 = j(t), o = j(n), s = j(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 M = .2, N = 70, P = 50, F = 40, I = 30, L = 4, R = 3;
|
|
443
|
+
function z(e) {
|
|
444
444
|
return e != null;
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function B(e) {
|
|
447
447
|
return e === "bad" ? 2 : +(e === "watch");
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
return e.reduce((e, t) =>
|
|
449
|
+
function V(e) {
|
|
450
|
+
return e.reduce((e, t) => B(t) > B(e) ? t : e, "good");
|
|
451
451
|
}
|
|
452
|
-
function
|
|
452
|
+
function H(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 = z(e.totalTokens) && (e.totalTokens ?? 0) > 0 && z(e.retryTokensWasted) ? (e.retryTokensWasted ?? 0) / (e.totalTokens ?? 1) : void 0;
|
|
457
|
+
if (a !== void 0 && (r.push(a > M ? "bad" : "good"), a > M && i.push(`${Math.round(a * 100)}% of tokens spent on retries`)), z(e.m5ContextUtilizationPct)) {
|
|
458
458
|
let t = e.m5ContextUtilizationPct ?? 0;
|
|
459
|
-
r.push(t >
|
|
459
|
+
r.push(t > N ? "watch" : "good"), t > N && i.push(`Context ${Math.round(t)}% full`);
|
|
460
460
|
}
|
|
461
|
-
if (
|
|
461
|
+
if (z(e.m6OutputSurvivalPct)) {
|
|
462
462
|
let t = e.m6OutputSurvivalPct ?? 0;
|
|
463
|
-
r.push(t <
|
|
463
|
+
r.push(t < P ? "watch" : "good"), t < P && i.push(`Only ${Math.round(t)}% of output survived`);
|
|
464
464
|
}
|
|
465
|
-
e.outcome === "failed" &&
|
|
465
|
+
e.outcome === "failed" && z(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 || z(e.m5ContextUtilizationPct) || z(e.m6OutputSurvivalPct)) && n.push(U("token", "Token efficiency", a === void 0 ? z(e.m5ContextUtilizationPct) ? `${Math.round(e.m5ContextUtilizationPct ?? 0)}% context used` : "—" : `${Math.round(a * 100)}% retry tokens`, V(r), i));
|
|
466
466
|
}
|
|
467
467
|
{
|
|
468
468
|
let t = [], r = [];
|
|
469
|
-
if (
|
|
469
|
+
if (z(e.specQualityScore)) {
|
|
470
470
|
let n = e.specQualityScore ?? 0;
|
|
471
|
-
t.push(n <
|
|
471
|
+
t.push(n < F ? "bad" : "good"), n < F && r.push(`Spec quality low (${Math.round(n)}/100)`);
|
|
472
472
|
}
|
|
473
|
-
if (
|
|
473
|
+
if (z(e.signalDensity)) {
|
|
474
474
|
let n = e.signalDensity ?? 0;
|
|
475
|
-
t.push(n <
|
|
475
|
+
t.push(n < I ? "watch" : "good"), n < I && 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")), (z(e.specQualityScore) || z(e.signalDensity) || z(e.m7SpecHasExamples) || z(e.m7SpecHasConstraints)) && n.push(U("prompt", "Prompt quality", z(e.specQualityScore) ? `Spec ${Math.round(e.specQualityScore ?? 0)}/100` : z(e.signalDensity) ? `${Math.round(e.signalDensity ?? 0)}% signal` : "—", V(t), r));
|
|
478
478
|
}
|
|
479
479
|
{
|
|
480
480
|
let t = [], r = [];
|
|
481
|
-
if (
|
|
481
|
+
if (z(e.m4ConsecutiveErrorMax)) {
|
|
482
482
|
let n = e.m4ConsecutiveErrorMax ?? 0;
|
|
483
|
-
t.push(n >=
|
|
483
|
+
t.push(n >= L ? "bad" : "good"), n >= L && r.push(`${n} errors in a row`);
|
|
484
484
|
}
|
|
485
|
-
if (
|
|
485
|
+
if (z(e.withinSessionReverts)) {
|
|
486
486
|
let n = e.withinSessionReverts ?? 0;
|
|
487
|
-
t.push(n >=
|
|
487
|
+
t.push(n >= R ? "bad" : "good"), n >= R && r.push(`${n} reverts mid-session`);
|
|
488
488
|
}
|
|
489
|
-
(
|
|
489
|
+
(z(e.m4ConsecutiveErrorMax) || z(e.withinSessionReverts)) && n.push(U("loop", "Loop efficiency", z(e.m4ConsecutiveErrorMax) ? `${e.m4ConsecutiveErrorMax ?? 0} max error streak` : z(e.withinSessionReverts) ? `${e.withinSessionReverts ?? 0} reverts` : "—", V(t), r));
|
|
490
490
|
}
|
|
491
491
|
return n;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function U(e, t, n, r, i) {
|
|
494
494
|
let a = {
|
|
495
495
|
id: e,
|
|
496
496
|
label: t,
|
|
@@ -500,7 +500,7 @@ function H(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 ge(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 _e(e, t) {
|
|
|
509
509
|
label: e.label
|
|
510
510
|
};
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function _e(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 ve(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 W(e) {
|
|
530
|
+
return y(e).map((t, n) => _e(t, n, e));
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
let n =
|
|
532
|
+
function G(e, t = {}) {
|
|
533
|
+
let n = A(e), r = T(e).map((t) => ge(t, e)), i = W(e), a = H(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 K = Object.freeze({
|
|
539
539
|
input: "input",
|
|
540
540
|
output: "output",
|
|
541
541
|
cacheRead: "cache read",
|
|
@@ -543,7 +543,7 @@ var G = Object.freeze({
|
|
|
543
543
|
cacheWrite1h: "cache write 1h (subset)",
|
|
544
544
|
reasoning: "reasoning (subset)",
|
|
545
545
|
totalTokens: "total tokens"
|
|
546
|
-
}),
|
|
546
|
+
}), ve = Object.freeze({
|
|
547
547
|
input: "input",
|
|
548
548
|
output: "output",
|
|
549
549
|
cacheRead: "cache read",
|
|
@@ -582,8 +582,8 @@ function be(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", K),
|
|
586
|
+
cost: r("cost", ve)
|
|
587
587
|
}];
|
|
588
588
|
});
|
|
589
589
|
}
|
|
@@ -1105,7 +1105,7 @@ 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 ??
|
|
1108
|
+
tasks: Ve(l.taskGroups ?? W(d), s),
|
|
1109
1109
|
highlights: ut(s, p, f),
|
|
1110
1110
|
filterIndex: ft(s, u),
|
|
1111
1111
|
analytics: l
|
|
@@ -1166,14 +1166,19 @@ function $(e, t, n, r, i, a, o) {
|
|
|
1166
1166
|
s.set(e.index, (s.get(e.index) ?? 0) + 1);
|
|
1167
1167
|
for (let t of e.toolCalls ?? []) t.id && c.set(t.id, (c.get(t.id) ?? 0) + 1);
|
|
1168
1168
|
}
|
|
1169
|
-
let l = Xe(t, e.model), u =
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
t
|
|
1169
|
+
let l = Xe(t, e.model), u = /* @__PURE__ */ new Map();
|
|
1170
|
+
r === "main" && t.forEach((e, t) => u.set(e, t));
|
|
1171
|
+
let d = (e.harness === "pi" ? t : Je(t)).filter((t) => !Ke(t, e.harness)).map((e) => {
|
|
1172
|
+
let t = qe(e), n = u.get(e);
|
|
1173
|
+
return t !== e && n !== void 0 && u.set(t, n), t;
|
|
1174
|
+
}), f = o === void 0 ? null : new Set(o), p = f === null ? d : d.filter((e) => f.has(e.index)), m = x(p), h = e.harness, g = a ?? G(p, { scorecard: e.scorecard ?? void 0 }), _ = st(g.patternAnnotations ?? [], ot(i ?? [])), v = -1;
|
|
1175
|
+
for (let e = 0; e < p.length; e++) {
|
|
1176
|
+
let t = p[e];
|
|
1177
|
+
t.role === "assistant" && (t.depth ?? 0) === 0 && t.content?.trim() && (v = e);
|
|
1173
1178
|
}
|
|
1174
|
-
let
|
|
1175
|
-
for (let e = 0; e <
|
|
1176
|
-
let t =
|
|
1179
|
+
let y = /* @__PURE__ */ new Map(), b = [], S = new Map(d.map((e, t) => [e, t]));
|
|
1180
|
+
for (let e = 0; e < p.length; e++) {
|
|
1181
|
+
let t = p[e], i = (t.toolCalls ?? []).map((e, t) => ({
|
|
1177
1182
|
...tt(e),
|
|
1178
1183
|
sourceIndex: t,
|
|
1179
1184
|
sourceIdUnique: !e.id || c.get(e.id) === 1
|
|
@@ -1183,15 +1188,15 @@ function $(e, t, n, r, i, a, o) {
|
|
|
1183
1188
|
let i = n?.filter((n) => n.attachment?.turnIndex === t.index && n.attachment?.toolCallId === e.id);
|
|
1184
1189
|
i?.length && (e.nativeMetadata = i);
|
|
1185
1190
|
}
|
|
1186
|
-
for (let e of i)
|
|
1191
|
+
for (let e of i) y.set(e.id, e);
|
|
1187
1192
|
let a = t.content ?? "", o;
|
|
1188
1193
|
if (t.entryType === "thinking" && (Z(t) || a.trim() !== "")) {
|
|
1189
1194
|
o = {
|
|
1190
1195
|
text: a,
|
|
1191
1196
|
words: Ie(a)
|
|
1192
1197
|
};
|
|
1193
|
-
let e =
|
|
1194
|
-
for (let r = e - 1; r >= 0 && !n; r--) (
|
|
1198
|
+
let e = S.get(t) ?? -1, n;
|
|
1199
|
+
for (let r = e - 1; r >= 0 && !n; r--) (d[r].depth ?? 0) === (t.depth ?? 0) && (n = d[r]);
|
|
1195
1200
|
let r = Le(n, t);
|
|
1196
1201
|
r !== void 0 && (o.durationMs = r), a = "";
|
|
1197
1202
|
} else if (!Z(t)) {
|
|
@@ -1204,34 +1209,34 @@ function $(e, t, n, r, i, a, o) {
|
|
|
1204
1209
|
}, a = a.slice(e[0].length));
|
|
1205
1210
|
}
|
|
1206
1211
|
}
|
|
1207
|
-
let
|
|
1212
|
+
let f = t.depth ?? 0, g = t.entryType === "error" || i.some((e) => e.isError), x = {
|
|
1208
1213
|
index: t.index,
|
|
1209
1214
|
sourceIndexUnique: s.get(t.index) === 1,
|
|
1210
1215
|
identity: `${r}:${t.sourceEntryRef || t.index}`,
|
|
1211
1216
|
partition: r,
|
|
1212
1217
|
role: t.role,
|
|
1213
|
-
label:
|
|
1218
|
+
label: m[e] ?? String(e + 1),
|
|
1214
1219
|
content: a,
|
|
1215
|
-
depth:
|
|
1220
|
+
depth: f,
|
|
1216
1221
|
toolCalls: i,
|
|
1217
|
-
annotations:
|
|
1222
|
+
annotations: _[t.index] ?? []
|
|
1218
1223
|
};
|
|
1219
|
-
|
|
1220
|
-
let
|
|
1221
|
-
|
|
1224
|
+
u.has(t) && (x.sourcePosition = u.get(t)), f === 0 && t.role === "assistant" && (x.provider = h), t.agentName && (x.agentName = t.agentName), o && (x.thinking = o);
|
|
1225
|
+
let C = Be(t.role, a, h);
|
|
1226
|
+
C !== void 0 && (x.displayContent = C), 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), g && (x.isError = !0), e === v && (x.isFinal = !0), !t.usage && (t.tokensIn != null || t.tokensOut != null) && (x.tokens = {
|
|
1222
1227
|
in: t.tokensIn ?? 0,
|
|
1223
1228
|
out: t.tokensOut ?? 0
|
|
1224
1229
|
}), t.timestamp && (x.timestamp = t.timestamp);
|
|
1225
|
-
let
|
|
1226
|
-
|
|
1230
|
+
let w = l.get(t.index);
|
|
1231
|
+
w?.effectiveModel !== void 0 && (x.effectiveModel = w.effectiveModel), w?.modelChangedFrom !== void 0 && (x.modelChangedFrom = w.modelChangedFrom), b.push(x);
|
|
1227
1232
|
}
|
|
1228
1233
|
return {
|
|
1229
|
-
turns:
|
|
1230
|
-
toolCallsById:
|
|
1231
|
-
analytics:
|
|
1232
|
-
annotationsByTurn:
|
|
1233
|
-
filteredTurns:
|
|
1234
|
+
turns: b,
|
|
1235
|
+
toolCallsById: y,
|
|
1236
|
+
analytics: g,
|
|
1237
|
+
annotationsByTurn: _,
|
|
1238
|
+
filteredTurns: p
|
|
1234
1239
|
};
|
|
1235
1240
|
}
|
|
1236
1241
|
//#endregion
|
|
1237
|
-
export { h as S,
|
|
1242
|
+
export { h as S, W as _, ke as a, A as b, Ee as c, K as d, T as f, he as g, G as h, Te as i, q as l, C as m, Ke as n, Oe as o, H as p, Je as r, De as s, pt as t, ve as u, y as v, E as x, x as y };
|
package/dist/lib/commons.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dt as e, Tt as t, ft as n, mt as r } from "./GraphLegend-e9x79JtU.js";
|
|
2
|
-
import { $ as i, $t as a, Gn as o, In as s, O as c, Qn as l, St as u, Xn as d, Yn as f, Zt as p, _t as m, at as h, bt as g, en as _, ht as v, k as y, nt as b, ot as x, pr as S, tn as C, tt as w, vt as T, yt as E } from "./ui-
|
|
2
|
+
import { $ as i, $t as a, Gn as o, In as s, O as c, Qn as l, St as u, Xn as d, Yn as f, Zt as p, _t as m, at as h, bt as g, en as _, ht as v, k as y, nt as b, ot as x, pr as S, tn as C, tt as w, vt as T, yt as E } from "./ui-Do7A_I-0.js";
|
|
3
3
|
import { p as D } from "./time-CpVBzcqQ.js";
|
|
4
4
|
import { i as O, o as k, r as A } from "./format-B3uT2wzU.js";
|
|
5
5
|
import { useEffect as j, useId as M, useMemo as N, useRef as ee, useState as P } from "react";
|