agent-inspect 6.31.12 → 6.31.13
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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/{chunk-GBAGZVUX.mjs → chunk-ZAYVAHIH.mjs} +82 -13
- package/packages/cli/dist/chunk-ZAYVAHIH.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +286 -44
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +209 -36
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-F44EQY4S.mjs → src-KP4UIFK5.mjs} +3 -3
- package/packages/cli/dist/{src-F44EQY4S.mjs.map → src-KP4UIFK5.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +80 -11
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.mjs +27 -7
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/{chunk-OAUNS5CS.mjs → chunk-JE3TUFAQ.mjs} +3 -3
- package/packages/core/dist/{chunk-OAUNS5CS.mjs.map → chunk-JE3TUFAQ.mjs.map} +1 -1
- package/packages/core/dist/{chunk-QOC3PJO3.mjs → chunk-NJUSSJX3.mjs} +3 -3
- package/packages/core/dist/{chunk-QOC3PJO3.mjs.map → chunk-NJUSSJX3.mjs.map} +1 -1
- package/packages/core/dist/{chunk-AK5EN4U2.mjs → chunk-YU6XT5A2.mjs} +58 -9
- package/packages/core/dist/chunk-YU6XT5A2.mjs.map +1 -0
- package/packages/core/dist/exporters.cjs +205 -32
- package/packages/core/dist/exporters.cjs.map +1 -1
- package/packages/core/dist/exporters.mjs +205 -32
- package/packages/core/dist/exporters.mjs.map +1 -1
- package/packages/core/dist/logs.cjs +56 -7
- package/packages/core/dist/logs.cjs.map +1 -1
- package/packages/core/dist/logs.mjs +2 -2
- package/packages/core/dist/persisted.cjs +56 -7
- package/packages/core/dist/persisted.cjs.map +1 -1
- package/packages/core/dist/persisted.mjs +3 -3
- package/packages/core/dist/readers.cjs +56 -7
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.mjs +3 -3
- package/packages/cli/dist/chunk-GBAGZVUX.mjs.map +0 -1
- package/packages/core/dist/chunk-AK5EN4U2.mjs.map +0 -1
|
@@ -1535,18 +1535,16 @@ var TreeBuilder = class {
|
|
|
1535
1535
|
inc(confidenceBreakdown, e.confidence);
|
|
1536
1536
|
kinds[e.kind] = (kinds[e.kind] ?? 0) + 1;
|
|
1537
1537
|
}
|
|
1538
|
-
const startedAt = sorted.length > 0 ? sorted[0].timestamp : void 0;
|
|
1539
|
-
const endedAt = sorted.length > 0 ? sorted[sorted.length - 1].timestamp : void 0;
|
|
1540
|
-
const status = computeRunStatus(sorted);
|
|
1541
|
-
const durationMs = startedAt !== void 0 && endedAt !== void 0 && Number.isFinite(startedAt) && Number.isFinite(endedAt) && endedAt >= startedAt && status !== "running" ? endedAt - startedAt : void 0;
|
|
1542
1538
|
const name = sorted.find((e) => e.kind === "RUN")?.name;
|
|
1539
|
+
const status = computeRunStatus(sorted);
|
|
1540
|
+
const timing = resolveRunTiming(sorted, status);
|
|
1543
1541
|
out.push({
|
|
1544
1542
|
runId,
|
|
1545
1543
|
name,
|
|
1546
1544
|
status,
|
|
1547
|
-
startedAt,
|
|
1548
|
-
endedAt:
|
|
1549
|
-
durationMs,
|
|
1545
|
+
startedAt: timing.startedAt,
|
|
1546
|
+
endedAt: timing.endedAt,
|
|
1547
|
+
durationMs: timing.durationMs,
|
|
1550
1548
|
children: roots,
|
|
1551
1549
|
metadata: {
|
|
1552
1550
|
totalEvents: sorted.length,
|
|
@@ -1560,6 +1558,57 @@ var TreeBuilder = class {
|
|
|
1560
1558
|
return out;
|
|
1561
1559
|
}
|
|
1562
1560
|
};
|
|
1561
|
+
function resolveRunTiming(sorted, status) {
|
|
1562
|
+
let startedAtMs;
|
|
1563
|
+
let endedAtMs;
|
|
1564
|
+
let explicitDurationMs;
|
|
1565
|
+
for (const event of sorted) {
|
|
1566
|
+
if (event.kind !== "RUN") continue;
|
|
1567
|
+
const attrs = event.attributes ?? {};
|
|
1568
|
+
if (typeof attrs.startedAtMs === "number" && Number.isFinite(attrs.startedAtMs)) {
|
|
1569
|
+
startedAtMs = startedAtMs === void 0 ? attrs.startedAtMs : Math.min(startedAtMs, attrs.startedAtMs);
|
|
1570
|
+
}
|
|
1571
|
+
if (typeof attrs.endedAtMs === "number" && Number.isFinite(attrs.endedAtMs)) {
|
|
1572
|
+
endedAtMs = endedAtMs === void 0 ? attrs.endedAtMs : Math.max(endedAtMs, attrs.endedAtMs);
|
|
1573
|
+
}
|
|
1574
|
+
if ((event.status === "ok" || event.status === "error") && typeof event.durationMs === "number" && Number.isFinite(event.durationMs) && event.durationMs >= 0) {
|
|
1575
|
+
explicitDurationMs = event.durationMs;
|
|
1576
|
+
if (endedAtMs === void 0 && startedAtMs !== void 0) {
|
|
1577
|
+
endedAtMs = startedAtMs + event.durationMs;
|
|
1578
|
+
} else if (endedAtMs === void 0 && Number.isFinite(event.timestamp)) {
|
|
1579
|
+
endedAtMs = event.timestamp + event.durationMs;
|
|
1580
|
+
if (startedAtMs === void 0) {
|
|
1581
|
+
startedAtMs = event.timestamp;
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
if (startedAtMs === void 0 && event.status === "running" && Number.isFinite(event.timestamp)) {
|
|
1586
|
+
startedAtMs = event.timestamp;
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
if (startedAtMs !== void 0 && endedAtMs !== void 0 && Number.isFinite(startedAtMs) && Number.isFinite(endedAtMs) && endedAtMs >= startedAtMs && status !== "running") {
|
|
1590
|
+
return {
|
|
1591
|
+
startedAt: startedAtMs,
|
|
1592
|
+
endedAt: endedAtMs,
|
|
1593
|
+
durationMs: endedAtMs - startedAtMs
|
|
1594
|
+
};
|
|
1595
|
+
}
|
|
1596
|
+
if (startedAtMs !== void 0 && explicitDurationMs !== void 0 && status !== "running") {
|
|
1597
|
+
return {
|
|
1598
|
+
startedAt: startedAtMs,
|
|
1599
|
+
endedAt: startedAtMs + explicitDurationMs,
|
|
1600
|
+
durationMs: explicitDurationMs
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
const startedAt = sorted.length > 0 ? sorted[0].timestamp : void 0;
|
|
1604
|
+
const endedAt = sorted.length > 0 ? sorted[sorted.length - 1].timestamp : void 0;
|
|
1605
|
+
const durationMs = startedAt !== void 0 && endedAt !== void 0 && Number.isFinite(startedAt) && Number.isFinite(endedAt) && endedAt >= startedAt && status !== "running" ? endedAt - startedAt : void 0;
|
|
1606
|
+
return {
|
|
1607
|
+
startedAt,
|
|
1608
|
+
endedAt: status === "running" ? void 0 : endedAt,
|
|
1609
|
+
durationMs
|
|
1610
|
+
};
|
|
1611
|
+
}
|
|
1563
1612
|
|
|
1564
1613
|
// packages/core/src/persisted/tree-bridge.ts
|
|
1565
1614
|
function logicalToPersisted(event) {
|