@omnixhq/ucp-js-sdk 1.0.1 → 1.0.2

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.
package/dist/index.cjs CHANGED
@@ -185,7 +185,7 @@ const BuyerConsentBuyerSchema = zod.intersection(zod.object({
185
185
  "last_name": zod.string().describe("Last name of the buyer.").optional(),
186
186
  "email": zod.string().describe("Email of the buyer.").optional(),
187
187
  "phone_number": zod.string().describe("E.164 standard.").optional()
188
- }), zod.object({ "consent": zod.object({
188
+ }).passthrough(), zod.object({ "consent": zod.object({
189
189
  "analytics": zod.boolean().describe("Consent for analytics and performance tracking.").optional(),
190
190
  "preferences": zod.boolean().describe("Consent for storing user preferences.").optional(),
191
191
  "marketing": zod.boolean().describe("Consent for marketing communications.").optional(),
@@ -292,12 +292,12 @@ const CheckoutSchema = zod.object({
292
292
  "last_name": zod.string().describe("Last name of the buyer.").optional(),
293
293
  "email": zod.string().describe("Email of the buyer.").optional(),
294
294
  "phone_number": zod.string().describe("E.164 standard.").optional()
295
- }).describe("Representation of the buyer.").optional(),
295
+ }).passthrough().describe("Representation of the buyer.").optional(),
296
296
  "context": zod.object({
297
297
  "address_country": zod.string().describe("The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example \"US\". For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as \"SGP\" or a full country name such as \"Singapore\" can also be used. Optional hint for market context (currency, availability, pricing)—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
298
298
  "address_region": zod.string().describe("The region in which the locality is, and which is in the country. For example, California or another appropriate first-level Administrative division. Optional hint for progressive localization—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
299
299
  "postal_code": zod.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional()
300
- }).describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.").optional(),
300
+ }).passthrough().describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.").optional(),
301
301
  "status": zod.enum([
302
302
  "incomplete",
303
303
  "requires_escalation",
@@ -384,14 +384,14 @@ const CheckoutSchema = zod.object({
384
384
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
385
385
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
386
386
  }).describe("The billing address associated with this payment method.").optional(),
387
- "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
387
+ "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).passthrough().describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
388
388
  "display": zod.record(zod.string(), zod.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
389
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({ "selected": zod.boolean().describe("Whether this instrument is selected by the user.").optional() })).describe("A payment instrument with selection state.")).describe("The payment instruments available for this payment. Each instrument is associated with a specific handler via the handler_id field. Handlers can extend the base payment_instrument schema to add handler-specific fields.").optional() }).describe("Payment configuration containing handlers.").optional(),
389
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({ "selected": zod.boolean().describe("Whether this instrument is selected by the user.").optional() })).describe("A payment instrument with selection state.")).describe("The payment instruments available for this payment. Each instrument is associated with a specific handler via the handler_id field. Handlers can extend the base payment_instrument schema to add handler-specific fields.").optional() }).describe("Payment configuration containing handlers.").optional(),
390
390
  "order": zod.object({
391
391
  "id": zod.string().describe("Unique order identifier."),
392
392
  "permalink_url": zod.string().url().describe("Permalink to access the order on merchant site.")
393
393
  }).describe("Details about an order created for this checkout session.").optional()
394
- }).describe("Base checkout schema. Extensions compose onto this using allOf.");
394
+ }).passthrough().describe("Base checkout schema. Extensions compose onto this using allOf.");
395
395
  const CheckoutCreateRequestSchema = zod.object({
396
396
  "line_items": zod.array(zod.object({
397
397
  "id": zod.string(),
@@ -422,12 +422,12 @@ const CheckoutCreateRequestSchema = zod.object({
422
422
  "last_name": zod.string().describe("Last name of the buyer.").optional(),
423
423
  "email": zod.string().describe("Email of the buyer.").optional(),
424
424
  "phone_number": zod.string().describe("E.164 standard.").optional()
425
- }).describe("Representation of the buyer.").optional(),
425
+ }).passthrough().describe("Representation of the buyer.").optional(),
426
426
  "context": zod.object({
427
427
  "address_country": zod.string().describe("The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example \"US\". For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as \"SGP\" or a full country name such as \"Singapore\" can also be used. Optional hint for market context (currency, availability, pricing)—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
428
428
  "address_region": zod.string().describe("The region in which the locality is, and which is in the country. For example, California or another appropriate first-level Administrative division. Optional hint for progressive localization—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
429
429
  "postal_code": zod.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional()
430
- }).describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.").optional(),
430
+ }).passthrough().describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.").optional(),
431
431
  "payment": zod.object({ "instruments": zod.array(zod.intersection(zod.object({
432
432
  "id": zod.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
433
433
  "handler_id": zod.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
@@ -443,9 +443,9 @@ const CheckoutCreateRequestSchema = zod.object({
443
443
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
444
444
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
445
445
  }).describe("The billing address associated with this payment method.").optional(),
446
- "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
446
+ "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).passthrough().describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
447
447
  "display": zod.record(zod.string(), zod.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
448
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({ "selected": zod.boolean().describe("Whether this instrument is selected by the user.").optional() })).describe("A payment instrument with selection state.")).describe("The payment instruments available for this payment. Each instrument is associated with a specific handler via the handler_id field. Handlers can extend the base payment_instrument schema to add handler-specific fields.").optional() }).describe("Payment configuration containing handlers.").optional()
448
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({ "selected": zod.boolean().describe("Whether this instrument is selected by the user.").optional() })).describe("A payment instrument with selection state.")).describe("The payment instruments available for this payment. Each instrument is associated with a specific handler via the handler_id field. Handlers can extend the base payment_instrument schema to add handler-specific fields.").optional() }).describe("Payment configuration containing handlers.").optional()
449
449
  }).strict();
450
450
  const CheckoutUpdateRequestSchema = zod.object({
451
451
  "id": zod.string().describe("Unique identifier of the checkout session."),
@@ -478,12 +478,12 @@ const CheckoutUpdateRequestSchema = zod.object({
478
478
  "last_name": zod.string().describe("Last name of the buyer.").optional(),
479
479
  "email": zod.string().describe("Email of the buyer.").optional(),
480
480
  "phone_number": zod.string().describe("E.164 standard.").optional()
481
- }).describe("Representation of the buyer.").optional(),
481
+ }).passthrough().describe("Representation of the buyer.").optional(),
482
482
  "context": zod.object({
483
483
  "address_country": zod.string().describe("The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example \"US\". For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as \"SGP\" or a full country name such as \"Singapore\" can also be used. Optional hint for market context (currency, availability, pricing)—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
484
484
  "address_region": zod.string().describe("The region in which the locality is, and which is in the country. For example, California or another appropriate first-level Administrative division. Optional hint for progressive localization—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
485
485
  "postal_code": zod.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional()
486
- }).describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.").optional(),
486
+ }).passthrough().describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.").optional(),
487
487
  "payment": zod.object({ "instruments": zod.array(zod.intersection(zod.object({
488
488
  "id": zod.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
489
489
  "handler_id": zod.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
@@ -499,9 +499,9 @@ const CheckoutUpdateRequestSchema = zod.object({
499
499
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
500
500
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
501
501
  }).describe("The billing address associated with this payment method.").optional(),
502
- "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
502
+ "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).passthrough().describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
503
503
  "display": zod.record(zod.string(), zod.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
504
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({ "selected": zod.boolean().describe("Whether this instrument is selected by the user.").optional() })).describe("A payment instrument with selection state.")).describe("The payment instruments available for this payment. Each instrument is associated with a specific handler via the handler_id field. Handlers can extend the base payment_instrument schema to add handler-specific fields.").optional() }).describe("Payment configuration containing handlers.").optional()
504
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({ "selected": zod.boolean().describe("Whether this instrument is selected by the user.").optional() })).describe("A payment instrument with selection state.")).describe("The payment instruments available for this payment. Each instrument is associated with a specific handler via the handler_id field. Handlers can extend the base payment_instrument schema to add handler-specific fields.").optional() }).describe("Payment configuration containing handlers.").optional()
505
505
  }).strict();
506
506
  const CheckoutCompleteRequestSchema = zod.object({ "payment": zod.object({ "instruments": zod.array(zod.intersection(zod.object({
507
507
  "id": zod.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
@@ -518,9 +518,9 @@ const CheckoutCompleteRequestSchema = zod.object({ "payment": zod.object({ "inst
518
518
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
519
519
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
520
520
  }).describe("The billing address associated with this payment method.").optional(),
521
- "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
521
+ "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).passthrough().describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
522
522
  "display": zod.record(zod.string(), zod.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
523
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({ "selected": zod.boolean().describe("Whether this instrument is selected by the user.").optional() })).describe("A payment instrument with selection state.")).describe("The payment instruments available for this payment. Each instrument is associated with a specific handler via the handler_id field. Handlers can extend the base payment_instrument schema to add handler-specific fields.").optional() }).describe("Payment configuration containing handlers.") }).strict();
523
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({ "selected": zod.boolean().describe("Whether this instrument is selected by the user.").optional() })).describe("A payment instrument with selection state.")).describe("The payment instruments available for this payment. Each instrument is associated with a specific handler via the handler_id field. Handlers can extend the base payment_instrument schema to add handler-specific fields.").optional() }).describe("Payment configuration containing handlers.") }).strict();
524
524
  const DiscountAllocationSchema = zod.object({
525
525
  "path": zod.string().describe("JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping')."),
526
526
  "amount": zod.number().int().gte(0).describe("Amount allocated to this target in minor (cents) currency units.")
@@ -572,7 +572,7 @@ const FulfillmentExtensionFulfillmentOptionSchema = zod.object({
572
572
  "display_text": zod.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
573
573
  "amount": zod.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
574
574
  })).describe("Fulfillment option totals breakdown.")
575
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).");
575
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).");
576
576
  const FulfillmentExtensionFulfillmentGroupSchema = zod.object({
577
577
  "id": zod.string().describe("Group identifier for referencing merchant-generated groups in updates."),
578
578
  "line_item_ids": zod.array(zod.string()).describe("Line item IDs included in this group/package."),
@@ -596,9 +596,9 @@ const FulfillmentExtensionFulfillmentGroupSchema = zod.object({
596
596
  "display_text": zod.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
597
597
  "amount": zod.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
598
598
  })).describe("Fulfillment option totals breakdown.")
599
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
599
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
600
600
  "selected_option_id": zod.union([zod.string().describe("ID of the selected fulfillment option for this group."), zod.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
601
- }).describe("A merchant-generated package/group of line items with fulfillment options.");
601
+ }).passthrough().describe("A merchant-generated package/group of line items with fulfillment options.");
602
602
  const FulfillmentExtensionFulfillmentMethodSchema = zod.object({
603
603
  "id": zod.string().describe("Unique fulfillment method identifier."),
604
604
  "type": zod.enum(["shipping", "pickup"]).describe("Fulfillment method type."),
@@ -628,7 +628,7 @@ const FulfillmentExtensionFulfillmentMethodSchema = zod.object({
628
628
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
629
629
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
630
630
  }).describe("Physical address of the location.").optional()
631
- }).describe("A pickup location (retail store, locker, etc.).")];
631
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).")];
632
632
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
633
633
  const passed = schemas.length - errors.length;
634
634
  if (passed !== 1) ctx.addIssue(errors.length ? {
@@ -666,16 +666,16 @@ const FulfillmentExtensionFulfillmentMethodSchema = zod.object({
666
666
  "display_text": zod.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
667
667
  "amount": zod.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
668
668
  })).describe("Fulfillment option totals breakdown.")
669
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
669
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
670
670
  "selected_option_id": zod.union([zod.string().describe("ID of the selected fulfillment option for this group."), zod.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
671
- }).describe("A merchant-generated package/group of line items with fulfillment options.")).describe("Fulfillment groups for selecting options. Agent sets selected_option_id on groups to choose shipping method.").optional()
672
- }).describe("A fulfillment method (shipping or pickup) with destinations and groups.");
671
+ }).passthrough().describe("A merchant-generated package/group of line items with fulfillment options.")).describe("Fulfillment groups for selecting options. Agent sets selected_option_id on groups to choose shipping method.").optional()
672
+ }).passthrough().describe("A fulfillment method (shipping or pickup) with destinations and groups.");
673
673
  const FulfillmentExtensionFulfillmentAvailableMethodSchema = zod.object({
674
674
  "type": zod.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to."),
675
675
  "line_item_ids": zod.array(zod.string()).describe("Line items available for this fulfillment method."),
676
676
  "fulfillable_on": zod.union([zod.string().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers)."), zod.null().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers).")]).describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers).").optional(),
677
677
  "description": zod.string().describe("Human-readable availability info (e.g., 'Available for pickup at Downtown Store today').").optional()
678
- }).describe("Inventory availability hint for a fulfillment method type.");
678
+ }).passthrough().describe("Inventory availability hint for a fulfillment method type.");
679
679
  const FulfillmentExtensionFulfillmentSchema = zod.object({
680
680
  "methods": zod.array(zod.object({
681
681
  "id": zod.string().describe("Unique fulfillment method identifier."),
@@ -706,7 +706,7 @@ const FulfillmentExtensionFulfillmentSchema = zod.object({
706
706
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
707
707
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
708
708
  }).describe("Physical address of the location.").optional()
709
- }).describe("A pickup location (retail store, locker, etc.).")];
709
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).")];
710
710
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
711
711
  const passed = schemas.length - errors.length;
712
712
  if (passed !== 1) ctx.addIssue(errors.length ? {
@@ -744,16 +744,16 @@ const FulfillmentExtensionFulfillmentSchema = zod.object({
744
744
  "display_text": zod.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
745
745
  "amount": zod.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
746
746
  })).describe("Fulfillment option totals breakdown.")
747
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
747
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
748
748
  "selected_option_id": zod.union([zod.string().describe("ID of the selected fulfillment option for this group."), zod.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
749
- }).describe("A merchant-generated package/group of line items with fulfillment options.")).describe("Fulfillment groups for selecting options. Agent sets selected_option_id on groups to choose shipping method.").optional()
750
- }).describe("A fulfillment method (shipping or pickup) with destinations and groups.")).describe("Fulfillment methods for cart items.").optional(),
749
+ }).passthrough().describe("A merchant-generated package/group of line items with fulfillment options.")).describe("Fulfillment groups for selecting options. Agent sets selected_option_id on groups to choose shipping method.").optional()
750
+ }).passthrough().describe("A fulfillment method (shipping or pickup) with destinations and groups.")).describe("Fulfillment methods for cart items.").optional(),
751
751
  "available_methods": zod.array(zod.object({
752
752
  "type": zod.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to."),
753
753
  "line_item_ids": zod.array(zod.string()).describe("Line items available for this fulfillment method."),
754
754
  "fulfillable_on": zod.union([zod.string().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers)."), zod.null().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers).")]).describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers).").optional(),
755
755
  "description": zod.string().describe("Human-readable availability info (e.g., 'Available for pickup at Downtown Store today').").optional()
756
- }).describe("Inventory availability hint for a fulfillment method type.")).describe("Inventory availability hints.").optional()
756
+ }).passthrough().describe("Inventory availability hint for a fulfillment method type.")).describe("Inventory availability hints.").optional()
757
757
  }).describe("Container for fulfillment methods and availability.");
758
758
  const OrderSchema = zod.object({
759
759
  "ucp": zod.intersection(zod.object({
@@ -914,9 +914,9 @@ const PaymentSchema = zod.object({ "instruments": zod.array(zod.intersection(zod
914
914
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
915
915
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
916
916
  }).describe("The billing address associated with this payment method.").optional(),
917
- "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
917
+ "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).passthrough().describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
918
918
  "display": zod.record(zod.string(), zod.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
919
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({ "selected": zod.boolean().describe("Whether this instrument is selected by the user.").optional() })).describe("A payment instrument with selection state.")).describe("The payment instruments available for this payment. Each instrument is associated with a specific handler via the handler_id field. Handlers can extend the base payment_instrument schema to add handler-specific fields.").optional() }).describe("Payment configuration containing handlers.");
919
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({ "selected": zod.boolean().describe("Whether this instrument is selected by the user.").optional() })).describe("A payment instrument with selection state.")).describe("The payment instruments available for this payment. Each instrument is associated with a specific handler via the handler_id field. Handlers can extend the base payment_instrument schema to add handler-specific fields.").optional() }).describe("Payment configuration containing handlers.");
920
920
  const AccountInfoSchema = zod.object({ "payment_account_reference": zod.string().describe("EMVCo PAR. A unique identifier linking a payment card to a specific account, enabling tracking across tokens (Apple Pay, physical card, etc).").optional() }).describe("Non-sensitive backend identifiers for linking.");
921
921
  const AdjustmentSchema = zod.object({
922
922
  "id": zod.string().describe("Adjustment event identifier."),
@@ -950,8 +950,8 @@ const BuyerSchema = zod.object({
950
950
  "last_name": zod.string().describe("Last name of the buyer.").optional(),
951
951
  "email": zod.string().describe("Email of the buyer.").optional(),
952
952
  "phone_number": zod.string().describe("E.164 standard.").optional()
953
- });
954
- const CardCredentialSchema = zod.intersection(zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).describe("The base definition for any payment credential. Handlers define specific credential types."), zod.object({
953
+ }).passthrough();
954
+ const CardCredentialSchema = zod.intersection(zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).passthrough().describe("The base definition for any payment credential. Handlers define specific credential types."), zod.object({
955
955
  "type": zod.literal("card").describe("The credential type identifier for card credentials."),
956
956
  "card_number_type": zod.enum([
957
957
  "fpan",
@@ -981,9 +981,9 @@ const CardPaymentInstrumentSchema = zod.intersection(zod.object({
981
981
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
982
982
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
983
983
  }).describe("The billing address associated with this payment method.").optional(),
984
- "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
984
+ "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).passthrough().describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
985
985
  "display": zod.record(zod.string(), zod.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
986
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({
986
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), zod.object({
987
987
  "type": zod.literal("card").describe("Indicates this is a card payment instrument."),
988
988
  "display": zod.object({
989
989
  "brand": zod.string().describe("The card brand/network (e.g., visa, mastercard, amex).").optional(),
@@ -998,7 +998,7 @@ const ContextSchema = zod.object({
998
998
  "address_country": zod.string().describe("The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example \"US\". For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as \"SGP\" or a full country name such as \"Singapore\" can also be used. Optional hint for market context (currency, availability, pricing)—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
999
999
  "address_region": zod.string().describe("The region in which the locality is, and which is in the country. For example, California or another appropriate first-level Administrative division. Optional hint for progressive localization—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
1000
1000
  "postal_code": zod.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional()
1001
- }).describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.");
1001
+ }).passthrough().describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.");
1002
1002
  const ExpectationSchema = zod.object({
1003
1003
  "id": zod.string().describe("Expectation identifier."),
1004
1004
  "line_items": zod.array(zod.object({
@@ -1054,7 +1054,7 @@ const FulfillmentSchema = zod.object({
1054
1054
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1055
1055
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1056
1056
  }).describe("Physical address of the location.").optional()
1057
- }).describe("A pickup location (retail store, locker, etc.).")];
1057
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).")];
1058
1058
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1059
1059
  const passed = schemas.length - errors.length;
1060
1060
  if (passed !== 1) ctx.addIssue(errors.length ? {
@@ -1092,23 +1092,23 @@ const FulfillmentSchema = zod.object({
1092
1092
  "display_text": zod.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1093
1093
  "amount": zod.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
1094
1094
  })).describe("Fulfillment option totals breakdown.")
1095
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1095
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1096
1096
  "selected_option_id": zod.union([zod.string().describe("ID of the selected fulfillment option for this group."), zod.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
1097
- }).describe("A merchant-generated package/group of line items with fulfillment options.")).describe("Fulfillment groups for selecting options. Agent sets selected_option_id on groups to choose shipping method.").optional()
1098
- }).describe("A fulfillment method (shipping or pickup) with destinations and groups.")).describe("Fulfillment methods for cart items.").optional(),
1097
+ }).passthrough().describe("A merchant-generated package/group of line items with fulfillment options.")).describe("Fulfillment groups for selecting options. Agent sets selected_option_id on groups to choose shipping method.").optional()
1098
+ }).passthrough().describe("A fulfillment method (shipping or pickup) with destinations and groups.")).describe("Fulfillment methods for cart items.").optional(),
1099
1099
  "available_methods": zod.array(zod.object({
1100
1100
  "type": zod.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to."),
1101
1101
  "line_item_ids": zod.array(zod.string()).describe("Line items available for this fulfillment method."),
1102
1102
  "fulfillable_on": zod.union([zod.string().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers)."), zod.null().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers).")]).describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers).").optional(),
1103
1103
  "description": zod.string().describe("Human-readable availability info (e.g., 'Available for pickup at Downtown Store today').").optional()
1104
- }).describe("Inventory availability hint for a fulfillment method type.")).describe("Inventory availability hints.").optional()
1104
+ }).passthrough().describe("Inventory availability hint for a fulfillment method type.")).describe("Inventory availability hints.").optional()
1105
1105
  }).describe("Container for fulfillment methods and availability.");
1106
1106
  const FulfillmentAvailableMethodSchema = zod.object({
1107
1107
  "type": zod.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to."),
1108
1108
  "line_item_ids": zod.array(zod.string()).describe("Line items available for this fulfillment method."),
1109
1109
  "fulfillable_on": zod.union([zod.string().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers)."), zod.null().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers).")]).describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers).").optional(),
1110
1110
  "description": zod.string().describe("Human-readable availability info (e.g., 'Available for pickup at Downtown Store today').").optional()
1111
- }).describe("Inventory availability hint for a fulfillment method type.");
1111
+ }).passthrough().describe("Inventory availability hint for a fulfillment method type.");
1112
1112
  const FulfillmentDestinationSchema = zod.record(zod.string(), zod.unknown()).and(zod.unknown().superRefine((x, ctx) => {
1113
1113
  const schemas = [zod.record(zod.string(), zod.unknown()).and(zod.intersection(zod.object({
1114
1114
  "extended_address": zod.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
@@ -1134,7 +1134,7 @@ const FulfillmentDestinationSchema = zod.record(zod.string(), zod.unknown()).and
1134
1134
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1135
1135
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1136
1136
  }).describe("Physical address of the location.").optional()
1137
- }).describe("A pickup location (retail store, locker, etc.).")];
1137
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).")];
1138
1138
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1139
1139
  const passed = schemas.length - errors.length;
1140
1140
  if (passed !== 1) ctx.addIssue(errors.length ? {
@@ -1184,9 +1184,9 @@ const FulfillmentGroupSchema = zod.object({
1184
1184
  "display_text": zod.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1185
1185
  "amount": zod.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
1186
1186
  })).describe("Fulfillment option totals breakdown.")
1187
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1187
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1188
1188
  "selected_option_id": zod.union([zod.string().describe("ID of the selected fulfillment option for this group."), zod.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
1189
- }).describe("A merchant-generated package/group of line items with fulfillment options.");
1189
+ }).passthrough().describe("A merchant-generated package/group of line items with fulfillment options.");
1190
1190
  const FulfillmentGroupUpdateRequestSchema = zod.object({ "id": zod.string().describe("Group identifier for referencing merchant-generated groups in updates.") }).strict();
1191
1191
  const FulfillmentMethodSchema = zod.object({
1192
1192
  "id": zod.string().describe("Unique fulfillment method identifier."),
@@ -1217,7 +1217,7 @@ const FulfillmentMethodSchema = zod.object({
1217
1217
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1218
1218
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1219
1219
  }).describe("Physical address of the location.").optional()
1220
- }).describe("A pickup location (retail store, locker, etc.).")];
1220
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).")];
1221
1221
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1222
1222
  const passed = schemas.length - errors.length;
1223
1223
  if (passed !== 1) ctx.addIssue(errors.length ? {
@@ -1255,10 +1255,10 @@ const FulfillmentMethodSchema = zod.object({
1255
1255
  "display_text": zod.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1256
1256
  "amount": zod.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
1257
1257
  })).describe("Fulfillment option totals breakdown.")
1258
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1258
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1259
1259
  "selected_option_id": zod.union([zod.string().describe("ID of the selected fulfillment option for this group."), zod.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
1260
- }).describe("A merchant-generated package/group of line items with fulfillment options.")).describe("Fulfillment groups for selecting options. Agent sets selected_option_id on groups to choose shipping method.").optional()
1261
- }).describe("A fulfillment method (shipping or pickup) with destinations and groups.");
1260
+ }).passthrough().describe("A merchant-generated package/group of line items with fulfillment options.")).describe("Fulfillment groups for selecting options. Agent sets selected_option_id on groups to choose shipping method.").optional()
1261
+ }).passthrough().describe("A fulfillment method (shipping or pickup) with destinations and groups.");
1262
1262
  const FulfillmentMethodCreateRequestSchema = zod.object({
1263
1263
  "type": zod.enum(["shipping", "pickup"]).describe("Fulfillment method type."),
1264
1264
  "line_item_ids": zod.array(zod.string()).describe("Line item IDs fulfilled via this method.").optional()
@@ -1287,7 +1287,7 @@ const FulfillmentOptionSchema = zod.object({
1287
1287
  "display_text": zod.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1288
1288
  "amount": zod.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
1289
1289
  })).describe("Fulfillment option totals breakdown.")
1290
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).");
1290
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).");
1291
1291
  const ItemSchema = zod.object({
1292
1292
  "id": zod.string().describe("Should be recognized by both the Platform, and the Business. For Google it should match the id provided in the \"id\" field in the product feed."),
1293
1293
  "title": zod.string().describe("Product title."),
@@ -1438,7 +1438,7 @@ const OrderLineItemSchema = zod.object({
1438
1438
  ]).describe("Derived status: fulfilled if quantity.fulfilled == quantity.total, partial if quantity.fulfilled > 0, otherwise processing."),
1439
1439
  "parent_id": zod.string().describe("Parent line item identifier for any nested structures.").optional()
1440
1440
  });
1441
- const PaymentCredentialSchema = zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).describe("The base definition for any payment credential. Handlers define specific credential types.");
1441
+ const PaymentCredentialSchema = zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).passthrough().describe("The base definition for any payment credential. Handlers define specific credential types.");
1442
1442
  const PaymentIdentitySchema = zod.object({ "access_token": zod.string().describe("Unique identifier for this participant, obtained during onboarding with the tokenizer.") }).describe("Identity of a participant for token binding. The access_token uniquely identifies the participant who tokens should be bound to.");
1443
1443
  const PaymentInstrumentSchema = zod.object({
1444
1444
  "id": zod.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
@@ -1455,9 +1455,9 @@ const PaymentInstrumentSchema = zod.object({
1455
1455
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1456
1456
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1457
1457
  }).describe("The billing address associated with this payment method.").optional(),
1458
- "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
1458
+ "credential": zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).passthrough().describe("The base definition for any payment credential. Handlers define specific credential types.").optional(),
1459
1459
  "display": zod.record(zod.string(), zod.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
1460
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler.");
1460
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler.");
1461
1461
  const PlatformFulfillmentConfigSchema = zod.object({ "supports_multi_group": zod.boolean().describe("Enables multiple groups per method.").default(false) }).describe("Platform's fulfillment configuration.");
1462
1462
  const PostalAddressSchema = zod.object({
1463
1463
  "extended_address": zod.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
@@ -1484,7 +1484,7 @@ const RetailLocationSchema = zod.object({
1484
1484
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1485
1485
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1486
1486
  }).describe("Physical address of the location.").optional()
1487
- }).describe("A pickup location (retail store, locker, etc.).");
1487
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).");
1488
1488
  const ShippingDestinationSchema = zod.record(zod.string(), zod.unknown()).and(zod.intersection(zod.object({
1489
1489
  "extended_address": zod.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1490
1490
  "street_address": zod.string().describe("The street address.").optional(),
@@ -1496,7 +1496,7 @@ const ShippingDestinationSchema = zod.record(zod.string(), zod.unknown()).and(zo
1496
1496
  "last_name": zod.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1497
1497
  "phone_number": zod.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1498
1498
  }), zod.object({ "id": zod.string().describe("ID specific to this shipping destination.") }))).describe("Shipping destination.");
1499
- const TokenCredentialSchema = zod.intersection(zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).describe("The base definition for any payment credential. Handlers define specific credential types."), zod.object({
1499
+ const TokenCredentialSchema = zod.intersection(zod.object({ "type": zod.string().describe("The credential type discriminator. Specific schemas will constrain this to a constant value.") }).passthrough().describe("The base definition for any payment credential. Handlers define specific credential types."), zod.object({
1500
1500
  "type": zod.string().describe("The specific type of token produced by the handler (e.g., 'stripe_token')."),
1501
1501
  "token": zod.string().describe("The token value.")
1502
1502
  })).describe("Base token credential schema. Concrete payment handlers may extend this schema with additional fields and define their own constraints.");
@@ -1800,6 +1800,342 @@ const UcpResponseOrderSchema = zod.intersection(zod.object({
1800
1800
  "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1801
1801
  "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1802
1802
  }).describe("Shared foundation for all UCP entities."), zod.object({ "extends": zod.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Parent capability this extends. Present for extensions, absent for root capabilities.").optional() })).describe("Capability reference in responses. Only name/version required to confirm active capabilities."))).optional() })).describe("UCP metadata for order responses. No payment handlers needed post-purchase.");
1803
+ const ProfileSchemaSigningKeySchema = zod.object({
1804
+ "kid": zod.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
1805
+ "kty": zod.string().describe("Key type (e.g., 'EC', 'RSA')."),
1806
+ "crv": zod.string().describe("Curve name for EC keys (e.g., 'P-256').").optional(),
1807
+ "x": zod.string().describe("X coordinate for EC public keys (base64url encoded).").optional(),
1808
+ "y": zod.string().describe("Y coordinate for EC public keys (base64url encoded).").optional(),
1809
+ "n": zod.string().describe("Modulus for RSA public keys (base64url encoded).").optional(),
1810
+ "e": zod.string().describe("Exponent for RSA public keys (base64url encoded).").optional(),
1811
+ "use": zod.enum(["sig", "enc"]).describe("Key usage. Should be 'sig' for signing keys.").optional(),
1812
+ "alg": zod.string().describe("Algorithm (e.g., 'ES256', 'RS256').").optional()
1813
+ }).describe("Public key for signature verification in JWK format.");
1814
+ const ProfileSchemaBaseSchema = zod.object({
1815
+ "ucp": zod.object({
1816
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1817
+ "services": zod.record(zod.array(zod.intersection(zod.object({
1818
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1819
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1820
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1821
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1822
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1823
+ }).describe("Shared foundation for all UCP entities."), zod.object({
1824
+ "transport": zod.enum([
1825
+ "rest",
1826
+ "mcp",
1827
+ "a2a",
1828
+ "embedded"
1829
+ ]).describe("Transport protocol for this service binding."),
1830
+ "endpoint": zod.string().url().describe("Endpoint URL for this transport binding.").optional()
1831
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
1832
+ "capabilities": zod.record(zod.array(zod.intersection(zod.object({
1833
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1834
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1835
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1836
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1837
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1838
+ }).describe("Shared foundation for all UCP entities."), zod.object({ "extends": zod.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Parent capability this extends. Present for extensions, absent for root capabilities.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
1839
+ "payment_handlers": zod.record(zod.array(zod.intersection(zod.object({
1840
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1841
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1842
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1843
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1844
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1845
+ }).describe("Shared foundation for all UCP entities."), zod.record(zod.string(), zod.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
1846
+ }).describe("Base UCP metadata with shared properties for all schema types."),
1847
+ "signing_keys": zod.array(zod.object({
1848
+ "kid": zod.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
1849
+ "kty": zod.string().describe("Key type (e.g., 'EC', 'RSA')."),
1850
+ "crv": zod.string().describe("Curve name for EC keys (e.g., 'P-256').").optional(),
1851
+ "x": zod.string().describe("X coordinate for EC public keys (base64url encoded).").optional(),
1852
+ "y": zod.string().describe("Y coordinate for EC public keys (base64url encoded).").optional(),
1853
+ "n": zod.string().describe("Modulus for RSA public keys (base64url encoded).").optional(),
1854
+ "e": zod.string().describe("Exponent for RSA public keys (base64url encoded).").optional(),
1855
+ "use": zod.enum(["sig", "enc"]).describe("Key usage. Should be 'sig' for signing keys.").optional(),
1856
+ "alg": zod.string().describe("Algorithm (e.g., 'ES256', 'RS256').").optional()
1857
+ }).describe("Public key for signature verification in JWK format.")).describe("Public keys for signature verification (JWK format). Used to verify signed responses, webhooks, and other authenticated messages from this party.").optional()
1858
+ }).passthrough().describe("Base discovery profile with shared properties for all profile types.");
1859
+ const ProfileSchemaPlatformProfileSchema = zod.intersection(zod.object({
1860
+ "ucp": zod.object({
1861
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1862
+ "services": zod.record(zod.array(zod.intersection(zod.object({
1863
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1864
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1865
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1866
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1867
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1868
+ }).describe("Shared foundation for all UCP entities."), zod.object({
1869
+ "transport": zod.enum([
1870
+ "rest",
1871
+ "mcp",
1872
+ "a2a",
1873
+ "embedded"
1874
+ ]).describe("Transport protocol for this service binding."),
1875
+ "endpoint": zod.string().url().describe("Endpoint URL for this transport binding.").optional()
1876
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
1877
+ "capabilities": zod.record(zod.array(zod.intersection(zod.object({
1878
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1879
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1880
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1881
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1882
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1883
+ }).describe("Shared foundation for all UCP entities."), zod.object({ "extends": zod.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Parent capability this extends. Present for extensions, absent for root capabilities.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
1884
+ "payment_handlers": zod.record(zod.array(zod.intersection(zod.object({
1885
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1886
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1887
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1888
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1889
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1890
+ }).describe("Shared foundation for all UCP entities."), zod.record(zod.string(), zod.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
1891
+ }).describe("Base UCP metadata with shared properties for all schema types."),
1892
+ "signing_keys": zod.array(zod.object({
1893
+ "kid": zod.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
1894
+ "kty": zod.string().describe("Key type (e.g., 'EC', 'RSA')."),
1895
+ "crv": zod.string().describe("Curve name for EC keys (e.g., 'P-256').").optional(),
1896
+ "x": zod.string().describe("X coordinate for EC public keys (base64url encoded).").optional(),
1897
+ "y": zod.string().describe("Y coordinate for EC public keys (base64url encoded).").optional(),
1898
+ "n": zod.string().describe("Modulus for RSA public keys (base64url encoded).").optional(),
1899
+ "e": zod.string().describe("Exponent for RSA public keys (base64url encoded).").optional(),
1900
+ "use": zod.enum(["sig", "enc"]).describe("Key usage. Should be 'sig' for signing keys.").optional(),
1901
+ "alg": zod.string().describe("Algorithm (e.g., 'ES256', 'RS256').").optional()
1902
+ }).describe("Public key for signature verification in JWK format.")).describe("Public keys for signature verification (JWK format). Used to verify signed responses, webhooks, and other authenticated messages from this party.").optional()
1903
+ }).passthrough().describe("Base discovery profile with shared properties for all profile types."), zod.object({ "ucp": zod.intersection(zod.object({
1904
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1905
+ "services": zod.record(zod.array(zod.intersection(zod.object({
1906
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1907
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1908
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1909
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1910
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1911
+ }).describe("Shared foundation for all UCP entities."), zod.object({
1912
+ "transport": zod.enum([
1913
+ "rest",
1914
+ "mcp",
1915
+ "a2a",
1916
+ "embedded"
1917
+ ]).describe("Transport protocol for this service binding."),
1918
+ "endpoint": zod.string().url().describe("Endpoint URL for this transport binding.").optional()
1919
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
1920
+ "capabilities": zod.record(zod.array(zod.intersection(zod.object({
1921
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1922
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1923
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1924
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1925
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1926
+ }).describe("Shared foundation for all UCP entities."), zod.object({ "extends": zod.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Parent capability this extends. Present for extensions, absent for root capabilities.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
1927
+ "payment_handlers": zod.record(zod.array(zod.intersection(zod.object({
1928
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1929
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1930
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1931
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1932
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1933
+ }).describe("Shared foundation for all UCP entities."), zod.record(zod.string(), zod.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
1934
+ }).describe("Base UCP metadata with shared properties for all schema types."), zod.object({
1935
+ "services": zod.record(zod.array(zod.intersection(zod.intersection(zod.object({
1936
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1937
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1938
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1939
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1940
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1941
+ }).describe("Shared foundation for all UCP entities."), zod.object({
1942
+ "transport": zod.enum([
1943
+ "rest",
1944
+ "mcp",
1945
+ "a2a",
1946
+ "embedded"
1947
+ ]).describe("Transport protocol for this service binding."),
1948
+ "endpoint": zod.string().url().describe("Endpoint URL for this transport binding.").optional()
1949
+ })), zod.intersection(zod.record(zod.string(), zod.unknown()), zod.union([
1950
+ zod.object({ "transport": zod.literal("rest").optional() }),
1951
+ zod.object({ "transport": zod.literal("mcp").optional() }),
1952
+ zod.object({ "transport": zod.literal("a2a").optional() }),
1953
+ zod.object({ "transport": zod.literal("embedded").optional() })
1954
+ ]))).describe("Full service declaration for platform-level discovery. Different transports require different fields."))),
1955
+ "capabilities": zod.record(zod.array(zod.intersection(zod.intersection(zod.object({
1956
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1957
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1958
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1959
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1960
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1961
+ }).describe("Shared foundation for all UCP entities."), zod.object({ "extends": zod.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Parent capability this extends. Present for extensions, absent for root capabilities.").optional() })), zod.record(zod.string(), zod.unknown())).describe("Full capability declaration for platform-level discovery. Includes spec/schema URLs for agent fetching."))).optional(),
1962
+ "payment_handlers": zod.record(zod.array(zod.intersection(zod.intersection(zod.object({
1963
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1964
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1965
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1966
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1967
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1968
+ }).describe("Shared foundation for all UCP entities."), zod.record(zod.string(), zod.unknown())), zod.record(zod.string(), zod.unknown())).describe("Platform declaration for discovery profiles. May include partial config state required for discovery.")))
1969
+ })).describe("Full UCP metadata for platform-level configuration. Hosted at a URI advertised by the platform in request headers.").optional() })).describe("Full discovery profile for platforms. Exposes complete service, capability, and payment handler registries.");
1970
+ const ProfileSchemaBusinessProfileSchema = zod.intersection(zod.object({
1971
+ "ucp": zod.object({
1972
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1973
+ "services": zod.record(zod.array(zod.intersection(zod.object({
1974
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1975
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1976
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1977
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1978
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1979
+ }).describe("Shared foundation for all UCP entities."), zod.object({
1980
+ "transport": zod.enum([
1981
+ "rest",
1982
+ "mcp",
1983
+ "a2a",
1984
+ "embedded"
1985
+ ]).describe("Transport protocol for this service binding."),
1986
+ "endpoint": zod.string().url().describe("Endpoint URL for this transport binding.").optional()
1987
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
1988
+ "capabilities": zod.record(zod.array(zod.intersection(zod.object({
1989
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1990
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1991
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1992
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1993
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1994
+ }).describe("Shared foundation for all UCP entities."), zod.object({ "extends": zod.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Parent capability this extends. Present for extensions, absent for root capabilities.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
1995
+ "payment_handlers": zod.record(zod.array(zod.intersection(zod.object({
1996
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1997
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
1998
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1999
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2000
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2001
+ }).describe("Shared foundation for all UCP entities."), zod.record(zod.string(), zod.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
2002
+ }).describe("Base UCP metadata with shared properties for all schema types."),
2003
+ "signing_keys": zod.array(zod.object({
2004
+ "kid": zod.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
2005
+ "kty": zod.string().describe("Key type (e.g., 'EC', 'RSA')."),
2006
+ "crv": zod.string().describe("Curve name for EC keys (e.g., 'P-256').").optional(),
2007
+ "x": zod.string().describe("X coordinate for EC public keys (base64url encoded).").optional(),
2008
+ "y": zod.string().describe("Y coordinate for EC public keys (base64url encoded).").optional(),
2009
+ "n": zod.string().describe("Modulus for RSA public keys (base64url encoded).").optional(),
2010
+ "e": zod.string().describe("Exponent for RSA public keys (base64url encoded).").optional(),
2011
+ "use": zod.enum(["sig", "enc"]).describe("Key usage. Should be 'sig' for signing keys.").optional(),
2012
+ "alg": zod.string().describe("Algorithm (e.g., 'ES256', 'RS256').").optional()
2013
+ }).describe("Public key for signature verification in JWK format.")).describe("Public keys for signature verification (JWK format). Used to verify signed responses, webhooks, and other authenticated messages from this party.").optional()
2014
+ }).passthrough().describe("Base discovery profile with shared properties for all profile types."), zod.object({ "ucp": zod.intersection(zod.object({
2015
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2016
+ "services": zod.record(zod.array(zod.intersection(zod.object({
2017
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2018
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
2019
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2020
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2021
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2022
+ }).describe("Shared foundation for all UCP entities."), zod.object({
2023
+ "transport": zod.enum([
2024
+ "rest",
2025
+ "mcp",
2026
+ "a2a",
2027
+ "embedded"
2028
+ ]).describe("Transport protocol for this service binding."),
2029
+ "endpoint": zod.string().url().describe("Endpoint URL for this transport binding.").optional()
2030
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2031
+ "capabilities": zod.record(zod.array(zod.intersection(zod.object({
2032
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2033
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
2034
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2035
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2036
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2037
+ }).describe("Shared foundation for all UCP entities."), zod.object({ "extends": zod.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Parent capability this extends. Present for extensions, absent for root capabilities.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
2038
+ "payment_handlers": zod.record(zod.array(zod.intersection(zod.object({
2039
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2040
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
2041
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2042
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2043
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2044
+ }).describe("Shared foundation for all UCP entities."), zod.record(zod.string(), zod.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
2045
+ }).describe("Base UCP metadata with shared properties for all schema types."), zod.object({
2046
+ "services": zod.record(zod.array(zod.intersection(zod.intersection(zod.object({
2047
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2048
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
2049
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2050
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2051
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2052
+ }).describe("Shared foundation for all UCP entities."), zod.object({
2053
+ "transport": zod.enum([
2054
+ "rest",
2055
+ "mcp",
2056
+ "a2a",
2057
+ "embedded"
2058
+ ]).describe("Transport protocol for this service binding."),
2059
+ "endpoint": zod.string().url().describe("Endpoint URL for this transport binding.").optional()
2060
+ })), zod.union([
2061
+ zod.object({ "transport": zod.literal("rest").optional() }),
2062
+ zod.object({ "transport": zod.literal("mcp").optional() }),
2063
+ zod.object({ "transport": zod.literal("a2a").optional() }),
2064
+ zod.object({
2065
+ "transport": zod.literal("embedded").optional(),
2066
+ "config": zod.object({ "delegate": zod.array(zod.string()).describe("Delegations the business allows. At service-level, declares available delegations. In checkout responses, confirms accepted delegations for this session.").optional() }).describe("Per-checkout configuration for embedded transport binding. Allows businesses to vary ECP availability and delegations based on cart contents, agent authorization, or policy.").optional()
2067
+ })
2068
+ ])).describe("Service binding for business/merchant configuration. May override platform endpoints."))),
2069
+ "capabilities": zod.record(zod.array(zod.intersection(zod.object({
2070
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2071
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
2072
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2073
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2074
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2075
+ }).describe("Shared foundation for all UCP entities."), zod.object({ "extends": zod.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Parent capability this extends. Present for extensions, absent for root capabilities.").optional() })).describe("Capability configuration for business/merchant level. May include business-specific config overrides."))).optional(),
2076
+ "payment_handlers": zod.record(zod.array(zod.intersection(zod.object({
2077
+ "version": zod.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2078
+ "spec": zod.string().url().describe("URL to human-readable specification document.").optional(),
2079
+ "schema": zod.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2080
+ "id": zod.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2081
+ "config": zod.record(zod.string(), zod.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2082
+ }).describe("Shared foundation for all UCP entities."), zod.record(zod.string(), zod.unknown())).describe("Business declaration for discovery profiles. May include partial config state required for discovery.")))
2083
+ })).describe("UCP metadata for business/merchant-level configuration. Subset of platform schema with business-specific settings.").optional() })).describe("Discovery profile for businesses/merchants. Subset of platform profile with business-specific configuration.");
2084
+ const ServiceBaseTransportEnumSchema = zod.enum([
2085
+ "rest",
2086
+ "mcp",
2087
+ "a2a",
2088
+ "embedded"
2089
+ ]).describe("Transport protocol for this service binding.");
2090
+ const CheckoutStatusEnumSchema = zod.enum([
2091
+ "incomplete",
2092
+ "requires_escalation",
2093
+ "ready_for_complete",
2094
+ "complete_in_progress",
2095
+ "completed",
2096
+ "canceled"
2097
+ ]).describe("Checkout state indicating the current phase and required action. See Checkout Status lifecycle documentation for state transition details.");
2098
+ const DiscountAppliedDiscountMethodEnumSchema = zod.enum(["each", "across"]).describe("Allocation method. 'each' = applied independently per item. 'across' = split proportionally by value.");
2099
+ const AdjustmentStatusEnumSchema = zod.enum([
2100
+ "pending",
2101
+ "completed",
2102
+ "failed"
2103
+ ]).describe("Adjustment status.");
2104
+ const CardCredentialCardNumberTypeEnumSchema = zod.enum([
2105
+ "fpan",
2106
+ "network_token",
2107
+ "dpan"
2108
+ ]).describe("The type of card number. Network tokens are preferred with fallback to FPAN. See PCI Scope for more details.");
2109
+ const ExpectationMethodTypeEnumSchema = zod.enum([
2110
+ "shipping",
2111
+ "pickup",
2112
+ "digital"
2113
+ ]).describe("Delivery method type (shipping, pickup, digital).");
2114
+ const FulfillmentAvailableMethodTypeEnumSchema = zod.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to.");
2115
+ const FulfillmentMethodTypeEnumSchema = zod.enum(["shipping", "pickup"]).describe("Fulfillment method type.");
2116
+ const MessageErrorContentTypeEnumSchema = zod.enum(["plain", "markdown"]).describe("Content format, default = plain.");
2117
+ const MessageErrorSeverityEnumSchema = zod.enum([
2118
+ "recoverable",
2119
+ "requires_buyer_input",
2120
+ "requires_buyer_review"
2121
+ ]).describe("Declares who resolves this error. 'recoverable': agent can fix via API. 'requires_buyer_input': merchant requires information their API doesn't support collecting programmatically (checkout incomplete). 'requires_buyer_review': buyer must authorize before order placement due to policy, regulatory, or entitlement rules (checkout complete). Errors with 'requires_*' severity contribute to 'status: requires_escalation'.");
2122
+ const MessageInfoContentTypeEnumSchema = zod.enum(["plain", "markdown"]).describe("Content format, default = plain.");
2123
+ const MessageWarningContentTypeEnumSchema = zod.enum(["plain", "markdown"]).describe("Content format, default = plain.");
2124
+ const OrderLineItemStatusEnumSchema = zod.enum([
2125
+ "processing",
2126
+ "partial",
2127
+ "fulfilled"
2128
+ ]).describe("Derived status: fulfilled if quantity.fulfilled == quantity.total, partial if quantity.fulfilled > 0, otherwise processing.");
2129
+ const TotalTypeEnumSchema = zod.enum([
2130
+ "items_discount",
2131
+ "subtotal",
2132
+ "discount",
2133
+ "fulfillment",
2134
+ "tax",
2135
+ "fee",
2136
+ "total"
2137
+ ]).describe("Type of total categorization.");
2138
+ const ProfileSchemaSigningKeyUseEnumSchema = zod.enum(["sig", "enc"]).describe("Key usage. Should be 'sig' for signing keys.");
1803
2139
  //#endregion
1804
2140
  //#region src/extensions.ts
1805
2141
  const ItemResponseSchema = ItemSchema;
@@ -1807,67 +2143,19 @@ const TotalResponseSchema = TotalSchema;
1807
2143
  const LineItemResponseSchema = LineItemSchema;
1808
2144
  const FulfillmentResponseSchema = FulfillmentSchema;
1809
2145
  const FulfillmentMethodResponseSchema = FulfillmentMethodSchema;
1810
- const CheckoutResponseStatusSchema = zod.z.enum([
1811
- "incomplete",
1812
- "requires_escalation",
1813
- "ready_for_complete",
1814
- "complete_in_progress",
1815
- "completed",
1816
- "canceled"
1817
- ]);
1818
- const ExtendedPaymentCredentialSchema = PaymentCredentialSchema.extend({ token: zod.z.string().optional() });
2146
+ const CheckoutResponseStatusSchema = CheckoutStatusEnumSchema;
1819
2147
  const PaymentResponseSchema = PaymentSchema.passthrough();
1820
2148
  const PaymentInstrumentResponseSchema = PaymentInstrumentSchema.passthrough();
1821
- const UcpDiscoveryProfileSchema = zod.z.object({ ucp: zod.z.object({
1822
- version: zod.z.string(),
1823
- capabilities: zod.z.record(zod.z.string(), zod.z.array(UcpEntitySchema)).optional(),
1824
- services: zod.z.record(zod.z.string(), zod.z.array(UcpEntitySchema)).optional(),
1825
- payment_handlers: zod.z.array(PaymentHandlerResponseSchema).optional()
1826
- }) });
1827
- const PlatformConfigSchema = zod.z.object({ webhook_url: zod.z.string().url().optional() });
1828
- const FulfillmentRequestSchema = zod.z.object({ methods: zod.z.array(zod.z.object({
1829
- id: zod.z.string(),
1830
- type: zod.z.enum(["shipping", "pickup"]),
1831
- line_item_ids: zod.z.array(zod.z.string()),
1832
- selected_destination_id: zod.z.string().nullable().optional(),
1833
- groups: zod.z.array(zod.z.object({
1834
- id: zod.z.string(),
1835
- selected_option_id: zod.z.string().nullable().optional()
1836
- }).passthrough()).optional()
1837
- }).passthrough()).optional() }).passthrough();
1838
- const DiscountsObjectSchema = zod.z.object({ codes: zod.z.array(zod.z.string()).optional() }).passthrough();
1839
- const ConsentSchema = zod.z.object({
1840
- marketing: zod.z.boolean().optional(),
1841
- sms: zod.z.boolean().optional(),
1842
- terms: zod.z.boolean().optional()
1843
- }).passthrough();
1844
- const Ap2ResponseSchema = zod.z.object({
1845
- mandate: zod.z.string().optional(),
1846
- status: zod.z.string().optional()
1847
- }).passthrough();
2149
+ const UcpDiscoveryProfileSchema = ProfileSchemaBaseSchema;
2150
+ const UcpDiscoveryPlatformProfileSchema = ProfileSchemaPlatformProfileSchema;
2151
+ const UcpDiscoveryBusinessProfileSchema = ProfileSchemaBusinessProfileSchema;
2152
+ const UcpSigningKeySchema = ProfileSchemaSigningKeySchema;
1848
2153
  const CheckoutResponseSchema = CheckoutSchema.passthrough();
1849
- const ExtendedCheckoutResponseSchema = CheckoutSchema.extend({
1850
- fulfillment: FulfillmentResponseSchema.optional(),
1851
- discounts: DiscountsObjectSchema.optional(),
1852
- ap2: Ap2ResponseSchema.optional(),
1853
- order_id: zod.z.string().optional(),
1854
- order_permalink_url: zod.z.string().optional(),
1855
- platform: PlatformConfigSchema.optional()
1856
- }).passthrough();
1857
- const ExtendedCheckoutCreateRequestSchema = CheckoutCreateRequestSchema.extend({
1858
- fulfillment: FulfillmentRequestSchema.optional(),
1859
- discounts: DiscountsObjectSchema.optional(),
1860
- buyer: BuyerSchema.extend({ consent: ConsentSchema.optional() }).optional()
1861
- });
1862
- const ExtendedCheckoutUpdateRequestSchema = CheckoutUpdateRequestSchema.extend({
1863
- fulfillment: FulfillmentRequestSchema.optional(),
1864
- discounts: DiscountsObjectSchema.optional(),
1865
- buyer: BuyerSchema.extend({ consent: ConsentSchema.optional() }).optional()
1866
- });
1867
2154
  const OrderUpdateSchema = OrderSchema;
1868
2155
  //#endregion
1869
2156
  exports.AccountInfoSchema = AccountInfoSchema;
1870
2157
  exports.AdjustmentSchema = AdjustmentSchema;
2158
+ exports.AdjustmentStatusEnumSchema = AdjustmentStatusEnumSchema;
1871
2159
  exports.Ap2MandateAp2WithCheckoutMandateSchema = Ap2MandateAp2WithCheckoutMandateSchema;
1872
2160
  exports.Ap2MandateAp2WithMerchantAuthorizationSchema = Ap2MandateAp2WithMerchantAuthorizationSchema;
1873
2161
  exports.Ap2MandateCheckoutMandateSchema = Ap2MandateCheckoutMandateSchema;
@@ -1882,6 +2170,7 @@ exports.CapabilityBaseSchema = CapabilityBaseSchema;
1882
2170
  exports.CapabilityBusinessSchema = CapabilityBusinessSchema;
1883
2171
  exports.CapabilityPlatformSchema = CapabilityPlatformSchema;
1884
2172
  exports.CapabilityResponseSchema = CapabilityResponseSchema;
2173
+ exports.CardCredentialCardNumberTypeEnumSchema = CardCredentialCardNumberTypeEnumSchema;
1885
2174
  exports.CardCredentialSchema = CardCredentialSchema;
1886
2175
  exports.CardPaymentInstrumentSchema = CardPaymentInstrumentSchema;
1887
2176
  exports.CheckoutCompleteRequestSchema = CheckoutCompleteRequestSchema;
@@ -1889,18 +2178,18 @@ exports.CheckoutCreateRequestSchema = CheckoutCreateRequestSchema;
1889
2178
  exports.CheckoutResponseSchema = CheckoutResponseSchema;
1890
2179
  exports.CheckoutResponseStatusSchema = CheckoutResponseStatusSchema;
1891
2180
  exports.CheckoutSchema = CheckoutSchema;
2181
+ exports.CheckoutStatusEnumSchema = CheckoutStatusEnumSchema;
1892
2182
  exports.CheckoutUpdateRequestSchema = CheckoutUpdateRequestSchema;
1893
2183
  exports.ContextSchema = ContextSchema;
1894
2184
  exports.DiscountAllocationSchema = DiscountAllocationSchema;
2185
+ exports.DiscountAppliedDiscountMethodEnumSchema = DiscountAppliedDiscountMethodEnumSchema;
1895
2186
  exports.DiscountAppliedDiscountSchema = DiscountAppliedDiscountSchema;
1896
2187
  exports.DiscountDiscountsObjectSchema = DiscountDiscountsObjectSchema;
1897
2188
  exports.EmbeddedConfigSchema = EmbeddedConfigSchema;
2189
+ exports.ExpectationMethodTypeEnumSchema = ExpectationMethodTypeEnumSchema;
1898
2190
  exports.ExpectationSchema = ExpectationSchema;
1899
- exports.ExtendedCheckoutCreateRequestSchema = ExtendedCheckoutCreateRequestSchema;
1900
- exports.ExtendedCheckoutResponseSchema = ExtendedCheckoutResponseSchema;
1901
- exports.ExtendedCheckoutUpdateRequestSchema = ExtendedCheckoutUpdateRequestSchema;
1902
- exports.ExtendedPaymentCredentialSchema = ExtendedPaymentCredentialSchema;
1903
2191
  exports.FulfillmentAvailableMethodSchema = FulfillmentAvailableMethodSchema;
2192
+ exports.FulfillmentAvailableMethodTypeEnumSchema = FulfillmentAvailableMethodTypeEnumSchema;
1904
2193
  exports.FulfillmentDestinationSchema = FulfillmentDestinationSchema;
1905
2194
  exports.FulfillmentEventSchema = FulfillmentEventSchema;
1906
2195
  exports.FulfillmentExtensionFulfillmentAvailableMethodSchema = FulfillmentExtensionFulfillmentAvailableMethodSchema;
@@ -1913,6 +2202,7 @@ exports.FulfillmentGroupUpdateRequestSchema = FulfillmentGroupUpdateRequestSchem
1913
2202
  exports.FulfillmentMethodCreateRequestSchema = FulfillmentMethodCreateRequestSchema;
1914
2203
  exports.FulfillmentMethodResponseSchema = FulfillmentMethodResponseSchema;
1915
2204
  exports.FulfillmentMethodSchema = FulfillmentMethodSchema;
2205
+ exports.FulfillmentMethodTypeEnumSchema = FulfillmentMethodTypeEnumSchema;
1916
2206
  exports.FulfillmentMethodUpdateRequestSchema = FulfillmentMethodUpdateRequestSchema;
1917
2207
  exports.FulfillmentOptionSchema = FulfillmentOptionSchema;
1918
2208
  exports.FulfillmentResponseSchema = FulfillmentResponseSchema;
@@ -1924,12 +2214,17 @@ exports.LineItemSchema = LineItemSchema;
1924
2214
  exports.LineItemUpdateRequestSchema = LineItemUpdateRequestSchema;
1925
2215
  exports.LinkSchema = LinkSchema;
1926
2216
  exports.MerchantFulfillmentConfigSchema = MerchantFulfillmentConfigSchema;
2217
+ exports.MessageErrorContentTypeEnumSchema = MessageErrorContentTypeEnumSchema;
1927
2218
  exports.MessageErrorSchema = MessageErrorSchema;
2219
+ exports.MessageErrorSeverityEnumSchema = MessageErrorSeverityEnumSchema;
2220
+ exports.MessageInfoContentTypeEnumSchema = MessageInfoContentTypeEnumSchema;
1928
2221
  exports.MessageInfoSchema = MessageInfoSchema;
1929
2222
  exports.MessageSchema = MessageSchema;
2223
+ exports.MessageWarningContentTypeEnumSchema = MessageWarningContentTypeEnumSchema;
1930
2224
  exports.MessageWarningSchema = MessageWarningSchema;
1931
2225
  exports.OrderConfirmationSchema = OrderConfirmationSchema;
1932
2226
  exports.OrderLineItemSchema = OrderLineItemSchema;
2227
+ exports.OrderLineItemStatusEnumSchema = OrderLineItemStatusEnumSchema;
1933
2228
  exports.OrderSchema = OrderSchema;
1934
2229
  exports.OrderUpdateSchema = OrderUpdateSchema;
1935
2230
  exports.PaymentCredentialSchema = PaymentCredentialSchema;
@@ -1942,11 +2237,16 @@ exports.PaymentInstrumentResponseSchema = PaymentInstrumentResponseSchema;
1942
2237
  exports.PaymentInstrumentSchema = PaymentInstrumentSchema;
1943
2238
  exports.PaymentResponseSchema = PaymentResponseSchema;
1944
2239
  exports.PaymentSchema = PaymentSchema;
1945
- exports.PlatformConfigSchema = PlatformConfigSchema;
1946
2240
  exports.PlatformFulfillmentConfigSchema = PlatformFulfillmentConfigSchema;
1947
2241
  exports.PostalAddressSchema = PostalAddressSchema;
2242
+ exports.ProfileSchemaBaseSchema = ProfileSchemaBaseSchema;
2243
+ exports.ProfileSchemaBusinessProfileSchema = ProfileSchemaBusinessProfileSchema;
2244
+ exports.ProfileSchemaPlatformProfileSchema = ProfileSchemaPlatformProfileSchema;
2245
+ exports.ProfileSchemaSigningKeySchema = ProfileSchemaSigningKeySchema;
2246
+ exports.ProfileSchemaSigningKeyUseEnumSchema = ProfileSchemaSigningKeyUseEnumSchema;
1948
2247
  exports.RetailLocationSchema = RetailLocationSchema;
1949
2248
  exports.ServiceBaseSchema = ServiceBaseSchema;
2249
+ exports.ServiceBaseTransportEnumSchema = ServiceBaseTransportEnumSchema;
1950
2250
  exports.ServiceBusinessSchema = ServiceBusinessSchema;
1951
2251
  exports.ServicePlatformSchema = ServicePlatformSchema;
1952
2252
  exports.ServiceResponseSchema = ServiceResponseSchema;
@@ -1954,12 +2254,16 @@ exports.ShippingDestinationSchema = ShippingDestinationSchema;
1954
2254
  exports.TokenCredentialSchema = TokenCredentialSchema;
1955
2255
  exports.TotalResponseSchema = TotalResponseSchema;
1956
2256
  exports.TotalSchema = TotalSchema;
2257
+ exports.TotalTypeEnumSchema = TotalTypeEnumSchema;
1957
2258
  exports.UcpBaseSchema = UcpBaseSchema;
1958
2259
  exports.UcpBusinessSchema = UcpBusinessSchema;
2260
+ exports.UcpDiscoveryBusinessProfileSchema = UcpDiscoveryBusinessProfileSchema;
2261
+ exports.UcpDiscoveryPlatformProfileSchema = UcpDiscoveryPlatformProfileSchema;
1959
2262
  exports.UcpDiscoveryProfileSchema = UcpDiscoveryProfileSchema;
1960
2263
  exports.UcpEntitySchema = UcpEntitySchema;
1961
2264
  exports.UcpPlatformSchema = UcpPlatformSchema;
1962
2265
  exports.UcpResponseCheckoutSchema = UcpResponseCheckoutSchema;
1963
2266
  exports.UcpResponseOrderSchema = UcpResponseOrderSchema;
1964
2267
  exports.UcpReverseDomainNameSchema = UcpReverseDomainNameSchema;
2268
+ exports.UcpSigningKeySchema = UcpSigningKeySchema;
1965
2269
  exports.UcpVersionSchema = UcpVersionSchema;