agent-inspect 6.20.0 → 6.22.0

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 (60) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/docs/TRACE-CONTRACTS.md +39 -0
  4. package/package.json +1 -1
  5. package/packages/cli/dist/{chunk-QPRJUVLH.mjs → chunk-CHBYF4LE.mjs} +25 -2
  6. package/packages/cli/dist/chunk-CHBYF4LE.mjs.map +1 -0
  7. package/packages/cli/dist/index.cjs +50 -3
  8. package/packages/cli/dist/index.cjs.map +1 -1
  9. package/packages/cli/dist/index.mjs +4 -4
  10. package/packages/cli/dist/index.mjs.map +1 -1
  11. package/packages/cli/dist/{src-6W5ZR3I7.mjs → src-MY5WIBPF.mjs} +3 -3
  12. package/packages/cli/dist/{src-6W5ZR3I7.mjs.map → src-MY5WIBPF.mjs.map} +1 -1
  13. package/packages/core/dist/advanced.cjs +41 -0
  14. package/packages/core/dist/advanced.cjs.map +1 -1
  15. package/packages/core/dist/advanced.d.cts +39 -157
  16. package/packages/core/dist/advanced.d.ts +39 -157
  17. package/packages/core/dist/advanced.mjs +35 -61
  18. package/packages/core/dist/advanced.mjs.map +1 -1
  19. package/packages/core/dist/checks.cjs +736 -45
  20. package/packages/core/dist/checks.cjs.map +1 -1
  21. package/packages/core/dist/checks.d.cts +132 -5
  22. package/packages/core/dist/checks.d.ts +132 -5
  23. package/packages/core/dist/checks.mjs +2 -2
  24. package/packages/core/dist/{chunk-HT54OLPE.mjs → chunk-NDRMIL7Z.mjs} +103 -3
  25. package/packages/core/dist/chunk-NDRMIL7Z.mjs.map +1 -0
  26. package/packages/core/dist/{chunk-G47KQB42.mjs → chunk-OG3GAWCX.mjs} +727 -43
  27. package/packages/core/dist/chunk-OG3GAWCX.mjs.map +1 -0
  28. package/packages/core/dist/{chunk-3XS5O4JI.mjs → chunk-R4SSYU6D.mjs} +3 -3
  29. package/packages/core/dist/chunk-R4SSYU6D.mjs.map +1 -0
  30. package/packages/core/dist/{chunk-5YFJJFXU.mjs → chunk-WGDSM37E.mjs} +3 -3
  31. package/packages/core/dist/{chunk-5YFJJFXU.mjs.map → chunk-WGDSM37E.mjs.map} +1 -1
  32. package/packages/core/dist/{context-C5ye_xcS.d.cts → context-DOOT9GZ-.d.cts} +1 -1
  33. package/packages/core/dist/{context-CNsNSgE2.d.ts → context-DOX2-RjH.d.ts} +1 -1
  34. package/packages/core/dist/diff.d.cts +1 -1
  35. package/packages/core/dist/diff.d.ts +1 -1
  36. package/packages/core/dist/exporters.d.cts +1 -1
  37. package/packages/core/dist/exporters.d.ts +1 -1
  38. package/packages/core/dist/exporters.mjs +1 -1
  39. package/packages/core/dist/{index-rVpX5PPh.d.cts → index-CR4CCRqP.d.cts} +159 -2
  40. package/packages/core/dist/{index-Bg9ZdsdS.d.ts → index-CtK_p-ps.d.ts} +159 -2
  41. package/packages/core/dist/{index-AMAGuO_i.d.ts → index-D72DPqAF.d.ts} +2 -1
  42. package/packages/core/dist/{index-vqr-g6ev.d.cts → index-DLLz9sce.d.cts} +2 -1
  43. package/packages/core/dist/index.d.cts +3 -3
  44. package/packages/core/dist/index.d.ts +3 -3
  45. package/packages/core/dist/index.mjs +3 -3
  46. package/packages/core/dist/persisted.d.cts +1 -1
  47. package/packages/core/dist/persisted.d.ts +1 -1
  48. package/packages/core/dist/programmatic-gZTWLObB.d.cts +25 -0
  49. package/packages/core/dist/programmatic-gZTWLObB.d.ts +25 -0
  50. package/packages/core/dist/readers.cjs +105 -0
  51. package/packages/core/dist/readers.cjs.map +1 -1
  52. package/packages/core/dist/readers.d.cts +43 -18
  53. package/packages/core/dist/readers.d.ts +43 -18
  54. package/packages/core/dist/readers.mjs +1 -1
  55. package/packages/core/dist/{types--ainI31J.d.ts → types-Bx3mEZ04.d.ts} +1 -1
  56. package/packages/core/dist/{types-UnrNaTo2.d.cts → types-VzKihKQo.d.cts} +1 -1
  57. package/packages/cli/dist/chunk-QPRJUVLH.mjs.map +0 -1
  58. package/packages/core/dist/chunk-3XS5O4JI.mjs.map +0 -1
  59. package/packages/core/dist/chunk-G47KQB42.mjs.map +0 -1
  60. package/packages/core/dist/chunk-HT54OLPE.mjs.map +0 -1
@@ -1,29 +1,54 @@
1
- export { D as DEFAULT_TRACE_READERS, b as TraceFormatCandidate, c as TraceFormatDetectionResult, d as TraceFormatDetectionStatus, e as TraceInput, f as TraceReadError, g as TraceReadErrorCode, h as TraceReadOptions, a as TraceReadResult, T as TraceReadWarning, i as TraceReadWarningSeverity, j as TraceReader, k as TraceReaderDetectOptions, l as TraceReaderReadOptions, m as agentInspectJsonlReader, n as assertTraceInput, o as detectTraceFormat, p as openInferenceJsonReader, q as openTrace, r as openTraceDirectory, s as openTraceFile, t as openTraceText, u as otlpJsonReader, v as readTrace } from './index-vqr-g6ev.cjs';
1
+ export { D as DEFAULT_TRACE_READERS, T as TraceFormatCandidate, a as TraceFormatDetectionResult, b as TraceFormatDetectionStatus, c as TraceInput, d as TraceReadError, e as TraceReadErrorCode, f as TraceReadOptions, g as TraceReadResult, h as TraceReadWarning, i as TraceReadWarningSeverity, j as TraceReader, k as TraceReaderDetectOptions, l as TraceReaderReadOptions, m as agentInspectJsonlReader, n as assertTraceInput, o as detectTraceFormat, p as openInferenceJsonReader, q as openTrace, r as openTraceDirectory, s as openTraceFile, t as openTraceText, u as otlpJsonReader, v as readTrace } from './index-DLLz9sce.cjs';
2
+ export { P as PROGRAMMATIC_DIAGNOSTIC_SPECS, a as ProgrammaticDiagnosticCode, b as ProgrammaticDiagnosticSpec, f as formatProgrammaticDiagnostic } from './programmatic-gZTWLObB.cjs';
2
3
  import './inspect-event-DRthdZlf.cjs';
3
4
  import './persisted-inspect-event-CVZWZldL.cjs';
4
5
 
5
6
  /**
6
- * Stable programmatic diagnostic codes for readers / TraceFacts / TraceContract.
7
+ * Version-pinned reader/exporter mapping ledger (6.22).
7
8
  *
8
- * Lowercase `TraceReadError.code` values remain the published reader error codes.
9
- * These `AI_*` identifiers appear in messages and catalogs for actionable remediation.
9
+ * Records which external convention version was used and what was lost.
10
+ * Does not bind persisted schema 1.0 to an unstable external convention.
10
11
  *
11
- * @experimental Additive in 6.15.0; do not replace published lowercase reader codes.
12
+ * @experimental Available through `agent-inspect/readers`.
12
13
  */
13
- type ProgrammaticDiagnosticCode = "AI_TRACE_INPUT_INVALID" | "AI_TRACE_FORMAT_UNSUPPORTED" | "AI_TRACE_FORMAT_AMBIGUOUS" | "AI_TRACE_FACTS_INPUT_NOT_NORMALIZED" | "AI_TRACE_CONTRACT_RUN_SELECTION_REQUIRED" | "AI_TRACE_RELATIONSHIP_SELF_PARENT" | "AI_TRACE_RELATIONSHIP_CYCLE";
14
- interface ProgrammaticDiagnosticSpec {
15
- readonly code: ProgrammaticDiagnosticCode;
16
- /** Short problem statement (without the code prefix). */
17
- readonly summary: string;
18
- /** Actionable remediation hint (always included in formatted messages). */
19
- readonly remediation: string;
20
- /** Related published / capture codes that must remain valid. */
21
- readonly relatedCodes?: readonly string[];
14
+ type MappingConfidence = "explicit" | "correlated" | "heuristic" | "unknown";
15
+ type MappingLossKind = "none" | "dropped" | "bounded" | "privacy-redacted" | "kind-degraded" | "unsupported";
16
+ /**
17
+ * One source→target mapping row.
18
+ *
19
+ * @experimental
20
+ */
21
+ interface MappingLedgerEntry {
22
+ source: string;
23
+ target: string;
24
+ transformation: string;
25
+ confidence: MappingConfidence;
26
+ loss: MappingLossKind;
27
+ privacyDecision?: string;
22
28
  }
23
- declare const PROGRAMMATIC_DIAGNOSTIC_SPECS: Readonly<Record<ProgrammaticDiagnosticCode, ProgrammaticDiagnosticSpec>>;
24
29
  /**
25
- * Format `CODE: summary Remediation: …` for thrown errors and diagnostics.
30
+ * Ledger published by a reader or exporter mapping.
31
+ *
32
+ * @experimental
26
33
  */
27
- declare function formatProgrammaticDiagnostic(code: ProgrammaticDiagnosticCode, detail?: string): string;
34
+ interface MappingLedger {
35
+ id: string;
36
+ sourceFormat: string;
37
+ targetFormat: string;
38
+ /** External convention pin (e.g. OTel GenAI / OpenInference version). */
39
+ convention?: {
40
+ name: string;
41
+ version: string;
42
+ specUrl?: string;
43
+ };
44
+ entries: readonly MappingLedgerEntry[];
45
+ knownLosses: readonly string[];
46
+ }
47
+ /** OpenInference → AgentInspect mapping ledger pin. */
48
+ declare const OPENINFERENCE_MAPPING_LEDGER: MappingLedger;
49
+ /** OTLP JSON → AgentInspect mapping ledger pin. */
50
+ declare const OTLP_JSON_MAPPING_LEDGER: MappingLedger;
51
+ declare const BUILTIN_MAPPING_LEDGERS: readonly MappingLedger[];
52
+ declare function getMappingLedger(id: string): MappingLedger | undefined;
28
53
 
29
- export { PROGRAMMATIC_DIAGNOSTIC_SPECS, type ProgrammaticDiagnosticCode, type ProgrammaticDiagnosticSpec, formatProgrammaticDiagnostic };
54
+ export { BUILTIN_MAPPING_LEDGERS, type MappingConfidence, type MappingLedger, type MappingLedgerEntry, type MappingLossKind, OPENINFERENCE_MAPPING_LEDGER, OTLP_JSON_MAPPING_LEDGER, getMappingLedger };
@@ -1,29 +1,54 @@
1
- export { D as DEFAULT_TRACE_READERS, b as TraceFormatCandidate, c as TraceFormatDetectionResult, d as TraceFormatDetectionStatus, e as TraceInput, f as TraceReadError, g as TraceReadErrorCode, h as TraceReadOptions, a as TraceReadResult, T as TraceReadWarning, i as TraceReadWarningSeverity, j as TraceReader, k as TraceReaderDetectOptions, l as TraceReaderReadOptions, m as agentInspectJsonlReader, n as assertTraceInput, o as detectTraceFormat, p as openInferenceJsonReader, q as openTrace, r as openTraceDirectory, s as openTraceFile, t as openTraceText, u as otlpJsonReader, v as readTrace } from './index-AMAGuO_i.js';
1
+ export { D as DEFAULT_TRACE_READERS, T as TraceFormatCandidate, a as TraceFormatDetectionResult, b as TraceFormatDetectionStatus, c as TraceInput, d as TraceReadError, e as TraceReadErrorCode, f as TraceReadOptions, g as TraceReadResult, h as TraceReadWarning, i as TraceReadWarningSeverity, j as TraceReader, k as TraceReaderDetectOptions, l as TraceReaderReadOptions, m as agentInspectJsonlReader, n as assertTraceInput, o as detectTraceFormat, p as openInferenceJsonReader, q as openTrace, r as openTraceDirectory, s as openTraceFile, t as openTraceText, u as otlpJsonReader, v as readTrace } from './index-D72DPqAF.js';
2
+ export { P as PROGRAMMATIC_DIAGNOSTIC_SPECS, a as ProgrammaticDiagnosticCode, b as ProgrammaticDiagnosticSpec, f as formatProgrammaticDiagnostic } from './programmatic-gZTWLObB.js';
2
3
  import './inspect-event-DRthdZlf.js';
3
4
  import './persisted-inspect-event-BVucFVrP.js';
4
5
 
5
6
  /**
6
- * Stable programmatic diagnostic codes for readers / TraceFacts / TraceContract.
7
+ * Version-pinned reader/exporter mapping ledger (6.22).
7
8
  *
8
- * Lowercase `TraceReadError.code` values remain the published reader error codes.
9
- * These `AI_*` identifiers appear in messages and catalogs for actionable remediation.
9
+ * Records which external convention version was used and what was lost.
10
+ * Does not bind persisted schema 1.0 to an unstable external convention.
10
11
  *
11
- * @experimental Additive in 6.15.0; do not replace published lowercase reader codes.
12
+ * @experimental Available through `agent-inspect/readers`.
12
13
  */
13
- type ProgrammaticDiagnosticCode = "AI_TRACE_INPUT_INVALID" | "AI_TRACE_FORMAT_UNSUPPORTED" | "AI_TRACE_FORMAT_AMBIGUOUS" | "AI_TRACE_FACTS_INPUT_NOT_NORMALIZED" | "AI_TRACE_CONTRACT_RUN_SELECTION_REQUIRED" | "AI_TRACE_RELATIONSHIP_SELF_PARENT" | "AI_TRACE_RELATIONSHIP_CYCLE";
14
- interface ProgrammaticDiagnosticSpec {
15
- readonly code: ProgrammaticDiagnosticCode;
16
- /** Short problem statement (without the code prefix). */
17
- readonly summary: string;
18
- /** Actionable remediation hint (always included in formatted messages). */
19
- readonly remediation: string;
20
- /** Related published / capture codes that must remain valid. */
21
- readonly relatedCodes?: readonly string[];
14
+ type MappingConfidence = "explicit" | "correlated" | "heuristic" | "unknown";
15
+ type MappingLossKind = "none" | "dropped" | "bounded" | "privacy-redacted" | "kind-degraded" | "unsupported";
16
+ /**
17
+ * One source→target mapping row.
18
+ *
19
+ * @experimental
20
+ */
21
+ interface MappingLedgerEntry {
22
+ source: string;
23
+ target: string;
24
+ transformation: string;
25
+ confidence: MappingConfidence;
26
+ loss: MappingLossKind;
27
+ privacyDecision?: string;
22
28
  }
23
- declare const PROGRAMMATIC_DIAGNOSTIC_SPECS: Readonly<Record<ProgrammaticDiagnosticCode, ProgrammaticDiagnosticSpec>>;
24
29
  /**
25
- * Format `CODE: summary Remediation: …` for thrown errors and diagnostics.
30
+ * Ledger published by a reader or exporter mapping.
31
+ *
32
+ * @experimental
26
33
  */
27
- declare function formatProgrammaticDiagnostic(code: ProgrammaticDiagnosticCode, detail?: string): string;
34
+ interface MappingLedger {
35
+ id: string;
36
+ sourceFormat: string;
37
+ targetFormat: string;
38
+ /** External convention pin (e.g. OTel GenAI / OpenInference version). */
39
+ convention?: {
40
+ name: string;
41
+ version: string;
42
+ specUrl?: string;
43
+ };
44
+ entries: readonly MappingLedgerEntry[];
45
+ knownLosses: readonly string[];
46
+ }
47
+ /** OpenInference → AgentInspect mapping ledger pin. */
48
+ declare const OPENINFERENCE_MAPPING_LEDGER: MappingLedger;
49
+ /** OTLP JSON → AgentInspect mapping ledger pin. */
50
+ declare const OTLP_JSON_MAPPING_LEDGER: MappingLedger;
51
+ declare const BUILTIN_MAPPING_LEDGERS: readonly MappingLedger[];
52
+ declare function getMappingLedger(id: string): MappingLedger | undefined;
28
53
 
29
- export { PROGRAMMATIC_DIAGNOSTIC_SPECS, type ProgrammaticDiagnosticCode, type ProgrammaticDiagnosticSpec, formatProgrammaticDiagnostic };
54
+ export { BUILTIN_MAPPING_LEDGERS, type MappingConfidence, type MappingLedger, type MappingLedgerEntry, type MappingLossKind, OPENINFERENCE_MAPPING_LEDGER, OTLP_JSON_MAPPING_LEDGER, getMappingLedger };
@@ -1,4 +1,4 @@
1
- export { DEFAULT_TRACE_READERS, TraceReadError, agentInspectJsonlReader, assertTraceInput, detectTraceFormat, openInferenceJsonReader, openTrace, openTraceDirectory, openTraceFile, openTraceText, otlpJsonReader, readTrace } from './chunk-HT54OLPE.mjs';
1
+ export { BUILTIN_MAPPING_LEDGERS, DEFAULT_TRACE_READERS, OPENINFERENCE_MAPPING_LEDGER, OTLP_JSON_MAPPING_LEDGER, TraceReadError, agentInspectJsonlReader, assertTraceInput, detectTraceFormat, getMappingLedger, openInferenceJsonReader, openTrace, openTraceDirectory, openTraceFile, openTraceText, otlpJsonReader, readTrace } from './chunk-NDRMIL7Z.mjs';
2
2
  export { PROGRAMMATIC_DIAGNOSTIC_SPECS, formatProgrammaticDiagnostic } from './chunk-FWK3Q3OJ.mjs';
3
3
  import './chunk-NXQF73EC.mjs';
4
4
  import './chunk-S4YWKV4G.mjs';
@@ -243,4 +243,4 @@ declare function isStepStatus(value: unknown): value is StepStatus;
243
243
  */
244
244
  declare function isTraceEvent(value: unknown): value is TraceEvent;
245
245
 
246
- export { type ActiveStepContext as A, type ErrorInfo as E, type InspectRunOptions as I, type ObserveOptions as O, type RedactionProfile as R, type StepOptions as S, type TokenMetadata as T, type Run as a, type RunStatus as b, type Step as c, type StepMetadata as d, type StepStatus as e, type StepType as f, type TraceCorrelationMetadata as g, type TraceEvent as h, type ExecutionContext as i, type RunSummary as j, type TraceMetadata as k, type TraceMetadataStatus as l, type RunCompletedEvent as m, type RunStartedEvent as n, type StepCompletedEvent as o, type StepStartedEvent as p, type TraceEventBase as q, type TraceSchemaVersion as r, isStepStatus as s, isStepType as t, isTraceEvent as u };
246
+ export { type ActiveStepContext as A, type ErrorInfo as E, type InspectRunOptions as I, type ObserveOptions as O, type RedactionProfile as R, type StepOptions as S, type TraceMetadataStatus as T, type Run as a, type RunStatus as b, type Step as c, type StepMetadata as d, type StepStatus as e, type StepType as f, type TokenMetadata as g, type TraceCorrelationMetadata as h, type TraceEvent as i, type ExecutionContext as j, type RunSummary as k, type TraceMetadata as l, type RunCompletedEvent as m, type RunStartedEvent as n, type StepCompletedEvent as o, type StepStartedEvent as p, type TraceEventBase as q, type TraceSchemaVersion as r, isStepStatus as s, isStepType as t, isTraceEvent as u };
@@ -243,4 +243,4 @@ declare function isStepStatus(value: unknown): value is StepStatus;
243
243
  */
244
244
  declare function isTraceEvent(value: unknown): value is TraceEvent;
245
245
 
246
- export { type ActiveStepContext as A, type ErrorInfo as E, type InspectRunOptions as I, type ObserveOptions as O, type RedactionProfile as R, type StepOptions as S, type TokenMetadata as T, type Run as a, type RunStatus as b, type Step as c, type StepMetadata as d, type StepStatus as e, type StepType as f, type TraceCorrelationMetadata as g, type TraceEvent as h, type ExecutionContext as i, type RunSummary as j, type TraceMetadata as k, type TraceMetadataStatus as l, type RunCompletedEvent as m, type RunStartedEvent as n, type StepCompletedEvent as o, type StepStartedEvent as p, type TraceEventBase as q, type TraceSchemaVersion as r, isStepStatus as s, isStepType as t, isTraceEvent as u };
246
+ export { type ActiveStepContext as A, type ErrorInfo as E, type InspectRunOptions as I, type ObserveOptions as O, type RedactionProfile as R, type StepOptions as S, type TraceMetadataStatus as T, type Run as a, type RunStatus as b, type Step as c, type StepMetadata as d, type StepStatus as e, type StepType as f, type TokenMetadata as g, type TraceCorrelationMetadata as h, type TraceEvent as i, type ExecutionContext as j, type RunSummary as k, type TraceMetadata as l, type RunCompletedEvent as m, type RunStartedEvent as n, type StepCompletedEvent as o, type StepStartedEvent as p, type TraceEventBase as q, type TraceSchemaVersion as r, isStepStatus as s, isStepType as t, isTraceEvent as u };