@superdurable/connectors-sdk 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,93 @@
1
+ import {
2
+ ConnectionRefSchema,
3
+ OperationRefSchema,
4
+ deriveCallID
5
+ } from "./chunk-SOXYPIMO.js";
6
+
7
+ // src/credentials.ts
8
+ function createCall(context, connection, operation, options = {}) {
9
+ if (!context?.flowId) throw new TypeError("Dex Flow ID is required");
10
+ if (!context.stepExecutionId) throw new TypeError("connector operations require a Dex Step execution; RPC invocation is not allowed");
11
+ ConnectionRefSchema.parse(connection);
12
+ OperationRefSchema.parse(operation);
13
+ const call = { context, id: deriveCallID(context.flowId, context.stepExecutionId, operation), connection, operation };
14
+ const textWriter = options.textStream?.bufferedText(context, options.textOptions);
15
+ let sequence = 0;
16
+ Object.defineProperty(call, "context", { value: context, enumerable: false });
17
+ Object.defineProperties(call, {
18
+ reportProgress: { value: (progress) => {
19
+ if (!options.progressStream) return;
20
+ if (progress.percent !== void 0 && (!Number.isFinite(progress.percent) || progress.percent < 0 || progress.percent > 1)) throw new RangeError("connector progress percent must be between 0 and 1");
21
+ options.progressStream.write(context, { ...progress, callId: call.id, attempt: context.attempt, sequence: ++sequence });
22
+ }, enumerable: false },
23
+ writeText: { value: (value) => {
24
+ textWriter?.write(value);
25
+ }, enumerable: false },
26
+ hasProgressStream: { value: () => options.progressStream !== void 0, enumerable: false },
27
+ hasTextStream: { value: () => textWriter !== void 0, enumerable: false }
28
+ });
29
+ return call;
30
+ }
31
+ async function resolveCredential(provider, call, driver, signal) {
32
+ if (!provider) throw new TypeError("credential provider is required");
33
+ if (!driver) throw new TypeError("credential refresh driver is required");
34
+ if ("resolveWithRefresh" in provider && typeof provider.resolveWithRefresh === "function") {
35
+ return provider.resolveWithRefresh(call, driver, signal);
36
+ }
37
+ if (signal && "resolveContext" in provider && typeof provider.resolveContext === "function") {
38
+ return provider.resolveContext(call, signal);
39
+ }
40
+ return provider.resolve(call, signal);
41
+ }
42
+ async function resolveCredentialAfterRejection(provider, call, driver, signal) {
43
+ if (!provider) throw new TypeError("credential provider is required");
44
+ if (!driver) throw new TypeError("credential refresh driver is required");
45
+ if (!("resolveAfterRejection" in provider) || typeof provider.resolveAfterRejection !== "function") {
46
+ throw new TypeError("credential provider does not support refresh after rejection");
47
+ }
48
+ return provider.resolveAfterRejection(call, driver, signal);
49
+ }
50
+ var StaticCredentialProvider = class {
51
+ #credentials;
52
+ /** Capture all connection values during construction. */
53
+ constructor(entries) {
54
+ this.#credentials = new Map(Array.from(entries, ([connection, credential]) => [JSON.stringify([connection.provider, connection.name]), credential]));
55
+ }
56
+ /** Return the configured credential or reject a missing connection. */
57
+ async resolve(call) {
58
+ const key = JSON.stringify([call.connection.provider, call.connection.name]);
59
+ if (!this.#credentials.has(key)) throw new Error("connection is not configured");
60
+ return this.#credentials.get(key);
61
+ }
62
+ /** Static credentials never expire and therefore do not call the driver. */
63
+ async resolveWithRefresh(call) {
64
+ return this.resolve(call);
65
+ }
66
+ };
67
+ var SecretString = class {
68
+ #value;
69
+ /** Hold one private value outside default stringification and inspection. */
70
+ constructor(value) {
71
+ this.#value = value;
72
+ }
73
+ /** Reveal only at the provider request boundary. */
74
+ reveal() {
75
+ return this.#value;
76
+ }
77
+ /** Return a fixed redaction for accidental string formatting. */
78
+ toString() {
79
+ return "[REDACTED]";
80
+ }
81
+ /** Reject accidental JSON persistence. */
82
+ toJSON() {
83
+ throw new TypeError("connector secrets cannot be serialized");
84
+ }
85
+ };
86
+
87
+ export {
88
+ createCall,
89
+ resolveCredential,
90
+ resolveCredentialAfterRejection,
91
+ StaticCredentialProvider,
92
+ SecretString
93
+ };
@@ -0,0 +1,179 @@
1
+ // src/errors.ts
2
+ import { z } from "zod";
3
+ var FailureKindSchema = z.enum([
4
+ "VALIDATION",
5
+ "AUTHENTICATION",
6
+ "AUTHORIZATION",
7
+ "NOT_FOUND",
8
+ "CONFLICT",
9
+ "RATE_LIMIT",
10
+ "QUOTA_EXHAUSTED",
11
+ "AVAILABILITY",
12
+ "PROVIDER_REJECTION",
13
+ "TRANSPORT",
14
+ "RESPONSE_TOO_LARGE",
15
+ "PROTOCOL",
16
+ "LOCAL_DEFECT"
17
+ ]);
18
+ var FailureSchema = z.strictObject({ kind: FailureKindSchema, provider: z.string().min(1), operation: z.string().min(1), message: z.string().min(1) });
19
+ var RetryError = class extends Error {
20
+ /** Validated provider fact behind the retry request. */
21
+ failure;
22
+ /** Provider-requested retry delay in milliseconds; zero uses the Step policy. */
23
+ retryAfterMs;
24
+ constructor(failure, retryAfterMs = 0) {
25
+ const validated = FailureSchema.parse(failure);
26
+ super(`connector ${validated.provider} ${validated.operation} retry (${validated.kind}): ${validated.message}`);
27
+ this.name = "RetryError";
28
+ this.failure = validated;
29
+ this.retryAfterMs = retryAfterMs;
30
+ }
31
+ };
32
+ var ReauthorizationRequiredError = class extends Error {
33
+ constructor() {
34
+ super("connector reauthorization is required");
35
+ this.name = "ReauthorizationRequiredError";
36
+ }
37
+ };
38
+
39
+ // src/types.ts
40
+ import { z as z2 } from "zod";
41
+ import { createHash } from "crypto";
42
+ var CallIDSchema = z2.uuid();
43
+ var CallIDNamespace = "63281a42-70ad-5bc3-a289-728819af723f";
44
+ var ConnectionRefSchema = z2.strictObject({ provider: z2.string().refine((value) => value.trim().length > 0), name: z2.string().refine((value) => value.trim().length > 0) });
45
+ var OperationRefSchema = z2.strictObject({ connectorId: z2.string().regex(/^[a-z][a-z0-9-]{1,62}$/), operationId: z2.string().regex(/^[a-z][A-Za-z0-9]+$/) });
46
+ function deriveCallID(flowId, stepExecutionId, operation) {
47
+ OperationRefSchema.parse(operation);
48
+ const namespace = CallIDNamespace;
49
+ const fields = [flowId, stepExecutionId, operation.connectorId, operation.operationId];
50
+ const payload = Buffer.concat(fields.flatMap((field) => {
51
+ const encoded = Buffer.from(field, "utf8");
52
+ const length = Buffer.alloc(4);
53
+ length.writeUInt32BE(encoded.length);
54
+ return [length, encoded];
55
+ }));
56
+ return CallIDSchema.parse(uuidSHA1(namespace, payload));
57
+ }
58
+ function defaultIdempotencyKey(callId) {
59
+ return callId;
60
+ }
61
+ function uuidSHA1(namespace, name) {
62
+ const namespaceBytes = Buffer.from(namespace.replaceAll("-", ""), "hex");
63
+ const digest = createHash("sha1").update(namespaceBytes).update(name).digest();
64
+ digest[6] = (digest[6] ?? 0) & 15 | 80;
65
+ digest[8] = (digest[8] ?? 0) & 63 | 128;
66
+ const hex = digest.subarray(0, 16).toString("hex");
67
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
68
+ }
69
+ var DefectBranchID = "defect";
70
+ var UncertainBranchID = "uncertain";
71
+ var BranchDefinitionSchema = z2.strictObject({ id: z2.string().min(1), description: z2.string(), optional: z2.boolean().optional() });
72
+ var StepDefaultsWireSchema = z2.strictObject({
73
+ executeMethodTimeout: z2.number().int().nonnegative(),
74
+ heartbeatTimeout: z2.number().int().nonnegative().optional(),
75
+ executeRetry: z2.strictObject({ InitialInterval: z2.number().int().nonnegative(), BackoffCoefficient: z2.number().positive(), MaximumInterval: z2.number().int().nonnegative(), MaximumAttempts: z2.number().int().nonnegative(), TotalDuration: z2.number().int().nonnegative() }).optional(),
76
+ executeDurability: z2.number().int()
77
+ });
78
+ var QueryDefinitionWireSchema = z2.strictObject({ operation: OperationRefSchema, branches: z2.array(BranchDefinitionSchema).nullable(), stepDefaults: StepDefaultsWireSchema });
79
+ var MutationDefinitionWireSchema = QueryDefinitionWireSchema;
80
+ var ReceiptSchema = z2.strictObject({
81
+ callId: CallIDSchema,
82
+ idempotencyKey: z2.string().optional(),
83
+ provider: z2.string().min(1),
84
+ providerObjectId: z2.string().optional(),
85
+ providerRequestId: z2.string().optional(),
86
+ observedAt: z2.iso.datetime({ offset: true }),
87
+ metadata: z2.record(z2.string(), z2.string()).optional()
88
+ });
89
+ function zeroReceipt() {
90
+ return { callId: "", provider: "", observedAt: "0001-01-01T00:00:00Z" };
91
+ }
92
+ var QueryResultSchema = (valueSchema) => z2.strictObject({ branch: z2.string().min(1), value: valueSchema, receipt: ReceiptSchema, failure: FailureSchema.optional() });
93
+ var MutationResultSchema = QueryResultSchema;
94
+ function newQueryBranch(branch, value, receipt = {}, failure) {
95
+ return failure === void 0 ? { kind: "branch", branch, value, receipt } : { kind: "branch", branch, value, receipt, failure };
96
+ }
97
+ function newQueryRetry(failure, retryAfterMs = 0) {
98
+ validateRetryDelay(retryAfterMs);
99
+ return { kind: "retry", failure: FailureSchema.parse(failure), retryAfterMs };
100
+ }
101
+ function newMutationBranch(branch, value, receipt = {}, failure) {
102
+ return newQueryBranch(branch, value, receipt, failure);
103
+ }
104
+ function newMutationRetry(failure, retryAfterMs = 0) {
105
+ return newQueryRetry(failure, retryAfterMs);
106
+ }
107
+ function newMutationUncertain(value, failure, receipt = {}) {
108
+ return { kind: "uncertain", value, failure: FailureSchema.parse(failure), receipt };
109
+ }
110
+ function defaultConnectorStepExecuteRetryPolicy() {
111
+ return { initialIntervalMs: 1e3, backoffCoefficient: 2, maximumIntervalMs: 3e5, maximumAttempts: 0, totalDurationMs: 36e5 };
112
+ }
113
+ function retryPolicyToGoWire(policy) {
114
+ return {
115
+ InitialInterval: policy.initialIntervalMs * 1e6,
116
+ BackoffCoefficient: policy.backoffCoefficient,
117
+ MaximumInterval: policy.maximumIntervalMs * 1e6,
118
+ MaximumAttempts: policy.maximumAttempts,
119
+ TotalDuration: policy.totalDurationMs * 1e6
120
+ };
121
+ }
122
+ var ConnectorUIBindingSchema = z2.strictObject({ port: z2.string().regex(/^[a-z][A-Za-z0-9]*$/), jsonPointer: z2.string().regex(/^\/(?:[^~]|~[01])*$/) });
123
+ var ConnectorUIUnitSchema = z2.strictObject({
124
+ id: z2.string().regex(/^[a-z][A-Za-z0-9]*$/),
125
+ unitId: z2.string().regex(/^[a-z][A-Za-z0-9]*$/),
126
+ label: z2.string().refine((value) => value.trim().length > 0),
127
+ description: z2.string().refine((value) => value.trim().length > 0),
128
+ required: z2.boolean(),
129
+ bindings: z2.array(ConnectorUIBindingSchema).min(1)
130
+ }).superRefine((unit, context) => {
131
+ if (new Set(unit.bindings.map((binding) => binding.port)).size !== unit.bindings.length) context.addIssue({ code: "custom", message: "duplicate UI port" });
132
+ });
133
+ var ConnectorConfigurationUISchema = z2.strictObject({ units: z2.array(ConnectorUIUnitSchema) }).superRefine((ui, context) => {
134
+ if (new Set(ui.units.map((unit) => unit.id)).size !== ui.units.length) context.addIssue({ code: "custom", message: "duplicate UI unit ID" });
135
+ });
136
+ var ConnectorConfigurationRefSchema = z2.strictObject({
137
+ connectorId: OperationRefSchema.shape.connectorId,
138
+ connectionName: z2.string().refine((value) => value.trim().length > 0),
139
+ operationId: OperationRefSchema.shape.operationId,
140
+ flowType: z2.string().refine((value) => value.trim().length > 0),
141
+ stepType: z2.string().refine((value) => value.trim().length > 0)
142
+ });
143
+ function validateRetryDelay(delayMs) {
144
+ if (!Number.isSafeInteger(delayMs) || delayMs < 0) throw new RangeError("retry delay must be a non-negative integer in milliseconds");
145
+ }
146
+
147
+ export {
148
+ FailureKindSchema,
149
+ FailureSchema,
150
+ RetryError,
151
+ ReauthorizationRequiredError,
152
+ CallIDSchema,
153
+ CallIDNamespace,
154
+ ConnectionRefSchema,
155
+ OperationRefSchema,
156
+ deriveCallID,
157
+ defaultIdempotencyKey,
158
+ DefectBranchID,
159
+ UncertainBranchID,
160
+ BranchDefinitionSchema,
161
+ StepDefaultsWireSchema,
162
+ QueryDefinitionWireSchema,
163
+ MutationDefinitionWireSchema,
164
+ ReceiptSchema,
165
+ zeroReceipt,
166
+ QueryResultSchema,
167
+ MutationResultSchema,
168
+ newQueryBranch,
169
+ newQueryRetry,
170
+ newMutationBranch,
171
+ newMutationRetry,
172
+ newMutationUncertain,
173
+ defaultConnectorStepExecuteRetryPolicy,
174
+ retryPolicyToGoWire,
175
+ ConnectorUIBindingSchema,
176
+ ConnectorUIUnitSchema,
177
+ ConnectorConfigurationUISchema,
178
+ ConnectorConfigurationRefSchema
179
+ };
@@ -0,0 +1,181 @@
1
+ import { z } from 'zod';
2
+ import { F as Failure, B as BranchID, C as Call, M as MutationAttempt, Q as QueryAttempt, U as UncertainBranchID, a as CallID } from '../credentials-vrvW0d4j.js';
3
+ import { Q as QueryDefinition, M as Mutation, a as MutationDefinition, b as Query } from '../operation-Ca8rfacf.js';
4
+ import '@superdurable/dex';
5
+
6
+ /** One answered mock call, including input only in test memory. */
7
+ interface MockCall<Input> extends RecordedCall {
8
+ /** Provider-safe idempotency key selected by the SDK. */ idempotencyKey?: string;
9
+ /** Input observed by the mock. */ input: Input;
10
+ }
11
+ /** Constructor-injected checks for a scripted connector operation. */
12
+ interface MockOptions<Input, Output> {
13
+ /** Return a safe failure to select defect before case selection. */ requestCheck?: (input: Input) => Failure | undefined;
14
+ /** Validate a selected success branch against the request. */ answerCheck?: {
15
+ branch: BranchID;
16
+ check: (input: Input, output: Output) => void;
17
+ };
18
+ /** Receive scripting mistakes and unscripted-call reports. */ onFailure?: (message: string) => void;
19
+ }
20
+ interface Rule<Input, Output> {
21
+ matches: (input: Input) => boolean;
22
+ response: Case<Output>;
23
+ }
24
+ declare class Script<Input, Output> {
25
+ readonly rules: Rule<Input, Output>[];
26
+ readonly queue: Case<Output>[];
27
+ defaults: Case<Output>[];
28
+ defaultCount: number;
29
+ nextScripted(input: Input): Case<Output> | undefined;
30
+ nextDefault(): Case<Output> | undefined;
31
+ }
32
+ /** Per-Flow script whose longer matching prefixes take precedence. */
33
+ declare class FlowScript<Input, Output> {
34
+ #private;
35
+ /** Capture one Flow prefix and its owning operation. */
36
+ constructor(owner: ScriptedOperation<Input, Output>, script: Script<Input, Output>);
37
+ /** Queue one case per matching call. */
38
+ respond(...cases: Case<Output>[]): this;
39
+ /** Use a persistent input predicate before queued cases. */
40
+ when(matches: (input: Input) => boolean, response: Case<Output>): this;
41
+ /** Replace fallback cases; the last case repeats. */
42
+ default(...cases: Case<Output>[]): this;
43
+ }
44
+ interface ResolvedCase<Output> {
45
+ response: Case<Output>;
46
+ branch?: BranchID;
47
+ isReplay?: boolean;
48
+ isUnscripted?: boolean;
49
+ }
50
+ /** Shared script, call log, and idempotency memory for one operation mock. */
51
+ declare class ScriptedOperation<Input, Output> {
52
+ #private;
53
+ /** Validate the real operation definition and capture test checks. */
54
+ constructor(definition: QueryDefinition, isMutation: boolean, options?: MockOptions<Input, Output>);
55
+ /** Queue cases on the unscoped script. */
56
+ respond(...cases: Case<Output>[]): this;
57
+ /** Add a persistent input predicate on the unscoped script. */
58
+ when(matches: (input: Input) => boolean, response: Case<Output>): this;
59
+ /** Replace unscoped fallback cases; the last repeats. */
60
+ default(...cases: Case<Output>[]): this;
61
+ /** Require a Respond or When case for every call, ignoring all defaults. */
62
+ strict(): this;
63
+ /** Select a script by exact Flow ID or prefix; longest prefixes win. */
64
+ forFlow(flowIdOrPrefix: string): FlowScript<Input, Output>;
65
+ /** Copy answered calls in answer order, including retries and replays. */
66
+ calls(): MockCall<Input>[];
67
+ /** Copy scripting errors; callers can assert after a real Flow completes. */
68
+ failures(): string[];
69
+ /** Throw after integration verification if a script was invalid or unscripted. */
70
+ assertNoFailures(): void;
71
+ /** Add validated ordered responses to a script. */
72
+ addResponses(script: Script<Input, Output>, cases: readonly Case<Output>[]): void;
73
+ /** Add a validated persistent predicate to a script. */
74
+ addRule(script: Script<Input, Output>, matches: (input: Input) => boolean, response: Case<Output>): void;
75
+ /** Replace a script's fallback cases. */
76
+ setDefaults(script: Script<Input, Output>, cases: readonly Case<Output>[]): void;
77
+ /** Answer one real SDK invocation and record its safe outcome. */
78
+ answer(call: Call, input: Input, idempotencyKey: string): ResolvedCase<Output>;
79
+ }
80
+ /** Scripted query that implements the same invoke contract as a provider query. */
81
+ declare class MockQuery<Input, Output> extends ScriptedOperation<Input, Output> implements Query<Input, Output> {
82
+ #private;
83
+ /** Construct from the real query definition. */
84
+ constructor(definition: QueryDefinition, options?: MockOptions<Input, Output>);
85
+ /** Return the real query definition. */ definition(): QueryDefinition;
86
+ /** Answer one query call from the script. */
87
+ invoke(call: Call, input: Input): QueryAttempt<Output>;
88
+ }
89
+ /** Scripted mutation with provider-like terminal idempotency replay. */
90
+ declare class MockMutation<Input, Output> extends ScriptedOperation<Input, Output> implements Mutation<Input, Output> {
91
+ #private;
92
+ /** Construct from the real mutation definition. */
93
+ constructor(definition: MutationDefinition, options?: MockOptions<Input, Output>);
94
+ /** Return the real mutation definition. */ definition(): MutationDefinition;
95
+ /** Use the stable SDK call ID as the provider deduplication key. */ idempotencyKey(callId: string): string;
96
+ /** Answer one mutation call and remember terminal outcomes by key. */
97
+ invoke(call: Call, input: Input): MutationAttempt<Output>;
98
+ }
99
+ /** Construct a scripted query from a real operation definition. */
100
+ declare function newQuery<Input, Output>(definition: QueryDefinition, options?: MockOptions<Input, Output>): MockQuery<Input, Output>;
101
+ /** Construct a scripted mutation from a real operation definition. */
102
+ declare function newMutation<Input, Output>(definition: MutationDefinition, options?: MockOptions<Input, Output>): MockMutation<Input, Output>;
103
+
104
+ /** Environment variable that enables the test harness call report. */
105
+ declare const ReportDirectoryEnvironment = "DEX_CONNECTOR_MOCK_REPORT_DIR";
106
+ /** Report file consumed by the connector test harness. */
107
+ declare const ReportFileName = "connector-calls.json";
108
+ /** One scripted provider outcome independent of a Dex Step. */
109
+ type Case<T> = {
110
+ readonly kind: 'branch';
111
+ readonly branch: BranchID;
112
+ readonly value: T;
113
+ readonly failure?: Failure;
114
+ } | {
115
+ readonly kind: 'retry';
116
+ readonly failure: Failure;
117
+ readonly retryAfterMs: number;
118
+ } | {
119
+ readonly kind: 'uncertain';
120
+ readonly branch: typeof UncertainBranchID;
121
+ readonly value: T;
122
+ readonly failure: Failure;
123
+ };
124
+ /** Construct a terminal branch case. */
125
+ declare function branchCase<T>(branch: BranchID, value: T, failure?: Failure): Case<T>;
126
+ /** Construct a retry case; another scripted case answers the next attempt. */
127
+ declare function retryCase<T>(failure: Failure, retryAfterMs?: number): Case<T>;
128
+ /** Construct an unsafe, unconfirmable mutation case. */
129
+ declare function uncertainCase<T>(value: T, failure: Failure): Case<T>;
130
+ /** One provider call answered by a mock, with Go-compatible report fields. */
131
+ declare const RecordedCallSchema: z.ZodObject<{
132
+ connectorId: z.ZodString;
133
+ operationId: z.ZodString;
134
+ connectionName: z.ZodString;
135
+ flowId: z.ZodString;
136
+ callId: z.ZodUUID;
137
+ branch: z.ZodOptional<z.ZodString>;
138
+ retry: z.ZodOptional<z.ZodBoolean>;
139
+ replay: z.ZodOptional<z.ZodBoolean>;
140
+ unscripted: z.ZodOptional<z.ZodBoolean>;
141
+ }, z.core.$strict>;
142
+ /** One fixture-backed provider call. */
143
+ type RecordedCall = z.infer<typeof RecordedCallSchema> & {
144
+ callId: CallID;
145
+ };
146
+ /** Wire format of the mock call report. */
147
+ declare const ReportRowSchema: z.ZodObject<{
148
+ connection: z.ZodString;
149
+ operation: z.ZodString;
150
+ branch: z.ZodOptional<z.ZodString>;
151
+ connectorId: z.ZodString;
152
+ flowId: z.ZodOptional<z.ZodString>;
153
+ callId: z.ZodOptional<z.ZodString>;
154
+ retry: z.ZodOptional<z.ZodBoolean>;
155
+ replay: z.ZodOptional<z.ZodBoolean>;
156
+ unscripted: z.ZodOptional<z.ZodBoolean>;
157
+ }, z.core.$strict>;
158
+ /** Wire format of the complete mock call report. */
159
+ declare const CallReportSchema: z.ZodObject<{
160
+ calls: z.ZodArray<z.ZodObject<{
161
+ connection: z.ZodString;
162
+ operation: z.ZodString;
163
+ branch: z.ZodOptional<z.ZodString>;
164
+ connectorId: z.ZodString;
165
+ flowId: z.ZodOptional<z.ZodString>;
166
+ callId: z.ZodOptional<z.ZodString>;
167
+ retry: z.ZodOptional<z.ZodBoolean>;
168
+ replay: z.ZodOptional<z.ZodBoolean>;
169
+ unscripted: z.ZodOptional<z.ZodBoolean>;
170
+ }, z.core.$strict>>;
171
+ }, z.core.$strict>;
172
+ /** Safe report of connector mock calls. */
173
+ type CallReport = z.infer<typeof CallReportSchema>;
174
+ /** Decode one strict JSON fixture and validate it against the output schema. */
175
+ declare function decodeOutput<T>(encoded: string, outputSchema: z.ZodType<T>): T;
176
+ /** Load a private test fixture from disk and validate its complete shape. */
177
+ declare function loadOutputFixture<T>(path: string, outputSchema: z.ZodType<T>): Promise<T>;
178
+ /** Decode a Go-compatible call report without exposing test input values. */
179
+ declare function decodeCallReport(encoded: string): CallReport;
180
+
181
+ export { type CallReport, CallReportSchema, type Case, FlowScript, type MockCall, MockMutation, type MockOptions, MockQuery, type RecordedCall, RecordedCallSchema, ReportDirectoryEnvironment, ReportFileName, ReportRowSchema, branchCase, decodeCallReport, decodeOutput, loadOutputFixture, newMutation, newQuery, retryCase, uncertainCase };