@cloudgrid-io/mcp 0.21.17 → 0.21.19

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 (84) hide show
  1. package/README.md +2 -2
  2. package/package.json +10 -3
  3. package/src/corpus/cli-reference.md +8 -8
  4. package/src/corpus/cloudgrid-yaml.md +5 -5
  5. package/src/corpus/cookbook.md +1 -1
  6. package/src/corpus/playbook.md +1 -1
  7. package/src/corpus/skill-brain.md +1 -1
  8. package/src/corpus/skill-claim.md +2 -2
  9. package/src/corpus/skill-feedback.md +5 -5
  10. package/src/corpus/skill-plug.md +4 -4
  11. package/src/corpus/templates/_cloudgrid.yaml.reference +7 -7
  12. package/src/corpus/templates/admin-dashboard/cloudgrid.yaml +7 -7
  13. package/src/corpus/templates/ai-app/cloudgrid.yaml +7 -7
  14. package/src/corpus/templates/ai-knowledge-base/AGENTS.md +1 -1
  15. package/src/corpus/templates/ai-knowledge-base/cloudgrid.yaml +7 -7
  16. package/src/corpus/templates/analytics-dashboard/cloudgrid.yaml +7 -7
  17. package/src/corpus/templates/api-dashboard/cloudgrid.yaml +7 -7
  18. package/src/corpus/templates/api-docs/cloudgrid.yaml +7 -7
  19. package/src/corpus/templates/api-service/cloudgrid.yaml +7 -7
  20. package/src/corpus/templates/app-with-data/cloudgrid.yaml +7 -7
  21. package/src/corpus/templates/appointment-booking/cloudgrid.yaml +7 -7
  22. package/src/corpus/templates/approval-workflow/cloudgrid.yaml +7 -7
  23. package/src/corpus/templates/billing-dashboard/cloudgrid.yaml +7 -7
  24. package/src/corpus/templates/blog-cms/cloudgrid.yaml +7 -7
  25. package/src/corpus/templates/booking-system/cloudgrid.yaml +7 -7
  26. package/src/corpus/templates/calendar-scheduler/AGENTS.md +1 -1
  27. package/src/corpus/templates/calendar-scheduler/cloudgrid.yaml +7 -7
  28. package/src/corpus/templates/changelog/cloudgrid.yaml +7 -7
  29. package/src/corpus/templates/company-website/cloudgrid.yaml +7 -7
  30. package/src/corpus/templates/course-platform/cloudgrid.yaml +7 -7
  31. package/src/corpus/templates/crm/cloudgrid.yaml +7 -7
  32. package/src/corpus/templates/dashboard/cloudgrid.yaml +7 -7
  33. package/src/corpus/templates/deck/cloudgrid.yaml +7 -7
  34. package/src/corpus/templates/directory/cloudgrid.yaml +7 -7
  35. package/src/corpus/templates/docs-site/cloudgrid.yaml +7 -7
  36. package/src/corpus/templates/erp/cloudgrid.yaml +7 -7
  37. package/src/corpus/templates/event-board/cloudgrid.yaml +7 -7
  38. package/src/corpus/templates/expense-tracker/cloudgrid.yaml +7 -7
  39. package/src/corpus/templates/feature-request-board/cloudgrid.yaml +7 -7
  40. package/src/corpus/templates/financial-dashboard/cloudgrid.yaml +7 -7
  41. package/src/corpus/templates/forum/cloudgrid.yaml +7 -7
  42. package/src/corpus/templates/hr-portal/cloudgrid.yaml +7 -7
  43. package/src/corpus/templates/internal-tools-portal/cloudgrid.yaml +7 -7
  44. package/src/corpus/templates/inventory/cloudgrid.yaml +7 -7
  45. package/src/corpus/templates/invoice/cloudgrid.yaml +7 -7
  46. package/src/corpus/templates/job-board/cloudgrid.yaml +7 -7
  47. package/src/corpus/templates/kanban/cloudgrid.yaml +7 -7
  48. package/src/corpus/templates/landing-page/cloudgrid.yaml +7 -7
  49. package/src/corpus/templates/lms/cloudgrid.yaml +7 -7
  50. package/src/corpus/templates/marketplace/AGENTS.md +1 -1
  51. package/src/corpus/templates/marketplace/cloudgrid.yaml +7 -7
  52. package/src/corpus/templates/membership-site/cloudgrid.yaml +7 -7
  53. package/src/corpus/templates/monitoring-dashboard/cloudgrid.yaml +7 -7
  54. package/src/corpus/templates/multi-service/cloudgrid.yaml +7 -7
  55. package/src/corpus/templates/online-store/cloudgrid.yaml +7 -7
  56. package/src/corpus/templates/portfolio/cloudgrid.yaml +7 -7
  57. package/src/corpus/templates/product-catalog/cloudgrid.yaml +7 -7
  58. package/src/corpus/templates/product-launch/cloudgrid.yaml +7 -7
  59. package/src/corpus/templates/project-management/cloudgrid.yaml +7 -7
  60. package/src/corpus/templates/property-listings/cloudgrid.yaml +7 -7
  61. package/src/corpus/templates/quiz-platform/cloudgrid.yaml +7 -7
  62. package/src/corpus/templates/report/cloudgrid.yaml +7 -7
  63. package/src/corpus/templates/restaurant-reservations/cloudgrid.yaml +7 -7
  64. package/src/corpus/templates/revenue-dashboard/cloudgrid.yaml +7 -7
  65. package/src/corpus/templates/saas-marketing/cloudgrid.yaml +7 -7
  66. package/src/corpus/templates/semantic-search/cloudgrid.yaml +7 -7
  67. package/src/corpus/templates/semantic-search/services/backend/requirements.txt +2 -2
  68. package/src/corpus/templates/semantic-search/services/refresh/requirements.txt +2 -2
  69. package/src/corpus/templates/semantic-search/services/web/package-lock.json +3 -3
  70. package/src/corpus/templates/simple-semantic-search/cloudgrid.yaml +7 -7
  71. package/src/corpus/templates/status-page/cloudgrid.yaml +7 -7
  72. package/src/corpus/templates/subscription-management/cloudgrid.yaml +7 -7
  73. package/src/corpus/templates/task-manager/cloudgrid.yaml +7 -7
  74. package/src/corpus/templates/ticket-system/cloudgrid.yaml +7 -7
  75. package/src/corpus/templates/time-tracking/cloudgrid.yaml +7 -7
  76. package/src/corpus/templates/travel-booking/cloudgrid.yaml +7 -7
  77. package/src/corpus/templates/waitlist/cloudgrid.yaml +7 -7
  78. package/src/corpus/templates/web-app/cloudgrid.yaml +7 -7
  79. package/src/corpus/workflows/forum.md +1 -1
  80. package/src/corpus/workflows/simple-semantic-search.md +1 -1
  81. package/src/tools/constants.js +4 -1
  82. package/src/tools/deploy.js +37 -10
  83. package/src/tools/register.js +49 -58
  84. package/src/widgets/grid-login.html +14 -14
@@ -70,21 +70,19 @@ const escapeHtml = (s) =>
70
70
  s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
71
71
  .replace(/"/g, "&quot;").replace(/'/g, "&#39;");
72
72
 
73
+ // Publishing requires sign-in (#395): every entity must be owned by a real
74
+ // account so the publisher is known. There is NO guest option — offering a path
75
+ // the server will not honour strands the model (it asks, the user picks guest,
76
+ // the next call fails). This is the same reasoning grid_hello applies at
77
+ // register.js's signed-out branch after mcp#336: say ONLY what the tool can
78
+ // actually do, and route to the one recovery action (grid_login). §23 voice:
79
+ // plain, no emoji, no exclamation; the model-directed step is quarantined in the
80
+ // trailing (assistant: …) line so it is not read aloud.
73
81
  const AUTH_ASK_SIGNED_OUT =
74
- "How would you like to plug this?\n" +
75
- " - Sign in to your grid — it stays in your CloudGrid account.\n" +
76
- " - As a guest — live now at a link that expires in 7 days unless you claim it.\n\n" +
77
- "(assistant: offer both options and let the user choose — do not choose for them. " +
78
- "To sign in, call grid_login; as a guest, re-call grid_plug with anon: true. " +
79
- "Stop and wait for their answer.)";
80
- const authAskSignedIn = (who) =>
81
- `You are signed in${who}.\n\n` +
82
- "How would you like to plug this?\n" +
83
- " - To your grid — it stays in your CloudGrid account.\n" +
84
- " - As a guest — live now at a link that expires in 7 days unless you claim it.\n\n" +
85
- "(assistant: offer both options and let the user choose — do not choose for them. " +
86
- "For their grid, re-call grid_plug; as a guest, re-call grid_plug with anon: true. " +
87
- "Stop and wait for their answer.)";
82
+ "Plugging to a grid needs an account, so the page is saved to the user's CloudGrid " +
83
+ "account and belongs to them. Call grid_login to sign in, then re-call grid_plug.\n\n" +
84
+ "(assistant: call grid_login now; after they finish, retry grid_plug. Do not offer " +
85
+ "any sign-in-free path. Stop and wait for the sign-in to complete.)";
88
86
 
89
87
  // ── Registration ───────────────────────────────────────────────────────────────
90
88
  // Registers the tools onto `server`. ctx.edition decides whether the CLI-wrapping
@@ -593,53 +591,46 @@ export function registerTools(server, ctx) {
593
591
  }
594
592
  if (!isEdit) {
595
593
  const token = await ctx.getToken();
596
- if (input?.anon === true && ctx.state?.authChoiceOffered !== true) {
594
+ // CREATE requires sign-in (#395). Every published entity must be owned
595
+ // by a known account so "who published this?" is answerable. `anon:
596
+ // true` no longer selects a guest wire — an unauthenticated create is
597
+ // refused and publishes nothing. The guest/anon path is GONE for
598
+ // create; it survives only for editing pre-cutover drops (the
599
+ // owner-token wire, which is an EDIT and never reaches here).
600
+ if (!token) {
597
601
  if (ctx.state) ctx.state.authChoiceOffered = true;
598
- if (token) {
599
- const claims = decodeJwtAuth(token);
600
- const who = claims.email ? ` as ${claims.email}` : "";
601
- return okResult({
602
- text: authAskSignedIn(who),
603
- structured: { needs_auth: true },
604
- });
605
- }
606
602
  return okResult({
607
603
  text: AUTH_ASK_SIGNED_OUT,
608
604
  structured: { needs_auth: true },
609
605
  });
610
606
  }
611
- if (!token && input?.anon !== true) {
612
- if (ctx.state) ctx.state.authChoiceOffered = true;
613
- return okResult({
614
- text: AUTH_ASK_SIGNED_OUT,
615
- structured: { needs_auth: true },
616
- });
607
+ // Signed in — never ride the anon wire on a create. Drop a stale
608
+ // `anon: true` so it cannot re-select the guest wire inside runPlug
609
+ // (runPlug keys the wire on `anon === true` for creates).
610
+ if (input?.anon) input = { ...(input || {}), anon: false };
611
+ const decision = await resolveGridOrAsk(ctx, {
612
+ token,
613
+ suppliedGrid: input?.grid,
614
+ edition: ctx.edition,
615
+ });
616
+ if (decision.picker) {
617
+ // Do NOT silently default to the active grid — surface the ask.
618
+ return okResult(decision.picker);
617
619
  }
618
- if (token && input?.anon !== true) {
619
- const decision = await resolveGridOrAsk(ctx, {
620
- token,
621
- suppliedGrid: input?.grid,
622
- edition: ctx.edition,
623
- });
624
- if (decision.picker) {
625
- // Do NOT silently default to the active grid — surface the ask.
626
- return okResult(decision.picker);
627
- }
628
- if (decision.single) {
629
- // Proceed into the single grid; warn (don't block) if not set up yet.
630
- input = { ...(input || {}), grid: decision.single.slug };
631
- if (decision.single.render_ready === false) {
632
- const res = await runPlug(ctx, input || {});
633
- return okResult({
634
- ...res,
635
- text:
636
- `Warning: your only grid "${decision.single.slug}" isn't fully set up yet — the page may not load until provisioning completes.\n` +
637
- res.text,
638
- });
639
- }
640
- } else if (decision.grid) {
641
- input = { ...(input || {}), grid: decision.grid };
620
+ if (decision.single) {
621
+ // Proceed into the single grid; warn (don't block) if not set up yet.
622
+ input = { ...(input || {}), grid: decision.single.slug };
623
+ if (decision.single.render_ready === false) {
624
+ const res = await runPlug(ctx, input || {});
625
+ return okResult({
626
+ ...res,
627
+ text:
628
+ `Warning: your only grid "${decision.single.slug}" isn't fully set up yet — the page may not load until provisioning completes.\n` +
629
+ res.text,
630
+ });
642
631
  }
632
+ } else if (decision.grid) {
633
+ input = { ...(input || {}), grid: decision.grid };
643
634
  }
644
635
  }
645
636
  const res = await runPlug(ctx, input || {});
@@ -890,7 +881,7 @@ export function registerTools(server, ctx) {
890
881
  "grid_list_grids",
891
882
  {
892
883
  title: "List your grids",
893
- description: "List the signed-in user's grids, each with slug, name, role, and provisioning status. A grid that is still provisioning (render_ready false) may not serve pages yet — prefer a ready grid, and if the user insists on a not-ready one, warn them that pages may not load. Requires sign-in.",
884
+ description: "List the signed-in user's grids, each with slug, name, role, and provisioning status. Requires sign-in. To plug onto a brand-new grid, call grid_plug right away: it waits for the grid to be ready itself, so do not poll render_ready or wait before plugging.",
894
885
  inputSchema: {},
895
886
  outputSchema: {
896
887
  orgs: z.array(z.object({
@@ -936,10 +927,10 @@ export function registerTools(server, ctx) {
936
927
  const suffix = tags.length ? ` (${tags.join(", ")})` : "";
937
928
  return `${o.slug} — ${o.name} (${o.role})${suffix}`;
938
929
  });
939
- const readyCount = annotated.filter((o) => o.render_ready).length;
940
- if (readyCount === 0 && annotated.length > 0) {
941
- lines.push("\nNone of your grids are fully set up yet. Wait until provisioning completes (grid_start will show render_ready: true) before plugging. Do not switch to anonymous unless the user asks for it.");
942
- }
930
+ // No "none of your grids are set up yet, wait" line here (cloudgrid#2428).
931
+ // The platform reports render_ready true for every grid, so that branch
932
+ // never ran, and its advice (poll, then plug) is what playbook rule 3b
933
+ // tells the model NOT to do: grid_plug waits for a new grid itself.
943
934
  // Structured output stays `orgs` (its declared schema); user text says grid.
944
935
  return okResult({ text: lines.join("\n"), structured: { orgs: annotated } });
945
936
  },