@omnixhq/ucp-js-sdk 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -6,56 +6,124 @@ const CapabilityBaseSchema = z$1.intersection(z$1.object({
6
6
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
7
7
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
8
8
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
9
- }).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() }));
10
24
  const CapabilityPlatformSchema = z$1.intersection(z$1.intersection(z$1.object({
11
25
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
12
26
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
13
27
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
14
28
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
15
29
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
16
- }).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.");
17
45
  const CapabilityBusinessSchema = z$1.intersection(z$1.object({
18
46
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
19
47
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
20
48
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
21
49
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
22
50
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
23
- }).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.");
24
66
  const CapabilityResponseSchema = z$1.intersection(z$1.object({
25
67
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
26
68
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
27
69
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
28
70
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
29
71
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
30
- }).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.");
31
87
  const PaymentHandlerBaseSchema = z$1.intersection(z$1.object({
32
88
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
33
89
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
34
90
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
35
91
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
36
92
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
37
- }).describe("Shared foundation for all UCP entities."), z$1.record(z$1.string(), z$1.unknown()));
93
+ }).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({
94
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
95
+ "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()
96
+ }).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() })));
38
97
  const PaymentHandlerPlatformSchema = z$1.intersection(z$1.intersection(z$1.object({
39
98
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
40
99
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
41
100
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
42
101
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
43
102
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
44
- }).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.");
103
+ }).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({
104
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
105
+ "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()
106
+ }).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.");
45
107
  const PaymentHandlerBusinessSchema = z$1.intersection(z$1.object({
46
108
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
47
109
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
48
110
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
49
111
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
50
112
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
51
- }).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.");
113
+ }).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({
114
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
115
+ "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()
116
+ }).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.");
52
117
  const PaymentHandlerResponseSchema = z$1.intersection(z$1.object({
53
118
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
54
119
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
55
120
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
56
121
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
57
122
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
58
- }).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.");
123
+ }).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({
124
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
125
+ "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()
126
+ }).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.");
59
127
  const ServiceBaseSchema = z$1.intersection(z$1.object({
60
128
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
61
129
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -90,7 +158,7 @@ const ServicePlatformSchema = z$1.intersection(z$1.intersection(z$1.object({
90
158
  z$1.object({ "transport": z$1.literal("mcp").optional() }),
91
159
  z$1.object({ "transport": z$1.literal("a2a").optional() }),
92
160
  z$1.object({ "transport": z$1.literal("embedded").optional() })
93
- ]))).describe("Full service declaration for platform-level discovery. Different transports require different fields.");
161
+ ]))).describe("Full service declaration for platform-level discovery. All transports require `version`, `spec`, and `transport`. REST and MCP additionally require `schema` and `endpoint`; A2A requires `endpoint`; embedded requires `schema`.");
94
162
  const ServiceBusinessSchema = z$1.intersection(z$1.intersection(z$1.object({
95
163
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
96
164
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -111,7 +179,10 @@ const ServiceBusinessSchema = z$1.intersection(z$1.intersection(z$1.object({
111
179
  z$1.object({ "transport": z$1.literal("a2a").optional() }),
112
180
  z$1.object({
113
181
  "transport": z$1.literal("embedded").optional(),
114
- "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()
182
+ "config": z$1.object({
183
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In UCP responses, confirms accepted delegations for this session.").optional(),
184
+ "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()
185
+ }).describe("Per-session configuration for embedded transport binding. Allows businesses to vary EP availability and delegations based on cart contents, agent authorization, or policy.").optional()
115
186
  })
116
187
  ])).describe("Service binding for business/merchant configuration. May override platform endpoints.");
117
188
  const ServiceResponseSchema = z$1.intersection(z$1.intersection(z$1.object({
@@ -134,7 +205,10 @@ const ServiceResponseSchema = z$1.intersection(z$1.intersection(z$1.object({
134
205
  z$1.object({ "transport": z$1.literal("a2a").optional() }),
135
206
  z$1.object({
136
207
  "transport": z$1.literal("embedded").optional(),
137
- "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()
208
+ "config": z$1.object({
209
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In UCP responses, confirms accepted delegations for this session.").optional(),
210
+ "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()
211
+ }).describe("Per-session configuration for embedded transport binding. Allows businesses to vary EP availability and delegations based on cart contents, agent authorization, or policy.").optional()
138
212
  })
139
213
  ])).describe("Service binding in API responses. Includes per-resource transport configuration via typed config.");
140
214
  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.");
@@ -167,9 +241,257 @@ const BuyerConsentBuyerSchema = z$1.intersection(z$1.object({
167
241
  "marketing": z$1.boolean().describe("Consent for marketing communications.").optional(),
168
242
  "sale_of_data": z$1.boolean().describe("Consent for selling data to third parties (CCPA).").optional()
169
243
  }).describe("Consent tracking fields.").optional() })).describe("Buyer object extended with consent tracking.");
244
+ const CartSchema = z$1.object({
245
+ "ucp": z$1.intersection(z$1.object({
246
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
247
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
248
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
249
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
250
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
251
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
252
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
253
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
254
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
255
+ "transport": z$1.enum([
256
+ "rest",
257
+ "mcp",
258
+ "a2a",
259
+ "embedded"
260
+ ]).describe("Transport protocol for this service binding."),
261
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
262
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
263
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
264
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
265
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
266
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
267
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
268
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
269
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
270
+ 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)];
271
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
272
+ const passed = schemas.length - errors.length;
273
+ if (passed !== 1) ctx.addIssue(errors.length ? {
274
+ path: ctx.path,
275
+ code: "invalid_union",
276
+ unionErrors: errors,
277
+ message: "Invalid input: Should pass single schema. Passed " + passed
278
+ } : {
279
+ path: ctx.path,
280
+ code: "custom",
281
+ message: "Invalid input: Should pass single schema. Passed " + passed
282
+ });
283
+ }).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(),
284
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
285
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
286
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
287
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
288
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
289
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
290
+ }).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({
291
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
292
+ "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()
293
+ }).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()
294
+ }).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({
295
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
296
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
297
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
298
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
299
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
300
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
301
+ 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)];
302
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
303
+ const passed = schemas.length - errors.length;
304
+ if (passed !== 1) ctx.addIssue(errors.length ? {
305
+ path: ctx.path,
306
+ code: "invalid_union",
307
+ unionErrors: errors,
308
+ message: "Invalid input: Should pass single schema. Passed " + passed
309
+ } : {
310
+ path: ctx.path,
311
+ code: "custom",
312
+ message: "Invalid input: Should pass single schema. Passed " + passed
313
+ });
314
+ }).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."),
315
+ "id": z$1.string().describe("Unique cart identifier."),
316
+ "line_items": z$1.array(z$1.object({
317
+ "id": z$1.string(),
318
+ "item": z$1.object({
319
+ "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."),
320
+ "title": z$1.string().describe("Product title."),
321
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
322
+ "image_url": z$1.string().url().describe("Product image URI.").optional()
323
+ }),
324
+ "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
325
+ "totals": z$1.array(z$1.object({
326
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
327
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
328
+ "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).")
329
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
330
+ "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
331
+ }).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."),
332
+ "context": z$1.object({
333
+ "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(),
334
+ "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(),
335
+ "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(),
336
+ "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(),
337
+ "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(),
338
+ "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(),
339
+ "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()
340
+ }).passthrough().describe("Buyer signals for localization (country, region, postal_code). Merchant uses for pricing, availability, currency. Falls back to geo-IP if omitted.").optional(),
341
+ "signals": z$1.object({
342
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
343
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
344
+ }).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(),
345
+ "buyer": z$1.object({
346
+ "first_name": z$1.string().describe("First name of the buyer.").optional(),
347
+ "last_name": z$1.string().describe("Last name of the buyer.").optional(),
348
+ "email": z$1.string().describe("Email of the buyer.").optional(),
349
+ "phone_number": z$1.string().describe("E.164 standard.").optional()
350
+ }).passthrough().describe("Optional buyer information for personalized estimates.").optional(),
351
+ "currency": z$1.string().describe("ISO 4217 currency code. Determined by merchant based on context or geo-IP."),
352
+ "totals": z$1.array(z$1.intersection(z$1.object({
353
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
354
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
355
+ "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).")
356
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text."), z$1.intersection(z$1.object({ "lines": z$1.array(z$1.object({
357
+ "display_text": z$1.string().describe("Human-readable label for this sub-line."),
358
+ "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).")
359
+ }).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() }), z$1.any()))).describe("Estimated cost breakdown. May be partial if shipping/tax not yet calculable."),
360
+ "messages": z$1.array(z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
361
+ const schemas = [
362
+ z$1.object({
363
+ "type": z$1.literal("error").describe("Message type discriminator."),
364
+ "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."),
365
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
366
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
367
+ "content": z$1.string().describe("Human-readable message."),
368
+ "severity": z$1.enum([
369
+ "recoverable",
370
+ "requires_buyer_input",
371
+ "requires_buyer_review",
372
+ "unrecoverable"
373
+ ]).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'.")
374
+ }),
375
+ z$1.object({
376
+ "type": z$1.literal("warning").describe("Message type discriminator."),
377
+ "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
378
+ "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
379
+ "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
380
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
381
+ "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"),
382
+ "image_url": z$1.string().url().describe("URL to a required visual element (e.g., warning symbol, energy class label).").optional(),
383
+ "url": z$1.string().url().describe("Reference URL for more information (e.g., regulatory site, registry entry, policy page).").optional()
384
+ }),
385
+ z$1.object({
386
+ "type": z$1.literal("info").describe("Message type discriminator."),
387
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to.").optional(),
388
+ "code": z$1.string().describe("Info code for programmatic handling.").optional(),
389
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
390
+ "content": z$1.string().describe("Human-readable message.")
391
+ })
392
+ ];
393
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
394
+ const passed = schemas.length - errors.length;
395
+ if (passed !== 1) ctx.addIssue(errors.length ? {
396
+ path: ctx.path,
397
+ code: "invalid_union",
398
+ unionErrors: errors,
399
+ message: "Invalid input: Should pass single schema. Passed " + passed
400
+ } : {
401
+ path: ctx.path,
402
+ code: "custom",
403
+ message: "Invalid input: Should pass single schema. Passed " + passed
404
+ });
405
+ })).describe("Container for error, warning, or info messages.")).describe("Validation messages, warnings, or informational notices.").optional(),
406
+ "links": z$1.array(z$1.object({
407
+ "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."),
408
+ "url": z$1.string().url().describe("The actual URL pointing to the content to be displayed."),
409
+ "title": z$1.string().describe("Optional display text for the link. When provided, use this instead of generating from type.").optional()
410
+ })).describe("Optional merchant links (policies, FAQs).").optional(),
411
+ "continue_url": z$1.string().url().describe("URL for cart handoff and session recovery. Enables sharing and human-in-the-loop flows.").optional(),
412
+ "expires_at": z$1.string().datetime({ offset: true }).describe("Cart expiry timestamp (RFC 3339). Optional.").optional()
413
+ }).passthrough().describe("Shopping cart with estimated pricing before checkout. Lightweight pre-purchase exploration with no payment info or complex status states.");
414
+ const CartCreateRequestSchema = z$1.object({
415
+ "line_items": z$1.array(z$1.object({
416
+ "id": z$1.string(),
417
+ "item": z$1.object({
418
+ "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."),
419
+ "title": z$1.string().describe("Product title."),
420
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
421
+ "image_url": z$1.string().url().describe("Product image URI.").optional()
422
+ }),
423
+ "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
424
+ "totals": z$1.array(z$1.object({
425
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
426
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
427
+ "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).")
428
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
429
+ "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
430
+ }).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."),
431
+ "context": z$1.object({
432
+ "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(),
433
+ "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(),
434
+ "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(),
435
+ "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(),
436
+ "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(),
437
+ "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(),
438
+ "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()
439
+ }).passthrough().describe("Buyer signals for localization (country, region, postal_code). Merchant uses for pricing, availability, currency. Falls back to geo-IP if omitted.").optional(),
440
+ "signals": z$1.object({
441
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
442
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
443
+ }).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(),
444
+ "buyer": z$1.object({
445
+ "first_name": z$1.string().describe("First name of the buyer.").optional(),
446
+ "last_name": z$1.string().describe("Last name of the buyer.").optional(),
447
+ "email": z$1.string().describe("Email of the buyer.").optional(),
448
+ "phone_number": z$1.string().describe("E.164 standard.").optional()
449
+ }).passthrough().describe("Optional buyer information for personalized estimates.").optional()
450
+ }).strict();
451
+ const CartUpdateRequestSchema = z$1.object({
452
+ "id": z$1.string().describe("Unique cart identifier."),
453
+ "line_items": z$1.array(z$1.object({
454
+ "id": z$1.string(),
455
+ "item": z$1.object({
456
+ "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."),
457
+ "title": z$1.string().describe("Product title."),
458
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
459
+ "image_url": z$1.string().url().describe("Product image URI.").optional()
460
+ }),
461
+ "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
462
+ "totals": z$1.array(z$1.object({
463
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
464
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
465
+ "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).")
466
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
467
+ "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
468
+ }).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."),
469
+ "context": z$1.object({
470
+ "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(),
471
+ "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(),
472
+ "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(),
473
+ "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(),
474
+ "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(),
475
+ "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(),
476
+ "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()
477
+ }).passthrough().describe("Buyer signals for localization (country, region, postal_code). Merchant uses for pricing, availability, currency. Falls back to geo-IP if omitted.").optional(),
478
+ "signals": z$1.object({
479
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
480
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
481
+ }).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(),
482
+ "buyer": z$1.object({
483
+ "first_name": z$1.string().describe("First name of the buyer.").optional(),
484
+ "last_name": z$1.string().describe("Last name of the buyer.").optional(),
485
+ "email": z$1.string().describe("Email of the buyer.").optional(),
486
+ "phone_number": z$1.string().describe("E.164 standard.").optional()
487
+ }).passthrough().describe("Optional buyer information for personalized estimates.").optional()
488
+ }).strict();
489
+ const CatalogLookupSchema = z$1.record(z$1.string(), z$1.unknown()).describe("Product/variant lookup by identifier. Supports batch retrieval (lookup_catalog) and single-product detail (get_product).");
490
+ const CatalogSearchSchema = z$1.record(z$1.string(), z$1.unknown()).describe("Product catalog search capability.");
170
491
  const CheckoutSchema = z$1.object({
171
492
  "ucp": z$1.intersection(z$1.object({
172
493
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
494
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
173
495
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
174
496
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
175
497
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -191,14 +513,31 @@ const CheckoutSchema = z$1.object({
191
513
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
192
514
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
193
515
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
194
- }).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(),
516
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
517
+ 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)];
518
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
519
+ const passed = schemas.length - errors.length;
520
+ if (passed !== 1) ctx.addIssue(errors.length ? {
521
+ path: ctx.path,
522
+ code: "invalid_union",
523
+ unionErrors: errors,
524
+ message: "Invalid input: Should pass single schema. Passed " + passed
525
+ } : {
526
+ path: ctx.path,
527
+ code: "custom",
528
+ message: "Invalid input: Should pass single schema. Passed " + passed
529
+ });
530
+ }).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(),
195
531
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
196
532
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
197
533
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
198
534
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
199
535
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
200
536
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
201
- }).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()
537
+ }).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({
538
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
539
+ "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()
540
+ }).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()
202
541
  }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
203
542
  "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
204
543
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
@@ -220,7 +559,10 @@ const CheckoutSchema = z$1.object({
220
559
  z$1.object({ "transport": z$1.literal("a2a").optional() }),
221
560
  z$1.object({
222
561
  "transport": z$1.literal("embedded").optional(),
223
- "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()
562
+ "config": z$1.object({
563
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In UCP responses, confirms accepted delegations for this session.").optional(),
564
+ "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()
565
+ }).describe("Per-session configuration for embedded transport binding. Allows businesses to vary EP availability and delegations based on cart contents, agent authorization, or policy.").optional()
224
566
  })
225
567
  ])).describe("Service binding in API responses. Includes per-resource transport configuration via typed config."))).optional(),
226
568
  "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
@@ -229,38 +571,47 @@ const CheckoutSchema = z$1.object({
229
571
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
230
572
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
231
573
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
232
- }).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(),
574
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
575
+ 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)];
576
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
577
+ const passed = schemas.length - errors.length;
578
+ if (passed !== 1) ctx.addIssue(errors.length ? {
579
+ path: ctx.path,
580
+ code: "invalid_union",
581
+ unionErrors: errors,
582
+ message: "Invalid input: Should pass single schema. Passed " + passed
583
+ } : {
584
+ path: ctx.path,
585
+ code: "custom",
586
+ message: "Invalid input: Should pass single schema. Passed " + passed
587
+ });
588
+ }).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(),
233
589
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
234
590
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
235
591
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
236
592
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
237
593
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
238
594
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
239
- }).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.")))
595
+ }).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({
596
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
597
+ "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()
598
+ }).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.")))
240
599
  })).describe("UCP metadata for checkout responses."),
241
600
  "id": z$1.string().describe("Unique identifier of the checkout session."),
242
601
  "line_items": z$1.array(z$1.object({
243
602
  "id": z$1.string(),
244
603
  "item": z$1.object({
245
- "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."),
604
+ "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."),
246
605
  "title": z$1.string().describe("Product title."),
247
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
606
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
248
607
  "image_url": z$1.string().url().describe("Product image URI.").optional()
249
608
  }),
250
609
  "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
251
610
  "totals": z$1.array(z$1.object({
252
- "type": z$1.enum([
253
- "items_discount",
254
- "subtotal",
255
- "discount",
256
- "fulfillment",
257
- "tax",
258
- "fee",
259
- "total"
260
- ]).describe("Type of total categorization."),
611
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
261
612
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
262
- "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.")
263
- })).describe("Line item totals breakdown."),
613
+ "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).")
614
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
264
615
  "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
265
616
  }).describe("Line item object. Expected to use the currency of the parent object.")).describe("List of line items being checked out."),
266
617
  "buyer": z$1.object({
@@ -272,8 +623,16 @@ const CheckoutSchema = z$1.object({
272
623
  "context": z$1.object({
273
624
  "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(),
274
625
  "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(),
275
- "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()
276
- }).passthrough().describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.").optional(),
626
+ "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(),
627
+ "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(),
628
+ "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(),
629
+ "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(),
630
+ "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()
631
+ }).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(),
632
+ "signals": z$1.object({
633
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
634
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
635
+ }).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(),
277
636
  "status": z$1.enum([
278
637
  "incomplete",
279
638
  "requires_escalation",
@@ -283,39 +642,38 @@ const CheckoutSchema = z$1.object({
283
642
  "canceled"
284
643
  ]).describe("Checkout state indicating the current phase and required action. See Checkout Status lifecycle documentation for state transition details."),
285
644
  "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."),
286
- "totals": z$1.array(z$1.object({
287
- "type": z$1.enum([
288
- "items_discount",
289
- "subtotal",
290
- "discount",
291
- "fulfillment",
292
- "tax",
293
- "fee",
294
- "total"
295
- ]).describe("Type of total categorization."),
645
+ "totals": z$1.array(z$1.intersection(z$1.object({
646
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
296
647
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
297
- "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.")
298
- })).describe("Different cart totals."),
648
+ "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).")
649
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text."), z$1.intersection(z$1.object({ "lines": z$1.array(z$1.object({
650
+ "display_text": z$1.string().describe("Human-readable label for this sub-line."),
651
+ "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).")
652
+ }).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() }), z$1.any()))).describe("Different cart totals."),
299
653
  "messages": z$1.array(z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
300
654
  const schemas = [
301
655
  z$1.object({
302
656
  "type": z$1.literal("error").describe("Message type discriminator."),
303
- "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."),
657
+ "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."),
304
658
  "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
305
659
  "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
306
660
  "content": z$1.string().describe("Human-readable message."),
307
661
  "severity": z$1.enum([
308
662
  "recoverable",
309
663
  "requires_buyer_input",
310
- "requires_buyer_review"
311
- ]).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'.")
664
+ "requires_buyer_review",
665
+ "unrecoverable"
666
+ ]).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'.")
312
667
  }),
313
668
  z$1.object({
314
669
  "type": z$1.literal("warning").describe("Message type discriminator."),
315
670
  "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
316
671
  "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
317
672
  "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
318
- "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain")
673
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
674
+ "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"),
675
+ "image_url": z$1.string().url().describe("URL to a required visual element (e.g., warning symbol, energy class label).").optional(),
676
+ "url": z$1.string().url().describe("Reference URL for more information (e.g., regulatory site, registry entry, policy page).").optional()
319
677
  }),
320
678
  z$1.object({
321
679
  "type": z$1.literal("info").describe("Message type discriminator."),
@@ -365,6 +723,7 @@ const CheckoutSchema = z$1.object({
365
723
  }).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(),
366
724
  "order": z$1.object({
367
725
  "id": z$1.string().describe("Unique order identifier."),
726
+ "label": z$1.string().describe("Human-readable label for identifying the order. MUST only be provided by the business.").optional(),
368
727
  "permalink_url": z$1.string().url().describe("Permalink to access the order on merchant site.")
369
728
  }).describe("Details about an order created for this checkout session.").optional()
370
729
  }).passthrough().describe("Base checkout schema. Extensions compose onto this using allOf.");
@@ -372,25 +731,17 @@ const CheckoutCreateRequestSchema = z$1.object({
372
731
  "line_items": z$1.array(z$1.object({
373
732
  "id": z$1.string(),
374
733
  "item": z$1.object({
375
- "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."),
734
+ "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."),
376
735
  "title": z$1.string().describe("Product title."),
377
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
736
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
378
737
  "image_url": z$1.string().url().describe("Product image URI.").optional()
379
738
  }),
380
739
  "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
381
740
  "totals": z$1.array(z$1.object({
382
- "type": z$1.enum([
383
- "items_discount",
384
- "subtotal",
385
- "discount",
386
- "fulfillment",
387
- "tax",
388
- "fee",
389
- "total"
390
- ]).describe("Type of total categorization."),
741
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
391
742
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
392
- "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.")
393
- })).describe("Line item totals breakdown."),
743
+ "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).")
744
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
394
745
  "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
395
746
  }).describe("Line item object. Expected to use the currency of the parent object.")).describe("List of line items being checked out."),
396
747
  "buyer": z$1.object({
@@ -402,8 +753,16 @@ const CheckoutCreateRequestSchema = z$1.object({
402
753
  "context": z$1.object({
403
754
  "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(),
404
755
  "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(),
405
- "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()
406
- }).passthrough().describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.").optional(),
756
+ "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(),
757
+ "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(),
758
+ "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(),
759
+ "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(),
760
+ "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()
761
+ }).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(),
762
+ "signals": z$1.object({
763
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
764
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
765
+ }).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(),
407
766
  "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
408
767
  "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
409
768
  "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."),
@@ -424,29 +783,20 @@ const CheckoutCreateRequestSchema = z$1.object({
424
783
  }).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()
425
784
  }).strict();
426
785
  const CheckoutUpdateRequestSchema = z$1.object({
427
- "id": z$1.string().describe("Unique identifier of the checkout session."),
428
786
  "line_items": z$1.array(z$1.object({
429
787
  "id": z$1.string(),
430
788
  "item": z$1.object({
431
- "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."),
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."),
432
790
  "title": z$1.string().describe("Product title."),
433
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
791
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
434
792
  "image_url": z$1.string().url().describe("Product image URI.").optional()
435
793
  }),
436
794
  "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
437
795
  "totals": z$1.array(z$1.object({
438
- "type": z$1.enum([
439
- "items_discount",
440
- "subtotal",
441
- "discount",
442
- "fulfillment",
443
- "tax",
444
- "fee",
445
- "total"
446
- ]).describe("Type of total categorization."),
796
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
447
797
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
448
- "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.")
449
- })).describe("Line item totals breakdown."),
798
+ "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).")
799
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
450
800
  "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
451
801
  }).describe("Line item object. Expected to use the currency of the parent object.")).describe("List of line items being checked out."),
452
802
  "buyer": z$1.object({
@@ -458,8 +808,16 @@ const CheckoutUpdateRequestSchema = z$1.object({
458
808
  "context": z$1.object({
459
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(),
460
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(),
461
- "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()
462
- }).passthrough().describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.").optional(),
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(),
463
821
  "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
464
822
  "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
465
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."),
@@ -479,38 +837,46 @@ const CheckoutUpdateRequestSchema = z$1.object({
479
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()
480
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()
481
839
  }).strict();
482
- const CheckoutCompleteRequestSchema = z$1.object({ "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
483
- "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
484
- "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."),
485
- "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."),
486
- "billing_address": z$1.object({
487
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
488
- "street_address": z$1.string().describe("The street address.").optional(),
489
- "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(),
490
- "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(),
491
- "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(),
492
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
493
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
494
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
495
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
496
- }).describe("The billing address associated with this payment method.").optional(),
497
- "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(),
498
- "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()
499
- }).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.") }).strict();
840
+ const CheckoutCompleteRequestSchema = z$1.object({
841
+ "signals": z$1.object({
842
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
843
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
844
+ }).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(),
845
+ "payment": z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
846
+ "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
847
+ "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."),
848
+ "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."),
849
+ "billing_address": z$1.object({
850
+ "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
851
+ "street_address": z$1.string().describe("The street address.").optional(),
852
+ "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(),
853
+ "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(),
854
+ "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(),
855
+ "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
856
+ "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
857
+ "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
858
+ "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
859
+ }).describe("The billing address associated with this payment method.").optional(),
860
+ "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(),
861
+ "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()
862
+ }).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.")
863
+ }).strict();
500
864
  const DiscountAllocationSchema = z$1.object({
501
865
  "path": z$1.string().describe("JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping')."),
502
- "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in minor (cents) currency units.")
866
+ "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in ISO 4217 minor units.")
503
867
  }).describe("Breakdown of how a discount amount was allocated to a specific target.");
504
868
  const DiscountAppliedDiscountSchema = z$1.object({
505
869
  "code": z$1.string().describe("The discount code. Omitted for automatic discounts.").optional(),
506
870
  "title": z$1.string().describe("Human-readable discount name (e.g., 'Summer Sale 20% Off')."),
507
- "amount": z$1.number().int().gte(0).describe("Total discount amount in minor (cents) currency units."),
871
+ "amount": z$1.number().int().gte(0).describe("Total discount amount in ISO 4217 minor units."),
508
872
  "automatic": z$1.boolean().describe("True if applied automatically by merchant rules (no code required).").default(false),
509
873
  "method": z$1.enum(["each", "across"]).describe("Allocation method. 'each' = applied independently per item. 'across' = split proportionally by value.").optional(),
510
874
  "priority": z$1.number().int().gte(1).describe("Stacking order for discount calculation. Lower numbers applied first (1 = first).").optional(),
875
+ "provisional": z$1.boolean().describe("True if this discount requires additional verification.").default(false),
876
+ "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(),
511
877
  "allocations": z$1.array(z$1.object({
512
878
  "path": z$1.string().describe("JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping')."),
513
- "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in minor (cents) currency units.")
879
+ "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in ISO 4217 minor units.")
514
880
  }).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()
515
881
  }).describe("A discount that was successfully applied.");
516
882
  const DiscountDiscountsObjectSchema = z$1.object({
@@ -518,13 +884,15 @@ const DiscountDiscountsObjectSchema = z$1.object({
518
884
  "applied": z$1.array(z$1.object({
519
885
  "code": z$1.string().describe("The discount code. Omitted for automatic discounts.").optional(),
520
886
  "title": z$1.string().describe("Human-readable discount name (e.g., 'Summer Sale 20% Off')."),
521
- "amount": z$1.number().int().gte(0).describe("Total discount amount in minor (cents) currency units."),
887
+ "amount": z$1.number().int().gte(0).describe("Total discount amount in ISO 4217 minor units."),
522
888
  "automatic": z$1.boolean().describe("True if applied automatically by merchant rules (no code required).").default(false),
523
889
  "method": z$1.enum(["each", "across"]).describe("Allocation method. 'each' = applied independently per item. 'across' = split proportionally by value.").optional(),
524
890
  "priority": z$1.number().int().gte(1).describe("Stacking order for discount calculation. Lower numbers applied first (1 = first).").optional(),
891
+ "provisional": z$1.boolean().describe("True if this discount requires additional verification.").default(false),
892
+ "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(),
525
893
  "allocations": z$1.array(z$1.object({
526
894
  "path": z$1.string().describe("JSONPath to the allocation target (e.g., '$.line_items[0]', '$.totals.shipping')."),
527
- "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in minor (cents) currency units.")
895
+ "amount": z$1.number().int().gte(0).describe("Amount allocated to this target in ISO 4217 minor units.")
528
896
  }).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()
529
897
  }).describe("A discount that was successfully applied.")).describe("Discounts successfully applied (code-based and automatic).").readonly().optional()
530
898
  }).describe("Discount codes input and applied discounts output.");
@@ -536,18 +904,10 @@ const FulfillmentExtensionFulfillmentOptionSchema = z$1.object({
536
904
  "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
537
905
  "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
538
906
  "totals": z$1.array(z$1.object({
539
- "type": z$1.enum([
540
- "items_discount",
541
- "subtotal",
542
- "discount",
543
- "fulfillment",
544
- "tax",
545
- "fee",
546
- "total"
547
- ]).describe("Type of total categorization."),
907
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
548
908
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
549
- "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.")
550
- })).describe("Fulfillment option totals breakdown.")
909
+ "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).")
910
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
551
911
  }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).");
552
912
  const FulfillmentExtensionFulfillmentGroupSchema = z$1.object({
553
913
  "id": z$1.string().describe("Group identifier for referencing merchant-generated groups in updates."),
@@ -560,18 +920,10 @@ const FulfillmentExtensionFulfillmentGroupSchema = z$1.object({
560
920
  "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
561
921
  "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
562
922
  "totals": z$1.array(z$1.object({
563
- "type": z$1.enum([
564
- "items_discount",
565
- "subtotal",
566
- "discount",
567
- "fulfillment",
568
- "tax",
569
- "fee",
570
- "total"
571
- ]).describe("Type of total categorization."),
923
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
572
924
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
573
- "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.")
574
- })).describe("Fulfillment option totals breakdown.")
925
+ "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).")
926
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
575
927
  }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
576
928
  "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()
577
929
  }).passthrough().describe("A merchant-generated package/group of line items with fulfillment options.");
@@ -630,18 +982,10 @@ const FulfillmentExtensionFulfillmentMethodSchema = z$1.object({
630
982
  "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
631
983
  "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
632
984
  "totals": z$1.array(z$1.object({
633
- "type": z$1.enum([
634
- "items_discount",
635
- "subtotal",
636
- "discount",
637
- "fulfillment",
638
- "tax",
639
- "fee",
640
- "total"
641
- ]).describe("Type of total categorization."),
985
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
642
986
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
643
- "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.")
644
- })).describe("Fulfillment option totals breakdown.")
987
+ "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).")
988
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
645
989
  }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
646
990
  "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()
647
991
  }).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()
@@ -708,18 +1052,10 @@ const FulfillmentExtensionFulfillmentSchema = z$1.object({
708
1052
  "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
709
1053
  "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
710
1054
  "totals": z$1.array(z$1.object({
711
- "type": z$1.enum([
712
- "items_discount",
713
- "subtotal",
714
- "discount",
715
- "fulfillment",
716
- "tax",
717
- "fee",
718
- "total"
719
- ]).describe("Type of total categorization."),
1055
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
720
1056
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
721
- "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.")
722
- })).describe("Fulfillment option totals breakdown.")
1057
+ "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).")
1058
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
723
1059
  }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
724
1060
  "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()
725
1061
  }).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()
@@ -734,6 +1070,7 @@ const FulfillmentExtensionFulfillmentSchema = z$1.object({
734
1070
  const OrderSchema = z$1.object({
735
1071
  "ucp": z$1.intersection(z$1.object({
736
1072
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1073
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
737
1074
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
738
1075
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
739
1076
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -755,56 +1092,82 @@ const OrderSchema = z$1.object({
755
1092
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
756
1093
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
757
1094
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
758
- }).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(),
1095
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
1096
+ 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)];
1097
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1098
+ const passed = schemas.length - errors.length;
1099
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1100
+ path: ctx.path,
1101
+ code: "invalid_union",
1102
+ unionErrors: errors,
1103
+ message: "Invalid input: Should pass single schema. Passed " + passed
1104
+ } : {
1105
+ path: ctx.path,
1106
+ code: "custom",
1107
+ message: "Invalid input: Should pass single schema. Passed " + passed
1108
+ });
1109
+ }).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(),
759
1110
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
760
1111
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
761
1112
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
762
1113
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
763
1114
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
764
1115
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
765
- }).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()
1116
+ }).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({
1117
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
1118
+ "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()
1119
+ }).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()
766
1120
  }).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({
767
1121
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
768
1122
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
769
1123
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
770
1124
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
771
1125
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
772
- }).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."),
1126
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
1127
+ 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)];
1128
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1129
+ const passed = schemas.length - errors.length;
1130
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1131
+ path: ctx.path,
1132
+ code: "invalid_union",
1133
+ unionErrors: errors,
1134
+ message: "Invalid input: Should pass single schema. Passed " + passed
1135
+ } : {
1136
+ path: ctx.path,
1137
+ code: "custom",
1138
+ message: "Invalid input: Should pass single schema. Passed " + passed
1139
+ });
1140
+ }).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."),
773
1141
  "id": z$1.string().describe("Unique order identifier."),
1142
+ "label": z$1.string().describe("Human-readable label for identifying the order. MUST only be provided by the business.").optional(),
774
1143
  "checkout_id": z$1.string().describe("Associated checkout ID for reconciliation."),
775
1144
  "permalink_url": z$1.string().url().describe("Permalink to access the order on merchant site."),
776
1145
  "line_items": z$1.array(z$1.object({
777
1146
  "id": z$1.string().describe("Line item identifier."),
778
1147
  "item": z$1.object({
779
- "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."),
1148
+ "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."),
780
1149
  "title": z$1.string().describe("Product title."),
781
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
1150
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
782
1151
  "image_url": z$1.string().url().describe("Product image URI.").optional()
783
1152
  }).describe("Product data (id, title, price, image_url)."),
784
1153
  "quantity": z$1.object({
785
- "total": z$1.number().int().gte(0).describe("Current total quantity."),
786
- "fulfilled": z$1.number().int().gte(0).describe("Quantity fulfilled (sum from fulfillment events).")
787
- }).describe("Quantity tracking. Both total and fulfilled are derived from events."),
1154
+ "original": z$1.number().int().gte(0).describe("Quantity from the original checkout.").optional(),
1155
+ "total": z$1.number().int().gte(0).describe("Current total active quantity. May differ from original due to post-order modifications (e.g., returns or cancellations)."),
1156
+ "fulfilled": z$1.number().int().gte(0).describe("Quantity fulfilled so far.")
1157
+ }).describe("Quantity tracking for the line item."),
788
1158
  "totals": z$1.array(z$1.object({
789
- "type": z$1.enum([
790
- "items_discount",
791
- "subtotal",
792
- "discount",
793
- "fulfillment",
794
- "tax",
795
- "fee",
796
- "total"
797
- ]).describe("Type of total categorization."),
1159
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
798
1160
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
799
- "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.")
800
- })).describe("Line item totals breakdown."),
1161
+ "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).")
1162
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
801
1163
  "status": z$1.enum([
802
1164
  "processing",
803
1165
  "partial",
804
- "fulfilled"
805
- ]).describe("Derived status: fulfilled if quantity.fulfilled == quantity.total, partial if quantity.fulfilled > 0, otherwise processing."),
1166
+ "fulfilled",
1167
+ "removed"
1168
+ ]).describe("Derived status: removed if quantity.total == 0, fulfilled if quantity.total > 0 and quantity.fulfilled == quantity.total, partial if quantity.total > 0 and quantity.fulfilled > 0, otherwise processing."),
806
1169
  "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
807
- })).describe("Immutable line items — source of truth for what was ordered."),
1170
+ })).describe("Line items representing what was purchased can change post-order via edits or exchanges."),
808
1171
  "fulfillment": z$1.object({
809
1172
  "expectations": z$1.array(z$1.object({
810
1173
  "id": z$1.string().describe("Expectation identifier."),
@@ -856,25 +1219,71 @@ const OrderSchema = z$1.object({
856
1219
  ]).describe("Adjustment status."),
857
1220
  "line_items": z$1.array(z$1.object({
858
1221
  "id": z$1.string().describe("Line item ID reference."),
859
- "quantity": z$1.number().int().gte(1).describe("Quantity affected by this adjustment.")
1222
+ "quantity": z$1.number().int().describe("Signed quantity affected by this adjustment. Negative values represent reductions (e.g. returns); positive values represent additions (e.g. exchanges).")
860
1223
  })).describe("Which line items and quantities are affected (optional).").optional(),
861
- "amount": z$1.number().int().describe("Amount in minor units (cents) for refunds, credits, price adjustments (optional).").optional(),
1224
+ "totals": z$1.array(z$1.object({
1225
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1226
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1227
+ "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).")
1228
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Adjustment totals breakdown. Signed values - negative for money returned to buyer (refunds, credits), positive for additional charges (exchanges).").optional(),
862
1229
  "description": z$1.string().describe("Human-readable reason or description (e.g., 'Defective item', 'Customer requested').").optional()
863
- }).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(),
864
- "totals": z$1.array(z$1.object({
865
- "type": z$1.enum([
866
- "items_discount",
867
- "subtotal",
868
- "discount",
869
- "fulfillment",
870
- "tax",
871
- "fee",
872
- "total"
873
- ]).describe("Type of total categorization."),
1230
+ }).describe("Post-order 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("Post-order events (refunds, returns, credits, disputes, cancellations, etc.) that exist independently of fulfillment.").optional(),
1231
+ "currency": z$1.string().describe("ISO 4217 currency code. MUST match the currency from the originating checkout session."),
1232
+ "totals": z$1.array(z$1.intersection(z$1.object({
1233
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
874
1234
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
875
- "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.")
876
- })).describe("Different totals for the order.")
877
- }).describe("Order schema with immutable line items, buyer-facing fulfillment expectations, and append-only event logs.");
1235
+ "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).")
1236
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text."), z$1.intersection(z$1.object({ "lines": z$1.array(z$1.object({
1237
+ "display_text": z$1.string().describe("Human-readable label for this sub-line."),
1238
+ "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).")
1239
+ }).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() }), z$1.any()))).describe("Different totals for the order."),
1240
+ "messages": z$1.array(z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
1241
+ const schemas = [
1242
+ z$1.object({
1243
+ "type": z$1.literal("error").describe("Message type discriminator."),
1244
+ "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."),
1245
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
1246
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1247
+ "content": z$1.string().describe("Human-readable message."),
1248
+ "severity": z$1.enum([
1249
+ "recoverable",
1250
+ "requires_buyer_input",
1251
+ "requires_buyer_review",
1252
+ "unrecoverable"
1253
+ ]).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'.")
1254
+ }),
1255
+ z$1.object({
1256
+ "type": z$1.literal("warning").describe("Message type discriminator."),
1257
+ "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
1258
+ "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
1259
+ "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
1260
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1261
+ "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"),
1262
+ "image_url": z$1.string().url().describe("URL to a required visual element (e.g., warning symbol, energy class label).").optional(),
1263
+ "url": z$1.string().url().describe("Reference URL for more information (e.g., regulatory site, registry entry, policy page).").optional()
1264
+ }),
1265
+ z$1.object({
1266
+ "type": z$1.literal("info").describe("Message type discriminator."),
1267
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to.").optional(),
1268
+ "code": z$1.string().describe("Info code for programmatic handling.").optional(),
1269
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1270
+ "content": z$1.string().describe("Human-readable message.")
1271
+ })
1272
+ ];
1273
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1274
+ const passed = schemas.length - errors.length;
1275
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1276
+ path: ctx.path,
1277
+ code: "invalid_union",
1278
+ unionErrors: errors,
1279
+ message: "Invalid input: Should pass single schema. Passed " + passed
1280
+ } : {
1281
+ path: ctx.path,
1282
+ code: "custom",
1283
+ message: "Invalid input: Should pass single schema. Passed " + passed
1284
+ });
1285
+ })).describe("Container for error, warning, or info messages.")).describe("Business outcome messages (errors, warnings, informational). Present when the business needs to communicate status or issues to the platform.").optional()
1286
+ }).describe("Order schema with line items, buyer-facing fulfillment expectations, and event logs.");
878
1287
  const PaymentSchema = z$1.object({ "instruments": z$1.array(z$1.intersection(z$1.object({
879
1288
  "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
880
1289
  "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."),
@@ -905,11 +1314,20 @@ const AdjustmentSchema = z$1.object({
905
1314
  ]).describe("Adjustment status."),
906
1315
  "line_items": z$1.array(z$1.object({
907
1316
  "id": z$1.string().describe("Line item ID reference."),
908
- "quantity": z$1.number().int().gte(1).describe("Quantity affected by this adjustment.")
1317
+ "quantity": z$1.number().int().describe("Signed quantity affected by this adjustment. Negative values represent reductions (e.g. returns); positive values represent additions (e.g. exchanges).")
909
1318
  })).describe("Which line items and quantities are affected (optional).").optional(),
910
- "amount": z$1.number().int().describe("Amount in minor units (cents) for refunds, credits, price adjustments (optional).").optional(),
1319
+ "totals": z$1.array(z$1.object({
1320
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1321
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1322
+ "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).")
1323
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Adjustment totals breakdown. Signed values - negative for money returned to buyer (refunds, credits), positive for additional charges (exchanges).").optional(),
911
1324
  "description": z$1.string().describe("Human-readable reason or description (e.g., 'Defective item', 'Customer requested').").optional()
912
- }).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.");
1325
+ }).describe("Post-order 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.");
1326
+ 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).");
1327
+ const AvailablePaymentInstrumentSchema = z$1.object({
1328
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
1329
+ "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()
1330
+ }).describe("An instrument type available from a payment handler with optional constraints.");
913
1331
  const BindingSchema = z$1.object({
914
1332
  "checkout_id": z$1.string().describe("The checkout session identifier this token is bound to."),
915
1333
  "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()
@@ -942,39 +1360,138 @@ const CardCredentialSchema = z$1.intersection(z$1.object({ "type": z$1.string().
942
1360
  "cryptogram": z$1.string().describe("Cryptogram provided with network tokens.").optional(),
943
1361
  "eci_value": z$1.string().describe("Electronic Commerce Indicator / Security Level Indicator provided with network tokens.").optional()
944
1362
  })).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.");
945
- const CardPaymentInstrumentSchema = z$1.intersection(z$1.object({
946
- "id": z$1.string().describe("A unique identifier for this instrument instance, assigned by the platform."),
947
- "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."),
948
- "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."),
949
- "billing_address": z$1.object({
950
- "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
951
- "street_address": z$1.string().describe("The street address.").optional(),
952
- "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(),
953
- "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(),
954
- "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(),
955
- "postal_code": z$1.string().describe("The postal code. For example, 94043.").optional(),
956
- "first_name": z$1.string().describe("Optional. First name of the contact associated with the address.").optional(),
957
- "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
958
- "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
959
- }).describe("The billing address associated with this payment method.").optional(),
960
- "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(),
961
- "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()
962
- }).passthrough().describe("The base definition for any payment instrument. It links the instrument to a specific payment handler."), z$1.object({
963
- "type": z$1.literal("card").describe("Indicates this is a card payment instrument."),
964
- "display": z$1.object({
965
- "brand": z$1.string().describe("The card brand/network (e.g., visa, mastercard, amex).").optional(),
966
- "last_digits": z$1.string().describe("Last 4 digits of the card number.").optional(),
967
- "expiry_month": z$1.number().int().describe("The month of the card's expiration date (1-12).").optional(),
968
- "expiry_year": z$1.number().int().describe("The year of the card's expiration date.").optional(),
969
- "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(),
970
- "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()
971
- }).describe("Display information for this card payment instrument.").optional()
972
- })).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.");
1363
+ const CardPaymentInstrumentAvailableCardPaymentInstrumentSchema = z$1.intersection(z$1.object({
1364
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
1365
+ "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()
1366
+ }).describe("An instrument type available from a payment handler with optional constraints."), z$1.object({
1367
+ "type": z$1.literal("card").optional(),
1368
+ "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()
1369
+ })).describe("Declares card instrument availability with card-specific constraints.");
1370
+ const CategorySchema = z$1.object({
1371
+ "value": z$1.string().describe("Category value or path (e.g., 'Apparel > Shirts', '1604')."),
1372
+ "taxonomy": z$1.string().describe("Source taxonomy. Well-known values: `google_product_category`, `shopify`, `merchant`.").optional()
1373
+ }).describe("A product category with optional taxonomy identifier.");
973
1374
  const ContextSchema = z$1.object({
974
1375
  "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(),
975
1376
  "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(),
976
- "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()
977
- }).passthrough().describe("Provisional buyer signals for relevance and localization: product availability, pricing, currency, tax, shipping, payment methods, and eligibility (e.g., student or affiliation discounts). Businesses SHOULD use these values when authoritative data (e.g., address) is absent, and MAY ignore unsupported values without returning errors. Context can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context. Platforms SHOULD progressively enhance context throughout the buyer journey.");
1377
+ "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(),
1378
+ "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(),
1379
+ "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(),
1380
+ "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(),
1381
+ "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()
1382
+ }).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.");
1383
+ const DescriptionSchema = z$1.object({
1384
+ "plain": z$1.string().describe("Plain text content.").optional(),
1385
+ "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(),
1386
+ "markdown": z$1.string().describe("Markdown-formatted content.").optional()
1387
+ }).describe("Description content in one or more formats. At least one format must be provided.");
1388
+ const DetailOptionValueSchema = z$1.object({
1389
+ "available": z$1.boolean().describe("Whether a variant matching this value and the current option selections is purchasable.").optional(),
1390
+ "exists": z$1.boolean().describe("Whether a variant matching this value and the current option selections exists in the catalog.").optional()
1391
+ }).and(z$1.object({
1392
+ "id": z$1.string().describe("Optional server-assigned identifier for this option value. When present in a selected_option, the server SHOULD use it for matching instead of label.").optional(),
1393
+ "label": z$1.string().describe("Display text for this option value (e.g., 'Small', 'Blue').")
1394
+ }).describe("A selectable value for a product option.")).describe("An option value with availability signals relative to the current selections. Used in get_product responses where selected context exists.");
1395
+ 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.");
1396
+ const ErrorResponseSchema = z$1.object({
1397
+ "ucp": z$1.intersection(z$1.object({
1398
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1399
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1400
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1401
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1402
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1403
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1404
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1405
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1406
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
1407
+ "transport": z$1.enum([
1408
+ "rest",
1409
+ "mcp",
1410
+ "a2a",
1411
+ "embedded"
1412
+ ]).describe("Transport protocol for this service binding."),
1413
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
1414
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
1415
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1416
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1417
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1418
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1419
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1420
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1421
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
1422
+ 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)];
1423
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1424
+ const passed = schemas.length - errors.length;
1425
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1426
+ path: ctx.path,
1427
+ code: "invalid_union",
1428
+ unionErrors: errors,
1429
+ message: "Invalid input: Should pass single schema. Passed " + passed
1430
+ } : {
1431
+ path: ctx.path,
1432
+ code: "custom",
1433
+ message: "Invalid input: Should pass single schema. Passed " + passed
1434
+ });
1435
+ }).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(),
1436
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1437
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1438
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1439
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1440
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1441
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1442
+ }).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({
1443
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
1444
+ "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()
1445
+ }).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()
1446
+ }).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."),
1447
+ "messages": z$1.array(z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().superRefine((x, ctx) => {
1448
+ const schemas = [
1449
+ z$1.object({
1450
+ "type": z$1.literal("error").describe("Message type discriminator."),
1451
+ "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."),
1452
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
1453
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1454
+ "content": z$1.string().describe("Human-readable message."),
1455
+ "severity": z$1.enum([
1456
+ "recoverable",
1457
+ "requires_buyer_input",
1458
+ "requires_buyer_review",
1459
+ "unrecoverable"
1460
+ ]).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'.")
1461
+ }),
1462
+ z$1.object({
1463
+ "type": z$1.literal("warning").describe("Message type discriminator."),
1464
+ "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
1465
+ "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
1466
+ "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
1467
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1468
+ "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"),
1469
+ "image_url": z$1.string().url().describe("URL to a required visual element (e.g., warning symbol, energy class label).").optional(),
1470
+ "url": z$1.string().url().describe("Reference URL for more information (e.g., regulatory site, registry entry, policy page).").optional()
1471
+ }),
1472
+ z$1.object({
1473
+ "type": z$1.literal("info").describe("Message type discriminator."),
1474
+ "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to.").optional(),
1475
+ "code": z$1.string().describe("Info code for programmatic handling.").optional(),
1476
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1477
+ "content": z$1.string().describe("Human-readable message.")
1478
+ })
1479
+ ];
1480
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
1481
+ const passed = schemas.length - errors.length;
1482
+ if (passed !== 1) ctx.addIssue(errors.length ? {
1483
+ path: ctx.path,
1484
+ code: "invalid_union",
1485
+ unionErrors: errors,
1486
+ message: "Invalid input: Should pass single schema. Passed " + passed
1487
+ } : {
1488
+ path: ctx.path,
1489
+ code: "custom",
1490
+ message: "Invalid input: Should pass single schema. Passed " + passed
1491
+ });
1492
+ })).describe("Container for error, warning, or info messages.")).min(1).describe("Array of messages describing why the operation failed."),
1493
+ "continue_url": z$1.string().url().describe("URL for buyer handoff or session recovery.").optional()
1494
+ }).strict().describe("Generic error response when business logic prevents resource creation or failed to retrieve resource. Used when no valid resource can be established.");
978
1495
  const ExpectationSchema = z$1.object({
979
1496
  "id": z$1.string().describe("Expectation identifier."),
980
1497
  "line_items": z$1.array(z$1.object({
@@ -1056,18 +1573,10 @@ const FulfillmentSchema = z$1.object({
1056
1573
  "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1057
1574
  "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1058
1575
  "totals": z$1.array(z$1.object({
1059
- "type": z$1.enum([
1060
- "items_discount",
1061
- "subtotal",
1062
- "discount",
1063
- "fulfillment",
1064
- "tax",
1065
- "fee",
1066
- "total"
1067
- ]).describe("Type of total categorization."),
1576
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1068
1577
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1069
- "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.")
1070
- })).describe("Fulfillment option totals breakdown.")
1578
+ "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).")
1579
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
1071
1580
  }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1072
1581
  "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()
1073
1582
  }).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()
@@ -1148,18 +1657,10 @@ const FulfillmentGroupSchema = z$1.object({
1148
1657
  "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1149
1658
  "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1150
1659
  "totals": z$1.array(z$1.object({
1151
- "type": z$1.enum([
1152
- "items_discount",
1153
- "subtotal",
1154
- "discount",
1155
- "fulfillment",
1156
- "tax",
1157
- "fee",
1158
- "total"
1159
- ]).describe("Type of total categorization."),
1660
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1160
1661
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1161
- "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.")
1162
- })).describe("Fulfillment option totals breakdown.")
1662
+ "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).")
1663
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
1163
1664
  }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1164
1665
  "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()
1165
1666
  }).passthrough().describe("A merchant-generated package/group of line items with fulfillment options.");
@@ -1219,18 +1720,10 @@ const FulfillmentMethodSchema = z$1.object({
1219
1720
  "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1220
1721
  "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1221
1722
  "totals": z$1.array(z$1.object({
1222
- "type": z$1.enum([
1223
- "items_discount",
1224
- "subtotal",
1225
- "discount",
1226
- "fulfillment",
1227
- "tax",
1228
- "fee",
1229
- "total"
1230
- ]).describe("Type of total categorization."),
1723
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1231
1724
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1232
- "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.")
1233
- })).describe("Fulfillment option totals breakdown.")
1725
+ "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).")
1726
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
1234
1727
  }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).")).describe("Available fulfillment options for this group.").optional(),
1235
1728
  "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()
1236
1729
  }).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()
@@ -1240,7 +1733,8 @@ const FulfillmentMethodCreateRequestSchema = z$1.object({
1240
1733
  "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs fulfilled via this method.").optional()
1241
1734
  }).strict();
1242
1735
  const FulfillmentMethodUpdateRequestSchema = z$1.object({
1243
- "id": z$1.string().describe("Unique fulfillment method identifier."),
1736
+ "id": z$1.string().describe("Unique fulfillment method identifier.").optional(),
1737
+ "type": z$1.enum(["shipping", "pickup"]).describe("Fulfillment method type.").optional(),
1244
1738
  "line_item_ids": z$1.array(z$1.string()).describe("Line item IDs fulfilled via this method.")
1245
1739
  }).strict();
1246
1740
  const FulfillmentOptionSchema = z$1.object({
@@ -1251,47 +1745,35 @@ const FulfillmentOptionSchema = z$1.object({
1251
1745
  "earliest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Earliest fulfillment date.").optional(),
1252
1746
  "latest_fulfillment_time": z$1.string().datetime({ offset: true }).describe("Latest fulfillment date.").optional(),
1253
1747
  "totals": z$1.array(z$1.object({
1254
- "type": z$1.enum([
1255
- "items_discount",
1256
- "subtotal",
1257
- "discount",
1258
- "fulfillment",
1259
- "tax",
1260
- "fee",
1261
- "total"
1262
- ]).describe("Type of total categorization."),
1748
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1263
1749
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1264
- "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.")
1265
- })).describe("Fulfillment option totals breakdown.")
1750
+ "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).")
1751
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Fulfillment option totals breakdown.")
1266
1752
  }).passthrough().describe("A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).");
1753
+ const InputCorrelationSchema = z$1.object({
1754
+ "id": z$1.string().describe("The identifier from the lookup request that resolved to this variant."),
1755
+ "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()
1756
+ }).describe("Maps a request identifier to the variant it resolved to, with match semantics.");
1267
1757
  const ItemSchema = z$1.object({
1268
- "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."),
1758
+ "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."),
1269
1759
  "title": z$1.string().describe("Product title."),
1270
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
1760
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
1271
1761
  "image_url": z$1.string().url().describe("Product image URI.").optional()
1272
1762
  });
1273
1763
  const LineItemSchema = z$1.object({
1274
1764
  "id": z$1.string(),
1275
1765
  "item": z$1.object({
1276
- "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."),
1766
+ "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."),
1277
1767
  "title": z$1.string().describe("Product title."),
1278
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
1768
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
1279
1769
  "image_url": z$1.string().url().describe("Product image URI.").optional()
1280
1770
  }),
1281
1771
  "quantity": z$1.number().int().gte(1).describe("Quantity of the item being purchased."),
1282
1772
  "totals": z$1.array(z$1.object({
1283
- "type": z$1.enum([
1284
- "items_discount",
1285
- "subtotal",
1286
- "discount",
1287
- "fulfillment",
1288
- "tax",
1289
- "fee",
1290
- "total"
1291
- ]).describe("Type of total categorization."),
1773
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1292
1774
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1293
- "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.")
1294
- })).describe("Line item totals breakdown."),
1775
+ "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).")
1776
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
1295
1777
  "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
1296
1778
  }).describe("Line item object. Expected to use the currency of the parent object.");
1297
1779
  const LineItemUpdateRequestSchema = z$1.object({
@@ -1303,6 +1785,13 @@ const LinkSchema = z$1.object({
1303
1785
  "url": z$1.string().url().describe("The actual URL pointing to the content to be displayed."),
1304
1786
  "title": z$1.string().describe("Optional display text for the link. When provided, use this instead of generating from type.").optional()
1305
1787
  });
1788
+ const MediaSchema = z$1.object({
1789
+ "type": z$1.string().describe("Media type. Well-known values: `image`, `video`, `model_3d`."),
1790
+ "url": z$1.string().url().describe("URL to the media resource."),
1791
+ "alt_text": z$1.string().describe("Accessibility text describing the media.").optional(),
1792
+ "width": z$1.number().int().gte(1).describe("Width in pixels (for images/video).").optional(),
1793
+ "height": z$1.number().int().gte(1).describe("Height in pixels (for images/video).").optional()
1794
+ }).describe("Product media item (image, video, etc.).");
1306
1795
  const MerchantFulfillmentConfigSchema = z$1.object({
1307
1796
  "allows_multi_destination": z$1.object({
1308
1797
  "shipping": z$1.boolean().describe("Multiple shipping destinations allowed.").optional(),
@@ -1314,22 +1803,26 @@ const MessageSchema = z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().
1314
1803
  const schemas = [
1315
1804
  z$1.object({
1316
1805
  "type": z$1.literal("error").describe("Message type discriminator."),
1317
- "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."),
1806
+ "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."),
1318
1807
  "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
1319
1808
  "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1320
1809
  "content": z$1.string().describe("Human-readable message."),
1321
1810
  "severity": z$1.enum([
1322
1811
  "recoverable",
1323
1812
  "requires_buyer_input",
1324
- "requires_buyer_review"
1325
- ]).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'.")
1813
+ "requires_buyer_review",
1814
+ "unrecoverable"
1815
+ ]).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'.")
1326
1816
  }),
1327
1817
  z$1.object({
1328
1818
  "type": z$1.literal("warning").describe("Message type discriminator."),
1329
1819
  "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
1330
1820
  "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
1331
1821
  "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
1332
- "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain")
1822
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1823
+ "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"),
1824
+ "image_url": z$1.string().url().describe("URL to a required visual element (e.g., warning symbol, energy class label).").optional(),
1825
+ "url": z$1.string().url().describe("Reference URL for more information (e.g., regulatory site, registry entry, policy page).").optional()
1333
1826
  }),
1334
1827
  z$1.object({
1335
1828
  "type": z$1.literal("info").describe("Message type discriminator."),
@@ -1354,15 +1847,16 @@ const MessageSchema = z$1.record(z$1.string(), z$1.unknown()).and(z$1.unknown().
1354
1847
  })).describe("Container for error, warning, or info messages.");
1355
1848
  const MessageErrorSchema = z$1.object({
1356
1849
  "type": z$1.literal("error").describe("Message type discriminator."),
1357
- "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."),
1850
+ "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."),
1358
1851
  "path": z$1.string().describe("RFC 9535 JSONPath to the component the message refers to (e.g., $.items[1]).").optional(),
1359
1852
  "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1360
1853
  "content": z$1.string().describe("Human-readable message."),
1361
1854
  "severity": z$1.enum([
1362
1855
  "recoverable",
1363
1856
  "requires_buyer_input",
1364
- "requires_buyer_review"
1365
- ]).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'.")
1857
+ "requires_buyer_review",
1858
+ "unrecoverable"
1859
+ ]).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'.")
1366
1860
  });
1367
1861
  const MessageInfoSchema = z$1.object({
1368
1862
  "type": z$1.literal("info").describe("Message type discriminator."),
@@ -1376,44 +1870,47 @@ const MessageWarningSchema = z$1.object({
1376
1870
  "path": z$1.string().describe("JSONPath (RFC 9535) to related field (e.g., $.line_items[0]).").optional(),
1377
1871
  "code": z$1.string().describe("Warning code. Machine-readable identifier for the warning type (e.g., final_sale, prop65, fulfillment_changed, age_restricted, etc.)."),
1378
1872
  "content": z$1.string().describe("Human-readable warning message that MUST be displayed."),
1379
- "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain")
1873
+ "content_type": z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.").default("plain"),
1874
+ "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"),
1875
+ "image_url": z$1.string().url().describe("URL to a required visual element (e.g., warning symbol, energy class label).").optional(),
1876
+ "url": z$1.string().url().describe("Reference URL for more information (e.g., regulatory site, registry entry, policy page).").optional()
1380
1877
  });
1878
+ const OptionValueSchema = z$1.object({
1879
+ "id": z$1.string().describe("Optional server-assigned identifier for this option value. When present in a selected_option, the server SHOULD use it for matching instead of label.").optional(),
1880
+ "label": z$1.string().describe("Display text for this option value (e.g., 'Small', 'Blue').")
1881
+ }).describe("A selectable value for a product option.");
1381
1882
  const OrderConfirmationSchema = z$1.object({
1382
1883
  "id": z$1.string().describe("Unique order identifier."),
1884
+ "label": z$1.string().describe("Human-readable label for identifying the order. MUST only be provided by the business.").optional(),
1383
1885
  "permalink_url": z$1.string().url().describe("Permalink to access the order on merchant site.")
1384
1886
  }).describe("Order details available at the time of checkout completion.");
1385
1887
  const OrderLineItemSchema = z$1.object({
1386
1888
  "id": z$1.string().describe("Line item identifier."),
1387
1889
  "item": z$1.object({
1388
- "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."),
1890
+ "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."),
1389
1891
  "title": z$1.string().describe("Product title."),
1390
- "price": z$1.number().int().gte(0).describe("Unit price in minor (cents) currency units."),
1892
+ "price": z$1.number().int().gte(0).describe("Unit price in ISO 4217 minor units."),
1391
1893
  "image_url": z$1.string().url().describe("Product image URI.").optional()
1392
1894
  }).describe("Product data (id, title, price, image_url)."),
1393
1895
  "quantity": z$1.object({
1394
- "total": z$1.number().int().gte(0).describe("Current total quantity."),
1395
- "fulfilled": z$1.number().int().gte(0).describe("Quantity fulfilled (sum from fulfillment events).")
1396
- }).describe("Quantity tracking. Both total and fulfilled are derived from events."),
1896
+ "original": z$1.number().int().gte(0).describe("Quantity from the original checkout.").optional(),
1897
+ "total": z$1.number().int().gte(0).describe("Current total active quantity. May differ from original due to post-order modifications (e.g., returns or cancellations)."),
1898
+ "fulfilled": z$1.number().int().gte(0).describe("Quantity fulfilled so far.")
1899
+ }).describe("Quantity tracking for the line item."),
1397
1900
  "totals": z$1.array(z$1.object({
1398
- "type": z$1.enum([
1399
- "items_discount",
1400
- "subtotal",
1401
- "discount",
1402
- "fulfillment",
1403
- "tax",
1404
- "fee",
1405
- "total"
1406
- ]).describe("Type of total categorization."),
1901
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1407
1902
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1408
- "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.")
1409
- })).describe("Line item totals breakdown."),
1903
+ "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).")
1904
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.")).describe("Line item totals breakdown."),
1410
1905
  "status": z$1.enum([
1411
1906
  "processing",
1412
1907
  "partial",
1413
- "fulfilled"
1414
- ]).describe("Derived status: fulfilled if quantity.fulfilled == quantity.total, partial if quantity.fulfilled > 0, otherwise processing."),
1908
+ "fulfilled",
1909
+ "removed"
1910
+ ]).describe("Derived status: removed if quantity.total == 0, fulfilled if quantity.total > 0 and quantity.fulfilled == quantity.total, partial if quantity.total > 0 and quantity.fulfilled > 0, otherwise processing."),
1415
1911
  "parent_id": z$1.string().describe("Parent line item identifier for any nested structures.").optional()
1416
1912
  });
1913
+ const PaginationSchema = z$1.record(z$1.string(), z$1.unknown()).describe("Cursor-based pagination for list operations.");
1417
1914
  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.");
1418
1915
  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.");
1419
1916
  const PaymentInstrumentSchema = z$1.object({
@@ -1446,6 +1943,166 @@ const PostalAddressSchema = z$1.object({
1446
1943
  "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1447
1944
  "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1448
1945
  });
1946
+ const PriceSchema = z$1.object({
1947
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1948
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1949
+ }).describe("Price with explicit currency.");
1950
+ const PriceFilterSchema = z$1.object({
1951
+ "min": z$1.number().int().gte(0).describe("Minimum price in ISO 4217 minor units.").optional(),
1952
+ "max": z$1.number().int().gte(0).describe("Maximum price in ISO 4217 minor units.").optional()
1953
+ }).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.");
1954
+ const PriceRangeSchema = z$1.object({
1955
+ "min": z$1.object({
1956
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1957
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1958
+ }).describe("Minimum price in the range."),
1959
+ "max": z$1.object({
1960
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1961
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1962
+ }).describe("Maximum price in the range.")
1963
+ }).describe("A price range representing minimum and maximum values (e.g., across product variants).");
1964
+ const ProductSchema = z$1.object({
1965
+ "id": z$1.string().describe("Global ID (GID) uniquely identifying this product."),
1966
+ "handle": z$1.string().describe("URL-safe slug for SEO-friendly URLs (e.g., 'blue-runner-pro'). Use id for stable API references.").optional(),
1967
+ "title": z$1.string().describe("Product title."),
1968
+ "description": z$1.object({
1969
+ "plain": z$1.string().describe("Plain text content.").optional(),
1970
+ "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(),
1971
+ "markdown": z$1.string().describe("Markdown-formatted content.").optional()
1972
+ }).describe("Product description in one or more formats."),
1973
+ "url": z$1.string().url().describe("Canonical product page URL.").optional(),
1974
+ "categories": z$1.array(z$1.object({
1975
+ "value": z$1.string().describe("Category value or path (e.g., 'Apparel > Shirts', '1604')."),
1976
+ "taxonomy": z$1.string().describe("Source taxonomy. Well-known values: `google_product_category`, `shopify`, `merchant`.").optional()
1977
+ }).describe("A product category with optional taxonomy identifier.")).describe("Product categories with optional taxonomy identifiers.").optional(),
1978
+ "price_range": z$1.object({
1979
+ "min": z$1.object({
1980
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1981
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1982
+ }).describe("Minimum price in the range."),
1983
+ "max": z$1.object({
1984
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1985
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1986
+ }).describe("Maximum price in the range.")
1987
+ }).describe("Price range across all variants."),
1988
+ "list_price_range": z$1.object({
1989
+ "min": z$1.object({
1990
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1991
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1992
+ }).describe("Minimum price in the range."),
1993
+ "max": z$1.object({
1994
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
1995
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
1996
+ }).describe("Maximum price in the range.")
1997
+ }).describe("List price range before discounts (for strikethrough display).").optional(),
1998
+ "media": z$1.array(z$1.object({
1999
+ "type": z$1.string().describe("Media type. Well-known values: `image`, `video`, `model_3d`."),
2000
+ "url": z$1.string().url().describe("URL to the media resource."),
2001
+ "alt_text": z$1.string().describe("Accessibility text describing the media.").optional(),
2002
+ "width": z$1.number().int().gte(1).describe("Width in pixels (for images/video).").optional(),
2003
+ "height": z$1.number().int().gte(1).describe("Height in pixels (for images/video).").optional()
2004
+ }).describe("Product media item (image, video, etc.).")).describe("Product media (images, videos, 3D models). First item is the featured media for listings.").optional(),
2005
+ "options": z$1.array(z$1.object({
2006
+ "name": z$1.string().describe("Option name (e.g., 'Size', 'Color')."),
2007
+ "values": z$1.array(z$1.object({
2008
+ "id": z$1.string().describe("Optional server-assigned identifier for this option value. When present in a selected_option, the server SHOULD use it for matching instead of label.").optional(),
2009
+ "label": z$1.string().describe("Display text for this option value (e.g., 'Small', 'Blue').")
2010
+ }).describe("A selectable value for a product option.")).min(1).describe("Available values for this option.")
2011
+ }).describe("A product option such as size, color, or material.")).describe("Product options (Size, Color, etc.).").optional(),
2012
+ "variants": z$1.array(z$1.object({
2013
+ "id": z$1.string().describe("Global ID (GID) uniquely identifying this variant. Used as item.id in checkout."),
2014
+ "sku": z$1.string().describe("Business-assigned identifier for inventory and fulfillment.").optional(),
2015
+ "barcodes": z$1.array(z$1.object({
2016
+ "type": z$1.string().describe("Barcode standard. Well-known values: UPC, EAN, ISBN, GTIN, JAN."),
2017
+ "value": z$1.string().describe("Barcode value.")
2018
+ })).describe("Industry-standard product identifiers for cross-reference and correlation.").optional(),
2019
+ "handle": z$1.string().describe("URL-safe variant handle/slug.").optional(),
2020
+ "title": z$1.string().describe("Variant display title (e.g., 'Blue / Large')."),
2021
+ "description": z$1.object({
2022
+ "plain": z$1.string().describe("Plain text content.").optional(),
2023
+ "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(),
2024
+ "markdown": z$1.string().describe("Markdown-formatted content.").optional()
2025
+ }).describe("Variant description in one or more formats."),
2026
+ "url": z$1.string().url().describe("Canonical variant page URL.").optional(),
2027
+ "categories": z$1.array(z$1.object({
2028
+ "value": z$1.string().describe("Category value or path (e.g., 'Apparel > Shirts', '1604')."),
2029
+ "taxonomy": z$1.string().describe("Source taxonomy. Well-known values: `google_product_category`, `shopify`, `merchant`.").optional()
2030
+ }).describe("A product category with optional taxonomy identifier.")).describe("Variant categories with optional taxonomy identifiers.").optional(),
2031
+ "price": z$1.object({
2032
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
2033
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
2034
+ }).describe("Current selling price."),
2035
+ "list_price": z$1.object({
2036
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
2037
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
2038
+ }).describe("List price before discounts (for strikethrough display).").optional(),
2039
+ "unit_price": z$1.object({
2040
+ "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."),
2041
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code."),
2042
+ "measure": z$1.object({
2043
+ "value": z$1.number().describe("Package quantity."),
2044
+ "unit": z$1.string().describe("Unit of measurement.")
2045
+ }).describe("Product quantity in packaging (e.g., 750ml bottle)."),
2046
+ "reference": z$1.object({
2047
+ "value": z$1.number().int().describe("Reference quantity."),
2048
+ "unit": z$1.string().describe("Unit of measurement.")
2049
+ }).describe("Denominator for unit price display (e.g., per 100ml, per 1kg).")
2050
+ }).describe("Price per standard unit of measurement. MAY be omitted when unit pricing does not apply.").optional(),
2051
+ "availability": z$1.object({
2052
+ "available": z$1.boolean().describe("Whether this variant can be purchased. See status for fulfillment details.").optional(),
2053
+ "status": z$1.string().describe("Qualifies available with fulfillment state. Well-known values: `in_stock`, `backorder`, `preorder`, `out_of_stock`, `discontinued`.").optional()
2054
+ }).describe("Variant availability for purchase.").optional(),
2055
+ "selected_options": z$1.array(z$1.object({
2056
+ "name": z$1.string().describe("Option name (e.g., 'Size')."),
2057
+ "id": z$1.string().describe("Optional option value identifier from option_value.id. When present, the server SHOULD use it for matching; name and label remain required for display.").optional(),
2058
+ "label": z$1.string().describe("Selected option label (e.g., 'Large').")
2059
+ }).describe("A specific option selection on a variant (e.g., Size: Large).")).describe("Option selections that define this variant.").optional(),
2060
+ "media": z$1.array(z$1.object({
2061
+ "type": z$1.string().describe("Media type. Well-known values: `image`, `video`, `model_3d`."),
2062
+ "url": z$1.string().url().describe("URL to the media resource."),
2063
+ "alt_text": z$1.string().describe("Accessibility text describing the media.").optional(),
2064
+ "width": z$1.number().int().gte(1).describe("Width in pixels (for images/video).").optional(),
2065
+ "height": z$1.number().int().gte(1).describe("Height in pixels (for images/video).").optional()
2066
+ }).describe("Product media item (image, video, etc.).")).describe("Variant media (images, videos, 3D models). First item is the featured media for listings.").optional(),
2067
+ "rating": z$1.object({
2068
+ "value": z$1.number().gte(0).describe("Average rating value."),
2069
+ "scale_min": z$1.number().gte(0).describe("Minimum value on the rating scale (e.g., 1 for 1-5 stars).").default(1),
2070
+ "scale_max": z$1.number().gte(1).describe("Maximum value on the rating scale (e.g., 5 for 5-star)."),
2071
+ "count": z$1.number().int().gte(0).describe("Number of reviews contributing to the rating.").optional()
2072
+ }).describe("Variant rating.").optional(),
2073
+ "tags": z$1.array(z$1.string()).describe("Variant tags for categorization and search.").optional(),
2074
+ "metadata": z$1.record(z$1.string(), z$1.unknown()).describe("Business-defined custom data extending the standard variant model.").optional(),
2075
+ "seller": z$1.object({
2076
+ "name": z$1.string().describe("Seller display name.").optional(),
2077
+ "links": z$1.array(z$1.object({
2078
+ "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."),
2079
+ "url": z$1.string().url().describe("The actual URL pointing to the content to be displayed."),
2080
+ "title": z$1.string().describe("Optional display text for the link. When provided, use this instead of generating from type.").optional()
2081
+ })).describe("Seller policy and information links.").optional()
2082
+ }).describe("Optional seller context for this variant.").optional()
2083
+ }).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."),
2084
+ "rating": z$1.object({
2085
+ "value": z$1.number().gte(0).describe("Average rating value."),
2086
+ "scale_min": z$1.number().gte(0).describe("Minimum value on the rating scale (e.g., 1 for 1-5 stars).").default(1),
2087
+ "scale_max": z$1.number().gte(1).describe("Maximum value on the rating scale (e.g., 5 for 5-star)."),
2088
+ "count": z$1.number().int().gte(0).describe("Number of reviews contributing to the rating.").optional()
2089
+ }).describe("Aggregate product rating.").optional(),
2090
+ "tags": z$1.array(z$1.string()).describe("Product tags for categorization and search.").optional(),
2091
+ "metadata": z$1.record(z$1.string(), z$1.unknown()).describe("Business-defined custom data extending the standard product model.").optional()
2092
+ }).describe("A product in the catalog with variants and options.");
2093
+ const ProductOptionSchema = z$1.object({
2094
+ "name": z$1.string().describe("Option name (e.g., 'Size', 'Color')."),
2095
+ "values": z$1.array(z$1.object({
2096
+ "id": z$1.string().describe("Optional server-assigned identifier for this option value. When present in a selected_option, the server SHOULD use it for matching instead of label.").optional(),
2097
+ "label": z$1.string().describe("Display text for this option value (e.g., 'Small', 'Blue').")
2098
+ }).describe("A selectable value for a product option.")).min(1).describe("Available values for this option.")
2099
+ }).describe("A product option such as size, color, or material.");
2100
+ const RatingSchema = z$1.object({
2101
+ "value": z$1.number().gte(0).describe("Average rating value."),
2102
+ "scale_min": z$1.number().gte(0).describe("Minimum value on the rating scale (e.g., 1 for 1-5 stars).").default(1),
2103
+ "scale_max": z$1.number().gte(1).describe("Maximum value on the rating scale (e.g., 5 for 5-star)."),
2104
+ "count": z$1.number().int().gte(0).describe("Number of reviews contributing to the rating.").optional()
2105
+ }).describe("Product rating aggregate.");
1449
2106
  const RetailLocationSchema = z$1.object({
1450
2107
  "id": z$1.string().describe("Unique location identifier."),
1451
2108
  "name": z$1.string().describe("Location name (e.g., store name)."),
@@ -1461,6 +2118,19 @@ const RetailLocationSchema = z$1.object({
1461
2118
  "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1462
2119
  }).describe("Physical address of the location.").optional()
1463
2120
  }).passthrough().describe("A pickup location (retail store, locker, etc.).");
2121
+ 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').");
2122
+ const SearchFiltersSchema = z$1.object({
2123
+ "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(),
2124
+ "price": z$1.object({
2125
+ "min": z$1.number().int().gte(0).describe("Minimum price in ISO 4217 minor units.").optional(),
2126
+ "max": z$1.number().int().gte(0).describe("Maximum price in ISO 4217 minor units.").optional()
2127
+ }).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()
2128
+ }).passthrough().describe("Filter criteria to narrow search results. All specified filters combine with AND logic.");
2129
+ const SelectedOptionSchema = z$1.object({
2130
+ "name": z$1.string().describe("Option name (e.g., 'Size')."),
2131
+ "id": z$1.string().describe("Optional option value identifier from option_value.id. When present, the server SHOULD use it for matching; name and label remain required for display.").optional(),
2132
+ "label": z$1.string().describe("Selected option label (e.g., 'Large').")
2133
+ }).describe("A specific option selection on a variant (e.g., Size: Large).");
1464
2134
  const ShippingDestinationSchema = z$1.record(z$1.string(), z$1.unknown()).and(z$1.intersection(z$1.object({
1465
2135
  "extended_address": z$1.string().describe("An address extension such as an apartment number, C/O or alternative name.").optional(),
1466
2136
  "street_address": z$1.string().describe("The street address.").optional(),
@@ -1472,26 +2142,119 @@ const ShippingDestinationSchema = z$1.record(z$1.string(), z$1.unknown()).and(z$
1472
2142
  "last_name": z$1.string().describe("Optional. Last name of the contact associated with the address.").optional(),
1473
2143
  "phone_number": z$1.string().describe("Optional. Phone number of the contact associated with the address.").optional()
1474
2144
  }), z$1.object({ "id": z$1.string().describe("ID specific to this shipping destination.") }))).describe("Shipping destination.");
2145
+ const SignalsSchema = z$1.object({
2146
+ "dev.ucp.buyer_ip": z$1.string().describe("Client's IP address (IPv4 or IPv6).").optional(),
2147
+ "dev.ucp.user_agent": z$1.string().describe("Client's HTTP User-Agent header or equivalent.").optional()
2148
+ }).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.");
2149
+ 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).");
1475
2150
  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({
1476
2151
  "type": z$1.string().describe("The specific type of token produced by the handler (e.g., 'stripe_token')."),
1477
2152
  "token": z$1.string().describe("The token value.")
1478
2153
  })).describe("Base token credential schema. Concrete payment handlers may extend this schema with additional fields and define their own constraints.");
1479
2154
  const TotalSchema = z$1.object({
1480
- "type": z$1.enum([
1481
- "items_discount",
1482
- "subtotal",
1483
- "discount",
1484
- "fulfillment",
1485
- "tax",
1486
- "fee",
1487
- "total"
1488
- ]).describe("Type of total categorization."),
2155
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
1489
2156
  "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
1490
- "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.")
1491
- });
1492
- 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.");
2157
+ "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).")
2158
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text.");
2159
+ const TotalsSchema = z$1.array(z$1.intersection(z$1.object({
2160
+ "type": z$1.string().describe("Cost category. Well-known values: subtotal, items_discount, discount, fulfillment, tax, fee, total. Businesses MAY use additional values."),
2161
+ "display_text": z$1.string().describe("Text to display against the amount. Should reflect appropriate method (e.g., 'Shipping', 'Delivery').").optional(),
2162
+ "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).")
2163
+ }).and(z$1.intersection(z$1.any(), z$1.any())).describe("A cost breakdown entry with a category, amount, and optional display text."), z$1.intersection(z$1.object({ "lines": z$1.array(z$1.object({
2164
+ "display_text": z$1.string().describe("Human-readable label for this sub-line."),
2165
+ "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).")
2166
+ }).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() }), 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.");
2167
+ const VariantSchema = z$1.object({
2168
+ "id": z$1.string().describe("Global ID (GID) uniquely identifying this variant. Used as item.id in checkout."),
2169
+ "sku": z$1.string().describe("Business-assigned identifier for inventory and fulfillment.").optional(),
2170
+ "barcodes": z$1.array(z$1.object({
2171
+ "type": z$1.string().describe("Barcode standard. Well-known values: UPC, EAN, ISBN, GTIN, JAN."),
2172
+ "value": z$1.string().describe("Barcode value.")
2173
+ })).describe("Industry-standard product identifiers for cross-reference and correlation.").optional(),
2174
+ "handle": z$1.string().describe("URL-safe variant handle/slug.").optional(),
2175
+ "title": z$1.string().describe("Variant display title (e.g., 'Blue / Large')."),
2176
+ "description": z$1.object({
2177
+ "plain": z$1.string().describe("Plain text content.").optional(),
2178
+ "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(),
2179
+ "markdown": z$1.string().describe("Markdown-formatted content.").optional()
2180
+ }).describe("Variant description in one or more formats."),
2181
+ "url": z$1.string().url().describe("Canonical variant page URL.").optional(),
2182
+ "categories": z$1.array(z$1.object({
2183
+ "value": z$1.string().describe("Category value or path (e.g., 'Apparel > Shirts', '1604')."),
2184
+ "taxonomy": z$1.string().describe("Source taxonomy. Well-known values: `google_product_category`, `shopify`, `merchant`.").optional()
2185
+ }).describe("A product category with optional taxonomy identifier.")).describe("Variant categories with optional taxonomy identifiers.").optional(),
2186
+ "price": z$1.object({
2187
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
2188
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
2189
+ }).describe("Current selling price."),
2190
+ "list_price": z$1.object({
2191
+ "amount": z$1.number().int().gte(0).describe("Amount in ISO 4217 minor units. Use 0 for free items."),
2192
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code (e.g., 'USD', 'EUR', 'GBP').")
2193
+ }).describe("List price before discounts (for strikethrough display).").optional(),
2194
+ "unit_price": z$1.object({
2195
+ "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."),
2196
+ "currency": z$1.string().regex(/* @__PURE__ */ new RegExp("^[A-Z]{3}$")).describe("ISO 4217 currency code."),
2197
+ "measure": z$1.object({
2198
+ "value": z$1.number().describe("Package quantity."),
2199
+ "unit": z$1.string().describe("Unit of measurement.")
2200
+ }).describe("Product quantity in packaging (e.g., 750ml bottle)."),
2201
+ "reference": z$1.object({
2202
+ "value": z$1.number().int().describe("Reference quantity."),
2203
+ "unit": z$1.string().describe("Unit of measurement.")
2204
+ }).describe("Denominator for unit price display (e.g., per 100ml, per 1kg).")
2205
+ }).describe("Price per standard unit of measurement. MAY be omitted when unit pricing does not apply.").optional(),
2206
+ "availability": z$1.object({
2207
+ "available": z$1.boolean().describe("Whether this variant can be purchased. See status for fulfillment details.").optional(),
2208
+ "status": z$1.string().describe("Qualifies available with fulfillment state. Well-known values: `in_stock`, `backorder`, `preorder`, `out_of_stock`, `discontinued`.").optional()
2209
+ }).describe("Variant availability for purchase.").optional(),
2210
+ "selected_options": z$1.array(z$1.object({
2211
+ "name": z$1.string().describe("Option name (e.g., 'Size')."),
2212
+ "id": z$1.string().describe("Optional option value identifier from option_value.id. When present, the server SHOULD use it for matching; name and label remain required for display.").optional(),
2213
+ "label": z$1.string().describe("Selected option label (e.g., 'Large').")
2214
+ }).describe("A specific option selection on a variant (e.g., Size: Large).")).describe("Option selections that define this variant.").optional(),
2215
+ "media": z$1.array(z$1.object({
2216
+ "type": z$1.string().describe("Media type. Well-known values: `image`, `video`, `model_3d`."),
2217
+ "url": z$1.string().url().describe("URL to the media resource."),
2218
+ "alt_text": z$1.string().describe("Accessibility text describing the media.").optional(),
2219
+ "width": z$1.number().int().gte(1).describe("Width in pixels (for images/video).").optional(),
2220
+ "height": z$1.number().int().gte(1).describe("Height in pixels (for images/video).").optional()
2221
+ }).describe("Product media item (image, video, etc.).")).describe("Variant media (images, videos, 3D models). First item is the featured media for listings.").optional(),
2222
+ "rating": z$1.object({
2223
+ "value": z$1.number().gte(0).describe("Average rating value."),
2224
+ "scale_min": z$1.number().gte(0).describe("Minimum value on the rating scale (e.g., 1 for 1-5 stars).").default(1),
2225
+ "scale_max": z$1.number().gte(1).describe("Maximum value on the rating scale (e.g., 5 for 5-star)."),
2226
+ "count": z$1.number().int().gte(0).describe("Number of reviews contributing to the rating.").optional()
2227
+ }).describe("Variant rating.").optional(),
2228
+ "tags": z$1.array(z$1.string()).describe("Variant tags for categorization and search.").optional(),
2229
+ "metadata": z$1.record(z$1.string(), z$1.unknown()).describe("Business-defined custom data extending the standard variant model.").optional(),
2230
+ "seller": z$1.object({
2231
+ "name": z$1.string().describe("Seller display name.").optional(),
2232
+ "links": z$1.array(z$1.object({
2233
+ "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."),
2234
+ "url": z$1.string().url().describe("The actual URL pointing to the content to be displayed."),
2235
+ "title": z$1.string().describe("Optional display text for the link. When provided, use this instead of generating from type.").optional()
2236
+ })).describe("Seller policy and information links.").optional()
2237
+ }).describe("Optional seller context for this variant.").optional()
2238
+ }).describe("A purchasable variant of a product with specific option selections.");
2239
+ const EmbeddedConfigSchema = z$1.object({
2240
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In UCP responses, confirms accepted delegations for this session.").optional(),
2241
+ "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()
2242
+ }).describe("Per-session configuration for embedded transport binding. Allows businesses to vary EP availability and delegations based on cart contents, agent authorization, or policy.");
1493
2243
  const UcpVersionSchema = z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format.");
1494
- 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)");
2244
+ const UcpVersionConstraintSchema = z$1.object({
2245
+ "min": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Minimum required version (inclusive)."),
2246
+ "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()
2247
+ }).passthrough().describe("Version range requirement with minimum and optional maximum.");
2248
+ const UcpRequiresSchema = z$1.object({
2249
+ "protocol": z$1.object({
2250
+ "min": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Minimum required version (inclusive)."),
2251
+ "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()
2252
+ }).passthrough().describe("Required protocol version.").optional(),
2253
+ "capabilities": z$1.record(z$1.object({
2254
+ "min": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Minimum required version (inclusive)."),
2255
+ "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()
2256
+ }).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()
2257
+ }).passthrough().describe("Version requirements for extension schemas. Declares minimum (and optionally maximum) protocol and capability versions needed for correct operation.");
1495
2258
  const UcpEntitySchema = z$1.object({
1496
2259
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1497
2260
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1501,6 +2264,157 @@ const UcpEntitySchema = z$1.object({
1501
2264
  }).describe("Shared foundation for all UCP entities.");
1502
2265
  const UcpBaseSchema = z$1.object({
1503
2266
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2267
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2268
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
2269
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2270
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2271
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2272
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2273
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2274
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2275
+ "transport": z$1.enum([
2276
+ "rest",
2277
+ "mcp",
2278
+ "a2a",
2279
+ "embedded"
2280
+ ]).describe("Transport protocol for this service binding."),
2281
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2282
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2283
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2284
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2285
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2286
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2287
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2288
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2289
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2290
+ 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)];
2291
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2292
+ const passed = schemas.length - errors.length;
2293
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2294
+ path: ctx.path,
2295
+ code: "invalid_union",
2296
+ unionErrors: errors,
2297
+ message: "Invalid input: Should pass single schema. Passed " + passed
2298
+ } : {
2299
+ path: ctx.path,
2300
+ code: "custom",
2301
+ message: "Invalid input: Should pass single schema. Passed " + passed
2302
+ });
2303
+ }).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(),
2304
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2305
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2306
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2307
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2308
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2309
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2310
+ }).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({
2311
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2312
+ "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()
2313
+ }).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()
2314
+ }).describe("Base UCP metadata with shared properties for all schema types.");
2315
+ const UcpSuccessSchema = z$1.intersection(z$1.object({
2316
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2317
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2318
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
2319
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2320
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2321
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2322
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2323
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2324
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2325
+ "transport": z$1.enum([
2326
+ "rest",
2327
+ "mcp",
2328
+ "a2a",
2329
+ "embedded"
2330
+ ]).describe("Transport protocol for this service binding."),
2331
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2332
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2333
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2334
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2335
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2336
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2337
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2338
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2339
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2340
+ 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)];
2341
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2342
+ const passed = schemas.length - errors.length;
2343
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2344
+ path: ctx.path,
2345
+ code: "invalid_union",
2346
+ unionErrors: errors,
2347
+ message: "Invalid input: Should pass single schema. Passed " + passed
2348
+ } : {
2349
+ path: ctx.path,
2350
+ code: "custom",
2351
+ message: "Invalid input: Should pass single schema. Passed " + passed
2352
+ });
2353
+ }).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(),
2354
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2355
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2356
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2357
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2358
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2359
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2360
+ }).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({
2361
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2362
+ "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()
2363
+ }).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()
2364
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({ "status": z$1.literal("success") })).describe("UCP metadata with status 'success'. Use for response branches that carry the expected payload.");
2365
+ const UcpErrorSchema = z$1.intersection(z$1.object({
2366
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2367
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2368
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
2369
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2370
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2371
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2372
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2373
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2374
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2375
+ "transport": z$1.enum([
2376
+ "rest",
2377
+ "mcp",
2378
+ "a2a",
2379
+ "embedded"
2380
+ ]).describe("Transport protocol for this service binding."),
2381
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2382
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
2383
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
2384
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2385
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2386
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2387
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2388
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2389
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2390
+ 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)];
2391
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2392
+ const passed = schemas.length - errors.length;
2393
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2394
+ path: ctx.path,
2395
+ code: "invalid_union",
2396
+ unionErrors: errors,
2397
+ message: "Invalid input: Should pass single schema. Passed " + passed
2398
+ } : {
2399
+ path: ctx.path,
2400
+ code: "custom",
2401
+ message: "Invalid input: Should pass single schema. Passed " + passed
2402
+ });
2403
+ }).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(),
2404
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2405
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2406
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2407
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2408
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2409
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2410
+ }).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({
2411
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2412
+ "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()
2413
+ }).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()
2414
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({ "status": z$1.literal("error") })).describe("UCP metadata with status 'error'. Use for response branches that carry error information.");
2415
+ const UcpPlatformSchema = z$1.intersection(z$1.object({
2416
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2417
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1504
2418
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1505
2419
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1506
2420
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1522,17 +2436,87 @@ const UcpBaseSchema = z$1.object({
1522
2436
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1523
2437
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1524
2438
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1525
- }).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(),
2439
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2440
+ 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)];
2441
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2442
+ const passed = schemas.length - errors.length;
2443
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2444
+ path: ctx.path,
2445
+ code: "invalid_union",
2446
+ unionErrors: errors,
2447
+ message: "Invalid input: Should pass single schema. Passed " + passed
2448
+ } : {
2449
+ path: ctx.path,
2450
+ code: "custom",
2451
+ message: "Invalid input: Should pass single schema. Passed " + passed
2452
+ });
2453
+ }).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(),
1526
2454
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1527
2455
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1528
2456
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1529
2457
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1530
2458
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1531
2459
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1532
- }).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()
1533
- }).describe("Base UCP metadata with shared properties for all schema types.");
1534
- const UcpPlatformSchema = z$1.intersection(z$1.object({
2460
+ }).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({
2461
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2462
+ "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()
2463
+ }).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()
2464
+ }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
2465
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2466
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2467
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2468
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2469
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2470
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2471
+ }).describe("Shared foundation for all UCP entities."), z$1.object({
2472
+ "transport": z$1.enum([
2473
+ "rest",
2474
+ "mcp",
2475
+ "a2a",
2476
+ "embedded"
2477
+ ]).describe("Transport protocol for this service binding."),
2478
+ "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
2479
+ })), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.union([
2480
+ z$1.object({ "transport": z$1.literal("rest").optional() }),
2481
+ z$1.object({ "transport": z$1.literal("mcp").optional() }),
2482
+ z$1.object({ "transport": z$1.literal("a2a").optional() }),
2483
+ z$1.object({ "transport": z$1.literal("embedded").optional() })
2484
+ ]))).describe("Full service declaration for platform-level discovery. All transports require `version`, `spec`, and `transport`. REST and MCP additionally require `schema` and `endpoint`; A2A requires `endpoint`; embedded requires `schema`."))),
2485
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2486
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2487
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2488
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2489
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2490
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2491
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2492
+ 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)];
2493
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2494
+ const passed = schemas.length - errors.length;
2495
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2496
+ path: ctx.path,
2497
+ code: "invalid_union",
2498
+ unionErrors: errors,
2499
+ message: "Invalid input: Should pass single schema. Passed " + passed
2500
+ } : {
2501
+ path: ctx.path,
2502
+ code: "custom",
2503
+ message: "Invalid input: Should pass single schema. Passed " + passed
2504
+ });
2505
+ }).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(),
2506
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2507
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2508
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2509
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2510
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2511
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2512
+ }).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({
2513
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2514
+ "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()
2515
+ }).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.")))
2516
+ })).describe("Full UCP metadata for platform-level configuration. Hosted at a URI advertised by the platform in request headers.");
2517
+ const UcpBusinessSchema = z$1.intersection(z$1.object({
1535
2518
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2519
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1536
2520
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1537
2521
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1538
2522
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1554,15 +2538,33 @@ const UcpPlatformSchema = z$1.intersection(z$1.object({
1554
2538
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1555
2539
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1556
2540
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1557
- }).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(),
2541
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2542
+ 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)];
2543
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2544
+ const passed = schemas.length - errors.length;
2545
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2546
+ path: ctx.path,
2547
+ code: "invalid_union",
2548
+ unionErrors: errors,
2549
+ message: "Invalid input: Should pass single schema. Passed " + passed
2550
+ } : {
2551
+ path: ctx.path,
2552
+ code: "custom",
2553
+ message: "Invalid input: Should pass single schema. Passed " + passed
2554
+ });
2555
+ }).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(),
1558
2556
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1559
2557
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1560
2558
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1561
2559
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1562
2560
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1563
2561
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1564
- }).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()
2562
+ }).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({
2563
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2564
+ "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()
2565
+ }).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()
1565
2566
  }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
2567
+ "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(),
1566
2568
  "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
1567
2569
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1568
2570
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1577,29 +2579,53 @@ const UcpPlatformSchema = z$1.intersection(z$1.object({
1577
2579
  "embedded"
1578
2580
  ]).describe("Transport protocol for this service binding."),
1579
2581
  "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
1580
- })), z$1.intersection(z$1.record(z$1.string(), z$1.unknown()), z$1.union([
2582
+ })), z$1.union([
1581
2583
  z$1.object({ "transport": z$1.literal("rest").optional() }),
1582
2584
  z$1.object({ "transport": z$1.literal("mcp").optional() }),
1583
2585
  z$1.object({ "transport": z$1.literal("a2a").optional() }),
1584
- z$1.object({ "transport": z$1.literal("embedded").optional() })
1585
- ]))).describe("Full service declaration for platform-level discovery. Different transports require different fields."))),
1586
- "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2586
+ z$1.object({
2587
+ "transport": z$1.literal("embedded").optional(),
2588
+ "config": z$1.object({
2589
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In UCP responses, confirms accepted delegations for this session.").optional(),
2590
+ "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()
2591
+ }).describe("Per-session configuration for embedded transport binding. Allows businesses to vary EP availability and delegations based on cart contents, agent authorization, or policy.").optional()
2592
+ })
2593
+ ])).describe("Service binding for business/merchant configuration. May override platform endpoints."))),
2594
+ "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1587
2595
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1588
2596
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1589
2597
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1590
2598
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1591
2599
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1592
- }).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(),
1593
- "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2600
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2601
+ 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)];
2602
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2603
+ const passed = schemas.length - errors.length;
2604
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2605
+ path: ctx.path,
2606
+ code: "invalid_union",
2607
+ unionErrors: errors,
2608
+ message: "Invalid input: Should pass single schema. Passed " + passed
2609
+ } : {
2610
+ path: ctx.path,
2611
+ code: "custom",
2612
+ message: "Invalid input: Should pass single schema. Passed " + passed
2613
+ });
2614
+ }).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(),
2615
+ "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1594
2616
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1595
2617
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1596
2618
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1597
2619
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1598
2620
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1599
- }).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.")))
1600
- })).describe("Full UCP metadata for platform-level configuration. Hosted at a URI advertised by the platform in request headers.");
1601
- const UcpBusinessSchema = z$1.intersection(z$1.object({
2621
+ }).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({
2622
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2623
+ "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()
2624
+ }).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.")))
2625
+ })).describe("UCP metadata for business/merchant-level configuration. Subset of platform schema with business-specific settings.");
2626
+ const UcpResponseCheckoutSchema = z$1.intersection(z$1.object({
1602
2627
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2628
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1603
2629
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1604
2630
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1605
2631
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1621,14 +2647,31 @@ const UcpBusinessSchema = z$1.intersection(z$1.object({
1621
2647
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1622
2648
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1623
2649
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1624
- }).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(),
2650
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2651
+ 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)];
2652
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2653
+ const passed = schemas.length - errors.length;
2654
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2655
+ path: ctx.path,
2656
+ code: "invalid_union",
2657
+ unionErrors: errors,
2658
+ message: "Invalid input: Should pass single schema. Passed " + passed
2659
+ } : {
2660
+ path: ctx.path,
2661
+ code: "custom",
2662
+ message: "Invalid input: Should pass single schema. Passed " + passed
2663
+ });
2664
+ }).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(),
1625
2665
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1626
2666
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1627
2667
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1628
2668
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1629
2669
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1630
2670
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1631
- }).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()
2671
+ }).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({
2672
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2673
+ "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()
2674
+ }).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()
1632
2675
  }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
1633
2676
  "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
1634
2677
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
@@ -1650,26 +2693,47 @@ const UcpBusinessSchema = z$1.intersection(z$1.object({
1650
2693
  z$1.object({ "transport": z$1.literal("a2a").optional() }),
1651
2694
  z$1.object({
1652
2695
  "transport": z$1.literal("embedded").optional(),
1653
- "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()
2696
+ "config": z$1.object({
2697
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In UCP responses, confirms accepted delegations for this session.").optional(),
2698
+ "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()
2699
+ }).describe("Per-session configuration for embedded transport binding. Allows businesses to vary EP availability and delegations based on cart contents, agent authorization, or policy.").optional()
1654
2700
  })
1655
- ])).describe("Service binding for business/merchant configuration. May override platform endpoints."))),
2701
+ ])).describe("Service binding in API responses. Includes per-resource transport configuration via typed config."))).optional(),
1656
2702
  "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1657
2703
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1658
2704
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1659
2705
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1660
2706
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1661
2707
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1662
- }).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(),
2708
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2709
+ 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)];
2710
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2711
+ const passed = schemas.length - errors.length;
2712
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2713
+ path: ctx.path,
2714
+ code: "invalid_union",
2715
+ unionErrors: errors,
2716
+ message: "Invalid input: Should pass single schema. Passed " + passed
2717
+ } : {
2718
+ path: ctx.path,
2719
+ code: "custom",
2720
+ message: "Invalid input: Should pass single schema. Passed " + passed
2721
+ });
2722
+ }).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(),
1663
2723
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1664
2724
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1665
2725
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1666
2726
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1667
2727
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1668
2728
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1669
- }).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.")))
1670
- })).describe("UCP metadata for business/merchant-level configuration. Subset of platform schema with business-specific settings.");
1671
- const UcpResponseCheckoutSchema = z$1.intersection(z$1.object({
2729
+ }).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({
2730
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2731
+ "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()
2732
+ }).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.")))
2733
+ })).describe("UCP metadata for checkout responses.");
2734
+ const UcpResponseOrderSchema = z$1.intersection(z$1.object({
1672
2735
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2736
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1673
2737
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1674
2738
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1675
2739
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1691,16 +2755,56 @@ const UcpResponseCheckoutSchema = z$1.intersection(z$1.object({
1691
2755
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1692
2756
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1693
2757
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1694
- }).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(),
2758
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2759
+ 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)];
2760
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2761
+ const passed = schemas.length - errors.length;
2762
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2763
+ path: ctx.path,
2764
+ code: "invalid_union",
2765
+ unionErrors: errors,
2766
+ message: "Invalid input: Should pass single schema. Passed " + passed
2767
+ } : {
2768
+ path: ctx.path,
2769
+ code: "custom",
2770
+ message: "Invalid input: Should pass single schema. Passed " + passed
2771
+ });
2772
+ }).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(),
1695
2773
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1696
2774
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1697
2775
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1698
2776
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1699
2777
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1700
2778
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1701
- }).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()
1702
- }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
1703
- "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2779
+ }).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({
2780
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2781
+ "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()
2782
+ }).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()
2783
+ }).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({
2784
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2785
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2786
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2787
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2788
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2789
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2790
+ 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)];
2791
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2792
+ const passed = schemas.length - errors.length;
2793
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2794
+ path: ctx.path,
2795
+ code: "invalid_union",
2796
+ unionErrors: errors,
2797
+ message: "Invalid input: Should pass single schema. Passed " + passed
2798
+ } : {
2799
+ path: ctx.path,
2800
+ code: "custom",
2801
+ message: "Invalid input: Should pass single schema. Passed " + passed
2802
+ });
2803
+ }).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.");
2804
+ const UcpResponseCartSchema = z$1.intersection(z$1.object({
2805
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2806
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
2807
+ "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1704
2808
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1705
2809
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1706
2810
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
@@ -1714,32 +2818,62 @@ const UcpResponseCheckoutSchema = z$1.intersection(z$1.object({
1714
2818
  "embedded"
1715
2819
  ]).describe("Transport protocol for this service binding."),
1716
2820
  "endpoint": z$1.string().url().describe("Endpoint URL for this transport binding.").optional()
1717
- })), z$1.union([
1718
- z$1.object({ "transport": z$1.literal("rest").optional() }),
1719
- z$1.object({ "transport": z$1.literal("mcp").optional() }),
1720
- z$1.object({ "transport": z$1.literal("a2a").optional() }),
1721
- z$1.object({
1722
- "transport": z$1.literal("embedded").optional(),
1723
- "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()
1724
- })
1725
- ])).describe("Service binding in API responses. Includes per-resource transport configuration via typed config."))).optional(),
2821
+ })))).describe("Service registry keyed by reverse-domain name.").optional(),
1726
2822
  "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
1727
2823
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1728
2824
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1729
2825
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1730
2826
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1731
2827
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1732
- }).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(),
2828
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2829
+ 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)];
2830
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2831
+ const passed = schemas.length - errors.length;
2832
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2833
+ path: ctx.path,
2834
+ code: "invalid_union",
2835
+ unionErrors: errors,
2836
+ message: "Invalid input: Should pass single schema. Passed " + passed
2837
+ } : {
2838
+ path: ctx.path,
2839
+ code: "custom",
2840
+ message: "Invalid input: Should pass single schema. Passed " + passed
2841
+ });
2842
+ }).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(),
1733
2843
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1734
2844
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1735
2845
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1736
2846
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1737
2847
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1738
2848
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1739
- }).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.")))
1740
- })).describe("UCP metadata for checkout responses.");
1741
- const UcpResponseOrderSchema = z$1.intersection(z$1.object({
2849
+ }).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({
2850
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2851
+ "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()
2852
+ }).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()
2853
+ }).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({
2854
+ "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
2855
+ "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2856
+ "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2857
+ "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2858
+ "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2859
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2860
+ 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)];
2861
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2862
+ const passed = schemas.length - errors.length;
2863
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2864
+ path: ctx.path,
2865
+ code: "invalid_union",
2866
+ unionErrors: errors,
2867
+ message: "Invalid input: Should pass single schema. Passed " + passed
2868
+ } : {
2869
+ path: ctx.path,
2870
+ code: "custom",
2871
+ message: "Invalid input: Should pass single schema. Passed " + passed
2872
+ });
2873
+ }).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.");
2874
+ const UcpResponseCatalogSchema = z$1.intersection(z$1.object({
1742
2875
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2876
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1743
2877
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1744
2878
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1745
2879
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1761,21 +2895,52 @@ const UcpResponseOrderSchema = z$1.intersection(z$1.object({
1761
2895
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1762
2896
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1763
2897
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1764
- }).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(),
2898
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2899
+ 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)];
2900
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2901
+ const passed = schemas.length - errors.length;
2902
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2903
+ path: ctx.path,
2904
+ code: "invalid_union",
2905
+ unionErrors: errors,
2906
+ message: "Invalid input: Should pass single schema. Passed " + passed
2907
+ } : {
2908
+ path: ctx.path,
2909
+ code: "custom",
2910
+ message: "Invalid input: Should pass single schema. Passed " + passed
2911
+ });
2912
+ }).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(),
1765
2913
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1766
2914
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1767
2915
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1768
2916
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1769
2917
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1770
2918
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1771
- }).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()
2919
+ }).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({
2920
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
2921
+ "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()
2922
+ }).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()
1772
2923
  }).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({
1773
2924
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("Entity version in YYYY-MM-DD format."),
1774
2925
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1775
2926
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1776
2927
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1777
2928
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1778
- }).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.");
2929
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2930
+ 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)];
2931
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2932
+ const passed = schemas.length - errors.length;
2933
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2934
+ path: ctx.path,
2935
+ code: "invalid_union",
2936
+ unionErrors: errors,
2937
+ message: "Invalid input: Should pass single schema. Passed " + passed
2938
+ } : {
2939
+ path: ctx.path,
2940
+ code: "custom",
2941
+ message: "Invalid input: Should pass single schema. Passed " + passed
2942
+ });
2943
+ }).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.");
1779
2944
  const ProfileSchemaSigningKeySchema = z$1.object({
1780
2945
  "kid": z$1.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
1781
2946
  "kty": z$1.string().describe("Key type (e.g., 'EC', 'RSA')."),
@@ -1790,6 +2955,7 @@ const ProfileSchemaSigningKeySchema = z$1.object({
1790
2955
  const ProfileSchemaBaseSchema = z$1.object({
1791
2956
  "ucp": z$1.object({
1792
2957
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2958
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1793
2959
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1794
2960
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1795
2961
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1811,14 +2977,31 @@ const ProfileSchemaBaseSchema = z$1.object({
1811
2977
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1812
2978
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1813
2979
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1814
- }).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(),
2980
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
2981
+ 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)];
2982
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
2983
+ const passed = schemas.length - errors.length;
2984
+ if (passed !== 1) ctx.addIssue(errors.length ? {
2985
+ path: ctx.path,
2986
+ code: "invalid_union",
2987
+ unionErrors: errors,
2988
+ message: "Invalid input: Should pass single schema. Passed " + passed
2989
+ } : {
2990
+ path: ctx.path,
2991
+ code: "custom",
2992
+ message: "Invalid input: Should pass single schema. Passed " + passed
2993
+ });
2994
+ }).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(),
1815
2995
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1816
2996
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1817
2997
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1818
2998
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1819
2999
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1820
3000
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1821
- }).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()
3001
+ }).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({
3002
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3003
+ "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()
3004
+ }).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()
1822
3005
  }).describe("Base UCP metadata with shared properties for all schema types."),
1823
3006
  "signing_keys": z$1.array(z$1.object({
1824
3007
  "kid": z$1.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
@@ -1835,6 +3018,7 @@ const ProfileSchemaBaseSchema = z$1.object({
1835
3018
  const ProfileSchemaPlatformProfileSchema = z$1.intersection(z$1.object({
1836
3019
  "ucp": z$1.object({
1837
3020
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
3021
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1838
3022
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1839
3023
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1840
3024
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1856,14 +3040,31 @@ const ProfileSchemaPlatformProfileSchema = z$1.intersection(z$1.object({
1856
3040
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1857
3041
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1858
3042
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1859
- }).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(),
3043
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
3044
+ 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)];
3045
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
3046
+ const passed = schemas.length - errors.length;
3047
+ if (passed !== 1) ctx.addIssue(errors.length ? {
3048
+ path: ctx.path,
3049
+ code: "invalid_union",
3050
+ unionErrors: errors,
3051
+ message: "Invalid input: Should pass single schema. Passed " + passed
3052
+ } : {
3053
+ path: ctx.path,
3054
+ code: "custom",
3055
+ message: "Invalid input: Should pass single schema. Passed " + passed
3056
+ });
3057
+ }).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(),
1860
3058
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1861
3059
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1862
3060
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1863
3061
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1864
3062
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1865
3063
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1866
- }).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()
3064
+ }).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({
3065
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3066
+ "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()
3067
+ }).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()
1867
3068
  }).describe("Base UCP metadata with shared properties for all schema types."),
1868
3069
  "signing_keys": z$1.array(z$1.object({
1869
3070
  "kid": z$1.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
@@ -1878,6 +3079,7 @@ const ProfileSchemaPlatformProfileSchema = z$1.intersection(z$1.object({
1878
3079
  }).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()
1879
3080
  }).passthrough().describe("Base discovery profile with shared properties for all profile types."), z$1.object({ "ucp": z$1.intersection(z$1.object({
1880
3081
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
3082
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1881
3083
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1882
3084
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1883
3085
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1899,14 +3101,31 @@ const ProfileSchemaPlatformProfileSchema = z$1.intersection(z$1.object({
1899
3101
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1900
3102
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1901
3103
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1902
- }).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(),
3104
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
3105
+ 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)];
3106
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
3107
+ const passed = schemas.length - errors.length;
3108
+ if (passed !== 1) ctx.addIssue(errors.length ? {
3109
+ path: ctx.path,
3110
+ code: "invalid_union",
3111
+ unionErrors: errors,
3112
+ message: "Invalid input: Should pass single schema. Passed " + passed
3113
+ } : {
3114
+ path: ctx.path,
3115
+ code: "custom",
3116
+ message: "Invalid input: Should pass single schema. Passed " + passed
3117
+ });
3118
+ }).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(),
1903
3119
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1904
3120
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1905
3121
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1906
3122
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1907
3123
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1908
3124
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1909
- }).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()
3125
+ }).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({
3126
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3127
+ "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()
3128
+ }).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()
1910
3129
  }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
1911
3130
  "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
1912
3131
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
@@ -1927,25 +3146,43 @@ const ProfileSchemaPlatformProfileSchema = z$1.intersection(z$1.object({
1927
3146
  z$1.object({ "transport": z$1.literal("mcp").optional() }),
1928
3147
  z$1.object({ "transport": z$1.literal("a2a").optional() }),
1929
3148
  z$1.object({ "transport": z$1.literal("embedded").optional() })
1930
- ]))).describe("Full service declaration for platform-level discovery. Different transports require different fields."))),
3149
+ ]))).describe("Full service declaration for platform-level discovery. All transports require `version`, `spec`, and `transport`. REST and MCP additionally require `schema` and `endpoint`; A2A requires `endpoint`; embedded requires `schema`."))),
1931
3150
  "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
1932
3151
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1933
3152
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1934
3153
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1935
3154
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1936
3155
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1937
- }).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(),
3156
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
3157
+ 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)];
3158
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
3159
+ const passed = schemas.length - errors.length;
3160
+ if (passed !== 1) ctx.addIssue(errors.length ? {
3161
+ path: ctx.path,
3162
+ code: "invalid_union",
3163
+ unionErrors: errors,
3164
+ message: "Invalid input: Should pass single schema. Passed " + passed
3165
+ } : {
3166
+ path: ctx.path,
3167
+ code: "custom",
3168
+ message: "Invalid input: Should pass single schema. Passed " + passed
3169
+ });
3170
+ }).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(),
1938
3171
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
1939
3172
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1940
3173
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1941
3174
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1942
3175
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1943
3176
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1944
- }).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.")))
3177
+ }).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({
3178
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3179
+ "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()
3180
+ }).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.")))
1945
3181
  })).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.");
1946
3182
  const ProfileSchemaBusinessProfileSchema = z$1.intersection(z$1.object({
1947
3183
  "ucp": z$1.object({
1948
3184
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
3185
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1949
3186
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1950
3187
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1951
3188
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -1967,14 +3204,31 @@ const ProfileSchemaBusinessProfileSchema = z$1.intersection(z$1.object({
1967
3204
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1968
3205
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1969
3206
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1970
- }).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(),
3207
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
3208
+ 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)];
3209
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
3210
+ const passed = schemas.length - errors.length;
3211
+ if (passed !== 1) ctx.addIssue(errors.length ? {
3212
+ path: ctx.path,
3213
+ code: "invalid_union",
3214
+ unionErrors: errors,
3215
+ message: "Invalid input: Should pass single schema. Passed " + passed
3216
+ } : {
3217
+ path: ctx.path,
3218
+ code: "custom",
3219
+ message: "Invalid input: Should pass single schema. Passed " + passed
3220
+ });
3221
+ }).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(),
1971
3222
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
1972
3223
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1973
3224
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
1974
3225
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
1975
3226
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
1976
3227
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
1977
- }).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()
3228
+ }).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({
3229
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3230
+ "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()
3231
+ }).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()
1978
3232
  }).describe("Base UCP metadata with shared properties for all schema types."),
1979
3233
  "signing_keys": z$1.array(z$1.object({
1980
3234
  "kid": z$1.string().describe("Key ID. Referenced in signature headers to identify which key to use for verification."),
@@ -1989,6 +3243,7 @@ const ProfileSchemaBusinessProfileSchema = z$1.intersection(z$1.object({
1989
3243
  }).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()
1990
3244
  }).passthrough().describe("Base discovery profile with shared properties for all profile types."), z$1.object({ "ucp": z$1.intersection(z$1.object({
1991
3245
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
3246
+ "status": z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.").default("success"),
1992
3247
  "services": z$1.record(z$1.array(z$1.intersection(z$1.object({
1993
3248
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
1994
3249
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -2010,15 +3265,33 @@ const ProfileSchemaBusinessProfileSchema = z$1.intersection(z$1.object({
2010
3265
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2011
3266
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2012
3267
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2013
- }).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(),
3268
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
3269
+ 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)];
3270
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
3271
+ const passed = schemas.length - errors.length;
3272
+ if (passed !== 1) ctx.addIssue(errors.length ? {
3273
+ path: ctx.path,
3274
+ code: "invalid_union",
3275
+ unionErrors: errors,
3276
+ message: "Invalid input: Should pass single schema. Passed " + passed
3277
+ } : {
3278
+ path: ctx.path,
3279
+ code: "custom",
3280
+ message: "Invalid input: Should pass single schema. Passed " + passed
3281
+ });
3282
+ }).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(),
2014
3283
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2015
3284
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2016
3285
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2017
3286
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2018
3287
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2019
3288
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2020
- }).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()
3289
+ }).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({
3290
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3291
+ "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()
3292
+ }).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()
2021
3293
  }).describe("Base UCP metadata with shared properties for all schema types."), z$1.object({
3294
+ "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(),
2022
3295
  "services": z$1.record(z$1.array(z$1.intersection(z$1.intersection(z$1.object({
2023
3296
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2024
3297
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
@@ -2039,7 +3312,10 @@ const ProfileSchemaBusinessProfileSchema = z$1.intersection(z$1.object({
2039
3312
  z$1.object({ "transport": z$1.literal("a2a").optional() }),
2040
3313
  z$1.object({
2041
3314
  "transport": z$1.literal("embedded").optional(),
2042
- "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()
3315
+ "config": z$1.object({
3316
+ "delegate": z$1.array(z$1.string()).describe("Delegations the business allows. At service-level, declares available delegations. In UCP responses, confirms accepted delegations for this session.").optional(),
3317
+ "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()
3318
+ }).describe("Per-session configuration for embedded transport binding. Allows businesses to vary EP availability and delegations based on cart contents, agent authorization, or policy.").optional()
2043
3319
  })
2044
3320
  ])).describe("Service binding for business/merchant configuration. May override platform endpoints."))),
2045
3321
  "capabilities": z$1.record(z$1.array(z$1.intersection(z$1.object({
@@ -2048,14 +3324,31 @@ const ProfileSchemaBusinessProfileSchema = z$1.intersection(z$1.object({
2048
3324
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2049
3325
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2050
3326
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2051
- }).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(),
3327
+ }).describe("Shared foundation for all UCP entities."), z$1.object({ "extends": z$1.unknown().superRefine((x, ctx) => {
3328
+ 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)];
3329
+ const errors = schemas.reduce((errors, schema) => ((result) => result.error ? [...errors, result.error] : errors)(schema.safeParse(x)), []);
3330
+ const passed = schemas.length - errors.length;
3331
+ if (passed !== 1) ctx.addIssue(errors.length ? {
3332
+ path: ctx.path,
3333
+ code: "invalid_union",
3334
+ unionErrors: errors,
3335
+ message: "Invalid input: Should pass single schema. Passed " + passed
3336
+ } : {
3337
+ path: ctx.path,
3338
+ code: "custom",
3339
+ message: "Invalid input: Should pass single schema. Passed " + passed
3340
+ });
3341
+ }).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(),
2052
3342
  "payment_handlers": z$1.record(z$1.array(z$1.intersection(z$1.object({
2053
3343
  "version": z$1.string().regex(/* @__PURE__ */ new RegExp("^\\d{4}-\\d{2}-\\d{2}$")).describe("UCP version in YYYY-MM-DD format."),
2054
3344
  "spec": z$1.string().url().describe("URL to human-readable specification document.").optional(),
2055
3345
  "schema": z$1.string().url().describe("URL to JSON Schema defining this entity's structure and payloads.").optional(),
2056
3346
  "id": z$1.string().describe("Unique identifier for this entity instance. Used to disambiguate when multiple instances exist.").optional(),
2057
3347
  "config": z$1.record(z$1.string(), z$1.unknown()).describe("Entity-specific configuration. Structure defined by each entity's schema.").optional()
2058
- }).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.")))
3348
+ }).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({
3349
+ "type": z$1.string().describe("The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."),
3350
+ "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()
3351
+ }).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.")))
2059
3352
  })).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.");
2060
3353
  const ServiceBaseTransportEnumSchema = z$1.enum([
2061
3354
  "rest",
@@ -2093,24 +3386,18 @@ const MessageErrorContentTypeEnumSchema = z$1.enum(["plain", "markdown"]).descri
2093
3386
  const MessageErrorSeverityEnumSchema = z$1.enum([
2094
3387
  "recoverable",
2095
3388
  "requires_buyer_input",
2096
- "requires_buyer_review"
2097
- ]).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'.");
3389
+ "requires_buyer_review",
3390
+ "unrecoverable"
3391
+ ]).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'.");
2098
3392
  const MessageInfoContentTypeEnumSchema = z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.");
2099
3393
  const MessageWarningContentTypeEnumSchema = z$1.enum(["plain", "markdown"]).describe("Content format, default = plain.");
2100
3394
  const OrderLineItemStatusEnumSchema = z$1.enum([
2101
3395
  "processing",
2102
3396
  "partial",
2103
- "fulfilled"
2104
- ]).describe("Derived status: fulfilled if quantity.fulfilled == quantity.total, partial if quantity.fulfilled > 0, otherwise processing.");
2105
- const TotalTypeEnumSchema = z$1.enum([
2106
- "items_discount",
2107
- "subtotal",
2108
- "discount",
2109
- "fulfillment",
2110
- "tax",
2111
- "fee",
2112
- "total"
2113
- ]).describe("Type of total categorization.");
3397
+ "fulfilled",
3398
+ "removed"
3399
+ ]).describe("Derived status: removed if quantity.total == 0, fulfilled if quantity.total > 0 and quantity.fulfilled == quantity.total, partial if quantity.total > 0 and quantity.fulfilled > 0, otherwise processing.");
3400
+ const UcpBaseStatusEnumSchema = z$1.enum(["success", "error"]).describe("Application-level status of the UCP operation.");
2114
3401
  const ProfileSchemaSigningKeyUseEnumSchema = z$1.enum(["sig", "enc"]).describe("Key usage. Should be 'sig' for signing keys.");
2115
3402
  //#endregion
2116
3403
  //#region src/extensions.ts
@@ -2129,4 +3416,4 @@ const UcpSigningKeySchema = ProfileSchemaSigningKeySchema;
2129
3416
  const CheckoutResponseSchema = CheckoutSchema.passthrough();
2130
3417
  const OrderUpdateSchema = OrderSchema;
2131
3418
  //#endregion
2132
- export { AccountInfoSchema, AdjustmentSchema, AdjustmentStatusEnumSchema, Ap2MandateAp2WithCheckoutMandateSchema, Ap2MandateAp2WithMerchantAuthorizationSchema, Ap2MandateCheckoutMandateSchema, Ap2MandateErrorCodeSchema, Ap2MandateMerchantAuthorizationSchema, BindingSchema, BusinessFulfillmentConfigSchema, BuyerConsentBuyerSchema, BuyerConsentConsentSchema, BuyerSchema, CapabilityBaseSchema, CapabilityBusinessSchema, CapabilityPlatformSchema, CapabilityResponseSchema, CardCredentialCardNumberTypeEnumSchema, CardCredentialSchema, CardPaymentInstrumentSchema, CheckoutCompleteRequestSchema, CheckoutCreateRequestSchema, CheckoutResponseSchema, CheckoutResponseStatusSchema, CheckoutSchema, CheckoutStatusEnumSchema, CheckoutUpdateRequestSchema, ContextSchema, DiscountAllocationSchema, DiscountAppliedDiscountMethodEnumSchema, DiscountAppliedDiscountSchema, DiscountDiscountsObjectSchema, EmbeddedConfigSchema, ExpectationMethodTypeEnumSchema, ExpectationSchema, FulfillmentAvailableMethodSchema, FulfillmentAvailableMethodTypeEnumSchema, FulfillmentDestinationSchema, FulfillmentEventSchema, FulfillmentExtensionFulfillmentAvailableMethodSchema, FulfillmentExtensionFulfillmentGroupSchema, FulfillmentExtensionFulfillmentMethodSchema, FulfillmentExtensionFulfillmentOptionSchema, FulfillmentExtensionFulfillmentSchema, FulfillmentGroupSchema, FulfillmentGroupUpdateRequestSchema, FulfillmentMethodCreateRequestSchema, FulfillmentMethodResponseSchema, FulfillmentMethodSchema, FulfillmentMethodTypeEnumSchema, FulfillmentMethodUpdateRequestSchema, FulfillmentOptionSchema, FulfillmentResponseSchema, FulfillmentSchema, ItemResponseSchema, ItemSchema, LineItemResponseSchema, LineItemSchema, LineItemUpdateRequestSchema, LinkSchema, MerchantFulfillmentConfigSchema, MessageErrorContentTypeEnumSchema, MessageErrorSchema, MessageErrorSeverityEnumSchema, MessageInfoContentTypeEnumSchema, MessageInfoSchema, MessageSchema, MessageWarningContentTypeEnumSchema, MessageWarningSchema, OrderConfirmationSchema, OrderLineItemSchema, OrderLineItemStatusEnumSchema, OrderSchema, OrderUpdateSchema, PaymentCredentialSchema, PaymentHandlerBaseSchema, PaymentHandlerBusinessSchema, PaymentHandlerPlatformSchema, PaymentHandlerResponseSchema, PaymentIdentitySchema, PaymentInstrumentResponseSchema, PaymentInstrumentSchema, PaymentResponseSchema, PaymentSchema, PlatformFulfillmentConfigSchema, PostalAddressSchema, ProfileSchemaBaseSchema, ProfileSchemaBusinessProfileSchema, ProfileSchemaPlatformProfileSchema, ProfileSchemaSigningKeySchema, ProfileSchemaSigningKeyUseEnumSchema, RetailLocationSchema, ServiceBaseSchema, ServiceBaseTransportEnumSchema, ServiceBusinessSchema, ServicePlatformSchema, ServiceResponseSchema, ShippingDestinationSchema, TokenCredentialSchema, TotalResponseSchema, TotalSchema, TotalTypeEnumSchema, UcpBaseSchema, UcpBusinessSchema, UcpDiscoveryBusinessProfileSchema, UcpDiscoveryPlatformProfileSchema, UcpDiscoveryProfileSchema, UcpEntitySchema, UcpPlatformSchema, UcpResponseCheckoutSchema, UcpResponseOrderSchema, UcpReverseDomainNameSchema, UcpSigningKeySchema, UcpVersionSchema };
3419
+ 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, DetailOptionValueSchema, 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, 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, UcpErrorSchema, UcpPlatformSchema, UcpRequiresSchema, UcpResponseCartSchema, UcpResponseCatalogSchema, UcpResponseCheckoutSchema, UcpResponseOrderSchema, UcpSigningKeySchema, UcpSuccessSchema, UcpVersionConstraintSchema, UcpVersionSchema, VariantSchema };