@cloudgrid-io/mcp 0.16.1 → 0.17.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/README.md +39 -39
- package/package.json +1 -1
- package/src/corpus/capability-map.md +7 -7
- package/src/corpus/cloudgrid-yaml.md +5 -5
- package/src/corpus/cookbook.md +1 -1
- package/src/corpus/install.md +1 -1
- package/src/corpus/rules/publish-fallbacks.md +1 -1
- package/src/corpus/skill-claim.md +1 -1
- package/src/corpus/skill-drop.md +2 -2
- package/src/corpus/skill-login.md +2 -2
- package/src/corpus/skills-readme.md +1 -1
- package/src/corpus/templates/ai-knowledge-base/AGENTS.md +1 -1
- package/src/corpus/templates/ai-knowledge-base/index.md +1 -1
- package/src/corpus/templates/api-docs/README.md +3 -3
- package/src/corpus/templates/api-docs/index.md +3 -3
- package/src/corpus/templates/appointment-booking/AGENTS.md +9 -9
- package/src/corpus/templates/appointment-booking/index.md +6 -6
- package/src/corpus/templates/approval-workflow/AGENTS.md +2 -2
- package/src/corpus/templates/approval-workflow/index.md +2 -2
- package/src/corpus/templates/billing-dashboard/index.md +1 -1
- package/src/corpus/templates/calendar-scheduler/AGENTS.md +1 -1
- package/src/corpus/templates/calendar-scheduler/index.md +1 -1
- package/src/corpus/templates/changelog/README.md +3 -3
- package/src/corpus/templates/changelog/index.md +3 -3
- package/src/corpus/templates/company-website/README.md +3 -3
- package/src/corpus/templates/company-website/cloudgrid.yaml +1 -1
- package/src/corpus/templates/company-website/index.md +3 -3
- package/src/corpus/templates/course-platform/index.md +1 -1
- package/src/corpus/templates/dashboard/cloudgrid.yaml +1 -1
- package/src/corpus/templates/dashboard/index.md +3 -3
- package/src/corpus/templates/deck/cloudgrid.yaml +1 -1
- package/src/corpus/templates/deck/index.md +3 -3
- package/src/corpus/templates/docs-site/README.md +3 -3
- package/src/corpus/templates/docs-site/index.md +3 -3
- package/src/corpus/templates/forum/AGENTS.md +6 -6
- package/src/corpus/templates/forum/index.md +1 -1
- package/src/corpus/templates/hr-portal/index.md +1 -1
- package/src/corpus/templates/internal-tools-portal/index.md +1 -1
- package/src/corpus/templates/landing-page/cloudgrid.yaml +1 -1
- package/src/corpus/templates/landing-page/index.md +3 -3
- package/src/corpus/templates/lms/index.md +1 -1
- package/src/corpus/templates/marketplace/AGENTS.md +1 -1
- package/src/corpus/templates/marketplace/index.md +1 -1
- package/src/corpus/templates/membership-site/AGENTS.md +9 -9
- package/src/corpus/templates/membership-site/index.md +6 -6
- package/src/corpus/templates/online-store/index.md +1 -1
- package/src/corpus/templates/portfolio/README.md +3 -3
- package/src/corpus/templates/portfolio/index.md +3 -3
- package/src/corpus/templates/product-launch/README.md +3 -3
- package/src/corpus/templates/product-launch/cloudgrid.yaml +1 -1
- package/src/corpus/templates/product-launch/index.md +3 -3
- package/src/corpus/templates/report/cloudgrid.yaml +1 -1
- package/src/corpus/templates/report/index.md +3 -3
- package/src/corpus/templates/restaurant-reservations/AGENTS.md +9 -9
- package/src/corpus/templates/restaurant-reservations/index.md +2 -2
- package/src/corpus/templates/saas-marketing/README.md +3 -3
- package/src/corpus/templates/saas-marketing/index.md +3 -3
- package/src/corpus/templates/status-page/README.md +3 -3
- package/src/corpus/templates/status-page/index.md +3 -3
- package/src/corpus/templates/subscription-management/AGENTS.md +9 -9
- package/src/corpus/templates/subscription-management/index.md +6 -6
- package/src/corpus/templates/waitlist/README.md +3 -3
- package/src/corpus/templates/waitlist/index.md +3 -3
- package/src/corpus/templates/web-app/cloudgrid.yaml +1 -1
- package/src/corpus/templates/web-app/index.md +3 -3
- package/src/corpus/troubleshooting/deploy-errors.md +1 -1
- package/src/corpus/troubleshooting/persistent-apps.md +1 -1
- package/src/corpus/usage.md +2 -2
- package/src/corpus/workflows/admin-dashboard.md +6 -6
- package/src/corpus/workflows/ai-app.md +8 -8
- package/src/corpus/workflows/ai-knowledge-base.md +6 -6
- package/src/corpus/workflows/analytics-dashboard.md +6 -6
- package/src/corpus/workflows/api-dashboard.md +6 -6
- package/src/corpus/workflows/api-docs.md +3 -3
- package/src/corpus/workflows/api-service.md +8 -8
- package/src/corpus/workflows/app-with-data.md +8 -8
- package/src/corpus/workflows/appointment-booking.md +8 -8
- package/src/corpus/workflows/approval-workflow.md +6 -6
- package/src/corpus/workflows/billing-dashboard.md +8 -8
- package/src/corpus/workflows/blog-cms.md +6 -6
- package/src/corpus/workflows/booking-system.md +7 -7
- package/src/corpus/workflows/calendar-scheduler.md +6 -6
- package/src/corpus/workflows/changelog.md +3 -3
- package/src/corpus/workflows/company-website.md +4 -4
- package/src/corpus/workflows/course-platform.md +7 -7
- package/src/corpus/workflows/crm.md +7 -7
- package/src/corpus/workflows/dashboard.md +4 -4
- package/src/corpus/workflows/directory.md +6 -6
- package/src/corpus/workflows/docs-site.md +3 -3
- package/src/corpus/workflows/erp.md +7 -7
- package/src/corpus/workflows/event-board.md +6 -6
- package/src/corpus/workflows/expense-tracker.md +6 -6
- package/src/corpus/workflows/feature-request-board.md +6 -6
- package/src/corpus/workflows/financial-dashboard.md +6 -6
- package/src/corpus/workflows/forum.md +7 -7
- package/src/corpus/workflows/hr-portal.md +7 -7
- package/src/corpus/workflows/internal-tools-portal.md +7 -7
- package/src/corpus/workflows/inventory.md +6 -6
- package/src/corpus/workflows/invoice.md +6 -6
- package/src/corpus/workflows/job-board.md +6 -6
- package/src/corpus/workflows/kanban.md +7 -7
- package/src/corpus/workflows/landing-page.md +4 -4
- package/src/corpus/workflows/lms.md +7 -7
- package/src/corpus/workflows/marketplace.md +6 -6
- package/src/corpus/workflows/membership-site.md +8 -8
- package/src/corpus/workflows/monitoring-dashboard.md +6 -6
- package/src/corpus/workflows/online-store.md +8 -8
- package/src/corpus/workflows/portfolio.md +3 -3
- package/src/corpus/workflows/presentation.md +4 -4
- package/src/corpus/workflows/product-catalog.md +6 -6
- package/src/corpus/workflows/product-launch.md +4 -4
- package/src/corpus/workflows/project-management.md +6 -6
- package/src/corpus/workflows/property-listings.md +6 -6
- package/src/corpus/workflows/quiz-platform.md +6 -6
- package/src/corpus/workflows/report.md +4 -4
- package/src/corpus/workflows/restaurant-reservations.md +7 -7
- package/src/corpus/workflows/revenue-dashboard.md +6 -6
- package/src/corpus/workflows/saas-marketing.md +3 -3
- package/src/corpus/workflows/semantic-search.md +7 -7
- package/src/corpus/workflows/status-page.md +3 -3
- package/src/corpus/workflows/subscription-management.md +8 -8
- package/src/corpus/workflows/task-manager.md +6 -6
- package/src/corpus/workflows/ticket-system.md +6 -6
- package/src/corpus/workflows/time-tracking.md +6 -6
- package/src/corpus/workflows/travel-booking.md +7 -7
- package/src/corpus/workflows/waitlist.md +3 -3
- package/src/corpus/workflows/web-app.md +4 -4
- package/src/docs.js +5 -5
- package/src/index.js +1 -1
- package/src/tools.js +191 -142
- package/src/web.js +1 -1
- package/src/widgets/live-result.html +1 -1
- package/src/widgets/org-picker.html +1 -1
|
@@ -15,8 +15,8 @@ flow, use the `membership-site` blueprint — the two share the same Stripe + Mo
|
|
|
15
15
|
wiring.
|
|
16
16
|
|
|
17
17
|
**Fetch the bundle:**
|
|
18
|
-
- `
|
|
19
|
-
- `
|
|
18
|
+
- `grid_fetch("template", "subscription-management")` — this blueprint (`cloudgrid.yaml` + `AGENTS.md`).
|
|
19
|
+
- `grid_fetch("template", "app-with-data")` — the proven Next.js + Mongo shape to extend (lazy db client, App-Router API).
|
|
20
20
|
|
|
21
21
|
**Key rules:**
|
|
22
22
|
|
|
@@ -30,7 +30,7 @@ wiring.
|
|
|
30
30
|
`DATABASE_MONGODB_URL` (legacy `MONGODB_URL` fallback). Read it LAZILY inside
|
|
31
31
|
the getter, never at module top level (top-level read fails `next build`).
|
|
32
32
|
4. **Secrets via the `vault:` block** → env vars. `STRIPE_KEY` and
|
|
33
|
-
`STRIPE_WEBHOOK_SECRET` map to vault items; set them with `
|
|
33
|
+
`STRIPE_WEBHOOK_SECRET` map to vault items; set them with `grid_secrets`,
|
|
34
34
|
and the deployer injects them at runtime. Read lazily; do not commit keys or
|
|
35
35
|
put secrets in `services.web.env` (publishable key + price ids go there).
|
|
36
36
|
5. **The webhook is the source of truth.** Change-plan / cancel APIs call Stripe;
|
|
@@ -66,8 +66,8 @@ vault:
|
|
|
66
66
|
|
|
67
67
|
## Deploy (async, local edition)
|
|
68
68
|
|
|
69
|
-
`
|
|
70
|
-
`services/web/`, set the vault secrets with `
|
|
71
|
-
(async — poll `
|
|
69
|
+
`grid_init` first (creates the entity + link.json), write the app under
|
|
70
|
+
`services/web/`, set the vault secrets with `grid_secrets`, `grid_plug`
|
|
71
|
+
(async — poll `grid_status` to a live URL), then register the `/api/webhook`
|
|
72
72
|
URL in Stripe, configure the Billing Portal, and re-plug. Re-plug the same entity
|
|
73
73
|
to update the same URL.
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
A single self-contained HTML launch waitlist / coming-soon page: a hero, an email capture form, and a social-proof counter.
|
|
4
4
|
|
|
5
5
|
Static inspiration — a single self-contained `index.html` (inline CSS and JS,
|
|
6
|
-
no external CDNs). It deploys instantly via `
|
|
6
|
+
no external CDNs). It deploys instantly via `grid_drop` and works on every
|
|
7
7
|
CloudGrid edition, including hosted.
|
|
8
8
|
|
|
9
9
|
## Fill it in
|
|
10
10
|
|
|
11
|
-
Fetch the template with `
|
|
11
|
+
Fetch the template with `grid_fetch("template", "waitlist")`, then replace the
|
|
12
12
|
placeholders:
|
|
13
13
|
|
|
14
14
|
- The product name, coming-soon headline, and subheadline.
|
|
@@ -21,7 +21,7 @@ stylesheets, fonts, or large embedded media.
|
|
|
21
21
|
## Deploy
|
|
22
22
|
|
|
23
23
|
- Hosted MCP edition: call the drop tool with the HTML.
|
|
24
|
-
- Local MCP / CLI edition: write the HTML to a file and run `
|
|
24
|
+
- Local MCP / CLI edition: write the HTML to a file and run `grid plug`.
|
|
25
25
|
|
|
26
26
|
It deploys as an inspiration and returns a live share URL right away. Re-deploy
|
|
27
27
|
with the same entity id to update the same URL.
|
|
@@ -5,14 +5,14 @@ State (if any) lives only in memory and is lost on refresh.
|
|
|
5
5
|
|
|
6
6
|
## How it deploys
|
|
7
7
|
|
|
8
|
-
To publish this page, use **`
|
|
8
|
+
To publish this page, use **`grid_drop`** (or `grid_plug` with the inline
|
|
9
9
|
HTML): it deploys as an **inspiration** — instant, and works on the **hosted**
|
|
10
10
|
edition (Claude Web) as well as local. The reference `cloudgrid.yaml` in this
|
|
11
11
|
directory (`type: static`) is ONLY for plugging the page as an OWNED static
|
|
12
|
-
runtime (async, local edition only); the fast path is `
|
|
12
|
+
runtime (async, local edition only); the fast path is `grid_drop`.
|
|
13
13
|
|
|
14
14
|
The fillable HTML is the real template — fetch it with
|
|
15
|
-
`
|
|
15
|
+
`grid_fetch("template", "waitlist")` and fill in the user's content.
|
|
16
16
|
|
|
17
17
|
## Note on storing signups
|
|
18
18
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
# THIS TEMPLATE (web-app): a single self-contained static page. The active fields
|
|
17
17
|
# are exactly name + services.web{type: static, path: /}; there are no needs.
|
|
18
18
|
# This cloudgrid.yaml is the reference for plugging it as an OWNED static
|
|
19
|
-
# runtime; the fast path is to deploy it as an INSPIRATION via
|
|
19
|
+
# runtime; the fast path is to deploy it as an INSPIRATION via grid_drop
|
|
20
20
|
# (instant, and works on the hosted edition too).
|
|
21
21
|
# ============================================================================
|
|
22
22
|
|
|
@@ -5,14 +5,14 @@ no `needs:`. State (if any) lives only in memory and is lost on refresh.
|
|
|
5
5
|
|
|
6
6
|
## How it deploys
|
|
7
7
|
|
|
8
|
-
To publish this page, use **`
|
|
8
|
+
To publish this page, use **`grid_drop`** (or `grid_plug` with the inline
|
|
9
9
|
HTML): it deploys as an **inspiration** — instant, and works on the **hosted**
|
|
10
10
|
edition (Claude Web) as well as local. The reference `cloudgrid.yaml` in this
|
|
11
11
|
directory (`type: static`) is ONLY for plugging the page as an OWNED static
|
|
12
|
-
runtime (async, local edition only); the fast path is `
|
|
12
|
+
runtime (async, local edition only); the fast path is `grid_drop`.
|
|
13
13
|
|
|
14
14
|
The fillable HTML is the real template — fetch it with
|
|
15
|
-
`
|
|
15
|
+
`grid_fetch("template", "web-app")` and fill in the user's content.
|
|
16
16
|
|
|
17
17
|
## cloudgrid.yaml (reference only)
|
|
18
18
|
|
|
@@ -10,7 +10,7 @@ Match the symptom to the row, apply the fix, and stop. Do not retry permutations
|
|
|
10
10
|
|
|
11
11
|
| Symptom | Cause | Fix |
|
|
12
12
|
| --- | --- | --- |
|
|
13
|
-
| `SCOPE_INVALID` on deploy | Known platform issue, not your request | Deploy from a terminal with `
|
|
13
|
+
| `SCOPE_INVALID` on deploy | Known platform issue, not your request | Deploy from a terminal with `grid plug <path>` or `cloudgrid plug <path>`. Do not retry flag or path permutations. If no terminal is available, tell the user it is a known issue that needs the CLI. |
|
|
14
14
|
| `429` anonymous cap reached | Anonymous deploy quota is exhausted | Stop. Do not log in to work around it and do not retry today. Tell the user the cap is reached; they can try later or sign in for a higher limit as a deliberate choice. |
|
|
15
15
|
| `409 EDIT_REJECTED` on re-plug | The target entity is archived or expired | Do not silently create a new entity — that mints a new URL and orphans the shared one. Ask the user before creating a fresh entity. |
|
|
16
16
|
| `401` on an anonymous edit | Missing or stale `owner_token` | Re-plug with the `owner_token` from the last deploy of that entity. Each anonymous edit returns a fresh token — store the new one and use it next time. |
|
|
@@ -15,7 +15,7 @@ Match the symptom to the row, apply the fix, and stop.
|
|
|
15
15
|
| `next build` fails / DB connection error at build time | The DB env var is read at module top level; `next build` imports the module for route analysis before the grid injects the var | Read `process.env.DATABASE_MONGODB_URL` (with a legacy `MONGODB_URL` fallback) LAZILY inside the getter (e.g. inside `getDb`), never at module load. Moving the check into the function lets the build pass. |
|
|
16
16
|
| App builds + deploys but every request 500s with `DATABASE_MONGODB_URL not set` | The datastore isn't declared, or you declared the deprecated `requires:` instead of `needs:` | Declare `needs: { database: true }` in `cloudgrid.yaml`. The deployer provisions Mongo and injects `DATABASE_MONGODB_URL` (plus the legacy `MONGODB_URL` alias). Never set `needs:` and `requires:` together (the validator rejects it). |
|
|
17
17
|
| `DATABASE_MONGODB_URL is undefined` (or the db.js guard throws) | The env var isn't present because you're not running under the grid | Run locally with `grid dev`, or deploy with `grid plug` — the grid injects `DATABASE_MONGODB_URL` (+legacy `MONGODB_URL`) at dev-time and runtime. Do NOT set it yourself and never hardcode a connection string. |
|
|
18
|
-
| Deploy seems stuck / no URL returned | Runtime deploys are asynchronous | `plug` returns `status: building`, not a URL. Poll `
|
|
18
|
+
| Deploy seems stuck / no URL returned | Runtime deploys are asynchronous | `plug` returns `status: building`, not a URL. Poll `grid_status` (or the poll_url) until the app is live, then return the live URL. Don't treat the build/log link as the deliverable. |
|
|
19
19
|
| It won't build on the hosted edition | Hosted MCP is inline-only — it can't run the CLI or folder-plug | Runtime apps need the LOCAL edition (Claude Desktop/Code) or the CLI. On hosted, tell the user persistence isn't available there and offer a static version instead. |
|
|
20
20
|
| Redis not available | `cache` wasn't declared | Add `cache: true` to `needs:` in `cloudgrid.yaml`; the grid then injects `CACHE_REDIS_URL` (plus the legacy `REDIS_URL` alias). Only add it if the app actually needs Redis. |
|
|
21
21
|
|
package/src/corpus/usage.md
CHANGED
|
@@ -16,7 +16,7 @@ Which one you use depends on the client. Pick your client below.
|
|
|
16
16
|
- **Node 18+** (for `npx`).
|
|
17
17
|
- **No login needed to try it** — anonymous drop works out of the box. For owned
|
|
18
18
|
drops (into your org), run `cloudgrid login` once, or use the `login` skill / the
|
|
19
|
-
`
|
|
19
|
+
`grid_login` MCP tool.
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
@@ -45,7 +45,7 @@ npx skills add cloudgrid-io/skills
|
|
|
45
45
|
```
|
|
46
46
|
claude mcp add cloudgrid -- npx -y @cloudgrid-io/mcp
|
|
47
47
|
```
|
|
48
|
-
- **Find it under `/mcp`.** Exposes tools `
|
|
48
|
+
- **Find it under `/mcp`.** Exposes tools `grid_drop`, `grid_login`, …
|
|
49
49
|
- Invoke by describing the task; the model calls the tool.
|
|
50
50
|
|
|
51
51
|
> Where did my install go? `/skills` (skills), `/plugin` (plugin), `/mcp` (MCP).
|
|
@@ -33,13 +33,13 @@ edition** (Claude Desktop / Claude Code) or the CLI.
|
|
|
33
33
|
|
|
34
34
|
## 2. Auth + grid
|
|
35
35
|
|
|
36
|
-
1. Ensure signed in: `
|
|
36
|
+
1. Ensure signed in: `grid_login_status`; if not, `grid_login`.
|
|
37
37
|
2. A grid is required. Respect the grid picker: if the user has more than one
|
|
38
38
|
grid, ask which to use; do not assume a target.
|
|
39
39
|
|
|
40
40
|
## 3. Scaffold
|
|
41
41
|
|
|
42
|
-
`
|
|
42
|
+
`grid_init` an app `<name>`. `init` creates the entity + `.cloudgrid/link.json`
|
|
43
43
|
and writes a `cloudgrid.yaml` with an EMPTY `services: {}`. `plug` needs a linked
|
|
44
44
|
directory, so run `init` FIRST. Then (a) write the app under **`services/web/`**,
|
|
45
45
|
and (b) fill `cloudgrid.yaml` to the shape below (`services.web` + `needs:
|
|
@@ -64,7 +64,7 @@ and (b) fill `cloudgrid.yaml` to the shape below (`services.web` + `needs:
|
|
|
64
64
|
author new yaml with it, and never set `needs:` and `requires:` together (the
|
|
65
65
|
validator rejects it).
|
|
66
66
|
2. Fetch the template for the Mongo wiring + CRUD shape:
|
|
67
|
-
`
|
|
67
|
+
`grid_fetch("template", "admin-dashboard")`. It is a minimal, real Next.js
|
|
68
68
|
+ `mongodb`-driver admin panel under `services/web/`: a lazy client in
|
|
69
69
|
`services/web/lib/db.js`, two App-Router GET/POST/DELETE routes (`users` and
|
|
70
70
|
`orders`), a server-component page that computes a metrics header, and a
|
|
@@ -83,15 +83,15 @@ before deploying. Don't require it.
|
|
|
83
83
|
|
|
84
84
|
## 6. Config
|
|
85
85
|
|
|
86
|
-
- API keys / secrets → `
|
|
86
|
+
- API keys / secrets → `grid_secrets`. Non-secret config → `grid_env`.
|
|
87
87
|
- Do **NOT** set the DB connection vars yourself (`DATABASE_MONGODB_URL` or the
|
|
88
88
|
legacy `MONGODB_URL`) — the grid injects them.
|
|
89
89
|
|
|
90
90
|
## 7. Deploy (async)
|
|
91
91
|
|
|
92
|
-
Deploy the folder with `
|
|
92
|
+
Deploy the folder with `grid_plug`. A **runtime deploy is ASYNC**: the first
|
|
93
93
|
response is `status: "building"`, NOT a live URL yet.
|
|
94
|
-
- Poll `
|
|
94
|
+
- Poll `grid_status` (or the returned poll_url) until the entity is live.
|
|
95
95
|
- Surface a liveness signal while it builds — never a bare silent wait.
|
|
96
96
|
- Only once it is live, return the deployed app URL (NOT the build/log link).
|
|
97
97
|
|
|
@@ -35,13 +35,13 @@ folder-plug your project.
|
|
|
35
35
|
## 2. Auth + grid
|
|
36
36
|
|
|
37
37
|
Persistent apps are owned entities.
|
|
38
|
-
1. Ensure signed in: `
|
|
38
|
+
1. Ensure signed in: `grid_login_status`; if not, `grid_login`.
|
|
39
39
|
2. A grid is required. Respect the grid picker: if the user has more than one
|
|
40
40
|
grid, ask which to use; do not assume a target.
|
|
41
41
|
|
|
42
42
|
## 3. Scaffold
|
|
43
43
|
|
|
44
|
-
`
|
|
44
|
+
`grid_init` an app `<name>`. `init` creates the entity + `.cloudgrid/link.json`
|
|
45
45
|
and writes a `cloudgrid.yaml` with an EMPTY `services: {}`. `plug` needs a linked
|
|
46
46
|
directory, so run `init` FIRST.
|
|
47
47
|
|
|
@@ -75,7 +75,7 @@ ai: true, database: true }`).
|
|
|
75
75
|
yaml with it, and never set `needs:` and `requires:` together (the validator
|
|
76
76
|
rejects it).
|
|
77
77
|
2. Fetch the template for the chat wiring:
|
|
78
|
-
`
|
|
78
|
+
`grid_fetch("template", "ai-app")`. It is a minimal Next.js App Router chat
|
|
79
79
|
app under `services/web/`: a chat page, an API route
|
|
80
80
|
(`app/api/chat/route.js`, `export const dynamic = "force-dynamic"`) that reads
|
|
81
81
|
the user message, calls the AI gateway, persists the exchange to Mongo, and
|
|
@@ -95,7 +95,7 @@ ai: true, database: true }`).
|
|
|
95
95
|
imported for route analysis before the grid injects the var). Store the user
|
|
96
96
|
message and the assistant reply so the conversation survives refresh. Never
|
|
97
97
|
hardcode a connection string; never commit a secret.
|
|
98
|
-
- (Optional) fetch `
|
|
98
|
+
- (Optional) fetch `grid_fetch("example", "ai-app")` for a richer filled
|
|
99
99
|
reference (a themed assistant) to imitate.
|
|
100
100
|
|
|
101
101
|
## 5. (Optional) Run locally
|
|
@@ -105,17 +105,17 @@ are wired in dev too — and send a test message before deploying. Don't require
|
|
|
105
105
|
|
|
106
106
|
## 6. Config
|
|
107
107
|
|
|
108
|
-
- Extra API keys / secrets (only if the app needs its own) → `
|
|
109
|
-
- Non-secret config → `
|
|
108
|
+
- Extra API keys / secrets (only if the app needs its own) → `grid_secrets`.
|
|
109
|
+
- Non-secret config → `grid_env`.
|
|
110
110
|
- Do **NOT** set the DB connection var yourself (`DATABASE_MONGODB_URL` / legacy
|
|
111
111
|
`MONGODB_URL`) and do **NOT** set an AI key — the grid injects the DB var and
|
|
112
112
|
the AI SDK auto-detects the in-grid identity.
|
|
113
113
|
|
|
114
114
|
## 7. Deploy (async)
|
|
115
115
|
|
|
116
|
-
Deploy the folder with `
|
|
116
|
+
Deploy the folder with `grid_plug`. A **runtime deploy is ASYNC**: the first
|
|
117
117
|
response is `status: "building"` with a `poll_url` / entity, NOT a live URL yet.
|
|
118
|
-
- Poll `
|
|
118
|
+
- Poll `grid_status` (or the returned poll_url) until the entity is live.
|
|
119
119
|
- Surface a liveness signal while it builds — never a bare silent wait.
|
|
120
120
|
- Only once it is live, return the deployed URL (the app URL, NOT the build/log
|
|
121
121
|
link).
|
|
@@ -44,13 +44,13 @@ CLI.
|
|
|
44
44
|
|
|
45
45
|
## 2. Auth + grid
|
|
46
46
|
|
|
47
|
-
1. Ensure signed in: `
|
|
47
|
+
1. Ensure signed in: `grid_login_status`; if not, `grid_login`.
|
|
48
48
|
2. A grid is required. Respect the grid picker: if the user has more than one
|
|
49
49
|
grid, ask which to use; do not assume a target.
|
|
50
50
|
|
|
51
51
|
## 3. Fetch the blueprint and READ AGENTS.md
|
|
52
52
|
|
|
53
|
-
`
|
|
53
|
+
`grid_fetch("template", "ai-knowledge-base")`. The deliverable is the
|
|
54
54
|
**`AGENTS.md` structure guide** — read it before writing anything. It defines:
|
|
55
55
|
- the `services/web/` file tree (pages, `api/documents` + `api/ask` routes, `lib/`),
|
|
56
56
|
- the Mongo collections (`documents`, `chunks`) + fields,
|
|
@@ -64,7 +64,7 @@ There is no app code to copy — you generate it from the guide.
|
|
|
64
64
|
|
|
65
65
|
## 4. Scaffold + fill cloudgrid.yaml
|
|
66
66
|
|
|
67
|
-
`
|
|
67
|
+
`grid_init` an app `<name>` FIRST (creates the entity + `.cloudgrid/link.json`
|
|
68
68
|
and a starter `cloudgrid.yaml` with empty `services:{}`; `plug` needs a linked
|
|
69
69
|
directory). Then put the app under **`services/web/`** and set `cloudgrid.yaml` to
|
|
70
70
|
the blueprint's active fields:
|
|
@@ -112,7 +112,7 @@ Generate the files under `services/web/` per the guide:
|
|
|
112
112
|
yourself; the grid injects them.
|
|
113
113
|
- Only if you add auth/payments: map the secret in the `vault:` block
|
|
114
114
|
(`AUTH_PROVIDER_KEY` and/or `STRIPE_KEY`) and store the value with
|
|
115
|
-
`grid secrets set <vault-item-key> …`. Non-secret public config → `
|
|
115
|
+
`grid secrets set <vault-item-key> …`. Non-secret public config → `grid_env`.
|
|
116
116
|
|
|
117
117
|
## 7. (Optional) Run locally
|
|
118
118
|
|
|
@@ -121,9 +121,9 @@ Gateway before deploying. Don't require it.
|
|
|
121
121
|
|
|
122
122
|
## 8. Deploy (async)
|
|
123
123
|
|
|
124
|
-
Deploy the folder with `
|
|
124
|
+
Deploy the folder with `grid_plug`. A **runtime deploy is ASYNC**: the first
|
|
125
125
|
response is `status: "building"`, NOT a live URL yet.
|
|
126
|
-
- Poll `
|
|
126
|
+
- Poll `grid_status` (or the returned poll_url) until the entity is live.
|
|
127
127
|
- Surface a liveness signal while it builds — never a bare silent wait.
|
|
128
128
|
- Only once it is live, return the deployed app URL (NOT the build/log link).
|
|
129
129
|
|
|
@@ -34,13 +34,13 @@ edition** (Claude Desktop / Claude Code) or the CLI.
|
|
|
34
34
|
|
|
35
35
|
## 2. Auth + grid
|
|
36
36
|
|
|
37
|
-
1. Ensure signed in: `
|
|
37
|
+
1. Ensure signed in: `grid_login_status`; if not, `grid_login`.
|
|
38
38
|
2. A grid is required. Respect the grid picker: if the user has more than one
|
|
39
39
|
grid, ask which to use; do not assume a target.
|
|
40
40
|
|
|
41
41
|
## 3. Scaffold
|
|
42
42
|
|
|
43
|
-
`
|
|
43
|
+
`grid_init` an app `<name>`. `init` creates the entity + `.cloudgrid/link.json`
|
|
44
44
|
and writes a `cloudgrid.yaml` with an EMPTY `services: {}`. `plug` needs a linked
|
|
45
45
|
directory, so run `init` FIRST. Then (a) write the app under **`services/web/`**,
|
|
46
46
|
and (b) fill `cloudgrid.yaml` to the shape below (`services.web` + `needs:
|
|
@@ -65,7 +65,7 @@ and (b) fill `cloudgrid.yaml` to the shape below (`services.web` + `needs:
|
|
|
65
65
|
author new yaml with it, and never set `needs:` and `requires:` together (the
|
|
66
66
|
validator rejects it).
|
|
67
67
|
2. Fetch the template for the Mongo wiring + aggregation shape:
|
|
68
|
-
`
|
|
68
|
+
`grid_fetch("template", "analytics-dashboard")`. It is a minimal, real
|
|
69
69
|
Next.js + `mongodb`-driver dashboard under `services/web/`: a lazy client in
|
|
70
70
|
`services/web/lib/db.js`, an App-Router GET/POST/DELETE route on an `events`
|
|
71
71
|
collection, a server-component page that reads the collection and computes
|
|
@@ -85,15 +85,15 @@ before deploying. Don't require it.
|
|
|
85
85
|
|
|
86
86
|
## 6. Config
|
|
87
87
|
|
|
88
|
-
- API keys / secrets → `
|
|
88
|
+
- API keys / secrets → `grid_secrets`. Non-secret config → `grid_env`.
|
|
89
89
|
- Do **NOT** set the DB connection vars yourself (`DATABASE_MONGODB_URL` or the
|
|
90
90
|
legacy `MONGODB_URL`) — the grid injects them.
|
|
91
91
|
|
|
92
92
|
## 7. Deploy (async)
|
|
93
93
|
|
|
94
|
-
Deploy the folder with `
|
|
94
|
+
Deploy the folder with `grid_plug`. A **runtime deploy is ASYNC**: the first
|
|
95
95
|
response is `status: "building"`, NOT a live URL yet.
|
|
96
|
-
- Poll `
|
|
96
|
+
- Poll `grid_status` (or the returned poll_url) until the entity is live.
|
|
97
97
|
- Surface a liveness signal while it builds — never a bare silent wait.
|
|
98
98
|
- Only once it is live, return the deployed app URL (NOT the build/log link).
|
|
99
99
|
|
|
@@ -33,13 +33,13 @@ edition** (Claude Desktop / Claude Code) or the CLI.
|
|
|
33
33
|
|
|
34
34
|
## 2. Auth + grid
|
|
35
35
|
|
|
36
|
-
1. Ensure signed in: `
|
|
36
|
+
1. Ensure signed in: `grid_login_status`; if not, `grid_login`.
|
|
37
37
|
2. A grid is required. Respect the grid picker: if the user has more than one
|
|
38
38
|
grid, ask which to use; do not assume a target.
|
|
39
39
|
|
|
40
40
|
## 3. Scaffold
|
|
41
41
|
|
|
42
|
-
`
|
|
42
|
+
`grid_init` an app `<name>`. `init` creates the entity + `.cloudgrid/link.json`
|
|
43
43
|
and writes a `cloudgrid.yaml` with an EMPTY `services: {}`. `plug` needs a linked
|
|
44
44
|
directory, so run `init` FIRST. Then (a) write the app under **`services/web/`**,
|
|
45
45
|
and (b) fill `cloudgrid.yaml` to the shape below (`services.web` + `needs:
|
|
@@ -64,7 +64,7 @@ and (b) fill `cloudgrid.yaml` to the shape below (`services.web` + `needs:
|
|
|
64
64
|
author new yaml with it, and never set `needs:` and `requires:` together (the
|
|
65
65
|
validator rejects it).
|
|
66
66
|
2. Fetch the template for the Mongo wiring + CRUD shape:
|
|
67
|
-
`
|
|
67
|
+
`grid_fetch("template", "api-dashboard")`. It is a minimal, real Next.js +
|
|
68
68
|
`mongodb`-driver request monitor under `services/web/`: a lazy client in
|
|
69
69
|
`services/web/lib/db.js`, an App-Router GET/POST/DELETE route on a `requests`
|
|
70
70
|
collection, a server-component page that reads the log, and a client dashboard
|
|
@@ -83,15 +83,15 @@ before deploying. Don't require it.
|
|
|
83
83
|
|
|
84
84
|
## 6. Config
|
|
85
85
|
|
|
86
|
-
- API keys / secrets → `
|
|
86
|
+
- API keys / secrets → `grid_secrets`. Non-secret config → `grid_env`.
|
|
87
87
|
- Do **NOT** set the DB connection vars yourself (`DATABASE_MONGODB_URL` or the
|
|
88
88
|
legacy `MONGODB_URL`) — the grid injects them.
|
|
89
89
|
|
|
90
90
|
## 7. Deploy (async)
|
|
91
91
|
|
|
92
|
-
Deploy the folder with `
|
|
92
|
+
Deploy the folder with `grid_plug`. A **runtime deploy is ASYNC**: the first
|
|
93
93
|
response is `status: "building"`, NOT a live URL yet.
|
|
94
|
-
- Poll `
|
|
94
|
+
- Poll `grid_status` (or the returned poll_url) until the entity is live.
|
|
95
95
|
- Surface a liveness signal while it builds — never a bare silent wait.
|
|
96
96
|
- Only once it is live, return the deployed app URL (NOT the build/log link).
|
|
97
97
|
|
|
@@ -4,7 +4,7 @@ when: API documentation, API reference, endpoint docs, REST API docs, method/par
|
|
|
4
4
|
needs: none
|
|
5
5
|
deploy: inspiration
|
|
6
6
|
editions: all
|
|
7
|
-
capabilities_note: static — no infrastructure. Publishes as an inspiration (instant, works on hosted) via
|
|
7
|
+
capabilities_note: static — no infrastructure. Publishes as an inspiration (instant, works on hosted) via grid_drop.
|
|
8
8
|
summary: Fetch the api-docs template, fill it with the user's endpoints, deploy it, and return the live share URL.
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -15,7 +15,7 @@ this recipe. For prose guides or a general docs site, use `docs-site`; use this
|
|
|
15
15
|
one when the content is an endpoint reference. Do not ask setup questions first;
|
|
16
16
|
use sensible defaults and build.
|
|
17
17
|
|
|
18
|
-
1. **Fetch the template.** Call `
|
|
18
|
+
1. **Fetch the template.** Call `grid_fetch("template", "api-docs")` to load
|
|
19
19
|
the self-contained HTML API reference (sidebar endpoint list, method badges,
|
|
20
20
|
params tables, request/response code blocks, client-side filter).
|
|
21
21
|
2. **Fill the template.** Replace the placeholders with the user's content:
|
|
@@ -28,7 +28,7 @@ use sensible defaults and build.
|
|
|
28
28
|
stylesheets, fonts, or large embedded media.
|
|
29
29
|
3. **Deploy.** Deploy the filled HTML:
|
|
30
30
|
- Hosted MCP edition: call the drop tool with the HTML.
|
|
31
|
-
- Local MCP / CLI edition: write the HTML to a file and run `
|
|
31
|
+
- Local MCP / CLI edition: write the HTML to a file and run `grid plug`.
|
|
32
32
|
It is an inspiration and deploys synchronously, so you get a URL right away.
|
|
33
33
|
4. **Return the live share URL.** For revisions, re-deploy with the entity id
|
|
34
34
|
from the first deploy — it updates the same share URL.
|
|
@@ -36,13 +36,13 @@ the CLI and folder-plug your project.
|
|
|
36
36
|
## 2. Auth + grid
|
|
37
37
|
|
|
38
38
|
Persistent services are owned entities.
|
|
39
|
-
1. Ensure signed in: `
|
|
39
|
+
1. Ensure signed in: `grid_login_status`; if not, `grid_login`.
|
|
40
40
|
2. A grid is required. Respect the grid picker: if the user has more than one
|
|
41
41
|
grid, ask which to use; do not assume a target.
|
|
42
42
|
|
|
43
43
|
## 3. Scaffold
|
|
44
44
|
|
|
45
|
-
`
|
|
45
|
+
`grid_init` an app `<name>`. `init` creates the entity + `.cloudgrid/link.json`
|
|
46
46
|
and writes a `cloudgrid.yaml` with an EMPTY `services: {}`. `plug` needs a linked
|
|
47
47
|
directory, so run `init` FIRST.
|
|
48
48
|
|
|
@@ -72,7 +72,7 @@ fill in `cloudgrid.yaml` to the shape below (`services.api` type `node` + `needs
|
|
|
72
72
|
runtime. `requires:` is the deprecated v1 alias; don't author new yaml with
|
|
73
73
|
it, and never set `needs:` and `requires:` together (the validator rejects it).
|
|
74
74
|
2. Fetch the template for the server + Mongo shape:
|
|
75
|
-
`
|
|
75
|
+
`grid_fetch("template", "api-service")`. It is a minimal Node `http`
|
|
76
76
|
server under `services/api/`: it listens on `process.env.PORT || 8080` and
|
|
77
77
|
serves a small REST resource (`/items` GET list / POST create / DELETE by id)
|
|
78
78
|
backed by Mongo.
|
|
@@ -85,7 +85,7 @@ fill in `cloudgrid.yaml` to the shape below (`services.api` type `node` + `needs
|
|
|
85
85
|
never at module top level, or node startup crashes** before the grid has
|
|
86
86
|
injected the var.
|
|
87
87
|
- Return clear JSON errors (`{ "error": "…" }`) with the right status codes.
|
|
88
|
-
- (Optional) fetch `
|
|
88
|
+
- (Optional) fetch `grid_fetch("example", "api-service")` for a slightly
|
|
89
89
|
richer filled reference to imitate.
|
|
90
90
|
|
|
91
91
|
## 5. (Optional) Run locally
|
|
@@ -95,16 +95,16 @@ and hit the endpoints before deploying. Don't require it.
|
|
|
95
95
|
|
|
96
96
|
## 6. Config
|
|
97
97
|
|
|
98
|
-
- API keys / secrets → `
|
|
99
|
-
- Non-secret config → `
|
|
98
|
+
- API keys / secrets → `grid_secrets`.
|
|
99
|
+
- Non-secret config → `grid_env`.
|
|
100
100
|
- Do **NOT** set the DB connection vars yourself (`DATABASE_MONGODB_URL`, or the
|
|
101
101
|
legacy `MONGODB_URL` alias) — the grid injects them.
|
|
102
102
|
|
|
103
103
|
## 7. Deploy (async)
|
|
104
104
|
|
|
105
|
-
Deploy the folder with `
|
|
105
|
+
Deploy the folder with `grid_plug`. A **runtime deploy is ASYNC**: the first
|
|
106
106
|
response is `status: "building"` with a `poll_url` / entity, NOT a live URL yet.
|
|
107
|
-
- Poll `
|
|
107
|
+
- Poll `grid_status` (or the returned poll_url) until the entity is live.
|
|
108
108
|
- Surface a liveness signal while it builds — never a bare silent wait.
|
|
109
109
|
- Only once it is live, return the deployed URL (the API base URL, NOT the
|
|
110
110
|
build/log link).
|
|
@@ -36,14 +36,14 @@ the CLI and folder-plug your project.
|
|
|
36
36
|
## 2. Auth + grid
|
|
37
37
|
|
|
38
38
|
Persistent apps are owned entities.
|
|
39
|
-
1. Ensure signed in: `
|
|
39
|
+
1. Ensure signed in: `grid_login_status`; if not, `grid_login`.
|
|
40
40
|
2. A grid is required. Respect the grid picker: if the user has more than one
|
|
41
41
|
grid, ask which to use (per the existing `resolveGridOrAsk` behavior); do not
|
|
42
42
|
assume a target.
|
|
43
43
|
|
|
44
44
|
## 3. Scaffold
|
|
45
45
|
|
|
46
|
-
`
|
|
46
|
+
`grid_init` an app `<name>` (the default `--type` is fine). `init` creates
|
|
47
47
|
the entity + `.cloudgrid/link.json` and writes a `cloudgrid.yaml` with an EMPTY
|
|
48
48
|
`services: {}`. `plug` needs a linked directory, so run `init` FIRST.
|
|
49
49
|
|
|
@@ -73,7 +73,7 @@ in `cloudgrid.yaml` to the shape below (`services.web` + `needs: { database: tru
|
|
|
73
73
|
runtime. `requires:` is the deprecated v1 alias; don't author new yaml with it,
|
|
74
74
|
and never set `needs:` and `requires:` together (the validator rejects it).
|
|
75
75
|
2. Fetch the template for the Mongo wiring + CRUD shape:
|
|
76
|
-
`
|
|
76
|
+
`grid_fetch("template", "app-with-data")`. It is a minimal, real
|
|
77
77
|
Next.js + `mongodb`-driver to-do app under `services/web/`: a lazy client in
|
|
78
78
|
`services/web/lib/db.js`, an App-Router GET/POST/DELETE route on a `todos`
|
|
79
79
|
collection, and a page.
|
|
@@ -85,7 +85,7 @@ in `cloudgrid.yaml` to the shape below (`services.web` + `needs: { database: tru
|
|
|
85
85
|
- **Put the DB connection behind a lazy getter — never read the connection
|
|
86
86
|
string at module top level, or `next build` fails** (the module is imported
|
|
87
87
|
for route analysis before the grid injects the var).
|
|
88
|
-
- (Optional) fetch `
|
|
88
|
+
- (Optional) fetch `grid_fetch("example", "app-with-data")` for a slightly
|
|
89
89
|
richer filled reference to imitate.
|
|
90
90
|
|
|
91
91
|
## 5. (Optional) Run locally
|
|
@@ -95,17 +95,17 @@ and sanity-check before deploying. Don't require it.
|
|
|
95
95
|
|
|
96
96
|
## 6. Config
|
|
97
97
|
|
|
98
|
-
- API keys / secrets → `
|
|
99
|
-
- Non-secret config → `
|
|
98
|
+
- API keys / secrets → `grid_secrets`.
|
|
99
|
+
- Non-secret config → `grid_env`.
|
|
100
100
|
- Do **NOT** set the DB/cache connection vars yourself (`DATABASE_MONGODB_URL`,
|
|
101
101
|
`CACHE_REDIS_URL`, or their legacy `MONGODB_URL` / `REDIS_URL` aliases) — the
|
|
102
102
|
grid injects them.
|
|
103
103
|
|
|
104
104
|
## 7. Deploy (async)
|
|
105
105
|
|
|
106
|
-
Deploy the folder with `
|
|
106
|
+
Deploy the folder with `grid_plug`. A **runtime deploy is ASYNC**: the first
|
|
107
107
|
response is `status: "building"` with a `poll_url` / entity, NOT a live URL yet.
|
|
108
|
-
- Poll `
|
|
108
|
+
- Poll `grid_status` (or the returned poll_url) until the entity is live.
|
|
109
109
|
- Surface a liveness signal while it builds — keep the user informed, never a
|
|
110
110
|
bare silent wait.
|
|
111
111
|
- Only once it is live, return the deployed URL (the app URL, NOT the build/log
|
|
@@ -34,7 +34,7 @@ A booking app is a built + deployed container. It requires the **local edition**
|
|
|
34
34
|
|
|
35
35
|
## 2. Auth + grid
|
|
36
36
|
|
|
37
|
-
1. Ensure signed in: `
|
|
37
|
+
1. Ensure signed in: `grid_login_status`; if not, `grid_login`.
|
|
38
38
|
2. A grid is required. Respect the grid picker: if the user has more than one
|
|
39
39
|
grid, ask which to use; do not assume a target.
|
|
40
40
|
|
|
@@ -43,18 +43,18 @@ A booking app is a built + deployed container. It requires the **local edition**
|
|
|
43
43
|
Fetch the template and read its structure guide — this is the core of the
|
|
44
44
|
workflow:
|
|
45
45
|
|
|
46
|
-
- `
|
|
46
|
+
- `grid_fetch("template", "appointment-booking")` — the `cloudgrid.yaml` +
|
|
47
47
|
**`AGENTS.md`**. AGENTS.md has the file tree, the Mongo collections
|
|
48
48
|
(`providers`, `services`, `availability`, `appointments`), the slot-computation
|
|
49
49
|
and anti-double-booking rules, the CloudGrid injection table, and the auth +
|
|
50
50
|
Stripe wiring. **Read it fully before building.**
|
|
51
|
-
- `
|
|
51
|
+
- `grid_fetch("template", "app-with-data")` — the proven Next.js + Mongo
|
|
52
52
|
shape this blueprint extends (lazy db client in `lib/db.js`, App-Router
|
|
53
53
|
GET/POST route). Imitate its wiring.
|
|
54
54
|
|
|
55
55
|
## 4. Scaffold
|
|
56
56
|
|
|
57
|
-
`
|
|
57
|
+
`grid_init` an app `<name>`. `init` creates the entity + `.cloudgrid/link.json`
|
|
58
58
|
and writes a `cloudgrid.yaml` with an EMPTY `services: {}`. `plug` needs a linked
|
|
59
59
|
directory, so run `init` FIRST. Then write the app under **`services/web/`** and
|
|
60
60
|
set `cloudgrid.yaml` to the active shape below.
|
|
@@ -101,12 +101,12 @@ never set `needs:` and `requires:` together (the validator rejects it).
|
|
|
101
101
|
|
|
102
102
|
## 6. Config / secrets
|
|
103
103
|
|
|
104
|
-
- Auth + Stripe secrets → `
|
|
104
|
+
- Auth + Stripe secrets → `grid_secrets` (set the vault items `auth-provider-key`,
|
|
105
105
|
and if taking deposits `stripe-live-key`, `stripe-webhook-secret`, that the
|
|
106
106
|
`vault:` block maps from). The deployer injects each as its env var at runtime
|
|
107
107
|
and under `grid dev`.
|
|
108
108
|
- Non-secret config (auth publishable key `NEXT_PUBLIC_...`, Stripe price ids) →
|
|
109
|
-
`
|
|
109
|
+
`grid_env` / `services.web.env`.
|
|
110
110
|
- Do **NOT** set the DB connection vars yourself (`DATABASE_MONGODB_URL` / legacy
|
|
111
111
|
`MONGODB_URL`) — the grid injects them.
|
|
112
112
|
|
|
@@ -127,9 +127,9 @@ claim reminders are live.
|
|
|
127
127
|
|
|
128
128
|
## 9. Deploy (async)
|
|
129
129
|
|
|
130
|
-
Deploy the folder with `
|
|
130
|
+
Deploy the folder with `grid_plug`. A **runtime deploy is ASYNC**: the first
|
|
131
131
|
response is `status: "building"`, NOT a live URL yet.
|
|
132
|
-
- Poll `
|
|
132
|
+
- Poll `grid_status` (or the returned poll_url) until the entity is live.
|
|
133
133
|
- Surface a liveness signal while it builds — never a bare silent wait.
|
|
134
134
|
- If taking deposits, once live register the `/api/webhook` URL as the Stripe
|
|
135
135
|
webhook endpoint, copy the signing secret into the `stripe-webhook-secret`
|
|
@@ -37,25 +37,25 @@ A persistent approval app is a built + deployed container. It requires the
|
|
|
37
37
|
|
|
38
38
|
## 2. Auth + grid
|
|
39
39
|
|
|
40
|
-
1. Ensure signed in: `
|
|
40
|
+
1. Ensure signed in: `grid_login_status`; if not, `grid_login`.
|
|
41
41
|
2. A grid is required. Respect the grid picker: if the user has more than one
|
|
42
42
|
grid, ask which to use; do not assume a target.
|
|
43
43
|
|
|
44
44
|
## 3. Read the blueprint
|
|
45
45
|
|
|
46
46
|
Fetch the blueprint and read it before building:
|
|
47
|
-
`
|
|
47
|
+
`grid_fetch("template", "approval-workflow")`. Its **`AGENTS.md`** is the
|
|
48
48
|
structure guide — the file tree (under `services/web/`), the Mongo collections
|
|
49
49
|
(`users`, `requests`, `steps`, `audit`), the **state machine** (how a request
|
|
50
50
|
advances / is decided across its ordered steps), how CloudGrid injects the DB
|
|
51
51
|
and secrets, how to wire auth roles (and optional payments), and the deploy
|
|
52
52
|
steps. Also fetch the concrete CRUD shape to adapt from:
|
|
53
|
-
`
|
|
53
|
+
`grid_fetch("template", "app-with-data")` (lazy `lib/db.js`, App Router
|
|
54
54
|
route, server page).
|
|
55
55
|
|
|
56
56
|
## 4. Scaffold
|
|
57
57
|
|
|
58
|
-
`
|
|
58
|
+
`grid_init` an app `<name>`. `init` creates the entity + `.cloudgrid/link.json`
|
|
59
59
|
and writes a `cloudgrid.yaml` with an EMPTY `services: {}`. `plug` needs a linked
|
|
60
60
|
directory, so run `init` FIRST. Then (a) write the app under **`services/web/`**
|
|
61
61
|
following `AGENTS.md`, and (b) fill `cloudgrid.yaml` to the shape below.
|
|
@@ -110,9 +110,9 @@ before deploying. Don't require it.
|
|
|
110
110
|
|
|
111
111
|
## 8. Deploy (async)
|
|
112
112
|
|
|
113
|
-
Deploy the folder with `
|
|
113
|
+
Deploy the folder with `grid_plug`. A **runtime deploy is ASYNC**: the first
|
|
114
114
|
response is `status: "building"`, NOT a live URL yet.
|
|
115
|
-
- Poll `
|
|
115
|
+
- Poll `grid_status` (or the returned poll_url) until the entity is live.
|
|
116
116
|
- Surface a liveness signal while it builds — never a bare silent wait.
|
|
117
117
|
- Only once it is live, return the deployed app URL (NOT the build/log link).
|
|
118
118
|
|