agent-inspect 6.29.1 → 6.29.2

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/docs/API.md +4 -0
  4. package/docs/CLI.md +2 -0
  5. package/docs/LIMITATIONS.md +1 -0
  6. package/docs/NETWORK-BEHAVIOR.md +8 -0
  7. package/docs/TRACE-CONTRACTS.md +11 -0
  8. package/package.json +2 -2
  9. package/packages/cli/dist/index.cjs +45 -10
  10. package/packages/cli/dist/index.cjs.map +1 -1
  11. package/packages/cli/dist/index.mjs +46 -11
  12. package/packages/cli/dist/index.mjs.map +1 -1
  13. package/packages/core/dist/advanced.cjs +38 -1
  14. package/packages/core/dist/advanced.cjs.map +1 -1
  15. package/packages/core/dist/advanced.d.cts +2 -2
  16. package/packages/core/dist/advanced.d.ts +2 -2
  17. package/packages/core/dist/advanced.mjs +3 -3
  18. package/packages/core/dist/checks.cjs +15 -2
  19. package/packages/core/dist/checks.cjs.map +1 -1
  20. package/packages/core/dist/checks.d.cts +2 -2
  21. package/packages/core/dist/checks.d.ts +2 -2
  22. package/packages/core/dist/checks.mjs +1 -1
  23. package/packages/core/dist/{chunk-GPGBKN7W.mjs → chunk-QZIXYP7U.mjs} +17 -4
  24. package/packages/core/dist/{chunk-GPGBKN7W.mjs.map → chunk-QZIXYP7U.mjs.map} +1 -1
  25. package/packages/core/dist/{chunk-AQMJFKI6.mjs → chunk-XRI3GB6I.mjs} +40 -3
  26. package/packages/core/dist/chunk-XRI3GB6I.mjs.map +1 -0
  27. package/packages/core/dist/{index-C61p7wBR.d.cts → index-BaQ48jrq.d.cts} +9 -1
  28. package/packages/core/dist/{index-DTO2iGeq.d.ts → index-CrnEOoRu.d.ts} +9 -1
  29. package/packages/core/dist/index.cjs +38 -1
  30. package/packages/core/dist/index.cjs.map +1 -1
  31. package/packages/core/dist/index.mjs +2 -2
  32. package/packages/core/dist/chunk-AQMJFKI6.mjs.map +0 -1
@@ -6,8 +6,8 @@ import { a as InspectRunTree } from './inspect-event-CDqjcrG_.cjs';
6
6
  export { A as AttributionConfidence, E as EventSource, b as InspectEvent, I as InspectKind, c as InspectNode } from './inspect-event-CDqjcrG_.cjs';
7
7
  import { P as PersistedInspectEvent } from './persisted-inspect-event-DPaCiars.cjs';
8
8
  import { Stats } from 'node:fs';
9
- import { aR as SessionWorkflowMetadata, aS as SessionRunRecord, aT as EnrichSessionSummaryOptions, aU as SessionStatus, aV as SessionSummary, aW as SessionIndex, aX as BuildActivitySummaryOptions, aY as ActivitySummary, aZ as SessionWarning, a_ as BuildSessionIndexOptions, N as TraceCheckResult, X as TraceCheckStatus, a2 as TraceContractInput, Z as TraceContract } from './index-C61p7wBR.cjs';
10
- export { a$ as ActivityEntry, b0 as CriticalPathStep, b1 as HandoffEdge, b2 as RetryLink, b3 as SESSION_WORKFLOW_KEYS, b4 as SessionCheckSummary, b5 as SessionConfidence, b6 as SessionEdgeSource, b7 as SessionGroup, b8 as SessionLastError, b9 as SessionWorkflowKey } from './index-C61p7wBR.cjs';
9
+ import { aR as SessionWorkflowMetadata, aS as SessionRunRecord, aT as EnrichSessionSummaryOptions, aU as SessionStatus, aV as SessionSummary, aW as SessionIndex, aX as BuildActivitySummaryOptions, aY as ActivitySummary, aZ as SessionWarning, a_ as BuildSessionIndexOptions, N as TraceCheckResult, X as TraceCheckStatus, a2 as TraceContractInput, Z as TraceContract } from './index-BaQ48jrq.cjs';
10
+ export { a$ as ActivityEntry, b0 as CriticalPathStep, b1 as HandoffEdge, b2 as RetryLink, b3 as SESSION_WORKFLOW_KEYS, b4 as SessionCheckSummary, b5 as SessionConfidence, b6 as SessionEdgeSource, b7 as SessionGroup, b8 as SessionLastError, b9 as SessionWorkflowKey } from './index-BaQ48jrq.cjs';
11
11
  import { b as ObservedOutcome } from './types-BA_IOdg4.cjs';
12
12
  export { a as ObservedOutcomeStatus } from './types-BA_IOdg4.cjs';
13
13
  import './writers.cjs';
@@ -6,8 +6,8 @@ import { a as InspectRunTree } from './inspect-event-CDqjcrG_.js';
6
6
  export { A as AttributionConfidence, E as EventSource, b as InspectEvent, I as InspectKind, c as InspectNode } from './inspect-event-CDqjcrG_.js';
7
7
  import { P as PersistedInspectEvent } from './persisted-inspect-event-BMwvGIB8.js';
8
8
  import { Stats } from 'node:fs';
9
- import { aR as SessionWorkflowMetadata, aS as SessionRunRecord, aT as EnrichSessionSummaryOptions, aU as SessionStatus, aV as SessionSummary, aW as SessionIndex, aX as BuildActivitySummaryOptions, aY as ActivitySummary, aZ as SessionWarning, a_ as BuildSessionIndexOptions, N as TraceCheckResult, X as TraceCheckStatus, a2 as TraceContractInput, Z as TraceContract } from './index-DTO2iGeq.js';
10
- export { a$ as ActivityEntry, b0 as CriticalPathStep, b1 as HandoffEdge, b2 as RetryLink, b3 as SESSION_WORKFLOW_KEYS, b4 as SessionCheckSummary, b5 as SessionConfidence, b6 as SessionEdgeSource, b7 as SessionGroup, b8 as SessionLastError, b9 as SessionWorkflowKey } from './index-DTO2iGeq.js';
9
+ import { aR as SessionWorkflowMetadata, aS as SessionRunRecord, aT as EnrichSessionSummaryOptions, aU as SessionStatus, aV as SessionSummary, aW as SessionIndex, aX as BuildActivitySummaryOptions, aY as ActivitySummary, aZ as SessionWarning, a_ as BuildSessionIndexOptions, N as TraceCheckResult, X as TraceCheckStatus, a2 as TraceContractInput, Z as TraceContract } from './index-CrnEOoRu.js';
10
+ export { a$ as ActivityEntry, b0 as CriticalPathStep, b1 as HandoffEdge, b2 as RetryLink, b3 as SESSION_WORKFLOW_KEYS, b4 as SessionCheckSummary, b5 as SessionConfidence, b6 as SessionEdgeSource, b7 as SessionGroup, b8 as SessionLastError, b9 as SessionWorkflowKey } from './index-CrnEOoRu.js';
11
11
  import { b as ObservedOutcome } from './types-BA_IOdg4.js';
12
12
  export { a as ObservedOutcomeStatus } from './types-BA_IOdg4.js';
13
13
  import './writers.js';
@@ -1,6 +1,6 @@
1
- import { extractSessionWorkflowMetadata, sessionKeyForRun, defineTraceContract, runTraceChecks, createRunStatusRule, createToolUsageRule, createRunDurationRule, createLlmUsageRule, createObservedOutcomeRule } from './chunk-GPGBKN7W.mjs';
2
- export { extractSessionWorkflowMetadata, sessionKeyForRun } from './chunk-GPGBKN7W.mjs';
3
- export { MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, TERMINAL_INDENT, TraceDirectory, createInspector, createInspectorRuntime, formatTerminalName, getCurrentContext, getCurrentCorrelationMetadata, getCurrentDepth, getCurrentRunId, getCurrentRunName, getCurrentStepId, getIndent, getParentStepId, getTraceDirFromContext, getTraceSafetyFromContext, hasActiveContext, isAgentInspectEnabled, isSilentContext, maybeInspectRun, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, renderErrorLine, renderRunSummary, renderStepLine, resolveTraceDir, runWithContext, runWithStepContext } from './chunk-AQMJFKI6.mjs';
1
+ import { extractSessionWorkflowMetadata, sessionKeyForRun, defineTraceContract, runTraceChecks, createRunStatusRule, createToolUsageRule, createRunDurationRule, createLlmUsageRule, createObservedOutcomeRule } from './chunk-QZIXYP7U.mjs';
2
+ export { extractSessionWorkflowMetadata, sessionKeyForRun } from './chunk-QZIXYP7U.mjs';
3
+ export { MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, TERMINAL_INDENT, TraceDirectory, createInspector, createInspectorRuntime, formatTerminalName, getCurrentContext, getCurrentCorrelationMetadata, getCurrentDepth, getCurrentRunId, getCurrentRunName, getCurrentStepId, getIndent, getParentStepId, getTraceDirFromContext, getTraceSafetyFromContext, hasActiveContext, isAgentInspectEnabled, isSilentContext, maybeInspectRun, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, renderErrorLine, renderRunSummary, renderStepLine, resolveTraceDir, runWithContext, runWithStepContext } from './chunk-XRI3GB6I.mjs';
4
4
  import { buildRunTimeline, filterTraces, extractMetadata, buildRunSummary } from './chunk-5RF7FYGL.mjs';
5
5
  export { buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildTraceStats, extractMetadata, filterTraces, formatStepLabel, renderRunWhat, renderTimeline, renderTraceStats } from './chunk-5RF7FYGL.mjs';
6
6
  import { extractOutcomesFromTraceEvents, parseObservationFilter, summarizeObservedOutcomes, extractOutcomesFromPersistedEvents, renderObservedOutcomesHtml } from './chunk-COZPMOUF.mjs';
@@ -1579,15 +1579,28 @@ function jsonType(value) {
1579
1579
  function valuesEqual(left, right) {
1580
1580
  return canonicalStructuredEqual(left, right).equal === true;
1581
1581
  }
1582
+ function isStructuredArgumentEvidence(value) {
1583
+ return value !== void 0 && value !== null && typeof value === "object";
1584
+ }
1582
1585
  function extractToolArgumentPayload(event) {
1583
1586
  const attrs2 = event.attributes ?? {};
1584
1587
  for (const key of ["arguments", "input", "toolArguments"]) {
1585
1588
  const candidate = attrs2[key];
1586
- if (candidate !== void 0 && candidate !== null && typeof candidate === "object") {
1589
+ if (isStructuredArgumentEvidence(candidate)) {
1587
1590
  return { present: true, value: candidate };
1588
1591
  }
1589
1592
  }
1590
- if (event.inputSummary !== void 0 && event.inputSummary !== null && typeof event.inputSummary === "object") {
1593
+ const metadata = attrs2.metadata;
1594
+ if (isStructuredArgumentEvidence(metadata) && !Array.isArray(metadata)) {
1595
+ const nested = metadata;
1596
+ for (const key of ["arguments", "input", "toolArguments"]) {
1597
+ const candidate = nested[key];
1598
+ if (isStructuredArgumentEvidence(candidate)) {
1599
+ return { present: true, value: candidate };
1600
+ }
1601
+ }
1602
+ }
1603
+ if (isStructuredArgumentEvidence(event.inputSummary)) {
1591
1604
  return { present: true, value: event.inputSummary };
1592
1605
  }
1593
1606
  return { present: false, value: void 0 };