@agent-inspect/vitest 6.14.0 → 6.14.2

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/README.md CHANGED
@@ -1,14 +1,15 @@
1
1
  # @agent-inspect/vitest
2
2
 
3
- Vitest reporter failed tests emit local trace artifacts; passing tests stay quiet.
3
+ Vitest reporter for local AgentInspect failure artifacts, plus **experimental** TraceContract matchers.
4
4
 
5
5
 
6
- **Support level:** Supported — see [SUPPORT-LEVELS.md](https://github.com/rajudandigam/agent-inspect/blob/main/docs/SUPPORT-LEVELS.md).
6
+ **Support level:** Supported (reporter) · Experimental (matchers) — see [SUPPORT-LEVELS.md](https://github.com/rajudandigam/agent-inspect/blob/main/docs/SUPPORT-LEVELS.md).
7
7
 
8
8
  ## When to use
9
9
 
10
10
  - Vitest suites that run instrumented agents
11
- - You want PR artifacts on failure without changing test assertions
11
+ - PR artifacts on failure without changing assertion libraries
12
+ - Experimental trajectory assertions via `toPassTraceContract` / `toHaveRequiredTool`
12
13
 
13
14
  ## When not to use
14
15
 
@@ -23,7 +24,7 @@ npm install agent-inspect @agent-inspect/vitest vitest
23
24
 
24
25
  **Peer:** `vitest@^2.1.0`
25
26
 
26
- ## Example
27
+ ## Reporter example
27
28
 
28
29
  ```ts
29
30
  // vitest.config.ts
@@ -37,6 +38,20 @@ export default defineConfig({
37
38
  });
38
39
  ```
39
40
 
41
+ ## Experimental matchers
42
+
43
+ ```ts
44
+ import { expect } from "vitest";
45
+ import { agentInspectVitestMatchers } from "@agent-inspect/vitest";
46
+
47
+ expect.extend(agentInspectVitestMatchers);
48
+
49
+ expect(read).toPassTraceContract(contract);
50
+ expect(read).toHaveRequiredTool("lookup_orders");
51
+ ```
52
+
53
+ There is no `expectTrace(...).toSatisfyTraceContract` helper — use the matchers above.
54
+
40
55
  ## Privacy
41
56
 
42
57
  - Writes traces locally on failure only (by default)
@@ -44,7 +59,8 @@ export default defineConfig({
44
59
 
45
60
  ## API
46
61
 
47
- Default export: Vitest reporter factory.
62
+ - Default export: Vitest reporter factory
63
+ - `agentInspectVitestMatchers` — Experimental
48
64
 
49
65
  ## CLI
50
66
 
@@ -52,20 +68,20 @@ After failure: `npx agent-inspect report <run-id>`
52
68
 
53
69
  ## Limitations
54
70
 
55
- - This package is a **reporter** (failure artifacts). It does **not** ship Vitest TraceContract matchers such as `expectTrace(...).toSatisfyTraceContract`.
56
- - Use `agent-inspect check` / TraceContract APIs for trajectory assertions.
71
+ - Matchers are **Experimental** and may evolve in minors
72
+ - Prefer CLI / TraceContract APIs for deep CI gates when matchers are insufficient
57
73
 
58
74
  ## Docs
59
75
 
60
76
  - [CI artifacts](https://github.com/rajudandigam/agent-inspect/blob/main/docs/CI-ARTIFACTS.md)
61
77
  - [TRACE-CONTRACTS.md](https://github.com/rajudandigam/agent-inspect/blob/main/docs/TRACE-CONTRACTS.md)
78
+ - [TRACE-FACTS.md](https://github.com/rajudandigam/agent-inspect/blob/main/docs/TRACE-FACTS.md)
62
79
 
63
80
  ## Troubleshooting
64
81
 
65
82
  - **No artifact:** Ensure trace was written during test and reporter `traceDir` matches
66
83
  - **Original errors preserved:** Reporter does not swallow Vitest failures
67
84
 
68
-
69
85
  ## Version
70
86
 
71
87
  Part of the fixed AgentInspect release line. See the npm badge / package manifest for the current version.
package/dist/index.d.cts CHANGED
@@ -76,6 +76,14 @@ interface InspectNode {
76
76
  children: InspectNode[];
77
77
  depth: number;
78
78
  }
79
+ /** Bounded parent/cycle summary for visibility-first tree building (6.14.2+). */
80
+ interface RelationshipSummary {
81
+ rootCount: number;
82
+ selfParentCount: number;
83
+ cycleCount: number;
84
+ unresolvedParentCount: number;
85
+ normalizedEdgeCount: number;
86
+ }
79
87
  interface InspectRunTree {
80
88
  runId: string;
81
89
  name?: string;
@@ -88,6 +96,7 @@ interface InspectRunTree {
88
96
  totalEvents: number;
89
97
  confidenceBreakdown: Record<AttributionConfidence, number>;
90
98
  kinds: Record<InspectKind, number>;
99
+ relationshipSummary?: RelationshipSummary;
91
100
  };
92
101
  }
93
102
 
package/dist/index.d.ts CHANGED
@@ -76,6 +76,14 @@ interface InspectNode {
76
76
  children: InspectNode[];
77
77
  depth: number;
78
78
  }
79
+ /** Bounded parent/cycle summary for visibility-first tree building (6.14.2+). */
80
+ interface RelationshipSummary {
81
+ rootCount: number;
82
+ selfParentCount: number;
83
+ cycleCount: number;
84
+ unresolvedParentCount: number;
85
+ normalizedEdgeCount: number;
86
+ }
79
87
  interface InspectRunTree {
80
88
  runId: string;
81
89
  name?: string;
@@ -88,6 +96,7 @@ interface InspectRunTree {
88
96
  totalEvents: number;
89
97
  confidenceBreakdown: Record<AttributionConfidence, number>;
90
98
  kinds: Record<InspectKind, number>;
99
+ relationshipSummary?: RelationshipSummary;
91
100
  };
92
101
  }
93
102
 
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@agent-inspect/vitest",
3
- "version": "6.14.0",
3
+ "version": "6.14.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "description": "Optional Vitest reporter for AgentInspect local trace artifacts",
6
+ "description": "Vitest reporter and experimental TraceContract matchers for AgentInspect local evidence",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/rajudandigam/agent-inspect.git",
@@ -37,7 +37,7 @@
37
37
  "vitest": "^2.1.0"
38
38
  },
39
39
  "dependencies": {
40
- "agent-inspect": "6.14.0"
40
+ "agent-inspect": "6.14.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "vitest": "^2.1.8"
@@ -45,6 +45,14 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
+ "keywords": [
49
+ "vitest",
50
+ "agent-inspect",
51
+ "tracecontract",
52
+ "trajectory-testing",
53
+ "typescript",
54
+ "ai-agents"
55
+ ],
48
56
  "scripts": {
49
57
  "build": "pnpm --workspace-root exec tsup --config tsup.vitest.config.ts",
50
58
  "test": "vitest run -c ../../vitest.config.ts"