@bettercms-ai/mcp 0.81.0 → 0.82.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 +48 -3
- package/dist/index.js.map +1 -1
- package/dist/skills/bettercms/SKILL.md +5 -4
- package/dist/skills/bettercms/references/frameworks.md +2 -2
- package/dist/skills/bettercms/references/getting-started.md +23 -1
- package/dist/skills/bettercms/references/other-frameworks.md +3 -1
- package/dist/skills/bettercms/references/publishing.md +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3115,6 +3115,18 @@ var SLOT_MULTIPLE_NOTE = "'slot' with config.multiple holds a list [{componentId
|
|
|
3115
3115
|
var PROP_V2_NOTE = "Props take the fields' V2 keys (\xA714): 'object' = ONE {child: value} from config.fields, \u226410 levels (field_depth_exceeded); datetime|slug|email|phone|json|location|tags|rating|code|reference|multi-reference as that field (a reference names contentModelId, or polymorphic + allowedModelSlugs; page reads hydrate its entries); helpMore, advanced, recommendedMax, openMode, config.scale, ui.layout rows|chips|gallery, ui.preview.fallback, showIf notEmpty|empty. Send helpText: null for a prop whose /kit schema has no description (omitted, the platform writes one).";
|
|
3116
3116
|
var LAYOUT_LOCK_NOTE = "A Global field with `overridable:false` + `lockReason` (add-field `field`, update-field `patch`) refuses page overrides (LAYOUT_FIELD_NOT_OVERRIDABLE); get_layout scope page lists stored ones as `shadowed`.";
|
|
3117
3117
|
var AUTHORING_DESCRIPTION = "Record which authoring architecture this site uses: 'components' (the default: reusable section components placed as blocks, which editors add, reorder and swap; on a site whose pages were DERIVED it keeps every field, value and binding, then run the componentize lane) or 'fields' (a typed field schema per page, for a blog, catalogue or directory). A deploy, a promote and every editor_setup record 'components' when nothing is set, so call this only to change it. Never ask the user: record it, say so in your final report, and tell them they can switch it in the dashboard.";
|
|
3118
|
+
var DELIVERY_KEY_DESCRIPTION = "Create a read-only delivery key for this project's own front end and return it once (it is never shown again: write it straight into the front end's .env under the name its SDK config reads, e.g. BCMS_API_KEY or BETTERCMS_API_KEY, never into chat or a commit). Published content needs no key (the SDK reads it by BCMS_PROJECT_ID), so create one only when the front end's config asks for a key. `scope: \"published\"` = content:read, no expiry; `scope: \"draft\"` also reads drafts and expires within the hour (a preview build's credential; editors' previews use the dashboard's preview link instead). Listed and revocable in Project \u2192 Settings \u2192 API keys like any other key. Requires artifact:write.";
|
|
3119
|
+
var DELIVERY_KEY_PARAMS = {
|
|
3120
|
+
name: "what it is for, shown in the key list (e.g. 'Front end (Vercel)')",
|
|
3121
|
+
scope: "published (content:read, the default) or draft (also drafts; expires within the hour)"
|
|
3122
|
+
};
|
|
3123
|
+
var FRONT_END_DESCRIPTION = 'Record where this project\'s own front end lives, so editors open drafts on it ("Preview on site") and a publish reaches it: `siteUrl` (its deployed origin), `framework` (next or astro: which preview route the SDK mounts), `draftPath` (Next only, when not /api/draft) and `revalidation` (a front end that revalidates instead of rebuilding). Call it after the front end is deployed; `npx @bettercms-ai/cli@latest deploy --to <host>` already registers the rebuild hook. Read the current values from get_project. Fields you omit are left as they are; null clears one. Requires artifact:write.';
|
|
3124
|
+
var FRONT_END_PARAMS = {
|
|
3125
|
+
siteUrl: "the deployed front end's origin, https://\u2026 (null clears it)",
|
|
3126
|
+
framework: "next or astro",
|
|
3127
|
+
draftPath: "Next only: the draft-mode route when not /api/draft (null clears it)",
|
|
3128
|
+
revalidation: "a front end that revalidates instead of rebuilding: { webhookUrl (https), webhookSecret (16+ chars, also stored as BETTERCMS_WEBHOOK_SECRET on the front end) } (null clears it)"
|
|
3129
|
+
};
|
|
3118
3130
|
var MEDIA_DEFAULT_NOTE = "Leave the default (the CDN) unless the owner asked otherwise; never ask.";
|
|
3119
3131
|
var REBUILD_DESCRIPTION = "Rebuild from the connected repository, as the dashboard's Rebuild does. Use it when a get_next_steps fix names it, or after a push that started no build; then get_deploy_status { waitSeconds: 50 } until live, and editor_setup. 409 NOT_QUEUED: no repository (deploy_project the working tree) or publishing held.";
|
|
3120
3132
|
var withWait = (path, waitSeconds) => typeof waitSeconds === "number" && waitSeconds > 0 ? `${path}?wait=${Math.min(Math.round(waitSeconds), 50)}` : path;
|
|
@@ -3694,7 +3706,7 @@ var GIT_TEXT = {
|
|
|
3694
3706
|
var HOSTING_TEXT = {
|
|
3695
3707
|
list_env_vars: "The project's environment variables by NAME and scope (never a value), and `missing`: the ones the repository's .env.example declares that the project does not set. A site missing them builds and serves, then renders empty or crashes in the browser. Resolve `missing` by running `npx @bettercms-ai/cli@latest env push` in the repository: it uploads those values from the user's own .env files straight to BetterCMS, so they never pass through this conversation. Never read, print or ask the user to paste a value. When the values do not exist locally because the site reads its content from another CMS, move that content into BetterCMS instead (the bettercms skill's external-content reference). BetterCMS's own BCMS_* identifiers are supplied to every build and never need setting.",
|
|
3696
3708
|
list_hosting_connections: "The Vercel, Netlify and Cloudflare accounts connected to this workspace (id, provider, accountLabel, status; never a token), plus `connectUrl`, the dashboard page where a person connects one. Call it before deploy_to_host. If the provider the user wants has no connection with status `ok`, give the user `connectUrl` to connect it in their browser and stop until they have: you never handle OAuth or a host token yourself.",
|
|
3697
|
-
deploy_to_host: "Deploy this project to the user's own Vercel or Netlify account through their connection. BetterCMS builds the site and the host serves that build (skill publishing). The first call creates the site on the host and makes it the project's host; a later call for the same provider redeploys that site (`redeployed: true`). `connectionId` (from list_hosting_connections) defaults to the newest working one, `siteName` to the project's handle. A refusal carries a `code` and a `fixUrl` (not_connected, reconnect, pick_existing_site, grant_required, ADMIN_REQUIRED): each is fixed by the user at `fixUrl`, so relay it and stop. `deploymentQueued: false` means the project has no live build yet: deploy_project first, and that release reaches the host on its own. Never run the Vercel or Netlify CLI while a connection exists. Then poll get_host_deploy_status. Needs artifact:write, like deploy_project.",
|
|
3709
|
+
deploy_to_host: "Deploy this project to the user's own Vercel or Netlify account through their connection. BetterCMS builds the site and the host serves that build (skill publishing). The first call creates the site on the host and makes it the project's host; a later call for the same provider redeploys that site (`redeployed: true`). `connectionId` (from list_hosting_connections) defaults to the newest working one, `siteName` to the project's handle. A refusal carries a `code` and a `fixUrl` (not_connected, reconnect, pick_existing_site, grant_required, ADMIN_REQUIRED): each is fixed by the user at `fixUrl`, so relay it and stop. `deploymentQueued: false` means the project has no live build yet: deploy_project first, and that release reaches the host on its own. Never run the Vercel or Netlify CLI while a connection exists. A headless project is not deployed here: its own front end deploys with `npx @bettercms-ai/cli@latest deploy --to <host>`. Then poll get_host_deploy_status. Needs artifact:write, like deploy_project.",
|
|
3698
3710
|
get_host_deploy_status: "The connected project's recent deployments to Vercel, Netlify or Cloudflare, newest first: state (queued|deploying|live|failed), providerUrl, error, sha and targetName. Poll it after deploy_to_host until the newest one is `live`, whose `providerUrl` is the live URL to hand the user, or `failed`, whose `error` you read back to them."
|
|
3699
3711
|
};
|
|
3700
3712
|
async function builtinCopyId(client, builtinId) {
|
|
@@ -4279,7 +4291,7 @@ function buildToolDefs(deps) {
|
|
|
4279
4291
|
propUi: z.record(z.string(), z.record(z.string(), z.unknown()).nullable()).optional().describe(PROP_UI_ARG_NOTE),
|
|
4280
4292
|
propGroup: z.record(z.string(), z.record(z.string(), z.unknown()).nullable()).optional().describe("prop key \u2192 its ui.group ({id, label?, kind?, icon?, collapsed?}), null takes it out"),
|
|
4281
4293
|
propTab: z.record(z.string(), z.record(z.string(), z.unknown()).nullable()).optional().describe("prop key \u2192 its ui.tab ({id, label?, icon?, order?}), the V2 schema group it sits in. The FIRST top-level prop in a tab defines {id, label, icon?, order?}, later ones send {id}; \u22648 tabs; one group's members share one tab. null takes it out"),
|
|
4282
|
-
propLabel: z.record(z.string(), z.string().min(1).max(255)).optional().describe("prop key \u2192 label"),
|
|
4294
|
+
propLabel: z.record(z.string(), z.string().min(1).max(255)).optional().describe("prop key \u2192 label: one or two words of meaning (playbook \xA72, Naming)"),
|
|
4283
4295
|
propHelpText: z.record(z.string(), z.string().max(200).nullable()).optional().describe("prop key \u2192 help text; null = no help on purpose (stays empty, never refilled)"),
|
|
4284
4296
|
override: z.boolean().optional().describe(OVERRIDE_NOTE),
|
|
4285
4297
|
ifMatch: z.number().int().min(0).optional().describe(COMPONENT_IF_MATCH_NOTE),
|
|
@@ -4798,6 +4810,25 @@ ${d.outline}` : "Proposed Content structure.", d);
|
|
|
4798
4810
|
z.object({ preference: z.enum(AUTHORING_CHOICES).describe("components or fields") }).shape,
|
|
4799
4811
|
async (c, a) => ok("Recorded the authoring architecture.", await data(c, "PATCH", `/management/projects/current/authoring-preference`, { preference: a.preference }))
|
|
4800
4812
|
),
|
|
4813
|
+
def(
|
|
4814
|
+
"create_delivery_key",
|
|
4815
|
+
"Create a read-only delivery key for the front end",
|
|
4816
|
+
DELIVERY_KEY_DESCRIPTION,
|
|
4817
|
+
z.object({ name: z.string().min(1).describe(DELIVERY_KEY_PARAMS.name), scope: z.enum(["published", "draft"]).optional().describe(DELIVERY_KEY_PARAMS.scope) }).shape,
|
|
4818
|
+
async (c, a) => ok("Created the delivery key. It is shown once: write it into the front end's .env now.", await data(c, "POST", `/management/projects/current/delivery-keys`, a))
|
|
4819
|
+
),
|
|
4820
|
+
def(
|
|
4821
|
+
"set_front_end",
|
|
4822
|
+
"Record where the project's own front end lives",
|
|
4823
|
+
FRONT_END_DESCRIPTION,
|
|
4824
|
+
z.object({
|
|
4825
|
+
siteUrl: z.string().nullable().optional().describe(FRONT_END_PARAMS.siteUrl),
|
|
4826
|
+
framework: z.enum(["next", "astro"]).optional().describe(FRONT_END_PARAMS.framework),
|
|
4827
|
+
draftPath: z.string().nullable().optional().describe(FRONT_END_PARAMS.draftPath),
|
|
4828
|
+
revalidation: z.object({ webhookUrl: z.string(), webhookSecret: z.string() }).nullable().optional().describe(FRONT_END_PARAMS.revalidation)
|
|
4829
|
+
}).shape,
|
|
4830
|
+
async (c, a) => ok("Recorded the front end.", await data(c, "PATCH", `/management/projects/current/front-end`, a))
|
|
4831
|
+
),
|
|
4801
4832
|
def(
|
|
4802
4833
|
"set_binding_mode",
|
|
4803
4834
|
"Set how the site's bindings are resolved",
|
|
@@ -4859,7 +4890,7 @@ ${d.outline}` : "Proposed Content structure.", d);
|
|
|
4859
4890
|
fieldUi: z.record(z.string(), z.record(z.string(), z.unknown()).nullable()).optional().describe(FIELD_UI_ARG_NOTE),
|
|
4860
4891
|
fieldFieldset: z.record(z.string(), z.string().min(1).nullable()).optional().describe("path \u2192 fieldset id, null takes it out"),
|
|
4861
4892
|
fieldOrder: z.strictObject({ parentPath: z.string().min(1).optional(), order: z.array(z.string().min(1)).min(1).max(200) }).optional().describe("the full new order of one parent's child keys (top level without parentPath). An array with both zones needs 'KEY.zones.nonRepeatable' or 'KEY.zones.repeatable'; its bare key is a 400"),
|
|
4862
|
-
fieldLabel: z.record(z.string(), z.string().min(1).max(255)).optional().describe("path \u2192 label"),
|
|
4893
|
+
fieldLabel: z.record(z.string(), z.string().min(1).max(255)).optional().describe("path \u2192 label: one or two words of meaning (playbook \xA72, Naming)"),
|
|
4863
4894
|
fieldHelpText: z.record(z.string(), z.string().max(500).nullable()).optional().describe("path \u2192 help text, null clears it"),
|
|
4864
4895
|
override: z.boolean().optional().describe(OVERRIDE_NOTE),
|
|
4865
4896
|
ifMatch: z.number().int().min(0).optional().describe(MODEL_IF_MATCH_NOTE),
|
|
@@ -7362,6 +7393,20 @@ from the builtin blueprints \`list_components\` returns (\`builtin:*\`) instead
|
|
|
7362
7393
|
JSON. On an IMPORTED site, never materialize a builtin: read the repo's own components first
|
|
7363
7394
|
(\`src/components\`, its sections folder) and make ONE CMS component per source component, named
|
|
7364
7395
|
as the source names it \u2014 the site's Pricing section is "Pricing", not "Section 2" or "Simple".
|
|
7396
|
+
|
|
7397
|
+
**Naming: one or two words of MEANING, BEM-shaped, in Portable Text's words.** You choose every
|
|
7398
|
+
name, from what the page holds. The BLOCK is the section: what it IS (Hero, Pricing, FAQ), else
|
|
7399
|
+
the meaning words of its own heading ("We've spent years learning three timbers" \u2192 "Three
|
|
7400
|
+
Timbers", "Get in touch" \u2192 "Get In Touch"). A LIST is named by its own title, the heading or
|
|
7401
|
+
caption over it ("Our services" \u2192 "Services"), else by what its rows are (Plans, Questions,
|
|
7402
|
+
Steps, Links), never by its first row's copy. A list with its own title is a block inside the
|
|
7403
|
+
block: "About \u203A Services", its columns bare roles read under it (Title, Description). A field is
|
|
7404
|
+
its block plus its ELEMENT, said the way Portable Text titles its types (heading, paragraph,
|
|
7405
|
+
quote, list item, link, image, button) with a modifier only to tell two apart ("Hero headline",
|
|
7406
|
+
"Footer link 2 URL"). Never body copy, never a sentence. Rename anything to say its meaning better
|
|
7407
|
+
\u2014 \`propLabel\`, \`fieldLabel\`, or \`data-bcms-section-label\` / \`data-bcms-label\` in the source \u2014
|
|
7408
|
+
within the bound; a name you give is yours and is never re-derived.
|
|
7409
|
+
|
|
7365
7410
|
On a DERIVED site run \`get_componentize_plan\` \u2192 \`componentize_sections\` FIRST \u2014 it does most
|
|
7366
7411
|
of this in one call, and once \`components\` is recorded each \`editor_setup\` of a derived site
|
|
7367
7412
|
runs it in bind mode and publishes the components, so expect ALREADY_COMPONENTIZED \u2014 the placements it wrote are
|