sbuilder-mcp 0.101.3 → 0.102.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.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,22 @@ 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.102.0] - 2026-10-30
10
+
11
+ ### Added
12
+ - `sb_review` reports a `tag_filters_share_key` finding when two or more tag filters that target the same list write the same `f.tag` URL key, and suggests giving each its own `filterGroupKey` with `filterMatch` set to `any`.
13
+
14
+ ### Changed
15
+ - The generated catalog is regenerated against web_builder v1.0.194.
16
+
17
+ ## [0.101.4] - 2026-10-30
18
+
19
+ ### Added
20
+ - `sb_review` accepts an optional `page_id` and refuses with an error when it is not the open page, and its result names the reviewed page in `page`.
21
+
22
+ ### Fixed
23
+ - `sb_review` scores a button with its own `transparent` background against the real surface behind it instead of the preset's fill, so it no longer reports false low-contrast findings.
24
+
9
25
  ## [0.101.3] - 2026-10-29
10
26
 
11
27
  ### Added
package/CHANGELOG.vi.md CHANGED
@@ -6,6 +6,22 @@ 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.102.0] - 2026-10-30
10
+
11
+ ### Added
12
+ - `sb_review` báo finding `tag_filters_share_key` khi hai bộ lọc thẻ trở lên cùng nhắm một danh sách và dùng chung khóa URL `f.tag`, đồng thời gợi ý đặt `filterGroupKey` riêng cho từng bộ lọc cùng `filterMatch` là `any`.
13
+
14
+ ### Changed
15
+ - Catalog sinh tự động được sinh lại theo web_builder v1.0.194.
16
+
17
+ ## [0.101.4] - 2026-10-30
18
+
19
+ ### Added
20
+ - `sb_review` nhận thêm `page_id` tùy chọn và báo lỗi khi nó không phải trang đang mở, đồng thời kết quả ghi tên trang được review trong `page`.
21
+
22
+ ### Fixed
23
+ - `sb_review` chấm nút có nền `transparent` riêng trên nền thật phía sau thay vì màu nền của preset, nên không còn báo sai lỗi tương phản thấp.
24
+
9
25
  ## [0.101.3] - 2026-10-29
10
26
 
11
27
  ### Added
@@ -1,7 +1,7 @@
1
1
  export const DEAD_KEY_SOURCE = {
2
- "files": 6052,
3
- "identifiers": 111294,
4
- "seededKeys": 460,
2
+ "files": 6066,
3
+ "identifiers": 111445,
4
+ "seededKeys": 461,
5
5
  "dead": 0
6
6
  };
7
7
  /**
@@ -2180,6 +2180,7 @@ export const ELEMENTS = {
2180
2180
  "filterExcluded": [],
2181
2181
  "filterColors": {},
2182
2182
  "filterMatch": "any",
2183
+ "filterGroupKey": "",
2183
2184
  "filterArity": "",
2184
2185
  "filterBehavior": "filter",
2185
2186
  "filterTargets": [],
@@ -2394,6 +2395,7 @@ export const ELEMENTS = {
2394
2395
  "filterExcluded": [],
2395
2396
  "filterColors": {},
2396
2397
  "filterMatch": "any",
2398
+ "filterGroupKey": "",
2397
2399
  "filterArity": "",
2398
2400
  "filterBehavior": "filter",
2399
2401
  "filterTargets": [],
@@ -2609,6 +2611,7 @@ export const ELEMENTS = {
2609
2611
  "filterExcluded": [],
2610
2612
  "filterColors": {},
2611
2613
  "filterMatch": "any",
2614
+ "filterGroupKey": "",
2612
2615
  "filterArity": "",
2613
2616
  "filterBehavior": "filter",
2614
2617
  "filterTargets": [],
@@ -2823,6 +2826,7 @@ export const ELEMENTS = {
2823
2826
  "filterExcluded": [],
2824
2827
  "filterColors": {},
2825
2828
  "filterMatch": "any",
2829
+ "filterGroupKey": "",
2826
2830
  "filterArity": "",
2827
2831
  "filterBehavior": "filter",
2828
2832
  "filterTargets": [],
@@ -36248,6 +36252,7 @@ export const ELEMENTS = {
36248
36252
  "filterSource": "sort",
36249
36253
  "filterValues": [],
36250
36254
  "filterTargets": [],
36255
+ "filterGroupKey": "",
36251
36256
  "placeholder": "",
36252
36257
  "filterBehavior": "filter"
36253
36258
  }
@@ -4,7 +4,7 @@ export const SHAPE_SOURCE = {
4
4
  "fromHandlers": 334,
5
5
  "fromSwaggerOnly": 10,
6
6
  "withReadOnly": 29,
7
- "structsRead": 3482
7
+ "structsRead": 3494
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": "efacb346e41db65b9450504e34c5a5dd8a9f01a1",
5
- "committedAt": "2026-10-30T00:07:45+07:00",
4
+ "commit": "933548d70fed2991e00069b2b3b705870edb8175",
5
+ "committedAt": "2026-10-30T10:19:43+07:00",
6
6
  "dirty": false
7
7
  };
@@ -3,7 +3,7 @@
3
3
  export const TRANSLATION_SOURCE = {
4
4
  "elements": 68,
5
5
  "pairs": 190,
6
- "neverKeys": 183,
6
+ "neverKeys": 184,
7
7
  "entityTypes": 12
8
8
  };
9
9
  /** Every entity type a translation record can name, including "node". */
@@ -421,6 +421,7 @@ export const NEVER_TRANSLATED = [
421
421
  "filterBehavior",
422
422
  "filterColors",
423
423
  "filterExcluded",
424
+ "filterGroupKey",
424
425
  "filterHierarchy",
425
426
  "filterMatch",
426
427
  "filterMaxDepth",
@@ -20,6 +20,8 @@ import { siteToken } from '../../tools/credentialpick.js';
20
20
  * blog/course sources are not covered.
21
21
  */
22
22
  export const FILTER_VALUE_TYPES = new Set(['filter-checkbox', 'filter-radio', 'filter-tag', 'filter-color', 'select']);
23
+ /** web_builder's tag filter group grammar (schema sources.ts TAG_GROUP_RE): `f.tag.<group>=`. */
24
+ export const TAG_GROUP = /^[a-z0-9][a-z0-9_-]{0,31}$/;
23
25
  /** The keys whose change re-derives the rows on sb_set. */
24
26
  export const RESOURCE_KEYS = ['filterSource', 'filterAxis', 'filterRanges'];
25
27
  const CATALOG = new Set(['category', 'brand', 'tag', 'attribute']);
@@ -153,6 +153,9 @@ export const FIX = {
153
153
  'sort gets the six orders, a catalogue source reads the facets, a price filter needs filterRanges. A sort aimed ' +
154
154
  'at a record list takes filterValues [{ "value": "fld_…_asc" | "fld_…_desc", "label": "…", "enabled": true }]; ' +
155
155
  'anything else, write specials.filterValues [{ "value": …, "label": …, "enabled": true }] yourself.',
156
+ tag_filters_share_key: 'Give each tag filter its own group: sb_set id "<id>", namespace specials, keys { "filterGroupKey": "cpu" } ' +
157
+ '(a slug, ^[a-z0-9][a-z0-9_-]{0,31}$ — one per filter: "cpu", "vga", "ram"), and set "filterMatch": "any" so values ' +
158
+ 'OR inside the group. Groups AND with each other, so CPU X + VGA Y narrows to machines holding both.',
156
159
  record_relation_unset: 'Link it to its parent row: sb_set id "<id>", namespace config, keys { "recordRelationField": "fld_…" } — ' +
157
160
  'the ID of a "reference" field in THIS list\'s collection that targets the enclosing list\'s collection ' +
158
161
  '(GET /api/sites/{siteId}/collections/{id}/fields, refCollectionId).',
@@ -1,5 +1,5 @@
1
1
  import { isDeepStrictEqual } from 'node:util';
2
- import { FILTER_VALUE_TYPES, sourceOf } from './filtervalues.js';
2
+ import { FILTER_VALUE_TYPES, TAG_GROUP, sourceOf } from './filtervalues.js';
3
3
  import { childrenOf, childrenWithSatellites, isOverlay, isSharedSection, pageChildren, subtreeIds, appBlockRoot, SPEC_GLOBAL_REF, SPEC_APP_BLOCK_REF } from '../../core/tree.js';
4
4
  import { STUCK_STATE, stickyBlockedBy, stuckHostOf, isPinnedNode } from './sticky.js';
5
5
  import { bandOf, isGlobal } from './traps.js';
@@ -468,6 +468,41 @@ opts = {}) {
468
468
  // shape and is legitimately a list of links; a two-button pair is a call to
469
469
  // action, not a menu. The check that fires on those is one an author learns to
470
470
  // ignore, which costs more than the one it catches.
471
+ // TAG FILTERS SHARING ONE URL KEY (TTG, 2026-10-30): CPU, VGA and RAM tag filters all
472
+ // wrote `f.tag=`, under ONE match mode — OR returned machines with either part, AND
473
+ // emptied the shelf on two CPUs. Since web_builder's tag filter groups each filter owns
474
+ // `f.tag.<filterGroupKey>`: values OR within it, groups AND. Event filters write no URL.
475
+ {
476
+ const byKey = new Map();
477
+ for (const id of walkOrder) {
478
+ const n = d.nodes[id];
479
+ const sp = (n.specials ?? {});
480
+ if (!FILTER_VALUE_TYPES.has(n.data.type) || sourceOf(n.data.type, sp) !== 'tag' || sp.filterBehavior === 'event')
481
+ continue;
482
+ const g = typeof sp.filterGroupKey === 'string' && TAG_GROUP.test(sp.filterGroupKey) ? sp.filterGroupKey : '';
483
+ const targets = [
484
+ ...(typeof sp.filterTarget === 'string' && sp.filterTarget ? [sp.filterTarget] : []),
485
+ ...(Array.isArray(sp.filterTargets) ? sp.filterTargets.filter((t) => typeof t === 'string' && t !== '') : []),
486
+ ];
487
+ const key = g ? `tag.${g}` : 'tag';
488
+ byKey.set(key, [...(byKey.get(key) ?? []), { id, type: n.data.type, targets }]);
489
+ }
490
+ for (const [key, list] of byKey) {
491
+ const overlaps = (a, b) => a.length === 0 || b.length === 0 || a.some((t) => b.includes(t));
492
+ for (let i = 1; i < list.length; i++) {
493
+ if (!list.slice(0, i).some((p) => overlaps(p.targets, list[i].targets)))
494
+ continue;
495
+ out.push({
496
+ code: 'tag_filters_share_key',
497
+ nodeId: list[i].id,
498
+ type: list[i].type,
499
+ problem: `${list.length} tag filters on this page write the same URL key f.${key}, so their values combine under ONE ` +
500
+ 'match mode: OR returns products carrying a value from either filter, AND empties the shelf when a shopper ticks two values of one.',
501
+ fix: fill('tag_filters_share_key', { id: list[i].id }),
502
+ });
503
+ }
504
+ }
505
+ }
471
506
  for (const [containerId, childIds] of [...Object.keys(d.nodes)].map((id) => [id, childrenOf(d, id)])) {
472
507
  if (band.get(containerId) !== 'header')
473
508
  continue;
@@ -92,7 +92,9 @@ export function groundOf(node, theme) {
92
92
  if (own && own !== 'transparent') {
93
93
  return { color: theme ? resolveVars(theme, own) : own, literal: !own.includes('var(') };
94
94
  }
95
- if (!theme)
95
+ // An OWN `transparent` overrides the preset's fill (TTG: header links on
96
+ // button-default's #2e86ae read 2.28:1 while the page showed the bar's #eceef0).
97
+ if (own || !theme)
96
98
  return null;
97
99
  const id = presetIdOf(node);
98
100
  const p = id ? s(findPreset(theme, id)?.base.backgroundColor) : '';
@@ -2038,11 +2038,18 @@ export function registerPageTools(server, ctx) {
2038
2038
  server.registerTool('sb_review', {
2039
2039
  description: 'What a VISITOR would meet on the open page (blank band, placeholder, dead binding) AND ' +
2040
2040
  "what stands between this store and a paid order (checkout page, gateway, delivery, a " +
2041
- 'way back to the cart). Run it before calling a page finished.',
2042
- inputSchema: {},
2041
+ 'cart link). Run it before calling a page done; page_id: only that page.',
2042
+ inputSchema: { page_id: z.string().optional() },
2043
2043
  annotations: { readOnlyHint: true },
2044
- }, async () => {
2044
+ }, async ({ page_id }) => {
2045
2045
  const doc = session.current();
2046
+ // A REVIEW OF THE WRONG PAGE READS AS A CLEAN ONE. Measured on TTG: sb_page_open
2047
+ // batched with sb_review reached the server SECOND (the client's own dispatch,
2048
+ // past serial.ts), and the account page's review was the search page's.
2049
+ const open = session.page()?.pageId;
2050
+ if (page_id && page_id !== open) {
2051
+ throw new Error(`sbuilder: the open page is ${open}, not ${page_id} — call sb_page_open first, then review.`);
2052
+ }
2046
2053
  // THE STORE'S OWN READINESS, which no API exposes and no page document
2047
2054
  // can show. A page can review perfectly clean and still sit on a store
2048
2055
  // with no checkout page, no gateway and no way back to the cart.
@@ -2102,6 +2109,7 @@ export function registerPageTools(server, ctx) {
2102
2109
  // Clean = no finding a visitor meets; `advice` (maintenance) rides beside the verdict.
2103
2110
  const clean = !field.findings;
2104
2111
  return text({
2112
+ page: open,
2105
2113
  ...(clean ? { findings: [], verdict: 'Nothing a visitor would notice on this page.' } : {}),
2106
2114
  ...field,
2107
2115
  ...store,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbuilder-mcp",
3
- "version": "0.101.3",
3
+ "version": "0.102.0",
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",