webcake-storefront-mcp 2.0.0 → 2.2.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.
@@ -1,4 +1,18 @@
1
1
  [
2
+ {
3
+ "v": "2.2.0",
4
+ "d": "19/11/2026",
5
+ "type": "Added",
6
+ "en": "get_element now returns a keys field with one line per specials/config key the published renderer reads — meaning, type, allowed/seen values, and…",
7
+ "vi": "get_element nay trả về thêm trường keys — một dòng cho mỗi key specials/config mà renderer của trang đã publish đọc tới, gồm ý nghĩa, kiểu dữ liệu,…"
8
+ },
9
+ {
10
+ "v": "2.1.0",
11
+ "d": "19/11/2026",
12
+ "type": "Added",
13
+ "en": "New get_page_custom_code and update_page_custom_code tools (family site_code) read and write custom code for ONE page — code_custom_css,…",
14
+ "vi": "Hai tool mới get_page_custom_code và update_page_custom_code (nhóm site_code) đọc và ghi custom code cho MỘT trang — code_custom_css,…"
15
+ },
2
16
  {
3
17
  "v": "2.0.0",
4
18
  "d": "19/11/2026",
@@ -26,19 +40,5 @@
26
40
  "type": "Added",
27
41
  "en": "The stdio server now reopens the browser Connect page automatically when the session token expires or the backend rejects it with a 401, then…",
28
42
  "vi": "Server stdio nay tự mở lại trang Connect trên trình duyệt khi token phiên hết hạn hoặc bị backend từ chối với lỗi 401, rồi tự chạy lại lệnh gọi tool…"
29
- },
30
- {
31
- "v": "1.39.0",
32
- "d": "13/11/2026",
33
- "type": "Added",
34
- "en": "New preview_page tool screenshots the saved (unpublished) draft at desktop and mobile widths through the editor's own preview host, so a page can be…",
35
- "vi": "Tool mới preview_page chụp ảnh bản nháp đã lưu (chưa publish) ở cả độ rộng máy tính và điện thoại qua host xem trước của chính editor, nhờ đó có thể…"
36
- },
37
- {
38
- "v": "1.38.0",
39
- "d": "05/11/2026",
40
- "type": "Changed",
41
- "en": "The install command no longer asks any questions: it opens the prod browser connect page and configures every AI app it detects on the machine…",
42
- "vi": "Lệnh install nay không còn hỏi gì: mở thẳng trang kết nối prod trên trình duyệt và ghi cấu hình vào mọi ứng dụng AI phát hiện được trên máy (Claude…"
43
43
  }
44
44
  ]
@@ -1,5 +1,8 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { elementSchema, suggestType, valueRules } from "../builder/element-schema.js";
2
+ import { checkSiteCode, codeGuard } from "../builder/native-first.js";
3
+ import { PAGE_CODE_ARG, writePageCode } from "./page-code.js";
4
+ import { PAGE_CODE_BUDGET, codeTargets, lintPageCode, mergePageCode } from "../builder/page-code.js";
5
+ import { elementSchema, suggestType, keyReference } from "../builder/element-schema.js";
3
6
  import { z } from "zod";
4
7
  import { BUILD_GUIDE } from "../builder/guide.js";
5
8
  import { PAGE_SCHEMA } from "../builder/page-schema.js";
@@ -174,7 +177,7 @@ export function registerBuilderTools(server, api, handle) {
174
177
  server.tool("get_build_guide", "Get the BuilderX page authoring guide: page shape, the grid layout model, styling, breakpoints, forms/data, and the build workflow. Read this before building or heavily editing a page.", {}, () => handle(async () => ({ guide: BUILD_GUIDE })));
175
178
  server.tool("get_page_schema", "Get the authoritative JSON Schema (Draft 2020-12) for a page source `{ sections: [...] }` — the structural contract for every node (id/type/specials/runtime{style,config}/children/events/bindings) in the CSS-grid model. Use it as the shape to emit; validate_page enforces the semantic rules.", {}, () => handle(async () => PAGE_SCHEMA));
176
179
  server.tool("list_elements", "List all BuilderX element/component types you can place on a page, grouped by category with a one-line summary and whether each is a container.", {}, () => handle(async () => listElements()));
177
- server.tool("get_element", "Get the full detail of an element type: category, container flag, summary, an ATTRIBUTES reference (the meaningful specials/config keys + their purpose, events, and dataset binding targets), VALUE_RULES (per key: allowed values `one of …` that validate_page enforces, values `seen` on real pages, and non-string value types), PARENTS when it must sit inside a given container, and a live skeleton node (the authoritative default shape) you can copy and edit. Read this before authoring/editing an element so you set the right keys.", {
180
+ server.tool("get_element", "Get the full detail of an element type: category, container flag, summary, KEYS — one line per specials/config key the published renderer reads (`key: meaning · type · one of a|b (enforced) / e.g. a|b · default x`; style config of one part folded as `part{Color,FontSize=14,…}`), no_effect = keys no render code reads (don't set them), ATTRIBUTES (events, dataset binding targets, notes), PARENTS when it must sit inside a given container, and a live skeleton node (the authoritative default shape) you can copy and edit. Read this before authoring/editing an element so you set the right keys.", {
178
181
  type: z.string().describe("Element type, e.g. 'text', 'button', 'grid-product'"),
179
182
  }, ({ type }) => handle(async () => {
180
183
  const el = getElement(type);
@@ -183,7 +186,9 @@ export function registerBuilderTools(server, api, handle) {
183
186
  return guess ? { ...el, did_you_mean: guess } : el;
184
187
  }
185
188
  const parents = elementSchema(type)?.parents;
186
- return { ...el, ...(parents ? { parents } : {}), value_rules: valueRules(type) };
189
+ // attributes.specials/config/more_* are folded into `keys` (one line per key).
190
+ const { specials: _s, more_specials: _ms, config: _c, more_config: _mc, ...attributes } = el.attributes || {};
191
+ return { ...el, attributes, ...(parents ? { parents } : {}), keys: keyReference(type) };
187
192
  }));
188
193
  server.tool("list_events", "List every interaction EVENT you can attach to a node: the triggers (eventName: click/hover/success/submit/…) and the actions (open_page, scroll_to, toggle, open_popup, add_to_cart, buy_now, phone_call, open_link, …) with the exact extra fields each action needs. Attach via new_element/new_section opts.events (ids are auto-minted, e.g. opts.events=[{ action:'add_to_cart', open_page:'cart' }]).", {}, () => handle(async () => describeEventsCatalog()));
189
194
  server.tool("list_bindings", "List every dynamic-data BINDING target: the datasets (product, cart_item, order, order_item, post, category, customer, customer_address, …) and their exact field names ('product::product_price', …), which page type each needs (store/member/blog), and how repeater children (grid-product, cart-items, post-list) bind per-item. Attach via new_element opts.bindings (ids auto-minted, e.g. opts.bindings=[{ target:'product::product_price' }]).", {}, () => handle(async () => describeBindingsCatalog()));
@@ -244,10 +249,18 @@ ONE page per site for type main (homepage) / error / maintain, and slugs are uni
244
249
  })
245
250
  .optional()
246
251
  .describe("SEO for this page → settings.seo. Without it the page publishes with an EMPTY title/description. For a store page a good default title is '{{name_product}} | {{name_site}}' (product) or '{{name_category}} | {{name_site}}' (category)."),
252
+ custom_code: PAGE_CODE_ARG,
253
+ native_gap: z.string().min(30).optional().describe("Only if custom_code is refused and no native way exists: the need, what you checked, what it lacks."),
247
254
  dry_run: z.boolean().default(true).describe("Preview+validate only (true) or create+save (false)"),
248
- }, ({ name, slug, source, type, is_homepage, seo, dry_run }) => handle(async () => {
255
+ }, ({ name, slug, source, type, is_homepage, seo, custom_code, native_gap, dry_run }) => handle(async () => {
249
256
  const parsed = parseSource(source);
250
257
  const validation = validatePage(parsed);
258
+ // Per-page code is judged against THIS source before anything is created.
259
+ const pageCode = custom_code ? Object.fromEntries(Object.entries(custom_code).filter(([, v]) => v !== undefined)) : undefined;
260
+ const codeCheck = pageCode ? lintPageCode(mergePageCode({}, pageCode).after, codeTargets(parsed).ids) : undefined;
261
+ const codeBlock = pageCode ? codeGuard(checkSiteCode({}, mergePageCode({}, pageCode).after, { label: "Page", budget: PAGE_CODE_BUDGET }), native_gap) : null;
262
+ if (codeCheck?.errors.length)
263
+ validation.valid = false;
251
264
  // Resolve numeric page type + the site data-source flag a special page needs.
252
265
  const kind = type || (is_homepage ? "main" : undefined);
253
266
  const typeNum = kind ? PAGE_TYPE_NUM[kind] : undefined;
@@ -263,6 +276,7 @@ ONE page per site for type main (homepage) / error / maintain, and slugs are uni
263
276
  dry_run: true,
264
277
  ...(conflict ? { blocked: true, conflict } : {}),
265
278
  validation,
279
+ ...(pageCode ? { custom_code: { errors: codeCheck.errors, warnings: codeCheck.warnings, ...(codeBlock ? { blocked: codeBlock } : {}) } } : {}),
266
280
  request: { name, slug: cleanSlug ?? null, type: kind ?? null, page_type_num: typeNum ?? null, is_homepage, sections: (parsed && parsed.sections || []).length },
267
281
  will_enable_feature: requiredFlag ?? null,
268
282
  renders_at_breakpoints: ["bp1", "bp2", "bp3", "bp4"],
@@ -277,8 +291,10 @@ ONE page per site for type main (homepage) / error / maintain, and slugs are uni
277
291
  return { error: conflict.error, existing_page: conflict.existing_page };
278
292
  }
279
293
  if (!validation.valid) {
280
- return { error: "Validation failed — not saving.", validation };
294
+ return { error: "Validation failed — not saving.", validation, ...(codeCheck?.errors.length ? { custom_code_errors: codeCheck.errors } : {}) };
281
295
  }
296
+ if (codeBlock)
297
+ return codeBlock;
282
298
  // A special page is useless if its site data-source flag is off (bindings
283
299
  // return null). Enable it BEFORE creating the page so the page works on first load.
284
300
  let feature = null;
@@ -300,6 +316,9 @@ ONE page per site for type main (homepage) / error / maintain, and slugs are uni
300
316
  }
301
317
  // slug / homepage / SEO are not applied at create — set them via update_page.
302
318
  const metaWarning = await applyPageMeta(api, pageId, { slug: cleanSlug, is_homepage, seo }).then(() => undefined, (e) => `Page saved, but slug/homepage/SEO failed: ${e?.message ?? e}`);
319
+ const codeSaved = pageCode
320
+ ? await writePageCode(api, pageId, pageCode, { native_gap, dry_run: false }).catch((e) => ({ error: `Page saved, but its custom code failed: ${e?.message ?? e}` }))
321
+ : undefined;
303
322
  return {
304
323
  success: true,
305
324
  page_id: pageId,
@@ -308,6 +327,7 @@ ONE page per site for type main (homepage) / error / maintain, and slugs are uni
308
327
  page_type: kind ?? null,
309
328
  ...(feature ? { data_source: { flag: feature.flag, newly_enabled: feature.changed } } : {}),
310
329
  stats: validation.stats,
330
+ ...(codeSaved ? { custom_code: codeSaved } : {}),
311
331
  ...(metaWarning ? { warning: metaWarning } : {}),
312
332
  };
313
333
  }));
@@ -30,8 +30,8 @@ export const FAMILIES = {
30
30
  global_section: ["Global header/footer/custom sections shown on every page", [
31
31
  "list_global_sections", "get_global_section", "create_global_section", "delete_global_section", "search_global_section_elements", "get_global_section_element",
32
32
  ]],
33
- site_code: ["Site-wide custom script/CSS (native first: refused when an element can do it)", [
34
- "get_site_custom_code", "update_site_custom_code", "append_site_custom_code",
33
+ site_code: ["Custom code, site-wide or for ONE page (native first: refused when an element can do it)", [
34
+ "get_site_custom_code", "update_site_custom_code", "append_site_custom_code", "get_page_custom_code", "update_page_custom_code",
35
35
  ]],
36
36
  theme: ["Site themes and templates", ["list_themes", "semantic_search_themes", "list_template_themes", "create_site_from_template"]],
37
37
  product: ["Products of the store", ["list_products", "get_product", "create_product", "update_product", "delete_product", "set_product_published"]],
@@ -0,0 +1,114 @@
1
+ // get_page_custom_code / update_page_custom_code: custom code for ONE page (page.settings.custom_code).
2
+ // writePageCode is the single writer — update_page_source.custom_code and build_page go through it.
3
+ import { z } from "zod";
4
+ import { checkSiteCode, codeGuard } from "../builder/native-first.js";
5
+ import { PAGE_CODE_BUDGET, PAGE_CODE_FIELDS, PAGE_CODE_GUIDE, codeTargets, lintPageCode, mergePageCode, readPageCode, } from "../builder/page-code.js";
6
+ import { getConfirmMode } from "./context.js";
7
+ const parse = (v) => {
8
+ if (typeof v !== "string")
9
+ return v;
10
+ try {
11
+ return JSON.parse(v);
12
+ }
13
+ catch {
14
+ return null;
15
+ }
16
+ };
17
+ /** The page (fresh from the backend), its settings object and parsed source. */
18
+ async function loadPage(api, pageId) {
19
+ const res = await api.listPages();
20
+ const list = res?.data || res?.pages || res;
21
+ const page = (Array.isArray(list) ? list : []).find((p) => p.id === pageId);
22
+ if (!page)
23
+ throw new Error(`Page "${pageId}" not found on this site (list_pages).`);
24
+ const settings = parse(page.settings);
25
+ const source = parse(page.source?.source) || { sections: [] };
26
+ return { page, settings: settings && typeof settings === "object" ? settings : {}, source };
27
+ }
28
+ const sizes = (c) => Object.fromEntries(PAGE_CODE_FIELDS.map((f) => [f, (c[f] || "").length]));
29
+ const usage = (c) => {
30
+ const script = ["code_before_head", "code_before_body", "code_custom_javascript"].reduce((n, f) => n + (c[f] || "").length, 0);
31
+ const css = (c.code_custom_css || "").length;
32
+ return { script: { used: script, budget: PAGE_CODE_BUDGET.script.soft }, css: { used: css, budget: PAGE_CODE_BUDGET.css.soft } };
33
+ };
34
+ /** Validate and save a page's custom code. Returns the result object a tool hands back. */
35
+ export async function writePageCode(api, pageId, input, opts = {}) {
36
+ const { settings, source } = await loadPage(api, pageId);
37
+ const before = readPageCode(settings);
38
+ const { after, notes } = mergePageCode(before, input, opts.mode ?? "replace");
39
+ const { ids } = codeTargets(source);
40
+ const lint = lintPageCode(after, ids);
41
+ if (lint.errors.length)
42
+ return { error: "BLOCKED: the code has errors — not saved.", errors: lint.errors, ...(lint.warnings.length ? { warnings: lint.warnings } : {}) };
43
+ const blocked = codeGuard(checkSiteCode(before, after, { label: "Page", budget: PAGE_CODE_BUDGET }), opts.native_gap);
44
+ if (blocked)
45
+ return blocked;
46
+ if (!opts.allow_shrink)
47
+ for (const f of PAGE_CODE_FIELDS) {
48
+ const was = (before[f] || "").length;
49
+ const now = (after[f] || "").length;
50
+ if (was > 200 && now < was * 0.5)
51
+ return {
52
+ error: `BLOCKED: ${f} would shrink from ${was} to ${now} chars — that looks like lost code. Read it with get_page_custom_code and merge (or mode:"append"); pass allow_shrink:true if the removal is deliberate.`,
53
+ };
54
+ }
55
+ const changed = PAGE_CODE_FIELDS.filter((f) => (before[f] || "") !== (after[f] || ""));
56
+ const report = {
57
+ page_id: pageId,
58
+ changed,
59
+ before: sizes(before),
60
+ after: sizes(after),
61
+ usage: usage(after),
62
+ ...(notes.length ? { notes } : {}),
63
+ ...(lint.warnings.length ? { warnings: lint.warnings } : {}),
64
+ };
65
+ if (!changed.length)
66
+ return { ...report, saved: false, note: "Nothing changed." };
67
+ if (opts.dry_run)
68
+ return { ...report, dry_run: true, would_save: after, next: "Show the user the code; on their OK call again with dry_run:false." };
69
+ // Top-level settings keys replace: the whole custom_code object goes in, every other key stays.
70
+ const next = { ...settings, custom_code: after };
71
+ if (!Object.keys(after).length)
72
+ delete next.custom_code;
73
+ await api.updatePage(pageId, { settings: next });
74
+ return { ...report, saved: true, next: "Check it with preview_page, then publish_site to take it live (settings are copied on publish)." };
75
+ }
76
+ const codeArgs = {
77
+ code_custom_css: z.string().optional().describe("CSS for this page (no <style> needed). Target #ELEMENT-ID or .custom_class. \"\" clears."),
78
+ code_custom_javascript: z.string().optional().describe("Plain JS for this page, NO <script> tag; runs at the end of <body>. \"\" clears."),
79
+ code_before_head: z.string().optional().describe("HTML for <head> on this page only (<script src>, <link>, <meta>). \"\" clears."),
80
+ code_before_body: z.string().optional().describe("HTML after this page's content, before its scripts (noscript pixel, widget mount point). \"\" clears."),
81
+ };
82
+ export const PAGE_CODE_ARG = z.object(codeArgs).optional()
83
+ .describe("Per-page custom code saved with the page (same slots as update_page_custom_code). Last resort — native first.");
84
+ export function registerPageCodeTools(server, api, handle) {
85
+ server.tool("get_page_custom_code", "Read the custom code of ONE page (CSS / JS / head / body slots in page.settings.custom_code), its budget usage, the element ids and custom classes the code can target on that page, and the rules for per-page code. Read this before update_page_custom_code.", { page_id: z.string().describe("Page ID (list_pages)") }, ({ page_id }) => handle(async () => {
86
+ const { page, settings, source } = await loadPage(api, page_id);
87
+ const code = readPageCode(settings);
88
+ const t = codeTargets(source);
89
+ return {
90
+ page: { id: page.id, name: page.name, slug: page.slug ?? null },
91
+ custom_code: code,
92
+ usage: usage(code),
93
+ targets: t.targets,
94
+ ...(t.truncated ? { targets_note: `${t.total} elements; first ${t.targets.length} listed — search_page_elements for the rest.` } : {}),
95
+ guide: PAGE_CODE_GUIDE,
96
+ };
97
+ }));
98
+ server.tool("update_page_custom_code", `Save custom code for ONE page — only when the element schema can't do what the user asked (NATIVE FIRST: element → its settings/events/bindings → an app → code). Slots: code_custom_css, code_custom_javascript (plain JS, own <script>), code_before_head, code_before_body; rendered on that page only, after the site's code. mode "replace" (default) sets the slots you pass, "append" adds to them; "" clears a slot. JS syntax and CSS braces are checked before saving, #ids not on the page are flagged, oversized or UI-building code is refused unless native_gap names the gap, and a large shrink needs allow_shrink. Read get_page_custom_code first; dry_run shows what would be saved.`, {
99
+ page_id: z.string().describe("Page ID (list_pages)"),
100
+ ...codeArgs,
101
+ mode: z.enum(["replace", "append"]).optional().describe("replace (default): set the given slots; append: add after the current code"),
102
+ native_gap: z.string().min(30).optional().describe("Only when refused and no native way exists: the need, the elements/apps you checked, what each lacks. Tell the user first."),
103
+ allow_shrink: z.boolean().optional().describe("Allow a slot to lose more than half its code (deliberate removal)"),
104
+ dry_run: z.boolean().optional().describe("Validate and show what would be saved, without saving (default: on in confirm mode)"),
105
+ }, ({ page_id, mode, native_gap, allow_shrink, dry_run, ...code }) => handle(async () => {
106
+ const input = Object.fromEntries(Object.entries(code).filter(([, v]) => v !== undefined));
107
+ if (!Object.keys(input).length)
108
+ throw new Error("Pass at least one slot: code_custom_css, code_custom_javascript, code_before_head or code_before_body.");
109
+ return writePageCode(api, page_id, input, {
110
+ mode, native_gap, allow_shrink,
111
+ dry_run: dry_run !== undefined ? dry_run : getConfirmMode() === "always_confirm",
112
+ });
113
+ }));
114
+ }
@@ -1,4 +1,6 @@
1
1
  import { z } from "zod";
2
+ import { writePageCode } from "./page-code.js";
3
+ import { readPageCode } from "../builder/page-code.js";
2
4
  import { CUSTOM_CODE_GUIDE } from "../guides.js";
3
5
  import { getConfirmMode } from "./context.js";
4
6
  import { addedErrors, applyNodeUpdates, computeNodeDiff, checkContentPlaceholders, checkElementPatch, finalizeForRender } from "../builder/page.js";
@@ -237,7 +239,8 @@ export function registerPageTools(server, api, handle) {
237
239
  const overview = source ? buildOverview(source) : null;
238
240
  return {
239
241
  page: { id: page.id, name: page.name, slug: page.slug, type: page.type },
240
- custom_code: (page.source && page.source.custom_code) || null,
242
+ custom_code: readPageCode(page.settings),
243
+ ...(page.source?.custom_code ? { legacy_devmode_code: "page_source.custom_code is set but the storefront never renders it — move it with update_page_custom_code." } : {}),
241
244
  overview,
242
245
  hint: "Use search_page_elements to query specific elements by type, class, text, etc. Target via CSS: #ELEMENT-ID or .custom-class. Sections have class 'x-section', elements have 'x-element'.",
243
246
  };
@@ -625,7 +628,7 @@ IMPORTANT: Before calling this tool, you MUST:
625
628
  Safeguarded: blocks if new source is <50% of existing size.`, {
626
629
  page_id: z.string().describe("Page ID"),
627
630
  source: z.any().describe("Full page source object (sections tree) or JSON string"),
628
- custom_code: z.string().optional().describe("Custom code (CSS/JS) for this page. Last resort, same rules as update_site_custom_code."),
631
+ custom_code: z.string().optional().describe("JS for this page only → page.settings.custom_code.code_custom_javascript (same as update_page_custom_code; use that tool for CSS/head/body slots). Last resort."),
629
632
  native_gap: NATIVE_GAP,
630
633
  allow_shrink: ALLOW_SHRINK,
631
634
  }, ({ page_id, source, custom_code, native_gap, allow_shrink }) => handle(async () => {
@@ -637,14 +640,16 @@ Safeguarded: blocks if new source is <50% of existing size.`, {
637
640
  // per-breakpoint keys like every other writer; nodes already in bp shape are untouched.
638
641
  finalizeForRender(body.source, await api.getSiteBreakpoints(), await api.getSiteDefaultGrid());
639
642
  }
643
+ // page_source.custom_code is stored but never rendered; per-page code lives in
644
+ // page.settings.custom_code (update_page_custom_code). This param writes there.
645
+ let pageCode;
640
646
  if (custom_code != null) {
647
+ pageCode = await writePageCode(api, page_id, { code_custom_javascript: custom_code }, { native_gap, dry_run: false });
641
648
  invalidatePageCache();
642
- const { page } = await getPageWithSource(api, page_id);
643
- const old = page?.source?.custom_code;
644
- const blocked = codeGuard(checkSiteCode({ code_custom_javascript: typeof old === "string" ? old : JSON.stringify(old ?? "") }, { code_custom_javascript: custom_code }), native_gap);
645
- if (blocked)
646
- return blocked;
647
- body.custom_code = custom_code;
649
+ if (pageCode.error)
650
+ return pageCode;
651
+ if (body.source == null)
652
+ return { success: true, custom_code: pageCode };
648
653
  }
649
654
  // Safeguard: force fresh read and block if new source is suspiciously smaller
650
655
  if (body.source) {
@@ -676,6 +681,7 @@ Safeguarded: blocks if new source is <50% of existing size.`, {
676
681
  page_source_id: saved.id,
677
682
  page_id: saved.page_id,
678
683
  source_length: (saved.source || "").length,
684
+ ...(pageCode ? { custom_code: pageCode } : {}),
679
685
  };
680
686
  }));
681
687
  }
@@ -30,6 +30,7 @@ import { registerBuilderExtraTools } from "./builder-extras.js";
30
30
  import { registerPageDraftTools } from "./page-draft.js";
31
31
  import { registerSitePlanTools } from "./site-plans.js";
32
32
  import { registerApiGatewayTools } from "./api-gateway.js";
33
+ import { registerPageCodeTools } from "./page-code.js";
33
34
  import { readFileSync } from "node:fs";
34
35
  import { FAMILIES, familyTool } from "./families.js";
35
36
  /** Tool names folded into api_get / api_call → their route (invoke_tool points callers there). */
@@ -88,6 +89,7 @@ const MODULES = [
88
89
  ["web", registerPageDraftTools],
89
90
  ["site_config", registerSitePlanTools],
90
91
  ["session", registerApiGatewayTools],
92
+ ["web", registerPageCodeTools],
91
93
  ];
92
94
  /** Every collected tool of a server, by name — members of a family included (tests, gateway). */
93
95
  const ENTRIES = new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webcake-storefront-mcp",
3
- "version": "2.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "MCP server for the WebCake/StoreCake storefront builder — page CRUD, page authoring, products, orders, and more",
5
5
  "mcpName": "io.github.vuluu2k/webcake-storefront-mcp",
6
6
  "license": "MIT",
@@ -34,7 +34,9 @@
34
34
  "gen-api": "node scripts/gen-api-catalog.mjs",
35
35
  "prepare": "npm run build",
36
36
  "prepublishOnly": "npm run build && npm run smoke",
37
- "test": "node --test \"test/*.test.mjs\""
37
+ "test": "node --test \"test/*.test.mjs\"",
38
+ "mine-renderer": "node scripts/mine-renderer.mjs",
39
+ "mine-editor": "node scripts/mine-editor.mjs"
38
40
  },
39
41
  "dependencies": {
40
42
  "@modelcontextprotocol/sdk": "^1.12.1",