@modainteract/moda-interact-shared 5.4.0 → 5.6.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,746 @@
1
+ import { S as SubsetSchema, e as CommercePurposeOutputSchema, f as CommerceProductSchema } from './response-Cs4zC3d3.js';
2
+ import { z } from 'zod';
3
+
4
+ declare const ToolNameSchema: z.ZodString;
5
+ declare const CommerceExecutionPurposeSchema: z.ZodLiteral<"INITIAL_RECOVERY_OUTREACH">;
6
+ declare const CommercePurposeProfileSchema: z.ZodPipe<z.ZodObject<{
7
+ purpose: z.ZodLiteral<"INITIAL_RECOVERY_OUTREACH">;
8
+ featureId: z.ZodString;
9
+ releaseId: z.ZodString;
10
+ behaviourPrompt: z.ZodString;
11
+ capabilities: z.ZodArray<z.ZodObject<{
12
+ capabilityId: z.ZodString;
13
+ toolId: z.ZodString;
14
+ revisionId: z.ZodString;
15
+ name: z.ZodString;
16
+ position: z.ZodNumber;
17
+ inputSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
18
+ outputSchema: z.ZodCustom<CommercePurposeOutputSchema, CommercePurposeOutputSchema>;
19
+ }, z.core.$strict>>;
20
+ }, z.core.$strict>, z.ZodTransform<{
21
+ purpose: "INITIAL_RECOVERY_OUTREACH";
22
+ featureId: string;
23
+ releaseId: string;
24
+ behaviourPrompt: string;
25
+ capabilities: {
26
+ capabilityId: string;
27
+ toolId: string;
28
+ revisionId: string;
29
+ name: string;
30
+ position: number;
31
+ inputSchema: SubsetSchema;
32
+ outputSchema: CommercePurposeOutputSchema;
33
+ }[];
34
+ }, {
35
+ purpose: "INITIAL_RECOVERY_OUTREACH";
36
+ featureId: string;
37
+ releaseId: string;
38
+ behaviourPrompt: string;
39
+ capabilities: {
40
+ capabilityId: string;
41
+ toolId: string;
42
+ revisionId: string;
43
+ name: string;
44
+ position: number;
45
+ inputSchema: SubsetSchema;
46
+ outputSchema: CommercePurposeOutputSchema;
47
+ }[];
48
+ }>>;
49
+ /** New outreach callers must resolve a present validated snapshot; legacy conversation parsing remains optional. */
50
+ declare function requireCommercePurposeProfile(raw: unknown): {
51
+ purpose: "INITIAL_RECOVERY_OUTREACH";
52
+ featureId: string;
53
+ releaseId: string;
54
+ behaviourPrompt: string;
55
+ capabilities: {
56
+ capabilityId: string;
57
+ toolId: string;
58
+ revisionId: string;
59
+ name: string;
60
+ position: number;
61
+ inputSchema: SubsetSchema;
62
+ outputSchema: CommercePurposeOutputSchema;
63
+ }[];
64
+ };
65
+ type CommerceExecutionPurpose = z.infer<typeof CommerceExecutionPurposeSchema>;
66
+ type CommercePurposeProfile = z.infer<typeof CommercePurposeProfileSchema>;
67
+ declare const PublishedGrantedToolSchema: z.ZodObject<{
68
+ toolId: z.ZodString;
69
+ toolRevisionId: z.ZodString;
70
+ toolName: z.ZodString;
71
+ definitionVersion: z.ZodString;
72
+ capabilityKeys: z.ZodArray<z.ZodString>;
73
+ }, z.core.$strict>;
74
+ declare const PublishedToolDescriptorSchema: z.ZodObject<{
75
+ toolId: z.ZodString;
76
+ toolRevisionId: z.ZodString;
77
+ name: z.ZodString;
78
+ definitionVersion: z.ZodString;
79
+ description: z.ZodString;
80
+ inputSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
81
+ }, z.core.$strict>;
82
+ declare const CommerceBuiltInToolNameSchema: z.ZodEnum<{
83
+ commerce_get_discount_options: "commerce_get_discount_options";
84
+ commerce_get_discount_details: "commerce_get_discount_details";
85
+ }>;
86
+ declare const CommerceBuiltInToolGrantSchema: z.ZodObject<{
87
+ kind: z.ZodEnum<{
88
+ BUILT_IN: "BUILT_IN";
89
+ }>;
90
+ toolName: z.ZodEnum<{
91
+ commerce_get_discount_options: "commerce_get_discount_options";
92
+ commerce_get_discount_details: "commerce_get_discount_details";
93
+ }>;
94
+ definitionVersion: z.ZodEnum<{
95
+ "2.0.0": "2.0.0";
96
+ }>;
97
+ }, z.core.$strict>;
98
+ declare const CommerceBuiltInToolDescriptorSchema: z.ZodObject<{
99
+ kind: z.ZodEnum<{
100
+ BUILT_IN: "BUILT_IN";
101
+ }>;
102
+ name: z.ZodEnum<{
103
+ commerce_get_discount_options: "commerce_get_discount_options";
104
+ commerce_get_discount_details: "commerce_get_discount_details";
105
+ }>;
106
+ definitionVersion: z.ZodEnum<{
107
+ "2.0.0": "2.0.0";
108
+ }>;
109
+ description: z.ZodString;
110
+ inputSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
111
+ }, z.core.$strict>;
112
+ type PublishedGrantedTool = z.infer<typeof PublishedGrantedToolSchema>;
113
+ type PublishedToolDescriptor = z.infer<typeof PublishedToolDescriptorSchema>;
114
+ type CommerceBuiltInToolGrant = z.infer<typeof CommerceBuiltInToolGrantSchema>;
115
+ type CommerceBuiltInToolDescriptor = z.infer<typeof CommerceBuiltInToolDescriptorSchema>;
116
+ declare const GrantedToolSchema: z.ZodUnion<readonly [z.ZodObject<{
117
+ toolId: z.ZodString;
118
+ toolRevisionId: z.ZodString;
119
+ toolName: z.ZodString;
120
+ definitionVersion: z.ZodString;
121
+ capabilityKeys: z.ZodArray<z.ZodString>;
122
+ }, z.core.$strict>, z.ZodObject<{
123
+ kind: z.ZodEnum<{
124
+ BUILT_IN: "BUILT_IN";
125
+ }>;
126
+ toolName: z.ZodEnum<{
127
+ commerce_get_discount_options: "commerce_get_discount_options";
128
+ commerce_get_discount_details: "commerce_get_discount_details";
129
+ }>;
130
+ definitionVersion: z.ZodEnum<{
131
+ "2.0.0": "2.0.0";
132
+ }>;
133
+ }, z.core.$strict>]>;
134
+ declare const ToolDescriptorSchema: z.ZodUnion<readonly [z.ZodObject<{
135
+ toolId: z.ZodString;
136
+ toolRevisionId: z.ZodString;
137
+ name: z.ZodString;
138
+ definitionVersion: z.ZodString;
139
+ description: z.ZodString;
140
+ inputSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
141
+ }, z.core.$strict>, z.ZodObject<{
142
+ kind: z.ZodEnum<{
143
+ BUILT_IN: "BUILT_IN";
144
+ }>;
145
+ name: z.ZodEnum<{
146
+ commerce_get_discount_options: "commerce_get_discount_options";
147
+ commerce_get_discount_details: "commerce_get_discount_details";
148
+ }>;
149
+ definitionVersion: z.ZodEnum<{
150
+ "2.0.0": "2.0.0";
151
+ }>;
152
+ description: z.ZodString;
153
+ inputSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
154
+ }, z.core.$strict>]>;
155
+ declare const GrantedToolsSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
156
+ toolId: z.ZodString;
157
+ toolRevisionId: z.ZodString;
158
+ toolName: z.ZodString;
159
+ definitionVersion: z.ZodString;
160
+ capabilityKeys: z.ZodArray<z.ZodString>;
161
+ }, z.core.$strict>, z.ZodObject<{
162
+ kind: z.ZodEnum<{
163
+ BUILT_IN: "BUILT_IN";
164
+ }>;
165
+ toolName: z.ZodEnum<{
166
+ commerce_get_discount_options: "commerce_get_discount_options";
167
+ commerce_get_discount_details: "commerce_get_discount_details";
168
+ }>;
169
+ definitionVersion: z.ZodEnum<{
170
+ "2.0.0": "2.0.0";
171
+ }>;
172
+ }, z.core.$strict>]>>;
173
+ declare const isBuiltInTool: <T extends GrantedTool | ToolDescriptor>(value: T) => value is Extract<T, {
174
+ kind: "BUILT_IN";
175
+ }>;
176
+ declare const POLICY_OPERATIONS: readonly ["taxonomy.resolveCategories", "products.search", "products.get", "shipping.getInformation", "recovery.getBasket", "shopify.searchProducts", "discounts.getOptions", "discounts.getDetails", "discounts.evaluate", "products.findQualifying", "products.findSimilar"];
177
+ declare const ExternalHttpExecutionSchema: z.ZodObject<{
178
+ kind: z.ZodLiteral<"EXTERNAL_HTTP">;
179
+ executorVersion: z.ZodLiteral<"1.0.0">;
180
+ connectionRevisionId: z.ZodString;
181
+ method: z.ZodLiteral<"GET">;
182
+ path: z.ZodString;
183
+ query: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
184
+ input: z.ZodString;
185
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
186
+ }, z.core.$strict>, z.ZodObject<{
187
+ literal: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
188
+ }, z.core.$strict>]>>;
189
+ responseFormat: z.ZodObject<{
190
+ mode: z.ZodEnum<{
191
+ JSON: "JSON";
192
+ TEXT: "TEXT";
193
+ }>;
194
+ mediaTypes: z.ZodArray<z.ZodString>;
195
+ }, z.core.$strict>;
196
+ resultPath: z.ZodString;
197
+ responseProcessing: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
198
+ kind: z.ZodLiteral<"OBJECT">;
199
+ fields: z.ZodRecord<z.ZodString, z.ZodObject<{
200
+ path: z.ZodString;
201
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
202
+ }, z.core.$strict>>;
203
+ }, z.core.$strict>, z.ZodObject<{
204
+ kind: z.ZodLiteral<"LIST">;
205
+ fields: z.ZodRecord<z.ZodString, z.ZodObject<{
206
+ path: z.ZodString;
207
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
208
+ }, z.core.$strict>>;
209
+ filters: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
210
+ path: z.ZodString;
211
+ op: z.ZodEnum<{
212
+ GT: "GT";
213
+ LT: "LT";
214
+ NE: "NE";
215
+ EQ: "EQ";
216
+ GTE: "GTE";
217
+ LTE: "LTE";
218
+ CONTAINS: "CONTAINS";
219
+ STARTS_WITH: "STARTS_WITH";
220
+ }>;
221
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodNull]>;
222
+ }, z.core.$strict>, z.ZodObject<{
223
+ path: z.ZodString;
224
+ op: z.ZodLiteral<"IN">;
225
+ values: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodNull]>>;
226
+ }, z.core.$strict>], "op">>;
227
+ sort: z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
228
+ path: z.ZodString;
229
+ direction: z.ZodEnum<{
230
+ ASC: "ASC";
231
+ DESC: "DESC";
232
+ }>;
233
+ }, z.core.$strict>]>;
234
+ limit: z.ZodInt;
235
+ }, z.core.$strict>]>, z.ZodObject<{
236
+ kind: z.ZodLiteral<"JAVASCRIPT">;
237
+ runtimeVersion: z.ZodLiteral<"quickjs-sync.v1">;
238
+ source: z.ZodString;
239
+ }, z.core.$strict>]>;
240
+ resultSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
241
+ }, z.core.$strict>;
242
+ declare const CommerceExecutionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
243
+ kind: z.ZodLiteral<"SHOPIFY_STOREFRONT_QUERY">;
244
+ executorVersion: z.ZodLiteral<"1.0.0">;
245
+ apiVersion: z.ZodLiteral<"2026-07">;
246
+ schemaHash: z.ZodString;
247
+ document: z.ZodString;
248
+ operationName: z.ZodString;
249
+ variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
250
+ input: z.ZodString;
251
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
252
+ }, z.core.$strict>, z.ZodObject<{
253
+ literal: z.ZodUnknown;
254
+ }, z.core.$strict>]>>;
255
+ resultPath: z.ZodString;
256
+ }, z.core.$strict>, z.ZodObject<{
257
+ kind: z.ZodLiteral<"POLICY_OPERATION">;
258
+ operation: z.ZodEnum<{
259
+ "taxonomy.resolveCategories": "taxonomy.resolveCategories";
260
+ "products.search": "products.search";
261
+ "products.get": "products.get";
262
+ "shipping.getInformation": "shipping.getInformation";
263
+ "recovery.getBasket": "recovery.getBasket";
264
+ "shopify.searchProducts": "shopify.searchProducts";
265
+ "discounts.getOptions": "discounts.getOptions";
266
+ "discounts.getDetails": "discounts.getDetails";
267
+ "discounts.evaluate": "discounts.evaluate";
268
+ "products.findQualifying": "products.findQualifying";
269
+ "products.findSimilar": "products.findSimilar";
270
+ }>;
271
+ operationVersion: z.ZodLiteral<"1.0.0">;
272
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
273
+ input: z.ZodString;
274
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
275
+ }, z.core.$strict>, z.ZodObject<{
276
+ literal: z.ZodUnknown;
277
+ }, z.core.$strict>]>>;
278
+ }, z.core.$strict>, z.ZodObject<{
279
+ kind: z.ZodLiteral<"EXTERNAL_HTTP">;
280
+ executorVersion: z.ZodLiteral<"1.0.0">;
281
+ connectionRevisionId: z.ZodString;
282
+ method: z.ZodLiteral<"GET">;
283
+ path: z.ZodString;
284
+ query: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
285
+ input: z.ZodString;
286
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
287
+ }, z.core.$strict>, z.ZodObject<{
288
+ literal: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
289
+ }, z.core.$strict>]>>;
290
+ responseFormat: z.ZodObject<{
291
+ mode: z.ZodEnum<{
292
+ JSON: "JSON";
293
+ TEXT: "TEXT";
294
+ }>;
295
+ mediaTypes: z.ZodArray<z.ZodString>;
296
+ }, z.core.$strict>;
297
+ resultPath: z.ZodString;
298
+ responseProcessing: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
299
+ kind: z.ZodLiteral<"OBJECT">;
300
+ fields: z.ZodRecord<z.ZodString, z.ZodObject<{
301
+ path: z.ZodString;
302
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
303
+ }, z.core.$strict>>;
304
+ }, z.core.$strict>, z.ZodObject<{
305
+ kind: z.ZodLiteral<"LIST">;
306
+ fields: z.ZodRecord<z.ZodString, z.ZodObject<{
307
+ path: z.ZodString;
308
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
309
+ }, z.core.$strict>>;
310
+ filters: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
311
+ path: z.ZodString;
312
+ op: z.ZodEnum<{
313
+ GT: "GT";
314
+ LT: "LT";
315
+ NE: "NE";
316
+ EQ: "EQ";
317
+ GTE: "GTE";
318
+ LTE: "LTE";
319
+ CONTAINS: "CONTAINS";
320
+ STARTS_WITH: "STARTS_WITH";
321
+ }>;
322
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodNull]>;
323
+ }, z.core.$strict>, z.ZodObject<{
324
+ path: z.ZodString;
325
+ op: z.ZodLiteral<"IN">;
326
+ values: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodNull]>>;
327
+ }, z.core.$strict>], "op">>;
328
+ sort: z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
329
+ path: z.ZodString;
330
+ direction: z.ZodEnum<{
331
+ ASC: "ASC";
332
+ DESC: "DESC";
333
+ }>;
334
+ }, z.core.$strict>]>;
335
+ limit: z.ZodInt;
336
+ }, z.core.$strict>]>, z.ZodObject<{
337
+ kind: z.ZodLiteral<"JAVASCRIPT">;
338
+ runtimeVersion: z.ZodLiteral<"quickjs-sync.v1">;
339
+ source: z.ZodString;
340
+ }, z.core.$strict>]>;
341
+ resultSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
342
+ }, z.core.$strict>], "kind">;
343
+ type ExternalHttpExecution = Extract<z.infer<typeof CommerceExecutionSchema>, {
344
+ kind: "EXTERNAL_HTTP";
345
+ }>;
346
+ declare const ResponseTemplateSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
347
+ kind: z.ZodLiteral<"text">;
348
+ text: z.ZodString;
349
+ unavailable: z.ZodString;
350
+ }, z.core.$strict>, z.ZodObject<{
351
+ kind: z.ZodLiteral<"items">;
352
+ itemsPath: z.ZodString;
353
+ item: z.ZodString;
354
+ empty: z.ZodString;
355
+ unavailable: z.ZodString;
356
+ }, z.core.$strict>], "kind">;
357
+ declare const CommerceToolDefinitionSchema: z.ZodObject<{
358
+ inputSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
359
+ execution: z.ZodDiscriminatedUnion<[z.ZodObject<{
360
+ kind: z.ZodLiteral<"SHOPIFY_STOREFRONT_QUERY">;
361
+ executorVersion: z.ZodLiteral<"1.0.0">;
362
+ apiVersion: z.ZodLiteral<"2026-07">;
363
+ schemaHash: z.ZodString;
364
+ document: z.ZodString;
365
+ operationName: z.ZodString;
366
+ variables: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
367
+ input: z.ZodString;
368
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
369
+ }, z.core.$strict>, z.ZodObject<{
370
+ literal: z.ZodUnknown;
371
+ }, z.core.$strict>]>>;
372
+ resultPath: z.ZodString;
373
+ }, z.core.$strict>, z.ZodObject<{
374
+ kind: z.ZodLiteral<"POLICY_OPERATION">;
375
+ operation: z.ZodEnum<{
376
+ "taxonomy.resolveCategories": "taxonomy.resolveCategories";
377
+ "products.search": "products.search";
378
+ "products.get": "products.get";
379
+ "shipping.getInformation": "shipping.getInformation";
380
+ "recovery.getBasket": "recovery.getBasket";
381
+ "shopify.searchProducts": "shopify.searchProducts";
382
+ "discounts.getOptions": "discounts.getOptions";
383
+ "discounts.getDetails": "discounts.getDetails";
384
+ "discounts.evaluate": "discounts.evaluate";
385
+ "products.findQualifying": "products.findQualifying";
386
+ "products.findSimilar": "products.findSimilar";
387
+ }>;
388
+ operationVersion: z.ZodLiteral<"1.0.0">;
389
+ arguments: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
390
+ input: z.ZodString;
391
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
392
+ }, z.core.$strict>, z.ZodObject<{
393
+ literal: z.ZodUnknown;
394
+ }, z.core.$strict>]>>;
395
+ }, z.core.$strict>, z.ZodObject<{
396
+ kind: z.ZodLiteral<"EXTERNAL_HTTP">;
397
+ executorVersion: z.ZodLiteral<"1.0.0">;
398
+ connectionRevisionId: z.ZodString;
399
+ method: z.ZodLiteral<"GET">;
400
+ path: z.ZodString;
401
+ query: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
402
+ input: z.ZodString;
403
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
404
+ }, z.core.$strict>, z.ZodObject<{
405
+ literal: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
406
+ }, z.core.$strict>]>>;
407
+ responseFormat: z.ZodObject<{
408
+ mode: z.ZodEnum<{
409
+ JSON: "JSON";
410
+ TEXT: "TEXT";
411
+ }>;
412
+ mediaTypes: z.ZodArray<z.ZodString>;
413
+ }, z.core.$strict>;
414
+ resultPath: z.ZodString;
415
+ responseProcessing: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
416
+ kind: z.ZodLiteral<"OBJECT">;
417
+ fields: z.ZodRecord<z.ZodString, z.ZodObject<{
418
+ path: z.ZodString;
419
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
420
+ }, z.core.$strict>>;
421
+ }, z.core.$strict>, z.ZodObject<{
422
+ kind: z.ZodLiteral<"LIST">;
423
+ fields: z.ZodRecord<z.ZodString, z.ZodObject<{
424
+ path: z.ZodString;
425
+ omitIfMissing: z.ZodOptional<z.ZodLiteral<true>>;
426
+ }, z.core.$strict>>;
427
+ filters: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
428
+ path: z.ZodString;
429
+ op: z.ZodEnum<{
430
+ GT: "GT";
431
+ LT: "LT";
432
+ NE: "NE";
433
+ EQ: "EQ";
434
+ GTE: "GTE";
435
+ LTE: "LTE";
436
+ CONTAINS: "CONTAINS";
437
+ STARTS_WITH: "STARTS_WITH";
438
+ }>;
439
+ value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodNull]>;
440
+ }, z.core.$strict>, z.ZodObject<{
441
+ path: z.ZodString;
442
+ op: z.ZodLiteral<"IN">;
443
+ values: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodNull]>>;
444
+ }, z.core.$strict>], "op">>;
445
+ sort: z.ZodUnion<readonly [z.ZodNull, z.ZodObject<{
446
+ path: z.ZodString;
447
+ direction: z.ZodEnum<{
448
+ ASC: "ASC";
449
+ DESC: "DESC";
450
+ }>;
451
+ }, z.core.$strict>]>;
452
+ limit: z.ZodInt;
453
+ }, z.core.$strict>]>, z.ZodObject<{
454
+ kind: z.ZodLiteral<"JAVASCRIPT">;
455
+ runtimeVersion: z.ZodLiteral<"quickjs-sync.v1">;
456
+ source: z.ZodString;
457
+ }, z.core.$strict>]>;
458
+ resultSchema: z.ZodCustom<SubsetSchema, SubsetSchema>;
459
+ }, z.core.$strict>], "kind">;
460
+ responseTemplate: z.ZodDiscriminatedUnion<[z.ZodObject<{
461
+ kind: z.ZodLiteral<"text">;
462
+ text: z.ZodString;
463
+ unavailable: z.ZodString;
464
+ }, z.core.$strict>, z.ZodObject<{
465
+ kind: z.ZodLiteral<"items">;
466
+ itemsPath: z.ZodString;
467
+ item: z.ZodString;
468
+ empty: z.ZodString;
469
+ unavailable: z.ZodString;
470
+ }, z.core.$strict>], "kind">;
471
+ name: z.ZodString;
472
+ definitionVersion: z.ZodString;
473
+ description: z.ZodString;
474
+ }, z.core.$strict>;
475
+ declare const CommerceToolDraftDefinitionSchema: z.ZodObject<{
476
+ inputSchema: z.ZodUnknown;
477
+ execution: z.ZodUnknown;
478
+ responseTemplate: z.ZodUnknown;
479
+ name: z.ZodString;
480
+ definitionVersion: z.ZodString;
481
+ description: z.ZodString;
482
+ }, z.core.$strict>;
483
+ type CommerceToolDefinition = z.infer<typeof CommerceToolDefinitionSchema>;
484
+ type CommerceToolDraftDefinition = z.infer<typeof CommerceToolDraftDefinitionSchema>;
485
+ type GrantedTool = z.infer<typeof GrantedToolSchema>;
486
+ type ToolDescriptor = z.infer<typeof ToolDescriptorSchema>;
487
+ /** Commerce owns schema-backed GraphQL parsing, restrictions and output derivation. */
488
+ interface CommerceDefinitionCompiler {
489
+ compile(execution: CommerceToolDefinition["execution"], input: SubsetSchema): {
490
+ outputSchema: SubsetSchema;
491
+ validateMappedArguments: (mapping: CommerceToolDefinition["execution"]) => boolean;
492
+ };
493
+ }
494
+ declare function validateDefinitionForPublication(raw: unknown, compiler: CommerceDefinitionCompiler): {
495
+ inputSchema: SubsetSchema;
496
+ execution: {
497
+ kind: "EXTERNAL_HTTP";
498
+ executorVersion: "1.0.0";
499
+ connectionRevisionId: string;
500
+ method: "GET";
501
+ path: string;
502
+ query: Record<string, {
503
+ input: string;
504
+ omitIfMissing?: true | undefined;
505
+ } | {
506
+ literal: string | number | boolean;
507
+ }>;
508
+ responseFormat: {
509
+ mode: "JSON" | "TEXT";
510
+ mediaTypes: string[];
511
+ };
512
+ resultPath: string;
513
+ responseProcessing: {
514
+ kind: "OBJECT";
515
+ fields: Record<string, {
516
+ path: string;
517
+ omitIfMissing?: true | undefined;
518
+ }>;
519
+ } | {
520
+ kind: "LIST";
521
+ fields: Record<string, {
522
+ path: string;
523
+ omitIfMissing?: true | undefined;
524
+ }>;
525
+ filters: ({
526
+ path: string;
527
+ op: "GT" | "LT" | "NE" | "EQ" | "GTE" | "LTE" | "CONTAINS" | "STARTS_WITH";
528
+ value: string | number | boolean | null;
529
+ } | {
530
+ path: string;
531
+ op: "IN";
532
+ values: (string | number | boolean | null)[];
533
+ })[];
534
+ sort: {
535
+ path: string;
536
+ direction: "ASC" | "DESC";
537
+ } | null;
538
+ limit: number;
539
+ } | {
540
+ kind: "JAVASCRIPT";
541
+ runtimeVersion: "quickjs-sync.v1";
542
+ source: string;
543
+ };
544
+ resultSchema: SubsetSchema;
545
+ } | {
546
+ kind: "SHOPIFY_STOREFRONT_QUERY";
547
+ executorVersion: "1.0.0";
548
+ apiVersion: "2026-07";
549
+ schemaHash: string;
550
+ document: string;
551
+ operationName: string;
552
+ variables: Record<string, {
553
+ input: string;
554
+ omitIfMissing?: true | undefined;
555
+ } | {
556
+ literal: unknown;
557
+ }>;
558
+ resultPath: string;
559
+ } | {
560
+ kind: "POLICY_OPERATION";
561
+ operation: "taxonomy.resolveCategories" | "products.search" | "products.get" | "shipping.getInformation" | "recovery.getBasket" | "shopify.searchProducts" | "discounts.getOptions" | "discounts.getDetails" | "discounts.evaluate" | "products.findQualifying" | "products.findSimilar";
562
+ operationVersion: "1.0.0";
563
+ arguments: Record<string, {
564
+ input: string;
565
+ omitIfMissing?: true | undefined;
566
+ } | {
567
+ literal: unknown;
568
+ }>;
569
+ };
570
+ responseTemplate: {
571
+ kind: "text";
572
+ text: string;
573
+ unavailable: string;
574
+ } | {
575
+ kind: "items";
576
+ itemsPath: string;
577
+ item: string;
578
+ empty: string;
579
+ unavailable: string;
580
+ };
581
+ name: string;
582
+ definitionVersion: string;
583
+ description: string;
584
+ };
585
+ declare function definitionToMcpDescriptor(definition: CommerceToolDefinition): {
586
+ name: string;
587
+ description: string;
588
+ inputSchema: SubsetSchema;
589
+ };
590
+ declare function mapToolArguments(definition: CommerceToolDefinition, raw: unknown): Record<string, unknown>;
591
+ declare const toolHashInput: (definition: CommerceToolDefinition) => {
592
+ contractVersion: "commerce.v1";
593
+ definition: {
594
+ inputSchema: SubsetSchema;
595
+ execution: {
596
+ kind: "EXTERNAL_HTTP";
597
+ executorVersion: "1.0.0";
598
+ connectionRevisionId: string;
599
+ method: "GET";
600
+ path: string;
601
+ query: Record<string, {
602
+ input: string;
603
+ omitIfMissing?: true | undefined;
604
+ } | {
605
+ literal: string | number | boolean;
606
+ }>;
607
+ responseFormat: {
608
+ mode: "JSON" | "TEXT";
609
+ mediaTypes: string[];
610
+ };
611
+ resultPath: string;
612
+ responseProcessing: {
613
+ kind: "OBJECT";
614
+ fields: Record<string, {
615
+ path: string;
616
+ omitIfMissing?: true | undefined;
617
+ }>;
618
+ } | {
619
+ kind: "LIST";
620
+ fields: Record<string, {
621
+ path: string;
622
+ omitIfMissing?: true | undefined;
623
+ }>;
624
+ filters: ({
625
+ path: string;
626
+ op: "GT" | "LT" | "NE" | "EQ" | "GTE" | "LTE" | "CONTAINS" | "STARTS_WITH";
627
+ value: string | number | boolean | null;
628
+ } | {
629
+ path: string;
630
+ op: "IN";
631
+ values: (string | number | boolean | null)[];
632
+ })[];
633
+ sort: {
634
+ path: string;
635
+ direction: "ASC" | "DESC";
636
+ } | null;
637
+ limit: number;
638
+ } | {
639
+ kind: "JAVASCRIPT";
640
+ runtimeVersion: "quickjs-sync.v1";
641
+ source: string;
642
+ };
643
+ resultSchema: SubsetSchema;
644
+ } | {
645
+ kind: "SHOPIFY_STOREFRONT_QUERY";
646
+ executorVersion: "1.0.0";
647
+ apiVersion: "2026-07";
648
+ schemaHash: string;
649
+ document: string;
650
+ operationName: string;
651
+ variables: Record<string, {
652
+ input: string;
653
+ omitIfMissing?: true | undefined;
654
+ } | {
655
+ literal: unknown;
656
+ }>;
657
+ resultPath: string;
658
+ } | {
659
+ kind: "POLICY_OPERATION";
660
+ operation: "taxonomy.resolveCategories" | "products.search" | "products.get" | "shipping.getInformation" | "recovery.getBasket" | "shopify.searchProducts" | "discounts.getOptions" | "discounts.getDetails" | "discounts.evaluate" | "products.findQualifying" | "products.findSimilar";
661
+ operationVersion: "1.0.0";
662
+ arguments: Record<string, {
663
+ input: string;
664
+ omitIfMissing?: true | undefined;
665
+ } | {
666
+ literal: unknown;
667
+ }>;
668
+ };
669
+ responseTemplate: {
670
+ kind: "text";
671
+ text: string;
672
+ unavailable: string;
673
+ } | {
674
+ kind: "items";
675
+ itemsPath: string;
676
+ item: string;
677
+ empty: string;
678
+ unavailable: string;
679
+ };
680
+ name: string;
681
+ definitionVersion: string;
682
+ description: string;
683
+ };
684
+ };
685
+ /** Publication adapters supply the actual highest published version from persistence. */
686
+ declare function validateDefinitionVersion(proposed: string, highestPublished: string | null): boolean;
687
+ declare const CommerceToolIdentitySchema: z.ZodObject<{
688
+ id: z.ZodString;
689
+ name: z.ZodString;
690
+ enabled: z.ZodBoolean;
691
+ }, z.core.$strict>;
692
+ declare const CommerceToolRevisionIdentitySchema: z.ZodObject<{
693
+ toolId: z.ZodString;
694
+ toolRevisionId: z.ZodString;
695
+ definitionVersion: z.ZodString;
696
+ contentHash: z.ZodString;
697
+ }, z.core.$strict>;
698
+ declare const POLICY_OPERATION_DESCRIPTORS: {
699
+ operation: "taxonomy.resolveCategories" | "products.search" | "products.get" | "shipping.getInformation" | "recovery.getBasket" | "shopify.searchProducts" | "discounts.getOptions" | "discounts.getDetails" | "discounts.evaluate" | "products.findQualifying" | "products.findSimilar";
700
+ operationVersion: "1.0.0";
701
+ }[];
702
+
703
+ declare const CommerceConversationProductContextSchema: z.ZodObject<{
704
+ schemaVersion: z.ZodLiteral<1>;
705
+ shopId: z.ZodString;
706
+ conversationId: z.ZodString;
707
+ platform: z.ZodEnum<{
708
+ SHOPIFY: "SHOPIFY";
709
+ WOOCOMMERCE: "WOOCOMMERCE";
710
+ }>;
711
+ references: z.ZodArray<z.ZodObject<{
712
+ productId: z.ZodString;
713
+ variantId: z.ZodNullable<z.ZodString>;
714
+ title: z.ZodString;
715
+ observedAt: z.ZodISODateTime;
716
+ }, z.core.$strict>>;
717
+ updatedAt: z.ZodISODateTime;
718
+ }, z.core.$strict>;
719
+ type CommerceConversationProductContext = z.infer<typeof CommerceConversationProductContextSchema>;
720
+ type CommerceProductObservation = {
721
+ toolName: string;
722
+ products: z.infer<typeof CommerceProductSchema>[];
723
+ observedAt: string;
724
+ };
725
+ type CommerceProductContextIdentity = {
726
+ shopId: string;
727
+ conversationId: string;
728
+ platform: "SHOPIFY" | "WOOCOMMERCE";
729
+ now: number;
730
+ };
731
+ declare function mergeConversationProductContext(previous: CommerceConversationProductContext | null, observations: readonly CommerceProductObservation[], identity: CommerceProductContextIdentity): CommerceConversationProductContext;
732
+ declare function resolveConversationProductReference(context: CommerceConversationProductContext, reference: {
733
+ productId?: string;
734
+ variantId?: string | null;
735
+ title?: string;
736
+ }): {
737
+ kind: "MATCH";
738
+ productId: string;
739
+ variantId: string | null;
740
+ } | {
741
+ kind: "AMBIGUOUS";
742
+ } | {
743
+ kind: "MISSING";
744
+ };
745
+
746
+ export { PublishedGrantedToolSchema as A, PublishedToolDescriptorSchema as B, type CommerceExecutionPurpose as C, ToolDescriptorSchema as D, type ExternalHttpExecution as E, ToolNameSchema as F, type GrantedTool as G, definitionToMcpDescriptor as H, isBuiltInTool as I, mapToolArguments as J, mergeConversationProductContext as K, requireCommercePurposeProfile as L, resolveConversationProductReference as M, toolHashInput as N, validateDefinitionForPublication as O, type PublishedToolDescriptor as P, validateDefinitionVersion as Q, ResponseTemplateSchema as R, type ToolDescriptor as T, type CommerceConversationProductContext as a, type CommerceBuiltInToolDescriptor as b, type CommerceToolDefinition as c, type CommerceBuiltInToolGrant as d, CommerceBuiltInToolDescriptorSchema as e, CommerceBuiltInToolGrantSchema as f, CommerceBuiltInToolNameSchema as g, CommerceConversationProductContextSchema as h, type CommerceDefinitionCompiler as i, CommerceExecutionPurposeSchema as j, CommerceExecutionSchema as k, type CommerceProductContextIdentity as l, type CommerceProductObservation as m, type CommercePurposeProfile as n, CommercePurposeProfileSchema as o, CommerceToolDefinitionSchema as p, type CommerceToolDraftDefinition as q, CommerceToolDraftDefinitionSchema as r, CommerceToolIdentitySchema as s, CommerceToolRevisionIdentitySchema as t, ExternalHttpExecutionSchema as u, GrantedToolSchema as v, GrantedToolsSchema as w, POLICY_OPERATIONS as x, POLICY_OPERATION_DESCRIPTORS as y, type PublishedGrantedTool as z };