@cimplify/cli 0.2.2 → 0.2.4

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 (41) hide show
  1. package/dist/{add-YJDP63WM.mjs → add-5JU6S6MB.mjs} +1 -1
  2. package/dist/{chunk-WLLH5HFI.mjs → chunk-2Y4JWLPE.mjs} +2 -2
  3. package/dist/{chunk-O36TGF2L.mjs → chunk-7RQTL7FM.mjs} +1 -1
  4. package/dist/{chunk-2BO4H6VP.mjs → chunk-JOUXICGV.mjs} +1 -1
  5. package/dist/{chunk-VE74N3YS.mjs → chunk-MXYUAJEW.mjs} +3 -1
  6. package/dist/{chunk-4ZVTPMUZ.mjs → chunk-NC3GKHDD.mjs} +2 -2
  7. package/dist/{chunk-SN6E73KY.mjs → chunk-RHAO6VWV.mjs} +138 -6
  8. package/dist/{deploy-N3GTTUI5.mjs → deploy-M37L5P6H.mjs} +4 -4
  9. package/dist/{dev-ABPRBTPU.mjs → dev-AQP6TMYK.mjs} +2 -2
  10. package/dist/dispatcher.mjs +37 -22
  11. package/dist/{domains-7Y23SAEM.mjs → domains-2ZQ7AG27.mjs} +2 -2
  12. package/dist/{env-H6M4G4V6.mjs → env-FDBPGU3W.mjs} +2 -2
  13. package/dist/{link-QPWA5Q6Z.mjs → link-P4K2HRXY.mjs} +1 -1
  14. package/dist/{list-DS4C3JRB.mjs → list-FDJZCW22.mjs} +1 -1
  15. package/dist/{login-JFDAQ7T5.mjs → login-RSKGT6GU.mjs} +1 -1
  16. package/dist/{logs-EABEQBEV.mjs → logs-E2AGTDCF.mjs} +2 -2
  17. package/dist/{projects-L7JEO3KO.mjs → projects-IHDG76PK.mjs} +2 -2
  18. package/dist/{repo-54HUIBFC.mjs → repo-XMMLZHLC.mjs} +3 -3
  19. package/dist/{rollback-YTKRECZ5.mjs → rollback-36O4NOEL.mjs} +3 -3
  20. package/dist/{status-IFJIYWRQ.mjs → status-6AT4HF63.mjs} +2 -2
  21. package/dist/{update-UH2HKLOK.mjs → update-4FJNHZYC.mjs} +1 -1
  22. package/dist/{whoami-INHDUHWA.mjs → whoami-DIJZYZIN.mjs} +1 -1
  23. package/package.json +1 -1
  24. package/templates/storefront-bakery/.env.example +6 -0
  25. package/templates/storefront-bakery/app/.well-known/ucp/route.ts +66 -0
  26. package/templates/storefront-bakery/package.json +1 -1
  27. package/templates/storefront-fashion/.env.example +6 -0
  28. package/templates/storefront-fashion/app/.well-known/ucp/route.ts +66 -0
  29. package/templates/storefront-fashion/package.json +1 -1
  30. package/templates/storefront-grocery/.env.example +6 -0
  31. package/templates/storefront-grocery/app/.well-known/ucp/route.ts +66 -0
  32. package/templates/storefront-grocery/package.json +1 -1
  33. package/templates/storefront-restaurant/.env.example +6 -0
  34. package/templates/storefront-restaurant/app/.well-known/ucp/route.ts +66 -0
  35. package/templates/storefront-restaurant/package.json +1 -1
  36. package/templates/storefront-retail/.env.example +6 -0
  37. package/templates/storefront-retail/app/.well-known/ucp/route.ts +66 -0
  38. package/templates/storefront-retail/package.json +1 -1
  39. package/templates/storefront-services/.env.example +6 -0
  40. package/templates/storefront-services/app/.well-known/ucp/route.ts +66 -0
  41. package/templates/storefront-services/package.json +1 -1
@@ -0,0 +1,66 @@
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
+ export const revalidate = 3600;
19
+
20
+ export async function GET() {
21
+ const businessHandle = process.env.NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE;
22
+
23
+ if (!businessHandle) {
24
+ return NextResponse.json(
25
+ {
26
+ error: "NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE not set",
27
+ remediation:
28
+ "Set NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE in .env.local (and your deployment env) to your business handle.",
29
+ },
30
+ { status: 500 },
31
+ );
32
+ }
33
+
34
+ try {
35
+ const response = await fetch(
36
+ `${UCP_API_BASE}/ucp/v1/${businessHandle}/manifest`,
37
+ {
38
+ headers: { "Content-Type": "application/json" },
39
+ next: { revalidate: 3600 },
40
+ },
41
+ );
42
+
43
+ if (!response.ok) {
44
+ return NextResponse.json(
45
+ { error: `Upstream UCP manifest fetch failed: ${response.status}` },
46
+ { status: response.status },
47
+ );
48
+ }
49
+
50
+ const manifest = await response.json();
51
+ return NextResponse.json(manifest, {
52
+ headers: {
53
+ "Content-Type": "application/json",
54
+ "Cache-Control": "public, max-age=3600, s-maxage=3600",
55
+ },
56
+ });
57
+ } catch (error) {
58
+ return NextResponse.json(
59
+ {
60
+ error: "Failed to fetch UCP manifest",
61
+ detail: error instanceof Error ? error.message : String(error),
62
+ },
63
+ { status: 500 },
64
+ );
65
+ }
66
+ }
@@ -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,66 @@
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
+ export const revalidate = 3600;
19
+
20
+ export async function GET() {
21
+ const businessHandle = process.env.NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE;
22
+
23
+ if (!businessHandle) {
24
+ return NextResponse.json(
25
+ {
26
+ error: "NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE not set",
27
+ remediation:
28
+ "Set NEXT_PUBLIC_CIMPLIFY_BUSINESS_HANDLE in .env.local (and your deployment env) to your business handle.",
29
+ },
30
+ { status: 500 },
31
+ );
32
+ }
33
+
34
+ try {
35
+ const response = await fetch(
36
+ `${UCP_API_BASE}/ucp/v1/${businessHandle}/manifest`,
37
+ {
38
+ headers: { "Content-Type": "application/json" },
39
+ next: { revalidate: 3600 },
40
+ },
41
+ );
42
+
43
+ if (!response.ok) {
44
+ return NextResponse.json(
45
+ { error: `Upstream UCP manifest fetch failed: ${response.status}` },
46
+ { status: response.status },
47
+ );
48
+ }
49
+
50
+ const manifest = await response.json();
51
+ return NextResponse.json(manifest, {
52
+ headers: {
53
+ "Content-Type": "application/json",
54
+ "Cache-Control": "public, max-age=3600, s-maxage=3600",
55
+ },
56
+ });
57
+ } catch (error) {
58
+ return NextResponse.json(
59
+ {
60
+ error: "Failed to fetch UCP manifest",
61
+ detail: error instanceof Error ? error.message : String(error),
62
+ },
63
+ { status: 500 },
64
+ );
65
+ }
66
+ }
@@ -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"