@cloudgrid-io/mcp 0.16.2 → 0.18.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 +15 -9
- package/src/corpus/cloudgrid-yaml.md +10 -8
- package/src/corpus/cookbook.md +4 -4
- package/src/corpus/install-for-agents.md +1 -2
- 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-login.md +2 -2
- package/src/corpus/skill-plug.md +69 -6
- package/src/corpus/skills-readme.md +10 -10
- 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 -4
- 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 -4
- package/src/corpus/templates/company-website/README.md +3 -4
- package/src/corpus/templates/company-website/cloudgrid.yaml +1 -1
- package/src/corpus/templates/company-website/index.md +3 -4
- 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 -4
- package/src/corpus/templates/deck/cloudgrid.yaml +1 -1
- package/src/corpus/templates/deck/index.md +3 -4
- package/src/corpus/templates/docs-site/README.md +3 -3
- package/src/corpus/templates/docs-site/index.md +3 -4
- 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 -4
- 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 -4
- package/src/corpus/templates/product-launch/README.md +3 -4
- package/src/corpus/templates/product-launch/cloudgrid.yaml +1 -1
- package/src/corpus/templates/product-launch/index.md +3 -4
- package/src/corpus/templates/report/cloudgrid.yaml +1 -1
- package/src/corpus/templates/report/index.md +3 -4
- 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 -4
- package/src/corpus/templates/status-page/README.md +3 -3
- package/src/corpus/templates/status-page/index.md +3 -4
- 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 -4
- package/src/corpus/templates/web-app/cloudgrid.yaml +1 -1
- package/src/corpus/templates/web-app/index.md +3 -4
- package/src/corpus/troubleshooting/deploy-errors.md +1 -1
- package/src/corpus/troubleshooting/persistent-apps.md +1 -1
- package/src/corpus/usage.md +3 -3
- 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 +329 -734
- package/src/web.js +2 -2
- package/src/widgets/live-result.html +1 -1
- package/src/widgets/org-picker.html +3 -3
- package/src/corpus/skill-drop.md +0 -140
|
@@ -20,7 +20,7 @@ app under `services/web/` following it — the proven `app-with-data` shape with
|
|
|
20
20
|
`MONGODB_URL` fallback — the grid injects it; never hardcode, never commit.
|
|
21
21
|
3. **Third-party secrets go through the `vault:` block** (Stripe `STRIPE_KEY`,
|
|
22
22
|
email `SENDGRID_API_KEY`, optional `AUTH_PROVIDER_KEY`) → injected env vars;
|
|
23
|
-
store values with `
|
|
23
|
+
store values with `grid_secrets`.
|
|
24
24
|
4. **Declare `needs: { database: true }`** (canonical) — never mix `needs:` and
|
|
25
25
|
`requires:`.
|
|
26
26
|
5. **Cron reminder service is documented but NOT deployable yet** (platform issue
|
|
@@ -29,7 +29,7 @@ app under `services/web/` following it — the proven `app-with-data` shape with
|
|
|
29
29
|
## Fetch bundle
|
|
30
30
|
|
|
31
31
|
```
|
|
32
|
-
|
|
32
|
+
grid_fetch("template", "restaurant-reservations") # cloudgrid.yaml + AGENTS.md + README
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
Then read `AGENTS.md` (file tree, `menu`/`reservations`/`tables` collections,
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
A single self-contained HTML SaaS marketing site (hero, features, pricing tiers, testimonials, FAQ, and a closing call to action). Richer than the landing-page template.
|
|
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_plug` 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", "saas-marketing")`, then replace the
|
|
12
12
|
placeholders:
|
|
13
13
|
|
|
14
14
|
- The product name, tagline, and hero eyebrow/headline/subheadline.
|
|
@@ -24,7 +24,7 @@ stylesheets, fonts, or large embedded media.
|
|
|
24
24
|
## Deploy
|
|
25
25
|
|
|
26
26
|
- Hosted MCP edition: call the drop tool with the HTML.
|
|
27
|
-
- Local MCP / CLI edition: write the HTML to a file and run `
|
|
27
|
+
- Local MCP / CLI edition: write the HTML to a file and run `grid plug`.
|
|
28
28
|
|
|
29
29
|
It deploys as an inspiration and returns a live share URL right away. Re-deploy
|
|
30
30
|
with the same entity id to update the same URL.
|
|
@@ -5,14 +5,13 @@ 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 **`
|
|
9
|
-
HTML): it deploys as an **inspiration** — instant, and works on the **hosted**
|
|
8
|
+
To publish this page, use **`grid_plug`** with the inline `html`: it deploys as an **inspiration** — instant, and works on the **hosted**
|
|
10
9
|
edition (Claude Web) as well as local. The reference `cloudgrid.yaml` in this
|
|
11
10
|
directory (`type: static`) is ONLY for plugging the page as an OWNED static
|
|
12
|
-
runtime (async, local edition only); the fast path is `
|
|
11
|
+
runtime (async, local edition only); the fast path is `grid_plug`.
|
|
13
12
|
|
|
14
13
|
The fillable HTML is the real template — fetch it with
|
|
15
|
-
`
|
|
14
|
+
`grid_fetch("template", "saas-marketing")` and fill in the user's content.
|
|
16
15
|
|
|
17
16
|
## cloudgrid.yaml (reference only)
|
|
18
17
|
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
A single self-contained HTML service status page: an overall banner, a component list with up / degraded / down pills, per-component uptime bars, and an incident history log. Status is baked into the page.
|
|
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_plug` 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", "status-page")`, then replace the
|
|
12
12
|
placeholders:
|
|
13
13
|
|
|
14
14
|
- The overall status banner text and state class (`ok` / `degraded` / `down`).
|
|
@@ -22,7 +22,7 @@ stylesheets, fonts, or large embedded media.
|
|
|
22
22
|
## Deploy
|
|
23
23
|
|
|
24
24
|
- Hosted MCP edition: call the drop tool with the HTML.
|
|
25
|
-
- Local MCP / CLI edition: write the HTML to a file and run `
|
|
25
|
+
- Local MCP / CLI edition: write the HTML to a file and run `grid plug`.
|
|
26
26
|
|
|
27
27
|
It deploys as an inspiration and returns a live share URL right away. Re-deploy
|
|
28
28
|
with the same entity id to update the same URL.
|
|
@@ -5,14 +5,13 @@ 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 **`
|
|
9
|
-
HTML): it deploys as an **inspiration** — instant, and works on the **hosted**
|
|
8
|
+
To publish this page, use **`grid_plug`** with the inline `html`: it deploys as an **inspiration** — instant, and works on the **hosted**
|
|
10
9
|
edition (Claude Web) as well as local. The reference `cloudgrid.yaml` in this
|
|
11
10
|
directory (`type: static`) is ONLY for plugging the page as an OWNED static
|
|
12
|
-
runtime (async, local edition only); the fast path is `
|
|
11
|
+
runtime (async, local edition only); the fast path is `grid_plug`.
|
|
13
12
|
|
|
14
13
|
The fillable HTML is the real template — fetch it with
|
|
15
|
-
`
|
|
14
|
+
`grid_fetch("template", "status-page")` and fill in the user's content.
|
|
16
15
|
|
|
17
16
|
## cloudgrid.yaml (reference only)
|
|
18
17
|
|
|
@@ -18,7 +18,7 @@ The two share the same Stripe + Mongo wiring.
|
|
|
18
18
|
The proven persistent shape is `app-with-data` (Next.js + Mongo). This blueprint
|
|
19
19
|
extends it with Stripe subscriptions + the Billing Portal. Fetch that template
|
|
20
20
|
for the Mongo lazy-client and App-Router API pattern:
|
|
21
|
-
`
|
|
21
|
+
`grid_fetch("template", "app-with-data")`.
|
|
22
22
|
|
|
23
23
|
## 1. File tree
|
|
24
24
|
|
|
@@ -89,7 +89,7 @@ client for plan/status — read this (kept current by the webhook).
|
|
|
89
89
|
STRIPE_KEY: stripe-live-key
|
|
90
90
|
STRIPE_WEBHOOK_SECRET: stripe-webhook-secret
|
|
91
91
|
```
|
|
92
|
-
Set the vault items ONCE with `
|
|
92
|
+
Set the vault items ONCE with `grid_secrets` (or `grid secrets set`), then
|
|
93
93
|
the deployer injects each as the named env var (`process.env.STRIPE_KEY`, etc.)
|
|
94
94
|
at runtime and under `grid dev`. Do NOT commit keys; do NOT set them in
|
|
95
95
|
`services.web.env` (that block is for non-secret config only). Read them lazily
|
|
@@ -158,22 +158,22 @@ known user — otherwise anyone could change anyone's plan.
|
|
|
158
158
|
|
|
159
159
|
## 5. Deploy steps
|
|
160
160
|
|
|
161
|
-
1. `
|
|
161
|
+
1. `grid_login_status` → `grid_login` if needed. Respect the grid picker
|
|
162
162
|
(ask which grid if the user has more than one).
|
|
163
|
-
2. `
|
|
163
|
+
2. `grid_init` an app `<name>` FIRST — it creates the entity, writes
|
|
164
164
|
`.cloudgrid/link.json`, and a `cloudgrid.yaml` with empty `services: {}`.
|
|
165
165
|
`plug` needs a linked directory.
|
|
166
166
|
3. Write the app under `services/web/` and set `cloudgrid.yaml` to the active
|
|
167
167
|
shape: `name` + `services.web{type: nextjs, path: /}` + `needs:{database:true}`
|
|
168
168
|
+ the `vault:` block.
|
|
169
|
-
4. Set the secrets: `
|
|
169
|
+
4. Set the secrets: `grid_secrets` for `stripe-live-key`,
|
|
170
170
|
`stripe-webhook-secret` (and `auth-provider-key` if you use an auth SDK) — the
|
|
171
171
|
vault item keys the `vault:` block maps from. Non-secret config (Stripe
|
|
172
|
-
publishable key, price ids, auth publishable key) → `
|
|
172
|
+
publishable key, price ids, auth publishable key) → `grid_env` /
|
|
173
173
|
`services.web.env`. Do NOT set `DATABASE_MONGODB_URL` yourself — the grid
|
|
174
174
|
injects it.
|
|
175
|
-
5. `
|
|
176
|
-
is `status: building`, not a live URL. Poll `
|
|
175
|
+
5. `grid_plug` to deploy. A runtime deploy is **ASYNC** — the first response
|
|
176
|
+
is `status: building`, not a live URL. Poll `grid_status` (or the returned
|
|
177
177
|
poll_url) until live; surface a liveness signal while it builds, never a bare
|
|
178
178
|
silent wait.
|
|
179
179
|
6. Once live, add the `/api/webhook` URL as the Stripe webhook endpoint, copy
|
|
@@ -187,5 +187,5 @@ A subscription-management app is a built + deployed runtime container, so it
|
|
|
187
187
|
requires the **local edition** (Claude Desktop / Claude Code) or the CLI. The
|
|
188
188
|
**hosted** edition (Claude Web / hosted MCP) is inline-only and can only publish
|
|
189
189
|
static pages — it CANNOT build this app. On hosted, say so plainly and offer a
|
|
190
|
-
static pricing/plans page (via `
|
|
190
|
+
static pricing/plans page (via `grid_plug`) instead, then stop the runtime
|
|
191
191
|
path.
|
|
@@ -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_plug` 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,13 @@ 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 **`
|
|
9
|
-
HTML): it deploys as an **inspiration** — instant, and works on the **hosted**
|
|
8
|
+
To publish this page, use **`grid_plug`** with the inline `html`: it deploys as an **inspiration** — instant, and works on the **hosted**
|
|
10
9
|
edition (Claude Web) as well as local. The reference `cloudgrid.yaml` in this
|
|
11
10
|
directory (`type: static`) is ONLY for plugging the page as an OWNED static
|
|
12
|
-
runtime (async, local edition only); the fast path is `
|
|
11
|
+
runtime (async, local edition only); the fast path is `grid_plug`.
|
|
13
12
|
|
|
14
13
|
The fillable HTML is the real template — fetch it with
|
|
15
|
-
`
|
|
14
|
+
`grid_fetch("template", "waitlist")` and fill in the user's content.
|
|
16
15
|
|
|
17
16
|
## Note on storing signups
|
|
18
17
|
|
|
@@ -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_plug
|
|
20
20
|
# (instant, and works on the hosted edition too).
|
|
21
21
|
# ============================================================================
|
|
22
22
|
|
|
@@ -5,14 +5,13 @@ 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 **`
|
|
9
|
-
HTML): it deploys as an **inspiration** — instant, and works on the **hosted**
|
|
8
|
+
To publish this page, use **`grid_plug`** with the inline `html`: it deploys as an **inspiration** — instant, and works on the **hosted**
|
|
10
9
|
edition (Claude Web) as well as local. The reference `cloudgrid.yaml` in this
|
|
11
10
|
directory (`type: static`) is ONLY for plugging the page as an OWNED static
|
|
12
|
-
runtime (async, local edition only); the fast path is `
|
|
11
|
+
runtime (async, local edition only); the fast path is `grid_plug`.
|
|
13
12
|
|
|
14
13
|
The fillable HTML is the real template — fetch it with
|
|
15
|
-
`
|
|
14
|
+
`grid_fetch("template", "web-app")` and fill in the user's content.
|
|
16
15
|
|
|
17
16
|
## cloudgrid.yaml (reference only)
|
|
18
17
|
|
|
@@ -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
|
|
|
@@ -39,13 +39,13 @@ npx skills add cloudgrid-io/skills
|
|
|
39
39
|
/plugin install cloudgrid
|
|
40
40
|
```
|
|
41
41
|
- **Find it under `/plugin`**; the skills also show under `/skills` (labeled Plugin).
|
|
42
|
-
- Invoke as **`/cloudgrid:
|
|
42
|
+
- Invoke as **`/cloudgrid:plug`** (plugin namespace + short skill name, like `superpowers:brainstorming`), or describe the task.
|
|
43
43
|
|
|
44
44
|
### Route 3 — the MCP server
|
|
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_plug`, `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_plug.
|
|
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).
|