@ucptools/validator 1.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.
Files changed (121) hide show
  1. package/CLAUDE.md +109 -0
  2. package/CONTRIBUTING.md +113 -0
  3. package/LICENSE +21 -0
  4. package/README.md +203 -0
  5. package/api/analyze-feed.js +140 -0
  6. package/api/badge.js +185 -0
  7. package/api/benchmark.js +177 -0
  8. package/api/directory-stats.ts +29 -0
  9. package/api/directory.ts +73 -0
  10. package/api/generate-compliance.js +143 -0
  11. package/api/generate-schema.js +457 -0
  12. package/api/generate.js +132 -0
  13. package/api/security-scan.js +133 -0
  14. package/api/simulate.js +187 -0
  15. package/api/tsconfig.json +10 -0
  16. package/api/validate.js +1351 -0
  17. package/apify-actor/.actor/actor.json +68 -0
  18. package/apify-actor/.actor/input_schema.json +32 -0
  19. package/apify-actor/APIFY-STORE-LISTING.md +412 -0
  20. package/apify-actor/Dockerfile +8 -0
  21. package/apify-actor/README.md +166 -0
  22. package/apify-actor/main.ts +111 -0
  23. package/apify-actor/package.json +17 -0
  24. package/apify-actor/src/main.js +199 -0
  25. package/docs/BRAND-IDENTITY.md +238 -0
  26. package/docs/BRAND-STYLE-GUIDE.md +356 -0
  27. package/drizzle/0000_black_king_cobra.sql +39 -0
  28. package/drizzle/meta/0000_snapshot.json +309 -0
  29. package/drizzle/meta/_journal.json +13 -0
  30. package/drizzle.config.ts +10 -0
  31. package/examples/full-profile.json +70 -0
  32. package/examples/minimal-profile.json +23 -0
  33. package/package.json +69 -0
  34. package/public/.well-known/ucp +25 -0
  35. package/public/android-chrome-192x192.png +0 -0
  36. package/public/android-chrome-512x512.png +0 -0
  37. package/public/apple-touch-icon.png +0 -0
  38. package/public/brand.css +321 -0
  39. package/public/directory.html +701 -0
  40. package/public/favicon-16x16.png +0 -0
  41. package/public/favicon-32x32.png +0 -0
  42. package/public/favicon.ico +0 -0
  43. package/public/guides/bigcommerce.html +743 -0
  44. package/public/guides/fastucp.html +838 -0
  45. package/public/guides/magento.html +779 -0
  46. package/public/guides/shopify.html +726 -0
  47. package/public/guides/squarespace.html +749 -0
  48. package/public/guides/wix.html +747 -0
  49. package/public/guides/woocommerce.html +733 -0
  50. package/public/index.html +3835 -0
  51. package/public/learn.html +396 -0
  52. package/public/logo.jpeg +0 -0
  53. package/public/og-image-icon.png +0 -0
  54. package/public/og-image.png +0 -0
  55. package/public/robots.txt +6 -0
  56. package/public/site.webmanifest +31 -0
  57. package/public/sitemap.xml +69 -0
  58. package/public/social/linkedin-banner-1128x191.png +0 -0
  59. package/public/social/temp.PNG +0 -0
  60. package/public/social/x-header-1500x500.png +0 -0
  61. package/public/verify.html +410 -0
  62. package/scripts/generate-favicons.js +44 -0
  63. package/scripts/generate-ico.js +23 -0
  64. package/scripts/generate-og-image.js +45 -0
  65. package/scripts/reset-db.ts +77 -0
  66. package/scripts/seed-db.ts +71 -0
  67. package/scripts/setup-benchmark-db.js +70 -0
  68. package/src/api/server.ts +266 -0
  69. package/src/cli/index.ts +302 -0
  70. package/src/compliance/compliance-generator.ts +452 -0
  71. package/src/compliance/index.ts +28 -0
  72. package/src/compliance/templates.ts +338 -0
  73. package/src/compliance/types.ts +170 -0
  74. package/src/db/index.ts +28 -0
  75. package/src/db/schema.ts +84 -0
  76. package/src/feed-analyzer/feed-analyzer.ts +726 -0
  77. package/src/feed-analyzer/index.ts +34 -0
  78. package/src/feed-analyzer/types.ts +354 -0
  79. package/src/generator/index.ts +7 -0
  80. package/src/generator/key-generator.ts +124 -0
  81. package/src/generator/profile-builder.ts +402 -0
  82. package/src/hosting/artifacts-generator.ts +679 -0
  83. package/src/hosting/index.ts +6 -0
  84. package/src/index.ts +105 -0
  85. package/src/security/index.ts +15 -0
  86. package/src/security/security-scanner.ts +604 -0
  87. package/src/security/types.ts +55 -0
  88. package/src/services/directory.ts +434 -0
  89. package/src/simulator/agent-simulator.ts +941 -0
  90. package/src/simulator/index.ts +7 -0
  91. package/src/simulator/types.ts +170 -0
  92. package/src/types/generator.ts +140 -0
  93. package/src/types/index.ts +7 -0
  94. package/src/types/ucp-profile.ts +140 -0
  95. package/src/types/validation.ts +89 -0
  96. package/src/validator/index.ts +194 -0
  97. package/src/validator/network-validator.ts +417 -0
  98. package/src/validator/rules-validator.ts +297 -0
  99. package/src/validator/sdk-validator.ts +330 -0
  100. package/src/validator/structural-validator.ts +476 -0
  101. package/tests/fixtures/non-compliant-profile.json +25 -0
  102. package/tests/fixtures/official-sample-profile.json +75 -0
  103. package/tests/integration/benchmark.test.ts +207 -0
  104. package/tests/integration/database.test.ts +163 -0
  105. package/tests/integration/directory-api.test.ts +268 -0
  106. package/tests/integration/simulate-api.test.ts +230 -0
  107. package/tests/integration/validate-api.test.ts +269 -0
  108. package/tests/setup.ts +15 -0
  109. package/tests/unit/agent-simulator.test.ts +575 -0
  110. package/tests/unit/compliance-generator.test.ts +374 -0
  111. package/tests/unit/directory-service.test.ts +272 -0
  112. package/tests/unit/feed-analyzer.test.ts +517 -0
  113. package/tests/unit/lint-suggestions.test.ts +423 -0
  114. package/tests/unit/official-samples.test.ts +211 -0
  115. package/tests/unit/pdf-report.test.ts +390 -0
  116. package/tests/unit/sdk-validator.test.ts +531 -0
  117. package/tests/unit/security-scanner.test.ts +410 -0
  118. package/tests/unit/validation.test.ts +390 -0
  119. package/tsconfig.json +20 -0
  120. package/vercel.json +34 -0
  121. package/vitest.config.ts +22 -0
@@ -0,0 +1,476 @@
1
+ /**
2
+ * Structural Validator
3
+ * Validates UCP Profile JSON structure (no network calls)
4
+ */
5
+
6
+ import type { UcpProfile, UcpService, UcpCapability } from '../types/ucp-profile.js';
7
+ import type { ValidationIssue } from '../types/validation.js';
8
+ import { ValidationErrorCodes } from '../types/validation.js';
9
+
10
+ /**
11
+ * Version format regex (YYYY-MM-DD)
12
+ */
13
+ const VERSION_REGEX = /^\d{4}-\d{2}-\d{2}$/;
14
+
15
+ /**
16
+ * Validate the structural integrity of a UCP profile
17
+ * Returns an array of validation issues
18
+ */
19
+ export function validateStructure(profile: unknown): ValidationIssue[] {
20
+ const issues: ValidationIssue[] = [];
21
+
22
+ // Check if it's an object
23
+ if (!profile || typeof profile !== 'object') {
24
+ issues.push({
25
+ severity: 'error',
26
+ code: ValidationErrorCodes.MISSING_UCP_OBJECT,
27
+ path: '$',
28
+ message: 'Profile must be a JSON object',
29
+ hint: 'Ensure your profile is valid JSON and contains a root object',
30
+ });
31
+ return issues;
32
+ }
33
+
34
+ const profileObj = profile as Record<string, unknown>;
35
+
36
+ // Check for ucp root object
37
+ if (!profileObj.ucp || typeof profileObj.ucp !== 'object') {
38
+ issues.push({
39
+ severity: 'error',
40
+ code: ValidationErrorCodes.MISSING_UCP_OBJECT,
41
+ path: '$.ucp',
42
+ message: 'Missing required "ucp" object at root level',
43
+ hint: 'Add a "ucp" object containing version, services, and capabilities',
44
+ });
45
+ return issues;
46
+ }
47
+
48
+ const ucp = profileObj.ucp as Record<string, unknown>;
49
+
50
+ // Validate version
51
+ issues.push(...validateVersion(ucp));
52
+
53
+ // Validate services
54
+ issues.push(...validateServices(ucp));
55
+
56
+ // Validate capabilities
57
+ issues.push(...validateCapabilities(ucp));
58
+
59
+ // Validate signing_keys if present
60
+ if (profileObj.signing_keys !== undefined) {
61
+ issues.push(...validateSigningKeys(profileObj.signing_keys));
62
+ }
63
+
64
+ return issues;
65
+ }
66
+
67
+ /**
68
+ * Validate UCP version field
69
+ */
70
+ function validateVersion(ucp: Record<string, unknown>): ValidationIssue[] {
71
+ const issues: ValidationIssue[] = [];
72
+
73
+ if (!ucp.version) {
74
+ issues.push({
75
+ severity: 'error',
76
+ code: ValidationErrorCodes.MISSING_VERSION,
77
+ path: '$.ucp.version',
78
+ message: 'Missing required "version" field in ucp object',
79
+ hint: 'Add version field with format "YYYY-MM-DD" (e.g., "2026-01-11")',
80
+ });
81
+ } else if (typeof ucp.version !== 'string') {
82
+ issues.push({
83
+ severity: 'error',
84
+ code: ValidationErrorCodes.INVALID_VERSION_FORMAT,
85
+ path: '$.ucp.version',
86
+ message: 'Version must be a string',
87
+ hint: 'Use format "YYYY-MM-DD" (e.g., "2026-01-11")',
88
+ });
89
+ } else if (!VERSION_REGEX.test(ucp.version)) {
90
+ issues.push({
91
+ severity: 'error',
92
+ code: ValidationErrorCodes.INVALID_VERSION_FORMAT,
93
+ path: '$.ucp.version',
94
+ message: `Invalid version format: "${ucp.version}"`,
95
+ hint: 'Use format "YYYY-MM-DD" (e.g., "2026-01-11")',
96
+ });
97
+ }
98
+
99
+ return issues;
100
+ }
101
+
102
+ /**
103
+ * Validate services object
104
+ */
105
+ function validateServices(ucp: Record<string, unknown>): ValidationIssue[] {
106
+ const issues: ValidationIssue[] = [];
107
+
108
+ if (!ucp.services) {
109
+ issues.push({
110
+ severity: 'error',
111
+ code: ValidationErrorCodes.MISSING_SERVICES,
112
+ path: '$.ucp.services',
113
+ message: 'Missing required "services" field in ucp object',
114
+ hint: 'Add a services object with at least one service definition',
115
+ });
116
+ return issues;
117
+ }
118
+
119
+ if (typeof ucp.services !== 'object' || Array.isArray(ucp.services)) {
120
+ issues.push({
121
+ severity: 'error',
122
+ code: ValidationErrorCodes.INVALID_SERVICE_STRUCTURE,
123
+ path: '$.ucp.services',
124
+ message: 'Services must be an object (not an array)',
125
+ hint: 'Use format: { "dev.ucp.shopping": { ... } }',
126
+ });
127
+ return issues;
128
+ }
129
+
130
+ const services = ucp.services as Record<string, unknown>;
131
+
132
+ // Check for at least one service
133
+ if (Object.keys(services).length === 0) {
134
+ issues.push({
135
+ severity: 'warn',
136
+ code: ValidationErrorCodes.MISSING_SERVICES,
137
+ path: '$.ucp.services',
138
+ message: 'Services object is empty',
139
+ hint: 'Add at least one service (e.g., "dev.ucp.shopping")',
140
+ });
141
+ }
142
+
143
+ // Validate each service
144
+ for (const [serviceName, service] of Object.entries(services)) {
145
+ issues.push(...validateService(serviceName, service));
146
+ }
147
+
148
+ return issues;
149
+ }
150
+
151
+ /**
152
+ * Validate individual service definition
153
+ */
154
+ function validateService(name: string, service: unknown): ValidationIssue[] {
155
+ const issues: ValidationIssue[] = [];
156
+ const path = `$.ucp.services["${name}"]`;
157
+
158
+ if (!service || typeof service !== 'object') {
159
+ issues.push({
160
+ severity: 'error',
161
+ code: ValidationErrorCodes.INVALID_SERVICE_STRUCTURE,
162
+ path,
163
+ message: `Service "${name}" must be an object`,
164
+ });
165
+ return issues;
166
+ }
167
+
168
+ const svc = service as Record<string, unknown>;
169
+
170
+ // Check required version
171
+ if (!svc.version) {
172
+ issues.push({
173
+ severity: 'error',
174
+ code: ValidationErrorCodes.INVALID_SERVICE_STRUCTURE,
175
+ path: `${path}.version`,
176
+ message: `Service "${name}" missing required "version" field`,
177
+ });
178
+ } else if (typeof svc.version === 'string' && !VERSION_REGEX.test(svc.version)) {
179
+ issues.push({
180
+ severity: 'error',
181
+ code: ValidationErrorCodes.INVALID_VERSION_FORMAT,
182
+ path: `${path}.version`,
183
+ message: `Invalid version format in service "${name}"`,
184
+ hint: 'Use format "YYYY-MM-DD"',
185
+ });
186
+ }
187
+
188
+ // Check required spec
189
+ if (!svc.spec) {
190
+ issues.push({
191
+ severity: 'error',
192
+ code: ValidationErrorCodes.INVALID_SERVICE_STRUCTURE,
193
+ path: `${path}.spec`,
194
+ message: `Service "${name}" missing required "spec" field`,
195
+ });
196
+ }
197
+
198
+ // Check for at least one transport
199
+ const hasTransport = svc.rest || svc.mcp || svc.a2a || svc.embedded;
200
+ if (!hasTransport) {
201
+ issues.push({
202
+ severity: 'warn',
203
+ code: ValidationErrorCodes.INVALID_SERVICE_STRUCTURE,
204
+ path,
205
+ message: `Service "${name}" has no transport bindings`,
206
+ hint: 'Add at least one transport: rest, mcp, a2a, or embedded',
207
+ });
208
+ }
209
+
210
+ // Validate REST transport if present
211
+ if (svc.rest) {
212
+ issues.push(...validateRestTransport(svc.rest, `${path}.rest`));
213
+ }
214
+
215
+ // Validate MCP transport if present
216
+ if (svc.mcp) {
217
+ issues.push(...validateMcpTransport(svc.mcp, `${path}.mcp`));
218
+ }
219
+
220
+ return issues;
221
+ }
222
+
223
+ /**
224
+ * Validate REST transport binding
225
+ */
226
+ function validateRestTransport(transport: unknown, path: string): ValidationIssue[] {
227
+ const issues: ValidationIssue[] = [];
228
+
229
+ if (!transport || typeof transport !== 'object') {
230
+ issues.push({
231
+ severity: 'error',
232
+ code: ValidationErrorCodes.INVALID_SERVICE_STRUCTURE,
233
+ path,
234
+ message: 'REST transport must be an object',
235
+ });
236
+ return issues;
237
+ }
238
+
239
+ const rest = transport as Record<string, unknown>;
240
+
241
+ if (!rest.schema) {
242
+ issues.push({
243
+ severity: 'error',
244
+ code: ValidationErrorCodes.INVALID_SERVICE_STRUCTURE,
245
+ path: `${path}.schema`,
246
+ message: 'REST transport missing required "schema" field',
247
+ });
248
+ }
249
+
250
+ if (!rest.endpoint) {
251
+ issues.push({
252
+ severity: 'error',
253
+ code: ValidationErrorCodes.INVALID_SERVICE_STRUCTURE,
254
+ path: `${path}.endpoint`,
255
+ message: 'REST transport missing required "endpoint" field',
256
+ });
257
+ }
258
+
259
+ return issues;
260
+ }
261
+
262
+ /**
263
+ * Validate MCP transport binding
264
+ */
265
+ function validateMcpTransport(transport: unknown, path: string): ValidationIssue[] {
266
+ const issues: ValidationIssue[] = [];
267
+
268
+ if (!transport || typeof transport !== 'object') {
269
+ issues.push({
270
+ severity: 'error',
271
+ code: ValidationErrorCodes.INVALID_SERVICE_STRUCTURE,
272
+ path,
273
+ message: 'MCP transport must be an object',
274
+ });
275
+ return issues;
276
+ }
277
+
278
+ const mcp = transport as Record<string, unknown>;
279
+
280
+ if (!mcp.schema) {
281
+ issues.push({
282
+ severity: 'error',
283
+ code: ValidationErrorCodes.INVALID_SERVICE_STRUCTURE,
284
+ path: `${path}.schema`,
285
+ message: 'MCP transport missing required "schema" field',
286
+ });
287
+ }
288
+
289
+ if (!mcp.endpoint) {
290
+ issues.push({
291
+ severity: 'error',
292
+ code: ValidationErrorCodes.INVALID_SERVICE_STRUCTURE,
293
+ path: `${path}.endpoint`,
294
+ message: 'MCP transport missing required "endpoint" field',
295
+ });
296
+ }
297
+
298
+ return issues;
299
+ }
300
+
301
+ /**
302
+ * Validate capabilities array
303
+ */
304
+ function validateCapabilities(ucp: Record<string, unknown>): ValidationIssue[] {
305
+ const issues: ValidationIssue[] = [];
306
+
307
+ if (!ucp.capabilities) {
308
+ issues.push({
309
+ severity: 'error',
310
+ code: ValidationErrorCodes.MISSING_CAPABILITIES,
311
+ path: '$.ucp.capabilities',
312
+ message: 'Missing required "capabilities" field in ucp object',
313
+ hint: 'Add a capabilities array with at least one capability',
314
+ });
315
+ return issues;
316
+ }
317
+
318
+ if (!Array.isArray(ucp.capabilities)) {
319
+ issues.push({
320
+ severity: 'error',
321
+ code: ValidationErrorCodes.INVALID_CAPABILITY_STRUCTURE,
322
+ path: '$.ucp.capabilities',
323
+ message: 'Capabilities must be an array',
324
+ });
325
+ return issues;
326
+ }
327
+
328
+ if (ucp.capabilities.length === 0) {
329
+ issues.push({
330
+ severity: 'warn',
331
+ code: ValidationErrorCodes.MISSING_CAPABILITIES,
332
+ path: '$.ucp.capabilities',
333
+ message: 'Capabilities array is empty',
334
+ hint: 'Add at least one capability (e.g., dev.ucp.shopping.checkout)',
335
+ });
336
+ }
337
+
338
+ // Validate each capability
339
+ for (let i = 0; i < ucp.capabilities.length; i++) {
340
+ issues.push(...validateCapability(ucp.capabilities[i], i));
341
+ }
342
+
343
+ return issues;
344
+ }
345
+
346
+ /**
347
+ * Validate individual capability
348
+ */
349
+ function validateCapability(capability: unknown, index: number): ValidationIssue[] {
350
+ const issues: ValidationIssue[] = [];
351
+ const path = `$.ucp.capabilities[${index}]`;
352
+
353
+ if (!capability || typeof capability !== 'object') {
354
+ issues.push({
355
+ severity: 'error',
356
+ code: ValidationErrorCodes.INVALID_CAPABILITY_STRUCTURE,
357
+ path,
358
+ message: `Capability at index ${index} must be an object`,
359
+ });
360
+ return issues;
361
+ }
362
+
363
+ const cap = capability as Record<string, unknown>;
364
+
365
+ // Check required fields
366
+ if (!cap.name) {
367
+ issues.push({
368
+ severity: 'error',
369
+ code: ValidationErrorCodes.INVALID_CAPABILITY_STRUCTURE,
370
+ path: `${path}.name`,
371
+ message: 'Capability missing required "name" field',
372
+ });
373
+ }
374
+
375
+ if (!cap.version) {
376
+ issues.push({
377
+ severity: 'error',
378
+ code: ValidationErrorCodes.INVALID_CAPABILITY_STRUCTURE,
379
+ path: `${path}.version`,
380
+ message: 'Capability missing required "version" field',
381
+ });
382
+ } else if (typeof cap.version === 'string' && !VERSION_REGEX.test(cap.version)) {
383
+ issues.push({
384
+ severity: 'error',
385
+ code: ValidationErrorCodes.INVALID_VERSION_FORMAT,
386
+ path: `${path}.version`,
387
+ message: `Invalid version format: "${cap.version}"`,
388
+ hint: 'Use format "YYYY-MM-DD"',
389
+ });
390
+ }
391
+
392
+ if (!cap.spec) {
393
+ issues.push({
394
+ severity: 'error',
395
+ code: ValidationErrorCodes.INVALID_CAPABILITY_STRUCTURE,
396
+ path: `${path}.spec`,
397
+ message: 'Capability missing required "spec" field',
398
+ });
399
+ }
400
+
401
+ if (!cap.schema) {
402
+ issues.push({
403
+ severity: 'error',
404
+ code: ValidationErrorCodes.INVALID_CAPABILITY_STRUCTURE,
405
+ path: `${path}.schema`,
406
+ message: 'Capability missing required "schema" field',
407
+ });
408
+ }
409
+
410
+ return issues;
411
+ }
412
+
413
+ /**
414
+ * Validate signing_keys structure
415
+ * Accepts signing_keys as a direct array of JWKs (official UCP format)
416
+ */
417
+ function validateSigningKeys(signingKeys: unknown): ValidationIssue[] {
418
+ const issues: ValidationIssue[] = [];
419
+ const path = '$.signing_keys';
420
+
421
+ // signing_keys should be an array of JWKs
422
+ if (!Array.isArray(signingKeys)) {
423
+ issues.push({
424
+ severity: 'error',
425
+ code: ValidationErrorCodes.INVALID_SIGNING_KEY,
426
+ path,
427
+ message: 'signing_keys must be an array of JWK objects',
428
+ });
429
+ return issues;
430
+ }
431
+
432
+ for (let i = 0; i < signingKeys.length; i++) {
433
+ issues.push(...validateJwk(signingKeys[i], `${path}[${i}]`));
434
+ }
435
+
436
+ return issues;
437
+ }
438
+
439
+ /**
440
+ * Validate JWK structure
441
+ */
442
+ function validateJwk(jwk: unknown, path: string): ValidationIssue[] {
443
+ const issues: ValidationIssue[] = [];
444
+
445
+ if (!jwk || typeof jwk !== 'object') {
446
+ issues.push({
447
+ severity: 'error',
448
+ code: ValidationErrorCodes.INVALID_SIGNING_KEY,
449
+ path,
450
+ message: 'JWK must be an object',
451
+ });
452
+ return issues;
453
+ }
454
+
455
+ const key = jwk as Record<string, unknown>;
456
+
457
+ if (!key.kty) {
458
+ issues.push({
459
+ severity: 'error',
460
+ code: ValidationErrorCodes.INVALID_SIGNING_KEY,
461
+ path: `${path}.kty`,
462
+ message: 'JWK missing required "kty" field',
463
+ });
464
+ }
465
+
466
+ if (!key.kid) {
467
+ issues.push({
468
+ severity: 'error',
469
+ code: ValidationErrorCodes.INVALID_SIGNING_KEY,
470
+ path: `${path}.kid`,
471
+ message: 'JWK missing required "kid" field',
472
+ });
473
+ }
474
+
475
+ return issues;
476
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "ucp": {
3
+ "version": "1.0",
4
+ "services": {
5
+ "checkout": "/api/ucp/checkout",
6
+ "orders": "/api/ucp/orders",
7
+ "products": "/api/ucp/products"
8
+ },
9
+ "capabilities": [
10
+ "dev.ucp.shopping.checkout",
11
+ "dev.ucp.shopping.catalog",
12
+ "dev.ucp.shopping.fulfillment"
13
+ ],
14
+ "merchant": {
15
+ "name": "Test Merchant",
16
+ "description": "A non-compliant but working UCP profile",
17
+ "website": "https://example.com"
18
+ },
19
+ "sandbox": true
20
+ },
21
+ "payment": {
22
+ "sandbox_mode": true,
23
+ "accepted_tokens": ["sandbox_*", "test"]
24
+ }
25
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "ucp": {
3
+ "version": "2026-01-11",
4
+ "services": {
5
+ "dev.ucp.shopping": {
6
+ "version": "2026-01-11",
7
+ "spec": "https://ucp.dev/specs/shopping",
8
+ "rest": {
9
+ "schema": "https://ucp.dev/services/shopping/openapi.json",
10
+ "endpoint": "https://example.com/api"
11
+ }
12
+ }
13
+ },
14
+ "capabilities": [
15
+ {
16
+ "name": "dev.ucp.shopping.checkout",
17
+ "version": "2026-01-11",
18
+ "spec": "https://ucp.dev/specs/shopping/checkout",
19
+ "schema": "https://ucp.dev/schemas/shopping/checkout.json"
20
+ },
21
+ {
22
+ "name": "dev.ucp.shopping.order",
23
+ "version": "2026-01-11",
24
+ "spec": "https://ucp.dev/specs/shopping/order",
25
+ "schema": "https://ucp.dev/schemas/shopping/order.json",
26
+ "extends": "dev.ucp.shopping.checkout"
27
+ },
28
+ {
29
+ "name": "dev.ucp.shopping.fulfillment",
30
+ "version": "2026-01-11",
31
+ "spec": "https://ucp.dev/specs/shopping/fulfillment",
32
+ "schema": "https://ucp.dev/schemas/shopping/fulfillment.json",
33
+ "extends": "dev.ucp.shopping.order"
34
+ },
35
+ {
36
+ "name": "dev.ucp.shopping.discount",
37
+ "version": "2026-01-11",
38
+ "spec": "https://ucp.dev/specs/shopping/discount",
39
+ "schema": "https://ucp.dev/schemas/shopping/discount.json",
40
+ "extends": "dev.ucp.shopping.checkout"
41
+ },
42
+ {
43
+ "name": "dev.ucp.shopping.buyer_consent",
44
+ "version": "2026-01-11",
45
+ "spec": "https://ucp.dev/specs/shopping/buyer_consent",
46
+ "schema": "https://ucp.dev/schemas/shopping/buyer_consent.json",
47
+ "extends": "dev.ucp.shopping.checkout"
48
+ }
49
+ ]
50
+ },
51
+ "signing_keys": [
52
+ {
53
+ "kty": "EC",
54
+ "crv": "P-256",
55
+ "x": "test-x-coordinate",
56
+ "y": "test-y-coordinate",
57
+ "kid": "key-2026-01"
58
+ }
59
+ ],
60
+ "payment": {
61
+ "handlers": [
62
+ {
63
+ "id": "mock_payment",
64
+ "name": "com.example.mock_payment",
65
+ "version": "2026-01-11",
66
+ "spec": "https://example.com/payment/spec",
67
+ "config_schema": "https://example.com/payment/config.json",
68
+ "instrument_schemas": ["https://example.com/payment/instrument.json"],
69
+ "config": {
70
+ "mode": "sandbox"
71
+ }
72
+ }
73
+ ]
74
+ }
75
+ }