webcake-storefront-mcp 1.18.0 → 1.18.1
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/dist/builder/guide.js +43 -0
- package/dist/changelog.json +7 -7
- package/dist/server.js +2 -0
- package/dist/tools/builder.js +4 -1
- package/package.json +1 -1
package/dist/builder/guide.js
CHANGED
|
@@ -158,6 +158,49 @@ Rule of thumb: if the page shows products, a cart, customer/order data, or blog
|
|
|
158
158
|
set \`type\` accordingly so the binding source is turned on. A binding target like
|
|
159
159
|
\`product::product_price\` REQUIRES its page to be the matching type.
|
|
160
160
|
|
|
161
|
+
## Build the WHOLE storefront — every page to the SAME standard (NOT just the home page)
|
|
162
|
+
A shop is multi-page. Build EACH page to a real e-commerce standard with the same palette,
|
|
163
|
+
spacing and header/footer — never leave the home page rich and the rest as bare stubs.
|
|
164
|
+
\`scaffold_store_pages\` creates FUNCTIONAL but MINIMAL pages (a heading + the binding element);
|
|
165
|
+
treat them as STARTERS to enrich, not the finished page. After scaffolding, rebuild each page's
|
|
166
|
+
source so it looks designed:
|
|
167
|
+
- Category (collections, type store): banner + heading + grid-product (+ optional intro/CTA).
|
|
168
|
+
- Product detail (products, type store): 2-col [product-gallery | info: text-dataset
|
|
169
|
+
product::product_name + product_price/original_price + short_description, quantity-input,
|
|
170
|
+
"Thêm vào giỏ" (add_to_cart) + "Mua ngay" (buy_now), trust badges] then a description/feature
|
|
171
|
+
band then a related grid-product ("Có thể bạn cũng thích").
|
|
172
|
+
- Cart (cart, type store): heading + 2-col [cart-items | order-summary card with a
|
|
173
|
+
"Tiến hành thanh toán" button -> { action:"open_page", open_page_id:<checkout> }] + continue link.
|
|
174
|
+
- Checkout (checkout, type store): heading + 2-col [form{type:form_order} with input/
|
|
175
|
+
phone-number/email/address + submit-button "Đặt hàng" | order summary (cart-items)].
|
|
176
|
+
- Thank-you (complete, type store): centred confirmation + order-items + continue-shopping.
|
|
177
|
+
- Optional: About / Contact (custom), Blog (type blog: post-list) + Post.
|
|
178
|
+
Reuse the SAME section helpers, palette and card styling as the home page so the whole site
|
|
179
|
+
feels like ONE design.
|
|
180
|
+
|
|
181
|
+
## Global Header & Footer — create them for EVERY site (don't inline per page)
|
|
182
|
+
A header (logo/nav/cart) and footer (links/contact/copyright) belong on EVERY page, so make them
|
|
183
|
+
GLOBAL, not copied into each page. Build a header section + a footer section (new_section, same as
|
|
184
|
+
any section), then:
|
|
185
|
+
create_global_section({ type:"header", name:"Header", section:<headerSection> }) // top of every page
|
|
186
|
+
create_global_section({ type:"footer", name:"Footer", section:<footerSection> }) // bottom of every page
|
|
187
|
+
(omit page_ids to apply to ALL pages). ORDER MATTERS: build/save the page CONTENT first, THEN
|
|
188
|
+
create the globals — they embed into each page's source. If you later overwrite a page's source
|
|
189
|
+
(update_page_source/build_page) you WIPE its embedded header/footer, so re-create the globals
|
|
190
|
+
(delete_global_section by the section NODE id, then create once) to re-embed cleanly. Edit a global
|
|
191
|
+
later with update_global_section_element(s) and it updates on every page at once.
|
|
192
|
+
|
|
193
|
+
## Popups (newsletter / promo / age-gate)
|
|
194
|
+
A popup is a GLOBAL SOURCE, not a page section. Build it, store it, then trigger it:
|
|
195
|
+
1. Build the popup body (new_section: heading + text + form/input + a close button), then wrap it:
|
|
196
|
+
new_element("popup", { children:[<that section>], specials:{ /* trigger + overlay */ } }).
|
|
197
|
+
Trigger/behaviour (auto-open after a delay, exit-intent, only-once, overlay) lives in specials.
|
|
198
|
+
2. Save it: create_global_source({ component:"popup", source:{ sections:[<popupNode>] } }) -> returns its id.
|
|
199
|
+
3. Open/close from any element via events: a button { action:"open_popup", popup_id:"<id>", popup_overlay:true };
|
|
200
|
+
a close button inside { action:"close_popup", popup_id:"<id>" }; a form can auto-close on its
|
|
201
|
+
success trigger ({ eventName:"success", action:"close_popup", popup_id:"<id>" }).
|
|
202
|
+
List existing popups with list_global_sources({component:"popup"}); edit via update_global_source(_element).
|
|
203
|
+
|
|
161
204
|
## Workflow (do this every time)
|
|
162
205
|
1. Intake: confirm goal, brand, colours, sections wanted (ask 3-5 questions if unclear).
|
|
163
206
|
2. list_elements / get_element to pick the right component types.
|
package/dist/changelog.json
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "1.18.1",
|
|
4
|
+
"d": "25/06/2026",
|
|
5
|
+
"type": "Changed",
|
|
6
|
+
"en": "get_build_guide now includes three new sections: \"Build the WHOLE storefront\" with per-page recipes for enriching category, product detail, cart,…",
|
|
7
|
+
"vi": "get_build_guide nay bổ sung ba mục mới: \"Build the WHOLE storefront\" — công thức từng trang để nâng cấp danh mục, trang chi tiết sản phẩm, giỏ hàng,…"
|
|
8
|
+
},
|
|
2
9
|
{
|
|
3
10
|
"v": "1.18.0",
|
|
4
11
|
"d": "25/06/2026",
|
|
@@ -33,12 +40,5 @@
|
|
|
33
40
|
"type": "Fixed",
|
|
34
41
|
"en": "update_page_element, update_page_elements, update_global_source_element, and update_global_source_elements now normalize events and bindings arrays…",
|
|
35
42
|
"vi": "update_page_element, update_page_elements, update_global_source_element và update_global_source_elements nay chuẩn hóa mảng events và bindings khi…"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"v": "1.15.0",
|
|
39
|
-
"d": "24/06/2026",
|
|
40
|
-
"type": "Added",
|
|
41
|
-
"en": "New get_global_section tool returns a compact tree representation of a single global section (Header/Footer/block), listing each element's id, type,…",
|
|
42
|
-
"vi": "Tool mới get_global_section trả về cây phần tử dạng compact của một global section (Header/Footer/block), liệt kê id, type, text, class, binding và…"
|
|
43
43
|
}
|
|
44
44
|
]
|
package/dist/server.js
CHANGED
|
@@ -8,6 +8,8 @@ Tool discovery: the common tools (pages, builder, products, orders, blog, custom
|
|
|
8
8
|
|
|
9
9
|
You can also BUILD pages: use get_build_guide, list_elements, get_element to learn the BuilderX component model, new_section/new_element to compose, validate_page to check, then build_page (dry_run first) to create. Publishing is site-level via publish_site.
|
|
10
10
|
|
|
11
|
+
Build the WHOLE site, not just the home page: enrich EVERY page (category, product detail, cart, checkout, thank-you, …) to the same e-commerce standard with the same palette/header/footer — scaffold_store_pages makes MINIMAL starter pages, so design them properly afterwards. Make the Header and Footer GLOBAL (create_global_section type:"header"/"footer") so they're consistent on every page — don't inline them per page. For newsletter/promo offers, build a popup (a "popup" global_source) and open it with an open_popup event. See get_build_guide for the per-page recipes, the global-section order rules, and the popup workflow.
|
|
12
|
+
|
|
11
13
|
To make a generated site look real, also CREATE DATA so dataset bindings resolve: create_product_category + create_product (storefront), create_blog_category + create_article (blog). Get image URLs from search_images / upload_images first, then reference them. A good flow for a fresh site: create_site → create a few categories → create products in them → build_page (home + store/blog pages) → publish_site.
|
|
12
14
|
|
|
13
15
|
INTAKE FIRST — when the user asks to BUILD/CREATE a site, store, or page (a fresh build, not a small edit or a data question), do NOT jump straight to create_site/build_page on the same turn. Act as a professional shop-website designer doing client work: first ask ONE short batch of questions (call get_intake_guide for the exact list), restate the plan you'll build, get a "yes", THEN build. The shop owner is an ORDINARY person, not a designer — ask in plain words and visual outcomes ("tông nâu ấm, ảnh sản phẩm to"), never jargon. Ask the essentials (with sensible defaults so they answer fast): what they sell + a few products & prices, brand/shop name, primary color/style, which pages they need, real contact info (hotline/Zalo, address, email, hours) + the main call-to-action, and any promotion. NEVER invent or silently placeholder real data (shop name, products, prices, phone, address) — ask for it; placeholder only what the user explicitly skips, and tell them what to fill in. Skip intake only when the user already gave the brief, says "just do it / tự quyết", or it's a tiny edit.
|
package/dist/tools/builder.js
CHANGED
|
@@ -197,7 +197,10 @@ product/category/cart from any page lands on a real page instead of a 404.
|
|
|
197
197
|
Creates only the ones MISSING (matched by slug): Category (collections), Product (products),
|
|
198
198
|
Cart (cart), Checkout (checkout), Thank-you (complete) — all type 'store' (enables use_store),
|
|
199
199
|
plus optional member (login/register/profile) and blog (blog/post) pages.
|
|
200
|
-
Run this right after you create products/categories. dry_run=true (default) previews
|
|
200
|
+
Run this right after you create products/categories. dry_run=true (default) previews.
|
|
201
|
+
NOTE: these are MINIMAL STARTER pages (a heading + the binding element) — you MUST then
|
|
202
|
+
enrich EACH one to the same standard as the home page (see get_build_guide "Build the WHOLE
|
|
203
|
+
storefront"), and add a GLOBAL header/footer (create_global_section). Don't leave them bare.`, {
|
|
201
204
|
include_member: z.boolean().default(false).describe("Also create login/register/profile (type member, use_member)"),
|
|
202
205
|
include_blog: z.boolean().default(false).describe("Also create blog list + post pages (type blog, use_blog)"),
|
|
203
206
|
dry_run: z.boolean().default(true).describe("Preview (true) or actually create the missing pages (false)"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webcake-storefront-mcp",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.1",
|
|
4
4
|
"description": "MCP server for the WebCake/StoreCake storefront builder — page CRUD, page authoring, products, orders, and more",
|
|
5
5
|
"mcpName": "io.github.vuluu2k/webcake-storefront-mcp",
|
|
6
6
|
"license": "MIT",
|