webcake-landing-mcp 1.0.26 → 1.0.28
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/changelog.json +14 -14
- package/dist/http.js +9 -1
- package/dist/web-guide.js +9 -1
- package/package.json +1 -1
package/dist/changelog.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "1.0.28",
|
|
4
|
+
"d": "08/06/2026",
|
|
5
|
+
"type": "Fixed",
|
|
6
|
+
"en": "The GET / guide page no longer animates the browser's scroll-position restoration on reload; smooth scrolling is now enabled one animation frame…",
|
|
7
|
+
"vi": "Trang hướng dẫn GET / không còn tạo hiệu ứng cuộn cho quá trình trình duyệt khôi phục vị trí cuộn khi tải lại trang; smooth scrolling nay chỉ được…"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"v": "1.0.27",
|
|
11
|
+
"d": "08/06/2026",
|
|
12
|
+
"type": "Fixed",
|
|
13
|
+
"en": "The HTTP server's GET / route now serves the full HTML guide page to social and search crawlers (Facebook, Zalo, Twitter/X, LinkedIn, Slack,…",
|
|
14
|
+
"vi": "Route GET / của HTTP server nay phục vụ trang hướng dẫn HTML đầy đủ cho các crawler mạng xã hội và công cụ tìm kiếm (Facebook, Zalo, Twitter/X,…"
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"v": "1.0.26",
|
|
4
18
|
"d": "07/06/2026",
|
|
@@ -26,19 +40,5 @@
|
|
|
26
40
|
"type": "Added",
|
|
27
41
|
"en": "The GET / guide page now includes a dark/light theme toggle button in the header; the preference is saved in localStorage and applied before the…",
|
|
28
42
|
"vi": "Trang hướng dẫn GET / nay có nút chuyển chế độ sáng/tối trong header; lựa chọn được lưu vào localStorage và áp dụng trước khi trang hiển thị để…"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"v": "1.0.22",
|
|
32
|
-
"d": "07/06/2026",
|
|
33
|
-
"type": "Added",
|
|
34
|
-
"en": "New WEBCAKE_BUILDER_BASE environment variable, x-webcake-builder-base HTTP header, and ?builder_base= query parameter set the page-builder host used…",
|
|
35
|
-
"vi": "Biến môi trường WEBCAKE_BUILDER_BASE mới, HTTP header x-webcake-builder-base, và tham số truy vấn ?builder_base= cho phép đặt host của page-builder…"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"v": "1.0.21",
|
|
39
|
-
"d": "07/06/2026",
|
|
40
|
-
"type": "Added",
|
|
41
|
-
"en": "The HTTP server's GET / guide page is now bilingual (vi/en): append ?lang=en to the URL to switch to English (default is Vietnamese), a language…",
|
|
42
|
-
"vi": "Trang hướng dẫn GET / của HTTP server nay hỗ trợ song ngữ (vi/en): thêm ?lang=en vào URL để chuyển sang tiếng Anh (mặc định là tiếng Việt), kèm nút…"
|
|
43
43
|
}
|
|
44
44
|
]
|
package/dist/http.js
CHANGED
|
@@ -20,6 +20,13 @@ import { createServer } from "./server.js";
|
|
|
20
20
|
import { ICON_SVG, ICON_MIME } from "./branding.js";
|
|
21
21
|
import { guideHtml, ogImageSvg, normalizeLang } from "./web-guide.js";
|
|
22
22
|
const MCP_PATH = "/mcp";
|
|
23
|
+
// Social/search crawlers (Facebook, Zalo, Twitter/X, LinkedIn, Slack, Telegram,
|
|
24
|
+
// WhatsApp, Discord, Google, Bing…) fetch the root with `Accept: */*` rather than
|
|
25
|
+
// `text/html`, so they'd otherwise get the JSON health blob and never see the OG
|
|
26
|
+
// tags — links wouldn't unfurl and Facebook's debugger reports a missing og:image.
|
|
27
|
+
// Detect them by User-Agent so they get the full HTML <head>. (Programmatic MCP /
|
|
28
|
+
// healthcheck probes also send `*/*` but don't match, so they still get JSON.)
|
|
29
|
+
const BOT_UA = /facebookexternalhit|facebot|twitterbot|linkedinbot|slackbot|slack-imgproxy|telegrambot|whatsapp|discordbot|pinterest|redditbot|googlebot|bingbot|applebot|yandexbot|baiduspider|embedly|quora link preview|outbrain|vkshare|w3c_validator|skypeuripreview|zalo/i;
|
|
23
30
|
// The raster social card (1200x630), pre-rendered and committed at src/og.png,
|
|
24
31
|
// mirrored to dist/og.png by copy-assets. Served at GET /og.png as the og:image —
|
|
25
32
|
// SVG OG images don't unfurl on Facebook/X/LinkedIn/Zalo. Read once, lazily.
|
|
@@ -113,7 +120,8 @@ export async function startHttpServer(port) {
|
|
|
113
120
|
// page that links the favicon (helps icon discovery); programmatic probes
|
|
114
121
|
// (the container healthcheck uses `Accept: */*`) still get the JSON health.
|
|
115
122
|
const accept = String(req.headers["accept"] ?? "");
|
|
116
|
-
|
|
123
|
+
const ua = String(req.headers["user-agent"] ?? "");
|
|
124
|
+
if (path === "/" && (accept.includes("text/html") || BOT_UA.test(ua))) {
|
|
117
125
|
// Public base URL, honoring the reverse proxy (Coolify/Traefik/Cloudflare).
|
|
118
126
|
const fwdHost = req.headers["x-forwarded-host"];
|
|
119
127
|
const host = (Array.isArray(fwdHost) ? fwdHost[0] : fwdHost) || req.headers.host || "localhost";
|
package/dist/web-guide.js
CHANGED
|
@@ -422,7 +422,11 @@ export function guideHtml(origin, lang = "vi") {
|
|
|
422
422
|
:root[data-theme="dark"]{--ink:#e8f0ec;--mut:#9aaba2;--bg:#0b110e;--card:#141b17;
|
|
423
423
|
--line:rgba(255,255,255,.07);--shadow:0 1px 2px rgba(0,0,0,.3),0 8px 24px -14px rgba(0,0,0,.7);--code:#070f0b;--g7:#5ee08a;--ic-fg:#6fe79a;--btn-hover:#21c264}
|
|
424
424
|
*{box-sizing:border-box}
|
|
425
|
-
|
|
425
|
+
/* Smooth scrolling only AFTER first load — applied globally it makes the
|
|
426
|
+
browser *animate* scroll-position restoration on reload, which reads as a
|
|
427
|
+
jerky scroll. The .smooth class is added a frame after load (see script). */
|
|
428
|
+
html{scroll-behavior:auto}
|
|
429
|
+
html.smooth{scroll-behavior:smooth}
|
|
426
430
|
body{margin:0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:var(--ink);
|
|
427
431
|
background:var(--bg);line-height:1.62;overflow-x:hidden}
|
|
428
432
|
/* Subtle background tint — one faint, slow accent glow */
|
|
@@ -752,6 +756,10 @@ export function guideHtml(origin, lang = "vi") {
|
|
|
752
756
|
function paint(){if(tBtn)tBtn.innerHTML=effective()==='dark'?SUN:MOON;}
|
|
753
757
|
paint();
|
|
754
758
|
if(tBtn)tBtn.addEventListener('click',function(){var next=effective()==='dark'?'light':'dark';html.setAttribute('data-theme',next);try{localStorage.setItem('wc-theme',next);}catch(e){}paint();});
|
|
759
|
+
|
|
760
|
+
// Enable smooth scrolling only after the browser has restored scroll position
|
|
761
|
+
// on (re)load — applying it globally animates that restore into a jerky scroll.
|
|
762
|
+
window.addEventListener('load',function(){requestAnimationFrame(function(){html.classList.add('smooth');});});
|
|
755
763
|
})();
|
|
756
764
|
</script>
|
|
757
765
|
</body></html>`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webcake-landing-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"description": "MCP server exposing Webcake landing-page element schemas + AI usage hints, and persisting LLM-generated page sources to a Webcake backend.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|