agent-inspect 1.8.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.
- package/CHANGELOG.md +14 -0
- package/README.md +146 -23
- package/docs/ADAPTER-CONFORMANCE.md +1 -1
- package/docs/ADAPTERS.md +41 -6
- package/docs/API.md +123 -36
- package/docs/CLI.md +75 -11
- package/docs/EXPORTS.md +1 -1
- package/docs/GETTING-STARTED.md +72 -16
- package/docs/KNOWN-ISSUES.md +8 -3
- package/docs/LIMITATIONS.md +6 -6
- package/docs/LOG-TO-TREE-QUICKSTART.md +1 -2
- package/docs/MIGRATION.md +67 -0
- package/docs/SCHEMA.md +29 -12
- package/package.json +2 -2
- package/packages/cli/dist/index.cjs +7604 -7660
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +7604 -7660
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/core/dist/advanced.cjs +2047 -26
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +346 -196
- package/packages/core/dist/advanced.d.ts +346 -196
- package/packages/core/dist/advanced.mjs +628 -5
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.d.cts +1 -1
- package/packages/core/dist/checks.d.ts +1 -1
- package/packages/core/dist/chunk-2ZXEMWGK.mjs +549 -0
- package/packages/core/dist/chunk-2ZXEMWGK.mjs.map +1 -0
- package/packages/core/dist/{chunk-57S5D6HR.mjs → chunk-4JVGFNQH.mjs} +50 -6
- package/packages/core/dist/chunk-4JVGFNQH.mjs.map +1 -0
- package/packages/core/dist/{chunk-6QSLZCBJ.mjs → chunk-A4V2H3YU.mjs} +329 -163
- package/packages/core/dist/chunk-A4V2H3YU.mjs.map +1 -0
- package/packages/core/dist/{chunk-74XZ6N7Q.mjs → chunk-IZBJAZGF.mjs} +12 -4
- package/packages/core/dist/chunk-IZBJAZGF.mjs.map +1 -0
- package/packages/core/dist/{chunk-VTIB5MDK.mjs → chunk-NQZPZ2FN.mjs} +15 -10
- package/packages/core/dist/chunk-NQZPZ2FN.mjs.map +1 -0
- package/packages/core/dist/{chunk-TZISEVLQ.mjs → chunk-XUNJMAPD.mjs} +3 -3
- package/packages/core/dist/{chunk-TZISEVLQ.mjs.map → chunk-XUNJMAPD.mjs.map} +1 -1
- package/packages/core/dist/context-CSKnzpXR.d.cts +177 -0
- package/packages/core/dist/context-yv2VSDQF.d.ts +177 -0
- package/packages/core/dist/diff.d.cts +2 -2
- package/packages/core/dist/diff.d.ts +2 -2
- package/packages/core/dist/diff.mjs +473 -3
- package/packages/core/dist/diff.mjs.map +1 -1
- package/packages/core/dist/exporters.cjs +691 -0
- package/packages/core/dist/exporters.cjs.map +1 -1
- package/packages/core/dist/exporters.d.cts +24 -3
- package/packages/core/dist/exporters.d.ts +24 -3
- package/packages/core/dist/exporters.mjs +1113 -3
- package/packages/core/dist/exporters.mjs.map +1 -1
- package/packages/core/dist/index.cjs +1385 -8022
- package/packages/core/dist/index.cjs.map +1 -1
- package/packages/core/dist/index.d.cts +8 -313
- package/packages/core/dist/index.d.ts +8 -313
- package/packages/core/dist/index.mjs +18 -1331
- package/packages/core/dist/index.mjs.map +1 -1
- package/packages/core/dist/{log-config-DanPV3P9.d.cts → log-config-8aE5Kxtr.d.cts} +1 -1
- package/packages/core/dist/{log-config-BPHS4Sds.d.ts → log-config-DVimQJho.d.ts} +1 -1
- package/packages/core/dist/logs.d.cts +2 -2
- package/packages/core/dist/logs.d.ts +2 -2
- package/packages/core/dist/logs.mjs +785 -2
- package/packages/core/dist/logs.mjs.map +1 -1
- package/packages/core/dist/{persisted-inspect-event-Cw7TeYGr.d.ts → persisted-inspect-event-D-WpXeZX.d.ts} +14 -5
- package/packages/core/dist/{persisted-inspect-event-DHPfzUd8.d.cts → persisted-inspect-event-DHcHPUKv.d.cts} +14 -5
- package/packages/core/dist/persisted.cjs +11 -1
- package/packages/core/dist/persisted.cjs.map +1 -1
- package/packages/core/dist/persisted.d.cts +4 -4
- package/packages/core/dist/persisted.d.ts +4 -4
- package/packages/core/dist/persisted.mjs +150 -3
- package/packages/core/dist/persisted.mjs.map +1 -1
- package/packages/core/dist/readers.cjs +27 -10
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.d.cts +1 -1
- package/packages/core/dist/readers.d.ts +1 -1
- package/packages/core/dist/readers.mjs +1580 -4
- package/packages/core/dist/readers.mjs.map +1 -1
- package/packages/core/dist/{types-Ap9uMdx_.d.ts → types-D-Y1kOU-.d.ts} +2 -2
- package/packages/core/dist/{types-B2-BU5CS.d.cts → types-DgMN3qow.d.cts} +2 -2
- package/packages/core/dist/writers.cjs +49 -3
- package/packages/core/dist/writers.cjs.map +1 -1
- package/packages/core/dist/writers.d.cts +1 -1
- package/packages/core/dist/writers.d.ts +1 -1
- package/packages/core/dist/writers.mjs +341 -4
- package/packages/core/dist/writers.mjs.map +1 -1
- package/packages/core/dist/chunk-57S5D6HR.mjs.map +0 -1
- package/packages/core/dist/chunk-6QSLZCBJ.mjs.map +0 -1
- package/packages/core/dist/chunk-6SZPTECC.mjs +0 -342
- package/packages/core/dist/chunk-6SZPTECC.mjs.map +0 -1
- package/packages/core/dist/chunk-74XZ6N7Q.mjs.map +0 -1
- package/packages/core/dist/chunk-HR7G62IE.mjs +0 -785
- package/packages/core/dist/chunk-HR7G62IE.mjs.map +0 -1
- package/packages/core/dist/chunk-TFLPUZ56.mjs +0 -1571
- package/packages/core/dist/chunk-TFLPUZ56.mjs.map +0 -1
- package/packages/core/dist/chunk-U2BGPESY.mjs +0 -150
- package/packages/core/dist/chunk-U2BGPESY.mjs.map +0 -1
- package/packages/core/dist/chunk-VTIB5MDK.mjs.map +0 -1
- package/packages/core/dist/chunk-Y56BPA3B.mjs +0 -990
- package/packages/core/dist/chunk-Y56BPA3B.mjs.map +0 -1
- package/packages/core/dist/chunk-YWAOOXLR.mjs +0 -475
- package/packages/core/dist/chunk-YWAOOXLR.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
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
|
+
|
|
9
|
+
## 1.9.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 309350e: Release v1.9.0 adoption leverage with the private harness workspace, explain dry-run/local analysis, promoted adapter adoption paths, and the v2 root API slimming plan.
|
|
14
|
+
|
|
3
15
|
## 1.8.0
|
|
4
16
|
|
|
17
|
+
Released **2026-06-27**.
|
|
18
|
+
|
|
5
19
|
### Minor Changes
|
|
6
20
|
|
|
7
21
|
- 0bee42c: Release v1.8.0 with OpenAI Agents trace processor support, optional Vitest/Jest reporter packages kept private, deterministic CI release checks, and the validated local-first reporting improvements from the v1.8 release train.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# agent-inspect
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Trace, check, and safely share TypeScript AI agent runs locally.**
|
|
4
4
|
|
|
5
|
-
agent-inspect helps you understand what happened inside an AI agent run
|
|
5
|
+
agent-inspect helps you understand what happened inside an AI agent run without sending traces to a hosted service. It turns framework events, observed objects/classes, manual steps, tool calls, LLM calls, structured logs, failures, durations, and run metadata into readable local execution trees.
|
|
6
6
|
|
|
7
7
|
It is built for TypeScript/Node.js developers and teams shipping real agentic products — not just toy demos. Use it for **local TypeScript agent debugging**, **eval iteration**, and **CI trace artifacts**. It **complements** production observability platforms; it does **not** replace them.
|
|
8
8
|
|
|
9
|
-
The
|
|
9
|
+
The default loop is local-first: capture a trace, inspect/report/diff it, run deterministic checks in CI, then export a redacted copy only when you choose to share.
|
|
10
10
|
|
|
11
11
|
**No account. No cloud upload. No dashboard required.**
|
|
12
12
|
|
|
@@ -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.
|
|
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
|
|
@@ -40,10 +40,110 @@ npx agent-inspect --help
|
|
|
40
40
|
|
|
41
41
|
For a clean npm/pnpm install checklist with ESM, CJS, and CLI checks, see [Clean install smoke test](docs/INSTALL-SMOKE-TEST.md).
|
|
42
42
|
|
|
43
|
-
##
|
|
43
|
+
## Three adoption paths
|
|
44
|
+
|
|
45
|
+
Already using AI SDK, OpenAI Agents JS, LangChain, or LangGraph-through-LangChain? Start with **Path B** for framework-native local traces before adding manual instrumentation.
|
|
46
|
+
|
|
47
|
+
### Path A — Observe an existing object/class
|
|
48
|
+
|
|
49
|
+
Use `observe()` when you already have an agent-like object with a `run`, `execute`, or `invoke` method.
|
|
44
50
|
|
|
45
51
|
Create `demo.mjs`:
|
|
46
52
|
|
|
53
|
+
```js
|
|
54
|
+
import { observe } from "agent-inspect";
|
|
55
|
+
|
|
56
|
+
class SupportAgent {
|
|
57
|
+
async run(input) {
|
|
58
|
+
return {
|
|
59
|
+
answer: `Answering: ${input.question}`,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const agent = observe(new SupportAgent(), {
|
|
65
|
+
traceDir: "./.agent-inspect",
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
await agent.run({
|
|
69
|
+
question: "How do refunds work?",
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Run it, then inspect the trace:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
node demo.mjs
|
|
77
|
+
npx agent-inspect list --dir ./.agent-inspect
|
|
78
|
+
npx agent-inspect view <run-id> --dir ./.agent-inspect
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Path B — Use a framework adapter
|
|
82
|
+
|
|
83
|
+
Optional adapters keep framework dependencies out of the root package and write local traces only when configured.
|
|
84
|
+
|
|
85
|
+
AI SDK local telemetry:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import { generateText } from "ai";
|
|
89
|
+
import { agentInspect } from "@agent-inspect/ai-sdk";
|
|
90
|
+
|
|
91
|
+
await generateText({
|
|
92
|
+
model,
|
|
93
|
+
prompt,
|
|
94
|
+
experimental_telemetry: {
|
|
95
|
+
isEnabled: true,
|
|
96
|
+
recordInputs: false,
|
|
97
|
+
recordOutputs: false,
|
|
98
|
+
integrations: [
|
|
99
|
+
agentInspect({
|
|
100
|
+
traceDir: "./.agent-inspect",
|
|
101
|
+
runName: "support-agent",
|
|
102
|
+
capture: "metadata-only",
|
|
103
|
+
}),
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
OpenAI Agents local-only processor:
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
import { setTraceProcessors } from "@openai/agents";
|
|
113
|
+
import { agentInspectProcessor } from "@agent-inspect/openai-agents";
|
|
114
|
+
|
|
115
|
+
setTraceProcessors([
|
|
116
|
+
agentInspectProcessor({
|
|
117
|
+
traceDir: "./.agent-inspect",
|
|
118
|
+
workflowName: "support-agent",
|
|
119
|
+
capture: "metadata-only",
|
|
120
|
+
}),
|
|
121
|
+
]);
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
LangChain callback adapter:
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
import { AgentInspectCallback } from "@agent-inspect/langchain";
|
|
128
|
+
|
|
129
|
+
const callback = new AgentInspectCallback({
|
|
130
|
+
runName: "support-agent",
|
|
131
|
+
traceDir: "./.agent-inspect",
|
|
132
|
+
persist: true,
|
|
133
|
+
capture: "metadata-only",
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
await agent.invoke(input, { callbacks: [callback] });
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
See [docs/ADAPTERS.md](docs/ADAPTERS.md).
|
|
140
|
+
|
|
141
|
+
No-network recipes: [ai-sdk-local-telemetry](examples/recipes/ai-sdk-local-telemetry/), [openai-agents-local-tracing](examples/recipes/openai-agents-local-tracing/), and [langgraph-callback-local](examples/recipes/langgraph-callback-local/).
|
|
142
|
+
|
|
143
|
+
### Path C — Manually instrument custom flows
|
|
144
|
+
|
|
145
|
+
Use `inspectRun` and `step` when you want explicit names, custom nesting, or flows that are not object/class shaped.
|
|
146
|
+
|
|
47
147
|
```js
|
|
48
148
|
import { inspectRun, step } from "agent-inspect";
|
|
49
149
|
|
|
@@ -71,15 +171,6 @@ await inspectRun(
|
|
|
71
171
|
);
|
|
72
172
|
```
|
|
73
173
|
|
|
74
|
-
Run it, then inspect the trace:
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
node demo.mjs
|
|
78
|
-
npx agent-inspect list --dir ./.agent-inspect
|
|
79
|
-
npx agent-inspect view <run-id> --dir ./.agent-inspect
|
|
80
|
-
npx agent-inspect view <run-id> --dir ./.agent-inspect --summary
|
|
81
|
-
```
|
|
82
|
-
|
|
83
174
|
Full flow:
|
|
84
175
|
|
|
85
176
|
```bash
|
|
@@ -99,6 +190,32 @@ support-agent
|
|
|
99
190
|
|
|
100
191
|
A runnable copy lives in [examples/00-quickstart-demo](examples/00-quickstart-demo/README.md).
|
|
101
192
|
|
|
193
|
+
Use the root import for stable beginner APIs:
|
|
194
|
+
|
|
195
|
+
```ts
|
|
196
|
+
import {
|
|
197
|
+
createInspector,
|
|
198
|
+
observe,
|
|
199
|
+
inspectRun,
|
|
200
|
+
maybeInspectRun,
|
|
201
|
+
step,
|
|
202
|
+
getCurrentCorrelationMetadata,
|
|
203
|
+
} from "agent-inspect";
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Use subpaths for advanced, experimental, or lower-level workflows:
|
|
207
|
+
|
|
208
|
+
```ts
|
|
209
|
+
import { openTrace } from "agent-inspect/readers";
|
|
210
|
+
import { memoryWriter } from "agent-inspect/writers";
|
|
211
|
+
import { runTraceChecks } from "agent-inspect/checks";
|
|
212
|
+
import { diffTraceEvents } from "agent-inspect/diff";
|
|
213
|
+
import { exportMarkdown } from "agent-inspect/exporters";
|
|
214
|
+
import { parseLogsToTrees } from "agent-inspect/logs";
|
|
215
|
+
import { traceEventsToPersistedInspectEvents } from "agent-inspect/persisted";
|
|
216
|
+
import { createInspectorRuntime } from "agent-inspect/advanced";
|
|
217
|
+
```
|
|
218
|
+
|
|
102
219
|
**Env-gated tracing** (eval harnesses, CI): use `maybeInspectRun` and set `AGENT_INSPECT=1` when you want a trace — otherwise no files are written.
|
|
103
220
|
|
|
104
221
|
```ts
|
|
@@ -111,20 +228,23 @@ await maybeInspectRun("eval-case-42", async () => runAgent());
|
|
|
111
228
|
AGENT_INSPECT=1 node eval-runner.mjs
|
|
112
229
|
```
|
|
113
230
|
|
|
114
|
-
## What you can do today
|
|
231
|
+
## What you can do today
|
|
115
232
|
|
|
116
233
|
- **Trace manually** with `inspectRun`, `step`, `step.llm`, `step.tool`, and `observe` — local JSONL under `.agent-inspect/` by default.
|
|
117
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.
|
|
118
236
|
- **Correlate runs** with optional `correlationId`, `requestId`, `decisionId`, and `groupId` on `run_started` metadata.
|
|
119
237
|
- **Redact before disk** with default key-based redaction, or choose `redactionProfile`: `local`, `share`, or `strict`.
|
|
120
|
-
- **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.
|
|
121
240
|
- **Export share-safe copies** — `export --redaction-profile share` (or `strict`) writes local Markdown/HTML/OpenInference/OTLP JSON only.
|
|
122
241
|
- **Parse structured logs** you already emit (JSON first-class; log4js best-effort).
|
|
123
242
|
- **Optional LangChain adapter** — metadata-only by default; optional `persist: true` and `stream: true` streaming metadata (no full token capture by default).
|
|
124
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`.
|
|
244
|
+
- **Optional OpenAI Agents adapter** — experimental `@agent-inspect/openai-agents` trace processor for local OpenAI Agents JS trace processing.
|
|
125
245
|
- **Optional TUI** — `view --tui` when `@agent-inspect/tui` is installed.
|
|
126
|
-
- **Persisted-event foundation
|
|
127
|
-
- **Experimental
|
|
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.
|
|
247
|
+
- **Experimental subpaths** — `agent-inspect/readers`, `/writers`, `/checks`, `/diff`, `/exporters`, `/logs`, `/persisted`, and `/advanced` for advanced local workflows.
|
|
128
248
|
|
|
129
249
|
Nothing uploads traces by default. Review exports before sharing — see [safe trace sharing](docs/SAFE-TRACE-SHARING.md).
|
|
130
250
|
|
|
@@ -136,7 +256,7 @@ Each run produces a **JSONL** trace: `run_started` / `run_completed`, `step_star
|
|
|
136
256
|
|
|
137
257
|
*Synthetic demo — [examples/02-nested-steps](examples/02-nested-steps/README.md). More visuals: [SCREENSHOTS.md](docs/SCREENSHOTS.md).*
|
|
138
258
|
|
|
139
|
-
##
|
|
259
|
+
## Advanced ingestion: use this when your app already emits structured logs
|
|
140
260
|
|
|
141
261
|
Many production systems already emit **line-delimited JSON** or text logs with embedded JSON (e.g. via **pino**, **winston**, **log4js**, **NestJS** loggers, job runners, or custom event streams). agent-inspect can turn those into **local grouped timelines/trees** without wrapping every function.
|
|
142
262
|
|
|
@@ -175,6 +295,7 @@ More detail: [docs/LOGS.md](docs/LOGS.md) · [docs/LOG-TO-TREE-QUICKSTART.md](do
|
|
|
175
295
|
| `tail` | Watch structured logs while the app runs |
|
|
176
296
|
| `export` | Write Markdown / HTML / OpenInference-compatible JSON / OTLP JSON **locally** |
|
|
177
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 |
|
|
178
299
|
| `diff` | Compare two local runs (read-only) |
|
|
179
300
|
| `timeline` | Chronological view of one run |
|
|
180
301
|
| `stats` | Local aggregates over a trace directory |
|
|
@@ -199,18 +320,20 @@ Full flags and behavior: [docs/CLI.md](docs/CLI.md).
|
|
|
199
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.
|
|
200
321
|
- Keep traces **on disk** while still using enterprise observability elsewhere.
|
|
201
322
|
|
|
202
|
-
## Stable foundation
|
|
323
|
+
## Stable foundation
|
|
203
324
|
|
|
204
|
-
|
|
325
|
+
AgentInspect is the **local-first trace workbench** for TypeScript AI agents:
|
|
205
326
|
|
|
206
327
|
- Instrument runs with `inspectRun` and `step`
|
|
207
|
-
- Write **local JSONL traces** (`schemaVersion: "0.1"`
|
|
328
|
+
- Write and read **local JSONL traces** (`schemaVersion: "0.1"` manual traces remain readable; schema 1.0 persisted rows are the v2 writer target)
|
|
208
329
|
- Inspect with **`list`**, **`view`**, **`clean`**, **`logs`**, **`tail`**, **`export`**, **`diff`**, **`timeline`**, **`stats`**, **`search`**
|
|
209
330
|
|
|
210
|
-
**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()`.
|
|
211
332
|
|
|
212
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).
|
|
213
334
|
|
|
335
|
+
**Shipped in 1.8.0:** experimental deterministic checks (`agent-inspect/checks` and `agent-inspect check`), safe-sharing workflows (`scan`, `verify-safe`, safe artifacts), and first public `@agent-inspect/openai-agents` package. Linked release aligns `agent-inspect`, `@agent-inspect/ai-sdk`, `@agent-inspect/langchain`, `@agent-inspect/tui`, and `@agent-inspect/openai-agents` at **1.8.0**.
|
|
336
|
+
|
|
214
337
|
**Shipped in 1.7.0:** 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/), adapter conformance fixtures, OpenAI Agents/LangGraph support decisions, and local-first adapter docs. Examples keep `recordInputs: false`, `recordOutputs: false`, metadata-only capture, and no upload behavior. Linked release aligns `agent-inspect`, `@agent-inspect/ai-sdk`, `@agent-inspect/langchain`, and `@agent-inspect/tui` at **1.7.0**.
|
|
215
338
|
|
|
216
339
|
**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 then-published npm packages at **1.6.0**.
|
|
@@ -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;
|
|
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/ADAPTERS.md
CHANGED
|
@@ -4,7 +4,7 @@ AgentInspect is **framework-agnostic** at its core. Optional adapter packages in
|
|
|
4
4
|
|
|
5
5
|
## Vercel AI SDK (`@agent-inspect/ai-sdk`)
|
|
6
6
|
|
|
7
|
-
**Status:** experimental
|
|
7
|
+
**Status:** experimental adapter — optional package published in the aligned v1.8.0 package set.
|
|
8
8
|
|
|
9
9
|
The v1.8 train has hardened lifecycle identity and parallel integration isolation. The adapter remains metadata-only: `capture: "preview"` and preview-only redaction options emit diagnostics and fall back to metadata-only capture until bounded free-text previews are implemented.
|
|
10
10
|
|
|
@@ -49,6 +49,34 @@ const result = await generateText({
|
|
|
49
49
|
|
|
50
50
|
[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`.
|
|
51
51
|
|
|
52
|
+
### Common host shapes
|
|
53
|
+
|
|
54
|
+
Use the same explicit telemetry block for route handlers, streaming, and tool calls. The adapter does not wrap providers or change host-call settings.
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
const telemetry = {
|
|
58
|
+
isEnabled: true,
|
|
59
|
+
recordInputs: false,
|
|
60
|
+
recordOutputs: false,
|
|
61
|
+
integrations: [agentInspect({ traceDir: "./.agent-inspect", capture: "metadata-only" })],
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// Next.js route or local handler
|
|
65
|
+
await generateText({ model, prompt, experimental_telemetry: telemetry });
|
|
66
|
+
|
|
67
|
+
// Streaming
|
|
68
|
+
await streamText({ model, prompt, experimental_telemetry: telemetry });
|
|
69
|
+
|
|
70
|
+
// Tool calls
|
|
71
|
+
await generateText({ model, prompt, tools, experimental_telemetry: telemetry });
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Review recipe output with:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npx agent-inspect open ./examples/recipes/ai-sdk-local-telemetry/.agent-inspect-runs
|
|
78
|
+
```
|
|
79
|
+
|
|
52
80
|
Full API: [API.md](./API.md) §11.
|
|
53
81
|
|
|
54
82
|
---
|
|
@@ -181,6 +209,8 @@ LangGraph support is expected to ride through this same `@agent-inspect/langchai
|
|
|
181
209
|
|
|
182
210
|
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.
|
|
183
211
|
|
|
212
|
+
Runnable local recipe: [langgraph-callback-local](../examples/recipes/langgraph-callback-local).
|
|
213
|
+
|
|
184
214
|
Decision note: [LANGGRAPH-ADAPTER-BOUNDARY.md](./proposals/LANGGRAPH-ADAPTER-BOUNDARY.md).
|
|
185
215
|
|
|
186
216
|
---
|
|
@@ -202,13 +232,13 @@ Requires an interactive terminal. See [API.md](./API.md) §10.
|
|
|
202
232
|
|
|
203
233
|
## Vitest (`@agent-inspect/vitest`)
|
|
204
234
|
|
|
205
|
-
**Status:** experimental
|
|
235
|
+
**Status:** experimental workspace package, private/unpublished.
|
|
206
236
|
|
|
207
237
|
```bash
|
|
208
238
|
npm install agent-inspect @agent-inspect/vitest vitest
|
|
209
239
|
```
|
|
210
240
|
|
|
211
|
-
|
|
241
|
+
The reporter creates safe, structural artifacts for failed tests that explicitly attach AgentInspect trace metadata. It never guesses trace files by timestamp and does not read trace contents into artifacts.
|
|
212
242
|
|
|
213
243
|
```ts
|
|
214
244
|
import { createAgentInspectVitestReporter } from "@agent-inspect/vitest";
|
|
@@ -251,13 +281,13 @@ Full API: [API.md](./API.md) §12.
|
|
|
251
281
|
|
|
252
282
|
## Jest (`@agent-inspect/jest`)
|
|
253
283
|
|
|
254
|
-
**Status:** experimental
|
|
284
|
+
**Status:** experimental workspace package, private/unpublished.
|
|
255
285
|
|
|
256
286
|
```bash
|
|
257
287
|
npm install agent-inspect @agent-inspect/jest jest
|
|
258
288
|
```
|
|
259
289
|
|
|
260
|
-
|
|
290
|
+
The reporter creates safe, structural artifacts for failed Jest assertions that explicitly attach AgentInspect trace metadata through a map or resolver. It never guesses trace files by timestamp and does not read trace contents into artifacts.
|
|
261
291
|
|
|
262
292
|
```js
|
|
263
293
|
module.exports = {
|
|
@@ -294,7 +324,7 @@ Full API: [API.md](./API.md) §13.
|
|
|
294
324
|
|
|
295
325
|
## OpenAI Agents JS (`@agent-inspect/openai-agents`)
|
|
296
326
|
|
|
297
|
-
**Status:** experimental
|
|
327
|
+
**Status:** experimental adapter — optional package published in the aligned v1.8.0 package set.
|
|
298
328
|
|
|
299
329
|
The safe integration boundary is documented in [OPENAI-AGENTS-JS-TRACING.md](./proposals/OPENAI-AGENTS-JS-TRACING.md). Install the AgentInspect processor by replacing processors:
|
|
300
330
|
|
|
@@ -312,6 +342,11 @@ setTraceProcessors([
|
|
|
312
342
|
|
|
313
343
|
Do not use `addTraceProcessor()` as the default AgentInspect path; that preserves the OpenAI default exporter in server runtimes. The processor does not auto-install itself, does not upload, and does not add OpenAI Agents dependencies to root/core.
|
|
314
344
|
|
|
345
|
+
Integration modes:
|
|
346
|
+
|
|
347
|
+
- **Local-only replacement:** `setTraceProcessors([agentInspectProcessor(...)])` replaces existing processors for the current process. This is the documented safe default when you want AgentInspect to own local trace output.
|
|
348
|
+
- **Additional processor:** `addTraceProcessor(agentInspectProcessor(...))` is an advanced, user-owned choice. It can preserve existing/default processors and any backend export behavior they already perform.
|
|
349
|
+
|
|
315
350
|
- **No auto-install** — importing or constructing `agentInspectProcessor()` never calls `setTraceProcessors()` or `addTraceProcessor()`.
|
|
316
351
|
- **No upload behavior** — the processor writes only to an explicit local writer or `traceDir`.
|
|
317
352
|
- **Metadata-only by default** — records trace/span IDs, parentage, names, timing, status, errors, safe model/tool names, token counts, and bounded summaries.
|