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,8 +1,165 @@
1
- import { T as TraceReadWarning, a as TraceReadResult } from './index-vqr-g6ev.cjs';
1
+ import { T as TraceMetadataStatus } from './types-VzKihKQo.cjs';
2
+ import { h as TraceReadWarning, g as TraceReadResult } from './index-DLLz9sce.cjs';
2
3
  import { a as InspectRunTree, b as InspectNode, A as AttributionConfidence } from './inspect-event-DRthdZlf.cjs';
3
4
  import { P as PersistedInspectEvent } from './persisted-inspect-event-CVZWZldL.cjs';
4
5
  import { O as ObservedOutcomeStatus } from './types-B562HgN_.cjs';
5
6
 
7
+ /** Known session/workflow metadata keys (v2.4 RFC). */
8
+ declare const SESSION_WORKFLOW_KEYS: readonly ["sessionId", "conversationId", "groupId", "parentGroupId", "attempt", "retryOf", "retryReason", "handoffFrom", "handoffTo", "subAgentId", "subAgentName", "jobId", "queueName", "workflowName", "workflowStep", "toolCallId", "mcpToolCallId", "linkedStepId", "operationId", "attemptId", "attemptNumber", "fallbackOf", "idempotencyKey", "correlationId", "requestId", "decisionId"];
9
+ type SessionWorkflowKey = (typeof SESSION_WORKFLOW_KEYS)[number];
10
+ type SessionConfidence = "explicit" | "correlated" | "heuristic" | "unknown";
11
+ type SessionEdgeSource = "manual" | "adapter" | "json-log" | "log4js" | "mcp-client" | "inferred";
12
+ interface SessionWorkflowMetadata {
13
+ sessionId?: string;
14
+ conversationId?: string;
15
+ groupId?: string;
16
+ parentGroupId?: string;
17
+ attempt?: number;
18
+ retryOf?: string;
19
+ retryReason?: string;
20
+ handoffFrom?: string;
21
+ handoffTo?: string;
22
+ subAgentId?: string;
23
+ subAgentName?: string;
24
+ jobId?: string;
25
+ queueName?: string;
26
+ workflowName?: string;
27
+ workflowStep?: string;
28
+ toolCallId?: string;
29
+ mcpToolCallId?: string;
30
+ linkedStepId?: string;
31
+ operationId?: string;
32
+ attemptId?: string;
33
+ attemptNumber?: number;
34
+ fallbackOf?: string;
35
+ idempotencyKey?: string;
36
+ correlationId?: string;
37
+ requestId?: string;
38
+ decisionId?: string;
39
+ }
40
+ interface SessionRunRecord {
41
+ runId: string;
42
+ name?: string;
43
+ status?: TraceMetadataStatus;
44
+ startedAt?: number;
45
+ endedAt?: number;
46
+ durationMs?: number;
47
+ filePath?: string;
48
+ metadata?: Record<string, unknown>;
49
+ }
50
+ interface SessionWarning {
51
+ code: string;
52
+ message: string;
53
+ runId?: string;
54
+ sessionId?: string;
55
+ }
56
+ interface HandoffEdge {
57
+ from: string;
58
+ to: string;
59
+ source: SessionEdgeSource;
60
+ confidence: SessionConfidence;
61
+ }
62
+ interface RetryLink {
63
+ runId: string;
64
+ retryOf?: string;
65
+ attempt?: number;
66
+ source: SessionEdgeSource;
67
+ confidence: SessionConfidence;
68
+ }
69
+ interface SessionGroup {
70
+ groupId: string;
71
+ parentGroupId?: string;
72
+ runIds: string[];
73
+ }
74
+ interface CriticalPathStep {
75
+ runId: string;
76
+ name?: string;
77
+ startedAt?: number;
78
+ durationMs?: number;
79
+ source: SessionEdgeSource;
80
+ confidence: SessionConfidence;
81
+ }
82
+ /** Session lifecycle status (v4.2 RFC). */
83
+ type SessionStatus = "running" | "waiting_input" | "idle" | "completed" | "error" | "stale" | "unknown";
84
+ interface SessionLastError {
85
+ runId: string;
86
+ message: string;
87
+ code?: string;
88
+ }
89
+ interface SessionCheckSummary {
90
+ pass: number;
91
+ fail: number;
92
+ warn: number;
93
+ }
94
+ interface EnrichSessionSummaryOptions {
95
+ /** Reference clock for staleness (default Date.now()). */
96
+ nowMs?: number;
97
+ /** Inactivity threshold before marking a session stale (default 24h). */
98
+ staleThresholdMs?: number;
99
+ }
100
+ interface ActivityEntry {
101
+ sessionId: string;
102
+ status: SessionStatus;
103
+ summary: string;
104
+ lastActivity: string;
105
+ runCount: number;
106
+ }
107
+ interface ActivitySummary {
108
+ since: string;
109
+ sessions: number;
110
+ failed: number;
111
+ stale: number;
112
+ guardrailWarnings: number;
113
+ entries: ActivityEntry[];
114
+ }
115
+ interface BuildActivitySummaryOptions {
116
+ /** Duration window (e.g. 7d, 24h). Default 7d. */
117
+ since?: string;
118
+ /** Reference clock (default Date.now()). */
119
+ nowMs?: number;
120
+ /** Max entries returned (default 20). */
121
+ limit?: number;
122
+ }
123
+ interface SessionSummary {
124
+ sessionId: string;
125
+ runIds: string[];
126
+ groups: SessionGroup[];
127
+ handoffs: HandoffEdge[];
128
+ retries: RetryLink[];
129
+ criticalPath: CriticalPathStep[];
130
+ /** Derived session status (v4.2+). */
131
+ status: SessionStatus;
132
+ /** Earliest run start time in the session. */
133
+ startedAt?: number;
134
+ /** Latest run end time when all runs have ended. */
135
+ endedAt?: number;
136
+ /** endedAt - startedAt when both are present. */
137
+ durationMs?: number;
138
+ correlationId?: string;
139
+ jobId?: string;
140
+ workflowId?: string;
141
+ lastError?: SessionLastError;
142
+ /** ISO-8601 timestamp of the most recent run activity. */
143
+ lastActivity: string;
144
+ retryCount: number;
145
+ observationSummary?: string;
146
+ checkSummary?: SessionCheckSummary;
147
+ }
148
+ interface SessionIndex {
149
+ runs: SessionRunRecord[];
150
+ sessions: SessionSummary[];
151
+ unscopedRunIds: string[];
152
+ warnings: SessionWarning[];
153
+ }
154
+ interface BuildSessionIndexOptions {
155
+ /** When true, group runs that share only `groupId` under a synthetic session key. */
156
+ correlateByGroupId?: boolean;
157
+ /** Reference clock for session staleness (v4.2+). */
158
+ nowMs?: number;
159
+ /** Inactivity threshold before marking a session stale (v4.2+, default 24h). */
160
+ staleThresholdMs?: number;
161
+ }
162
+
6
163
  /**
7
164
  * Logical lifecycle projection for trace checks.
8
165
  *
@@ -724,4 +881,4 @@ declare function createObservedOutcomeRule(options?: ObservedOutcomeRuleOptions)
724
881
  */
725
882
  declare function runTraceChecks(input: TraceCheckInput, options?: RunTraceChecksOptions): TraceCheckResult;
726
883
 
727
- export { createRetrievalRule as $, type TraceCheckFacts as A, type BaselineRegressionRuleOptions as B, type TraceCheckFinding as C, type DecisionRuleOptions as D, type TraceCheckFindingStatus as E, type TraceCheckRule as F, type GuardrailRuleOptions as G, type TraceCheckRuleCategory as H, type TraceCheckRuleExecution as I, type TraceCheckRuleExecutionStatus as J, type TraceCheckSeverity as K, type LogicalTraceEvent as L, type MaxStepDurationRuleOptions as M, type TraceCheckStatus as N, type ObservedOutcomeRuleOptions as O, type TraceCheckSummary as P, type TraceSignalRuleOptions as Q, type RetrievalRuleOptions as R, type SafetyFindingCategory as S, type TraceCheckInput as T, createBaselineRegressionRule as U, createDecisionRule as V, createGuardrailRule as W, createLlmUsageRule as X, createMaxStepDurationRule as Y, createObservedOutcomeRule as Z, createRequireCompletedRule as _, type LogicalProjectionDiagnostic as a, createRunDepthRule as a0, createRunDurationRule as a1, createRunEventCountRule as a2, createRunStatusRule as a3, createSafetyOversizedAttributeRule as a4, createSafetyRawContentRule as a5, createSafetyRedactionRule as a6, createSafetySecretPatternRule as a7, createStallDetectionRule as a8, createStructureCycleRule as a9, createStructureIncompleteRule as aa, createStructureOrphanRule as ab, createStructureParallelWidthRule as ac, createStructureRelationshipRule as ad, createToolFailureRule as ae, createToolOrderingRule as af, createToolUsageRule as ag, projectLogicalEvents as ah, resolveCanonicalToolName as ai, runTraceChecks as aj, type TraceCheckResult as b, type LlmUsageRuleOptions as c, type RunDepthRuleOptions as d, type RunDurationRuleOptions as e, type RunEventCountRuleOptions as f, type RunStatusRuleOptions as g, type RunTraceChecksOptions as h, type SafetyFindingConfidence as i, type SafetyOversizedAttributeRuleOptions as j, type SafetyRawContentRuleOptions as k, type SafetyRedactionRuleOptions as l, type SafetySecretPattern as m, type SafetySecretPatternRuleOptions as n, type StallDetectionRuleOptions as o, type StructureIncompleteRuleOptions as p, type StructureOrphanRuleOptions as q, type StructureParallelWidthRuleOptions as r, type StructureRelationshipRuleOptions as s, type ToolFailureRuleOptions as t, type ToolOrderingRuleOptions as u, type ToolUsageRuleOptions as v, type TraceCheckContext as w, type TraceCheckDiagnostic as x, type TraceCheckDiagnosticCode as y, type TraceCheckEvidence as z };
884
+ export { createRequireCompletedRule as $, type TraceCheckEvidence as A, type BaselineRegressionRuleOptions as B, type TraceCheckFacts as C, type DecisionRuleOptions as D, type TraceCheckFinding as E, type TraceCheckFindingStatus as F, type GuardrailRuleOptions as G, type TraceCheckRule as H, type TraceCheckRuleCategory as I, type TraceCheckRuleExecution as J, type TraceCheckRuleExecutionStatus as K, type LogicalTraceEvent as L, type MaxStepDurationRuleOptions as M, type TraceCheckSeverity as N, type ObservedOutcomeRuleOptions as O, type TraceCheckStatus as P, type TraceCheckSummary as Q, type RetrievalRuleOptions as R, type SessionWorkflowMetadata as S, type TraceCheckInput as T, type TraceSignalRuleOptions as U, createBaselineRegressionRule as V, createDecisionRule as W, createGuardrailRule as X, createLlmUsageRule as Y, createMaxStepDurationRule as Z, createObservedOutcomeRule as _, type LogicalProjectionDiagnostic as a, createRetrievalRule as a0, createRunDepthRule as a1, createRunDurationRule as a2, createRunEventCountRule as a3, createRunStatusRule as a4, createSafetyOversizedAttributeRule as a5, createSafetyRawContentRule as a6, createSafetyRedactionRule as a7, createSafetySecretPatternRule as a8, createStallDetectionRule as a9, type SessionConfidence as aA, type SessionEdgeSource as aB, type SessionGroup as aC, type SessionLastError as aD, type SessionWorkflowKey as aE, createStructureCycleRule as aa, createStructureIncompleteRule as ab, createStructureOrphanRule as ac, createStructureParallelWidthRule as ad, createStructureRelationshipRule as ae, createToolFailureRule as af, createToolOrderingRule as ag, createToolUsageRule as ah, projectLogicalEvents as ai, resolveCanonicalToolName as aj, runTraceChecks as ak, type SessionRunRecord as al, type EnrichSessionSummaryOptions as am, type SessionStatus as an, type SessionSummary as ao, type SessionIndex as ap, type BuildActivitySummaryOptions as aq, type ActivitySummary as ar, type SessionWarning as as, type BuildSessionIndexOptions as at, type ActivityEntry as au, type CriticalPathStep as av, type HandoffEdge as aw, type RetryLink as ax, SESSION_WORKFLOW_KEYS as ay, type SessionCheckSummary as az, type TraceCheckDiagnostic as b, type TraceCheckResult as c, type LlmUsageRuleOptions as d, type RunDepthRuleOptions as e, type RunDurationRuleOptions as f, type RunEventCountRuleOptions as g, type RunStatusRuleOptions as h, type RunTraceChecksOptions as i, type SafetyFindingCategory as j, type SafetyFindingConfidence as k, type SafetyOversizedAttributeRuleOptions as l, type SafetyRawContentRuleOptions as m, type SafetyRedactionRuleOptions as n, type SafetySecretPattern as o, type SafetySecretPatternRuleOptions as p, type StallDetectionRuleOptions as q, type StructureIncompleteRuleOptions as r, type StructureOrphanRuleOptions as s, type StructureParallelWidthRuleOptions as t, type StructureRelationshipRuleOptions as u, type ToolFailureRuleOptions as v, type ToolOrderingRuleOptions as w, type ToolUsageRuleOptions as x, type TraceCheckContext as y, type TraceCheckDiagnosticCode as z };
@@ -1,8 +1,165 @@
1
- import { T as TraceReadWarning, a as TraceReadResult } from './index-AMAGuO_i.js';
1
+ import { T as TraceMetadataStatus } from './types-Bx3mEZ04.js';
2
+ import { h as TraceReadWarning, g as TraceReadResult } from './index-D72DPqAF.js';
2
3
  import { a as InspectRunTree, b as InspectNode, A as AttributionConfidence } from './inspect-event-DRthdZlf.js';
3
4
  import { P as PersistedInspectEvent } from './persisted-inspect-event-BVucFVrP.js';
4
5
  import { O as ObservedOutcomeStatus } from './types-B562HgN_.js';
5
6
 
7
+ /** Known session/workflow metadata keys (v2.4 RFC). */
8
+ declare const SESSION_WORKFLOW_KEYS: readonly ["sessionId", "conversationId", "groupId", "parentGroupId", "attempt", "retryOf", "retryReason", "handoffFrom", "handoffTo", "subAgentId", "subAgentName", "jobId", "queueName", "workflowName", "workflowStep", "toolCallId", "mcpToolCallId", "linkedStepId", "operationId", "attemptId", "attemptNumber", "fallbackOf", "idempotencyKey", "correlationId", "requestId", "decisionId"];
9
+ type SessionWorkflowKey = (typeof SESSION_WORKFLOW_KEYS)[number];
10
+ type SessionConfidence = "explicit" | "correlated" | "heuristic" | "unknown";
11
+ type SessionEdgeSource = "manual" | "adapter" | "json-log" | "log4js" | "mcp-client" | "inferred";
12
+ interface SessionWorkflowMetadata {
13
+ sessionId?: string;
14
+ conversationId?: string;
15
+ groupId?: string;
16
+ parentGroupId?: string;
17
+ attempt?: number;
18
+ retryOf?: string;
19
+ retryReason?: string;
20
+ handoffFrom?: string;
21
+ handoffTo?: string;
22
+ subAgentId?: string;
23
+ subAgentName?: string;
24
+ jobId?: string;
25
+ queueName?: string;
26
+ workflowName?: string;
27
+ workflowStep?: string;
28
+ toolCallId?: string;
29
+ mcpToolCallId?: string;
30
+ linkedStepId?: string;
31
+ operationId?: string;
32
+ attemptId?: string;
33
+ attemptNumber?: number;
34
+ fallbackOf?: string;
35
+ idempotencyKey?: string;
36
+ correlationId?: string;
37
+ requestId?: string;
38
+ decisionId?: string;
39
+ }
40
+ interface SessionRunRecord {
41
+ runId: string;
42
+ name?: string;
43
+ status?: TraceMetadataStatus;
44
+ startedAt?: number;
45
+ endedAt?: number;
46
+ durationMs?: number;
47
+ filePath?: string;
48
+ metadata?: Record<string, unknown>;
49
+ }
50
+ interface SessionWarning {
51
+ code: string;
52
+ message: string;
53
+ runId?: string;
54
+ sessionId?: string;
55
+ }
56
+ interface HandoffEdge {
57
+ from: string;
58
+ to: string;
59
+ source: SessionEdgeSource;
60
+ confidence: SessionConfidence;
61
+ }
62
+ interface RetryLink {
63
+ runId: string;
64
+ retryOf?: string;
65
+ attempt?: number;
66
+ source: SessionEdgeSource;
67
+ confidence: SessionConfidence;
68
+ }
69
+ interface SessionGroup {
70
+ groupId: string;
71
+ parentGroupId?: string;
72
+ runIds: string[];
73
+ }
74
+ interface CriticalPathStep {
75
+ runId: string;
76
+ name?: string;
77
+ startedAt?: number;
78
+ durationMs?: number;
79
+ source: SessionEdgeSource;
80
+ confidence: SessionConfidence;
81
+ }
82
+ /** Session lifecycle status (v4.2 RFC). */
83
+ type SessionStatus = "running" | "waiting_input" | "idle" | "completed" | "error" | "stale" | "unknown";
84
+ interface SessionLastError {
85
+ runId: string;
86
+ message: string;
87
+ code?: string;
88
+ }
89
+ interface SessionCheckSummary {
90
+ pass: number;
91
+ fail: number;
92
+ warn: number;
93
+ }
94
+ interface EnrichSessionSummaryOptions {
95
+ /** Reference clock for staleness (default Date.now()). */
96
+ nowMs?: number;
97
+ /** Inactivity threshold before marking a session stale (default 24h). */
98
+ staleThresholdMs?: number;
99
+ }
100
+ interface ActivityEntry {
101
+ sessionId: string;
102
+ status: SessionStatus;
103
+ summary: string;
104
+ lastActivity: string;
105
+ runCount: number;
106
+ }
107
+ interface ActivitySummary {
108
+ since: string;
109
+ sessions: number;
110
+ failed: number;
111
+ stale: number;
112
+ guardrailWarnings: number;
113
+ entries: ActivityEntry[];
114
+ }
115
+ interface BuildActivitySummaryOptions {
116
+ /** Duration window (e.g. 7d, 24h). Default 7d. */
117
+ since?: string;
118
+ /** Reference clock (default Date.now()). */
119
+ nowMs?: number;
120
+ /** Max entries returned (default 20). */
121
+ limit?: number;
122
+ }
123
+ interface SessionSummary {
124
+ sessionId: string;
125
+ runIds: string[];
126
+ groups: SessionGroup[];
127
+ handoffs: HandoffEdge[];
128
+ retries: RetryLink[];
129
+ criticalPath: CriticalPathStep[];
130
+ /** Derived session status (v4.2+). */
131
+ status: SessionStatus;
132
+ /** Earliest run start time in the session. */
133
+ startedAt?: number;
134
+ /** Latest run end time when all runs have ended. */
135
+ endedAt?: number;
136
+ /** endedAt - startedAt when both are present. */
137
+ durationMs?: number;
138
+ correlationId?: string;
139
+ jobId?: string;
140
+ workflowId?: string;
141
+ lastError?: SessionLastError;
142
+ /** ISO-8601 timestamp of the most recent run activity. */
143
+ lastActivity: string;
144
+ retryCount: number;
145
+ observationSummary?: string;
146
+ checkSummary?: SessionCheckSummary;
147
+ }
148
+ interface SessionIndex {
149
+ runs: SessionRunRecord[];
150
+ sessions: SessionSummary[];
151
+ unscopedRunIds: string[];
152
+ warnings: SessionWarning[];
153
+ }
154
+ interface BuildSessionIndexOptions {
155
+ /** When true, group runs that share only `groupId` under a synthetic session key. */
156
+ correlateByGroupId?: boolean;
157
+ /** Reference clock for session staleness (v4.2+). */
158
+ nowMs?: number;
159
+ /** Inactivity threshold before marking a session stale (v4.2+, default 24h). */
160
+ staleThresholdMs?: number;
161
+ }
162
+
6
163
  /**
7
164
  * Logical lifecycle projection for trace checks.
8
165
  *
@@ -724,4 +881,4 @@ declare function createObservedOutcomeRule(options?: ObservedOutcomeRuleOptions)
724
881
  */
725
882
  declare function runTraceChecks(input: TraceCheckInput, options?: RunTraceChecksOptions): TraceCheckResult;
726
883
 
727
- export { createRetrievalRule as $, type TraceCheckFacts as A, type BaselineRegressionRuleOptions as B, type TraceCheckFinding as C, type DecisionRuleOptions as D, type TraceCheckFindingStatus as E, type TraceCheckRule as F, type GuardrailRuleOptions as G, type TraceCheckRuleCategory as H, type TraceCheckRuleExecution as I, type TraceCheckRuleExecutionStatus as J, type TraceCheckSeverity as K, type LogicalTraceEvent as L, type MaxStepDurationRuleOptions as M, type TraceCheckStatus as N, type ObservedOutcomeRuleOptions as O, type TraceCheckSummary as P, type TraceSignalRuleOptions as Q, type RetrievalRuleOptions as R, type SafetyFindingCategory as S, type TraceCheckInput as T, createBaselineRegressionRule as U, createDecisionRule as V, createGuardrailRule as W, createLlmUsageRule as X, createMaxStepDurationRule as Y, createObservedOutcomeRule as Z, createRequireCompletedRule as _, type LogicalProjectionDiagnostic as a, createRunDepthRule as a0, createRunDurationRule as a1, createRunEventCountRule as a2, createRunStatusRule as a3, createSafetyOversizedAttributeRule as a4, createSafetyRawContentRule as a5, createSafetyRedactionRule as a6, createSafetySecretPatternRule as a7, createStallDetectionRule as a8, createStructureCycleRule as a9, createStructureIncompleteRule as aa, createStructureOrphanRule as ab, createStructureParallelWidthRule as ac, createStructureRelationshipRule as ad, createToolFailureRule as ae, createToolOrderingRule as af, createToolUsageRule as ag, projectLogicalEvents as ah, resolveCanonicalToolName as ai, runTraceChecks as aj, type TraceCheckResult as b, type LlmUsageRuleOptions as c, type RunDepthRuleOptions as d, type RunDurationRuleOptions as e, type RunEventCountRuleOptions as f, type RunStatusRuleOptions as g, type RunTraceChecksOptions as h, type SafetyFindingConfidence as i, type SafetyOversizedAttributeRuleOptions as j, type SafetyRawContentRuleOptions as k, type SafetyRedactionRuleOptions as l, type SafetySecretPattern as m, type SafetySecretPatternRuleOptions as n, type StallDetectionRuleOptions as o, type StructureIncompleteRuleOptions as p, type StructureOrphanRuleOptions as q, type StructureParallelWidthRuleOptions as r, type StructureRelationshipRuleOptions as s, type ToolFailureRuleOptions as t, type ToolOrderingRuleOptions as u, type ToolUsageRuleOptions as v, type TraceCheckContext as w, type TraceCheckDiagnostic as x, type TraceCheckDiagnosticCode as y, type TraceCheckEvidence as z };
884
+ export { createRequireCompletedRule as $, type TraceCheckEvidence as A, type BaselineRegressionRuleOptions as B, type TraceCheckFacts as C, type DecisionRuleOptions as D, type TraceCheckFinding as E, type TraceCheckFindingStatus as F, type GuardrailRuleOptions as G, type TraceCheckRule as H, type TraceCheckRuleCategory as I, type TraceCheckRuleExecution as J, type TraceCheckRuleExecutionStatus as K, type LogicalTraceEvent as L, type MaxStepDurationRuleOptions as M, type TraceCheckSeverity as N, type ObservedOutcomeRuleOptions as O, type TraceCheckStatus as P, type TraceCheckSummary as Q, type RetrievalRuleOptions as R, type SessionWorkflowMetadata as S, type TraceCheckInput as T, type TraceSignalRuleOptions as U, createBaselineRegressionRule as V, createDecisionRule as W, createGuardrailRule as X, createLlmUsageRule as Y, createMaxStepDurationRule as Z, createObservedOutcomeRule as _, type LogicalProjectionDiagnostic as a, createRetrievalRule as a0, createRunDepthRule as a1, createRunDurationRule as a2, createRunEventCountRule as a3, createRunStatusRule as a4, createSafetyOversizedAttributeRule as a5, createSafetyRawContentRule as a6, createSafetyRedactionRule as a7, createSafetySecretPatternRule as a8, createStallDetectionRule as a9, type SessionConfidence as aA, type SessionEdgeSource as aB, type SessionGroup as aC, type SessionLastError as aD, type SessionWorkflowKey as aE, createStructureCycleRule as aa, createStructureIncompleteRule as ab, createStructureOrphanRule as ac, createStructureParallelWidthRule as ad, createStructureRelationshipRule as ae, createToolFailureRule as af, createToolOrderingRule as ag, createToolUsageRule as ah, projectLogicalEvents as ai, resolveCanonicalToolName as aj, runTraceChecks as ak, type SessionRunRecord as al, type EnrichSessionSummaryOptions as am, type SessionStatus as an, type SessionSummary as ao, type SessionIndex as ap, type BuildActivitySummaryOptions as aq, type ActivitySummary as ar, type SessionWarning as as, type BuildSessionIndexOptions as at, type ActivityEntry as au, type CriticalPathStep as av, type HandoffEdge as aw, type RetryLink as ax, SESSION_WORKFLOW_KEYS as ay, type SessionCheckSummary as az, type TraceCheckDiagnostic as b, type TraceCheckResult as c, type LlmUsageRuleOptions as d, type RunDepthRuleOptions as e, type RunDurationRuleOptions as f, type RunEventCountRuleOptions as g, type RunStatusRuleOptions as h, type RunTraceChecksOptions as i, type SafetyFindingCategory as j, type SafetyFindingConfidence as k, type SafetyOversizedAttributeRuleOptions as l, type SafetyRawContentRuleOptions as m, type SafetyRedactionRuleOptions as n, type SafetySecretPattern as o, type SafetySecretPatternRuleOptions as p, type StallDetectionRuleOptions as q, type StructureIncompleteRuleOptions as r, type StructureOrphanRuleOptions as s, type StructureParallelWidthRuleOptions as t, type StructureRelationshipRuleOptions as u, type ToolFailureRuleOptions as v, type ToolOrderingRuleOptions as w, type ToolUsageRuleOptions as x, type TraceCheckContext as y, type TraceCheckDiagnosticCode as z };
@@ -77,6 +77,7 @@ declare const openInferenceJsonReader: TraceReader;
77
77
  declare const otlpJsonReader: TraceReader;
78
78
  declare const agentInspectJsonlReader: TraceReader;
79
79
  declare const DEFAULT_TRACE_READERS: readonly TraceReader[];
80
+
80
81
  declare function detectTraceFormat(input: TraceInput, options?: TraceReadOptions): Promise<TraceFormatDetectionResult>;
81
82
  declare function readTrace(input: TraceInput, options?: TraceReadOptions): Promise<TraceReadResult>;
82
83
  declare function openTrace(input: TraceInput, options?: TraceReadOptions): Promise<TraceReadResult>;
@@ -99,4 +100,4 @@ declare function openTraceDirectory(dirPath: string, options?: TraceReadOptions)
99
100
  */
100
101
  declare function openTraceText(content: string, options?: TraceReadOptions): Promise<TraceReadResult>;
101
102
 
102
- export { DEFAULT_TRACE_READERS as D, type TraceReadWarning as T, type TraceReadResult as a, type TraceFormatCandidate as b, type TraceFormatDetectionResult as c, type TraceFormatDetectionStatus as d, type TraceInput as e, TraceReadError as f, type TraceReadErrorCode as g, type TraceReadOptions as h, type TraceReadWarningSeverity as i, type TraceReader as j, type TraceReaderDetectOptions as k, type TraceReaderReadOptions as l, agentInspectJsonlReader as m, assertTraceInput as n, detectTraceFormat as o, openInferenceJsonReader as p, openTrace as q, openTraceDirectory as r, openTraceFile as s, openTraceText as t, otlpJsonReader as u, readTrace as v };
103
+ export { DEFAULT_TRACE_READERS as D, type TraceFormatCandidate as T, type TraceFormatDetectionResult as a, type TraceFormatDetectionStatus as b, type TraceInput as c, TraceReadError as d, type TraceReadErrorCode as e, type TraceReadOptions as f, type TraceReadResult as g, type TraceReadWarning as h, type TraceReadWarningSeverity as i, type TraceReader as j, type TraceReaderDetectOptions as k, type TraceReaderReadOptions as l, agentInspectJsonlReader as m, assertTraceInput as n, detectTraceFormat as o, openInferenceJsonReader as p, openTrace as q, openTraceDirectory as r, openTraceFile as s, openTraceText as t, otlpJsonReader as u, readTrace as v };
@@ -77,6 +77,7 @@ declare const openInferenceJsonReader: TraceReader;
77
77
  declare const otlpJsonReader: TraceReader;
78
78
  declare const agentInspectJsonlReader: TraceReader;
79
79
  declare const DEFAULT_TRACE_READERS: readonly TraceReader[];
80
+
80
81
  declare function detectTraceFormat(input: TraceInput, options?: TraceReadOptions): Promise<TraceFormatDetectionResult>;
81
82
  declare function readTrace(input: TraceInput, options?: TraceReadOptions): Promise<TraceReadResult>;
82
83
  declare function openTrace(input: TraceInput, options?: TraceReadOptions): Promise<TraceReadResult>;
@@ -99,4 +100,4 @@ declare function openTraceDirectory(dirPath: string, options?: TraceReadOptions)
99
100
  */
100
101
  declare function openTraceText(content: string, options?: TraceReadOptions): Promise<TraceReadResult>;
101
102
 
102
- export { DEFAULT_TRACE_READERS as D, type TraceReadWarning as T, type TraceReadResult as a, type TraceFormatCandidate as b, type TraceFormatDetectionResult as c, type TraceFormatDetectionStatus as d, type TraceInput as e, TraceReadError as f, type TraceReadErrorCode as g, type TraceReadOptions as h, type TraceReadWarningSeverity as i, type TraceReader as j, type TraceReaderDetectOptions as k, type TraceReaderReadOptions as l, agentInspectJsonlReader as m, assertTraceInput as n, detectTraceFormat as o, openInferenceJsonReader as p, openTrace as q, openTraceDirectory as r, openTraceFile as s, openTraceText as t, otlpJsonReader as u, readTrace as v };
103
+ export { DEFAULT_TRACE_READERS as D, type TraceFormatCandidate as T, type TraceFormatDetectionResult as a, type TraceFormatDetectionStatus as b, type TraceInput as c, TraceReadError as d, type TraceReadErrorCode as e, type TraceReadOptions as f, type TraceReadResult as g, type TraceReadWarning as h, type TraceReadWarningSeverity as i, type TraceReader as j, type TraceReaderDetectOptions as k, type TraceReaderReadOptions as l, agentInspectJsonlReader as m, assertTraceInput as n, detectTraceFormat as o, openInferenceJsonReader as p, openTrace as q, openTraceDirectory as r, openTraceFile as s, openTraceText as t, otlpJsonReader as u, readTrace as v };
@@ -1,6 +1,6 @@
1
- import { I as InspectRunOptions, S as StepOptions, O as ObserveOptions } from './types-UnrNaTo2.cjs';
2
- export { E as ErrorInfo, R as RedactionProfile, a as Run, b as RunStatus, c as Step, d as StepMetadata, e as StepStatus, f as StepType, T as TokenMetadata, g as TraceCorrelationMetadata } from './types-UnrNaTo2.cjs';
3
- export { C as CreateInspectorOptions, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, d as InspectorStepOptions, e as createInspector, g as getCurrentCorrelationMetadata, m as maybeInspectRun } from './context-C5ye_xcS.cjs';
1
+ import { I as InspectRunOptions, S as StepOptions, O as ObserveOptions } from './types-VzKihKQo.cjs';
2
+ export { E as ErrorInfo, R as RedactionProfile, a as Run, b as RunStatus, c as Step, d as StepMetadata, e as StepStatus, f as StepType, g as TokenMetadata, h as TraceCorrelationMetadata } from './types-VzKihKQo.cjs';
3
+ export { C as CreateInspectorOptions, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, d as InspectorStepOptions, e as createInspector, g as getCurrentCorrelationMetadata, m as maybeInspectRun } from './context-DOOT9GZ-.cjs';
4
4
  import { a as ObserveOutcomeOptions } from './types-B562HgN_.cjs';
5
5
  import './log-config-CFlIJHTf.cjs';
6
6
  import './inspect-event-DRthdZlf.cjs';
@@ -1,6 +1,6 @@
1
- import { I as InspectRunOptions, S as StepOptions, O as ObserveOptions } from './types--ainI31J.js';
2
- export { E as ErrorInfo, R as RedactionProfile, a as Run, b as RunStatus, c as Step, d as StepMetadata, e as StepStatus, f as StepType, T as TokenMetadata, g as TraceCorrelationMetadata } from './types--ainI31J.js';
3
- export { C as CreateInspectorOptions, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, d as InspectorStepOptions, e as createInspector, g as getCurrentCorrelationMetadata, m as maybeInspectRun } from './context-CNsNSgE2.js';
1
+ import { I as InspectRunOptions, S as StepOptions, O as ObserveOptions } from './types-Bx3mEZ04.js';
2
+ export { E as ErrorInfo, R as RedactionProfile, a as Run, b as RunStatus, c as Step, d as StepMetadata, e as StepStatus, f as StepType, g as TokenMetadata, h as TraceCorrelationMetadata } from './types-Bx3mEZ04.js';
3
+ export { C as CreateInspectorOptions, I as Inspector, a as InspectorCaptureOptions, b as InspectorObserveOptions, c as InspectorRunOptions, d as InspectorStepOptions, e as createInspector, g as getCurrentCorrelationMetadata, m as maybeInspectRun } from './context-DOX2-RjH.js';
4
4
  import { a as ObserveOutcomeOptions } from './types-B562HgN_.js';
5
5
  import './log-config-OZRfpHED.js';
6
6
  import './inspect-event-DRthdZlf.js';
@@ -1,6 +1,6 @@
1
- import { getCurrentContext, getCurrentDepth, getParentStepId, getTraceSafetyFromContext, runWithStepContext, printStepStart, printStepComplete, printError, printFailedAt, inspectRun } from './chunk-5YFJJFXU.mjs';
2
- export { createInspector, getCurrentCorrelationMetadata, inspectRun, maybeInspectRun } from './chunk-5YFJJFXU.mjs';
3
- import { normalizeObserveOutcomeInput, prepareOutcomeEventForDisk } from './chunk-3XS5O4JI.mjs';
1
+ import { getCurrentContext, getCurrentDepth, getParentStepId, getTraceSafetyFromContext, runWithStepContext, printStepStart, printStepComplete, printError, printFailedAt, inspectRun } from './chunk-WGDSM37E.mjs';
2
+ export { createInspector, getCurrentCorrelationMetadata, inspectRun, maybeInspectRun } from './chunk-WGDSM37E.mjs';
3
+ import { normalizeObserveOutcomeInput, prepareOutcomeEventForDisk } from './chunk-R4SSYU6D.mjs';
4
4
  import './chunk-BT7CATSD.mjs';
5
5
  import { prepareTraceEventForDisk, writeTraceEvent } from './chunk-U25RHRSU.mjs';
6
6
  import './chunk-VU6O5QAH.mjs';
@@ -1,6 +1,6 @@
1
1
  import { P as PersistedInspectEvent } from './persisted-inspect-event-CVZWZldL.cjs';
2
2
  export { a as PersistedEventSource, b as PersistedEventSourceType, c as PersistedEventStatus, d as PersistedInspectError, e as PersistedInspectEventV02, f as PersistedInspectEventV10, g as PersistedSchemaVersion, h as PersistedTokenUsage, i as PersistedTraceContext, j as isPersistedInspectEvent, k as isPersistedInspectEventV02, l as isPersistedInspectEventV10 } from './persisted-inspect-event-CVZWZldL.cjs';
3
- import { h as TraceEvent } from './types-UnrNaTo2.cjs';
3
+ import { i as TraceEvent } from './types-VzKihKQo.cjs';
4
4
  import { c as InspectEvent, a as InspectRunTree } from './inspect-event-DRthdZlf.cjs';
5
5
  import './log-config-CFlIJHTf.cjs';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { P as PersistedInspectEvent } from './persisted-inspect-event-BVucFVrP.js';
2
2
  export { a as PersistedEventSource, b as PersistedEventSourceType, c as PersistedEventStatus, d as PersistedInspectError, e as PersistedInspectEventV02, f as PersistedInspectEventV10, g as PersistedSchemaVersion, h as PersistedTokenUsage, i as PersistedTraceContext, j as isPersistedInspectEvent, k as isPersistedInspectEventV02, l as isPersistedInspectEventV10 } from './persisted-inspect-event-BVucFVrP.js';
3
- import { h as TraceEvent } from './types--ainI31J.js';
3
+ import { i as TraceEvent } from './types-Bx3mEZ04.js';
4
4
  import { c as InspectEvent, a as InspectRunTree } from './inspect-event-DRthdZlf.js';
5
5
  import './log-config-OZRfpHED.js';
6
6
 
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Stable programmatic diagnostic codes for readers / TraceFacts / TraceContract.
3
+ *
4
+ * Lowercase `TraceReadError.code` values remain the published reader error codes.
5
+ * These `AI_*` identifiers appear in messages and catalogs for actionable remediation.
6
+ *
7
+ * @experimental Additive in 6.15.0; do not replace published lowercase reader codes.
8
+ */
9
+ 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";
10
+ interface ProgrammaticDiagnosticSpec {
11
+ readonly code: ProgrammaticDiagnosticCode;
12
+ /** Short problem statement (without the code prefix). */
13
+ readonly summary: string;
14
+ /** Actionable remediation hint (always included in formatted messages). */
15
+ readonly remediation: string;
16
+ /** Related published / capture codes that must remain valid. */
17
+ readonly relatedCodes?: readonly string[];
18
+ }
19
+ declare const PROGRAMMATIC_DIAGNOSTIC_SPECS: Readonly<Record<ProgrammaticDiagnosticCode, ProgrammaticDiagnosticSpec>>;
20
+ /**
21
+ * Format `CODE: summary Remediation: …` for thrown errors and diagnostics.
22
+ */
23
+ declare function formatProgrammaticDiagnostic(code: ProgrammaticDiagnosticCode, detail?: string): string;
24
+
25
+ export { PROGRAMMATIC_DIAGNOSTIC_SPECS as P, type ProgrammaticDiagnosticCode as a, type ProgrammaticDiagnosticSpec as b, formatProgrammaticDiagnostic as f };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Stable programmatic diagnostic codes for readers / TraceFacts / TraceContract.
3
+ *
4
+ * Lowercase `TraceReadError.code` values remain the published reader error codes.
5
+ * These `AI_*` identifiers appear in messages and catalogs for actionable remediation.
6
+ *
7
+ * @experimental Additive in 6.15.0; do not replace published lowercase reader codes.
8
+ */
9
+ 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";
10
+ interface ProgrammaticDiagnosticSpec {
11
+ readonly code: ProgrammaticDiagnosticCode;
12
+ /** Short problem statement (without the code prefix). */
13
+ readonly summary: string;
14
+ /** Actionable remediation hint (always included in formatted messages). */
15
+ readonly remediation: string;
16
+ /** Related published / capture codes that must remain valid. */
17
+ readonly relatedCodes?: readonly string[];
18
+ }
19
+ declare const PROGRAMMATIC_DIAGNOSTIC_SPECS: Readonly<Record<ProgrammaticDiagnosticCode, ProgrammaticDiagnosticSpec>>;
20
+ /**
21
+ * Format `CODE: summary Remediation: …` for thrown errors and diagnostics.
22
+ */
23
+ declare function formatProgrammaticDiagnostic(code: ProgrammaticDiagnosticCode, detail?: string): string;
24
+
25
+ export { PROGRAMMATIC_DIAGNOSTIC_SPECS as P, type ProgrammaticDiagnosticCode as a, type ProgrammaticDiagnosticSpec as b, formatProgrammaticDiagnostic as f };
@@ -1234,6 +1234,107 @@ function formatProgrammaticDiagnostic(code, detail) {
1234
1234
  return `${code}: ${summary} Remediation: ${spec.remediation}`;
1235
1235
  }
1236
1236
 
1237
+ // packages/core/src/readers/mapping-ledger.ts
1238
+ var OPENINFERENCE_MAPPING_LEDGER = {
1239
+ id: "openinference-to-agent-inspect",
1240
+ sourceFormat: "openinference-json",
1241
+ targetFormat: "agent-inspect-persisted-1.0",
1242
+ convention: {
1243
+ name: "OpenInference",
1244
+ version: "0.2.x",
1245
+ specUrl: "https://github.com/Arize-ai/openinference"
1246
+ },
1247
+ entries: [
1248
+ {
1249
+ source: "span.context.span_id",
1250
+ target: "eventId / trace.spanId",
1251
+ transformation: "hex identity when present",
1252
+ confidence: "explicit",
1253
+ loss: "none"
1254
+ },
1255
+ {
1256
+ source: "span.context.trace_id",
1257
+ target: "trace.traceId",
1258
+ transformation: "hex identity when present",
1259
+ confidence: "explicit",
1260
+ loss: "none"
1261
+ },
1262
+ {
1263
+ source: "span.parent_id",
1264
+ target: "parentId",
1265
+ transformation: "direct when resolvable in batch",
1266
+ confidence: "explicit",
1267
+ loss: "none"
1268
+ },
1269
+ {
1270
+ source: "attributes.openinference.span.kind",
1271
+ target: "kind",
1272
+ transformation: "enumerated kind map with degrade-to-LOGIC",
1273
+ confidence: "correlated",
1274
+ loss: "kind-degraded",
1275
+ privacyDecision: "unknown kinds preserved under bounds as attributes"
1276
+ },
1277
+ {
1278
+ source: "attributes.llm.input_messages / output_messages",
1279
+ target: "inputSummary / outputSummary",
1280
+ transformation: "bounded summaries only",
1281
+ confidence: "heuristic",
1282
+ loss: "privacy-redacted",
1283
+ privacyDecision: "raw message bodies are not required and may be omitted"
1284
+ }
1285
+ ],
1286
+ knownLosses: [
1287
+ "Chain-of-thought / private reasoning fields are never imported as raw content.",
1288
+ "Oversized attributes are bounded or marked unsupported.",
1289
+ "Unknown OpenInference kinds degrade to LOGIC with a warning."
1290
+ ]
1291
+ };
1292
+ var OTLP_JSON_MAPPING_LEDGER = {
1293
+ id: "otlp-json-to-agent-inspect",
1294
+ sourceFormat: "otlp-json",
1295
+ targetFormat: "agent-inspect-persisted-1.0",
1296
+ convention: {
1297
+ name: "OpenTelemetry GenAI semantic conventions",
1298
+ version: "1.36.0",
1299
+ specUrl: "https://opentelemetry.io/docs/specs/semconv/gen-ai/"
1300
+ },
1301
+ entries: [
1302
+ {
1303
+ source: "resourceSpans[].scopeSpans[].spans[]",
1304
+ target: "PersistedInspectEvent[]",
1305
+ transformation: "one span \u2192 one event when mappable",
1306
+ confidence: "explicit",
1307
+ loss: "none"
1308
+ },
1309
+ {
1310
+ source: "span.attributes[gen_ai.*]",
1311
+ target: "attributes / tokenUsage / kind",
1312
+ transformation: "pinned GenAI attribute family",
1313
+ confidence: "correlated",
1314
+ loss: "bounded"
1315
+ },
1316
+ {
1317
+ source: "span.attributes (unknown keys)",
1318
+ target: "attributes.* / unsupportedFields",
1319
+ transformation: "preserve under bounds or list as unsupported",
1320
+ confidence: "unknown",
1321
+ loss: "unsupported"
1322
+ }
1323
+ ],
1324
+ knownLosses: [
1325
+ "Schema 1.0 is not bound to Development-status OTel GenAI revisions.",
1326
+ "Status rewrite to fit a local narrative is forbidden.",
1327
+ "Payload bodies may be omitted; digests are optional application metadata."
1328
+ ]
1329
+ };
1330
+ var BUILTIN_MAPPING_LEDGERS = Object.freeze([
1331
+ OPENINFERENCE_MAPPING_LEDGER,
1332
+ OTLP_JSON_MAPPING_LEDGER
1333
+ ]);
1334
+ function getMappingLedger(id) {
1335
+ return BUILTIN_MAPPING_LEDGERS.find((ledger) => ledger.id === id);
1336
+ }
1337
+
1237
1338
  // packages/core/src/readers/index.ts
1238
1339
  var DEFAULT_MAX_TRACE_INPUT_BYTES = 10 * 1024 * 1024;
1239
1340
  var MIN_DETECTION_CONFIDENCE = 0.5;
@@ -2854,13 +2955,17 @@ function openTraceText(content, options = {}) {
2854
2955
  return openTrace({ type: "string", content }, options);
2855
2956
  }
2856
2957
 
2958
+ exports.BUILTIN_MAPPING_LEDGERS = BUILTIN_MAPPING_LEDGERS;
2857
2959
  exports.DEFAULT_TRACE_READERS = DEFAULT_TRACE_READERS;
2960
+ exports.OPENINFERENCE_MAPPING_LEDGER = OPENINFERENCE_MAPPING_LEDGER;
2961
+ exports.OTLP_JSON_MAPPING_LEDGER = OTLP_JSON_MAPPING_LEDGER;
2858
2962
  exports.PROGRAMMATIC_DIAGNOSTIC_SPECS = PROGRAMMATIC_DIAGNOSTIC_SPECS;
2859
2963
  exports.TraceReadError = TraceReadError;
2860
2964
  exports.agentInspectJsonlReader = agentInspectJsonlReader;
2861
2965
  exports.assertTraceInput = assertTraceInput;
2862
2966
  exports.detectTraceFormat = detectTraceFormat;
2863
2967
  exports.formatProgrammaticDiagnostic = formatProgrammaticDiagnostic;
2968
+ exports.getMappingLedger = getMappingLedger;
2864
2969
  exports.openInferenceJsonReader = openInferenceJsonReader;
2865
2970
  exports.openTrace = openTrace;
2866
2971
  exports.openTraceDirectory = openTraceDirectory;