@omnixhq/ucp-js-sdk 1.0.0 → 1.0.2-draft.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (6) hide show
  1. package/README.md +111 -28
  2. package/dist/index.cjs +2598 -1090
  3. package/dist/index.d.cts +22844 -10173
  4. package/dist/index.d.mts +22844 -10173
  5. package/dist/index.mjs +2539 -1085
  6. package/package.json +45 -2
package/dist/index.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as z$1 from "zod";
2
- import { z } from "zod";
3
2
  //#region src/spec_generated.ts
4
3
  const CapabilityBaseSchema = z$1.intersection(z$1.object({
5
4
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
@@ -7,56 +6,173 @@ const CapabilityBaseSchema = z$1.intersection(z$1.object({
7
6
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
8
7
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
9
8
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
10
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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() }));
9
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
10
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
11
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
12
+ const passed = schemas.length - errors.length;
13
+ if (passed !== 1) ctx.addIssue(errors.length ? {
14
+ path: ctx.path,
15
+ code: "invalid_union",
16
+ unionErrors: errors,
17
+ message: "Invalid input: Should pass single schema. Passed " + passed
18
+ } : {
19
+ path: ctx.path,
20
+ code: "custom",
21
+ message: "Invalid input: Should pass single schema. Passed " + passed
22
+ });
23
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() }));
11
24
  const CapabilityPlatformSchema = z$1.intersection(z$1.intersection(z$1.object({
12
25
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
13
26
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
14
27
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
15
28
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
16
29
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
17
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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() })), z$1.record(z$1.string(), z$1.unknown())).describe("Full capability declaration for platform-level discovery. Includes spec/schema URLs for agent fetching.");
30
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
31
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
32
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
33
+ const passed = schemas.length - errors.length;
34
+ if (passed !== 1) ctx.addIssue(errors.length ? {
35
+ path: ctx.path,
36
+ code: "invalid_union",
37
+ unionErrors: errors,
38
+ message: "Invalid input: Should pass single schema. Passed " + passed
39
+ } : {
40
+ path: ctx.path,
41
+ code: "custom",
42
+ message: "Invalid input: Should pass single schema. Passed " + passed
43
+ });
44
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })), z$1.record(z$1.string(), z$1.unknown())).describe("Full capability declaration for platform-level discovery. Includes spec/schema URLs for agent fetching.");
18
45
  const CapabilityBusinessSchema = z$1.intersection(z$1.object({
19
46
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
20
47
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
21
48
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
22
49
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
23
50
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
24
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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.");
51
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
52
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
53
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
54
+ const passed = schemas.length - errors.length;
55
+ if (passed !== 1) ctx.addIssue(errors.length ? {
56
+ path: ctx.path,
57
+ code: "invalid_union",
58
+ unionErrors: errors,
59
+ message: "Invalid input: Should pass single schema. Passed " + passed
60
+ } : {
61
+ path: ctx.path,
62
+ code: "custom",
63
+ message: "Invalid input: Should pass single schema. Passed " + passed
64
+ });
65
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })).describe("Capability configuration for business/merchant level. May include business-specific config overrides.");
25
66
  const CapabilityResponseSchema = z$1.intersection(z$1.object({
26
67
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
27
68
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
28
69
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
29
70
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
30
71
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
31
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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.");
72
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
73
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
74
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
75
+ const passed = schemas.length - errors.length;
76
+ if (passed !== 1) ctx.addIssue(errors.length ? {
77
+ path: ctx.path,
78
+ code: "invalid_union",
79
+ unionErrors: errors,
80
+ message: "Invalid input: Should pass single schema. Passed " + passed
81
+ } : {
82
+ path: ctx.path,
83
+ code: "custom",
84
+ message: "Invalid input: Should pass single schema. Passed " + passed
85
+ });
86
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })).describe("Capability reference in responses. Only name/version required to confirm active capabilities.");
87
+ const IdentityLinkingPlatformSchema = z$1.intersection(z$1.intersection(z$1.object({
88
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
89
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
90
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
91
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
92
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
93
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
94
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
95
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
96
+ const passed = schemas.length - errors.length;
97
+ if (passed !== 1) ctx.addIssue(errors.length ? {
98
+ path: ctx.path,
99
+ code: "invalid_union",
100
+ unionErrors: errors,
101
+ message: "Invalid input: Should pass single schema. Passed " + passed
102
+ } : {
103
+ path: ctx.path,
104
+ code: "custom",
105
+ message: "Invalid input: Should pass single schema. Passed " + passed
106
+ });
107
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })), z$1.record(z$1.string(), z$1.unknown())).describe("Full capability declaration for platform-level discovery. Includes spec/schema URLs for agent fetching.");
108
+ const IdentityLinkingBusinessSchema = z$1.intersection(z$1.intersection(z$1.object({
109
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
110
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
111
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
112
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
113
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
114
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
115
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
116
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
117
+ const passed = schemas.length - errors.length;
118
+ if (passed !== 1) ctx.addIssue(errors.length ? {
119
+ path: ctx.path,
120
+ code: "invalid_union",
121
+ unionErrors: errors,
122
+ message: "Invalid input: Should pass single schema. Passed " + passed
123
+ } : {
124
+ path: ctx.path,
125
+ code: "custom",
126
+ message: "Invalid input: Should pass single schema. Passed " + passed
127
+ });
128
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })).describe("Capability configuration for business/merchant level. May include business-specific config overrides."), z$1.object({ "config": z$1.object({ "supported_mechanisms": z$1.array(z$1.object({ "type": z$1.string().describe("The mechanism type discriminator. Known values: 'oauth2'. Specific mechanism schemas constrain this to a constant value.") }).passthrough().describe("Base definition for any authentication mechanism. The 'type' field discriminates between known mechanism schemas (e.g., oauth2). Unknown types pass through with only the base requirement, enabling forward-compatible extensibility. Note: this open base schema does not enforce field requirements for known types — use $defs/oauth2 directly to validate an oauth2 mechanism object explicitly.")).min(1) }) }));
129
+ const IdentityLinkingIdentityScopesSchema = z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-zA-Z0-9][a-zA-Z0-9_\\-]*(\\.[a-zA-Z0-9][a-zA-Z0-9_\\-]*)*\\.scopes\\.[a-zA-Z0-9][a-zA-Z0-9_\\-]*(\\.[a-zA-Z0-9][a-zA-Z0-9_\\-]*)*$"))).min(1).refine((arr) => arr.every((item, i) => arr.indexOf(item) == i), "All items must be unique!").describe("A custom UCP annotation placed at the root of a capability schema to declare the OAuth 2.0 scopes required to operate that capability. Scopes MUST use reverse DNS dot notation to prevent namespace collisions (e.g., 'dev.ucp.shopping.scopes.checkout_session' for UCP-defined scopes, 'com.example.scopes.my_capability' for third-party scopes). Platforms collect this annotation from every capability in the finalized negotiated intersection and use the union as the authorization scope set. This annotation is intentionally a plain JSON array so it is ignored by standard JSON Schema validators — it carries semantic meaning only to UCP-aware tooling. Absence of this annotation on a capability schema means that capability requires no dedicated scope.");
130
+ const IdentityLinkingMechanismSchema = z$1.object({ "type": z$1.string().describe("The mechanism type discriminator. Known values: 'oauth2'. Specific mechanism schemas constrain this to a constant value.") }).passthrough().describe("Base definition for any authentication mechanism. The 'type' field discriminates between known mechanism schemas (e.g., oauth2). Unknown types pass through with only the base requirement, enabling forward-compatible extensibility. Note: this open base schema does not enforce field requirements for known types — use $defs/oauth2 directly to validate an oauth2 mechanism object explicitly.");
131
+ const IdentityLinkingOauth2Schema = z$1.object({
132
+ "type": z$1.literal("oauth2").describe("OAuth 2.0 authentication mechanism."),
133
+ "issuer": z$1.string().url().describe("The authorization server URL, supporting RFC 8414 discovery."),
134
+ "discovery_endpoint": z$1.string().url().describe("Optional explicit URI to the authorization server's metadata (e.g., `https://auth.merchant.example.com/.well-known/openid-configuration`). If omitted, platforms construct discovery paths based on the `issuer`.").optional()
135
+ }).passthrough();
32
136
  const PaymentHandlerBaseSchema = z$1.intersection(z$1.object({
33
137
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
34
138
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
35
139
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
36
140
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
37
141
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
38
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown()));
142
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
143
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
144
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
145
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() })));
39
146
  const PaymentHandlerPlatformSchema = z$1.intersection(z$1.intersection(z$1.object({
40
147
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
41
148
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
42
149
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
43
150
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
44
151
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
45
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())), z$1.record(z$1.string(), z$1.unknown())).describe("Platform declaration for discovery profiles. May include partial config state required for discovery.");
152
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
153
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
154
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
155
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))), z$1.record(z$1.string(), z$1.unknown())).describe("Platform declaration for discovery profiles. May include partial config state required for discovery.");
46
156
  const PaymentHandlerBusinessSchema = z$1.intersection(z$1.object({
47
157
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
48
158
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
49
159
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
50
160
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
51
161
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
52
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())).describe("Business declaration for discovery profiles. May include partial config state required for discovery.");
162
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
163
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
164
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
165
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))).describe("Business declaration for discovery profiles. May include partial config state required for discovery.");
53
166
  const PaymentHandlerResponseSchema = z$1.intersection(z$1.object({
54
167
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
55
168
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
56
169
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
57
170
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
58
171
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
59
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())).describe("Handler reference in responses. May include full config state for runtime usage of the handler.");
172
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
173
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
174
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
175
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))).describe("Handler reference in responses. May include full config state for runtime usage of the handler.");
60
176
  const ServiceBaseSchema = z$1.intersection(z$1.object({
61
177
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
62
178
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -112,7 +228,10 @@ const ServiceBusinessSchema = z$1.intersection(z$1.intersection(z$1.object({
112
228
  z$1.object({ "transport": z$1.literal("a2a").optional() }),
113
229
  z$1.object({
114
230
  "transport": z$1.literal("embedded").optional(),
115
- "config": z$1.object({ "delegate": z$1.array(z$1.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()
231
+ "config": z$1.object({
232
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In checkout responses, confirms accepted delegations for this session.").optional(),
233
+ "color_scheme": z$1.array(z$1.enum(["light", "dark"])).describe("Color schemes the business supports. Hosts use ec_color_scheme query parameter to request a scheme from this list.").optional()
234
+ }).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()
116
235
  })
117
236
  ])).describe("Service binding for business/merchant configuration. May override platform endpoints.");
118
237
  const ServiceResponseSchema = z$1.intersection(z$1.intersection(z$1.object({
@@ -135,7 +254,10 @@ const ServiceResponseSchema = z$1.intersection(z$1.intersection(z$1.object({
135
254
  z$1.object({ "transport": z$1.literal("a2a").optional() }),
136
255
  z$1.object({
137
256
  "transport": z$1.literal("embedded").optional(),
138
- "config": z$1.object({ "delegate": z$1.array(z$1.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()
257
+ "config": z$1.object({
258
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In checkout responses, confirms accepted delegations for this session.").optional(),
259
+ "color_scheme": z$1.array(z$1.enum(["light", "dark"])).describe("Color schemes the business supports. Hosts use ec_color_scheme query parameter to request a scheme from this list.").optional()
260
+ }).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()
139
261
  })
140
262
  ])).describe("Service binding in API responses. Includes per-resource transport configuration via typed config.");
141
263
  const Ap2MandateMerchantAuthorizationSchema = z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Za-z0-9_-]+\\.\\.[A-Za-z0-9_-]+$")).describe("JWS Detached Content signature (RFC 7515 Appendix F) over the checkout response body (excluding ap2 field). Format: `<base64url-header>..<base64url-signature>`. The header MUST contain 'alg' (ES256/ES384/ES512) and 'kid' claims. The signature covers both the header and JCS-canonicalized checkout payload.");
@@ -162,15 +284,16 @@ const BuyerConsentBuyerSchema = z$1.intersection(z$1.object({
162
284
  "last_name": z$1.string().describe("Last name of the buyer.").optional(),
163
285
  "email": z$1.string().describe("Email of the buyer.").optional(),
164
286
  "phone_number": z$1.string().describe("E.164 standard.").optional()
165
- }), z$1.object({ "consent": z$1.object({
287
+ }).passthrough(), z$1.object({ "consent": z$1.object({
166
288
  "analytics": z$1.boolean().describe("Consent for analytics and performance tracking.").optional(),
167
289
  "preferences": z$1.boolean().describe("Consent for storing user preferences.").optional(),
168
290
  "marketing": z$1.boolean().describe("Consent for marketing communications.").optional(),
169
291
  "sale_of_data": z$1.boolean().describe("Consent for selling data to third parties (CCPA).").optional()
170
292
  }).describe("Consent tracking fields.").optional() })).describe("Buyer object extended with consent tracking.");
171
- const CheckoutSchema = z$1.object({
293
+ const CartSchema = z$1.object({
172
294
  "ucp": z$1.intersection(z$1.object({
173
295
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
296
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
174
297
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
175
298
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
176
299
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -192,131 +315,124 @@ const CheckoutSchema = z$1.object({
192
315
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
193
316
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
194
317
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
195
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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(),
196
- "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
197
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
198
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
199
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
200
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
201
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
202
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
203
- }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
204
- "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
205
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
206
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
207
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
208
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
209
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
210
- }).describe("Shared foundation for all UCP entities."), z$1.object({
211
- "transport": z$1.enum([
212
- "rest",
213
- "mcp",
214
- "a2a",
215
- "embedded"
216
- ]).describe("Transport protocol for this service binding."),
217
- "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
218
- })), z$1.union([
219
- z$1.object({ "transport": z$1.literal("rest").optional() }),
220
- z$1.object({ "transport": z$1.literal("mcp").optional() }),
221
- z$1.object({ "transport": z$1.literal("a2a").optional() }),
222
- z$1.object({
223
- "transport": z$1.literal("embedded").optional(),
224
- "config": z$1.object({ "delegate": z$1.array(z$1.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()
225
- })
226
- ])).describe("Service binding in API responses. Includes per-resource transport configuration via typed config."))).optional(),
227
- "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
228
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
229
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
230
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
231
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
232
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
233
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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(),
318
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
319
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
320
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
321
+ const passed = schemas.length - errors.length;
322
+ if (passed !== 1) ctx.addIssue(errors.length ? {
323
+ path: ctx.path,
324
+ code: "invalid_union",
325
+ unionErrors: errors,
326
+ message: "Invalid input: Should pass single schema. Passed " + passed
327
+ } : {
328
+ path: ctx.path,
329
+ code: "custom",
330
+ message: "Invalid input: Should pass single schema. Passed " + passed
331
+ });
332
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
234
333
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
235
334
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
236
335
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
237
336
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
238
337
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
239
338
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
240
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())).describe("Handler reference in responses. May include full config state for runtime usage of the handler.")))
241
- })).describe("UCP metadata for checkout responses."),
242
- "id": z$1.string().describe("Unique identifier of the checkout session."),
339
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
340
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
341
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
342
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
343
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
344
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
345
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
346
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
347
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
348
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
349
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
350
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
351
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
352
+ const passed = schemas.length - errors.length;
353
+ if (passed !== 1) ctx.addIssue(errors.length ? {
354
+ path: ctx.path,
355
+ code: "invalid_union",
356
+ unionErrors: errors,
357
+ message: "Invalid input: Should pass single schema. Passed " + passed
358
+ } : {
359
+ path: ctx.path,
360
+ code: "custom",
361
+ message: "Invalid input: Should pass single schema. Passed " + passed
362
+ });
363
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })).describe("Capability reference in responses. Only name/version required to confirm active capabilities."))).optional() })).describe("UCP metadata for cart responses. No payment handlers needed pre-checkout."),
364
+ "id": z$1.string().describe("Unique cart identifier."),
243
365
  "line_items": z$1.array(z$1.object({
244
366
  "id": z$1.string(),
245
367
  "item": z$1.object({
246
- "id": z$1.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."),
368
+ "id": z$1.string().describe("The product identifier, often the SKU, required to resolve the product details associated with this line item. Should be recognized by both the Platform, and the Business."),
247
369
  "title": z$1.string().describe("Product title."),
248
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
370
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
249
371
  "image_url": z$1.string().url().describe("Product image URI.").optional()
250
372
  }),
251
373
  "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
252
374
  "totals": z$1.array(z$1.object({
253
- "type": z$1.enum([
254
- "items_discount",
255
- "subtotal",
256
- "discount",
257
- "fulfillment",
258
- "tax",
259
- "fee",
260
- "total"
261
- ]).describe("Type of total categorization."),
375
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
262
376
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
263
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
264
- })).describe("Line item totals breakdown."),
377
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
378
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
265
379
  "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
266
- }).describe("Line item object. Expected to use the currency of the parent object.")).describe("List of line items being checked out."),
380
+ }).describe("Line item object. Expected to use the currency of the parent object.")).describe("Cart line items. Same structure as checkout. Full replacement on update."),
381
+ "context": z$1.object({
382
+ "address_country": z$1.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(),
383
+ "address_region": z$1.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(),
384
+ "postal_code": z$1.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
385
+ "intent": z$1.string().describe("Background context describing buyer's intent (e.g., 'looking for a gift under $50', 'need something durable for outdoor use'). Informs relevance, recommendations, and personalization.").optional(),
386
+ "language": z$1.string().describe("Preferred language for content. Use IETF BCP 47 language tags (e.g., 'en', 'fr-CA', 'zh-Hans'). For REST, equivalent to Accept-Language header—platforms SHOULD fall back to Accept-Language when this field is absent; when provided, overrides Accept-Language. Businesses MAY return content in a different language if unavailable.").optional(),
387
+ "currency": z$1.string().describe("Preferred currency (ISO 4217, e.g., 'EUR', 'USD'). Businesses determine presentment currency from context and authoritative signals; this hint MAY inform selection in multi-currency markets. Also serves as the denomination for price filter values — platforms SHOULD include this field when sending price filters. Response prices include explicit currency confirming the resolution.").optional(),
388
+ "eligibility": z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Reverse-domain identifier used for collision-safe namespacing of capabilities, services, handlers, eligibility claims, and extension-contributed keys. Must contain at least two dot-separated segments (e.g., 'dev.ucp.shopping.checkout', 'com.example.loyalty_gold').")).refine((arr) => arr.every((item, i) => arr.indexOf(item) == i), "All items must be unique!").describe("Buyer claims about eligible benefits such as loyalty membership, payment instrument perks, and similar. Recognized claims MAY inform the Business response (e.g., member-only product availability, adjusted pricing in catalog, provisional discounts at cart or checkout). Businesses MUST ignore unrecognized values without error. Values MUST use reverse-domain naming (e.g., 'com.example.loyalty_gold', 'org.school.student') and MUST be non-identifying.").optional()
389
+ }).passthrough().describe("Buyer signals for localization (country, region, postal_code). Merchant uses for pricing, availability, currency. Falls back to geo-IP if omitted.").optional(),
390
+ "signals": z$1.object({
391
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
392
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
393
+ }).passthrough().describe("Environment data provided by the platform to support authorization and abuse prevention. Values MUST NOT be buyer-asserted claims — platforms provide signals based on direct observation or independently verifiable third-party attestations. All signal keys MUST use reverse-domain naming to ensure provenance and prevent collisions when multiple extensions contribute to the shared namespace.").optional(),
267
394
  "buyer": z$1.object({
268
395
  "first_name": z$1.string().describe("First name of the buyer.").optional(),
269
396
  "last_name": z$1.string().describe("Last name of the buyer.").optional(),
270
397
  "email": z$1.string().describe("Email of the buyer.").optional(),
271
398
  "phone_number": z$1.string().describe("E.164 standard.").optional()
272
- }).describe("Representation of the buyer.").optional(),
273
- "context": z$1.object({
274
- "address_country": z$1.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(),
275
- "address_region": z$1.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(),
276
- "postal_code": z$1.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional()
277
- }).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(),
278
- "status": z$1.enum([
279
- "incomplete",
280
- "requires_escalation",
281
- "ready_for_complete",
282
- "complete_in_progress",
283
- "completed",
284
- "canceled"
285
- ]).describe("Checkout state indicating the current phase and required action. See Checkout Status lifecycle documentation for state transition details."),
286
- "currency": z$1.string().describe("ISO 4217 currency code reflecting the merchant's market determination. Derived from address, context, and geo IP—buyers provide signals, merchants determine currency."),
287
- "totals": z$1.array(z$1.object({
288
- "type": z$1.enum([
289
- "items_discount",
290
- "subtotal",
291
- "discount",
292
- "fulfillment",
293
- "tax",
294
- "fee",
295
- "total"
296
- ]).describe("Type of total categorization."),
399
+ }).passthrough().describe("Optional buyer information for personalized estimates.").optional(),
400
+ "currency": z$1.string().describe("ISO 4217 currency code. Determined by merchant based on context or geo-IP."),
401
+ "totals": z$1.array(z$1.intersection(z$1.intersection(z$1.object({
402
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
297
403
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
298
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
299
- })).describe("Different cart totals."),
404
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
405
+ }).describe("A cost breakdown entry with a category, amount, and optional display text."), z$1.object({
406
+ "amount": z$1.number().int().describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD). May be negative — the sign is intrinsic to the value (e.g., discounts are negative, charges are positive).").optional(),
407
+ "lines": z$1.array(z$1.object({
408
+ "display_text": z$1.string().describe("Human-readable label for this sub-line."),
409
+ "amount": z$1.number().int().describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD). May be negative — the sign is intrinsic to the value (e.g., discounts are negative, charges are positive).")
410
+ }).describe("Sub-line entry. Additional metadata MAY be included.")).describe("Optional itemized breakdown. The parent entry is always rendered; lines are supplementary. Sum of line amounts MUST equal the parent entry amount.").optional()
411
+ })), z$1.intersection(z$1.any(), z$1.intersection(z$1.any(), z$1.any())))).describe("Estimated cost breakdown. May be partial if shipping/tax not yet calculable."),
300
412
  "messages": z$1.array(z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
301
413
  const schemas = [
302
414
  z$1.object({
303
415
  "type": z$1.literal("error").describe("Message type discriminator."),
304
- "code": z$1.string().describe("Error code. Possible values include: missing, invalid, out_of_stock, payment_declined, requires_sign_in, requires_3ds, requires_identity_linking. Freeform codes also allowed."),
416
+ "code": z$1.string().describe("Error code identifying the type of error. Standard errors are defined in specification (see examples), and have standardized semantics; freeform codes are permitted."),
305
417
  "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
306
418
  "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
307
419
  "content": z$1.string().describe("Human-readable message."),
308
420
  "severity": z$1.enum([
309
421
  "recoverable",
310
422
  "requires_buyer_input",
311
- "requires_buyer_review"
312
- ]).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'.")
423
+ "requires_buyer_review",
424
+ "unrecoverable"
425
+ ]).describe("Reflects the resource state and recommended action. 'recoverable': platform can resolve by modifying inputs and retrying 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. 'unrecoverable': no valid resource exists to act on, retry with new resource or inputs. Errors with 'requires_*' severity contribute to 'status: requires_escalation'.")
313
426
  }),
314
427
  z$1.object({
315
428
  "type": z$1.literal("warning").describe("Message type discriminator."),
316
429
  "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
317
430
  "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
318
431
  "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
319
- "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain")
432
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
433
+ "presentation": z$1.string().describe("Rendering contract for this warning. 'notice' (default): platform MUST display, MAY dismiss. 'disclosure': platform MUST display in proximity to the path-referenced component, MUST NOT hide or auto-dismiss. See specification for full contract.").default("notice"),
434
+ "image_url": z$1.string().url().describe("URL to a required visual element (e.g., warning symbol, energy class label).").optional(),
435
+ "url": z$1.string().url().describe("Reference URL for more information (e.g., regulatory site, registry entry, policy page).").optional()
320
436
  }),
321
437
  z$1.object({
322
438
  "type": z$1.literal("info").describe("Message type discriminator."),
@@ -338,352 +454,119 @@ const CheckoutSchema = z$1.object({
338
454
  code: "custom",
339
455
  message: "Invalid input: Should pass single schema. Passed " + passed
340
456
  });
341
- })).describe("Container for error, warning, or info messages.")).describe("List of messages with error and info about the checkout session state.").optional(),
457
+ })).describe("Container for error, warning, or info messages.")).describe("Validation messages, warnings, or informational notices.").optional(),
342
458
  "links": z$1.array(z$1.object({
343
459
  "type": z$1.string().describe("Type of link. Well-known values: `privacy_policy`, `terms_of_service`, `refund_policy`, `shipping_policy`, `faq`. Consumers SHOULD handle unknown values gracefully by displaying them using the `title` field or omitting the link."),
344
460
  "url": z$1.string().url().describe("The actual URL pointing to the content to be displayed."),
345
461
  "title": z$1.string().describe("Optional display text for the link. When provided, use this instead of generating from type.").optional()
346
- })).describe("Links to be displayed by the platform (Privacy Policy, TOS). Mandatory for legal compliance."),
347
- "expires_at": z$1.string().datetime({ offset: true }).describe("RFC 3339 expiry timestamp. Default TTL is 6 hours from creation if not sent.").optional(),
348
- "continue_url": z$1.string().url().describe("URL for checkout handoff and session recovery. MUST be provided when status is requires_escalation. See specification for format and availability requirements.").optional(),
349
- "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
350
- "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
351
- "handler_id": z$1.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
352
- "type": z$1.string().describe("The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas will constrain this to a constant value."),
353
- "billing_address": z$1.object({
354
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
355
- "street_address": z$1.string().describe("The street address.").optional(),
356
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
357
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
358
- "address_country": z$1.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(),
359
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
360
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
361
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
362
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
363
- }).describe("The billing address associated with this payment method.").optional(),
364
- "credential": z$1.object({ "type": z$1.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(),
365
- "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
366
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({ "selected": z$1.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(),
367
- "order": z$1.object({
368
- "id": z$1.string().describe("Unique order identifier."),
369
- "permalink_url": z$1.string().url().describe("Permalink to access the order on merchant site.")
370
- }).describe("Details about an order created for this checkout session.").optional()
371
- }).describe("Base checkout schema. Extensions compose onto this using allOf.");
372
- const CheckoutCreateRequestSchema = z$1.object({
462
+ })).describe("Optional merchant links (policies, FAQs).").optional(),
463
+ "continue_url": z$1.string().url().describe("URL for cart handoff and session recovery. Enables sharing and human-in-the-loop flows.").optional(),
464
+ "expires_at": z$1.string().datetime({ offset: true }).describe("Cart expiry timestamp (RFC 3339). Optional.").optional()
465
+ }).passthrough().describe("Shopping cart with estimated pricing before checkout. Lightweight pre-purchase exploration with no payment info or complex status states.");
466
+ const CartCreateRequestSchema = z$1.object({
373
467
  "line_items": z$1.array(z$1.object({
374
468
  "id": z$1.string(),
375
469
  "item": z$1.object({
376
- "id": z$1.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."),
470
+ "id": z$1.string().describe("The product identifier, often the SKU, required to resolve the product details associated with this line item. Should be recognized by both the Platform, and the Business."),
377
471
  "title": z$1.string().describe("Product title."),
378
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
472
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
379
473
  "image_url": z$1.string().url().describe("Product image URI.").optional()
380
474
  }),
381
475
  "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
382
476
  "totals": z$1.array(z$1.object({
383
- "type": z$1.enum([
384
- "items_discount",
385
- "subtotal",
386
- "discount",
387
- "fulfillment",
388
- "tax",
389
- "fee",
390
- "total"
391
- ]).describe("Type of total categorization."),
477
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
392
478
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
393
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
394
- })).describe("Line item totals breakdown."),
479
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
480
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
395
481
  "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
396
- }).describe("Line item object. Expected to use the currency of the parent object.")).describe("List of line items being checked out."),
482
+ }).describe("Line item object. Expected to use the currency of the parent object.")).describe("Cart line items. Same structure as checkout. Full replacement on update."),
483
+ "context": z$1.object({
484
+ "address_country": z$1.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(),
485
+ "address_region": z$1.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(),
486
+ "postal_code": z$1.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
487
+ "intent": z$1.string().describe("Background context describing buyer's intent (e.g., 'looking for a gift under $50', 'need something durable for outdoor use'). Informs relevance, recommendations, and personalization.").optional(),
488
+ "language": z$1.string().describe("Preferred language for content. Use IETF BCP 47 language tags (e.g., 'en', 'fr-CA', 'zh-Hans'). For REST, equivalent to Accept-Language header—platforms SHOULD fall back to Accept-Language when this field is absent; when provided, overrides Accept-Language. Businesses MAY return content in a different language if unavailable.").optional(),
489
+ "currency": z$1.string().describe("Preferred currency (ISO 4217, e.g., 'EUR', 'USD'). Businesses determine presentment currency from context and authoritative signals; this hint MAY inform selection in multi-currency markets. Also serves as the denomination for price filter values — platforms SHOULD include this field when sending price filters. Response prices include explicit currency confirming the resolution.").optional(),
490
+ "eligibility": z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Reverse-domain identifier used for collision-safe namespacing of capabilities, services, handlers, eligibility claims, and extension-contributed keys. Must contain at least two dot-separated segments (e.g., 'dev.ucp.shopping.checkout', 'com.example.loyalty_gold').")).refine((arr) => arr.every((item, i) => arr.indexOf(item) == i), "All items must be unique!").describe("Buyer claims about eligible benefits such as loyalty membership, payment instrument perks, and similar. Recognized claims MAY inform the Business response (e.g., member-only product availability, adjusted pricing in catalog, provisional discounts at cart or checkout). Businesses MUST ignore unrecognized values without error. Values MUST use reverse-domain naming (e.g., 'com.example.loyalty_gold', 'org.school.student') and MUST be non-identifying.").optional()
491
+ }).passthrough().describe("Buyer signals for localization (country, region, postal_code). Merchant uses for pricing, availability, currency. Falls back to geo-IP if omitted.").optional(),
492
+ "signals": z$1.object({
493
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
494
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
495
+ }).passthrough().describe("Environment data provided by the platform to support authorization and abuse prevention. Values MUST NOT be buyer-asserted claims — platforms provide signals based on direct observation or independently verifiable third-party attestations. All signal keys MUST use reverse-domain naming to ensure provenance and prevent collisions when multiple extensions contribute to the shared namespace.").optional(),
397
496
  "buyer": z$1.object({
398
497
  "first_name": z$1.string().describe("First name of the buyer.").optional(),
399
498
  "last_name": z$1.string().describe("Last name of the buyer.").optional(),
400
499
  "email": z$1.string().describe("Email of the buyer.").optional(),
401
500
  "phone_number": z$1.string().describe("E.164 standard.").optional()
402
- }).describe("Representation of the buyer.").optional(),
403
- "context": z$1.object({
404
- "address_country": z$1.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(),
405
- "address_region": z$1.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(),
406
- "postal_code": z$1.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional()
407
- }).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(),
408
- "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
409
- "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
410
- "handler_id": z$1.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
411
- "type": z$1.string().describe("The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas will constrain this to a constant value."),
412
- "billing_address": z$1.object({
413
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
414
- "street_address": z$1.string().describe("The street address.").optional(),
415
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
416
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
417
- "address_country": z$1.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(),
418
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
419
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
420
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
421
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
422
- }).describe("The billing address associated with this payment method.").optional(),
423
- "credential": z$1.object({ "type": z$1.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(),
424
- "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
425
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({ "selected": z$1.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()
501
+ }).passthrough().describe("Optional buyer information for personalized estimates.").optional()
426
502
  }).strict();
427
- const CheckoutUpdateRequestSchema = z$1.object({
428
- "id": z$1.string().describe("Unique identifier of the checkout session."),
503
+ const CartUpdateRequestSchema = z$1.object({
504
+ "id": z$1.string().describe("Unique cart identifier."),
429
505
  "line_items": z$1.array(z$1.object({
430
506
  "id": z$1.string(),
431
507
  "item": z$1.object({
432
- "id": z$1.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."),
508
+ "id": z$1.string().describe("The product identifier, often the SKU, required to resolve the product details associated with this line item. Should be recognized by both the Platform, and the Business."),
433
509
  "title": z$1.string().describe("Product title."),
434
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
510
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
435
511
  "image_url": z$1.string().url().describe("Product image URI.").optional()
436
512
  }),
437
513
  "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
438
514
  "totals": z$1.array(z$1.object({
439
- "type": z$1.enum([
440
- "items_discount",
441
- "subtotal",
442
- "discount",
443
- "fulfillment",
444
- "tax",
445
- "fee",
446
- "total"
447
- ]).describe("Type of total categorization."),
515
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
448
516
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
449
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
450
- })).describe("Line item totals breakdown."),
517
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
518
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
451
519
  "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
452
- }).describe("Line item object. Expected to use the currency of the parent object.")).describe("List of line items being checked out."),
520
+ }).describe("Line item object. Expected to use the currency of the parent object.")).describe("Cart line items. Same structure as checkout. Full replacement on update."),
521
+ "context": z$1.object({
522
+ "address_country": z$1.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(),
523
+ "address_region": z$1.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(),
524
+ "postal_code": z$1.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
525
+ "intent": z$1.string().describe("Background context describing buyer's intent (e.g., 'looking for a gift under $50', 'need something durable for outdoor use'). Informs relevance, recommendations, and personalization.").optional(),
526
+ "language": z$1.string().describe("Preferred language for content. Use IETF BCP 47 language tags (e.g., 'en', 'fr-CA', 'zh-Hans'). For REST, equivalent to Accept-Language header—platforms SHOULD fall back to Accept-Language when this field is absent; when provided, overrides Accept-Language. Businesses MAY return content in a different language if unavailable.").optional(),
527
+ "currency": z$1.string().describe("Preferred currency (ISO 4217, e.g., 'EUR', 'USD'). Businesses determine presentment currency from context and authoritative signals; this hint MAY inform selection in multi-currency markets. Also serves as the denomination for price filter values — platforms SHOULD include this field when sending price filters. Response prices include explicit currency confirming the resolution.").optional(),
528
+ "eligibility": z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Reverse-domain identifier used for collision-safe namespacing of capabilities, services, handlers, eligibility claims, and extension-contributed keys. Must contain at least two dot-separated segments (e.g., 'dev.ucp.shopping.checkout', 'com.example.loyalty_gold').")).refine((arr) => arr.every((item, i) => arr.indexOf(item) == i), "All items must be unique!").describe("Buyer claims about eligible benefits such as loyalty membership, payment instrument perks, and similar. Recognized claims MAY inform the Business response (e.g., member-only product availability, adjusted pricing in catalog, provisional discounts at cart or checkout). Businesses MUST ignore unrecognized values without error. Values MUST use reverse-domain naming (e.g., 'com.example.loyalty_gold', 'org.school.student') and MUST be non-identifying.").optional()
529
+ }).passthrough().describe("Buyer signals for localization (country, region, postal_code). Merchant uses for pricing, availability, currency. Falls back to geo-IP if omitted.").optional(),
530
+ "signals": z$1.object({
531
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
532
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
533
+ }).passthrough().describe("Environment data provided by the platform to support authorization and abuse prevention. Values MUST NOT be buyer-asserted claims — platforms provide signals based on direct observation or independently verifiable third-party attestations. All signal keys MUST use reverse-domain naming to ensure provenance and prevent collisions when multiple extensions contribute to the shared namespace.").optional(),
453
534
  "buyer": z$1.object({
454
535
  "first_name": z$1.string().describe("First name of the buyer.").optional(),
455
536
  "last_name": z$1.string().describe("Last name of the buyer.").optional(),
456
537
  "email": z$1.string().describe("Email of the buyer.").optional(),
457
538
  "phone_number": z$1.string().describe("E.164 standard.").optional()
458
- }).describe("Representation of the buyer.").optional(),
459
- "context": z$1.object({
460
- "address_country": z$1.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(),
461
- "address_region": z$1.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(),
462
- "postal_code": z$1.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional()
463
- }).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(),
464
- "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
465
- "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
466
- "handler_id": z$1.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
467
- "type": z$1.string().describe("The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas will constrain this to a constant value."),
468
- "billing_address": z$1.object({
469
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
470
- "street_address": z$1.string().describe("The street address.").optional(),
471
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
472
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
473
- "address_country": z$1.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(),
474
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
475
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
476
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
477
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
478
- }).describe("The billing address associated with this payment method.").optional(),
479
- "credential": z$1.object({ "type": z$1.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(),
480
- "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
481
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({ "selected": z$1.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()
539
+ }).passthrough().describe("Optional buyer information for personalized estimates.").optional()
482
540
  }).strict();
483
- const CheckoutCompleteRequestSchema = z$1.object({ "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
484
- "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
485
- "handler_id": z$1.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
486
- "type": z$1.string().describe("The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas will constrain this to a constant value."),
487
- "billing_address": z$1.object({
488
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
489
- "street_address": z$1.string().describe("The street address.").optional(),
490
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
491
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
492
- "address_country": z$1.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(),
493
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
494
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
495
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
496
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
497
- }).describe("The billing address associated with this payment method.").optional(),
498
- "credential": z$1.object({ "type": z$1.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(),
499
- "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
500
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({ "selected": z$1.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();
501
- const DiscountAllocationSchema = z$1.object({
502
- "path": z$1.string().describe("JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping')."),
503
- "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in minor (cents) currency units.")
504
- }).describe("Breakdown of how a discount amount was allocated to a specific target.");
505
- const DiscountAppliedDiscountSchema = z$1.object({
506
- "code": z$1.string().describe("The discount code. Omitted for automatic discounts.").optional(),
507
- "title": z$1.string().describe("Human-readable discount name (e.g., 'Summer Sale 20% Off')."),
508
- "amount": z$1.number().int().gte(0).describe("Total discount amount in minor (cents) currency units."),
509
- "automatic": z$1.boolean().describe("True if applied automatically by merchant rules (no code required).").default(false),
510
- "method": z$1.enum(["each", "across"]).describe("Allocation method. 'each' = applied independently per item. 'across' = split proportionally by value.").optional(),
511
- "priority": z$1.number().int().gte(1).describe("Stacking order for discount calculation. Lower numbers applied first (1 = first).").optional(),
512
- "allocations": z$1.array(z$1.object({
513
- "path": z$1.string().describe("JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping')."),
514
- "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in minor (cents) currency units.")
515
- }).describe("Breakdown of how a discount amount was allocated to a specific target.")).describe("Breakdown of where this discount was allocated. Sum of allocation amounts equals total amount.").optional()
516
- }).describe("A discount that was successfully applied.");
517
- const DiscountDiscountsObjectSchema = z$1.object({
518
- "codes": z$1.array(z$1.string()).describe("Discount codes to apply. Case-insensitive. Replaces previously submitted codes. Send empty array to clear.").optional(),
519
- "applied": z$1.array(z$1.object({
520
- "code": z$1.string().describe("The discount code. Omitted for automatic discounts.").optional(),
521
- "title": z$1.string().describe("Human-readable discount name (e.g., 'Summer Sale 20% Off')."),
522
- "amount": z$1.number().int().gte(0).describe("Total discount amount in minor (cents) currency units."),
523
- "automatic": z$1.boolean().describe("True if applied automatically by merchant rules (no code required).").default(false),
524
- "method": z$1.enum(["each", "across"]).describe("Allocation method. 'each' = applied independently per item. 'across' = split proportionally by value.").optional(),
525
- "priority": z$1.number().int().gte(1).describe("Stacking order for discount calculation. Lower numbers applied first (1 = first).").optional(),
526
- "allocations": z$1.array(z$1.object({
527
- "path": z$1.string().describe("JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping')."),
528
- "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in minor (cents) currency units.")
529
- }).describe("Breakdown of how a discount amount was allocated to a specific target.")).describe("Breakdown of where this discount was allocated. Sum of allocation amounts equals total amount.").optional()
530
- }).describe("A discount that was successfully applied.")).describe("Discounts successfully applied (code-based and automatic).").readonly().optional()
531
- }).describe("Discount codes input and applied discounts output.");
532
- const FulfillmentExtensionFulfillmentOptionSchema = z$1.object({
533
- "id": z$1.string().describe("Unique fulfillment option identifier."),
534
- "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
535
- "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
536
- "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
537
- "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
538
- "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
539
- "totals": z$1.array(z$1.object({
540
- "type": z$1.enum([
541
- "items_discount",
542
- "subtotal",
543
- "discount",
544
- "fulfillment",
545
- "tax",
546
- "fee",
547
- "total"
548
- ]).describe("Type of total categorization."),
549
- "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
550
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
551
- })).describe("Fulfillment option totals breakdown.")
552
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).");
553
- const FulfillmentExtensionFulfillmentGroupSchema = z$1.object({
554
- "id": z$1.string().describe("Group identifier for referencing merchant-generated groups in updates."),
555
- "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs included in this group/package."),
556
- "options": z$1.array(z$1.object({
557
- "id": z$1.string().describe("Unique fulfillment option identifier."),
558
- "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
559
- "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
560
- "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
561
- "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
562
- "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
563
- "totals": z$1.array(z$1.object({
564
- "type": z$1.enum([
565
- "items_discount",
566
- "subtotal",
567
- "discount",
568
- "fulfillment",
569
- "tax",
570
- "fee",
571
- "total"
572
- ]).describe("Type of total categorization."),
573
- "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
574
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
575
- })).describe("Fulfillment option totals breakdown.")
576
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
577
- "selected_option_id": z$1.union([z$1.string().describe("ID of the selected fulfillment option for this group."), z$1.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
578
- }).describe("A merchant-generated package/group of line items with fulfillment options.");
579
- const FulfillmentExtensionFulfillmentMethodSchema = z$1.object({
580
- "id": z$1.string().describe("Unique fulfillment method identifier."),
581
- "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type."),
582
- "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs fulfilled via this method."),
583
- "destinations": z$1.array(z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
584
- const schemas = [z$1.record(z$1.string(), z$1.unknown()).and(z$1.intersection(z$1.object({
585
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
586
- "street_address": z$1.string().describe("The street address.").optional(),
587
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
588
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
589
- "address_country": z$1.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(),
590
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
591
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
592
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
593
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
594
- }), z$1.object({ "id": z$1.string().describe("ID specific to this shipping destination.") }))).describe("Shipping destination."), z$1.object({
595
- "id": z$1.string().describe("Unique location identifier."),
596
- "name": z$1.string().describe("Location name (e.g., store name)."),
597
- "address": z$1.object({
598
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
599
- "street_address": z$1.string().describe("The street address.").optional(),
600
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
601
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
602
- "address_country": z$1.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(),
603
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
604
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
605
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
606
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
607
- }).describe("Physical address of the location.").optional()
608
- }).describe("A pickup location (retail store, locker, etc.).")];
609
- const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
610
- const passed = schemas.length - errors.length;
611
- if (passed !== 1) ctx.addIssue(errors.length ? {
612
- path: ctx.path,
613
- code: "invalid_union",
614
- unionErrors: errors,
615
- message: "Invalid input: Should pass single schema. Passed " + passed
616
- } : {
617
- path: ctx.path,
618
- code: "custom",
619
- message: "Invalid input: Should pass single schema. Passed " + passed
620
- });
621
- })).describe("A destination for fulfillment.")).describe("Available destinations. For shipping: addresses. For pickup: retail locations.").optional(),
622
- "selected_destination_id": z$1.union([z$1.string().describe("ID of the selected destination."), z$1.null().describe("ID of the selected destination.")]).describe("ID of the selected destination.").optional(),
623
- "groups": z$1.array(z$1.object({
624
- "id": z$1.string().describe("Group identifier for referencing merchant-generated groups in updates."),
625
- "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs included in this group/package."),
626
- "options": z$1.array(z$1.object({
627
- "id": z$1.string().describe("Unique fulfillment option identifier."),
628
- "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
629
- "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
630
- "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
631
- "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
632
- "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
633
- "totals": z$1.array(z$1.object({
634
- "type": z$1.enum([
635
- "items_discount",
636
- "subtotal",
637
- "discount",
638
- "fulfillment",
639
- "tax",
640
- "fee",
641
- "total"
642
- ]).describe("Type of total categorization."),
643
- "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
644
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
645
- })).describe("Fulfillment option totals breakdown.")
646
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
647
- "selected_option_id": z$1.union([z$1.string().describe("ID of the selected fulfillment option for this group."), z$1.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
648
- }).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()
649
- }).describe("A fulfillment method (shipping or pickup) with destinations and groups.");
650
- const FulfillmentExtensionFulfillmentAvailableMethodSchema = z$1.object({
651
- "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to."),
652
- "line_item_ids": z$1.array(z$1.string()).describe("Line items available for this fulfillment method."),
653
- "fulfillable_on": z$1.union([z$1.string().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers)."), z$1.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(),
654
- "description": z$1.string().describe("Human-readable availability info (e.g., 'Available for pickup at Downtown Store today').").optional()
655
- }).describe("Inventory availability hint for a fulfillment method type.");
656
- const FulfillmentExtensionFulfillmentSchema = z$1.object({
657
- "methods": z$1.array(z$1.object({
658
- "id": z$1.string().describe("Unique fulfillment method identifier."),
659
- "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type."),
660
- "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs fulfilled via this method."),
661
- "destinations": z$1.array(z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
662
- const schemas = [z$1.record(z$1.string(), z$1.unknown()).and(z$1.intersection(z$1.object({
663
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
664
- "street_address": z$1.string().describe("The street address.").optional(),
665
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
666
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
667
- "address_country": z$1.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(),
668
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
669
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
670
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
671
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
672
- }), z$1.object({ "id": z$1.string().describe("ID specific to this shipping destination.") }))).describe("Shipping destination."), z$1.object({
673
- "id": z$1.string().describe("Unique location identifier."),
674
- "name": z$1.string().describe("Location name (e.g., store name)."),
675
- "address": z$1.object({
676
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
677
- "street_address": z$1.string().describe("The street address.").optional(),
678
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
679
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
680
- "address_country": z$1.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(),
681
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
682
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
683
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
684
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
685
- }).describe("Physical address of the location.").optional()
686
- }).describe("A pickup location (retail store, locker, etc.).")];
541
+ const CatalogLookupSchema = z$1.record(z$1.string(), z$1.unknown()).describe("Product/variant lookup by identifier capability.");
542
+ const CatalogSearchSchema = z$1.record(z$1.string(), z$1.unknown()).describe("Product catalog search capability.");
543
+ const CheckoutSchema = z$1.object({
544
+ "ucp": z$1.intersection(z$1.object({
545
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
546
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
547
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
548
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
549
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
550
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
551
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
552
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
553
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
554
+ "transport": z$1.enum([
555
+ "rest",
556
+ "mcp",
557
+ "a2a",
558
+ "embedded"
559
+ ]).describe("Transport protocol for this service binding."),
560
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
561
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
562
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
563
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
564
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
565
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
566
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
567
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
568
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
569
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
687
570
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
688
571
  const passed = schemas.length - errors.length;
689
572
  if (passed !== 1) ctx.addIssue(errors.length ? {
@@ -696,46 +579,19 @@ const FulfillmentExtensionFulfillmentSchema = z$1.object({
696
579
  code: "custom",
697
580
  message: "Invalid input: Should pass single schema. Passed " + passed
698
581
  });
699
- })).describe("A destination for fulfillment.")).describe("Available destinations. For shipping: addresses. For pickup: retail locations.").optional(),
700
- "selected_destination_id": z$1.union([z$1.string().describe("ID of the selected destination."), z$1.null().describe("ID of the selected destination.")]).describe("ID of the selected destination.").optional(),
701
- "groups": z$1.array(z$1.object({
702
- "id": z$1.string().describe("Group identifier for referencing merchant-generated groups in updates."),
703
- "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs included in this group/package."),
704
- "options": z$1.array(z$1.object({
705
- "id": z$1.string().describe("Unique fulfillment option identifier."),
706
- "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
707
- "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
708
- "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
709
- "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
710
- "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
711
- "totals": z$1.array(z$1.object({
712
- "type": z$1.enum([
713
- "items_discount",
714
- "subtotal",
715
- "discount",
716
- "fulfillment",
717
- "tax",
718
- "fee",
719
- "total"
720
- ]).describe("Type of total categorization."),
721
- "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
722
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
723
- })).describe("Fulfillment option totals breakdown.")
724
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
725
- "selected_option_id": z$1.union([z$1.string().describe("ID of the selected fulfillment option for this group."), z$1.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
726
- }).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()
727
- }).describe("A fulfillment method (shipping or pickup) with destinations and groups.")).describe("Fulfillment methods for cart items.").optional(),
728
- "available_methods": z$1.array(z$1.object({
729
- "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to."),
730
- "line_item_ids": z$1.array(z$1.string()).describe("Line items available for this fulfillment method."),
731
- "fulfillable_on": z$1.union([z$1.string().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers)."), z$1.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(),
732
- "description": z$1.string().describe("Human-readable availability info (e.g., 'Available for pickup at Downtown Store today').").optional()
733
- }).describe("Inventory availability hint for a fulfillment method type.")).describe("Inventory availability hints.").optional()
734
- }).describe("Container for fulfillment methods and availability.");
735
- const OrderSchema = z$1.object({
736
- "ucp": z$1.intersection(z$1.object({
737
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
738
- "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
582
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
583
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
584
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
585
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
586
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
587
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
588
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
589
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
590
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
591
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
592
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
593
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
594
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
739
595
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
740
596
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
741
597
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
@@ -749,76 +605,402 @@ const OrderSchema = z$1.object({
749
605
  "embedded"
750
606
  ]).describe("Transport protocol for this service binding."),
751
607
  "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
752
- })))).describe("Service registry keyed by reverse-domain name.").optional(),
608
+ })), z$1.union([
609
+ z$1.object({ "transport": z$1.literal("rest").optional() }),
610
+ z$1.object({ "transport": z$1.literal("mcp").optional() }),
611
+ z$1.object({ "transport": z$1.literal("a2a").optional() }),
612
+ z$1.object({
613
+ "transport": z$1.literal("embedded").optional(),
614
+ "config": z$1.object({
615
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In checkout responses, confirms accepted delegations for this session.").optional(),
616
+ "color_scheme": z$1.array(z$1.enum(["light", "dark"])).describe("Color schemes the business supports. Hosts use ec_color_scheme query parameter to request a scheme from this list.").optional()
617
+ }).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()
618
+ })
619
+ ])).describe("Service binding in API responses. Includes per-resource transport configuration via typed config."))).optional(),
753
620
  "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
754
621
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
755
622
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
756
623
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
757
624
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
758
625
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
759
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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(),
626
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
627
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
628
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
629
+ const passed = schemas.length - errors.length;
630
+ if (passed !== 1) ctx.addIssue(errors.length ? {
631
+ path: ctx.path,
632
+ code: "invalid_union",
633
+ unionErrors: errors,
634
+ message: "Invalid input: Should pass single schema. Passed " + passed
635
+ } : {
636
+ path: ctx.path,
637
+ code: "custom",
638
+ message: "Invalid input: Should pass single schema. Passed " + passed
639
+ });
640
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })).describe("Capability reference in responses. Only name/version required to confirm active capabilities."))).optional(),
760
641
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
761
642
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
762
643
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
763
644
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
764
645
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
765
646
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
766
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
767
- }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
768
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
769
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
770
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
771
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
772
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
773
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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."),
774
- "id": z$1.string().describe("Unique order identifier."),
775
- "checkout_id": z$1.string().describe("Associated checkout ID for reconciliation."),
776
- "permalink_url": z$1.string().url().describe("Permalink to access the order on merchant site."),
647
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
648
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
649
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
650
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))).describe("Handler reference in responses. May include full config state for runtime usage of the handler.")))
651
+ })).describe("UCP metadata for checkout responses."),
652
+ "id": z$1.string().describe("Unique identifier of the checkout session."),
777
653
  "line_items": z$1.array(z$1.object({
778
- "id": z$1.string().describe("Line item identifier."),
654
+ "id": z$1.string(),
779
655
  "item": z$1.object({
780
- "id": z$1.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."),
656
+ "id": z$1.string().describe("The product identifier, often the SKU, required to resolve the product details associated with this line item. Should be recognized by both the Platform, and the Business."),
781
657
  "title": z$1.string().describe("Product title."),
782
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
658
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
783
659
  "image_url": z$1.string().url().describe("Product image URI.").optional()
784
- }).describe("Product data (id, title, price, image_url)."),
785
- "quantity": z$1.object({
786
- "total": z$1.number().int().gte(0).describe("Current total quantity."),
787
- "fulfilled": z$1.number().int().gte(0).describe("Quantity fulfilled (sum from fulfillment events).")
788
- }).describe("Quantity tracking. Both total and fulfilled are derived from events."),
660
+ }),
661
+ "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
789
662
  "totals": z$1.array(z$1.object({
790
- "type": z$1.enum([
791
- "items_discount",
792
- "subtotal",
793
- "discount",
794
- "fulfillment",
795
- "tax",
796
- "fee",
797
- "total"
798
- ]).describe("Type of total categorization."),
663
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
799
664
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
800
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
801
- })).describe("Line item totals breakdown."),
802
- "status": z$1.enum([
803
- "processing",
804
- "partial",
805
- "fulfilled"
806
- ]).describe("Derived status: fulfilled if quantity.fulfilled == quantity.total, partial if quantity.fulfilled > 0, otherwise processing."),
665
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
666
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
807
667
  "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
808
- })).describe("Immutable line items source of truth for what was ordered."),
809
- "fulfillment": z$1.object({
810
- "expectations": z$1.array(z$1.object({
811
- "id": z$1.string().describe("Expectation identifier."),
812
- "line_items": z$1.array(z$1.object({
813
- "id": z$1.string().describe("Line item ID reference."),
814
- "quantity": z$1.number().int().gte(1).describe("Quantity of this item in this expectation.")
815
- })).describe("Which line items and quantities are in this expectation."),
816
- "method_type": z$1.enum([
817
- "shipping",
818
- "pickup",
819
- "digital"
820
- ]).describe("Delivery method type (shipping, pickup, digital)."),
821
- "destination": z$1.object({
668
+ }).describe("Line item object. Expected to use the currency of the parent object.")).describe("List of line items being checked out."),
669
+ "buyer": z$1.object({
670
+ "first_name": z$1.string().describe("First name of the buyer.").optional(),
671
+ "last_name": z$1.string().describe("Last name of the buyer.").optional(),
672
+ "email": z$1.string().describe("Email of the buyer.").optional(),
673
+ "phone_number": z$1.string().describe("E.164 standard.").optional()
674
+ }).passthrough().describe("Representation of the buyer.").optional(),
675
+ "context": z$1.object({
676
+ "address_country": z$1.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(),
677
+ "address_region": z$1.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(),
678
+ "postal_code": z$1.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
679
+ "intent": z$1.string().describe("Background context describing buyer's intent (e.g., 'looking for a gift under $50', 'need something durable for outdoor use'). Informs relevance, recommendations, and personalization.").optional(),
680
+ "language": z$1.string().describe("Preferred language for content. Use IETF BCP 47 language tags (e.g., 'en', 'fr-CA', 'zh-Hans'). For REST, equivalent to Accept-Language header—platforms SHOULD fall back to Accept-Language when this field is absent; when provided, overrides Accept-Language. Businesses MAY return content in a different language if unavailable.").optional(),
681
+ "currency": z$1.string().describe("Preferred currency (ISO 4217, e.g., 'EUR', 'USD'). Businesses determine presentment currency from context and authoritative signals; this hint MAY inform selection in multi-currency markets. Also serves as the denomination for price filter values — platforms SHOULD include this field when sending price filters. Response prices include explicit currency confirming the resolution.").optional(),
682
+ "eligibility": z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Reverse-domain identifier used for collision-safe namespacing of capabilities, services, handlers, eligibility claims, and extension-contributed keys. Must contain at least two dot-separated segments (e.g., 'dev.ucp.shopping.checkout', 'com.example.loyalty_gold').")).refine((arr) => arr.every((item, i) => arr.indexOf(item) == i), "All items must be unique!").describe("Buyer claims about eligible benefits such as loyalty membership, payment instrument perks, and similar. Recognized claims MAY inform the Business response (e.g., member-only product availability, adjusted pricing in catalog, provisional discounts at cart or checkout). Businesses MUST ignore unrecognized values without error. Values MUST use reverse-domain naming (e.g., 'com.example.loyalty_gold', 'org.school.student') and MUST be non-identifying.").optional()
683
+ }).passthrough().describe("Provisional buyer signals for relevance and localization—not authoritative data. Businesses SHOULD use these values when verified inputs (e.g., shipping address) are absent, and MAY ignore or down-rank them if inconsistent with higher-confidence signals (authenticated account, risk detection) or regulatory constraints (export controls). Eligibility and policy enforcement MUST occur at checkout time using binding transaction data. Context SHOULD be non-identifying and can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context.").optional(),
684
+ "signals": z$1.object({
685
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
686
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
687
+ }).passthrough().describe("Environment data provided by the platform to support authorization and abuse prevention. Values MUST NOT be buyer-asserted claims — platforms provide signals based on direct observation or independently verifiable third-party attestations. All signal keys MUST use reverse-domain naming to ensure provenance and prevent collisions when multiple extensions contribute to the shared namespace.").optional(),
688
+ "risk_signals": z$1.record(z$1.string(), z$1.unknown()).describe("Deprecated. Use signals instead. Will be removed in the next version.").optional(),
689
+ "status": z$1.enum([
690
+ "incomplete",
691
+ "requires_escalation",
692
+ "ready_for_complete",
693
+ "complete_in_progress",
694
+ "completed",
695
+ "canceled"
696
+ ]).describe("Checkout state indicating the current phase and required action. See Checkout Status lifecycle documentation for state transition details."),
697
+ "currency": z$1.string().describe("ISO 4217 currency code reflecting the merchant's market determination. Derived from address, context, and geo IP—buyers provide signals, merchants determine currency."),
698
+ "totals": z$1.array(z$1.intersection(z$1.intersection(z$1.object({
699
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
700
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
701
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
702
+ }).describe("A cost breakdown entry with a category, amount, and optional display text."), z$1.object({
703
+ "amount": z$1.number().int().describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD). May be negative — the sign is intrinsic to the value (e.g., discounts are negative, charges are positive).").optional(),
704
+ "lines": z$1.array(z$1.object({
705
+ "display_text": z$1.string().describe("Human-readable label for this sub-line."),
706
+ "amount": z$1.number().int().describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD). May be negative — the sign is intrinsic to the value (e.g., discounts are negative, charges are positive).")
707
+ }).describe("Sub-line entry. Additional metadata MAY be included.")).describe("Optional itemized breakdown. The parent entry is always rendered; lines are supplementary. Sum of line amounts MUST equal the parent entry amount.").optional()
708
+ })), z$1.intersection(z$1.any(), z$1.intersection(z$1.any(), z$1.any())))).describe("Different cart totals."),
709
+ "messages": z$1.array(z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
710
+ const schemas = [
711
+ z$1.object({
712
+ "type": z$1.literal("error").describe("Message type discriminator."),
713
+ "code": z$1.string().describe("Error code identifying the type of error. Standard errors are defined in specification (see examples), and have standardized semantics; freeform codes are permitted."),
714
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
715
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
716
+ "content": z$1.string().describe("Human-readable message."),
717
+ "severity": z$1.enum([
718
+ "recoverable",
719
+ "requires_buyer_input",
720
+ "requires_buyer_review",
721
+ "unrecoverable"
722
+ ]).describe("Reflects the resource state and recommended action. 'recoverable': platform can resolve by modifying inputs and retrying 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. 'unrecoverable': no valid resource exists to act on, retry with new resource or inputs. Errors with 'requires_*' severity contribute to 'status: requires_escalation'.")
723
+ }),
724
+ z$1.object({
725
+ "type": z$1.literal("warning").describe("Message type discriminator."),
726
+ "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
727
+ "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
728
+ "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
729
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
730
+ "presentation": z$1.string().describe("Rendering contract for this warning. 'notice' (default): platform MUST display, MAY dismiss. 'disclosure': platform MUST display in proximity to the path-referenced component, MUST NOT hide or auto-dismiss. See specification for full contract.").default("notice"),
731
+ "image_url": z$1.string().url().describe("URL to a required visual element (e.g., warning symbol, energy class label).").optional(),
732
+ "url": z$1.string().url().describe("Reference URL for more information (e.g., regulatory site, registry entry, policy page).").optional()
733
+ }),
734
+ z$1.object({
735
+ "type": z$1.literal("info").describe("Message type discriminator."),
736
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to.").optional(),
737
+ "code": z$1.string().describe("Info code for programmatic handling.").optional(),
738
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
739
+ "content": z$1.string().describe("Human-readable message.")
740
+ })
741
+ ];
742
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
743
+ const passed = schemas.length - errors.length;
744
+ if (passed !== 1) ctx.addIssue(errors.length ? {
745
+ path: ctx.path,
746
+ code: "invalid_union",
747
+ unionErrors: errors,
748
+ message: "Invalid input: Should pass single schema. Passed " + passed
749
+ } : {
750
+ path: ctx.path,
751
+ code: "custom",
752
+ message: "Invalid input: Should pass single schema. Passed " + passed
753
+ });
754
+ })).describe("Container for error, warning, or info messages.")).describe("List of messages with error and info about the checkout session state.").optional(),
755
+ "links": z$1.array(z$1.object({
756
+ "type": z$1.string().describe("Type of link. Well-known values: `privacy_policy`, `terms_of_service`, `refund_policy`, `shipping_policy`, `faq`. Consumers SHOULD handle unknown values gracefully by displaying them using the `title` field or omitting the link."),
757
+ "url": z$1.string().url().describe("The actual URL pointing to the content to be displayed."),
758
+ "title": z$1.string().describe("Optional display text for the link. When provided, use this instead of generating from type.").optional()
759
+ })).describe("Links to be displayed by the platform (Privacy Policy, TOS). Mandatory for legal compliance."),
760
+ "expires_at": z$1.string().datetime({ offset: true }).describe("RFC 3339 expiry timestamp. Default TTL is 6 hours from creation if not sent.").optional(),
761
+ "continue_url": z$1.string().url().describe("URL for checkout handoff and session recovery. MUST be provided when status is requires_escalation. See specification for format and availability requirements.").optional(),
762
+ "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
763
+ "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
764
+ "handler_id": z$1.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
765
+ "type": z$1.string().describe("The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas will constrain this to a constant value."),
766
+ "billing_address": z$1.object({
767
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
768
+ "street_address": z$1.string().describe("The street address.").optional(),
769
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
770
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
771
+ "address_country": z$1.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(),
772
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
773
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
774
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
775
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
776
+ }).describe("The billing address associated with this payment method.").optional(),
777
+ "credential": z$1.object({ "type": z$1.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(),
778
+ "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
779
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({ "selected": z$1.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(),
780
+ "order": z$1.object({
781
+ "id": z$1.string().describe("Unique order identifier."),
782
+ "permalink_url": z$1.string().url().describe("Permalink to access the order on merchant site.")
783
+ }).describe("Details about an order created for this checkout session.").optional()
784
+ }).passthrough().describe("Base checkout schema. Extensions compose onto this using allOf.");
785
+ const CheckoutCreateRequestSchema = z$1.object({
786
+ "line_items": z$1.array(z$1.object({
787
+ "id": z$1.string(),
788
+ "item": z$1.object({
789
+ "id": z$1.string().describe("The product identifier, often the SKU, required to resolve the product details associated with this line item. Should be recognized by both the Platform, and the Business."),
790
+ "title": z$1.string().describe("Product title."),
791
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
792
+ "image_url": z$1.string().url().describe("Product image URI.").optional()
793
+ }),
794
+ "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
795
+ "totals": z$1.array(z$1.object({
796
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
797
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
798
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
799
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
800
+ "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
801
+ }).describe("Line item object. Expected to use the currency of the parent object.")).describe("List of line items being checked out."),
802
+ "buyer": z$1.object({
803
+ "first_name": z$1.string().describe("First name of the buyer.").optional(),
804
+ "last_name": z$1.string().describe("Last name of the buyer.").optional(),
805
+ "email": z$1.string().describe("Email of the buyer.").optional(),
806
+ "phone_number": z$1.string().describe("E.164 standard.").optional()
807
+ }).passthrough().describe("Representation of the buyer.").optional(),
808
+ "context": z$1.object({
809
+ "address_country": z$1.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(),
810
+ "address_region": z$1.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(),
811
+ "postal_code": z$1.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
812
+ "intent": z$1.string().describe("Background context describing buyer's intent (e.g., 'looking for a gift under $50', 'need something durable for outdoor use'). Informs relevance, recommendations, and personalization.").optional(),
813
+ "language": z$1.string().describe("Preferred language for content. Use IETF BCP 47 language tags (e.g., 'en', 'fr-CA', 'zh-Hans'). For REST, equivalent to Accept-Language header—platforms SHOULD fall back to Accept-Language when this field is absent; when provided, overrides Accept-Language. Businesses MAY return content in a different language if unavailable.").optional(),
814
+ "currency": z$1.string().describe("Preferred currency (ISO 4217, e.g., 'EUR', 'USD'). Businesses determine presentment currency from context and authoritative signals; this hint MAY inform selection in multi-currency markets. Also serves as the denomination for price filter values — platforms SHOULD include this field when sending price filters. Response prices include explicit currency confirming the resolution.").optional(),
815
+ "eligibility": z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Reverse-domain identifier used for collision-safe namespacing of capabilities, services, handlers, eligibility claims, and extension-contributed keys. Must contain at least two dot-separated segments (e.g., 'dev.ucp.shopping.checkout', 'com.example.loyalty_gold').")).refine((arr) => arr.every((item, i) => arr.indexOf(item) == i), "All items must be unique!").describe("Buyer claims about eligible benefits such as loyalty membership, payment instrument perks, and similar. Recognized claims MAY inform the Business response (e.g., member-only product availability, adjusted pricing in catalog, provisional discounts at cart or checkout). Businesses MUST ignore unrecognized values without error. Values MUST use reverse-domain naming (e.g., 'com.example.loyalty_gold', 'org.school.student') and MUST be non-identifying.").optional()
816
+ }).passthrough().describe("Provisional buyer signals for relevance and localization—not authoritative data. Businesses SHOULD use these values when verified inputs (e.g., shipping address) are absent, and MAY ignore or down-rank them if inconsistent with higher-confidence signals (authenticated account, risk detection) or regulatory constraints (export controls). Eligibility and policy enforcement MUST occur at checkout time using binding transaction data. Context SHOULD be non-identifying and can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context.").optional(),
817
+ "signals": z$1.object({
818
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
819
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
820
+ }).passthrough().describe("Environment data provided by the platform to support authorization and abuse prevention. Values MUST NOT be buyer-asserted claims — platforms provide signals based on direct observation or independently verifiable third-party attestations. All signal keys MUST use reverse-domain naming to ensure provenance and prevent collisions when multiple extensions contribute to the shared namespace.").optional(),
821
+ "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
822
+ "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
823
+ "handler_id": z$1.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
824
+ "type": z$1.string().describe("The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas will constrain this to a constant value."),
825
+ "billing_address": z$1.object({
826
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
827
+ "street_address": z$1.string().describe("The street address.").optional(),
828
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
829
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
830
+ "address_country": z$1.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(),
831
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
832
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
833
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
834
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
835
+ }).describe("The billing address associated with this payment method.").optional(),
836
+ "credential": z$1.object({ "type": z$1.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(),
837
+ "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
838
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({ "selected": z$1.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()
839
+ }).strict();
840
+ const CheckoutUpdateRequestSchema = z$1.object({
841
+ "line_items": z$1.array(z$1.object({
842
+ "id": z$1.string(),
843
+ "item": z$1.object({
844
+ "id": z$1.string().describe("The product identifier, often the SKU, required to resolve the product details associated with this line item. Should be recognized by both the Platform, and the Business."),
845
+ "title": z$1.string().describe("Product title."),
846
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
847
+ "image_url": z$1.string().url().describe("Product image URI.").optional()
848
+ }),
849
+ "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
850
+ "totals": z$1.array(z$1.object({
851
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
852
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
853
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
854
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
855
+ "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
856
+ }).describe("Line item object. Expected to use the currency of the parent object.")).describe("List of line items being checked out."),
857
+ "buyer": z$1.object({
858
+ "first_name": z$1.string().describe("First name of the buyer.").optional(),
859
+ "last_name": z$1.string().describe("Last name of the buyer.").optional(),
860
+ "email": z$1.string().describe("Email of the buyer.").optional(),
861
+ "phone_number": z$1.string().describe("E.164 standard.").optional()
862
+ }).passthrough().describe("Representation of the buyer.").optional(),
863
+ "context": z$1.object({
864
+ "address_country": z$1.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(),
865
+ "address_region": z$1.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(),
866
+ "postal_code": z$1.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
867
+ "intent": z$1.string().describe("Background context describing buyer's intent (e.g., 'looking for a gift under $50', 'need something durable for outdoor use'). Informs relevance, recommendations, and personalization.").optional(),
868
+ "language": z$1.string().describe("Preferred language for content. Use IETF BCP 47 language tags (e.g., 'en', 'fr-CA', 'zh-Hans'). For REST, equivalent to Accept-Language header—platforms SHOULD fall back to Accept-Language when this field is absent; when provided, overrides Accept-Language. Businesses MAY return content in a different language if unavailable.").optional(),
869
+ "currency": z$1.string().describe("Preferred currency (ISO 4217, e.g., 'EUR', 'USD'). Businesses determine presentment currency from context and authoritative signals; this hint MAY inform selection in multi-currency markets. Also serves as the denomination for price filter values — platforms SHOULD include this field when sending price filters. Response prices include explicit currency confirming the resolution.").optional(),
870
+ "eligibility": z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Reverse-domain identifier used for collision-safe namespacing of capabilities, services, handlers, eligibility claims, and extension-contributed keys. Must contain at least two dot-separated segments (e.g., 'dev.ucp.shopping.checkout', 'com.example.loyalty_gold').")).refine((arr) => arr.every((item, i) => arr.indexOf(item) == i), "All items must be unique!").describe("Buyer claims about eligible benefits such as loyalty membership, payment instrument perks, and similar. Recognized claims MAY inform the Business response (e.g., member-only product availability, adjusted pricing in catalog, provisional discounts at cart or checkout). Businesses MUST ignore unrecognized values without error. Values MUST use reverse-domain naming (e.g., 'com.example.loyalty_gold', 'org.school.student') and MUST be non-identifying.").optional()
871
+ }).passthrough().describe("Provisional buyer signals for relevance and localization—not authoritative data. Businesses SHOULD use these values when verified inputs (e.g., shipping address) are absent, and MAY ignore or down-rank them if inconsistent with higher-confidence signals (authenticated account, risk detection) or regulatory constraints (export controls). Eligibility and policy enforcement MUST occur at checkout time using binding transaction data. Context SHOULD be non-identifying and can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context.").optional(),
872
+ "signals": z$1.object({
873
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
874
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
875
+ }).passthrough().describe("Environment data provided by the platform to support authorization and abuse prevention. Values MUST NOT be buyer-asserted claims — platforms provide signals based on direct observation or independently verifiable third-party attestations. All signal keys MUST use reverse-domain naming to ensure provenance and prevent collisions when multiple extensions contribute to the shared namespace.").optional(),
876
+ "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
877
+ "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
878
+ "handler_id": z$1.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
879
+ "type": z$1.string().describe("The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas will constrain this to a constant value."),
880
+ "billing_address": z$1.object({
881
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
882
+ "street_address": z$1.string().describe("The street address.").optional(),
883
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
884
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
885
+ "address_country": z$1.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(),
886
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
887
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
888
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
889
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
890
+ }).describe("The billing address associated with this payment method.").optional(),
891
+ "credential": z$1.object({ "type": z$1.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(),
892
+ "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
893
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({ "selected": z$1.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()
894
+ }).strict();
895
+ const CheckoutCompleteRequestSchema = z$1.object({
896
+ "signals": z$1.object({
897
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
898
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
899
+ }).passthrough().describe("Environment data provided by the platform to support authorization and abuse prevention. Values MUST NOT be buyer-asserted claims — platforms provide signals based on direct observation or independently verifiable third-party attestations. All signal keys MUST use reverse-domain naming to ensure provenance and prevent collisions when multiple extensions contribute to the shared namespace.").optional(),
900
+ "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
901
+ "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
902
+ "handler_id": z$1.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
903
+ "type": z$1.string().describe("The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas will constrain this to a constant value."),
904
+ "billing_address": z$1.object({
905
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
906
+ "street_address": z$1.string().describe("The street address.").optional(),
907
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
908
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
909
+ "address_country": z$1.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(),
910
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
911
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
912
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
913
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
914
+ }).describe("The billing address associated with this payment method.").optional(),
915
+ "credential": z$1.object({ "type": z$1.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(),
916
+ "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
917
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({ "selected": z$1.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.")
918
+ }).strict();
919
+ const DiscountAllocationSchema = z$1.object({
920
+ "path": z$1.string().describe("JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping')."),
921
+ "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in ISO 4217 minor units.")
922
+ }).describe("Breakdown of how a discount amount was allocated to a specific target.");
923
+ const DiscountAppliedDiscountSchema = z$1.object({
924
+ "code": z$1.string().describe("The discount code. Omitted for automatic discounts.").optional(),
925
+ "title": z$1.string().describe("Human-readable discount name (e.g., 'Summer Sale 20% Off')."),
926
+ "amount": z$1.number().int().gte(0).describe("Total discount amount in ISO 4217 minor units."),
927
+ "automatic": z$1.boolean().describe("True if applied automatically by merchant rules (no code required).").default(false),
928
+ "method": z$1.enum(["each", "across"]).describe("Allocation method. 'each' = applied independently per item. 'across' = split proportionally by value.").optional(),
929
+ "priority": z$1.number().int().gte(1).describe("Stacking order for discount calculation. Lower numbers applied first (1 = first).").optional(),
930
+ "provisional": z$1.boolean().describe("True if this discount requires additional verification.").default(false),
931
+ "eligibility": z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("The eligibility claim accepted by the Business for this discount. Corresponds to a value from context.eligibility. Omitted for code-based and non-eligibility automatic discounts.").optional(),
932
+ "allocations": z$1.array(z$1.object({
933
+ "path": z$1.string().describe("JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping')."),
934
+ "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in ISO 4217 minor units.")
935
+ }).describe("Breakdown of how a discount amount was allocated to a specific target.")).describe("Breakdown of where this discount was allocated. Sum of allocation amounts equals total amount.").optional()
936
+ }).describe("A discount that was successfully applied.");
937
+ const DiscountDiscountsObjectSchema = z$1.object({
938
+ "codes": z$1.array(z$1.string()).describe("Discount codes to apply. Case-insensitive. Replaces previously submitted codes. Send empty array to clear.").optional(),
939
+ "applied": z$1.array(z$1.object({
940
+ "code": z$1.string().describe("The discount code. Omitted for automatic discounts.").optional(),
941
+ "title": z$1.string().describe("Human-readable discount name (e.g., 'Summer Sale 20% Off')."),
942
+ "amount": z$1.number().int().gte(0).describe("Total discount amount in ISO 4217 minor units."),
943
+ "automatic": z$1.boolean().describe("True if applied automatically by merchant rules (no code required).").default(false),
944
+ "method": z$1.enum(["each", "across"]).describe("Allocation method. 'each' = applied independently per item. 'across' = split proportionally by value.").optional(),
945
+ "priority": z$1.number().int().gte(1).describe("Stacking order for discount calculation. Lower numbers applied first (1 = first).").optional(),
946
+ "provisional": z$1.boolean().describe("True if this discount requires additional verification.").default(false),
947
+ "eligibility": z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("The eligibility claim accepted by the Business for this discount. Corresponds to a value from context.eligibility. Omitted for code-based and non-eligibility automatic discounts.").optional(),
948
+ "allocations": z$1.array(z$1.object({
949
+ "path": z$1.string().describe("JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping')."),
950
+ "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in ISO 4217 minor units.")
951
+ }).describe("Breakdown of how a discount amount was allocated to a specific target.")).describe("Breakdown of where this discount was allocated. Sum of allocation amounts equals total amount.").optional()
952
+ }).describe("A discount that was successfully applied.")).describe("Discounts successfully applied (code-based and automatic).").readonly().optional()
953
+ }).describe("Discount codes input and applied discounts output.");
954
+ const FulfillmentExtensionFulfillmentOptionSchema = z$1.object({
955
+ "id": z$1.string().describe("Unique fulfillment option identifier."),
956
+ "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
957
+ "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
958
+ "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
959
+ "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
960
+ "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
961
+ "totals": z$1.array(z$1.object({
962
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
963
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
964
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
965
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
966
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).");
967
+ const FulfillmentExtensionFulfillmentGroupSchema = z$1.object({
968
+ "id": z$1.string().describe("Group identifier for referencing merchant-generated groups in updates."),
969
+ "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs included in this group/package."),
970
+ "options": z$1.array(z$1.object({
971
+ "id": z$1.string().describe("Unique fulfillment option identifier."),
972
+ "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
973
+ "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
974
+ "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
975
+ "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
976
+ "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
977
+ "totals": z$1.array(z$1.object({
978
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
979
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
980
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
981
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
982
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
983
+ "selected_option_id": z$1.union([z$1.string().describe("ID of the selected fulfillment option for this group."), z$1.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
984
+ }).passthrough().describe("A merchant-generated package/group of line items with fulfillment options.");
985
+ const FulfillmentExtensionFulfillmentMethodSchema = z$1.object({
986
+ "id": z$1.string().describe("Unique fulfillment method identifier."),
987
+ "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type."),
988
+ "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs fulfilled via this method."),
989
+ "destinations": z$1.array(z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
990
+ const schemas = [z$1.record(z$1.string(), z$1.unknown()).and(z$1.intersection(z$1.object({
991
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
992
+ "street_address": z$1.string().describe("The street address.").optional(),
993
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
994
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
995
+ "address_country": z$1.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(),
996
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
997
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
998
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
999
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1000
+ }), z$1.object({ "id": z$1.string().describe("ID specific to this shipping destination.") }))).describe("Shipping destination."), z$1.object({
1001
+ "id": z$1.string().describe("Unique location identifier."),
1002
+ "name": z$1.string().describe("Location name (e.g., store name)."),
1003
+ "address": z$1.object({
822
1004
  "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
823
1005
  "street_address": z$1.string().describe("The street address.").optional(),
824
1006
  "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
@@ -828,18 +1010,250 @@ const OrderSchema = z$1.object({
828
1010
  "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
829
1011
  "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
830
1012
  "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
831
- }).describe("Delivery destination address."),
832
- "description": z$1.string().describe("Human-readable delivery description (e.g., 'Arrives in 5-8 business days').").optional(),
833
- "fulfillable_on": z$1.string().describe("When this expectation can be fulfilled: 'now' or ISO 8601 timestamp for future date (backorder, pre-order).").optional()
834
- }).describe("Buyer-facing fulfillment expectation representing logical groupings of items (e.g., 'package'). Can be split, merged, or adjusted post-order to set buyer expectations for when/how items arrive.")).describe("Buyer-facing groups representing when/how items will be delivered. Can be split, merged, or adjusted post-order.").optional(),
835
- "events": z$1.array(z$1.object({
836
- "id": z$1.string().describe("Fulfillment event identifier."),
837
- "occurred_at": z$1.string().datetime({ offset: true }).describe("RFC 3339 timestamp when this fulfillment event occurred."),
838
- "type": z$1.string().describe("Fulfillment event type. Common values include: processing (preparing to ship), shipped (handed to carrier), in_transit (in delivery network), delivered (received by buyer), failed_attempt (delivery attempt failed), canceled (fulfillment canceled), undeliverable (cannot be delivered), returned_to_sender (returned to merchant)."),
839
- "line_items": z$1.array(z$1.object({
840
- "id": z$1.string().describe("Line item ID reference."),
841
- "quantity": z$1.number().int().gte(1).describe("Quantity fulfilled in this event.")
842
- })).describe("Which line items and quantities are fulfilled in this event."),
1013
+ }).describe("Physical address of the location.").optional()
1014
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).")];
1015
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1016
+ const passed = schemas.length - errors.length;
1017
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1018
+ path: ctx.path,
1019
+ code: "invalid_union",
1020
+ unionErrors: errors,
1021
+ message: "Invalid input: Should pass single schema. Passed " + passed
1022
+ } : {
1023
+ path: ctx.path,
1024
+ code: "custom",
1025
+ message: "Invalid input: Should pass single schema. Passed " + passed
1026
+ });
1027
+ })).describe("A destination for fulfillment.")).describe("Available destinations. For shipping: addresses. For pickup: retail locations.").optional(),
1028
+ "selected_destination_id": z$1.union([z$1.string().describe("ID of the selected destination."), z$1.null().describe("ID of the selected destination.")]).describe("ID of the selected destination.").optional(),
1029
+ "groups": z$1.array(z$1.object({
1030
+ "id": z$1.string().describe("Group identifier for referencing merchant-generated groups in updates."),
1031
+ "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs included in this group/package."),
1032
+ "options": z$1.array(z$1.object({
1033
+ "id": z$1.string().describe("Unique fulfillment option identifier."),
1034
+ "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
1035
+ "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
1036
+ "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
1037
+ "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1038
+ "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1039
+ "totals": z$1.array(z$1.object({
1040
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1041
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1042
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
1043
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
1044
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1045
+ "selected_option_id": z$1.union([z$1.string().describe("ID of the selected fulfillment option for this group."), z$1.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
1046
+ }).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()
1047
+ }).passthrough().describe("A fulfillment method (shipping or pickup) with destinations and groups.");
1048
+ const FulfillmentExtensionFulfillmentAvailableMethodSchema = z$1.object({
1049
+ "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to."),
1050
+ "line_item_ids": z$1.array(z$1.string()).describe("Line items available for this fulfillment method."),
1051
+ "fulfillable_on": z$1.union([z$1.string().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers)."), z$1.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(),
1052
+ "description": z$1.string().describe("Human-readable availability info (e.g., 'Available for pickup at Downtown Store today').").optional()
1053
+ }).passthrough().describe("Inventory availability hint for a fulfillment method type.");
1054
+ const FulfillmentExtensionFulfillmentSchema = z$1.object({
1055
+ "methods": z$1.array(z$1.object({
1056
+ "id": z$1.string().describe("Unique fulfillment method identifier."),
1057
+ "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type."),
1058
+ "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs fulfilled via this method."),
1059
+ "destinations": z$1.array(z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
1060
+ const schemas = [z$1.record(z$1.string(), z$1.unknown()).and(z$1.intersection(z$1.object({
1061
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1062
+ "street_address": z$1.string().describe("The street address.").optional(),
1063
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
1064
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
1065
+ "address_country": z$1.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(),
1066
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
1067
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
1068
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1069
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1070
+ }), z$1.object({ "id": z$1.string().describe("ID specific to this shipping destination.") }))).describe("Shipping destination."), z$1.object({
1071
+ "id": z$1.string().describe("Unique location identifier."),
1072
+ "name": z$1.string().describe("Location name (e.g., store name)."),
1073
+ "address": z$1.object({
1074
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1075
+ "street_address": z$1.string().describe("The street address.").optional(),
1076
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
1077
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
1078
+ "address_country": z$1.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(),
1079
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
1080
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
1081
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1082
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1083
+ }).describe("Physical address of the location.").optional()
1084
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).")];
1085
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1086
+ const passed = schemas.length - errors.length;
1087
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1088
+ path: ctx.path,
1089
+ code: "invalid_union",
1090
+ unionErrors: errors,
1091
+ message: "Invalid input: Should pass single schema. Passed " + passed
1092
+ } : {
1093
+ path: ctx.path,
1094
+ code: "custom",
1095
+ message: "Invalid input: Should pass single schema. Passed " + passed
1096
+ });
1097
+ })).describe("A destination for fulfillment.")).describe("Available destinations. For shipping: addresses. For pickup: retail locations.").optional(),
1098
+ "selected_destination_id": z$1.union([z$1.string().describe("ID of the selected destination."), z$1.null().describe("ID of the selected destination.")]).describe("ID of the selected destination.").optional(),
1099
+ "groups": z$1.array(z$1.object({
1100
+ "id": z$1.string().describe("Group identifier for referencing merchant-generated groups in updates."),
1101
+ "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs included in this group/package."),
1102
+ "options": z$1.array(z$1.object({
1103
+ "id": z$1.string().describe("Unique fulfillment option identifier."),
1104
+ "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
1105
+ "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
1106
+ "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
1107
+ "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1108
+ "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1109
+ "totals": z$1.array(z$1.object({
1110
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1111
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1112
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
1113
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
1114
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1115
+ "selected_option_id": z$1.union([z$1.string().describe("ID of the selected fulfillment option for this group."), z$1.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
1116
+ }).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()
1117
+ }).passthrough().describe("A fulfillment method (shipping or pickup) with destinations and groups.")).describe("Fulfillment methods for cart items.").optional(),
1118
+ "available_methods": z$1.array(z$1.object({
1119
+ "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to."),
1120
+ "line_item_ids": z$1.array(z$1.string()).describe("Line items available for this fulfillment method."),
1121
+ "fulfillable_on": z$1.union([z$1.string().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers)."), z$1.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(),
1122
+ "description": z$1.string().describe("Human-readable availability info (e.g., 'Available for pickup at Downtown Store today').").optional()
1123
+ }).passthrough().describe("Inventory availability hint for a fulfillment method type.")).describe("Inventory availability hints.").optional()
1124
+ }).describe("Container for fulfillment methods and availability.");
1125
+ const OrderSchema = z$1.object({
1126
+ "ucp": z$1.intersection(z$1.object({
1127
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1128
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1129
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1130
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1131
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1132
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1133
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1134
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1135
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
1136
+ "transport": z$1.enum([
1137
+ "rest",
1138
+ "mcp",
1139
+ "a2a",
1140
+ "embedded"
1141
+ ]).describe("Transport protocol for this service binding."),
1142
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
1143
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
1144
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1145
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1146
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1147
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1148
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1149
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1150
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
1151
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
1152
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1153
+ const passed = schemas.length - errors.length;
1154
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1155
+ path: ctx.path,
1156
+ code: "invalid_union",
1157
+ unionErrors: errors,
1158
+ message: "Invalid input: Should pass single schema. Passed " + passed
1159
+ } : {
1160
+ path: ctx.path,
1161
+ code: "custom",
1162
+ message: "Invalid input: Should pass single schema. Passed " + passed
1163
+ });
1164
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
1165
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1166
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1167
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1168
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1169
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1170
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1171
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
1172
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
1173
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
1174
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
1175
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1176
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1177
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1178
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1179
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1180
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1181
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
1182
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
1183
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1184
+ const passed = schemas.length - errors.length;
1185
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1186
+ path: ctx.path,
1187
+ code: "invalid_union",
1188
+ unionErrors: errors,
1189
+ message: "Invalid input: Should pass single schema. Passed " + passed
1190
+ } : {
1191
+ path: ctx.path,
1192
+ code: "custom",
1193
+ message: "Invalid input: Should pass single schema. Passed " + passed
1194
+ });
1195
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").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."),
1196
+ "id": z$1.string().describe("Unique order identifier."),
1197
+ "checkout_id": z$1.string().describe("Associated checkout ID for reconciliation."),
1198
+ "permalink_url": z$1.string().url().describe("Permalink to access the order on merchant site."),
1199
+ "line_items": z$1.array(z$1.object({
1200
+ "id": z$1.string().describe("Line item identifier."),
1201
+ "item": z$1.object({
1202
+ "id": z$1.string().describe("The product identifier, often the SKU, required to resolve the product details associated with this line item. Should be recognized by both the Platform, and the Business."),
1203
+ "title": z$1.string().describe("Product title."),
1204
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
1205
+ "image_url": z$1.string().url().describe("Product image URI.").optional()
1206
+ }).describe("Product data (id, title, price, image_url)."),
1207
+ "quantity": z$1.object({
1208
+ "total": z$1.number().int().gte(0).describe("Current total quantity."),
1209
+ "fulfilled": z$1.number().int().gte(0).describe("Quantity fulfilled (sum from fulfillment events).")
1210
+ }).describe("Quantity tracking. Both total and fulfilled are derived from events."),
1211
+ "totals": z$1.array(z$1.object({
1212
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1213
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1214
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
1215
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
1216
+ "status": z$1.enum([
1217
+ "processing",
1218
+ "partial",
1219
+ "fulfilled"
1220
+ ]).describe("Derived status: fulfilled if quantity.fulfilled == quantity.total, partial if quantity.fulfilled > 0, otherwise processing."),
1221
+ "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
1222
+ })).describe("Immutable line items — source of truth for what was ordered."),
1223
+ "fulfillment": z$1.object({
1224
+ "expectations": z$1.array(z$1.object({
1225
+ "id": z$1.string().describe("Expectation identifier."),
1226
+ "line_items": z$1.array(z$1.object({
1227
+ "id": z$1.string().describe("Line item ID reference."),
1228
+ "quantity": z$1.number().int().gte(1).describe("Quantity of this item in this expectation.")
1229
+ })).describe("Which line items and quantities are in this expectation."),
1230
+ "method_type": z$1.enum([
1231
+ "shipping",
1232
+ "pickup",
1233
+ "digital"
1234
+ ]).describe("Delivery method type (shipping, pickup, digital)."),
1235
+ "destination": z$1.object({
1236
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1237
+ "street_address": z$1.string().describe("The street address.").optional(),
1238
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
1239
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
1240
+ "address_country": z$1.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(),
1241
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
1242
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
1243
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1244
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1245
+ }).describe("Delivery destination address."),
1246
+ "description": z$1.string().describe("Human-readable delivery description (e.g., 'Arrives in 5-8 business days').").optional(),
1247
+ "fulfillable_on": z$1.string().describe("When this expectation can be fulfilled: 'now' or ISO 8601 timestamp for future date (backorder, pre-order).").optional()
1248
+ }).describe("Buyer-facing fulfillment expectation representing logical groupings of items (e.g., 'package'). Can be split, merged, or adjusted post-order to set buyer expectations for when/how items arrive.")).describe("Buyer-facing groups representing when/how items will be delivered. Can be split, merged, or adjusted post-order.").optional(),
1249
+ "events": z$1.array(z$1.object({
1250
+ "id": z$1.string().describe("Fulfillment event identifier."),
1251
+ "occurred_at": z$1.string().datetime({ offset: true }).describe("RFC 3339 timestamp when this fulfillment event occurred."),
1252
+ "type": z$1.string().describe("Fulfillment event type. Common values include: processing (preparing to ship), shipped (handed to carrier), in_transit (in delivery network), delivered (received by buyer), failed_attempt (delivery attempt failed), canceled (fulfillment canceled), undeliverable (cannot be delivered), returned_to_sender (returned to merchant)."),
1253
+ "line_items": z$1.array(z$1.object({
1254
+ "id": z$1.string().describe("Line item ID reference."),
1255
+ "quantity": z$1.number().int().gte(1).describe("Quantity fulfilled in this event.")
1256
+ })).describe("Which line items and quantities are fulfilled in this event."),
843
1257
  "tracking_number": z$1.string().describe("Carrier tracking number (required if type != processing).").optional(),
844
1258
  "tracking_url": z$1.string().url().describe("URL to track this shipment (required if type != processing).").optional(),
845
1259
  "carrier": z$1.string().describe("Carrier name (e.g., 'FedEx', 'USPS').").optional(),
@@ -859,22 +1273,21 @@ const OrderSchema = z$1.object({
859
1273
  "id": z$1.string().describe("Line item ID reference."),
860
1274
  "quantity": z$1.number().int().gte(1).describe("Quantity affected by this adjustment.")
861
1275
  })).describe("Which line items and quantities are affected (optional).").optional(),
862
- "amount": z$1.number().int().describe("Amount in minor units (cents) for refunds, credits, price adjustments (optional).").optional(),
1276
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units for refunds, credits, or price adjustments.").optional(),
863
1277
  "description": z$1.string().describe("Human-readable reason or description (e.g., 'Defective item', 'Customer requested').").optional()
864
1278
  }).describe("Append-only event that exists independently of fulfillment. Typically represents money movements but can be any post-order change. Polymorphic type that can optionally reference line items.")).describe("Append-only event log of money movements (refunds, returns, credits, disputes, cancellations, etc.) that exist independently of fulfillment.").optional(),
865
- "totals": z$1.array(z$1.object({
866
- "type": z$1.enum([
867
- "items_discount",
868
- "subtotal",
869
- "discount",
870
- "fulfillment",
871
- "tax",
872
- "fee",
873
- "total"
874
- ]).describe("Type of total categorization."),
1279
+ "currency": z$1.string().describe("ISO 4217 currency code. MUST match the currency from the originating checkout session.").optional(),
1280
+ "totals": z$1.array(z$1.intersection(z$1.intersection(z$1.object({
1281
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
875
1282
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
876
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
877
- })).describe("Different totals for the order.")
1283
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
1284
+ }).describe("A cost breakdown entry with a category, amount, and optional display text."), z$1.object({
1285
+ "amount": z$1.number().int().describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD). May be negative — the sign is intrinsic to the value (e.g., discounts are negative, charges are positive).").optional(),
1286
+ "lines": z$1.array(z$1.object({
1287
+ "display_text": z$1.string().describe("Human-readable label for this sub-line."),
1288
+ "amount": z$1.number().int().describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD). May be negative — the sign is intrinsic to the value (e.g., discounts are negative, charges are positive).")
1289
+ }).describe("Sub-line entry. Additional metadata MAY be included.")).describe("Optional itemized breakdown. The parent entry is always rendered; lines are supplementary. Sum of line amounts MUST equal the parent entry amount.").optional()
1290
+ })), z$1.intersection(z$1.any(), z$1.intersection(z$1.any(), z$1.any())))).describe("Different totals for the order.")
878
1291
  }).describe("Order schema with immutable line items, buyer-facing fulfillment expectations, and append-only event logs.");
879
1292
  const PaymentSchema = z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
880
1293
  "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
@@ -891,9 +1304,9 @@ const PaymentSchema = z$1.object({ "instruments": z$1.array(z$1.intersection(z$1
891
1304
  "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
892
1305
  "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
893
1306
  }).describe("The billing address associated with this payment method.").optional(),
894
- "credential": z$1.object({ "type": z$1.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(),
1307
+ "credential": z$1.object({ "type": z$1.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(),
895
1308
  "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
896
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({ "selected": z$1.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.");
1309
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({ "selected": z$1.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.");
897
1310
  const AccountInfoSchema = z$1.object({ "payment_account_reference": z$1.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.");
898
1311
  const AdjustmentSchema = z$1.object({
899
1312
  "id": z$1.string().describe("Adjustment event identifier."),
@@ -908,9 +1321,14 @@ const AdjustmentSchema = z$1.object({
908
1321
  "id": z$1.string().describe("Line item ID reference."),
909
1322
  "quantity": z$1.number().int().gte(1).describe("Quantity affected by this adjustment.")
910
1323
  })).describe("Which line items and quantities are affected (optional).").optional(),
911
- "amount": z$1.number().int().describe("Amount in minor units (cents) for refunds, credits, price adjustments (optional).").optional(),
1324
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units for refunds, credits, or price adjustments.").optional(),
912
1325
  "description": z$1.string().describe("Human-readable reason or description (e.g., 'Defective item', 'Customer requested').").optional()
913
1326
  }).describe("Append-only event that exists independently of fulfillment. Typically represents money movements but can be any post-order change. Polymorphic type that can optionally reference line items.");
1327
+ const AmountSchema = z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).");
1328
+ const AvailablePaymentInstrumentSchema = z$1.object({
1329
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
1330
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
1331
+ }).describe("An instrument type available from a payment handler with optional constraints.");
914
1332
  const BindingSchema = z$1.object({
915
1333
  "checkout_id": z$1.string().describe("The checkout session identifier this token is bound to."),
916
1334
  "identity": z$1.object({ "access_token": z$1.string().describe("Unique identifier for this participant, obtained during onboarding with the tokenizer.") }).describe("The participant this token is bound to. Required when acting on behalf of another participant (e.g., agent tokenizing for merchant). Omit when the authenticated caller is the binding target.").optional()
@@ -927,8 +1345,8 @@ const BuyerSchema = z$1.object({
927
1345
  "last_name": z$1.string().describe("Last name of the buyer.").optional(),
928
1346
  "email": z$1.string().describe("Email of the buyer.").optional(),
929
1347
  "phone_number": z$1.string().describe("E.164 standard.").optional()
930
- });
931
- const CardCredentialSchema = z$1.intersection(z$1.object({ "type": z$1.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."), z$1.object({
1348
+ }).passthrough();
1349
+ const CardCredentialSchema = z$1.intersection(z$1.object({ "type": z$1.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."), z$1.object({
932
1350
  "type": z$1.literal("card").describe("The credential type identifier for card credentials."),
933
1351
  "card_number_type": z$1.enum([
934
1352
  "fpan",
@@ -943,65 +1361,157 @@ const CardCredentialSchema = z$1.intersection(z$1.object({ "type": z$1.string().
943
1361
  "cryptogram": z$1.string().describe("Cryptogram provided with network tokens.").optional(),
944
1362
  "eci_value": z$1.string().describe("Electronic Commerce Indicator / Security Level Indicator provided with network tokens.").optional()
945
1363
  })).describe("A card credential containing sensitive payment card details including raw Primary Account Numbers (PANs). This credential type MUST NOT be used for checkout, only with payment handlers that tokenize or encrypt credentials. CRITICAL: Both parties handling CardCredential (sender and receiver) MUST be PCI DSS compliant. Transmission MUST use HTTPS/TLS with strong cipher suites.");
946
- const CardPaymentInstrumentSchema = z$1.intersection(z$1.object({
947
- "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
948
- "handler_id": z$1.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
949
- "type": z$1.string().describe("The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas will constrain this to a constant value."),
950
- "billing_address": z$1.object({
951
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
952
- "street_address": z$1.string().describe("The street address.").optional(),
953
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
954
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
955
- "address_country": z$1.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(),
956
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
957
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
958
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
959
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
960
- }).describe("The billing address associated with this payment method.").optional(),
961
- "credential": z$1.object({ "type": z$1.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(),
962
- "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
963
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({
964
- "type": z$1.literal("card").describe("Indicates this is a card payment instrument."),
965
- "display": z$1.object({
966
- "brand": z$1.string().describe("The card brand/network (e.g., visa, mastercard, amex).").optional(),
967
- "last_digits": z$1.string().describe("Last 4 digits of the card number.").optional(),
968
- "expiry_month": z$1.number().int().describe("The month of the card's expiration date (1-12).").optional(),
969
- "expiry_year": z$1.number().int().describe("The year of the card's expiration date.").optional(),
970
- "description": z$1.string().describe("An optional rich text description of the card to display to the user (e.g., 'Visa ending in 1234, expires 12/2025').").optional(),
971
- "card_art": z$1.string().url().describe("An optional URI to a rich image representing the card (e.g., card art provided by the issuer).").optional()
972
- }).describe("Display information for this card payment instrument.").optional()
973
- })).describe("A basic card payment instrument with visible card details. Can be inherited by a handler's instrument schema to define handler-specific display details or more complex credential structures.");
1364
+ const CardPaymentInstrumentAvailableCardPaymentInstrumentSchema = z$1.intersection(z$1.object({
1365
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
1366
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
1367
+ }).describe("An instrument type available from a payment handler with optional constraints."), z$1.object({
1368
+ "type": z$1.literal("card").optional(),
1369
+ "constraints": z$1.object({ "brands": z$1.array(z$1.string()).min(1).refine((arr) => arr.every((item, i) => arr.indexOf(item) == i), "All items must be unique!").describe("Limit to specific card brands (e.g., ['visa', 'mastercard', 'amex']).").optional() }).optional()
1370
+ })).describe("Declares card instrument availability with card-specific constraints.");
1371
+ const CategorySchema = z$1.object({
1372
+ "value": z$1.string().describe("Category value or path (e.g., 'Apparel > Shirts', '1604')."),
1373
+ "taxonomy": z$1.string().describe("Source taxonomy. Well-known values: `google_product_category`, `shopify`, `merchant`.").optional()
1374
+ }).describe("A product category with optional taxonomy identifier.");
974
1375
  const ContextSchema = z$1.object({
975
1376
  "address_country": z$1.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(),
976
1377
  "address_region": z$1.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(),
977
- "postal_code": z$1.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional()
978
- }).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.");
979
- const ExpectationSchema = z$1.object({
980
- "id": z$1.string().describe("Expectation identifier."),
981
- "line_items": z$1.array(z$1.object({
982
- "id": z$1.string().describe("Line item ID reference."),
983
- "quantity": z$1.number().int().gte(1).describe("Quantity of this item in this expectation.")
984
- })).describe("Which line items and quantities are in this expectation."),
985
- "method_type": z$1.enum([
986
- "shipping",
987
- "pickup",
988
- "digital"
989
- ]).describe("Delivery method type (shipping, pickup, digital)."),
990
- "destination": z$1.object({
991
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
992
- "street_address": z$1.string().describe("The street address.").optional(),
993
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
994
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
995
- "address_country": z$1.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(),
996
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
997
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
998
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
999
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1000
- }).describe("Delivery destination address."),
1001
- "description": z$1.string().describe("Human-readable delivery description (e.g., 'Arrives in 5-8 business days').").optional(),
1002
- "fulfillable_on": z$1.string().describe("When this expectation can be fulfilled: 'now' or ISO 8601 timestamp for future date (backorder, pre-order).").optional()
1003
- }).describe("Buyer-facing fulfillment expectation representing logical groupings of items (e.g., 'package'). Can be split, merged, or adjusted post-order to set buyer expectations for when/how items arrive.");
1004
- const FulfillmentSchema = z$1.object({
1378
+ "postal_code": z$1.string().describe("The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value.").optional(),
1379
+ "intent": z$1.string().describe("Background context describing buyer's intent (e.g., 'looking for a gift under $50', 'need something durable for outdoor use'). Informs relevance, recommendations, and personalization.").optional(),
1380
+ "language": z$1.string().describe("Preferred language for content. Use IETF BCP 47 language tags (e.g., 'en', 'fr-CA', 'zh-Hans'). For REST, equivalent to Accept-Language header—platforms SHOULD fall back to Accept-Language when this field is absent; when provided, overrides Accept-Language. Businesses MAY return content in a different language if unavailable.").optional(),
1381
+ "currency": z$1.string().describe("Preferred currency (ISO 4217, e.g., 'EUR', 'USD'). Businesses determine presentment currency from context and authoritative signals; this hint MAY inform selection in multi-currency markets. Also serves as the denomination for price filter values — platforms SHOULD include this field when sending price filters. Response prices include explicit currency confirming the resolution.").optional(),
1382
+ "eligibility": z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Reverse-domain identifier used for collision-safe namespacing of capabilities, services, handlers, eligibility claims, and extension-contributed keys. Must contain at least two dot-separated segments (e.g., 'dev.ucp.shopping.checkout', 'com.example.loyalty_gold').")).refine((arr) => arr.every((item, i) => arr.indexOf(item) == i), "All items must be unique!").describe("Buyer claims about eligible benefits such as loyalty membership, payment instrument perks, and similar. Recognized claims MAY inform the Business response (e.g., member-only product availability, adjusted pricing in catalog, provisional discounts at cart or checkout). Businesses MUST ignore unrecognized values without error. Values MUST use reverse-domain naming (e.g., 'com.example.loyalty_gold', 'org.school.student') and MUST be non-identifying.").optional()
1383
+ }).passthrough().describe("Provisional buyer signals for relevance and localization—not authoritative data. Businesses SHOULD use these values when verified inputs (e.g., shipping address) are absent, and MAY ignore or down-rank them if inconsistent with higher-confidence signals (authenticated account, risk detection) or regulatory constraints (export controls). Eligibility and policy enforcement MUST occur at checkout time using binding transaction data. Context SHOULD be non-identifying and can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context.");
1384
+ const DescriptionSchema = z$1.object({
1385
+ "plain": z$1.string().describe("Plain text content.").optional(),
1386
+ "html": z$1.string().describe("HTML-formatted content. Security: Platforms MUST sanitize before rendering—strip scripts, event handlers, and untrusted elements. Treat all rich text as untrusted input.").optional(),
1387
+ "markdown": z$1.string().describe("Markdown-formatted content.").optional()
1388
+ }).describe("Description content in one or more formats. At least one format must be provided.");
1389
+ const ErrorCodeSchema = z$1.string().describe("Error code identifying the type of error. Standard errors are defined in specification (see examples), and have standardized semantics; freeform codes are permitted.");
1390
+ const ErrorResponseSchema = z$1.object({
1391
+ "ucp": z$1.intersection(z$1.object({
1392
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1393
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1394
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1395
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1396
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1397
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1398
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1399
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1400
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
1401
+ "transport": z$1.enum([
1402
+ "rest",
1403
+ "mcp",
1404
+ "a2a",
1405
+ "embedded"
1406
+ ]).describe("Transport protocol for this service binding."),
1407
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
1408
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
1409
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1410
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1411
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1412
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1413
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1414
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1415
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
1416
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
1417
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1418
+ const passed = schemas.length - errors.length;
1419
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1420
+ path: ctx.path,
1421
+ code: "invalid_union",
1422
+ unionErrors: errors,
1423
+ message: "Invalid input: Should pass single schema. Passed " + passed
1424
+ } : {
1425
+ path: ctx.path,
1426
+ code: "custom",
1427
+ message: "Invalid input: Should pass single schema. Passed " + passed
1428
+ });
1429
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
1430
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1431
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1432
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1433
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1434
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1435
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1436
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
1437
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
1438
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
1439
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
1440
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({ "status": z$1.literal("error") })).describe("UCP protocol metadata. Status MUST be 'error' for error response."),
1441
+ "messages": z$1.array(z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
1442
+ const schemas = [
1443
+ z$1.object({
1444
+ "type": z$1.literal("error").describe("Message type discriminator."),
1445
+ "code": z$1.string().describe("Error code identifying the type of error. Standard errors are defined in specification (see examples), and have standardized semantics; freeform codes are permitted."),
1446
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
1447
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1448
+ "content": z$1.string().describe("Human-readable message."),
1449
+ "severity": z$1.enum([
1450
+ "recoverable",
1451
+ "requires_buyer_input",
1452
+ "requires_buyer_review",
1453
+ "unrecoverable"
1454
+ ]).describe("Reflects the resource state and recommended action. 'recoverable': platform can resolve by modifying inputs and retrying 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. 'unrecoverable': no valid resource exists to act on, retry with new resource or inputs. Errors with 'requires_*' severity contribute to 'status: requires_escalation'.")
1455
+ }),
1456
+ z$1.object({
1457
+ "type": z$1.literal("warning").describe("Message type discriminator."),
1458
+ "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
1459
+ "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
1460
+ "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
1461
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1462
+ "presentation": z$1.string().describe("Rendering contract for this warning. 'notice' (default): platform MUST display, MAY dismiss. 'disclosure': platform MUST display in proximity to the path-referenced component, MUST NOT hide or auto-dismiss. See specification for full contract.").default("notice"),
1463
+ "image_url": z$1.string().url().describe("URL to a required visual element (e.g., warning symbol, energy class label).").optional(),
1464
+ "url": z$1.string().url().describe("Reference URL for more information (e.g., regulatory site, registry entry, policy page).").optional()
1465
+ }),
1466
+ z$1.object({
1467
+ "type": z$1.literal("info").describe("Message type discriminator."),
1468
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to.").optional(),
1469
+ "code": z$1.string().describe("Info code for programmatic handling.").optional(),
1470
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1471
+ "content": z$1.string().describe("Human-readable message.")
1472
+ })
1473
+ ];
1474
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1475
+ const passed = schemas.length - errors.length;
1476
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1477
+ path: ctx.path,
1478
+ code: "invalid_union",
1479
+ unionErrors: errors,
1480
+ message: "Invalid input: Should pass single schema. Passed " + passed
1481
+ } : {
1482
+ path: ctx.path,
1483
+ code: "custom",
1484
+ message: "Invalid input: Should pass single schema. Passed " + passed
1485
+ });
1486
+ })).describe("Container for error, warning, or info messages.")).min(1).describe("Array of messages describing why the operation failed."),
1487
+ "continue_url": z$1.string().url().describe("URL for buyer handoff or session recovery.").optional()
1488
+ }).strict().describe("Generic error response when business logic prevents resource creation or failed to retrieve resource. Used when no valid resource can be established.");
1489
+ const ExpectationSchema = z$1.object({
1490
+ "id": z$1.string().describe("Expectation identifier."),
1491
+ "line_items": z$1.array(z$1.object({
1492
+ "id": z$1.string().describe("Line item ID reference."),
1493
+ "quantity": z$1.number().int().gte(1).describe("Quantity of this item in this expectation.")
1494
+ })).describe("Which line items and quantities are in this expectation."),
1495
+ "method_type": z$1.enum([
1496
+ "shipping",
1497
+ "pickup",
1498
+ "digital"
1499
+ ]).describe("Delivery method type (shipping, pickup, digital)."),
1500
+ "destination": z$1.object({
1501
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1502
+ "street_address": z$1.string().describe("The street address.").optional(),
1503
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
1504
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
1505
+ "address_country": z$1.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(),
1506
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
1507
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
1508
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1509
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1510
+ }).describe("Delivery destination address."),
1511
+ "description": z$1.string().describe("Human-readable delivery description (e.g., 'Arrives in 5-8 business days').").optional(),
1512
+ "fulfillable_on": z$1.string().describe("When this expectation can be fulfilled: 'now' or ISO 8601 timestamp for future date (backorder, pre-order).").optional()
1513
+ }).describe("Buyer-facing fulfillment expectation representing logical groupings of items (e.g., 'package'). Can be split, merged, or adjusted post-order to set buyer expectations for when/how items arrive.");
1514
+ const FulfillmentSchema = z$1.object({
1005
1515
  "methods": z$1.array(z$1.object({
1006
1516
  "id": z$1.string().describe("Unique fulfillment method identifier."),
1007
1517
  "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type."),
@@ -1031,7 +1541,7 @@ const FulfillmentSchema = z$1.object({
1031
1541
  "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1032
1542
  "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1033
1543
  }).describe("Physical address of the location.").optional()
1034
- }).describe("A pickup location (retail store, locker, etc.).")];
1544
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).")];
1035
1545
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1036
1546
  const passed = schemas.length - errors.length;
1037
1547
  if (passed !== 1) ctx.addIssue(errors.length ? {
@@ -1057,35 +1567,27 @@ const FulfillmentSchema = z$1.object({
1057
1567
  "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1058
1568
  "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1059
1569
  "totals": z$1.array(z$1.object({
1060
- "type": z$1.enum([
1061
- "items_discount",
1062
- "subtotal",
1063
- "discount",
1064
- "fulfillment",
1065
- "tax",
1066
- "fee",
1067
- "total"
1068
- ]).describe("Type of total categorization."),
1570
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1069
1571
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1070
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
1071
- })).describe("Fulfillment option totals breakdown.")
1072
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1572
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
1573
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
1574
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1073
1575
  "selected_option_id": z$1.union([z$1.string().describe("ID of the selected fulfillment option for this group."), z$1.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
1074
- }).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()
1075
- }).describe("A fulfillment method (shipping or pickup) with destinations and groups.")).describe("Fulfillment methods for cart items.").optional(),
1576
+ }).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()
1577
+ }).passthrough().describe("A fulfillment method (shipping or pickup) with destinations and groups.")).describe("Fulfillment methods for cart items.").optional(),
1076
1578
  "available_methods": z$1.array(z$1.object({
1077
1579
  "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to."),
1078
1580
  "line_item_ids": z$1.array(z$1.string()).describe("Line items available for this fulfillment method."),
1079
1581
  "fulfillable_on": z$1.union([z$1.string().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers)."), z$1.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(),
1080
1582
  "description": z$1.string().describe("Human-readable availability info (e.g., 'Available for pickup at Downtown Store today').").optional()
1081
- }).describe("Inventory availability hint for a fulfillment method type.")).describe("Inventory availability hints.").optional()
1583
+ }).passthrough().describe("Inventory availability hint for a fulfillment method type.")).describe("Inventory availability hints.").optional()
1082
1584
  }).describe("Container for fulfillment methods and availability.");
1083
1585
  const FulfillmentAvailableMethodSchema = z$1.object({
1084
1586
  "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to."),
1085
1587
  "line_item_ids": z$1.array(z$1.string()).describe("Line items available for this fulfillment method."),
1086
1588
  "fulfillable_on": z$1.union([z$1.string().describe("'now' for immediate availability, or ISO 8601 date for future (preorders, transfers)."), z$1.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(),
1087
1589
  "description": z$1.string().describe("Human-readable availability info (e.g., 'Available for pickup at Downtown Store today').").optional()
1088
- }).describe("Inventory availability hint for a fulfillment method type.");
1590
+ }).passthrough().describe("Inventory availability hint for a fulfillment method type.");
1089
1591
  const FulfillmentDestinationSchema = z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
1090
1592
  const schemas = [z$1.record(z$1.string(), z$1.unknown()).and(z$1.intersection(z$1.object({
1091
1593
  "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
@@ -1111,7 +1613,7 @@ const FulfillmentDestinationSchema = z$1.record(z$1.string(), z$1.unknown()).and
1111
1613
  "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1112
1614
  "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1113
1615
  }).describe("Physical address of the location.").optional()
1114
- }).describe("A pickup location (retail store, locker, etc.).")];
1616
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).")];
1115
1617
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1116
1618
  const passed = schemas.length - errors.length;
1117
1619
  if (passed !== 1) ctx.addIssue(errors.length ? {
@@ -1149,21 +1651,13 @@ const FulfillmentGroupSchema = z$1.object({
1149
1651
  "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1150
1652
  "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1151
1653
  "totals": z$1.array(z$1.object({
1152
- "type": z$1.enum([
1153
- "items_discount",
1154
- "subtotal",
1155
- "discount",
1156
- "fulfillment",
1157
- "tax",
1158
- "fee",
1159
- "total"
1160
- ]).describe("Type of total categorization."),
1654
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1161
1655
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1162
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
1163
- })).describe("Fulfillment option totals breakdown.")
1164
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1656
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
1657
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
1658
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1165
1659
  "selected_option_id": z$1.union([z$1.string().describe("ID of the selected fulfillment option for this group."), z$1.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
1166
- }).describe("A merchant-generated package/group of line items with fulfillment options.");
1660
+ }).passthrough().describe("A merchant-generated package/group of line items with fulfillment options.");
1167
1661
  const FulfillmentGroupUpdateRequestSchema = z$1.object({ "id": z$1.string().describe("Group identifier for referencing merchant-generated groups in updates.") }).strict();
1168
1662
  const FulfillmentMethodSchema = z$1.object({
1169
1663
  "id": z$1.string().describe("Unique fulfillment method identifier."),
@@ -1194,7 +1688,799 @@ const FulfillmentMethodSchema = z$1.object({
1194
1688
  "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1195
1689
  "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1196
1690
  }).describe("Physical address of the location.").optional()
1197
- }).describe("A pickup location (retail store, locker, etc.).")];
1691
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).")];
1692
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1693
+ const passed = schemas.length - errors.length;
1694
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1695
+ path: ctx.path,
1696
+ code: "invalid_union",
1697
+ unionErrors: errors,
1698
+ message: "Invalid input: Should pass single schema. Passed " + passed
1699
+ } : {
1700
+ path: ctx.path,
1701
+ code: "custom",
1702
+ message: "Invalid input: Should pass single schema. Passed " + passed
1703
+ });
1704
+ })).describe("A destination for fulfillment.")).describe("Available destinations. For shipping: addresses. For pickup: retail locations.").optional(),
1705
+ "selected_destination_id": z$1.union([z$1.string().describe("ID of the selected destination."), z$1.null().describe("ID of the selected destination.")]).describe("ID of the selected destination.").optional(),
1706
+ "groups": z$1.array(z$1.object({
1707
+ "id": z$1.string().describe("Group identifier for referencing merchant-generated groups in updates."),
1708
+ "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs included in this group/package."),
1709
+ "options": z$1.array(z$1.object({
1710
+ "id": z$1.string().describe("Unique fulfillment option identifier."),
1711
+ "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
1712
+ "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
1713
+ "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
1714
+ "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1715
+ "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1716
+ "totals": z$1.array(z$1.object({
1717
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1718
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1719
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
1720
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
1721
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1722
+ "selected_option_id": z$1.union([z$1.string().describe("ID of the selected fulfillment option for this group."), z$1.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
1723
+ }).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()
1724
+ }).passthrough().describe("A fulfillment method (shipping or pickup) with destinations and groups.");
1725
+ const FulfillmentMethodCreateRequestSchema = z$1.object({
1726
+ "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type."),
1727
+ "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs fulfilled via this method.").optional()
1728
+ }).strict();
1729
+ const FulfillmentMethodUpdateRequestSchema = z$1.object({
1730
+ "id": z$1.string().describe("Unique fulfillment method identifier.").optional(),
1731
+ "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type.").optional(),
1732
+ "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs fulfilled via this method.")
1733
+ }).strict();
1734
+ const FulfillmentOptionSchema = z$1.object({
1735
+ "id": z$1.string().describe("Unique fulfillment option identifier."),
1736
+ "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
1737
+ "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
1738
+ "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
1739
+ "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1740
+ "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1741
+ "totals": z$1.array(z$1.object({
1742
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1743
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1744
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
1745
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
1746
+ }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).");
1747
+ const InputCorrelationSchema = z$1.object({
1748
+ "id": z$1.string().describe("The identifier from the lookup request that resolved to this variant."),
1749
+ "match": z$1.string().describe("How the request identifier resolved to this variant. Well-known values: `exact` (input directly identifies this variant, e.g., variant ID, SKU), `featured` (server selected this variant as representative, e.g., product ID resolved to best match). Businesses MAY implement and provide additional resolution strategies.").optional()
1750
+ }).describe("Maps a request identifier to the variant it resolved to, with match semantics.");
1751
+ const ItemSchema = z$1.object({
1752
+ "id": z$1.string().describe("The product identifier, often the SKU, required to resolve the product details associated with this line item. Should be recognized by both the Platform, and the Business."),
1753
+ "title": z$1.string().describe("Product title."),
1754
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
1755
+ "image_url": z$1.string().url().describe("Product image URI.").optional()
1756
+ });
1757
+ const LineItemSchema = z$1.object({
1758
+ "id": z$1.string(),
1759
+ "item": z$1.object({
1760
+ "id": z$1.string().describe("The product identifier, often the SKU, required to resolve the product details associated with this line item. Should be recognized by both the Platform, and the Business."),
1761
+ "title": z$1.string().describe("Product title."),
1762
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
1763
+ "image_url": z$1.string().url().describe("Product image URI.").optional()
1764
+ }),
1765
+ "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
1766
+ "totals": z$1.array(z$1.object({
1767
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1768
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1769
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
1770
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
1771
+ "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
1772
+ }).describe("Line item object. Expected to use the currency of the parent object.");
1773
+ const LineItemUpdateRequestSchema = z$1.object({
1774
+ "id": z$1.string().optional(),
1775
+ "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
1776
+ }).strict();
1777
+ const LinkSchema = z$1.object({
1778
+ "type": z$1.string().describe("Type of link. Well-known values: `privacy_policy`, `terms_of_service`, `refund_policy`, `shipping_policy`, `faq`. Consumers SHOULD handle unknown values gracefully by displaying them using the `title` field or omitting the link."),
1779
+ "url": z$1.string().url().describe("The actual URL pointing to the content to be displayed."),
1780
+ "title": z$1.string().describe("Optional display text for the link. When provided, use this instead of generating from type.").optional()
1781
+ });
1782
+ const MediaSchema = z$1.object({
1783
+ "type": z$1.string().describe("Media type. Well-known values: `image`, `video`, `model_3d`."),
1784
+ "url": z$1.string().url().describe("URL to the media resource."),
1785
+ "alt_text": z$1.string().describe("Accessibility text describing the media.").optional(),
1786
+ "width": z$1.number().int().gte(1).describe("Width in pixels (for images/video).").optional(),
1787
+ "height": z$1.number().int().gte(1).describe("Height in pixels (for images/video).").optional()
1788
+ }).describe("Product media item (image, video, etc.).");
1789
+ const MerchantFulfillmentConfigSchema = z$1.object({
1790
+ "allows_multi_destination": z$1.object({
1791
+ "shipping": z$1.boolean().describe("Multiple shipping destinations allowed.").optional(),
1792
+ "pickup": z$1.boolean().describe("Multiple pickup locations allowed.").optional()
1793
+ }).strict().describe("Permits multiple destinations per method type.").optional(),
1794
+ "allows_method_combinations": z$1.array(z$1.array(z$1.enum(["shipping", "pickup"]))).describe("Allowed method type combinations.").optional()
1795
+ }).describe("Merchant's fulfillment configuration.");
1796
+ const MessageSchema = z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
1797
+ const schemas = [
1798
+ z$1.object({
1799
+ "type": z$1.literal("error").describe("Message type discriminator."),
1800
+ "code": z$1.string().describe("Error code identifying the type of error. Standard errors are defined in specification (see examples), and have standardized semantics; freeform codes are permitted."),
1801
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
1802
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1803
+ "content": z$1.string().describe("Human-readable message."),
1804
+ "severity": z$1.enum([
1805
+ "recoverable",
1806
+ "requires_buyer_input",
1807
+ "requires_buyer_review",
1808
+ "unrecoverable"
1809
+ ]).describe("Reflects the resource state and recommended action. 'recoverable': platform can resolve by modifying inputs and retrying 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. 'unrecoverable': no valid resource exists to act on, retry with new resource or inputs. Errors with 'requires_*' severity contribute to 'status: requires_escalation'.")
1810
+ }),
1811
+ z$1.object({
1812
+ "type": z$1.literal("warning").describe("Message type discriminator."),
1813
+ "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
1814
+ "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
1815
+ "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
1816
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1817
+ "presentation": z$1.string().describe("Rendering contract for this warning. 'notice' (default): platform MUST display, MAY dismiss. 'disclosure': platform MUST display in proximity to the path-referenced component, MUST NOT hide or auto-dismiss. See specification for full contract.").default("notice"),
1818
+ "image_url": z$1.string().url().describe("URL to a required visual element (e.g., warning symbol, energy class label).").optional(),
1819
+ "url": z$1.string().url().describe("Reference URL for more information (e.g., regulatory site, registry entry, policy page).").optional()
1820
+ }),
1821
+ z$1.object({
1822
+ "type": z$1.literal("info").describe("Message type discriminator."),
1823
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to.").optional(),
1824
+ "code": z$1.string().describe("Info code for programmatic handling.").optional(),
1825
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1826
+ "content": z$1.string().describe("Human-readable message.")
1827
+ })
1828
+ ];
1829
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1830
+ const passed = schemas.length - errors.length;
1831
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1832
+ path: ctx.path,
1833
+ code: "invalid_union",
1834
+ unionErrors: errors,
1835
+ message: "Invalid input: Should pass single schema. Passed " + passed
1836
+ } : {
1837
+ path: ctx.path,
1838
+ code: "custom",
1839
+ message: "Invalid input: Should pass single schema. Passed " + passed
1840
+ });
1841
+ })).describe("Container for error, warning, or info messages.");
1842
+ const MessageErrorSchema = z$1.object({
1843
+ "type": z$1.literal("error").describe("Message type discriminator."),
1844
+ "code": z$1.string().describe("Error code identifying the type of error. Standard errors are defined in specification (see examples), and have standardized semantics; freeform codes are permitted."),
1845
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
1846
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1847
+ "content": z$1.string().describe("Human-readable message."),
1848
+ "severity": z$1.enum([
1849
+ "recoverable",
1850
+ "requires_buyer_input",
1851
+ "requires_buyer_review",
1852
+ "unrecoverable"
1853
+ ]).describe("Reflects the resource state and recommended action. 'recoverable': platform can resolve by modifying inputs and retrying 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. 'unrecoverable': no valid resource exists to act on, retry with new resource or inputs. Errors with 'requires_*' severity contribute to 'status: requires_escalation'.")
1854
+ });
1855
+ const MessageInfoSchema = z$1.object({
1856
+ "type": z$1.literal("info").describe("Message type discriminator."),
1857
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to.").optional(),
1858
+ "code": z$1.string().describe("Info code for programmatic handling.").optional(),
1859
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1860
+ "content": z$1.string().describe("Human-readable message.")
1861
+ });
1862
+ const MessageWarningSchema = z$1.object({
1863
+ "type": z$1.literal("warning").describe("Message type discriminator."),
1864
+ "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
1865
+ "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
1866
+ "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
1867
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1868
+ "presentation": z$1.string().describe("Rendering contract for this warning. 'notice' (default): platform MUST display, MAY dismiss. 'disclosure': platform MUST display in proximity to the path-referenced component, MUST NOT hide or auto-dismiss. See specification for full contract.").default("notice"),
1869
+ "image_url": z$1.string().url().describe("URL to a required visual element (e.g., warning symbol, energy class label).").optional(),
1870
+ "url": z$1.string().url().describe("Reference URL for more information (e.g., regulatory site, registry entry, policy page).").optional()
1871
+ });
1872
+ const OptionValueSchema = z$1.object({ "label": z$1.string().describe("Display text for this option value (e.g., 'Small', 'Blue').") }).describe("A selectable value for a product option.");
1873
+ const OrderConfirmationSchema = z$1.object({
1874
+ "id": z$1.string().describe("Unique order identifier."),
1875
+ "permalink_url": z$1.string().url().describe("Permalink to access the order on merchant site.")
1876
+ }).describe("Order details available at the time of checkout completion.");
1877
+ const OrderLineItemSchema = z$1.object({
1878
+ "id": z$1.string().describe("Line item identifier."),
1879
+ "item": z$1.object({
1880
+ "id": z$1.string().describe("The product identifier, often the SKU, required to resolve the product details associated with this line item. Should be recognized by both the Platform, and the Business."),
1881
+ "title": z$1.string().describe("Product title."),
1882
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
1883
+ "image_url": z$1.string().url().describe("Product image URI.").optional()
1884
+ }).describe("Product data (id, title, price, image_url)."),
1885
+ "quantity": z$1.object({
1886
+ "total": z$1.number().int().gte(0).describe("Current total quantity."),
1887
+ "fulfilled": z$1.number().int().gte(0).describe("Quantity fulfilled (sum from fulfillment events).")
1888
+ }).describe("Quantity tracking. Both total and fulfilled are derived from events."),
1889
+ "totals": z$1.array(z$1.object({
1890
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1891
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1892
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
1893
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
1894
+ "status": z$1.enum([
1895
+ "processing",
1896
+ "partial",
1897
+ "fulfilled"
1898
+ ]).describe("Derived status: fulfilled if quantity.fulfilled == quantity.total, partial if quantity.fulfilled > 0, otherwise processing."),
1899
+ "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
1900
+ });
1901
+ const PaginationSchema = z$1.record(z$1.string(), z$1.unknown()).describe("Cursor-based pagination for list operations.");
1902
+ const PaymentCredentialSchema = z$1.object({ "type": z$1.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.");
1903
+ const PaymentIdentitySchema = z$1.object({ "access_token": z$1.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.");
1904
+ const PaymentInstrumentSchema = z$1.object({
1905
+ "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
1906
+ "handler_id": z$1.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
1907
+ "type": z$1.string().describe("The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas will constrain this to a constant value."),
1908
+ "billing_address": z$1.object({
1909
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1910
+ "street_address": z$1.string().describe("The street address.").optional(),
1911
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
1912
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
1913
+ "address_country": z$1.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(),
1914
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
1915
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
1916
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1917
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1918
+ }).describe("The billing address associated with this payment method.").optional(),
1919
+ "credential": z$1.object({ "type": z$1.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(),
1920
+ "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
1921
+ }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler.");
1922
+ const PlatformFulfillmentConfigSchema = z$1.object({ "supports_multi_group": z$1.boolean().describe("Enables multiple groups per method.").default(false) }).describe("Platform's fulfillment configuration.");
1923
+ const PostalAddressSchema = z$1.object({
1924
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1925
+ "street_address": z$1.string().describe("The street address.").optional(),
1926
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
1927
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
1928
+ "address_country": z$1.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(),
1929
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
1930
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
1931
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1932
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1933
+ });
1934
+ const PriceSchema = z$1.object({
1935
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1936
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1937
+ }).describe("Price with explicit currency.");
1938
+ const PriceFilterSchema = z$1.object({
1939
+ "min": z$1.number().int().gte(0).describe("Minimum price in ISO 4217 minor units.").optional(),
1940
+ "max": z$1.number().int().gte(0).describe("Maximum price in ISO 4217 minor units.").optional()
1941
+ }).describe("Price range filter denominated in context.currency. When context.currency matches the presentment currency, businesses apply the filter directly. When it differs, businesses SHOULD convert filter values to the presentment currency before applying; if conversion is not supported, businesses MAY ignore the filter and SHOULD indicate this via a message. When context.currency is absent, filter denomination is ambiguous and businesses MAY ignore it.");
1942
+ const PriceRangeSchema = z$1.object({
1943
+ "min": z$1.object({
1944
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1945
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1946
+ }).describe("Minimum price in the range."),
1947
+ "max": z$1.object({
1948
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1949
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1950
+ }).describe("Maximum price in the range.")
1951
+ }).describe("A price range representing minimum and maximum values (e.g., across product variants).");
1952
+ const ProductSchema = z$1.object({
1953
+ "id": z$1.string().describe("Global ID (GID) uniquely identifying this product."),
1954
+ "handle": z$1.string().describe("URL-safe slug for SEO-friendly URLs (e.g., 'blue-runner-pro'). Use id for stable API references.").optional(),
1955
+ "title": z$1.string().describe("Product title."),
1956
+ "description": z$1.object({
1957
+ "plain": z$1.string().describe("Plain text content.").optional(),
1958
+ "html": z$1.string().describe("HTML-formatted content. Security: Platforms MUST sanitize before rendering—strip scripts, event handlers, and untrusted elements. Treat all rich text as untrusted input.").optional(),
1959
+ "markdown": z$1.string().describe("Markdown-formatted content.").optional()
1960
+ }).describe("Product description in one or more formats."),
1961
+ "url": z$1.string().url().describe("Canonical product page URL.").optional(),
1962
+ "categories": z$1.array(z$1.object({
1963
+ "value": z$1.string().describe("Category value or path (e.g., 'Apparel > Shirts', '1604')."),
1964
+ "taxonomy": z$1.string().describe("Source taxonomy. Well-known values: `google_product_category`, `shopify`, `merchant`.").optional()
1965
+ }).describe("A product category with optional taxonomy identifier.")).describe("Product categories with optional taxonomy identifiers.").optional(),
1966
+ "price_range": z$1.object({
1967
+ "min": z$1.object({
1968
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1969
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1970
+ }).describe("Minimum price in the range."),
1971
+ "max": z$1.object({
1972
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1973
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1974
+ }).describe("Maximum price in the range.")
1975
+ }).describe("Price range across all variants."),
1976
+ "list_price_range": z$1.object({
1977
+ "min": z$1.object({
1978
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1979
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1980
+ }).describe("Minimum price in the range."),
1981
+ "max": z$1.object({
1982
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1983
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1984
+ }).describe("Maximum price in the range.")
1985
+ }).describe("List price range before discounts (for strikethrough display).").optional(),
1986
+ "media": z$1.array(z$1.object({
1987
+ "type": z$1.string().describe("Media type. Well-known values: `image`, `video`, `model_3d`."),
1988
+ "url": z$1.string().url().describe("URL to the media resource."),
1989
+ "alt_text": z$1.string().describe("Accessibility text describing the media.").optional(),
1990
+ "width": z$1.number().int().gte(1).describe("Width in pixels (for images/video).").optional(),
1991
+ "height": z$1.number().int().gte(1).describe("Height in pixels (for images/video).").optional()
1992
+ }).describe("Product media item (image, video, etc.).")).describe("Product media (images, videos, 3D models). First item is the featured media for listings.").optional(),
1993
+ "options": z$1.array(z$1.object({
1994
+ "name": z$1.string().describe("Option name (e.g., 'Size', 'Color')."),
1995
+ "values": z$1.array(z$1.object({ "label": z$1.string().describe("Display text for this option value (e.g., 'Small', 'Blue').") }).describe("A selectable value for a product option.")).min(1).describe("Available values for this option.")
1996
+ }).describe("A product option such as size, color, or material.")).describe("Product options (Size, Color, etc.).").optional(),
1997
+ "variants": z$1.array(z$1.object({
1998
+ "id": z$1.string().describe("Global ID (GID) uniquely identifying this variant. Used as item.id in checkout."),
1999
+ "sku": z$1.string().describe("Business-assigned identifier for inventory and fulfillment.").optional(),
2000
+ "barcodes": z$1.array(z$1.object({
2001
+ "type": z$1.string().describe("Barcode standard. Well-known values: UPC, EAN, ISBN, GTIN, JAN."),
2002
+ "value": z$1.string().describe("Barcode value.")
2003
+ })).describe("Industry-standard product identifiers for cross-reference and correlation.").optional(),
2004
+ "handle": z$1.string().describe("URL-safe variant handle/slug.").optional(),
2005
+ "title": z$1.string().describe("Variant display title (e.g., 'Blue / Large')."),
2006
+ "description": z$1.object({
2007
+ "plain": z$1.string().describe("Plain text content.").optional(),
2008
+ "html": z$1.string().describe("HTML-formatted content. Security: Platforms MUST sanitize before rendering—strip scripts, event handlers, and untrusted elements. Treat all rich text as untrusted input.").optional(),
2009
+ "markdown": z$1.string().describe("Markdown-formatted content.").optional()
2010
+ }).describe("Variant description in one or more formats."),
2011
+ "url": z$1.string().url().describe("Canonical variant page URL.").optional(),
2012
+ "categories": z$1.array(z$1.object({
2013
+ "value": z$1.string().describe("Category value or path (e.g., 'Apparel > Shirts', '1604')."),
2014
+ "taxonomy": z$1.string().describe("Source taxonomy. Well-known values: `google_product_category`, `shopify`, `merchant`.").optional()
2015
+ }).describe("A product category with optional taxonomy identifier.")).describe("Variant categories with optional taxonomy identifiers.").optional(),
2016
+ "price": z$1.object({
2017
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
2018
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
2019
+ }).describe("Current selling price."),
2020
+ "list_price": z$1.object({
2021
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
2022
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
2023
+ }).describe("List price before discounts (for strikethrough display).").optional(),
2024
+ "unit_price": z$1.object({
2025
+ "amount": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units. Business MUST return precomputed unit price value: (variant.price / measure.value) * reference.value."),
2026
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code."),
2027
+ "measure": z$1.object({
2028
+ "value": z$1.number().describe("Package quantity."),
2029
+ "unit": z$1.string().describe("Unit of measurement.")
2030
+ }).describe("Product quantity in packaging (e.g., 750ml bottle)."),
2031
+ "reference": z$1.object({
2032
+ "value": z$1.number().int().describe("Reference quantity."),
2033
+ "unit": z$1.string().describe("Unit of measurement.")
2034
+ }).describe("Denominator for unit price display (e.g., per 100ml, per 1kg).")
2035
+ }).describe("Price per standard unit of measurement. MAY be omitted when unit pricing does not apply.").optional(),
2036
+ "availability": z$1.object({
2037
+ "available": z$1.boolean().describe("Whether this variant can be purchased. See status for fulfillment details.").optional(),
2038
+ "status": z$1.string().describe("Qualifies available with fulfillment state. Well-known values: `in_stock`, `backorder`, `preorder`, `out_of_stock`, `discontinued`.").optional()
2039
+ }).describe("Variant availability for purchase.").optional(),
2040
+ "selected_options": z$1.array(z$1.object({
2041
+ "name": z$1.string().describe("Option name (e.g., 'Size')."),
2042
+ "label": z$1.string().describe("Selected option label (e.g., 'Large').")
2043
+ }).describe("A specific option selection on a variant (e.g., Size: Large).")).describe("Option selections that define this variant.").optional(),
2044
+ "media": z$1.array(z$1.object({
2045
+ "type": z$1.string().describe("Media type. Well-known values: `image`, `video`, `model_3d`."),
2046
+ "url": z$1.string().url().describe("URL to the media resource."),
2047
+ "alt_text": z$1.string().describe("Accessibility text describing the media.").optional(),
2048
+ "width": z$1.number().int().gte(1).describe("Width in pixels (for images/video).").optional(),
2049
+ "height": z$1.number().int().gte(1).describe("Height in pixels (for images/video).").optional()
2050
+ }).describe("Product media item (image, video, etc.).")).describe("Variant media (images, videos, 3D models). First item is the featured media for listings.").optional(),
2051
+ "rating": z$1.object({
2052
+ "value": z$1.number().gte(0).describe("Average rating value."),
2053
+ "scale_min": z$1.number().gte(0).describe("Minimum value on the rating scale (e.g., 1 for 1-5 stars).").default(1),
2054
+ "scale_max": z$1.number().gte(1).describe("Maximum value on the rating scale (e.g., 5 for 5-star)."),
2055
+ "count": z$1.number().int().gte(0).describe("Number of reviews contributing to the rating.").optional()
2056
+ }).describe("Variant rating.").optional(),
2057
+ "tags": z$1.array(z$1.string()).describe("Variant tags for categorization and search.").optional(),
2058
+ "metadata": z$1.record(z$1.string(), z$1.unknown()).describe("Business-defined custom data extending the standard variant model.").optional(),
2059
+ "seller": z$1.object({
2060
+ "name": z$1.string().describe("Seller display name.").optional(),
2061
+ "links": z$1.array(z$1.object({
2062
+ "type": z$1.string().describe("Type of link. Well-known values: `privacy_policy`, `terms_of_service`, `refund_policy`, `shipping_policy`, `faq`. Consumers SHOULD handle unknown values gracefully by displaying them using the `title` field or omitting the link."),
2063
+ "url": z$1.string().url().describe("The actual URL pointing to the content to be displayed."),
2064
+ "title": z$1.string().describe("Optional display text for the link. When provided, use this instead of generating from type.").optional()
2065
+ })).describe("Seller policy and information links.").optional()
2066
+ }).describe("Optional seller context for this variant.").optional()
2067
+ }).describe("A purchasable variant of a product with specific option selections.")).min(1).describe("Purchasable variants of this product. First item is the featured variant for listings."),
2068
+ "rating": z$1.object({
2069
+ "value": z$1.number().gte(0).describe("Average rating value."),
2070
+ "scale_min": z$1.number().gte(0).describe("Minimum value on the rating scale (e.g., 1 for 1-5 stars).").default(1),
2071
+ "scale_max": z$1.number().gte(1).describe("Maximum value on the rating scale (e.g., 5 for 5-star)."),
2072
+ "count": z$1.number().int().gte(0).describe("Number of reviews contributing to the rating.").optional()
2073
+ }).describe("Aggregate product rating.").optional(),
2074
+ "tags": z$1.array(z$1.string()).describe("Product tags for categorization and search.").optional(),
2075
+ "metadata": z$1.record(z$1.string(), z$1.unknown()).describe("Business-defined custom data extending the standard product model.").optional()
2076
+ }).describe("A product in the catalog with variants and options.");
2077
+ const ProductOptionSchema = z$1.object({
2078
+ "name": z$1.string().describe("Option name (e.g., 'Size', 'Color')."),
2079
+ "values": z$1.array(z$1.object({ "label": z$1.string().describe("Display text for this option value (e.g., 'Small', 'Blue').") }).describe("A selectable value for a product option.")).min(1).describe("Available values for this option.")
2080
+ }).describe("A product option such as size, color, or material.");
2081
+ const RatingSchema = z$1.object({
2082
+ "value": z$1.number().gte(0).describe("Average rating value."),
2083
+ "scale_min": z$1.number().gte(0).describe("Minimum value on the rating scale (e.g., 1 for 1-5 stars).").default(1),
2084
+ "scale_max": z$1.number().gte(1).describe("Maximum value on the rating scale (e.g., 5 for 5-star)."),
2085
+ "count": z$1.number().int().gte(0).describe("Number of reviews contributing to the rating.").optional()
2086
+ }).describe("Product rating aggregate.");
2087
+ const RetailLocationSchema = z$1.object({
2088
+ "id": z$1.string().describe("Unique location identifier."),
2089
+ "name": z$1.string().describe("Location name (e.g., store name)."),
2090
+ "address": z$1.object({
2091
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
2092
+ "street_address": z$1.string().describe("The street address.").optional(),
2093
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
2094
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
2095
+ "address_country": z$1.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(),
2096
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
2097
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
2098
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
2099
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
2100
+ }).describe("Physical address of the location.").optional()
2101
+ }).passthrough().describe("A pickup location (retail store, locker, etc.).");
2102
+ const ReverseDomainNameSchema = z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Reverse-domain identifier used for collision-safe namespacing of capabilities, services, handlers, eligibility claims, and extension-contributed keys. Must contain at least two dot-separated segments (e.g., 'dev.ucp.shopping.checkout', 'com.example.loyalty_gold').");
2103
+ const SearchFiltersSchema = z$1.object({
2104
+ "categories": z$1.array(z$1.string()).describe("Filter by product categories (OR logic — matches products in any listed categories). Values match against the value field in product category entries. Valid values can be discovered from the categories field in search results, merchant documentation, or standard taxonomies that businesses may align with.").optional(),
2105
+ "price": z$1.object({
2106
+ "min": z$1.number().int().gte(0).describe("Minimum price in ISO 4217 minor units.").optional(),
2107
+ "max": z$1.number().int().gte(0).describe("Maximum price in ISO 4217 minor units.").optional()
2108
+ }).describe("Price range filter denominated in context.currency. When context.currency matches the presentment currency, businesses apply the filter directly. When it differs, businesses SHOULD convert filter values to the presentment currency before applying; if conversion is not supported, businesses MAY ignore the filter and SHOULD indicate this via a message. When context.currency is absent, filter denomination is ambiguous and businesses MAY ignore it.").optional()
2109
+ }).passthrough().describe("Filter criteria to narrow search results. All specified filters combine with AND logic.");
2110
+ const SelectedOptionSchema = z$1.object({
2111
+ "name": z$1.string().describe("Option name (e.g., 'Size')."),
2112
+ "label": z$1.string().describe("Selected option label (e.g., 'Large').")
2113
+ }).describe("A specific option selection on a variant (e.g., Size: Large).");
2114
+ const ShippingDestinationSchema = z$1.record(z$1.string(), z$1.unknown()).and(z$1.intersection(z$1.object({
2115
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
2116
+ "street_address": z$1.string().describe("The street address.").optional(),
2117
+ "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
2118
+ "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
2119
+ "address_country": z$1.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(),
2120
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
2121
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
2122
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
2123
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
2124
+ }), z$1.object({ "id": z$1.string().describe("ID specific to this shipping destination.") }))).describe("Shipping destination.");
2125
+ const SignalsSchema = z$1.object({
2126
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
2127
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
2128
+ }).passthrough().describe("Environment data provided by the platform to support authorization and abuse prevention. Values MUST NOT be buyer-asserted claims — platforms provide signals based on direct observation or independently verifiable third-party attestations. All signal keys MUST use reverse-domain naming to ensure provenance and prevent collisions when multiple extensions contribute to the shared namespace.");
2129
+ const SignedAmountSchema = z$1.number().int().describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD). May be negative — the sign is intrinsic to the value (e.g., discounts are negative, charges are positive).");
2130
+ const TokenCredentialSchema = z$1.intersection(z$1.object({ "type": z$1.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."), z$1.object({
2131
+ "type": z$1.string().describe("The specific type of token produced by the handler (e.g., 'stripe_token')."),
2132
+ "token": z$1.string().describe("The token value.")
2133
+ })).describe("Base token credential schema. Concrete payment handlers may extend this schema with additional fields and define their own constraints.");
2134
+ const TotalSchema = z$1.object({
2135
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
2136
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
2137
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
2138
+ }).describe("A cost breakdown entry with a category, amount, and optional display text.");
2139
+ const TotalsSchema = z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2140
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
2141
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
2142
+ "amount": z$1.number().int().gte(0).describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD).")
2143
+ }).describe("A cost breakdown entry with a category, amount, and optional display text."), z$1.object({
2144
+ "amount": z$1.number().int().describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD). May be negative — the sign is intrinsic to the value (e.g., discounts are negative, charges are positive).").optional(),
2145
+ "lines": z$1.array(z$1.object({
2146
+ "display_text": z$1.string().describe("Human-readable label for this sub-line."),
2147
+ "amount": z$1.number().int().describe("Monetary amount in the currency's minor unit as defined by ISO 4217. Refer to the currency's exponent to determine minor-to-major ratio (e.g., 2 for USD, 0 for JPY, 3 for KWD). May be negative — the sign is intrinsic to the value (e.g., discounts are negative, charges are positive).")
2148
+ }).describe("Sub-line entry. Additional metadata MAY be included.")).describe("Optional itemized breakdown. The parent entry is always rendered; lines are supplementary. Sum of line amounts MUST equal the parent entry amount.").optional()
2149
+ })), z$1.intersection(z$1.any(), z$1.intersection(z$1.any(), z$1.any())))).describe("Pricing breakdown provided by the business. MUST contain exactly one subtotal and one total entry. Detail types (tax, fee, discount, fulfillment) may appear multiple times for itemization. Platforms MUST render all entries in order using display_text and amount.");
2150
+ const VariantSchema = z$1.object({
2151
+ "id": z$1.string().describe("Global ID (GID) uniquely identifying this variant. Used as item.id in checkout."),
2152
+ "sku": z$1.string().describe("Business-assigned identifier for inventory and fulfillment.").optional(),
2153
+ "barcodes": z$1.array(z$1.object({
2154
+ "type": z$1.string().describe("Barcode standard. Well-known values: UPC, EAN, ISBN, GTIN, JAN."),
2155
+ "value": z$1.string().describe("Barcode value.")
2156
+ })).describe("Industry-standard product identifiers for cross-reference and correlation.").optional(),
2157
+ "handle": z$1.string().describe("URL-safe variant handle/slug.").optional(),
2158
+ "title": z$1.string().describe("Variant display title (e.g., 'Blue / Large')."),
2159
+ "description": z$1.object({
2160
+ "plain": z$1.string().describe("Plain text content.").optional(),
2161
+ "html": z$1.string().describe("HTML-formatted content. Security: Platforms MUST sanitize before rendering—strip scripts, event handlers, and untrusted elements. Treat all rich text as untrusted input.").optional(),
2162
+ "markdown": z$1.string().describe("Markdown-formatted content.").optional()
2163
+ }).describe("Variant description in one or more formats."),
2164
+ "url": z$1.string().url().describe("Canonical variant page URL.").optional(),
2165
+ "categories": z$1.array(z$1.object({
2166
+ "value": z$1.string().describe("Category value or path (e.g., 'Apparel > Shirts', '1604')."),
2167
+ "taxonomy": z$1.string().describe("Source taxonomy. Well-known values: `google_product_category`, `shopify`, `merchant`.").optional()
2168
+ }).describe("A product category with optional taxonomy identifier.")).describe("Variant categories with optional taxonomy identifiers.").optional(),
2169
+ "price": z$1.object({
2170
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
2171
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
2172
+ }).describe("Current selling price."),
2173
+ "list_price": z$1.object({
2174
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
2175
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
2176
+ }).describe("List price before discounts (for strikethrough display).").optional(),
2177
+ "unit_price": z$1.object({
2178
+ "amount": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units. Business MUST return precomputed unit price value: (variant.price / measure.value) * reference.value."),
2179
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code."),
2180
+ "measure": z$1.object({
2181
+ "value": z$1.number().describe("Package quantity."),
2182
+ "unit": z$1.string().describe("Unit of measurement.")
2183
+ }).describe("Product quantity in packaging (e.g., 750ml bottle)."),
2184
+ "reference": z$1.object({
2185
+ "value": z$1.number().int().describe("Reference quantity."),
2186
+ "unit": z$1.string().describe("Unit of measurement.")
2187
+ }).describe("Denominator for unit price display (e.g., per 100ml, per 1kg).")
2188
+ }).describe("Price per standard unit of measurement. MAY be omitted when unit pricing does not apply.").optional(),
2189
+ "availability": z$1.object({
2190
+ "available": z$1.boolean().describe("Whether this variant can be purchased. See status for fulfillment details.").optional(),
2191
+ "status": z$1.string().describe("Qualifies available with fulfillment state. Well-known values: `in_stock`, `backorder`, `preorder`, `out_of_stock`, `discontinued`.").optional()
2192
+ }).describe("Variant availability for purchase.").optional(),
2193
+ "selected_options": z$1.array(z$1.object({
2194
+ "name": z$1.string().describe("Option name (e.g., 'Size')."),
2195
+ "label": z$1.string().describe("Selected option label (e.g., 'Large').")
2196
+ }).describe("A specific option selection on a variant (e.g., Size: Large).")).describe("Option selections that define this variant.").optional(),
2197
+ "media": z$1.array(z$1.object({
2198
+ "type": z$1.string().describe("Media type. Well-known values: `image`, `video`, `model_3d`."),
2199
+ "url": z$1.string().url().describe("URL to the media resource."),
2200
+ "alt_text": z$1.string().describe("Accessibility text describing the media.").optional(),
2201
+ "width": z$1.number().int().gte(1).describe("Width in pixels (for images/video).").optional(),
2202
+ "height": z$1.number().int().gte(1).describe("Height in pixels (for images/video).").optional()
2203
+ }).describe("Product media item (image, video, etc.).")).describe("Variant media (images, videos, 3D models). First item is the featured media for listings.").optional(),
2204
+ "rating": z$1.object({
2205
+ "value": z$1.number().gte(0).describe("Average rating value."),
2206
+ "scale_min": z$1.number().gte(0).describe("Minimum value on the rating scale (e.g., 1 for 1-5 stars).").default(1),
2207
+ "scale_max": z$1.number().gte(1).describe("Maximum value on the rating scale (e.g., 5 for 5-star)."),
2208
+ "count": z$1.number().int().gte(0).describe("Number of reviews contributing to the rating.").optional()
2209
+ }).describe("Variant rating.").optional(),
2210
+ "tags": z$1.array(z$1.string()).describe("Variant tags for categorization and search.").optional(),
2211
+ "metadata": z$1.record(z$1.string(), z$1.unknown()).describe("Business-defined custom data extending the standard variant model.").optional(),
2212
+ "seller": z$1.object({
2213
+ "name": z$1.string().describe("Seller display name.").optional(),
2214
+ "links": z$1.array(z$1.object({
2215
+ "type": z$1.string().describe("Type of link. Well-known values: `privacy_policy`, `terms_of_service`, `refund_policy`, `shipping_policy`, `faq`. Consumers SHOULD handle unknown values gracefully by displaying them using the `title` field or omitting the link."),
2216
+ "url": z$1.string().url().describe("The actual URL pointing to the content to be displayed."),
2217
+ "title": z$1.string().describe("Optional display text for the link. When provided, use this instead of generating from type.").optional()
2218
+ })).describe("Seller policy and information links.").optional()
2219
+ }).describe("Optional seller context for this variant.").optional()
2220
+ }).describe("A purchasable variant of a product with specific option selections.");
2221
+ const EmbeddedConfigSchema = z$1.object({
2222
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In checkout responses, confirms accepted delegations for this session.").optional(),
2223
+ "color_scheme": z$1.array(z$1.enum(["light", "dark"])).describe("Color schemes the business supports. Hosts use ec_color_scheme query parameter to request a scheme from this list.").optional()
2224
+ }).describe("Per-checkout configuration for embedded transport binding. Allows businesses to vary ECP availability and delegations based on cart contents, agent authorization, or policy.");
2225
+ const UcpVersionSchema = z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format.");
2226
+ const UcpVersionConstraintSchema = z$1.object({
2227
+ "min": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Minimum required version (inclusive)."),
2228
+ "max": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Maximum compatible version (inclusive). When absent, no upper bound.").optional()
2229
+ }).passthrough().describe("Version range requirement with minimum and optional maximum.");
2230
+ const UcpRequiresSchema = z$1.object({
2231
+ "protocol": z$1.object({
2232
+ "min": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Minimum required version (inclusive)."),
2233
+ "max": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Maximum compatible version (inclusive). When absent, no upper bound.").optional()
2234
+ }).passthrough().describe("Required protocol version.").optional(),
2235
+ "capabilities": z$1.record(z$1.object({
2236
+ "min": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Minimum required version (inclusive)."),
2237
+ "max": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Maximum compatible version (inclusive). When absent, no upper bound.").optional()
2238
+ }).passthrough().describe("Version range requirement with minimum and optional maximum.")).describe("Required capability versions, keyed by capability name. Keys must be a subset of the extension's $defs keys.").optional()
2239
+ }).passthrough().describe("Version requirements for extension schemas. Declares minimum (and optionally maximum) protocol and capability versions needed for correct operation.");
2240
+ const UcpEntitySchema = z$1.object({
2241
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2242
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2243
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2244
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2245
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2246
+ }).describe("Shared foundation for all UCP entities.");
2247
+ const UcpBaseSchema = z$1.object({
2248
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2249
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2250
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
2251
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2252
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2253
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2254
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2255
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2256
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2257
+ "transport": z$1.enum([
2258
+ "rest",
2259
+ "mcp",
2260
+ "a2a",
2261
+ "embedded"
2262
+ ]).describe("Transport protocol for this service binding."),
2263
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2264
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2265
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2266
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2267
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2268
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2269
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2270
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2271
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2272
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2273
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2274
+ const passed = schemas.length - errors.length;
2275
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2276
+ path: ctx.path,
2277
+ code: "invalid_union",
2278
+ unionErrors: errors,
2279
+ message: "Invalid input: Should pass single schema. Passed " + passed
2280
+ } : {
2281
+ path: ctx.path,
2282
+ code: "custom",
2283
+ message: "Invalid input: Should pass single schema. Passed " + passed
2284
+ });
2285
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
2286
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2287
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2288
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2289
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2290
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2291
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2292
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2293
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2294
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2295
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
2296
+ }).describe("Base UCP metadata with shared properties for all schema types.");
2297
+ const UcpPlatformSchema = z$1.intersection(z$1.object({
2298
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2299
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2300
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
2301
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2302
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2303
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2304
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2305
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2306
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2307
+ "transport": z$1.enum([
2308
+ "rest",
2309
+ "mcp",
2310
+ "a2a",
2311
+ "embedded"
2312
+ ]).describe("Transport protocol for this service binding."),
2313
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2314
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2315
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2316
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2317
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2318
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2319
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2320
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2321
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2322
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2323
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2324
+ const passed = schemas.length - errors.length;
2325
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2326
+ path: ctx.path,
2327
+ code: "invalid_union",
2328
+ unionErrors: errors,
2329
+ message: "Invalid input: Should pass single schema. Passed " + passed
2330
+ } : {
2331
+ path: ctx.path,
2332
+ code: "custom",
2333
+ message: "Invalid input: Should pass single schema. Passed " + passed
2334
+ });
2335
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
2336
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2337
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2338
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2339
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2340
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2341
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2342
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2343
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2344
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2345
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
2346
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
2347
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2348
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2349
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2350
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2351
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2352
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2353
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2354
+ "transport": z$1.enum([
2355
+ "rest",
2356
+ "mcp",
2357
+ "a2a",
2358
+ "embedded"
2359
+ ]).describe("Transport protocol for this service binding."),
2360
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2361
+ })), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.union([
2362
+ z$1.object({ "transport": z$1.literal("rest").optional() }),
2363
+ z$1.object({ "transport": z$1.literal("mcp").optional() }),
2364
+ z$1.object({ "transport": z$1.literal("a2a").optional() }),
2365
+ z$1.object({ "transport": z$1.literal("embedded").optional() })
2366
+ ]))).describe("Full service declaration for platform-level discovery. Different transports require different fields."))),
2367
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2368
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2369
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2370
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2371
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2372
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2373
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2374
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2375
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2376
+ const passed = schemas.length - errors.length;
2377
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2378
+ path: ctx.path,
2379
+ code: "invalid_union",
2380
+ unionErrors: errors,
2381
+ message: "Invalid input: Should pass single schema. Passed " + passed
2382
+ } : {
2383
+ path: ctx.path,
2384
+ code: "custom",
2385
+ message: "Invalid input: Should pass single schema. Passed " + passed
2386
+ });
2387
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })), z$1.record(z$1.string(), z$1.unknown())).describe("Full capability declaration for platform-level discovery. Includes spec/schema URLs for agent fetching."))).optional(),
2388
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2389
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2390
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2391
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2392
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2393
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2394
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2395
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2396
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2397
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))), z$1.record(z$1.string(), z$1.unknown())).describe("Platform declaration for discovery profiles. May include partial config state required for discovery.")))
2398
+ })).describe("Full UCP metadata for platform-level configuration. Hosted at a URI advertised by the platform in request headers.");
2399
+ const UcpBusinessSchema = z$1.intersection(z$1.object({
2400
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2401
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2402
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
2403
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2404
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2405
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2406
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2407
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2408
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2409
+ "transport": z$1.enum([
2410
+ "rest",
2411
+ "mcp",
2412
+ "a2a",
2413
+ "embedded"
2414
+ ]).describe("Transport protocol for this service binding."),
2415
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2416
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2417
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2418
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2419
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2420
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2421
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2422
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2423
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2424
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2425
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2426
+ const passed = schemas.length - errors.length;
2427
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2428
+ path: ctx.path,
2429
+ code: "invalid_union",
2430
+ unionErrors: errors,
2431
+ message: "Invalid input: Should pass single schema. Passed " + passed
2432
+ } : {
2433
+ path: ctx.path,
2434
+ code: "custom",
2435
+ message: "Invalid input: Should pass single schema. Passed " + passed
2436
+ });
2437
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
2438
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2439
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2440
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2441
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2442
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2443
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2444
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2445
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2446
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2447
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
2448
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
2449
+ "supported_versions": z$1.record(z$1.string().url()).describe("Previous protocol versions this business supports, mapped to profile URIs. Businesses that support older protocol versions SHOULD advertise each version and link to its profile. Each URI points to a complete, self-contained profile for that version. When omitted, only `version` is supported.").optional(),
2450
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2451
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2452
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2453
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2454
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2455
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2456
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2457
+ "transport": z$1.enum([
2458
+ "rest",
2459
+ "mcp",
2460
+ "a2a",
2461
+ "embedded"
2462
+ ]).describe("Transport protocol for this service binding."),
2463
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2464
+ })), z$1.union([
2465
+ z$1.object({ "transport": z$1.literal("rest").optional() }),
2466
+ z$1.object({ "transport": z$1.literal("mcp").optional() }),
2467
+ z$1.object({ "transport": z$1.literal("a2a").optional() }),
2468
+ z$1.object({
2469
+ "transport": z$1.literal("embedded").optional(),
2470
+ "config": z$1.object({
2471
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In checkout responses, confirms accepted delegations for this session.").optional(),
2472
+ "color_scheme": z$1.array(z$1.enum(["light", "dark"])).describe("Color schemes the business supports. Hosts use ec_color_scheme query parameter to request a scheme from this list.").optional()
2473
+ }).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()
2474
+ })
2475
+ ])).describe("Service binding for business/merchant configuration. May override platform endpoints."))),
2476
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2477
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2478
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2479
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2480
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2481
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2482
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2483
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
1198
2484
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1199
2485
  const passed = schemas.length - errors.length;
1200
2486
  if (passed !== 1) ctx.addIssue(errors.length ? {
@@ -1207,139 +2493,183 @@ const FulfillmentMethodSchema = z$1.object({
1207
2493
  code: "custom",
1208
2494
  message: "Invalid input: Should pass single schema. Passed " + passed
1209
2495
  });
1210
- })).describe("A destination for fulfillment.")).describe("Available destinations. For shipping: addresses. For pickup: retail locations.").optional(),
1211
- "selected_destination_id": z$1.union([z$1.string().describe("ID of the selected destination."), z$1.null().describe("ID of the selected destination.")]).describe("ID of the selected destination.").optional(),
1212
- "groups": z$1.array(z$1.object({
1213
- "id": z$1.string().describe("Group identifier for referencing merchant-generated groups in updates."),
1214
- "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs included in this group/package."),
1215
- "options": z$1.array(z$1.object({
1216
- "id": z$1.string().describe("Unique fulfillment option identifier."),
1217
- "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
1218
- "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
1219
- "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
1220
- "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1221
- "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1222
- "totals": z$1.array(z$1.object({
1223
- "type": z$1.enum([
1224
- "items_discount",
1225
- "subtotal",
1226
- "discount",
1227
- "fulfillment",
1228
- "tax",
1229
- "fee",
1230
- "total"
1231
- ]).describe("Type of total categorization."),
1232
- "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1233
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
1234
- })).describe("Fulfillment option totals breakdown.")
1235
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1236
- "selected_option_id": z$1.union([z$1.string().describe("ID of the selected fulfillment option for this group."), z$1.null().describe("ID of the selected fulfillment option for this group.")]).describe("ID of the selected fulfillment option for this group.").optional()
1237
- }).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()
1238
- }).describe("A fulfillment method (shipping or pickup) with destinations and groups.");
1239
- const FulfillmentMethodCreateRequestSchema = z$1.object({
1240
- "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type."),
1241
- "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs fulfilled via this method.").optional()
1242
- }).strict();
1243
- const FulfillmentMethodUpdateRequestSchema = z$1.object({
1244
- "id": z$1.string().describe("Unique fulfillment method identifier."),
1245
- "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs fulfilled via this method.")
1246
- }).strict();
1247
- const FulfillmentOptionSchema = z$1.object({
1248
- "id": z$1.string().describe("Unique fulfillment option identifier."),
1249
- "title": z$1.string().describe("Short label (e.g., 'Express Shipping', 'Curbside Pickup')."),
1250
- "description": z$1.string().describe("Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').").optional(),
1251
- "carrier": z$1.string().describe("Carrier name (for shipping).").optional(),
1252
- "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1253
- "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1254
- "totals": z$1.array(z$1.object({
1255
- "type": z$1.enum([
1256
- "items_discount",
1257
- "subtotal",
1258
- "discount",
1259
- "fulfillment",
1260
- "tax",
1261
- "fee",
1262
- "total"
1263
- ]).describe("Type of total categorization."),
1264
- "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1265
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
1266
- })).describe("Fulfillment option totals breakdown.")
1267
- }).describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).");
1268
- const ItemSchema = z$1.object({
1269
- "id": z$1.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."),
1270
- "title": z$1.string().describe("Product title."),
1271
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
1272
- "image_url": z$1.string().url().describe("Product image URI.").optional()
1273
- });
1274
- const LineItemSchema = z$1.object({
1275
- "id": z$1.string(),
1276
- "item": z$1.object({
1277
- "id": z$1.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."),
1278
- "title": z$1.string().describe("Product title."),
1279
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
1280
- "image_url": z$1.string().url().describe("Product image URI.").optional()
1281
- }),
1282
- "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
1283
- "totals": z$1.array(z$1.object({
1284
- "type": z$1.enum([
1285
- "items_discount",
1286
- "subtotal",
1287
- "discount",
1288
- "fulfillment",
1289
- "tax",
1290
- "fee",
1291
- "total"
1292
- ]).describe("Type of total categorization."),
1293
- "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1294
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
1295
- })).describe("Line item totals breakdown."),
1296
- "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
1297
- }).describe("Line item object. Expected to use the currency of the parent object.");
1298
- const LineItemUpdateRequestSchema = z$1.object({
1299
- "id": z$1.string().optional(),
1300
- "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
1301
- }).strict();
1302
- const LinkSchema = z$1.object({
1303
- "type": z$1.string().describe("Type of link. Well-known values: `privacy_policy`, `terms_of_service`, `refund_policy`, `shipping_policy`, `faq`. Consumers SHOULD handle unknown values gracefully by displaying them using the `title` field or omitting the link."),
1304
- "url": z$1.string().url().describe("The actual URL pointing to the content to be displayed."),
1305
- "title": z$1.string().describe("Optional display text for the link. When provided, use this instead of generating from type.").optional()
1306
- });
1307
- const MerchantFulfillmentConfigSchema = z$1.object({
1308
- "allows_multi_destination": z$1.object({
1309
- "shipping": z$1.boolean().describe("Multiple shipping destinations allowed.").optional(),
1310
- "pickup": z$1.boolean().describe("Multiple pickup locations allowed.").optional()
1311
- }).strict().describe("Permits multiple destinations per method type.").optional(),
1312
- "allows_method_combinations": z$1.array(z$1.array(z$1.enum(["shipping", "pickup"]))).describe("Allowed method type combinations.").optional()
1313
- }).describe("Merchant's fulfillment configuration.");
1314
- const MessageSchema = z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
1315
- const schemas = [
1316
- z$1.object({
1317
- "type": z$1.literal("error").describe("Message type discriminator."),
1318
- "code": z$1.string().describe("Error code. Possible values include: missing, invalid, out_of_stock, payment_declined, requires_sign_in, requires_3ds, requires_identity_linking. Freeform codes also allowed."),
1319
- "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
1320
- "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1321
- "content": z$1.string().describe("Human-readable message."),
1322
- "severity": z$1.enum([
1323
- "recoverable",
1324
- "requires_buyer_input",
1325
- "requires_buyer_review"
1326
- ]).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'.")
1327
- }),
1328
- z$1.object({
1329
- "type": z$1.literal("warning").describe("Message type discriminator."),
1330
- "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
1331
- "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
1332
- "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
1333
- "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain")
1334
- }),
2496
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })).describe("Capability configuration for business/merchant level. May include business-specific config overrides."))).optional(),
2497
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2498
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2499
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2500
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2501
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2502
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2503
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2504
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2505
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2506
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))).describe("Business declaration for discovery profiles. May include partial config state required for discovery.")))
2507
+ })).describe("UCP metadata for business/merchant-level configuration. Subset of platform schema with business-specific settings.");
2508
+ const UcpResponseCheckoutSchema = z$1.intersection(z$1.object({
2509
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2510
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2511
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
2512
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2513
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2514
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2515
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2516
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2517
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2518
+ "transport": z$1.enum([
2519
+ "rest",
2520
+ "mcp",
2521
+ "a2a",
2522
+ "embedded"
2523
+ ]).describe("Transport protocol for this service binding."),
2524
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2525
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2526
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2527
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2528
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2529
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2530
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2531
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2532
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2533
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2534
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2535
+ const passed = schemas.length - errors.length;
2536
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2537
+ path: ctx.path,
2538
+ code: "invalid_union",
2539
+ unionErrors: errors,
2540
+ message: "Invalid input: Should pass single schema. Passed " + passed
2541
+ } : {
2542
+ path: ctx.path,
2543
+ code: "custom",
2544
+ message: "Invalid input: Should pass single schema. Passed " + passed
2545
+ });
2546
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
2547
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2548
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2549
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2550
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2551
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2552
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2553
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2554
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2555
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2556
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
2557
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
2558
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2559
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2560
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2561
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2562
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2563
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2564
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2565
+ "transport": z$1.enum([
2566
+ "rest",
2567
+ "mcp",
2568
+ "a2a",
2569
+ "embedded"
2570
+ ]).describe("Transport protocol for this service binding."),
2571
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2572
+ })), z$1.union([
2573
+ z$1.object({ "transport": z$1.literal("rest").optional() }),
2574
+ z$1.object({ "transport": z$1.literal("mcp").optional() }),
2575
+ z$1.object({ "transport": z$1.literal("a2a").optional() }),
1335
2576
  z$1.object({
1336
- "type": z$1.literal("info").describe("Message type discriminator."),
1337
- "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to.").optional(),
1338
- "code": z$1.string().describe("Info code for programmatic handling.").optional(),
1339
- "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1340
- "content": z$1.string().describe("Human-readable message.")
2577
+ "transport": z$1.literal("embedded").optional(),
2578
+ "config": z$1.object({
2579
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In checkout responses, confirms accepted delegations for this session.").optional(),
2580
+ "color_scheme": z$1.array(z$1.enum(["light", "dark"])).describe("Color schemes the business supports. Hosts use ec_color_scheme query parameter to request a scheme from this list.").optional()
2581
+ }).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()
1341
2582
  })
1342
- ];
2583
+ ])).describe("Service binding in API responses. Includes per-resource transport configuration via typed config."))).optional(),
2584
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2585
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2586
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2587
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2588
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2589
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2590
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2591
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2592
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2593
+ const passed = schemas.length - errors.length;
2594
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2595
+ path: ctx.path,
2596
+ code: "invalid_union",
2597
+ unionErrors: errors,
2598
+ message: "Invalid input: Should pass single schema. Passed " + passed
2599
+ } : {
2600
+ path: ctx.path,
2601
+ code: "custom",
2602
+ message: "Invalid input: Should pass single schema. Passed " + passed
2603
+ });
2604
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })).describe("Capability reference in responses. Only name/version required to confirm active capabilities."))).optional(),
2605
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2606
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2607
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2608
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2609
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2610
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2611
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2612
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2613
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2614
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))).describe("Handler reference in responses. May include full config state for runtime usage of the handler.")))
2615
+ })).describe("UCP metadata for checkout responses.");
2616
+ const UcpResponseOrderSchema = z$1.intersection(z$1.object({
2617
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2618
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2619
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
2620
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2621
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2622
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2623
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2624
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2625
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2626
+ "transport": z$1.enum([
2627
+ "rest",
2628
+ "mcp",
2629
+ "a2a",
2630
+ "embedded"
2631
+ ]).describe("Transport protocol for this service binding."),
2632
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2633
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2634
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2635
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2636
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2637
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2638
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2639
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2640
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2641
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2642
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2643
+ const passed = schemas.length - errors.length;
2644
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2645
+ path: ctx.path,
2646
+ code: "invalid_union",
2647
+ unionErrors: errors,
2648
+ message: "Invalid input: Should pass single schema. Passed " + passed
2649
+ } : {
2650
+ path: ctx.path,
2651
+ code: "custom",
2652
+ message: "Invalid input: Should pass single schema. Passed " + passed
2653
+ });
2654
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
2655
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2656
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2657
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2658
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2659
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2660
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2661
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2662
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2663
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2664
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
2665
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2666
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2667
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2668
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2669
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2670
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2671
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2672
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
1343
2673
  const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1344
2674
  const passed = schemas.length - errors.length;
1345
2675
  if (passed !== 1) ctx.addIssue(errors.length ? {
@@ -1352,156 +2682,80 @@ const MessageSchema = z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().
1352
2682
  code: "custom",
1353
2683
  message: "Invalid input: Should pass single schema. Passed " + passed
1354
2684
  });
1355
- })).describe("Container for error, warning, or info messages.");
1356
- const MessageErrorSchema = z$1.object({
1357
- "type": z$1.literal("error").describe("Message type discriminator."),
1358
- "code": z$1.string().describe("Error code. Possible values include: missing, invalid, out_of_stock, payment_declined, requires_sign_in, requires_3ds, requires_identity_linking. Freeform codes also allowed."),
1359
- "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
1360
- "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1361
- "content": z$1.string().describe("Human-readable message."),
1362
- "severity": z$1.enum([
1363
- "recoverable",
1364
- "requires_buyer_input",
1365
- "requires_buyer_review"
1366
- ]).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'.")
1367
- });
1368
- const MessageInfoSchema = z$1.object({
1369
- "type": z$1.literal("info").describe("Message type discriminator."),
1370
- "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to.").optional(),
1371
- "code": z$1.string().describe("Info code for programmatic handling.").optional(),
1372
- "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1373
- "content": z$1.string().describe("Human-readable message.")
1374
- });
1375
- const MessageWarningSchema = z$1.object({
1376
- "type": z$1.literal("warning").describe("Message type discriminator."),
1377
- "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
1378
- "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
1379
- "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
1380
- "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain")
1381
- });
1382
- const OrderConfirmationSchema = z$1.object({
1383
- "id": z$1.string().describe("Unique order identifier."),
1384
- "permalink_url": z$1.string().url().describe("Permalink to access the order on merchant site.")
1385
- }).describe("Order details available at the time of checkout completion.");
1386
- const OrderLineItemSchema = z$1.object({
1387
- "id": z$1.string().describe("Line item identifier."),
1388
- "item": z$1.object({
1389
- "id": z$1.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."),
1390
- "title": z$1.string().describe("Product title."),
1391
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
1392
- "image_url": z$1.string().url().describe("Product image URI.").optional()
1393
- }).describe("Product data (id, title, price, image_url)."),
1394
- "quantity": z$1.object({
1395
- "total": z$1.number().int().gte(0).describe("Current total quantity."),
1396
- "fulfilled": z$1.number().int().gte(0).describe("Quantity fulfilled (sum from fulfillment events).")
1397
- }).describe("Quantity tracking. Both total and fulfilled are derived from events."),
1398
- "totals": z$1.array(z$1.object({
1399
- "type": z$1.enum([
1400
- "items_discount",
1401
- "subtotal",
1402
- "discount",
1403
- "fulfillment",
1404
- "tax",
1405
- "fee",
1406
- "total"
1407
- ]).describe("Type of total categorization."),
1408
- "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1409
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
1410
- })).describe("Line item totals breakdown."),
1411
- "status": z$1.enum([
1412
- "processing",
1413
- "partial",
1414
- "fulfilled"
1415
- ]).describe("Derived status: fulfilled if quantity.fulfilled == quantity.total, partial if quantity.fulfilled > 0, otherwise processing."),
1416
- "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
1417
- });
1418
- const PaymentCredentialSchema = z$1.object({ "type": z$1.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.");
1419
- const PaymentIdentitySchema = z$1.object({ "access_token": z$1.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.");
1420
- const PaymentInstrumentSchema = z$1.object({
1421
- "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
1422
- "handler_id": z$1.string().describe("The unique identifier for the handler instance that produced this instrument. This corresponds to the 'id' field in the Payment Handler definition."),
1423
- "type": z$1.string().describe("The broad category of the instrument (e.g., 'card', 'tokenized_card'). Specific schemas will constrain this to a constant value."),
1424
- "billing_address": z$1.object({
1425
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1426
- "street_address": z$1.string().describe("The street address.").optional(),
1427
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
1428
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
1429
- "address_country": z$1.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(),
1430
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
1431
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
1432
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1433
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1434
- }).describe("The billing address associated with this payment method.").optional(),
1435
- "credential": z$1.object({ "type": z$1.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(),
1436
- "display": z$1.record(z$1.string(), z$1.unknown()).describe("Display information for this payment instrument. Each payment instrument schema defines its specific display properties, as outlined by the payment handler.").optional()
1437
- }).describe("The base definition for any payment instrument. It links the instrument to a specific payment handler.");
1438
- const PlatformFulfillmentConfigSchema = z$1.object({ "supports_multi_group": z$1.boolean().describe("Enables multiple groups per method.").default(false) }).describe("Platform's fulfillment configuration.");
1439
- const PostalAddressSchema = z$1.object({
1440
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1441
- "street_address": z$1.string().describe("The street address.").optional(),
1442
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
1443
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
1444
- "address_country": z$1.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(),
1445
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
1446
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
1447
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1448
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1449
- });
1450
- const RetailLocationSchema = z$1.object({
1451
- "id": z$1.string().describe("Unique location identifier."),
1452
- "name": z$1.string().describe("Location name (e.g., store name)."),
1453
- "address": z$1.object({
1454
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1455
- "street_address": z$1.string().describe("The street address.").optional(),
1456
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
1457
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
1458
- "address_country": z$1.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(),
1459
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
1460
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
1461
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1462
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1463
- }).describe("Physical address of the location.").optional()
1464
- }).describe("A pickup location (retail store, locker, etc.).");
1465
- const ShippingDestinationSchema = z$1.record(z$1.string(), z$1.unknown()).and(z$1.intersection(z$1.object({
1466
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1467
- "street_address": z$1.string().describe("The street address.").optional(),
1468
- "address_locality": z$1.string().describe("The locality in which the street address is, and which is in the region. For example, Mountain View.").optional(),
1469
- "address_region": z$1.string().describe("The region in which the locality is, and which is in the country. Required for applicable countries (i.e. state in US, province in CA). For example, California or another appropriate first-level Administrative division.").optional(),
1470
- "address_country": z$1.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(),
1471
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
1472
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
1473
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1474
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1475
- }), z$1.object({ "id": z$1.string().describe("ID specific to this shipping destination.") }))).describe("Shipping destination.");
1476
- const TokenCredentialSchema = z$1.intersection(z$1.object({ "type": z$1.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."), z$1.object({
1477
- "type": z$1.string().describe("The specific type of token produced by the handler (e.g., 'stripe_token')."),
1478
- "token": z$1.string().describe("The token value.")
1479
- })).describe("Base token credential schema. Concrete payment handlers may extend this schema with additional fields and define their own constraints.");
1480
- const TotalSchema = z$1.object({
1481
- "type": z$1.enum([
1482
- "items_discount",
1483
- "subtotal",
1484
- "discount",
1485
- "fulfillment",
1486
- "tax",
1487
- "fee",
1488
- "total"
1489
- ]).describe("Type of total categorization."),
1490
- "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1491
- "amount": z$1.number().int().gte(0).describe("If type == total, sums subtotal - discount + fulfillment + tax + fee. Should be >= 0. Amount in minor (cents) currency units.")
1492
- });
1493
- const EmbeddedConfigSchema = z$1.object({ "delegate": z$1.array(z$1.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.");
1494
- const UcpVersionSchema = z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format.");
1495
- const UcpReverseDomainNameSchema = z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")).describe("Reverse-domain identifier (e.g., com.google.pay, dev.ucp.shopping.checkout)");
1496
- const UcpEntitySchema = z$1.object({
2685
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").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.");
2686
+ const UcpResponseCartSchema = z$1.intersection(z$1.object({
2687
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2688
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2689
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
2690
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2691
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2692
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2693
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2694
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2695
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2696
+ "transport": z$1.enum([
2697
+ "rest",
2698
+ "mcp",
2699
+ "a2a",
2700
+ "embedded"
2701
+ ]).describe("Transport protocol for this service binding."),
2702
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2703
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2704
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2705
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2706
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2707
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2708
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2709
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2710
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2711
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2712
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2713
+ const passed = schemas.length - errors.length;
2714
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2715
+ path: ctx.path,
2716
+ code: "invalid_union",
2717
+ unionErrors: errors,
2718
+ message: "Invalid input: Should pass single schema. Passed " + passed
2719
+ } : {
2720
+ path: ctx.path,
2721
+ code: "custom",
2722
+ message: "Invalid input: Should pass single schema. Passed " + passed
2723
+ });
2724
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
2725
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2726
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2727
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2728
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2729
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2730
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2731
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2732
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2733
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2734
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
2735
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1497
2736
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1498
2737
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1499
2738
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1500
2739
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1501
2740
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1502
- }).describe("Shared foundation for all UCP entities.");
1503
- const UcpBaseSchema = z$1.object({
2741
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2742
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2743
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2744
+ const passed = schemas.length - errors.length;
2745
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2746
+ path: ctx.path,
2747
+ code: "invalid_union",
2748
+ unionErrors: errors,
2749
+ message: "Invalid input: Should pass single schema. Passed " + passed
2750
+ } : {
2751
+ path: ctx.path,
2752
+ code: "custom",
2753
+ message: "Invalid input: Should pass single schema. Passed " + passed
2754
+ });
2755
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })).describe("Capability reference in responses. Only name/version required to confirm active capabilities."))).optional() })).describe("UCP metadata for cart responses. No payment handlers needed pre-checkout.");
2756
+ const UcpResponseCatalogSchema = z$1.intersection(z$1.object({
1504
2757
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2758
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1505
2759
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1506
2760
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1507
2761
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1523,19 +2777,193 @@ const UcpBaseSchema = z$1.object({
1523
2777
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1524
2778
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1525
2779
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1526
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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(),
2780
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2781
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2782
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2783
+ const passed = schemas.length - errors.length;
2784
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2785
+ path: ctx.path,
2786
+ code: "invalid_union",
2787
+ unionErrors: errors,
2788
+ message: "Invalid input: Should pass single schema. Passed " + passed
2789
+ } : {
2790
+ path: ctx.path,
2791
+ code: "custom",
2792
+ message: "Invalid input: Should pass single schema. Passed " + passed
2793
+ });
2794
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
1527
2795
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1528
2796
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1529
2797
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1530
2798
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1531
2799
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1532
2800
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1533
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
1534
- }).describe("Base UCP metadata with shared properties for all schema types.");
1535
- const UcpPlatformSchema = z$1.intersection(z$1.object({
2801
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2802
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2803
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2804
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
2805
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2806
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2807
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2808
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2809
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2810
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2811
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2812
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2813
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2814
+ const passed = schemas.length - errors.length;
2815
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2816
+ path: ctx.path,
2817
+ code: "invalid_union",
2818
+ unionErrors: errors,
2819
+ message: "Invalid input: Should pass single schema. Passed " + passed
2820
+ } : {
2821
+ path: ctx.path,
2822
+ code: "custom",
2823
+ message: "Invalid input: Should pass single schema. Passed " + passed
2824
+ });
2825
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })).describe("Capability reference in responses. Only name/version required to confirm active capabilities."))).optional() })).describe("UCP metadata for catalog responses.");
2826
+ const ProfileSchemaSigningKeySchema = z$1.object({
2827
+ "kid": z$1.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
2828
+ "kty": z$1.string().describe("Key type (e.g., 'EC', 'RSA')."),
2829
+ "crv": z$1.string().describe("Curve name for EC keys (e.g., 'P-256').").optional(),
2830
+ "x": z$1.string().describe("X coordinate for EC public keys (base64url encoded).").optional(),
2831
+ "y": z$1.string().describe("Y coordinate for EC public keys (base64url encoded).").optional(),
2832
+ "n": z$1.string().describe("Modulus for RSA public keys (base64url encoded).").optional(),
2833
+ "e": z$1.string().describe("Exponent for RSA public keys (base64url encoded).").optional(),
2834
+ "use": z$1.enum(["sig", "enc"]).describe("Key usage. Should be 'sig' for signing keys.").optional(),
2835
+ "alg": z$1.string().describe("Algorithm (e.g., 'ES256', 'RS256').").optional()
2836
+ }).describe("Public key for signature verification in JWK format.");
2837
+ const ProfileSchemaBaseSchema = z$1.object({
2838
+ "ucp": z$1.object({
2839
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2840
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2841
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
2842
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2843
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2844
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2845
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2846
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2847
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2848
+ "transport": z$1.enum([
2849
+ "rest",
2850
+ "mcp",
2851
+ "a2a",
2852
+ "embedded"
2853
+ ]).describe("Transport protocol for this service binding."),
2854
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2855
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2856
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2857
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2858
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2859
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2860
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2861
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2862
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2863
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2864
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2865
+ const passed = schemas.length - errors.length;
2866
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2867
+ path: ctx.path,
2868
+ code: "invalid_union",
2869
+ unionErrors: errors,
2870
+ message: "Invalid input: Should pass single schema. Passed " + passed
2871
+ } : {
2872
+ path: ctx.path,
2873
+ code: "custom",
2874
+ message: "Invalid input: Should pass single schema. Passed " + passed
2875
+ });
2876
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
2877
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2878
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2879
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2880
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2881
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2882
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2883
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2884
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2885
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2886
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
2887
+ }).describe("Base UCP metadata with shared properties for all schema types."),
2888
+ "signing_keys": z$1.array(z$1.object({
2889
+ "kid": z$1.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
2890
+ "kty": z$1.string().describe("Key type (e.g., 'EC', 'RSA')."),
2891
+ "crv": z$1.string().describe("Curve name for EC keys (e.g., 'P-256').").optional(),
2892
+ "x": z$1.string().describe("X coordinate for EC public keys (base64url encoded).").optional(),
2893
+ "y": z$1.string().describe("Y coordinate for EC public keys (base64url encoded).").optional(),
2894
+ "n": z$1.string().describe("Modulus for RSA public keys (base64url encoded).").optional(),
2895
+ "e": z$1.string().describe("Exponent for RSA public keys (base64url encoded).").optional(),
2896
+ "use": z$1.enum(["sig", "enc"]).describe("Key usage. Should be 'sig' for signing keys.").optional(),
2897
+ "alg": z$1.string().describe("Algorithm (e.g., 'ES256', 'RS256').").optional()
2898
+ }).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()
2899
+ }).passthrough().describe("Base discovery profile with shared properties for all profile types.");
2900
+ const ProfileSchemaPlatformProfileSchema = z$1.intersection(z$1.object({
2901
+ "ucp": z$1.object({
2902
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2903
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2904
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
2905
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2906
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2907
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2908
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2909
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2910
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2911
+ "transport": z$1.enum([
2912
+ "rest",
2913
+ "mcp",
2914
+ "a2a",
2915
+ "embedded"
2916
+ ]).describe("Transport protocol for this service binding."),
2917
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2918
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2919
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2920
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2921
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2922
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2923
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2924
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2925
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2926
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2927
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2928
+ const passed = schemas.length - errors.length;
2929
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2930
+ path: ctx.path,
2931
+ code: "invalid_union",
2932
+ unionErrors: errors,
2933
+ message: "Invalid input: Should pass single schema. Passed " + passed
2934
+ } : {
2935
+ path: ctx.path,
2936
+ code: "custom",
2937
+ message: "Invalid input: Should pass single schema. Passed " + passed
2938
+ });
2939
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
2940
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2941
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2942
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2943
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2944
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2945
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2946
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
2947
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2948
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
2949
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
2950
+ }).describe("Base UCP metadata with shared properties for all schema types."),
2951
+ "signing_keys": z$1.array(z$1.object({
2952
+ "kid": z$1.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
2953
+ "kty": z$1.string().describe("Key type (e.g., 'EC', 'RSA')."),
2954
+ "crv": z$1.string().describe("Curve name for EC keys (e.g., 'P-256').").optional(),
2955
+ "x": z$1.string().describe("X coordinate for EC public keys (base64url encoded).").optional(),
2956
+ "y": z$1.string().describe("Y coordinate for EC public keys (base64url encoded).").optional(),
2957
+ "n": z$1.string().describe("Modulus for RSA public keys (base64url encoded).").optional(),
2958
+ "e": z$1.string().describe("Exponent for RSA public keys (base64url encoded).").optional(),
2959
+ "use": z$1.enum(["sig", "enc"]).describe("Key usage. Should be 'sig' for signing keys.").optional(),
2960
+ "alg": z$1.string().describe("Algorithm (e.g., 'ES256', 'RS256').").optional()
2961
+ }).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()
2962
+ }).passthrough().describe("Base discovery profile with shared properties for all profile types."), z$1.object({ "ucp": z$1.intersection(z$1.object({
1536
2963
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2964
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1537
2965
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1538
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2966
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1539
2967
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1540
2968
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1541
2969
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
@@ -1550,22 +2978,39 @@ const UcpPlatformSchema = z$1.intersection(z$1.object({
1550
2978
  "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
1551
2979
  })))).describe("Service registry keyed by reverse-domain name.").optional(),
1552
2980
  "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1553
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2981
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1554
2982
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1555
2983
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1556
2984
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1557
2985
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1558
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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(),
2986
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2987
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
2988
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2989
+ const passed = schemas.length - errors.length;
2990
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2991
+ path: ctx.path,
2992
+ code: "invalid_union",
2993
+ unionErrors: errors,
2994
+ message: "Invalid input: Should pass single schema. Passed " + passed
2995
+ } : {
2996
+ path: ctx.path,
2997
+ code: "custom",
2998
+ message: "Invalid input: Should pass single schema. Passed " + passed
2999
+ });
3000
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
1559
3001
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1560
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
3002
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1561
3003
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1562
3004
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1563
3005
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1564
3006
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1565
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
3007
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
3008
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3009
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
3010
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
1566
3011
  }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
1567
3012
  "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
1568
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
3013
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1569
3014
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1570
3015
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1571
3016
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
@@ -1585,24 +3030,104 @@ const UcpPlatformSchema = z$1.intersection(z$1.object({
1585
3030
  z$1.object({ "transport": z$1.literal("embedded").optional() })
1586
3031
  ]))).describe("Full service declaration for platform-level discovery. Different transports require different fields."))),
1587
3032
  "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
1588
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
3033
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1589
3034
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1590
3035
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1591
3036
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1592
3037
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1593
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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() })), z$1.record(z$1.string(), z$1.unknown())).describe("Full capability declaration for platform-level discovery. Includes spec/schema URLs for agent fetching."))).optional(),
3038
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
3039
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
3040
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
3041
+ const passed = schemas.length - errors.length;
3042
+ if (passed !== 1) ctx.addIssue(errors.length ? {
3043
+ path: ctx.path,
3044
+ code: "invalid_union",
3045
+ unionErrors: errors,
3046
+ message: "Invalid input: Should pass single schema. Passed " + passed
3047
+ } : {
3048
+ path: ctx.path,
3049
+ code: "custom",
3050
+ message: "Invalid input: Should pass single schema. Passed " + passed
3051
+ });
3052
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })), z$1.record(z$1.string(), z$1.unknown())).describe("Full capability declaration for platform-level discovery. Includes spec/schema URLs for agent fetching."))).optional(),
1594
3053
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
1595
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
3054
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1596
3055
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1597
3056
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1598
3057
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1599
3058
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1600
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())), z$1.record(z$1.string(), z$1.unknown())).describe("Platform declaration for discovery profiles. May include partial config state required for discovery.")))
1601
- })).describe("Full UCP metadata for platform-level configuration. Hosted at a URI advertised by the platform in request headers.");
1602
- const UcpBusinessSchema = z$1.intersection(z$1.object({
3059
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
3060
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3061
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
3062
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))), z$1.record(z$1.string(), z$1.unknown())).describe("Platform declaration for discovery profiles. May include partial config state required for discovery.")))
3063
+ })).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.");
3064
+ const ProfileSchemaBusinessProfileSchema = z$1.intersection(z$1.object({
3065
+ "ucp": z$1.object({
3066
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
3067
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
3068
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
3069
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
3070
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
3071
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
3072
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
3073
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
3074
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
3075
+ "transport": z$1.enum([
3076
+ "rest",
3077
+ "mcp",
3078
+ "a2a",
3079
+ "embedded"
3080
+ ]).describe("Transport protocol for this service binding."),
3081
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
3082
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
3083
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
3084
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
3085
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
3086
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
3087
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
3088
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
3089
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
3090
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
3091
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
3092
+ const passed = schemas.length - errors.length;
3093
+ if (passed !== 1) ctx.addIssue(errors.length ? {
3094
+ path: ctx.path,
3095
+ code: "invalid_union",
3096
+ unionErrors: errors,
3097
+ message: "Invalid input: Should pass single schema. Passed " + passed
3098
+ } : {
3099
+ path: ctx.path,
3100
+ code: "custom",
3101
+ message: "Invalid input: Should pass single schema. Passed " + passed
3102
+ });
3103
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
3104
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
3105
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
3106
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
3107
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
3108
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
3109
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
3110
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
3111
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3112
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
3113
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
3114
+ }).describe("Base UCP metadata with shared properties for all schema types."),
3115
+ "signing_keys": z$1.array(z$1.object({
3116
+ "kid": z$1.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
3117
+ "kty": z$1.string().describe("Key type (e.g., 'EC', 'RSA')."),
3118
+ "crv": z$1.string().describe("Curve name for EC keys (e.g., 'P-256').").optional(),
3119
+ "x": z$1.string().describe("X coordinate for EC public keys (base64url encoded).").optional(),
3120
+ "y": z$1.string().describe("Y coordinate for EC public keys (base64url encoded).").optional(),
3121
+ "n": z$1.string().describe("Modulus for RSA public keys (base64url encoded).").optional(),
3122
+ "e": z$1.string().describe("Exponent for RSA public keys (base64url encoded).").optional(),
3123
+ "use": z$1.enum(["sig", "enc"]).describe("Key usage. Should be 'sig' for signing keys.").optional(),
3124
+ "alg": z$1.string().describe("Algorithm (e.g., 'ES256', 'RS256').").optional()
3125
+ }).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()
3126
+ }).passthrough().describe("Base discovery profile with shared properties for all profile types."), z$1.object({ "ucp": z$1.intersection(z$1.object({
1603
3127
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
3128
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1604
3129
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1605
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
3130
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1606
3131
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1607
3132
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1608
3133
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
@@ -1617,22 +3142,40 @@ const UcpBusinessSchema = z$1.intersection(z$1.object({
1617
3142
  "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
1618
3143
  })))).describe("Service registry keyed by reverse-domain name.").optional(),
1619
3144
  "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1620
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
3145
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1621
3146
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1622
3147
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1623
3148
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1624
3149
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1625
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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(),
3150
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
3151
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
3152
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
3153
+ const passed = schemas.length - errors.length;
3154
+ if (passed !== 1) ctx.addIssue(errors.length ? {
3155
+ path: ctx.path,
3156
+ code: "invalid_union",
3157
+ unionErrors: errors,
3158
+ message: "Invalid input: Should pass single schema. Passed " + passed
3159
+ } : {
3160
+ path: ctx.path,
3161
+ code: "custom",
3162
+ message: "Invalid input: Should pass single schema. Passed " + passed
3163
+ });
3164
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })))).describe("Capability registry keyed by reverse-domain name.").optional(),
1626
3165
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1627
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
3166
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1628
3167
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1629
3168
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1630
3169
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1631
3170
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1632
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
3171
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
3172
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3173
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
3174
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))))).describe("Payment handler registry keyed by reverse-domain name.").optional()
1633
3175
  }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
3176
+ "supported_versions": z$1.record(z$1.string().url()).describe("Previous protocol versions this business supports, mapped to profile URIs. Businesses that support older protocol versions SHOULD advertise each version and link to its profile. Each URI points to a complete, self-contained profile for that version. When omitted, only `version` is supported.").optional(),
1634
3177
  "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
1635
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
3178
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1636
3179
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1637
3180
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1638
3181
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
@@ -1651,132 +3194,92 @@ const UcpBusinessSchema = z$1.intersection(z$1.object({
1651
3194
  z$1.object({ "transport": z$1.literal("a2a").optional() }),
1652
3195
  z$1.object({
1653
3196
  "transport": z$1.literal("embedded").optional(),
1654
- "config": z$1.object({ "delegate": z$1.array(z$1.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()
3197
+ "config": z$1.object({
3198
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In checkout responses, confirms accepted delegations for this session.").optional(),
3199
+ "color_scheme": z$1.array(z$1.enum(["light", "dark"])).describe("Color schemes the business supports. Hosts use ec_color_scheme query parameter to request a scheme from this list.").optional()
3200
+ }).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()
1655
3201
  })
1656
3202
  ])).describe("Service binding for business/merchant configuration. May override platform endpoints."))),
1657
3203
  "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1658
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1659
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1660
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1661
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1662
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1663
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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(),
1664
- "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1665
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1666
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1667
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1668
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1669
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1670
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())).describe("Business declaration for discovery profiles. May include partial config state required for discovery.")))
1671
- })).describe("UCP metadata for business/merchant-level configuration. Subset of platform schema with business-specific settings.");
1672
- const UcpResponseCheckoutSchema = z$1.intersection(z$1.object({
1673
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1674
- "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1675
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1676
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1677
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1678
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1679
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1680
- }).describe("Shared foundation for all UCP entities."), z$1.object({
1681
- "transport": z$1.enum([
1682
- "rest",
1683
- "mcp",
1684
- "a2a",
1685
- "embedded"
1686
- ]).describe("Transport protocol for this service binding."),
1687
- "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
1688
- })))).describe("Service registry keyed by reverse-domain name.").optional(),
1689
- "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1690
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1691
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1692
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1693
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1694
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1695
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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(),
1696
- "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1697
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1698
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1699
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1700
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1701
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1702
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
1703
- }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
1704
- "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
1705
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1706
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1707
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1708
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1709
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1710
- }).describe("Shared foundation for all UCP entities."), z$1.object({
1711
- "transport": z$1.enum([
1712
- "rest",
1713
- "mcp",
1714
- "a2a",
1715
- "embedded"
1716
- ]).describe("Transport protocol for this service binding."),
1717
- "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
1718
- })), z$1.union([
1719
- z$1.object({ "transport": z$1.literal("rest").optional() }),
1720
- z$1.object({ "transport": z$1.literal("mcp").optional() }),
1721
- z$1.object({ "transport": z$1.literal("a2a").optional() }),
1722
- z$1.object({
1723
- "transport": z$1.literal("embedded").optional(),
1724
- "config": z$1.object({ "delegate": z$1.array(z$1.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()
1725
- })
1726
- ])).describe("Service binding in API responses. Includes per-resource transport configuration via typed config."))).optional(),
1727
- "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1728
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1729
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1730
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1731
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1732
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1733
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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(),
1734
- "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1735
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1736
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1737
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1738
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1739
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1740
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())).describe("Handler reference in responses. May include full config state for runtime usage of the handler.")))
1741
- })).describe("UCP metadata for checkout responses.");
1742
- const UcpResponseOrderSchema = z$1.intersection(z$1.object({
1743
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1744
- "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1745
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1746
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1747
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1748
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1749
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1750
- }).describe("Shared foundation for all UCP entities."), z$1.object({
1751
- "transport": z$1.enum([
1752
- "rest",
1753
- "mcp",
1754
- "a2a",
1755
- "embedded"
1756
- ]).describe("Transport protocol for this service binding."),
1757
- "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
1758
- })))).describe("Service registry keyed by reverse-domain name.").optional(),
1759
- "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1760
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
3204
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1761
3205
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1762
3206
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1763
3207
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1764
3208
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1765
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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(),
3209
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
3210
+ const schemas = [z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$")), z$1.array(z$1.string().regex(/* @__PURE__ */ new RegExp("^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9_]*)+$"))).min(1)];
3211
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
3212
+ const passed = schemas.length - errors.length;
3213
+ if (passed !== 1) ctx.addIssue(errors.length ? {
3214
+ path: ctx.path,
3215
+ code: "invalid_union",
3216
+ unionErrors: errors,
3217
+ message: "Invalid input: Should pass single schema. Passed " + passed
3218
+ } : {
3219
+ path: ctx.path,
3220
+ code: "custom",
3221
+ message: "Invalid input: Should pass single schema. Passed " + passed
3222
+ });
3223
+ }).describe("Parent capability(s) this extends. Present for extensions, absent for root capabilities. Use array for multi-parent extensions.").optional() })).describe("Capability configuration for business/merchant level. May include business-specific config overrides."))).optional(),
1766
3224
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1767
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
3225
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1768
3226
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1769
3227
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1770
3228
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1771
3229
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1772
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown())))).describe("Payment handler registry keyed by reverse-domain name.").optional()
1773
- }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1774
- "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1775
- "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1776
- "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1777
- "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1778
- "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1779
- }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.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.");
3230
+ }).describe("Shared foundation for all UCP entities."), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.object({ "available_instruments": z$1.array(z$1.object({
3231
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3232
+ "constraints": z$1.record(z$1.string(), z$1.unknown()).describe("Constraints on this instrument type. Structure depends on instrument type and active capabilities.").optional()
3233
+ }).describe("An instrument type available from a payment handler with optional constraints.")).min(1).describe("Instrument types this handler supports, with optional constraints. When absent, every instrument should be considered available.").optional() }))).describe("Business declaration for discovery profiles. May include partial config state required for discovery.")))
3234
+ })).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.");
3235
+ const ServiceBaseTransportEnumSchema = z$1.enum([
3236
+ "rest",
3237
+ "mcp",
3238
+ "a2a",
3239
+ "embedded"
3240
+ ]).describe("Transport protocol for this service binding.");
3241
+ const CheckoutStatusEnumSchema = z$1.enum([
3242
+ "incomplete",
3243
+ "requires_escalation",
3244
+ "ready_for_complete",
3245
+ "complete_in_progress",
3246
+ "completed",
3247
+ "canceled"
3248
+ ]).describe("Checkout state indicating the current phase and required action. See Checkout Status lifecycle documentation for state transition details.");
3249
+ const DiscountAppliedDiscountMethodEnumSchema = z$1.enum(["each", "across"]).describe("Allocation method. 'each' = applied independently per item. 'across' = split proportionally by value.");
3250
+ const AdjustmentStatusEnumSchema = z$1.enum([
3251
+ "pending",
3252
+ "completed",
3253
+ "failed"
3254
+ ]).describe("Adjustment status.");
3255
+ const CardCredentialCardNumberTypeEnumSchema = z$1.enum([
3256
+ "fpan",
3257
+ "network_token",
3258
+ "dpan"
3259
+ ]).describe("The type of card number. Network tokens are preferred with fallback to FPAN. See PCI Scope for more details.");
3260
+ const ExpectationMethodTypeEnumSchema = z$1.enum([
3261
+ "shipping",
3262
+ "pickup",
3263
+ "digital"
3264
+ ]).describe("Delivery method type (shipping, pickup, digital).");
3265
+ const FulfillmentAvailableMethodTypeEnumSchema = z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type this availability applies to.");
3266
+ const FulfillmentMethodTypeEnumSchema = z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type.");
3267
+ const MessageErrorContentTypeEnumSchema = z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.");
3268
+ const MessageErrorSeverityEnumSchema = z$1.enum([
3269
+ "recoverable",
3270
+ "requires_buyer_input",
3271
+ "requires_buyer_review",
3272
+ "unrecoverable"
3273
+ ]).describe("Reflects the resource state and recommended action. 'recoverable': platform can resolve by modifying inputs and retrying 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. 'unrecoverable': no valid resource exists to act on, retry with new resource or inputs. Errors with 'requires_*' severity contribute to 'status: requires_escalation'.");
3274
+ const MessageInfoContentTypeEnumSchema = z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.");
3275
+ const MessageWarningContentTypeEnumSchema = z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.");
3276
+ const OrderLineItemStatusEnumSchema = z$1.enum([
3277
+ "processing",
3278
+ "partial",
3279
+ "fulfilled"
3280
+ ]).describe("Derived status: fulfilled if quantity.fulfilled == quantity.total, partial if quantity.fulfilled > 0, otherwise processing.");
3281
+ const UcpBaseStatusEnumSchema = z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.");
3282
+ const ProfileSchemaSigningKeyUseEnumSchema = z$1.enum(["sig", "enc"]).describe("Key usage. Should be 'sig' for signing keys.");
1780
3283
  //#endregion
1781
3284
  //#region src/extensions.ts
1782
3285
  const ItemResponseSchema = ItemSchema;
@@ -1784,63 +3287,14 @@ const TotalResponseSchema = TotalSchema;
1784
3287
  const LineItemResponseSchema = LineItemSchema;
1785
3288
  const FulfillmentResponseSchema = FulfillmentSchema;
1786
3289
  const FulfillmentMethodResponseSchema = FulfillmentMethodSchema;
1787
- const CheckoutResponseStatusSchema = z.enum([
1788
- "incomplete",
1789
- "requires_escalation",
1790
- "ready_for_complete",
1791
- "complete_in_progress",
1792
- "completed",
1793
- "canceled"
1794
- ]);
1795
- const ExtendedPaymentCredentialSchema = PaymentCredentialSchema.extend({ token: z.string().optional() });
3290
+ const CheckoutResponseStatusSchema = CheckoutStatusEnumSchema;
1796
3291
  const PaymentResponseSchema = PaymentSchema.passthrough();
1797
3292
  const PaymentInstrumentResponseSchema = PaymentInstrumentSchema.passthrough();
1798
- const UcpDiscoveryProfileSchema = z.object({ ucp: z.object({
1799
- version: z.string(),
1800
- capabilities: z.record(z.string(), z.array(UcpEntitySchema)).optional(),
1801
- services: z.record(z.string(), z.array(UcpEntitySchema)).optional(),
1802
- payment_handlers: z.array(PaymentHandlerResponseSchema).optional()
1803
- }) });
1804
- const PlatformConfigSchema = z.object({ webhook_url: z.string().url().optional() });
1805
- const FulfillmentRequestSchema = z.object({ methods: z.array(z.object({
1806
- id: z.string(),
1807
- type: z.enum(["shipping", "pickup"]),
1808
- line_item_ids: z.array(z.string()),
1809
- selected_destination_id: z.string().nullable().optional(),
1810
- groups: z.array(z.object({
1811
- id: z.string(),
1812
- selected_option_id: z.string().nullable().optional()
1813
- }).passthrough()).optional()
1814
- }).passthrough()).optional() }).passthrough();
1815
- const DiscountsObjectSchema = z.object({ codes: z.array(z.string()).optional() }).passthrough();
1816
- const ConsentSchema = z.object({
1817
- marketing: z.boolean().optional(),
1818
- sms: z.boolean().optional(),
1819
- terms: z.boolean().optional()
1820
- }).passthrough();
1821
- const Ap2ResponseSchema = z.object({
1822
- mandate: z.string().optional(),
1823
- status: z.string().optional()
1824
- }).passthrough();
3293
+ const UcpDiscoveryProfileSchema = ProfileSchemaBaseSchema;
3294
+ const UcpDiscoveryPlatformProfileSchema = ProfileSchemaPlatformProfileSchema;
3295
+ const UcpDiscoveryBusinessProfileSchema = ProfileSchemaBusinessProfileSchema;
3296
+ const UcpSigningKeySchema = ProfileSchemaSigningKeySchema;
1825
3297
  const CheckoutResponseSchema = CheckoutSchema.passthrough();
1826
- const ExtendedCheckoutResponseSchema = CheckoutSchema.extend({
1827
- fulfillment: FulfillmentResponseSchema.optional(),
1828
- discounts: DiscountsObjectSchema.optional(),
1829
- ap2: Ap2ResponseSchema.optional(),
1830
- order_id: z.string().optional(),
1831
- order_permalink_url: z.string().optional(),
1832
- platform: PlatformConfigSchema.optional()
1833
- }).passthrough();
1834
- const ExtendedCheckoutCreateRequestSchema = CheckoutCreateRequestSchema.extend({
1835
- fulfillment: FulfillmentRequestSchema.optional(),
1836
- discounts: DiscountsObjectSchema.optional(),
1837
- buyer: BuyerSchema.extend({ consent: ConsentSchema.optional() }).optional()
1838
- });
1839
- const ExtendedCheckoutUpdateRequestSchema = CheckoutUpdateRequestSchema.extend({
1840
- fulfillment: FulfillmentRequestSchema.optional(),
1841
- discounts: DiscountsObjectSchema.optional(),
1842
- buyer: BuyerSchema.extend({ consent: ConsentSchema.optional() }).optional()
1843
- });
1844
3298
  const OrderUpdateSchema = OrderSchema;
1845
3299
  //#endregion
1846
- export { AccountInfoSchema, AdjustmentSchema, Ap2MandateAp2WithCheckoutMandateSchema, Ap2MandateAp2WithMerchantAuthorizationSchema, Ap2MandateCheckoutMandateSchema, Ap2MandateErrorCodeSchema, Ap2MandateMerchantAuthorizationSchema, BindingSchema, BusinessFulfillmentConfigSchema, BuyerConsentBuyerSchema, BuyerConsentConsentSchema, BuyerSchema, CapabilityBaseSchema, CapabilityBusinessSchema, CapabilityPlatformSchema, CapabilityResponseSchema, CardCredentialSchema, CardPaymentInstrumentSchema, CheckoutCompleteRequestSchema, CheckoutCreateRequestSchema, CheckoutResponseSchema, CheckoutResponseStatusSchema, CheckoutSchema, CheckoutUpdateRequestSchema, ContextSchema, DiscountAllocationSchema, DiscountAppliedDiscountSchema, DiscountDiscountsObjectSchema, EmbeddedConfigSchema, ExpectationSchema, ExtendedCheckoutCreateRequestSchema, ExtendedCheckoutResponseSchema, ExtendedCheckoutUpdateRequestSchema, ExtendedPaymentCredentialSchema, FulfillmentAvailableMethodSchema, FulfillmentDestinationSchema, FulfillmentEventSchema, FulfillmentExtensionFulfillmentAvailableMethodSchema, FulfillmentExtensionFulfillmentGroupSchema, FulfillmentExtensionFulfillmentMethodSchema, FulfillmentExtensionFulfillmentOptionSchema, FulfillmentExtensionFulfillmentSchema, FulfillmentGroupSchema, FulfillmentGroupUpdateRequestSchema, FulfillmentMethodCreateRequestSchema, FulfillmentMethodResponseSchema, FulfillmentMethodSchema, FulfillmentMethodUpdateRequestSchema, FulfillmentOptionSchema, FulfillmentResponseSchema, FulfillmentSchema, ItemResponseSchema, ItemSchema, LineItemResponseSchema, LineItemSchema, LineItemUpdateRequestSchema, LinkSchema, MerchantFulfillmentConfigSchema, MessageErrorSchema, MessageInfoSchema, MessageSchema, MessageWarningSchema, OrderConfirmationSchema, OrderLineItemSchema, OrderSchema, OrderUpdateSchema, PaymentCredentialSchema, PaymentHandlerBaseSchema, PaymentHandlerBusinessSchema, PaymentHandlerPlatformSchema, PaymentHandlerResponseSchema, PaymentIdentitySchema, PaymentInstrumentResponseSchema, PaymentInstrumentSchema, PaymentResponseSchema, PaymentSchema, PlatformConfigSchema, PlatformFulfillmentConfigSchema, PostalAddressSchema, RetailLocationSchema, ServiceBaseSchema, ServiceBusinessSchema, ServicePlatformSchema, ServiceResponseSchema, ShippingDestinationSchema, TokenCredentialSchema, TotalResponseSchema, TotalSchema, UcpBaseSchema, UcpBusinessSchema, UcpDiscoveryProfileSchema, UcpEntitySchema, UcpPlatformSchema, UcpResponseCheckoutSchema, UcpResponseOrderSchema, UcpReverseDomainNameSchema, UcpVersionSchema };
3300
+ export { AccountInfoSchema, AdjustmentSchema, AdjustmentStatusEnumSchema, AmountSchema, Ap2MandateAp2WithCheckoutMandateSchema, Ap2MandateAp2WithMerchantAuthorizationSchema, Ap2MandateCheckoutMandateSchema, Ap2MandateErrorCodeSchema, Ap2MandateMerchantAuthorizationSchema, AvailablePaymentInstrumentSchema, BindingSchema, BusinessFulfillmentConfigSchema, BuyerConsentBuyerSchema, BuyerConsentConsentSchema, BuyerSchema, CapabilityBaseSchema, CapabilityBusinessSchema, CapabilityPlatformSchema, CapabilityResponseSchema, CardCredentialCardNumberTypeEnumSchema, CardCredentialSchema, CardPaymentInstrumentAvailableCardPaymentInstrumentSchema, CartCreateRequestSchema, CartSchema, CartUpdateRequestSchema, CatalogLookupSchema, CatalogSearchSchema, CategorySchema, CheckoutCompleteRequestSchema, CheckoutCreateRequestSchema, CheckoutResponseSchema, CheckoutResponseStatusSchema, CheckoutSchema, CheckoutStatusEnumSchema, CheckoutUpdateRequestSchema, ContextSchema, DescriptionSchema, DiscountAllocationSchema, DiscountAppliedDiscountMethodEnumSchema, DiscountAppliedDiscountSchema, DiscountDiscountsObjectSchema, EmbeddedConfigSchema, ErrorCodeSchema, ErrorResponseSchema, ExpectationMethodTypeEnumSchema, ExpectationSchema, FulfillmentAvailableMethodSchema, FulfillmentAvailableMethodTypeEnumSchema, FulfillmentDestinationSchema, FulfillmentEventSchema, FulfillmentExtensionFulfillmentAvailableMethodSchema, FulfillmentExtensionFulfillmentGroupSchema, FulfillmentExtensionFulfillmentMethodSchema, FulfillmentExtensionFulfillmentOptionSchema, FulfillmentExtensionFulfillmentSchema, FulfillmentGroupSchema, FulfillmentGroupUpdateRequestSchema, FulfillmentMethodCreateRequestSchema, FulfillmentMethodResponseSchema, FulfillmentMethodSchema, FulfillmentMethodTypeEnumSchema, FulfillmentMethodUpdateRequestSchema, FulfillmentOptionSchema, FulfillmentResponseSchema, FulfillmentSchema, IdentityLinkingBusinessSchema, IdentityLinkingIdentityScopesSchema, IdentityLinkingMechanismSchema, IdentityLinkingOauth2Schema, IdentityLinkingPlatformSchema, InputCorrelationSchema, ItemResponseSchema, ItemSchema, LineItemResponseSchema, LineItemSchema, LineItemUpdateRequestSchema, LinkSchema, MediaSchema, MerchantFulfillmentConfigSchema, MessageErrorContentTypeEnumSchema, MessageErrorSchema, MessageErrorSeverityEnumSchema, MessageInfoContentTypeEnumSchema, MessageInfoSchema, MessageSchema, MessageWarningContentTypeEnumSchema, MessageWarningSchema, OptionValueSchema, OrderConfirmationSchema, OrderLineItemSchema, OrderLineItemStatusEnumSchema, OrderSchema, OrderUpdateSchema, PaginationSchema, PaymentCredentialSchema, PaymentHandlerBaseSchema, PaymentHandlerBusinessSchema, PaymentHandlerPlatformSchema, PaymentHandlerResponseSchema, PaymentIdentitySchema, PaymentInstrumentResponseSchema, PaymentInstrumentSchema, PaymentResponseSchema, PaymentSchema, PlatformFulfillmentConfigSchema, PostalAddressSchema, PriceFilterSchema, PriceRangeSchema, PriceSchema, ProductOptionSchema, ProductSchema, ProfileSchemaBaseSchema, ProfileSchemaBusinessProfileSchema, ProfileSchemaPlatformProfileSchema, ProfileSchemaSigningKeySchema, ProfileSchemaSigningKeyUseEnumSchema, RatingSchema, RetailLocationSchema, ReverseDomainNameSchema, SearchFiltersSchema, SelectedOptionSchema, ServiceBaseSchema, ServiceBaseTransportEnumSchema, ServiceBusinessSchema, ServicePlatformSchema, ServiceResponseSchema, ShippingDestinationSchema, SignalsSchema, SignedAmountSchema, TokenCredentialSchema, TotalResponseSchema, TotalSchema, TotalsSchema, UcpBaseSchema, UcpBaseStatusEnumSchema, UcpBusinessSchema, UcpDiscoveryBusinessProfileSchema, UcpDiscoveryPlatformProfileSchema, UcpDiscoveryProfileSchema, UcpEntitySchema, UcpPlatformSchema, UcpRequiresSchema, UcpResponseCartSchema, UcpResponseCatalogSchema, UcpResponseCheckoutSchema, UcpResponseOrderSchema, UcpSigningKeySchema, UcpVersionConstraintSchema, UcpVersionSchema, VariantSchema };