webcake-landing-mcp 1.13.3 → 1.13.5

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": "1.13.5",
4
+ "d": "20/11/2026",
5
+ "type": "Fixed",
6
+ "en": "update_page/patch_page no longer block on a click event the Webcake editor itself saved with action:null (an event added via the editor's EventTrait…",
7
+ "vi": "update_page/patch_page không còn bị chặn bởi một event click mà chính editor Webcake đã lưu với action:null (một event được thêm qua picker…"
8
+ },
9
+ {
10
+ "v": "1.13.4",
11
+ "d": "20/11/2026",
12
+ "type": "Changed",
13
+ "en": "All read-only tools (get_generation_guide, list_elements, get_element, get_page_schema, new_element, new_page_skeleton, validate_page,…",
14
+ "vi": "Tất cả tool chỉ-đọc (get_generation_guide, list_elements, get_element, get_page_schema, new_element, new_page_skeleton, validate_page,…"
15
+ },
2
16
  {
3
17
  "v": "1.13.3",
4
18
  "d": "20/11/2026",
@@ -26,19 +40,5 @@
26
40
  "type": "Added",
27
41
  "en": "new_element and the get_element/list_elements skeletons now return the exact node the Webcake editor drops for a type — its default colors, font,…",
28
42
  "vi": "new_element và skeleton của get_element/list_elements nay trả về đúng node mà editor Webcake thả ra cho type đó — màu, font, viền, kích thước mặc…"
29
- },
30
- {
31
- "v": "1.12.0",
32
- "d": "19/11/2026",
33
- "type": "Added",
34
- "en": "get_element/list_elements now return keys (one line per specials/config/styles key the published renderer actually reads, with meaning, value type,…",
35
- "vi": "get_element/list_elements nay trả thêm keys (mỗi dòng là một key specials/config/styles mà renderer thật có đọc, kèm ý nghĩa, kiểu giá trị, enum,…"
36
- },
37
- {
38
- "v": "1.11.0",
39
- "d": "19/11/2026",
40
- "type": "Added",
41
- "en": "Three new tools, api_find, api_get, and api_call, expose the full landing_page_backend API surface the account's token can reach, beyond what the…",
42
- "vi": "Ba tool mới api_find, api_get, api_call cho phép gọi toàn bộ API của landing_page_backend mà token của tài khoản có quyền truy cập, vượt ra ngoài…"
43
43
  }
44
44
  ]
@@ -210,8 +210,8 @@
210
210
  "description": "Trigger. Matches the editor's own dropdown: click/hover on any element, success/error on a form, delay on anything (plus the legacy \"unset\")."
211
211
  },
212
212
  "action": {
213
- "type": "string",
214
- "description": "Behavior. Common click actions and what target holds: none(-), open_link(URL), open_popup(popup id), close_popup(popup id), scroll_to(element/section id), show_section/hide_section(section id), show_hide_element(element id), change_tab(id), lightbox(image id/url), copy(text), collapse(id), set_field_value(field_name + set_value), back_to/back_home(url), share(url), play_audio/stop_audio(id), open_cart/add_to_cart(product id), open_app(provider: botcake|whatsapp|mess_prefill|tiktok_prefill|line_prefill), change_color, custom_js. Hover actions: change_color, change_background, change_text_color, change_underline, change_overline, change_image, animation_hover, show_hide_element.",
213
+ "type": ["string", "null"],
214
+ "description": "null = an event the editor added but no action was picked yet (EventTrait.vue add()); the renderer ignores it and create_page's repair drops it. Behavior. Common click actions and what target holds: none(-), open_link(URL), open_popup(popup id), close_popup(popup id), scroll_to(element/section id), show_section/hide_section(section id), show_hide_element(element id), change_tab(id), lightbox(image id/url), copy(text), collapse(id), set_field_value(field_name + set_value), back_to/back_home(url), share(url), play_audio/stop_audio(id), open_cart/add_to_cart(product id), open_app(provider: botcake|whatsapp|mess_prefill|tiktok_prefill|line_prefill), change_color, custom_js. Hover actions: change_color, change_background, change_text_color, change_underline, change_overline, change_image, animation_hover, show_hide_element.",
215
215
  "examples": [
216
216
  "none", "open_link", "open_popup", "close_popup", "scroll_to",
217
217
  "show_section", "hide_section", "show_hide_element", "copy",
package/dist/smoke.js CHANGED
@@ -189,6 +189,17 @@ console.log("== expand: relocates misplaced responsive.<bp>.animation into confi
189
189
  const kept = landingDomain.expand(both).page[0].children[0].responsive.desktop;
190
190
  check("explicit config.animation wins over the stray key", kept.config.animation.name === "zoomIn" && kept.animation === undefined, kept.config);
191
191
  }
192
+ console.log("== editor-saved values: looping animation + empty click event (#4) ==");
193
+ {
194
+ // A page saved by the editor carries repeat:"infinite" on looping animations and
195
+ // action:null on an event added but never configured — a whole-tree patch must not choke on them.
196
+ const ed = structuredClone(good);
197
+ const el = ed.page[0].children[0];
198
+ el.responsive.desktop.config.animation = { name: "pulse", delay: 0, duration: 1, repeat: "infinite" };
199
+ el.events = [{ id: "ev_null", type: "click", action: null, target: null }];
200
+ const r = validatePage(landingDomain.expand(ed));
201
+ check("editor repeat:'infinite' + action:null validate", r.valid, r.errors);
202
+ }
192
203
  console.log("== form fields: field_default follows the system field_name; alias names warn ==");
193
204
  {
194
205
  // The editor locks a field's ID when properties.field_default is true and
@@ -12,7 +12,7 @@ export function registerGenerationTools(server, domain) {
12
12
  server.tool("new_element", "Returns the node the Webcake editor drops for a type, in the sparse authoring shape: a fresh id, the editor default look (colours, font, border, size) and settings for both breakpoints, and its default children (a form with name + phone fields and a submit button, a carousel with slides, a grid with items). Images are sized placeholders to replace. properties, runtime, empty events and per-breakpoint config are omitted because the server fills them from factory defaults on validate and save.", {
13
13
  type: z.string().describe("Element type to create."),
14
14
  name: z.string().optional().describe("Optional properties.name override (layer label)."),
15
- }, { title: "New Element Node", readOnlyHint: true, openWorldHint: false }, async ({ type, name }) => {
15
+ }, { title: "New Element Node", readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ type, name }) => {
16
16
  if (!domain.catalog[type]) {
17
17
  return text({ error: `Unknown element type "${type}".`, valid_types: domain.elementTypes });
18
18
  }
@@ -26,7 +26,7 @@ export function registerGenerationTools(server, domain) {
26
26
  mobileOnly: z.boolean().optional().describe("true if the page renders mobile-only."),
27
27
  desktopWidth: z.union([z.literal(960), z.literal(1200)]).optional().describe("Desktop canvas width (settings.width_section.desktop). 960 (default, simple/narrow) or 1200 (wide/multi-column/editorial, or cloning a >960 reference)."),
28
28
  mobileWidth: z.union([z.literal(420), z.literal(360)]).optional().describe("Mobile canvas width (settings.width_section.mobile). 420 (default) or 360 (to match a ~360–390 mobile design)."),
29
- }, { title: "New Page Skeleton", readOnlyHint: true, openWorldHint: false }, async ({ mobileOnly, desktopWidth, mobileWidth }) => text(domain.createPageSource({
29
+ }, { title: "New Page Skeleton", readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ mobileOnly, desktopWidth, mobileWidth }) => text(domain.createPageSource({
30
30
  mobileOnly: mobileOnly ?? false,
31
31
  settings: desktopWidth || mobileWidth
32
32
  ? { width_section: { desktop: desktopWidth ?? 960, mobile: mobileWidth ?? 420 } }
@@ -36,7 +36,7 @@ export function registerGenerationTools(server, domain) {
36
36
  server.tool("validate_page", "Validates a page source against the JSON schema and semantic rules: unique ids, dangling event targets, children only on container types, missing field_name, top-level types, and form-data bindings (duplicate field_name within one form; dangling promoId / connectedSurvey / connectedForm / set_field_value targets). Before validating it applies deterministic layout corrections (off-canvas boxes moved on-canvas, elements below wrapped text moved down) and lists them in auto_fixed. Returns errors (structural problems that block saving) and warnings (visible layout defects such as overlapping text, off-canvas bounds, or empty bands).", {
37
37
  page: objectOrJson()
38
38
  .describe("The page source object { page:[...], settings:{} } OR a JSON string of it."),
39
- }, { title: "Validate Page Source", readOnlyHint: true, openWorldHint: false }, async ({ page }) => {
39
+ }, { title: "Validate Page Source", readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ page }) => {
40
40
  // Hydrate sparse nodes (the model may omit boilerplate) before validating,
41
41
  // so what we check is the same full tree that create_page/add_section persist.
42
42
  const expanded = domain.expand(page);
@@ -67,7 +67,7 @@ export function registerGenerationTools(server, domain) {
67
67
  marginMobile: z.number().optional().describe("Mobile page margin / content inset. Default 20."),
68
68
  align: z.enum(["center", "left", "right"]).optional().describe("Horizontal alignment of the block within the canvas. Default center."),
69
69
  mobileItemWidth: z.number().optional().describe("Stacked-mobile item width (row/grid). Default = mobile content width."),
70
- }, { title: "Compute Layout Coordinates", readOnlyHint: true, openWorldHint: false }, async (opts) => {
70
+ }, { title: "Compute Layout Coordinates", readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async (opts) => {
71
71
  if (!domain.computeLayout) {
72
72
  return text({ error: "This domain does not provide layout coordinates." });
73
73
  }
@@ -84,7 +84,7 @@ export function registerIngestTools(server, domain) {
84
84
  .string()
85
85
  .optional()
86
86
  .describe("The page's original URL, when the HTML was saved or copied from a live site. Resolves relative font and image URLs and fetches the page's external stylesheets (+ @imports), so self-hosted fonts (`font_groups`) and computed type (`typography` / `text_styles`) defined outside the HTML are included."),
87
- }, { title: "Ingest HTML Reference", readOnlyHint: true, openWorldHint: true }, async ({ html, intent, detail, sections, base_url }) => {
87
+ }, { title: "Ingest HTML Reference", readOnlyHint: true, destructiveHint: false, openWorldHint: true }, async ({ html, intent, detail, sections, base_url }) => {
88
88
  const baseUrl = base_url && /^https?:\/\//i.test(base_url) ? base_url : undefined;
89
89
  const extraCss = baseUrl ? await fetchStylesheets(html, baseUrl) : undefined;
90
90
  return text({ intent: intent ?? "adapt", ...withCloneSource(domain, parseHtml(html, detail ?? "compact", { sections, baseUrl, extraCss })) });
@@ -97,7 +97,7 @@ export function registerIngestTools(server, domain) {
97
97
  .describe("How the result will be used. 'adapt' (default): the reference provides layout and imagery while the text is rewritten for the user's brand. 'clone': text and images stay close to the original. Absolute-canvas exports return a clone `source` either way."),
98
98
  detail: detailParam,
99
99
  sections: sectionsParam,
100
- }, { title: "Ingest URL Reference", readOnlyHint: true, openWorldHint: true }, async ({ url, intent, detail, sections }) => {
100
+ }, { title: "Ingest URL Reference", readOnlyHint: true, destructiveHint: false, openWorldHint: true }, async ({ url, intent, detail, sections }) => {
101
101
  const fetched = await fetchHtml(url);
102
102
  if (!fetched.ok) {
103
103
  return text({
@@ -214,7 +214,7 @@ export function registerMediaTools(server, allowLocalFiles = true) {
214
214
  size: z.enum(["large", "medium", "small"]).optional().describe("Minimum photo size to return (default any)."),
215
215
  color: z.string().optional().describe("Optional color filter: a name (red, blue, …) or a hex like '6a8f3c'."),
216
216
  page: z.number().int().min(1).optional().describe("Result page for pagination (default 1)."),
217
- }, { title: "Search Stock Images", readOnlyHint: true, openWorldHint: true }, async ({ query, queries, per_page, pick, orientation, size, color, page }, extra) => {
217
+ }, { title: "Search Stock Images", readOnlyHint: true, destructiveHint: false, openWorldHint: true }, async ({ query, queries, per_page, pick, orientation, size, color, page }, extra) => {
218
218
  const list = queries && queries.length ? queries : query ? [query] : [];
219
219
  if (list.length === 0) {
220
220
  return text({ ok: false, error: "Pass `query` or `queries`." });
@@ -267,7 +267,7 @@ export function registerMediaTools(server, allowLocalFiles = true) {
267
267
  .min(1)
268
268
  .max(40)
269
269
  .describe("Icon references to resolve (1–40), e.g. [\"ms:verified\", \"ms:support_agent\", \"fa:chart-line\"] — typically the block.icon values from an ingest result."),
270
- }, { title: "Resolve Icon SVGs", readOnlyHint: true, openWorldHint: true }, async ({ icons }) => {
270
+ }, { title: "Resolve Icon SVGs", readOnlyHint: true, destructiveHint: false, openWorldHint: true }, async ({ icons }) => {
271
271
  const unique = [...new Set(icons)];
272
272
  const results = await Promise.all(unique.map(async (ref) => [ref, await resolveIconSvg(ref)]));
273
273
  const out = {};
@@ -297,7 +297,7 @@ export function registerMediaTools(server, allowLocalFiles = true) {
297
297
  full_page: z.boolean().optional().describe("Capture the whole scrollable page (default true) vs just the viewport."),
298
298
  width: z.number().int().min(320).max(2560).optional().describe("Viewport width in px (default 1280; ~960 or 1200 matches the desktop page canvas, ~420 the mobile one)."),
299
299
  tiles: z.boolean().optional().describe("Tall pages: return the page as MULTIPLE top→bottom band images (each readable in detail) instead of one squished full-page image. Requires a Playwright host (RENDER_SCREENSHOT_BASE); without one it falls back to a single image."),
300
- }, { title: "Render Preview Screenshot", readOnlyHint: true, openWorldHint: true }, async ({ page_id, url, full_page, width, tiles }, extra) => {
300
+ }, { title: "Render Preview Screenshot", readOnlyHint: true, destructiveHint: false, openWorldHint: true }, async ({ page_id, url, full_page, width, tiles }, extra) => {
301
301
  const headers = extra?.requestInfo?.headers;
302
302
  let target = url?.trim();
303
303
  if (!target && page_id) {
@@ -274,7 +274,7 @@ export function registerPersistenceTools(server, domain) {
274
274
  };
275
275
  };
276
276
  // 8) List organizations -----------------------------------------------------
277
- server.tool("list_organizations", "Returns the account's Webcake organizations (id, name, is_default). The default org (type===1, usually the personal workspace) is where pages normally go. Needs WEBCAKE_API_BASE + WEBCAKE_JWT.", {}, { title: "List Webcake Organizations", readOnlyHint: true, openWorldHint: true }, async (_args, extra) => {
277
+ server.tool("list_organizations", "Returns the account's Webcake organizations (id, name, is_default). The default org (type===1, usually the personal workspace) is where pages normally go. Needs WEBCAKE_API_BASE + WEBCAKE_JWT.", {}, { title: "List Webcake Organizations", readOnlyHint: true, destructiveHint: false, openWorldHint: true }, async (_args, extra) => {
278
278
  const { config, missing } = cfgFor(extra);
279
279
  if (!config) {
280
280
  return text({
@@ -546,7 +546,7 @@ export function registerPersistenceTools(server, domain) {
546
546
  });
547
547
  });
548
548
  // 10) List pages ------------------------------------------------------------
549
- server.tool("list_pages", "Lists the pages owned by the account (id, name, organization_id, updated_at), most-recent first. Needs WEBCAKE_API_BASE + WEBCAKE_JWT.", {}, { title: "List Webcake Pages", readOnlyHint: true, openWorldHint: true }, async (_args, extra) => {
549
+ server.tool("list_pages", "Lists the pages owned by the account (id, name, organization_id, updated_at), most-recent first. Needs WEBCAKE_API_BASE + WEBCAKE_JWT.", {}, { title: "List Webcake Pages", readOnlyHint: true, destructiveHint: false, openWorldHint: true }, async (_args, extra) => {
550
550
  const { config, missing } = cfgFor(extra);
551
551
  if (!config)
552
552
  return text({ ok: false, reason: "missing_env", missing_env: missing });
@@ -570,7 +570,7 @@ export function registerPersistenceTools(server, domain) {
570
570
  .describe("Case-insensitive substring of the page's domain (matches custom_domain OR default_domain)."),
571
571
  page_id: z.string().optional().describe("Exact page id — narrows to that single page (useful to confirm it exists/owned)."),
572
572
  limit: z.number().int().positive().max(100).optional().describe("Max results (default 50, capped at 100)."),
573
- }, { title: "Find Webcake Pages", readOnlyHint: true, openWorldHint: true }, async ({ name, domain, page_id, limit }, extra) => {
573
+ }, { title: "Find Webcake Pages", readOnlyHint: true, destructiveHint: false, openWorldHint: true }, async ({ name, domain, page_id, limit }, extra) => {
574
574
  const { config, missing } = cfgFor(extra);
575
575
  if (!config)
576
576
  return text({ ok: false, reason: "missing_env", missing_env: missing });
@@ -608,7 +608,7 @@ export function registerPersistenceTools(server, domain) {
608
608
  .boolean()
609
609
  .optional()
610
610
  .describe("Default TRUE — strip factory-default boilerplate from every element (sparse shape, far fewer tokens). false returns the raw stored tree."),
611
- }, { title: "Get Webcake Page Source", readOnlyHint: true, openWorldHint: true }, async ({ page_id, draft_id, outline, element_id, compact }, extra) => {
611
+ }, { title: "Get Webcake Page Source", readOnlyHint: true, destructiveHint: false, openWorldHint: true }, async ({ page_id, draft_id, outline, element_id, compact }, extra) => {
612
612
  // Outline / one element / a draft: a narrow read of the same tree.
613
613
  const narrow = (src, meta) => {
614
614
  if (typeof src === "string")
@@ -9,9 +9,9 @@ import { text } from "../mcp/response.js";
9
9
  const SPARSE_NOTE = "Skeletons and examples are in the SPARSE authoring shape — emit elements exactly like this (id, type, BOTH breakpoints' styles, specials, real events). OMIT properties/runtime/empty events+children/config: the server hydrates them from factory defaults on validate/persist. A skeleton is what the Webcake editor drops for the type (its colours, font, border, default children) — keep its style keys: the hydration defaults carry no paint.";
10
10
  export function registerReferenceTools(server, domain) {
11
11
  // 1) Generation guide -------------------------------------------------------
12
- server.tool("get_generation_guide", "Returns the page-building conventions reference: output shape, the absolute-positioning coordinate system, event vocabulary, and the recommended workflow.", { title: "Get Generation Guide", readOnlyHint: true, openWorldHint: false }, async () => text(domain.guide));
12
+ server.tool("get_generation_guide", "Returns the page-building conventions reference: output shape, the absolute-positioning coordinate system, event vocabulary, and the recommended workflow.", { title: "Get Generation Guide", readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async () => text(domain.guide));
13
13
  // 2) List elements ----------------------------------------------------------
14
- server.tool("list_elements", "List every supported element type, grouped by category, with a one-line summary and whether it is a container (can hold children).", { title: "List Element Types", readOnlyHint: true, openWorldHint: false }, async () => {
14
+ server.tool("list_elements", "List every supported element type, grouped by category, with a one-line summary and whether it is a container (can hold children).", { title: "List Element Types", readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async () => {
15
15
  const byCategory = {};
16
16
  for (const t of domain.elementTypes) {
17
17
  const d = domain.catalog[t];
@@ -31,7 +31,7 @@ export function registerReferenceTools(server, domain) {
31
31
  .array(z.string())
32
32
  .optional()
33
33
  .describe("Several element types fetched in one call, e.g. ['section','text-block','button','form','input']."),
34
- }, { title: "Get Element Details", readOnlyHint: true, openWorldHint: false }, async ({ type, types }) => {
34
+ }, { title: "Get Element Details", readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async ({ type, types }) => {
35
35
  const list = types && types.length ? types : type ? [type] : [];
36
36
  if (list.length === 0) {
37
37
  return text({ error: "Pass `type` (single) or `types` (non-empty array).", valid_types: domain.elementTypes });
@@ -70,5 +70,5 @@ export function registerReferenceTools(server, domain) {
70
70
  });
71
71
  });
72
72
  // 4) Page schema ------------------------------------------------------------
73
- server.tool("get_page_schema", "Returns the full JSON Schema (Draft 2020-12) of a Webcake page source object { page: [...], settings: {...} } for structural reference and validation.", { title: "Get Page JSON Schema", readOnlyHint: true, openWorldHint: false }, async () => text(domain.schema));
73
+ server.tool("get_page_schema", "Returns the full JSON Schema (Draft 2020-12) of a Webcake page source object { page: [...], settings: {...} } for structural reference and validation.", { title: "Get Page JSON Schema", readOnlyHint: true, destructiveHint: false, openWorldHint: false }, async () => text(domain.schema));
74
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webcake-landing-mcp",
3
- "version": "1.13.3",
3
+ "version": "1.13.5",
4
4
  "description": "MCP server exposing Webcake landing-page element schemas + AI usage hints, and persisting LLM-generated page sources to a Webcake backend.",
5
5
  "mcpName": "io.github.vuluu2k/webcake-landing-mcp",
6
6
  "type": "module",
@@ -32,6 +32,7 @@
32
32
  "smoke": "node dist/smoke.js",
33
33
  "inspect": "npm run build && npx -y @modelcontextprotocol/inspector node dist/index.js",
34
34
  "pack:mcpb": "node scripts/pack-mcpb.mjs",
35
+ "pack:plugin": "node scripts/pack-plugin.mjs",
35
36
  "prepare": "npm run build",
36
37
  "prepublishOnly": "npm run build && npm run smoke",
37
38
  "release": "node scripts/release.js",