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,119 @@
1
+ import { type SpliceRecording } from "./splice-recording.js";
2
+ export interface SpliceProjectOptions {
3
+ recording?: SpliceRecording | string;
4
+ restorations?: Record<string, unknown>;
5
+ }
6
+ export declare function createSpliceProjectFiles(options?: SpliceProjectOptions): Promise<{
7
+ files: Record<string, string>;
8
+ origin: "recording" | "synthetic";
9
+ check: {
10
+ source: import("./splice.js").SpliceEndpoint;
11
+ target: import("./splice.js").SpliceEndpoint;
12
+ maxTargetCalls: number;
13
+ maxResultBytes: number;
14
+ fingerprints: {
15
+ source: string;
16
+ target: string;
17
+ plan: string;
18
+ };
19
+ note: string;
20
+ preflightStatus: "blocked" | "ready" | "review";
21
+ status: "blocked" | "ready" | "review";
22
+ issues: import("./splice.js").SpliceIssue[];
23
+ origin: "recording" | "synthetic";
24
+ adapter: {
25
+ status: string;
26
+ };
27
+ networkCalls: number;
28
+ toolCalls: number;
29
+ explanation?: import("./splice-diagnostics.js").SpliceExplanation | undefined;
30
+ mappingSummary?: {
31
+ rows: number;
32
+ argumentBytes: number;
33
+ } | undefined;
34
+ };
35
+ }>;
36
+ /** Checks fixed artifact filenames only; returns counts/paths, never mapped values. */
37
+ export declare function checkSpliceProjectFiles(files: Record<string, string>): Promise<{
38
+ source: import("./splice.js").SpliceEndpoint;
39
+ target: import("./splice.js").SpliceEndpoint;
40
+ maxTargetCalls: number;
41
+ maxResultBytes: number;
42
+ fingerprints: {
43
+ source: string;
44
+ target: string;
45
+ plan: string;
46
+ };
47
+ note: string;
48
+ preflightStatus: "blocked" | "ready" | "review";
49
+ status: "blocked" | "ready" | "review";
50
+ issues: import("./splice.js").SpliceIssue[];
51
+ origin: "recording" | "synthetic";
52
+ adapter: {
53
+ status: string;
54
+ };
55
+ networkCalls: number;
56
+ toolCalls: number;
57
+ explanation?: import("./splice-diagnostics.js").SpliceExplanation | undefined;
58
+ mappingSummary?: {
59
+ rows: number;
60
+ argumentBytes: number;
61
+ } | undefined;
62
+ }>;
63
+ export declare function initializeSpliceProject(directory: string, options?: SpliceProjectOptions): Promise<{
64
+ directory: string;
65
+ files: string[];
66
+ origin: "recording" | "synthetic";
67
+ check: {
68
+ source: import("./splice.js").SpliceEndpoint;
69
+ target: import("./splice.js").SpliceEndpoint;
70
+ maxTargetCalls: number;
71
+ maxResultBytes: number;
72
+ fingerprints: {
73
+ source: string;
74
+ target: string;
75
+ plan: string;
76
+ };
77
+ note: string;
78
+ preflightStatus: "blocked" | "ready" | "review";
79
+ status: "blocked" | "ready" | "review";
80
+ issues: import("./splice.js").SpliceIssue[];
81
+ origin: "recording" | "synthetic";
82
+ adapter: {
83
+ status: string;
84
+ };
85
+ networkCalls: number;
86
+ toolCalls: number;
87
+ explanation?: import("./splice-diagnostics.js").SpliceExplanation | undefined;
88
+ mappingSummary?: {
89
+ rows: number;
90
+ argumentBytes: number;
91
+ } | undefined;
92
+ };
93
+ }>;
94
+ export declare function checkSpliceProject(directory: string): Promise<{
95
+ source: import("./splice.js").SpliceEndpoint;
96
+ target: import("./splice.js").SpliceEndpoint;
97
+ maxTargetCalls: number;
98
+ maxResultBytes: number;
99
+ fingerprints: {
100
+ source: string;
101
+ target: string;
102
+ plan: string;
103
+ };
104
+ note: string;
105
+ preflightStatus: "blocked" | "ready" | "review";
106
+ status: "blocked" | "ready" | "review";
107
+ issues: import("./splice.js").SpliceIssue[];
108
+ origin: "recording" | "synthetic";
109
+ adapter: {
110
+ status: string;
111
+ };
112
+ networkCalls: number;
113
+ toolCalls: number;
114
+ explanation?: import("./splice-diagnostics.js").SpliceExplanation | undefined;
115
+ mappingSummary?: {
116
+ rows: number;
117
+ argumentBytes: number;
118
+ } | undefined;
119
+ }>;
@@ -0,0 +1,296 @@
1
+ // Fixed-file, offline project scaffolding. No subprocesses, credential discovery or tool connections.
2
+ import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
+ import { join, resolve } from "node:path";
4
+ import { createContractFromCatalog, parseContractSnapshot, selectContractTools, } from "./contracts.js";
5
+ import { prepareSplice, parseSpliceSpec, emitSpliceModule, SpliceError, } from "./splice.js";
6
+ import { createContractCaller, ContractValidationError, } from "./contract-caller.js";
7
+ import { decode } from "./execution.js";
8
+ import { loadReplayFixture, parseSpliceRecording, replaySpliceRecording, } from "./splice-recording.js";
9
+ import { explainSpliceError } from "./splice-diagnostics.js";
10
+ import { copyJson, parseWorkflowJson, jsonObject, JSON_LIMIT, } from "./workflow-json.js";
11
+ const serialize = (value) => {
12
+ const text = JSON.stringify(copyJson(value), null, 2) + "\n";
13
+ if (Buffer.byteLength(text) > JSON_LIMIT)
14
+ throw new Error("Serialized project artifact exceeds 5 MiB.");
15
+ return text;
16
+ };
17
+ export async function createSpliceProjectFiles(options = {}) {
18
+ let plan, source, target, input, fixture, context;
19
+ let originalRecording;
20
+ const manifest = {
21
+ format: "toolsplice-project",
22
+ formatVersion: 1,
23
+ origin: "synthetic",
24
+ fixtureFormat: "decoded",
25
+ hasContext: true,
26
+ restorationRequiredForRecording: false,
27
+ };
28
+ if (options.recording !== undefined) {
29
+ const loaded = loadReplayFixture(options.recording, {
30
+ restorations: options.restorations,
31
+ });
32
+ const replay = await replaySpliceRecording(options.recording, {
33
+ restorations: options.restorations,
34
+ });
35
+ if (!replay.matched || replay.outcome.status !== "succeeded")
36
+ throw new Error("A starter needs a successful recording that matches offline replay.");
37
+ const call = loaded.recording.calls.find((c) => c.side === "source");
38
+ if (!call || call.outcome !== "returned" || !Object.hasOwn(call, "result"))
39
+ throw new Error("Recording has no usable source response.");
40
+ plan = loaded.spec;
41
+ source = loaded.source;
42
+ target = loaded.target;
43
+ input = loaded.recording.input;
44
+ fixture = call.result;
45
+ context = loaded.recording.context;
46
+ originalRecording = parseSpliceRecording(options.recording);
47
+ manifest.origin = "recording";
48
+ manifest.fixtureFormat = "mcp";
49
+ manifest.hasContext = Object.hasOwn(loaded.recording, "context");
50
+ manifest.restorationRequiredForRecording = loaded.restored;
51
+ }
52
+ else {
53
+ if (options.restorations !== undefined)
54
+ throw new Error("Restorations require a recording.");
55
+ source = createContractFromCatalog({ name: "documents" }, {
56
+ tools: [
57
+ {
58
+ name: "read_document",
59
+ inputSchema: {
60
+ type: "object",
61
+ properties: { url: { type: "string" } },
62
+ required: ["url"],
63
+ additionalProperties: false,
64
+ },
65
+ outputSchema: {
66
+ type: "object",
67
+ properties: { markdown: { type: "string" } },
68
+ required: ["markdown"],
69
+ additionalProperties: false,
70
+ },
71
+ },
72
+ ],
73
+ });
74
+ target = createContractFromCatalog({ name: "artifacts" }, {
75
+ tools: [
76
+ {
77
+ name: "save_document",
78
+ inputSchema: {
79
+ type: "object",
80
+ properties: {
81
+ path: { type: "string", minLength: 1 },
82
+ content: { type: "string" },
83
+ },
84
+ required: ["path", "content"],
85
+ additionalProperties: false,
86
+ },
87
+ outputSchema: {
88
+ type: "object",
89
+ properties: { saved: { type: "boolean" } },
90
+ required: ["saved"],
91
+ },
92
+ },
93
+ ],
94
+ });
95
+ plan = {
96
+ format: "toolsplice-splice",
97
+ formatVersion: 1,
98
+ source: {
99
+ server: "documents",
100
+ tool: "read_document",
101
+ path: "/markdown",
102
+ valueSchema: { type: "string", minLength: 1 },
103
+ },
104
+ target: { server: "artifacts", tool: "save_document" },
105
+ contextSchema: {
106
+ type: "object",
107
+ properties: { path: { type: "string", minLength: 1 } },
108
+ required: ["path"],
109
+ additionalProperties: false,
110
+ },
111
+ bindings: [
112
+ { to: "/content", from: "" },
113
+ { to: "/path", fromContext: "/path" },
114
+ ],
115
+ };
116
+ input = { url: "https://docs.example.com/intro" };
117
+ context = { path: "saved.md" };
118
+ fixture = {
119
+ markdown: "# Synthetic document\n\nThis is an offline starter fixture. No URL is fetched and no document is written.\n",
120
+ };
121
+ }
122
+ const files = {
123
+ "toolsplice.project.json": serialize(manifest),
124
+ "plan.json": serialize(plan),
125
+ "source.json": serialize(source),
126
+ "target.json": serialize(target),
127
+ "input.json": serialize(input),
128
+ "fixture.json": serialize(fixture),
129
+ "adapter.ts": emitSpliceModule(plan, source, target),
130
+ };
131
+ if (manifest.hasContext)
132
+ files["context.json"] = serialize(context);
133
+ if (originalRecording)
134
+ files["recording.json"] = serialize(originalRecording);
135
+ files["README.md"] =
136
+ `# Toolsplice handoff project\n\nOrigin: ${manifest.origin}. This folder contains private application artifacts; review before sharing.\n\nCheck the saved source input/output, context and every mapped destination argument offline:\n\n\`\`\`sh\ntoolsplice project . --allow-review --json\n\`\`\`\n\nThe command calls no tools and writes no documents. --allow-review accepts the offline review exit status; it does not disable runtime guards.\n\n${manifest.origin === "synthetic" ? "The catalogs, input and response are synthetic. Connect your own tools, export their contracts and explicitly update the mapping. Toolsplice does not guess ID semantics or establish provider clients.\n" : "The contracts, mapping and source fixture come from the successful saved recording. No provider was contacted to create this folder.\n"}\n\nThe generated adapter.ts uses the full toolsplice package. Call createSplice with your application-owned callers, then pass input and optional context. Review its report and explicitly set allowReview when required. The adapter can perform real destination effects only when your application invokes it with live callers.\n\nFor a smaller dependency tree, use toolsplice-core in your application and regenerate with its emitSpliceModule function; its default runtime import is toolsplice-core. Install toolsplice or toolsplice-core from npm, or the appropriate local tarball when testing this checkout.\n\n${originalRecording ? `Replay all captured responses: \`toolsplice replay recording.json --json\`. ${manifest.restorationRequiredForRecording ? "The retained recording is still redacted and needs your private --restorations file; restored input/context/fixture files in this private project may contain confidential values." : ""}\nCheck a candidate contract: \`toolsplice replay recording.json --target-contract new-target.json --json\`.\n` : ""}`;
137
+ files["README.md"] += `
138
+ The project check also verifies that adapter.ts matches the saved plan/contracts and current generator. After editing those artifacts, generate into a new file:
139
+
140
+ \`\`\`sh
141
+ toolsplice splice plan.json --source-contract source.json --target-contract target.json --fixture fixture.json --fixture-format ${manifest.fixtureFormat}${manifest.hasContext ? " --context context.json" : ""} --allow-review --summary --out adapter.next.ts --json
142
+ \`\`\`
143
+
144
+ Review adapter.next.ts before replacing adapter.ts. Existing files are never overwritten by generation.
145
+ `;
146
+ const check = await checkSpliceProjectFiles(files);
147
+ if (check.status === "blocked")
148
+ throw new Error("Starter artifacts do not pass offline validation.");
149
+ return { files, origin: manifest.origin, check };
150
+ }
151
+ function projectManifest(input) {
152
+ const v = parseWorkflowJson(input);
153
+ if (!jsonObject(v) ||
154
+ v.format !== "toolsplice-project" ||
155
+ v.formatVersion !== 1 ||
156
+ !["synthetic", "recording"].includes(String(v.origin)) ||
157
+ !["decoded", "mcp"].includes(String(v.fixtureFormat)) ||
158
+ typeof v.hasContext !== "boolean" ||
159
+ typeof v.restorationRequiredForRecording !== "boolean" ||
160
+ Object.keys(v).some((k) => ![
161
+ "format",
162
+ "formatVersion",
163
+ "origin",
164
+ "fixtureFormat",
165
+ "hasContext",
166
+ "restorationRequiredForRecording",
167
+ ].includes(k)))
168
+ throw new Error("Invalid or unsupported Toolsplice project manifest.");
169
+ return v;
170
+ }
171
+ /** Checks fixed artifact filenames only; returns counts/paths, never mapped values. */
172
+ export async function checkSpliceProjectFiles(files) {
173
+ const manifest = projectManifest(files["toolsplice.project.json"]), plan = parseSpliceSpec(files["plan.json"]), source = parseContractSnapshot(files["source.json"]), target = parseContractSnapshot(files["target.json"]), prepared = prepareSplice(plan, source, target);
174
+ let failure, rows;
175
+ const adapterCurrent = prepared.report.status === "blocked"
176
+ ? undefined
177
+ : files["adapter.ts"] === emitSpliceModule(plan, source, target);
178
+ if (prepared.report.status !== "blocked")
179
+ try {
180
+ if (!adapterCurrent)
181
+ throw new SpliceError("preflight", 0, undefined, [
182
+ {
183
+ severity: "error",
184
+ code: "generated-adapter-stale",
185
+ path: "/adapter.ts",
186
+ message: "Generated adapter differs from the current plan/contracts/generator. Generate a new file and review it before replacing the old adapter.",
187
+ },
188
+ ]);
189
+ const input = parseWorkflowJson(files["input.json"]);
190
+ if (!jsonObject(input))
191
+ throw new SpliceError("source", 0, undefined, [
192
+ {
193
+ severity: "error",
194
+ code: "source-input-object",
195
+ path: "/input",
196
+ message: "Source input must be an object.",
197
+ },
198
+ ]);
199
+ try {
200
+ await createContractCaller(async () => ({ content: [] }), selectContractTools(source, [plan.source.tool]), { outputs: false })({ name: plan.source.tool, arguments: input });
201
+ }
202
+ catch (e) {
203
+ throw new SpliceError("source", 0, e instanceof ContractValidationError ? e : undefined);
204
+ }
205
+ let fixture = parseWorkflowJson(files["fixture.json"]);
206
+ if (manifest.fixtureFormat === "mcp") {
207
+ if (!jsonObject(fixture))
208
+ throw new Error("MCP fixture must be a result object.");
209
+ try {
210
+ if (fixture.resultType !== undefined &&
211
+ fixture.resultType !== "complete")
212
+ throw new Error("Non-complete result.");
213
+ fixture = decode(fixture);
214
+ }
215
+ catch {
216
+ throw new SpliceError("source", 0, undefined, [
217
+ {
218
+ severity: "error",
219
+ code: "fixture-tool-error",
220
+ path: "/fixture",
221
+ message: "Saved MCP source reports an error.",
222
+ },
223
+ ]);
224
+ }
225
+ }
226
+ rows = await prepared.mapOutput(fixture, manifest.hasContext
227
+ ? { context: parseWorkflowJson(files["context.json"]) }
228
+ : {});
229
+ }
230
+ catch (e) {
231
+ if (!(e instanceof SpliceError))
232
+ throw e;
233
+ failure = e;
234
+ }
235
+ return {
236
+ ...prepared.report,
237
+ preflightStatus: prepared.report.status,
238
+ status: failure ? "blocked" : prepared.report.status,
239
+ issues: failure
240
+ ? [...prepared.report.issues, ...failure.issues]
241
+ : prepared.report.issues,
242
+ origin: manifest.origin,
243
+ adapter: {
244
+ status: adapterCurrent === undefined
245
+ ? "not-checked"
246
+ : adapterCurrent
247
+ ? "current"
248
+ : "stale",
249
+ },
250
+ networkCalls: 0,
251
+ toolCalls: 0,
252
+ ...(failure ? { explanation: explainSpliceError(plan, failure) } : {}),
253
+ ...(rows
254
+ ? {
255
+ mappingSummary: {
256
+ rows: rows.length,
257
+ argumentBytes: rows.reduce((n, row) => n + Buffer.byteLength(JSON.stringify(row)), 0),
258
+ },
259
+ }
260
+ : {}),
261
+ };
262
+ }
263
+ export async function initializeSpliceProject(directory, options = {}) {
264
+ const result = await createSpliceProjectFiles(options), path = resolve(directory);
265
+ // Validation precedes this atomic new-directory operation. Existing folders are never modified.
266
+ mkdirSync(path, { mode: 0o700 });
267
+ for (const [name, text] of Object.entries(result.files))
268
+ writeFileSync(join(path, name), text, { mode: 0o600, flag: "wx" });
269
+ return {
270
+ directory: path,
271
+ files: Object.keys(result.files),
272
+ origin: result.origin,
273
+ check: result.check,
274
+ };
275
+ }
276
+ export async function checkSpliceProject(directory) {
277
+ const path = resolve(directory), read = (name) => {
278
+ try {
279
+ return readFileSync(join(path, name), "utf8");
280
+ }
281
+ catch {
282
+ throw new Error("Project artifact is missing or unreadable.");
283
+ }
284
+ };
285
+ const text = read("toolsplice.project.json"), manifest = projectManifest(text);
286
+ const files = Object.fromEntries([
287
+ "plan.json",
288
+ "source.json",
289
+ "target.json",
290
+ "input.json",
291
+ "fixture.json",
292
+ "adapter.ts",
293
+ ...(manifest.hasContext ? ["context.json"] : []),
294
+ ].map((name) => [name, read(name)]));
295
+ return checkSpliceProjectFiles({ ...files, "toolsplice.project.json": text });
296
+ }
@@ -0,0 +1,105 @@
1
+ import type { ToolCaller } from "./execution.js";
2
+ import type { ToolResultLike } from "./extract.js";
3
+ import { type ContractSnapshot } from "./contracts.js";
4
+ import { SpliceError, type SpliceSpec, type SpliceRunOptions } from "./splice.js";
5
+ interface RecordedCall {
6
+ side: "source" | "target";
7
+ name: string;
8
+ outcome: "returned" | "threw";
9
+ durationMs: number;
10
+ arguments?: Record<string, unknown>;
11
+ result?: ToolResultLike;
12
+ }
13
+ type RecordedOutcome = {
14
+ status: "succeeded";
15
+ resultFingerprint?: string;
16
+ } | {
17
+ status: "failed";
18
+ stage: SpliceError["stage"] | "unknown";
19
+ completedTargets: number;
20
+ issues: {
21
+ code: string;
22
+ path: string;
23
+ }[];
24
+ };
25
+ export interface SpliceRecording {
26
+ format: "toolsplice-recording";
27
+ formatVersion: 1;
28
+ createdAt: string;
29
+ toolspliceVersion: string;
30
+ capture: "metadata" | "payloads";
31
+ complete: boolean;
32
+ planFingerprint: string;
33
+ plan?: SpliceSpec;
34
+ sourceContract?: ContractSnapshot;
35
+ targetContract?: ContractSnapshot;
36
+ input?: unknown;
37
+ context?: unknown;
38
+ allowReview: boolean;
39
+ cancellationObserved: boolean;
40
+ calls: RecordedCall[];
41
+ outcome: RecordedOutcome;
42
+ diagnostics: string[];
43
+ redactions: string[];
44
+ fingerprint: string;
45
+ }
46
+ export interface SpliceRecordingOptions {
47
+ /** Metadata is the default; payloads explicitly opt in to retaining inputs and results. */
48
+ capture?: "metadata" | "payloads";
49
+ /** Case-insensitive field names, in addition to common credential names. */
50
+ redactKeys?: string[];
51
+ /** Any string containing one of these values is wholly redacted. Values are never saved as policy. */
52
+ redactValues?: string[];
53
+ /** Serialized artifact cap, 1 KiB–5 MiB. Capture failures never retry or fail the workflow. */
54
+ maxBytes?: number;
55
+ }
56
+ export declare function createSpliceRecorder(plan: SpliceSpec, source: ContractSnapshot, target: ContractSnapshot, options?: SpliceRecordingOptions): {
57
+ report: import("./splice.js").SpliceReport;
58
+ run: (sourceCaller: ToolCaller, targetCaller: ToolCaller, input: unknown, runOptions?: SpliceRunOptions) => Promise<unknown[]>;
59
+ snapshot: () => SpliceRecording;
60
+ };
61
+ export declare function parseSpliceRecording(input: unknown): SpliceRecording;
62
+ export interface SpliceReplayOptions {
63
+ restorations?: Record<string, unknown>;
64
+ /** Candidate contracts are checked against the saved calls; they never replace the recording. */
65
+ sourceContract?: ContractSnapshot;
66
+ targetContract?: ContractSnapshot;
67
+ /** Explicit policy override; otherwise the recorded review decision is retained. */
68
+ allowReview?: boolean;
69
+ }
70
+ /** Shared artifact loader for replay and explicit project scaffolding. No writes or connections. */
71
+ export declare function loadReplayFixture(input: SpliceRecording | string, options?: {
72
+ restorations?: Record<string, unknown>;
73
+ }): {
74
+ recording: SpliceRecording;
75
+ restored: boolean;
76
+ spec: SpliceSpec;
77
+ source: ContractSnapshot;
78
+ target: ContractSnapshot;
79
+ };
80
+ /** No live caller or connection can be supplied. Saved responses are consumed strictly in order. */
81
+ export declare function replaySpliceRecording(input: SpliceRecording | string, options?: SpliceReplayOptions): Promise<{
82
+ matched: boolean;
83
+ recordedOutcome: RecordedOutcome;
84
+ upgrade?: {
85
+ status: "failed" | "inconclusive" | "passed";
86
+ source: import("./contracts.js").ContractComparison;
87
+ target: import("./contracts.js").ContractComparison;
88
+ fingerprints: {
89
+ recordedSource: string;
90
+ candidateSource: string;
91
+ recordedTarget: string;
92
+ candidateTarget: string;
93
+ };
94
+ note: string;
95
+ } | undefined;
96
+ mode: "restored-fixture" | "saved-fixture";
97
+ networkCalls: 0;
98
+ consumedCalls: number;
99
+ recordedCalls: number;
100
+ outcome: RecordedOutcome;
101
+ result?: unknown[] | undefined;
102
+ explanation?: import("./splice-diagnostics.js").SpliceExplanation | undefined;
103
+ caveats: string[];
104
+ }>;
105
+ export {};