sbuilder-mcp 0.5.0 → 0.7.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 +20 -0
- package/CHANGELOG.vi.md +20 -0
- package/README.md +2 -1
- package/README.vi.md +2 -1
- package/dist/catalog/api.generated.js +160 -6
- package/dist/catalog/checkout.generated.js +5071 -0
- package/dist/catalog/elements.generated.js +716 -1
- package/dist/catalog/shapes.generated.js +81 -13
- package/dist/domains/site/importmap.js +237 -0
- package/dist/domains/site/review.js +14 -1
- package/dist/server.js +2 -0
- package/dist/tools/importpage.js +124 -0
- package/dist/tools/store.js +112 -4
- package/dist/vision/capture.js +170 -0
- package/dist/vision/shoot.js +10 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,26 @@ 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.7.0] - 2026-09-08
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- sb_import reads any public URL and adds its structure and content to the open page as real elements — section, heading, text, image, button, list — dressed in that page's own tokens (ink and weight off the first heading, colour and size off the first body line, fill and radius off the first non-transparent button) instead of embedding the source's raw markup. An image is bounded in both axes rather than only capped in width, since an SVG has no intrinsic pixel size and would otherwise stretch a section into thousands of pixels of empty space; each image is uploaded into the site's own media library, falling back to the original URL on a failed upload, and a failure is reported grouped and counted by reason rather than as a bare count. dry_run (the default) returns what was found before anything is added.
|
|
13
|
+
- npm run codegen:check runs the catalog generator against a committed platform ref and writes nothing, exiting 1 and naming every file that would change, so a stale catalog is caught before a tool starts describing an element or operation the platform no longer has.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- The element and API catalog is regenerated: adds the bundle-items element and the kind, bundlePricing, bundleValue and bundleItems fields on a product, plus a set of relation-slot operations and a storefront-string levelling command; sb_api_find's token budget ceiling is raised to 3,500 to hold the larger product call sheet.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- sb_look can now photograph a node whose box sits below roughly the first 900px of the page; a clip request previously ran against the viewport alone and failed with Playwright's "Clipped area is either empty or outside the resulting image" for anything further down, and it now captures the full page first so the clip lines up regardless of where the node sits.
|
|
20
|
+
|
|
21
|
+
## [0.6.0] - 2026-09-08
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- sb_store now takes action:"form" alongside action:"checkout", seeding any of the platform's 17 form templates (contact, subscribe, order, address, consult, booking, stay, feedback, event, quote, apply, and the five auth forms login, register, forgot, verify, reset) with their own field document, instead of the checkout order form being the only one this server could build; it creates the form, PUTs it back whole (a bare create is otherwise silently renamed and turned custom), then saves the template's field document, deleting the form again if either write fails. It makes no page, since where a login form belongs is a design decision — place it with sb_add and point specials.formId at the id returned.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- sb_review no longer reports empty_container on a global section's or app block's reference node, since a page stores its shared header or footer as an empty node stamped globalRef or appBlockRef that the platform composes the master into on read; the fix the finding used to name, adding something inside it, was decomposed away by the very next save.
|
|
28
|
+
|
|
9
29
|
## [0.5.0] - 2026-09-08
|
|
10
30
|
|
|
11
31
|
### Added
|
package/CHANGELOG.vi.md
CHANGED
|
@@ -6,6 +6,26 @@ 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.7.0] - 2026-09-08
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- sb_import đọc bất kỳ URL công khai nào và thêm cấu trúc, nội dung của nó vào trang đang mở dưới dạng các element thật — section, heading, text, image, button, list — được khoác token của chính trang đó (màu và độ đậm lấy từ heading đầu tiên, màu và cỡ chữ lấy từ dòng văn bản đầu tiên, màu nền và bo góc lấy từ nút không trong suốt đầu tiên) thay vì nhúng nguyên markup của nguồn. Một ảnh được giới hạn kích thước ở cả hai chiều thay vì chỉ giới hạn chiều rộng, vì một SVG không có kích thước pixel nội tại nên nếu không sẽ kéo dài cả một section thành hàng nghìn pixel khoảng trắng; mỗi ảnh được tải lên thư viện media của chính site, giữ nguyên URL gốc nếu upload thất bại, và một lỗi upload được báo cáo theo nhóm và đếm theo lý do thay vì chỉ là một con số trần trụi. dry_run (mặc định) trả về những gì tìm thấy trước khi thêm bất cứ thứ gì.
|
|
13
|
+
- npm run codegen:check chạy trình sinh catalog dựa trên một ref đã commit của nền tảng và không ghi gì cả, thoát với mã 1 và nêu tên mọi file sẽ thay đổi, để một catalog cũ được phát hiện trước khi một tool bắt đầu mô tả một element hay operation mà nền tảng không còn nữa.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Catalog element và API được tạo lại: thêm element bundle-items cùng các trường kind, bundlePricing, bundleValue và bundleItems trên một sản phẩm, cùng một loạt operation cho relation-slot và lệnh làm phẳng chuỗi storefront; trần token budget của sb_api_find được nâng lên 3.500 để chứa call sheet sản phẩm lớn hơn.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- sb_look giờ có thể chụp được một node có box nằm dưới khoảng 900px đầu tiên của trang; trước đây một yêu cầu clip chỉ chạy trên viewport và thất bại với lỗi "Clipped area is either empty or outside the resulting image" của Playwright với bất kỳ node nào nằm xa hơn, và giờ nó chụp toàn trang trước để tọa độ clip khớp bất kể node nằm ở đâu.
|
|
20
|
+
|
|
21
|
+
## [0.6.0] - 2026-09-08
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
- sb_store giờ nhận action:"form" bên cạnh action:"checkout", gieo bất kỳ template nào trong 17 template form của nền tảng (contact, subscribe, order, address, consult, booking, stay, feedback, event, quote, apply, và năm form xác thực login, register, forgot, verify, reset) cùng field document riêng của nó, thay vì trước đây server này chỉ dựng được đúng order form của checkout; nó tạo form, PUT lại nguyên vẹn (nếu không thì một lần tạo đơn thuần sẽ bị âm thầm đổi tên và chuyển thành custom), rồi lưu field document của template, và xoá lại form nếu một trong hai lệnh ghi đó thất bại. Nó không tạo trang, vì đặt form login ở đâu là quyết định thiết kế — hãy đặt form bằng sb_add rồi trỏ specials.formId vào id được trả về.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- sb_review không còn báo cáo empty_container trên node tham chiếu của một global section hay app block, vì một trang lưu header hoặc footer dùng chung dưới dạng node rỗng gắn cờ globalRef hoặc appBlockRef mà nền tảng sẽ ghép bản gốc vào khi đọc; cách sửa mà finding này từng nêu ra — thêm gì đó vào bên trong — sẽ bị lần lưu kế tiếp phân rã mất ngay.
|
|
28
|
+
|
|
9
29
|
## [0.5.0] - 2026-09-08
|
|
10
30
|
|
|
11
31
|
### Added
|
package/README.md
CHANGED
|
@@ -98,7 +98,8 @@ make, because those mean "this person's account".
|
|
|
98
98
|
| `sb_look` | Save, render, and return screenshots plus measured node boxes and layout defects measured on the render |
|
|
99
99
|
| `sb_event` | Give a node a click action — open the cart, go to a page, open a pop-up |
|
|
100
100
|
| `sb_bind` | Bind a node's content to real store data, or make a button add to the cart |
|
|
101
|
-
| `
|
|
101
|
+
| `sb_import` | Read a page from any public URL and add its structure and content to the open page as real elements, styled with THIS page's own tokens — a translation, not a clone |
|
|
102
|
+
| `sb_store` | Run a store flow that must happen in a fixed order — the four writes that make a working checkout, or any of the platform's 17 form templates (login, register, forgot, contact, subscribe …) with its own field document |
|
|
102
103
|
| `sb_undo` | Put back what a PUT replaced — the platform has no page history or restore, so this is the only way back |
|
|
103
104
|
|
|
104
105
|
Twenty-eight tools, **484 API operations** (158 of the 212 writes carrying a body shape read
|
package/README.vi.md
CHANGED
|
@@ -95,7 +95,8 @@ là "tài khoản của người này".
|
|
|
95
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 |
|
|
96
96
|
| `sb_event` | Gắn click action cho một node — mở giỏ, sang trang, mở pop-up |
|
|
97
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
|
-
| `
|
|
98
|
+
| `sb_import` | Đọc một trang từ URL công khai bất kỳ và thêm cấu trúc + nội dung của nó vào trang đang mở dưới dạng element thật, mang token của CHÍNH trang này — là dịch lại, không phải sao chép |
|
|
99
|
+
| `sb_store` | Chạy một luồng cửa hàng bắt buộc đúng thứ tự — bốn lệnh ghi tạo nên trang thanh toán, hoặc gieo bất kỳ template nào trong 17 form của nền tảng (login, register, forgot, contact, subscribe …) kèm field document của nó |
|
|
99
100
|
| `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 |
|
|
100
101
|
|
|
101
102
|
Hai mươi tám tool, **484 operation API** (158 trong 212 lệnh ghi có hình dạng body đọc thẳng
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const SWAGGER_SOURCE = {
|
|
2
|
-
"operations":
|
|
3
|
-
"definitions":
|
|
4
|
-
"bodyCarrying":
|
|
5
|
-
"bodyUndescribed":
|
|
2
|
+
"operations": 486,
|
|
3
|
+
"definitions": 102,
|
|
4
|
+
"bodyCarrying": 172,
|
|
5
|
+
"bodyUndescribed": 63,
|
|
6
6
|
"generatedFrom": "server/docs/swagger.json"
|
|
7
7
|
};
|
|
8
8
|
export const API_OPERATIONS = [
|
|
@@ -10226,14 +10226,58 @@ export const API_OPERATIONS = [
|
|
|
10226
10226
|
"bodyRef": "github_com_webbuilder_server_internal_products.Product",
|
|
10227
10227
|
"credential": "siteScoped"
|
|
10228
10228
|
},
|
|
10229
|
+
{
|
|
10230
|
+
"id": "get:/api/sites/{siteId}/products/{id}/bundles",
|
|
10231
|
+
"method": "GET",
|
|
10232
|
+
"path": "/api/sites/{siteId}/products/{id}/bundles",
|
|
10233
|
+
"tags": [
|
|
10234
|
+
"products",
|
|
10235
|
+
"products"
|
|
10236
|
+
],
|
|
10237
|
+
"summary": "Bundles containing a product",
|
|
10238
|
+
"params": [
|
|
10239
|
+
{
|
|
10240
|
+
"name": "siteId",
|
|
10241
|
+
"in": "path",
|
|
10242
|
+
"required": true,
|
|
10243
|
+
"type": "string",
|
|
10244
|
+
"description": "Site ID"
|
|
10245
|
+
},
|
|
10246
|
+
{
|
|
10247
|
+
"name": "body",
|
|
10248
|
+
"in": "body",
|
|
10249
|
+
"required": false,
|
|
10250
|
+
"type": "object",
|
|
10251
|
+
"description": "Category IDs to set (PUT only): {\\"
|
|
10252
|
+
},
|
|
10253
|
+
{
|
|
10254
|
+
"name": "siteId",
|
|
10255
|
+
"in": "path",
|
|
10256
|
+
"required": true,
|
|
10257
|
+
"type": "string",
|
|
10258
|
+
"description": "Site ID"
|
|
10259
|
+
},
|
|
10260
|
+
{
|
|
10261
|
+
"name": "id",
|
|
10262
|
+
"in": "path",
|
|
10263
|
+
"required": true,
|
|
10264
|
+
"type": "string",
|
|
10265
|
+
"description": "Product ID"
|
|
10266
|
+
}
|
|
10267
|
+
],
|
|
10268
|
+
"bodyDescribed": false,
|
|
10269
|
+
"bodyRef": null,
|
|
10270
|
+
"credential": "siteScoped"
|
|
10271
|
+
},
|
|
10229
10272
|
{
|
|
10230
10273
|
"id": "get:/api/sites/{siteId}/products/{productId}/categories",
|
|
10231
10274
|
"method": "GET",
|
|
10232
10275
|
"path": "/api/sites/{siteId}/products/{productId}/categories",
|
|
10233
10276
|
"tags": [
|
|
10277
|
+
"products",
|
|
10234
10278
|
"products"
|
|
10235
10279
|
],
|
|
10236
|
-
"summary": "
|
|
10280
|
+
"summary": "Bundles containing a product",
|
|
10237
10281
|
"params": [
|
|
10238
10282
|
{
|
|
10239
10283
|
"name": "siteId",
|
|
@@ -10255,6 +10299,13 @@ export const API_OPERATIONS = [
|
|
|
10255
10299
|
"required": false,
|
|
10256
10300
|
"type": "object",
|
|
10257
10301
|
"description": "Category IDs to set (PUT only): {\\"
|
|
10302
|
+
},
|
|
10303
|
+
{
|
|
10304
|
+
"name": "siteId",
|
|
10305
|
+
"in": "path",
|
|
10306
|
+
"required": true,
|
|
10307
|
+
"type": "string",
|
|
10308
|
+
"description": "Site ID"
|
|
10258
10309
|
}
|
|
10259
10310
|
],
|
|
10260
10311
|
"bodyDescribed": false,
|
|
@@ -10266,9 +10317,10 @@ export const API_OPERATIONS = [
|
|
|
10266
10317
|
"method": "PUT",
|
|
10267
10318
|
"path": "/api/sites/{siteId}/products/{productId}/categories",
|
|
10268
10319
|
"tags": [
|
|
10320
|
+
"products",
|
|
10269
10321
|
"products"
|
|
10270
10322
|
],
|
|
10271
|
-
"summary": "
|
|
10323
|
+
"summary": "Bundles containing a product",
|
|
10272
10324
|
"params": [
|
|
10273
10325
|
{
|
|
10274
10326
|
"name": "siteId",
|
|
@@ -10290,6 +10342,13 @@ export const API_OPERATIONS = [
|
|
|
10290
10342
|
"required": false,
|
|
10291
10343
|
"type": "object",
|
|
10292
10344
|
"description": "Category IDs to set (PUT only): {\\"
|
|
10345
|
+
},
|
|
10346
|
+
{
|
|
10347
|
+
"name": "siteId",
|
|
10348
|
+
"in": "path",
|
|
10349
|
+
"required": true,
|
|
10350
|
+
"type": "string",
|
|
10351
|
+
"description": "Site ID"
|
|
10293
10352
|
}
|
|
10294
10353
|
],
|
|
10295
10354
|
"bodyDescribed": false,
|
|
@@ -10646,6 +10705,34 @@ export const API_OPERATIONS = [
|
|
|
10646
10705
|
"bodyRef": null,
|
|
10647
10706
|
"credential": "siteScoped"
|
|
10648
10707
|
},
|
|
10708
|
+
{
|
|
10709
|
+
"id": "get:/api/sites/{siteId}/relation-slots/usage",
|
|
10710
|
+
"method": "GET",
|
|
10711
|
+
"path": "/api/sites/{siteId}/relation-slots/usage",
|
|
10712
|
+
"tags": [
|
|
10713
|
+
"relations"
|
|
10714
|
+
],
|
|
10715
|
+
"summary": "How many curated shelves reference an item",
|
|
10716
|
+
"params": [
|
|
10717
|
+
{
|
|
10718
|
+
"name": "siteId",
|
|
10719
|
+
"in": "path",
|
|
10720
|
+
"required": true,
|
|
10721
|
+
"type": "string",
|
|
10722
|
+
"description": "Site ID"
|
|
10723
|
+
},
|
|
10724
|
+
{
|
|
10725
|
+
"name": "itemId",
|
|
10726
|
+
"in": "query",
|
|
10727
|
+
"required": true,
|
|
10728
|
+
"type": "string",
|
|
10729
|
+
"description": "Product or article id"
|
|
10730
|
+
}
|
|
10731
|
+
],
|
|
10732
|
+
"bodyDescribed": false,
|
|
10733
|
+
"bodyRef": null,
|
|
10734
|
+
"credential": "siteScoped"
|
|
10735
|
+
},
|
|
10649
10736
|
{
|
|
10650
10737
|
"id": "post:/api/sites/{siteId}/restore",
|
|
10651
10738
|
"method": "POST",
|
|
@@ -15482,6 +15569,36 @@ export const API_DEFINITIONS = {
|
|
|
15482
15569
|
}
|
|
15483
15570
|
}
|
|
15484
15571
|
},
|
|
15572
|
+
"github_com_webbuilder_server_internal_products.BundleItem": {
|
|
15573
|
+
"type": "object",
|
|
15574
|
+
"properties": {
|
|
15575
|
+
"position": {
|
|
15576
|
+
"description": "Position is the merchant's arrangement — the order the components are\nlisted on the product page.",
|
|
15577
|
+
"type": "integer"
|
|
15578
|
+
},
|
|
15579
|
+
"productId": {
|
|
15580
|
+
"type": "string"
|
|
15581
|
+
},
|
|
15582
|
+
"quantity": {
|
|
15583
|
+
"description": "Quantity is how many units of the component one combo contains (≥ 1).",
|
|
15584
|
+
"type": "integer"
|
|
15585
|
+
},
|
|
15586
|
+
"variantId": {
|
|
15587
|
+
"type": "string"
|
|
15588
|
+
}
|
|
15589
|
+
}
|
|
15590
|
+
},
|
|
15591
|
+
"github_com_webbuilder_server_internal_products.BundlePricing": {
|
|
15592
|
+
"type": "string",
|
|
15593
|
+
"enum": [
|
|
15594
|
+
"fixed",
|
|
15595
|
+
"percent"
|
|
15596
|
+
],
|
|
15597
|
+
"x-enum-varnames": [
|
|
15598
|
+
"BundlePricingFixed",
|
|
15599
|
+
"BundlePricingPercent"
|
|
15600
|
+
]
|
|
15601
|
+
},
|
|
15485
15602
|
"github_com_webbuilder_server_internal_products.MetaTag": {
|
|
15486
15603
|
"type": "object",
|
|
15487
15604
|
"properties": {
|
|
@@ -15533,6 +15650,24 @@ export const API_DEFINITIONS = {
|
|
|
15533
15650
|
"brand": {
|
|
15534
15651
|
"type": "string"
|
|
15535
15652
|
},
|
|
15653
|
+
"bundleItems": {
|
|
15654
|
+
"description": "BundleItems is what one combo contains. Empty on every simple product, and\non a combo a merchant has not finished building — which is authorable but\nnot sellable (ApplyBundleTotals).",
|
|
15655
|
+
"type": "array",
|
|
15656
|
+
"items": {
|
|
15657
|
+
"$ref": "#/definitions/github_com_webbuilder_server_internal_products.BundleItem"
|
|
15658
|
+
}
|
|
15659
|
+
},
|
|
15660
|
+
"bundlePricing": {
|
|
15661
|
+
"description": "BundlePricing and BundleValue are how a combo is priced: a flat price in\ncents (\"fixed\") or a percentage off the components' total (\"percent\",\n0–100). The two share one Value field for the reason discounts.Discount\ndoes — the unit is a function of the mode, and two fields would let a\nmerchant leave the unused one holding a number that means nothing.\n\nBoth are ignored (and cleared) on a simple product.",
|
|
15662
|
+
"allOf": [
|
|
15663
|
+
{
|
|
15664
|
+
"$ref": "#/definitions/github_com_webbuilder_server_internal_products.BundlePricing"
|
|
15665
|
+
}
|
|
15666
|
+
]
|
|
15667
|
+
},
|
|
15668
|
+
"bundleValue": {
|
|
15669
|
+
"type": "integer"
|
|
15670
|
+
},
|
|
15536
15671
|
"compareAtCents": {
|
|
15537
15672
|
"description": "CompareAt of the min-price visible variant; 0 = none",
|
|
15538
15673
|
"type": "integer"
|
|
@@ -15558,6 +15693,14 @@ export const API_DEFINITIONS = {
|
|
|
15558
15693
|
"type": "string"
|
|
15559
15694
|
}
|
|
15560
15695
|
},
|
|
15696
|
+
"kind": {
|
|
15697
|
+
"description": "Kind says whether this is an ordinary product or a COMBO whose price and\navailability are derived from the components in BundleItems. Absent on the\nwire means simple — see bundle.go, which owns every rule below.",
|
|
15698
|
+
"allOf": [
|
|
15699
|
+
{
|
|
15700
|
+
"$ref": "#/definitions/github_com_webbuilder_server_internal_products.ProductKind"
|
|
15701
|
+
}
|
|
15702
|
+
]
|
|
15703
|
+
},
|
|
15561
15704
|
"moneyOverride": {
|
|
15562
15705
|
"description": "MoneyOverride is an opaque per-product money-display override (compact-convert\nrules + exchange-rate overrides), stored as a JSONB blob. The domain keeps it\nopaque — it is decoded at the render boundary (bindings.ProductSource →\nrender.ProductData) — so products stays decoupled from render/money, the same\nway the site settings document is an opaque blob. Empty ({}/null) → no override.",
|
|
15563
15706
|
"type": "array",
|
|
@@ -15694,6 +15837,17 @@ export const API_DEFINITIONS = {
|
|
|
15694
15837
|
}
|
|
15695
15838
|
}
|
|
15696
15839
|
},
|
|
15840
|
+
"github_com_webbuilder_server_internal_products.ProductKind": {
|
|
15841
|
+
"type": "string",
|
|
15842
|
+
"enum": [
|
|
15843
|
+
"simple",
|
|
15844
|
+
"bundle"
|
|
15845
|
+
],
|
|
15846
|
+
"x-enum-varnames": [
|
|
15847
|
+
"ProductKindSimple",
|
|
15848
|
+
"ProductKindBundle"
|
|
15849
|
+
]
|
|
15850
|
+
},
|
|
15697
15851
|
"github_com_webbuilder_server_internal_products.ProductStatus": {
|
|
15698
15852
|
"type": "string",
|
|
15699
15853
|
"enum": [
|