@feigi/fleet-ctl 3.116.2 → 3.116.3
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/package.json
CHANGED
|
@@ -357,7 +357,7 @@ function createdPrNumbers(text) {
|
|
|
357
357
|
// numbers in first-seen order.
|
|
358
358
|
export function foldOmpTranscript(jsonlText, filePath) {
|
|
359
359
|
let model = null, thinking = null, task = null, resolvedModelIdentity = null, agent = null;
|
|
360
|
-
let firstTs = null
|
|
360
|
+
let firstTs = null;
|
|
361
361
|
// For the `work_s` column (member-outcomes.mjs): every timestamped entry's
|
|
362
362
|
// instant, and the member's working parts — each run of timestamped entries
|
|
363
363
|
// between two `session_exit` entries, as [first, last] in epoch ms. The
|
|
@@ -391,7 +391,7 @@ export function foldOmpTranscript(jsonlText, filePath) {
|
|
|
391
391
|
catch { if (i !== lines.length - 1) malformedNonLastLines++; continue; }
|
|
392
392
|
assertOmpShaped(d, filePath);
|
|
393
393
|
let ms = NaN;
|
|
394
|
-
if (typeof d.timestamp === "string") { firstTs ??= d.timestamp;
|
|
394
|
+
if (typeof d.timestamp === "string") { firstTs ??= d.timestamp; ms = Date.parse(d.timestamp); }
|
|
395
395
|
if (Number.isFinite(ms)) stamps.push(ms);
|
|
396
396
|
if (d.type === "custom" && d.customType === "session_exit") {
|
|
397
397
|
sessionExit = true;
|
|
@@ -447,7 +447,12 @@ export function foldOmpTranscript(jsonlText, filePath) {
|
|
|
447
447
|
if (d.type === "message" && m?.role === "user" && messageText(m).trimStart().startsWith("[budget notice]")) budgetNotice = true;
|
|
448
448
|
}
|
|
449
449
|
if (partFirst !== null) workParts.push([partFirst, partLast]);
|
|
450
|
-
|
|
450
|
+
// `wall_s` is the span of the parseable stamps, latest minus earliest, so it
|
|
451
|
+
// does not depend on file order and cannot go negative; an unparseable
|
|
452
|
+
// stamp is skipped, and a transcript with none spans 0.
|
|
453
|
+
let earliest = Infinity, latest = -Infinity;
|
|
454
|
+
for (const t of stamps) { if (t < earliest) earliest = t; if (t > latest) latest = t; }
|
|
455
|
+
const span = stamps.length ? (latest - earliest) / 1000 : 0;
|
|
451
456
|
return {
|
|
452
457
|
model, thinking, task, resolvedModelIdentity, agent,
|
|
453
458
|
input, cacheWrite, cacheRead, output,
|
|
@@ -462,7 +467,7 @@ export function foldOmpTranscript(jsonlText, filePath) {
|
|
|
462
467
|
// a partial sum never passes for the member's whole cost.
|
|
463
468
|
cost: sawCost && !unpriced ? cost : null,
|
|
464
469
|
turns,
|
|
465
|
-
wallS:
|
|
470
|
+
wallS: Math.round(span),
|
|
466
471
|
entries,
|
|
467
472
|
malformedNonLastLines,
|
|
468
473
|
openedPrs: [...openedPrs],
|