@modainteract/moda-interact-shared 0.12.2 → 0.13.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,1004 @@
1
+ import { z } from 'zod';
2
+
3
+ /** Bounded canonical JSON. No credentials, hashing runtime or provider access. */
4
+ declare function canonicalJson(value: unknown, order?: "codepoint" | "utf16"): string;
5
+ declare const jsonBytes: (value: unknown) => number;
6
+ /** RFC8785 sorts UTF-16 code units; JSON.stringify supplies ECMAScript number serialization. */
7
+ declare const responseContractCanonicalJson: (value: unknown) => string;
8
+ type Digest = (canonical: string) => string;
9
+
10
+ type Json = null | boolean | number | string | Json[] | {
11
+ [key: string]: Json;
12
+ };
13
+ type SubsetSchema = {
14
+ type: string | [string, "null"];
15
+ description?: string;
16
+ properties?: Record<string, SubsetSchema>;
17
+ required?: string[];
18
+ additionalProperties?: false;
19
+ items?: SubsetSchema;
20
+ enum?: Array<string | number | boolean | null>;
21
+ minLength?: number;
22
+ maxLength?: number;
23
+ minimum?: number;
24
+ maximum?: number;
25
+ minItems?: number;
26
+ maxItems?: number;
27
+ pattern?: string;
28
+ };
29
+ declare const MONEY_PATTERN = "^[0-9]{1,18}(\\.[0-9]{1,6})?$";
30
+ declare const safeName: (name: string) => boolean;
31
+ declare const safePath: (path: string) => boolean;
32
+ declare function validateSubset(value: unknown, mode: "input" | "details"): value is SubsetSchema;
33
+ declare const InputSchemaSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
34
+ declare const DetailsSchemaSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
35
+ declare function matchesSubset(schema: SubsetSchema, value: unknown): boolean;
36
+ declare function compileSubset(schema: SubsetSchema, mode: "input" | "details"): z.ZodCustom<Record<string, Json>, Record<string, Json>>;
37
+
38
+ declare const ToolNameSchema: z.ZodString;
39
+ declare const ToolBindingSchema: z.ZodObject<{
40
+ toolId: z.ZodString;
41
+ toolRevisionId: z.ZodString;
42
+ }, z.core.$strict>;
43
+ declare const ToolBindingsSchema: z.ZodArray<z.ZodObject<{
44
+ toolId: z.ZodString;
45
+ toolRevisionId: z.ZodString;
46
+ }, z.core.$strict>>;
47
+ declare const GrantedToolSchema: z.ZodObject<{
48
+ toolId: z.ZodString;
49
+ toolRevisionId: z.ZodString;
50
+ toolName: z.ZodString;
51
+ definitionVersion: z.ZodString;
52
+ capabilityKeys: z.ZodArray<z.ZodString>;
53
+ }, z.core.$strict>;
54
+ declare const GrantedToolsSchema: z.ZodArray<z.ZodObject<{
55
+ toolId: z.ZodString;
56
+ toolRevisionId: z.ZodString;
57
+ toolName: z.ZodString;
58
+ definitionVersion: z.ZodString;
59
+ capabilityKeys: z.ZodArray<z.ZodString>;
60
+ }, z.core.$strict>>;
61
+ declare const ToolDescriptorSchema: z.ZodObject<{
62
+ toolId: z.ZodString;
63
+ toolRevisionId: z.ZodString;
64
+ name: z.ZodString;
65
+ definitionVersion: z.ZodString;
66
+ description: z.ZodString;
67
+ inputSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
68
+ }, z.core.$strict>;
69
+ declare const POLICY_OPERATIONS: readonly ["recovery.getBasket", "shopify.searchProducts", "discounts.getOptions", "discounts.evaluate", "products.findQualifying", "products.findSimilar"];
70
+ declare const CommerceExecutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
71
+ kind: z.ZodLiteral<"SHOPIFY_STOREFRONT_QUERY">;
72
+ executorVersion: z.ZodLiteral<"1.0.0">;
73
+ apiVersion: z.ZodLiteral<"2026-07">;
74
+ schemaHash: z.ZodString;
75
+ document: z.ZodString;
76
+ operationName: z.ZodString;
77
+ variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
78
+ input: z.ZodString;
79
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
80
+ }, z.core.$strict>, z.ZodObject<{
81
+ literal: z.ZodUnknown;
82
+ }, z.core.$strict>]>>;
83
+ resultPath: z.ZodString;
84
+ }, z.core.$strict>, z.ZodObject<{
85
+ kind: z.ZodLiteral<"POLICY_OPERATION">;
86
+ operation: z.ZodEnum<{
87
+ "recovery.getBasket": "recovery.getBasket";
88
+ "shopify.searchProducts": "shopify.searchProducts";
89
+ "discounts.getOptions": "discounts.getOptions";
90
+ "discounts.evaluate": "discounts.evaluate";
91
+ "products.findQualifying": "products.findQualifying";
92
+ "products.findSimilar": "products.findSimilar";
93
+ }>;
94
+ operationVersion: z.ZodLiteral<"1.0.0">;
95
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
96
+ input: z.ZodString;
97
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
98
+ }, z.core.$strict>, z.ZodObject<{
99
+ literal: z.ZodUnknown;
100
+ }, z.core.$strict>]>>;
101
+ }, z.core.$strict>], "kind">;
102
+ declare const ResponseTemplateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
103
+ kind: z.ZodLiteral<"text">;
104
+ text: z.ZodString;
105
+ unavailable: z.ZodString;
106
+ }, z.core.$strict>, z.ZodObject<{
107
+ kind: z.ZodLiteral<"items">;
108
+ itemsPath: z.ZodString;
109
+ item: z.ZodString;
110
+ empty: z.ZodString;
111
+ unavailable: z.ZodString;
112
+ }, z.core.$strict>], "kind">;
113
+ declare const CommerceToolDefinitionSchema: z.ZodObject<{
114
+ inputSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
115
+ execution: z.ZodDiscriminatedUnion<[z.ZodObject<{
116
+ kind: z.ZodLiteral<"SHOPIFY_STOREFRONT_QUERY">;
117
+ executorVersion: z.ZodLiteral<"1.0.0">;
118
+ apiVersion: z.ZodLiteral<"2026-07">;
119
+ schemaHash: z.ZodString;
120
+ document: z.ZodString;
121
+ operationName: z.ZodString;
122
+ variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
123
+ input: z.ZodString;
124
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
125
+ }, z.core.$strict>, z.ZodObject<{
126
+ literal: z.ZodUnknown;
127
+ }, z.core.$strict>]>>;
128
+ resultPath: z.ZodString;
129
+ }, z.core.$strict>, z.ZodObject<{
130
+ kind: z.ZodLiteral<"POLICY_OPERATION">;
131
+ operation: z.ZodEnum<{
132
+ "recovery.getBasket": "recovery.getBasket";
133
+ "shopify.searchProducts": "shopify.searchProducts";
134
+ "discounts.getOptions": "discounts.getOptions";
135
+ "discounts.evaluate": "discounts.evaluate";
136
+ "products.findQualifying": "products.findQualifying";
137
+ "products.findSimilar": "products.findSimilar";
138
+ }>;
139
+ operationVersion: z.ZodLiteral<"1.0.0">;
140
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
141
+ input: z.ZodString;
142
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
143
+ }, z.core.$strict>, z.ZodObject<{
144
+ literal: z.ZodUnknown;
145
+ }, z.core.$strict>]>>;
146
+ }, z.core.$strict>], "kind">;
147
+ responseTemplate: z.ZodDiscriminatedUnion<[z.ZodObject<{
148
+ kind: z.ZodLiteral<"text">;
149
+ text: z.ZodString;
150
+ unavailable: z.ZodString;
151
+ }, z.core.$strict>, z.ZodObject<{
152
+ kind: z.ZodLiteral<"items">;
153
+ itemsPath: z.ZodString;
154
+ item: z.ZodString;
155
+ empty: z.ZodString;
156
+ unavailable: z.ZodString;
157
+ }, z.core.$strict>], "kind">;
158
+ name: z.ZodString;
159
+ definitionVersion: z.ZodString;
160
+ description: z.ZodString;
161
+ }, z.core.$strict>;
162
+ declare const CommerceToolDraftDefinitionSchema: z.ZodObject<{
163
+ inputSchema: z.ZodUnknown;
164
+ execution: z.ZodUnknown;
165
+ responseTemplate: z.ZodUnknown;
166
+ name: z.ZodString;
167
+ definitionVersion: z.ZodString;
168
+ description: z.ZodString;
169
+ }, z.core.$strict>;
170
+ type CommerceToolDefinition = z.infer<typeof CommerceToolDefinitionSchema>;
171
+ type CommerceToolDraftDefinition = z.infer<typeof CommerceToolDraftDefinitionSchema>;
172
+ type GrantedTool = z.infer<typeof GrantedToolSchema>;
173
+ type ToolDescriptor = z.infer<typeof ToolDescriptorSchema>;
174
+ /** Commerce owns schema-backed GraphQL parsing, restrictions and output derivation. */
175
+ interface CommerceDefinitionCompiler {
176
+ compile(execution: CommerceToolDefinition["execution"], input: SubsetSchema): {
177
+ outputSchema: SubsetSchema;
178
+ validateMappedArguments: (mapping: CommerceToolDefinition["execution"]) => boolean;
179
+ };
180
+ }
181
+ declare function validateDefinitionForPublication(raw: unknown, compiler: CommerceDefinitionCompiler): {
182
+ inputSchema: SubsetSchema;
183
+ execution: {
184
+ kind: "SHOPIFY_STOREFRONT_QUERY";
185
+ executorVersion: "1.0.0";
186
+ apiVersion: "2026-07";
187
+ schemaHash: string;
188
+ document: string;
189
+ operationName: string;
190
+ variables: Record<string, {
191
+ input: string;
192
+ omitIfMissing?: true | undefined;
193
+ } | {
194
+ literal: unknown;
195
+ }>;
196
+ resultPath: string;
197
+ } | {
198
+ kind: "POLICY_OPERATION";
199
+ operation: "recovery.getBasket" | "shopify.searchProducts" | "discounts.getOptions" | "discounts.evaluate" | "products.findQualifying" | "products.findSimilar";
200
+ operationVersion: "1.0.0";
201
+ arguments: Record<string, {
202
+ input: string;
203
+ omitIfMissing?: true | undefined;
204
+ } | {
205
+ literal: unknown;
206
+ }>;
207
+ };
208
+ responseTemplate: {
209
+ kind: "text";
210
+ text: string;
211
+ unavailable: string;
212
+ } | {
213
+ kind: "items";
214
+ itemsPath: string;
215
+ item: string;
216
+ empty: string;
217
+ unavailable: string;
218
+ };
219
+ name: string;
220
+ definitionVersion: string;
221
+ description: string;
222
+ };
223
+ declare function definitionToMcpDescriptor(definition: CommerceToolDefinition): {
224
+ name: string;
225
+ description: string;
226
+ inputSchema: SubsetSchema;
227
+ };
228
+ declare function mapToolArguments(definition: CommerceToolDefinition, raw: unknown): Record<string, unknown>;
229
+ declare const toolHashInput: (definition: CommerceToolDefinition) => {
230
+ contractVersion: "commerce.v1";
231
+ definition: {
232
+ inputSchema: SubsetSchema;
233
+ execution: {
234
+ kind: "SHOPIFY_STOREFRONT_QUERY";
235
+ executorVersion: "1.0.0";
236
+ apiVersion: "2026-07";
237
+ schemaHash: string;
238
+ document: string;
239
+ operationName: string;
240
+ variables: Record<string, {
241
+ input: string;
242
+ omitIfMissing?: true | undefined;
243
+ } | {
244
+ literal: unknown;
245
+ }>;
246
+ resultPath: string;
247
+ } | {
248
+ kind: "POLICY_OPERATION";
249
+ operation: "recovery.getBasket" | "shopify.searchProducts" | "discounts.getOptions" | "discounts.evaluate" | "products.findQualifying" | "products.findSimilar";
250
+ operationVersion: "1.0.0";
251
+ arguments: Record<string, {
252
+ input: string;
253
+ omitIfMissing?: true | undefined;
254
+ } | {
255
+ literal: unknown;
256
+ }>;
257
+ };
258
+ responseTemplate: {
259
+ kind: "text";
260
+ text: string;
261
+ unavailable: string;
262
+ } | {
263
+ kind: "items";
264
+ itemsPath: string;
265
+ item: string;
266
+ empty: string;
267
+ unavailable: string;
268
+ };
269
+ name: string;
270
+ definitionVersion: string;
271
+ description: string;
272
+ };
273
+ };
274
+ declare function capabilityHashInput(promptTemplate: string, configuration: unknown, toolBindings: unknown): {
275
+ contractVersion: "commerce.v1";
276
+ promptTemplate: string;
277
+ configuration: unknown;
278
+ toolBindings: {
279
+ toolId: string;
280
+ toolRevisionId: string;
281
+ }[];
282
+ };
283
+ /** Publication adapters supply the actual highest published version from persistence. */
284
+ declare function validateDefinitionVersion(proposed: string, highestPublished: string | null): boolean;
285
+ declare const CommerceToolIdentitySchema: z.ZodObject<{
286
+ id: z.ZodString;
287
+ name: z.ZodString;
288
+ enabled: z.ZodBoolean;
289
+ }, z.core.$strict>;
290
+ declare const CommerceToolRevisionIdentitySchema: z.ZodObject<{
291
+ toolId: z.ZodString;
292
+ toolRevisionId: z.ZodString;
293
+ definitionVersion: z.ZodString;
294
+ contentHash: z.ZodString;
295
+ }, z.core.$strict>;
296
+ declare const POLICY_OPERATION_DESCRIPTORS: {
297
+ operation: "recovery.getBasket" | "shopify.searchProducts" | "discounts.getOptions" | "discounts.evaluate" | "products.findQualifying" | "products.findSimilar";
298
+ operationVersion: "1.0.0";
299
+ }[];
300
+
301
+ declare const CommerceTurnIdentitySchema: z.ZodObject<{
302
+ contractVersion: z.ZodLiteral<"commerce.v1">;
303
+ shopId: z.ZodString;
304
+ checkoutRecoveryId: z.ZodString;
305
+ conversationId: z.ZodString;
306
+ inboundVersion: z.ZodNumber;
307
+ }, z.core.$strict>;
308
+ type CommerceTurnIdentity = z.infer<typeof CommerceTurnIdentitySchema>;
309
+ declare const CommerceConversationGrantSchema: z.ZodObject<{
310
+ id: z.ZodString;
311
+ shopId: z.ZodString;
312
+ conversationId: z.ZodString;
313
+ initialInboundVersion: z.ZodNumber;
314
+ releaseId: z.ZodString;
315
+ selectedCapabilityKeys: z.ZodArray<z.ZodString>;
316
+ grantedTools: z.ZodArray<z.ZodObject<{
317
+ toolId: z.ZodString;
318
+ toolRevisionId: z.ZodString;
319
+ toolName: z.ZodString;
320
+ definitionVersion: z.ZodString;
321
+ capabilityKeys: z.ZodArray<z.ZodString>;
322
+ }, z.core.$strict>>;
323
+ runnerVersion: z.ZodString;
324
+ createdAt: z.ZodISODateTime;
325
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
326
+ }, z.core.$strict>;
327
+ type CommerceConversationGrant = z.infer<typeof CommerceConversationGrantSchema>;
328
+ declare const CommerceConfigurationSchema: z.ZodObject<{
329
+ maxRecommendations: z.ZodOptional<z.ZodNumber>;
330
+ maxSearchResults: z.ZodOptional<z.ZodNumber>;
331
+ }, z.core.$strict>;
332
+ declare const CommerceManifestSchema: z.ZodObject<{
333
+ contractVersion: z.ZodLiteral<"commerce.v1">;
334
+ releaseId: z.ZodString;
335
+ runnerCompatibility: z.ZodString;
336
+ capabilities: z.ZodArray<z.ZodObject<{
337
+ key: z.ZodString;
338
+ revisionId: z.ZodString;
339
+ position: z.ZodNumber;
340
+ promptName: z.ZodString;
341
+ configuration: z.ZodObject<{
342
+ maxRecommendations: z.ZodOptional<z.ZodNumber>;
343
+ maxSearchResults: z.ZodOptional<z.ZodNumber>;
344
+ }, z.core.$strict>;
345
+ toolDescriptors: z.ZodArray<z.ZodObject<{
346
+ toolId: z.ZodString;
347
+ toolRevisionId: z.ZodString;
348
+ name: z.ZodString;
349
+ definitionVersion: z.ZodString;
350
+ description: z.ZodString;
351
+ inputSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
352
+ }, z.core.$strict>>;
353
+ }, z.core.$strict>>;
354
+ selectedCapabilityKeys: z.ZodArray<z.ZodString>;
355
+ grantedTools: z.ZodArray<z.ZodObject<{
356
+ toolId: z.ZodString;
357
+ toolRevisionId: z.ZodString;
358
+ toolName: z.ZodString;
359
+ definitionVersion: z.ZodString;
360
+ capabilityKeys: z.ZodArray<z.ZodString>;
361
+ }, z.core.$strict>>;
362
+ responseContract: z.ZodObject<{
363
+ version: z.ZodLiteral<"response.v1">;
364
+ instructions: z.ZodString;
365
+ detailsSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
366
+ }, z.core.$strict>;
367
+ responseContractHash: z.ZodString;
368
+ }, z.core.$strict>;
369
+ type CommerceManifest = z.infer<typeof CommerceManifestSchema>;
370
+ declare const CommerceReleaseIdentitySchema: z.ZodObject<{
371
+ contractVersion: z.ZodLiteral<"commerce.v1">;
372
+ releaseId: z.ZodString;
373
+ runnerCompatibility: z.ZodString;
374
+ }, z.core.$strict>;
375
+ declare const CommerceResolveAssertionSchema: z.ZodObject<{
376
+ contractVersion: z.ZodLiteral<"commerce.v1">;
377
+ shopId: z.ZodString;
378
+ checkoutRecoveryId: z.ZodString;
379
+ conversationId: z.ZodString;
380
+ inboundVersion: z.ZodNumber;
381
+ purpose: z.ZodLiteral<"resolve">;
382
+ }, z.core.$strict>;
383
+ declare const CommerceExecuteAssertionSchema: z.ZodObject<{
384
+ contractVersion: z.ZodLiteral<"commerce.v1">;
385
+ shopId: z.ZodString;
386
+ checkoutRecoveryId: z.ZodString;
387
+ conversationId: z.ZodString;
388
+ inboundVersion: z.ZodNumber;
389
+ purpose: z.ZodLiteral<"execute">;
390
+ grantId: z.ZodString;
391
+ releaseId: z.ZodString;
392
+ }, z.core.$strict>;
393
+ declare const CommerceAssertionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
394
+ contractVersion: z.ZodLiteral<"commerce.v1">;
395
+ shopId: z.ZodString;
396
+ checkoutRecoveryId: z.ZodString;
397
+ conversationId: z.ZodString;
398
+ inboundVersion: z.ZodNumber;
399
+ purpose: z.ZodLiteral<"resolve">;
400
+ }, z.core.$strict>, z.ZodObject<{
401
+ contractVersion: z.ZodLiteral<"commerce.v1">;
402
+ shopId: z.ZodString;
403
+ checkoutRecoveryId: z.ZodString;
404
+ conversationId: z.ZodString;
405
+ inboundVersion: z.ZodNumber;
406
+ purpose: z.ZodLiteral<"execute">;
407
+ grantId: z.ZodString;
408
+ releaseId: z.ZodString;
409
+ }, z.core.$strict>], "purpose">;
410
+ declare const CommerceProposalSchema: z.ZodObject<{
411
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
412
+ kind: z.ZodLiteral<"ADD">;
413
+ variantId: z.ZodString;
414
+ quantity: z.ZodNumber;
415
+ }, z.core.$strict>, z.ZodObject<{
416
+ kind: z.ZodLiteral<"REPLACE">;
417
+ lineId: z.ZodString;
418
+ variantId: z.ZodString;
419
+ quantity: z.ZodNumber;
420
+ }, z.core.$strict>], "kind">>;
421
+ }, z.core.$strict>;
422
+ declare const CommerceBasketSchema: z.ZodObject<{
423
+ basketId: z.ZodString;
424
+ source: z.ZodEnum<{
425
+ RECOVERY_SNAPSHOT: "RECOVERY_SNAPSHOT";
426
+ PROPOSED: "PROPOSED";
427
+ }>;
428
+ observedAt: z.ZodISODateTime;
429
+ currency: z.ZodNullable<z.ZodString>;
430
+ lines: z.ZodArray<z.ZodObject<{
431
+ lineId: z.ZodString;
432
+ productId: z.ZodNullable<z.ZodString>;
433
+ variantId: z.ZodNullable<z.ZodString>;
434
+ quantity: z.ZodNullable<z.ZodNumber>;
435
+ unitPrice: z.ZodNullable<z.ZodString>;
436
+ }, z.core.$strict>>;
437
+ fingerprint: z.ZodString;
438
+ unknownFields: z.ZodArray<z.ZodString>;
439
+ }, z.core.$strict>;
440
+ declare const CommerceProductSchema: z.ZodObject<{
441
+ productId: z.ZodString;
442
+ variantId: z.ZodString;
443
+ title: z.ZodString;
444
+ url: z.ZodNullable<z.ZodURL>;
445
+ available: z.ZodNullable<z.ZodBoolean>;
446
+ unitPrice: z.ZodNullable<z.ZodString>;
447
+ currency: z.ZodNullable<z.ZodString>;
448
+ productType: z.ZodNullable<z.ZodString>;
449
+ vendor: z.ZodNullable<z.ZodString>;
450
+ observedAt: z.ZodISODateTime;
451
+ }, z.core.$strict>;
452
+ declare const CommerceOfferSchema: z.ZodObject<{
453
+ offerId: z.ZodString;
454
+ title: z.ZodString;
455
+ method: z.ZodEnum<{
456
+ AUTOMATIC: "AUTOMATIC";
457
+ CODE: "CODE";
458
+ }>;
459
+ code: z.ZodNullable<z.ZodString>;
460
+ startsAt: z.ZodNullable<z.ZodISODateTime>;
461
+ endsAt: z.ZodNullable<z.ZodISODateTime>;
462
+ support: z.ZodEnum<{
463
+ SUPPORTED: "SUPPORTED";
464
+ UNSUPPORTED: "UNSUPPORTED";
465
+ UNKNOWN: "UNKNOWN";
466
+ }>;
467
+ reasonCodes: z.ZodArray<z.ZodString>;
468
+ }, z.core.$strict>;
469
+ declare const CommerceEvidenceSchema: z.ZodObject<{
470
+ evidenceId: z.ZodString;
471
+ turn: z.ZodObject<{
472
+ contractVersion: z.ZodLiteral<"commerce.v1">;
473
+ shopId: z.ZodString;
474
+ checkoutRecoveryId: z.ZodString;
475
+ conversationId: z.ZodString;
476
+ inboundVersion: z.ZodNumber;
477
+ }, z.core.$strict>;
478
+ grantId: z.ZodString;
479
+ releaseId: z.ZodString;
480
+ offerId: z.ZodString;
481
+ proposal: z.ZodNullable<z.ZodObject<{
482
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
483
+ kind: z.ZodLiteral<"ADD">;
484
+ variantId: z.ZodString;
485
+ quantity: z.ZodNumber;
486
+ }, z.core.$strict>, z.ZodObject<{
487
+ kind: z.ZodLiteral<"REPLACE">;
488
+ lineId: z.ZodString;
489
+ variantId: z.ZodString;
490
+ quantity: z.ZodNumber;
491
+ }, z.core.$strict>], "kind">>;
492
+ }, z.core.$strict>>;
493
+ basketFingerprint: z.ZodString;
494
+ ruleFingerprint: z.ZodString;
495
+ evaluatedAt: z.ZodISODateTime;
496
+ expiresAt: z.ZodISODateTime;
497
+ outcome: z.ZodEnum<{
498
+ UNSUPPORTED: "UNSUPPORTED";
499
+ UNKNOWN: "UNKNOWN";
500
+ QUALIFIES_FOR_KNOWN_RULES: "QUALIFIES_FOR_KNOWN_RULES";
501
+ DOES_NOT_QUALIFY: "DOES_NOT_QUALIFY";
502
+ }>;
503
+ currency: z.ZodNullable<z.ZodString>;
504
+ savings: z.ZodNullable<z.ZodString>;
505
+ resultingTotal: z.ZodNullable<z.ZodString>;
506
+ evaluatedConditions: z.ZodArray<z.ZodObject<{
507
+ code: z.ZodString;
508
+ description: z.ZodString;
509
+ }, z.core.$strict>>;
510
+ unresolvedConditions: z.ZodArray<z.ZodObject<{
511
+ code: z.ZodString;
512
+ description: z.ZodString;
513
+ }, z.core.$strict>>;
514
+ }, z.core.$strict>;
515
+ type CommerceEvidence = z.infer<typeof CommerceEvidenceSchema>;
516
+ declare const CommerceAlternativeSchema: z.ZodObject<{
517
+ product: z.ZodObject<{
518
+ productId: z.ZodString;
519
+ variantId: z.ZodString;
520
+ title: z.ZodString;
521
+ url: z.ZodNullable<z.ZodURL>;
522
+ available: z.ZodNullable<z.ZodBoolean>;
523
+ unitPrice: z.ZodNullable<z.ZodString>;
524
+ currency: z.ZodNullable<z.ZodString>;
525
+ productType: z.ZodNullable<z.ZodString>;
526
+ vendor: z.ZodNullable<z.ZodString>;
527
+ observedAt: z.ZodISODateTime;
528
+ }, z.core.$strict>;
529
+ proposal: z.ZodObject<{
530
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
531
+ kind: z.ZodLiteral<"ADD">;
532
+ variantId: z.ZodString;
533
+ quantity: z.ZodNumber;
534
+ }, z.core.$strict>, z.ZodObject<{
535
+ kind: z.ZodLiteral<"REPLACE">;
536
+ lineId: z.ZodString;
537
+ variantId: z.ZodString;
538
+ quantity: z.ZodNumber;
539
+ }, z.core.$strict>], "kind">>;
540
+ }, z.core.$strict>;
541
+ extraSpend: z.ZodNullable<z.ZodString>;
542
+ resultingTotal: z.ZodNullable<z.ZodString>;
543
+ currency: z.ZodNullable<z.ZodString>;
544
+ evidence: z.ZodNullable<z.ZodObject<{
545
+ evidenceId: z.ZodString;
546
+ turn: z.ZodObject<{
547
+ contractVersion: z.ZodLiteral<"commerce.v1">;
548
+ shopId: z.ZodString;
549
+ checkoutRecoveryId: z.ZodString;
550
+ conversationId: z.ZodString;
551
+ inboundVersion: z.ZodNumber;
552
+ }, z.core.$strict>;
553
+ grantId: z.ZodString;
554
+ releaseId: z.ZodString;
555
+ offerId: z.ZodString;
556
+ proposal: z.ZodNullable<z.ZodObject<{
557
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
558
+ kind: z.ZodLiteral<"ADD">;
559
+ variantId: z.ZodString;
560
+ quantity: z.ZodNumber;
561
+ }, z.core.$strict>, z.ZodObject<{
562
+ kind: z.ZodLiteral<"REPLACE">;
563
+ lineId: z.ZodString;
564
+ variantId: z.ZodString;
565
+ quantity: z.ZodNumber;
566
+ }, z.core.$strict>], "kind">>;
567
+ }, z.core.$strict>>;
568
+ basketFingerprint: z.ZodString;
569
+ ruleFingerprint: z.ZodString;
570
+ evaluatedAt: z.ZodISODateTime;
571
+ expiresAt: z.ZodISODateTime;
572
+ outcome: z.ZodEnum<{
573
+ UNSUPPORTED: "UNSUPPORTED";
574
+ UNKNOWN: "UNKNOWN";
575
+ QUALIFIES_FOR_KNOWN_RULES: "QUALIFIES_FOR_KNOWN_RULES";
576
+ DOES_NOT_QUALIFY: "DOES_NOT_QUALIFY";
577
+ }>;
578
+ currency: z.ZodNullable<z.ZodString>;
579
+ savings: z.ZodNullable<z.ZodString>;
580
+ resultingTotal: z.ZodNullable<z.ZodString>;
581
+ evaluatedConditions: z.ZodArray<z.ZodObject<{
582
+ code: z.ZodString;
583
+ description: z.ZodString;
584
+ }, z.core.$strict>>;
585
+ unresolvedConditions: z.ZodArray<z.ZodObject<{
586
+ code: z.ZodString;
587
+ description: z.ZodString;
588
+ }, z.core.$strict>>;
589
+ }, z.core.$strict>>;
590
+ similarityReasons: z.ZodArray<z.ZodString>;
591
+ }, z.core.$strict>;
592
+ declare const CommerceErrorCodeSchema: z.ZodEnum<{
593
+ INVALID_INPUT: "INVALID_INPUT";
594
+ DENIED: "DENIED";
595
+ STALE_TURN: "STALE_TURN";
596
+ NOT_FOUND: "NOT_FOUND";
597
+ UNAVAILABLE: "UNAVAILABLE";
598
+ THROTTLED: "THROTTLED";
599
+ DEADLINE: "DEADLINE";
600
+ INCOMPATIBLE_VERSION: "INCOMPATIBLE_VERSION";
601
+ }>;
602
+ declare function commerceToolResultSchema<T extends z.ZodType>(data: T): z.ZodUnion<readonly [z.ZodObject<{
603
+ contractVersion: z.ZodLiteral<"commerce.v1">;
604
+ status: z.ZodLiteral<"OK">;
605
+ data: T;
606
+ renderedText: z.ZodString;
607
+ }, z.core.$strict>, z.ZodObject<{
608
+ contractVersion: z.ZodLiteral<"commerce.v1">;
609
+ status: z.ZodLiteral<"ERROR">;
610
+ code: z.ZodEnum<{
611
+ INVALID_INPUT: "INVALID_INPUT";
612
+ DENIED: "DENIED";
613
+ STALE_TURN: "STALE_TURN";
614
+ NOT_FOUND: "NOT_FOUND";
615
+ UNAVAILABLE: "UNAVAILABLE";
616
+ THROTTLED: "THROTTLED";
617
+ DEADLINE: "DEADLINE";
618
+ INCOMPATIBLE_VERSION: "INCOMPATIBLE_VERSION";
619
+ }>;
620
+ retryable: z.ZodBoolean;
621
+ renderedText: z.ZodOptional<z.ZodString>;
622
+ }, z.core.$strict>]>;
623
+ declare const CommerceToolResultSchema: z.ZodUnion<readonly [z.ZodObject<{
624
+ contractVersion: z.ZodLiteral<"commerce.v1">;
625
+ status: z.ZodLiteral<"OK">;
626
+ data: z.ZodUnknown;
627
+ renderedText: z.ZodString;
628
+ }, z.core.$strict>, z.ZodObject<{
629
+ contractVersion: z.ZodLiteral<"commerce.v1">;
630
+ status: z.ZodLiteral<"ERROR">;
631
+ code: z.ZodEnum<{
632
+ INVALID_INPUT: "INVALID_INPUT";
633
+ DENIED: "DENIED";
634
+ STALE_TURN: "STALE_TURN";
635
+ NOT_FOUND: "NOT_FOUND";
636
+ UNAVAILABLE: "UNAVAILABLE";
637
+ THROTTLED: "THROTTLED";
638
+ DEADLINE: "DEADLINE";
639
+ INCOMPATIBLE_VERSION: "INCOMPATIBLE_VERSION";
640
+ }>;
641
+ retryable: z.ZodBoolean;
642
+ renderedText: z.ZodOptional<z.ZodString>;
643
+ }, z.core.$strict>]>;
644
+ type CommerceToolResult = z.infer<typeof CommerceToolResultSchema>;
645
+ declare const CommerceToolInputs: {
646
+ commerce_get_basket: z.ZodObject<{}, z.core.$strict>;
647
+ commerce_search_products: z.ZodObject<{
648
+ query: z.ZodString;
649
+ maximumPrice: z.ZodOptional<z.ZodString>;
650
+ availableOnly: z.ZodDefault<z.ZodBoolean>;
651
+ limit: z.ZodDefault<z.ZodNumber>;
652
+ cursor: z.ZodDefault<z.ZodNullable<z.ZodString>>;
653
+ }, z.core.$strict>;
654
+ commerce_get_discount_options: z.ZodObject<{}, z.core.$strict>;
655
+ commerce_evaluate_discount: z.ZodObject<{
656
+ offerId: z.ZodString;
657
+ proposal: z.ZodNullable<z.ZodObject<{
658
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
659
+ kind: z.ZodLiteral<"ADD">;
660
+ variantId: z.ZodString;
661
+ quantity: z.ZodNumber;
662
+ }, z.core.$strict>, z.ZodObject<{
663
+ kind: z.ZodLiteral<"REPLACE">;
664
+ lineId: z.ZodString;
665
+ variantId: z.ZodString;
666
+ quantity: z.ZodNumber;
667
+ }, z.core.$strict>], "kind">>;
668
+ }, z.core.$strict>>;
669
+ }, z.core.$strict>;
670
+ commerce_find_qualifying_products: z.ZodObject<{
671
+ offerId: z.ZodString;
672
+ query: z.ZodNullable<z.ZodString>;
673
+ limit: z.ZodDefault<z.ZodNumber>;
674
+ }, z.core.$strict>;
675
+ commerce_find_similar_products: z.ZodObject<{
676
+ variantId: z.ZodString;
677
+ offerId: z.ZodNullable<z.ZodString>;
678
+ limit: z.ZodDefault<z.ZodNumber>;
679
+ }, z.core.$strict>;
680
+ };
681
+ declare const CommerceToolOutputs: {
682
+ commerce_get_basket: z.ZodObject<{
683
+ basketId: z.ZodString;
684
+ source: z.ZodEnum<{
685
+ RECOVERY_SNAPSHOT: "RECOVERY_SNAPSHOT";
686
+ PROPOSED: "PROPOSED";
687
+ }>;
688
+ observedAt: z.ZodISODateTime;
689
+ currency: z.ZodNullable<z.ZodString>;
690
+ lines: z.ZodArray<z.ZodObject<{
691
+ lineId: z.ZodString;
692
+ productId: z.ZodNullable<z.ZodString>;
693
+ variantId: z.ZodNullable<z.ZodString>;
694
+ quantity: z.ZodNullable<z.ZodNumber>;
695
+ unitPrice: z.ZodNullable<z.ZodString>;
696
+ }, z.core.$strict>>;
697
+ fingerprint: z.ZodString;
698
+ unknownFields: z.ZodArray<z.ZodString>;
699
+ }, z.core.$strict>;
700
+ commerce_search_products: z.ZodObject<{
701
+ products: z.ZodArray<z.ZodObject<{
702
+ productId: z.ZodString;
703
+ variantId: z.ZodString;
704
+ title: z.ZodString;
705
+ url: z.ZodNullable<z.ZodURL>;
706
+ available: z.ZodNullable<z.ZodBoolean>;
707
+ unitPrice: z.ZodNullable<z.ZodString>;
708
+ currency: z.ZodNullable<z.ZodString>;
709
+ productType: z.ZodNullable<z.ZodString>;
710
+ vendor: z.ZodNullable<z.ZodString>;
711
+ observedAt: z.ZodISODateTime;
712
+ }, z.core.$strict>>;
713
+ cursor: z.ZodNullable<z.ZodString>;
714
+ truncated: z.ZodBoolean;
715
+ }, z.core.$strict>;
716
+ commerce_get_discount_options: z.ZodObject<{
717
+ mode: z.ZodEnum<{
718
+ NONE: "NONE";
719
+ FIXED: "FIXED";
720
+ AI_BEST_APPLICABLE: "AI_BEST_APPLICABLE";
721
+ }>;
722
+ offers: z.ZodArray<z.ZodObject<{
723
+ offerId: z.ZodString;
724
+ title: z.ZodString;
725
+ method: z.ZodEnum<{
726
+ AUTOMATIC: "AUTOMATIC";
727
+ CODE: "CODE";
728
+ }>;
729
+ code: z.ZodNullable<z.ZodString>;
730
+ startsAt: z.ZodNullable<z.ZodISODateTime>;
731
+ endsAt: z.ZodNullable<z.ZodISODateTime>;
732
+ support: z.ZodEnum<{
733
+ SUPPORTED: "SUPPORTED";
734
+ UNSUPPORTED: "UNSUPPORTED";
735
+ UNKNOWN: "UNKNOWN";
736
+ }>;
737
+ reasonCodes: z.ZodArray<z.ZodString>;
738
+ }, z.core.$strict>>;
739
+ truncated: z.ZodBoolean;
740
+ }, z.core.$strict>;
741
+ commerce_evaluate_discount: z.ZodObject<{
742
+ evidenceId: z.ZodString;
743
+ turn: z.ZodObject<{
744
+ contractVersion: z.ZodLiteral<"commerce.v1">;
745
+ shopId: z.ZodString;
746
+ checkoutRecoveryId: z.ZodString;
747
+ conversationId: z.ZodString;
748
+ inboundVersion: z.ZodNumber;
749
+ }, z.core.$strict>;
750
+ grantId: z.ZodString;
751
+ releaseId: z.ZodString;
752
+ offerId: z.ZodString;
753
+ proposal: z.ZodNullable<z.ZodObject<{
754
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
755
+ kind: z.ZodLiteral<"ADD">;
756
+ variantId: z.ZodString;
757
+ quantity: z.ZodNumber;
758
+ }, z.core.$strict>, z.ZodObject<{
759
+ kind: z.ZodLiteral<"REPLACE">;
760
+ lineId: z.ZodString;
761
+ variantId: z.ZodString;
762
+ quantity: z.ZodNumber;
763
+ }, z.core.$strict>], "kind">>;
764
+ }, z.core.$strict>>;
765
+ basketFingerprint: z.ZodString;
766
+ ruleFingerprint: z.ZodString;
767
+ evaluatedAt: z.ZodISODateTime;
768
+ expiresAt: z.ZodISODateTime;
769
+ outcome: z.ZodEnum<{
770
+ UNSUPPORTED: "UNSUPPORTED";
771
+ UNKNOWN: "UNKNOWN";
772
+ QUALIFIES_FOR_KNOWN_RULES: "QUALIFIES_FOR_KNOWN_RULES";
773
+ DOES_NOT_QUALIFY: "DOES_NOT_QUALIFY";
774
+ }>;
775
+ currency: z.ZodNullable<z.ZodString>;
776
+ savings: z.ZodNullable<z.ZodString>;
777
+ resultingTotal: z.ZodNullable<z.ZodString>;
778
+ evaluatedConditions: z.ZodArray<z.ZodObject<{
779
+ code: z.ZodString;
780
+ description: z.ZodString;
781
+ }, z.core.$strict>>;
782
+ unresolvedConditions: z.ZodArray<z.ZodObject<{
783
+ code: z.ZodString;
784
+ description: z.ZodString;
785
+ }, z.core.$strict>>;
786
+ }, z.core.$strict>;
787
+ commerce_find_qualifying_products: z.ZodObject<{
788
+ alternatives: z.ZodArray<z.ZodObject<{
789
+ product: z.ZodObject<{
790
+ productId: z.ZodString;
791
+ variantId: z.ZodString;
792
+ title: z.ZodString;
793
+ url: z.ZodNullable<z.ZodURL>;
794
+ available: z.ZodNullable<z.ZodBoolean>;
795
+ unitPrice: z.ZodNullable<z.ZodString>;
796
+ currency: z.ZodNullable<z.ZodString>;
797
+ productType: z.ZodNullable<z.ZodString>;
798
+ vendor: z.ZodNullable<z.ZodString>;
799
+ observedAt: z.ZodISODateTime;
800
+ }, z.core.$strict>;
801
+ proposal: z.ZodObject<{
802
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
803
+ kind: z.ZodLiteral<"ADD">;
804
+ variantId: z.ZodString;
805
+ quantity: z.ZodNumber;
806
+ }, z.core.$strict>, z.ZodObject<{
807
+ kind: z.ZodLiteral<"REPLACE">;
808
+ lineId: z.ZodString;
809
+ variantId: z.ZodString;
810
+ quantity: z.ZodNumber;
811
+ }, z.core.$strict>], "kind">>;
812
+ }, z.core.$strict>;
813
+ extraSpend: z.ZodNullable<z.ZodString>;
814
+ resultingTotal: z.ZodNullable<z.ZodString>;
815
+ currency: z.ZodNullable<z.ZodString>;
816
+ evidence: z.ZodNullable<z.ZodObject<{
817
+ evidenceId: z.ZodString;
818
+ turn: z.ZodObject<{
819
+ contractVersion: z.ZodLiteral<"commerce.v1">;
820
+ shopId: z.ZodString;
821
+ checkoutRecoveryId: z.ZodString;
822
+ conversationId: z.ZodString;
823
+ inboundVersion: z.ZodNumber;
824
+ }, z.core.$strict>;
825
+ grantId: z.ZodString;
826
+ releaseId: z.ZodString;
827
+ offerId: z.ZodString;
828
+ proposal: z.ZodNullable<z.ZodObject<{
829
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
830
+ kind: z.ZodLiteral<"ADD">;
831
+ variantId: z.ZodString;
832
+ quantity: z.ZodNumber;
833
+ }, z.core.$strict>, z.ZodObject<{
834
+ kind: z.ZodLiteral<"REPLACE">;
835
+ lineId: z.ZodString;
836
+ variantId: z.ZodString;
837
+ quantity: z.ZodNumber;
838
+ }, z.core.$strict>], "kind">>;
839
+ }, z.core.$strict>>;
840
+ basketFingerprint: z.ZodString;
841
+ ruleFingerprint: z.ZodString;
842
+ evaluatedAt: z.ZodISODateTime;
843
+ expiresAt: z.ZodISODateTime;
844
+ outcome: z.ZodEnum<{
845
+ UNSUPPORTED: "UNSUPPORTED";
846
+ UNKNOWN: "UNKNOWN";
847
+ QUALIFIES_FOR_KNOWN_RULES: "QUALIFIES_FOR_KNOWN_RULES";
848
+ DOES_NOT_QUALIFY: "DOES_NOT_QUALIFY";
849
+ }>;
850
+ currency: z.ZodNullable<z.ZodString>;
851
+ savings: z.ZodNullable<z.ZodString>;
852
+ resultingTotal: z.ZodNullable<z.ZodString>;
853
+ evaluatedConditions: z.ZodArray<z.ZodObject<{
854
+ code: z.ZodString;
855
+ description: z.ZodString;
856
+ }, z.core.$strict>>;
857
+ unresolvedConditions: z.ZodArray<z.ZodObject<{
858
+ code: z.ZodString;
859
+ description: z.ZodString;
860
+ }, z.core.$strict>>;
861
+ }, z.core.$strict>>;
862
+ similarityReasons: z.ZodArray<z.ZodString>;
863
+ }, z.core.$strict>>;
864
+ truncated: z.ZodBoolean;
865
+ }, z.core.$strict>;
866
+ commerce_find_similar_products: z.ZodObject<{
867
+ alternatives: z.ZodArray<z.ZodObject<{
868
+ product: z.ZodObject<{
869
+ productId: z.ZodString;
870
+ variantId: z.ZodString;
871
+ title: z.ZodString;
872
+ url: z.ZodNullable<z.ZodURL>;
873
+ available: z.ZodNullable<z.ZodBoolean>;
874
+ unitPrice: z.ZodNullable<z.ZodString>;
875
+ currency: z.ZodNullable<z.ZodString>;
876
+ productType: z.ZodNullable<z.ZodString>;
877
+ vendor: z.ZodNullable<z.ZodString>;
878
+ observedAt: z.ZodISODateTime;
879
+ }, z.core.$strict>;
880
+ proposal: z.ZodObject<{
881
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
882
+ kind: z.ZodLiteral<"ADD">;
883
+ variantId: z.ZodString;
884
+ quantity: z.ZodNumber;
885
+ }, z.core.$strict>, z.ZodObject<{
886
+ kind: z.ZodLiteral<"REPLACE">;
887
+ lineId: z.ZodString;
888
+ variantId: z.ZodString;
889
+ quantity: z.ZodNumber;
890
+ }, z.core.$strict>], "kind">>;
891
+ }, z.core.$strict>;
892
+ extraSpend: z.ZodNullable<z.ZodString>;
893
+ resultingTotal: z.ZodNullable<z.ZodString>;
894
+ currency: z.ZodNullable<z.ZodString>;
895
+ evidence: z.ZodNullable<z.ZodObject<{
896
+ evidenceId: z.ZodString;
897
+ turn: z.ZodObject<{
898
+ contractVersion: z.ZodLiteral<"commerce.v1">;
899
+ shopId: z.ZodString;
900
+ checkoutRecoveryId: z.ZodString;
901
+ conversationId: z.ZodString;
902
+ inboundVersion: z.ZodNumber;
903
+ }, z.core.$strict>;
904
+ grantId: z.ZodString;
905
+ releaseId: z.ZodString;
906
+ offerId: z.ZodString;
907
+ proposal: z.ZodNullable<z.ZodObject<{
908
+ operations: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
909
+ kind: z.ZodLiteral<"ADD">;
910
+ variantId: z.ZodString;
911
+ quantity: z.ZodNumber;
912
+ }, z.core.$strict>, z.ZodObject<{
913
+ kind: z.ZodLiteral<"REPLACE">;
914
+ lineId: z.ZodString;
915
+ variantId: z.ZodString;
916
+ quantity: z.ZodNumber;
917
+ }, z.core.$strict>], "kind">>;
918
+ }, z.core.$strict>>;
919
+ basketFingerprint: z.ZodString;
920
+ ruleFingerprint: z.ZodString;
921
+ evaluatedAt: z.ZodISODateTime;
922
+ expiresAt: z.ZodISODateTime;
923
+ outcome: z.ZodEnum<{
924
+ UNSUPPORTED: "UNSUPPORTED";
925
+ UNKNOWN: "UNKNOWN";
926
+ QUALIFIES_FOR_KNOWN_RULES: "QUALIFIES_FOR_KNOWN_RULES";
927
+ DOES_NOT_QUALIFY: "DOES_NOT_QUALIFY";
928
+ }>;
929
+ currency: z.ZodNullable<z.ZodString>;
930
+ savings: z.ZodNullable<z.ZodString>;
931
+ resultingTotal: z.ZodNullable<z.ZodString>;
932
+ evaluatedConditions: z.ZodArray<z.ZodObject<{
933
+ code: z.ZodString;
934
+ description: z.ZodString;
935
+ }, z.core.$strict>>;
936
+ unresolvedConditions: z.ZodArray<z.ZodObject<{
937
+ code: z.ZodString;
938
+ description: z.ZodString;
939
+ }, z.core.$strict>>;
940
+ }, z.core.$strict>>;
941
+ similarityReasons: z.ZodArray<z.ZodString>;
942
+ }, z.core.$strict>>;
943
+ truncated: z.ZodBoolean;
944
+ }, z.core.$strict>;
945
+ };
946
+ declare function productBelongsToDomain(product: z.infer<typeof CommerceProductSchema>, verifiedDomain: string): boolean;
947
+
948
+ declare const CommerceResponseContractSchema: z.ZodObject<{
949
+ version: z.ZodLiteral<"response.v1">;
950
+ instructions: z.ZodString;
951
+ detailsSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
952
+ }, z.core.$strict>;
953
+ type CommerceResponseContract = z.infer<typeof CommerceResponseContractSchema>;
954
+ declare const EMPTY_RESPONSE_CONTRACT: CommerceResponseContract;
955
+ declare const ReferralReasonSchema: z.ZodEnum<{
956
+ INSUFFICIENT_TOOLS: "INSUFFICIENT_TOOLS";
957
+ UNVERIFIABLE_FACTS: "UNVERIFIABLE_FACTS";
958
+ TOOL_UNAVAILABLE: "TOOL_UNAVAILABLE";
959
+ TOOL_REVOKED: "TOOL_REVOKED";
960
+ }>;
961
+ declare const CommerceFinalResponseSchema: z.ZodObject<{
962
+ answerKind: z.ZodEnum<{
963
+ ANSWER: "ANSWER";
964
+ REFER_TO_STORE: "REFER_TO_STORE";
965
+ }>;
966
+ replyText: z.ZodString;
967
+ referralReason: z.ZodNullable<z.ZodEnum<{
968
+ INSUFFICIENT_TOOLS: "INSUFFICIENT_TOOLS";
969
+ UNVERIFIABLE_FACTS: "UNVERIFIABLE_FACTS";
970
+ TOOL_UNAVAILABLE: "TOOL_UNAVAILABLE";
971
+ TOOL_REVOKED: "TOOL_REVOKED";
972
+ }>>;
973
+ detectedLanguageTag: z.ZodNullable<z.ZodString>;
974
+ detectedLanguageConfidence: z.ZodNullable<z.ZodNumber>;
975
+ evidenceIds: z.ZodArray<z.ZodString>;
976
+ details: z.ZodRecord<z.ZodString, z.ZodUnknown>;
977
+ }, z.core.$strict>;
978
+ type CommerceFinalResponse = z.infer<typeof CommerceFinalResponseSchema>;
979
+ declare function finalResponseSchema(definition: CommerceResponseContract): z.ZodObject<{
980
+ answerKind: z.ZodEnum<{
981
+ ANSWER: "ANSWER";
982
+ REFER_TO_STORE: "REFER_TO_STORE";
983
+ }>;
984
+ replyText: z.ZodString;
985
+ referralReason: z.ZodNullable<z.ZodEnum<{
986
+ INSUFFICIENT_TOOLS: "INSUFFICIENT_TOOLS";
987
+ UNVERIFIABLE_FACTS: "UNVERIFIABLE_FACTS";
988
+ TOOL_UNAVAILABLE: "TOOL_UNAVAILABLE";
989
+ TOOL_REVOKED: "TOOL_REVOKED";
990
+ }>>;
991
+ detectedLanguageTag: z.ZodNullable<z.ZodString>;
992
+ detectedLanguageConfidence: z.ZodNullable<z.ZodNumber>;
993
+ evidenceIds: z.ZodArray<z.ZodString>;
994
+ details: z.ZodRecord<z.ZodString, z.ZodUnknown>;
995
+ }, z.core.$strict>;
996
+ declare function verifyResponseContract(definition: unknown, hash: string, digest: Digest): {
997
+ version: "response.v1";
998
+ instructions: string;
999
+ detailsSchema: SubsetSchema;
1000
+ };
1001
+ /** JSON Schema branches retain the immutable envelope; only ANSWER details vary. */
1002
+ declare function finalResponseToolSchema(definition: CommerceResponseContract): Json;
1003
+
1004
+ export { ToolNameSchema as $, type CommerceToolDraftDefinition as A, CommerceToolDraftDefinitionSchema as B, type CommerceTurnIdentity as C, type Digest as D, CommerceToolIdentitySchema as E, CommerceToolInputs as F, type GrantedTool as G, CommerceToolOutputs as H, CommerceToolResultSchema as I, CommerceToolRevisionIdentitySchema as J, CommerceTurnIdentitySchema as K, DetailsSchemaSchema as L, EMPTY_RESPONSE_CONTRACT as M, GrantedToolSchema as N, GrantedToolsSchema as O, InputSchemaSchema as P, type Json as Q, MONEY_PATTERN as R, type SubsetSchema as S, type ToolDescriptor as T, POLICY_OPERATIONS as U, POLICY_OPERATION_DESCRIPTORS as V, ReferralReasonSchema as W, ResponseTemplateSchema as X, ToolBindingSchema as Y, ToolBindingsSchema as Z, ToolDescriptorSchema as _, type CommerceConversationGrant as a, canonicalJson as a0, capabilityHashInput as a1, commerceToolResultSchema as a2, compileSubset as a3, definitionToMcpDescriptor as a4, finalResponseSchema as a5, finalResponseToolSchema as a6, jsonBytes as a7, mapToolArguments as a8, matchesSubset as a9, productBelongsToDomain as aa, responseContractCanonicalJson as ab, safeName as ac, safePath as ad, toolHashInput as ae, validateDefinitionForPublication as af, validateDefinitionVersion as ag, validateSubset as ah, verifyResponseContract as ai, type CommerceManifest as b, type CommerceToolResult as c, type CommerceFinalResponse as d, type CommerceToolDefinition as e, CommerceAlternativeSchema as f, CommerceAssertionSchema as g, CommerceBasketSchema as h, CommerceConfigurationSchema as i, CommerceConversationGrantSchema as j, type CommerceDefinitionCompiler as k, CommerceErrorCodeSchema as l, type CommerceEvidence as m, CommerceEvidenceSchema as n, CommerceExecuteAssertionSchema as o, CommerceExecutionSchema as p, CommerceFinalResponseSchema as q, CommerceManifestSchema as r, CommerceOfferSchema as s, CommerceProductSchema as t, CommerceProposalSchema as u, CommerceReleaseIdentitySchema as v, CommerceResolveAssertionSchema as w, type CommerceResponseContract as x, CommerceResponseContractSchema as y, CommerceToolDefinitionSchema as z };