sbuilder-mcp 0.4.3 → 0.5.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 +28 -0
- package/CHANGELOG.vi.md +28 -0
- package/README.md +10 -2
- package/README.vi.md +10 -2
- package/dist/catalog/api.generated.js +64 -1
- package/dist/catalog/checkout.generated.js +813 -0
- package/dist/catalog/elements.generated.js +2 -1
- package/dist/catalog/search.js +15 -0
- package/dist/catalog/shapes.generated.js +6582 -0
- package/dist/core/tree.js +46 -0
- package/dist/domains/site/builder.js +30 -10
- package/dist/domains/site/findings.js +15 -0
- package/dist/domains/site/readiness.js +7 -1
- package/dist/domains/site/review.js +112 -3
- package/dist/domains/site/traps.js +43 -5
- package/dist/install/index.js +29 -1
- package/dist/server.js +7 -1
- package/dist/tools/api.js +42 -2
- package/dist/tools/live.js +39 -5
- package/dist/tools/session.js +2 -1
- package/dist/tools/store.js +286 -0
- package/dist/tools/undo.js +162 -0
- package/dist/transport/http.js +36 -7
- package/dist/vision/shoot.js +24 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,34 @@ 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.5.0] - 2026-09-08
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- sb_review reports default_seed_copy when a satellite's empty state still carries the platform's own English seed text, such as a repeater's empty state saying "No products yet", which previously matched no rule and reviewed clean.
|
|
13
|
+
- sb_review reports form_fields_flush when a form, form-segment or form-step-nav stacks its fields with no gap between them, so each label reads as belonging to the control above it.
|
|
14
|
+
- The install CLI accepts --site-name, matching the flag the platform's own Agent app install line already appends; it rides in as SB_SITE_NAME alongside the site id, and sb_connect reports it back so a session can display the store's name instead of its id.
|
|
15
|
+
- A dry run of the install CLI now reports its own preview outcome and exit code instead of reusing the failure marker and exit code of a real install.
|
|
16
|
+
- sb_api_call now falls back {siteId} and {siteID} path parameters to SB_SITE across all 289 operations that name the site, matching the fallback every other tool already applies through siteFor(); an explicit argument still wins.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- sb_set's state parameter now writes to the location the platform's cascade actually reads: node.states[state] at base, node.responsive[breakpoint].states[state] per breakpoint. Previously it wrote to a path nothing reads, and base:true combined with state:"hover" wrote the hover value straight into the plain style, leaving a node permanently styled as if hovered with no hover state at all.
|
|
20
|
+
- sb_set now refuses a state argument on specials instead of silently dropping it, since content and identity do not vary by interaction state.
|
|
21
|
+
- sb_review now walks into satellite nodes (a repeater's empty state, a variant option's skin, a quantity stepper's buttons, a menu or tab item's skin), so findings inside them are reported instead of being invisible to every check.
|
|
22
|
+
- sb_review and sb_set now report a site-wide edit as such: a change to a node inside a global section's interior, or inside a site overlay like the cart drawer, is flagged rather than reading as an ordinary page-local edit.
|
|
23
|
+
- sb_look now opens a closed overlay (such as the cart drawer) before measuring it, so a node_id resolving inside one can be photographed at all instead of failing with a clipping error that named neither the overlay nor the reason.
|
|
24
|
+
- sb_look's preview_note no longer claims the draft preview renders every repeater's empty state; the draft preview threads real store data just like a published page, and the note now describes the real caveat, which is that an entity template previews with nothing bound.
|
|
25
|
+
|
|
26
|
+
## [0.4.4] - 2026-09-08
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- sb_api_find's call sheet now returns body_shape for 158 of the platform's 212 write operations, read directly off the Go handler that decodes each body instead of the 46 swagger.json describes, and expands one level of a nested struct (such as a product's variants, where the price actually lives) rather than stopping at the type name.
|
|
30
|
+
- sb_store runs the four fixed-order writes a working checkout needs — create an order form, save it back whole with the cart as its source, fill in the store's real payment methods and delivery options, then create and publish a checkout-type page — since building them by hand and missing one step ships a Checkout button that answers 404. dry_run (the default) returns the ordered plan and the payment_methods/delivery_options the form will carry; executing returns form_id, page_id, slug and published.
|
|
31
|
+
- sb_undo restores what a PUT made through sb_api_call just replaced, since the platform has no page history, versions or restore for pages, forms or settings; sb_api_call now reads a PUT's target through the matching GET before writing so there is something to put back.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
- sb_review's checkoutPage gap now points to sb_store's checkout action instead of a fix that only creates a checkout-type page, which has no order form bound to the cart and takes no orders.
|
|
35
|
+
- Redacting a request preview (used by sb_api_call and sb_undo) now matches platform-sourced credential field names such as accessKey, apiKey, clientSecret, hashSecret, webhookSecret, orderToken and signature, not just an exact "secret", since a body sb_undo echoes back comes from the platform's own vocabulary rather than a caller's.
|
|
36
|
+
|
|
9
37
|
## [0.4.3] - 2026-09-08
|
|
10
38
|
|
|
11
39
|
### Changed
|
package/CHANGELOG.vi.md
CHANGED
|
@@ -6,6 +6,34 @@ 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.5.0] - 2026-09-08
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- sb_review giờ báo cáo default_seed_copy khi một node vệ tinh ở trạng thái rỗng vẫn còn mang seed text tiếng Anh của nền tảng, chẳng hạn trạng thái rỗng của một repeater ghi "No products yet" — trước đây không khớp với rule nào nên review vẫn báo sạch.
|
|
13
|
+
- sb_review giờ báo cáo form_fields_flush khi một form, form-segment hoặc form-step-nav xếp các field mà không có gap, khiến mỗi label đọc như thể thuộc về control phía trên nó.
|
|
14
|
+
- CLI cài đặt giờ nhận --site-name, khớp với flag mà dòng lệnh cài đặt của chính Agent app trên nền tảng đã thêm vào; giá trị này đi kèm dưới dạng SB_SITE_NAME cùng với site id, và sb_connect báo cáo lại giá trị này để một session có thể hiển thị tên cửa hàng thay vì id.
|
|
15
|
+
- Một dry run của CLI cài đặt giờ báo cáo kết quả xem trước và exit code riêng, thay vì dùng chung dấu hiệu thất bại và exit code của một lần cài đặt thật.
|
|
16
|
+
- sb_api_call giờ fallback các path parameter {siteId} và {siteID} về SB_SITE trên toàn bộ 289 operation có tên site, khớp với cách fallback mà mọi tool khác đã áp dụng qua siteFor(); một tham số được truyền rõ ràng vẫn được ưu tiên.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- Tham số state của sb_set giờ ghi đúng vào vị trí mà cascade của nền tảng thực sự đọc: node.states[state] ở base, node.responsive[breakpoint].states[state] theo từng breakpoint. Trước đây nó ghi vào một đường dẫn không ai đọc, và base:true kết hợp với state:"hover" ghi thẳng giá trị hover vào style thường, khiến node mang màu hover vĩnh viễn mà không hề có trạng thái hover.
|
|
20
|
+
- sb_set giờ từ chối tham số state trên specials thay vì âm thầm bỏ qua, vì nội dung và identity không thay đổi theo trạng thái tương tác.
|
|
21
|
+
- sb_review giờ đi vào cả các node vệ tinh (trạng thái rỗng của repeater, skin của một variant option, các nút của quantity stepper, skin của một mục menu hoặc tab), nên các finding bên trong chúng được báo cáo thay vì vô hình với mọi check.
|
|
22
|
+
- sb_review và sb_set giờ báo cáo một chỉnh sửa có phạm vi toàn site đúng như bản chất của nó: thay đổi một node bên trong phần thân của một global section, hoặc bên trong một overlay của site như cart drawer, giờ được gắn cờ thay vì đọc như một chỉnh sửa cục bộ trên trang.
|
|
23
|
+
- sb_look giờ mở một overlay đang đóng (như cart drawer) trước khi đo, nên một node_id nằm bên trong overlay đó giờ có thể được chụp ảnh, thay vì thất bại với lỗi clip không nêu rõ overlay hay lý do.
|
|
24
|
+
- preview_note của sb_look không còn khẳng định rằng bản xem trước bản nháp render trạng thái rỗng của mọi repeater; bản xem trước bản nháp truyền dữ liệu cửa hàng thật giống như một trang đã publish, và ghi chú giờ mô tả đúng lưu ý thực sự — đó là một entity template xem trước sẽ không có gì được bind.
|
|
25
|
+
|
|
26
|
+
## [0.4.4] - 2026-09-08
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
- sb_api_find giờ trả về body_shape cho 158 trong tổng số 212 write operation của nền tảng, đọc trực tiếp từ handler Go giải mã từng body thay vì chỉ 46 operation mà swagger.json mô tả, và mở rộng thêm một cấp cho struct lồng nhau (như variants của một sản phẩm, nơi giá thực sự nằm ở đó) thay vì dừng lại ở tên kiểu.
|
|
30
|
+
- sb_store chạy bốn lượt ghi theo đúng thứ tự cố định mà một checkout hoạt động cần — tạo order form, lưu lại nguyên vẹn với giỏ hàng làm nguồn, điền các phương thức thanh toán và tùy chọn giao hàng thật của cửa hàng, rồi tạo và publish một trang kiểu checkout — vì tự dựng bằng tay mà bỏ sót một bước sẽ cho ra nút Checkout luôn trả về 404. dry_run (mặc định) trả về plan theo đúng thứ tự cùng payment_methods/delivery_options mà form sẽ mang; khi thực thi sẽ trả về form_id, page_id, slug và published.
|
|
31
|
+
- sb_undo khôi phục lại thứ mà một PUT qua sb_api_call vừa ghi đè, vì nền tảng không có lịch sử, phiên bản hay khôi phục cho trang, form hay settings; sb_api_call giờ đọc đối tượng của một PUT qua GET tương ứng trước khi ghi, để có thứ mà khôi phục lại.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
- Gap checkoutPage của sb_review giờ trỏ tới action checkout của sb_store thay vì một cách sửa chỉ tạo trang kiểu checkout, vốn không có order form gắn với giỏ hàng nên không nhận được đơn hàng nào.
|
|
35
|
+
- Việc redact một bản xem trước request (dùng bởi sb_api_call và sb_undo) giờ khớp với các tên trường credential có nguồn gốc từ nền tảng như accessKey, apiKey, clientSecret, hashSecret, webhookSecret, orderToken và signature, chứ không chỉ khớp chính xác "secret", vì body mà sb_undo phản chiếu lại đến từ vocabulary của nền tảng chứ không phải của caller.
|
|
36
|
+
|
|
9
37
|
## [0.4.3] - 2026-09-08
|
|
10
38
|
|
|
11
39
|
### Changed
|
package/README.md
CHANGED
|
@@ -23,6 +23,11 @@ worse than one that does not exist.
|
|
|
23
23
|
as `SB_SITE` and every tool then defaults to it. Without it the model has to carry the id
|
|
24
24
|
through the session, which it can only get by listing pages and reading one back.
|
|
25
25
|
|
|
26
|
+
`--site-name "Your Store"` rides alongside it as `SB_SITE_NAME`. It is a label, never an
|
|
27
|
+
address — nothing resolves by it — but it lets the agent say the store's name back to you
|
|
28
|
+
instead of a 32-character id you did not choose. The **Apps → AI agent** screen appends it
|
|
29
|
+
whenever the store has a name.
|
|
30
|
+
|
|
26
31
|
It **merges**: the servers already in those files stay, whatever it replaces is copied to
|
|
27
32
|
`<file>.sbuilder-backup`, and a config it cannot parse is refused rather than overwritten —
|
|
28
33
|
a file with a trailing comma is far likelier than one worth discarding, and it is what you
|
|
@@ -69,7 +74,7 @@ make, because those mean "this person's account".
|
|
|
69
74
|
| --- | --- |
|
|
70
75
|
| `sb_connect` | Log in, list the sites this account can operate, report which credentials are present |
|
|
71
76
|
| `sb_site_list` | List the sites this account can operate |
|
|
72
|
-
| `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
|
|
77
|
+
| `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 the body's fields read off the handler that decodes them, each carrying the trap its own doc comment records |
|
|
73
78
|
| `sb_api_call` | Execute one operation. Defaults to a dry run that sends nothing |
|
|
74
79
|
| `sb_page_open` | Open a page for editing and return its outline |
|
|
75
80
|
| `sb_outline` | The open page as a compressed tree — never a raw document dump |
|
|
@@ -93,8 +98,11 @@ make, because those mean "this person's account".
|
|
|
93
98
|
| `sb_look` | Save, render, and return screenshots plus measured node boxes and layout defects measured on the render |
|
|
94
99
|
| `sb_event` | Give a node a click action — open the cart, go to a page, open a pop-up |
|
|
95
100
|
| `sb_bind` | Bind a node's content to real store data, or make a button add to the cart |
|
|
101
|
+
| `sb_store` | Run a store flow that must happen in a fixed order — today, the four writes that make a working checkout |
|
|
102
|
+
| `sb_undo` | Put back what a PUT replaced — the platform has no page history or restore, so this is the only way back |
|
|
96
103
|
|
|
97
|
-
Twenty-
|
|
104
|
+
Twenty-eight tools, **484 API operations** (158 of the 212 writes carrying a body shape read
|
|
105
|
+
off the handler), 107 elements, 77 binding sources. `sb_api_find`
|
|
98
106
|
is an index rather than a tool per endpoint, so the tool list stays short while everything
|
|
99
107
|
the platform can do stays reachable — and operations added to the platform arrive with the
|
|
100
108
|
next `npm run codegen`.
|
package/README.vi.md
CHANGED
|
@@ -23,6 +23,11 @@ còn tệ hơn một cờ không tồn tại.
|
|
|
23
23
|
thành `SB_SITE` và mọi tool sau đó mặc định dùng site đó. Không có nó thì model phải mang
|
|
24
24
|
theo id suốt phiên, mà cách duy nhất để lấy là liệt kê trang rồi đọc ngược ra.
|
|
25
25
|
|
|
26
|
+
`--site-name "Tên Cửa Hàng"` đi kèm, được ghi thành `SB_SITE_NAME`. Nó là một nhãn, không phải
|
|
27
|
+
địa chỉ — không có gì phân giải theo nó — nhưng nhờ nó agent gọi được tên cửa hàng thay vì
|
|
28
|
+
đọc lại một id 32 ký tự bạn không đặt. Màn hình **Apps → AI agent** tự thêm nó khi cửa hàng
|
|
29
|
+
có tên.
|
|
30
|
+
|
|
26
31
|
Nó **gộp**: các server đã có trong file được giữ nguyên, thứ nó thay thế được chép sang
|
|
27
32
|
`<file>.sbuilder-backup`, và một config nó không đọc được thì bị từ chối chứ không ghi đè —
|
|
28
33
|
một file thừa dấu phẩy khả dĩ hơn nhiều một file đáng vứt, và đó chính là thứ bạn cần để sửa.
|
|
@@ -66,7 +71,7 @@ là "tài khoản của người này".
|
|
|
66
71
|
| --- | --- |
|
|
67
72
|
| `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 |
|
|
68
73
|
| `sb_site_list` | Liệt kê site tài khoản vận hành được |
|
|
69
|
-
| `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à
|
|
74
|
+
| `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ác trường body đọc thẳng từ handler decode chúng, mỗi trường mang theo cái bẫy doc comment của chính nó ghi lại |
|
|
70
75
|
| `sb_api_call` | Chạy một operation. Mặc định chạy khô, không gửi gì |
|
|
71
76
|
| `sb_page_open` | Mở một trang để sửa và trả về outline |
|
|
72
77
|
| `sb_outline` | Trang đang mở dạng cây nén — không bao giờ dump tài liệu thô |
|
|
@@ -90,8 +95,11 @@ là "tài khoản của người này".
|
|
|
90
95
|
| `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 |
|
|
91
96
|
| `sb_event` | Gắn click action cho một node — mở giỏ, sang trang, mở pop-up |
|
|
92
97
|
| `sb_bind` | Gắn nội dung một node vào dữ liệu cửa hàng thật, hoặc biến một nút thành nút thêm vào giỏ |
|
|
98
|
+
| `sb_store` | Chạy một luồng cửa hàng bắt buộc đúng thứ tự — hiện là bốn lệnh ghi tạo nên một trang thanh toán hoạt động |
|
|
99
|
+
| `sb_undo` | Trả lại thứ mà một lệnh PUT đã ghi đè — nền tảng không có lịch sử trang hay restore, nên đây là đường về duy nhất |
|
|
93
100
|
|
|
94
|
-
Hai mươi
|
|
101
|
+
Hai mươi tám tool, **484 operation API** (158 trong 212 lệnh ghi có hình dạng body đọc thẳng
|
|
102
|
+
từ handler), 107 element, 77 nguồn binding. `sb_api_find` là
|
|
95
103
|
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
|
|
96
104
|
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
|
|
97
105
|
`npm run codegen` kế tiếp.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const SWAGGER_SOURCE = {
|
|
2
|
-
"operations":
|
|
2
|
+
"operations": 484,
|
|
3
3
|
"definitions": 99,
|
|
4
4
|
"bodyCarrying": 171,
|
|
5
5
|
"bodyUndescribed": 62,
|
|
@@ -10625,6 +10625,48 @@ export const API_OPERATIONS = [
|
|
|
10625
10625
|
"bodyRef": null,
|
|
10626
10626
|
"credential": "siteScoped"
|
|
10627
10627
|
},
|
|
10628
|
+
{
|
|
10629
|
+
"id": "get:/api/sites/{siteId}/relation-slots",
|
|
10630
|
+
"method": "GET",
|
|
10631
|
+
"path": "/api/sites/{siteId}/relation-slots",
|
|
10632
|
+
"tags": [
|
|
10633
|
+
"relations"
|
|
10634
|
+
],
|
|
10635
|
+
"summary": "Curated relation slots and their picks",
|
|
10636
|
+
"params": [
|
|
10637
|
+
{
|
|
10638
|
+
"name": "siteId",
|
|
10639
|
+
"in": "path",
|
|
10640
|
+
"required": true,
|
|
10641
|
+
"type": "string",
|
|
10642
|
+
"description": "Site ID"
|
|
10643
|
+
}
|
|
10644
|
+
],
|
|
10645
|
+
"bodyDescribed": false,
|
|
10646
|
+
"bodyRef": null,
|
|
10647
|
+
"credential": "siteScoped"
|
|
10648
|
+
},
|
|
10649
|
+
{
|
|
10650
|
+
"id": "post:/api/sites/{siteId}/restore",
|
|
10651
|
+
"method": "POST",
|
|
10652
|
+
"path": "/api/sites/{siteId}/restore",
|
|
10653
|
+
"tags": [
|
|
10654
|
+
"sites"
|
|
10655
|
+
],
|
|
10656
|
+
"summary": "Restore a site from the trash",
|
|
10657
|
+
"params": [
|
|
10658
|
+
{
|
|
10659
|
+
"name": "siteId",
|
|
10660
|
+
"in": "path",
|
|
10661
|
+
"required": true,
|
|
10662
|
+
"type": "string",
|
|
10663
|
+
"description": "Site ID"
|
|
10664
|
+
}
|
|
10665
|
+
],
|
|
10666
|
+
"bodyDescribed": false,
|
|
10667
|
+
"bodyRef": null,
|
|
10668
|
+
"credential": "siteScoped"
|
|
10669
|
+
},
|
|
10628
10670
|
{
|
|
10629
10671
|
"id": "get:/api/sites/{siteId}/returns",
|
|
10630
10672
|
"method": "GET",
|
|
@@ -12113,6 +12155,27 @@ export const API_OPERATIONS = [
|
|
|
12113
12155
|
"bodyRef": null,
|
|
12114
12156
|
"credential": "siteScoped"
|
|
12115
12157
|
},
|
|
12158
|
+
{
|
|
12159
|
+
"id": "delete:/api/sites/{siteId}/trash",
|
|
12160
|
+
"method": "DELETE",
|
|
12161
|
+
"path": "/api/sites/{siteId}/trash",
|
|
12162
|
+
"tags": [
|
|
12163
|
+
"sites"
|
|
12164
|
+
],
|
|
12165
|
+
"summary": "Permanently delete a site that is in the trash",
|
|
12166
|
+
"params": [
|
|
12167
|
+
{
|
|
12168
|
+
"name": "siteId",
|
|
12169
|
+
"in": "path",
|
|
12170
|
+
"required": true,
|
|
12171
|
+
"type": "string",
|
|
12172
|
+
"description": "Site ID"
|
|
12173
|
+
}
|
|
12174
|
+
],
|
|
12175
|
+
"bodyDescribed": false,
|
|
12176
|
+
"bodyRef": null,
|
|
12177
|
+
"credential": "siteScoped"
|
|
12178
|
+
},
|
|
12116
12179
|
{
|
|
12117
12180
|
"id": "get:/api/sites/{siteId}/webhooks",
|
|
12118
12181
|
"method": "GET",
|