@bettercms-ai/mcp 0.66.4 → 0.66.6

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
@@ -2692,7 +2692,9 @@ var NEW_TOOL_TEXT = {
2692
2692
  editor_setup: "Make the live build editable. A build imports only SEO/meta, media, brand and the models bcms-content.json declares; this derives the rest from the live release: pages, collections, forms, bindings, button and section components (when the authoring preference is components), Component Groups and the Content sidebar. Run it after an import or a rebuild, before the conversion brief. Idempotent: `ready` when it already ran for the live sha, else it starts (`running`; poll with `check: true` or get_deploy_status `editorSetup`). `state`: never or stale (run it), running, ready, failed. 409 = nothing is live yet: deploy first. Then get_next_steps.",
2693
2693
  transform_image: "Edit an existing Media Library image with an instruction (e.g. 'remove the background', 'make it dusk'); the result is saved as a NEW asset and the original is kept (5 AI credits). Returns the new asset (id, url, altText)."
2694
2694
  };
2695
+ var DELETE_PAGE_RUNTIME_BUNDLE = " Or, with no pageId, `runtimeBundle`: 'report' lists the duplicate pages derived from a server app's own bundle (`app/` folders); 'apply' retires them and their empty folders.";
2695
2696
  var PARAM_TEXT = {
2697
+ runtimeBundle: "instead of pageId: the server-app bundle cleanup",
2696
2698
  editorSetupForce: "re-run a setup already ready for the live build",
2697
2699
  editorSetupCheck: "true = only report the state; starts nothing",
2698
2700
  pageDynamic: "a dynamic (collection template) page only",
@@ -2894,7 +2896,7 @@ var fieldType = z.enum([
2894
2896
  "sections"
2895
2897
  ]);
2896
2898
  var slug = z.string().regex(/^[a-z0-9-]+$/, "lowercase letters, numbers, and hyphens only");
2897
- var fieldKey = z.string().regex(/^[a-zA-Z0-9_]+$/, "letters, numbers, and underscores only");
2899
+ var fieldKey = z.string().regex(/^[a-zA-Z0-9_-]+$/, "letters, numbers, underscores, and hyphens only");
2898
2900
  var uiObject = z.strictObject({
2899
2901
  collapsed: z.boolean().optional().describe("start this panel collapsed. Use it for long optional sections."),
2900
2902
  preview: z.strictObject({
@@ -2935,7 +2937,7 @@ var propUiObject = uiObject.extend({
2935
2937
  });
2936
2938
  var fieldShape = {
2937
2939
  key: fieldKey.describe(
2938
- "machine field key. \u{1F534} UNIQUE ACROSS THE WHOLE MODEL \u2014 API IDs share ONE FLAT NAMESPACE, so a field nested inside a group must NOT reuse a key used by another field or group. Every section's heading cannot be 'title'. Prefix with the section: 'hero_title', 'pricing_title', 'faq_title'. Reusing a key is refused, and if it slips through it leaves permanent errors in the editor and breaks conditional-visibility rules, which reference fields by bare key."
2940
+ "machine field key. \u{1F534} UNIQUE ACROSS THE WHOLE MODEL \u2014 API IDs share ONE FLAT NAMESPACE, so a field nested inside a group must NOT reuse a key used by another field or group. Every section's heading cannot be 'title'. Prefix with the section: 'hero_title', 'pricing_title', 'faq_title'. Reusing a key is refused, and if it slips through it leaves permanent errors in the editor and breaks conditional-visibility rules, which reference fields by bare key. Keys derived from an imported site may contain hyphens ('hero-h1-welcome'): address them exactly as returned."
2939
2941
  ),
2940
2942
  label: z.string().min(1).describe("human label shown in the editor"),
2941
2943
  type: fieldType.describe(`field type. ${BUTTON_FIELD_NOTE}`),
@@ -3468,7 +3470,8 @@ function buildToolDefs(deps) {
3468
3470
  translationOf: z.string().nullable().optional().describe(PARAM_TEXT.translationOf)
3469
3471
  });
3470
3472
  const deletePageInput = z.object({
3471
- pageId: z.string().min(1).describe("id of the page to delete (from list_pages)")
3473
+ pageId: z.string().min(1).optional().describe("id of the page to delete (from list_pages)"),
3474
+ runtimeBundle: z.enum(["report", "apply"]).optional().describe(PARAM_TEXT.runtimeBundle)
3472
3475
  });
3473
3476
  const deleteEntryInput = z.object({
3474
3477
  entryId: z.string().min(1).describe("id of the content entry to delete (from list_content_entries)")
@@ -4711,9 +4714,11 @@ ${res.warnings.join("\n")}` : summary, res.data);
4711
4714
  "get_next_steps",
4712
4715
  "Get what to do next",
4713
4716
  NEXT_STEPS_DESCRIPTION,
4714
- z.object({}).shape,
4717
+ z.object({
4718
+ importJunk: z.boolean().optional().describe("true = add rule import-junk: what an old import left, with removal calls")
4719
+ }).shape,
4715
4720
  // The whole body: `receipt` rides beside `data`, and `data()` would drop it.
4716
- async (c) => ok("Next steps.", await c.fetchJSON(c.url(`/management/insights/next-steps`), { method: "GET" }))
4721
+ async (c, a) => ok("Next steps.", await c.fetchJSON(c.url(`/management/insights/next-steps${a.importJunk === true ? "?importJunk=true" : ""}`), { method: "GET" }))
4717
4722
  ),
4718
4723
  def(
4719
4724
  "get_binding_report",
@@ -4989,7 +4994,7 @@ ${res.warnings.join("\n")}` : summary, res.data);
4989
4994
  def(
4990
4995
  "get_deploy_status",
4991
4996
  "Get deploy/build status",
4992
- "Get the connected project's deploy/build status: state (idle|queued|building|failed), whether it's publishing, the live commit sha, when it went live, and any build error. `editorSetup`: whether editing is set up for the live build (never or stale = call editor_setup). Poll this after deploy_project until state is idle with your sha live. `release` is the newest release (id, sha, status, phaseMarks, error, createdAt): while an uploaded build ingests or releases, state is `building`, `release.sha` the new sha and `lastLiveSha` still the old one; a failed deploy shows `release.status` failed with its `error`, and `held` state (`held.by`: staff, archived or no-subdomain) means the release waits until that is cleared. Also returns `canvas.lane` (the editor's live-preview lane for this site: `bridge` / `draft-route` / `none`) and `editorUrl`, the visual editor to hand the user.",
4997
+ "Get the connected project's deploy/build status: state (idle|queued|building|failed), whether it's publishing, the live commit sha, when it went live, and any build error. `editorSetup`: whether editing is set up for the live build (never or stale = call editor_setup). Poll this after deploy_project until state is idle with your sha live. `release` is the newest release (id, sha, status, phaseMarks, error, createdAt): while an uploaded build ingests or releases, state is `building`, `release.sha` the new sha and `lastLiveSha` still the old one; a failed deploy shows `release.status` failed with its `error`, and `held` state (`held.by`: staff, archived or no-subdomain) means the release waits until that is cleared. `runtime` ({state: ok|crash-loop, restarts, oomKilled}) appears for a server app only: crash-loop means its container keeps restarting (often out of memory) though the build went live fine. Also returns `canvas.lane` (the editor's live-preview lane for this site: `bridge` / `draft-route` / `none`) and `editorUrl`, the visual editor to hand the user.",
4993
4998
  z.object({}).shape,
4994
4999
  // Flat body, no `data` envelope: `data()` read it as undefined.
4995
5000
  async (c) => ok("Deploy status.", await c.fetchJSON(c.url(`/management/projects/deploy-status`), { method: "GET" }))
@@ -5334,11 +5339,19 @@ ${notes.join("\n")}` : summary, created);
5334
5339
  name: "delete_page",
5335
5340
  config: {
5336
5341
  title: "Delete a page",
5337
- description: "DELETE a page and its content. Destructive but REVERSIBLE \u2014 it soft-deletes (can be restored from the dashboard) and is audit-logged. Use it to remove a page you created by mistake. Confirm with the user before deleting content they may want.",
5342
+ description: "DELETE a page and its content. Destructive but REVERSIBLE \u2014 it soft-deletes (can be restored from the dashboard) and is audit-logged. Use it to remove a page you created by mistake. Confirm with the user before deleting content they may want." + DELETE_PAGE_RUNTIME_BUNDLE,
5338
5343
  inputSchema: deletePageInput.shape
5339
5344
  },
5340
5345
  handler: guard(
5341
5346
  async (args) => withClient(async (client) => {
5347
+ if (!args.pageId === !args.runtimeBundle) return fail("Pass exactly one of pageId or runtimeBundle.");
5348
+ if (args.runtimeBundle) {
5349
+ const res2 = await client.fetchJSON(client.url("/management/pages/retire-runtime-bundle"), {
5350
+ method: "POST",
5351
+ body: JSON.stringify({ dryRun: args.runtimeBundle !== "apply" })
5352
+ });
5353
+ return ok(args.runtimeBundle === "apply" ? "Bundle pages retired." : "Bundle pages (dry run, nothing written).", res2.data);
5354
+ }
5342
5355
  const res = await client.deletePage(args.pageId);
5343
5356
  return ok(`Deleted page ${res.id} (soft-delete \u2014 restorable from the dashboard).`, res);
5344
5357
  })