@ucptools/validator 1.0.0 → 1.1.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/auth/config.d.ts +20 -0
- package/dist/auth/config.d.ts.map +1 -0
- package/dist/auth/config.js +114 -0
- package/dist/auth/config.js.map +1 -0
- package/dist/auth/index.d.ts +5 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +17 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/middleware.d.ts +45 -0
- package/dist/auth/middleware.d.ts.map +1 -0
- package/dist/auth/middleware.js +170 -0
- package/dist/auth/middleware.js.map +1 -0
- package/dist/auth/service.d.ts +80 -0
- package/dist/auth/service.d.ts.map +1 -0
- package/dist/auth/service.js +298 -0
- package/dist/auth/service.js.map +1 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +375 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/mock-server.d.ts +20 -0
- package/dist/cli/mock-server.d.ts.map +1 -0
- package/dist/cli/mock-server.js +261 -0
- package/dist/cli/mock-server.js.map +1 -0
- package/dist/compliance/compliance-generator.d.ts +34 -0
- package/dist/compliance/compliance-generator.d.ts.map +1 -0
- package/dist/compliance/compliance-generator.js +320 -0
- package/dist/compliance/compliance-generator.js.map +1 -0
- package/dist/compliance/index.d.ts +8 -0
- package/dist/compliance/index.d.ts.map +1 -0
- package/dist/compliance/index.js +17 -0
- package/dist/compliance/index.js.map +1 -0
- package/dist/compliance/templates.d.ts +34 -0
- package/dist/compliance/templates.d.ts.map +1 -0
- package/{src/compliance/templates.ts → dist/compliance/templates.js} +117 -155
- package/dist/compliance/templates.js.map +1 -0
- package/dist/compliance/types.d.ts +64 -0
- package/dist/compliance/types.d.ts.map +1 -0
- package/dist/compliance/types.js +64 -0
- package/dist/compliance/types.js.map +1 -0
- package/dist/db/index.d.ts +17 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +80 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/schema.d.ts +3886 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +425 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/db/utils.d.ts +252 -0
- package/dist/db/utils.d.ts.map +1 -0
- package/dist/db/utils.js +295 -0
- package/dist/db/utils.js.map +1 -0
- package/dist/feed-analyzer/feed-analyzer.d.ts +26 -0
- package/dist/feed-analyzer/feed-analyzer.d.ts.map +1 -0
- package/{src/feed-analyzer/feed-analyzer.ts → dist/feed-analyzer/feed-analyzer.js} +856 -726
- package/dist/feed-analyzer/feed-analyzer.js.map +1 -0
- package/dist/feed-analyzer/index.d.ts +8 -0
- package/dist/feed-analyzer/index.d.ts.map +1 -0
- package/dist/feed-analyzer/index.js +19 -0
- package/dist/feed-analyzer/index.js.map +1 -0
- package/dist/feed-analyzer/types.d.ts +285 -0
- package/dist/feed-analyzer/types.d.ts.map +1 -0
- package/dist/feed-analyzer/types.js +175 -0
- package/dist/feed-analyzer/types.js.map +1 -0
- package/{src/generator/index.ts → dist/generator/index.d.ts} +1 -1
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +13 -0
- package/dist/generator/index.js.map +1 -0
- package/dist/generator/key-generator.d.ts +24 -0
- package/dist/generator/key-generator.d.ts.map +1 -0
- package/dist/generator/key-generator.js +144 -0
- package/dist/generator/key-generator.js.map +1 -0
- package/dist/generator/profile-builder.d.ts +15 -0
- package/dist/generator/profile-builder.d.ts.map +1 -0
- package/dist/generator/profile-builder.js +338 -0
- package/dist/generator/profile-builder.js.map +1 -0
- package/dist/hosting/artifacts-generator.d.ts +10 -0
- package/dist/hosting/artifacts-generator.d.ts.map +1 -0
- package/{src/hosting/artifacts-generator.ts → dist/hosting/artifacts-generator.js} +191 -241
- package/dist/hosting/artifacts-generator.js.map +1 -0
- package/{src/hosting/index.ts → dist/hosting/index.d.ts} +1 -1
- package/dist/hosting/index.d.ts.map +1 -0
- package/dist/hosting/index.js +10 -0
- package/dist/hosting/index.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/analytics.d.ts +337 -0
- package/dist/lib/analytics.d.ts.map +1 -0
- package/dist/lib/analytics.js +188 -0
- package/dist/lib/analytics.js.map +1 -0
- package/{src/security/index.ts → dist/security/index.d.ts} +8 -15
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +12 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/security-scanner.d.ts +10 -0
- package/dist/security/security-scanner.d.ts.map +1 -0
- package/dist/security/security-scanner.js +669 -0
- package/dist/security/security-scanner.js.map +1 -0
- package/dist/security/types.d.ts +80 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/security/types.js +21 -0
- package/dist/security/types.js.map +1 -0
- package/dist/services/analytics.d.ts +114 -0
- package/dist/services/analytics.d.ts.map +1 -0
- package/dist/services/analytics.js +862 -0
- package/dist/services/analytics.js.map +1 -0
- package/dist/services/badge.d.ts +31 -0
- package/dist/services/badge.d.ts.map +1 -0
- package/dist/services/badge.js +152 -0
- package/dist/services/badge.js.map +1 -0
- package/dist/services/cron.d.ts +125 -0
- package/dist/services/cron.d.ts.map +1 -0
- package/dist/services/cron.js +613 -0
- package/dist/services/cron.js.map +1 -0
- package/dist/services/directory.d.ts +106 -0
- package/dist/services/directory.d.ts.map +1 -0
- package/dist/services/directory.js +351 -0
- package/dist/services/directory.js.map +1 -0
- package/dist/services/email.d.ts +112 -0
- package/dist/services/email.d.ts.map +1 -0
- package/dist/services/email.js +772 -0
- package/dist/services/email.js.map +1 -0
- package/dist/services/hosted-profiles.d.ts +77 -0
- package/dist/services/hosted-profiles.d.ts.map +1 -0
- package/dist/services/hosted-profiles.js +433 -0
- package/dist/services/hosted-profiles.js.map +1 -0
- package/dist/services/latency.d.ts +67 -0
- package/dist/services/latency.d.ts.map +1 -0
- package/dist/services/latency.js +274 -0
- package/dist/services/latency.js.map +1 -0
- package/dist/services/manifest-compliance.d.ts +64 -0
- package/dist/services/manifest-compliance.d.ts.map +1 -0
- package/dist/services/manifest-compliance.js +271 -0
- package/dist/services/manifest-compliance.js.map +1 -0
- package/dist/services/monitoring-diff.d.ts +31 -0
- package/dist/services/monitoring-diff.d.ts.map +1 -0
- package/dist/services/monitoring-diff.js +189 -0
- package/dist/services/monitoring-diff.js.map +1 -0
- package/dist/services/notifications.d.ts +46 -0
- package/dist/services/notifications.d.ts.map +1 -0
- package/dist/services/notifications.js +88 -0
- package/dist/services/notifications.js.map +1 -0
- package/dist/services/stripe.d.ts +93 -0
- package/dist/services/stripe.d.ts.map +1 -0
- package/dist/services/stripe.js +490 -0
- package/dist/services/stripe.js.map +1 -0
- package/dist/services/validation-history.d.ts +99 -0
- package/dist/services/validation-history.d.ts.map +1 -0
- package/dist/services/validation-history.js +344 -0
- package/dist/services/validation-history.js.map +1 -0
- package/dist/services/validation-logging.d.ts +103 -0
- package/dist/services/validation-logging.d.ts.map +1 -0
- package/dist/services/validation-logging.js +210 -0
- package/dist/services/validation-logging.js.map +1 -0
- package/dist/services/validation.d.ts +119 -0
- package/dist/services/validation.d.ts.map +1 -0
- package/dist/services/validation.js +1185 -0
- package/dist/services/validation.js.map +1 -0
- package/dist/simulator/agent-simulator.d.ts +69 -0
- package/dist/simulator/agent-simulator.d.ts.map +1 -0
- package/dist/simulator/agent-simulator.js +870 -0
- package/dist/simulator/agent-simulator.js.map +1 -0
- package/{src/simulator/index.ts → dist/simulator/index.d.ts} +7 -7
- package/dist/simulator/index.d.ts.map +1 -0
- package/dist/simulator/index.js +23 -0
- package/dist/simulator/index.js.map +1 -0
- package/{src/simulator/types.ts → dist/simulator/types.d.ts} +171 -170
- package/dist/simulator/types.d.ts.map +1 -0
- package/dist/simulator/types.js +18 -0
- package/dist/simulator/types.js.map +1 -0
- package/dist/types/acp-validation.d.ts +87 -0
- package/dist/types/acp-validation.d.ts.map +1 -0
- package/dist/types/acp-validation.js +40 -0
- package/dist/types/acp-validation.js.map +1 -0
- package/dist/types/analytics.d.ts +182 -0
- package/dist/types/analytics.d.ts.map +1 -0
- package/dist/types/analytics.js +7 -0
- package/dist/types/analytics.js.map +1 -0
- package/dist/types/generator.d.ts +106 -0
- package/dist/types/generator.d.ts.map +1 -0
- package/dist/types/generator.js +6 -0
- package/dist/types/generator.js.map +1 -0
- package/{src/types/index.ts → dist/types/index.d.ts} +1 -1
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +23 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/ucp-profile.d.ts +111 -0
- package/dist/types/ucp-profile.d.ts.map +1 -0
- package/dist/types/ucp-profile.js +45 -0
- package/dist/types/ucp-profile.js.map +1 -0
- package/dist/types/validation.d.ts +76 -0
- package/dist/types/validation.d.ts.map +1 -0
- package/dist/types/validation.js +42 -0
- package/dist/types/validation.js.map +1 -0
- package/dist/validator/acp/index.d.ts +31 -0
- package/dist/validator/acp/index.d.ts.map +1 -0
- package/dist/validator/acp/index.js +574 -0
- package/dist/validator/acp/index.js.map +1 -0
- package/dist/validator/index.d.ts +26 -0
- package/dist/validator/index.d.ts.map +1 -0
- package/dist/validator/index.js +161 -0
- package/dist/validator/index.js.map +1 -0
- package/dist/validator/network-validator.d.ts +28 -0
- package/dist/validator/network-validator.d.ts.map +1 -0
- package/dist/validator/network-validator.js +319 -0
- package/dist/validator/network-validator.js.map +1 -0
- package/dist/validator/rules-validator.d.ts +19 -0
- package/dist/validator/rules-validator.d.ts.map +1 -0
- package/dist/validator/rules-validator.js +306 -0
- package/dist/validator/rules-validator.js.map +1 -0
- package/dist/validator/sdk-validator.d.ts +58 -0
- package/dist/validator/sdk-validator.d.ts.map +1 -0
- package/{src/validator/sdk-validator.ts → dist/validator/sdk-validator.js} +273 -330
- package/dist/validator/sdk-validator.js.map +1 -0
- package/dist/validator/structural-validator.d.ts +11 -0
- package/dist/validator/structural-validator.d.ts.map +1 -0
- package/dist/validator/structural-validator.js +549 -0
- package/dist/validator/structural-validator.js.map +1 -0
- package/dist/validator/utils.d.ts +51 -0
- package/dist/validator/utils.d.ts.map +1 -0
- package/dist/validator/utils.js +132 -0
- package/dist/validator/utils.js.map +1 -0
- package/package.json +44 -12
- package/CLAUDE.md +0 -109
- package/api/analyze-feed.js +0 -140
- package/api/badge.js +0 -185
- package/api/benchmark.js +0 -177
- package/api/directory-stats.ts +0 -29
- package/api/directory.ts +0 -73
- package/api/generate-compliance.js +0 -143
- package/api/generate-schema.js +0 -457
- package/api/generate.js +0 -132
- package/api/security-scan.js +0 -133
- package/api/simulate.js +0 -187
- package/api/tsconfig.json +0 -10
- package/api/validate.js +0 -1351
- package/apify-actor/.actor/actor.json +0 -68
- package/apify-actor/.actor/input_schema.json +0 -32
- package/apify-actor/APIFY-STORE-LISTING.md +0 -412
- package/apify-actor/Dockerfile +0 -8
- package/apify-actor/README.md +0 -166
- package/apify-actor/main.ts +0 -111
- package/apify-actor/package.json +0 -17
- package/apify-actor/src/main.js +0 -199
- package/docs/BRAND-IDENTITY.md +0 -238
- package/docs/BRAND-STYLE-GUIDE.md +0 -356
- package/drizzle/0000_black_king_cobra.sql +0 -39
- package/drizzle/meta/0000_snapshot.json +0 -309
- package/drizzle/meta/_journal.json +0 -13
- package/drizzle.config.ts +0 -10
- package/public/.well-known/ucp +0 -25
- package/public/android-chrome-192x192.png +0 -0
- package/public/android-chrome-512x512.png +0 -0
- package/public/apple-touch-icon.png +0 -0
- package/public/brand.css +0 -321
- package/public/directory.html +0 -701
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/guides/bigcommerce.html +0 -743
- package/public/guides/fastucp.html +0 -838
- package/public/guides/magento.html +0 -779
- package/public/guides/shopify.html +0 -726
- package/public/guides/squarespace.html +0 -749
- package/public/guides/wix.html +0 -747
- package/public/guides/woocommerce.html +0 -733
- package/public/index.html +0 -3835
- package/public/learn.html +0 -396
- package/public/logo.jpeg +0 -0
- package/public/og-image-icon.png +0 -0
- package/public/og-image.png +0 -0
- package/public/robots.txt +0 -6
- package/public/site.webmanifest +0 -31
- package/public/sitemap.xml +0 -69
- package/public/social/linkedin-banner-1128x191.png +0 -0
- package/public/social/temp.PNG +0 -0
- package/public/social/x-header-1500x500.png +0 -0
- package/public/verify.html +0 -410
- package/scripts/generate-favicons.js +0 -44
- package/scripts/generate-ico.js +0 -23
- package/scripts/generate-og-image.js +0 -45
- package/scripts/reset-db.ts +0 -77
- package/scripts/seed-db.ts +0 -71
- package/scripts/setup-benchmark-db.js +0 -70
- package/src/api/server.ts +0 -266
- package/src/cli/index.ts +0 -302
- package/src/compliance/compliance-generator.ts +0 -452
- package/src/compliance/index.ts +0 -28
- package/src/compliance/types.ts +0 -170
- package/src/db/index.ts +0 -28
- package/src/db/schema.ts +0 -84
- package/src/feed-analyzer/index.ts +0 -34
- package/src/feed-analyzer/types.ts +0 -354
- package/src/generator/key-generator.ts +0 -124
- package/src/generator/profile-builder.ts +0 -402
- package/src/index.ts +0 -105
- package/src/security/security-scanner.ts +0 -604
- package/src/security/types.ts +0 -55
- package/src/services/directory.ts +0 -434
- package/src/simulator/agent-simulator.ts +0 -941
- package/src/types/generator.ts +0 -140
- package/src/types/ucp-profile.ts +0 -140
- package/src/types/validation.ts +0 -89
- package/src/validator/index.ts +0 -194
- package/src/validator/network-validator.ts +0 -417
- package/src/validator/rules-validator.ts +0 -297
- package/src/validator/structural-validator.ts +0 -476
- package/tests/fixtures/non-compliant-profile.json +0 -25
- package/tests/fixtures/official-sample-profile.json +0 -75
- package/tests/integration/benchmark.test.ts +0 -207
- package/tests/integration/database.test.ts +0 -163
- package/tests/integration/directory-api.test.ts +0 -268
- package/tests/integration/simulate-api.test.ts +0 -230
- package/tests/integration/validate-api.test.ts +0 -269
- package/tests/setup.ts +0 -15
- package/tests/unit/agent-simulator.test.ts +0 -575
- package/tests/unit/compliance-generator.test.ts +0 -374
- package/tests/unit/directory-service.test.ts +0 -272
- package/tests/unit/feed-analyzer.test.ts +0 -517
- package/tests/unit/lint-suggestions.test.ts +0 -423
- package/tests/unit/official-samples.test.ts +0 -211
- package/tests/unit/pdf-report.test.ts +0 -390
- package/tests/unit/sdk-validator.test.ts +0 -531
- package/tests/unit/security-scanner.test.ts +0 -410
- package/tests/unit/validation.test.ts +0 -390
- package/tsconfig.json +0 -20
- package/vercel.json +0 -34
- package/vitest.config.ts +0 -22
|
@@ -1,838 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<!-- Google Analytics -->
|
|
6
|
-
<script async src="https://www.googletagmanager.com/gtag/js?id=G-J5JSHV7H1E"></script>
|
|
7
|
-
<script>
|
|
8
|
-
window.dataLayer = window.dataLayer || [];
|
|
9
|
-
function gtag() { dataLayer.push(arguments); }
|
|
10
|
-
gtag('js', new Date());
|
|
11
|
-
gtag('config', 'G-J5JSHV7H1E');
|
|
12
|
-
</script>
|
|
13
|
-
<meta charset="UTF-8">
|
|
14
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
15
|
-
<title>FastUCP Integration Guide - Build UCP Servers with Python | UCP Tools</title>
|
|
16
|
-
<meta name="description"
|
|
17
|
-
content="Learn how to build UCP-compliant merchant servers using FastUCP Python framework. Complete guide with examples, validation tips, and best practices.">
|
|
18
|
-
<link rel="canonical" href="https://ucptools.dev/guides/fastucp">
|
|
19
|
-
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
|
20
|
-
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
|
21
|
-
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
|
22
|
-
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
|
23
|
-
<link rel="manifest" href="/site.webmanifest">
|
|
24
|
-
<meta name="theme-color" content="#2E86AB">
|
|
25
|
-
<meta property="og:title" content="FastUCP Integration Guide - Build UCP Servers with Python">
|
|
26
|
-
<meta property="og:description"
|
|
27
|
-
content="Complete guide to building AI-ready commerce with FastUCP Python framework.">
|
|
28
|
-
<meta property="og:image" content="/og-image.png">
|
|
29
|
-
<meta property="og:type" content="article">
|
|
30
|
-
|
|
31
|
-
<!-- Google Fonts -->
|
|
32
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
33
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
34
|
-
<link
|
|
35
|
-
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap"
|
|
36
|
-
rel="stylesheet">
|
|
37
|
-
|
|
38
|
-
<style>
|
|
39
|
-
/* ========================================
|
|
40
|
-
CSS VARIABLES (Brand Design System)
|
|
41
|
-
======================================== */
|
|
42
|
-
:root {
|
|
43
|
-
--brand-blue: #2E86AB;
|
|
44
|
-
--brand-teal: #36B5A2;
|
|
45
|
-
--brand-green: #47C97A;
|
|
46
|
-
--brand-gradient: linear-gradient(135deg, #2E86AB 0%, #36B5A2 50%, #47C97A 100%);
|
|
47
|
-
--brand-gradient-hover: linear-gradient(135deg, #267593 0%, #2EA18F 50%, #3BB86B 100%);
|
|
48
|
-
--color-dark: #1A2B3C;
|
|
49
|
-
--color-medium: #5A6978;
|
|
50
|
-
--color-light: #94A3B8;
|
|
51
|
-
--color-border: #E2E8F0;
|
|
52
|
-
--color-background: #F8FAFC;
|
|
53
|
-
--color-card: #FFFFFF;
|
|
54
|
-
--color-success: #47C97A;
|
|
55
|
-
--color-warning: #F59E0B;
|
|
56
|
-
--color-error: #EF4444;
|
|
57
|
-
--color-info: #2E86AB;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* ========================================
|
|
61
|
-
BASE STYLES
|
|
62
|
-
======================================== */
|
|
63
|
-
* {
|
|
64
|
-
box-sizing: border-box;
|
|
65
|
-
margin: 0;
|
|
66
|
-
padding: 0;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
body {
|
|
70
|
-
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
71
|
-
background: var(--color-background);
|
|
72
|
-
color: var(--color-dark);
|
|
73
|
-
line-height: 1.6;
|
|
74
|
-
min-height: 100vh;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
a {
|
|
78
|
-
color: var(--brand-blue);
|
|
79
|
-
text-decoration: none;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
a:hover {
|
|
83
|
-
text-decoration: underline;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.container {
|
|
87
|
-
max-width: 1200px;
|
|
88
|
-
margin: 0 auto;
|
|
89
|
-
padding: 0 20px;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/* ========================================
|
|
93
|
-
HEADER (Matching main site)
|
|
94
|
-
======================================== */
|
|
95
|
-
header {
|
|
96
|
-
background: var(--color-card);
|
|
97
|
-
border-bottom: 1px solid var(--color-border);
|
|
98
|
-
padding: 16px 0;
|
|
99
|
-
position: sticky;
|
|
100
|
-
top: 0;
|
|
101
|
-
z-index: 1000;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.header-inner {
|
|
105
|
-
display: flex;
|
|
106
|
-
justify-content: space-between;
|
|
107
|
-
align-items: center;
|
|
108
|
-
max-width: 1200px;
|
|
109
|
-
margin: 0 auto;
|
|
110
|
-
padding: 0 20px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.logo {
|
|
114
|
-
display: flex;
|
|
115
|
-
align-items: center;
|
|
116
|
-
gap: 12px;
|
|
117
|
-
font-size: 24px;
|
|
118
|
-
font-weight: 700;
|
|
119
|
-
text-decoration: none;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.logo:hover {
|
|
123
|
-
text-decoration: none;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.logo-icon {
|
|
127
|
-
width: 40px;
|
|
128
|
-
height: 40px;
|
|
129
|
-
border-radius: 8px;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.logo-text {
|
|
133
|
-
background: var(--brand-gradient);
|
|
134
|
-
-webkit-background-clip: text;
|
|
135
|
-
-webkit-text-fill-color: transparent;
|
|
136
|
-
background-clip: text;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.logo-suffix {
|
|
140
|
-
font-weight: 400;
|
|
141
|
-
-webkit-text-fill-color: var(--color-medium);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
nav {
|
|
145
|
-
display: flex;
|
|
146
|
-
gap: 8px;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
nav a {
|
|
150
|
-
padding: 8px 16px;
|
|
151
|
-
color: var(--color-medium);
|
|
152
|
-
text-decoration: none;
|
|
153
|
-
font-weight: 500;
|
|
154
|
-
border-radius: 6px;
|
|
155
|
-
transition: all 0.2s;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
nav a:hover {
|
|
159
|
-
color: var(--brand-blue);
|
|
160
|
-
background: rgba(46, 134, 171, 0.08);
|
|
161
|
-
text-decoration: none;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
nav a.active {
|
|
165
|
-
color: var(--brand-blue);
|
|
166
|
-
background: rgba(46, 134, 171, 0.12);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/* ========================================
|
|
170
|
-
HERO SECTION
|
|
171
|
-
======================================== */
|
|
172
|
-
.guide-hero {
|
|
173
|
-
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
|
|
174
|
-
color: white;
|
|
175
|
-
padding: 80px 0;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
.guide-hero .container {
|
|
179
|
-
max-width: 800px;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.guide-hero h1 {
|
|
183
|
-
font-size: 2.75rem;
|
|
184
|
-
font-weight: 700;
|
|
185
|
-
margin-bottom: 16px;
|
|
186
|
-
line-height: 1.2;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.guide-hero p {
|
|
190
|
-
font-size: 1.25rem;
|
|
191
|
-
opacity: 0.9;
|
|
192
|
-
line-height: 1.6;
|
|
193
|
-
margin-bottom: 24px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.guide-badges {
|
|
197
|
-
display: flex;
|
|
198
|
-
gap: 12px;
|
|
199
|
-
flex-wrap: wrap;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.guide-badge {
|
|
203
|
-
background: rgba(255, 255, 255, 0.15);
|
|
204
|
-
backdrop-filter: blur(10px);
|
|
205
|
-
padding: 8px 16px;
|
|
206
|
-
border-radius: 24px;
|
|
207
|
-
font-size: 0.9rem;
|
|
208
|
-
font-weight: 500;
|
|
209
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/* ========================================
|
|
213
|
-
MAIN CONTENT LAYOUT
|
|
214
|
-
======================================== */
|
|
215
|
-
.guide-content {
|
|
216
|
-
display: grid;
|
|
217
|
-
grid-template-columns: 1fr 260px;
|
|
218
|
-
gap: 60px;
|
|
219
|
-
max-width: 1100px;
|
|
220
|
-
margin: 0 auto;
|
|
221
|
-
padding: 60px 20px;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
@media (max-width: 968px) {
|
|
225
|
-
.guide-content {
|
|
226
|
-
grid-template-columns: 1fr;
|
|
227
|
-
gap: 40px;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.guide-sidebar {
|
|
231
|
-
order: -1;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
@media (max-width: 600px) {
|
|
236
|
-
.guide-hero h1 {
|
|
237
|
-
font-size: 2rem;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.guide-hero p {
|
|
241
|
-
font-size: 1.1rem;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
.header-inner {
|
|
245
|
-
flex-direction: column;
|
|
246
|
-
gap: 16px;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
nav {
|
|
250
|
-
flex-wrap: wrap;
|
|
251
|
-
justify-content: center;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/* ========================================
|
|
256
|
-
GUIDE MAIN CONTENT
|
|
257
|
-
======================================== */
|
|
258
|
-
.guide-main section {
|
|
259
|
-
margin-bottom: 48px;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
.guide-main h2 {
|
|
263
|
-
color: var(--color-dark);
|
|
264
|
-
font-size: 1.75rem;
|
|
265
|
-
font-weight: 700;
|
|
266
|
-
margin-bottom: 20px;
|
|
267
|
-
padding-bottom: 12px;
|
|
268
|
-
border-bottom: 2px solid var(--color-border);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.guide-main h3 {
|
|
272
|
-
font-size: 1.25rem;
|
|
273
|
-
font-weight: 600;
|
|
274
|
-
margin: 32px 0 16px;
|
|
275
|
-
color: var(--color-dark);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
.guide-main p {
|
|
279
|
-
margin-bottom: 16px;
|
|
280
|
-
color: var(--color-medium);
|
|
281
|
-
font-size: 1.05rem;
|
|
282
|
-
line-height: 1.7;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
.guide-main ul,
|
|
286
|
-
.guide-main ol {
|
|
287
|
-
margin-bottom: 20px;
|
|
288
|
-
padding-left: 24px;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.guide-main li {
|
|
292
|
-
margin-bottom: 10px;
|
|
293
|
-
color: var(--color-medium);
|
|
294
|
-
line-height: 1.6;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.guide-main li strong {
|
|
298
|
-
color: var(--color-dark);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/* ========================================
|
|
302
|
-
CODE BLOCKS
|
|
303
|
-
======================================== */
|
|
304
|
-
pre {
|
|
305
|
-
background: #1e1e1e;
|
|
306
|
-
color: #d4d4d4;
|
|
307
|
-
padding: 24px;
|
|
308
|
-
border-radius: 12px;
|
|
309
|
-
overflow-x: auto;
|
|
310
|
-
margin: 20px 0;
|
|
311
|
-
font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
|
|
312
|
-
font-size: 0.9rem;
|
|
313
|
-
line-height: 1.6;
|
|
314
|
-
border: 1px solid #333;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
code {
|
|
318
|
-
font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
:not(pre)>code {
|
|
322
|
-
background: #EEF2F6;
|
|
323
|
-
padding: 3px 8px;
|
|
324
|
-
border-radius: 6px;
|
|
325
|
-
font-size: 0.9em;
|
|
326
|
-
color: var(--brand-blue);
|
|
327
|
-
font-weight: 500;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
/* ========================================
|
|
331
|
-
FEATURE GRID
|
|
332
|
-
======================================== */
|
|
333
|
-
.feature-grid {
|
|
334
|
-
display: grid;
|
|
335
|
-
grid-template-columns: repeat(2, 1fr);
|
|
336
|
-
gap: 20px;
|
|
337
|
-
margin: 24px 0;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
@media (max-width: 600px) {
|
|
341
|
-
.feature-grid {
|
|
342
|
-
grid-template-columns: 1fr;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
.feature-card {
|
|
347
|
-
background: var(--color-card);
|
|
348
|
-
border: 1px solid var(--color-border);
|
|
349
|
-
border-radius: 12px;
|
|
350
|
-
padding: 24px;
|
|
351
|
-
transition: all 0.2s;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.feature-card:hover {
|
|
355
|
-
border-color: var(--brand-teal);
|
|
356
|
-
box-shadow: 0 4px 12px rgba(46, 134, 171, 0.1);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
.feature-card h4 {
|
|
360
|
-
font-size: 1.1rem;
|
|
361
|
-
font-weight: 600;
|
|
362
|
-
margin-bottom: 8px;
|
|
363
|
-
color: var(--color-dark);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
.feature-card p {
|
|
367
|
-
font-size: 0.95rem;
|
|
368
|
-
margin: 0;
|
|
369
|
-
color: var(--color-medium);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
/* ========================================
|
|
373
|
-
TIP BOXES
|
|
374
|
-
======================================== */
|
|
375
|
-
.tip-box {
|
|
376
|
-
background: #EFF6FF;
|
|
377
|
-
border-left: 4px solid var(--brand-blue);
|
|
378
|
-
padding: 20px 24px;
|
|
379
|
-
border-radius: 0 12px 12px 0;
|
|
380
|
-
margin: 24px 0;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
.tip-box.warning {
|
|
384
|
-
background: #FEF3C7;
|
|
385
|
-
border-color: var(--color-warning);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
.tip-box.success {
|
|
389
|
-
background: #DCFCE7;
|
|
390
|
-
border-color: var(--color-success);
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
.tip-box strong {
|
|
394
|
-
display: block;
|
|
395
|
-
margin-bottom: 6px;
|
|
396
|
-
color: var(--color-dark);
|
|
397
|
-
font-size: 1rem;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
.tip-box p,
|
|
401
|
-
.tip-box {
|
|
402
|
-
color: var(--color-medium);
|
|
403
|
-
font-size: 0.95rem;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/* ========================================
|
|
407
|
-
CTA BOXES
|
|
408
|
-
======================================== */
|
|
409
|
-
.cta-box {
|
|
410
|
-
background: var(--brand-gradient);
|
|
411
|
-
color: white;
|
|
412
|
-
padding: 40px;
|
|
413
|
-
border-radius: 16px;
|
|
414
|
-
text-align: center;
|
|
415
|
-
margin: 32px 0;
|
|
416
|
-
box-shadow: 0 8px 32px rgba(46, 134, 171, 0.25);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
.cta-box h3 {
|
|
420
|
-
color: white;
|
|
421
|
-
font-size: 1.5rem;
|
|
422
|
-
margin-bottom: 12px;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
.cta-box p {
|
|
426
|
-
color: rgba(255, 255, 255, 0.9);
|
|
427
|
-
margin-bottom: 24px;
|
|
428
|
-
font-size: 1.05rem;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
.cta-box .btn {
|
|
432
|
-
background: white;
|
|
433
|
-
color: var(--brand-blue);
|
|
434
|
-
padding: 14px 32px;
|
|
435
|
-
border-radius: 8px;
|
|
436
|
-
text-decoration: none;
|
|
437
|
-
font-weight: 600;
|
|
438
|
-
font-size: 1rem;
|
|
439
|
-
display: inline-block;
|
|
440
|
-
transition: all 0.2s;
|
|
441
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.cta-box .btn:hover {
|
|
445
|
-
transform: translateY(-2px);
|
|
446
|
-
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
|
|
447
|
-
text-decoration: none;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
/* ========================================
|
|
451
|
-
TABLES
|
|
452
|
-
======================================== */
|
|
453
|
-
table {
|
|
454
|
-
width: 100%;
|
|
455
|
-
border-collapse: collapse;
|
|
456
|
-
margin: 20px 0;
|
|
457
|
-
background: var(--color-card);
|
|
458
|
-
border-radius: 12px;
|
|
459
|
-
overflow: hidden;
|
|
460
|
-
border: 1px solid var(--color-border);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
th,
|
|
464
|
-
td {
|
|
465
|
-
text-align: left;
|
|
466
|
-
padding: 16px 20px;
|
|
467
|
-
border-bottom: 1px solid var(--color-border);
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
th {
|
|
471
|
-
background: var(--color-background);
|
|
472
|
-
font-weight: 600;
|
|
473
|
-
color: var(--color-dark);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
tr:last-child td {
|
|
477
|
-
border-bottom: none;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
td code {
|
|
481
|
-
background: #EEF2F6;
|
|
482
|
-
padding: 4px 8px;
|
|
483
|
-
border-radius: 4px;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
/* ========================================
|
|
487
|
-
SIDEBAR
|
|
488
|
-
======================================== */
|
|
489
|
-
.guide-sidebar {
|
|
490
|
-
position: sticky;
|
|
491
|
-
top: 100px;
|
|
492
|
-
align-self: start;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
.sidebar-toc {
|
|
496
|
-
background: var(--color-card);
|
|
497
|
-
border: 1px solid var(--color-border);
|
|
498
|
-
border-radius: 12px;
|
|
499
|
-
padding: 24px;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
.sidebar-toc h4 {
|
|
503
|
-
font-size: 0.8rem;
|
|
504
|
-
text-transform: uppercase;
|
|
505
|
-
letter-spacing: 1px;
|
|
506
|
-
color: var(--color-light);
|
|
507
|
-
margin-bottom: 16px;
|
|
508
|
-
font-weight: 600;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
.sidebar-toc ul {
|
|
512
|
-
list-style: none;
|
|
513
|
-
padding: 0;
|
|
514
|
-
margin: 0;
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
.sidebar-toc li {
|
|
518
|
-
margin-bottom: 0;
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
.sidebar-toc a {
|
|
522
|
-
display: block;
|
|
523
|
-
padding: 10px 12px;
|
|
524
|
-
color: var(--color-medium);
|
|
525
|
-
text-decoration: none;
|
|
526
|
-
font-size: 0.9rem;
|
|
527
|
-
border-radius: 6px;
|
|
528
|
-
transition: all 0.2s;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
.sidebar-toc a:hover {
|
|
532
|
-
color: var(--brand-blue);
|
|
533
|
-
background: rgba(46, 134, 171, 0.08);
|
|
534
|
-
text-decoration: none;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
/* ========================================
|
|
538
|
-
FOOTER
|
|
539
|
-
======================================== */
|
|
540
|
-
footer {
|
|
541
|
-
background: var(--color-dark);
|
|
542
|
-
color: white;
|
|
543
|
-
padding: 48px 0;
|
|
544
|
-
margin-top: 60px;
|
|
545
|
-
text-align: center;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
footer p {
|
|
549
|
-
margin: 0;
|
|
550
|
-
opacity: 0.9;
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
footer a {
|
|
554
|
-
color: var(--brand-teal);
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
footer a:hover {
|
|
558
|
-
color: var(--brand-green);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
.footer-links {
|
|
562
|
-
margin-top: 12px;
|
|
563
|
-
opacity: 0.7;
|
|
564
|
-
}
|
|
565
|
-
</style>
|
|
566
|
-
</head>
|
|
567
|
-
|
|
568
|
-
<body>
|
|
569
|
-
<header>
|
|
570
|
-
<div class="header-inner">
|
|
571
|
-
<a href="/" class="logo">
|
|
572
|
-
<img src="/logo.jpeg" alt="UCP.tools logo" class="logo-icon">
|
|
573
|
-
<span class="logo-text">UCP<span class="logo-suffix">.tools</span></span>
|
|
574
|
-
</a>
|
|
575
|
-
<nav>
|
|
576
|
-
<a href="/">Validator</a>
|
|
577
|
-
<a href="/learn">Learn</a>
|
|
578
|
-
<a href="/directory">Directory</a>
|
|
579
|
-
<a href="/guides/fastucp" class="active">FastUCP</a>
|
|
580
|
-
</nav>
|
|
581
|
-
</div>
|
|
582
|
-
</header>
|
|
583
|
-
|
|
584
|
-
<div class="guide-hero">
|
|
585
|
-
<div class="container">
|
|
586
|
-
<h1>⚡ FastUCP Integration Guide</h1>
|
|
587
|
-
<p>Build UCP-compliant merchant servers in Python with FastUCP — the "FastAPI" for Universal Commerce
|
|
588
|
-
Protocol.</p>
|
|
589
|
-
<div class="guide-badges">
|
|
590
|
-
<span class="guide-badge">🐍 Python 3.10+</span>
|
|
591
|
-
<span class="guide-badge">🚀 FastAPI Based</span>
|
|
592
|
-
<span class="guide-badge">🤖 AI Agent Ready</span>
|
|
593
|
-
<span class="guide-badge">📋 Auto-Discovery</span>
|
|
594
|
-
</div>
|
|
595
|
-
</div>
|
|
596
|
-
</div>
|
|
597
|
-
|
|
598
|
-
<div class="guide-content">
|
|
599
|
-
<main class="guide-main">
|
|
600
|
-
<section id="introduction">
|
|
601
|
-
<h2>What is FastUCP?</h2>
|
|
602
|
-
<p>
|
|
603
|
-
<a href="https://github.com/MehmetHilmiEmel/fastucp" target="_blank">FastUCP</a> is a Python
|
|
604
|
-
framework that makes building UCP-compliant merchant servers simple. Built on top of FastAPI, it
|
|
605
|
-
handles all the protocol complexity so you can focus on your business logic.
|
|
606
|
-
</p>
|
|
607
|
-
|
|
608
|
-
<div class="feature-grid">
|
|
609
|
-
<div class="feature-card">
|
|
610
|
-
<h4>🧱 Official Models</h4>
|
|
611
|
-
<p>Built on Google's auto-generated Pydantic models for 100% protocol compliance.</p>
|
|
612
|
-
</div>
|
|
613
|
-
<div class="feature-card">
|
|
614
|
-
<h4>🔍 Auto-Discovery</h4>
|
|
615
|
-
<p>Automatically generates <code>/.well-known/ucp</code> manifest from your endpoints.</p>
|
|
616
|
-
</div>
|
|
617
|
-
<div class="feature-card">
|
|
618
|
-
<h4>🛒 Builder Pattern</h4>
|
|
619
|
-
<p>Use <code>CheckoutBuilder</code> to construct responses without manual JSON wrangling.</p>
|
|
620
|
-
</div>
|
|
621
|
-
<div class="feature-card">
|
|
622
|
-
<h4>💳 Payment Presets</h4>
|
|
623
|
-
<p>Easy integration with Google Pay, Apple Pay, and other payment handlers.</p>
|
|
624
|
-
</div>
|
|
625
|
-
</div>
|
|
626
|
-
</section>
|
|
627
|
-
|
|
628
|
-
<section id="installation">
|
|
629
|
-
<h2>Installation</h2>
|
|
630
|
-
<p>FastUCP requires Python 3.10 or higher. Install via pip or uv:</p>
|
|
631
|
-
|
|
632
|
-
<pre><span style="color:#6A9955"># Using pip</span>
|
|
633
|
-
pip install fastucp-python
|
|
634
|
-
|
|
635
|
-
<span style="color:#6A9955"># Using uv (Recommended)</span>
|
|
636
|
-
uv add fastucp-python</pre>
|
|
637
|
-
</section>
|
|
638
|
-
|
|
639
|
-
<section id="quickstart">
|
|
640
|
-
<h2>Quick Start</h2>
|
|
641
|
-
<p>Here's a minimal UCP merchant server that sells a single item:</p>
|
|
642
|
-
|
|
643
|
-
<pre><span style="color:#6A9955"># main.py</span>
|
|
644
|
-
<span style="color:#C586C0">from</span> fastucp <span style="color:#C586C0">import</span> FastUCP
|
|
645
|
-
<span style="color:#C586C0">from</span> fastucp.builders <span style="color:#C586C0">import</span> CheckoutBuilder
|
|
646
|
-
<span style="color:#C586C0">from</span> fastucp.types <span style="color:#C586C0">import</span> CheckoutCreateRequest
|
|
647
|
-
|
|
648
|
-
<span style="color:#6A9955"># 1. Initialize the App</span>
|
|
649
|
-
app = FastUCP(
|
|
650
|
-
title=<span style="color:#CE9178">"My Store"</span>,
|
|
651
|
-
base_url=<span style="color:#CE9178">"http://localhost:8000"</span>
|
|
652
|
-
)
|
|
653
|
-
|
|
654
|
-
<span style="color:#6A9955"># 2. Define checkout endpoint</span>
|
|
655
|
-
<span style="color:#DCDCAA">@app.checkout</span>(<span style="color:#CE9178">"/checkout-sessions"</span>)
|
|
656
|
-
<span style="color:#C586C0">def</span> <span style="color:#DCDCAA">create_session</span>(payload: CheckoutCreateRequest):
|
|
657
|
-
cart = CheckoutBuilder(app, session_id=<span style="color:#CE9178">"session_123"</span>)
|
|
658
|
-
|
|
659
|
-
cart.add_item(
|
|
660
|
-
item_id=<span style="color:#CE9178">"sku_001"</span>,
|
|
661
|
-
title=<span style="color:#CE9178">"AI Commerce T-Shirt"</span>,
|
|
662
|
-
price=<span style="color:#B5CEA8">2500</span>, <span style="color:#6A9955"># $25.00 in cents</span>
|
|
663
|
-
quantity=<span style="color:#B5CEA8">1</span>,
|
|
664
|
-
img_url=<span style="color:#CE9178">"https://example.com/shirt.jpg"</span>
|
|
665
|
-
)
|
|
666
|
-
|
|
667
|
-
<span style="color:#C586C0">return</span> cart.build()
|
|
668
|
-
|
|
669
|
-
<span style="color:#C586C0">if</span> __name__ == <span style="color:#CE9178">"__main__"</span>:
|
|
670
|
-
<span style="color:#C586C0">import</span> uvicorn
|
|
671
|
-
uvicorn.run(app, host=<span style="color:#CE9178">"127.0.0.1"</span>, port=<span style="color:#B5CEA8">8000</span>)</pre>
|
|
672
|
-
|
|
673
|
-
<p>Run the server:</p>
|
|
674
|
-
<pre>python main.py</pre>
|
|
675
|
-
|
|
676
|
-
<p>Your server is now live with these endpoints:</p>
|
|
677
|
-
<table>
|
|
678
|
-
<tr>
|
|
679
|
-
<th>Endpoint</th>
|
|
680
|
-
<th>Description</th>
|
|
681
|
-
</tr>
|
|
682
|
-
<tr>
|
|
683
|
-
<td><code>GET /.well-known/ucp</code></td>
|
|
684
|
-
<td>Auto-generated UCP discovery manifest</td>
|
|
685
|
-
</tr>
|
|
686
|
-
<tr>
|
|
687
|
-
<td><code>POST /checkout-sessions</code></td>
|
|
688
|
-
<td>Create new checkout session</td>
|
|
689
|
-
</tr>
|
|
690
|
-
</table>
|
|
691
|
-
</section>
|
|
692
|
-
|
|
693
|
-
<section id="validation">
|
|
694
|
-
<h2>🔍 Test Your FastUCP Server</h2>
|
|
695
|
-
<p>Once your server is running, validate it using UCP Tools to ensure full compliance:</p>
|
|
696
|
-
|
|
697
|
-
<div class="cta-box">
|
|
698
|
-
<h3>Validate Your FastUCP Server</h3>
|
|
699
|
-
<p>Enter your server URL to check AI commerce readiness and UCP compliance.</p>
|
|
700
|
-
<a href="/" class="btn">Open Validator →</a>
|
|
701
|
-
</div>
|
|
702
|
-
|
|
703
|
-
<h3>What We Check</h3>
|
|
704
|
-
<ul>
|
|
705
|
-
<li><strong>Discovery Profile:</strong> Is <code>/.well-known/ucp</code> accessible and valid?</li>
|
|
706
|
-
<li><strong>Capabilities:</strong> Are checkout, order, and fulfillment capabilities declared?</li>
|
|
707
|
-
<li><strong>Service Bindings:</strong> Are REST/MCP endpoints properly configured?</li>
|
|
708
|
-
<li><strong>Payment Handlers:</strong> Are payment methods correctly specified?</li>
|
|
709
|
-
<li><strong>Schema Compliance:</strong> Does the profile match UCP specification?</li>
|
|
710
|
-
</ul>
|
|
711
|
-
|
|
712
|
-
<div class="tip-box success">
|
|
713
|
-
<strong>✅ Pro Tip</strong>
|
|
714
|
-
Use ngrok or a similar tool to expose your local server for testing: <code>ngrok http 8000</code>
|
|
715
|
-
</div>
|
|
716
|
-
</section>
|
|
717
|
-
|
|
718
|
-
<section id="capabilities">
|
|
719
|
-
<h2>Adding Capabilities</h2>
|
|
720
|
-
<p>FastUCP automatically registers capabilities when you use decorators:</p>
|
|
721
|
-
|
|
722
|
-
<pre><span style="color:#6A9955"># Checkout capability (auto-registered)</span>
|
|
723
|
-
<span style="color:#DCDCAA">@app.checkout</span>(<span style="color:#CE9178">"/checkout-sessions"</span>)
|
|
724
|
-
<span style="color:#C586C0">def</span> <span style="color:#DCDCAA">create_checkout</span>(payload):
|
|
725
|
-
...
|
|
726
|
-
|
|
727
|
-
<span style="color:#6A9955"># Update checkout</span>
|
|
728
|
-
<span style="color:#DCDCAA">@app.update_checkout</span>(<span style="color:#CE9178">"/checkout-sessions/{id}"</span>)
|
|
729
|
-
<span style="color:#C586C0">def</span> <span style="color:#DCDCAA">update_checkout</span>(id: str, payload):
|
|
730
|
-
...
|
|
731
|
-
|
|
732
|
-
<span style="color:#6A9955"># Complete checkout → Order capability (auto-registered)</span>
|
|
733
|
-
<span style="color:#DCDCAA">@app.complete_checkout</span>(<span style="color:#CE9178">"/checkout-sessions/{id}/complete"</span>)
|
|
734
|
-
<span style="color:#C586C0">def</span> <span style="color:#DCDCAA">complete_checkout</span>(id: str, payload):
|
|
735
|
-
...</pre>
|
|
736
|
-
|
|
737
|
-
<p>Each decorator automatically adds the corresponding capability to your <code>/.well-known/ucp</code>
|
|
738
|
-
manifest.</p>
|
|
739
|
-
</section>
|
|
740
|
-
|
|
741
|
-
<section id="payments">
|
|
742
|
-
<h2>Payment Handlers</h2>
|
|
743
|
-
<p>FastUCP includes presets for common payment methods:</p>
|
|
744
|
-
|
|
745
|
-
<pre><span style="color:#C586C0">from</span> fastucp.presets <span style="color:#C586C0">import</span> GooglePay
|
|
746
|
-
|
|
747
|
-
app.add_payment_handler(
|
|
748
|
-
GooglePay(
|
|
749
|
-
merchant_id=<span style="color:#CE9178">"your_merchant_id"</span>,
|
|
750
|
-
gateway=<span style="color:#CE9178">"stripe"</span>,
|
|
751
|
-
gateway_merchant_id=<span style="color:#CE9178">"your_stripe_id"</span>
|
|
752
|
-
)
|
|
753
|
-
)</pre>
|
|
754
|
-
|
|
755
|
-
<p>This automatically adds the payment handler to your discovery profile.</p>
|
|
756
|
-
</section>
|
|
757
|
-
|
|
758
|
-
<section id="tips">
|
|
759
|
-
<h2>Validation Tips</h2>
|
|
760
|
-
|
|
761
|
-
<div class="tip-box">
|
|
762
|
-
<strong>💡 Common Issue: Missing base_url</strong>
|
|
763
|
-
Always set <code>base_url</code> in your FastUCP constructor. This is used to generate absolute URLs
|
|
764
|
-
in the discovery profile.
|
|
765
|
-
</div>
|
|
766
|
-
|
|
767
|
-
<div class="tip-box warning">
|
|
768
|
-
<strong>⚠️ Production URLs</strong>
|
|
769
|
-
In production, ensure <code>base_url</code> matches your actual domain with HTTPS.
|
|
770
|
-
</div>
|
|
771
|
-
|
|
772
|
-
<h3>Checklist for UCP Compliance</h3>
|
|
773
|
-
<ol>
|
|
774
|
-
<li>✅ Set correct <code>base_url</code> for your environment</li>
|
|
775
|
-
<li>✅ Define at least one checkout endpoint using <code>@app.checkout()</code></li>
|
|
776
|
-
<li>✅ Add payment handlers if accepting payments</li>
|
|
777
|
-
<li>✅ Test with UCP Tools validator before going live</li>
|
|
778
|
-
<li>✅ Use AI Agent Simulator to verify agent compatibility</li>
|
|
779
|
-
</ol>
|
|
780
|
-
</section>
|
|
781
|
-
|
|
782
|
-
<section id="ai-simulation">
|
|
783
|
-
<h2>🤖 Test with AI Agent Simulator</h2>
|
|
784
|
-
<p>
|
|
785
|
-
UCP Tools includes an AI Agent Simulator that tests how AI shopping agents will interact with your
|
|
786
|
-
FastUCP server. It simulates the full discovery and checkout flow.
|
|
787
|
-
</p>
|
|
788
|
-
|
|
789
|
-
<div class="cta-box">
|
|
790
|
-
<h3>Run AI Agent Simulation</h3>
|
|
791
|
-
<p>Test how AI agents will discover and use your UCP endpoints.</p>
|
|
792
|
-
<a href="/#simulate" class="btn">Open AI Simulator →</a>
|
|
793
|
-
</div>
|
|
794
|
-
</section>
|
|
795
|
-
|
|
796
|
-
<section id="resources">
|
|
797
|
-
<h2>Resources</h2>
|
|
798
|
-
<ul>
|
|
799
|
-
<li><a href="https://github.com/MehmetHilmiEmel/fastucp" target="_blank">FastUCP GitHub
|
|
800
|
-
Repository</a></li>
|
|
801
|
-
<li><a href="https://pypi.org/project/fastucp-python/" target="_blank">FastUCP on PyPI</a></li>
|
|
802
|
-
<li><a href="https://ucp.dev" target="_blank">Official UCP Specification</a></li>
|
|
803
|
-
<li><a href="/learn">UCP Learning Center</a></li>
|
|
804
|
-
</ul>
|
|
805
|
-
</section>
|
|
806
|
-
</main>
|
|
807
|
-
|
|
808
|
-
<aside class="guide-sidebar">
|
|
809
|
-
<div class="sidebar-toc">
|
|
810
|
-
<h4>On This Page</h4>
|
|
811
|
-
<ul>
|
|
812
|
-
<li><a href="#introduction">What is FastUCP?</a></li>
|
|
813
|
-
<li><a href="#installation">Installation</a></li>
|
|
814
|
-
<li><a href="#quickstart">Quick Start</a></li>
|
|
815
|
-
<li><a href="#validation">Test with UCP Tools</a></li>
|
|
816
|
-
<li><a href="#capabilities">Adding Capabilities</a></li>
|
|
817
|
-
<li><a href="#payments">Payment Handlers</a></li>
|
|
818
|
-
<li><a href="#tips">Validation Tips</a></li>
|
|
819
|
-
<li><a href="#ai-simulation">AI Agent Simulator</a></li>
|
|
820
|
-
<li><a href="#resources">Resources</a></li>
|
|
821
|
-
</ul>
|
|
822
|
-
</div>
|
|
823
|
-
</aside>
|
|
824
|
-
</div>
|
|
825
|
-
|
|
826
|
-
<footer>
|
|
827
|
-
<div class="container">
|
|
828
|
-
<p>UCP Tools — Built for the AI Commerce era</p>
|
|
829
|
-
<p class="footer-links">
|
|
830
|
-
<a href="https://github.com/Nolpak14/ucp-tools" target="_blank">GitHub</a> ·
|
|
831
|
-
<a href="https://github.com/MehmetHilmiEmel/fastucp" target="_blank">FastUCP</a> ·
|
|
832
|
-
<a href="https://ucp.dev" target="_blank">UCP Spec</a>
|
|
833
|
-
</p>
|
|
834
|
-
</div>
|
|
835
|
-
</footer>
|
|
836
|
-
</body>
|
|
837
|
-
|
|
838
|
-
</html>
|