agent-inspect 2.4.0 → 2.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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 57efe08: Release v2.6.0 with optional localhost viewer and read-only MCP server surfaces.
8
+
9
+ This train adds `@agent-inspect/viewer`, `agent-inspect serve`, `@agent-inspect/mcp-server` read-only trace tools, and defers IDE extension until post-v2.6 demand review. All optional surfaces are read-only with share-profile defaults.
10
+
11
+ ## 2.5.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 11edf90: Release v2.5.0 with deterministic guardrails and circuit utilities.
16
+
17
+ This train adds `@agent-inspect/guardrails` and `@agent-inspect/circuit`, optional `check --guardrails` / `check --circuit` flags, eval safety rule factories, and recipes. No compliance claims, no remote policy engine, and no default enforcement.
18
+
3
19
  ## 2.4.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -22,7 +22,7 @@ agent-inspect gives those runs **structure**: an **execution tree** you can read
22
22
 
23
23
  ## Install
24
24
 
25
- Current npm release line: **2.3.x** for the existing public packages. **v2.4.0** (release prep) adds multi-run **session** navigation (`sessions` / `session` CLI), session-aware `search` and `check`, and optional **`@agent-inspect/mcp`** client telemetry — all local-first on top of the stable v2 trace contract.
25
+ Current npm release line: **2.4.0** for the linked public packages (`agent-inspect`, adapters, reporters, redact, eval, mcp). **v2.4.0** adds multi-run **session** navigation (`sessions` / `session` CLI), session-aware `search` and `check`, and optional **`@agent-inspect/mcp`** client telemetry.
26
26
 
27
27
  ```bash
28
28
  npm install agent-inspect
@@ -340,7 +340,7 @@ AgentInspect is the **local-first trace workbench** for TypeScript AI agents:
340
340
 
341
341
  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).
342
342
 
343
- **v2.4 train status:** session/workflow causality helpers ship on `agent-inspect/advanced` (`buildSessionIndex`, scope/cohort helpers). CLI adds `sessions`, `session`, `search --session`, and `check --session` / `--group`. Optional `@agent-inspect/mcp` wraps MCP client `tools/list` and `tools/call` as local tool steps with bounded summaries — no gateway or server product.
343
+ **v2.4 shipped:** sessions/MCP client telemetry on `main@2.4.0`. All ten linked packages published at `2.4.0` including `@agent-inspect/mcp`.
344
344
 
345
345
  **v2.3 shipped:** adapter hardening for AI SDK, OpenAI Agents JS, and LangChain/LangGraph with no-network recipes and executable conformance coverage. Mastra and NestJS framework packages remain demand-gated; NestJS is covered through structured-log ingestion.
346
346
 
@@ -438,6 +438,34 @@ await inspectRun("agent-with-mcp", async () => {
438
438
 
439
439
  No-network recipe: [mcp-client-tracing](examples/recipes/mcp-client-tracing/). This is **not** an MCP server, gateway, or hosted broker — see [docs/ADAPTERS.md](docs/ADAPTERS.md).
440
440
 
441
+ ### Local viewer (`@agent-inspect/viewer`)
442
+
443
+ Optional **localhost read-only** HTTP viewer. Start from the CLI:
444
+
445
+ ```bash
446
+ pnpm add agent-inspect @agent-inspect/viewer
447
+ npx agent-inspect serve --dir ./.agent-inspect-runs
448
+ ```
449
+
450
+ Binds `127.0.0.1` by default. Serves trace list, timeline, and check JSON from disk — no upload, no mutation. Recipe: [read-only viewer workflow](examples/recipes/read-only-mcp-server/) (also covers MCP server tools).
451
+
452
+ ### Read-only MCP server (`@agent-inspect/mcp-server`)
453
+
454
+ Optional package exposing **read-only** MCP tools (`list_traces`, `read_trace`, `search_traces`, `run_checks`, `create_share_safe_report`, and analysis helpers) over a local trace directory. Distinct from `@agent-inspect/mcp` (client telemetry). Default redaction profile is `share`.
455
+
456
+ ```bash
457
+ pnpm add agent-inspect @agent-inspect/mcp-server
458
+ ```
459
+
460
+ ```ts
461
+ import { runReadOnlyMcpServer } from "@agent-inspect/mcp-server";
462
+
463
+ // stdio MCP server — configure trace dir via AGENT_INSPECT_TRACE_DIR
464
+ await runReadOnlyMcpServer({ redactionProfile: "share" });
465
+ ```
466
+
467
+ IDE extension is **deferred** — see [docs/IDE-SURFACES.md](docs/IDE-SURFACES.md).
468
+
441
469
  ### TUI viewer (`@agent-inspect/tui`)
442
470
 
443
471
  Optional **Ink/React** package, installed separately. Use with an interactive terminal:
@@ -485,6 +513,9 @@ Reporter artifact behavior and API details are documented in [docs/API.md](docs/
485
513
  | [examples/recipes/what-report-inspect](examples/recipes/what-report-inspect/) | `what` + `report` inspection |
486
514
  | [examples/recipes/runtime-and-ingestion](examples/recipes/runtime-and-ingestion/) | v1.6 runtime writers + universal ingestion |
487
515
  | [examples/recipes/mcp-client-tracing](examples/recipes/mcp-client-tracing) | v2.4 MCP client tool-call tracing |
516
+ | [examples/recipes/guardrails-basic](examples/recipes/guardrails-basic) | v2.5 deterministic guardrails |
517
+ | [examples/recipes/circuit-breaker-basic](examples/recipes/circuit-breaker-basic) | v2.5 circuit analyzers |
518
+ | [examples/recipes/read-only-mcp-server](examples/recipes/read-only-mcp-server) | v2.6 read-only MCP trace tools |
488
519
 
489
520
  **Multi-run sessions:** set `sessionId` (and optional handoff/retry metadata) on `run_started`, then browse with `npx agent-inspect sessions` and `npx agent-inspect session <id> --timeline`. See [SESSIONS-AND-WORKFLOW-CAUSALITY](docs/proposals/SESSIONS-AND-WORKFLOW-CAUSALITY.md).
490
521
 
package/SECURITY.md CHANGED
@@ -76,5 +76,22 @@ For a practical pre-share workflow, see `docs/SAFE-TRACE-SHARING.md`. For schema
76
76
 
77
77
  - Prefer Node.js built-ins over new dependencies.
78
78
  - Do not add vendor SDKs, OpenTelemetry SDKs, or framework dependencies to the main `agent-inspect` package.
79
- - Keep optional integrations (`@agent-inspect/langchain`, `@agent-inspect/tui`) separate so users do not pull them in by default.
79
+ - Keep optional integrations (`@agent-inspect/langchain`, `@agent-inspect/tui`, `@agent-inspect/viewer`, `@agent-inspect/mcp-server`) separate so users do not pull them in by default.
80
+
81
+ ## Optional surfaces (v2.6)
82
+
83
+ ### Local viewer (`agent-inspect serve`)
84
+
85
+ - Binds **localhost by default** (`127.0.0.1`). Binding to all interfaces exposes local traces on the network.
86
+ - **Read-only** HTTP routes — no trace mutation APIs.
87
+ - Does not upload data. Review traces before sharing screenshots or exported copies.
88
+
89
+ ### Read-only MCP server (`@agent-inspect/mcp-server`)
90
+
91
+ - Exposes **read-only** MCP tools over a configured trace directory.
92
+ - Default tool output redaction profile is **`share`** (not `local`).
93
+ - Does not invoke user agent tools or mutate traces.
94
+ - Configure via `AGENT_INSPECT_TRACE_DIR` and `AGENT_INSPECT_MCP_REDACTION_PROFILE` when documented.
95
+
96
+ IDE marketplace extension is **deferred** — see [docs/IDE-SURFACES.md](docs/IDE-SURFACES.md).
80
97
 
package/docs/ADAPTERS.md CHANGED
@@ -453,6 +453,47 @@ Session navigation for multi-run workflows uses `agent-inspect sessions` / `sess
453
453
 
454
454
  ---
455
455
 
456
+ ## Local viewer (`@agent-inspect/viewer`)
457
+
458
+ **Status:** optional package — v2.6.0 train.
459
+
460
+ Read-only localhost HTTP server for browsing traces on disk. Wired through `agent-inspect serve`.
461
+
462
+ | In scope | Out of scope |
463
+ | -------- | ------------ |
464
+ | `127.0.0.1` default bind | Cloud hosting or accounts |
465
+ | Trace list, timeline, check JSON routes | Trace mutation or replay |
466
+ | Reads through `agent-inspect/readers` | SQLite or remote fetch |
467
+
468
+ ```bash
469
+ npm install agent-inspect @agent-inspect/viewer
470
+ npx agent-inspect serve --dir ./.agent-inspect-runs
471
+ ```
472
+
473
+ ---
474
+
475
+ ## Read-only MCP server (`@agent-inspect/mcp-server`)
476
+
477
+ **Status:** optional package — v2.6.0 train.
478
+
479
+ Stdio MCP server exposing **read-only** tools (`list_traces`, `read_trace`, `search_traces`, `find_first_error`, `find_slowest_path`, `compare_runs`, `run_checks`, `create_share_safe_report`). Distinct from `@agent-inspect/mcp` (client telemetry).
480
+
481
+ | In scope | Out of scope |
482
+ | -------- | ------------ |
483
+ | Local trace directory tools | MCP client wrapping |
484
+ | `share` redaction default | Unredacted prompts by default |
485
+ | Bounded JSON responses | Tool invocation on user agents |
486
+
487
+ ```ts
488
+ import { runReadOnlyMcpServer } from "@agent-inspect/mcp-server";
489
+
490
+ await runReadOnlyMcpServer({ redactionProfile: "share" });
491
+ ```
492
+
493
+ Recipe: [examples/recipes/read-only-mcp-server](../examples/recipes/read-only-mcp-server/). IDE extension deferred: [IDE-SURFACES.md](./IDE-SURFACES.md).
494
+
495
+ ---
496
+
456
497
  ## Future adapters (not shipped)
457
498
 
458
499
  Direction only — see [ROADMAP.md](../ROADMAP.md):
package/docs/CLI.md CHANGED
@@ -310,6 +310,8 @@ Options:
310
310
  - `--session <id>`: check all runs in a workflow session (uses `--dir`; target may be `.`)
311
311
  - `--group <id>`: check all runs sharing a `groupId` metadata value
312
312
  - `--correlate-group`: when using `--session`, also match synthetic `group:` session keys
313
+ - `--guardrails <rule>`: optional deterministic guardrail rules (`banned-phrase`, `pii-leak`, `prompt-injection`, …); repeatable
314
+ - `--circuit <rule>`: optional circuit analyzers (`same-tool-repetition`, `max-retries`, …); repeatable
313
315
 
314
316
  By default, `check` runs `run.status`. Additional built-in rules can be selected with `--rule` or config when their options are available.
315
317
 
@@ -334,12 +336,30 @@ Examples:
334
336
  npx agent-inspect check fixtures/traces-v0.2/manual-basic.jsonl --json
335
337
  npx agent-inspect check minimal-success --dir fixtures/traces --rule run.status
336
338
  npx agent-inspect check trace.jsonl --max-duration-ms 30000 --required-tool search_docs --json
337
- npx agent-inspect check . --dir ./.agent-inspect --session sess-handoff-001 --json
339
+ npx agent-inspect check trace.jsonl --guardrails pii-leak --guardrails prompt-injection --json
340
+ npx agent-inspect check trace.jsonl --circuit same-tool-repetition --circuit max-retries --json
338
341
  ```
339
342
 
340
343
  Recipe: [examples/recipes/deterministic-ci-checks](../examples/recipes/deterministic-ci-checks/README.md)
341
344
 
342
- ### 6.10 `eval`
345
+ ### 6.10 `serve`
346
+
347
+ Start the optional **localhost read-only** trace viewer (`@agent-inspect/viewer`). Reads traces from disk only; no upload or mutation.
348
+
349
+ ```bash
350
+ agent-inspect serve [options]
351
+ ```
352
+
353
+ Options:
354
+
355
+ - `--dir <path>`: trace directory to serve (default from `AGENT_INSPECT_TRACE_DIR` or `.agent-inspect-runs`)
356
+ - `--host <host>`: bind host (default `127.0.0.1`)
357
+ - `--port <number>`: bind port (default `7337`)
358
+ - `--open`: open a browser when host is localhost
359
+
360
+ Binding to `0.0.0.0` logs a warning — traces may be exposed on the network. Prefer `127.0.0.1` unless you accept that risk.
361
+
362
+ ### 6.11 `eval`
343
363
 
344
364
  Run deterministic local evals against an existing trace. This command reads through the same local reader pipeline as `open` and `check`; it does not rerun agents, call models, upload traces, mutate inputs, or create a hosted dataset.
345
365
 
@@ -55,6 +55,12 @@ This document states what AgentInspect **does not** provide today. It complement
55
55
  - **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).
56
56
  - **Redaction is not encryption.** Local trace files remain readable on disk; treat `.agent-inspect-runs/` like any developer artifact that may contain operational data.
57
57
 
58
+ ## Guardrails and circuits (v2.5 planning)
59
+
60
+ - **Guardrails and circuits are deterministic local utilities, not compliance certification.** `@agent-inspect/guardrails` and `@agent-inspect/circuit` (planned v2.5) evaluate text, JSON, and trace patterns with bounded evidence; they do not prove safety for every sharing context or replace human review.
61
+ - **No LLM judge or remote policy engine.** Built-in rules use pattern lists, redact findings, and structural heuristics only.
62
+ - **No automatic remediation by default.** Results are advisory unless caller code maps failures to errors, trace events, or enforcement.
63
+
58
64
  ## Checks, artifacts, and test reporters
59
65
 
60
66
  - **Checks are deterministic local rules, not compliance certification.** `check`, `scan`, and `verify-safe` surface bounded findings and diagnostics over supported local inputs; they do not prove a trace is safe for every sharing context.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-inspect",
3
- "version": "2.4.0",
3
+ "version": "2.6.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Local-first execution-tree debugger for TypeScript AI agents",
@@ -178,7 +178,7 @@
178
178
  },
179
179
  "scripts": {
180
180
  "clean": "pnpm -r exec -- rm -rf dist",
181
- "build": "pnpm exec tsup --config tsup.core.config.ts && pnpm exec tsup --config tsup.cli.config.ts && pnpm exec tsup --config tsup.langchain.config.ts && pnpm exec tsup --config tsup.tui.config.ts && pnpm exec tsup --config tsup.ai-sdk.config.ts && pnpm exec tsup --config tsup.vitest.config.ts && pnpm exec tsup --config tsup.jest.config.ts && pnpm exec tsup --config tsup.openai-agents.config.ts && pnpm exec tsup --config tsup.harness.config.ts && pnpm exec tsup --config tsup.redact.config.ts && pnpm exec tsup --config tsup.eval.config.ts && pnpm exec tsup --config tsup.mcp.config.ts",
181
+ "build": "pnpm exec tsup --config tsup.core.config.ts && pnpm exec tsup --config tsup.cli.config.ts && pnpm exec tsup --config tsup.langchain.config.ts && pnpm exec tsup --config tsup.tui.config.ts && pnpm exec tsup --config tsup.ai-sdk.config.ts && pnpm exec tsup --config tsup.vitest.config.ts && pnpm exec tsup --config tsup.jest.config.ts && pnpm exec tsup --config tsup.openai-agents.config.ts && pnpm exec tsup --config tsup.harness.config.ts && pnpm exec tsup --config tsup.redact.config.ts && pnpm exec tsup --config tsup.eval.config.ts && pnpm exec tsup --config tsup.mcp.config.ts && pnpm exec tsup --config tsup.guardrails.config.ts && pnpm exec tsup --config tsup.circuit.config.ts && pnpm exec tsup --config tsup.viewer.config.ts && pnpm exec tsup --config tsup.mcp-server.config.ts",
182
182
  "typecheck": "tsc --noEmit",
183
183
  "test": "vitest run",
184
184
  "test:watch": "vitest",