agent-inspect 1.3.0 → 1.5.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 +47 -4
- package/README.md +59 -37
- package/docs/ADAPTERS.md +117 -31
- package/docs/API.md +24 -6
- package/docs/CLI.md +126 -1
- package/docs/DIFF.md +8 -0
- package/docs/EXPORTS.md +86 -15
- package/docs/GETTING-STARTED.md +48 -2
- package/docs/KNOWN-ISSUES.md +6 -0
- package/docs/LIMITATIONS.md +11 -3
- package/docs/LOGS.md +22 -0
- package/docs/SCHEMA.md +8 -5
- package/docs/SCREENSHOTS.md +190 -9
- package/package.json +51 -1
- package/packages/cli/dist/index.cjs +3253 -1662
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +3253 -1662
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/core/dist/advanced.cjs +1437 -0
- package/packages/core/dist/advanced.cjs.map +1 -0
- package/packages/core/dist/advanced.d.cts +159 -0
- package/packages/core/dist/advanced.d.ts +159 -0
- package/packages/core/dist/advanced.mjs +8 -0
- package/packages/core/dist/advanced.mjs.map +1 -0
- package/packages/core/dist/chunk-5EMIZZXD.mjs +907 -0
- package/packages/core/dist/chunk-5EMIZZXD.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-HY7H3CQM.mjs +127 -0
- package/packages/core/dist/chunk-HY7H3CQM.mjs.map +1 -0
- package/packages/core/dist/chunk-Q6EPNB3V.mjs +539 -0
- package/packages/core/dist/chunk-Q6EPNB3V.mjs.map +1 -0
- package/packages/core/dist/chunk-QPAU2TPA.mjs +785 -0
- package/packages/core/dist/chunk-QPAU2TPA.mjs.map +1 -0
- package/packages/core/dist/chunk-QX3ZMPUF.mjs +451 -0
- package/packages/core/dist/chunk-QX3ZMPUF.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-XDBND27A.mjs +975 -0
- package/packages/core/dist/chunk-XDBND27A.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 +81 -0
- package/packages/core/dist/diff.d.ts +81 -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 +113 -0
- package/packages/core/dist/exporters.d.ts +113 -0
- package/packages/core/dist/exporters.mjs +6 -0
- package/packages/core/dist/exporters.mjs.map +1 -0
- package/packages/core/dist/index.cjs +2982 -1829
- package/packages/core/dist/index.cjs.map +1 -1
- package/packages/core/dist/index.d.cts +201 -892
- package/packages/core/dist/index.d.ts +201 -892
- package/packages/core/dist/index.mjs +780 -4620
- package/packages/core/dist/index.mjs.map +1 -1
- package/packages/core/dist/log-config-BzGmDYum.d.cts +71 -0
- package/packages/core/dist/log-config-BzGmDYum.d.ts +71 -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 +137 -0
- package/packages/core/dist/logs.d.ts +137 -0
- package/packages/core/dist/logs.mjs +6 -0
- package/packages/core/dist/logs.mjs.map +1 -0
- package/packages/core/dist/persisted.cjs +1057 -0
- package/packages/core/dist/persisted.cjs.map +1 -0
- package/packages/core/dist/persisted.d.cts +160 -0
- package/packages/core/dist/persisted.d.ts +160 -0
- package/packages/core/dist/persisted.mjs +5 -0
- package/packages/core/dist/persisted.mjs.map +1 -0
- package/packages/core/dist/types-Bkt7LS01.d.ts +226 -0
- package/packages/core/dist/types-CNbheSdk.d.cts +226 -0
package/docs/EXPORTS.md
CHANGED
|
@@ -1,26 +1,97 @@
|
|
|
1
|
-
|
|
1
|
+
# Exports
|
|
2
2
|
|
|
3
|
-
AgentInspect
|
|
3
|
+
AgentInspect exports are **local-only**: they produce strings or files on disk. Nothing uploads to a vendor, collector, or hosted dashboard.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- **Schema + compatibility guarantees**: `docs/SCHEMA.md`
|
|
7
|
-
- **Safety / redaction notes**: `docs/CLI.md`, `SECURITY.md`, and `docs/SCHEMA.md` (redaction section)
|
|
5
|
+
Use exports to share run summaries in PRs, postmortems, or internal threads — **after reviewing** the output. See [SAFE-TRACE-SHARING.md](./SAFE-TRACE-SHARING.md).
|
|
8
6
|
|
|
9
|
-
##
|
|
7
|
+
## CLI
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
```bash
|
|
10
|
+
agent-inspect export <run-id> --format <markdown|html|openinference|otlp-json> [options]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Full flags: [CLI.md](./CLI.md) §6.6.
|
|
14
|
+
|
|
15
|
+
## Formats
|
|
16
|
+
|
|
17
|
+
| Format | Purpose |
|
|
18
|
+
| ------ | ------- |
|
|
19
|
+
| `markdown` | Human-readable tree for PRs, issues, docs |
|
|
20
|
+
| `html` | Standalone HTML snapshot for local viewing |
|
|
21
|
+
| `openinference` | OpenInference-compatible JSON (compatibility-oriented) |
|
|
22
|
+
| `otlp-json` | OTLP JSON shape (experimental; validate per backend) |
|
|
23
|
+
|
|
24
|
+
All formats are **compatibility-oriented** for local inspection and handoff — not guaranteed to match every vendor schema version.
|
|
25
|
+
|
|
26
|
+
### Markdown export
|
|
27
|
+
|
|
28
|
+

|
|
12
29
|
|
|
13
30
|
```bash
|
|
14
|
-
agent-inspect export
|
|
31
|
+
agent-inspect export minimal-success --dir fixtures/traces --format markdown
|
|
15
32
|
```
|
|
16
33
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- **
|
|
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
|
+
|
|
39
|
+
## Common options
|
|
40
|
+
|
|
41
|
+
| Flag | Notes |
|
|
42
|
+
| ---- | ----- |
|
|
43
|
+
| `--dir <path>` | Trace directory (default from `AGENT_INSPECT_TRACE_DIR` or `.agent-inspect`) |
|
|
44
|
+
| `-o, --output <path>` | Write to file instead of stdout |
|
|
45
|
+
| `--json` | JSON wrapper output (includes content when not writing to file) |
|
|
46
|
+
| `--validate` | Validate exported payload shape before writing |
|
|
47
|
+
| `--include-attributes` | Include bounded attributes — **review before sharing** |
|
|
48
|
+
| `--no-metadata` | Omit summary/metadata sections |
|
|
49
|
+
| `--no-errors` | Omit error sections |
|
|
50
|
+
| `--redaction-profile <local\|share\|strict>` | Key-based redaction on the **export copy** (v1.3.0+) |
|
|
51
|
+
|
|
52
|
+
## Redaction profiles (share-safe exports)
|
|
53
|
+
|
|
54
|
+
Profiles apply to the **exported copy** only. Original JSONL traces on disk are **not mutated**.
|
|
55
|
+
|
|
56
|
+
| Profile | Typical use |
|
|
57
|
+
| ------- | ------------- |
|
|
58
|
+
| `local` | Default — same key-based defaults as trace writing |
|
|
59
|
+
| `share` | PRs, GitHub issues, internal Slack/email threads |
|
|
60
|
+
| `strict` | External or public sharing — also redacts prompt/output/message-like keys |
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx agent-inspect export <run-id> --format markdown --redaction-profile share
|
|
64
|
+
npx agent-inspect export <run-id> --format html --redaction-profile strict
|
|
65
|
+
npx agent-inspect export <run-id> --format openinference --redaction-profile share --validate
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Redaction profiles are **key-based safeguards**, not compliance-grade PII detection. Always review exports manually.
|
|
69
|
+
|
|
70
|
+
## Programmatic API
|
|
71
|
+
|
|
72
|
+
Experimental helpers (local-only):
|
|
73
|
+
|
|
74
|
+
- `exportRunTree`, `redactRunTreeForExport`
|
|
75
|
+
- `exportMarkdown`, `exportHtml`, `exportOpenInference`, `exportOtlpJson`
|
|
76
|
+
- `validateExport`, `validateExportContent`
|
|
77
|
+
|
|
78
|
+
See [API.md](./API.md) §7.
|
|
79
|
+
|
|
80
|
+
## What not to share
|
|
81
|
+
|
|
82
|
+
Even with `--redaction-profile strict`, review exports for:
|
|
83
|
+
|
|
84
|
+
- API keys, tokens, cookies, session IDs
|
|
85
|
+
- Customer IDs, emails, phone numbers, internal hostnames
|
|
86
|
+
- Full prompts, completions, tool I/O (especially with `--include-attributes`)
|
|
87
|
+
- File paths that expose usernames or internal project names
|
|
20
88
|
|
|
21
|
-
|
|
89
|
+
Prefer the smallest useful artifact — a summary or synthetic reproduction beats a full production trace.
|
|
22
90
|
|
|
23
|
-
|
|
24
|
-
- Export formats (Markdown/HTML/OpenInference/OTLP JSON) are documented as **experimental / compatibility-oriented** in `docs/API.md`.
|
|
25
|
-
- AgentInspect does **not** upload anywhere; exports write local strings/files only.
|
|
91
|
+
## Related docs
|
|
26
92
|
|
|
93
|
+
- [CLI.md](./CLI.md) — `export` command reference
|
|
94
|
+
- [SCHEMA.md](./SCHEMA.md) — trace event model and redaction notes
|
|
95
|
+
- [SAFE-TRACE-SHARING.md](./SAFE-TRACE-SHARING.md) — checklist before posting
|
|
96
|
+
- [API.md](./API.md) — `ExportOptions`, experimental export APIs
|
|
97
|
+
- [LIMITATIONS.md](./LIMITATIONS.md) — compatibility and boundary 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,8 +60,30 @@ 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
|
|
|
69
|
+
### Correlation metadata (v1.3.0+)
|
|
70
|
+
|
|
71
|
+
Attach optional correlation fields to `run_started` metadata — useful for eval cases, CI job IDs, and future stats views. They are **metadata only**, not run IDs. Review before sharing exports.
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
await inspectRun(
|
|
75
|
+
"support-agent",
|
|
76
|
+
async () => runAgent(),
|
|
77
|
+
{
|
|
78
|
+
correlationId: "eval-suite-2026-06",
|
|
79
|
+
requestId: "req-abc123",
|
|
80
|
+
groupId: "ci-job-42",
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Inside a traced run, adapters can read active fields via `getCurrentCorrelationMetadata()`.
|
|
86
|
+
|
|
63
87
|
### Install compatibility
|
|
64
88
|
|
|
65
89
|
If `import` or `require` fails after install, see [KNOWN-ISSUES.md — Common install/runtime compatibility checks](./KNOWN-ISSUES.md#common-installruntime-compatibility-checks).
|
|
@@ -109,9 +133,28 @@ agent-inspect export minimal-success --dir fixtures/traces --format markdown
|
|
|
109
133
|
agent-inspect export minimal-success --dir fixtures/traces --format openinference --validate
|
|
110
134
|
```
|
|
111
135
|
|
|
112
|
-
|
|
136
|
+
Share-safe copy for a PR or issue (v1.3.0+):
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
agent-inspect export minimal-success --dir fixtures/traces \
|
|
140
|
+
--format markdown --redaction-profile share
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Exports are **local-only** and do not upload anywhere. Review output before sharing — see [SAFE-TRACE-SHARING.md](./SAFE-TRACE-SHARING.md).
|
|
144
|
+
|
|
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/).
|
|
113
156
|
|
|
114
|
-
##
|
|
157
|
+
## 9. Diff two runs
|
|
115
158
|
|
|
116
159
|
```bash
|
|
117
160
|
agent-inspect diff minimal-success minimal-error --dir fixtures/traces
|
|
@@ -151,6 +194,9 @@ agent-inspect view <runId> --tui
|
|
|
151
194
|
- [docs/API.md](./API.md)
|
|
152
195
|
- [docs/CLI.md](./CLI.md)
|
|
153
196
|
- [docs/SCHEMA.md](./SCHEMA.md)
|
|
197
|
+
- [docs/EXPORTS.md](./EXPORTS.md)
|
|
198
|
+
- [docs/SAFE-TRACE-SHARING.md](./SAFE-TRACE-SHARING.md)
|
|
199
|
+
- [docs/ADAPTERS.md](./ADAPTERS.md)
|
|
154
200
|
- [docs/LOGGING-PLAYBOOK.md](./LOGGING-PLAYBOOK.md)
|
|
155
201
|
- [docs/COMPARE.md](./COMPARE.md)
|
|
156
202
|
- [docs/LOG-TO-TREE-QUICKSTART.md](./LOG-TO-TREE-QUICKSTART.md)
|
package/docs/KNOWN-ISSUES.md
CHANGED
|
@@ -16,6 +16,12 @@ AgentInspect is **local-first** and **CLI-first**. These behaviors are intention
|
|
|
16
16
|
|
|
17
17
|
- **Vendor sinks** (hosted dashboards, Langfuse/Braintrust/New Relic/Datadog native uploads, OTLP gRPC streaming, etc.) are **not implemented** in the core packages described here.
|
|
18
18
|
- **LangChain adapter** captures **metadata-oriented** signals by default; it does not replace full framework observability.
|
|
19
|
+
- **LangChain `stream: true`** records chunk counts and timing only — not a full token replay. Per-token JSONL events are not emitted.
|
|
20
|
+
- **Correlation metadata** (`correlationId`, `requestId`, `decisionId`, `groupId`) is written on `run_started` but **CLI list/view does not filter by correlation fields** yet.
|
|
21
|
+
|
|
22
|
+
## Structured log parsing
|
|
23
|
+
|
|
24
|
+
- Ingest requires **line-delimited JSON** or a **recoverable JSON payload** in the log line (log4js-style is best-effort). Arbitrary printf-style text without JSON is not supported.
|
|
19
25
|
|
|
20
26
|
## UI / replay
|
|
21
27
|
|
package/docs/LIMITATIONS.md
CHANGED
|
@@ -9,15 +9,15 @@ This document states what AgentInspect **does not** provide today. It complement
|
|
|
9
9
|
- **No vendor upload pipeline**: no built-in Langfuse/Braintrust/New Relic/Datadog direct exporters as live sinks.
|
|
10
10
|
- **No automatic universal instrumentation** of every framework: integration is explicit (manual traces, log ingest, optional adapters).
|
|
11
11
|
|
|
12
|
-
## Correlation metadata (v1.3.0
|
|
12
|
+
## Correlation metadata (v1.3.0)
|
|
13
13
|
|
|
14
|
-
-
|
|
14
|
+
- **`list` / `view` / `export`** do not filter by correlation fields yet — `stats --correlation-id` / `--group-id` and `search` provide targeted read paths; full CLI filtering remains incremental.
|
|
15
15
|
|
|
16
16
|
## Persisted event model (v1.2.0 foundation)
|
|
17
17
|
|
|
18
18
|
- **v0.2 is not the default persisted trace file format.** `inspectRun()` / `step()` still write `schemaVersion: "0.1"` JSONL.
|
|
19
19
|
- **CLI commands** (`list`, `view`, `export`, `diff`, `logs`, `tail`) still primarily operate on current v0.1 trace and log paths.
|
|
20
|
-
- **v0.2 read
|
|
20
|
+
- **v0.2 read integration** — inspection CLI reads v0.2 JSONL via dual-format normalization (v1.5.0). Default **write** path remains v0.1; `list` metadata for v0.2-only files may be limited.
|
|
21
21
|
|
|
22
22
|
## LangChain streaming (v1.3.0)
|
|
23
23
|
|
|
@@ -48,6 +48,14 @@ This document states what AgentInspect **does not** provide today. It complement
|
|
|
48
48
|
|
|
49
49
|
- **No cost engine**: no pricing tables, invoice-grade usage, or provider billing reconciliation.
|
|
50
50
|
|
|
51
|
+
## Local observability commands (v1.4.0)
|
|
52
|
+
|
|
53
|
+
- **`timeline`**, **`stats`**, and **`search`** scan local JSONL files — no database index; large directories may be slow.
|
|
54
|
+
- **`search`** is deterministic exact/contains matching only — no semantic or fuzzy search.
|
|
55
|
+
- **`stats`** is local file aggregation — not production fleet analytics.
|
|
56
|
+
|
|
57
|
+
Visual demos: [SCREENSHOTS.md](./SCREENSHOTS.md) · [CLI.md](./CLI.md)
|
|
58
|
+
|
|
51
59
|
## Scale
|
|
52
60
|
|
|
53
61
|
- Designed for **developer machines** and **inner-loop debugging**, not petabyte log warehouses.
|
package/docs/LOGS.md
CHANGED
|
@@ -7,8 +7,30 @@ AgentInspect can parse **existing logs** (line-delimited JSON, and best-effort l
|
|
|
7
7
|
- **Production-shaped playbook**: `docs/LOGGING-PLAYBOOK.md` (pino, log4js, NestJS recipes)
|
|
8
8
|
- **Field mapping and redaction**: `docs/API.md` (log ingest APIs) and `docs/SCHEMA.md`
|
|
9
9
|
- **Safety constraints**: JSON logs first-class; log4js best-effort; no `eval`; no JavaScript object-literal parsing as a log interchange format (see `SECURITY.md`)
|
|
10
|
+
- **Visual demos**: [SCREENSHOTS.md](./SCREENSHOTS.md#use-existing-logs)
|
|
10
11
|
|
|
11
12
|
Notes:
|
|
12
13
|
- Log parsing APIs are documented as **experimental** in `docs/API.md`.
|
|
13
14
|
- Log-derived events include **confidence labels**; AgentInspect is conservative about inferring parent/child structure.
|
|
14
15
|
|
|
16
|
+
### JSON logs → tree (visual pending)
|
|
17
|
+
|
|
18
|
+
Animated demo is **pending re-record** — a staging capture showed tool/LLM summary counts that did not match displayed events. Use the canonical command below; see [assets/demos/RECORDING.md](./assets/demos/RECORDING.md).
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
agent-inspect logs fixtures/logs/minimal-success.json.log \
|
|
22
|
+
--format json \
|
|
23
|
+
--run-id-key runId \
|
|
24
|
+
--event-key event \
|
|
25
|
+
--timestamp-key timestamp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Run: [examples/06-log-to-tree](../examples/06-log-to-tree/README.md)
|
|
29
|
+
|
|
30
|
+
### Live tail (visual pending)
|
|
31
|
+
|
|
32
|
+
`agent-inspect tail` updates a local tree as new log lines arrive. Recording guide: [RECORDING.md](./assets/demos/RECORDING.md).
|
|
33
|
+
|
|
34
|
+
### log4js (best-effort)
|
|
35
|
+
|
|
36
|
+
See [examples/recipes/log4js-json-layout](../examples/recipes/log4js-json-layout/README.md). Visual pending re-record.
|
package/docs/SCHEMA.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Schema (AgentInspect 1.
|
|
1
|
+
# Schema (AgentInspect 1.x)
|
|
2
2
|
|
|
3
3
|
This document describes the **persisted manual trace JSONL schema** and the **log-derived normalized model** used by AgentInspect.
|
|
4
4
|
|
|
@@ -25,7 +25,7 @@ Manual trace events use:
|
|
|
25
25
|
|
|
26
26
|
- **`schemaVersion: "0.1"`**
|
|
27
27
|
|
|
28
|
-
Existing `0.1` traces remain readable
|
|
28
|
+
Existing `0.1` traces remain readable across AgentInspect 1.x.
|
|
29
29
|
|
|
30
30
|
### 2.3 TraceEvent union
|
|
31
31
|
|
|
@@ -129,10 +129,11 @@ Unknown status must **not** be treated as success.
|
|
|
129
129
|
## 6. Metadata policy
|
|
130
130
|
|
|
131
131
|
- Runs may include `metadata` on `run_started`.
|
|
132
|
-
- **Correlation metadata (v1.3.0+):** optional `correlationId`, `requestId`, `decisionId`, and `groupId` on `run_started.metadata` when passed via `inspectRun` / `maybeInspectRun` options. Event names remain unchanged (`run_started`, `step_started`, `step_completed`, `run_completed`).
|
|
132
|
+
- **Correlation metadata (v1.3.0+):** optional `correlationId`, `requestId`, `decisionId`, and `groupId` on `run_started.metadata` when passed via `inspectRun` / `maybeInspectRun` options. Event names remain unchanged (`run_started`, `step_started`, `step_completed`, `run_completed`). `stats --correlation-id` and `--group-id` filter by these fields; `list` / `view` do not filter by correlation yet.
|
|
133
133
|
- Steps may include `metadata` on `step_started`.
|
|
134
134
|
- Manual traces intentionally avoid full prompt/output capture by default.
|
|
135
135
|
- **Redaction (default on):** before disk, `inspectRun` / `step` redact sensitive keys using the shared `Redactor` defaults (`authorization`, `cookie`, `token`, `apiKey`, `password`, `secret`, `email`). Opt out with `redact: false`.
|
|
136
|
+
- **Redaction profiles (v1.3.0+):** optional `redactionProfile` (`local`, `share`, `strict`) adds preset extra keys and tighter metadata bounds for trace writing. Key-based only — not compliance-grade DLP. `export --redaction-profile` applies profiles to export copies without mutating source JSONL.
|
|
136
137
|
- **Size bounds:** long string values are truncated (`maxMetadataValueLength`, default 2000; preview-like keys use `maxPreviewLength`, default 500). Serialized events are capped at `maxEventBytes` (default 65536 UTF-8 bytes). If still too large, `metadata` may be replaced with `{ truncated: true, reason: "maxEventBytes", originalApproxBytes: number }`. Required event fields are never removed.
|
|
137
138
|
|
|
138
139
|
## 7. Additive fields and unknown fields
|
|
@@ -141,6 +142,8 @@ Unknown status must **not** be treated as success.
|
|
|
141
142
|
- Readers should ignore unknown fields where safe.
|
|
142
143
|
- Breaking schema changes require a major version.
|
|
143
144
|
|
|
145
|
+
**v1.5 vocabulary (kinds, token metadata, streaming attributes):** [TRACE-VOCABULARY-V1.5.md](./proposals/TRACE-VOCABULARY-V1.5.md)
|
|
146
|
+
|
|
144
147
|
## 8. Malformed lines
|
|
145
148
|
|
|
146
149
|
Manual trace reading:
|
|
@@ -150,7 +153,7 @@ Manual trace reading:
|
|
|
150
153
|
|
|
151
154
|
## 9. Backward compatibility
|
|
152
155
|
|
|
153
|
-
- v0.1 JSONL traces remain readable
|
|
156
|
+
- v0.1 JSONL traces remain readable across AgentInspect 1.x.
|
|
154
157
|
- No automatic migrations or rewriting of old files.
|
|
155
158
|
|
|
156
159
|
## 10. Breaking change policy
|
|
@@ -235,7 +238,7 @@ Canonical samples: `fixtures/traces-v0.2/*.jsonl` (validated by `pnpm fixtures:c
|
|
|
235
238
|
| `tokenUsage` | no | `{ input?, output?, total? }` when known |
|
|
236
239
|
| `trace` | no | Optional `{ traceId?, spanId?, parentSpanId? }` for future OTel alignment |
|
|
237
240
|
|
|
238
|
-
Programmatic helpers: see [API.md](./API.md) §
|
|
241
|
+
Programmatic helpers: see [API.md](./API.md) §11 (experimental persisted-event foundation).
|
|
239
242
|
|
|
240
243
|
## 15. Migration notes
|
|
241
244
|
|
package/docs/SCREENSHOTS.md
CHANGED
|
@@ -1,14 +1,195 @@
|
|
|
1
|
-
|
|
1
|
+
# Visual demos
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Curated terminal recordings for AgentInspect **1.4.0**. They show what the local trace workbench captures and how to inspect it — without a hosted dashboard or vendor upload.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Synthetic output only:** demos use committed [fixtures](../fixtures/README.md), [examples](../examples/README.md), and recipes. No external LLM calls or API keys.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- [ ] Failed tool call / failed step rendering
|
|
9
|
-
- [ ] `agent-inspect logs` output (JSON logs)
|
|
10
|
-
- [ ] `agent-inspect diff` output
|
|
11
|
-
- [ ] Optional TUI (`agent-inspect view <run-id> --tui`)
|
|
7
|
+
**npm note:** GIFs live in `docs/assets/demos/` for GitHub documentation. They are **not** shipped in the `agent-inspect` npm tarball.
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
**Re-record guide:** [assets/demos/RECORDING.md](assets/demos/RECORDING.md)
|
|
10
|
+
**Maintainer audit:** [implementation/VISUAL-DEMO-AUDIT.md](implementation/VISUAL-DEMO-AUDIT.md)
|
|
14
11
|
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Start tracing
|
|
15
|
+
|
|
16
|
+
Manual `inspectRun` / `step` traces written as local JSONL.
|
|
17
|
+
|
|
18
|
+
### Quickstart (install → trace → view)
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
Run: [examples/00-quickstart-demo](../examples/00-quickstart-demo/README.md)
|
|
23
|
+
Also: [GETTING-STARTED.md](GETTING-STARTED.md)
|
|
24
|
+
|
|
25
|
+
### Nested execution tree
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+
Run: [examples/02-nested-steps](../examples/02-nested-steps/README.md)
|
|
30
|
+
Command: `agent-inspect view <run-id> --dir <trace-dir>`
|
|
31
|
+
|
|
32
|
+
### Parallel sibling steps
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
Run: [examples/03-parallel-steps](../examples/03-parallel-steps/README.md)
|
|
37
|
+
|
|
38
|
+
### Error handling
|
|
39
|
+
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+
Run: [examples/04-error-handling](../examples/04-error-handling/README.md)
|
|
43
|
+
|
|
44
|
+
### `observe()` wrapper
|
|
45
|
+
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+
Run: [examples/05-observe-wrapper](../examples/05-observe-wrapper/README.md) · API: [API.md](API.md)
|
|
49
|
+
|
|
50
|
+
### Env-gated tracing (`maybeInspectRun`)
|
|
51
|
+
|
|
52
|
+

|
|
53
|
+
|
|
54
|
+
Docs: [GETTING-STARTED.md](GETTING-STARTED.md) · [API.md](API.md) (`maybeInspectRun`)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Use existing logs
|
|
59
|
+
|
|
60
|
+
Turn structured logs you already emit into a **local** grouped timeline or tree.
|
|
61
|
+
|
|
62
|
+
### JSON logs → tree
|
|
63
|
+
|
|
64
|
+
**Status:** animated demo pending re-record (staging asset had summary-count mismatch).
|
|
65
|
+
**Command:**
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
agent-inspect logs ./your.json.log \
|
|
69
|
+
--format json \
|
|
70
|
+
--run-id-key runId \
|
|
71
|
+
--event-key event \
|
|
72
|
+
--timestamp-key timestamp
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Run: [examples/06-log-to-tree](../examples/06-log-to-tree/README.md) · [LOGS.md](LOGS.md) · [LOG-TO-TREE-QUICKSTART.md](LOG-TO-TREE-QUICKSTART.md)
|
|
76
|
+
|
|
77
|
+
### Live tail
|
|
78
|
+
|
|
79
|
+
**Status:** animated demo pending re-record.
|
|
80
|
+
**Command:** `agent-inspect tail <log-file> [mapping flags]` — see [LOGS.md](LOGS.md).
|
|
81
|
+
|
|
82
|
+
### log4js (best-effort)
|
|
83
|
+
|
|
84
|
+
**Status:** pending re-record. Documented in [LOGS.md](LOGS.md); recipe: [log4js-json-layout](../examples/recipes/log4js-json-layout/README.md).
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Inspect and compare
|
|
89
|
+
|
|
90
|
+
Read-only CLI over local JSONL traces.
|
|
91
|
+
|
|
92
|
+
### Chronological timeline (`--focus slow`)
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
agent-inspect timeline <run-id> --dir fixtures/traces --focus slow
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Docs: [CLI.md](CLI.md) § timeline
|
|
101
|
+
|
|
102
|
+
### Local stats
|
|
103
|
+
|
|
104
|
+

|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
agent-inspect stats --dir fixtures/traces
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Filter by correlation: `agent-inspect stats --correlation-id <id>` or `--group-id <id>`.
|
|
111
|
+
Docs: [CLI.md](CLI.md) § stats
|
|
112
|
+
|
|
113
|
+
### Deterministic search
|
|
114
|
+
|
|
115
|
+

|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
agent-inspect search --dir fixtures/traces --status error --limit 5
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Docs: [CLI.md](CLI.md) § search
|
|
122
|
+
|
|
123
|
+
### Diff two runs
|
|
124
|
+
|
|
125
|
+

|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
agent-inspect diff minimal-success minimal-error --dir fixtures/traces
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Docs: [DIFF.md](DIFF.md)
|
|
132
|
+
|
|
133
|
+
### Markdown export
|
|
134
|
+
|
|
135
|
+

|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
agent-inspect export minimal-success --dir fixtures/traces --format markdown
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Docs: [EXPORTS.md](EXPORTS.md)
|
|
142
|
+
|
|
143
|
+
### HTML / OpenInference / OTLP
|
|
144
|
+
|
|
145
|
+
- **HTML:** rendered-report visual pending re-record; export command in [EXPORTS.md](EXPORTS.md).
|
|
146
|
+
- **OpenInference / OTLP JSON:** compatibility-oriented local formats — see prose and `--validate` in [EXPORTS.md](EXPORTS.md), not dedicated GIFs.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Integrations and optional UI
|
|
151
|
+
|
|
152
|
+
### LangChain persistence
|
|
153
|
+
|
|
154
|
+

|
|
155
|
+
|
|
156
|
+
Run: [examples/08-langchain-adapter](../examples/08-langchain-adapter/README.md) · [ADAPTERS.md](ADAPTERS.md)
|
|
157
|
+
|
|
158
|
+
Streaming metadata (`stream: true`) demo pending re-record until `chunkCount` / `streamDurationMs` are non-null.
|
|
159
|
+
|
|
160
|
+
### Optional TUI (`@agent-inspect/tui`)
|
|
161
|
+
|
|
162
|
+

|
|
163
|
+
|
|
164
|
+
Requires optional package: `pnpm add @agent-inspect/tui`
|
|
165
|
+
Command: `agent-inspect view <run-id> --tui`
|
|
166
|
+
Docs: [ADAPTERS.md](ADAPTERS.md)
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Safety and sharing
|
|
171
|
+
|
|
172
|
+
### Default metadata redaction
|
|
173
|
+
|
|
174
|
+

|
|
175
|
+
|
|
176
|
+
Profiles (`local` / `share` / `strict`) and export redaction: [SAFE-TRACE-SHARING.md](SAFE-TRACE-SHARING.md)
|
|
177
|
+
|
|
178
|
+
### Event size bounds
|
|
179
|
+
|
|
180
|
+
Described in [LIMITATIONS.md](LIMITATIONS.md) — no GIF (static explanation preferred).
|
|
181
|
+
|
|
182
|
+
### Correlation metadata
|
|
183
|
+
|
|
184
|
+
Described in [API.md](API.md) — optional `correlationId`, `requestId`, `decisionId`, `groupId` on `run_started`.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Planned checklist (completed items)
|
|
189
|
+
|
|
190
|
+
- [x] Basic trace tree (`inspectRun` + `step`)
|
|
191
|
+
- [x] Failed step rendering
|
|
192
|
+
- [x] `agent-inspect logs` output (JSON) — **re-record pending**
|
|
193
|
+
- [x] `agent-inspect diff` output
|
|
194
|
+
- [x] Optional TUI (`view --tui`)
|
|
195
|
+
- [x] `timeline`, `stats`, `search` (v1.4.0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-inspect",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Local-first execution-tree debugger for TypeScript AI agents",
|
|
@@ -25,6 +25,56 @@
|
|
|
25
25
|
"types": "./packages/core/dist/index.d.cts",
|
|
26
26
|
"default": "./packages/core/dist/index.cjs"
|
|
27
27
|
}
|
|
28
|
+
},
|
|
29
|
+
"./advanced": {
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./packages/core/dist/advanced.d.ts",
|
|
32
|
+
"default": "./packages/core/dist/advanced.mjs"
|
|
33
|
+
},
|
|
34
|
+
"require": {
|
|
35
|
+
"types": "./packages/core/dist/advanced.d.cts",
|
|
36
|
+
"default": "./packages/core/dist/advanced.cjs"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"./persisted": {
|
|
40
|
+
"import": {
|
|
41
|
+
"types": "./packages/core/dist/persisted.d.ts",
|
|
42
|
+
"default": "./packages/core/dist/persisted.mjs"
|
|
43
|
+
},
|
|
44
|
+
"require": {
|
|
45
|
+
"types": "./packages/core/dist/persisted.d.cts",
|
|
46
|
+
"default": "./packages/core/dist/persisted.cjs"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"./logs": {
|
|
50
|
+
"import": {
|
|
51
|
+
"types": "./packages/core/dist/logs.d.ts",
|
|
52
|
+
"default": "./packages/core/dist/logs.mjs"
|
|
53
|
+
},
|
|
54
|
+
"require": {
|
|
55
|
+
"types": "./packages/core/dist/logs.d.cts",
|
|
56
|
+
"default": "./packages/core/dist/logs.cjs"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"./exporters": {
|
|
60
|
+
"import": {
|
|
61
|
+
"types": "./packages/core/dist/exporters.d.ts",
|
|
62
|
+
"default": "./packages/core/dist/exporters.mjs"
|
|
63
|
+
},
|
|
64
|
+
"require": {
|
|
65
|
+
"types": "./packages/core/dist/exporters.d.cts",
|
|
66
|
+
"default": "./packages/core/dist/exporters.cjs"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"./diff": {
|
|
70
|
+
"import": {
|
|
71
|
+
"types": "./packages/core/dist/diff.d.ts",
|
|
72
|
+
"default": "./packages/core/dist/diff.mjs"
|
|
73
|
+
},
|
|
74
|
+
"require": {
|
|
75
|
+
"types": "./packages/core/dist/diff.d.cts",
|
|
76
|
+
"default": "./packages/core/dist/diff.cjs"
|
|
77
|
+
}
|
|
28
78
|
}
|
|
29
79
|
},
|
|
30
80
|
"bin": {
|