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
|
@@ -11,12 +11,12 @@ import { escapeHtml, flattenTree } from './chunk-CAWPF22J.mjs';
|
|
|
11
11
|
import { resolveRedactionProfile, readTraceEventsFromFile, stringContainsHighConfidenceCredential } from './chunk-DK3OW6UI.mjs';
|
|
12
12
|
export { DEFAULT_MAX_EVENT_BYTES, DEFAULT_MAX_METADATA_VALUE_LENGTH, DEFAULT_MAX_PREVIEW_LENGTH, getRunIdFromTraceFileName, initializeTraceFile, listTraceFiles, prepareMetadataForDisk, prepareTraceEventForDisk, readTraceEvents, readTraceFile, resolveRedactionProfile, resolveTraceSafetyOptions, serializeEvent, validateEvent, writeTraceEvent } from './chunk-DK3OW6UI.mjs';
|
|
13
13
|
import { Redactor } from './chunk-VLVCLAPB.mjs';
|
|
14
|
-
import { openTrace } from './chunk-
|
|
15
|
-
import './chunk-
|
|
14
|
+
import { openTrace } from './chunk-NJUSSJX3.mjs';
|
|
15
|
+
import './chunk-JE3TUFAQ.mjs';
|
|
16
16
|
import { projectLogicalEvents } from './chunk-AHUZNHFI.mjs';
|
|
17
17
|
import './chunk-S4YWKV4G.mjs';
|
|
18
18
|
import './chunk-S6LQBLX5.mjs';
|
|
19
|
-
import './chunk-
|
|
19
|
+
import './chunk-YU6XT5A2.mjs';
|
|
20
20
|
import { parseDuration, isTraceEvent, getTraceFilePath } from './chunk-7DHSWDKB.mjs';
|
|
21
21
|
export { DEFAULT_TRACE_DIR_NAME, FALLBACK_TRACE_DIR, MAX_NAME_LENGTH, RUNS_DIR_NAME, createRunId, createStepId, ensureTraceDir, formatDuration, formatError, formatTimestamp, getDefaultTraceDir, getTraceFilePath, isStepStatus, isStepType, isTraceEvent, parseDuration, parseTraceJsonl, truncateName, unknownTraceFormatMessage, warn } from './chunk-7DHSWDKB.mjs';
|
|
22
22
|
import { persistedInspectEventsToTraceEvents } from './chunk-EE5Z2GQ3.mjs';
|
|
@@ -381,12 +381,14 @@ function topKinds(run) {
|
|
|
381
381
|
function countErrorNodes(nodes) {
|
|
382
382
|
return nodes.filter((entry) => entry.node.event.status === "error").length;
|
|
383
383
|
}
|
|
384
|
+
function isExecutionStepKind(kind) {
|
|
385
|
+
return kind !== "RUN" && kind !== "OUTCOME";
|
|
386
|
+
}
|
|
384
387
|
function slowestNode(nodes) {
|
|
385
388
|
return nodes.filter(
|
|
386
389
|
(entry) => entry.node.event.durationMs !== void 0 && // The RUN boundary spans the whole run, so its duration always dominates
|
|
387
|
-
// and shadows every real step.
|
|
388
|
-
|
|
389
|
-
entry.node.event.kind !== "RUN"
|
|
390
|
+
// and shadows every real step. OUTCOME is a linked result, not execution.
|
|
391
|
+
isExecutionStepKind(entry.node.event.kind)
|
|
390
392
|
).sort((a, b) => {
|
|
391
393
|
const delta = (b.node.event.durationMs ?? 0) - (a.node.event.durationMs ?? 0);
|
|
392
394
|
return delta !== 0 ? delta : a.index - b.index;
|
|
@@ -439,6 +441,12 @@ function buildFacts(run, redactor, events) {
|
|
|
439
441
|
const scoped = events.filter((event) => event.runId === run.runId);
|
|
440
442
|
const { logicalEvents: logical } = projectLogicalEvents(scoped);
|
|
441
443
|
const logicalSteps = logical.filter((event) => event.kind !== "RUN");
|
|
444
|
+
const executionSteps = logical.filter((event) => isExecutionStepKind(event.kind));
|
|
445
|
+
const executionByKind = {
|
|
446
|
+
LLM: executionSteps.filter((event) => event.kind === "LLM").length,
|
|
447
|
+
TOOL: executionSteps.filter((event) => event.kind === "TOOL").length,
|
|
448
|
+
LOGIC: executionSteps.filter((event) => event.kind === "LOGIC").length
|
|
449
|
+
};
|
|
442
450
|
facts.push(
|
|
443
451
|
fact("run.rawEventCount", "Raw persisted event count", scoped.length, redactor),
|
|
444
452
|
fact(
|
|
@@ -452,9 +460,21 @@ function buildFacts(run, redactor, events) {
|
|
|
452
460
|
"Logical lifecycle event count (including RUN)",
|
|
453
461
|
logical.length,
|
|
454
462
|
redactor
|
|
463
|
+
),
|
|
464
|
+
fact(
|
|
465
|
+
"run.executionStepCount",
|
|
466
|
+
"Execution step count (excludes RUN and OUTCOME)",
|
|
467
|
+
executionSteps.length,
|
|
468
|
+
redactor
|
|
469
|
+
),
|
|
470
|
+
fact(
|
|
471
|
+
"run.executionStepKinds",
|
|
472
|
+
"Execution step kind counts",
|
|
473
|
+
executionByKind,
|
|
474
|
+
redactor
|
|
455
475
|
)
|
|
456
476
|
);
|
|
457
|
-
const slowestLogical = [...
|
|
477
|
+
const slowestLogical = [...executionSteps].filter((event) => typeof event.durationMs === "number").sort((a, b) => {
|
|
458
478
|
const delta = (b.durationMs ?? 0) - (a.durationMs ?? 0);
|
|
459
479
|
return delta !== 0 ? delta : a.eventId.localeCompare(b.eventId);
|
|
460
480
|
})[0];
|