@bettercms-ai/mcp 0.32.0 → 0.34.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 +0 -0
- package/dist/index.js +37 -16
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -2958,7 +2958,7 @@ function buildToolDefs(deps) {
|
|
|
2958
2958
|
def(
|
|
2959
2959
|
"pull_project_source",
|
|
2960
2960
|
"Pull the project's live source",
|
|
2961
|
-
"Get the connected project's CURRENT live source/build so you can edit it locally. Returns a presigned tarball download url (1h) + the live commit sha \u2014 download it, extract, edit the files, then call deploy_project. If the project is connected to a GitHub repo,
|
|
2961
|
+
"Get the connected project's CURRENT live source/build so you can edit it locally. Returns a presigned tarball download url (1h) + the live commit sha \u2014 download it, extract, edit the files, then call deploy_project. If the project is connected to a GitHub repo, `github` carries owner, repo, branch and cloneUrl \u2014 clone it and work on THAT branch, because it is the one the provisioned Action builds from; a commit on any other branch never reaches the live site.",
|
|
2962
2962
|
z.object({}).shape,
|
|
2963
2963
|
async (c) => ok("Project source.", await data(c, "GET", `/management/projects/source`))
|
|
2964
2964
|
),
|
|
@@ -4135,6 +4135,13 @@ the canvas but skips release annotation and publish-time injection, because ther
|
|
|
4135
4135
|
disk to annotate. Copy rendered on the client must carry the attributes in the HYDRATED DOM,
|
|
4136
4136
|
and only the canvas sees it \u2014 a release scan cannot.
|
|
4137
4137
|
|
|
4138
|
+
**Which recipe.** There are TWO below and they are not alternatives you pick by taste \u2014 call
|
|
4139
|
+
\`get_binding_report\` and \`get_conversion_brief\` first and let the answer choose. A brief that
|
|
4140
|
+
comes back WITH PAGES means this project was imported and deployed, so its schema and values were
|
|
4141
|
+
derived for you already \u2192 **Recipe A**. A 404 or an empty brief means the site is not in the CMS
|
|
4142
|
+
yet \u2192 **Recipe B**. \`get_next_steps\` works on every plan and names the next unfinished step
|
|
4143
|
+
either way.
|
|
4144
|
+
|
|
4138
4145
|
**If you know Sanity, this is the same shape under different names:**
|
|
4139
4146
|
|
|
4140
4147
|
defineType schema in code -> content models / page fields (create_content_model,
|
|
@@ -4152,11 +4159,12 @@ and only the canvas sees it \u2014 a release scan cannot.
|
|
|
4152
4159
|
its build, the schema and the values already exist \u2014 a page per route, a field per element, and
|
|
4153
4160
|
the original copy carried on each field as its \`defaultValue\`. Call \`get_conversion_brief\`
|
|
4154
4161
|
first: it lists those pages, their routes, every bindable path with its current and original
|
|
4155
|
-
value, and the attributes to declare. SKIP steps 3 and 4 below and bind the keys it
|
|
4156
|
-
registering the schema again builds a second one over the first.
|
|
4162
|
+
value, and the attributes to declare. SKIP Recipe B's steps 3 and 4 below and bind the keys it
|
|
4163
|
+
names \u2014 registering the schema again builds a second one over the first.
|
|
4157
4164
|
|
|
4158
|
-
**
|
|
4159
|
-
mechanical, and there is a tool that does it.
|
|
4165
|
+
**Recipe A \u2014 imported and deployed: the codemod order.** For a derived site the whole of Recipe
|
|
4166
|
+
B's step 5 is mechanical, and there is a tool that does it. Run the codemod rather than editing by
|
|
4167
|
+
hand. THE ORDER, and every step of it matters:
|
|
4160
4168
|
|
|
4161
4169
|
1. \`get_conversion_brief { complete: true }\` \u2014 the COMPLETE brief, not the capped one. It comes
|
|
4162
4170
|
back uncapped and paged (50 pages at a time): follow \`cursor\` until it stops coming back and
|
|
@@ -4176,7 +4184,11 @@ mechanical, and there is a tool that does it. THE ORDER, and every step of it ma
|
|
|
4176
4184
|
what lets the coverage meter say WHY a path is undeclared instead of only that it is; without
|
|
4177
4185
|
it every one of them reads \`not-declared\`, which looks like a broken site rather than work
|
|
4178
4186
|
with a reason. It records and releases nothing.
|
|
4179
|
-
5. Push, or \`deploy_project
|
|
4187
|
+
5. Push, or \`deploy_project\`. A PLAIN HTML repo \u2014 no \`package.json\` \u2014 deploys by PUSH ONLY:
|
|
4188
|
+
\`deploy_project\` refuses such an archive by design, so pushing is the whole lane. Either way,
|
|
4189
|
+
poll \`get_deploy_status\` until \`slot\` is \`current\` (or \`awaitingPromote\` is false) before you
|
|
4190
|
+
read the report in step 6 \u2014 a report read against the previous release is the previous
|
|
4191
|
+
release's verdict.
|
|
4180
4192
|
6. \`get_binding_report\`. Alongside \`unmatched\` it now carries \`coverage\` \u2014 \`declared\` (what the
|
|
4181
4193
|
brief listed), \`bound\` (what the build declares) and \`pending\` with the reasons. Fix what it
|
|
4182
4194
|
names and release again until \`coverage.pending\` is empty.
|
|
@@ -4185,14 +4197,15 @@ mechanical, and there is a tool that does it. THE ORDER, and every step of it ma
|
|
|
4185
4197
|
|
|
4186
4198
|
**Or let BetterCMS propose the edit.** \`get_conversion_plan\` returns an APPROVED conversion \u2014 the
|
|
4187
4199
|
exact new contents of each template file, reviewed by a human in the dashboard and already checked
|
|
4188
|
-
against this project's real field paths. When there is one, apply it instead of
|
|
4189
|
-
|
|
4190
|
-
carry on from step
|
|
4200
|
+
against this project's real field paths. When there is one, apply it instead of Recipe A's step 2
|
|
4201
|
+
(the codemod): check out its \`baseHeadOid\`, branch from there, write each file's \`content\`
|
|
4202
|
+
verbatim, and carry on from Recipe A's step 5. A 404 with \`code: "no-approved-plan"\` means nobody approved one, so the
|
|
4191
4203
|
conversion is yours to write.
|
|
4192
4204
|
|
|
4193
|
-
**
|
|
4205
|
+
**Recipe B \u2014 not in the CMS yet: the steps.**
|
|
4194
4206
|
|
|
4195
|
-
1. \`pull_project_source\` (or clone the \`github\` remote it returns
|
|
4207
|
+
1. \`pull_project_source\` (or clone the \`github\` remote it returns \u2014 \`cloneUrl\` on the \`branch\`
|
|
4208
|
+
it names, which is the branch the provisioned Action builds). Read the SOURCE. Never
|
|
4196
4209
|
reconstruct content from the deployed HTML \u2014 that is how a site ends up bound to a copy of
|
|
4197
4210
|
its own stale build.
|
|
4198
4211
|
2. Decide the architecture WITH the human (\xA710) and record it: \`set_authoring_preference\`.
|
|
@@ -4259,12 +4272,16 @@ conversion is yours to write.
|
|
|
4259
4272
|
- NEXT: wrap the page's \`BcmsBlocks\` in \`BcmsDraftBridge\` from
|
|
4260
4273
|
\`@bettercms-ai/next/draft-bridge\` and redeploy. The bridge marks its output
|
|
4261
4274
|
\`data-bcms-canvas="bridge"\`, which is what the release scan records.
|
|
4262
|
-
- ASTRO: switch the pages to \`output: 'server'\` with
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4275
|
+
- ASTRO: switch the pages to \`output: 'server'\` with \`@astrojs/node\` in
|
|
4276
|
+
\`mode: 'standalone'\` \u2014 the \`bettercms()\` integration already injects the draft routes,
|
|
4277
|
+
do not write them by hand \u2014 render pages from \`loadPage\` + \`loadComponents\`, mount
|
|
4278
|
+
\`<BcmsLive>\`, set \`BCMS_DRAFT_SECRET\` (BetterCMS hosting sets it for you), redeploy,
|
|
4279
|
+
then switch the project to "Run as a server app" on the Hosting page. Never migrate a
|
|
4280
|
+
static site to SSR without asking the human first.
|
|
4266
4281
|
Then \`get_binding_report.canvas.lane\` reads \`bridge\` or \`draft-route\` instead of \`none\`.
|
|
4267
|
-
6. Push, or \`deploy_project
|
|
4282
|
+
6. Push, or \`deploy_project\`. A PLAIN HTML repo \u2014 no \`package.json\` \u2014 deploys by PUSH ONLY:
|
|
4283
|
+
\`deploy_project\` refuses such an archive by design. Poll \`get_deploy_status\` until \`slot\` is
|
|
4284
|
+
\`current\` (or \`awaitingPromote\` is false). Then
|
|
4268
4285
|
\`get_binding_report\` \u2014 still \`text-match\`, and \`unmatched\` should be EMPTY because the
|
|
4269
4286
|
values are byte-equal to what the build renders. On a converted site read \`coverage\` too: it
|
|
4270
4287
|
counts the PINNED brief's paths, which \`unmatched\` cannot, because \`unmatched\` only ever
|
|
@@ -4277,6 +4294,10 @@ conversion is yours to write.
|
|
|
4277
4294
|
text against its entry values yourself before you call the page done. Then publish, and
|
|
4278
4295
|
fetch the live URL cache-busted (\xA712: publish and deploy are separate claims).
|
|
4279
4296
|
\`get_next_steps\` keeps reporting the gap until every one of these holds.
|
|
4297
|
+
|
|
4298
|
+
**Done means.** Whichever recipe you ran: \`get_binding_report\` reads \`mode "declared"\`,
|
|
4299
|
+
\`unmatched\` empty, \`bound\` above 0, \`coverage.pending\` empty, and \`canvas.lane\` is \`bridge\` or
|
|
4300
|
+
\`draft-route\` when the site should show structural drafts.
|
|
4280
4301
|
`;
|
|
4281
4302
|
|
|
4282
4303
|
// src/prompts.ts
|