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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 90fa75e: Release v2.0.0 with the stable root API contract, schema 1.0 persisted InspectEvent writer path, v0.1/v0.2/v1.0 reader compatibility, and explicit trace migration workflow.
8
+
3
9
  ## 1.9.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -22,7 +22,7 @@ agent-inspect gives those runs **structure**: an **execution tree** you can read
22
22
 
23
23
  ## Install
24
24
 
25
- Current npm release: **1.8.0** (`agent-inspect`, `@agent-inspect/ai-sdk`, `@agent-inspect/langchain`, `@agent-inspect/tui`, `@agent-inspect/openai-agents` all aligned).
25
+ Current npm release line: **1.9.x** for the existing public packages. The v2 contract work on `main` is unreleased until the release-readiness gate completes. `@agent-inspect/openai-agents` v1.9 publication recovery is a separate maintainer npm setup item and is not retried by the v2 train.
26
26
 
27
27
  ```bash
28
28
  npm install agent-inspect
@@ -194,6 +194,7 @@ Use the root import for stable beginner APIs:
194
194
 
195
195
  ```ts
196
196
  import {
197
+ createInspector,
197
198
  observe,
198
199
  inspectRun,
199
200
  maybeInspectRun,
@@ -212,7 +213,7 @@ import { diffTraceEvents } from "agent-inspect/diff";
212
213
  import { exportMarkdown } from "agent-inspect/exporters";
213
214
  import { parseLogsToTrees } from "agent-inspect/logs";
214
215
  import { traceEventsToPersistedInspectEvents } from "agent-inspect/persisted";
215
- import { createInspector } from "agent-inspect/advanced";
216
+ import { createInspectorRuntime } from "agent-inspect/advanced";
216
217
  ```
217
218
 
218
219
  **Env-gated tracing** (eval harnesses, CI): use `maybeInspectRun` and set `AGENT_INSPECT=1` when you want a trace — otherwise no files are written.
@@ -227,20 +228,22 @@ await maybeInspectRun("eval-case-42", async () => runAgent());
227
228
  AGENT_INSPECT=1 node eval-runner.mjs
228
229
  ```
229
230
 
230
- ## What you can do today (v1.8.0)
231
+ ## What you can do today
231
232
 
232
233
  - **Trace manually** with `inspectRun`, `step`, `step.llm`, `step.tool`, and `observe` — local JSONL under `.agent-inspect/` by default.
233
234
  - **Toggle tracing** with `maybeInspectRun` and `AGENT_INSPECT=1` in eval harnesses or CI.
235
+ - **Use an isolated inspector** with `createInspector()` and explicit local writers for tests/adapters.
234
236
  - **Correlate runs** with optional `correlationId`, `requestId`, `decisionId`, and `groupId` on `run_started` metadata.
235
237
  - **Redact before disk** with default key-based redaction, or choose `redactionProfile`: `local`, `share`, or `strict`.
236
- - **Inspect from the CLI** — `list`, `view`, `clean`, `logs`, `tail`, `export`, `open`, `diff`, `timeline`, `stats`, `search`, `what`, `report`.
238
+ - **Inspect from the CLI** — `list`, `view`, `clean`, `logs`, `tail`, `export`, `open`, `migrate`, `diff`, `timeline`, `stats`, `search`, `what`, `report`.
239
+ - **Migrate explicitly** with `agent-inspect migrate <trace.jsonl> --to 1.0 --dry-run` or `--output <file>`; originals are never overwritten by default.
237
240
  - **Export share-safe copies** — `export --redaction-profile share` (or `strict`) writes local Markdown/HTML/OpenInference/OTLP JSON only.
238
241
  - **Parse structured logs** you already emit (JSON first-class; log4js best-effort).
239
242
  - **Optional LangChain adapter** — metadata-only by default; optional `persist: true` and `stream: true` streaming metadata (no full token capture by default).
240
243
  - **Optional AI SDK adapter** — experimental `@agent-inspect/ai-sdk` telemetry integration for AI SDK v6; metadata-only by default with `recordInputs: false` and `recordOutputs: false`.
241
244
  - **Optional OpenAI Agents adapter** — experimental `@agent-inspect/openai-agents` trace processor for local OpenAI Agents JS trace processing.
242
245
  - **Optional TUI** — `view --tui` when `@agent-inspect/tui` is installed.
243
- - **Persisted-event foundation (v1.2.0+)** in-memory `PersistedInspectEvent` converters; manual writing stays `schemaVersion: "0.1"`.
246
+ - **Persisted-event foundation** — v0.1/v0.2/v1.0 AgentInspect JSONL remains readable; `createInspector()` and built-in writers use the schema 1.0 persisted path.
244
247
  - **Experimental subpaths** — `agent-inspect/readers`, `/writers`, `/checks`, `/diff`, `/exporters`, `/logs`, `/persisted`, and `/advanced` for advanced local workflows.
245
248
 
246
249
  Nothing uploads traces by default. Review exports before sharing — see [safe trace sharing](docs/SAFE-TRACE-SHARING.md).
@@ -292,6 +295,7 @@ More detail: [docs/LOGS.md](docs/LOGS.md) · [docs/LOG-TO-TREE-QUICKSTART.md](do
292
295
  | `tail` | Watch structured logs while the app runs |
293
296
  | `export` | Write Markdown / HTML / OpenInference-compatible JSON / OTLP JSON **locally** |
294
297
  | `open` | Read AgentInspect JSONL, OpenInference JSON, or OTLP JSON locally |
298
+ | `migrate` | Convert a local AgentInspect JSONL file to schema 1.0 with dry-run or explicit output |
295
299
  | `diff` | Compare two local runs (read-only) |
296
300
  | `timeline` | Chronological view of one run |
297
301
  | `stats` | Local aggregates over a trace directory |
@@ -316,15 +320,15 @@ Full flags and behavior: [docs/CLI.md](docs/CLI.md).
316
320
  - **Export** a run to Markdown for a PR, postmortem, or internal thread — use `--redaction-profile share` for share-safe copies, then review before sharing.
317
321
  - Keep traces **on disk** while still using enterprise observability elsewhere.
318
322
 
319
- ## Stable foundation (AgentInspect 1.x)
323
+ ## Stable foundation
320
324
 
321
- **agent-inspect 1.x** (current: **1.8.0**) is the **local-first trace workbench** for TypeScript AI agents:
325
+ AgentInspect is the **local-first trace workbench** for TypeScript AI agents:
322
326
 
323
327
  - Instrument runs with `inspectRun` and `step`
324
- - Write **local JSONL traces** (`schemaVersion: "0.1"` compatibility retained)
328
+ - Write and read **local JSONL traces** (`schemaVersion: "0.1"` manual traces remain readable; schema 1.0 persisted rows are the v2 writer target)
325
329
  - Inspect with **`list`**, **`view`**, **`clean`**, **`logs`**, **`tail`**, **`export`**, **`diff`**, **`timeline`**, **`stats`**, **`search`**
326
330
 
327
- **Stable APIs:** `inspectRun()`, `maybeInspectRun()`, `step()`, `step.llm()`, `step.tool()`, `observe()`, `getCurrentCorrelationMetadata()`.
331
+ **Stable root APIs:** `createInspector()`, `inspectRun()`, `maybeInspectRun()`, `step()`, `step.llm()`, `step.tool()`, `observe()`, `getCurrentCorrelationMetadata()`.
328
332
 
329
333
  Pass `enabled: false` to `inspectRun` for a no-trace passthrough. Use `maybeInspectRun` with `AGENT_INSPECT=1` to toggle tracing in eval or CI — see [docs/API.md](docs/API.md).
330
334
 
@@ -22,7 +22,7 @@ Executable shared assertions live in `packages/core/test/adapter-executable-conf
22
22
  | --- | --- | --- | --- | --- |
23
23
  | AI SDK | `@agent-inspect/ai-sdk` | implemented experimental; v1.8 correctness hardening pending | AI SDK telemetry integration | optional package peer dependency |
24
24
  | LangChain | `@agent-inspect/langchain` | implemented experimental | explicit callback | optional package peer dependency |
25
- | OpenAI Agents JS | `@agent-inspect/openai-agents` | implemented experimental; private until first publication gate | `setTraceProcessors()` replacement | optional package peer dependency |
25
+ | OpenAI Agents JS | `@agent-inspect/openai-agents` | implemented experimental; public package, with v1.9 publication recovery tracked separately | `setTraceProcessors()` replacement | optional package peer dependency |
26
26
  | LangGraph | `@agent-inspect/langchain` | fixture-backed through LangChain callback | explicit LangChain callback | existing LangChain adapter first |
27
27
 
28
28
  ## Required defaults
package/docs/API.md CHANGED
@@ -1,4 +1,4 @@
1
- # API (AgentInspect 1.x)
1
+ # API
2
2
 
3
3
  This document describes the **public TypeScript API surface** of AgentInspect and classifies each area as **stable** or **experimental**.
4
4
 
@@ -6,13 +6,14 @@ AgentInspect is a **local-first execution-tree debugger**. It is not a SaaS, not
6
6
 
7
7
  ## 1. Stability policy
8
8
 
9
- - **Stable**: intended to be compatible across v1.x. Breaking changes require v2.0.
10
- - **Experimental**: available for adoption, but subject to refinement (including naming/shape changes) before a future stability declaration. Experimental APIs may change in v1.x.
9
+ - **Stable**: intended to stay compatible within the current major version.
10
+ - **Experimental**: available for adoption, but subject to refinement (including naming/shape changes) before a future stability declaration.
11
11
 
12
12
  Use the root import for stable beginner APIs. Use subpaths for advanced, experimental, or lower-level workflows.
13
13
 
14
14
  ```ts
15
15
  import {
16
+ createInspector,
16
17
  observe,
17
18
  inspectRun,
18
19
  maybeInspectRun,
@@ -21,7 +22,7 @@ import {
21
22
  } from "agent-inspect";
22
23
  ```
23
24
 
24
- **v1.9 root API direction:** do not add new root exports casually. Existing root imports keep working through v1.x for compatibility, but new advanced examples should use the subpath where the API lives. The intended stable root set for v2 is:
25
+ **v2 root API contract:** do not add new root exports casually. Advanced, experimental, and lower-level helpers belong on the subpath where the API lives. The stable root value set is:
25
26
 
26
27
  ```ts
27
28
  import {
@@ -34,7 +35,7 @@ import {
34
35
  } from "agent-inspect";
35
36
  ```
36
37
 
37
- **1.x subpath exports:** Additive subpaths (`/logs`, `/exporters`, `/persisted`, `/diff`, `/advanced`, `/writers`, `/readers`, `/checks`) narrow the import surface for experimental and advanced APIs. Root `"."` imports remain valid through v1.x. Design: [API-BOUNDARY-V1.5.md](./implementation/API-BOUNDARY-V1.5.md).
38
+ **Subpath exports:** Subpaths (`/logs`, `/exporters`, `/persisted`, `/diff`, `/advanced`, `/writers`, `/readers`, `/checks`) narrow the import surface for experimental and advanced APIs. Design history: [API-BOUNDARY-V1.5.md](./implementation/API-BOUNDARY-V1.5.md).
38
39
 
39
40
  ```ts
40
41
  import { parseLogsToTrees } from "agent-inspect/logs";
@@ -44,15 +45,15 @@ import { openTrace } from "agent-inspect/readers";
44
45
  import { runTraceChecks } from "agent-inspect/checks";
45
46
  import { diffTraceEvents } from "agent-inspect/diff";
46
47
  import { traceEventsToPersistedInspectEvents } from "agent-inspect/persisted";
47
- import { createInspector } from "agent-inspect/advanced";
48
+ import { createInspectorRuntime } from "agent-inspect/advanced";
48
49
  ```
49
50
 
50
51
  Notes:
51
52
 
52
- - The core guarantee of v1.x is **stable local debugging**: manual tracing + CLI inspection.
53
+ - The core guarantee is **stable local debugging**: manual tracing + CLI inspection.
53
54
  - Export formats (OpenInference / OTLP JSON) are **local-only** and **compatibility-oriented**. They do **not** upload anywhere.
54
- - There are **zero production sinks** in v1.x; sink/uploader APIs are not stable.
55
- - Advanced root exports in v1.x are compatibility aliases. Prefer `agent-inspect/advanced`, `agent-inspect/readers`, `agent-inspect/writers`, `agent-inspect/checks`, `agent-inspect/diff`, `agent-inspect/exporters`, `agent-inspect/logs`, and `agent-inspect/persisted` for new code.
55
+ - There are **zero production sinks**; sink/uploader APIs are not stable.
56
+ - Advanced APIs are available from `agent-inspect/advanced`, `agent-inspect/readers`, `agent-inspect/writers`, `agent-inspect/checks`, `agent-inspect/diff`, `agent-inspect/exporters`, `agent-inspect/logs`, and `agent-inspect/persisted`.
56
57
 
57
58
  ## 2. Stable core APIs (manual tracing)
58
59
 
@@ -78,14 +79,14 @@ import {
78
79
  - **`maxEventBytes`**: max UTF-8 bytes per serialized JSONL event (default `65536`). Oversized events are truncated; instrumentation never throws into user code.
79
80
  - **Correlation metadata (v1.3.0+):** optional `correlationId`, `requestId`, `decisionId`, and `groupId` strings. When set, they are written on `run_started.metadata` (not on every step). Top-level correlation options override the same keys in `options.metadata`. Useful for eval cases, CI job IDs, request tracing, and `stats --correlation-id` / `--group-id`. They are **metadata only** — they do not replace `runId`. Treat sensitive IDs as trace data before sharing exports.
80
81
  - **`maybeInspectRun(name, fn, options?)`**: same as `inspectRun` when tracing is enabled; otherwise passthrough. Enablement: explicit **`options.enabled`** wins; when omitted, reads **`AGENT_INSPECT`** (`1`, `true`, `yes`, `on`, `enabled` — case-insensitive). Unset or other values disable tracing. Use in eval harnesses, CI, or jobs where tracing should be toggled by environment.
81
- - **`isAgentInspectEnabled(value?)`**: returns whether a string (or `process.env.AGENT_INSPECT`) matches an enable token.
82
+ - **`isAgentInspectEnabled(value?)`**: advanced helper available from `agent-inspect/advanced`; returns whether a string (or `process.env.AGENT_INSPECT`) matches an enable token.
82
83
  - **`step(name, fn, options?)`**: traces a named unit of work inside `inspectRun` (`step_started` / `step_completed`). Step `metadata` inherits the parent run's redaction and size-bound settings.
83
84
  - **`step.llm(model, fn)`**: convenience wrapper (`type: "llm"`, `metadata.model`).
84
85
  - **`step.tool(toolName, fn)`**: convenience wrapper (`type: "tool"`, `metadata.toolName`).
85
86
  - **`observe(agent, options?)`**: proxy wrapper that traces top-level `run` / `execute` / `invoke` methods via `inspectRun`.
86
87
  - **`getCurrentCorrelationMetadata()`**: returns active run correlation fields (`correlationId`, `requestId`, `decisionId`, `groupId`) inside `inspectRun` / `maybeInspectRun`; `undefined` outside a traced run or when none were set.
87
88
  - **`RedactionProfile`**: `"local" | "share" | "strict"` — see `redactionProfile` on `InspectRunOptions` and `ExportOptions`.
88
- - **`resolveRedactionProfile(profile?)`**: resolves profile extra keys and metadata caps (for advanced integrations).
89
+ - **`resolveRedactionProfile(profile?)`**: advanced helper available from `agent-inspect/advanced`; resolves profile extra keys and metadata caps for integrations.
89
90
 
90
91
  ## 3. Stable local inspection APIs
91
92
 
@@ -328,29 +329,29 @@ The processor records local v0.2 persisted events for trace/run, agent, generati
328
329
 
329
330
  ## 15. Experimental persisted-event foundation (v1.2.0)
330
331
 
331
- These helpers expose the **source-agnostic `PersistedInspectEvent` model** (`schemaVersion: "0.2"`). They are **local-only**, **in-memory**, and **do not change** storage write/read or CLI behavior in v1.2.0.
332
+ These helpers expose the **source-agnostic `PersistedInspectEvent` model**. They are **local-only** and support v0.2 compatibility plus the stable schema 1.0 persisted contract.
332
333
 
333
334
  Import from `agent-inspect/persisted`:
334
335
 
335
336
  | API | Role |
336
337
  | --- | ---- |
337
- | `isPersistedInspectEvent` | Runtime validator for v0.2 persisted events |
338
+ | `isPersistedInspectEvent` | Runtime validator for supported persisted events |
338
339
  | `traceEventToPersistedInspectEvent` | Convert one v0.1 `TraceEvent` |
339
340
  | `traceEventsToPersistedInspectEvents` | Batch v0.1 → v0.2 |
340
341
  | `inspectEventToPersistedInspectEvent` | Convert one in-memory `InspectEvent` |
341
- | `inspectEventsToPersistedInspectEvents` | Batch `InspectEvent` → v0.2 |
342
- | `persistedInspectEventToInspectEvent` | Convert one v0.2 event to `InspectEvent` |
343
- | `persistedInspectEventsToInspectEvents` | Batch v0.2 → `InspectEvent` |
344
- | `persistedInspectEventsToRunTrees` | Build `InspectRunTree[]` from v0.2 events (via `TreeBuilder`) |
342
+ | `inspectEventsToPersistedInspectEvents` | Batch `InspectEvent` → persisted events |
343
+ | `persistedInspectEventToInspectEvent` | Convert one persisted event to `InspectEvent` |
344
+ | `persistedInspectEventsToInspectEvents` | Batch persisted events → `InspectEvent` |
345
+ | `persistedInspectEventsToRunTrees` | Build `InspectRunTree[]` from persisted events (via `TreeBuilder`) |
345
346
  | `traceEventsToPersistedRunTrees` | v0.1 `TraceEvent[]` → persisted model → trees |
346
347
 
347
348
  Related types: `PersistedInspectEvent`, `PersistedEventSourceType`, `PersistedEventStatus`, `TraceEventToPersistedOptions`, `InspectEventToPersistedOptions`, `PersistedToInspectEventOptions`, `PersistedTreeBridgeOptions`.
348
349
 
349
350
  **Notes:**
350
351
 
351
- - Manual trace **writing** remains `schemaVersion: "0.1"`.
352
- - v0.2 is **not written by default**; use converters and `fixtures/traces-v0.2/` samples for validation.
353
- - Inspection read paths normalize v0.1 and v0.2 JSONL for local CLI/API use. v0.2 remains experimental as a persisted-event foundation and is not the default writer.
352
+ - Manual global trace **writing** remains `schemaVersion: "0.1"`.
353
+ - `createInspector()` and built-in persisted writer paths target schema 1.0 rows.
354
+ - Inspection read paths normalize v0.1, v0.2, and v1.0 JSONL for local CLI/API use. v0.2 remains a compatibility foundation.
354
355
 
355
356
  ## 16. Local observability helpers (v1.4.0+)
356
357
 
@@ -373,7 +374,7 @@ Report redaction profiles are key-based safeguards applied to the complete rende
373
374
 
374
375
  ## 18. Experimental trace writers (v1.6)
375
376
 
376
- Trace writers are the first slice of the v1.6 runtime foundation. They are experimental during v1.x and intended for tests, adapters, and future `createInspector` work.
377
+ Trace writers are the local persistence contract for tests, adapters, and `createInspector()` workflows.
377
378
 
378
379
  Import from `agent-inspect/writers`:
379
380
 
@@ -395,7 +396,7 @@ import type {
395
396
  ```
396
397
 
397
398
  - **`TraceWriter`**: async `write(event)`, optional `flush()`, optional `close()`, optional `getStats()`.
398
- - **`fileWriter({ dir?, filePath? })`**: appends v0.2 `PersistedInspectEvent` JSONL rows to local disk. By default it derives one file per `event.runId`; `filePath` writes all events to an explicit local file. Filesystem and serialization failures are reflected in writer stats instead of being thrown into application code.
399
+ - **`fileWriter({ dir?, filePath? })`**: appends `PersistedInspectEvent` JSONL rows to local disk. `createInspector()` emits schema 1.0 rows by default; compatibility adapters may still pass readable v0.2 rows. By default it derives one file per `event.runId`; `filePath` writes all events to an explicit local file. Filesystem and serialization failures are reflected in writer stats instead of being thrown into application code.
399
400
  - **`bufferedFileWriter({ dir?, filePath?, maxQueueSize?, flushIntervalMs?, maxBatchSize?, overflow? })`**: buffers local JSONL writes with bounded queue behavior. Overflow supports `drop-oldest` and `drop-newest`; neither mode throws into application code.
400
401
  - **`compositeWriter([...writers])`**: fans out events to multiple explicit local/custom writers. A failing child writer does not prevent other children from receiving events; failures are reflected in composite stats.
401
402
  - **`memoryWriter()`**: stores cloned `PersistedInspectEvent` rows in memory for tests, adapter fixtures, and eval harnesses.
@@ -405,12 +406,12 @@ No network writer or vendor sink exists in this package.
405
406
 
406
407
  ## 19. Experimental inspector API/runtime (v1.6)
407
408
 
408
- `createInspector()` is the experimental public instance API for local-first tracing with explicit writers. It owns an instance-specific runtime context, records v0.2 persisted inspect events, preserves application return values/errors, and exposes diagnostics plus deterministic `flush()`/`close()` lifecycle hooks.
409
+ `createInspector()` is the public instance API for local-first tracing with explicit writers. It owns an instance-specific runtime context, records schema 1.0 persisted inspect events, preserves application return values/errors, and exposes diagnostics plus deterministic `flush()`/`close()` lifecycle hooks.
409
410
 
410
- Import from `agent-inspect/advanced`:
411
+ Import from `agent-inspect`:
411
412
 
412
413
  ```ts
413
- import { createInspector } from "agent-inspect/advanced";
414
+ import { createInspector } from "agent-inspect";
414
415
  import { memoryWriter } from "agent-inspect/writers";
415
416
 
416
417
  const writer = memoryWriter();
@@ -441,9 +442,9 @@ Public methods:
441
442
 
442
443
  `traceDir` and `silent` on `createInspector()` are context metadata for compatibility with existing helpers. They do not configure persistence or terminal output. Prefer writer-owned output configuration such as `fileWriter({ dir })` or `fileWriter({ filePath })`.
443
444
 
444
- `createInspectorRuntime()` is also available from `agent-inspect/advanced` as the low-level isolation primitive. Most users should prefer `createInspector()` and `inspector.getDiagnostics()`. Root exports for the runtime remain available for 1.x compatibility, but new advanced usage should import from `agent-inspect/advanced`.
445
+ `createInspectorRuntime()` is available from `agent-inspect/advanced` as the low-level isolation primitive. Most users should prefer `createInspector()` and `inspector.getDiagnostics()`.
445
446
 
446
- These APIs are experimental during v1.x. They do not add a default network writer or vendor sink.
447
+ The low-level runtime helpers remain on `agent-inspect/advanced`. These APIs do not add a default network writer or vendor sink.
447
448
 
448
449
  ## 20. Experimental trace readers (v1.6)
449
450
 
@@ -503,7 +504,7 @@ Recipes: [deterministic-ci-checks](../examples/recipes/deterministic-ci-checks/R
503
504
  Import from `agent-inspect`:
504
505
 
505
506
  ```ts
506
- import { buildLocalExplanation } from "agent-inspect";
507
+ import { buildLocalExplanation } from "agent-inspect/advanced";
507
508
  ```
508
509
 
509
510
  - **`buildLocalExplanation(run, options?)`**:
@@ -553,7 +554,7 @@ No deprecated APIs are declared as of 1.4.0.
553
554
 
554
555
  ## 25. Removal / deprecation policy
555
556
 
556
- - Stable APIs are not removed in v1.x.
557
+ - Stable APIs are not removed within the current major version.
557
558
  - If removal is necessary, the API should be **deprecated** first, documented, and kept for a reasonable window (target: at least one minor line) unless security requires faster action.
558
559
 
559
560
  ## 26. Backward compatibility policy
package/docs/CLI.md CHANGED
@@ -1,4 +1,4 @@
1
- # CLI (AgentInspect 1.x)
1
+ # CLI
2
2
 
3
3
  This document describes the **stable CLI surface** of AgentInspect.
4
4
 
@@ -26,6 +26,7 @@ Core commands:
26
26
  - `tail` — live-tail logs into updating local trees
27
27
  - `export` — export manual traces to Markdown/HTML/OpenInference/OTLP JSON (local only)
28
28
  - `open` — read supported local trace files, directories, or stdin through the canonical reader pipeline
29
+ - `migrate` — convert one local AgentInspect JSONL file to schema 1.0 with dry-run or explicit output
29
30
  - `check` — run deterministic local trace checks with stable JSON and exit codes
30
31
  - `scan` — best-effort local safety scan for trace capture risks
31
32
  - `verify-safe` — best-effort local trace safety verification
@@ -243,7 +244,36 @@ cat packages/core/test/fixtures/openinference-basic.json | npx agent-inspect ope
243
244
 
244
245
  When a directory or payload contains multiple runs, `open` lists the run ids and exits until you pass `--run <run-id>`.
245
246
 
246
- ### 6.8 `check`
247
+ ### 6.8 `migrate`
248
+
249
+ Convert one local AgentInspect JSONL trace file to the stable schema 1.0 persisted contract. This command is local and non-destructive by default: it does not upload traces, run agents, mutate the input file, or overwrite originals.
250
+
251
+ ```bash
252
+ agent-inspect migrate <input.jsonl> --to 1.0 --dry-run
253
+ agent-inspect migrate <input.jsonl> --to 1.0 --output <output.jsonl>
254
+ ```
255
+
256
+ Options:
257
+
258
+ - `--to 1.0`: required target schema version
259
+ - `--dry-run`: print deterministic counts and warnings without writing output
260
+ - `-o, --output <path>`: write migrated schema 1.0 JSONL to a separate file
261
+ - `--force`: accepted only for explicit output validation; input overwrite is still refused
262
+
263
+ Input support:
264
+
265
+ - v0.1 manual trace rows are converted to schema 1.0 persisted rows.
266
+ - v0.2 and v1.0 persisted rows are preserved/upgraded through the shared persisted contract.
267
+ - malformed JSON and unsupported schema rows are reported as line warnings.
268
+
269
+ Examples:
270
+
271
+ ```bash
272
+ npx agent-inspect migrate fixtures/traces/minimal-success.jsonl --to 1.0 --dry-run
273
+ npx agent-inspect migrate fixtures/traces/minimal-success.jsonl --to 1.0 --output fixtures/traces/minimal-success.v1.jsonl
274
+ ```
275
+
276
+ ### 6.9 `check`
247
277
 
248
278
  Run deterministic checks against a local trace. This command is local and read-only: it does not rerun agents, call models, upload traces, or mutate input files.
249
279
 
@@ -292,7 +322,7 @@ npx agent-inspect check trace.jsonl --max-duration-ms 30000 --required-tool sear
292
322
 
293
323
  Recipe: [examples/recipes/deterministic-ci-checks](../examples/recipes/deterministic-ci-checks/README.md)
294
324
 
295
- ### 6.9 `scan` and `verify-safe`
325
+ ### 6.10 `scan` and `verify-safe`
296
326
 
297
327
  Run best-effort local safety verification for supported trace inputs. These commands are local and read-only: they do not rerun agents, call models, upload traces, mutate input files, or certify compliance.
298
328
 
@@ -331,7 +361,7 @@ npx agent-inspect verify-safe minimal-success --dir fixtures/traces
331
361
  npx agent-inspect verify-safe trace.jsonl --max-string-length 8192 --json
332
362
  ```
333
363
 
334
- ### 6.10 `artifacts`
364
+ ### 6.11 `artifacts`
335
365
 
336
366
  Create deterministic local CI artifacts for supported trace inputs. This command is local and read-only for trace inputs: it does not rerun agents, call models, upload files, use GitHub APIs, or mutate repository state. It writes only to `--output-dir` and, when requested, a local step-summary file.
337
367
 
@@ -371,7 +401,7 @@ npx agent-inspect artifacts candidate.jsonl --baseline baseline.jsonl --output-d
371
401
 
372
402
  Recipe and sample workflow: [examples/recipes/deterministic-ci-checks](../examples/recipes/deterministic-ci-checks/README.md)
373
403
 
374
- ### 6.11 `diff`
404
+ ### 6.12 `diff`
375
405
 
376
406
  Compare two manual trace runs. Diff is **local** and **read-only** (does not rerun agents).
377
407
 
@@ -435,7 +465,7 @@ Differences:
435
465
 
436
466
  More examples, including timing-only and structure-only diffs, are in `docs/DIFF.md`.
437
467
 
438
- ### 6.12 `timeline`
468
+ ### 6.13 `timeline`
439
469
 
440
470
  Chronological step list for one manual trace. Read-only; does not mutate JSONL files.
441
471
 
@@ -451,7 +481,7 @@ Options:
451
481
 
452
482
  ![Timeline with slow-step focus](../assets/demos/timeline.gif)
453
483
 
454
- ### 6.13 `stats`
484
+ ### 6.14 `stats`
455
485
 
456
486
  Local aggregate statistics over trace files in a directory. Read-only.
457
487
 
@@ -471,7 +501,7 @@ Options:
471
501
 
472
502
  Use `--correlation-id` or `--group-id` to filter runs by `run_started` metadata (see [API.md](./API.md)).
473
503
 
474
- ### 6.14 `search`
504
+ ### 6.15 `search`
475
505
 
476
506
  Deterministic search over local traces (substring / exact filters). No semantic search.
477
507
 
@@ -501,7 +531,7 @@ npx agent-inspect search --duration ">100ms" --json
501
531
 
502
532
  ![Search traces by status error](../assets/demos/search.gif)
503
533
 
504
- ### 6.15 `what`
534
+ ### 6.16 `what`
505
535
 
506
536
  Concise human-readable summary of one local trace run. Read-only; accepts v0.1 manual JSONL and v0.2 persisted-event JSONL through the shared dual-format normalization path. Vocabulary: [TRACE-VOCABULARY-V1.5.md](./proposals/TRACE-VOCABULARY-V1.5.md).
507
537
 
@@ -530,7 +560,7 @@ Outcome: Completed successfully.
530
560
  Slowest: plan (100ms, logic)
531
561
  ```
532
562
 
533
- ### 6.16 `report`
563
+ ### 6.17 `report`
534
564
 
535
565
  Generate a local inspection report combining **what happened**, **timeline**, and **execution tree** sections. The command reads local v0.1 manual JSONL and v0.2 persisted-event JSONL through the shared dual-format normalization path without mutating them. Distinct from `export` (which targets shareable tree snapshots and standards formats).
536
566
 
@@ -555,7 +585,7 @@ Example:
555
585
  npx agent-inspect report minimal-success --dir fixtures/traces --format html -o report.html
556
586
  ```
557
587
 
558
- ### 6.17 `explain`
588
+ ### 6.18 `explain`
559
589
 
560
590
  Explain a local trace using deterministic facts and local inference labels. This command reads through the same local reader pipeline as `open` / `check`; it does not call a model provider, upload traces, replay agents, or mutate input files.
561
591
 
package/docs/EXPORTS.md CHANGED
@@ -75,7 +75,7 @@ Experimental helpers (local-only):
75
75
  - `exportMarkdown`, `exportHtml`, `exportOpenInference`, `exportOtlpJson`
76
76
  - `validateExport`, `validateExportContent`
77
77
 
78
- See [API.md](./API.md) §7.
78
+ Import these from `agent-inspect/exporters`. See [API.md](./API.md) §7.
79
79
 
80
80
  ## What not to share
81
81
 
@@ -70,6 +70,7 @@ Use the root import for stable beginner APIs:
70
70
 
71
71
  ```ts
72
72
  import {
73
+ createInspector,
73
74
  observe,
74
75
  inspectRun,
75
76
  maybeInspectRun,
@@ -88,7 +89,7 @@ import { diffTraceEvents } from "agent-inspect/diff";
88
89
  import { exportMarkdown } from "agent-inspect/exporters";
89
90
  import { parseLogsToTrees } from "agent-inspect/logs";
90
91
  import { traceEventsToPersistedInspectEvents } from "agent-inspect/persisted";
91
- import { createInspector } from "agent-inspect/advanced";
92
+ import { createInspectorRuntime } from "agent-inspect/advanced";
92
93
  ```
93
94
 
94
95
  ### Always trace vs env-gated tracing
@@ -23,7 +23,7 @@ AgentInspect is **local-first** and **CLI-first**. These behaviors are intention
23
23
 
24
24
  - **Vendor sinks** (hosted dashboards, Langfuse/Braintrust/New Relic/Datadog native uploads, OTLP gRPC streaming, etc.) are **not implemented** in the core packages described here.
25
25
  - **AI SDK adapter** (`@agent-inspect/ai-sdk`) is experimental and metadata-first. It depends on explicit AI SDK telemetry configuration and requires `recordInputs: false` / `recordOutputs: false` for the documented safe path.
26
- - **OpenAI Agents JS adapter** (`@agent-inspect/openai-agents`) is experimental and remains private/unpublished until the v1.8 first-publication gate. Runtime metadata mapping is local-only; the safe install path is `setTraceProcessors()` rather than `addTraceProcessor()`.
26
+ - **OpenAI Agents JS adapter** (`@agent-inspect/openai-agents`) is experimental and metadata-first. Runtime metadata mapping is local-only; the safe install path is `setTraceProcessors()` rather than `addTraceProcessor()`. The v1.9 package publication retry is pending maintainer-side npm auto-publish setup and is separate from v2 contract work.
27
27
  - **LangGraph support** is currently a documented boundary through `@agent-inspect/langchain`, not a dedicated package.
28
28
  - **LangChain adapter** captures **metadata-oriented** signals by default; it does not replace full framework observability.
29
29
  - **LangChain `stream: true`** records chunk counts and timing only — not a full token replay. Per-token JSONL events are not emitted.
@@ -93,9 +93,14 @@ pnpm compat:smoke
93
93
  - Fixture pattern: [test/consumer-fixtures/jest-cjs/](../../test/consumer-fixtures/jest-cjs/).
94
94
  - Full Jest runner smoke in CI is a documented follow-up — root package does not ship Jest as a devDependency.
95
95
 
96
- ## v1.8 pre-release adoption notes
96
+ ## v2 migration notes
97
+
98
+ - Advanced APIs no longer live on the root import in the v2 contract. Use `agent-inspect/readers`, `/writers`, `/checks`, `/diff`, `/exporters`, `/logs`, `/persisted`, and `/advanced`.
99
+ - The small root value API is `createInspector`, `inspectRun`, `maybeInspectRun`, `step`, `observe`, and `getCurrentCorrelationMetadata`.
100
+ - Use `agent-inspect migrate <trace.jsonl> --to 1.0 --dry-run` before writing migrated output. The command does not rewrite input files.
101
+
102
+ ## v1.8/v1.9 adoption notes
97
103
 
98
- - `@agent-inspect/vitest` and `@agent-inspect/jest` are private/unpublished until the v1.8 release-readiness gate completes. The [test reporter artifact recipe](../examples/recipes/test-reporter-artifacts/README.md) documents the intended config shape without requiring those packages.
99
104
  - `agent-inspect artifacts --github-summary` writes a local step-summary file only. It does not call GitHub APIs, open PR comments, upload artifacts, or mutate repository state.
100
105
  - Baseline checks compare normalized structural facts from explicit candidate and baseline inputs. They are useful for CI regression evidence, not replay or semantic eval scoring.
101
106
 
@@ -15,13 +15,13 @@ This document states what AgentInspect **does not** provide today. It complement
15
15
 
16
16
  ## Persisted event model (v1.2.0 foundation)
17
17
 
18
- - **v0.2 is not the default persisted trace file format.** `inspectRun()` / `step()` still write `schemaVersion: "0.1"` JSONL.
19
- - **Dual-format inspection is a read path, not a write migration.** `list`, `view`, `timeline`, `stats`, `search`, `diff`, `export`, `what`, and `report` read v0.1/v0.2 trace files through normalization where applicable. `logs` and `tail` remain structured-log ingestion commands, not v0.2 writers.
20
- - **Default write path remains v0.1.** v0.2 fixtures and converters are available for adapters and migration testing, but AgentInspect does not automatically rewrite traces.
18
+ - **Manual global tracing remains v0.1.** `inspectRun()` / `step()` still write `schemaVersion: "0.1"` JSONL for compatibility.
19
+ - **Persisted writer/runtime output targets schema 1.0.** `createInspector()` with built-in writers emits schema 1.0 persisted rows; v0.2 remains a readable compatibility foundation.
20
+ - **Migration is explicit, not automatic.** `agent-inspect migrate <input> --to 1.0 --dry-run` reports what would change, and `--output <file>` writes a separate file. AgentInspect does not rewrite old traces in place.
21
21
 
22
22
  ## Runtime writers and universal readers (v1.6)
23
23
 
24
- - **Experimental APIs:** `agent-inspect/writers`, `agent-inspect/readers`, and `createInspector()` are available for local adoption, but their experimental contracts may be refined in v1.x.
24
+ - **Subpath APIs:** `agent-inspect/writers`, `agent-inspect/readers`, and advanced helpers are available for local adoption from their owning subpaths. `createInspector()` is part of the small root API.
25
25
  - **Explicit writer ownership:** `createInspector()` does not print terminal lifecycle output or implicitly choose a disk writer. Use `fileWriter()` / `bufferedFileWriter()` / custom writers when persistence is desired.
26
26
  - **No standards upload:** OpenInference and OTLP JSON support is local read/export compatibility only. There is no OTLP gRPC/HTTP streaming sink, collector client, or hosted ingestion behavior.
27
27
  - **Conservative detection:** `agent-inspect open` does not silently accept arbitrary JSON. Unsupported or ambiguous inputs produce errors/warnings rather than guessed traces.
@@ -31,7 +31,7 @@ This document states what AgentInspect **does not** provide today. It complement
31
31
 
32
32
  - **AI SDK integration is explicit telemetry wiring.** Use `@agent-inspect/ai-sdk` through AI SDK `experimental_telemetry.integrations`; AgentInspect does not wrap providers, patch fetch, or enable telemetry globally.
33
33
  - **AI SDK privacy settings are caller-owned.** Examples set `recordInputs: false` and `recordOutputs: false`; leaving those enabled in user code can cause the AI SDK telemetry layer to include richer data before AgentInspect receives events.
34
- - **OpenAI Agents JS support is experimental and not published yet.** `@agent-inspect/openai-agents` maps metadata-only runtime spans through the safe `setTraceProcessors()` boundary, remains private until the v1.8 first-publication gate, and does not capture raw payloads by default.
34
+ - **OpenAI Agents JS support is experimental.** `@agent-inspect/openai-agents` maps metadata-only runtime spans through the safe `setTraceProcessors()` boundary and does not capture raw payloads by default. The v1.9 package publication retry is a separate maintainer npm automation task, not part of the v2 contract work.
35
35
  - **LangGraph support is a boundary decision, not a separate package.** Initial support is expected through `@agent-inspect/langchain` callbacks unless no-network fixtures prove a separate package is needed.
36
36
  - **No root/core adapter dependencies.** AI SDK, OpenAI Agents, LangGraph, OpenTelemetry, and LangChain remain outside the root/core runtime dependency graph.
37
37
 
@@ -58,7 +58,7 @@ This document states what AgentInspect **does not** provide today. It complement
58
58
 
59
59
  - **Checks are deterministic local rules, not compliance certification.** `check`, `scan`, and `verify-safe` surface bounded findings and diagnostics over supported local inputs; they do not prove a trace is safe for every sharing context.
60
60
  - **Safe CI artifacts are structural summaries.** They avoid raw prompt/output/request/response/header/tool payload content by default, but teams should still review generated files before sharing.
61
- - **Vitest/Jest reporters are optional and unpublished until release readiness in the v1.8 train.** The recipes document config patterns and explicit associations; consumers should install the packages only after publication.
61
+ - **Vitest/Jest reporters are optional package surfaces.** Recipes document config patterns and explicit associations; package publication is controlled by release readiness and maintainer authorization.
62
62
 
63
63
  ## Execution semantics
64
64
 
package/docs/MIGRATION.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Migration
2
2
 
3
- AgentInspect 1.x keeps existing global APIs and published imports working. Manual trace writing remains `schemaVersion: "0.1"`, and v0.1/v0.2 traces remain readable.
3
+ AgentInspect keeps stable global APIs and published imports working within each major version. Manual trace writing remains `schemaVersion: "0.1"` where documented, and v0.1/v0.2 traces remain readable.
4
4
 
5
5
  ## From older 1.x docs
6
6
 
@@ -17,6 +17,7 @@ Use the root import for stable beginner APIs:
17
17
 
18
18
  ```ts
19
19
  import {
20
+ createInspector,
20
21
  observe,
21
22
  inspectRun,
22
23
  maybeInspectRun,
@@ -35,17 +36,16 @@ import { diffTraceEvents } from "agent-inspect/diff";
35
36
  import { exportMarkdown } from "agent-inspect/exporters";
36
37
  import { parseLogsToTrees } from "agent-inspect/logs";
37
38
  import { traceEventsToPersistedInspectEvents } from "agent-inspect/persisted";
38
- import { createInspector } from "agent-inspect/advanced";
39
+ import { createInspectorRuntime } from "agent-inspect/advanced";
39
40
  ```
40
41
 
41
- ## v2 import preparation
42
+ ## Root and subpath imports
42
43
 
43
- No import changes are required for v1.x. To prepare for v2, keep beginner workflow APIs at the root and move advanced usage to subpaths now.
44
+ Keep beginner workflow APIs at the root and move advanced usage to subpaths.
44
45
 
45
- | 1.x root compatibility import | Preferred 1.x import for new code | v2 direction |
46
+ | API area | Preferred import | Direction |
46
47
  | --- | --- | --- |
47
- | `inspectRun`, `maybeInspectRun`, `step`, `observe`, `getCurrentCorrelationMetadata` | `agent-inspect` | stays root |
48
- | `createInspector` | `agent-inspect/advanced` | likely root and `/advanced` |
48
+ | `inspectRun`, `maybeInspectRun`, `step`, `observe`, `getCurrentCorrelationMetadata`, `createInspector` | `agent-inspect` | stays root |
49
49
  | `createInspectorRuntime` | `agent-inspect/advanced` | `/advanced` |
50
50
  | `openTrace`, `readTrace`, `detectTraceFormat` | `agent-inspect/readers` | `/readers` |
51
51
  | `memoryWriter`, `fileWriter`, `bufferedFileWriter`, `compositeWriter`, `nullWriter` | `agent-inspect/writers` | `/writers` |
@@ -61,7 +61,7 @@ Nothing uploads by default. Manual metadata is redacted before disk by default,
61
61
 
62
62
  ## Compatibility notes
63
63
 
64
- - Existing `inspectRun`, `maybeInspectRun`, `step`, `step.llm`, `step.tool`, `observe`, and `getCurrentCorrelationMetadata` imports remain valid.
64
+ - Existing `inspectRun`, `maybeInspectRun`, `step`, `step.llm`, `step.tool`, `observe`, `getCurrentCorrelationMetadata`, and `createInspector` imports remain valid.
65
65
  - Root/core does not require optional adapter dependencies.
66
66
  - Optional adapter APIs are experimental and package-scoped.
67
67
  - No destructive migration is required for existing trace directories.