toolsplice 0.0.0-stage → 0.0.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.
Files changed (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +372 -2
  3. package/dist/cli.d.ts +2 -0
  4. package/dist/cli.js +923 -0
  5. package/dist/codegen.d.ts +44 -0
  6. package/dist/codegen.js +479 -0
  7. package/dist/contract-caller.d.ts +22 -0
  8. package/dist/contract-caller.js +307 -0
  9. package/dist/contract-corrections.d.ts +35 -0
  10. package/dist/contract-corrections.js +159 -0
  11. package/dist/contract-schema.d.ts +5 -0
  12. package/dist/contract-schema.js +126 -0
  13. package/dist/contracts.d.ts +71 -0
  14. package/dist/contracts.js +366 -0
  15. package/dist/core.d.ts +14 -0
  16. package/dist/core.js +16 -0
  17. package/dist/doctor.d.ts +22 -0
  18. package/dist/doctor.js +91 -0
  19. package/dist/drift.d.ts +23 -0
  20. package/dist/drift.js +111 -0
  21. package/dist/execution.d.ts +38 -0
  22. package/dist/execution.js +66 -0
  23. package/dist/extract.d.ts +34 -0
  24. package/dist/extract.js +73 -0
  25. package/dist/index.d.ts +20 -0
  26. package/dist/index.js +19 -0
  27. package/dist/ordered-transport.d.ts +12 -0
  28. package/dist/ordered-transport.js +106 -0
  29. package/dist/pattern.d.ts +2 -0
  30. package/dist/pattern.js +32 -0
  31. package/dist/postgres.d.ts +41 -0
  32. package/dist/postgres.js +264 -0
  33. package/dist/probe.d.ts +29 -0
  34. package/dist/probe.js +134 -0
  35. package/dist/proxy.d.ts +40 -0
  36. package/dist/proxy.js +436 -0
  37. package/dist/runtime.d.ts +6 -0
  38. package/dist/runtime.js +26 -0
  39. package/dist/schema.d.ts +17 -0
  40. package/dist/schema.js +299 -0
  41. package/dist/shape.d.ts +91 -0
  42. package/dist/shape.js +499 -0
  43. package/dist/splice-diagnostics.d.ts +40 -0
  44. package/dist/splice-diagnostics.js +80 -0
  45. package/dist/splice-project.d.ts +119 -0
  46. package/dist/splice-project.js +296 -0
  47. package/dist/splice-recording.d.ts +105 -0
  48. package/dist/splice-recording.js +464 -0
  49. package/dist/splice.d.ts +84 -0
  50. package/dist/splice.js +1065 -0
  51. package/dist/storage.d.ts +17 -0
  52. package/dist/storage.js +1 -0
  53. package/dist/store.d.ts +151 -0
  54. package/dist/store.js +735 -0
  55. package/dist/v2.d.ts +49 -0
  56. package/dist/v2.js +396 -0
  57. package/dist/validate-output.d.ts +3 -0
  58. package/dist/validate-output.js +73 -0
  59. package/dist/version.d.ts +1 -0
  60. package/dist/version.js +1 -0
  61. package/dist/workflow-json.d.ts +8 -0
  62. package/dist/workflow-json.js +74 -0
  63. package/docs/PROJECTS-AND-UPGRADES.md +115 -0
  64. package/docs/RECORDING-AND-CORRECTIONS.md +176 -0
  65. package/package.json +95 -4
@@ -0,0 +1,115 @@
1
+ # Projects, candidate-contract checks and the standalone core
2
+
3
+ Toolsplice v0.9 adds offline setup and upgrade checks, plus an independently installable core package. No Cloudflare service/account is required. These changes do not add durable workflow resumption, automatic retries or provider authentication/discovery.
4
+
5
+ ## Start a project
6
+
7
+ ```sh
8
+ toolsplice init ./my-handoff
9
+ toolsplice project ./my-handoff --allow-review --json
10
+ ```
11
+
12
+ For this unpublished checkout, build first and replace `toolsplice` with `node /absolute/path/to/mcp-shape/dist/cli.js`. A developer already running the CLI can check the generated project without installing a second package or configuring a provider account.
13
+
14
+ The new private directory contains:
15
+
16
+ | File | Purpose |
17
+ |---|---|
18
+ | `toolsplice.project.json` | Fixed-file project format, fixture encoding and origin |
19
+ | `plan.json` | Explicit source → destination bindings |
20
+ | `source.json`, `target.json` | Portable contract snapshots |
21
+ | `input.json` | Saved source arguments |
22
+ | `fixture.json` | Saved decoded or raw MCP source result |
23
+ | `context.json` | Per-call values, when declared/present |
24
+ | `adapter.ts` | Generated typed adapter, using the full package |
25
+ | `README.md` | Check, regeneration and application instructions |
26
+
27
+ The default is a **synthetic** document → artifact handoff. It checks locally; it fetches no URL, writes no destination document and creates no clients or learning store. Applications provide actual tool callers and explicitly replace the contracts/mapping. Field names are not matched heuristically. The initializer does not run npm or install dependencies.
28
+
29
+ `project` checks source input, context, saved source output, selected-value requirements and every mapped destination argument. It also compares `adapter.ts` with the current plan/contracts/generator. A stale generated adapter blocks the check. It never overwrites that file. Regenerate into a new path with the command in the project's README, review the result and replace the generated adapter deliberately. Formatting/customizing a generated file can also trigger this conservative freshness check.
30
+
31
+ The check reports counts, paths and issues, omitting mapped values. `--allow-review` changes the exit policy for review status; blocked projects still fail, and runtime guards remain active. It does not authorize or perform live effects.
32
+
33
+ Project contents are prepared and checked before creating the directory. Existing directories are refused without modification. The directory uses mode 0700 and new files mode 0600. An I/O failure while writing can leave a partial new directory for inspection; filesystem creation is not claimed to be a transaction. The project format reads fixed artifact filenames and does not allow arbitrary path references in its manifest.
34
+
35
+ ## Start from a successful recording
36
+
37
+ ```sh
38
+ toolsplice init ./existing-handoff --from-recording recording.json --json
39
+ ```
40
+
41
+ The recording must be a complete payload capture that reproduces a successful outcome under offline replay. Metadata-only, incomplete, failed, unrestored or mismatching recordings are rejected before creating the directory. The initializer copies the exact mapping/contracts and raw source response; it does not contact the original servers. It retains `recording.json` so that full response replay and upgrade checks remain available.
42
+
43
+ For a redacted recording:
44
+
45
+ ```sh
46
+ toolsplice init ./private-handoff --from-recording recording.json \
47
+ --restorations private-values.json --json
48
+ ```
49
+
50
+ Every redacted path requires an explicit restoration. **Restored input/context/source fixtures are copied into the new private project and may contain confidential values.** The retained `recording.json` is the original redacted artifact; private restoration policies/values are not inserted into that retained recording. Its replay still needs the private restoration file. Do not share a generated project merely because its original recording was redacted.
51
+
52
+ API equivalents are `createSpliceProjectFiles`, `initializeSpliceProject`, `checkSpliceProjectFiles` and `checkSpliceProject` from the full package. The file builder does not perform filesystem writes. The standalone core focuses on execution/contracts and does not export project/CLI helpers.
53
+
54
+ ## Check candidate contracts against saved calls
55
+
56
+ ```ts
57
+ import { replaySpliceRecording } from 'toolsplice'; // Or toolsplice-core.
58
+ const report = await replaySpliceRecording(recording, {
59
+ sourceContract: candidateSource,
60
+ targetContract: candidateTarget,
61
+ allowReview: true, // Explicitly allow uncertain preflight checks when reviewed.
62
+ });
63
+ console.log(report.upgrade?.status, report.networkCalls);
64
+ ```
65
+
66
+ ```sh
67
+ toolsplice replay recording.json --target-contract candidate-target.json --json
68
+ toolsplice replay recording.json --source-contract candidate-source.json \
69
+ --target-contract candidate-target.json --allow-review --json
70
+ ```
71
+
72
+ Candidate snapshots must identify the same logical servers as the recording. Only the selected tools are compared; unrelated catalog additions do not create handoff drift. A missing selected tool is reported as a failing fixture check with a breaking diff. A different server identity or malformed snapshot is a configuration error.
73
+
74
+ Replay retains the original plan and exact saved call sequence. Candidate input requirements validate saved source arguments and mapped destination arguments; candidate outputs validate the saved source/destination responses. All saved arguments must still match. No actual servers/callers can be supplied. The returned `upgrade` includes source/target schema comparisons and both recorded/candidate fingerprints. The recording and candidate objects are detached and remain unchanged.
75
+
76
+ | `upgrade.status` | Meaning |
77
+ |---|---|
78
+ | `passed` | A previously successful captured case still matches under candidate contracts |
79
+ | `failed` | That successful captured case no longer matches, including new validation or preflight-policy failures |
80
+ | `inconclusive` | The original run failed, was cancelled or included a transport failure, so it cannot establish successful upgrade compatibility |
81
+
82
+ `matched` still describes agreement with the recorded outcome. A saved expected failure can have `matched: true` while an upgrade check remains inconclusive. CLI exit 0 requires a passed candidate check; failed or inconclusive candidate checks exit 2. Ordinary replay without candidates preserves the v0.8 behavior: a matching expected failure exits 0. Invalid/unrestored artifacts or configuration errors exit 1.
83
+
84
+ The recorded review policy is retained by default. `--allow-review` is an explicit override for reviewing new uncertainty; it never bypasses blocked plans or runtime validation. Reports omit result values and raw exception causes. CLI human-readable output includes the candidate status.
85
+
86
+ These results apply only to saved cases. Passing fixtures do not prove universal schema compatibility, semantic ID correctness, factual accuracy, live server behavior or committed side effects. Applications retrieve/update catalogs and create candidate snapshots explicitly; this command neither calls a provider nor discovers schema changes automatically.
87
+
88
+ ## Choose a dependency footprint
89
+
90
+ `toolsplice` retains the full existing API/CLI and optional PostgreSQL support. No existing public import or persisted store name is renamed.
91
+
92
+ `toolsplice-core` is a separate package with only **Ajv and re2js** as direct production dependencies. It exports contracts, validators, handoff preparation, adapter generation, recording/replay, field-origin diagnostics and reviewed corrections. The application supplies raw-result `ToolCaller` functions. It has no SDK convenience client, CLI, learning proxy or PostgreSQL export.
93
+
94
+ ```ts
95
+ import { prepareSplice, emitSpliceModule, type ToolCaller } from 'toolsplice-core';
96
+ const adapter = prepareSplice(plan, sourceContract, targetContract);
97
+ const result = await adapter.run(sourceCaller, targetCaller, input);
98
+ const code = emitSpliceModule(plan, sourceContract, targetContract);
99
+ // Generated code imports toolsplice-core by default.
100
+ ```
101
+
102
+ The full package's emitter continues to default to `toolsplice`. Both emitters allow an explicit `runtimeImport`. Core requires Node 22+ and includes Node filesystem/crypto support internally; browser or Worker compatibility is not claimed.
103
+
104
+ From the source checkout:
105
+
106
+ ```sh
107
+ npm ci
108
+ npm run build
109
+ npm pack
110
+ npm pack ./packages/core
111
+ ```
112
+
113
+ Install the chosen local tarball in your application. Both packages remain unpublished. The core name was unregistered at its timestamped registry check, which neither reserves it nor guarantees future availability.
114
+
115
+ The core build uses TypeScript's dependency file graph and rejects SDK/Zod/PostgreSQL dependencies. Clean-consumer verification independently installs the tarball, proves the SDK cannot resolve, compiles/runs a generated adapter and exercises capture/replay, candidate checks and corrections. Full-package consumers separately test the original SDK/CLI paths. File-size measurements count regular-file bytes and skip symlinks; filesystem allocation can differ. Verification evidence and exact sizes are recorded in `test-results/v09-final-validation.json` in this checkout.
@@ -0,0 +1,176 @@
1
+ # Record, replay, explain and correct a handoff
2
+
3
+ The v0.9 additions are documented in [projects and candidate-contract checks](PROJECTS-AND-UPGRADES.md). The v0.8 verification section below is historical evidence of that release.
4
+
5
+ Toolsplice v0.8 introduced these features to its standalone Node.js library and CLI. They require no Cloudflare account, service or runtime. The existing execution path still validates all mapped arguments before the first destination call. No model API or provider call is needed to replay or validate a correction.
6
+
7
+ ## Capture one application-owned run
8
+
9
+ ```ts
10
+ import { writeFile } from 'node:fs/promises';
11
+ import { createSpliceRecorder, explainSpliceError, SpliceError } from 'toolsplice';
12
+
13
+ const recorder = createSpliceRecorder(plan, sourceContract, targetContract, {
14
+ capture: 'payloads',
15
+ redactKeys: ['customerEmail'],
16
+ // Supply known secrets from your own configuration if they can occur in text.
17
+ redactValues: secretValues,
18
+ });
19
+
20
+ try {
21
+ await recorder.run(sourceCaller, targetCaller, input, {
22
+ allowReview: true,
23
+ context: { path: 'saved.md' }, // Only if the plan declares contextSchema.
24
+ });
25
+ } catch (error) {
26
+ if (error instanceof SpliceError) {
27
+ console.error(explainSpliceError(plan, error));
28
+ }
29
+ throw error;
30
+ } finally {
31
+ try {
32
+ await writeFile('/private/app-fixtures/run.json',
33
+ JSON.stringify(recorder.snapshot()), { mode: 0o600, flag: 'wx' });
34
+ } catch {
35
+ // Application telemetry can report that capture/storage failed.
36
+ // Preserve the workflow's original outcome; never retry a write here.
37
+ }
38
+ }
39
+ ```
40
+
41
+ The application supplies contracts, connections and storage. Each recorder captures one invocation; create separate recorders for concurrent runs. A snapshot is available after success or failure and returns detached JSON. Snapshot or filesystem failures are handled separately from the workflow. The library neither creates a recording database nor writes a recording file implicitly. Use an application-selected durable directory or persistence backend when records must survive a server restart. Learning stores retain shape information and remain separate from payload recordings.
42
+
43
+ Capture failures do not retry, change or fail the forwarded workflow. The existing executor's validation failures still stop the workflow at the appropriate boundary. Non-JSON data or exhausted capture budgets mark the artifact incomplete, and incomplete artifacts cannot be replayed. A very small artifact cap may also make `snapshot()` fail when even the metadata cannot fit.
44
+
45
+ ## Privacy and limits
46
+
47
+ - **Default capture is `metadata`.** It retains call names/sides, durations, outcome/path diagnostics and fingerprints. It omits plans, contracts, input/context and request/result payloads. Metadata recordings cannot be replayed.
48
+ - **`capture: 'payloads'` is explicit.** It additionally retains the plan, the selected tools from both contracts, invocation input/context, ordered call arguments and raw MCP responses. These may contain confidential data. Capture only workflows and data your application intends to retain.
49
+ - Common credential field names are redacted case-insensitively, including `password`, `authorization`, `apiKey`, `api_key`, `token`, `access_token`, `refresh_token`, `secret` and `client_secret`. `redactKeys` adds names. These names are checked in captured plans/contracts as well as payloads; a property definition named `token` may therefore also require restoration.
50
+ - `redactValues` wholly redacts any captured string containing a configured secret, including prose/JSON text inside MCP content. If a data object's key contains a configured secret, the enclosing object is redacted so that key is not retained in a redaction path. The policy values themselves are not saved.
51
+ - Redaction is **not guaranteed anonymization**. Unknown secrets, personal data and sensitive field names need an application policy. Names, diagnostic paths and hashes can themselves reveal information. Do not publish recordings merely because credential fields were masked.
52
+ - The artifact cap defaults to **5 MiB** and can be configured from **1 KiB to 5 MiB**. Capture uses an aggregate payload budget as well as a final serialized-artifact check. Bounded plain finite JSON and the existing node/depth limits apply. There are at most 1,001 dispatched source/destination calls in a supported single handoff.
53
+
54
+ A recording fingerprint detects accidental content changes. It is not a signature, encryption or proof that an artifact is trustworthy. Share and load fixtures using your application's access controls.
55
+
56
+ ## Replay entirely offline
57
+
58
+ ```ts
59
+ import { replaySpliceRecording } from 'toolsplice';
60
+ const report = await replaySpliceRecording(savedRecording);
61
+ if (!report.matched) throw new Error('Recorded workflow regression');
62
+ ```
63
+
64
+ ```sh
65
+ node dist/cli.js replay recording.json --json
66
+ node dist/cli.js replay recording.json --out replay-report.json --json
67
+ ```
68
+
69
+ Replay builds the adapter from the saved plan/contracts, using the current guard implementation. It consumes saved raw responses in strict source/destination order and verifies names, arguments and the resulting success/failure outcome. Success compares a canonical result fingerprint. Failure compares stage, acknowledged target count and issue codes/paths. No live caller, server process or connection can be supplied. The API also returns replayed results; the CLI reports their count/byte size and omits their values.
70
+
71
+ A matching **expected failure** is a passing regression test. CLI exit codes are:
72
+
73
+ | Exit | Meaning |
74
+ |---|---|
75
+ | 0 | Replay matched its saved outcome, or correction fixtures all passed |
76
+ | 2 | Replay call sequence, arguments or outcome differed |
77
+ | 1 | Artifact/configuration invalid, incomplete, unrestored or correction validation failed |
78
+
79
+ Metadata and incomplete payload recordings are rejected. For redacted payload recordings, supply every redacted artifact path in an application-owned private restoration object:
80
+
81
+ ```json
82
+ {
83
+ "/input/token": "private replacement supplied locally",
84
+ "/calls/0/arguments/token": "private replacement supplied locally"
85
+ }
86
+ ```
87
+
88
+ ```sh
89
+ node dist/cli.js replay recording.json --restorations private-values.json --json
90
+ ```
91
+
92
+ Only the artifact's listed redaction paths can be replaced; all are required. Restorations are copied into an in-memory artifact and are not written to the report. Restored plans/contracts must still satisfy their fingerprints. Restored fixtures are labelled `restored-fixture`; supplied values are not authenticated as the original values. Treat the restoration file as confidential.
93
+
94
+ Saved transport exceptions are simulated without retaining their raw messages or causes. Cancellation timing is not reproduced. A target may have committed before cancellation or a response-validation error, even if the acknowledged result count is zero. Replay proves agreement with a fixture; it does not execute, roll back, resume or verify provider side effects, billing or factual correctness. It is not a crash-recovery journal.
95
+
96
+ ## Explain a failed field
97
+
98
+ `explainSpliceError(plan, error)` produces path-only diagnostics. For a destination type error on row 1, it can identify:
99
+
100
+ ```json
101
+ {
102
+ "bindingIndex": 0,
103
+ "targetPointer": "/id",
104
+ "origin": "source",
105
+ "pointer": "/assignee/personId",
106
+ "selectionPointer": "/issues",
107
+ "parsedJson": false,
108
+ "rowIndex": 1
109
+ }
110
+ ```
111
+
112
+ Source pointers are relative to the selected value or fanout row. The selection and explicit JSON parsing are reported separately, so a pointer into parsed JSON is not presented as a pointer into the original raw string. Context origins are labelled separately. Literal bindings identify their origin without including the literal value. Diagnostics never serialize the raw exception cause. Required-property or broad schema errors may implicate several bindings; the report does not invent a uniquely responsible field.
113
+
114
+ Saved fixture failures from `toolsplice splice` include the explanation in JSON and field-origin lines in human-readable output. Replay includes an explanation when it reproduces a `SpliceError`.
115
+
116
+ ## Correct an inaccurate provider declaration explicitly
117
+
118
+ A correction manifest replaces entire selected input/output schemas, pins one exact original snapshot and includes both accepted and rejected fixtures for every replacement:
119
+
120
+ ```json
121
+ {
122
+ "format": "toolsplice-correction",
123
+ "formatVersion": 1,
124
+ "baseFingerprint": "<64-character baseline fingerprint>",
125
+ "reason": "This installation accepts the documented query argument; the saved declaration omits it.",
126
+ "changes": [{
127
+ "tool": "read",
128
+ "side": "input",
129
+ "schema": {
130
+ "type": "object",
131
+ "properties": { "query": { "type": "string" } },
132
+ "required": ["query"],
133
+ "additionalProperties": false
134
+ },
135
+ "fixtures": [
136
+ { "name": "text-query", "valid": true, "value": { "query": "public docs" } },
137
+ { "name": "numeric-query", "valid": false, "value": { "query": 7 } }
138
+ ]
139
+ }]
140
+ }
141
+ ```
142
+
143
+ ```ts
144
+ import { applyContractCorrection, prepareSplice } from 'toolsplice';
145
+ const reviewed = await applyContractCorrection(originalContract, manifest);
146
+ // Original remains unchanged; review the schema comparison and fixture results.
147
+ const adapter = prepareSplice(plan, sourceContract, reviewed.corrected);
148
+ ```
149
+
150
+ ```sh
151
+ node dist/cli.js correct baseline.json --correction correction.json --json
152
+ node dist/cli.js correct baseline.json --correction correction.json \
153
+ --out corrected.json --json
154
+ ```
155
+
156
+ The first command validates and reports; the second additionally writes a **new 0600 file**, refusing to overwrite an existing path. No artifact is written until every replacement's fixtures match their expectations. CLI reports omit fixture values. The corrected contract can be supplied explicitly to `splice --source-contract` or `--target-contract`.
157
+
158
+ The API returns detached `original`, `manifest`, `corrected`, fixture results and the schema comparison. Persist the original and manifest beside the corrected artifact if you need the full review history. Corrected snapshots fingerprint the base and manifest references. Corrected output schemas are labelled `outputSource: 'corrected'`, not provider-declared or learned. Existing uncorrected snapshot fingerprints remain unchanged. Older package versions may reject corrected artifacts; use v0.8+ for these new artifacts.
159
+
160
+ Stale baseline fingerprints, no-op replacements, duplicate tool/side changes, unsupported validators and fixture mismatches reject the correction. There are 1–32 changes and 2–32 fixtures per change, each with at least one expected acceptance and one rejection. `originalValid: null` means the original schema was unknown or could not be guarded; it is not evidence of acceptance. Fixtures test schema behavior only, including for read-only probes previously saved from a real provider. They do not call tools, certify semantics or establish that a live server still behaves the same way.
161
+
162
+ The pinned Firecrawl regression in `test/contract-corrections.test.ts` exercises the previously observed `jsonOptions.schema` mismatch. The replacement admits only the reviewed title-extraction schema form and rejects a numeric-title form. It makes zero Firecrawl requests and consumes no provider credits.
163
+
164
+ ## Run the complete local demonstration
165
+
166
+ ```sh
167
+ npm run demo:handoff
168
+ ```
169
+
170
+ The demo uses two native synthetic MCP servers and writes four new Markdown files into a private demo folder. It records a success and a duplicate-batch failure, shuts down both servers, then replays both through the API and CLI. Replay makes zero tool/network calls and performs no writes. The demo checks five negative compiler assertions, source/context/no-data/collision prevention and offline CLI review. It makes ten native MCP tool calls in the original workflows and zero model calls.
171
+
172
+ ## v0.8 verification
173
+
174
+ Node 24.4.1 and 22.23.3 each passed 385 normal tests with zero failures and 13 opt-in skips, plus clean installed-package consumers. The new recording/correction/CLI tests contribute 20 cases. Native PostgreSQL 18.4 integrations ran separately on both runtimes: 13 tests each, 1,000 cross-process calls/observations each, zero recording warnings and successful restart recovery. The previous v0.7 lifecycle-soak results remain evidence of those older loaded versions, not of the new recorder.
175
+
176
+ Both updated handoff demos passed with the servers closed before API/CLI replay. A generated adapter using a corrected output contract compiled, checked a negative type assertion and ran with two fixture calls. Existing saved real Firecrawl/filesystem responses were converted to a new recording and replayed through the API and CLI; this used zero new network calls, filesystem writes or provider credits. No direct model calls or paid model benchmarks were run. Detailed hashes and evidence paths are in `test-results/v08-final-validation.json` in the checkout. The package remains unpublished.
package/package.json CHANGED
@@ -1,6 +1,97 @@
1
1
  {
2
2
  "name": "toolsplice",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.1",
4
+ "description": "Check, dry-run, and generate guarded adapters between MCP tools using declared or learned output shapes.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "bin": {
8
+ "toolsplice": "dist/cli.js",
9
+ "callshape": "dist/cli.js",
10
+ "mcp-shape": "dist/cli.js"
11
+ },
12
+ "main": "dist/index.js",
13
+ "types": "dist/index.d.ts",
14
+ "files": [
15
+ "dist",
16
+ "docs/RECORDING-AND-CORRECTIONS.md",
17
+ "docs/PROJECTS-AND-UPGRADES.md",
18
+ "LICENSE"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc -p tsconfig.json && node scripts/prepare-package.mjs && node scripts/build-core.mjs",
22
+ "typecheck": "tsc -p tsconfig.check.json",
23
+ "test": "vitest run",
24
+ "cli": "tsx src/cli.ts",
25
+ "bench": "tsx bench/run.ts",
26
+ "prepack": "npm run build",
27
+ "test:real": "tsx scripts/smoke-real.ts",
28
+ "test:soak": "tsx scripts/soak.ts",
29
+ "test:package": "node scripts/verify-package.mjs",
30
+ "test:client": "node scripts/verify-client.mjs",
31
+ "test:processes": "tsx scripts/stress-processes.ts",
32
+ "test:postgres": "node scripts/test-postgres.mjs",
33
+ "test:postgres:local": "npm run build && node scripts/verify-postgres.mjs",
34
+ "demo": "npm run build && tsx examples/demo.ts",
35
+ "test:demo": "npm run build && tsx examples/demo.ts --json",
36
+ "test:contracts:soak": "tsx scripts/soak-contracts.ts",
37
+ "test:handoffs": "tsx scripts/smoke-handoffs.ts",
38
+ "test:firecrawl": "tsx scripts/smoke-firecrawl.ts",
39
+ "test:splice:soak": "tsx scripts/soak-splice.ts",
40
+ "test:firecrawl:workflows": "tsx scripts/evaluate-firecrawl.ts",
41
+ "test:firecrawl:files": "tsx scripts/smoke-firecrawl-files.ts",
42
+ "test:public:files": "tsx scripts/smoke-public-files.ts",
43
+ "test:catalogs": "tsx scripts/survey-catalogs.ts",
44
+ "demo:handoff": "npm run build && tsx examples/demo-handoff.ts",
45
+ "test:core:package": "node scripts/verify-core-package.mjs",
46
+ "trial:maintenance": "npm run build && node scripts/evaluate-maintenance.mjs"
47
+ },
48
+ "dependencies": {
49
+ "@modelcontextprotocol/sdk": "^1.32.1",
50
+ "ajv": "^8.17.1",
51
+ "re2js": "2.8.8",
52
+ "zod": "^4.6.7"
53
+ },
54
+ "devDependencies": {
55
+ "@anthropic-ai/sdk": "^0.135.0",
56
+ "@modelcontextprotocol/client": "^2.3.1",
57
+ "@modelcontextprotocol/server": "^2.3.1",
58
+ "@types/node": "^26.6.5",
59
+ "@types/pg": "^8.23.1",
60
+ "tsx": "^4.23.15",
61
+ "typescript": "^7.0.2",
62
+ "vitest": "^5.0.5"
63
+ },
64
+ "engines": {
65
+ "node": ">=22"
66
+ },
67
+ "exports": {
68
+ ".": {
69
+ "types": "./dist/index.d.ts",
70
+ "import": "./dist/index.js"
71
+ },
72
+ "./v2": {
73
+ "types": "./dist/v2.d.ts",
74
+ "import": "./dist/v2.js"
75
+ },
76
+ "./postgres": {
77
+ "types": "./dist/postgres.d.ts",
78
+ "import": "./dist/postgres.js"
79
+ }
80
+ },
81
+ "optionalDependencies": {
82
+ "pg": "^8.23.1"
83
+ },
84
+ "keywords": [
85
+ "mcp",
86
+ "model-context-protocol",
87
+ "typescript",
88
+ "schema-inference",
89
+ "tool-calling",
90
+ "code-mode",
91
+ "schema-drift",
92
+ "tool-composition",
93
+ "schema-compatibility",
94
+ "adapter",
95
+ "preflight"
96
+ ]
97
+ }