@agent-inspect/vitest 6.14.0 → 6.14.1
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 +24 -8
- package/package.json +11 -3
package/README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# @agent-inspect/vitest
|
|
2
2
|
|
|
3
|
-
Vitest reporter
|
|
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
|
-
-
|
|
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
|
-
##
|
|
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
|
-
-
|
|
56
|
-
-
|
|
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/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-inspect/vitest",
|
|
3
|
-
"version": "6.14.
|
|
3
|
+
"version": "6.14.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "
|
|
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.
|
|
40
|
+
"agent-inspect": "6.14.1"
|
|
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"
|