agent-inspect 1.6.0 → 1.7.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 94a7220: Release v1.7.0 framework-native adoption with the experimental AI SDK telemetry adapter, adapter conformance coverage, and local-first adapter documentation.
8
+
3
9
  ## 1.6.0
4
10
 
5
11
  Released **2026-06-25**.
package/README.md CHANGED
@@ -210,6 +210,8 @@ Pass `enabled: false` to `inspectRun` for a no-trace passthrough. Use `maybeInsp
210
210
 
211
211
  **Shipped in 1.6.0:** experimental writer subpath (`agent-inspect/writers`), isolated `createInspector()` API via `agent-inspect/advanced`, local trace readers via `agent-inspect/readers`, OpenInference/OTLP JSON readers, universal `agent-inspect open`, and deterministic [runtime-and-ingestion recipe](examples/recipes/runtime-and-ingestion/). These remain local-only and do not add upload behavior. Linked release aligns all three npm packages at **1.6.0**.
212
212
 
213
+ **In progress for 1.7.0 on main:** experimental `@agent-inspect/ai-sdk` telemetry integration for AI SDK v6 with a local no-network [ai-sdk-local-telemetry recipe](examples/recipes/ai-sdk-local-telemetry/). Examples keep `recordInputs: false`, `recordOutputs: false`, metadata-only capture, and no upload behavior.
214
+
213
215
  **Shipped in 1.5.0:** non-breaking subpath exports; `what` and `report` CLI; dual-format read path (v0.1 + v0.2 JSONL); [what-report-inspect recipe](examples/recipes/what-report-inspect/). Linked release aligns all three npm packages at **1.5.0**.
214
216
 
215
217
  **Roadmap beyond current release work:** future work continues from the local runtime and universal ingestion foundation before broadening framework adapters. See [ROADMAP.md](ROADMAP.md).
@@ -0,0 +1,35 @@
1
+ # Adapter conformance
2
+
3
+ AgentInspect optional framework adapters must stay local-first, dependency-isolated, and metadata-only by default.
4
+
5
+ The machine-readable matrix lives at [docs/implementation/adapter-conformance-matrix.json](./implementation/adapter-conformance-matrix.json). It tracks expected coverage for:
6
+
7
+ - run lifecycle
8
+ - generic steps
9
+ - tools
10
+ - LLM calls
11
+ - errors
12
+ - streaming metadata
13
+ - metadata bounds and privacy controls
14
+
15
+ ## Current matrix
16
+
17
+ | Adapter | Package | Status | Default install mode | Boundary |
18
+ | --- | --- | --- | --- | --- |
19
+ | AI SDK | `@agent-inspect/ai-sdk` | implemented experimental | AI SDK telemetry integration | optional package peer dependency |
20
+ | LangChain | `@agent-inspect/langchain` | implemented experimental | explicit callback | optional package peer dependency |
21
+ | OpenAI Agents JS | `@agent-inspect/openai-agents` | scaffold only | `setTraceProcessors()` replacement | optional package peer dependency |
22
+ | LangGraph | `@agent-inspect/langchain` | decision only | explicit LangChain callback | existing LangChain adapter first |
23
+
24
+ ## Required defaults
25
+
26
+ - No network behavior.
27
+ - No default upload behavior.
28
+ - No root/core dependency on framework SDKs.
29
+ - Metadata-only capture by default.
30
+ - Raw prompts, messages, outputs, tool payloads, headers, request bodies, and response bodies must not be persisted by default.
31
+ - Framework-specific fixtures must be no-network and dependency-isolated.
32
+
33
+ ## Before claiming support
34
+
35
+ An adapter can be documented as supported only after no-network fixtures cover run, step, tool, LLM, error, streaming, and metadata-bound expectations for that framework path.
package/docs/ADAPTERS.md CHANGED
@@ -2,6 +2,54 @@
2
2
 
3
3
  AgentInspect is **framework-agnostic** at its core. Optional adapter packages integrate specific frameworks without monkey-patching, vendor sinks, or network upload.
4
4
 
5
+ ## Vercel AI SDK (`@agent-inspect/ai-sdk`)
6
+
7
+ **Status:** experimental v1.7 train — optional workspace package; publication waits for v1.7 release readiness.
8
+
9
+ ### Install
10
+
11
+ ```bash
12
+ npm install agent-inspect @agent-inspect/ai-sdk ai
13
+ ```
14
+
15
+ ### Local telemetry integration
16
+
17
+ ```ts
18
+ import { generateText } from "ai";
19
+ import { agentInspect } from "@agent-inspect/ai-sdk";
20
+
21
+ const result = await generateText({
22
+ model,
23
+ prompt,
24
+ experimental_telemetry: {
25
+ isEnabled: true,
26
+ recordInputs: false,
27
+ recordOutputs: false,
28
+ integrations: [
29
+ agentInspect({
30
+ traceDir: "./.agent-inspect",
31
+ runName: "support-agent",
32
+ capture: "metadata-only",
33
+ }),
34
+ ],
35
+ },
36
+ });
37
+ ```
38
+
39
+ - **No monkey-patching** — pass the integration explicitly through AI SDK telemetry.
40
+ - **No upload behavior** — the adapter writes only to an explicit local writer or `traceDir`.
41
+ - **Metadata-only by default** — records model, finish reason, token usage, timing, and safe counts/summaries.
42
+ - **Required safe telemetry settings** — set `recordInputs: false` and `recordOutputs: false` on every AI SDK call using this adapter.
43
+ - **No raw payload capture by default** — prompts, messages, generated text, stream chunks, tool inputs/outputs, headers, request bodies, and response bodies are not persisted.
44
+
45
+ ### Local no-network recipe
46
+
47
+ [examples/recipes/ai-sdk-local-telemetry](../examples/recipes/ai-sdk-local-telemetry/) uses AI SDK test utilities only (`MockLanguageModelV3`, `simulateReadableStream`) and writes local v0.2 adapter events for `agent-inspect open`.
48
+
49
+ Full API: [API.md](./API.md) §11.
50
+
51
+ ---
52
+
5
53
  ## LangChain.js (`@agent-inspect/langchain`)
6
54
 
7
55
  **Status:** experimental — programmatic API may evolve independently of stable core tracing.
@@ -114,6 +162,14 @@ Full API: [API.md](./API.md) §9.
114
162
 
115
163
  [examples/08-langchain-adapter](../examples/08-langchain-adapter/README.md)
116
164
 
165
+ ### LangGraph boundary
166
+
167
+ LangGraph support is expected to ride through this same `@agent-inspect/langchain` callback boundary first. A dedicated LangGraph package is deferred until no-network fixtures prove that LangGraph exposes important lifecycle data unavailable through LangChain callbacks.
168
+
169
+ Future LangGraph examples must keep the same safety defaults: explicit callback installation, metadata-only capture, no raw prompt/output/tool payload capture by default, no hosted sink, and local persistence only when `persist: true` is set.
170
+
171
+ Decision note: [LANGGRAPH-ADAPTER-BOUNDARY.md](./proposals/LANGGRAPH-ADAPTER-BOUNDARY.md).
172
+
117
173
  ---
118
174
 
119
175
  ## TUI (`@agent-inspect/tui`)
@@ -131,11 +187,32 @@ Requires an interactive terminal. See [API.md](./API.md) §10.
131
187
 
132
188
  ---
133
189
 
190
+ ## OpenAI Agents JS (`@agent-inspect/openai-agents`)
191
+
192
+ **Status:** scaffolded for v1.7 train — optional workspace package; runtime mapping is not implemented yet.
193
+
194
+ The safe integration boundary is documented in [OPENAI-AGENTS-JS-TRACING.md](./proposals/OPENAI-AGENTS-JS-TRACING.md). Future examples must install the AgentInspect processor by replacing processors:
195
+
196
+ ```ts
197
+ import { setTraceProcessors } from "@openai/agents";
198
+ import { agentInspectProcessor } from "@agent-inspect/openai-agents";
199
+
200
+ setTraceProcessors([
201
+ agentInspectProcessor({
202
+ traceDir: "./.agent-inspect",
203
+ capture: "metadata-only",
204
+ }),
205
+ ]);
206
+ ```
207
+
208
+ Do not use `addTraceProcessor()` as the default AgentInspect path; that preserves the OpenAI default exporter in server runtimes. The scaffold does not auto-install a processor, does not upload, and does not add OpenAI Agents dependencies to root/core.
209
+
210
+ ---
211
+
134
212
  ## Future adapters (not shipped)
135
213
 
136
214
  Direction only — see [ROADMAP.md](../ROADMAP.md):
137
215
 
138
- - **Vercel AI SDK** — optional callback-style adapter (metadata-first, no vendor sink)
139
216
  - **NestJS / logging bridges** — deeper recipes or helper patterns beyond [LOGGING-PLAYBOOK.md](./LOGGING-PLAYBOOK.md)
140
217
 
141
218
  No automatic universal instrumentation. Integrations remain explicit and opt-in.
@@ -145,5 +222,6 @@ No automatic universal instrumentation. Integrations remain explicit and opt-in.
145
222
  ## Related docs
146
223
 
147
224
  - [API.md](./API.md) — adapter options and stability policy
225
+ - [ADAPTER-CONFORMANCE.md](./ADAPTER-CONFORMANCE.md) — no-network fixture matrix and shared expectations
148
226
  - [SAFE-TRACE-SHARING.md](./SAFE-TRACE-SHARING.md) — review exports before sharing
149
227
  - [LIMITATIONS.md](./LIMITATIONS.md) — LangChain streaming and metadata boundaries
package/docs/API.md CHANGED
@@ -150,7 +150,66 @@ Rationale: v1.x includes one official adapter and **zero production sinks**, so
150
150
 
151
151
  - `runTraceViewer`, `loadTraceForTui`, `buildTuiTraceModel`, etc.
152
152
 
153
- ## 11. Experimental persisted-event foundation (v1.2.0)
153
+ ## 11. Experimental `@agent-inspect/ai-sdk` APIs
154
+
155
+ `@agent-inspect/ai-sdk` is an optional v1.7 adapter package for Vercel AI SDK v6 telemetry integrations. It is experimental during the v1.7 train and remains private until release readiness.
156
+
157
+ Import from `@agent-inspect/ai-sdk`:
158
+
159
+ ```ts
160
+ import { agentInspect } from "@agent-inspect/ai-sdk";
161
+ ```
162
+
163
+ - **`agentInspect(options?)`**: returns an AI SDK `TelemetryIntegration` bound with `bindTelemetryIntegration()`.
164
+ - **`writer`**: optional explicit local `TraceWriter` for tests, recipes, and controlled runtime integration.
165
+ - **`traceDir`**: optional local directory that creates a file writer inside the adapter package.
166
+ - **`runName`**: optional local run name.
167
+ - **`capture`**: `"metadata-only"` (default) or `"preview"` (reserved for explicit bounded capture).
168
+ - **`redactionProfile`** and **`maxPreviewChars`**: reserved for bounded/redacted future preview behavior.
169
+ - **`getDiagnostics()`**: exposes isolated adapter write failures without throwing into AI SDK callbacks.
170
+
171
+ Every AI SDK call using the adapter must keep telemetry local and metadata-only:
172
+
173
+ ```ts
174
+ experimental_telemetry: {
175
+ isEnabled: true,
176
+ recordInputs: false,
177
+ recordOutputs: false,
178
+ integrations: [agentInspect({ traceDir: "./.agent-inspect" })],
179
+ }
180
+ ```
181
+
182
+ The adapter records local v0.2 persisted events for run, LLM step, and tool lifecycle metadata. By default it does not persist raw prompts, messages, generated text, stream chunks, tool inputs, tool outputs, headers, request bodies, response bodies, or user `experimental_context`.
183
+
184
+ No network writer, OpenTelemetry exporter, provider wrapper, or global monkey-patch is part of this package.
185
+
186
+ Recipe: [examples/recipes/ai-sdk-local-telemetry](../examples/recipes/ai-sdk-local-telemetry/).
187
+
188
+ ## 12. Experimental `@agent-inspect/openai-agents` APIs
189
+
190
+ `@agent-inspect/openai-agents` is an optional v1.7 scaffold for future OpenAI Agents JS tracing processor integration. Runtime span mapping is not implemented yet.
191
+
192
+ Import from `@agent-inspect/openai-agents`:
193
+
194
+ ```ts
195
+ import { agentInspectProcessor } from "@agent-inspect/openai-agents";
196
+ ```
197
+
198
+ - **`agentInspectProcessor(options?)`**: returns a local-only scaffold object with diagnostics.
199
+ - **`installMode`**: always `"setTraceProcessors"` to document the safe replacement install path.
200
+ - **`localOnly`**: always `true`; the scaffold performs no network I/O and does not install itself globally.
201
+ - **`writer`**, **`traceDir`**, **`workflowName`**, **`capture`**, **`redactionProfile`**, and **`maxPreviewChars`** are reserved for the later runtime mapping chunk.
202
+ - **`getDiagnostics()`**: exposes scaffold diagnostics and reports `runtimeMappingImplemented: false`.
203
+
204
+ Safe future usage must replace processors explicitly:
205
+
206
+ ```ts
207
+ setTraceProcessors([agentInspectProcessor({ traceDir: "./.agent-inspect" })]);
208
+ ```
209
+
210
+ Do not use `addTraceProcessor()` as the default AgentInspect path; that leaves existing/default processors in place and can preserve backend export behavior in server runtimes.
211
+
212
+ ## 13. Experimental persisted-event foundation (v1.2.0)
154
213
 
155
214
  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.
156
215
 
@@ -176,7 +235,7 @@ Related types: `PersistedInspectEvent`, `PersistedEventSourceType`, `PersistedEv
176
235
  - v0.2 is **not written by default**; use converters and `fixtures/traces-v0.2/` samples for validation.
177
236
  - 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.
178
237
 
179
- ## 12. Local observability helpers (v1.4.0+)
238
+ ## 14. Local observability helpers (v1.4.0+)
180
239
 
181
240
  Read-only helpers for timeline, stats, and search over local JSONL traces. v0.1 manual traces remain the default writer; v0.2 persisted-event files are accepted where the shared dual-format read path is used. Local files only.
182
241
 
@@ -186,7 +245,7 @@ Read-only helpers for timeline, stats, and search over local JSONL traces. v0.1
186
245
 
187
246
  CLI wrappers: `agent-inspect timeline`, `stats`, `search` — see [CLI.md](./CLI.md).
188
247
 
189
- ## 13. Report and what helpers (v1.5.0+)
248
+ ## 15. Report and what helpers (v1.5.0+)
190
249
 
191
250
  Read-only helpers for concise inspection summaries and local reports:
192
251
 
@@ -195,7 +254,7 @@ Read-only helpers for concise inspection summaries and local reports:
195
254
 
196
255
  Report redaction profiles are key-based safeguards applied to the complete rendered report input, not only to the tree section. Review generated reports before sharing; this is not compliance-grade DLP.
197
256
 
198
- ## 14. Experimental trace writers (v1.6)
257
+ ## 16. Experimental trace writers (v1.6)
199
258
 
200
259
  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.
201
260
 
@@ -227,7 +286,7 @@ import type {
227
286
 
228
287
  No network writer or vendor sink exists in this package.
229
288
 
230
- ## 15. Experimental inspector API/runtime (v1.6)
289
+ ## 17. Experimental inspector API/runtime (v1.6)
231
290
 
232
291
  `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.
233
292
 
@@ -269,7 +328,7 @@ Public methods:
269
328
 
270
329
  These APIs are experimental during v1.x. They do not add a default network writer or vendor sink.
271
330
 
272
- ## 16. Experimental trace readers (v1.6)
331
+ ## 18. Experimental trace readers (v1.6)
273
332
 
274
333
  `agent-inspect/readers` exposes the experimental local trace reader contract and detection pipeline. It includes AgentInspect JSONL for v0.1, v0.2, and mixed local trace files, plus local OpenInference JSON and OTLP JSON compatibility readers.
275
334
 
@@ -300,23 +359,23 @@ import type { TraceReader } from "agent-inspect/readers";
300
359
 
301
360
  The reader contract does not silently accept arbitrary JSON and does not add OTel SDK, database, hosted ingestion, or network upload dependencies.
302
361
 
303
- ## 17. Deprecated APIs
362
+ ## 19. Deprecated APIs
304
363
 
305
364
  No deprecated APIs are declared as of 1.4.0.
306
365
 
307
- ## 18. Removal / deprecation policy
366
+ ## 20. Removal / deprecation policy
308
367
 
309
368
  - Stable APIs are not removed in v1.x.
310
369
  - 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.
311
370
 
312
- ## 19. Backward compatibility policy
371
+ ## 21. Backward compatibility policy
313
372
 
314
373
  - Manual trace JSONL (`schemaVersion: "0.1"`) remains readable.
315
374
  - Additive schema changes are allowed in minor versions.
316
375
  - Breaking changes require a major version.
317
376
  - Unknown fields should be ignored where safe.
318
377
 
319
- ## 20. Examples
378
+ ## 22. Examples
320
379
 
321
380
  ### Minimal manual trace
322
381
 
@@ -22,6 +22,9 @@ AgentInspect is **local-first** and **CLI-first**. These behaviors are intention
22
22
  ## Integrations
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
+ - **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 scaffold-only in the v1.7 train. Runtime span mapping is not implemented, and the safe future path is `setTraceProcessors()` rather than `addTraceProcessor()`.
27
+ - **LangGraph support** is currently a documented boundary through `@agent-inspect/langchain`, not a dedicated package.
25
28
  - **LangChain adapter** captures **metadata-oriented** signals by default; it does not replace full framework observability.
26
29
  - **LangChain `stream: true`** records chunk counts and timing only — not a full token replay. Per-token JSONL events are not emitted.
27
30
  - **Correlation metadata** (`correlationId`, `requestId`, `decisionId`, `groupId`) is written on `run_started` but **CLI list/view does not filter by correlation fields** yet.
@@ -27,6 +27,14 @@ This document states what AgentInspect **does not** provide today. It complement
27
27
  - **Conservative detection:** `agent-inspect open` does not silently accept arbitrary JSON. Unsupported or ambiguous inputs produce errors/warnings rather than guessed traces.
28
28
  - **Large inputs:** reader inputs are bounded and read into local memory. This is not a database index or production log warehouse.
29
29
 
30
+ ## Framework adapters (v1.7)
31
+
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
+ - **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 scaffold-only.** `@agent-inspect/openai-agents` documents the safe `setTraceProcessors()` boundary but does not map runtime spans yet and is not part of the v1.7 published package set.
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
+ - **No root/core adapter dependencies.** AI SDK, OpenAI Agents, LangGraph, OpenTelemetry, and LangChain remain outside the root/core runtime dependency graph.
37
+
30
38
  ## LangChain streaming (v1.3.0)
31
39
 
32
40
  - **Metadata-focused only** — `stream: true` records chunk counts, timing, and optional bounded previews; it is **not** a replay/cassette system.
package/docs/SCHEMA.md CHANGED
@@ -239,7 +239,7 @@ Canonical samples: `fixtures/traces-v0.2/*.jsonl` (validated by `pnpm fixtures:c
239
239
  | `tokenUsage` | no | `{ input?, output?, total?, cached? }` when supplied/known |
240
240
  | `trace` | no | Optional `{ traceId?, spanId?, parentSpanId? }` for future OTel alignment |
241
241
 
242
- Programmatic helpers: see [API.md](./API.md) §11 (experimental persisted-event foundation).
242
+ Programmatic helpers: see [API.md](./API.md) §13 (experimental persisted-event foundation).
243
243
 
244
244
  ## 15. v1.6 local reader/writer compatibility
245
245
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Local-first execution-tree debugger for TypeScript AI agents",
@@ -119,6 +119,7 @@
119
119
  "docs/EXPORTS.md",
120
120
  "docs/DIFF.md",
121
121
  "docs/ADAPTERS.md",
122
+ "docs/ADAPTER-CONFORMANCE.md",
122
123
  "docs/COMPARE.md",
123
124
  "docs/LOG-TO-TREE-QUICKSTART.md",
124
125
  "docs/SCREENSHOTS.md"
@@ -157,7 +158,7 @@
157
158
  },
158
159
  "scripts": {
159
160
  "clean": "pnpm -r exec -- rm -rf dist",
160
- "build": "pnpm exec tsup --config tsup.core.config.ts && pnpm exec tsup --config tsup.cli.config.ts && pnpm exec tsup --config tsup.langchain.config.ts && pnpm exec tsup --config tsup.tui.config.ts",
161
+ "build": "pnpm exec tsup --config tsup.core.config.ts && pnpm exec tsup --config tsup.cli.config.ts && pnpm exec tsup --config tsup.langchain.config.ts && pnpm exec tsup --config tsup.tui.config.ts && pnpm exec tsup --config tsup.ai-sdk.config.ts && pnpm exec tsup --config tsup.openai-agents.config.ts",
161
162
  "typecheck": "tsc --noEmit",
162
163
  "test": "vitest run",
163
164
  "test:watch": "vitest",
@@ -23,7 +23,7 @@ var process2__default = /*#__PURE__*/_interopDefault(process2);
23
23
  var tty__default = /*#__PURE__*/_interopDefault(tty);
24
24
 
25
25
  // package.json
26
- var version = "1.6.0";
26
+ var version = "1.7.0";
27
27
 
28
28
  // packages/core/src/types.ts
29
29
  var STEP_TYPES = [