sbuilder-mcp 0.1.3 → 0.1.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 +61 -6
- package/CHANGELOG.vi.md +72 -0
- package/README.md +37 -11
- package/README.vi.md +36 -10
- package/dist/catalog/api.generated.js +6246 -2867
- package/dist/catalog/element-search.js +103 -0
- package/dist/catalog/elements.generated.js +23285 -5114
- package/dist/catalog/search.js +35 -3
- package/dist/core/tree.js +23 -0
- package/dist/domains/site/builder.js +186 -18
- package/dist/domains/site/document.js +3 -1
- package/dist/domains/site/findings.js +51 -0
- package/dist/domains/site/node.js +17 -1
- package/dist/domains/site/readiness-fetch.js +52 -0
- package/dist/domains/site/readiness.js +126 -0
- package/dist/domains/site/review.js +19 -11
- package/dist/domains/site/validate.js +37 -17
- package/dist/install/index.js +1 -14
- package/dist/install/write.js +0 -105
- package/dist/live/session.js +31 -3
- package/dist/mcp/notices.js +21 -0
- package/dist/mcp/response.js +11 -3
- package/dist/server.js +17 -32
- package/dist/tools/api.js +192 -33
- package/dist/tools/credentialpick.js +2 -7
- package/dist/tools/live.js +159 -51
- package/dist/tools/page.js +236 -169
- package/dist/tools/project.js +38 -0
- package/dist/tools/session.js +14 -109
- package/dist/transport/http.js +21 -4
- package/dist/transport/media.js +18 -2
- package/dist/transport/pages.js +2 -2
- package/dist/vision/boxes.js +35 -0
- package/dist/vision/measure.js +4 -3
- package/dist/vision/shoot.js +185 -74
- package/package.json +3 -2
- package/dist/tools/siteref.js +0 -33
- package/dist/transport/keys.js +0 -73
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,69 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**English** · [Tiếng Việt](./CHANGELOG.vi.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
All notable changes to this project are documented in this file.
|
|
6
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
7
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
8
|
|
|
7
|
-
## 0.1.
|
|
9
|
+
## [0.1.5] - 2026-09-07
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
### Added
|
|
12
|
+
- sb_review reports store_gaps: the platform's own readiness rules — no published checkout page, no live payment gateway, no published product page, no shipping method, nothing that opens the cart — none of which any API exposes and all of which survive publish silently.
|
|
13
|
+
- sb_page_create takes type, slug and is_homepage, so an agent can create the checkout and product pages that /checkout and /products/{slug} resolve by type rather than by slug.
|
|
14
|
+
- sb_look takes url to shoot a given address (typically the published storefront) instead of the draft preview, which threads no store data and renders every repeater's empty state.
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
### Changed
|
|
17
|
+
- sb_set re-derives a dataset element's bindings when config.datasetSource or config.kind changes, instead of leaving them pointing at the entity they used to describe.
|
|
18
|
+
- sb_add and sb_set now refuse a caller writing specials.globalId, specials.appBlockId or specials.appBlockHash, which are stamps the server writes on compose; authoring one decomposes the node over its shared master on the next save.
|
|
19
|
+
- Binding sources for sb_bind and sb_review grew from 26 to 77 by also reading the editor's own binding context, so a platform-seeded binding such as price is no longer reported as dead.
|
|
20
|
+
- sb_bind's source argument no longer lists every binding source in its schema; an unknown source is still refused with the full list.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- Newly added dataset elements (text-dataset, pricing-dataset, list-dataset, and others) now carry the bindings the editor would have given them at drop time, instead of saving, publishing and rendering their placeholder forever.
|
|
24
|
+
- Removing a node now also removes its satellite nodes (list-empty, list-loading, the quantity and product-variant-label nodes), which attach by parent pointer alone and used to survive removal and fail the next save with unrecognized ids.
|
|
25
|
+
- sb_publish now posts to the site's publish endpoint with pageIds instead of a per-page publish route that the platform answers with 404.
|
|
26
|
+
- A tool result built from an empty response body (such as a 204 on delete) no longer fails client-side validation.
|
|
27
|
+
- sb_page_open, sb_set and sb_look no longer refuse a real page's satellite nodes (list-empty, list-loading, the quantity and product-variant-label nodes) as orphans; the save check now verifies attachment to the tree instead of exact parent/child-list agreement.
|
|
28
|
+
- sb_media_upload reports that a key-only install cannot upload media, since /api/media is mounted behind session auth only, instead of surfacing a bare unauthorized error.
|
|
29
|
+
|
|
30
|
+
## [0.1.4] - 2026-09-07
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- sb_set accepts an edits[] batch so many nodes save and publish in one call instead of one round trip per node.
|
|
34
|
+
- sb_api_call shapes list answers with pick and max_items, and cuts an oversized list to fit the result cap while saying how many items were shown and how to narrow the call.
|
|
35
|
+
- All 25 tools carry MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint), so compliant clients stop asking for confirmation on reads.
|
|
36
|
+
- Trap 5 is now guarded in code: an edit inside an app block's interior is refused instead of being silently lost on save.
|
|
37
|
+
- The catalog is regenerated from the platform: 106 elements, 412 API operations, and 26 binding sources.
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
- sb_look keeps Chrome open across calls, launching it lazily and reusing it while connected, and captures multiple widths in parallel instead of one at a time.
|
|
41
|
+
- sb_look screenshots are JPEG by default (format: "png" still available), which cuts image size and cost without changing token count.
|
|
42
|
+
- sb_look's node_id boxes now count depth from the framed node and cover only its subtree.
|
|
43
|
+
- sb_page_list, sb_templates and sb_media_list return a smaller, whitelisted set of fields instead of the whole document or settings blob.
|
|
44
|
+
- sb_look's measured layout boxes are returned as compact tuples ([id, type, x, y, w, h]) instead of pretty-printed objects, with box_depth controlling how deep the tree goes.
|
|
45
|
+
- Tool descriptions for sb_bind, sb_look, sb_live_join, sb_review and sb_api_find are shorter; sb_bind no longer interpolates all 26 binding sources into its schema.
|
|
46
|
+
- The server's handshake instructions are shorter, take their tool/element/operation counts from generated source records, and no longer claim a base style value vanishes on publish.
|
|
47
|
+
- Findings from sb_page_open, sb_review and sb_look reuse one fix template per kind of defect, and directives such as FIX THESE are said once per process instead of on every call.
|
|
48
|
+
- Every tool result is now compact JSON.
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
- sb_live_join reports why an API key cannot join a live session instead of joining silently into a socket that never opens, since the platform refuses wbk_ keys.
|
|
52
|
+
- Multipart uploads now surface the platform's per-field validation errors instead of a generic failure.
|
|
53
|
+
- Duplicating a subtree that contains an app block is refused instead of being silently reduced.
|
|
54
|
+
- fill() throws when a code has no template instead of returning an empty fix.
|
|
55
|
+
- sb_api_call's publish step splits an ops batch to stay under the live socket's 4 MiB frame cap instead of risking a dropped connection.
|
|
56
|
+
- A non-list answer's size is no longer silently cut, and asking for max_items on a non-list answer is now reported instead of ignored.
|
|
57
|
+
- A platform response field named truncated is no longer overwritten by the result-shaping logic.
|
|
58
|
+
- Each screenshot page now closes in its own finally block, so a tab lost to a first rejection can no longer leak for the life of the process.
|
|
59
|
+
|
|
60
|
+
## [0.1.2] - 2026-08-29
|
|
61
|
+
|
|
62
|
+
### Added
|
|
63
|
+
- The server reports which machine and which client it runs on, so the store's Agent app can show every connected agent.
|
|
64
|
+
- sb_look measures the render: content past the viewport, overlapping siblings, and text too small to read are reported with the width they happen at.
|
|
65
|
+
|
|
66
|
+
## [0.1.1] - 2026-08-28
|
|
12
67
|
|
|
13
68
|
- fix(release): ask for the one-time password instead of dying on it
|
|
14
69
|
- feat: sb_media_upload — the agent can add images
|
|
@@ -53,7 +108,7 @@ check switch quickly site for agent
|
|
|
53
108
|
- feat: repo skeleton, response helpers, and a green build/test/smoke gate
|
|
54
109
|
- docs: design spec and phase-1 implementation plan for @sbuilder/mcp
|
|
55
110
|
|
|
56
|
-
## 0.1.0
|
|
111
|
+
## [0.1.0]
|
|
57
112
|
|
|
58
113
|
First release.
|
|
59
114
|
|
package/CHANGELOG.vi.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
[English](./CHANGELOG.md) · **Tiếng Việt**
|
|
4
|
+
|
|
5
|
+
Mọi thay đổi đáng chú ý của dự án được ghi lại trong file này.
|
|
6
|
+
Định dạng dựa trên [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
7
|
+
và dự án tuân theo [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
|
+
|
|
9
|
+
## [0.1.5] - 2026-09-07
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- sb_review giờ báo cáo store_gaps: các quy tắc sẵn sàng bán hàng của chính nền tảng — chưa có trang checkout đã publish, chưa có cổng thanh toán live, chưa có trang product đã publish, chưa có phương thức vận chuyển, không có gì mở lại giỏ hàng — không API nào lộ ra các quy tắc này và tất cả đều sống sót qua publish một cách âm thầm.
|
|
13
|
+
- sb_page_create nhận type, slug và is_homepage, để agent tạo được trang checkout và product mà /checkout và /products/{slug} phân giải theo type chứ không theo slug.
|
|
14
|
+
- sb_look nhận url để chụp một địa chỉ cho trước (thường là storefront đã publish) thay vì bản xem trước dạng draft, vốn không truyền dữ liệu cửa hàng và khiến mọi repeater render trạng thái rỗng.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- sb_set giờ tính lại binding của một dataset element khi config.datasetSource hoặc config.kind thay đổi, thay vì để binding tiếp tục trỏ vào entity cũ.
|
|
18
|
+
- sb_add và sb_set giờ từ chối khi caller ghi specials.globalId, specials.appBlockId hoặc specials.appBlockHash — đây là các stamp do server ghi khi compose; tự ghi một trong số đó sẽ khiến lần lưu kế tiếp decompose node đó đè lên bản gốc chung.
|
|
19
|
+
- Số nguồn binding cho sb_bind và sb_review tăng từ 26 lên 77 nhờ đọc thêm context binding của editor, nên một binding do nền tảng tự seed như price không còn bị báo là dead.
|
|
20
|
+
- Tham số source của sb_bind không còn liệt kê toàn bộ nguồn binding trong schema; một nguồn không hợp lệ vẫn bị từ chối kèm danh sách đầy đủ.
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
- Các dataset element mới thêm (text-dataset, pricing-dataset, list-dataset, và các loại khác) giờ mang đúng binding mà editor sẽ gán lúc kéo-thả, thay vì lưu, publish và render mãi ở trạng thái placeholder.
|
|
24
|
+
- Xóa một node giờ cũng xóa các node vệ tinh của nó (list-empty, list-loading, các node quantity và product-variant-label), vốn chỉ gắn qua con trỏ parent và trước đây sống sót qua việc xóa rồi làm lần lưu kế tiếp bị từ chối vì id không xác định.
|
|
25
|
+
- sb_publish giờ gọi endpoint publish cấp site với pageIds, thay vì một route publish theo từng trang mà nền tảng trả về 404.
|
|
26
|
+
- Một kết quả tool được dựng từ response rỗng (như 204 khi xóa) không còn bị client từ chối do lỗi validate.
|
|
27
|
+
- sb_page_open, sb_set và sb_look không còn từ chối các node vệ tinh của một trang thật (list-empty, list-loading, các node quantity và product-variant-label) như thể chúng là orphan; kiểm tra khi lưu giờ xác minh sự gắn kết vào cây thay vì yêu cầu parent và child-list khớp chính xác.
|
|
28
|
+
- sb_media_upload giờ báo rõ rằng một cài đặt chỉ dùng API key không thể upload media, vì /api/media chỉ chấp nhận xác thực bằng session, thay vì trả về lỗi unauthorized trần trụi.
|
|
29
|
+
|
|
30
|
+
## [0.1.4] - 2026-09-07
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
- sb_set nhận một mảng edits[] để ghi nhiều node trong một lần gọi, thay vì lưu và publish riêng cho từng node.
|
|
34
|
+
- sb_api_call định dạng lại kết quả dạng danh sách bằng pick và max_items, và cắt bớt danh sách quá lớn để vừa giới hạn kết quả, kèm thông báo đã hiển thị bao nhiêu mục và cách thu hẹp lời gọi.
|
|
35
|
+
- Cả 25 tool đều mang chú thích MCP (readOnlyHint, destructiveHint, idempotentHint, openWorldHint), giúp các client tuân thủ chuẩn không còn hỏi xác nhận cho thao tác chỉ đọc.
|
|
36
|
+
- Bẫy thứ 5 giờ được chặn bằng code: một chỉnh sửa bên trong app block bị từ chối thay vì âm thầm mất khi lưu.
|
|
37
|
+
- Catalog được tạo lại từ nền tảng: 106 element, 412 API operation, và 26 nguồn binding.
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
- sb_look giữ Chrome mở giữa các lần gọi, khởi chạy lười và tái sử dụng khi còn kết nối, đồng thời chụp nhiều chiều rộng song song thay vì lần lượt.
|
|
41
|
+
- Ảnh chụp của sb_look mặc định là JPEG (vẫn có thể chọn format: "png"), giúp giảm dung lượng ảnh và chi phí mà không đổi số token.
|
|
42
|
+
- Các box theo node_id của sb_look giờ tính độ sâu từ node được khung và chỉ bao phủ subtree của nó.
|
|
43
|
+
- sb_page_list, sb_templates và sb_media_list trả về tập trường được lọc sẵn nhỏ hơn, thay vì cả document hay cả khối settings.
|
|
44
|
+
- Các box đo layout của sb_look giờ trả về dạng tuple gọn ([id, type, x, y, w, h]) thay vì object in đẹp, với box_depth điều khiển độ sâu duyệt cây.
|
|
45
|
+
- Mô tả của các tool sb_bind, sb_look, sb_live_join, sb_review và sb_api_find được rút gọn; sb_bind không còn chèn cả 26 nguồn binding vào schema.
|
|
46
|
+
- Hướng dẫn bắt tay của server ngắn hơn, lấy số lượng tool/element/operation từ dữ liệu sinh tự động, và không còn nói sai rằng giá trị style ở base biến mất khi publish.
|
|
47
|
+
- Các finding từ sb_page_open, sb_review và sb_look dùng chung một mẫu fix cho mỗi loại lỗi, và các chỉ dẫn như FIX THESE chỉ được nói một lần cho mỗi tiến trình thay vì lặp lại ở mọi lần gọi.
|
|
48
|
+
- Mọi kết quả trả về của tool giờ là JSON rút gọn.
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
- sb_live_join báo rõ lý do một API key không thể tham gia phiên live, thay vì âm thầm tham gia vào một socket không bao giờ mở, vì nền tảng từ chối key dạng wbk_.
|
|
52
|
+
- Upload dạng multipart giờ trả về đúng lỗi kiểm tra theo từng trường của nền tảng thay vì một lỗi chung chung.
|
|
53
|
+
- Nhân bản một subtree chứa app block bị từ chối thay vì bị âm thầm rút gọn.
|
|
54
|
+
- fill() báo lỗi khi một code không có template thay vì trả về một fix rỗng.
|
|
55
|
+
- Bước publish của sb_api_call chia nhỏ batch ops để nằm dưới giới hạn khung 4 MiB của socket live, thay vì có nguy cơ làm rớt kết nối.
|
|
56
|
+
- Kết quả không phải danh sách không còn bị cắt âm thầm, và việc dùng max_items trên một kết quả không phải danh sách giờ được báo thay vì bị bỏ qua.
|
|
57
|
+
- Trường truncated do nền tảng trả về không còn bị logic định dạng kết quả ghi đè.
|
|
58
|
+
- Mỗi trang chụp ảnh giờ đóng trong khối finally riêng, nên một tab bị lỗi lần đầu không còn rò rỉ suốt vòng đời tiến trình.
|
|
59
|
+
|
|
60
|
+
## [0.1.2] - 2026-08-29
|
|
61
|
+
|
|
62
|
+
### Added
|
|
63
|
+
- Server báo cho nền tảng biết nó đang chạy trên máy nào và trong client nào, để app Agent của cửa hàng hiển thị được mọi agent đang kết nối.
|
|
64
|
+
- sb_look đo kết quả render: nội dung tràn khỏi viewport, các phần tử anh em chồng lên nhau, và chữ quá nhỏ để đọc được báo cáo kèm chiều rộng mà lỗi xảy ra.
|
|
65
|
+
|
|
66
|
+
## [0.1.1] - 2026-08-28
|
|
67
|
+
|
|
68
|
+
Sửa lỗi, thêm tool, và vòng lặp nhìn.
|
|
69
|
+
|
|
70
|
+
## [0.1.0]
|
|
71
|
+
|
|
72
|
+
Bản phát hành đầu tiên.
|
package/README.md
CHANGED
|
@@ -63,13 +63,13 @@ make, because those mean "this person's account".
|
|
|
63
63
|
| --- | --- |
|
|
64
64
|
| `sb_connect` | Log in, list the sites this account can operate, report which credentials are present |
|
|
65
65
|
| `sb_site_list` | List the sites this account can operate |
|
|
66
|
-
| `sb_api_find` | Find API operations by intent —
|
|
66
|
+
| `sb_api_find` | Find API operations by intent — one line per match — then read one operation's call sheet by id: real parameter schemas, the credential it needs, and an explicit note when the platform's document fails to describe a request body |
|
|
67
67
|
| `sb_api_call` | Execute one operation. Defaults to a dry run that sends nothing |
|
|
68
68
|
| `sb_page_open` | Open a page for editing and return its outline |
|
|
69
69
|
| `sb_outline` | The open page as a compressed tree — never a raw document dump |
|
|
70
70
|
| `sb_node_read` | One node in full, with a warning if it is a shared global |
|
|
71
71
|
| `sb_catalog_search` | Find an element by what it should do, using the platform's own AI hints |
|
|
72
|
-
| `sb_traits_for` |
|
|
72
|
+
| `sb_traits_for` | An element's inspector — tabs, groups, controls and what each declared one writes — plus its AI hints, defaults and containment rules |
|
|
73
73
|
| `sb_add` | Add an element — or a whole nested subtree — in one call |
|
|
74
74
|
| `sb_set` | Write style/config/specials. Per breakpoint by default |
|
|
75
75
|
| `sb_move` | Move a node to another parent |
|
|
@@ -78,18 +78,23 @@ make, because those mean "this person's account".
|
|
|
78
78
|
| `sb_templates` | The store's saved section templates — designed sections to start from |
|
|
79
79
|
| `sb_template_use` | Instantiate a template into a page |
|
|
80
80
|
| `sb_page_list` | Every page on the site |
|
|
81
|
-
| `sb_page_create` | Create a page |
|
|
81
|
+
| `sb_page_create` | Create a page; `type` is the route for checkout, product, category, post, course |
|
|
82
82
|
| `sb_publish` | Compile the draft into the live page (cascades to shared globals) |
|
|
83
|
-
| `sb_review` | Every defect a visitor would see, each with the
|
|
83
|
+
| `sb_review` | Every defect a visitor would see, each with its fix, plus the five gaps between this store and a paid order |
|
|
84
84
|
| `sb_media_list` | The site's media library |
|
|
85
85
|
| `sb_media_upload` | Add an image and get its URL — the only route, the upload is multipart |
|
|
86
86
|
| `sb_live_join` | Join the editor's live-edit room as a visible peer — edits then appear live |
|
|
87
|
-
| `sb_look` | Save, render, and return screenshots plus measured node boxes |
|
|
87
|
+
| `sb_look` | Save, render, and return screenshots plus measured node boxes and layout defects measured on the render |
|
|
88
88
|
| `sb_bind` | Bind a node's content to real store data |
|
|
89
89
|
|
|
90
|
-
Twenty-five tools, **
|
|
91
|
-
|
|
92
|
-
operations added to the platform arrive with the
|
|
90
|
+
Twenty-five tools, **412 API operations**, 106 elements, 26 binding sources. `sb_api_find`
|
|
91
|
+
is an index rather than a tool per endpoint, so the tool list stays short while everything
|
|
92
|
+
the platform can do stays reachable — and operations added to the platform arrive with the
|
|
93
|
+
next `npm run codegen`.
|
|
94
|
+
|
|
95
|
+
Every result is compact JSON, every directive is said once per process, and every tool
|
|
96
|
+
carries MCP annotations — a client that honours them stops asking a person to confirm a
|
|
97
|
+
read.
|
|
93
98
|
|
|
94
99
|
Full reference: [`docs/tools.md`](./docs/tools.md).
|
|
95
100
|
|
|
@@ -117,9 +122,27 @@ npm run smoke # offline self-test; must print ALL GOOD
|
|
|
117
122
|
Contributor guide: [`CLAUDE.md`](./CLAUDE.md). Design rationale:
|
|
118
123
|
[`docs/superpowers/specs/`](./docs/superpowers/specs/).
|
|
119
124
|
|
|
125
|
+
### Release
|
|
126
|
+
|
|
127
|
+
A push to `main` that touches `src/**` releases on its own
|
|
128
|
+
(`.github/workflows/auto-release.yml`): the gate runs (build, test, smoke), the version
|
|
129
|
+
bump is read off the commit subject — `feat` is minor, `BREAKING CHANGE` or `!` is major,
|
|
130
|
+
anything else is patch — Claude writes the changelog entry in both languages,
|
|
131
|
+
`server.json` is synced, the release is committed as `chore(release): vX.Y.Z` and tagged,
|
|
132
|
+
then published to npm, as a GitHub Release, and to the MCP Registry through GitHub OIDC.
|
|
133
|
+
`workflow_dispatch` runs the same flow with a bump you choose. A commit whose subject
|
|
134
|
+
contains `chore(release):` or `release: v` is skipped, so a release never triggers another.
|
|
135
|
+
|
|
136
|
+
The workflow needs two repository secrets in the `prod` environment: `NPM_ACCESS_TOKEN`
|
|
137
|
+
and `CLAUDE_CODE_OAUTH_TOKEN`. The registry step needs none.
|
|
138
|
+
|
|
139
|
+
`npm run release` (`scripts/release.mjs`) is the offline path — a machine with no CI, or a
|
|
140
|
+
release cut while a secret is being rotated. It runs the same gate and writes the same
|
|
141
|
+
`## [x.y.z] - date` changelog heading, so the two never disagree.
|
|
142
|
+
|
|
120
143
|
## Designing safely
|
|
121
144
|
|
|
122
|
-
|
|
145
|
+
Five platform rules fail **silently** if a client does not know them, so they are encoded
|
|
123
146
|
here as tested code rather than advice:
|
|
124
147
|
|
|
125
148
|
- **Band order** — ROOT's children must read `[header][middle][footer]`, or the platform
|
|
@@ -131,12 +154,15 @@ here as tested code rather than advice:
|
|
|
131
154
|
publishing cascades. Any result touching one says so.
|
|
132
155
|
- **Responsive by default** — `sb_set` writes per breakpoint, because a design should
|
|
133
156
|
respond. Base is the cascade's fallback layer, not a trap.
|
|
157
|
+
- **App blocks** — a marketplace app's subtree is composed onto the page on read and reduced
|
|
158
|
+
back to one reference node on save, so an edit inside it is lost without a word. Every
|
|
159
|
+
write refuses the interior; the outline flags the block root `app: true`.
|
|
134
160
|
|
|
135
161
|
## Status
|
|
136
162
|
|
|
137
163
|
All three phases shipped: authentication and full API reach; the page document, patch
|
|
138
|
-
protocol, builder and the
|
|
139
|
-
loop.
|
|
164
|
+
protocol, builder and the five traps; the live-edit socket, the yield rule, and the vision
|
|
165
|
+
loop. Since then: a token diet across every result, and releases that cut themselves.
|
|
140
166
|
|
|
141
167
|
Requires **Node ≥22** (the global `WebSocket`) and, for `sb_look` only, **system Google
|
|
142
168
|
Chrome** — `playwright-core` bundles no browser, so installing downloads nothing.
|
package/README.vi.md
CHANGED
|
@@ -60,13 +60,13 @@ là "tài khoản của người này".
|
|
|
60
60
|
| --- | --- |
|
|
61
61
|
| `sb_connect` | Đăng nhập, liệt kê site tài khoản vận hành được, báo đang có credential nào |
|
|
62
62
|
| `sb_site_list` | Liệt kê site tài khoản vận hành được |
|
|
63
|
-
| `sb_api_find` | Tìm operation theo ý định —
|
|
63
|
+
| `sb_api_find` | Tìm operation theo ý định — mỗi kết quả một dòng — rồi đọc call sheet của một operation theo id: schema tham số thật, credential cần dùng, và cảnh báo rõ ràng khi tài liệu của nền tảng không mô tả request body |
|
|
64
64
|
| `sb_api_call` | Chạy một operation. Mặc định chạy khô, không gửi gì |
|
|
65
65
|
| `sb_page_open` | Mở một trang để sửa và trả về outline |
|
|
66
66
|
| `sb_outline` | Trang đang mở dạng cây nén — không bao giờ dump tài liệu thô |
|
|
67
67
|
| `sb_node_read` | Một node đầy đủ, kèm cảnh báo nếu nó là global dùng chung |
|
|
68
68
|
| `sb_catalog_search` | Tìm element theo việc nó cần làm, dùng chính AI hints của nền tảng |
|
|
69
|
-
| `sb_traits_for` |
|
|
69
|
+
| `sb_traits_for` | Inspector của element — tab, nhóm, control và mỗi control khai báo sẵn ghi vào đâu — kèm AI hints, default và luật chứa con |
|
|
70
70
|
| `sb_add` | Thêm một element — hoặc cả cây con lồng nhau — trong một lần gọi |
|
|
71
71
|
| `sb_set` | Ghi style/config/specials. Mặc định theo breakpoint |
|
|
72
72
|
| `sb_move` | Chuyển node sang cha khác |
|
|
@@ -75,18 +75,22 @@ là "tài khoản của người này".
|
|
|
75
75
|
| `sb_templates` | Section template đã lưu của cửa hàng — section thiết kế sẵn để bắt đầu |
|
|
76
76
|
| `sb_template_use` | Thả một template vào trang |
|
|
77
77
|
| `sb_page_list` | Mọi trang của site |
|
|
78
|
-
| `sb_page_create` | Tạo một trang |
|
|
78
|
+
| `sb_page_create` | Tạo một trang; `type` là đường đi cho checkout, product, category, post, course |
|
|
79
79
|
| `sb_publish` | Biên dịch bản nháp thành trang live (lan sang global dùng chung) |
|
|
80
|
-
| `sb_review` | Mọi khiếm khuyết người xem sẽ thấy, kèm lệnh sửa từng cái |
|
|
80
|
+
| `sb_review` | Mọi khiếm khuyết người xem sẽ thấy, kèm lệnh sửa từng cái, và năm khoảng trống chắn giữa cửa hàng với một đơn đã thanh toán |
|
|
81
81
|
| `sb_media_list` | Thư viện ảnh của site |
|
|
82
82
|
| `sb_media_upload` | Thêm ảnh và lấy URL — đường duy nhất, vì upload là multipart |
|
|
83
83
|
| `sb_live_join` | Vào phòng live-edit của editor như một peer nhìn thấy được — sửa gì hiện ngay |
|
|
84
|
-
| `sb_look` | Lưu, render, trả về ảnh chụp kèm box đo được của
|
|
84
|
+
| `sb_look` | Lưu, render, trả về ảnh chụp kèm box đo được của node và lỗi bố cục đo trên bản render |
|
|
85
85
|
| `sb_bind` | Gắn nội dung một node vào dữ liệu cửa hàng thật |
|
|
86
86
|
|
|
87
|
-
Hai mươi lăm tool, **
|
|
88
|
-
tool, nên danh sách tool vẫn ngắn trong khi mọi
|
|
89
|
-
operation mới thêm bên nền tảng sẽ tự có sau lần
|
|
87
|
+
Hai mươi lăm tool, **412 operation API**, 106 element, 26 nguồn binding. `sb_api_find` là
|
|
88
|
+
một chỉ mục chứ không phải mỗi endpoint một tool, nên danh sách tool vẫn ngắn trong khi mọi
|
|
89
|
+
thứ nền tảng làm được vẫn với tới — và operation mới thêm bên nền tảng sẽ tự có sau lần
|
|
90
|
+
`npm run codegen` kế tiếp.
|
|
91
|
+
|
|
92
|
+
Mọi kết quả đều là JSON nén, mọi directive chỉ nói một lần mỗi process, và mọi tool đều mang
|
|
93
|
+
MCP annotation — client nào tôn trọng chúng sẽ thôi hỏi người dùng xác nhận một lần đọc.
|
|
90
94
|
|
|
91
95
|
Tra cứu đầy đủ: [`docs/tools.vi.md`](./docs/tools.vi.md).
|
|
92
96
|
|
|
@@ -114,9 +118,27 @@ npm run smoke # tự kiểm offline; phải in ALL GOOD
|
|
|
114
118
|
Hướng dẫn đóng góp: [`CLAUDE.md`](./CLAUDE.md). Lý do thiết kế:
|
|
115
119
|
[`docs/superpowers/specs/`](./docs/superpowers/specs/).
|
|
116
120
|
|
|
121
|
+
### Phát hành
|
|
122
|
+
|
|
123
|
+
Một lần push lên `main` có đụng `src/**` sẽ tự phát hành
|
|
124
|
+
(`.github/workflows/auto-release.yml`): cổng kiểm chạy (build, test, smoke), mức tăng phiên
|
|
125
|
+
bản đọc từ tiêu đề commit — `feat` là minor, `BREAKING CHANGE` hoặc `!` là major, còn lại là
|
|
126
|
+
patch — Claude viết mục changelog bằng cả hai ngôn ngữ, `server.json` được đồng bộ, bản phát
|
|
127
|
+
hành được commit là `chore(release): vX.Y.Z` và gắn tag, rồi publish lên npm, thành GitHub
|
|
128
|
+
Release, và lên MCP Registry qua GitHub OIDC. `workflow_dispatch` chạy đúng luồng đó với mức
|
|
129
|
+
tăng bạn chọn. Commit có tiêu đề chứa `chore(release):` hoặc `release: v` thì bị bỏ qua, nên
|
|
130
|
+
một lần phát hành không bao giờ kích hoạt lần khác.
|
|
131
|
+
|
|
132
|
+
Workflow cần hai secret của repo trong environment `prod`: `NPM_ACCESS_TOKEN` và
|
|
133
|
+
`CLAUDE_CODE_OAUTH_TOKEN`. Bước registry không cần secret nào.
|
|
134
|
+
|
|
135
|
+
`npm run release` (`scripts/release.mjs`) là đường offline — máy không có CI, hoặc phát hành
|
|
136
|
+
đúng lúc đang xoay secret. Nó chạy cùng cổng kiểm và ghi cùng tiêu đề changelog
|
|
137
|
+
`## [x.y.z] - date`, nên hai bên không bao giờ lệch nhau.
|
|
138
|
+
|
|
117
139
|
## Thiết kế an toàn
|
|
118
140
|
|
|
119
|
-
|
|
141
|
+
Năm luật của nền tảng hỏng **im lặng** nếu client không biết, nên chúng được viết thành code
|
|
120
142
|
có test chứ không phải lời khuyên:
|
|
121
143
|
|
|
122
144
|
- **Thứ tự băng** — con của ROOT phải đọc `[header][middle][footer]`, sai là nền tảng từ
|
|
@@ -127,11 +149,15 @@ có test chứ không phải lời khuyên:
|
|
|
127
149
|
thì lan. Mọi kết quả đụng tới nó đều nói rõ.
|
|
128
150
|
- **Mặc định responsive** — `sb_set` ghi theo breakpoint, vì một thiết kế nên đáp ứng. Base
|
|
129
151
|
là lớp dự phòng của cascade, không phải cái bẫy.
|
|
152
|
+
- **App block** — cây con của một app trên marketplace được ghép vào trang lúc đọc và thu về
|
|
153
|
+
một node tham chiếu lúc lưu, nên sửa gì bên trong là mất mà không một lời. Mọi lần ghi đều
|
|
154
|
+
từ chối phần bên trong; outline cắm cờ `app: true` cho gốc block.
|
|
130
155
|
|
|
131
156
|
## Trạng thái
|
|
132
157
|
|
|
133
158
|
Cả ba giai đoạn đã xong: xác thực và với tới toàn bộ API; tài liệu trang, giao thức patch,
|
|
134
|
-
builder và
|
|
159
|
+
builder và năm cái bẫy; socket live-edit, luật nhường, và vòng lặp thị giác. Sau đó: một đợt
|
|
160
|
+
ăn kiêng token trên mọi kết quả, và phát hành tự cắt.
|
|
135
161
|
|
|
136
162
|
Cần **Node ≥22** (WebSocket toàn cục) và, chỉ với `sb_look`, **Google Chrome của hệ thống** —
|
|
137
163
|
`playwright-core` không kèm trình duyệt nào nên lúc cài không tải gì.
|