sbuilder-mcp 0.100.4 → 0.100.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,17 @@ All notable changes to this project are documented in this file.
6
6
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
7
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [0.100.5] - 2026-10-29
10
+
11
+ ### Changed
12
+ - `sb_bind` returns `collapsed` with the replaced sources and a one-time note when it replaces a field's chain of several bindings with one.
13
+
14
+ ### Fixed
15
+ - `sb_look` measurements report `off_canvas` for a hidden absolute box, such as a closed dropdown panel, that still widens the page, and skip only hidden boxes inside a fixed layer, such as a closed drawer.
16
+ - `sb_look` no longer treats `aria-hidden` boxes as hidden, and hidden boxes still count for width but not for overlap or small text.
17
+ - `sb_look` turns off CSS transitions before measuring, so an overlay opened just before measuring is measured at its final position.
18
+ - `sb_review` reports `duplicate_binding_field` only when a binding is shadowed by a source that is always present, because a binding before a present-only source such as `product.summary`, `rating` or `record.*` is a fallback.
19
+
9
20
  ## [0.100.4] - 2026-10-29
10
21
 
11
22
  ### Fixed
package/CHANGELOG.vi.md CHANGED
@@ -6,6 +6,17 @@ Mọi thay đổi đáng chú ý của dự án được ghi lại trong file n
6
6
  Định dạng dựa trên [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
7
7
  và dự án tuân theo [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## [0.100.5] - 2026-10-29
10
+
11
+ ### Changed
12
+ - `sb_bind` trả về `collapsed` cùng các nguồn bị thay và một ghi chú một lần khi thay chuỗi nhiều binding của một field bằng một binding duy nhất.
13
+
14
+ ### Fixed
15
+ - Phép đo của `sb_look` báo `off_canvas` cho hộp ẩn dạng absolute, như panel dropdown đang đóng, mà vẫn làm trang rộng ra, và chỉ bỏ qua hộp ẩn nằm trong lớp fixed, như drawer đang đóng.
16
+ - `sb_look` không còn coi hộp `aria-hidden` là ẩn, và hộp ẩn vẫn được tính vào bề rộng nhưng không tính vào overlap hay chữ nhỏ.
17
+ - `sb_look` tắt CSS transition trước khi đo, nên overlay vừa mở được đo ở vị trí cuối.
18
+ - `sb_review` chỉ báo `duplicate_binding_field` khi binding bị che bởi một nguồn luôn có, vì binding đứng trước nguồn present-only như `product.summary`, `rating` hay `record.*` là dự phòng.
19
+
9
20
  ## [0.100.4] - 2026-10-29
10
21
 
11
22
  ### Fixed
@@ -1,6 +1,6 @@
1
1
  export const DEAD_KEY_SOURCE = {
2
- "files": 6041,
3
- "identifiers": 111016,
2
+ "files": 6043,
3
+ "identifiers": 111049,
4
4
  "seededKeys": 460,
5
5
  "dead": 0
6
6
  };
@@ -36400,6 +36400,38 @@ export const BINDING_SOURCES = [
36400
36400
  "site.timezone",
36401
36401
  "site.youtube"
36402
36402
  ];
36403
+ /** Sources a context holds only when the entity has one (scripts/gen-catalog.ts readPresentOnlySources). */
36404
+ export const PRESENT_ONLY_SOURCES = [
36405
+ "course.ratingAverage",
36406
+ "course.ratingCount",
36407
+ "product.attributes",
36408
+ "product.brandLogo",
36409
+ "product.brandUrl",
36410
+ "product.bundleItems",
36411
+ "product.id",
36412
+ "product.model",
36413
+ "product.ratingAverage",
36414
+ "product.ratingCount",
36415
+ "product.summary",
36416
+ "product.tags",
36417
+ "product.variations",
36418
+ "site.addressLine",
36419
+ "site.country",
36420
+ "site.description",
36421
+ "site.facebook",
36422
+ "site.instagram",
36423
+ "site.localeSwitch",
36424
+ "site.moneySwitch",
36425
+ "site.postalCode",
36426
+ "site.privacyPolicy",
36427
+ "site.province",
36428
+ "site.returnPolicy",
36429
+ "site.shippingPolicy",
36430
+ "site.supportEmail",
36431
+ "site.supportPhone",
36432
+ "site.tiktok",
36433
+ "site.youtube"
36434
+ ];
36403
36435
  export const BOUND_SPECIALS = {
36404
36436
  "bundle-items": [
36405
36437
  "boundBundleItems"
@@ -4,7 +4,7 @@ export const SHAPE_SOURCE = {
4
4
  "fromHandlers": 334,
5
5
  "fromSwaggerOnly": 10,
6
6
  "withReadOnly": 29,
7
- "structsRead": 3469
7
+ "structsRead": 3470
8
8
  };
9
9
  export const REQUEST_SHAPES = {
10
10
  "post:/api/sites/{id}/ai-credits/purchase": {
@@ -1,7 +1,7 @@
1
1
  // GENERATED by scripts/gen-catalog.ts — do not edit by hand.
2
2
  // The platform commit every other generated file here describes.
3
3
  export const PLATFORM_SOURCE = {
4
- "commit": "ab273ce14722dcc17f81176e01415a1892e5d878",
5
- "committedAt": "2026-10-29T18:33:35+07:00",
4
+ "commit": "ae1e972c66244b299ac4b5460be740a680f63844",
5
+ "committedAt": "2026-10-29T19:22:08+07:00",
6
6
  "dirty": false
7
7
  };
@@ -5,7 +5,7 @@ import { bandOf, isGlobal } from './traps.js';
5
5
  import { exampleCopy } from './examplecopy.js';
6
6
  import { SEED_COPY_VI, langOf } from './seedcopy.js';
7
7
  import { HOVER_STATE, hoverHome } from './hover.js';
8
- import { ELEMENTS, BINDING_SOURCES, BOUND_SPECIALS, FIRST_CHILD_ONLY, SATELLITE_RULES, ELEMENT_SEEDS } from '../../catalog/elements.generated.js';
8
+ import { ELEMENTS, BINDING_SOURCES, PRESENT_ONLY_SOURCES, BOUND_SPECIALS, FIRST_CHILD_ONLY, SATELLITE_RULES, ELEMENT_SEEDS } from '../../catalog/elements.generated.js';
9
9
  import { fill } from './findings.js';
10
10
  import { hrefParamProblems, isRecordSource, isSameSitePath, parseRecordRefAxis, readRecordAggregates, recordAggKeyOf, recordAggregateParams, RECORD_FIELD_ID, RECORD_HTML_SOURCE, RECORD_SOURCE, RECORD_TILES, recordScope, } from './record.js';
11
11
  import { formFieldFindings, isFormDocument } from './formdoc.js';
@@ -1541,26 +1541,36 @@ opts = {}) {
1541
1541
  }
1542
1542
  }
1543
1543
  // TWO BINDINGS ON ONE FIELD (TTG gap #62). ApplyBindings
1544
- // (render/scope/scope.go) walks them IN ORDER and each resolved source
1545
- // overwrites the special, so the LAST renders and the rest are dead weight
1546
- // that a reorder silently swaps. The purchase binding is not a field binding.
1544
+ // (render/scope/scope.go) walks them IN ORDER, SKIPS a source the context
1545
+ // does not hold, and each resolved one overwrites the special — so the last
1546
+ // source THE CONTEXT RESOLVES wins. An earlier binding is dead only under a
1547
+ // later source that is ALWAYS there: same context (namespace) and not
1548
+ // present-only. Under `product.tags`, `product.summary`, a rating or a
1549
+ // `record.*` field it is the fallback for an entity without one, and a
1550
+ // source from another context may be outside this node's scope altogether.
1551
+ // The purchase binding is not a field binding.
1547
1552
  const byField = new Map();
1548
1553
  for (const b of bindings) {
1549
1554
  if (!b.field || !b.source || b.id === PRODUCT_ACTION_BINDING_ID)
1550
1555
  continue;
1551
1556
  byField.set(b.field, [...(byField.get(b.field) ?? []), b.source]);
1552
1557
  }
1558
+ const ns = (s) => s.split('.')[0];
1559
+ const always = (s) => ns(s) !== 'record' && !PRESENT_ONLY_SOURCES.includes(s);
1553
1560
  for (const [field, sources] of byField) {
1554
- if (sources.length < 2)
1561
+ const shadow = (i) => sources.slice(i + 1).filter((t) => ns(t) === ns(sources[i]) && always(t)).pop();
1562
+ const deadAt = sources.map((_, i) => i).filter((i) => shadow(i));
1563
+ if (!deadAt.length)
1555
1564
  continue;
1556
- const wins = sources[sources.length - 1];
1565
+ const dead = deadAt.map((i) => sources[i]);
1557
1566
  out.push({
1558
1567
  code: 'duplicate_binding_field',
1559
1568
  nodeId: id,
1560
1569
  type,
1561
1570
  key: field,
1562
- problem: `${sources.length} bindings write ${field} (${sources.join(', ')}); the renderer applies them in ` +
1563
- `order, so ${wins} renders and the others are dead weight.`,
1571
+ problem: `${sources.length} bindings write ${field} (${sources.join(', ')}); the renderer applies them in order ` +
1572
+ `and the last source the context resolves wins, so ${dead.join(', ')} never renders — ` +
1573
+ `${shadow(deadAt[0])} always resolves after it.`,
1564
1574
  fix: fill('duplicate_binding_field', { id, key: field }),
1565
1575
  });
1566
1576
  }
@@ -882,11 +882,27 @@ export function registerLiveTools(server, ctx, session) {
882
882
  }
883
883
  }
884
884
  const forced = guard.forced.length ? { forced: guard.forced } : {};
885
+ // A FALLBACK CHAIN COLLAPSED. ApplyBindings skips a source the context
886
+ // lacks, so earlier bindings under a present-only one (product.summary,
887
+ // tags, rating, record.*) render when it is absent. Replacing them all is
888
+ // what a rebind asks for — and is said, since it can lose a fallback.
889
+ const prior = action === undefined
890
+ ? (d.node(id).bindings ?? [])
891
+ .filter((b) => b?.field === field && b.id !== PRODUCT_ACTION_BINDING_ID)
892
+ .map((b) => b.source ?? '')
893
+ : [];
894
+ const collapsed = prior.length > 1
895
+ ? {
896
+ collapsed: prior,
897
+ collapsed_note: (dry_run !== false ? ctx.notices.peek : ctx.notices.once).call(ctx.notices, 'bind:collapsed', `${field} held a chain; the renderer shows the last source the context resolves, so an earlier one was ` +
898
+ 'a fallback for an entity without the later one. Now one binding — rebind each if the chain was wanted.'),
899
+ }
900
+ : {};
885
901
  if (dry_run !== false) {
886
902
  const refuse = session.wouldRefuse(patches);
887
- return text({ dry_run: true, patches, ...(refuse ? { would_refuse: refuse } : {}), ...forced });
903
+ return text({ dry_run: true, patches, ...(refuse ? { would_refuse: refuse } : {}), ...collapsed, ...forced });
888
904
  }
889
905
  await session.applyAndSave(patches);
890
- return text({ bound: id, source, field, ...(action ? { action } : {}), rev: d.rev, ...forced });
906
+ return text({ bound: id, source, field, ...(action ? { action } : {}), ...collapsed, rev: d.rev, ...forced });
891
907
  });
892
908
  }
@@ -33,16 +33,21 @@ export function measureShot(shot, skip = new Set(), doc) {
33
33
  // that is two dozen false positives long is a list nobody reads.
34
34
  if (skip.has(b.id))
35
35
  continue;
36
- // A box the browser does not show (a CLOSED drawer is `visibility:hidden`
37
- // and translated off-screen by its own static CSS) is not a visitor's
38
- // problem; the same drawer OPENED is (TTG gap #60).
39
- if (b.hidden)
36
+ // A CLOSED DRAWER is `visibility:hidden` AND fixed, translated off-screen by
37
+ // its own static CSS: nothing a visitor sees or scrolls to (TTG gap #60).
38
+ // Hidden is PAINT only, though — a hidden ABSOLUTE panel (a closed dropdown,
39
+ // a reveal-on-hover child) still lays out and still widens the page:
40
+ // measured, a 320px `.wb-dropdown-panel` at x=200 made a 390 phone scroll
41
+ // to 520 (review of v0.100.4). So only hidden-in-a-fixed-layer is skipped.
42
+ if (b.hidden && (b.inFixed || b.position === 'fixed'))
40
43
  continue;
41
44
  // A FLOATING BOX PAST THE VIEWPORT (TTG gap #60). A fixed drawer 400px wide
42
45
  // on a 390px phone overhangs by 10px with no scrollbar to show it — headless
43
46
  // has none, and a 24px padding hides most of it in the picture. Out of the
44
- // flow nothing shrinks it, so the fix is a cap, said with the widths.
45
- if ((b.position === 'fixed' || b.position === 'sticky' || b.position === 'absolute') &&
47
+ // flow nothing shrinks it, so the fix is a cap, said with the widths. A
48
+ // HIDDEN one is not seen at all; what it costs is the scroll (off_canvas).
49
+ if (!b.hidden &&
50
+ (b.position === 'fixed' || b.position === 'sticky' || b.position === 'absolute') &&
46
51
  (b.x < -1 || b.x + b.w > shot.width + 1)) {
47
52
  out.push({
48
53
  code: 'wider_than_viewport',
@@ -60,13 +65,14 @@ export function measureShot(shot, skip = new Set(), doc) {
60
65
  code: 'off_canvas',
61
66
  nodeId: b.id,
62
67
  width: shot.width,
63
- problem: `Extends past the ${shot.width}px viewport (${b.x} → ${b.x + b.w}).`,
68
+ problem: (b.hidden ? 'Hidden, yet still laid out — it widens the page: ' : '') +
69
+ `Extends past the ${shot.width}px viewport (${b.x} → ${b.x + b.w}).`,
64
70
  fix: fill('off_canvas', { id: b.id }),
65
71
  });
66
72
  }
67
73
  // TEXT TOO SMALL. Only where text actually renders: a container inherits a
68
74
  // font size it never shows, and reporting that would be noise.
69
- if (b.hasText && b.fontPx && b.fontPx < MIN_BODY_PX) {
75
+ if (!b.hidden && b.hasText && b.fontPx && b.fontPx < MIN_BODY_PX) {
70
76
  out.push({
71
77
  code: 'text_too_small',
72
78
  nodeId: b.id,
@@ -389,7 +389,10 @@ async function settleLazyImages(page) {
389
389
  */
390
390
  async function settleAnimations(page) {
391
391
  await page
392
- .addStyleTag({ content: '*,*::before,*::after{animation:none !important}' })
392
+ // TRANSITION TOO: an overlay opened just before measuring slides in under
393
+ // its own transition (cart drawer `transform .25s`), and a shot mid-slide
394
+ // measures a box that is not where it ends. `none` jumps to the end value.
395
+ .addStyleTag({ content: '*,*::before,*::after{animation:none !important;transition:none !important}' })
393
396
  .catch(() => { });
394
397
  }
395
398
  async function shootOne(page, url, width, format, opts) {
@@ -456,8 +459,11 @@ async function shootOne(page, url, width, format, opts) {
456
459
  const cs = getComputedStyle(el);
457
460
  const own = (el.textContent ?? '').trim();
458
461
  let layer;
459
- for (let e = el; e && layer === undefined; e = e.parentElement) {
460
- if (!['absolute', 'fixed', 'sticky'].includes(getComputedStyle(e).position))
462
+ let inFixed = false;
463
+ for (let e = el; e && !inFixed; e = e.parentElement) {
464
+ const p = getComputedStyle(e).position;
465
+ inFixed = p === 'fixed';
466
+ if (layer !== undefined || !['absolute', 'fixed', 'sticky'].includes(p))
461
467
  continue;
462
468
  if (!e.id && !anon.has(e))
463
469
  anon.set(e, `@${anon.size}`);
@@ -474,7 +480,8 @@ async function shootOne(page, url, width, format, opts) {
474
480
  hasText: own.length > 0,
475
481
  position: cs.position,
476
482
  ...(layer ? { layer } : {}),
477
- ...(cs.visibility !== 'visible' || el.closest('[aria-hidden="true"]') ? { hidden: true } : {}),
483
+ ...(cs.visibility !== 'visible' ? { hidden: true } : {}),
484
+ ...(inFixed ? { inFixed: true } : {}),
478
485
  };
479
486
  });
480
487
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbuilder-mcp",
3
- "version": "0.100.4",
3
+ "version": "0.100.5",
4
4
  "description": "MCP server that designs and operates a Store Builder site — pages, data, theme and publish — through the platform's own API and live-edit protocol.",
5
5
  "mcpName": "io.github.vuluu2k/sbuilder-mcp",
6
6
  "type": "module",