@bettercms-ai/mcp 0.21.0 → 0.22.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/dist/index.js CHANGED
@@ -3951,6 +3951,47 @@ is schema-first by design (\xA71) and should stay that way. Say so and move on.
3951
3951
  Either way: ask, do not choose. The 409 carries this project's actual page counts \u2014 how many
3952
3952
  are field-driven, block-driven, and how many place a reusable component \u2014 so quote those to
3953
3953
  the user rather than describing the choice in the abstract.
3954
+
3955
+ ## 11. The canvas: what makes an imported site EDITABLE
3956
+
3957
+ A deploy makes a site LIVE. It does not make it editable \u2014 those are different states, and the
3958
+ gap between them is the single most common disappointment after an import.
3959
+
3960
+ **The canvas is the real site when it can be.** When a page's draft matches its published copy
3961
+ structurally, the visual editor frames the project's OWN deployed build and paints unpublished
3962
+ text over it. Structural drafts (new sections, unpublished pages, changed components) render on
3963
+ the platform's own renderer instead \u2014 and that renderer previews in a GENERIC theme unless the
3964
+ deploy artifact declares \`bcms-presentation.json\` at its root. Put the file in \`public/\`
3965
+ (the build lands it at the artifact root) declaring the site's presentation \u2014 container width,
3966
+ type scale, nav position and background, footer surface \u2014 as DTCG \`{"$type": ..., "$value": ...}\`
3967
+ entries. Redeclare it on every deploy; absent means "declared nothing" and previews fall back
3968
+ to platform defaults that will not look like this site.
3969
+
3970
+ **Editing binds by VALUE.** The editor matches CMS field values against the text the site
3971
+ renders. Three consequences, each load-bearing:
3972
+
3973
+ 1. Content that exists ONLY in the build can never be click-to-edit. Bring it in, per
3974
+ route, in this order (get_next_steps reports the state until it is done):
3975
+
3976
+ a. create_page one per route, slug matching the route
3977
+ b. add_page_field the fields its content needs (or create_component +
3978
+ publish_component + component blocks, per your \xA710 answer)
3979
+ c. set_page_content values EXACTLY equal to the text the site renders \u2014
3980
+ binding matches by value, so a paraphrase binds nothing
3981
+ d. update_page status 'published' \u2014 the canvas binds the PUBLISHED copy
3982
+ 2. A value that renders in more than one place stays uneditable on the canvas (deliberate:
3983
+ binding it would edit all of them at once). It remains editable in the side panel.
3984
+ 3. Keep chrome semantic \u2014 \`<nav>\`, \`<footer>\`, page content inside \`<main>\`, mastheads
3985
+ as a top-level \`<header>\`. Chrome is edited through the project Layout, not the page,
3986
+ and semantic landmarks are how the editor keeps a nav edit from being written into page
3987
+ content. Div-built chrome outside \`<main>\` is still excluded; div-built chrome with no
3988
+ \`<main>\` anywhere loses that protection.
3989
+
3990
+ **Hosting decides whether a canvas exists at all.** A site deployed here is framed through a
3991
+ same-origin proxy \u2014 that is what the canvas requires. A site hosted elsewhere (your own Vercel,
3992
+ your own server) has NO canvas today: the SDK's draft mode with \`stega: true\` embeds invisible
3993
+ per-field provenance in fetched strings, which prepares the content for editing surfaces, but do
3994
+ not promise a canvas for an externally-hosted site.
3954
3995
  `;
3955
3996
 
3956
3997
  // src/prompts.ts
@@ -4344,6 +4385,44 @@ On 401/403, the MCP key needs (re)authorizing.`
4344
4385
 
4345
4386
  ${SEO_FLOW}
4346
4387
 
4388
+ On 401/403, the MCP key needs (re)authorizing.`
4389
+ }
4390
+ }
4391
+ ]
4392
+ })
4393
+ );
4394
+ server.registerPrompt(
4395
+ "import-site",
4396
+ {
4397
+ title: "Make an imported site editable (guided)",
4398
+ description: "After deploying an existing site: bring its content into the CMS so the visual editor can bind it, declare its presentation manifest, and publish everything that renders. A deploy makes a site LIVE, not EDITABLE \u2014 this flow closes that gap.",
4399
+ argsSchema: {
4400
+ request: z2.string().optional().describe("scope, e.g. 'all routes' or 'just the home page'")
4401
+ }
4402
+ },
4403
+ ({ request }) => ({
4404
+ messages: [
4405
+ {
4406
+ role: "user",
4407
+ content: {
4408
+ type: "text",
4409
+ text: `Make my imported site editable in BetterCMS.${request ? ` Scope: "${request}".` : ""}
4410
+
4411
+ Read bettercms://playbook/schema section 11 first, then work this order:
4412
+
4413
+ 1. AUTHORING GATE \u2014 if any deploy answered 409 AUTHORING_DECISION_REQUIRED, ask ME
4414
+ components-or-fields (do not choose), then set_authoring_preference.
4415
+ 2. CONTENT INTO THE CMS, per route: create_page (slug = route) -> add_page_field (or
4416
+ create_component + publish_component + component blocks) -> set_page_content with values
4417
+ EXACTLY equal to the rendered text (binding matches by value; a paraphrase binds nothing)
4418
+ -> update_page status 'published' (the canvas binds the PUBLISHED copy).
4419
+ 3. PRESENTATION MANIFEST \u2014 add bcms-presentation.json to public/ (container width, type
4420
+ scale, nav position/background, footer surface as DTCG {"$type","$value"} entries) and
4421
+ redeploy, or structural draft previews render in a generic theme, not this site's design.
4422
+ 4. VERIFY \u2014 call get_next_steps and fix what it lists (it knows about missing manifests,
4423
+ content still only in the build, and placed-but-unpublished components), or tell me why
4424
+ an item is being left.
4425
+
4347
4426
  On 401/403, the MCP key needs (re)authorizing.`
4348
4427
  }
4349
4428
  }