sbuilder-mcp 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ 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.4.0] - 2026-09-08
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- sb_review reports a catalogue gap when a site has no active products, since every repeater on the site renders its empty state and the product template is bound to nothing on a store that otherwise reports ready.
|
|
13
|
+
- sb_review reports the same catalogue gap when every active product is priced at zero, since a zero-priced product still renders, adds to the cart and totals nothing.
|
|
14
|
+
|
|
9
15
|
## [0.3.0] - 2026-09-08
|
|
10
16
|
|
|
11
17
|
### Added
|
package/CHANGELOG.vi.md
CHANGED
|
@@ -6,6 +6,12 @@ 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.4.0] - 2026-09-08
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- sb_review giờ báo cáo gap catalogue khi site chưa có sản phẩm active nào, vì mọi repeater trên site sẽ render trạng thái rỗng và product template không bind vào đâu cả trên một cửa hàng vốn báo cáo là đã sẵn sàng.
|
|
13
|
+
- sb_review giờ báo cáo cùng gap catalogue khi mọi sản phẩm active đều có giá bằng không, vì một sản phẩm giá 0 vẫn render, vẫn thêm được vào giỏ hàng và tổng đơn hàng bằng không.
|
|
14
|
+
|
|
9
15
|
## [0.3.0] - 2026-09-08
|
|
10
16
|
|
|
11
17
|
### Added
|
|
@@ -24,11 +24,16 @@ export async function gatherReadiness(ctx, siteId, pageNodes) {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
const site = encodeURIComponent(siteId);
|
|
27
|
-
const [pageList, gateways, shipping, globals] = await Promise.all([
|
|
27
|
+
const [pageList, gateways, shipping, globals, productList] = await Promise.all([
|
|
28
28
|
get(`/api/sites/${site}/pages`),
|
|
29
29
|
get(`/api/sites/${site}/payment-gateways`),
|
|
30
30
|
get(`/api/sites/${site}/shipping-methods`),
|
|
31
31
|
get(`/api/sites/${site}/global-sections`),
|
|
32
|
+
// The SITE-SCOPED list, not /api/v1/products: this one takes either
|
|
33
|
+
// credential, so the check answers for a session install as well as a
|
|
34
|
+
// key-only one. A page is enough to tell empty from not; `total` carries the
|
|
35
|
+
// real count when the platform sends it.
|
|
36
|
+
get(`/api/sites/${site}/products?limit=200`),
|
|
32
37
|
]);
|
|
33
38
|
// A gateway counts only when it is BOTH enabled and configured — the editor's
|
|
34
39
|
// `live` getter also filters by the store's currency, which is a narrowing:
|
|
@@ -42,8 +47,19 @@ export async function gatherReadiness(ctx, siteId, pageNodes) {
|
|
|
42
47
|
const globalNodes = globals?.globalSections
|
|
43
48
|
? globals.globalSections.flatMap((g) => Object.values(g.document?.nodes ?? {}))
|
|
44
49
|
: null;
|
|
50
|
+
// ACTIVE means a shopper can see it; PURCHASABLE adds a price above zero. A
|
|
51
|
+
// product priced at zero renders, adds to the cart, and totals nothing — which
|
|
52
|
+
// reads as a working store right up to the money.
|
|
53
|
+
const rows = productList?.products;
|
|
54
|
+
const products = Array.isArray(rows)
|
|
55
|
+
? {
|
|
56
|
+
active: rows.filter((p) => (p.status ?? 'active') === 'active').length,
|
|
57
|
+
purchasable: rows.filter((p) => (p.status ?? 'active') === 'active' && (p.priceCents ?? 0) > 0).length,
|
|
58
|
+
}
|
|
59
|
+
: null;
|
|
45
60
|
return {
|
|
46
61
|
pages: pageList?.pages ?? null,
|
|
62
|
+
products,
|
|
47
63
|
liveGateways,
|
|
48
64
|
shippingMethods,
|
|
49
65
|
pageNodes,
|
|
@@ -100,6 +100,30 @@ export function readinessGaps(input) {
|
|
|
100
100
|
: 'Create a page of type "product" and publish it.',
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
+
// NOTHING TO SELL. Checked before the delivery option, because a shipping
|
|
104
|
+
// method for an empty catalogue is furniture.
|
|
105
|
+
if (input.products) {
|
|
106
|
+
if (input.products.active === 0) {
|
|
107
|
+
gaps.push({
|
|
108
|
+
id: 'catalogue',
|
|
109
|
+
draft: false,
|
|
110
|
+
problem: 'The store has no active products. Every product list on the site renders its empty ' +
|
|
111
|
+
'state, the product template has nothing to bind to, and there is nothing to add to a ' +
|
|
112
|
+
'cart — on a site that otherwise reports ready.',
|
|
113
|
+
fix: 'Create products (sb_api_find "create product"). priceCents is minor units — VND × 100.',
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
else if (input.products.purchasable === 0) {
|
|
117
|
+
gaps.push({
|
|
118
|
+
id: 'catalogue',
|
|
119
|
+
draft: false,
|
|
120
|
+
problem: `All ${input.products.active} active products are priced at zero. They render, they add ` +
|
|
121
|
+
'to the cart, and the order totals nothing — which reads as a working store right up ' +
|
|
122
|
+
'to the money.',
|
|
123
|
+
fix: 'Set priceCents on each product and its variants. Minor units: VND × 100.',
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
103
127
|
if (input.shippingMethods === 0) {
|
|
104
128
|
gaps.push({
|
|
105
129
|
id: 'shipping',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sbuilder-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "MCP server that designs and operates a Store Builder site — pages, data, theme and publish — through the platform's own API and live-edit protocol.",
|
|
5
5
|
"mcpName": "io.github.vuluu2k/sbuilder-mcp",
|
|
6
6
|
"type": "module",
|