evalvcr 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +221 -2
- package/dist/cassette.d.ts +75 -0
- package/dist/cassette.d.ts.map +1 -0
- package/dist/cassette.js +390 -0
- package/dist/cassette.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +422 -0
- package/dist/cli.js.map +1 -0
- package/dist/evalite-compat.d.ts +23 -0
- package/dist/evalite-compat.d.ts.map +1 -0
- package/dist/evalite-compat.js +19 -0
- package/dist/evalite-compat.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/interceptors/ai-sdk.d.ts +14 -0
- package/dist/interceptors/ai-sdk.d.ts.map +1 -0
- package/dist/interceptors/ai-sdk.js +216 -0
- package/dist/interceptors/ai-sdk.js.map +1 -0
- package/dist/interceptors/anthropic.d.ts +15 -0
- package/dist/interceptors/anthropic.d.ts.map +1 -0
- package/dist/interceptors/anthropic.js +180 -0
- package/dist/interceptors/anthropic.js.map +1 -0
- package/dist/interceptors/fetch.d.ts +3 -0
- package/dist/interceptors/fetch.d.ts.map +1 -0
- package/dist/interceptors/fetch.js +121 -0
- package/dist/interceptors/fetch.js.map +1 -0
- package/dist/interceptors/index.d.ts +6 -0
- package/dist/interceptors/index.d.ts.map +1 -0
- package/dist/interceptors/index.js +8 -0
- package/dist/interceptors/index.js.map +1 -0
- package/dist/interceptors/mcp.d.ts +70 -0
- package/dist/interceptors/mcp.d.ts.map +1 -0
- package/dist/interceptors/mcp.js +294 -0
- package/dist/interceptors/mcp.js.map +1 -0
- package/dist/interceptors/openai.d.ts +17 -0
- package/dist/interceptors/openai.d.ts.map +1 -0
- package/dist/interceptors/openai.js +210 -0
- package/dist/interceptors/openai.js.map +1 -0
- package/dist/migrate-evalite.d.ts +25 -0
- package/dist/migrate-evalite.d.ts.map +1 -0
- package/dist/migrate-evalite.js +138 -0
- package/dist/migrate-evalite.js.map +1 -0
- package/dist/report.d.ts +2 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +4 -0
- package/dist/report.js.map +1 -0
- package/dist/reporters/index.d.ts +9 -0
- package/dist/reporters/index.d.ts.map +1 -0
- package/dist/reporters/index.js +23 -0
- package/dist/reporters/index.js.map +1 -0
- package/dist/reporters/json.d.ts +3 -0
- package/dist/reporters/json.d.ts.map +1 -0
- package/dist/reporters/json.js +6 -0
- package/dist/reporters/json.js.map +1 -0
- package/dist/reporters/markdown.d.ts +3 -0
- package/dist/reporters/markdown.d.ts.map +1 -0
- package/dist/reporters/markdown.js +41 -0
- package/dist/reporters/markdown.js.map +1 -0
- package/dist/reporters/pretty.d.ts +6 -0
- package/dist/reporters/pretty.d.ts.map +1 -0
- package/dist/reporters/pretty.js +59 -0
- package/dist/reporters/pretty.js.map +1 -0
- package/dist/reporters/sarif.d.ts +43 -0
- package/dist/reporters/sarif.d.ts.map +1 -0
- package/dist/reporters/sarif.js +74 -0
- package/dist/reporters/sarif.js.map +1 -0
- package/dist/runner.d.ts +49 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +689 -0
- package/dist/runner.js.map +1 -0
- package/dist/schemas.d.ts +15 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +275 -0
- package/dist/schemas.js.map +1 -0
- package/dist/scorer-utils.d.ts +6 -0
- package/dist/scorer-utils.d.ts.map +1 -0
- package/dist/scorer-utils.js +59 -0
- package/dist/scorer-utils.js.map +1 -0
- package/dist/scrub.d.ts +25 -0
- package/dist/scrub.d.ts.map +1 -0
- package/dist/scrub.js +285 -0
- package/dist/scrub.js.map +1 -0
- package/dist/server.d.ts +16 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +493 -0
- package/dist/server.js.map +1 -0
- package/dist/storage/index.d.ts +5 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +19 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/json-file.d.ts +17 -0
- package/dist/storage/json-file.d.ts.map +1 -0
- package/dist/storage/json-file.js +89 -0
- package/dist/storage/json-file.js.map +1 -0
- package/dist/storage/sqlite.d.ts +16 -0
- package/dist/storage/sqlite.d.ts.map +1 -0
- package/dist/storage/sqlite.js +125 -0
- package/dist/storage/sqlite.js.map +1 -0
- package/dist/types.d.ts +336 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/package.json +95 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 evalvcr contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,222 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# evalvcr
|
|
4
|
+
|
|
5
|
+
**Local-first AI-agent & MCP evaluation and deterministic VCR cassette testing suite.**
|
|
6
|
+
|
|
7
|
+
Record LLM, Claude Agent SDK, OpenAI, Vercel AI SDK, and MCP (`stdio` + Streamable HTTP) interactions once, scrub secrets and PII automatically before disk writes, and replay deterministically in TypeScript, Python (`pytest`), Docker, or GitHub Actions — with **zero** third-party runtime dependencies and **zero** telemetry.
|
|
8
|
+
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](package.json)
|
|
11
|
+
[](python/evalvcr/pyproject.toml)
|
|
12
|
+
|
|
13
|
+
**[Documentation](https://evalvcr.mintlify.site)** · **[Interactive Playground](https://evalvcr.vercel.app)** · **[npm](https://www.npmjs.com/package/evalvcr)**
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
## Why `evalvcr`?
|
|
22
|
+
|
|
23
|
+
Testing AI agents and Model Context Protocol (MCP) servers in CI breaks down when tests hit live model APIs: runs become flaky, slow, expensive, and unsafe to run on pull requests.
|
|
24
|
+
|
|
25
|
+
`evalvcr` solves this with **open, deterministic VCR cassettes (`evalvcr.cassette.v1`)** and **structured evaluation reports (`evalvcr.report.v1`)** that work identically across TypeScript and Python:
|
|
26
|
+
|
|
27
|
+
- **Zero External Runtime Dependencies:** `evalvcr`, `@evalvcr/scorers`, `@evalvcr/storage-neon`, `@evalvcr/playground`, and Python `evalvcr` run on Node `>= 20` / Python `>= 3.10` standard libraries alone.
|
|
28
|
+
- **Pre-Disk Secret & PII Scrubbing:** A deterministic 7-step ASCII scrubber redacts sensitive headers, PEM keys, database passwords, API/Bearer tokens, SSNs, Luhn-validated payment cards, and email addresses *before* writing cassettes and *before* hashing fingerprints.
|
|
29
|
+
- **Strict Drift Detection:** `strict` mode enforces exact `seq` ordering and canonical JSON (JCS-aligned) SHA-256 fingerprints, emitting field-level diffs when prompts, tools, or MCP params drift.
|
|
30
|
+
- **MCP + Multi-SDK Native:** Intercepts MCP Client & Server (`stdio` and Streamable HTTP JSON-RPC 2.0), Vercel AI SDK (`wrapAISDKModel`), Anthropic / Claude Agent SDK (`wrapAnthropic`, `wrapClaudeAgent`), OpenAI (`wrapOpenAI`), and `fetch` (`createVCRFetch`).
|
|
31
|
+
- **14 Atomic Deterministic Scorers + Security Guards:** Exact match, contains, JSON schema, Levenshtein similarity, tool-call accuracy/order, latency/token budgets, 5 deterministic security/integrity guards, and cached `llmJudge`.
|
|
32
|
+
- **Smooth `evalite` Migration:** Includes `evalvcr/evalite-compat` and `evalvcr migrate-evalite` (`--dry-run` / `--write`).
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Feature Comparison
|
|
37
|
+
|
|
38
|
+
| Capability | `evalvcr` | `evalite` | `mcp-evals` | `vitest-evals` |
|
|
39
|
+
| :--- | :---: | :---: | :---: | :---: |
|
|
40
|
+
| Deterministic VCR Cassette Replay (`record`/`replay`/`auto`/`strict`) | Yes | No | No | No |
|
|
41
|
+
| Pre-disk Secret & PII Scrubbing | Yes (7-step) | No | No | No |
|
|
42
|
+
| MCP `stdio` + Streamable HTTP JSON-RPC 2.0 Replay | Yes | No | Partial (live LLM) | No |
|
|
43
|
+
| Claude Agent SDK + Anthropic + OpenAI + Vercel AI SDK | Yes | AI SDK focus | MCP only | Custom |
|
|
44
|
+
| Local Zero-Config SQLite / JSON UI (`evalvcr serve`) | Yes | Separate server | No | No |
|
|
45
|
+
| Built-in Security & Integrity Guard Scorers + SARIF 2.1.0 | Yes | No | No | No |
|
|
46
|
+
| Cross-Language Python + `pytest` Companion (Same Schemas) | Yes | No | No | No |
|
|
47
|
+
| `evalite` Compatibility Layer & CLI Migrator | Yes | Native | No | No |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Quick Start (TypeScript)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install -D evalvcr @evalvcr/scorers
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Create `evals/agent.eval.mjs` (or `.ts` on Node `>= 22.6`):
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
import { defineEval, wrapAISDKModel } from "evalvcr";
|
|
61
|
+
import { toolCallAccuracy, secretLeakGuard } from "@evalvcr/scorers";
|
|
62
|
+
|
|
63
|
+
defineEval("weather-agent", {
|
|
64
|
+
mode: "auto", // records on first run, replays deterministically after
|
|
65
|
+
scoreThreshold: 0.8,
|
|
66
|
+
data: [
|
|
67
|
+
{
|
|
68
|
+
name: "fetches forecast",
|
|
69
|
+
input: "What is the weather in Hanoi?",
|
|
70
|
+
expected: { toolCalls: [{ name: "get_weather" }] },
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
scorers: [toolCallAccuracy(), secretLeakGuard()],
|
|
74
|
+
async task(input, ctx) {
|
|
75
|
+
const model = wrapAISDKModel(myModel, ctx.vcr);
|
|
76
|
+
const res = await model.doGenerate({ prompt: input });
|
|
77
|
+
return {
|
|
78
|
+
text: res.text,
|
|
79
|
+
toolCalls: res.toolCalls ?? [],
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Run evaluations locally or in CI:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Run with default replay/auto behavior
|
|
89
|
+
npx evalvcr run ./evals --mode auto
|
|
90
|
+
|
|
91
|
+
# Enforce strict sequence + fingerprint matching in CI
|
|
92
|
+
npx evalvcr run ./evals --mode strict --threshold 0.8 --fail-on error
|
|
93
|
+
|
|
94
|
+
# Open the built-in local Web UI (SQLite on Node 22.5+, JSON fallback on Node 20)
|
|
95
|
+
npx evalvcr serve --host 127.0.0.1 --port 4310
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Quick Start (Python & `pytest`)
|
|
101
|
+
|
|
102
|
+
`python/evalvcr` requires only Python `>= 3.10` stdlib (`pytest` is optional):
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pip install evalvcr
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
import pytest
|
|
110
|
+
from evalvcr import CassetteVCR, exact_match
|
|
111
|
+
|
|
112
|
+
@pytest.mark.evalvcr(mode="auto", cassette="weather-agent")
|
|
113
|
+
def test_agent_replay(evalvcr_cassette: CassetteVCR):
|
|
114
|
+
interaction = evalvcr_cassette.interact(
|
|
115
|
+
kind="llm.chat",
|
|
116
|
+
provider="anthropic",
|
|
117
|
+
request={"method": "POST", "target": "/v1/messages", "body": {"prompt": "hi"}},
|
|
118
|
+
execute=lambda: {"response": {"status": 200, "sdk": {"text": "hello"}}},
|
|
119
|
+
)
|
|
120
|
+
assert exact_match()({"output": interaction["response"]["sdk"]["text"], "expected": "hello"})["score"] == 1.0
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Run via `pytest` or `unittest`:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
pytest --evalvcr-mode=strict --evalvcr-cassette-dir=.evalvcr/cassettes
|
|
127
|
+
python -m evalvcr run ./evals --mode replay
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Cassettes recorded in TypeScript replay in Python and vice versa with identical JCS canonical JSON + SHA-256 fingerprints.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## CLI Reference
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
evalvcr run [paths...] [options]
|
|
138
|
+
--format <pretty|json|sarif|markdown> Output format (default: pretty)
|
|
139
|
+
--json Alias for --format json
|
|
140
|
+
--mode <record|replay|auto|strict> VCR mode (default: replay)
|
|
141
|
+
--threshold <0..1> Pass threshold override (default: 0.7)
|
|
142
|
+
--fail-on <error|warning|off> Exit non-zero on findings (default: error)
|
|
143
|
+
--cassette-dir <dir> Cassette directory (default: .evalvcr/cassettes)
|
|
144
|
+
--storage-dir <dir> Local SQLite/JSON storage directory (default: .evalvcr)
|
|
145
|
+
--watch Watch files and re-run on changes
|
|
146
|
+
--output <file> Write formatted output to a file
|
|
147
|
+
|
|
148
|
+
evalvcr migrate-evalite [dir] [--dry-run|--write] [--native] [--format json|--json]
|
|
149
|
+
evalvcr serve [--host 127.0.0.1] [--port 4310] [--dir .evalvcr] [--cassette-dir <dir>]
|
|
150
|
+
evalvcr inspect <file.json> [--format pretty|json] [--json]
|
|
151
|
+
evalvcr scrub <cassette.json> [--write]
|
|
152
|
+
evalvcr export <report.json> --format <sarif|markdown|json> [--json] [--output <file>]
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Exit codes: `0` = passed, `1` = evaluation threshold / drift / `--fail-on` failure, `2` = invalid CLI usage, missing file, or malformed schema (concise error on `stderr`, no stack trace).
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Packages & Companion Surfaces
|
|
160
|
+
|
|
161
|
+
| Component | Package / Path | Purpose |
|
|
162
|
+
| :--- | :--- | :--- |
|
|
163
|
+
| Core Engine & CLI | `evalvcr` (`packages/core`) | VCR engine, 7-step scrubber, runner, interceptors, storage, local Web UI, CLI |
|
|
164
|
+
| Atomic Scorers | `@evalvcr/scorers` (`packages/scorers`) | 14 atomic scorers (`exactMatch`, `contains`, `jsonSchema`, `toolCallAccuracy`, `toolCallOrder`, `latencyBudget`, `tokenCostBudget`, `levenshteinSimilarity`, 5 security/integrity guards, cached `llmJudge`) |
|
|
165
|
+
| Neon Adapter | `@evalvcr/storage-neon` (`packages/storage-neon`) | Optional Neon Postgres PR-branch history storage (`NEON_SCHEMA_SQL`, `NeonStorageAdapter`, `createHttpSqlExecutor`, `resolveBranchContext`) |
|
|
166
|
+
| Python SDK | `evalvcr` (`python/evalvcr`) | Pure-Python stdlib VCR engine, scorers, CLI, and `pytest11` plugin |
|
|
167
|
+
| Playground | `@evalvcr/playground` (`apps/playground`) | Interactive client-side trace waterfall, drift diff, security findings, Markdown PR summary, and SVG badge inspector ([Live](https://evalvcr.vercel.app)) |
|
|
168
|
+
| GitHub Action | `action.yml` (`action/`) | Composite action writing Step Summary, SARIF 2.1.0, outputs, and opt-in sticky PR comments |
|
|
169
|
+
| Container | `Dockerfile` | Multi-stage `node:22-alpine` non-root CLI image |
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## GitHub Action
|
|
174
|
+
|
|
175
|
+
```yaml
|
|
176
|
+
name: AI Evals
|
|
177
|
+
on:
|
|
178
|
+
pull_request:
|
|
179
|
+
|
|
180
|
+
permissions:
|
|
181
|
+
contents: read
|
|
182
|
+
pull-requests: write
|
|
183
|
+
|
|
184
|
+
jobs:
|
|
185
|
+
evalvcr:
|
|
186
|
+
runs-on: ubuntu-latest
|
|
187
|
+
steps:
|
|
188
|
+
- uses: actions/checkout@v4
|
|
189
|
+
- uses: evalvcr/evalvcr@v0.1.1
|
|
190
|
+
with:
|
|
191
|
+
paths: ./evals
|
|
192
|
+
mode: strict
|
|
193
|
+
threshold: "0.8"
|
|
194
|
+
fail-on: error
|
|
195
|
+
comment: "true"
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Documentation
|
|
201
|
+
|
|
202
|
+
Full Mintlify-ready guides live under [`docs/`](docs/):
|
|
203
|
+
|
|
204
|
+
- [Introduction](docs/index.mdx)
|
|
205
|
+
- [Quickstart](docs/quickstart.mdx)
|
|
206
|
+
- [CLI Reference](docs/cli.mdx)
|
|
207
|
+
- [VCR Cassettes & Scrubbing](docs/vcr-cassettes.mdx)
|
|
208
|
+
- [MCP & SDK Interceptors](docs/mcp-and-sdks.mdx)
|
|
209
|
+
- [Scorers & Security Guards](docs/scorers.mdx)
|
|
210
|
+
- [Python & pytest Companion](docs/python.mdx)
|
|
211
|
+
- [GitHub Action & CI](docs/ci-and-action.mdx)
|
|
212
|
+
- [Migrating from Evalite](docs/migration-evalite.mdx)
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Contributing
|
|
217
|
+
|
|
218
|
+
Contributions are welcome — see [CONTRIBUTING.md](https://github.com/evalvcr/evalvcr/blob/main/CONTRIBUTING.md) for local setup, the atomic scorer guide, and TS/Python schema parity rules.
|
|
219
|
+
|
|
220
|
+
## License
|
|
221
|
+
|
|
222
|
+
[MIT](LICENSE) © 2026 `evalvcr` contributors
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { CassetteInteractionV1, CassetteV1, DriftDiffItem, InteractionKind, VCRController, VCRInteractionInput, VCRMode } from "./types.js";
|
|
2
|
+
export interface VCREngineOptions {
|
|
3
|
+
name: string;
|
|
4
|
+
cassettePath?: string;
|
|
5
|
+
cassetteDir?: string;
|
|
6
|
+
mode?: VCRMode;
|
|
7
|
+
scrub?: boolean;
|
|
8
|
+
allowFallbackMatch?: boolean;
|
|
9
|
+
sdkVersion?: string;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export declare class CassetteMissError extends Error {
|
|
13
|
+
readonly cassetteName: string;
|
|
14
|
+
readonly kind: InteractionKind;
|
|
15
|
+
readonly provider: string;
|
|
16
|
+
readonly target: string;
|
|
17
|
+
readonly fingerprint: string;
|
|
18
|
+
constructor(params: {
|
|
19
|
+
cassetteName: string;
|
|
20
|
+
kind: InteractionKind;
|
|
21
|
+
provider: string;
|
|
22
|
+
target: string;
|
|
23
|
+
fingerprint: string;
|
|
24
|
+
message?: string;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export declare class CassetteDriftError extends Error {
|
|
28
|
+
readonly cassetteName: string;
|
|
29
|
+
readonly seq: number;
|
|
30
|
+
readonly diffs: DriftDiffItem[];
|
|
31
|
+
constructor(params: {
|
|
32
|
+
cassetteName: string;
|
|
33
|
+
seq: number;
|
|
34
|
+
diffs: DriftDiffItem[];
|
|
35
|
+
message?: string;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export declare function sanitizeCassetteName(name: string): string;
|
|
39
|
+
export declare function diffValues(expected: unknown, actual: unknown, path?: string): DriftDiffItem[];
|
|
40
|
+
export declare class VCREngine implements VCRController {
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly mode: VCRMode;
|
|
43
|
+
readonly cassettePath: string;
|
|
44
|
+
private readonly scrubEnabled;
|
|
45
|
+
private readonly allowFallbackMatch;
|
|
46
|
+
private readonly sdkVersion;
|
|
47
|
+
private readonly metadata?;
|
|
48
|
+
private fileExistedOnLoad;
|
|
49
|
+
private loadedCassette;
|
|
50
|
+
private recorded;
|
|
51
|
+
private captured;
|
|
52
|
+
private consumedIndices;
|
|
53
|
+
private cursor;
|
|
54
|
+
private dirty;
|
|
55
|
+
private totalRedactedCount;
|
|
56
|
+
private rulesApplied;
|
|
57
|
+
constructor(options: VCREngineOptions);
|
|
58
|
+
private loadFromDisk;
|
|
59
|
+
private isRecordingEffectiveMode;
|
|
60
|
+
interact(input: VCRInteractionInput): Promise<CassetteInteractionV1>;
|
|
61
|
+
verifyComplete(): void;
|
|
62
|
+
getCassette(): CassetteV1;
|
|
63
|
+
getStats(): {
|
|
64
|
+
recordedCount: number;
|
|
65
|
+
capturedCount: number;
|
|
66
|
+
consumedCount: number;
|
|
67
|
+
cursor: number;
|
|
68
|
+
dirty: boolean;
|
|
69
|
+
};
|
|
70
|
+
save(): Promise<string>;
|
|
71
|
+
saveIfDirty(): Promise<void>;
|
|
72
|
+
close(): Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
export declare function withVCR<T>(options: VCREngineOptions, fn: (vcr: VCREngine) => Promise<T>): Promise<T>;
|
|
75
|
+
//# sourceMappingURL=cassette.d.ts.map
|
|
@@ -0,0 +1 @@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