agent-inspect 4.3.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/docs/API.md +3 -0
- package/docs/CLI.md +37 -0
- package/docs/SCHEMA.md +27 -1
- package/package.json +1 -1
- package/packages/cli/dist/chunk-TB45H3QT.mjs +7881 -0
- package/packages/cli/dist/chunk-TB45H3QT.mjs.map +1 -0
- package/packages/cli/dist/index.cjs +10461 -9188
- package/packages/cli/dist/index.cjs.map +1 -1
- package/packages/cli/dist/index.mjs +2619 -5688
- package/packages/cli/dist/index.mjs.map +1 -1
- package/packages/cli/dist/{src-YFMPWEIS.mjs → src-ZRFSYML6.mjs} +3 -3
- package/packages/cli/dist/{src-YFMPWEIS.mjs.map → src-ZRFSYML6.mjs.map} +1 -1
- package/packages/core/dist/advanced.cjs +3410 -21
- package/packages/core/dist/advanced.cjs.map +1 -1
- package/packages/core/dist/advanced.d.cts +147 -9
- package/packages/core/dist/advanced.d.ts +147 -9
- package/packages/core/dist/advanced.mjs +603 -20
- package/packages/core/dist/advanced.mjs.map +1 -1
- package/packages/core/dist/checks.cjs +117 -18
- package/packages/core/dist/checks.cjs.map +1 -1
- package/packages/core/dist/checks.d.cts +11 -3
- package/packages/core/dist/checks.d.ts +11 -3
- package/packages/core/dist/checks.mjs +7 -1612
- package/packages/core/dist/checks.mjs.map +1 -1
- package/packages/core/dist/{chunk-2ZXEMWGK.mjs → chunk-3USJVBLA.mjs} +3 -3
- package/packages/core/dist/{chunk-2ZXEMWGK.mjs.map → chunk-3USJVBLA.mjs.map} +1 -1
- package/packages/core/dist/{chunk-HY7H3CQM.mjs → chunk-CAWPF22J.mjs} +4 -3
- package/packages/core/dist/chunk-CAWPF22J.mjs.map +1 -0
- package/packages/core/dist/{chunk-XUNJMAPD.mjs → chunk-KNYL56KZ.mjs} +38 -3
- package/packages/core/dist/chunk-KNYL56KZ.mjs.map +1 -0
- package/packages/core/dist/{chunk-IZBJAZGF.mjs → chunk-P366CCL2.mjs} +34 -3
- package/packages/core/dist/chunk-P366CCL2.mjs.map +1 -0
- package/packages/core/dist/chunk-QLYOCCEF.mjs +1650 -0
- package/packages/core/dist/chunk-QLYOCCEF.mjs.map +1 -0
- package/packages/core/dist/{chunk-4JVGFNQH.mjs → chunk-ULCGIRTC.mjs} +95 -8
- package/packages/core/dist/chunk-ULCGIRTC.mjs.map +1 -0
- package/packages/core/dist/chunk-VFO76UH3.mjs +228 -0
- package/packages/core/dist/chunk-VFO76UH3.mjs.map +1 -0
- package/packages/core/dist/{chunk-NQZPZ2FN.mjs → chunk-WRE4CNPF.mjs} +6 -3
- package/packages/core/dist/chunk-WRE4CNPF.mjs.map +1 -0
- package/packages/core/dist/chunk-X2FLDF7M.mjs +1581 -0
- package/packages/core/dist/chunk-X2FLDF7M.mjs.map +1 -0
- package/packages/core/dist/{chunk-A4V2H3YU.mjs → chunk-ZWA5RWMV.mjs} +40 -4
- package/packages/core/dist/chunk-ZWA5RWMV.mjs.map +1 -0
- package/packages/core/dist/{context-DjY-jvQk.d.cts → context-BbfkMYjz.d.cts} +5 -3
- package/packages/core/dist/{context-BDZmi53V.d.ts → context-Cp8NRbBX.d.ts} +5 -3
- package/packages/core/dist/diff.cjs.map +1 -1
- package/packages/core/dist/diff.d.cts +3 -3
- package/packages/core/dist/diff.d.ts +3 -3
- package/packages/core/dist/diff.mjs +1 -1
- package/packages/core/dist/exporters.cjs +137 -1
- package/packages/core/dist/exporters.cjs.map +1 -1
- package/packages/core/dist/exporters.d.cts +6 -3
- package/packages/core/dist/exporters.d.ts +6 -3
- package/packages/core/dist/exporters.mjs +71 -6
- package/packages/core/dist/exporters.mjs.map +1 -1
- package/packages/core/dist/index.cjs +181 -6
- package/packages/core/dist/index.cjs.map +1 -1
- package/packages/core/dist/index.d.cts +14 -7
- package/packages/core/dist/index.d.ts +14 -7
- package/packages/core/dist/index.mjs +51 -7
- package/packages/core/dist/index.mjs.map +1 -1
- package/packages/core/dist/{inspect-event-CYAV7Hxm.d.cts → inspect-event-IqwOHbGo.d.cts} +1 -1
- package/packages/core/dist/{inspect-event-CYAV7Hxm.d.ts → inspect-event-IqwOHbGo.d.ts} +1 -1
- package/packages/core/dist/{log-config-BNQ9UTmP.d.cts → log-config-CW8w5YQ9.d.cts} +1 -1
- package/packages/core/dist/{log-config-D3Yp1SZN.d.ts → log-config-SRA4xTp8.d.ts} +1 -1
- package/packages/core/dist/logs.d.cts +3 -3
- package/packages/core/dist/logs.d.ts +3 -3
- package/packages/core/dist/{persisted-inspect-event-BLvb0jSX.d.ts → persisted-inspect-event-DruwqARZ.d.ts} +1 -1
- package/packages/core/dist/{persisted-inspect-event-D5SjBz9b.d.cts → persisted-inspect-event-Gd-W8vB7.d.cts} +1 -1
- package/packages/core/dist/persisted.cjs +67 -1
- package/packages/core/dist/persisted.cjs.map +1 -1
- package/packages/core/dist/persisted.d.cts +5 -5
- package/packages/core/dist/persisted.d.ts +5 -5
- package/packages/core/dist/persisted.mjs +3 -3
- package/packages/core/dist/readers.cjs +72 -3
- package/packages/core/dist/readers.cjs.map +1 -1
- package/packages/core/dist/readers.d.cts +2 -2
- package/packages/core/dist/readers.d.ts +2 -2
- package/packages/core/dist/readers.mjs +4 -1580
- package/packages/core/dist/readers.mjs.map +1 -1
- package/packages/core/dist/{types-CQun9LW6.d.ts → types-B1X87dUW.d.cts} +16 -2
- package/packages/core/dist/{types-C-llnPH0.d.cts → types-BVkjSd0q.d.ts} +16 -2
- package/packages/core/dist/types-CvsKGweN.d.cts +12 -0
- package/packages/core/dist/types-CvsKGweN.d.ts +12 -0
- package/packages/core/dist/writers.cjs +2 -1
- package/packages/core/dist/writers.cjs.map +1 -1
- package/packages/core/dist/writers.d.cts +2 -2
- package/packages/core/dist/writers.d.ts +2 -2
- package/packages/core/dist/writers.mjs +3 -4
- package/packages/core/dist/writers.mjs.map +1 -1
- package/packages/cli/dist/chunk-BS5LSKZ3.mjs +0 -3671
- package/packages/cli/dist/chunk-BS5LSKZ3.mjs.map +0 -1
- package/packages/core/dist/chunk-4JVGFNQH.mjs.map +0 -1
- package/packages/core/dist/chunk-A4V2H3YU.mjs.map +0 -1
- package/packages/core/dist/chunk-EDTQHZPM.mjs +0 -88
- package/packages/core/dist/chunk-EDTQHZPM.mjs.map +0 -1
- package/packages/core/dist/chunk-HY7H3CQM.mjs.map +0 -1
- package/packages/core/dist/chunk-IZBJAZGF.mjs.map +0 -1
- package/packages/core/dist/chunk-NQZPZ2FN.mjs.map +0 -1
- package/packages/core/dist/chunk-XUNJMAPD.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c5e3b16: Add trace suite config (`agent-inspect.suite.json`) with `suite init`, `validate`, `list`, `run`, and `report` commands for local CI trajectory checks.
|
|
8
|
+
|
|
9
|
+
## 4.4.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 42635d8: Add observed outcomes (`observeOutcome`) with OUTCOME events, report/check/search integration, and redaction-bounded evidence fields.
|
|
14
|
+
|
|
3
15
|
## 4.3.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/docs/API.md
CHANGED
|
@@ -84,6 +84,7 @@ import {
|
|
|
84
84
|
- **`step.llm(model, fn)`**: convenience wrapper (`type: "llm"`, `metadata.model`).
|
|
85
85
|
- **`step.tool(toolName, fn)`**: convenience wrapper (`type: "tool"`, `metadata.toolName`).
|
|
86
86
|
- **`observe(agent, options?)`**: proxy wrapper that traces top-level `run` / `execute` / `invoke` methods via `inspectRun`.
|
|
87
|
+
- **`observeOutcome(name, options)`** (v4.4.0+): records an observed outcome (`outcome_observed`) inside an active `inspectRun` context. Requires `expectation` and `status` (`passed` | `failed` | `unknown` | `skipped`); optional `method`, `actual`, and `evidence`. Outside a run → warn and no-op (never throws). `actual` / `evidence` are bounded and redacted before disk.
|
|
87
88
|
- **`getCurrentCorrelationMetadata()`**: returns active run correlation fields (`correlationId`, `requestId`, `decisionId`, `groupId`) inside `inspectRun` / `maybeInspectRun`; `undefined` outside a traced run or when none were set.
|
|
88
89
|
- **`RedactionProfile`**: `"local" | "share" | "strict"` — see `redactionProfile` on `InspectRunOptions` and `ExportOptions`.
|
|
89
90
|
- **`resolveRedactionProfile(profile?)`**: advanced helper available from `agent-inspect/advanced`; resolves profile extra keys and metadata caps for integrations.
|
|
@@ -109,6 +110,7 @@ These APIs support local workflows like listing traces, extracting metadata/summ
|
|
|
109
110
|
- `RunCompletedEvent` (`event: "run_completed"`)
|
|
110
111
|
- `StepStartedEvent` (`event: "step_started"`)
|
|
111
112
|
- `StepCompletedEvent` (`event: "step_completed"`)
|
|
113
|
+
- `OutcomeObservedEvent` (`event: "outcome_observed"`, v4.4.0+)
|
|
112
114
|
- Related types: `StepType`, `StepStatus`, `RunStatus`, `ErrorInfo`, `StepMetadata`, `TokenMetadata`
|
|
113
115
|
|
|
114
116
|
### Log-derived normalized model (stable as a model, not necessarily the parsing APIs)
|
|
@@ -460,6 +462,7 @@ Public methods:
|
|
|
460
462
|
- **`step(name, fn, options?)`**: writes nested step lifecycle events when called inside the same inspector's run context; outside a context it passes through.
|
|
461
463
|
- **`tool(name, fn, options?)`** / **`llm(name, fn, options?)`**: convenience wrappers that set `type` and metadata.
|
|
462
464
|
- **`observe(name, fn, options?)`**: returns an async wrapper that records the function call as an inspector step.
|
|
465
|
+
- **`observeOutcome(name, options)`** (v4.4.0+): writes `outcome_observed` / `OUTCOME` events through the configured writer when inside an inspector run context.
|
|
463
466
|
- **`getDiagnostics()`**: returns instrumentation error counts and writer stats without requiring direct runtime access.
|
|
464
467
|
- **`flush()`** / **`close()`**: delegate to the configured writer through the runtime.
|
|
465
468
|
|
package/docs/CLI.md
CHANGED
|
@@ -317,6 +317,7 @@ Options:
|
|
|
317
317
|
- `--correlate-group`: when using `--session`, also match synthetic `group:` session keys
|
|
318
318
|
- `--guardrails <rule>`: optional deterministic guardrail rules (`banned-phrase`, `pii-leak`, `prompt-injection`, …); repeatable
|
|
319
319
|
- `--circuit <rule>`: optional circuit analyzers (`same-tool-repetition`, `max-retries`, …); repeatable
|
|
320
|
+
- `--fail-on-observation <status>`: add `outcome.status` rule; repeatable (`failed`, `passed`, `unknown`, `skipped`; default when flag present without value: `failed`)
|
|
320
321
|
|
|
321
322
|
By default, `check` runs `run.status`. Additional built-in rules can be selected with `--rule` or config when their options are available.
|
|
322
323
|
|
|
@@ -667,6 +668,7 @@ Options:
|
|
|
667
668
|
- `--limit <number>` — default 50
|
|
668
669
|
- `--session <id>` — limit to runs in one workflow session
|
|
669
670
|
- `--correlate-group` — when using `--session`, also match synthetic `group:` keys
|
|
671
|
+
- `--observation <status>` — filter runs with observed outcomes matching status (`passed`, `failed`, `unknown`, `skipped`)
|
|
670
672
|
- `--json`
|
|
671
673
|
|
|
672
674
|
Examples:
|
|
@@ -779,6 +781,7 @@ Options:
|
|
|
779
781
|
- `-o, --output <path>` — write to file
|
|
780
782
|
- `--json` — JSON wrapper (includes `content` when writing to stdout)
|
|
781
783
|
- `--include-attributes` — bounded attributes in the execution tree section
|
|
784
|
+
- `--section <name>` — include report sections; repeatable (`what`, `timeline`, `tree`, `observations`; default: all except when narrowed)
|
|
782
785
|
- `--no-errors` — omit error details from the execution tree section
|
|
783
786
|
- `--no-correlation` — omit correlation ids from what section
|
|
784
787
|
- `--redaction-profile <local|share|strict>` — key-based redaction profile applied to the complete report (default `local`); review output before sharing
|
|
@@ -893,6 +896,40 @@ npx agent-inspect bundle --since 24h --dir ./.agent-inspect --json
|
|
|
893
896
|
|
|
894
897
|
Recipe: [shareable-bundle-basic](../examples/recipes/shareable-bundle-basic/README.md).
|
|
895
898
|
|
|
899
|
+
### 6.25 `suite`
|
|
900
|
+
|
|
901
|
+
Define and run **local trace suites** for CI trajectory checks (v5.0+). Suites read existing traces only — no agent replay, no model calls, no upload.
|
|
902
|
+
|
|
903
|
+
```bash
|
|
904
|
+
agent-inspect suite init
|
|
905
|
+
agent-inspect suite validate [--config path]
|
|
906
|
+
agent-inspect suite list [--config path]
|
|
907
|
+
agent-inspect suite run [--config path] [--json] [--markdown] [-o dir]
|
|
908
|
+
agent-inspect suite report --input <suite-run.json> [--format markdown|json]
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
Default config file: `agent-inspect.suite.json` in the current directory.
|
|
912
|
+
|
|
913
|
+
Options (shared):
|
|
914
|
+
|
|
915
|
+
- `--config <path>` — suite config (`.json`, `.js`, `.mjs`, `.cjs`)
|
|
916
|
+
|
|
917
|
+
`run` also supports:
|
|
918
|
+
|
|
919
|
+
- `-o, --output <dir>` — write JSON run artifact (default: `.agent-inspect/suite-runs`)
|
|
920
|
+
- `--json` / `--markdown` — structured or readable output
|
|
921
|
+
|
|
922
|
+
Case fields include `requireTools`, `forbidTools`, `maxDurationMs`, and `expectedObservations` (outcome names that must be `passed`).
|
|
923
|
+
|
|
924
|
+
Example:
|
|
925
|
+
|
|
926
|
+
```bash
|
|
927
|
+
npx agent-inspect suite init
|
|
928
|
+
npx agent-inspect suite run --config fixtures/configs/outcome-suite.suite.json --json
|
|
929
|
+
```
|
|
930
|
+
|
|
931
|
+
Recipe: [trace-suite-basic](../examples/recipes/trace-suite-basic/README.md).
|
|
932
|
+
|
|
896
933
|
## 7. Optional TUI behavior
|
|
897
934
|
|
|
898
935
|
`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.
|
package/docs/SCHEMA.md
CHANGED
|
@@ -36,6 +36,7 @@ The stable event names are:
|
|
|
36
36
|
- `run_completed`
|
|
37
37
|
- `step_started`
|
|
38
38
|
- `step_completed`
|
|
39
|
+
- `outcome_observed` (v4.4.0+)
|
|
39
40
|
|
|
40
41
|
There is **no** `step_failed` event. Failures are represented by `step_completed` with `status: "error"`.
|
|
41
42
|
|
|
@@ -111,6 +112,31 @@ Every trace line contains:
|
|
|
111
112
|
}
|
|
112
113
|
```
|
|
113
114
|
|
|
115
|
+
### 3.5 `outcome_observed` (v4.4.0+)
|
|
116
|
+
|
|
117
|
+
Records whether an external side effect matched expectations. Distinct from step/tool success.
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
{
|
|
121
|
+
schemaVersion: "0.1",
|
|
122
|
+
event: "outcome_observed",
|
|
123
|
+
timestamp: number,
|
|
124
|
+
runId: string,
|
|
125
|
+
outcomeId: string,
|
|
126
|
+
parentId?: string,
|
|
127
|
+
name: string,
|
|
128
|
+
expectation: string,
|
|
129
|
+
status: "passed" | "failed" | "unknown" | "skipped",
|
|
130
|
+
method?: "dom" | "accessibility" | "snapshot" | "network" | "storage"
|
|
131
|
+
| "filesystem" | "database" | "queue" | "custom",
|
|
132
|
+
actual?: unknown,
|
|
133
|
+
evidence?: Record<string, unknown>,
|
|
134
|
+
observedAt: number
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
`actual` and `evidence` are bounded and redacted before disk like step metadata. See [OBSERVED-OUTCOMES-V4.4.md](./proposals/OBSERVED-OUTCOMES-V4.4.md).
|
|
139
|
+
|
|
114
140
|
## 4. Error representation
|
|
115
141
|
|
|
116
142
|
- Errors are structured as `{ message, stack? }`.
|
|
@@ -173,7 +199,7 @@ interface InspectEvent {
|
|
|
173
199
|
runId: string;
|
|
174
200
|
parentId?: string;
|
|
175
201
|
name: string;
|
|
176
|
-
kind: "RUN" | "AGENT" | "LLM" | "TOOL" | "CHAIN" | "RETRIEVER" | "DECISION" | "RESULT" | "ERROR" | "LOGIC" | "LOG";
|
|
202
|
+
kind: "RUN" | "AGENT" | "LLM" | "TOOL" | "CHAIN" | "RETRIEVER" | "DECISION" | "RESULT" | "ERROR" | "LOGIC" | "LOG" | "OUTCOME";
|
|
177
203
|
timestamp: number;
|
|
178
204
|
status?: "running" | "ok" | "error";
|
|
179
205
|
durationMs?: number;
|
package/package.json
CHANGED