@cloudgrid-io/mcp 0.11.2 → 0.13.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.
Files changed (98) hide show
  1. package/package.json +2 -1
  2. package/src/corpus/capability-map.md +40 -6
  3. package/src/corpus/examples/ai-app/index.md +237 -0
  4. package/src/corpus/examples/api-service/index.md +190 -0
  5. package/src/corpus/examples/crm/index.md +273 -0
  6. package/src/corpus/examples/kanban/index.md +256 -0
  7. package/src/corpus/templates/admin-dashboard/README.md +75 -0
  8. package/src/corpus/templates/admin-dashboard/cloudgrid.yaml +15 -0
  9. package/src/corpus/templates/admin-dashboard/index.md +78 -0
  10. package/src/corpus/templates/admin-dashboard/services/web/app/api/orders/route.js +64 -0
  11. package/src/corpus/templates/admin-dashboard/services/web/app/api/users/route.js +63 -0
  12. package/src/corpus/templates/admin-dashboard/services/web/app/layout.js +39 -0
  13. package/src/corpus/templates/admin-dashboard/services/web/app/page.js +73 -0
  14. package/src/corpus/templates/admin-dashboard/services/web/app/resource-table.js +94 -0
  15. package/src/corpus/templates/admin-dashboard/services/web/lib/db.js +32 -0
  16. package/src/corpus/templates/admin-dashboard/services/web/package.json +16 -0
  17. package/src/corpus/templates/ai-app/README.md +95 -0
  18. package/src/corpus/templates/ai-app/cloudgrid.yaml +20 -0
  19. package/src/corpus/templates/ai-app/index.md +269 -0
  20. package/src/corpus/templates/ai-app/services/web/app/api/chat/route.js +51 -0
  21. package/src/corpus/templates/ai-app/services/web/app/chat.js +60 -0
  22. package/src/corpus/templates/ai-app/services/web/app/layout.js +36 -0
  23. package/src/corpus/templates/ai-app/services/web/app/page.js +25 -0
  24. package/src/corpus/templates/ai-app/services/web/lib/db.js +32 -0
  25. package/src/corpus/templates/ai-app/services/web/package.json +17 -0
  26. package/src/corpus/templates/api-docs/README.md +28 -0
  27. package/src/corpus/templates/api-docs/cloudgrid.yaml +10 -0
  28. package/src/corpus/templates/api-docs/index.html +136 -0
  29. package/src/corpus/templates/api-docs/index.md +30 -0
  30. package/src/corpus/templates/api-service/README.md +87 -0
  31. package/src/corpus/templates/api-service/cloudgrid.yaml +18 -0
  32. package/src/corpus/templates/api-service/index.md +225 -0
  33. package/src/corpus/templates/api-service/services/api/package.json +13 -0
  34. package/src/corpus/templates/api-service/services/api/src/index.js +132 -0
  35. package/src/corpus/templates/changelog/README.md +27 -0
  36. package/src/corpus/templates/changelog/cloudgrid.yaml +10 -0
  37. package/src/corpus/templates/changelog/index.html +80 -0
  38. package/src/corpus/templates/changelog/index.md +30 -0
  39. package/src/corpus/templates/crm/README.md +72 -0
  40. package/src/corpus/templates/crm/cloudgrid.yaml +15 -0
  41. package/src/corpus/templates/crm/index.md +68 -0
  42. package/src/corpus/templates/crm/services/web/app/api/contacts/route.js +80 -0
  43. package/src/corpus/templates/crm/services/web/app/contact-manager.js +102 -0
  44. package/src/corpus/templates/crm/services/web/app/layout.js +35 -0
  45. package/src/corpus/templates/crm/services/web/app/page.js +34 -0
  46. package/src/corpus/templates/crm/services/web/lib/db.js +32 -0
  47. package/src/corpus/templates/crm/services/web/package.json +16 -0
  48. package/src/corpus/templates/docs-site/README.md +28 -0
  49. package/src/corpus/templates/docs-site/cloudgrid.yaml +10 -0
  50. package/src/corpus/templates/docs-site/index.html +122 -0
  51. package/src/corpus/templates/docs-site/index.md +30 -0
  52. package/src/corpus/templates/kanban/README.md +72 -0
  53. package/src/corpus/templates/kanban/cloudgrid.yaml +15 -0
  54. package/src/corpus/templates/kanban/index.md +68 -0
  55. package/src/corpus/templates/kanban/services/web/app/api/cards/route.js +70 -0
  56. package/src/corpus/templates/kanban/services/web/app/board.js +93 -0
  57. package/src/corpus/templates/kanban/services/web/app/layout.js +37 -0
  58. package/src/corpus/templates/kanban/services/web/app/page.js +32 -0
  59. package/src/corpus/templates/kanban/services/web/lib/db.js +32 -0
  60. package/src/corpus/templates/kanban/services/web/package.json +16 -0
  61. package/src/corpus/templates/portfolio/README.md +29 -0
  62. package/src/corpus/templates/portfolio/cloudgrid.yaml +10 -0
  63. package/src/corpus/templates/portfolio/index.html +126 -0
  64. package/src/corpus/templates/portfolio/index.md +30 -0
  65. package/src/corpus/templates/saas-marketing/README.md +30 -0
  66. package/src/corpus/templates/saas-marketing/cloudgrid.yaml +10 -0
  67. package/src/corpus/templates/saas-marketing/index.html +212 -0
  68. package/src/corpus/templates/saas-marketing/index.md +30 -0
  69. package/src/corpus/templates/status-page/README.md +28 -0
  70. package/src/corpus/templates/status-page/cloudgrid.yaml +10 -0
  71. package/src/corpus/templates/status-page/index.html +117 -0
  72. package/src/corpus/templates/status-page/index.md +30 -0
  73. package/src/corpus/templates/task-manager/README.md +72 -0
  74. package/src/corpus/templates/task-manager/cloudgrid.yaml +15 -0
  75. package/src/corpus/templates/task-manager/index.md +68 -0
  76. package/src/corpus/templates/task-manager/services/web/app/api/tasks/route.js +77 -0
  77. package/src/corpus/templates/task-manager/services/web/app/layout.js +39 -0
  78. package/src/corpus/templates/task-manager/services/web/app/page.js +33 -0
  79. package/src/corpus/templates/task-manager/services/web/app/task-list.js +110 -0
  80. package/src/corpus/templates/task-manager/services/web/lib/db.js +32 -0
  81. package/src/corpus/templates/task-manager/services/web/package.json +16 -0
  82. package/src/corpus/templates/waitlist/README.md +38 -0
  83. package/src/corpus/templates/waitlist/cloudgrid.yaml +10 -0
  84. package/src/corpus/templates/waitlist/index.html +69 -0
  85. package/src/corpus/templates/waitlist/index.md +41 -0
  86. package/src/corpus/workflows/admin-dashboard.md +102 -0
  87. package/src/corpus/workflows/ai-app.md +136 -0
  88. package/src/corpus/workflows/api-docs.md +36 -0
  89. package/src/corpus/workflows/api-service.md +118 -0
  90. package/src/corpus/workflows/changelog.md +33 -0
  91. package/src/corpus/workflows/crm.md +101 -0
  92. package/src/corpus/workflows/docs-site.md +35 -0
  93. package/src/corpus/workflows/kanban.md +102 -0
  94. package/src/corpus/workflows/portfolio.md +35 -0
  95. package/src/corpus/workflows/saas-marketing.md +37 -0
  96. package/src/corpus/workflows/status-page.md +35 -0
  97. package/src/corpus/workflows/task-manager.md +101 -0
  98. package/src/corpus/workflows/waitlist.md +42 -0
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: status-page
3
+ when: status page, service status, uptime page, incident history, is-it-down page, system status board. Display-only — status is baked into the page, no live monitoring.
4
+ needs: none
5
+ deploy: inspiration
6
+ editions: all
7
+ capabilities_note: static — no infrastructure, status baked into the page. Publishes as an inspiration (instant, works on hosted) via gridctl_drop.
8
+ summary: Fetch the status-page template, fill it with the user's components and incidents, deploy it, and return the live share URL.
9
+ ---
10
+
11
+ # Workflow: status-page
12
+
13
+ Detect the intent ("build me a status page / uptime page for X") and follow this
14
+ recipe. This is a display-only static page — the status is baked into the markup,
15
+ there is no live polling. Do not ask setup questions first; use sensible defaults
16
+ and build.
17
+
18
+ 1. **Fetch the template.** Call `gridctl_fetch("template", "status-page")` to load
19
+ the self-contained HTML status page (overall banner, component list with
20
+ up/degraded/down pills, per-component uptime bars, incident history).
21
+ 2. **Fill the template.** Replace the placeholders with the user's content:
22
+ - The overall banner text and its state class (`ok` / `degraded` / `down`).
23
+ - One row per component: name, a status pill, and the 90-day uptime bar. Mark
24
+ any non-ok bar segments with class `degraded` or `down`.
25
+ - The incident history entries: date, title, state, and a short note.
26
+ - Keep it a single self-contained HTML file. Do not add external scripts,
27
+ stylesheets, fonts, or large embedded media.
28
+ 3. **Deploy.** Deploy the filled HTML:
29
+ - Hosted MCP edition: call the drop tool with the HTML.
30
+ - Local MCP / CLI edition: write the HTML to a file and run `gridctl plug`.
31
+ It is an inspiration and deploys synchronously, so you get a URL right away.
32
+ 4. **Return the live share URL.** For revisions, re-deploy with the entity id
33
+ from the first deploy — it updates the same share URL.
34
+
35
+ Keep the whole flow tight: fetch, fill, deploy, share.
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: task-manager
3
+ when: task manager, to-do app (richer than the app-with-data starter), task list with due dates/priorities, complete-toggle + filter — a persistent task app that sticks across refresh. Needs a database → runtime → local edition.
4
+ needs: database
5
+ deploy: runtime
6
+ editions: local
7
+ capabilities_note: persistent — needs a database (Mongo). Runtime app, async build, local edition only. Declare the canonical `needs: { database: true }`; the deployer injects DATABASE_MONGODB_URL (+legacy MONGODB_URL).
8
+ summary: Build a persistent Next.js + Mongo task manager on the grid — a `tasks` collection (title, done, due, priority) with a complete-toggle, active/done filter, add/delete. Richer than the bare app-with-data to-do. Edition-gate first, scaffold, put the app under services/web/, wire process.env.DATABASE_MONGODB_URL (legacy MONGODB_URL fallback) lazily, declare needs:{database:true} (not requires:), deploy async, poll to a live URL.
9
+ ---
10
+
11
+ # Workflow: task-manager
12
+
13
+ The user wants a task manager richer than the bare `app-with-data` to-do starter
14
+ — tasks with due dates and priorities, a complete-toggle, and an active/done
15
+ filter, all of which **stick** across refresh and are shared across sessions.
16
+ That is a **runtime app** backed by the grid's shared Mongo, not a static page.
17
+ It is the same proven shape as `app-with-data`, with a `tasks` domain (title,
18
+ done, due, priority of low/medium/high). (For the bare-minimum in-memory to-do,
19
+ use `app-with-data` instead.)
20
+
21
+ Follow this recipe. Be honest that a runtime deploy is async (not instant like a
22
+ static drop) and that it needs the local edition.
23
+
24
+ ## 1. Edition check FIRST (hard gate)
25
+
26
+ A persistent app is a built + deployed container. It requires the **local
27
+ edition** (Claude Desktop / Claude Code) or the CLI.
28
+
29
+ - **Hosted edition (Claude Web / hosted MCP):** you CANNOT build a runtime app —
30
+ hosted is inline-only and can only publish static pages. Tell the user
31
+ plainly, offer a **static version** instead, and STOP the runtime path here.
32
+ - **Local edition:** continue.
33
+
34
+ ## 2. Auth + grid
35
+
36
+ 1. Ensure signed in: `gridctl_login_status`; if not, `gridctl_login`.
37
+ 2. A grid is required. Respect the grid picker: if the user has more than one
38
+ grid, ask which to use; do not assume a target.
39
+
40
+ ## 3. Scaffold
41
+
42
+ `gridctl_init` an app `<name>`. `init` creates the entity + `.cloudgrid/link.json`
43
+ and writes a `cloudgrid.yaml` with an EMPTY `services: {}`. `plug` needs a linked
44
+ directory, so run `init` FIRST. Then (a) write the app under **`services/web/`**,
45
+ and (b) fill `cloudgrid.yaml` to the shape below (`services.web` + `needs:
46
+ { database: true }`).
47
+
48
+ ## 4. Add the datastore + wire Mongo
49
+
50
+ 1. Set `cloudgrid.yaml`. **App code MUST live under `services/<name>/`** —
51
+ `path:` is the URL mount, NOT the filesystem path.
52
+ ```yaml
53
+ name: my-tasks
54
+ services:
55
+ web:
56
+ type: nextjs
57
+ path: /
58
+ needs:
59
+ database: true
60
+ ```
61
+ **Declare the datastore with `needs: { database: true }`** — the canonical
62
+ shape. The deployer provisions Mongo and injects `DATABASE_MONGODB_URL` (plus
63
+ the legacy `MONGODB_URL` alias). `requires:` is the deprecated v1 alias; don't
64
+ author new yaml with it, and never set `needs:` and `requires:` together (the
65
+ validator rejects it).
66
+ 2. Fetch the template for the Mongo wiring + CRUD shape:
67
+ `gridctl_fetch("template", "task-manager")`. It is a minimal, real Next.js +
68
+ `mongodb`-driver task manager under `services/web/`: a lazy client in
69
+ `services/web/lib/db.js`, an App-Router GET/POST/PATCH/DELETE route on a
70
+ `tasks` collection (PATCH toggles done), a server-component page, and a client
71
+ list with an active/done filter.
72
+ 3. Adapt it (rename the collection, change fields, adjust the UI). **Read the DB
73
+ from `process.env.DATABASE_MONGODB_URL`** (legacy `process.env.MONGODB_URL`
74
+ fallback) — the grid injects it at dev-time and runtime.
75
+ - **Put the DB connection behind a lazy getter — never read the connection
76
+ string at module top level, or `next build` fails.**
77
+
78
+ ## 5. (Optional) Run locally
79
+
80
+ Mention that the user can `grid dev` to run locally against the injected Mongo
81
+ before deploying. Don't require it.
82
+
83
+ ## 6. Config
84
+
85
+ - API keys / secrets → `gridctl_secrets`. Non-secret config → `gridctl_env`.
86
+ - Do **NOT** set the DB connection vars yourself (`DATABASE_MONGODB_URL` or the
87
+ legacy `MONGODB_URL`) — the grid injects them.
88
+
89
+ ## 7. Deploy (async)
90
+
91
+ Deploy the folder with `gridctl_plug`. A **runtime deploy is ASYNC**: the first
92
+ response is `status: "building"`, NOT a live URL yet.
93
+ - Poll `gridctl_status` (or the returned poll_url) until the entity is live.
94
+ - Surface a liveness signal while it builds — never a bare silent wait.
95
+ - Only once it is live, return the deployed app URL (NOT the build/log link).
96
+
97
+ ## 8. Return the live URL + iterate
98
+
99
+ Give the user the live app URL — that is the deliverable. To iterate, re-plug the
100
+ SAME entity so it updates the same URL. Keep it honest: async build, local-edition
101
+ only, credentials injected by the grid.
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: waitlist
3
+ when: waitlist, coming soon, early access, join the list, launch page, sign-up teaser with an email capture form. NOTE the form is static — to actually STORE signups you need a runtime app (needs: database), coming in the crud-app archetype.
4
+ needs: none
5
+ deploy: inspiration
6
+ editions: all
7
+ capabilities_note: static — no infrastructure. The email form posts to a configurable mailto/external endpoint; it does NOT store signups. Publishes as an inspiration (instant, works on hosted) via gridctl_drop.
8
+ summary: Fetch the waitlist template, fill it with the user's launch copy, wire the form to a mailto or external endpoint, deploy it, and return the live share URL.
9
+ ---
10
+
11
+ # Workflow: waitlist
12
+
13
+ Detect the intent ("build me a waitlist / coming-soon / early-access page") and
14
+ follow this recipe. Do not ask setup questions first; use sensible defaults and
15
+ build.
16
+
17
+ **Important — the form is static.** This template captures an email and posts it
18
+ to a configurable action: a `mailto:` (the default, which opens the visitor's
19
+ mail client) or an external form endpoint you set on the `<form action>`. It does
20
+ NOT store signups anywhere on CloudGrid. To actually **store** waitlist signups
21
+ (persist, count, export them), you need a runtime app with a database
22
+ (`needs: { database: true }`) — that is a CRUD app, coming in the crud-app
23
+ archetype (Wave 1b). Do not claim this static page persists data.
24
+
25
+ 1. **Fetch the template.** Call `gridctl_fetch("template", "waitlist")` to load
26
+ the self-contained HTML waitlist page (hero, email form, social-proof counter).
27
+ 2. **Fill the template.** Replace the placeholders with the user's content:
28
+ - The product name, coming-soon headline, and subheadline.
29
+ - The signup counter and any social-proof line.
30
+ - The form action: set `<form action>` to a `mailto:` address or an external
31
+ form endpoint. Default is `mailto:`.
32
+ - Keep it a single self-contained HTML file. Do not add external scripts,
33
+ stylesheets, fonts, or large embedded media.
34
+ 3. **Deploy.** Deploy the filled HTML:
35
+ - Hosted MCP edition: call the drop tool with the HTML.
36
+ - Local MCP / CLI edition: write the HTML to a file and run `gridctl plug`.
37
+ It is an inspiration and deploys synchronously, so you get a URL right away.
38
+ 4. **Return the live share URL.** For revisions, re-deploy with the entity id
39
+ from the first deploy — it updates the same share URL. If the user needs
40
+ signups stored, tell them that needs the runtime crud-app archetype (Wave 1b).
41
+
42
+ Keep the whole flow tight: fetch, fill, deploy, share.