@cimplify/cli 0.2.3 → 0.2.5

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 (25) hide show
  1. package/dist/{add-YJDP63WM.mjs → add-HUQP6GG4.mjs} +1 -1
  2. package/dist/{chunk-SN6E73KY.mjs → chunk-CGHNZCC5.mjs} +138 -6
  3. package/dist/{chunk-WTFQ3B5E.mjs → chunk-YF2CTZZA.mjs} +1 -1
  4. package/dist/dispatcher.mjs +6 -6
  5. package/dist/{list-DS4C3JRB.mjs → list-6LEDLIFX.mjs} +1 -1
  6. package/dist/{update-DBU2HAYG.mjs → update-ILYTYAZW.mjs} +1 -1
  7. package/package.json +1 -1
  8. package/templates/storefront-bakery/.env.example +6 -0
  9. package/templates/storefront-bakery/app/.well-known/ucp/route.ts +65 -0
  10. package/templates/storefront-bakery/package.json +1 -1
  11. package/templates/storefront-fashion/.env.example +6 -0
  12. package/templates/storefront-fashion/app/.well-known/ucp/route.ts +65 -0
  13. package/templates/storefront-fashion/package.json +1 -1
  14. package/templates/storefront-grocery/.env.example +6 -0
  15. package/templates/storefront-grocery/app/.well-known/ucp/route.ts +65 -0
  16. package/templates/storefront-grocery/package.json +1 -1
  17. package/templates/storefront-restaurant/.env.example +6 -0
  18. package/templates/storefront-restaurant/app/.well-known/ucp/route.ts +65 -0
  19. package/templates/storefront-restaurant/package.json +1 -1
  20. package/templates/storefront-retail/.env.example +6 -0
  21. package/templates/storefront-retail/app/.well-known/ucp/route.ts +65 -0
  22. package/templates/storefront-retail/package.json +1 -1
  23. package/templates/storefront-services/.env.example +6 -0
  24. package/templates/storefront-services/app/.well-known/ucp/route.ts +65 -0
  25. package/templates/storefront-services/package.json +1 -1
@@ -2,7 +2,7 @@
2
2
  // package.json
3
3
  var package_default = {
4
4
  name: "@cimplify/cli",
5
- version: "0.2.3",
5
+ version: "0.2.5",
6
6
  description: "Cimplify CLI \u2014 deploy, manage env vars, link projects, and scaffold storefronts",
7
7
  keywords: [
8
8
  "cimplify",
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { package_default } from './chunk-WTFQ3B5E.mjs';
3
- import { TEMPLATES } from './chunk-SN6E73KY.mjs';
2
+ import { package_default } from './chunk-YF2CTZZA.mjs';
3
+ import { TEMPLATES } from './chunk-CGHNZCC5.mjs';
4
4
 
5
5
  // src/dispatcher.ts
6
6
  var VERSION = package_default.version ?? "unknown";
@@ -129,10 +129,10 @@ var COMMANDS = {
129
129
  status: () => import('./status-6AT4HF63.mjs'),
130
130
  dev: () => import('./dev-AQP6TMYK.mjs'),
131
131
  repo: () => import('./repo-XMMLZHLC.mjs'),
132
- list: () => import('./list-DS4C3JRB.mjs'),
133
- add: () => import('./add-YJDP63WM.mjs'),
134
- update: () => import('./update-DBU2HAYG.mjs'),
135
- upgrade: () => import('./update-DBU2HAYG.mjs')
132
+ list: () => import('./list-6LEDLIFX.mjs'),
133
+ add: () => import('./add-HUQP6GG4.mjs'),
134
+ update: () => import('./update-ILYTYAZW.mjs'),
135
+ upgrade: () => import('./update-ILYTYAZW.mjs')
136
136
  };
137
137
  var GLOBAL_FLAGS = /* @__PURE__ */ new Set(["--json", "--yes", "-y"]);
138
138
  function extractGlobalFlags(argv) {
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { REGISTRY_INDEX } from './chunk-SN6E73KY.mjs';
2
+ import { REGISTRY_INDEX } from './chunk-CGHNZCC5.mjs';
3
3
  import { parseArgs, flagBool } from './chunk-4SBJVRGM.mjs';
4
4
  import { CliError, CLI_ERROR_CODE, info, bold, dim, green, result } from './chunk-NZ4RG62Z.mjs';
5
5
 
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { package_default } from './chunk-WTFQ3B5E.mjs';
2
+ import { package_default } from './chunk-YF2CTZZA.mjs';
3
3
  import { promptYesNo } from './chunk-L6474RPL.mjs';
4
4
  import { parseArgs, flagBool, flagString } from './chunk-4SBJVRGM.mjs';
5
5
  import { success, bold, info, dim, result, failure, CliError, CLI_ERROR_CODE, step, isJsonMode } from './chunk-NZ4RG62Z.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimplify/cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Cimplify CLI — deploy, manage env vars, link projects, and scaffold storefronts",
5
5
  "keywords": [
6
6
  "cimplify",
@@ -14,3 +14,9 @@ NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_default_akua_bakery
14
14
  # and OpenGraph metadata. Set this on production deploys (Vercel auto-injects
15
15
  # via VERCEL_URL but Next prefers an explicit value).
16
16
  NEXT_PUBLIC_SITE_URL=https://example.com
17
+
18
+ # Business handle (human-readable slug, e.g. "akua-bakery"). Used by the
19
+ # UCP manifest endpoint at /.well-known/ucp so AI agents (Claude / ChatGPT /
20
+ # Gemini) can discover this storefront's commerce capabilities. Set this
21
+ # on production deploys; leave empty in dev unless you're testing UCP.
22
+ NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE=
@@ -0,0 +1,65 @@
1
+ import { NextResponse } from "next/server";
2
+
3
+ /**
4
+ * UCP (Universal Commerce Protocol) manifest discovery endpoint.
5
+ *
6
+ * Agents — Claude, ChatGPT, Gemini, MCP clients — probe
7
+ * `https://<your-domain>/.well-known/ucp` to learn what commerce
8
+ * capabilities your storefront supports. We forward the request to
9
+ * Cimplify, which returns the canonical manifest; the response body
10
+ * tells agents to make subsequent UCP calls directly to
11
+ * `api.cimplify.io/ucp/v1/<handle>/*` (no per-request proxy here).
12
+ *
13
+ * Edge-cached for an hour because capabilities change rarely.
14
+ */
15
+ const UCP_API_BASE =
16
+ process.env.NEXT_PUBLIC_CIMPLIFY_API_URL || "https://api.cimplify.io";
17
+
18
+
19
+ export async function GET() {
20
+ const businessHandle = process.env.NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE;
21
+
22
+ if (!businessHandle) {
23
+ return NextResponse.json(
24
+ {
25
+ error: "NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE not set",
26
+ remediation:
27
+ "Set NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE in .env.local (and your deployment env) to your business handle.",
28
+ },
29
+ { status: 500 },
30
+ );
31
+ }
32
+
33
+ try {
34
+ const response = await fetch(
35
+ `${UCP_API_BASE}/ucp/v1/${businessHandle}/manifest`,
36
+ {
37
+ headers: { "Content-Type": "application/json" },
38
+ next: { revalidate: 3600 },
39
+ },
40
+ );
41
+
42
+ if (!response.ok) {
43
+ return NextResponse.json(
44
+ { error: `Upstream UCP manifest fetch failed: ${response.status}` },
45
+ { status: response.status },
46
+ );
47
+ }
48
+
49
+ const manifest = await response.json();
50
+ return NextResponse.json(manifest, {
51
+ headers: {
52
+ "Content-Type": "application/json",
53
+ "Cache-Control": "public, max-age=3600, s-maxage=3600",
54
+ },
55
+ });
56
+ } catch (error) {
57
+ return NextResponse.json(
58
+ {
59
+ error: "Failed to fetch UCP manifest",
60
+ detail: error instanceof Error ? error.message : String(error),
61
+ },
62
+ { status: 500 },
63
+ );
64
+ }
65
+ }
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.45.0",
20
+ "@cimplify/sdk": "^0.45.1",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -14,3 +14,9 @@ NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_studio_frx
14
14
  # and OpenGraph metadata. Set this on production deploys (Vercel auto-injects
15
15
  # via VERCEL_URL but Next prefers an explicit value).
16
16
  NEXT_PUBLIC_SITE_URL=https://example.com
17
+
18
+ # Business handle (human-readable slug, e.g. "akua-bakery"). Used by the
19
+ # UCP manifest endpoint at /.well-known/ucp so AI agents (Claude / ChatGPT /
20
+ # Gemini) can discover this storefront's commerce capabilities. Set this
21
+ # on production deploys; leave empty in dev unless you're testing UCP.
22
+ NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE=
@@ -0,0 +1,65 @@
1
+ import { NextResponse } from "next/server";
2
+
3
+ /**
4
+ * UCP (Universal Commerce Protocol) manifest discovery endpoint.
5
+ *
6
+ * Agents — Claude, ChatGPT, Gemini, MCP clients — probe
7
+ * `https://<your-domain>/.well-known/ucp` to learn what commerce
8
+ * capabilities your storefront supports. We forward the request to
9
+ * Cimplify, which returns the canonical manifest; the response body
10
+ * tells agents to make subsequent UCP calls directly to
11
+ * `api.cimplify.io/ucp/v1/<handle>/*` (no per-request proxy here).
12
+ *
13
+ * Edge-cached for an hour because capabilities change rarely.
14
+ */
15
+ const UCP_API_BASE =
16
+ process.env.NEXT_PUBLIC_CIMPLIFY_API_URL || "https://api.cimplify.io";
17
+
18
+
19
+ export async function GET() {
20
+ const businessHandle = process.env.NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE;
21
+
22
+ if (!businessHandle) {
23
+ return NextResponse.json(
24
+ {
25
+ error: "NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE not set",
26
+ remediation:
27
+ "Set NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE in .env.local (and your deployment env) to your business handle.",
28
+ },
29
+ { status: 500 },
30
+ );
31
+ }
32
+
33
+ try {
34
+ const response = await fetch(
35
+ `${UCP_API_BASE}/ucp/v1/${businessHandle}/manifest`,
36
+ {
37
+ headers: { "Content-Type": "application/json" },
38
+ next: { revalidate: 3600 },
39
+ },
40
+ );
41
+
42
+ if (!response.ok) {
43
+ return NextResponse.json(
44
+ { error: `Upstream UCP manifest fetch failed: ${response.status}` },
45
+ { status: response.status },
46
+ );
47
+ }
48
+
49
+ const manifest = await response.json();
50
+ return NextResponse.json(manifest, {
51
+ headers: {
52
+ "Content-Type": "application/json",
53
+ "Cache-Control": "public, max-age=3600, s-maxage=3600",
54
+ },
55
+ });
56
+ } catch (error) {
57
+ return NextResponse.json(
58
+ {
59
+ error: "Failed to fetch UCP manifest",
60
+ detail: error instanceof Error ? error.message : String(error),
61
+ },
62
+ { status: 500 },
63
+ );
64
+ }
65
+ }
@@ -19,7 +19,7 @@
19
19
  "check": "bun run typecheck && bun run test:run"
20
20
  },
21
21
  "dependencies": {
22
- "@cimplify/sdk": "^0.45.0",
22
+ "@cimplify/sdk": "^0.45.1",
23
23
  "next": "^16.2.4",
24
24
  "react": "^19.0.0",
25
25
  "react-dom": "^19.0.0"
@@ -14,3 +14,9 @@ NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_freshmart
14
14
  # and OpenGraph metadata. Set this on production deploys (Vercel auto-injects
15
15
  # via VERCEL_URL but Next prefers an explicit value).
16
16
  NEXT_PUBLIC_SITE_URL=https://example.com
17
+
18
+ # Business handle (human-readable slug, e.g. "akua-bakery"). Used by the
19
+ # UCP manifest endpoint at /.well-known/ucp so AI agents (Claude / ChatGPT /
20
+ # Gemini) can discover this storefront's commerce capabilities. Set this
21
+ # on production deploys; leave empty in dev unless you're testing UCP.
22
+ NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE=
@@ -0,0 +1,65 @@
1
+ import { NextResponse } from "next/server";
2
+
3
+ /**
4
+ * UCP (Universal Commerce Protocol) manifest discovery endpoint.
5
+ *
6
+ * Agents — Claude, ChatGPT, Gemini, MCP clients — probe
7
+ * `https://<your-domain>/.well-known/ucp` to learn what commerce
8
+ * capabilities your storefront supports. We forward the request to
9
+ * Cimplify, which returns the canonical manifest; the response body
10
+ * tells agents to make subsequent UCP calls directly to
11
+ * `api.cimplify.io/ucp/v1/<handle>/*` (no per-request proxy here).
12
+ *
13
+ * Edge-cached for an hour because capabilities change rarely.
14
+ */
15
+ const UCP_API_BASE =
16
+ process.env.NEXT_PUBLIC_CIMPLIFY_API_URL || "https://api.cimplify.io";
17
+
18
+
19
+ export async function GET() {
20
+ const businessHandle = process.env.NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE;
21
+
22
+ if (!businessHandle) {
23
+ return NextResponse.json(
24
+ {
25
+ error: "NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE not set",
26
+ remediation:
27
+ "Set NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE in .env.local (and your deployment env) to your business handle.",
28
+ },
29
+ { status: 500 },
30
+ );
31
+ }
32
+
33
+ try {
34
+ const response = await fetch(
35
+ `${UCP_API_BASE}/ucp/v1/${businessHandle}/manifest`,
36
+ {
37
+ headers: { "Content-Type": "application/json" },
38
+ next: { revalidate: 3600 },
39
+ },
40
+ );
41
+
42
+ if (!response.ok) {
43
+ return NextResponse.json(
44
+ { error: `Upstream UCP manifest fetch failed: ${response.status}` },
45
+ { status: response.status },
46
+ );
47
+ }
48
+
49
+ const manifest = await response.json();
50
+ return NextResponse.json(manifest, {
51
+ headers: {
52
+ "Content-Type": "application/json",
53
+ "Cache-Control": "public, max-age=3600, s-maxage=3600",
54
+ },
55
+ });
56
+ } catch (error) {
57
+ return NextResponse.json(
58
+ {
59
+ error: "Failed to fetch UCP manifest",
60
+ detail: error instanceof Error ? error.message : String(error),
61
+ },
62
+ { status: 500 },
63
+ );
64
+ }
65
+ }
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.45.0",
20
+ "@cimplify/sdk": "^0.45.1",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -14,3 +14,9 @@ NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_mamas_kitchen
14
14
  # and OpenGraph metadata. Set this on production deploys (Vercel auto-injects
15
15
  # via VERCEL_URL but Next prefers an explicit value).
16
16
  NEXT_PUBLIC_SITE_URL=https://example.com
17
+
18
+ # Business handle (human-readable slug, e.g. "akua-bakery"). Used by the
19
+ # UCP manifest endpoint at /.well-known/ucp so AI agents (Claude / ChatGPT /
20
+ # Gemini) can discover this storefront's commerce capabilities. Set this
21
+ # on production deploys; leave empty in dev unless you're testing UCP.
22
+ NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE=
@@ -0,0 +1,65 @@
1
+ import { NextResponse } from "next/server";
2
+
3
+ /**
4
+ * UCP (Universal Commerce Protocol) manifest discovery endpoint.
5
+ *
6
+ * Agents — Claude, ChatGPT, Gemini, MCP clients — probe
7
+ * `https://<your-domain>/.well-known/ucp` to learn what commerce
8
+ * capabilities your storefront supports. We forward the request to
9
+ * Cimplify, which returns the canonical manifest; the response body
10
+ * tells agents to make subsequent UCP calls directly to
11
+ * `api.cimplify.io/ucp/v1/<handle>/*` (no per-request proxy here).
12
+ *
13
+ * Edge-cached for an hour because capabilities change rarely.
14
+ */
15
+ const UCP_API_BASE =
16
+ process.env.NEXT_PUBLIC_CIMPLIFY_API_URL || "https://api.cimplify.io";
17
+
18
+
19
+ export async function GET() {
20
+ const businessHandle = process.env.NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE;
21
+
22
+ if (!businessHandle) {
23
+ return NextResponse.json(
24
+ {
25
+ error: "NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE not set",
26
+ remediation:
27
+ "Set NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE in .env.local (and your deployment env) to your business handle.",
28
+ },
29
+ { status: 500 },
30
+ );
31
+ }
32
+
33
+ try {
34
+ const response = await fetch(
35
+ `${UCP_API_BASE}/ucp/v1/${businessHandle}/manifest`,
36
+ {
37
+ headers: { "Content-Type": "application/json" },
38
+ next: { revalidate: 3600 },
39
+ },
40
+ );
41
+
42
+ if (!response.ok) {
43
+ return NextResponse.json(
44
+ { error: `Upstream UCP manifest fetch failed: ${response.status}` },
45
+ { status: response.status },
46
+ );
47
+ }
48
+
49
+ const manifest = await response.json();
50
+ return NextResponse.json(manifest, {
51
+ headers: {
52
+ "Content-Type": "application/json",
53
+ "Cache-Control": "public, max-age=3600, s-maxage=3600",
54
+ },
55
+ });
56
+ } catch (error) {
57
+ return NextResponse.json(
58
+ {
59
+ error: "Failed to fetch UCP manifest",
60
+ detail: error instanceof Error ? error.message : String(error),
61
+ },
62
+ { status: 500 },
63
+ );
64
+ }
65
+ }
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.45.0",
20
+ "@cimplify/sdk": "^0.45.1",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -14,3 +14,9 @@ NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_currents_electronics
14
14
  # and OpenGraph metadata. Set this on production deploys (Vercel auto-injects
15
15
  # via VERCEL_URL but Next prefers an explicit value).
16
16
  NEXT_PUBLIC_SITE_URL=https://example.com
17
+
18
+ # Business handle (human-readable slug, e.g. "akua-bakery"). Used by the
19
+ # UCP manifest endpoint at /.well-known/ucp so AI agents (Claude / ChatGPT /
20
+ # Gemini) can discover this storefront's commerce capabilities. Set this
21
+ # on production deploys; leave empty in dev unless you're testing UCP.
22
+ NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE=
@@ -0,0 +1,65 @@
1
+ import { NextResponse } from "next/server";
2
+
3
+ /**
4
+ * UCP (Universal Commerce Protocol) manifest discovery endpoint.
5
+ *
6
+ * Agents — Claude, ChatGPT, Gemini, MCP clients — probe
7
+ * `https://<your-domain>/.well-known/ucp` to learn what commerce
8
+ * capabilities your storefront supports. We forward the request to
9
+ * Cimplify, which returns the canonical manifest; the response body
10
+ * tells agents to make subsequent UCP calls directly to
11
+ * `api.cimplify.io/ucp/v1/<handle>/*` (no per-request proxy here).
12
+ *
13
+ * Edge-cached for an hour because capabilities change rarely.
14
+ */
15
+ const UCP_API_BASE =
16
+ process.env.NEXT_PUBLIC_CIMPLIFY_API_URL || "https://api.cimplify.io";
17
+
18
+
19
+ export async function GET() {
20
+ const businessHandle = process.env.NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE;
21
+
22
+ if (!businessHandle) {
23
+ return NextResponse.json(
24
+ {
25
+ error: "NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE not set",
26
+ remediation:
27
+ "Set NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE in .env.local (and your deployment env) to your business handle.",
28
+ },
29
+ { status: 500 },
30
+ );
31
+ }
32
+
33
+ try {
34
+ const response = await fetch(
35
+ `${UCP_API_BASE}/ucp/v1/${businessHandle}/manifest`,
36
+ {
37
+ headers: { "Content-Type": "application/json" },
38
+ next: { revalidate: 3600 },
39
+ },
40
+ );
41
+
42
+ if (!response.ok) {
43
+ return NextResponse.json(
44
+ { error: `Upstream UCP manifest fetch failed: ${response.status}` },
45
+ { status: response.status },
46
+ );
47
+ }
48
+
49
+ const manifest = await response.json();
50
+ return NextResponse.json(manifest, {
51
+ headers: {
52
+ "Content-Type": "application/json",
53
+ "Cache-Control": "public, max-age=3600, s-maxage=3600",
54
+ },
55
+ });
56
+ } catch (error) {
57
+ return NextResponse.json(
58
+ {
59
+ error: "Failed to fetch UCP manifest",
60
+ detail: error instanceof Error ? error.message : String(error),
61
+ },
62
+ { status: 500 },
63
+ );
64
+ }
65
+ }
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.45.0",
20
+ "@cimplify/sdk": "^0.45.1",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"
@@ -14,3 +14,9 @@ NEXT_PUBLIC_CIMPLIFY_BUSINESS_ID=bus_serene_spa
14
14
  # and OpenGraph metadata. Set this on production deploys (Vercel auto-injects
15
15
  # via VERCEL_URL but Next prefers an explicit value).
16
16
  NEXT_PUBLIC_SITE_URL=https://example.com
17
+
18
+ # Business handle (human-readable slug, e.g. "akua-bakery"). Used by the
19
+ # UCP manifest endpoint at /.well-known/ucp so AI agents (Claude / ChatGPT /
20
+ # Gemini) can discover this storefront's commerce capabilities. Set this
21
+ # on production deploys; leave empty in dev unless you're testing UCP.
22
+ NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE=
@@ -0,0 +1,65 @@
1
+ import { NextResponse } from "next/server";
2
+
3
+ /**
4
+ * UCP (Universal Commerce Protocol) manifest discovery endpoint.
5
+ *
6
+ * Agents — Claude, ChatGPT, Gemini, MCP clients — probe
7
+ * `https://<your-domain>/.well-known/ucp` to learn what commerce
8
+ * capabilities your storefront supports. We forward the request to
9
+ * Cimplify, which returns the canonical manifest; the response body
10
+ * tells agents to make subsequent UCP calls directly to
11
+ * `api.cimplify.io/ucp/v1/<handle>/*` (no per-request proxy here).
12
+ *
13
+ * Edge-cached for an hour because capabilities change rarely.
14
+ */
15
+ const UCP_API_BASE =
16
+ process.env.NEXT_PUBLIC_CIMPLIFY_API_URL || "https://api.cimplify.io";
17
+
18
+
19
+ export async function GET() {
20
+ const businessHandle = process.env.NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE;
21
+
22
+ if (!businessHandle) {
23
+ return NextResponse.json(
24
+ {
25
+ error: "NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE not set",
26
+ remediation:
27
+ "Set NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE in .env.local (and your deployment env) to your business handle.",
28
+ },
29
+ { status: 500 },
30
+ );
31
+ }
32
+
33
+ try {
34
+ const response = await fetch(
35
+ `${UCP_API_BASE}/ucp/v1/${businessHandle}/manifest`,
36
+ {
37
+ headers: { "Content-Type": "application/json" },
38
+ next: { revalidate: 3600 },
39
+ },
40
+ );
41
+
42
+ if (!response.ok) {
43
+ return NextResponse.json(
44
+ { error: `Upstream UCP manifest fetch failed: ${response.status}` },
45
+ { status: response.status },
46
+ );
47
+ }
48
+
49
+ const manifest = await response.json();
50
+ return NextResponse.json(manifest, {
51
+ headers: {
52
+ "Content-Type": "application/json",
53
+ "Cache-Control": "public, max-age=3600, s-maxage=3600",
54
+ },
55
+ });
56
+ } catch (error) {
57
+ return NextResponse.json(
58
+ {
59
+ error: "Failed to fetch UCP manifest",
60
+ detail: error instanceof Error ? error.message : String(error),
61
+ },
62
+ { status: 500 },
63
+ );
64
+ }
65
+ }
@@ -17,7 +17,7 @@
17
17
  "check": "bun run typecheck && bun run test:run"
18
18
  },
19
19
  "dependencies": {
20
- "@cimplify/sdk": "^0.45.0",
20
+ "@cimplify/sdk": "^0.45.1",
21
21
  "next": "^16.2.4",
22
22
  "react": "^19.0.0",
23
23
  "react-dom": "^19.0.0"