sbuilder-mcp 0.98.3 → 0.98.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 +23 -0
- package/CHANGELOG.vi.md +23 -0
- package/dist/catalog/element-search.js +10 -3
- package/dist/catalog/fieldskin.generated.js +137 -0
- package/dist/catalog/icons.generated.js +6 -0
- package/dist/domains/site/importmap.js +5 -0
- package/dist/domains/site/readiness-fetch.js +1 -0
- package/dist/domains/site/readiness.js +7 -1
- package/dist/domains/site/review.js +8 -7
- package/dist/domains/site/writecheck.js +94 -24
- package/dist/mcp/serial.js +36 -0
- package/dist/server.js +23 -0
- package/dist/tools/page.js +35 -2
- package/dist/vision/measure.js +6 -0
- package/dist/vision/shoot.js +35 -21
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,29 @@ 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.98.5] - 2026-10-29
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- `sb_look` boxes carry a `layer` field, and a box inside a fixed, sticky or absolute layer is compared for overlap only with boxes in the same layer.
|
|
13
|
+
- `sb_traits_for` lists the skin tables such as `pay_card_skin` that the catalog generates for field controls.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Every tool that touches the open document runs in the order its requests arrive, so concurrent calls no longer interleave.
|
|
17
|
+
- `sb_page_open` is now required before the read commands that work on the open page, which wait for it.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- `sb_publish` reports pages it republished only through the cascade under `cascaded` and keeps their drafts in `unpublished_drafts` until they are published by name, because the cascade no longer hides a draft that is not live.
|
|
21
|
+
- `sb_set` and `sb_add` no longer treat icon-picker control names as config keys, and report `unknown_key` for `config.icon` on an icon element with a pointer to `specials.name`.
|
|
22
|
+
- `seed_override` for `mobile.flexDirection: column` on a flex-block flips a row stored at base, and the importer's packed-row note names the mobile row.
|
|
23
|
+
- `sb_review` no longer flags the merged sign-in and sign-up page on `/account` as a duplicate auth page.
|
|
24
|
+
|
|
25
|
+
## [0.98.4] - 2026-10-29
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- `sb_review` and `sb_add` report `rich_dropped` for `specials.textHtml` links whose `href` hides `javascript:` or `data:` behind numeric or named character references, and no longer flag malformed references such as `javascript&colonalert(1)`.
|
|
29
|
+
- `sb_review` and `sb_add` no longer report `rich_dropped` for a `<!` sequence inside a quoted attribute value or for attributes on a closing tag, and treat `</` followed by a non-letter as a comment.
|
|
30
|
+
- `sb_review` no longer treats `product.priceCents` as filled by a cart line, because each cart line renders a placeholder value for it.
|
|
31
|
+
|
|
9
32
|
## [0.98.3] - 2026-10-28
|
|
10
33
|
|
|
11
34
|
### Fixed
|
package/CHANGELOG.vi.md
CHANGED
|
@@ -6,6 +6,29 @@ 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.98.5] - 2026-10-29
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Hộp trong `sb_look` có thêm trường `layer`, và hộp nằm trong lớp fixed, sticky hoặc absolute chỉ được so overlap với hộp cùng lớp.
|
|
13
|
+
- `sb_traits_for` liệt kê các bảng skin như `pay_card_skin` mà catalog sinh ra cho các control của field.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Mọi tool chạm vào tài liệu đang mở chạy theo đúng thứ tự request tới, nên các lời gọi đồng thời không còn xen kẽ nhau.
|
|
17
|
+
- `sb_page_open` giờ là điều kiện trước của các lệnh đọc trên trang đang mở, và các lệnh đó chờ nó hoàn tất.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- `sb_publish` báo các trang chỉ được publish lại qua cascade trong `cascaded` và giữ bản nháp của chúng trong `unpublished_drafts` cho tới khi publish đích danh, vì cascade không còn che bản nháp chưa lên live.
|
|
21
|
+
- `sb_set` và `sb_add` không còn coi tên control của bộ chọn icon là config key, và báo `unknown_key` cho `config.icon` trên phần tử icon kèm gợi ý dùng `specials.name`.
|
|
22
|
+
- `seed_override` cho `mobile.flexDirection: column` trên flex-block lật hàng đang ghi ở base, và ghi chú hàng packed của importer nói rõ hàng mobile.
|
|
23
|
+
- `sb_review` không còn báo trang `/account` gộp đăng nhập và đăng ký là trang auth trùng lặp.
|
|
24
|
+
|
|
25
|
+
## [0.98.4] - 2026-10-29
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
- `sb_review` và `sb_add` báo `rich_dropped` cho liên kết trong `specials.textHtml` có `href` giấu `javascript:` hoặc `data:` sau tham chiếu ký tự số hoặc tên, và không còn báo nhầm các tham chiếu sai cú pháp như `javascript&colonalert(1)`.
|
|
29
|
+
- `sb_review` và `sb_add` không còn báo `rich_dropped` cho chuỗi `<!` nằm trong giá trị thuộc tính có ngoặc hoặc cho thuộc tính trên thẻ đóng, và coi `</` theo sau bởi ký tự không phải chữ là comment.
|
|
30
|
+
- `sb_review` không còn coi `product.priceCents` là key được dòng giỏ hàng điền, vì mỗi dòng hiển thị giá trị placeholder cho key này.
|
|
31
|
+
|
|
9
32
|
## [0.98.3] - 2026-10-28
|
|
10
33
|
|
|
11
34
|
### Fixed
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ELEMENTS, TRAIT_WRITES, WRITE_PRECONDITIONS } from './elements.generated.js';
|
|
2
2
|
import { FORM_TEMPLATES } from './checkout.generated.js';
|
|
3
|
+
import { FIELD_SKIN_BY_CONTROL } from './fieldskin.generated.js';
|
|
3
4
|
import { isBaseOnlyConfig } from '../domains/site/baseonly.js';
|
|
4
5
|
import { bindableFields } from '../domains/site/writecheck.js';
|
|
5
6
|
import { animationValues, animationVocabulary, elementVocabularies, sharedVocabularies, vocabulariesForWrites, } from '../domains/site/vocabulary.js';
|
|
@@ -234,6 +235,11 @@ export function searchWithTemplates(query, elements) {
|
|
|
234
235
|
*/
|
|
235
236
|
export function describeControl(key) {
|
|
236
237
|
const d = TRAIT_WRITES[key];
|
|
238
|
+
// A skin panel is one FieldSkinRows widget over one knob table — generated,
|
|
239
|
+
// so it is declared even though the trait registry never names it.
|
|
240
|
+
const skin = FIELD_SKIN_BY_CONTROL[key];
|
|
241
|
+
if (!d && skin)
|
|
242
|
+
return { writes: skin.map((k) => ({ target: 'config', writeKey: k })) };
|
|
237
243
|
if (!d) {
|
|
238
244
|
return {
|
|
239
245
|
writes: null,
|
|
@@ -279,10 +285,11 @@ export function traitsFor(type, control) {
|
|
|
279
285
|
].filter((k) => isBaseOnlyConfig(type, k));
|
|
280
286
|
const declared = {};
|
|
281
287
|
for (const c of el.controls) {
|
|
282
|
-
|
|
288
|
+
const desc = describeControl(c);
|
|
289
|
+
if (!desc.writes)
|
|
283
290
|
continue;
|
|
284
|
-
const base =
|
|
285
|
-
declared[c] = { ...
|
|
291
|
+
const base = desc.writes.some((w) => w.target === 'config' && isBaseOnlyConfig(type, w.writeKey));
|
|
292
|
+
declared[c] = { ...desc, ...(base ? { responsive: false } : {}) };
|
|
286
293
|
}
|
|
287
294
|
const preconditions = WRITE_PRECONDITIONS.filter((p) => p.types.includes(type)).map(({ types: _, ...p }) => p);
|
|
288
295
|
const bindable = bindableFields(type);
|
|
@@ -310,3 +310,140 @@ export const FIELD_SKIN_BY_NODE = {
|
|
|
310
310
|
"panelShadowColor"
|
|
311
311
|
]
|
|
312
312
|
};
|
|
313
|
+
/**
|
|
314
|
+
* The config keys each skin CONTROL writes — one `FieldSkinRows` widget over one
|
|
315
|
+
* knob table (`editor/src/trait/widgets.ts`). The trait registry describes none
|
|
316
|
+
* of these controls, so without this `sb_traits_for` called them undeclared.
|
|
317
|
+
*/
|
|
318
|
+
export const FIELD_SKIN_BY_CONTROL = {
|
|
319
|
+
"field_skin": [
|
|
320
|
+
"fieldBg",
|
|
321
|
+
"fieldBorderColor",
|
|
322
|
+
"fieldBorderWidth",
|
|
323
|
+
"fieldRadius",
|
|
324
|
+
"fieldPadY",
|
|
325
|
+
"fieldPadX"
|
|
326
|
+
],
|
|
327
|
+
"field_text_skin": [
|
|
328
|
+
"fieldTextColor",
|
|
329
|
+
"fieldFontSize",
|
|
330
|
+
"fieldPlaceholderColor"
|
|
331
|
+
],
|
|
332
|
+
"field_state_skin": [
|
|
333
|
+
"fieldFocusColor",
|
|
334
|
+
"fieldErrorColor"
|
|
335
|
+
],
|
|
336
|
+
"field_area_skin": [
|
|
337
|
+
"fieldAreaMinHeight"
|
|
338
|
+
],
|
|
339
|
+
"search_panel_skin": [
|
|
340
|
+
"panelBg",
|
|
341
|
+
"panelBorderColor",
|
|
342
|
+
"panelBorderWidth",
|
|
343
|
+
"panelRadius",
|
|
344
|
+
"panelOffset"
|
|
345
|
+
],
|
|
346
|
+
"search_panel_shadow": [
|
|
347
|
+
"panelShadowY",
|
|
348
|
+
"panelShadowBlur",
|
|
349
|
+
"panelShadowColor"
|
|
350
|
+
],
|
|
351
|
+
"form_message_skin": [
|
|
352
|
+
"formSentColor",
|
|
353
|
+
"formSentSize",
|
|
354
|
+
"formErrorSize"
|
|
355
|
+
],
|
|
356
|
+
"radio_skin": [
|
|
357
|
+
"choiceRowGap",
|
|
358
|
+
"choiceColGap",
|
|
359
|
+
"choiceGap",
|
|
360
|
+
"choiceSize",
|
|
361
|
+
"choiceBorderWidth",
|
|
362
|
+
"choiceBorderColor",
|
|
363
|
+
"choiceBg",
|
|
364
|
+
"choiceAccent",
|
|
365
|
+
"choiceTextColor",
|
|
366
|
+
"choiceFontSize",
|
|
367
|
+
"choiceDot"
|
|
368
|
+
],
|
|
369
|
+
"checkbox_skin": [
|
|
370
|
+
"choiceRowGap",
|
|
371
|
+
"choiceColGap",
|
|
372
|
+
"choiceGap",
|
|
373
|
+
"choiceSize",
|
|
374
|
+
"choiceBorderWidth",
|
|
375
|
+
"choiceBorderColor",
|
|
376
|
+
"choiceBg",
|
|
377
|
+
"choiceAccent",
|
|
378
|
+
"choiceTextColor",
|
|
379
|
+
"choiceFontSize",
|
|
380
|
+
"choiceRadius",
|
|
381
|
+
"choiceMarkWidth"
|
|
382
|
+
],
|
|
383
|
+
"timeslot_skin": [
|
|
384
|
+
"slotBg",
|
|
385
|
+
"slotBorderColor",
|
|
386
|
+
"slotBorderWidth",
|
|
387
|
+
"slotRadius",
|
|
388
|
+
"slotPadY",
|
|
389
|
+
"slotPadX",
|
|
390
|
+
"slotGap",
|
|
391
|
+
"slotMinWidth",
|
|
392
|
+
"slotMinHeight",
|
|
393
|
+
"slotAccent",
|
|
394
|
+
"slotHoverColor",
|
|
395
|
+
"slotSelectedWeight",
|
|
396
|
+
"slotTextColor",
|
|
397
|
+
"slotFontSize"
|
|
398
|
+
],
|
|
399
|
+
"slot_marker_skin": [
|
|
400
|
+
"slotMarkerSize",
|
|
401
|
+
"slotMarkerDot",
|
|
402
|
+
"slotMarkerGap"
|
|
403
|
+
],
|
|
404
|
+
"file_skin": [
|
|
405
|
+
"fileGap",
|
|
406
|
+
"filePlaceholderWeight"
|
|
407
|
+
],
|
|
408
|
+
"field_chrome": [
|
|
409
|
+
"fieldStackGap",
|
|
410
|
+
"fieldReqColor",
|
|
411
|
+
"fieldHintOpacity",
|
|
412
|
+
"fieldLabelColor",
|
|
413
|
+
"fieldLabelSize",
|
|
414
|
+
"fieldLabelWeight",
|
|
415
|
+
"fieldHintColor",
|
|
416
|
+
"fieldHintSize",
|
|
417
|
+
"fieldLabelPosition",
|
|
418
|
+
"fieldLabelPosition",
|
|
419
|
+
"fieldLabelPosition",
|
|
420
|
+
"fieldLabelPosition",
|
|
421
|
+
"fieldLabelWidth"
|
|
422
|
+
],
|
|
423
|
+
"pay_card_skin": [
|
|
424
|
+
"payCardBg",
|
|
425
|
+
"payCardBorderColor",
|
|
426
|
+
"payCardBorderWidth",
|
|
427
|
+
"payCardRadius",
|
|
428
|
+
"payCardPadY",
|
|
429
|
+
"payCardPadX",
|
|
430
|
+
"payCardGap",
|
|
431
|
+
"payCardRowGap"
|
|
432
|
+
],
|
|
433
|
+
"pay_state_skin": [
|
|
434
|
+
"payCardAccent",
|
|
435
|
+
"payCardSelectedBg",
|
|
436
|
+
"payCardHoverColor",
|
|
437
|
+
"payCardHoverBg"
|
|
438
|
+
],
|
|
439
|
+
"pay_text_skin": [
|
|
440
|
+
"payCardText",
|
|
441
|
+
"payCardNameWeight",
|
|
442
|
+
"payCardDescOpacity",
|
|
443
|
+
"payCardBodyGap"
|
|
444
|
+
],
|
|
445
|
+
"pay_marker_skin": [
|
|
446
|
+
"payMarkerSize",
|
|
447
|
+
"payMarkerDot"
|
|
448
|
+
]
|
|
449
|
+
};
|
|
@@ -114,3 +114,9 @@ export const ICON_KEYS = {
|
|
|
114
114
|
}
|
|
115
115
|
]
|
|
116
116
|
};
|
|
117
|
+
/**
|
|
118
|
+
* Every inspector control that IS an icon picker (`widgets.ts`). Its name is a
|
|
119
|
+
* WIDGET, not a key: the `icon` control writes `specials.name` on an `icon`,
|
|
120
|
+
* so `config.icon` there is stored and read by nothing (the star renders).
|
|
121
|
+
*/
|
|
122
|
+
export const ICON_CONTROLS = ["breadcrumb_icon", "button_icon", "chat_launcher_icon", "divider_icon", "field_icon", "icon", "list_dataset_nav", "list_item_icon", "popup_close"];
|
|
@@ -558,6 +558,11 @@ function shape(c, t) {
|
|
|
558
558
|
gap: '24px',
|
|
559
559
|
...(c.align === 'center' ? { justifyContent: 'center' } : {}),
|
|
560
560
|
},
|
|
561
|
+
// SAID AT MOBILE because `flex-block` SEEDS `mobile.flexDirection:
|
|
562
|
+
// column`, which this row's base `row` does not reach — so every
|
|
563
|
+
// packed row (a menu, a pair of buttons) stacked at 390 instead of
|
|
564
|
+
// wrapping, the opposite of what the comment above promises (TTG #26).
|
|
565
|
+
responsive: { mobile: { style: { flexDirection: 'row' } } },
|
|
561
566
|
// `width: auto` IS THE LOAD-BEARING HALF, and leaving it out looked
|
|
562
567
|
// like the whole idea had failed. `flex-block` seeds `width: 100%`
|
|
563
568
|
// from its element defaults, and `flex: 0 0 auto` only says "do not
|
|
@@ -151,6 +151,7 @@ export async function gatherReadiness(ctx, siteId, pageNodes, openPageId) {
|
|
|
151
151
|
pages: pageList?.pages ?? null,
|
|
152
152
|
menuLinks,
|
|
153
153
|
openPageType: open && open.isDefaultTemplate !== false ? open.type : undefined,
|
|
154
|
+
openType: open?.type,
|
|
154
155
|
products,
|
|
155
156
|
liveGateways,
|
|
156
157
|
shippingMethods,
|
|
@@ -389,8 +389,14 @@ export function readinessGaps(input) {
|
|
|
389
389
|
//
|
|
390
390
|
// COUNTED BY DISTINCT TYPE, not by how many form nodes there are. A form split
|
|
391
391
|
// across segments is several nodes of ONE type and is not this defect.
|
|
392
|
+
//
|
|
393
|
+
// NOT ON /account (TTG gap #28): the platform sends both jobs THERE — a
|
|
394
|
+
// members-only page redirects an anonymous visitor to /account
|
|
395
|
+
// (storefront/membersonly.go), and a form-link to the login or register page
|
|
396
|
+
// TYPE with no such page lands on "/account — the account page every store
|
|
397
|
+
// has, which carries its own sign-in and sign-up" (storefront/pagetyperoute.go).
|
|
392
398
|
const authTypes = new Set(['login', 'register', 'forgot', 'reset', 'verify']);
|
|
393
|
-
if (input.forms && input.forms.length > 0) {
|
|
399
|
+
if (input.forms && input.forms.length > 0 && input.openType !== 'account') {
|
|
394
400
|
const typeOf = new Map(input.forms
|
|
395
401
|
.filter((f) => !!f?.id && !!f?.type)
|
|
396
402
|
.map((f) => [f.id, f.type]));
|
|
@@ -188,12 +188,13 @@ const RECORD_ENTITIES = new Set(['product', 'category', 'course', 'article', 'bl
|
|
|
188
188
|
/** A record only one element type's rows supply, which is not a dataset repeater. */
|
|
189
189
|
const ROW_SUPPLIER = { cartLine: 'cart-order' };
|
|
190
190
|
/**
|
|
191
|
-
* The product keys a cart line
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* product
|
|
191
|
+
* The product keys a cart line drives per line. Only cart-order paints its row
|
|
192
|
+
* (cart-order/html.go: kids[0] + PlaceholderCartLine), and only these plus the
|
|
193
|
+
* stepper get a row directive (render/html.go rowDirectiveFor). CartLineContext
|
|
194
|
+
* fills product.priceCents too, but no directive carries it, so an element bound
|
|
195
|
+
* to it alone keeps the placeholder line's value on every line.
|
|
195
196
|
*/
|
|
196
|
-
const CART_LINE_KEYS = new Set(['product.title', 'product.image', 'product.price'
|
|
197
|
+
const CART_LINE_KEYS = new Set(['product.title', 'product.image', 'product.price']);
|
|
197
198
|
/** Does this node sit inside an element of `type`? */
|
|
198
199
|
function insideType(d, id, type) {
|
|
199
200
|
for (let x = d.nodes[id]?.data.parent; x && d.nodes[x]; x = d.nodes[x].data.parent) {
|
|
@@ -613,8 +614,8 @@ opts = {}) {
|
|
|
613
614
|
if (opts.pageType !== undefined && !inRepeater.get(id) && !inOverlay.has(id)) {
|
|
614
615
|
const entities = PAGE_ENTITIES[opts.pageType] ?? [];
|
|
615
616
|
const sources = (n.bindings ?? []).map((b) => String(b?.source ?? ''));
|
|
616
|
-
// A CART LINE
|
|
617
|
-
// product.title/image/price
|
|
617
|
+
// A CART LINE DRIVES SOME PRODUCT KEYS: `rowDirectiveFor` carries
|
|
618
|
+
// product.title/image/price per line rather than a cartLine.*
|
|
618
619
|
// twin. A node the line drives (one of those, or the row's own stepper)
|
|
619
620
|
// is supplied; its seeded extras (compareAtPrice, product.id) render
|
|
620
621
|
// empty in a line, which is what the platform's own drawer seed ships.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BASE_ONLY_CONFIG, BOUND_SPECIALS, CONFIG_VALUES, ELEMENT_VALUES, ELEMENTS, HOVER_HOMES, SATELLITE_RULES, TRAIT_WRITES, WRITE_PRECONDITIONS, } from '../../catalog/elements.generated.js';
|
|
2
|
-
import { FIELD_SKIN_BY_NODE } from '../../catalog/fieldskin.generated.js';
|
|
2
|
+
import { FIELD_SKIN_BY_CONTROL, FIELD_SKIN_BY_NODE } from '../../catalog/fieldskin.generated.js';
|
|
3
3
|
import { FORM_RULE_VOCAB } from '../../catalog/formrules.generated.js';
|
|
4
4
|
import { fill } from './findings.js';
|
|
5
5
|
import { collectsValue, formFieldFindings, formFields, nameFromLabel } from './formdoc.js';
|
|
6
|
-
import { ICON_KEYS } from '../../catalog/icons.generated.js';
|
|
6
|
+
import { ICON_CONTROLS, ICON_KEYS } from '../../catalog/icons.generated.js';
|
|
7
7
|
import { TRANSLATABLE_SPECIALS } from '../../catalog/translations.generated.js';
|
|
8
8
|
import { INLINE_RICH } from '../../catalog/richtext.generated.js';
|
|
9
9
|
import { iconNote } from './icons.js';
|
|
@@ -74,9 +74,13 @@ function keysOf(type) {
|
|
|
74
74
|
add('specials', TRANSLATABLE_SPECIALS[type]);
|
|
75
75
|
// A control the trait registry does not describe is often an inspector row
|
|
76
76
|
// named after the key it writes (`{ key: 'quickviewId', visible: false }` on
|
|
77
|
-
// list-dataset), so its NAME counts as a key in either namespace
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
// list-dataset), so its NAME counts as a key in either namespace — unless the
|
|
78
|
+
// control is a WIDGET whose writes are generated: the `icon` picker writes
|
|
79
|
+
// `specials.name`, so counting `icon` made `config.icon` look known and the
|
|
80
|
+
// star rendered (TTG gap #24).
|
|
81
|
+
const named = el.controls.filter((c) => !ICON_CONTROLS.includes(c) && !FIELD_SKIN_BY_CONTROL[c]);
|
|
82
|
+
add('config', named);
|
|
83
|
+
add('specials', named);
|
|
80
84
|
for (const v of [...Object.values(ELEMENT_VALUES[type] ?? {}), ...Object.values(ELEMENT_VALUES['*'] ?? {})]) {
|
|
81
85
|
add(v.target, [v.writeKey]);
|
|
82
86
|
}
|
|
@@ -130,40 +134,82 @@ function richOffenders(v) {
|
|
|
130
134
|
const tags = INLINE_RICH.tags;
|
|
131
135
|
const globalAttrs = INLINE_RICH.globalAttrs;
|
|
132
136
|
const tagAttrs = INLINE_RICH.tagAttrs;
|
|
133
|
-
|
|
137
|
+
const TAG = /<(\/?)([a-zA-Z][\w-]*)((?:"[^"]*"|'[^']*'|[^"'>])*)>/g;
|
|
138
|
+
// Go reads `<!`, `<?` and `</` + a non-letter as a comment — but only in
|
|
139
|
+
// TEXT, so tags (and the quoted values inside them) are blanked first.
|
|
140
|
+
if (/<[!?]|<\/[^a-zA-Z]/.test(v.replace(TAG, ' ')))
|
|
134
141
|
out.add('<!-- -->');
|
|
135
|
-
for (const m of v.matchAll(
|
|
136
|
-
const tag = m[
|
|
142
|
+
for (const m of v.matchAll(TAG)) {
|
|
143
|
+
const tag = m[2].toLowerCase();
|
|
137
144
|
if (!tags.includes(tag)) {
|
|
138
145
|
out.add(`<${tag}>`);
|
|
139
146
|
continue;
|
|
140
147
|
}
|
|
141
|
-
for
|
|
148
|
+
// The tokenizer returns no attributes for an END tag (TagAttr).
|
|
149
|
+
if (m[1])
|
|
150
|
+
continue;
|
|
151
|
+
for (const a of m[3].matchAll(/([^\s=/>"']+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g)) {
|
|
142
152
|
const name = a[1].toLowerCase();
|
|
143
|
-
|
|
144
|
-
if (!globalAttrs.includes(name) && !tagAttrs[tag]?.includes(name))
|
|
153
|
+
if (!globalAttrs.includes(name) && !tagAttrs[tag]?.includes(name)) {
|
|
145
154
|
out.add(`<${tag} ${name}>`);
|
|
146
|
-
|
|
147
|
-
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
const scheme = name === 'href' ? unsafeScheme(a[2] ?? a[3] ?? a[4] ?? '') : null;
|
|
158
|
+
if (scheme !== null)
|
|
159
|
+
out.add(`<${tag} href="${scheme}:…">`);
|
|
148
160
|
}
|
|
149
161
|
}
|
|
150
162
|
return [...out];
|
|
151
163
|
}
|
|
152
|
-
/**
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
164
|
+
/**
|
|
165
|
+
* The named references whose decoding can move safeURL's verdict — every entry
|
|
166
|
+
* of x/net/html's table (v0.56.0) that yields `:` `/` `?` `#` or a character
|
|
167
|
+
* strings.TrimSpace strips. Any other reference changes no verdict: undecoded
|
|
168
|
+
* or decoded, it is not a scheme letter, so leaving it verbatim is exact.
|
|
169
|
+
*/
|
|
170
|
+
const VERDICT_ENTITIES = {
|
|
171
|
+
'colon;': ':', 'sol;': '/', 'quest;': '?', 'num;': '#', 'Tab;': '\t', 'NewLine;': '\n',
|
|
172
|
+
'nbsp;': '\u00a0', nbsp: '\u00a0', 'NonBreakingSpace;': '\u00a0', 'ensp;': '\u2002', 'emsp;': '\u2003',
|
|
173
|
+
'emsp13;': '\u2004', 'emsp14;': '\u2005', 'numsp;': '\u2007', 'puncsp;': '\u2008', 'thinsp;': '\u2009',
|
|
174
|
+
'ThinSpace;': '\u2009', 'hairsp;': '\u200a', 'VeryThinSpace;': '\u200a', 'MediumSpace;': '\u205f',
|
|
175
|
+
'ThickSpace;': '\u205f\u200a',
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* html.unescape(val, attribute=true), one pass: a numeric reference with or
|
|
179
|
+
* without `;`; a named one only as spelled in the table, and one with no `;`
|
|
180
|
+
* left alone when `=` follows (unescapeEntity's attribute rule).
|
|
181
|
+
*/
|
|
182
|
+
function unescapeAttr(s) {
|
|
183
|
+
return s.replace(/&(?:#[xX]([0-9a-fA-F]+);?|#(\d+);?|([a-zA-Z0-9]+;?))/g, (all, hex, dec, name, at) => {
|
|
184
|
+
if (name !== undefined) {
|
|
185
|
+
const ch = VERDICT_ENTITIES[name];
|
|
186
|
+
return ch === undefined || (!name.endsWith(';') && s[at + all.length] === '=') ? all : ch;
|
|
187
|
+
}
|
|
188
|
+
const x = parseInt(hex ?? dec, hex ? 16 : 10);
|
|
189
|
+
// 0x80–0x9F is remapped through Windows-1252 in Go; no target is a verdict
|
|
190
|
+
// character, so the replacement character stands in for all of them.
|
|
191
|
+
const bad = x === 0 || (x >= 0x80 && x <= 0x9f) || (x >= 0xd800 && x <= 0xdfff) || x > 0x10ffff;
|
|
192
|
+
return String.fromCodePoint(bad ? 0xfffd : x);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/** strings.TrimSpace's set (unicode.IsSpace) — U+0085 in, U+FEFF out, unlike String#trim. */
|
|
196
|
+
const GO_TRIM = /^[\t\n\v\f\r \u0085\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]+|[\t\n\v\f\r \u0085\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000]+$/g;
|
|
197
|
+
/**
|
|
198
|
+
* server/pkg/sanitize safeURL on the value the tokenizer hands it: null when
|
|
199
|
+
* relative, http(s), mailto, tel or data:image/; else the decoded scheme.
|
|
200
|
+
*/
|
|
201
|
+
function unsafeScheme(raw) {
|
|
202
|
+
const t = unescapeAttr(raw).replace(GO_TRIM, '');
|
|
157
203
|
const colon = t.indexOf(':');
|
|
158
204
|
if (colon < 0)
|
|
159
|
-
return
|
|
205
|
+
return null;
|
|
160
206
|
const i = t.search(/[/?#]/);
|
|
161
207
|
if (i >= 0 && i < colon)
|
|
162
|
-
return
|
|
208
|
+
return null;
|
|
163
209
|
const scheme = t.slice(0, colon).toLowerCase();
|
|
164
210
|
if (['http', 'https', 'mailto', 'tel'].includes(scheme))
|
|
165
|
-
return
|
|
166
|
-
return scheme === 'data' && t.toLowerCase().startsWith('data:image/');
|
|
211
|
+
return null;
|
|
212
|
+
return scheme === 'data' && t.toLowerCase().startsWith('data:image/') ? null : t.slice(0, colon);
|
|
167
213
|
}
|
|
168
214
|
/**
|
|
169
215
|
* Check one write. `specials` is the node's specials AS THEY WILL BE after the
|
|
@@ -187,8 +233,10 @@ export function writeCheck(type, namespace, keys, opts = {}) {
|
|
|
187
233
|
'declared controls or any generated vocabulary. It is stored as written; if nothing reads ' +
|
|
188
234
|
'it, the write changes nothing on the page.', ks[other].has(k)
|
|
189
235
|
? `${type} reads ${other}.${k} — write it in namespace "${other}".`
|
|
190
|
-
:
|
|
191
|
-
|
|
236
|
+
: /icon/i.test(k) && ICON_KEYS[type]?.length
|
|
237
|
+
? `${type} keeps its glyph in ${ICON_KEYS[type].map((i) => `${i.ns}.${i.key}`).join(' / ')} — write the icon name there.`
|
|
238
|
+
: `Check the spelling against sb_traits_for "${type}"; a CSS property belongs in namespace ` +
|
|
239
|
+
'"style". Ignore this if the key is newer than this catalog.');
|
|
192
240
|
continue;
|
|
193
241
|
}
|
|
194
242
|
const icon = iconNote(type, namespace, k, v);
|
|
@@ -416,6 +464,28 @@ export function specCheck(spec, idOf) {
|
|
|
416
464
|
}
|
|
417
465
|
if (s.specials)
|
|
418
466
|
out.push(...writeCheck(s.type, 'specials', s.specials, { specials: { ...born, ...s.specials } }));
|
|
467
|
+
// The element's OWN seed flipping the axis the caller wrote at base, at a
|
|
468
|
+
// width the caller left unsaid: flex-block seeds `mobile.flexDirection:
|
|
469
|
+
// column` (the editor drops it the same way), so a row written at base
|
|
470
|
+
// stacks at 390 (TTG gap #26). The axis only — a seeded mobile gap is spacing.
|
|
471
|
+
for (const [bp, slot] of Object.entries((d?.responsive ?? {}))) {
|
|
472
|
+
for (const [k, v] of Object.entries(slot?.style ?? {})) {
|
|
473
|
+
if (k !== 'flexDirection' || !s.style || !(k in s.style) || s.style[k] === v)
|
|
474
|
+
continue;
|
|
475
|
+
if ((s.responsive?.[bp]?.style ?? {})[k] !== undefined)
|
|
476
|
+
continue;
|
|
477
|
+
out.push({
|
|
478
|
+
once: `seed-override:${s.type}.${bp}.${k}`,
|
|
479
|
+
note: {
|
|
480
|
+
code: 'seed_override',
|
|
481
|
+
...(id ? { id } : {}),
|
|
482
|
+
key: `style.${k}`,
|
|
483
|
+
problem: `${s.type} seeds responsive.${bp}.style.${k} = ${JSON.stringify(v)} (as the editor does), so the ${JSON.stringify(s.style[k])} written at base does not hold at ${bp}.`,
|
|
484
|
+
fix: `If it should, say it: responsive: { ${bp}: { style: { ${k}: ${JSON.stringify(s.style[k])} } } } in the spec, or sb_set breakpoint "${bp}".`,
|
|
485
|
+
},
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
}
|
|
419
489
|
for (const c of s.children ?? [])
|
|
420
490
|
walk(c);
|
|
421
491
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CallToolRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* ONE OPEN DOCUMENT, ONE CALL AT A TIME, IN ARRIVAL ORDER.
|
|
4
|
+
*
|
|
5
|
+
* `PageSession` holds a single open document, and `sb_page_open` replaces it
|
|
6
|
+
* only once its source read answers. A client batching `sb_page_open X` with
|
|
7
|
+
* `sb_outline` / `sb_node_read` ran the read in that gap and answered from the
|
|
8
|
+
* PREVIOUS page — measured on TTG (gap #30): the checkout form's outline after
|
|
9
|
+
* opening /tao-tai-khoan. Two parallel writes race the same way on one save.
|
|
10
|
+
*
|
|
11
|
+
* The slot is taken where the REQUEST arrives, not in the tool callback: the
|
|
12
|
+
* SDK validates arguments asynchronously first, and a schema that takes more
|
|
13
|
+
* ticks (sb_page_open's) let a later sb_outline enter its callback earlier.
|
|
14
|
+
* Tools in `free` touch no open document (the catalog, the API sheet, the media
|
|
15
|
+
* library) and stay parallel. Call before the first `registerTool`, which is
|
|
16
|
+
* when McpServer installs its `tools/call` handler.
|
|
17
|
+
*
|
|
18
|
+
* ponytail: one FIFO for every session tool, so a slow sb_look delays the next
|
|
19
|
+
* sb_set; a per-document lock only matters if two documents are ever open.
|
|
20
|
+
*/
|
|
21
|
+
export function serializeToolCalls(server, free) {
|
|
22
|
+
let tail = Promise.resolve();
|
|
23
|
+
const inner = server.server;
|
|
24
|
+
const set = inner.setRequestHandler.bind(inner);
|
|
25
|
+
inner.setRequestHandler = ((schema, handler) => {
|
|
26
|
+
if (schema !== CallToolRequestSchema)
|
|
27
|
+
return set(schema, handler);
|
|
28
|
+
return set(schema, ((req, extra) => {
|
|
29
|
+
if (free(req.params.name))
|
|
30
|
+
return handler(req, extra);
|
|
31
|
+
const run = tail.then(() => handler(req, extra));
|
|
32
|
+
tail = run.catch(() => undefined);
|
|
33
|
+
return run;
|
|
34
|
+
}));
|
|
35
|
+
});
|
|
36
|
+
}
|
package/dist/server.js
CHANGED
|
@@ -18,6 +18,7 @@ import { registerImportTools } from './tools/importpage.js';
|
|
|
18
18
|
import { registerUndoTools } from './tools/undo.js';
|
|
19
19
|
import { registerThemeTools } from './tools/theme.js';
|
|
20
20
|
import { registerTranslateTools } from './tools/translate.js';
|
|
21
|
+
import { serializeToolCalls } from './mcp/serial.js';
|
|
21
22
|
/**
|
|
22
23
|
* Sent on every handshake, so it is short, and says nothing a tool description
|
|
23
24
|
* already says. Counts come from the generated source records, never literals.
|
|
@@ -48,6 +49,25 @@ export function pkgVersion() {
|
|
|
48
49
|
return '0.0.0';
|
|
49
50
|
}
|
|
50
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Tools that never touch the open document, so they need not wait their turn.
|
|
54
|
+
* Anything not named here is serialized — the safe default for a new tool.
|
|
55
|
+
*/
|
|
56
|
+
const SESSION_FREE = new Set([
|
|
57
|
+
'sb_connect',
|
|
58
|
+
'sb_site_list',
|
|
59
|
+
'sb_api_find',
|
|
60
|
+
'sb_api_call',
|
|
61
|
+
'sb_page_update',
|
|
62
|
+
'sb_code',
|
|
63
|
+
'sb_theme',
|
|
64
|
+
'sb_catalog_search',
|
|
65
|
+
'sb_traits_for',
|
|
66
|
+
'sb_templates',
|
|
67
|
+
'sb_page_list',
|
|
68
|
+
'sb_media_list',
|
|
69
|
+
'sb_media_upload',
|
|
70
|
+
]);
|
|
51
71
|
export function buildContext() {
|
|
52
72
|
const base = process.env.SB_API ?? 'http://localhost:8080';
|
|
53
73
|
return {
|
|
@@ -70,6 +90,9 @@ export function createServer(ctx = buildContext()) {
|
|
|
70
90
|
server.server.oninitialized = () => {
|
|
71
91
|
setAgentClient(server.server.getClientVersion(), pkgVersion());
|
|
72
92
|
};
|
|
93
|
+
// Every tool that can reach the open document runs in arrival order — see
|
|
94
|
+
// mcp/serial.ts. Before the first registerTool, which installs tools/call.
|
|
95
|
+
serializeToolCalls(server, (name) => SESSION_FREE.has(name));
|
|
73
96
|
registerSessionTools(server, ctx);
|
|
74
97
|
registerApiTools(server, ctx);
|
|
75
98
|
const pageSession = registerPageTools(server, ctx);
|
package/dist/tools/page.js
CHANGED
|
@@ -2591,6 +2591,16 @@ export function registerPageTools(server, ctx) {
|
|
|
2591
2591
|
: {}),
|
|
2592
2592
|
});
|
|
2593
2593
|
});
|
|
2594
|
+
// DRAFTS A CASCADE HID, per site, for this process (TTG gap #27). A cascade
|
|
2595
|
+
// re-renders a live page from the version it LAST published (the platform's
|
|
2596
|
+
// publishSourceFor, by design) and writes a fresh published row — and the
|
|
2597
|
+
// page list's `publishedAt` is denormalised from that row, so the draft that
|
|
2598
|
+
// did NOT go live now reads older than "published". Remembered here until the
|
|
2599
|
+
// page is published by name.
|
|
2600
|
+
// ponytail: in-process; a new process sees only timestamps again. Exact would
|
|
2601
|
+
// compare each page's updatedAt with its live version's createdAt
|
|
2602
|
+
// (GET …/versions, isLive) — a heavy listing per page.
|
|
2603
|
+
const cascadeMasked = new Map();
|
|
2594
2604
|
server.registerTool('sb_publish', {
|
|
2595
2605
|
description: 'Compile the draft into the live page, and report which revision went live (id, ' +
|
|
2596
2606
|
'publishedAt, fromVersionId). PUBLISH CASCADES: a page sharing a global section with ' +
|
|
@@ -2641,6 +2651,10 @@ export function registerPageTools(server, ctx) {
|
|
|
2641
2651
|
});
|
|
2642
2652
|
const state = (p) => driftOf(p.updatedAt, p.publishedAt).state;
|
|
2643
2653
|
drafts = others.filter((p) => state(p) === 'draft_ahead').map(row);
|
|
2654
|
+
for (const m of cascadeMasked.get(site_id)?.values() ?? []) {
|
|
2655
|
+
if (m.pageId !== page_id && !drafts.some((d) => d.pageId === m.pageId))
|
|
2656
|
+
drafts.push(m);
|
|
2657
|
+
}
|
|
2644
2658
|
const unborn = others.filter((p) => state(p) === 'never_published').map(row);
|
|
2645
2659
|
fresh = unborn.filter((r) => !heldFromFirstPublish(r.type));
|
|
2646
2660
|
held = unborn.filter((r) => heldFromFirstPublish(r.type));
|
|
@@ -2655,7 +2669,7 @@ export function registerPageTools(server, ctx) {
|
|
|
2655
2669
|
...(left.length
|
|
2656
2670
|
? {
|
|
2657
2671
|
unpublished_drafts: left,
|
|
2658
|
-
drafts_note: 'Draft saved after its last publish (updatedAt past publishedAt — no platform flag says so
|
|
2672
|
+
drafts_note: 'Draft not live: saved after its last publish (updatedAt past publishedAt), or held back by a cascade this process saw — no platform flag says so. publish_drafts:true publishes them too.',
|
|
2659
2673
|
}
|
|
2660
2674
|
: {}),
|
|
2661
2675
|
...(unborn.length
|
|
@@ -2710,6 +2724,18 @@ export function registerPageTools(server, ctx) {
|
|
|
2710
2724
|
// `continue`). sb_page_create followed by sb_publish does exactly that:
|
|
2711
2725
|
// the call succeeds, the page never flips to published, and the URL 404s.
|
|
2712
2726
|
const landed = published.some((p) => p.pageId === page_id);
|
|
2727
|
+
// A page in the answer that was NOT asked for is a CASCADE: rendered from
|
|
2728
|
+
// its last published version, so its draft is exactly as unpublished as
|
|
2729
|
+
// before. It stays under unpublished_drafts, and is remembered.
|
|
2730
|
+
const asked = new Set(body.pageIds);
|
|
2731
|
+
const cascaded = published.map((p) => String(p.pageId)).filter((id) => !asked.has(id));
|
|
2732
|
+
const masked = cascadeMasked.get(site_id) ?? new Map();
|
|
2733
|
+
cascadeMasked.set(site_id, masked);
|
|
2734
|
+
for (const id of asked)
|
|
2735
|
+
masked.delete(id);
|
|
2736
|
+
for (const d of drafts)
|
|
2737
|
+
if (cascaded.includes(d.pageId))
|
|
2738
|
+
masked.set(d.pageId, d);
|
|
2713
2739
|
// A 200 PROVES A ROW WAS STORED, NOT THAT A VISITOR IS BEING SERVED IT.
|
|
2714
2740
|
// The storefront answers `cache-control: public, max-age=60`, so the two
|
|
2715
2741
|
// legitimately differ for up to a minute — long enough for a caller to
|
|
@@ -2740,9 +2766,16 @@ export function registerPageTools(server, ctx) {
|
|
|
2740
2766
|
};
|
|
2741
2767
|
}
|
|
2742
2768
|
}
|
|
2769
|
+
const cascadeNote = cascaded.length
|
|
2770
|
+
? ctx.notices.once('publish-cascade', 'cascaded: pages republished because they share a changed global section or overlay. The ' +
|
|
2771
|
+
'platform renders each from the version it LAST published (fromVersionId unchanged), never ' +
|
|
2772
|
+
'from its draft — and bumps its publishedAt, so a draft still waiting is listed under ' +
|
|
2773
|
+
'unpublished_drafts here, not by the timestamps.')
|
|
2774
|
+
: undefined;
|
|
2743
2775
|
return text({
|
|
2744
2776
|
published,
|
|
2745
|
-
...
|
|
2777
|
+
...(cascaded.length ? { cascaded, ...(cascadeNote ? { cascade_note: cascadeNote } : {}) } : {}),
|
|
2778
|
+
...draftNote(drafts.filter((d) => !asked.has(d.pageId)), fresh.filter((d) => !published.some((p) => p.pageId === d.pageId))),
|
|
2746
2779
|
...(live ? { live } : {}),
|
|
2747
2780
|
...(published.length !== (res.total ?? published.length) ? { total: res.total } : {}),
|
|
2748
2781
|
...(landed
|
package/dist/vision/measure.js
CHANGED
|
@@ -92,6 +92,12 @@ export function measureShot(shot, skip = new Set(), doc) {
|
|
|
92
92
|
continue;
|
|
93
93
|
if (b.position && b.position !== 'static' && b.position !== 'relative')
|
|
94
94
|
continue;
|
|
95
|
+
// And a box INSIDE such a layer floats with it: a static button in a fixed
|
|
96
|
+
// CTA meets whatever content is under the viewport corner on every page.
|
|
97
|
+
// Two boxes in the same layer are still compared — a header's own nav
|
|
98
|
+
// colliding is a real defect, pinned or not.
|
|
99
|
+
if ((a.layer ?? '') !== (b.layer ?? ''))
|
|
100
|
+
continue;
|
|
95
101
|
const pairKey = `${a.id}|${b.id}`;
|
|
96
102
|
if (seen.has(pairKey))
|
|
97
103
|
continue;
|
package/dist/vision/shoot.js
CHANGED
|
@@ -332,27 +332,41 @@ async function shootOne(page, url, width, format, opts) {
|
|
|
332
332
|
// node. `type` is read off the leading `wb-` class, which is the only type
|
|
333
333
|
// signal the render emits; the caller already knows the real types from
|
|
334
334
|
// sb_outline, so this is a convenience, not a contract.
|
|
335
|
-
const boxes = (await page.evaluate(() =>
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
.
|
|
341
|
-
.
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
335
|
+
const boxes = (await page.evaluate(() => {
|
|
336
|
+
// No named inner function: a transpiler's `__name` wrapper would not exist
|
|
337
|
+
// in the page (the vision skill's evaluate trap).
|
|
338
|
+
const anon = new Map();
|
|
339
|
+
return [...document.querySelectorAll('[id]')]
|
|
340
|
+
.filter((el) => el.id === 'ROOT' || /^[a-z]{2}_[0-9a-f]{8}$/.test(el.id))
|
|
341
|
+
.map((el) => {
|
|
342
|
+
const r = el.getBoundingClientRect();
|
|
343
|
+
const wb = String(el.className || '')
|
|
344
|
+
.split(/\s+/)
|
|
345
|
+
.find((c) => c.startsWith('wb-'));
|
|
346
|
+
const cs = getComputedStyle(el);
|
|
347
|
+
const own = (el.textContent ?? '').trim();
|
|
348
|
+
let layer;
|
|
349
|
+
for (let e = el; e && layer === undefined; e = e.parentElement) {
|
|
350
|
+
if (!['absolute', 'fixed', 'sticky'].includes(getComputedStyle(e).position))
|
|
351
|
+
continue;
|
|
352
|
+
if (!e.id && !anon.has(e))
|
|
353
|
+
anon.set(e, `@${anon.size}`);
|
|
354
|
+
layer = e.id || anon.get(e);
|
|
355
|
+
}
|
|
356
|
+
return {
|
|
357
|
+
id: el.id,
|
|
358
|
+
type: wb ? wb.slice(3) : '',
|
|
359
|
+
x: Math.round(r.x),
|
|
360
|
+
y: Math.round(r.y),
|
|
361
|
+
w: Math.round(r.width),
|
|
362
|
+
h: Math.round(r.height),
|
|
363
|
+
fontPx: Math.round(parseFloat(cs.fontSize) || 0),
|
|
364
|
+
hasText: own.length > 0,
|
|
365
|
+
position: cs.position,
|
|
366
|
+
...(layer ? { layer } : {}),
|
|
367
|
+
};
|
|
368
|
+
});
|
|
369
|
+
}));
|
|
356
370
|
// ZOOM. A designer does not judge a card by looking at the whole page, and
|
|
357
371
|
// a full-page shot of a long storefront makes one card a few pixels tall.
|
|
358
372
|
// The clip comes from the SAME measurement pass the boxes do, so what is
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sbuilder-mcp",
|
|
3
|
-
"version": "0.98.
|
|
3
|
+
"version": "0.98.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",
|