agent-inspect 1.4.0 → 1.6.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 +63 -0
- package/README.md +34 -6
- package/docs/ADAPTERS.md +6 -0
- package/docs/API.md +132 -9
- package/docs/ARCHITECTURE.md +4 -0
- package/docs/CLI.md +98 -5
- package/docs/DIFF.md +8 -0
- package/docs/EXPORTS.md +13 -0
- package/docs/GETTING-STARTED.md +19 -1
- package/docs/KNOWN-ISSUES.md +8 -1
- package/docs/LIMITATIONS.md +13 -2
- package/docs/LOGS.md +22 -0
- package/docs/SCHEMA.md +19 -7
- package/docs/SCREENSHOTS.md +190 -9
- package/package.json +71 -1
- package/packages/cli/dist/index.cjs +7121 -3986
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +7122 -3987
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/core/dist/advanced.cjs +2258 -0
- package/packages/core/dist/advanced.cjs.map +1 -0
- package/packages/core/dist/advanced.d.cts +254 -0
- package/packages/core/dist/advanced.d.ts +254 -0
- package/packages/core/dist/advanced.mjs +11 -0
- package/packages/core/dist/advanced.mjs.map +1 -0
- package/packages/core/dist/chunk-57S5D6HR.mjs +655 -0
- package/packages/core/dist/chunk-57S5D6HR.mjs.map +1 -0
- package/packages/core/dist/chunk-6QSLZCBJ.mjs +743 -0
- package/packages/core/dist/chunk-6QSLZCBJ.mjs.map +1 -0
- package/packages/core/dist/chunk-6SZPTECC.mjs +342 -0
- package/packages/core/dist/chunk-6SZPTECC.mjs.map +1 -0
- package/packages/core/dist/chunk-74XZ6N7Q.mjs +409 -0
- package/packages/core/dist/chunk-74XZ6N7Q.mjs.map +1 -0
- package/packages/core/dist/chunk-7TGZLWEE.mjs +35 -0
- package/packages/core/dist/chunk-7TGZLWEE.mjs.map +1 -0
- package/packages/core/dist/chunk-BT7CATSD.mjs +497 -0
- package/packages/core/dist/chunk-BT7CATSD.mjs.map +1 -0
- package/packages/core/dist/chunk-E5F2LQCX.mjs +83 -0
- package/packages/core/dist/chunk-E5F2LQCX.mjs.map +1 -0
- package/packages/core/dist/chunk-EDTQHZPM.mjs +88 -0
- package/packages/core/dist/chunk-EDTQHZPM.mjs.map +1 -0
- package/packages/core/dist/chunk-HR7G62IE.mjs +785 -0
- package/packages/core/dist/chunk-HR7G62IE.mjs.map +1 -0
- package/packages/core/dist/chunk-HY7H3CQM.mjs +127 -0
- package/packages/core/dist/chunk-HY7H3CQM.mjs.map +1 -0
- package/packages/core/dist/chunk-S4YWKV4G.mjs +48 -0
- package/packages/core/dist/chunk-S4YWKV4G.mjs.map +1 -0
- package/packages/core/dist/chunk-TFLPUZ56.mjs +1571 -0
- package/packages/core/dist/chunk-TFLPUZ56.mjs.map +1 -0
- package/packages/core/dist/chunk-TZISEVLQ.mjs +390 -0
- package/packages/core/dist/chunk-TZISEVLQ.mjs.map +1 -0
- package/packages/core/dist/chunk-U2BGPESY.mjs +150 -0
- package/packages/core/dist/chunk-U2BGPESY.mjs.map +1 -0
- package/packages/core/dist/chunk-VTIB5MDK.mjs +304 -0
- package/packages/core/dist/chunk-VTIB5MDK.mjs.map +1 -0
- package/packages/core/dist/chunk-VU6O5QAH.mjs +99 -0
- package/packages/core/dist/chunk-VU6O5QAH.mjs.map +1 -0
- package/packages/core/dist/chunk-Y56BPA3B.mjs +990 -0
- package/packages/core/dist/chunk-Y56BPA3B.mjs.map +1 -0
- package/packages/core/dist/chunk-YWAOOXLR.mjs +475 -0
- package/packages/core/dist/chunk-YWAOOXLR.mjs.map +1 -0
- package/packages/core/dist/diff.cjs +993 -0
- package/packages/core/dist/diff.cjs.map +1 -0
- package/packages/core/dist/diff.d.cts +82 -0
- package/packages/core/dist/diff.d.ts +82 -0
- package/packages/core/dist/diff.mjs +5 -0
- package/packages/core/dist/diff.mjs.map +1 -0
- package/packages/core/dist/exporters.cjs +1228 -0
- package/packages/core/dist/exporters.cjs.map +1 -0
- package/packages/core/dist/exporters.d.cts +114 -0
- package/packages/core/dist/exporters.d.ts +114 -0
- package/packages/core/dist/exporters.mjs +6 -0
- package/packages/core/dist/exporters.mjs.map +1 -0
- package/packages/core/dist/index.cjs +5542 -2218
- package/packages/core/dist/index.cjs.map +1 -1
- package/packages/core/dist/index.d.cts +113 -908
- package/packages/core/dist/index.d.ts +113 -908
- package/packages/core/dist/index.mjs +1048 -5403
- package/packages/core/dist/index.mjs.map +1 -1
- package/packages/core/dist/inspect-event-Des4JDHo.d.cts +41 -0
- package/packages/core/dist/inspect-event-Des4JDHo.d.ts +41 -0
- package/packages/core/dist/log-config-BnH8Ykcb.d.cts +33 -0
- package/packages/core/dist/log-config-C1GcJPIM.d.ts +33 -0
- package/packages/core/dist/logs.cjs +1007 -0
- package/packages/core/dist/logs.cjs.map +1 -0
- package/packages/core/dist/logs.d.cts +138 -0
- package/packages/core/dist/logs.d.ts +138 -0
- package/packages/core/dist/logs.mjs +6 -0
- package/packages/core/dist/logs.mjs.map +1 -0
- package/packages/core/dist/persisted-inspect-event-0kaRADsp.d.cts +56 -0
- package/packages/core/dist/persisted-inspect-event-DiFto0K2.d.ts +56 -0
- package/packages/core/dist/persisted.cjs +1055 -0
- package/packages/core/dist/persisted.cjs.map +1 -0
- package/packages/core/dist/persisted.d.cts +111 -0
- package/packages/core/dist/persisted.d.ts +111 -0
- package/packages/core/dist/persisted.mjs +7 -0
- package/packages/core/dist/persisted.mjs.map +1 -0
- package/packages/core/dist/readers.cjs +2590 -0
- package/packages/core/dist/readers.cjs.map +1 -0
- package/packages/core/dist/readers.d.cts +80 -0
- package/packages/core/dist/readers.d.ts +80 -0
- package/packages/core/dist/readers.mjs +9 -0
- package/packages/core/dist/readers.mjs.map +1 -0
- package/packages/core/dist/types-DB8jB6Jg.d.cts +232 -0
- package/packages/core/dist/types-tSix7tfv.d.ts +232 -0
- package/packages/core/dist/writers.cjs +997 -0
- package/packages/core/dist/writers.cjs.map +1 -0
- package/packages/core/dist/writers.d.cts +62 -0
- package/packages/core/dist/writers.d.ts +62 -0
- package/packages/core/dist/writers.mjs +9 -0
- package/packages/core/dist/writers.mjs.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,70 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.6.0
|
|
4
|
+
|
|
5
|
+
Released **2026-06-25**.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added experimental `agent-inspect/writers` subpath with `TraceWriter`, `fileWriter`, `bufferedFileWriter`, `compositeWriter`, `memoryWriter`, and `nullWriter` as the first v1.6 runtime foundation slice.
|
|
10
|
+
- Added experimental `createInspectorRuntime()` as the low-level instance-scoped runtime foundation.
|
|
11
|
+
- Added experimental `createInspector()` public instance API for isolated local tracing with explicit writers.
|
|
12
|
+
- Added experimental `agent-inspect/readers` subpath with the `TraceReader` contract, deterministic format detection, `readTrace()`, and `openTrace()` for future local ingestion readers.
|
|
13
|
+
- Added the default AgentInspect JSONL reader behind `readTrace()` / `openTrace()` for v0.1, v0.2, and mixed local trace files.
|
|
14
|
+
- Added local OpenInference JSON and OTLP JSON readers behind `agent-inspect/readers`.
|
|
15
|
+
- Added `agent-inspect open` for local AgentInspect JSONL, OpenInference JSON, OTLP JSON, directory, and stdin ingestion through the canonical reader pipeline.
|
|
16
|
+
- Added deterministic runtime/universal-ingestion recipe coverage for memory writer, buffered writer, `createInspector()`, explicit formats, stdin, and safe shutdown.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Shared inspection commands now route AgentInspect JSONL loading through the canonical reader pipeline where compatible.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Corrects the published CLI version path so `agent-inspect --version` reports the public package version.
|
|
25
|
+
- Makes `list`, `stats`, and `search` use the canonical dual-format read path for v0.1 and v0.2 trace files.
|
|
26
|
+
- Applies `report --redaction-profile share|strict` to the complete report, not only the execution tree section.
|
|
27
|
+
- Preserves mixed v0.1/v0.2 source ordering during normalization.
|
|
28
|
+
- Preserves error stack fidelity when converting persisted v0.2 events; `error.name` is no longer mapped to v0.1 `stack`.
|
|
29
|
+
- Preserves supported token usage fields across converters and inspection summaries: `input`, `output`, `total`, and `cached`.
|
|
30
|
+
|
|
31
|
+
### Notes
|
|
32
|
+
|
|
33
|
+
- Manual trace writing remains `schemaVersion: "0.1"`.
|
|
34
|
+
- v0.2 remains an experimental persisted-event foundation and dual-read input format, not the default writer.
|
|
35
|
+
- No provider pricing, token counting, cost engine, vendor upload, hosted ingestion, replay, or default telemetry behavior is included.
|
|
36
|
+
- This release includes corrective work accumulated after v1.5.0 plus the v1.6.0 runtime/reader foundation.
|
|
37
|
+
|
|
38
|
+
## 1.5.0
|
|
39
|
+
|
|
40
|
+
Released **2026-06-24**.
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
|
|
44
|
+
- Added non-breaking package subpath exports: `agent-inspect/advanced`, `/persisted`, `/logs`, `/exporters`, `/diff` (root `"."` export unchanged).
|
|
45
|
+
- Added `agent-inspect what <runId>` — concise local run summary (`--json`, `--no-correlation`).
|
|
46
|
+
- Added `agent-inspect report <runId>` — markdown/HTML inspection report (`what` + timeline + execution tree).
|
|
47
|
+
- Added core helpers: `buildRunWhatSummary`, `renderRunWhat`, `buildRunReport`.
|
|
48
|
+
- Added canonical dual-format read path: `parseTraceJsonl`, `persistedInspectEventToTraceEvents`; `readTraceEvents` accepts v0.1 and v0.2 JSONL.
|
|
49
|
+
- Added [TRACE-VOCABULARY-V1.5.md](docs/proposals/TRACE-VOCABULARY-V1.5.md) RFC and `fixtures/traces-v0.2/llm-tokens-and-streaming.jsonl`.
|
|
50
|
+
- Added [what-report-inspect recipe](examples/recipes/what-report-inspect/) and CI artifact updates for `what`/`report`.
|
|
51
|
+
|
|
52
|
+
### Changed
|
|
53
|
+
|
|
54
|
+
- Inspection CLI commands (`view`, `timeline`, `stats`, `search`, `diff`, `export`, `what`, `report`) use shared dual-format read path (v0.1 + v0.2).
|
|
55
|
+
|
|
56
|
+
### Notes
|
|
57
|
+
|
|
58
|
+
- Manual trace writing remains `schemaVersion: "0.1"`.
|
|
59
|
+
- v0.2 read is normalization for inspection — not a write-path switch.
|
|
60
|
+
- Token fields in reports are user-supplied metadata only; core does not count tokens.
|
|
61
|
+
- No vendor upload, hosted dashboard, or cost engine.
|
|
62
|
+
- Linked release aligns `@agent-inspect/tui` with `agent-inspect` and `@agent-inspect/langchain` (all **1.5.0**).
|
|
63
|
+
|
|
3
64
|
## 1.4.0
|
|
4
65
|
|
|
66
|
+
Released **2026-06-12**.
|
|
67
|
+
|
|
5
68
|
### Added
|
|
6
69
|
|
|
7
70
|
- Added `docs/CI-ARTIFACTS.md` and `examples/recipes/github-actions-artifact/` for CI trace artifact workflows.
|
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ The tool starts with **manual traces** and **existing structured logs**, and ext
|
|
|
10
10
|
|
|
11
11
|
**No account. No cloud upload. No dashboard required.**
|
|
12
12
|
|
|
13
|
+
**Visual demos:** [docs/SCREENSHOTS.md](docs/SCREENSHOTS.md) — curated terminal recordings (synthetic fixtures only).
|
|
14
|
+
|
|
13
15
|
## Why agent-inspect exists
|
|
14
16
|
|
|
15
17
|
AI agents are no longer single function calls. They plan, call tools, invoke LLMs, branch, retry, fail, and run work in parallel. **Console logs are flat**; reconstructing causality from a wall of lines is slow and error-prone.
|
|
@@ -20,7 +22,7 @@ agent-inspect gives those runs **structure**: an **execution tree** you can read
|
|
|
20
22
|
|
|
21
23
|
## Install
|
|
22
24
|
|
|
23
|
-
Current npm release: **1.
|
|
25
|
+
Current npm release: **1.6.0** (`agent-inspect`, `@agent-inspect/langchain`, `@agent-inspect/tui` — all aligned).
|
|
24
26
|
|
|
25
27
|
```bash
|
|
26
28
|
npm install agent-inspect
|
|
@@ -109,18 +111,19 @@ await maybeInspectRun("eval-case-42", async () => runAgent());
|
|
|
109
111
|
AGENT_INSPECT=1 node eval-runner.mjs
|
|
110
112
|
```
|
|
111
113
|
|
|
112
|
-
## What you can do today (v1.
|
|
114
|
+
## What you can do today (v1.6.0)
|
|
113
115
|
|
|
114
116
|
- **Trace manually** with `inspectRun`, `step`, `step.llm`, `step.tool`, and `observe` — local JSONL under `.agent-inspect/` by default.
|
|
115
117
|
- **Toggle tracing** with `maybeInspectRun` and `AGENT_INSPECT=1` in eval harnesses or CI.
|
|
116
118
|
- **Correlate runs** with optional `correlationId`, `requestId`, `decisionId`, and `groupId` on `run_started` metadata.
|
|
117
119
|
- **Redact before disk** with default key-based redaction, or choose `redactionProfile`: `local`, `share`, or `strict`.
|
|
118
|
-
- **Inspect from the CLI** — `list`, `view`, `clean`, `logs`, `tail`, `export`, `diff`, `timeline`, `stats`, `search`.
|
|
120
|
+
- **Inspect from the CLI** — `list`, `view`, `clean`, `logs`, `tail`, `export`, `open`, `diff`, `timeline`, `stats`, `search`, `what`, `report`.
|
|
119
121
|
- **Export share-safe copies** — `export --redaction-profile share` (or `strict`) writes local Markdown/HTML/OpenInference/OTLP JSON only.
|
|
120
122
|
- **Parse structured logs** you already emit (JSON first-class; log4js best-effort).
|
|
121
123
|
- **Optional LangChain adapter** — metadata-only by default; optional `persist: true` and `stream: true` streaming metadata (no full token capture by default).
|
|
122
124
|
- **Optional TUI** — `view --tui` when `@agent-inspect/tui` is installed.
|
|
123
125
|
- **Persisted-event foundation (v1.2.0+)** — in-memory `PersistedInspectEvent` converters; manual writing stays `schemaVersion: "0.1"`.
|
|
126
|
+
- **Experimental v1.6.0 APIs** — `agent-inspect/writers`, `agent-inspect/readers`, `createInspector()`, and `agent-inspect open` for local AgentInspect/OpenInference/OTLP ingestion.
|
|
124
127
|
|
|
125
128
|
Nothing uploads traces by default. Review exports before sharing — see [safe trace sharing](docs/SAFE-TRACE-SHARING.md).
|
|
126
129
|
|
|
@@ -128,6 +131,10 @@ Nothing uploads traces by default. Review exports before sharing — see [safe t
|
|
|
128
131
|
|
|
129
132
|
Each run produces a **JSONL** trace: `run_started` / `run_completed`, `step_started` / `step_completed`, with **nested steps**, **tool/LLM** types where you use `step.tool` / `step.llm`, and **durations** on completed steps. Failures are recorded on `step_completed` with `status: "error"` (there is no separate `step_failed` event). See [docs/SCHEMA.md](docs/SCHEMA.md).
|
|
130
133
|
|
|
134
|
+

|
|
135
|
+
|
|
136
|
+
*Synthetic demo — [examples/02-nested-steps](examples/02-nested-steps/README.md). More visuals: [SCREENSHOTS.md](docs/SCREENSHOTS.md).*
|
|
137
|
+
|
|
131
138
|
## Works with structured logs you already have
|
|
132
139
|
|
|
133
140
|
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.
|
|
@@ -152,6 +159,8 @@ npx agent-inspect logs ./agent.log --config agent-inspect.logs.json
|
|
|
152
159
|
- **Flat timeline by default**; nesting when parent relationships are explicit or configured.
|
|
153
160
|
- **Confidence labels** (`explicit`, `correlated`, `heuristic`, `unknown`) describe how attribution was inferred.
|
|
154
161
|
|
|
162
|
+
**Visual:** JSON log → tree recording is [documented in SCREENSHOTS.md](docs/SCREENSHOTS.md#json-logs--tree) (re-record pending; command above is the canonical flow).
|
|
163
|
+
|
|
155
164
|
More detail: [docs/LOGS.md](docs/LOGS.md) · [docs/LOG-TO-TREE-QUICKSTART.md](docs/LOG-TO-TREE-QUICKSTART.md) · [docs/LOGGING-PLAYBOOK.md](docs/LOGGING-PLAYBOOK.md) (pino, log4js, NestJS).
|
|
156
165
|
|
|
157
166
|
## CLI at a glance
|
|
@@ -164,10 +173,17 @@ More detail: [docs/LOGS.md](docs/LOGS.md) · [docs/LOG-TO-TREE-QUICKSTART.md](do
|
|
|
164
173
|
| `logs` | Turn existing structured logs into a local tree/timeline |
|
|
165
174
|
| `tail` | Watch structured logs while the app runs |
|
|
166
175
|
| `export` | Write Markdown / HTML / OpenInference-compatible JSON / OTLP JSON **locally** |
|
|
176
|
+
| `open` | Read AgentInspect JSONL, OpenInference JSON, or OTLP JSON locally |
|
|
167
177
|
| `diff` | Compare two local runs (read-only) |
|
|
168
178
|
| `timeline` | Chronological view of one run |
|
|
169
179
|
| `stats` | Local aggregates over a trace directory |
|
|
170
180
|
| `search` | Deterministic search over local traces |
|
|
181
|
+
| `what` | Concise summary of one run |
|
|
182
|
+
| `report` | Markdown/HTML inspection report (what + timeline + tree) |
|
|
183
|
+
|
|
184
|
+

|
|
185
|
+
|
|
186
|
+
*Synthetic demo — `agent-inspect timeline` on [fixtures/traces](fixtures/traces). Gallery: [SCREENSHOTS.md](docs/SCREENSHOTS.md).*
|
|
171
187
|
|
|
172
188
|
Full flags and behavior: [docs/CLI.md](docs/CLI.md).
|
|
173
189
|
|
|
@@ -182,16 +198,24 @@ Full flags and behavior: [docs/CLI.md](docs/CLI.md).
|
|
|
182
198
|
|
|
183
199
|
## Stable foundation (AgentInspect 1.x)
|
|
184
200
|
|
|
185
|
-
**agent-inspect 1.x** (current: **1.
|
|
201
|
+
**agent-inspect 1.x** (current: **1.6.0**) is the **local-first trace workbench** for TypeScript AI agents:
|
|
186
202
|
|
|
187
203
|
- Instrument runs with `inspectRun` and `step`
|
|
188
204
|
- Write **local JSONL traces** (`schemaVersion: "0.1"` — compatibility retained)
|
|
189
|
-
- Inspect with **`list`**, **`view`**, **`clean`**, **`logs`**, **`tail`**, **`export`**, **`diff`**
|
|
205
|
+
- Inspect with **`list`**, **`view`**, **`clean`**, **`logs`**, **`tail`**, **`export`**, **`diff`**, **`timeline`**, **`stats`**, **`search`**
|
|
190
206
|
|
|
191
207
|
**Stable APIs:** `inspectRun()`, `maybeInspectRun()`, `step()`, `step.llm()`, `step.tool()`, `observe()`, `getCurrentCorrelationMetadata()`.
|
|
192
208
|
|
|
193
209
|
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).
|
|
194
210
|
|
|
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
|
+
|
|
213
|
+
**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
|
+
|
|
215
|
+
**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).
|
|
216
|
+
|
|
217
|
+
**Shipped in 1.4.0:** CI artifact recipe ([docs/CI-ARTIFACTS.md](docs/CI-ARTIFACTS.md)); `timeline`, `stats`, and `search` CLI; core helpers `buildRunTimeline`, `buildTraceStats`, `searchTraces`. Linked release aligns all three npm packages at **1.4.0**.
|
|
218
|
+
|
|
195
219
|
**Shipped in 1.3.0:** correlation metadata; redaction profiles (`local` / `share` / `strict`); `export --redaction-profile`; LangChain `stream: true` metadata (chunk counts, duration — no full token capture by default).
|
|
196
220
|
|
|
197
221
|
**Also in 1.x** (local-first extensions):
|
|
@@ -264,6 +288,9 @@ The TUI is available as a separate optional package; its programmatic API is exp
|
|
|
264
288
|
| [examples/recipes/nestjs-json-logging](examples/recipes/nestjs-json-logging) | NestJS JSON logs |
|
|
265
289
|
| [examples/recipes/retry-fallback](examples/recipes/retry-fallback) | Fallback pattern |
|
|
266
290
|
| [examples/recipes/parallel-tools](examples/recipes/parallel-tools) | Parallel tools |
|
|
291
|
+
| [examples/recipes/github-actions-artifact](examples/recipes/github-actions-artifact) | CI trace artifacts |
|
|
292
|
+
| [examples/recipes/what-report-inspect](examples/recipes/what-report-inspect/) | `what` + `report` inspection |
|
|
293
|
+
| [examples/recipes/runtime-and-ingestion](examples/recipes/runtime-and-ingestion/) | v1.6 runtime writers + universal ingestion |
|
|
267
294
|
|
|
268
295
|
**Recipes** are deterministic and require **no external services** by default. Index: [examples/README.md](examples/README.md), [examples/recipes/README.md](examples/recipes/README.md).
|
|
269
296
|
|
|
@@ -290,7 +317,8 @@ For a detailed comparison, see [Compare with other tools](docs/COMPARE.md).
|
|
|
290
317
|
| [Install smoke test](docs/INSTALL-SMOKE-TEST.md) | [CLI](docs/CLI.md) | [Security](SECURITY.md) |
|
|
291
318
|
| [Log-to-tree quickstart](docs/LOG-TO-TREE-QUICKSTART.md) | [Schema](docs/SCHEMA.md) | [Limitations](docs/LIMITATIONS.md) |
|
|
292
319
|
| [Logging playbook](docs/LOGGING-PLAYBOOK.md) | [Exports](docs/EXPORTS.md) | [Known issues](docs/KNOWN-ISSUES.md) |
|
|
293
|
-
| [
|
|
320
|
+
| [CI artifacts](docs/CI-ARTIFACTS.md) | [Adapters](docs/ADAPTERS.md) | [Compare with other tools](docs/COMPARE.md) |
|
|
321
|
+
| [Visual demos](docs/SCREENSHOTS.md) | [Examples](examples/README.md) | |
|
|
294
322
|
|
|
295
323
|
Also: [Architecture](docs/ARCHITECTURE.md) · [Logs & tail](docs/LOGS.md) · [Diff](docs/DIFF.md) · [Changelog](CHANGELOG.md) · [Roadmap](ROADMAP.md) · [Contributing](CONTRIBUTING.md) · [Good first issues](GOOD-FIRST-ISSUES.md)
|
|
296
324
|
|
package/docs/ADAPTERS.md
CHANGED
|
@@ -51,6 +51,10 @@ npx agent-inspect view <run-id> --dir ./.agent-inspect
|
|
|
51
51
|
npx agent-inspect export <run-id> --format markdown --redaction-profile share
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
*Synthetic demo — [examples/08-langchain-adapter](../../examples/08-langchain-adapter/README.md).*
|
|
57
|
+
|
|
54
58
|
**Persistence model (Strategy A):**
|
|
55
59
|
|
|
56
60
|
1. **Standalone session** — one AgentInspect run per callback instance until the root LangChain run completes.
|
|
@@ -121,6 +125,8 @@ npm install agent-inspect @agent-inspect/tui
|
|
|
121
125
|
npx agent-inspect view <run-id> --tui
|
|
122
126
|
```
|
|
123
127
|
|
|
128
|
+

|
|
129
|
+
|
|
124
130
|
Requires an interactive terminal. See [API.md](./API.md) §10.
|
|
125
131
|
|
|
126
132
|
---
|
package/docs/API.md
CHANGED
|
@@ -9,6 +9,16 @@ AgentInspect is a **local-first execution-tree debugger**. It is not a SaaS, not
|
|
|
9
9
|
- **Stable**: intended to be compatible across v1.x. Breaking changes require v2.0.
|
|
10
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.
|
|
11
11
|
|
|
12
|
+
**1.x subpath exports:** Additive subpaths (`/logs`, `/exporters`, `/persisted`, `/diff`, `/advanced`, `/writers`, `/readers`) 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).
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { inspectRun, step } from "agent-inspect";
|
|
16
|
+
import { parseLogsToTrees } from "agent-inspect/logs";
|
|
17
|
+
import { exportMarkdown } from "agent-inspect/exporters";
|
|
18
|
+
import { memoryWriter } from "agent-inspect/writers";
|
|
19
|
+
import { openTrace } from "agent-inspect/readers";
|
|
20
|
+
```
|
|
21
|
+
|
|
12
22
|
Notes:
|
|
13
23
|
|
|
14
24
|
- The core guarantee of v1.x is **stable local debugging**: manual tracing + CLI inspection.
|
|
@@ -31,7 +41,7 @@ import { inspectRun, maybeInspectRun, step, observe } from "agent-inspect";
|
|
|
31
41
|
- **`maxMetadataValueLength`**: max string length for metadata values (default `2000`).
|
|
32
42
|
- **`maxPreviewLength`**: max string length for preview-like keys containing `preview` (default `500`).
|
|
33
43
|
- **`maxEventBytes`**: max UTF-8 bytes per serialized JSONL event (default `65536`). Oversized events are truncated; instrumentation never throws into user code.
|
|
34
|
-
- **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
|
|
44
|
+
- **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.
|
|
35
45
|
- **`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.
|
|
36
46
|
- **`isAgentInspectEnabled(value?)`**: returns whether a string (or `process.env.AGENT_INSPECT`) matches an enable token.
|
|
37
47
|
- **`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.
|
|
@@ -164,11 +174,11 @@ Related types: `PersistedInspectEvent`, `PersistedEventSourceType`, `PersistedEv
|
|
|
164
174
|
|
|
165
175
|
- Manual trace **writing** remains `schemaVersion: "0.1"`.
|
|
166
176
|
- v0.2 is **not written by default**; use converters and `fixtures/traces-v0.2/` samples for validation.
|
|
167
|
-
-
|
|
177
|
+
- 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.
|
|
168
178
|
|
|
169
|
-
## 12. Local observability helpers (v1.4.0)
|
|
179
|
+
## 12. Local observability helpers (v1.4.0+)
|
|
170
180
|
|
|
171
|
-
Read-only helpers for timeline, stats, and search over manual
|
|
181
|
+
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.
|
|
172
182
|
|
|
173
183
|
- **`buildRunTimeline`**, **`renderTimeline`** — chronological run view; types `RunTimeline`, `TimelineEntry`
|
|
174
184
|
- **`buildTraceStats`**, **`renderTraceStats`** — directory aggregates; type `TraceStats`
|
|
@@ -176,23 +186,137 @@ Read-only helpers for timeline, stats, and search over manual `TraceEvent` JSONL
|
|
|
176
186
|
|
|
177
187
|
CLI wrappers: `agent-inspect timeline`, `stats`, `search` — see [CLI.md](./CLI.md).
|
|
178
188
|
|
|
179
|
-
## 13.
|
|
189
|
+
## 13. Report and what helpers (v1.5.0+)
|
|
190
|
+
|
|
191
|
+
Read-only helpers for concise inspection summaries and local reports:
|
|
192
|
+
|
|
193
|
+
- **`buildRunWhatSummary`**, **`renderRunWhat`** — summarize status, duration, step counts, correlation metadata, slowest step, errors, and supplied token usage.
|
|
194
|
+
- **`buildRunReport`** — render Markdown or HTML reports from local trace events.
|
|
195
|
+
|
|
196
|
+
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
|
+
|
|
198
|
+
## 14. Experimental trace writers (v1.6)
|
|
199
|
+
|
|
200
|
+
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
|
+
|
|
202
|
+
Import from `agent-inspect/writers`:
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
import {
|
|
206
|
+
bufferedFileWriter,
|
|
207
|
+
compositeWriter,
|
|
208
|
+
fileWriter,
|
|
209
|
+
memoryWriter,
|
|
210
|
+
nullWriter,
|
|
211
|
+
} from "agent-inspect/writers";
|
|
212
|
+
import type {
|
|
213
|
+
BufferedFileWriterOptions,
|
|
214
|
+
CompositeTraceWriterOptions,
|
|
215
|
+
FileTraceWriterOptions,
|
|
216
|
+
TraceWriter,
|
|
217
|
+
TraceWriterStats,
|
|
218
|
+
} from "agent-inspect/writers";
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
- **`TraceWriter`**: async `write(event)`, optional `flush()`, optional `close()`, optional `getStats()`.
|
|
222
|
+
- **`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.
|
|
223
|
+
- **`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.
|
|
224
|
+
- **`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.
|
|
225
|
+
- **`memoryWriter()`**: stores cloned `PersistedInspectEvent` rows in memory for tests, adapter fixtures, and eval harnesses.
|
|
226
|
+
- **`nullWriter()`**: accepts events without retaining them for disabled mode, overhead comparisons, and no-output tests.
|
|
227
|
+
|
|
228
|
+
No network writer or vendor sink exists in this package.
|
|
229
|
+
|
|
230
|
+
## 15. Experimental inspector API/runtime (v1.6)
|
|
231
|
+
|
|
232
|
+
`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
|
+
|
|
234
|
+
Import from `agent-inspect/advanced`:
|
|
235
|
+
|
|
236
|
+
```ts
|
|
237
|
+
import { createInspector } from "agent-inspect/advanced";
|
|
238
|
+
import { memoryWriter } from "agent-inspect/writers";
|
|
239
|
+
|
|
240
|
+
const writer = memoryWriter();
|
|
241
|
+
const inspector = createInspector({
|
|
242
|
+
writer,
|
|
243
|
+
capture: { onSuccess: "metadata-only", onError: "metadata-only" },
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
await inspector.run("support-agent", async () => {
|
|
247
|
+
await inspector.step("plan", async () => "ok");
|
|
248
|
+
await inspector.tool("retrieve-policy", async () => "policy");
|
|
249
|
+
return inspector.llm("fixture-model", async () => "done");
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
await inspector.flush();
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Public methods:
|
|
256
|
+
|
|
257
|
+
- **`run(name, fn, options?)`**: starts an isolated run context and writes run lifecycle events.
|
|
258
|
+
- **`step(name, fn, options?)`**: writes nested step lifecycle events when called inside the same inspector's run context; outside a context it passes through.
|
|
259
|
+
- **`tool(name, fn, options?)`** / **`llm(name, fn, options?)`**: convenience wrappers that set `type` and metadata.
|
|
260
|
+
- **`observe(name, fn, options?)`**: returns an async wrapper that records the function call as an inspector step.
|
|
261
|
+
- **`getDiagnostics()`**: returns instrumentation error counts and writer stats without requiring direct runtime access.
|
|
262
|
+
- **`flush()`** / **`close()`**: delegate to the configured writer through the runtime.
|
|
263
|
+
|
|
264
|
+
`capture` is explicit and metadata-only. `onSuccess: "metadata-only"` records safe type/length/key-count summaries in `outputSummary`; `onError: "metadata-only"` records thrown-value type/name summaries. It does not store raw return values, prompts, outputs, or thrown objects. Use `"none"` to disable a capture side.
|
|
265
|
+
|
|
266
|
+
`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 })`.
|
|
267
|
+
|
|
268
|
+
`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`.
|
|
269
|
+
|
|
270
|
+
These APIs are experimental during v1.x. They do not add a default network writer or vendor sink.
|
|
271
|
+
|
|
272
|
+
## 16. Experimental trace readers (v1.6)
|
|
273
|
+
|
|
274
|
+
`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
|
+
|
|
276
|
+
Import from `agent-inspect/readers`:
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
import {
|
|
280
|
+
DEFAULT_TRACE_READERS,
|
|
281
|
+
agentInspectJsonlReader,
|
|
282
|
+
detectTraceFormat,
|
|
283
|
+
openInferenceJsonReader,
|
|
284
|
+
openTrace,
|
|
285
|
+
otlpJsonReader,
|
|
286
|
+
readTrace,
|
|
287
|
+
} from "agent-inspect/readers";
|
|
288
|
+
import type { TraceReader } from "agent-inspect/readers";
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
- **`TraceInput`**: file, directory, string, buffer, or stdin input descriptor.
|
|
292
|
+
- **`TraceReader`**: experimental reader interface with `format`, `detect(input)`, and `read(input)`.
|
|
293
|
+
- **`detectTraceFormat(input, { readers?, format? })`**: deterministic, conservative format detection. Explicit `format` acts as an override only when a matching reader is registered.
|
|
294
|
+
- **`readTrace(input, { readers?, format? })`**: detects a reader and returns `TraceReadResult`; unsupported or ambiguous input throws `TraceReadError`.
|
|
295
|
+
- **`openTrace(input, options?)`**: alias for `readTrace()` and the API path used by the universal `agent-inspect open` command.
|
|
296
|
+
- **`agentInspectJsonlReader`**: built-in local AgentInspect JSONL reader for v0.1, v0.2, and mixed files/directories.
|
|
297
|
+
- **`openInferenceJsonReader`**: local OpenInference JSON compatibility reader. Prompt/output-like attributes are summarized and bounded rather than stored as raw content.
|
|
298
|
+
- **`otlpJsonReader`**: local OTLP/HTTP JSON trace payload reader. Resource, scope, span, status, event, and parent metadata are preserved where possible with warnings for unsupported fields.
|
|
299
|
+
- **`DEFAULT_TRACE_READERS`**: ordered built-in reader registry used when no custom `readers` array is supplied.
|
|
300
|
+
|
|
301
|
+
The reader contract does not silently accept arbitrary JSON and does not add OTel SDK, database, hosted ingestion, or network upload dependencies.
|
|
302
|
+
|
|
303
|
+
## 17. Deprecated APIs
|
|
180
304
|
|
|
181
305
|
No deprecated APIs are declared as of 1.4.0.
|
|
182
306
|
|
|
183
|
-
##
|
|
307
|
+
## 18. Removal / deprecation policy
|
|
184
308
|
|
|
185
309
|
- Stable APIs are not removed in v1.x.
|
|
186
310
|
- 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.
|
|
187
311
|
|
|
188
|
-
##
|
|
312
|
+
## 19. Backward compatibility policy
|
|
189
313
|
|
|
190
314
|
- Manual trace JSONL (`schemaVersion: "0.1"`) remains readable.
|
|
191
315
|
- Additive schema changes are allowed in minor versions.
|
|
192
316
|
- Breaking changes require a major version.
|
|
193
317
|
- Unknown fields should be ignored where safe.
|
|
194
318
|
|
|
195
|
-
##
|
|
319
|
+
## 20. Examples
|
|
196
320
|
|
|
197
321
|
### Minimal manual trace
|
|
198
322
|
|
|
@@ -206,4 +330,3 @@ await inspectRun("demo-agent", async () => {
|
|
|
206
330
|
return { plan, hits, answer };
|
|
207
331
|
});
|
|
208
332
|
```
|
|
209
|
-
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -39,6 +39,10 @@ See [SECURITY.md](../SECURITY.md) and [LIMITATIONS.md](./LIMITATIONS.md).
|
|
|
39
39
|
|
|
40
40
|
See [ADAPTERS.md](./ADAPTERS.md).
|
|
41
41
|
|
|
42
|
+
### Architecture proposals
|
|
43
|
+
|
|
44
|
+
Maintainer-owned RFCs and planning proposals are indexed in [proposals/README.md](./proposals/README.md). The active post-v1.5 roadmap is [implementation/ROADMAP-V1.6-TO-V3.md](./implementation/ROADMAP-V1.6-TO-V3.md).
|
|
45
|
+
|
|
42
46
|
### Where to read next
|
|
43
47
|
|
|
44
48
|
- New users: [GETTING-STARTED.md](./GETTING-STARTED.md)
|
package/docs/CLI.md
CHANGED
|
@@ -25,10 +25,13 @@ Core commands:
|
|
|
25
25
|
- `logs` — parse structured logs into local execution trees
|
|
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
|
+
- `open` — read supported local trace files, directories, or stdin through the canonical reader pipeline
|
|
28
29
|
- `diff` — compare two manual traces (local, read-only)
|
|
29
30
|
- `timeline` — chronological view of one run (local JSONL)
|
|
30
31
|
- `stats` — local aggregate stats over a trace directory
|
|
31
32
|
- `search` — deterministic local search over traces
|
|
33
|
+
- `what` — concise summary of a single run (local JSONL)
|
|
34
|
+
- `report` — markdown or HTML inspection report for a single run
|
|
32
35
|
|
|
33
36
|
## 2. Environment variables
|
|
34
37
|
|
|
@@ -190,7 +193,36 @@ npx agent-inspect export <run-id> --format markdown --redaction-profile share
|
|
|
190
193
|
npx agent-inspect export <run-id> --format html --redaction-profile strict
|
|
191
194
|
```
|
|
192
195
|
|
|
193
|
-
### 6.7 `
|
|
196
|
+
### 6.7 `open`
|
|
197
|
+
|
|
198
|
+
Open any local trace format supported by the canonical reader pipeline. This command is read-only: it does not mutate input files, upload traces, or run agents.
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
agent-inspect open [input] [options]
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
`input` may be a file, directory, `-` for stdin, or omitted to read stdin.
|
|
205
|
+
|
|
206
|
+
Options:
|
|
207
|
+
|
|
208
|
+
- `--format <agent-inspect-jsonl|openinference-json|otlp-json>`: explicit reader format override
|
|
209
|
+
- `--run <run-id>`: select a run when input contains multiple runs
|
|
210
|
+
- `--json`: print structured JSON output
|
|
211
|
+
- `--diagnostics`: print reader warnings and unsupported fields in human output
|
|
212
|
+
|
|
213
|
+
Examples:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
npx agent-inspect open fixtures/traces/minimal-success.jsonl --format agent-inspect-jsonl
|
|
217
|
+
npx agent-inspect open fixtures/traces-v0.2/manual-basic.jsonl --format agent-inspect-jsonl
|
|
218
|
+
npx agent-inspect open packages/core/test/fixtures/openinference-basic.json --format openinference-json
|
|
219
|
+
npx agent-inspect open packages/core/test/fixtures/otlp-basic.json --format otlp-json
|
|
220
|
+
cat packages/core/test/fixtures/openinference-basic.json | npx agent-inspect open - --format openinference-json --json
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
When a directory or payload contains multiple runs, `open` lists the run ids and exits until you pass `--run <run-id>`.
|
|
224
|
+
|
|
225
|
+
### 6.8 `diff`
|
|
194
226
|
|
|
195
227
|
Compare two manual trace runs. Diff is **local** and **read-only** (does not rerun agents).
|
|
196
228
|
|
|
@@ -254,7 +286,7 @@ Differences:
|
|
|
254
286
|
|
|
255
287
|
More examples, including timing-only and structure-only diffs, are in `docs/DIFF.md`.
|
|
256
288
|
|
|
257
|
-
### 6.
|
|
289
|
+
### 6.9 `timeline`
|
|
258
290
|
|
|
259
291
|
Chronological step list for one manual trace. Read-only; does not mutate JSONL files.
|
|
260
292
|
|
|
@@ -268,7 +300,9 @@ Options:
|
|
|
268
300
|
- `--json` — structured `RunTimeline` JSON
|
|
269
301
|
- `--focus slow` — show only the slowest steps by duration (top N)
|
|
270
302
|
|
|
271
|
-
|
|
303
|
+

|
|
304
|
+
|
|
305
|
+
### 6.10 `stats`
|
|
272
306
|
|
|
273
307
|
Local aggregate statistics over trace files in a directory. Read-only.
|
|
274
308
|
|
|
@@ -284,7 +318,11 @@ Options:
|
|
|
284
318
|
- `--group-id <id>` — filter by `run_started.metadata.groupId`
|
|
285
319
|
- `--json`
|
|
286
320
|
|
|
287
|
-
|
|
321
|
+

|
|
322
|
+
|
|
323
|
+
Use `--correlation-id` or `--group-id` to filter runs by `run_started` metadata (see [API.md](./API.md)).
|
|
324
|
+
|
|
325
|
+
### 6.11 `search`
|
|
288
326
|
|
|
289
327
|
Deterministic search over local traces (substring / exact filters). No semantic search.
|
|
290
328
|
|
|
@@ -312,6 +350,62 @@ npx agent-inspect search --kind tool --name search
|
|
|
312
350
|
npx agent-inspect search --duration ">100ms" --json
|
|
313
351
|
```
|
|
314
352
|
|
|
353
|
+

|
|
354
|
+
|
|
355
|
+
### 6.12 `what`
|
|
356
|
+
|
|
357
|
+
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).
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
agent-inspect what <run-id> [options]
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Options:
|
|
364
|
+
|
|
365
|
+
- `--dir <path>`
|
|
366
|
+
- `--json` — structured `RunWhatSummary` JSON
|
|
367
|
+
- `--no-correlation` — omit correlation ids from human output
|
|
368
|
+
|
|
369
|
+
Example:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
npx agent-inspect what minimal-success --dir fixtures/traces
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
Sample output:
|
|
376
|
+
|
|
377
|
+
```
|
|
378
|
+
What: minimal-success
|
|
379
|
+
Status: success · Duration: 120ms · Steps: 1 (1 logic)
|
|
380
|
+
Outcome: Completed successfully.
|
|
381
|
+
Slowest: plan (100ms, logic)
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### 6.13 `report`
|
|
385
|
+
|
|
386
|
+
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).
|
|
387
|
+
|
|
388
|
+
```bash
|
|
389
|
+
agent-inspect report <run-id> [options]
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Options:
|
|
393
|
+
|
|
394
|
+
- `--dir <path>`
|
|
395
|
+
- `--format <markdown|html>` — default `markdown`
|
|
396
|
+
- `-o, --output <path>` — write to file
|
|
397
|
+
- `--json` — JSON wrapper (includes `content` when writing to stdout)
|
|
398
|
+
- `--include-attributes` — bounded attributes in the execution tree section
|
|
399
|
+
- `--no-errors` — omit error details from the execution tree section
|
|
400
|
+
- `--no-correlation` — omit correlation ids from what section
|
|
401
|
+
- `--redaction-profile <local|share|strict>` — key-based redaction profile applied to the complete report (default `local`); review output before sharing
|
|
402
|
+
|
|
403
|
+
Example:
|
|
404
|
+
|
|
405
|
+
```bash
|
|
406
|
+
npx agent-inspect report minimal-success --dir fixtures/traces --format html -o report.html
|
|
407
|
+
```
|
|
408
|
+
|
|
315
409
|
## 7. Optional TUI behavior
|
|
316
410
|
|
|
317
411
|
`view --tui` delegates to `@agent-inspect/tui` and requires an interactive terminal. If the package is not installed, the CLI prints a short install hint.
|
|
@@ -326,4 +420,3 @@ See:
|
|
|
326
420
|
|
|
327
421
|
- `docs/KNOWN-ISSUES.md`
|
|
328
422
|
- `docs/LIMITATIONS.md`
|
|
329
|
-
|
package/docs/DIFF.md
CHANGED
|
@@ -10,6 +10,14 @@ Notes:
|
|
|
10
10
|
- `diff` is read-only and does **not** rerun agents; “differences” do not necessarily imply failure (command errors do).
|
|
11
11
|
- `diff` reads local trace files only. It is useful for local debugging, but it is not production APM or hosted observability.
|
|
12
12
|
|
|
13
|
+

|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
agent-inspect diff minimal-success minimal-error --dir fixtures/traces
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
More visuals: [SCREENSHOTS.md](./SCREENSHOTS.md).
|
|
20
|
+
|
|
13
21
|
## CLI examples
|
|
14
22
|
|
|
15
23
|
The examples below use the checked-in fixture traces, so they are safe to copy and run locally:
|
package/docs/EXPORTS.md
CHANGED
|
@@ -23,6 +23,19 @@ Full flags: [CLI.md](./CLI.md) §6.6.
|
|
|
23
23
|
|
|
24
24
|
All formats are **compatibility-oriented** for local inspection and handoff — not guaranteed to match every vendor schema version.
|
|
25
25
|
|
|
26
|
+
### Markdown export
|
|
27
|
+
|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
agent-inspect export minimal-success --dir fixtures/traces --format markdown
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### HTML, OpenInference, OTLP
|
|
35
|
+
|
|
36
|
+
- **HTML:** export writes a local file; a rendered-report visual is pending re-record ([RECORDING.md](./assets/demos/RECORDING.md)). Use `agent-inspect export <run-id> --format html -o report.html` and open the file locally.
|
|
37
|
+
- **OpenInference / OTLP JSON:** compatibility-oriented shapes for local handoff — validate with `--validate` before sharing. No dedicated GIF; see format tables below.
|
|
38
|
+
|
|
26
39
|
## Common options
|
|
27
40
|
|
|
28
41
|
| Flag | Notes |
|
package/docs/GETTING-STARTED.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
AgentInspect is a **local-first execution-tree debugger** for TypeScript AI agents. It helps you produce and inspect an execution tree of steps, safely and deterministically, without uploading data anywhere.
|
|
4
4
|
|
|
5
|
+
**Visual demos:** [SCREENSHOTS.md](./SCREENSHOTS.md)
|
|
6
|
+
|
|
5
7
|
## 1. Install
|
|
6
8
|
|
|
7
9
|
```bash
|
|
@@ -58,6 +60,10 @@ await maybeInspectRun("eval-case-42", async () => {
|
|
|
58
60
|
AGENT_INSPECT=1 node eval-runner.mjs
|
|
59
61
|
```
|
|
60
62
|
|
|
63
|
+

|
|
64
|
+
|
|
65
|
+
*When `AGENT_INSPECT` is unset, no trace files are written.*
|
|
66
|
+
|
|
61
67
|
Enable tokens: `1`, `true`, `yes`, `on`, `enabled` (case-insensitive). Explicit `enabled: true | false` in options overrides the env var.
|
|
62
68
|
|
|
63
69
|
### Correlation metadata (v1.3.0+)
|
|
@@ -136,7 +142,19 @@ agent-inspect export minimal-success --dir fixtures/traces \
|
|
|
136
142
|
|
|
137
143
|
Exports are **local-only** and do not upload anywhere. Review output before sharing — see [SAFE-TRACE-SHARING.md](./SAFE-TRACE-SHARING.md).
|
|
138
144
|
|
|
139
|
-
## 8.
|
|
145
|
+
## 8. Local observability (v1.4.0+)
|
|
146
|
+
|
|
147
|
+
After traces exist under a directory:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
agent-inspect timeline <run-id> --dir ./.agent-inspect
|
|
151
|
+
agent-inspect stats --dir ./.agent-inspect --since 7d
|
|
152
|
+
agent-inspect search --dir ./.agent-inspect --status error --limit 10
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
For CI artifact workflows, see [CI-ARTIFACTS.md](./CI-ARTIFACTS.md) and [github-actions-artifact recipe](../examples/recipes/github-actions-artifact/).
|
|
156
|
+
|
|
157
|
+
## 9. Diff two runs
|
|
140
158
|
|
|
141
159
|
```bash
|
|
142
160
|
agent-inspect diff minimal-success minimal-error --dir fixtures/traces
|