webcake-landing-mcp 1.13.0 → 1.13.1

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,11 @@
1
1
  [
2
+ {
3
+ "v": "1.13.1",
4
+ "d": "20/11/2026",
5
+ "type": "Fixed",
6
+ "en": "update_page, patch_page, add_section (legacy fallback path), and completing a cached draft via create_page/patch_page/update_page with a draft_id…",
7
+ "vi": "update_page, patch_page, add_section (đường fallback cho backend cũ), và việc hoàn tất một draft đã cache qua create_page/patch_page/update_page với…"
8
+ },
2
9
  {
3
10
  "v": "1.13.0",
4
11
  "d": "19/11/2026",
@@ -33,12 +40,5 @@
33
40
  "type": "Changed",
34
41
  "en": "A Webcake JWT the backend rejects is now marked dead in a shared store (Redis + Postgres) instead of a single process's memory, so every remote…",
35
42
  "vi": "Một JWT Webcake bị backend từ chối nay được đánh dấu \"chết\" trong một store chung (Redis + Postgres) thay vì chỉ nằm trong bộ nhớ của một process,…"
36
- },
37
- {
38
- "v": "1.8.0",
39
- "d": "19/11/2026",
40
- "type": "Added",
41
- "en": "The stdio server now detects an expired or backend-rejected WEBCAKE_JWT and automatically reopens the browser Connect page, then retries the failing…",
42
- "vi": "Server stdio nay tự phát hiện WEBCAKE_JWT đã hết hạn hoặc bị backend từ chối, tự mở lại trang Connect trên trình duyệt, rồi thử lại tool bị lỗi một…"
43
43
  }
44
44
  ]
@@ -29,6 +29,8 @@ const EDITOR = load("./editor-keys.generated.json");
29
29
  const RTYPES = RENDERER.types || {};
30
30
  const SHARED = RENDERER.shared || {};
31
31
  const CLIENT = new Set(RENDERER.client_mentioned || []);
32
+ /** Keys only one type's own runtime file reads (render_v4/src/elements/<type>.js). */
33
+ const CLIENT_BY_TYPE = Object.fromEntries(Object.entries(RENDERER.client_by_type || {}).map(([t, ks]) => [t, new Set(ks)]));
32
34
  /** Types the HTML builder has a case for (anything else renders an empty wrapper). */
33
35
  export const RENDERED_TYPES = new Set(RENDERER.dispatched_html || []);
34
36
  const typeOf = (v) => (Array.isArray(v) ? "array" : v === null ? "null" : typeof v);
@@ -57,7 +59,7 @@ export function renderedVia(type, bucket, key) {
57
59
  return "shared";
58
60
  if (bucket === "styles" && r.styles_open && !(r.styles_dropped || []).includes(key))
59
61
  return "css-loop";
60
- if (bucket === "specials" && r.client_specials && CLIENT.has(key))
62
+ if (bucket === "specials" && r.client_specials && (CLIENT.has(key) || CLIENT_BY_TYPE[type]?.has(key)))
61
63
  return "client";
62
64
  return undefined;
63
65
  }
@@ -19,7 +19,7 @@ export const FORM = [
19
19
  botcake_dynamic_ref: "string — ref appended to the m.me URL when app_target='botcake_dynamic'.",
20
20
  others_link_params: "array of {key: elementId, name: string} — field→URL-param mappings when app_target='others'.",
21
21
  partnerServiceId: "string — sent as partner_service_id (partner/affiliate tracking).",
22
- fb_event_type: "Facebook pixel standard event fired on submit (e.g. Lead, Purchase, none). Use 'none' to disable pixel firing.",
22
+ fb_event_type: "Facebook pixel standard event fired on submit (e.g. Lead, Purchase, none). Use 'none' to disable pixel firing. A form from new_element / get_element carries the editor's default 'CompleteRegistration' (also tiktok_event_type, conversion value 10000 VND) — it only fires when the page has a Facebook pixel (window.fbq); set the event the user's ads optimise for, or 'none'.",
23
23
  fb_conversion_value: "string — FB pixel conversion value.",
24
24
  fb_tracking_currency: "string — currency for the FB conversion value (VND…).",
25
25
  fb_custom_tracking: "string — extra custom FB pixel event name to fire on submit.",
@@ -379,13 +379,11 @@
379
379
  "colorPrice",
380
380
  "colorTitle",
381
381
  "column",
382
- "columns",
383
382
  "commentContentLayout",
384
383
  "commentLayout",
385
384
  "commentType",
386
385
  "country",
387
386
  "ctype",
388
- "currentTime",
389
387
  "cursor",
390
388
  "customArrangementSheet",
391
389
  "customMessage",
@@ -454,7 +452,6 @@
454
452
  "lineHeight",
455
453
  "list",
456
454
  "lock",
457
- "margin",
458
455
  "marginBottom",
459
456
  "maxHeight",
460
457
  "maxWidth",
@@ -463,7 +460,6 @@
463
460
  "method",
464
461
  "multiForm",
465
462
  "multiFormParent",
466
- "multiOption",
467
463
  "name",
468
464
  "numerical_order",
469
465
  "opacity",
@@ -543,7 +539,6 @@
543
539
  "transform",
544
540
  "transition",
545
541
  "type",
546
- "typeTimeGroup",
547
542
  "typeVideo",
548
543
  "validate",
549
544
  "validate_country",
@@ -551,8 +546,16 @@
551
546
  "width",
552
547
  "zIndex"
553
548
  ],
549
+ "client_by_type": {
550
+ "survey": [
551
+ "multiOption"
552
+ ],
553
+ "timegroup": [
554
+ "currentTime",
555
+ "typeTimeGroup"
556
+ ]
557
+ },
554
558
  "server_mentioned": [
555
- "alignment",
556
559
  "allowZoom",
557
560
  "alt",
558
561
  "animateMode",
@@ -570,7 +573,6 @@
570
573
  "borderStyle",
571
574
  "borderWidth",
572
575
  "boxShadow",
573
- "checkboxSize",
574
576
  "code",
575
577
  "color",
576
578
  "colorBg",
@@ -582,7 +584,6 @@
582
584
  "colorTextBtn",
583
585
  "colorTitle",
584
586
  "column",
585
- "columns",
586
587
  "compressible",
587
588
  "country",
588
589
  "ctype",
@@ -619,15 +620,12 @@
619
620
  "fontWeight",
620
621
  "format_title",
621
622
  "gap",
622
- "head_background",
623
- "head_color",
624
623
  "height",
625
624
  "heightBgImage",
626
625
  "heightSvg",
627
626
  "hidden_commune",
628
627
  "hidden_title",
629
628
  "hide",
630
- "hoveredBorder",
631
629
  "html",
632
630
  "iconColor",
633
631
  "iconFontSize",
@@ -637,8 +635,6 @@
637
635
  "iconType",
638
636
  "id",
639
637
  "imageCompression",
640
- "imageHeight",
641
- "imageWidth",
642
638
  "img",
643
639
  "infinity",
644
640
  "inputHeight",
@@ -657,7 +653,6 @@
657
653
  "linePaddingBottom",
658
654
  "linePaddingLeft",
659
655
  "list",
660
- "margin",
661
656
  "marginText",
662
657
  "maxHeight",
663
658
  "maxValue",
@@ -697,14 +692,8 @@
697
692
  "rotate",
698
693
  "round",
699
694
  "row",
700
- "row_even_background",
701
- "row_even_color",
702
- "row_odd_background",
703
- "row_odd_color",
704
695
  "scrollAuto",
705
696
  "selectIcon",
706
- "selectedBackground",
707
- "selectedBorder",
708
697
  "sheetID",
709
698
  "showControl",
710
699
  "showCoupon",
@@ -33,15 +33,21 @@ function saveExtras(o) {
33
33
  /** Errors of `after` the `before` tree did not already have (matched by message with array indices
34
34
  * removed, so a moved/reordered element's unchanged problem is not "new"). No before → all. */
35
35
  function addedErrors(domain, before, after) {
36
+ const prior = priorErrors(domain, before);
37
+ return prior ? addedAgainst(prior, after) : after;
38
+ }
39
+ /** The errors a stored tree already has (undefined when there is none / it can't be judged). */
40
+ function priorErrors(domain, before) {
36
41
  if (!before)
37
- return after;
38
- let prior = [];
42
+ return undefined;
39
43
  try {
40
- prior = domain.validate(domain.expand(before)).errors;
44
+ return domain.validate(domain.expand(before)).errors;
41
45
  }
42
46
  catch {
43
- return after;
47
+ return undefined;
44
48
  }
49
+ }
50
+ function addedAgainst(prior, after) {
45
51
  const norm = (e) => e.replace(/\[\d+\]/g, "[]").replace(/\/\d+\//g, "/");
46
52
  const seen = new Map();
47
53
  for (const e of prior)
@@ -608,6 +614,7 @@ export function registerPersistenceTools(server, domain) {
608
614
  // The version of the live page this source was built from. Explicit wins;
609
615
  // a draft carries the one captured when it was first cached.
610
616
  let resolvedBaseVersion = base_version;
617
+ let draftPrior;
611
618
  if (draft_id) {
612
619
  const cached = await getDraft(draft_id);
613
620
  if (!cached) {
@@ -625,6 +632,7 @@ export function registerPersistenceTools(server, domain) {
625
632
  });
626
633
  }
627
634
  expanded = cached.source;
635
+ draftPrior = cached.prior_errors;
628
636
  resolvedPageId = page_id ?? cached.page_id;
629
637
  resolvedBaseVersion = base_version ?? cached.base_version;
630
638
  }
@@ -659,13 +667,14 @@ export function registerPersistenceTools(server, domain) {
659
667
  }
660
668
  dropStaleAgainst(liveSrc, expanded);
661
669
  const result = domain.validate(expanded);
662
- const added = result.valid ? [] : liveSrc ? addedErrors(domain, liveSrc, result.errors) : result.errors;
670
+ const prior = liveSrc ? priorErrors(domain, liveSrc) : draftPrior;
671
+ const added = result.valid ? [] : prior ? addedAgainst(prior, result.errors) : result.errors;
663
672
  if (!result.valid && added.length) {
664
673
  if (existingDraftId) {
665
674
  await updateDraft(existingDraftId, expanded);
666
675
  }
667
676
  else {
668
- existingDraftId = await putDraft({ source: expanded, kind: "update", page_id: resolvedPageId, base_version: resolvedBaseVersion });
677
+ existingDraftId = await putDraft({ source: expanded, kind: "update", page_id: resolvedPageId, base_version: resolvedBaseVersion, prior_errors: prior });
669
678
  }
670
679
  return text({
671
680
  updated: false,
@@ -686,7 +695,7 @@ export function registerPersistenceTools(server, domain) {
686
695
  await updateDraft(existingDraftId, expanded);
687
696
  }
688
697
  else {
689
- existingDraftId = await putDraft({ source: expanded, kind: "update", page_id: resolvedPageId, base_version: resolvedBaseVersion });
698
+ existingDraftId = await putDraft({ source: expanded, kind: "update", page_id: resolvedPageId, base_version: resolvedBaseVersion, prior_errors: prior });
690
699
  }
691
700
  return text({
692
701
  dry_run: true,
@@ -708,7 +717,7 @@ export function registerPersistenceTools(server, domain) {
708
717
  await updateDraft(existingDraftId, expanded);
709
718
  }
710
719
  else {
711
- existingDraftId = await putDraft({ source: expanded, kind: "update", page_id: resolvedPageId, base_version: resolvedBaseVersion });
720
+ existingDraftId = await putDraft({ source: expanded, kind: "update", page_id: resolvedPageId, base_version: resolvedBaseVersion, prior_errors: prior });
712
721
  }
713
722
  const guard = await guardOverwrite(config, resolvedPageId, parsed, {
714
723
  baseVersion: resolvedBaseVersion,
@@ -966,11 +975,13 @@ export function registerPersistenceTools(server, domain) {
966
975
  const merged = { ...base, page: [...existing, ...newSections] };
967
976
  const counts = { before: existing.length, after: existing.length + newSections.length };
968
977
  const mergedResult = domain.validate(merged);
969
- if (!mergedResult.valid) {
978
+ // only errors the new sections ADD (the stored page may already carry some)
979
+ const mergedAdded = mergedResult.valid ? [] : addedErrors(domain, base, mergedResult.errors);
980
+ if (mergedAdded.length) {
970
981
  return text({
971
982
  added: false,
972
983
  reason: "validation_failed",
973
- errors: mergedResult.errors,
984
+ errors: mergedAdded,
974
985
  ...warningsField(mergedResult.warnings),
975
986
  page_section_count: counts,
976
987
  hint: "Fix the section(s) — duplicate ids vs existing sections are a common cause — then retry.",
@@ -1304,12 +1315,15 @@ export function registerPersistenceTools(server, domain) {
1304
1315
  // 'sections' → APPEND to the live page
1305
1316
  // 'update' → UPDATE the existing page (updatePageSource)
1306
1317
  if (draft_id && draft) {
1307
- if (!result.valid) {
1318
+ // an update draft refuses only errors beyond what the live page already had
1319
+ const blocking = result.valid ? [] : draft.kind === "update" && draft.prior_errors ? addedAgainst(draft.prior_errors, result.errors) : result.errors;
1320
+ if (blocking.length) {
1308
1321
  await updateDraft(draft_id, base); // persist partial fixes for the next patch round
1309
1322
  return text({
1310
1323
  patched: false,
1311
1324
  reason: "validation_failed",
1312
- errors: result.errors,
1325
+ errors: blocking,
1326
+ ...(blocking.length < result.errors.length ? { pre_existing_errors: result.errors.length - blocking.length } : {}),
1313
1327
  ...warningsField(result.warnings),
1314
1328
  patches_applied: applied, ...integrity,
1315
1329
  draft_id,
@@ -1511,6 +1525,7 @@ export function registerPersistenceTools(server, domain) {
1511
1525
  source: expanded,
1512
1526
  kind: "update",
1513
1527
  page_id: page_id,
1528
+ prior_errors: priorErrors(domain, before),
1514
1529
  base_version: lastKnownPageVersion(page_id)?.fp,
1515
1530
  });
1516
1531
  if (isDry) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webcake-landing-mcp",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
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",