agent-inspect 1.0.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,54 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 21ecc6f: v1.1.0: env-gated tracing, trace safety (redaction + size bounds), LangChain JSONL persistence, logging recipes, CJS/ESM type export compatibility, community docs.
8
+
9
+ ## 1.1.0 — Unreleased
10
+
11
+ ### Added
12
+
13
+ - Added env-gated tracing with `maybeInspectRun()` using `AGENT_INSPECT`.
14
+ - Added `enabled` option for `inspectRun` passthrough when tracing should be skipped.
15
+ - Added default-on persisted trace safety for manual traces, including metadata redaction and event size bounds.
16
+ - Added optional LangChain JSONL persistence with `persist: true` in `@agent-inspect/langchain`.
17
+ - Added production-shaped logging guidance with pino, log4js, and NestJS JSON logging recipes.
18
+ - Added community contribution scaffold, issue templates, and good-first-issue guidance.
19
+
20
+ ### Fixed
21
+
22
+ - Fixed conditional type exports for ESM and CommonJS TypeScript consumers.
23
+ - Improved package compatibility for TypeScript Node16/NodeNext consumers using `import` and `require`.
24
+ - Updated public docs to avoid treating `docs-local` as primary contributor/user documentation.
25
+ - Updated stale docs around LangChain persistence, redaction, and package boundaries.
26
+
27
+ ### Security
28
+
29
+ - Redacts sensitive manual trace metadata before disk by default.
30
+ - Allows explicit opt-out with `redact: false`.
31
+ - Bounds persisted event and metadata size to reduce accidental large trace files.
32
+ - Keeps JSON logs first-class and log4js parsing best-effort without unsafe JavaScript object parsing.
33
+
34
+ ### Documentation
35
+
36
+ - Added/updated logging playbook for structured JSON logs ([docs/LOGGING-PLAYBOOK.md](docs/LOGGING-PLAYBOOK.md)).
37
+ - Updated public roadmap to separate completed v1.1-prep work from Now/Next/Future.
38
+ - Updated contributor/community docs for package boundaries and optional packages.
39
+ - Added clearer community onboarding and issue-draft guidance.
40
+
41
+ ### Notes
42
+
43
+ - LangChain adapter APIs remain experimental.
44
+ - `persist: false` remains the default for `@agent-inspect/langchain`; `persist: true` is opt-in.
45
+ - Existing manual trace schema remains `schemaVersion: "0.1"`.
46
+ - Existing event names remain `run_started`, `run_completed`, `step_started`, and `step_completed`.
47
+ - There is still no `step_failed` event; failures are represented as `step_completed` with `status: "error"`.
48
+ - JSON logs remain first-class; log4js text parsing remains best-effort.
49
+ - No vendor upload, network sink, dashboard, replay engine, or cost engine was added.
50
+ - Root `agent-inspect` runtime dependencies remain `chalk`, `commander`, and `nanoid` only.
51
+
3
52
  ## 1.0.3
4
53
 
5
54
  ### Patch Changes
@@ -20,16 +69,6 @@
20
69
 
21
70
  - 575b093: docs: onboarding polish
22
71
 
23
- ## Unreleased
24
-
25
- ### Documentation
26
-
27
- - Improved README onboarding for new users.
28
- - Added comparison guide.
29
- - Added log-to-tree quickstart.
30
- - Added a quickstart demo example.
31
- - Clarified docs organization between user-facing `docs/` and internal `docs-local/`.
32
-
33
72
  ## 1.0.0
34
73
 
35
74
  ### Stable local tracing
package/README.md CHANGED
@@ -133,7 +133,7 @@ npx agent-inspect logs ./agent.log --config agent-inspect.logs.json
133
133
  - **Flat timeline by default**; nesting when parent relationships are explicit or configured.
134
134
  - **Confidence labels** (`explicit`, `correlated`, `heuristic`, `unknown`) describe how attribution was inferred.
135
135
 
136
- More detail: [docs/LOGS.md](docs/LOGS.md) · [docs/LOG-TO-TREE-QUICKSTART.md](docs/LOG-TO-TREE-QUICKSTART.md).
136
+ 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).
137
137
 
138
138
  ## CLI at a glance
139
139
 
@@ -199,12 +199,18 @@ pnpm add agent-inspect @agent-inspect/langchain @langchain/core
199
199
  import { AgentInspectCallback } from "@agent-inspect/langchain";
200
200
 
201
201
  const callback = new AgentInspectCallback({
202
- runName: "my-run",
202
+ runName: "support-agent",
203
+ traceDir: "./.agent-inspect",
204
+ persist: true,
203
205
  capture: "metadata-only",
204
206
  });
205
207
 
206
208
  await agent.invoke(input, { callbacks: [callback] });
209
+ // In-memory events still available:
207
210
  const events = callback.getEvents();
211
+ // Persisted runs are inspectable via CLI:
212
+ // npx agent-inspect list --dir ./.agent-inspect
213
+ // npx agent-inspect view <run-id> --dir ./.agent-inspect
208
214
  ```
209
215
 
210
216
  See [examples/08-langchain-adapter](examples/08-langchain-adapter/README.md) and [docs/ADAPTERS.md](docs/ADAPTERS.md).
@@ -236,6 +242,9 @@ The TUI is available as a separate optional package; its programmatic API is exp
236
242
  | [examples/recipes/tool-failure-retry](examples/recipes/tool-failure-retry) | Tool failure + retry |
237
243
  | [examples/recipes/multi-agent-handoff](examples/recipes/multi-agent-handoff) | Handoff |
238
244
  | [examples/recipes/proactive-agent-logs](examples/recipes/proactive-agent-logs) | Structured logs |
245
+ | [examples/recipes/pino-json-logs](examples/recipes/pino-json-logs) | pino-shaped JSON |
246
+ | [examples/recipes/log4js-json-layout](examples/recipes/log4js-json-layout) | log4js embedded JSON |
247
+ | [examples/recipes/nestjs-json-logging](examples/recipes/nestjs-json-logging) | NestJS JSON logs |
239
248
  | [examples/recipes/retry-fallback](examples/recipes/retry-fallback) | Fallback pattern |
240
249
  | [examples/recipes/parallel-tools](examples/recipes/parallel-tools) | Parallel tools |
241
250
 
@@ -245,7 +254,7 @@ The TUI is available as a separate optional package; its programmatic API is exp
245
254
 
246
255
  - **Local files by default** — no upload, no vendor sinks in core workflows.
247
256
  - **No API keys** required for core tracing and CLI inspection.
248
- - **Manual metadata** is user-controlled; traces and exports can contain sensitive data if you put it there.
257
+ - **Manual metadata** is user-controlled. By default, common sensitive keys are **redacted before disk**; pass `redact: false` to opt out. Long metadata is truncated and events are capped at 64 KiB per JSONL line. Review traces and exports before sharing.
249
258
  - **Review exports** before sharing (especially with richer attribute flags).
250
259
 
251
260
  See [SECURITY.md](SECURITY.md).
@@ -265,6 +274,7 @@ For a detailed comparison, see [Compare with other tools](docs/COMPARE.md).
265
274
  - [Architecture (links to deeper design notes)](docs/ARCHITECTURE.md)
266
275
  - [Logs & tail](docs/LOGS.md)
267
276
  - [Log-to-tree quickstart](docs/LOG-TO-TREE-QUICKSTART.md)
277
+ - [Logging playbook](docs/LOGGING-PLAYBOOK.md)
268
278
  - [Exports](docs/EXPORTS.md)
269
279
  - [Diff](docs/DIFF.md)
270
280
  - [Adapters](docs/ADAPTERS.md)
package/SECURITY.md CHANGED
@@ -63,11 +63,14 @@ AgentInspect aims to be safe-by-default for **log-derived attributes** and **exp
63
63
 
64
64
  Important limitations:
65
65
 
66
- - **Manual trace metadata is user-controlled.** If you attach secrets to `inspectRun({ metadata })` or step metadata, those values may appear in local trace files and could appear in some views/exports depending on your settings and what you choose to include.
66
+ - **Manual trace metadata is user-controlled.** By default, `inspectRun()` and `step()` **redact common sensitive keys** before writing JSONL (`authorization`, `cookie`, `token`, `apiKey`, `password`, `secret`, `email` case-insensitive). Pass **`redact: false`** to persist metadata as-is (explicit opt-out).
67
+ - **Non-sensitive metadata and custom keys** are still written locally. Do not attach secrets you are unwilling to store on disk, even with redaction enabled (custom key names may bypass defaults).
68
+ - **Size bounds** truncate long metadata values and cap serialized event size (default 64 KiB per line). Oversized events are truncated further or replaced with a `{ truncated: true, reason: "maxEventBytes" }` marker — instrumentation never throws into your app because of payload size.
69
+ - **`@agent-inspect/langchain` with `persist: true`** writes the same local JSONL format as manual traces. Default **`capture: "metadata-only"`** does not persist full prompts/outputs; use **`capture: "preview"`** only when you accept truncated previews on disk.
67
70
  - Always **review exported files** before sharing them externally.
68
71
  - Avoid committing trace directories (`.agent-inspect-runs/`) to source control.
69
72
 
70
- For redaction design details, see `docs-local/architecture/REDACTION.md`.
73
+ For schema-level redaction notes, see `docs/SCHEMA.md` (redaction section) and `docs/API.md`.
71
74
 
72
75
  ## Dependency and security review process
73
76
 
package/docs/ADAPTERS.md CHANGED
@@ -5,11 +5,38 @@ AgentInspect is framework-agnostic at its core, but can optionally integrate wit
5
5
  - **LangChain.js adapter** (optional): `@agent-inspect/langchain`
6
6
  - Documented as **experimental** in `docs/API.md`
7
7
  - Requires `@langchain/core` as a peer dependency
8
+ - **In-memory by default** (`getEvents()` / `clear()`)
9
+ - **Optional JSONL persistence** (`persist: true`) maps callback lifecycle to schemaVersion `"0.1"` manual events (`run_started`, `step_started`, `step_completed`, `run_completed`) so `list` / `view` / `export` / `diff` work without a separate schema
10
+ - **Metadata-only capture by default**; `capture: "preview"` is opt-in with truncation
11
+ - **No monkey-patching**, **no vendor sinks**, **no network upload**
8
12
  - **Interactive TUI** (optional): `@agent-inspect/tui`
9
13
  - Documented as **experimental** in `docs/API.md`
10
14
  - Intended for CLI integration; programmatic TUI APIs may change
11
15
 
16
+ ### LangChain persistence model (Strategy A)
17
+
18
+ When `persist: true`:
19
+
20
+ 1. **Standalone callback session** — one AgentInspect run per `AgentInspectCallback` instance until the root LangChain run completes.
21
+ 2. **Inside `inspectRun`** — callback steps append to the active manual run (no extra `run_started` / `run_completed`).
22
+ 3. **Parent mapping** — LangChain `parentRunId` maps to AgentInspect `parentId` when the parent step was already persisted; unknown parents stay at run root (no invented hierarchy).
23
+ 4. **Step types** — `LLM` → `llm`, `TOOL` → `tool`, `DECISION` → `decision`, other kinds → `logic`.
24
+
25
+ ```ts
26
+ const callback = new AgentInspectCallback({
27
+ runName: "support-agent",
28
+ traceDir: "./.agent-inspect",
29
+ persist: true,
30
+ capture: "metadata-only",
31
+ });
32
+ ```
33
+
34
+ ```bash
35
+ npx agent-inspect list --dir ./.agent-inspect
36
+ npx agent-inspect view <run-id> --dir ./.agent-inspect
37
+ ```
38
+
12
39
  See also:
13
40
  - `docs/MIGRATION.md` (what changed from early versions)
14
- - `docs-local/RELEASE-CHECKLIST.md` (maintainer-only release steps)
41
+ - `docs/API.md` (LangChain adapter options: `persist`, `capture`, `traceDir`)
15
42
 
package/docs/API.md CHANGED
@@ -26,9 +26,13 @@ import { inspectRun, maybeInspectRun, step, observe } from "agent-inspect";
26
26
  ```
27
27
 
28
28
  - **`inspectRun(name, fn, options?)`**: wraps a workflow in a local JSONL trace (`run_started` / `run_completed`), prints terminal progress, and swallows instrumentation failures (user errors are re-thrown). **Traces by default** when `enabled` is omitted or `true`. Pass **`enabled: false`** to run `fn` with no trace file, no execution context, and no terminal output.
29
+ - **`redact`**: default `true` — redacts sensitive metadata keys before disk (`authorization`, `cookie`, `token`, `apiKey`, `password`, `secret`, `email`). Pass `false` to persist metadata as-is. Pass `{ rules?: RedactionRule[] }` for custom rules (defaults still apply).
30
+ - **`maxMetadataValueLength`**: max string length for metadata values (default `2000`).
31
+ - **`maxPreviewLength`**: max string length for preview-like keys containing `preview` (default `500`).
32
+ - **`maxEventBytes`**: max UTF-8 bytes per serialized JSONL event (default `65536`). Oversized events are truncated; instrumentation never throws into user code.
29
33
  - **`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.
30
34
  - **`isAgentInspectEnabled(value?)`**: returns whether a string (or `process.env.AGENT_INSPECT`) matches an enable token.
31
- - **`step(name, fn, options?)`**: traces a named unit of work inside `inspectRun` (`step_started` / `step_completed`).
35
+ - **`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.
32
36
  - **`step.llm(model, fn)`**: convenience wrapper (`type: "llm"`, `metadata.model`).
33
37
  - **`step.tool(toolName, fn)`**: convenience wrapper (`type: "tool"`, `metadata.toolName`).
34
38
  - **`observe(agent, options?)`**: proxy wrapper that traces top-level `run` / `execute` / `invoke` methods via `inspectRun`.
@@ -111,6 +115,13 @@ Diff is local and read-only. Programmatic diff surfaces are experimental until t
111
115
  `@agent-inspect/langchain` is an optional adapter package.
112
116
 
113
117
  - **`AgentInspectCallback`** (experimental)
118
+ - **`persist`**: default `false` — when `true`, maps callback lifecycle to schemaVersion `"0.1"` JSONL (`run_started` / `step_started` / `step_completed` / `run_completed`)
119
+ - **`runName`**: default `"langchain-agent"` for standalone persisted runs
120
+ - **`traceDir`**: defaults via `resolveTraceDir` / `AGENT_INSPECT_TRACE_DIR`
121
+ - **`capture`**: `"none"` | `"metadata-only"` (default) | `"preview"` (truncated previews, opt-in)
122
+ - **`redact`**: custom `RedactionRule[]` applied before disk (core defaults still apply via shared redactor)
123
+ - **`runId`**: optional id for standalone persisted runs
124
+ - In-memory **`getEvents()`** / **`clear()`** unchanged when `persist` is false
114
125
  - Metadata helpers: `extractModelName`, `extractTokenUsage`, `safePreview`, `toPlainMetadata`
115
126
 
116
127
  Rationale: v1.0 includes one official adapter and **zero production sinks**, so adapter surfaces remain experimental.
@@ -1,13 +1,48 @@
1
1
  ## Architecture
2
2
 
3
- This doc is a stable entry point for AgentInspect’s internal architecture and product boundaries.
3
+ AgentInspect is a **local-first execution-tree debugger**: manual traces and log ingest produce inspectable step trees stored as JSONL on disk (default `.agent-inspect-runs/`), with a CLI for list/view/clean/logs/tail/export/diff workflows.
4
4
 
5
- - **Canonical architecture overview**: see `docs-local/architecture/ARCHITECTURE.md`
6
- - **Event model**: `docs-local/architecture/EVENT-MODEL.md`
7
- - **Tree building rules**: `docs-local/architecture/TREE-BUILDING-RULES.md`
8
- - **Schema evolution policy**: `docs-local/architecture/SCHEMA-EVOLUTION.md`
9
- - **Dependency policy**: `docs-local/architecture/DEPENDENCY-POLICY.md`
10
- - **Redaction design**: `docs-local/architecture/REDACTION.md`
5
+ ### Package layout
11
6
 
12
- If you’re new, start with `docs/GETTING-STARTED.md`, then `docs/API.md`, `docs/CLI.md`, and `docs/SCHEMA.md`.
7
+ | Package | Published? | Role |
8
+ | -------- | ---------- | ---- |
9
+ | `agent-inspect` | Yes | Public tarball: core tracing APIs + CLI (`agent-inspect` binary) |
10
+ | `@agent-inspect/core` | No (private) | Tracing, storage, log parsing, export, diff |
11
+ | `@agent-inspect/cli` | No (private) | Commander CLI implementation |
12
+ | `@agent-inspect/langchain` | Yes (optional) | LangChain.js callback adapter (experimental) |
13
+ | `@agent-inspect/tui` | Yes (optional) | Ink/React terminal viewer (experimental) |
13
14
 
15
+ Root `agent-inspect` uses **conditional exports** for ESM/CJS TypeScript consumers (`import.types` / `require.types`). Heavy dependencies (LangChain, Ink/React) stay in optional packages.
16
+
17
+ ### Event model and schema
18
+
19
+ - Manual traces use **`schemaVersion: "0.1"`** JSONL events (`run_started`, `step_started`, `step_completed`, `run_completed`).
20
+ - Failures use `step_completed` with `status: "error"` — there is no `step_failed` event.
21
+ - Log-derived runs use confidence labels (`explicit`, `correlated`, `heuristic`, `unknown`) and conservative tree-building rules.
22
+
23
+ See [SCHEMA.md](./SCHEMA.md) for field reference and [API.md](./API.md) for public surfaces (stable vs experimental).
24
+
25
+ ### Safety and redaction
26
+
27
+ - Instrumentation must **not throw into user code**; trace safety failures degrade gracefully.
28
+ - **Manual metadata** is redacted before disk by default; `redact: false` opts out.
29
+ - **Size bounds** cap persisted event and metadata size.
30
+ - Log ingest: JSON first-class; log4js best-effort; no `eval` or JS object-literal parsing.
31
+
32
+ See [SECURITY.md](../SECURITY.md) and [LIMITATIONS.md](./LIMITATIONS.md).
33
+
34
+ ### Optional adapters
35
+
36
+ - **`@agent-inspect/langchain`**: in-memory by default; `persist: true` writes local JSONL. Experimental.
37
+ - **`@agent-inspect/tui`**: interactive viewer; isolated from root deps. Experimental.
38
+
39
+ See [ADAPTERS.md](./ADAPTERS.md).
40
+
41
+ ### Where to read next
42
+
43
+ - New users: [GETTING-STARTED.md](./GETTING-STARTED.md)
44
+ - CLI: [CLI.md](./CLI.md)
45
+ - Structured logs: [LOGS.md](./LOGS.md), [LOGGING-PLAYBOOK.md](./LOGGING-PLAYBOOK.md)
46
+ - Contributors: [CONTRIBUTING.md](../CONTRIBUTING.md), [docs/community/CONTRIBUTING.md](./community/CONTRIBUTING.md)
47
+
48
+ Maintainer-only internal docs under `docs-local/` may contain additional historical architecture depth; they are not required for contributors.
package/docs/EXPORTS.md CHANGED
@@ -4,7 +4,7 @@ AgentInspect supports local-only exports from run trees and traces. Exports are
4
4
 
5
5
  - **CLI usage**: `docs/CLI.md` (`export`)
6
6
  - **Schema + compatibility guarantees**: `docs/SCHEMA.md`
7
- - **Safety / redaction notes**: `docs/CLI.md`, `SECURITY.md`, and `docs-local/architecture/REDACTION.md`
7
+ - **Safety / redaction notes**: `docs/CLI.md`, `SECURITY.md`, and `docs/SCHEMA.md` (redaction section)
8
8
 
9
9
  Notes:
10
10
  - Export formats (Markdown/HTML/OpenInference/OTLP JSON) are documented as **experimental / compatibility-oriented** in `docs/API.md`.
@@ -117,12 +117,14 @@ See `examples/recipes/README.md`.
117
117
 
118
118
  ## 10. Optional LangChain adapter
119
119
 
120
- `@agent-inspect/langchain` is optional and **experimental**:
120
+ `@agent-inspect/langchain` is optional and **experimental**. Events are **in-memory by default**; pass `persist: true` to write local JSONL traces inspectable by the CLI.
121
121
 
122
122
  ```bash
123
123
  pnpm add @agent-inspect/langchain
124
124
  ```
125
125
 
126
+ See [examples/08-langchain-adapter](../examples/08-langchain-adapter/README.md) and [docs/ADAPTERS.md](./ADAPTERS.md).
127
+
126
128
  ## 11. Optional TUI
127
129
 
128
130
  `@agent-inspect/tui` is optional and **experimental**. The CLI can invoke it with:
@@ -133,18 +135,20 @@ agent-inspect view <runId> --tui
133
135
 
134
136
  ## 12. Safety notes
135
137
 
136
- - Redaction is on by default for log-derived attributes and exports.
138
+ - Redaction is on by default for log-derived attributes, **manual trace metadata (before disk)**, and exports. Pass `redact: false` to opt out of manual metadata redaction.
139
+ - Persisted events are size-bounded by default (see `docs/API.md`).
137
140
  - Confidence labels are required to keep attribution honest.
138
141
  - AgentInspect is for local debugging, not production monitoring.
139
142
 
140
143
  ## 13. Next docs
141
144
 
142
- - `docs/API.md`
143
- - `docs/CLI.md`
144
- - `docs/SCHEMA.md`
145
- - `docs/COMPARE.md`
146
- - `docs/LOG-TO-TREE-QUICKSTART.md`
147
- - `docs/KNOWN-ISSUES.md`
148
- - `docs/LIMITATIONS.md`
149
- - `docs-local/V1-READINESS-CHECKLIST.md`
145
+ - [docs/API.md](./API.md)
146
+ - [docs/CLI.md](./CLI.md)
147
+ - [docs/SCHEMA.md](./SCHEMA.md)
148
+ - [docs/LOGGING-PLAYBOOK.md](./LOGGING-PLAYBOOK.md)
149
+ - [docs/COMPARE.md](./COMPARE.md)
150
+ - [docs/LOG-TO-TREE-QUICKSTART.md](./LOG-TO-TREE-QUICKSTART.md)
151
+ - [docs/KNOWN-ISSUES.md](./KNOWN-ISSUES.md)
152
+ - [docs/LIMITATIONS.md](./LIMITATIONS.md)
153
+ - [ROADMAP.md](../ROADMAP.md)
150
154
 
@@ -15,6 +15,12 @@ This document states what AgentInspect **does not** provide today. It complement
15
15
  - **Log-derived runs** and **manual JSONL traces** may differ in fidelity (timestamps, nesting, confidence).
16
16
  - **Confidence labels** qualify inferred relationships; they do not guarantee correctness.
17
17
 
18
+ ## Trace safety bounds
19
+
20
+ - **Default metadata redaction** covers common sensitive keys only (exact key match, case-insensitive). Custom secret field names are not redacted unless you add rules via `redact: { rules: [...] }`.
21
+ - **Metadata truncation** applies to string values and nested structures; very large metadata may be replaced with a truncation marker when `maxEventBytes` is exceeded (default 64 KiB per JSONL line).
22
+ - **Redaction is not encryption.** Local trace files remain readable on disk; treat `.agent-inspect-runs/` like any developer artifact that may contain operational data.
23
+
18
24
  ## Execution semantics
19
25
 
20
26
  - **No replay / fork** of past runs from traces alone.
@@ -29,4 +35,4 @@ This document states what AgentInspect **does not** provide today. It complement
29
35
 
30
36
  - Designed for **developer machines** and **inner-loop debugging**, not petabyte log warehouses.
31
37
 
32
- For roadmap intent, see `docs-local/roadmap/VERSION-ROADMAP.md` and `docs-local/prd/v1.0-STABLE-LOCAL-INSPECTOR-PRD.md` (planning docs; not a promise of future features).
38
+ For roadmap intent, see [ROADMAP.md](../ROADMAP.md) (direction only not a delivery guarantee).
@@ -50,5 +50,7 @@ Run req_123
50
50
  See also:
51
51
  - `docs/CLI.md` (`logs`, `tail`)
52
52
  - `docs/LOGS.md`
53
+ - `docs/LOGGING-PLAYBOOK.md` (pino / log4js / NestJS examples + fixtures)
53
54
  - `docs/SCHEMA.md` (log ingest config types + confidence)
55
+ - `examples/recipes/pino-json-logs/`, `log4js-json-layout/`, `nestjs-json-logging/`
54
56
 
package/docs/LOGS.md CHANGED
@@ -4,8 +4,9 @@ AgentInspect can parse **existing logs** (line-delimited JSON, and best-effort l
4
4
 
5
5
  - **CLI usage**: `docs/CLI.md` (`logs`, `tail`)
6
6
  - **Quickstart**: `docs/LOG-TO-TREE-QUICKSTART.md`
7
- - **Log ingest config (field mapping + redaction)**: `docs-local/architecture/LOG-INGEST-CONFIG.md`
8
- - **Safety constraints** (no eval, no JS object parsing): `docs-local/architecture/ARCHITECTURE.md`
7
+ - **Production-shaped playbook**: `docs/LOGGING-PLAYBOOK.md` (pino, log4js, NestJS recipes)
8
+ - **Field mapping and redaction**: `docs/API.md` (log ingest APIs) and `docs/SCHEMA.md`
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`)
9
10
 
10
11
  Notes:
11
12
  - Log parsing APIs are documented as **experimental** in `docs/API.md`.
package/docs/SCHEMA.md CHANGED
@@ -131,6 +131,8 @@ Unknown status must **not** be treated as success.
131
131
  - Runs may include `metadata` on `run_started`.
132
132
  - Steps may include `metadata` on `step_started`.
133
133
  - Manual traces intentionally avoid full prompt/output capture by default.
134
+ - **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`.
135
+ - **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.
134
136
 
135
137
  ## 7. Additive fields and unknown fields
136
138
 
@@ -186,11 +188,15 @@ Log-derived trees must remain honest:
186
188
 
187
189
  ## 13. Redaction considerations
188
190
 
189
- Redaction is applied to log-derived attributes and to exports by default. **Manual trace metadata is user-controlled** and should be treated as potentially sensitive.
191
+ Redaction is applied to **log-derived attributes**, **manual trace metadata (before disk, by default)**, and **exports by default**.
192
+
193
+ - Manual metadata redaction uses exact key matching (case-insensitive), not substring matching.
194
+ - `redact: false` is an explicit opt-out; use only when you accept local persistence of metadata as provided.
195
+ - Local trace files can still contain sensitive data if you use non-default key names or opt out of redaction.
190
196
 
191
197
  Always review any exported content (Markdown/HTML/OpenInference/OTLP JSON) before sharing, especially if you enable richer attribute inclusion.
192
198
 
193
- See: `docs-local/architecture/REDACTION.md`.
199
+ See: `SECURITY.md` and `docs/API.md` (`InspectRunOptions.redact`, size bound options).
194
200
 
195
201
  ## 14. Migration notes
196
202
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Local-first execution-tree debugger for TypeScript AI agents",
@@ -12,7 +12,6 @@
12
12
  "url": "https://github.com/rajudandigam/agent-inspect/issues"
13
13
  },
14
14
  "homepage": "https://github.com/rajudandigam/agent-inspect#readme",
15
- "packageManager": "pnpm@9.15.0",
16
15
  "main": "./packages/core/dist/index.cjs",
17
16
  "module": "./packages/core/dist/index.mjs",
18
17
  "types": "./packages/core/dist/index.d.ts",
@@ -76,6 +75,16 @@
76
75
  "nanoid": "^5.0.9",
77
76
  "commander": "^12.1.0"
78
77
  },
78
+ "devDependencies": {
79
+ "@changesets/cli": "^2.27.10",
80
+ "@size-limit/preset-small-lib": "^11.1.6",
81
+ "@types/node": "^22.10.2",
82
+ "@vitest/coverage-v8": "^2.1.8",
83
+ "size-limit": "^11.1.6",
84
+ "tsup": "^8.3.5",
85
+ "typescript": "^5.7.2",
86
+ "vitest": "^2.1.8"
87
+ },
79
88
  "scripts": {
80
89
  "clean": "pnpm -r exec -- rm -rf dist",
81
90
  "build": "pnpm exec tsup --config tsup.core.config.ts && pnpm exec tsup --config tsup.cli.config.ts && pnpm exec tsup --config tsup.langchain.config.ts && pnpm exec tsup --config tsup.tui.config.ts",
@@ -86,8 +95,6 @@
86
95
  "size": "size-limit --config size-limit.config.mjs",
87
96
  "test:all": "pnpm run typecheck && pnpm run test && pnpm run build && pnpm run size",
88
97
  "prepublish:checks": "pnpm run typecheck && pnpm run test && pnpm run test:coverage && pnpm run build && pnpm run fixtures:check && pnpm run recipes:check && pnpm run size && pnpm run pack:smoke",
89
- "prepublishOnly": "pnpm run prepublish:checks",
90
- "prepack": "pnpm run clean && pnpm run build",
91
98
  "pack:dry-run": "pnpm run build && npm pack --dry-run",
92
99
  "pack:smoke": "pnpm run build && node scripts/package-smoke.mjs",
93
100
  "fixtures:check": "node scripts/validate-fixtures.mjs",
@@ -96,15 +103,5 @@
96
103
  "examples:check": "pnpm install && pnpm --filter agent-inspect-example-01-basic run start",
97
104
  "changeset": "changeset",
98
105
  "release": "changeset publish"
99
- },
100
- "devDependencies": {
101
- "@changesets/cli": "^2.27.10",
102
- "@size-limit/preset-small-lib": "^11.1.6",
103
- "@types/node": "^22.10.2",
104
- "@vitest/coverage-v8": "^2.1.8",
105
- "size-limit": "^11.1.6",
106
- "tsup": "^8.3.5",
107
- "typescript": "^5.7.2",
108
- "vitest": "^2.1.8"
109
106
  }
110
- }
107
+ }