agent-inspect 6.27.0 → 6.29.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 (97) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/docs/BUNDLES.md +4 -1
  4. package/docs/LIMITATIONS.md +1 -1
  5. package/docs/SAFE-TRACE-SHARING.md +2 -0
  6. package/docs/SCHEMA.md +1 -1
  7. package/package.json +2 -1
  8. package/packages/cli/dist/{chunk-WQITHDXH.mjs → chunk-D7PT6TXM.mjs} +4368 -3805
  9. package/packages/cli/dist/chunk-D7PT6TXM.mjs.map +1 -0
  10. package/packages/cli/dist/index.cjs +4593 -4019
  11. package/packages/cli/dist/index.cjs.map +1 -1
  12. package/packages/cli/dist/index.mjs +4 -4
  13. package/packages/cli/dist/index.mjs.map +1 -1
  14. package/packages/cli/dist/{src-T2ATN6XF.mjs → src-QONEBW2F.mjs} +3 -3
  15. package/packages/cli/dist/{src-T2ATN6XF.mjs.map → src-QONEBW2F.mjs.map} +1 -1
  16. package/packages/core/dist/advanced.cjs +3062 -2490
  17. package/packages/core/dist/advanced.cjs.map +1 -1
  18. package/packages/core/dist/advanced.d.cts +174 -16
  19. package/packages/core/dist/advanced.d.ts +174 -16
  20. package/packages/core/dist/advanced.mjs +374 -44
  21. package/packages/core/dist/advanced.mjs.map +1 -1
  22. package/packages/core/dist/checks.cjs +10 -1
  23. package/packages/core/dist/checks.cjs.map +1 -1
  24. package/packages/core/dist/checks.d.cts +9 -476
  25. package/packages/core/dist/checks.d.ts +9 -476
  26. package/packages/core/dist/checks.mjs +5 -5
  27. package/packages/core/dist/{chunk-U25RHRSU.mjs → chunk-3B24355S.mjs} +12 -5
  28. package/packages/core/dist/chunk-3B24355S.mjs.map +1 -0
  29. package/packages/core/dist/{chunk-NXQF73EC.mjs → chunk-5B4DNGFB.mjs} +9 -5
  30. package/packages/core/dist/chunk-5B4DNGFB.mjs.map +1 -0
  31. package/packages/core/dist/{chunk-NDRMIL7Z.mjs → chunk-FKUTGUFG.mjs} +12 -4
  32. package/packages/core/dist/chunk-FKUTGUFG.mjs.map +1 -0
  33. package/packages/core/dist/{chunk-B6PH7A24.mjs → chunk-LGTPSHH2.mjs} +3615 -3606
  34. package/packages/core/dist/chunk-LGTPSHH2.mjs.map +1 -0
  35. package/packages/core/dist/{chunk-R4SSYU6D.mjs → chunk-MVRZ7JBH.mjs} +3 -3
  36. package/packages/core/dist/{chunk-R4SSYU6D.mjs.map → chunk-MVRZ7JBH.mjs.map} +1 -1
  37. package/packages/core/dist/{chunk-P366CCL2.mjs → chunk-QJI52TH3.mjs} +4 -2
  38. package/packages/core/dist/chunk-QJI52TH3.mjs.map +1 -0
  39. package/packages/core/dist/{chunk-WRE4CNPF.mjs → chunk-SJ3C5RIS.mjs} +3 -3
  40. package/packages/core/dist/chunk-SJ3C5RIS.mjs.map +1 -0
  41. package/packages/core/dist/{chunk-WGDSM37E.mjs → chunk-TIGBAVED.mjs} +5 -5
  42. package/packages/core/dist/{chunk-WGDSM37E.mjs.map → chunk-TIGBAVED.mjs.map} +1 -1
  43. package/packages/core/dist/{chunk-JBNRJLIV.mjs → chunk-TNOPL75V.mjs} +33 -7
  44. package/packages/core/dist/chunk-TNOPL75V.mjs.map +1 -0
  45. package/packages/core/dist/{context-DOX2-RjH.d.ts → context-B8zzsmjX.d.ts} +4 -4
  46. package/packages/core/dist/{context-DOOT9GZ-.d.cts → context-BhaVHtOT.d.cts} +4 -4
  47. package/packages/core/dist/diff.d.cts +3 -3
  48. package/packages/core/dist/diff.d.ts +3 -3
  49. package/packages/core/dist/exporters.cjs +29 -3
  50. package/packages/core/dist/exporters.cjs.map +1 -1
  51. package/packages/core/dist/exporters.d.cts +3 -3
  52. package/packages/core/dist/exporters.d.ts +3 -3
  53. package/packages/core/dist/exporters.mjs +5 -5
  54. package/packages/core/dist/{index-DLLz9sce.d.cts → index-BT3KcO6-.d.cts} +2 -2
  55. package/packages/core/dist/{index-CR4CCRqP.d.cts → index-C61p7wBR.d.cts} +473 -6
  56. package/packages/core/dist/{index-CtK_p-ps.d.ts → index-DTO2iGeq.d.ts} +473 -6
  57. package/packages/core/dist/{index-D72DPqAF.d.ts → index-reskZCVW.d.ts} +2 -2
  58. package/packages/core/dist/index.cjs +10 -1
  59. package/packages/core/dist/index.cjs.map +1 -1
  60. package/packages/core/dist/index.d.cts +7 -7
  61. package/packages/core/dist/index.d.ts +7 -7
  62. package/packages/core/dist/index.mjs +6 -6
  63. package/packages/core/dist/{inspect-event-DRthdZlf.d.cts → inspect-event-CDqjcrG_.d.cts} +1 -1
  64. package/packages/core/dist/{inspect-event-DRthdZlf.d.ts → inspect-event-CDqjcrG_.d.ts} +1 -1
  65. package/packages/core/dist/{log-config-CFlIJHTf.d.cts → log-config-DcjV8ZjF.d.cts} +1 -1
  66. package/packages/core/dist/{log-config-OZRfpHED.d.ts → log-config-N_c5AE09.d.ts} +1 -1
  67. package/packages/core/dist/logs.d.cts +3 -3
  68. package/packages/core/dist/logs.d.ts +3 -3
  69. package/packages/core/dist/{persisted-inspect-event-BVucFVrP.d.ts → persisted-inspect-event-BMwvGIB8.d.ts} +6 -1
  70. package/packages/core/dist/{persisted-inspect-event-CVZWZldL.d.cts → persisted-inspect-event-DPaCiars.d.cts} +6 -1
  71. package/packages/core/dist/persisted.cjs +8 -2
  72. package/packages/core/dist/persisted.cjs.map +1 -1
  73. package/packages/core/dist/persisted.d.cts +5 -5
  74. package/packages/core/dist/persisted.d.ts +5 -5
  75. package/packages/core/dist/persisted.mjs +3 -3
  76. package/packages/core/dist/readers.cjs +16 -2
  77. package/packages/core/dist/readers.cjs.map +1 -1
  78. package/packages/core/dist/readers.d.cts +3 -3
  79. package/packages/core/dist/readers.d.ts +3 -3
  80. package/packages/core/dist/readers.mjs +4 -4
  81. package/packages/core/dist/{types-B562HgN_.d.cts → types-BA_IOdg4.d.cts} +1 -1
  82. package/packages/core/dist/{types-B562HgN_.d.ts → types-BA_IOdg4.d.ts} +1 -1
  83. package/packages/core/dist/{types-VzKihKQo.d.cts → types-BSzhK7Z1.d.cts} +11 -2
  84. package/packages/core/dist/{types-Bx3mEZ04.d.ts → types-C5Y8Idle.d.ts} +11 -2
  85. package/packages/core/dist/writers.cjs +10 -1
  86. package/packages/core/dist/writers.cjs.map +1 -1
  87. package/packages/core/dist/writers.d.cts +2 -2
  88. package/packages/core/dist/writers.d.ts +2 -2
  89. package/packages/core/dist/writers.mjs +3 -3
  90. package/packages/cli/dist/chunk-WQITHDXH.mjs.map +0 -1
  91. package/packages/core/dist/chunk-B6PH7A24.mjs.map +0 -1
  92. package/packages/core/dist/chunk-JBNRJLIV.mjs.map +0 -1
  93. package/packages/core/dist/chunk-NDRMIL7Z.mjs.map +0 -1
  94. package/packages/core/dist/chunk-NXQF73EC.mjs.map +0 -1
  95. package/packages/core/dist/chunk-P366CCL2.mjs.map +0 -1
  96. package/packages/core/dist/chunk-U25RHRSU.mjs.map +0 -1
  97. package/packages/core/dist/chunk-WRE4CNPF.mjs.map +0 -1
@@ -1,10 +1,10 @@
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
- import { a as ObserveOutcomeOptions } from './types-B562HgN_.cjs';
5
- import './log-config-CFlIJHTf.cjs';
6
- import './inspect-event-DRthdZlf.cjs';
7
- import './persisted-inspect-event-CVZWZldL.cjs';
1
+ import { I as InspectRunOptions, S as StepOptions, O as ObserveOptions } from './types-BSzhK7Z1.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-BSzhK7Z1.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-BhaVHtOT.cjs';
4
+ import { O as ObserveOutcomeOptions } from './types-BA_IOdg4.cjs';
5
+ import './log-config-DcjV8ZjF.cjs';
6
+ import './inspect-event-CDqjcrG_.cjs';
7
+ import './persisted-inspect-event-DPaCiars.cjs';
8
8
  import './writers.cjs';
9
9
 
10
10
  /**
@@ -1,10 +1,10 @@
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
- import { a as ObserveOutcomeOptions } from './types-B562HgN_.js';
5
- import './log-config-OZRfpHED.js';
6
- import './inspect-event-DRthdZlf.js';
7
- import './persisted-inspect-event-BVucFVrP.js';
1
+ import { I as InspectRunOptions, S as StepOptions, O as ObserveOptions } from './types-C5Y8Idle.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-C5Y8Idle.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-B8zzsmjX.js';
4
+ import { O as ObserveOutcomeOptions } from './types-BA_IOdg4.js';
5
+ import './log-config-N_c5AE09.js';
6
+ import './inspect-event-CDqjcrG_.js';
7
+ import './persisted-inspect-event-BMwvGIB8.js';
8
8
  import './writers.js';
9
9
 
10
10
  /**
@@ -1,12 +1,12 @@
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';
1
+ import { getCurrentContext, getCurrentDepth, getParentStepId, getTraceSafetyFromContext, runWithStepContext, printStepStart, printStepComplete, printError, printFailedAt, inspectRun } from './chunk-TIGBAVED.mjs';
2
+ export { createInspector, getCurrentCorrelationMetadata, inspectRun, maybeInspectRun } from './chunk-TIGBAVED.mjs';
3
+ import { normalizeObserveOutcomeInput, prepareOutcomeEventForDisk } from './chunk-MVRZ7JBH.mjs';
4
4
  import './chunk-BT7CATSD.mjs';
5
- import { prepareTraceEventForDisk, writeTraceEvent } from './chunk-U25RHRSU.mjs';
5
+ import { prepareTraceEventForDisk, writeTraceEvent } from './chunk-3B24355S.mjs';
6
6
  import './chunk-VU6O5QAH.mjs';
7
7
  import './chunk-S4YWKV4G.mjs';
8
- import { warn, createStepId, formatError, truncateName } from './chunk-WRE4CNPF.mjs';
9
- import './chunk-P366CCL2.mjs';
8
+ import { warn, createStepId, formatError, truncateName } from './chunk-SJ3C5RIS.mjs';
9
+ import './chunk-QJI52TH3.mjs';
10
10
  import './chunk-7TGZLWEE.mjs';
11
11
 
12
12
  // packages/core/src/step.ts
@@ -47,4 +47,4 @@ interface InspectRunTree {
47
47
  };
48
48
  }
49
49
 
50
- export type { AttributionConfidence as A, EventSource as E, InspectKind as I, InspectRunTree as a, InspectNode as b, InspectEvent as c };
50
+ export type { AttributionConfidence as A, EventSource as E, InspectKind as I, InspectRunTree as a, InspectEvent as b, InspectNode as c };
@@ -47,4 +47,4 @@ interface InspectRunTree {
47
47
  };
48
48
  }
49
49
 
50
- export type { AttributionConfidence as A, EventSource as E, InspectKind as I, InspectRunTree as a, InspectNode as b, InspectEvent as c };
50
+ export type { AttributionConfidence as A, EventSource as E, InspectKind as I, InspectRunTree as a, InspectEvent as b, InspectNode as c };
@@ -1,4 +1,4 @@
1
- import { I as InspectKind } from './inspect-event-DRthdZlf.cjs';
1
+ import { I as InspectKind } from './inspect-event-CDqjcrG_.cjs';
2
2
 
3
3
  interface LogEventMapping {
4
4
  kind?: InspectKind;
@@ -1,4 +1,4 @@
1
- import { I as InspectKind } from './inspect-event-DRthdZlf.js';
1
+ import { I as InspectKind } from './inspect-event-CDqjcrG_.js';
2
2
 
3
3
  interface LogEventMapping {
4
4
  kind?: InspectKind;
@@ -1,6 +1,6 @@
1
- import { L as LogIngestConfig, a as LogEventMapping, R as RedactionRule } from './log-config-CFlIJHTf.cjs';
2
- export { b as RedactionStrategy } from './log-config-CFlIJHTf.cjs';
3
- import { c as InspectEvent, a as InspectRunTree } from './inspect-event-DRthdZlf.cjs';
1
+ import { L as LogIngestConfig, a as LogEventMapping, R as RedactionRule } from './log-config-DcjV8ZjF.cjs';
2
+ export { b as RedactionStrategy } from './log-config-DcjV8ZjF.cjs';
3
+ import { b as InspectEvent, a as InspectRunTree } from './inspect-event-CDqjcrG_.cjs';
4
4
 
5
5
  type ParserWarningCode = "MALFORMED_JSON" | "MISSING_RUN_ID" | "MISSING_EVENT" | "MISSING_TIMESTAMP" | "UNSUPPORTED_LOG4JS_PAYLOAD" | "CONFIG_ERROR" | "UNKNOWN";
6
6
  interface ParserWarning {
@@ -1,6 +1,6 @@
1
- import { L as LogIngestConfig, a as LogEventMapping, R as RedactionRule } from './log-config-OZRfpHED.js';
2
- export { b as RedactionStrategy } from './log-config-OZRfpHED.js';
3
- import { c as InspectEvent, a as InspectRunTree } from './inspect-event-DRthdZlf.js';
1
+ import { L as LogIngestConfig, a as LogEventMapping, R as RedactionRule } from './log-config-N_c5AE09.js';
2
+ export { b as RedactionStrategy } from './log-config-N_c5AE09.js';
3
+ import { b as InspectEvent, a as InspectRunTree } from './inspect-event-CDqjcrG_.js';
4
4
 
5
5
  type ParserWarningCode = "MALFORMED_JSON" | "MISSING_RUN_ID" | "MISSING_EVENT" | "MISSING_TIMESTAMP" | "UNSUPPORTED_LOG4JS_PAYLOAD" | "CONFIG_ERROR" | "UNKNOWN";
6
6
  interface ParserWarning {
@@ -1,4 +1,4 @@
1
- import { I as InspectKind, A as AttributionConfidence } from './inspect-event-DRthdZlf.js';
1
+ import { I as InspectKind, A as AttributionConfidence } from './inspect-event-CDqjcrG_.js';
2
2
 
3
3
  type PersistedSchemaVersion = "0.2" | "1.0";
4
4
  type PersistedEventSourceType = "manual" | "json-log" | "log4js" | "adapter" | "ai-sdk" | "otel";
@@ -17,7 +17,12 @@ interface PersistedTokenUsage {
17
17
  input?: number;
18
18
  output?: number;
19
19
  total?: number;
20
+ /** Cache-read tokens (informational; never added to total). */
20
21
  cached?: number;
22
+ /** Cache-write / cache-creation tokens (informational; never added to total). */
23
+ cacheWrite?: number;
24
+ /** Reasoning / thinking tokens when providers report them separately. */
25
+ reasoning?: number;
21
26
  }
22
27
  interface PersistedTraceContext {
23
28
  traceId?: string;
@@ -1,4 +1,4 @@
1
- import { I as InspectKind, A as AttributionConfidence } from './inspect-event-DRthdZlf.cjs';
1
+ import { I as InspectKind, A as AttributionConfidence } from './inspect-event-CDqjcrG_.cjs';
2
2
 
3
3
  type PersistedSchemaVersion = "0.2" | "1.0";
4
4
  type PersistedEventSourceType = "manual" | "json-log" | "log4js" | "adapter" | "ai-sdk" | "otel";
@@ -17,7 +17,12 @@ interface PersistedTokenUsage {
17
17
  input?: number;
18
18
  output?: number;
19
19
  total?: number;
20
+ /** Cache-read tokens (informational; never added to total). */
20
21
  cached?: number;
22
+ /** Cache-write / cache-creation tokens (informational; never added to total). */
23
+ cacheWrite?: number;
24
+ /** Reasoning / thinking tokens when providers report them separately. */
25
+ reasoning?: number;
21
26
  }
22
27
  interface PersistedTraceContext {
23
28
  traceId?: string;
@@ -85,6 +85,8 @@ function isPersistedTokenUsage(value) {
85
85
  if (!isOptionalNonNegativeNumber(value.output)) return false;
86
86
  if (!isOptionalNonNegativeNumber(value.total)) return false;
87
87
  if (!isOptionalNonNegativeNumber(value.cached)) return false;
88
+ if (!isOptionalNonNegativeNumber(value.cacheWrite)) return false;
89
+ if (!isOptionalNonNegativeNumber(value.reasoning)) return false;
88
90
  return true;
89
91
  }
90
92
  function isPersistedTraceContext(value) {
@@ -177,16 +179,20 @@ function normalizeTokenUsage(value) {
177
179
  const output = nonNegativeFinite(value.output);
178
180
  const suppliedTotal = nonNegativeFinite(value.total);
179
181
  const cached = nonNegativeFinite(value.cached);
182
+ const cacheWrite = nonNegativeFinite(value.cacheWrite);
183
+ const reasoning = nonNegativeFinite(value.reasoning);
180
184
  const derivedTotal = input !== void 0 && output !== void 0 && Number.isFinite(input + output) ? input + output : void 0;
181
185
  const total = suppliedTotal ?? derivedTotal;
182
- if (input === void 0 && output === void 0 && total === void 0 && cached === void 0) {
186
+ if (input === void 0 && output === void 0 && total === void 0 && cached === void 0 && cacheWrite === void 0 && reasoning === void 0) {
183
187
  return void 0;
184
188
  }
185
189
  return {
186
190
  ...input !== void 0 ? { input } : {},
187
191
  ...output !== void 0 ? { output } : {},
188
192
  ...total !== void 0 ? { total } : {},
189
- ...cached !== void 0 ? { cached } : {}
193
+ ...cached !== void 0 ? { cached } : {},
194
+ ...cacheWrite !== void 0 ? { cacheWrite } : {},
195
+ ...reasoning !== void 0 ? { reasoning } : {}
190
196
  };
191
197
  }
192
198