agent-inspect 1.9.0 → 2.0.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 (98) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +13 -9
  3. package/docs/ADAPTER-CONFORMANCE.md +1 -1
  4. package/docs/API.md +30 -29
  5. package/docs/CLI.md +41 -11
  6. package/docs/EXPORTS.md +1 -1
  7. package/docs/GETTING-STARTED.md +2 -1
  8. package/docs/KNOWN-ISSUES.md +8 -3
  9. package/docs/LIMITATIONS.md +6 -6
  10. package/docs/MIGRATION.md +8 -8
  11. package/docs/SCHEMA.md +29 -12
  12. package/package.json +1 -1
  13. package/packages/cli/dist/index.cjs +7135 -7481
  14. package/packages/cli/dist/index.cjs.map +1 -1
  15. package/packages/cli/dist/index.mjs +7135 -7481
  16. package/packages/cli/dist/index.mjs.map +1 -1
  17. package/packages/core/dist/advanced.cjs +2047 -26
  18. package/packages/core/dist/advanced.cjs.map +1 -1
  19. package/packages/core/dist/advanced.d.cts +346 -196
  20. package/packages/core/dist/advanced.d.ts +346 -196
  21. package/packages/core/dist/advanced.mjs +628 -5
  22. package/packages/core/dist/advanced.mjs.map +1 -1
  23. package/packages/core/dist/checks.d.cts +1 -1
  24. package/packages/core/dist/checks.d.ts +1 -1
  25. package/packages/core/dist/chunk-2ZXEMWGK.mjs +549 -0
  26. package/packages/core/dist/chunk-2ZXEMWGK.mjs.map +1 -0
  27. package/packages/core/dist/{chunk-57S5D6HR.mjs → chunk-4JVGFNQH.mjs} +50 -6
  28. package/packages/core/dist/chunk-4JVGFNQH.mjs.map +1 -0
  29. package/packages/core/dist/{chunk-6QSLZCBJ.mjs → chunk-A4V2H3YU.mjs} +329 -163
  30. package/packages/core/dist/chunk-A4V2H3YU.mjs.map +1 -0
  31. package/packages/core/dist/{chunk-74XZ6N7Q.mjs → chunk-IZBJAZGF.mjs} +12 -4
  32. package/packages/core/dist/chunk-IZBJAZGF.mjs.map +1 -0
  33. package/packages/core/dist/{chunk-VTIB5MDK.mjs → chunk-NQZPZ2FN.mjs} +15 -10
  34. package/packages/core/dist/chunk-NQZPZ2FN.mjs.map +1 -0
  35. package/packages/core/dist/{chunk-TZISEVLQ.mjs → chunk-XUNJMAPD.mjs} +3 -3
  36. package/packages/core/dist/{chunk-TZISEVLQ.mjs.map → chunk-XUNJMAPD.mjs.map} +1 -1
  37. package/packages/core/dist/context-CSKnzpXR.d.cts +177 -0
  38. package/packages/core/dist/context-yv2VSDQF.d.ts +177 -0
  39. package/packages/core/dist/diff.d.cts +2 -2
  40. package/packages/core/dist/diff.d.ts +2 -2
  41. package/packages/core/dist/diff.mjs +473 -3
  42. package/packages/core/dist/diff.mjs.map +1 -1
  43. package/packages/core/dist/exporters.cjs +691 -0
  44. package/packages/core/dist/exporters.cjs.map +1 -1
  45. package/packages/core/dist/exporters.d.cts +24 -3
  46. package/packages/core/dist/exporters.d.ts +24 -3
  47. package/packages/core/dist/exporters.mjs +1113 -3
  48. package/packages/core/dist/exporters.mjs.map +1 -1
  49. package/packages/core/dist/index.cjs +1385 -8168
  50. package/packages/core/dist/index.cjs.map +1 -1
  51. package/packages/core/dist/index.d.cts +8 -350
  52. package/packages/core/dist/index.d.ts +8 -350
  53. package/packages/core/dist/index.mjs +18 -1478
  54. package/packages/core/dist/index.mjs.map +1 -1
  55. package/packages/core/dist/{log-config-DanPV3P9.d.cts → log-config-8aE5Kxtr.d.cts} +1 -1
  56. package/packages/core/dist/{log-config-BPHS4Sds.d.ts → log-config-DVimQJho.d.ts} +1 -1
  57. package/packages/core/dist/logs.d.cts +2 -2
  58. package/packages/core/dist/logs.d.ts +2 -2
  59. package/packages/core/dist/logs.mjs +785 -2
  60. package/packages/core/dist/logs.mjs.map +1 -1
  61. package/packages/core/dist/{persisted-inspect-event-Cw7TeYGr.d.ts → persisted-inspect-event-D-WpXeZX.d.ts} +14 -5
  62. package/packages/core/dist/{persisted-inspect-event-DHPfzUd8.d.cts → persisted-inspect-event-DHcHPUKv.d.cts} +14 -5
  63. package/packages/core/dist/persisted.cjs +11 -1
  64. package/packages/core/dist/persisted.cjs.map +1 -1
  65. package/packages/core/dist/persisted.d.cts +4 -4
  66. package/packages/core/dist/persisted.d.ts +4 -4
  67. package/packages/core/dist/persisted.mjs +150 -3
  68. package/packages/core/dist/persisted.mjs.map +1 -1
  69. package/packages/core/dist/readers.cjs +27 -10
  70. package/packages/core/dist/readers.cjs.map +1 -1
  71. package/packages/core/dist/readers.d.cts +1 -1
  72. package/packages/core/dist/readers.d.ts +1 -1
  73. package/packages/core/dist/readers.mjs +1580 -4
  74. package/packages/core/dist/readers.mjs.map +1 -1
  75. package/packages/core/dist/{types-Ap9uMdx_.d.ts → types-D-Y1kOU-.d.ts} +2 -2
  76. package/packages/core/dist/{types-B2-BU5CS.d.cts → types-DgMN3qow.d.cts} +2 -2
  77. package/packages/core/dist/writers.cjs +49 -3
  78. package/packages/core/dist/writers.cjs.map +1 -1
  79. package/packages/core/dist/writers.d.cts +1 -1
  80. package/packages/core/dist/writers.d.ts +1 -1
  81. package/packages/core/dist/writers.mjs +341 -4
  82. package/packages/core/dist/writers.mjs.map +1 -1
  83. package/packages/core/dist/chunk-57S5D6HR.mjs.map +0 -1
  84. package/packages/core/dist/chunk-6QSLZCBJ.mjs.map +0 -1
  85. package/packages/core/dist/chunk-6SZPTECC.mjs +0 -342
  86. package/packages/core/dist/chunk-6SZPTECC.mjs.map +0 -1
  87. package/packages/core/dist/chunk-74XZ6N7Q.mjs.map +0 -1
  88. package/packages/core/dist/chunk-HR7G62IE.mjs +0 -785
  89. package/packages/core/dist/chunk-HR7G62IE.mjs.map +0 -1
  90. package/packages/core/dist/chunk-TFLPUZ56.mjs +0 -1571
  91. package/packages/core/dist/chunk-TFLPUZ56.mjs.map +0 -1
  92. package/packages/core/dist/chunk-U2BGPESY.mjs +0 -150
  93. package/packages/core/dist/chunk-U2BGPESY.mjs.map +0 -1
  94. package/packages/core/dist/chunk-VTIB5MDK.mjs.map +0 -1
  95. package/packages/core/dist/chunk-Y56BPA3B.mjs +0 -990
  96. package/packages/core/dist/chunk-Y56BPA3B.mjs.map +0 -1
  97. package/packages/core/dist/chunk-YWAOOXLR.mjs +0 -475
  98. package/packages/core/dist/chunk-YWAOOXLR.mjs.map +0 -1
package/docs/SCHEMA.md CHANGED
@@ -1,13 +1,14 @@
1
- # Schema (AgentInspect 1.x)
1
+ # Schema
2
2
 
3
- This document describes the **persisted manual trace JSONL schema** and the **log-derived normalized model** used by AgentInspect.
3
+ This document describes the **persisted AgentInspect JSONL schemas** and the **log-derived normalized model** used by AgentInspect.
4
4
 
5
5
  ## 1. Overview
6
6
 
7
7
  AgentInspect has two related (but distinct) data models:
8
8
 
9
9
  1. **Manual trace JSONL** (persisted): lines of `TraceEvent` written by `inspectRun()` / `step()`.
10
- 2. **Log-derived normalized model** (in-memory): `InspectEvent` / `InspectRunTree` built from structured logs or adapters.
10
+ 2. **Persisted InspectEvent JSONL** (persisted): schema 1.0 rows written by `createInspector()` / built-in writers and produced by explicit migration.
11
+ 3. **Log-derived normalized model** (in-memory): `InspectEvent` / `InspectRunTree` built from structured logs or adapters.
11
12
 
12
13
  Important: log-derived trees are **normalized views**, not the same persisted JSONL schema.
13
14
 
@@ -25,7 +26,7 @@ Manual trace events use:
25
26
 
26
27
  - **`schemaVersion: "0.1"`**
27
28
 
28
- Existing `0.1` traces remain readable across AgentInspect 1.x.
29
+ Existing `0.1` traces remain readable across AgentInspect major versions covered by this migration path.
29
30
 
30
31
  ### 2.3 TraceEvent union
31
32
 
@@ -153,13 +154,13 @@ Manual trace reading:
153
154
 
154
155
  ## 9. Backward compatibility
155
156
 
156
- - v0.1 JSONL traces remain readable across AgentInspect 1.x.
157
- - No automatic migrations or rewriting of old files.
157
+ - v0.1, v0.2, and v1.0 AgentInspect JSONL traces remain readable.
158
+ - No automatic migrations or rewriting of old files. Use `agent-inspect migrate <input> --to 1.0 --dry-run` first, then `--output <file>` for explicit conversion.
158
159
 
159
160
  ## 10. Breaking change policy
160
161
 
161
162
  - Breaking changes require a major version.
162
- - Stable v1.x policy: avoid removing stable fields/events; prefer additive extensions.
163
+ - Stable policy: avoid removing stable fields/events within a major version; prefer additive extensions.
163
164
 
164
165
  ## 11. Log-derived InspectEvent model
165
166
 
@@ -241,18 +242,34 @@ Canonical samples: `fixtures/traces-v0.2/*.jsonl` (validated by `pnpm fixtures:c
241
242
 
242
243
  Programmatic helpers: see [API.md](./API.md) §13 (experimental persisted-event foundation).
243
244
 
244
- ## 15. v1.6 local reader/writer compatibility
245
+ ## 15. Stable persisted InspectEvent schemaVersion "1.0"
245
246
 
246
- v1.6 adds experimental writer and reader surfaces without changing the stable manual trace schema:
247
+ Schema 1.0 is the v2 persisted InspectEvent contract. It evolves the v0.2 shape in place rather than introducing a third unrelated model.
248
+
249
+ | Topic | Rule |
250
+ | ----- | ---- |
251
+ | `schemaVersion` | `"1.0"` |
252
+ | Default writer target | `createInspector()` and built-in persisted writers emit schema 1.0 rows by default. |
253
+ | Manual helper compatibility | `inspectRun()` / `step()` global/manual tracing continues to write `schemaVersion: "0.1"` for compatibility. |
254
+ | Reader compatibility | AgentInspect readers accept v0.1, v0.2, v1.0, and mixed AgentInspect JSONL where safe, with warnings. |
255
+ | Unknown optional fields | Safe unknown optional fields on v1.0 rows are preserved where possible; unsupported fields are surfaced through warnings/diagnostics rather than fabricated into relationships. |
256
+ | Migration | `agent-inspect migrate <input> --to 1.0 --dry-run` is non-mutating; `--output <file>` writes a separate migrated file and refuses input overwrite. |
257
+
258
+ Canonical samples: `fixtures/traces-v1.0/*.jsonl` (validated by `pnpm fixtures:check`).
259
+
260
+ ## 16. Local reader/writer compatibility
261
+
262
+ Local writer and reader surfaces do not change the stable manual trace schema:
247
263
 
248
264
  - `inspectRun()` / `step()` continue to write `schemaVersion: "0.1"` JSONL by default.
249
- - `createInspector()` can write explicit v0.2 `PersistedInspectEvent` rows when configured with a writer such as `fileWriter()` or `bufferedFileWriter()`.
265
+ - `createInspector()` writes schema 1.0 `PersistedInspectEvent` rows when configured with a writer such as `fileWriter()` or `bufferedFileWriter()`.
250
266
  - `agent-inspect/readers` and `agent-inspect open` read local AgentInspect JSONL, OpenInference JSON, and OTLP JSON inputs through compatibility adapters.
251
267
  - OpenInference and OTLP JSON inputs are **not** a third AgentInspect persisted schema. They are local read formats normalized into inspection trees with warnings and unsupported-field reporting.
252
268
  - Reader and writer APIs perform no network upload and do not mutate source files.
253
269
  - v1.8 checks, safety verification, baseline comparison, safe CI artifacts, and reporter artifacts are report layers over existing trace inputs. They do not change manual trace writing, introduce a third persisted trace model, or embed raw prompt/output/request/response/header/tool payload content in their default structural outputs.
254
270
 
255
- ## 16. Migration notes
271
+ ## 17. Migration notes
256
272
 
257
273
  - Minor releases may add optional fields/events, but must keep existing v0.1 traces readable.
258
- - v0.1 → v0.2 write migration guides are future work. v1.x inspection readers are dual-format; the default manual writer remains v0.1.
274
+ - v0.1/v0.2v1.0 migration is explicit and local-only through `agent-inspect migrate`; automatic in-place rewrite remains out of scope.
275
+ - The default manual writer remains v0.1; the persisted writer/runtime path targets schema 1.0.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "1.9.0",
3
+ "version": "2.0.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Local-first execution-tree debugger for TypeScript AI agents",