Эх сурвалжийг харах

[体系] 重构: 仓库重组为mcp/hub/template三件套;MCP模块化(lib六模块)+proto_init引导+全参数化通用适配;修复gitTry空out与AB定位

wubinggen 2 сар өмнө
parent
commit
cb2b42705a

+ 0 - 1
.gitignore

@@ -1,4 +1,3 @@
 node_modules/
 events.json
 *.log
-.env

+ 38 - 58
README.md

@@ -1,75 +1,55 @@
-# wedo-hub
+# wedo —— 原型多人协同体系
 
-wedo 原型协同**中心通知服务**——多人通过 git 共建原型库(各自 MCP `wedo` 推送/拉取),hub 只负责一件事:**广播"谁改了什么"**。不存原型内容(内容归 git),零依赖(node ≥ 18 单文件)。
+对差劲的需求原型做**本地补充重构**,并以 git 仓库为中心多人共建。一套三件:
 
 ```
-用户A改完原型 → MCP publish(push到git仓库) → POST /events 上报hub
-                                                    │
-用户B的MCP定时轮询 GET /events?repo=&since= ────────┘ → 🔔"A更新了 财务管理/包额"
-(hub不可达时MCP自动降级为裸 git fetch 比对提交,功能不缺失)
+mcp/       wedo MCP(七工具):init引导/sync感知/list/read/write原子写/publish规范推送/verify视口门禁
+hub/       wedo-hub 中心通知服务(零依赖node):多项目事件广播,谁改了什么一查便知
+template/  门户与元数据模板(数据驱动,新项目零改动复用)
 ```
 
-## 接口
+## 架构与数据流
 
-| 方法 | 路径 | 说明 |
-|---|---|---|
-| POST | `/events` | 上报改动事件 `{repo, user, message, commit, files[]}`(repo/message 必填) |
-| GET | `/events?repo=<项目>&since=<时间戳>` | 增量轮询某项目事件(since=上次游标,首次传 0) |
-| GET | `/repos` | 项目维度视图:每项目的活跃用户/事件数/最近改动 |
-| GET | `/health` | 健康检查 |
-
-- **鉴权**:所有请求头 `x-wedo-token: <WEDO_TOKEN>`(服务端未设置 WEDO_TOKEN 时不校验);
-- **CORS**:回显请求 Origin 并放行 OPTIONS 预检(预检不带 token,在鉴权前处理),支持 `file://` 门户页面跨域轮询;
-- **项目维度**:`repo` 字段隔离(如 `hanglung`、其他系统原型库各自命名),一份 hub 服务多项目;
-- **持久化**:内存 + `events.json`(最近 200 条,重启不丢)。
-
-## 部署
-
-**当前线上部署**:gogs 服务器(CentOS 7)以 Docker 运行,对外经宝塔 nginx 反代复用 gogs.wxapp.info 证书:
-
-- 对外地址:`https://gogs.wxapp.info/wedo-hub/`(nginx `file-upload.conf` 中 `/wedo-hub/` → `127.0.0.1:8790`,端口仅绑本机)
-- 容器管理:`cd /lio/projects/crrc/wedo-mcp-server && docker compose up -d`(restart=unless-stopped,开机自启)
-- 口令:仓库目录 `.env` 的 `WEDO_TOKEN`(git 忽略,不入库;变更后 `docker compose up -d` 重建生效)
-
-### 容器方式(线上采用,宿主机 node 版本过老时)
-
-```bash
-echo "WEDO_TOKEN=你的口令" > .env
-docker compose up -d
 ```
-
-### node 直启(内网快速试用)
-
-```bash
-node server.js                       # 默认 8790 端口,无鉴权(仅内网可信环境)
-WEDO_PORT=8790 WEDO_TOKEN=你的口令 node server.js
+成员A改原型(proto_write) → verify(视口矩阵) → publish
+        ├─ git 推送原型仓库(commit自动规范[域/页]动作:摘要)
+        └─ 广播 wedo-hub ──┬─ 成员B的MCP 5分钟轮询 → AI干活时🔔提醒
+                           └─ 成员B的门户 2分钟轮询 → 红绿灯常驻,点开看详情
+                                               └─ 都指向 proto_sync {pull:true}
 ```
 
-Windows: `set WEDO_TOKEN=xxx && node server.js`
+## 新项目接入(三步)
 
-### 验证
+1. **建原型库**:在 ZCode 里让 AI 调 `proto_init {repo_path, project_name, repo_url, domains}` —— 生成业务域目录 + `_meta.js` + 门户 `index.html`(双击即用)+ git init;
+2. **部署 hub**(可选,团队≥2人时建议):`hub/` 目录拷到服务器,`WEDO_PORT=8790 WEDO_TOKEN=口令 node server.js`(pm2/systemd 见 hub/README);
+3. **各成员配置**:ZCode 的 MCP 配置指向 `mcp/index.js`,env 见下表。
 
-```bash
-curl -H "x-wedo-token: 你的口令" https://gogs.wxapp.info/wedo-hub/health
-```
+## MCP 环境变量
 
-## MCP 侧配套(各协作用户)
+| env | 必填 | 说明 |
+|---|---|---|
+| `PROTO_REPO` | ✓ | 原型库绝对路径(一个 MCP 实例对应一个项目) |
+| `PROTO_BRANCH` | | 分支,默认 `main` |
+| `WEDO_HUB_URL` | | hub 地址;不配则纯 git 模式(publish 正常,感知降级为提交级) |
+| `WEDO_HUB_TOKEN` | | hub 口令 |
+| `WEDO_REPO` | | 项目标识(hub 事件隔离维度),建议与原型仓库名一致 |
+| `AB_BIN` | | agent-browser 可执行体路径(proto_verify 用;默认取 PATH 上的 agent-browser) |
 
-ZCode 的 wedo MCP 配置 env:
+## 日常使用
 
-```json
-{
-  "WEDO_HUB_URL": "https://gogs.wxapp.info/wedo-hub",
-  "WEDO_HUB_TOKEN": "你的口令",
-  "WEDO_REPO": "hanglung"
-}
-```
+- **浏览**:双击原型库 `index.html`(file:// 全链路,无需服务);状态灯红了 = 有人更新,让 AI `proto_sync`;
+- **AI 协作口令**:`看下原型库有没有更新` → proto_sync;`重构某某原型` → reproto 流程 + proto_write;`发布` → proto_verify + proto_publish;
+- **commit 规范**:`[业务域/页面名] 动作: 摘要`(新增|重构|更新|修复|标注|元数据|初始化|门户),publish 自动矫正。
 
-不配置 hub 时 MCP 自动使用纯 git 模式(publish 正常,更新感知降级为提交级比对)。
+## 已知约定与坑(实践沉淀)
 
-## 目录
+- 原子写:`proto_write` 走 tmp+rename,杜绝半截文件(热改被刷新会拿到残页);
+- 中文 JSON 测试:curl 必须 `-d @file`(UTF-8 文件载荷),Git Bash 裸传中文会污染字节;
+- Windows 下 agent-browser 是 `.cmd` shim:node 子进程请直调二进制(`AB_BIN`);
+- hub 事件清理:`DELETE /events?ts=` 单条 / `?all=1` 全清;
+- 门户 iframe/file:// 的 fetch 依赖 hub 的 CORS 头(hub 已内置)。
 
-```
-server.js      服务本体(零依赖单文件)
-events.json    运行时事件持久化(git忽略)
-```
+## 版本
+
+- v2.0.0(2026-08-26):仓库重组为 mcp/hub/template 三件套;MCP 模块化(lib/git·msg·hub·verify·meta·init);新增 proto_init;全参数化通用适配。
+- 首个生产实践:恒隆公寓 AMS 原型库(hanglung,包额/账单发往等页面,任务 11214 全程驱动孵化)。

+ 75 - 0
hub/README.md

@@ -0,0 +1,75 @@
+# wedo-hub
+
+wedo 原型协同**中心通知服务**——多人通过 git 共建原型库(各自 MCP `wedo` 推送/拉取),hub 只负责一件事:**广播"谁改了什么"**。不存原型内容(内容归 git),零依赖(node ≥ 18 单文件)。
+
+```
+用户A改完原型 → MCP publish(push到git仓库) → POST /events 上报hub
+                                                    │
+用户B的MCP定时轮询 GET /events?repo=&since= ────────┘ → 🔔"A更新了 财务管理/包额"
+(hub不可达时MCP自动降级为裸 git fetch 比对提交,功能不缺失)
+```
+
+## 接口
+
+| 方法 | 路径 | 说明 |
+|---|---|---|
+| POST | `/events` | 上报改动事件 `{repo, user, message, commit, files[]}`(repo/message 必填) |
+| GET | `/events?repo=<项目>&since=<时间戳>` | 增量轮询某项目事件(since=上次游标,首次传 0) |
+| GET | `/repos` | 项目维度视图:每项目的活跃用户/事件数/最近改动 |
+| GET | `/health` | 健康检查 |
+
+- **鉴权**:所有请求头 `x-wedo-token: <WEDO_TOKEN>`(服务端未设置 WEDO_TOKEN 时不校验);
+- **CORS**:回显请求 Origin 并放行 OPTIONS 预检(预检不带 token,在鉴权前处理),支持 `file://` 门户页面跨域轮询;
+- **项目维度**:`repo` 字段隔离(如 `hanglung`、其他系统原型库各自命名),一份 hub 服务多项目;
+- **持久化**:内存 + `events.json`(最近 200 条,重启不丢)。
+
+## 部署
+
+**当前线上部署**:gogs 服务器(CentOS 7)以 Docker 运行,对外经宝塔 nginx 反代复用 gogs.wxapp.info 证书:
+
+- 对外地址:`https://gogs.wxapp.info/wedo-hub/`(nginx `file-upload.conf` 中 `/wedo-hub/` → `127.0.0.1:8790`,端口仅绑本机)
+- 容器管理:`cd /lio/projects/crrc/wedo-mcp-server && docker compose up -d`(restart=unless-stopped,开机自启)
+- 口令:仓库目录 `.env` 的 `WEDO_TOKEN`(git 忽略,不入库;变更后 `docker compose up -d` 重建生效)
+
+### 容器方式(线上采用,宿主机 node 版本过老时)
+
+```bash
+echo "WEDO_TOKEN=你的口令" > .env
+docker compose up -d
+```
+
+### node 直启(内网快速试用)
+
+```bash
+node server.js                       # 默认 8790 端口,无鉴权(仅内网可信环境)
+WEDO_PORT=8790 WEDO_TOKEN=你的口令 node server.js
+```
+
+Windows: `set WEDO_TOKEN=xxx && node server.js`
+
+### 验证
+
+```bash
+curl -H "x-wedo-token: 你的口令" https://gogs.wxapp.info/wedo-hub/health
+```
+
+## MCP 侧配套(各协作用户)
+
+ZCode 的 wedo MCP 配置 env:
+
+```json
+{
+  "WEDO_HUB_URL": "https://gogs.wxapp.info/wedo-hub",
+  "WEDO_HUB_TOKEN": "你的口令",
+  "WEDO_REPO": "hanglung"
+}
+```
+
+不配置 hub 时 MCP 自动使用纯 git 模式(publish 正常,更新感知降级为提交级比对)。
+
+## 目录
+
+```
+server.js      服务本体(零依赖单文件)
+events.json    运行时事件持久化(git忽略)
+```

+ 0 - 0
package.json → hub/package.json


+ 0 - 0
server.js → hub/server.js


+ 19 - 0
mcp/README.md

@@ -0,0 +1,19 @@
+# wedo MCP(mcp/)
+
+原型库多人协同操作入口,七工具。模块结构:
+
+```
+index.js        工具注册层(仅参数定义与编排,业务逻辑在lib)
+lib/git.js      git封装 + 路径安全(safePath:库内+.html/.md/_meta.js/门户)
+lib/msg.js      commit信息规范(自动包装[域/页]动作:摘要)
+lib/hub.js      hub广播/轮询 + git降级 + newsBanner提醒
+lib/verify.js   headless视口矩阵断言(agent-browser直调)
+lib/meta.js     _meta.js元数据读取(门户/proto_list共用)
+lib/init.js     proto_init新项目引导(模板在../template/)
+```
+
+设计约定:
+- 所有 git 操作必经 `lib/git.js`(cwd 固定 PROTO_REPO、超时、stderr 捕获);
+- 所有写文件必走原子写(tmp+rename);
+- hub 任何失败不得影响 git 主流程(通知失败仅 console.error);
+- 工具返回一律中文 + emoji 状态前缀(✅❌⚠️🔔),AI 可直接转述用户。

+ 150 - 0
mcp/index.js

@@ -0,0 +1,150 @@
+#!/usr/bin/env node
+/**
+ * wedo MCP —— 原型库多人协同操作入口(七工具)
+ *
+ *   proto_init     新项目一键引导:目录骨架+_meta.js+门户+git初始化
+ *   proto_sync     感知远程更新(hub事件/git提交),可选 pull --rebase
+ *   proto_list     原型库目录树+收录清单元数据+git状态
+ *   proto_read     读原型(默认摘要150行,full=true全量)
+ *   proto_write    原子写入(tmp+rename,杜绝半截文件)
+ *   proto_publish  精确提交推送(commit自动规范[域/页]动作:摘要;push前远端检查;成功后广播hub)
+ *   proto_verify   headless视口矩阵断言(publish质量门禁)
+ *
+ * 配置(env): 见 README.md;核心 PROTO_REPO(原型库绝对路径,必填)
+ */
+import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
+import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
+import { z } from "zod";
+import { readFile, writeFile, readdir, stat, rename, mkdir } from "node:fs/promises";
+import { existsSync } from "node:fs";
+import { join, dirname, relative } from "node:path";
+import { git, gitTry, safePath, REPO, BRANCH } from "./lib/git.js";
+import { normalizeMsg } from "./lib/msg.js";
+import { hubNotify, startPolling, newsBanner } from "./lib/hub.js";
+import { verifyPage } from "./lib/verify.js";
+import { readMeta, metaLines } from "./lib/meta.js";
+import { initProject } from "./lib/init.js";
+
+const server = new McpServer({ name: "wedo", version: "2.0.0" });
+
+/* ── proto_init ── */
+server.tool("proto_init", "新项目原型库一键引导:目录骨架+_meta.js+门户index.html+git初始化(不覆盖已有库)", {
+  repo_path: z.string().describe("原型库绝对路径(不存在则创建)"),
+  project_name: z.string().describe("项目/系统名称"),
+  repo_url: z.string().optional().describe("git远程仓库地址(可选,提供则自动配置remote)"),
+  domains: z.array(z.string()).optional().describe("业务域目录名清单(默认 系统工作台/业务管理/数据中心/系统设置)"),
+  live_url: z.string().optional().describe("线上系统访问地址(可选,登记进_meta.js)"),
+}, async (p) => {
+  try { return { content: [{ type: "text", text: await initProject(p) }] }; }
+  catch (e) { return { content: [{ type: "text", text: `❌ ${e.message}` }] }; }
+});
+
+/* ── proto_sync ── */
+server.tool("proto_sync", `感知原型库远程更新(hub事件优先,降级git提交比对)+本地脏文件;pull=true 时 pull --rebase 同步(本地脏则拒绝)`, { pull: z.boolean().optional() }, async ({ pull }) => {
+  const fetchRes = gitTry(["fetch", "origin", "--quiet"]);
+  if (!fetchRes.ok) return { content: [{ type: "text", text: `❌ fetch 失败(检查网络/凭据):\n${fetchRes.err}` }] };
+  const news = gitTry(["log", "--pretty=format:%h %an %ad %s", "--date=format:%m-%d %H:%M", `HEAD..origin/${BRANCH}`]).out.trim();
+  const dirty = gitTry(["status", "--porcelain"]).out.trim();
+  let lines = [`仓库: ${REPO}`];
+  lines.push(news ? `🔔 远程有 ${news.split("\n").length} 个新提交:\n${news}` : "✅ 远程无新提交(本地已是最新)");
+  lines.push(dirty ? `⚠️ 本地未提交改动(将阻碍 rebase):\n${dirty}` : "✅ 本地工作区干净");
+  if (pull) {
+    if (news && dirty) lines.push("⏭️ 已跳过 pull:本地有未提交改动,请先处理(提交或暂存)再同步");
+    else if (news) {
+      const r = gitTry(["pull", "--rebase", "origin", BRANCH]);
+      lines.push(r.ok ? "✅ 已同步(pull --rebase 完成,本地页面已更新,浏览器记得刷新)" : `❌ pull 失败:\n${r.err}`);
+    } else lines.push("⏭️ 无需 pull");
+  } else if (news) lines.push("💡 需要更新到本地时: proto_sync {pull:true}(本地干净才会执行)");
+  return { content: [{ type: "text", text: lines.join("\n\n") }] };
+});
+
+/* ── proto_list ── */
+server.tool("proto_list", "列出原型库目录树(按业务域分组)、收录清单元数据(_meta.js)与 git 状态", {}, async () => {
+  async function walk(dir, depth) {
+    const out = [];
+    for (const name of (await readdir(dir)).sort()) {
+      if (name === ".git" || name.startsWith(".")) continue;
+      const p = join(dir, name), s = await stat(p);
+      if (s.isDirectory()) out.push(`${"  ".repeat(depth)}📁 ${name}/`, ...(await walk(p, depth + 1)));
+      else out.push(`${"  ".repeat(depth)}📄 ${name}  (${(s.size / 1024).toFixed(1)}KB)`);
+    }
+    return out;
+  }
+  const tree = (await walk(REPO, 0)).join("\n");
+  let metaTxt;
+  try { metaTxt = metaLines(await readMeta()); }
+  catch { metaTxt = "\n\n(⚠️ _meta.js 缺失或解析失败,门户收录清单将不完整;可用 proto_init 模板补建)"; }
+  const head = gitTry(["log", "-1", "--pretty=format:%h %an %ad %s", "--date=format:%m-%d %H:%M"]).out;
+  const dirty = gitTry(["status", "--porcelain"]).out.trim();
+  return { content: [{ type: "text", text: `原型库目录树:\n${tree}${metaTxt}\n\n当前 HEAD: ${head || "(空仓库)"}${dirty ? `\n⚠️ 未提交改动:\n${dirty}` : "\n✅ 工作区干净"}${newsBanner()}` }] };
+});
+
+/* ── proto_read ── */
+server.tool("proto_read", "读取原型文件;默认摘要模式(前150行+统计),full=true 返回全部内容", { path: z.string().describe("库内相对路径,如 财务管理/包额.html"), full: z.boolean().optional() }, async ({ path: p, full }) => {
+  let abs; try { abs = safePath(p); } catch (e) { return { content: [{ type: "text", text: `❌ ${e.message}` }] }; }
+  if (!existsSync(abs)) return { content: [{ type: "text", text: `❌ 文件不存在: ${p}(用 proto_list 查看目录)` }] };
+  const content = await readFile(abs, "utf8");
+  const lines = content.split("\n");
+  if (full || lines.length <= 150) return { content: [{ type: "text", text: `📄 ${p} (共${lines.length}行,全量):\n\n${content}` }] };
+  return { content: [{ type: "text", text: `📄 ${p} (共${lines.length}行,摘要前150行;需全文加 full:true):\n\n${lines.slice(0, 150).join("\n")}\n\n…(余 ${lines.length - 150} 行省略)` }] };
+});
+
+/* ── proto_write ── */
+server.tool("proto_write", "原子写入原型文件(临时文件+rename,杜绝半截文件);自动创建父目录;限 .html/.md/_meta.js/门户", { path: z.string(), content: z.string() }, async ({ path: p, content }) => {
+  let abs; try { abs = safePath(p); } catch (e) { return { content: [{ type: "text", text: `❌ ${e.message}` }] }; }
+  await mkdir(dirname(abs), { recursive: true });
+  const tmp = abs + ".tmp_" + Date.now();
+  await writeFile(tmp, content, "utf8");
+  await rename(tmp, abs);
+  return { content: [{ type: "text", text: `✅ 已原子写入 ${p} (${content.split("\n").length}行)。改动未提交,确认后用 proto_publish 推送。` }] };
+});
+
+/* ── proto_publish ── */
+server.tool("proto_publish",
+  "精确提交并推送原型改动(显式文件清单,禁 add -A);commit 自动规范为 [业务域/页面] 动作: 摘要;push 前检查远端(落后拒绝);成功后广播 wedo-hub",
+  { files: z.array(z.string()).describe("要提交的文件相对路径清单"), message: z.string().describe("改动摘要(自动包装为规范格式,已合规则原样)") },
+  async ({ files, message }) => {
+    if (!files || !files.length) return { content: [{ type: "text", text: "❌ files 不能为空(精确提交,拒绝全量提交)" }] };
+    const absList = [];
+    for (const f of files) {
+      let abs; try { abs = safePath(f); } catch (e) { return { content: [{ type: "text", text: `❌ ${e.message}` }] }; }
+      if (!existsSync(abs)) return { content: [{ type: "text", text: `❌ 文件不存在: ${f}` }] };
+      absList.push(abs);
+    }
+    gitTry(["fetch", "origin", "--quiet"]);
+    const ahead = gitTry(["log", "--oneline", `origin/${BRANCH}..HEAD`]).out.trim();
+    const behind = gitTry(["log", "--oneline", `HEAD..origin/${BRANCH}`]).out.trim();
+    if (behind && !ahead) return { content: [{ type: "text", text: `❌ 远程有新提交,请先 proto_sync {pull:true} 同步再提交:\n${behind}` }] };
+    for (const abs of absList) git(["add", relative(REPO, abs)]);
+    const staged = git(["status", "--porcelain"]).split("\n").filter(l => /^[AM]/.test(l));
+    if (!staged.length) return { content: [{ type: "text", text: "❌ 没有可提交的改动(文件内容与上次提交相同?)" }] };
+    const normMsg = normalizeMsg(message, staged);
+    git(["commit", "-m", normMsg]);
+    const push = gitTry(["push", "origin", BRANCH]);
+    if (!push.ok) {
+      gitTry(["reset", "--soft", "HEAD~1"]);
+      return { content: [{ type: "text", text: `❌ push 失败(已回退本地提交,改动仍在暂存区):\n${push.err}` }] };
+    }
+    const head = git(["log", "-1", "--pretty=format:%h"]).trim();
+    hubNotify(head, normMsg, staged.map(l => l.slice(3).trim()));
+    return { content: [{ type: "text", text: `✅ 已提交并推送 ${head}: ${normMsg}\n提交文件:\n${staged.join("\n")}\n\n💡 建议:重要页面改动 publish 前先 proto_verify 跑视口矩阵断言。${newsBanner()}` }] };
+  });
+
+/* ── proto_verify ── */
+server.tool("proto_verify",
+  "对原型页面跑 headless 视口矩阵断言(默认 1280/1536/1920):横向零溢出(默认态+标注态)、页面有内容;publish 前的质量门禁",
+  { path: z.string().describe("库内相对路径"), viewports: z.array(z.number()).optional().describe("自定义视口宽度列表") },
+  async ({ path: p, viewports }) => {
+    let abs; try { abs = safePath(p); } catch (e) { return { content: [{ type: "text", text: `❌ ${e.message}` }] }; }
+    if (!existsSync(abs)) return { content: [{ type: "text", text: `❌ 文件不存在: ${p}` }] };
+    try {
+      const report = await verifyPage(abs, viewports && viewports.length ? viewports : [1280, 1536, 1920]);
+      return { content: [{ type: "text", text: report }] };
+    } catch (e) { return { content: [{ type: "text", text: `❌ ${e.message}` }] }; }
+  });
+
+/* ── 启动 ── */
+startPolling(5 * 60_000);
+const transport = new StdioServerTransport();
+await server.connect(transport);
+console.error(`[wedo] ready v2.0.0 repo=${REPO} branch=${BRANCH} hub=${process.env.WEDO_HUB_URL ? "on" : "off"}(降级git)`);

+ 35 - 0
mcp/lib/git.js

@@ -0,0 +1,35 @@
+/** git 封装:cwd 固定原型库根;所有 git 操作的单一出口 */
+import { execFileSync } from "node:child_process";
+import { resolve, sep } from "node:path";
+
+export const REPO = process.env.PROTO_REPO || "";
+export const BRANCH = process.env.PROTO_BRANCH || "main";
+export const GIT_TIMEOUT = 60_000;
+
+if (!REPO) { console.error("[wedo] 缺少 PROTO_REPO 环境变量(原型库绝对路径)"); process.exit(1); }
+
+export function git(args, opts = {}) {
+  return execFileSync("git", args, {
+    cwd: REPO, timeout: GIT_TIMEOUT, encoding: "utf8",
+    stdio: ["ignore", "pipe", "pipe"], ...opts,
+  }).toString();
+}
+export function gitTry(args) {
+  try { return { ok: true, out: git(args), err: "" }; }
+  catch (e) { return { ok: false, out: "", err: (e.stderr || e.stdout || e.message || "").toString().trim() }; }
+}
+/** 校验路径在库内且为允许类型(.html/.md/_meta.js/门户index.html),返回绝对路径
+ *  注意:env传正斜杠而resolve返回反斜杠(Windows),比较前统一归一化分隔符 */
+export function safePath(p) {
+  const norm = x => resolve(x).split(sep).join("/");
+  const repoN = norm(REPO);
+  const abs = resolve(REPO, p || "");
+  const absN = norm(abs);
+  if (absN === repoN) throw new Error("路径不能是库根目录");
+  if (!absN.startsWith(repoN + "/")) throw new Error(`路径越界(必须在原型库内): ${p || "(空)"}`);
+  const rel = absN.slice(repoN.length + 1);
+  if (!/\.(html|md)$/i.test(abs) && rel !== "_meta.js" && rel !== "index.html") {
+    throw new Error("仅允许 .html / .md / _meta.js / 门户 index.html");
+  }
+  return abs;
+}

+ 60 - 0
mcp/lib/hub.js

@@ -0,0 +1,60 @@
+/** wedo-hub 中心通知:publish 后广播事件 / 定时轮询感知他人更新;不可用自动降级裸 git fetch
+ *  env: WEDO_HUB_URL / WEDO_HUB_TOKEN / WEDO_REPO(项目标识,hub按此隔离) */
+import { git, gitTry, BRANCH } from "./git.js";
+
+export const HUB = process.env.WEDO_HUB_URL || "";
+export const HUB_TOKEN = process.env.WEDO_HUB_TOKEN || "";
+export const REPO_ID = process.env.WEDO_REPO || "default";
+
+let pendingNews = "";
+let hubLastTs = 0;
+
+export async function hubNotify(commit, message, files) {
+  if (!HUB) return;
+  try {
+    await fetch(HUB.replace(/\/$/, "") + "/events", {
+      method: "POST",
+      headers: { "content-type": "application/json", ...(HUB_TOKEN ? { "x-wedo-token": HUB_TOKEN } : {}) },
+      body: JSON.stringify({ repo: REPO_ID, user: git(["config", "user.name"]).trim() || "unknown", message, commit, files }),
+    });
+  } catch (e) { console.error("[wedo] hub通知失败(不影响git):" + (e.message || e)); }
+}
+
+async function hubPoll() {
+  if (!HUB) return false;
+  try {
+    const r = await fetch(`${HUB.replace(/\/$/, "")}/events?repo=${encodeURIComponent(REPO_ID)}&since=${hubLastTs}`,
+      { headers: HUB_TOKEN ? { "x-wedo-token": HUB_TOKEN } : {} });
+    const data = JSON.parse(await r.text());
+    const evs = (data && data.events) || [];
+    if (evs.length) {
+      hubLastTs = evs[evs.length - 1].ts;
+      pendingNews = evs.map(e => `${(e.commit || "").slice(0, 7)} ${e.user} ${e.message} (${(e.files || []).join(",")})`).join("\n");
+      console.error(`[wedo] 🔔 hub通知:远端有 ${evs.length} 个新改动:\n${pendingNews}`);
+    }
+    return true;
+  } catch { return false; }
+}
+
+/** 定时静默检查:优先hub接口(业务级事件),降级裸git fetch(提交级比对) */
+export function startPolling(intervalMs) {
+  const tick = async () => {
+    if (await hubPoll()) return;
+    const r = gitTry(["fetch", "origin", "--quiet"]);
+    if (!r.ok) return;
+    const news = gitTry(["log", "--pretty=format:%h %an %s", `HEAD..origin/${BRANCH}`]).out.trim();
+    if (news) {
+      pendingNews = news;
+      console.error(`[wedo] 🔔 检测到远程新提交:\n${news}`);
+    }
+  };
+  setInterval(tick, intervalMs);
+}
+
+/** 取走并清空更新提醒(附加到工具返回,一次性) */
+export function newsBanner() {
+  if (!pendingNews) return "";
+  const b = `\n\n🔔【远程更新提醒】检测到未同步的远端改动:\n${pendingNews}\n(用 proto_sync {pull:true} 同步)`;
+  pendingNews = "";
+  return b;
+}

+ 52 - 0
mcp/lib/init.js

@@ -0,0 +1,52 @@
+/** proto_init:新项目原型库一键引导——目录骨架 + _meta.js + 门户 index.html + git 初始化
+ *  门户模板取自本仓库 ../template/index.html(数据驱动,零改动可用) */
+import { readFile, writeFile, mkdir, access } from "node:fs/promises";
+import { join, dirname } from "node:path";
+import { fileURLToPath } from "node:url";
+import { execFileSync } from "node:child_process";
+
+const TEMPLATE_DIR = join(dirname(fileURLToPath(import.meta.url)), "..", "..", "template");
+const DEFAULT_DOMAINS = ["系统工作台", "业务管理", "数据中心", "系统设置"];   /* 通用起步域,项目可自定义 */
+
+async function exists(p) { try { await access(p); return true; } catch { return false; } }
+
+export async function initProject({ repo_path, project_name, repo_url, domains, live_url }) {
+  if (!repo_path || !project_name) throw new Error("repo_path 与 project_name 必填");
+  if (await exists(join(repo_path, "_meta.js"))) throw new Error(`目标已是原型库(存在 _meta.js): ${repo_path}`);
+  const tplPortal = join(TEMPLATE_DIR, "index.html");
+  if (!(await exists(tplPortal))) throw new Error(`门户模板缺失: ${tplPortal}(检查 wedo-repo/template/)`);
+  const domainList = (domains && domains.length) ? domains : DEFAULT_DOMAINS;
+
+  await mkdir(repo_path, { recursive: true });
+  for (const d of domainList) await mkdir(join(repo_path, d), { recursive: true });
+  await mkdir(join(repo_path, "_机制示例"), { recursive: true });
+
+  const meta = `/* 原型库元数据(门户与 MCP 共读;file:// 环境用 JS 变量避免 fetch 的 CORS 限制)
+ * 维护: 新增/更新原型后同步本文件(卡片/状态灯随 _meta.js 自动更新) */
+window.PROTO_META = {
+  system: "${project_name}",
+  repo: { url: "${repo_url || ""}", desc: "原型二开补充库,仅供开发测试人员业务逻辑补充使用" },
+  live: { name: "线上系统", url: "${live_url || ""}", note: "线上/测试环境入口" },
+  hub: { url: "${process.env.WEDO_HUB_URL || ""}", token: "${process.env.WEDO_HUB_TOKEN || ""}", repo: "${process.env.WEDO_REPO || project_name}" },
+  domains: ${JSON.stringify(domainList)},
+  pages: []
+};
+`;
+  await writeFile(join(repo_path, "_meta.js"), meta, "utf8");
+  await writeFile(join(repo_path, "index.html"), await readFile(tplPortal, "utf8"), "utf8");
+
+  const gitInit = [];
+  const run = (args, cwd) => { try { execFileSync("git", args, { cwd, timeout: 30_000, stdio: ["ignore", "pipe", "pipe"] }); return true; } catch { return false; } };
+  if (run(["init", "-b", "main"], repo_path)) {
+    gitInit.push("git init(main) ✓");
+    if (repo_url && run(["remote", "add", "origin", repo_url], repo_path)) gitInit.push(`remote origin → ${repo_url} ✓`);
+  }
+  return [
+    `✅ 原型库已初始化: ${repo_path}`,
+    `项目: ${project_name} · 业务域: ${domainList.join(" / ")}`,
+    "生成: _meta.js(元数据) + index.html(门户,双击即用) + 各业务域目录 + _机制示例/",
+    ...gitInit.map(l => "  " + l),
+    "",
+    "下一步: 1)按 reproto 流程重构首个原型放入业务域目录 2)更新 _meta.js 的 pages 3)proto_publish 首次提交",
+  ].join("\n");
+}

+ 17 - 0
mcp/lib/meta.js

@@ -0,0 +1,17 @@
+/** 原型库元数据(_meta.js)读取:门户与 proto_list 共用的收录清单 */
+import { readFile } from "node:fs/promises";
+import { join } from "node:path";
+import { REPO } from "./git.js";
+
+export async function readMeta() {
+  const src = await readFile(join(REPO, "_meta.js"), "utf8");
+  return new Function("window", src + "; return window.PROTO_META;")({});
+}
+
+export function metaLines(meta) {
+  return "\n\n收录清单(来自 _meta.js):\n" +
+    meta.pages.map(p =>
+      `· ${p.domain}/${p.name} [${p.status}] 初始来源:${p.initialSource.type}${p.initialSource.url ? "(" + p.initialSource.url + ")" : ""} 线上:${p.liveUrl || "待登记"} 更新:${p.updated}`
+    ).join("\n") +
+    `\n门户: ${join(REPO, "index.html")} · 线上系统入口: ${meta.live && meta.live.url ? meta.live.url : "待登记"}`;
+}

+ 17 - 0
mcp/lib/msg.js

@@ -0,0 +1,17 @@
+/** commit 信息规范: [业务域/页面名] 动作: 摘要 (动作 ∈ 新增|重构|更新|修复|标注|元数据|初始化|门户)
+ *  已合规则原样;不合规则自动包装(从暂存清单推页面名,新文件判"新增") */
+const MSG_RE = /^\[[^\]]+\]\s*(新增|重构|更新|修复|标注|元数据|初始化|门户)\s*[::]/;
+
+export function normalizeMsg(rawMsg, stagedLines) {
+  const m = (rawMsg || "").trim();
+  if (MSG_RE.test(m)) return m;
+  const pageFiles = stagedLines.map(l => l.slice(3).trim()).filter(f => /\.html?$/i.test(f));
+  let scope;
+  if (pageFiles.length === 1) scope = pageFiles[0].replace(/\.html?$/i, "");
+  else if (pageFiles.length > 1) {
+    const dirs = pageFiles.map(f => f.split("/")[0]);
+    scope = dirs.every(d => d === dirs[0]) ? dirs[0] : "原型库";
+  } else scope = "原型库";
+  const action = stagedLines.some(l => /^A/.test(l)) ? "新增" : "更新";
+  return `[${scope}] ${action}: ${m || "原型改动"}`;
+}

+ 65 - 0
mcp/lib/verify.js

@@ -0,0 +1,65 @@
+/** headless 视口矩阵断言:复用 agent-browser(rust 二进制),免下载 Chromium
+ *  env: AB_BIN(agent-browser可执行体路径) */
+import { execFile as execFileCb } from "node:child_process";
+import { promisify } from "node:util";
+import { pathToFileURL } from "node:url";
+
+const execFileAsync = promisify(execFileCb);
+const AB_TIMEOUT = 90_000;
+/* agent-browser 定位:env 指定 > PATH 裸名 > 常见npm全局二进制(Windows下.cmd shim无法被execFile直接spawn) */
+const AB_CANDIDATES = [
+  process.env.AB_BIN,
+  "agent-browser",
+  process.env.APPDATA && process.env.APPDATA + "/npm/node_modules/agent-browser/bin/agent-browser-win32-x64.exe",
+  "D:/nodejs/node_global/node_modules/agent-browser/bin/agent-browser-win32-x64.exe",
+].filter(Boolean);
+let abBinResolved = null;
+
+async function ab(args) {
+  if (!abBinResolved) {
+    let lastErr;
+    for (const bin of AB_CANDIDATES) {
+      try { const { stdout } = await execFileAsync(bin, ["--version"], { timeout: 10_000, windowsHide: true }); abBinResolved = bin; break; }
+      catch (e) { lastErr = e; }
+    }
+    if (!abBinResolved) throw new Error(`找不到可执行的 agent-browser(尝试过: ${AB_CANDIDATES.join("; ")}),请用 AB_BIN 指定\n${(lastErr && lastErr.message || "").slice(0, 120)}`);
+  }
+  const { stdout } = await execFileAsync(abBinResolved, args, { timeout: AB_TIMEOUT, windowsHide: true });
+  return stdout.toString();   /* 铁律:完整读stdout,不接管道 */
+}
+
+/**
+ * 对单个原型页面跑视口矩阵断言
+ * @param abs 页面绝对路径  @param vps 视口宽度数组
+ * @returns 报告文本(逐项✅/❌+总结论)
+ */
+export async function verifyPage(abs, vps) {
+  const url = pathToFileURL(abs).href;
+  const probe = `(function(){var d=document.documentElement;var r={scroll:d.scrollWidth,vw:d.clientWidth,children:document.body.children.length};` +
+    `var b=document.getElementById('noteBtn');if(b){b.click();r.noteScroll=d.scrollWidth;r.noteVw=d.clientWidth;b.click();}return JSON.stringify(r);})()`;
+  const lines = [`🔎 视口矩阵断言: ${abs}`];
+  let allPass = true;
+  try {
+    await ab(["open", url]);                                  /* 单次打开,视口间切换(避免重复冷启动) */
+    for (const w of vps) {
+      await ab(["set", "viewport", String(w), "800"]);
+      await new Promise(r => setTimeout(r, 400));            /* 稳态:等resize重算后再读 */
+      let raw = (await ab(["eval", probe])).trim();
+      raw = raw.replace(/^"|"$/g, "").replace(/\\"/g, '"');
+      let r; try { r = JSON.parse(raw); } catch { throw new Error(`断言输出解析失败: ${raw.slice(0, 120)}`); }
+      const okDef = r.scroll <= r.vw + 1 && r.children > 0;
+      const hasNotes = r.noteScroll !== undefined;
+      const okNote = !hasNotes || r.noteScroll <= r.noteVw + 1;
+      if (!okDef || !okNote) allPass = false;
+      lines.push(`${okDef && okNote ? "✅" : "❌"} ${w}x800  默认态 ${r.scroll}/${r.vw}${okDef ? "✓" : "✗溢出"}` +
+        (hasNotes ? ` | 标注态 ${r.noteScroll}/${r.noteVw}${okNote ? "✓" : "✗溢出"}` : " | (无标注开关,跳过标注态)") +
+        `  内容节点=${r.children}`);
+    }
+  } catch (e) {
+    throw new Error(`verify 执行失败(检查 agent-browser 可用性/Chrome):\n${(e.stderr || e.message || "").toString().slice(0, 300)}`);
+  } finally {
+    try { await ab(["close"]); } catch { }
+  }
+  lines.push(allPass ? "🟢 全部通过,可放心 publish" : "🔴 存在溢出/异常,修复后再 publish");
+  return lines.join("\n");
+}

+ 1201 - 0
mcp/package-lock.json

@@ -0,0 +1,1201 @@
+{
+  "name": "wedo-mcp",
+  "version": "2.0.0",
+  "lockfileVersion": 3,
+  "requires": true,
+  "packages": {
+    "": {
+      "name": "wedo-mcp",
+      "version": "2.0.0",
+      "dependencies": {
+        "@modelcontextprotocol/sdk": "^1.30.0"
+      },
+      "engines": {
+        "node": ">=18"
+      }
+    },
+    "node_modules/@hono/node-server": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmmirror.com/@hono/node-server/-/node-server-2.1.1.tgz",
+      "integrity": "sha512-ELuehkj5VCBdgEw9zs+ivkKwyzzUCSQuE96YmiPvn1ECBoZCczbFXJLeEGMTYjphP6gydh4pHMqEYPVMYUVgQg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=20"
+      },
+      "peerDependencies": {
+        "hono": "^4"
+      }
+    },
+    "node_modules/@modelcontextprotocol/sdk": {
+      "version": "1.30.0",
+      "resolved": "https://registry.npmmirror.com/@modelcontextprotocol/sdk/-/sdk-1.30.0.tgz",
+      "integrity": "sha512-xKd8OIzlqNzcqcNumGAa6g+PW2kjD5vrpcKOnfldAUPP3j7lnqMPwlTXQm8gF+UwH72z0lqaRbjr9hqGz0eITA==",
+      "license": "MIT",
+      "dependencies": {
+        "@hono/node-server": "^1.19.9 || ^2.0.5",
+        "ajv": "^8.17.1",
+        "ajv-formats": "^3.0.1",
+        "content-type": "^1.0.5",
+        "cors": "^2.8.5",
+        "cross-spawn": "^7.0.5",
+        "eventsource": "^3.0.2",
+        "eventsource-parser": "^3.0.0",
+        "express": "^5.2.1",
+        "express-rate-limit": "^8.2.1",
+        "hono": "^4.11.4",
+        "jose": "^6.1.3",
+        "json-schema-typed": "^8.0.2",
+        "pkce-challenge": "^5.0.0",
+        "raw-body": "^3.0.0",
+        "zod": "^3.25 || ^4.0",
+        "zod-to-json-schema": "^3.25.1"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "peerDependencies": {
+        "@cfworker/json-schema": "^4.1.1",
+        "zod": "^3.25 || ^4.0"
+      },
+      "peerDependenciesMeta": {
+        "@cfworker/json-schema": {
+          "optional": true
+        },
+        "zod": {
+          "optional": false
+        }
+      }
+    },
+    "node_modules/accepts": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmmirror.com/accepts/-/accepts-2.0.0.tgz",
+      "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
+      "license": "MIT",
+      "dependencies": {
+        "mime-types": "^3.0.0",
+        "negotiator": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/ajv": {
+      "version": "8.20.0",
+      "resolved": "https://registry.npmmirror.com/ajv/-/ajv-8.20.0.tgz",
+      "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
+      "license": "MIT",
+      "dependencies": {
+        "fast-deep-equal": "^3.1.3",
+        "fast-uri": "^3.0.1",
+        "json-schema-traverse": "^1.0.0",
+        "require-from-string": "^2.0.2"
+      },
+      "funding": {
+        "type": "github",
+        "url": "https://github.com/sponsors/epoberezkin"
+      }
+    },
+    "node_modules/ajv-formats": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmmirror.com/ajv-formats/-/ajv-formats-3.0.1.tgz",
+      "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
+      "license": "MIT",
+      "dependencies": {
+        "ajv": "^8.0.0"
+      },
+      "peerDependencies": {
+        "ajv": "^8.0.0"
+      },
+      "peerDependenciesMeta": {
+        "ajv": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/body-parser": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmmirror.com/body-parser/-/body-parser-2.3.0.tgz",
+      "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==",
+      "license": "MIT",
+      "dependencies": {
+        "bytes": "^3.1.2",
+        "content-type": "^2.0.0",
+        "debug": "^4.4.3",
+        "http-errors": "^2.0.1",
+        "iconv-lite": "^0.7.2",
+        "on-finished": "^2.4.1",
+        "qs": "^6.15.2",
+        "raw-body": "^3.0.2",
+        "type-is": "^2.1.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/body-parser/node_modules/content-type": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/content-type/-/content-type-2.1.0.tgz",
+      "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/bytes": {
+      "version": "3.1.2",
+      "resolved": "https://registry.npmmirror.com/bytes/-/bytes-3.1.2.tgz",
+      "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/call-bind-apply-helpers": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
+      "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+      "license": "MIT",
+      "dependencies": {
+        "es-errors": "^1.3.0",
+        "function-bind": "^1.1.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/call-bound": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmmirror.com/call-bound/-/call-bound-1.0.4.tgz",
+      "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
+      "license": "MIT",
+      "dependencies": {
+        "call-bind-apply-helpers": "^1.0.2",
+        "get-intrinsic": "^1.3.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/content-disposition": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-1.1.0.tgz",
+      "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/content-type": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmmirror.com/content-type/-/content-type-1.0.5.tgz",
+      "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/cookie": {
+      "version": "0.7.2",
+      "resolved": "https://registry.npmmirror.com/cookie/-/cookie-0.7.2.tgz",
+      "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/cookie-signature": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.2.2.tgz",
+      "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=6.6.0"
+      }
+    },
+    "node_modules/cors": {
+      "version": "2.8.6",
+      "resolved": "https://registry.npmmirror.com/cors/-/cors-2.8.6.tgz",
+      "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",
+      "license": "MIT",
+      "dependencies": {
+        "object-assign": "^4",
+        "vary": "^1"
+      },
+      "engines": {
+        "node": ">= 0.10"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/cross-spawn": {
+      "version": "7.0.6",
+      "resolved": "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz",
+      "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
+      "license": "MIT",
+      "dependencies": {
+        "path-key": "^3.1.0",
+        "shebang-command": "^2.0.0",
+        "which": "^2.0.1"
+      },
+      "engines": {
+        "node": ">= 8"
+      }
+    },
+    "node_modules/debug": {
+      "version": "4.4.3",
+      "resolved": "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz",
+      "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
+      "license": "MIT",
+      "dependencies": {
+        "ms": "^2.1.3"
+      },
+      "engines": {
+        "node": ">=6.0"
+      },
+      "peerDependenciesMeta": {
+        "supports-color": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/depd": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz",
+      "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/dunder-proto": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz",
+      "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+      "license": "MIT",
+      "dependencies": {
+        "call-bind-apply-helpers": "^1.0.1",
+        "es-errors": "^1.3.0",
+        "gopd": "^1.2.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/ee-first": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmmirror.com/ee-first/-/ee-first-1.1.1.tgz",
+      "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
+      "license": "MIT"
+    },
+    "node_modules/encodeurl": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmmirror.com/encodeurl/-/encodeurl-2.0.0.tgz",
+      "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/es-define-property": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz",
+      "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/es-errors": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz",
+      "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/es-object-atoms": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
+      "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
+      "license": "MIT",
+      "dependencies": {
+        "es-errors": "^1.3.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/escape-html": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz",
+      "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
+      "license": "MIT"
+    },
+    "node_modules/etag": {
+      "version": "1.8.1",
+      "resolved": "https://registry.npmmirror.com/etag/-/etag-1.8.1.tgz",
+      "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/eventsource": {
+      "version": "3.0.7",
+      "resolved": "https://registry.npmmirror.com/eventsource/-/eventsource-3.0.7.tgz",
+      "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==",
+      "license": "MIT",
+      "dependencies": {
+        "eventsource-parser": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=18.0.0"
+      }
+    },
+    "node_modules/eventsource-parser": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmmirror.com/eventsource-parser/-/eventsource-parser-3.1.1.tgz",
+      "integrity": "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=18.0.0"
+      }
+    },
+    "node_modules/express": {
+      "version": "5.2.1",
+      "resolved": "https://registry.npmmirror.com/express/-/express-5.2.1.tgz",
+      "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
+      "license": "MIT",
+      "dependencies": {
+        "accepts": "^2.0.0",
+        "body-parser": "^2.2.1",
+        "content-disposition": "^1.0.0",
+        "content-type": "^1.0.5",
+        "cookie": "^0.7.1",
+        "cookie-signature": "^1.2.1",
+        "debug": "^4.4.0",
+        "depd": "^2.0.0",
+        "encodeurl": "^2.0.0",
+        "escape-html": "^1.0.3",
+        "etag": "^1.8.1",
+        "finalhandler": "^2.1.0",
+        "fresh": "^2.0.0",
+        "http-errors": "^2.0.0",
+        "merge-descriptors": "^2.0.0",
+        "mime-types": "^3.0.0",
+        "on-finished": "^2.4.1",
+        "once": "^1.4.0",
+        "parseurl": "^1.3.3",
+        "proxy-addr": "^2.0.7",
+        "qs": "^6.14.0",
+        "range-parser": "^1.2.1",
+        "router": "^2.2.0",
+        "send": "^1.1.0",
+        "serve-static": "^2.2.0",
+        "statuses": "^2.0.1",
+        "type-is": "^2.0.1",
+        "vary": "^1.1.2"
+      },
+      "engines": {
+        "node": ">= 18"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/express-rate-limit": {
+      "version": "8.6.2",
+      "resolved": "https://registry.npmmirror.com/express-rate-limit/-/express-rate-limit-8.6.2.tgz",
+      "integrity": "sha512-YH4ru+eOJxQABscKFfRCy9R7x9QFGdezclVMwwgFFndzS2Xnm0uo6B0ABZsLhcpeptGv2qvuJVWlQr9gQZoC3A==",
+      "license": "MIT",
+      "dependencies": {
+        "debug": "^4.4.3",
+        "ip-address": "^10.2.0"
+      },
+      "engines": {
+        "node": ">= 16"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/express-rate-limit"
+      },
+      "peerDependencies": {
+        "express": ">= 4.11"
+      }
+    },
+    "node_modules/fast-deep-equal": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npmmirror.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+      "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+      "license": "MIT"
+    },
+    "node_modules/fast-uri": {
+      "version": "3.1.6",
+      "resolved": "https://registry.npmmirror.com/fast-uri/-/fast-uri-3.1.6.tgz",
+      "integrity": "sha512-7Ical1vFEMr0onbVzEDIreM22I4khW+fzyQPwvAFWBp1iwdshSZRsL4jjRvPG9JP1uiqMHRto+YU6R2/CzDz5Q==",
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/fastify"
+        },
+        {
+          "type": "opencollective",
+          "url": "https://opencollective.com/fastify"
+        }
+      ],
+      "license": "BSD-3-Clause"
+    },
+    "node_modules/finalhandler": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmmirror.com/finalhandler/-/finalhandler-2.1.1.tgz",
+      "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",
+      "license": "MIT",
+      "dependencies": {
+        "debug": "^4.4.0",
+        "encodeurl": "^2.0.0",
+        "escape-html": "^1.0.3",
+        "on-finished": "^2.4.1",
+        "parseurl": "^1.3.3",
+        "statuses": "^2.0.1"
+      },
+      "engines": {
+        "node": ">= 18.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/forwarded": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz",
+      "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/fresh": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmmirror.com/fresh/-/fresh-2.0.0.tgz",
+      "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/function-bind": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz",
+      "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+      "license": "MIT",
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/get-intrinsic": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
+      "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+      "license": "MIT",
+      "dependencies": {
+        "call-bind-apply-helpers": "^1.0.2",
+        "es-define-property": "^1.0.1",
+        "es-errors": "^1.3.0",
+        "es-object-atoms": "^1.1.1",
+        "function-bind": "^1.1.2",
+        "get-proto": "^1.0.1",
+        "gopd": "^1.2.0",
+        "has-symbols": "^1.1.0",
+        "hasown": "^2.0.2",
+        "math-intrinsics": "^1.1.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/get-proto": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz",
+      "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+      "license": "MIT",
+      "dependencies": {
+        "dunder-proto": "^1.0.1",
+        "es-object-atoms": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/gopd": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz",
+      "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/has-symbols": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz",
+      "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/hasown": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.4.tgz",
+      "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
+      "license": "MIT",
+      "dependencies": {
+        "function-bind": "^1.1.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/hono": {
+      "version": "4.13.5",
+      "resolved": "https://registry.npmmirror.com/hono/-/hono-4.13.5.tgz",
+      "integrity": "sha512-O6+/eCYRkzzzy0rPWwKLiGBR1nFuUPZynnwjxN1MBA62NNqbT0wQEzQyK2gSO5yDIDB336sXQleAhOHrzlYyKw==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=16.9.0"
+      }
+    },
+    "node_modules/http-errors": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.1.tgz",
+      "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
+      "license": "MIT",
+      "dependencies": {
+        "depd": "~2.0.0",
+        "inherits": "~2.0.4",
+        "setprototypeof": "~1.2.0",
+        "statuses": "~2.0.2",
+        "toidentifier": "~1.0.1"
+      },
+      "engines": {
+        "node": ">= 0.8"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/iconv-lite": {
+      "version": "0.7.3",
+      "resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.7.3.tgz",
+      "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==",
+      "license": "MIT",
+      "dependencies": {
+        "safer-buffer": ">= 2.1.2 < 3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/inherits": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
+      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+      "license": "ISC"
+    },
+    "node_modules/ip-address": {
+      "version": "10.5.0",
+      "resolved": "https://registry.npmmirror.com/ip-address/-/ip-address-10.5.0.tgz",
+      "integrity": "sha512-R5SnVLJmgYYvf2F2ZgwSBnelz5G4q5AxIC277GDfUaNbrZKNANcBC7RHqYYePlszf4kBolVkJauG0ZjHHFh55g==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 12"
+      }
+    },
+    "node_modules/ipaddr.js": {
+      "version": "1.9.1",
+      "resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+      "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.10"
+      }
+    },
+    "node_modules/is-promise": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmmirror.com/is-promise/-/is-promise-4.0.0.tgz",
+      "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
+      "license": "MIT"
+    },
+    "node_modules/isexe": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmmirror.com/isexe/-/isexe-2.0.0.tgz",
+      "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
+      "license": "ISC"
+    },
+    "node_modules/jose": {
+      "version": "6.2.10",
+      "resolved": "https://registry.npmmirror.com/jose/-/jose-6.2.10.tgz",
+      "integrity": "sha512-iiW7J9qRFlGxvCOIBDBDxFePQSn7ZMAnrYGhrrOo6siO/MIqwfyilLR27pkfDgUk+raLuzADS8A3S/KLBisc0g==",
+      "license": "MIT",
+      "funding": {
+        "url": "https://github.com/sponsors/panva"
+      }
+    },
+    "node_modules/json-schema-traverse": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmmirror.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+      "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+      "license": "MIT"
+    },
+    "node_modules/json-schema-typed": {
+      "version": "8.0.2",
+      "resolved": "https://registry.npmmirror.com/json-schema-typed/-/json-schema-typed-8.0.2.tgz",
+      "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==",
+      "license": "BSD-2-Clause"
+    },
+    "node_modules/math-intrinsics": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
+      "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/media-typer": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-1.1.1.tgz",
+      "integrity": "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.8"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/merge-descriptors": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmmirror.com/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
+      "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/mime-db": {
+      "version": "1.54.0",
+      "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.54.0.tgz",
+      "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/mime-types": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-3.0.2.tgz",
+      "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
+      "license": "MIT",
+      "dependencies": {
+        "mime-db": "^1.54.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/ms": {
+      "version": "2.1.3",
+      "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz",
+      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+      "license": "MIT"
+    },
+    "node_modules/negotiator": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-1.1.0.tgz",
+      "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==",
+      "license": "MIT",
+      "dependencies": {
+        "content-type": "^2.1.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/negotiator/node_modules/content-type": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/content-type/-/content-type-2.1.0.tgz",
+      "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/object-assign": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz",
+      "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/object-inspect": {
+      "version": "1.13.4",
+      "resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.4.tgz",
+      "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/on-finished": {
+      "version": "2.4.1",
+      "resolved": "https://registry.npmmirror.com/on-finished/-/on-finished-2.4.1.tgz",
+      "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+      "license": "MIT",
+      "dependencies": {
+        "ee-first": "1.1.1"
+      },
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/once": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz",
+      "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+      "license": "ISC",
+      "dependencies": {
+        "wrappy": "1"
+      }
+    },
+    "node_modules/parseurl": {
+      "version": "1.3.3",
+      "resolved": "https://registry.npmmirror.com/parseurl/-/parseurl-1.3.3.tgz",
+      "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/path-key": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz",
+      "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/path-to-regexp": {
+      "version": "8.4.2",
+      "resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-8.4.2.tgz",
+      "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
+      "license": "MIT",
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/pkce-challenge": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmmirror.com/pkce-challenge/-/pkce-challenge-5.0.1.tgz",
+      "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=16.20.0"
+      }
+    },
+    "node_modules/proxy-addr": {
+      "version": "2.0.7",
+      "resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz",
+      "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+      "license": "MIT",
+      "dependencies": {
+        "forwarded": "0.2.0",
+        "ipaddr.js": "1.9.1"
+      },
+      "engines": {
+        "node": ">= 0.10"
+      }
+    },
+    "node_modules/qs": {
+      "version": "6.15.3",
+      "resolved": "https://registry.npmmirror.com/qs/-/qs-6.15.3.tgz",
+      "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==",
+      "license": "BSD-3-Clause",
+      "dependencies": {
+        "es-define-property": "^1.0.1",
+        "side-channel": "^1.1.1"
+      },
+      "engines": {
+        "node": ">=0.6"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/range-parser": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmmirror.com/range-parser/-/range-parser-1.3.0.tgz",
+      "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.6"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/raw-body": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmmirror.com/raw-body/-/raw-body-3.0.2.tgz",
+      "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",
+      "license": "MIT",
+      "dependencies": {
+        "bytes": "~3.1.2",
+        "http-errors": "~2.0.1",
+        "iconv-lite": "~0.7.0",
+        "unpipe": "~1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.10"
+      }
+    },
+    "node_modules/require-from-string": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmmirror.com/require-from-string/-/require-from-string-2.0.2.tgz",
+      "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/router": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmmirror.com/router/-/router-2.2.0.tgz",
+      "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
+      "license": "MIT",
+      "dependencies": {
+        "debug": "^4.4.0",
+        "depd": "^2.0.0",
+        "is-promise": "^4.0.0",
+        "parseurl": "^1.3.3",
+        "path-to-regexp": "^8.0.0"
+      },
+      "engines": {
+        "node": ">= 18"
+      }
+    },
+    "node_modules/safer-buffer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz",
+      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+      "license": "MIT"
+    },
+    "node_modules/send": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmmirror.com/send/-/send-1.2.1.tgz",
+      "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",
+      "license": "MIT",
+      "dependencies": {
+        "debug": "^4.4.3",
+        "encodeurl": "^2.0.0",
+        "escape-html": "^1.0.3",
+        "etag": "^1.8.1",
+        "fresh": "^2.0.0",
+        "http-errors": "^2.0.1",
+        "mime-types": "^3.0.2",
+        "ms": "^2.1.3",
+        "on-finished": "^2.4.1",
+        "range-parser": "^1.2.1",
+        "statuses": "^2.0.2"
+      },
+      "engines": {
+        "node": ">= 18"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/serve-static": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmmirror.com/serve-static/-/serve-static-2.2.1.tgz",
+      "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",
+      "license": "MIT",
+      "dependencies": {
+        "encodeurl": "^2.0.0",
+        "escape-html": "^1.0.3",
+        "parseurl": "^1.3.3",
+        "send": "^1.2.0"
+      },
+      "engines": {
+        "node": ">= 18"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/setprototypeof": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz",
+      "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
+      "license": "ISC"
+    },
+    "node_modules/shebang-command": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmmirror.com/shebang-command/-/shebang-command-2.0.0.tgz",
+      "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+      "license": "MIT",
+      "dependencies": {
+        "shebang-regex": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/shebang-regex": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmmirror.com/shebang-regex/-/shebang-regex-3.0.0.tgz",
+      "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/side-channel": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.1.1.tgz",
+      "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
+      "license": "MIT",
+      "dependencies": {
+        "es-errors": "^1.3.0",
+        "object-inspect": "^1.13.4",
+        "side-channel-list": "^1.0.1",
+        "side-channel-map": "^1.0.1",
+        "side-channel-weakmap": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/side-channel-list": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/side-channel-list/-/side-channel-list-1.0.1.tgz",
+      "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
+      "license": "MIT",
+      "dependencies": {
+        "es-errors": "^1.3.0",
+        "object-inspect": "^1.13.4"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/side-channel-map": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/side-channel-map/-/side-channel-map-1.0.1.tgz",
+      "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
+      "license": "MIT",
+      "dependencies": {
+        "call-bound": "^1.0.2",
+        "es-errors": "^1.3.0",
+        "get-intrinsic": "^1.2.5",
+        "object-inspect": "^1.13.3"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/side-channel-weakmap": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmmirror.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
+      "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
+      "license": "MIT",
+      "dependencies": {
+        "call-bound": "^1.0.2",
+        "es-errors": "^1.3.0",
+        "get-intrinsic": "^1.2.5",
+        "object-inspect": "^1.13.3",
+        "side-channel-map": "^1.0.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/statuses": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.2.tgz",
+      "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/toidentifier": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz",
+      "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=0.6"
+      }
+    },
+    "node_modules/type-is": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/type-is/-/type-is-2.1.0.tgz",
+      "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==",
+      "license": "MIT",
+      "dependencies": {
+        "content-type": "^2.0.0",
+        "media-typer": "^1.1.0",
+        "mime-types": "^3.0.0"
+      },
+      "engines": {
+        "node": ">= 18"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/type-is/node_modules/content-type": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/content-type/-/content-type-2.1.0.tgz",
+      "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
+      }
+    },
+    "node_modules/unpipe": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmmirror.com/unpipe/-/unpipe-1.0.0.tgz",
+      "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/vary": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz",
+      "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/which": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz",
+      "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+      "license": "ISC",
+      "dependencies": {
+        "isexe": "^2.0.0"
+      },
+      "bin": {
+        "node-which": "bin/node-which"
+      },
+      "engines": {
+        "node": ">= 8"
+      }
+    },
+    "node_modules/wrappy": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz",
+      "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
+      "license": "ISC"
+    },
+    "node_modules/zod": {
+      "version": "4.4.3",
+      "resolved": "https://registry.npmmirror.com/zod/-/zod-4.4.3.tgz",
+      "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==",
+      "license": "MIT",
+      "funding": {
+        "url": "https://github.com/sponsors/colinhacks"
+      }
+    },
+    "node_modules/zod-to-json-schema": {
+      "version": "3.25.2",
+      "resolved": "https://registry.npmmirror.com/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz",
+      "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==",
+      "license": "ISC",
+      "peerDependencies": {
+        "zod": "^3.25.28 || ^4"
+      }
+    }
+  }
+}

+ 10 - 0
mcp/package.json

@@ -0,0 +1,10 @@
+{
+  "name": "wedo-mcp",
+  "version": "2.0.0",
+  "description": "wedo 原型库多人协同 MCP:init/sync/list/read/write/publish/verify 七工具,git化原型库+hub广播+视口门禁",
+  "type": "module",
+  "main": "index.js",
+  "scripts": { "start": "node index.js" },
+  "dependencies": { "@modelcontextprotocol/sdk": "^1.30.0" },
+  "engines": { "node": ">=18" }
+}

+ 27 - 0
mcp/smoke.sh

@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+# wedo MCP v2 全工具冒烟(输出用Windows可见路径,避免Git Bash /tmp与原生python互不可见)
+cd "C:/Users/20175/.zcode/mcp-servers/wedo-repo/mcp" || exit 1
+export PROTO_REPO="D:/haolou/hanglung/ams/docs/恒隆原型本地重构"
+export WEDO_HUB_URL=""
+OUT="D:/haolou/hanglung/ams/docs/_smoke"
+mkdir -p "$OUT"
+rm -rf "D:/haolou/hanglung/ams/docs/_init_test"
+{
+  echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"1"}}}'
+  echo '{"jsonrpc":"2.0","method":"notifications/initialized"}'
+  cat "$OUT/call1.json"; echo
+  cat "$OUT/call2.json"; echo
+  cat "$OUT/call3.json"; echo; cat "$OUT/call4.json"; echo
+  sleep 5
+} | timeout 60 node index.js 2>"$OUT/err.log" > "$OUT/out.jsonl"
+echo "=== stderr ==="; tail -2 "$OUT/err.log"
+echo "=== 工具返回 ==="
+python - <<PY
+import json
+for line in open(r'D:/haolou/hanglung/ams/docs/_smoke/out.jsonl', encoding='utf-8', errors='replace'):
+    try: r = json.loads(line)
+    except: continue
+    if r.get('id') in (2, 3, 4, 11):
+        print(f"--- id={r['id']} ---")
+        print(r['result']['content'][0]['text'][:700])
+PY

+ 26 - 0
mcp/smoke_pub.sh

@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+# publish 全链路冒烟:临时库+本地bare远程(不碰真实仓库)
+cd "C:/Users/20175/.zcode/mcp-servers/wedo-repo/mcp" || exit 1
+export PROTO_REPO="D:/haolou/hanglung/ams/docs/_init_test"
+export WEDO_HUB_URL=""
+OUT="D:/haolou/hanglung/ams/docs/_smoke"
+git init --bare "$OUT/bare.git" -b main 2>/dev/null
+git -C "$PROTO_REPO" remote add origin "file:///D:/haolou/hanglung/ams/docs/_smoke/bare.git" 2>/dev/null
+git -C "$PROTO_REPO" config user.name lio; git -C "$PROTO_REPO" config user.email lio@wxapp.info
+printf '# 测试页\n' > "$PROTO_REPO/工作台/测试页.html"
+{
+  echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"1"}}}'
+  echo '{"jsonrpc":"2.0","method":"notifications/initialized"}'
+  echo '{"jsonrpc":"2.0","id":9,"method":"tools/call","params":{"name":"proto_publish","arguments":{"files":["工作台/测试页.html"],"message":"测试页冒烟"}}}'
+  echo '{"jsonrpc":"2.0","id":10,"method":"tools/call","params":{"name":"proto_sync","arguments":{"pull":false}}}'
+  sleep 4
+} | timeout 40 node index.js 2>/dev/null > "$OUT/pub.jsonl"
+python - <<PY
+import json
+for line in open(r'D:/haolou/hanglung/ams/docs/_smoke/pub.jsonl', encoding='utf-8', errors='replace'):
+    try: r = json.loads(line)
+    except: continue
+    if r.get('id') in (9, 10):
+        print(f"--- id={r['id']} ---"); print(r['result']['content'][0]['text'][:500])
+PY
+echo "--- bare远程提交 ---"; git -C "$OUT/bare.git" log --oneline -1 2>/dev/null || echo "(空)"

+ 25 - 0
template/README.md

@@ -0,0 +1,25 @@
+# template/ —— 新项目原型库模板
+
+`proto_init` 工具用这里的文件为新项目一键生成原型库骨架。
+
+## index.html(门户模板)
+
+**完全数据驱动**:所有项目信息(系统名/仓库地址/线上入口/hub 配置/业务域/页面清单)都从同目录 `_meta.js` 的 `window.PROTO_META` 读取,模板本身零项目耦合,任何项目原样可用。内置能力:
+
+- 左侧业务域导航(空域灰显)+ 顶栏搜索过滤;
+- 页面卡片:版本状态 / 初始来源(墨刀·线上系统·需求文档·新设计)/ 线上对照链接 / 关联任务;
+- 右侧 iframe 即点即预览原型(含原型内的「ⓘ 逻辑标注」等交互);
+- 常驻协同状态灯:🟢 已最新 / 🔴 有待同步(闪烁)/ ⚪ hub 未连通,点击弹最近事件详情 + 「我已同步」;
+- file:// 协议双击即用,无任何服务依赖。
+
+## _meta.js(元数据,init 时生成)
+
+结构见 proto_init 生成的文件头注释。要点:
+
+- `pages[]` 每页登记 `domain/name/file/status/updated/initialSource/liveUrl/related`;
+- `hub` 为协同状态灯的连接配置(url/token/repo);
+- 中文与数据格式:UTF-8;门户与 `proto_list` 均实时读取本文件,改后刷新即生效。
+
+## 页面原型规范(reproto 技能)
+
+单文件 HTML、零依赖、数据驱动示例自洽、可选「ⓘ 逻辑标注」系统;布局遵循画布缩放机制(参考各项目库 `_机制示例/`)。

+ 251 - 0
template/index.html

@@ -0,0 +1,251 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+<head>
+<meta charset="UTF-8">
+<title>原型门户 - 恒隆公寓AMS</title>
+<style>
+  * { margin:0; padding:0; box-sizing:border-box; }
+  html { overflow-x:hidden; }
+  body { font-family:"PingFang SC","Microsoft YaHei",sans-serif; font-size:13px; color:#333; background:#f0f2f5; display:flex; height:100vh; overflow:hidden; }
+  .nav { width:190px; background:#1f2d3d; color:#bfcbd9; flex-shrink:0; overflow-y:auto; }
+  .nav .logo { height:56px; display:flex; align-items:center; justify-content:center; color:#fff; font-size:14px; font-weight:600; background:#18222e; text-align:center; line-height:1.3; }
+  .nav .group-title { padding:10px 16px 4px; font-size:11px; color:#7f95ad; }
+  .nav .item { padding:8px 16px 8px 22px; cursor:pointer; display:flex; justify-content:space-between; }
+  .nav .item:hover { color:#fff; }
+  .nav .item.active { color:#fff; background:#2563eb; }
+  .nav .item .cnt { font-size:11px; color:#7f95ad; }
+  .nav .item.active .cnt { color:#dbeafe; }
+  .mid { flex:1; min-width:340px; display:flex; flex-direction:column; }
+  .topbar { height:56px; background:#fff; border-bottom:1px solid #e4e7ed; display:flex; align-items:center; padding:0 20px; gap:14px; }
+  .topbar b { font-size:14px; }
+  .topbar .sub { color:#909399; font-size:12px; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
+  .upd-banner { display:none; align-items:center; gap:10px; background:#fff7ed; border-bottom:1px solid #fdba74;
+          color:#9a3412; padding:8px 20px; font-size:12.5px; }
+  .upd-banner.show { display:flex; }
+  .upd-banner b { color:#c2410c; }
+  .upd-banner .btn-ok { margin-left:auto; height:26px; padding:0 12px; line-height:24px; border-radius:4px;
+          border:1px solid #fdba74; background:#fff; color:#b45309; cursor:pointer; font-size:12px; white-space:nowrap; }
+  .upd-banner .btn-ok:hover { background:#fef3c7; }
+  /* 协同状态灯(常驻):绿=已最新 红=有待同步 灰=hub未连通;点击弹详情面板 */
+  .hub-wrap { position:relative; }
+  .hub-dot { display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 10px; border:1px solid #dcdfe6;
+          border-radius:15px; background:#fff; cursor:pointer; font-size:12px; color:#606266; white-space:nowrap; }
+  .hub-dot:hover { border-color:#93c5fd; }
+  .hub-dot .led { width:9px; height:9px; border-radius:50%; background:#c0c4cc; transition:background .3s; }
+  .hub-dot.s-green .led { background:#22c55e; box-shadow:0 0 5px rgba(34,197,94,.7); }
+  .hub-dot.s-red .led { background:#ef4444; box-shadow:0 0 5px rgba(239,68,68,.8); animation:hubPulse 1.2s infinite; }
+  .hub-dot.s-gray .led { background:#c0c4cc; }
+  @keyframes hubPulse { 50% { opacity:.45; } }
+  .hub-pop { display:none; position:absolute; right:0; top:36px; width:360px; background:#fff; border:1px solid #e4e7ed;
+          border-radius:8px; box-shadow:0 6px 24px rgba(31,45,61,.16); z-index:50; overflow:hidden; }
+  .hub-pop.show { display:block; }
+  .hub-pop .hp-head { padding:10px 14px; border-bottom:1px solid #f2f4f7; font-size:12.5px; display:flex; align-items:center; gap:8px; }
+  .hub-pop .hp-head .st-green { color:#16a34a; } .hub-pop .hp-head .st-red { color:#dc2626; } .hub-pop .hp-head .st-gray { color:#909399; }
+  .hub-pop .hp-head .btn-ok { margin-left:auto; height:24px; padding:0 10px; line-height:22px; border-radius:4px;
+          border:1px solid #fdba74; background:#fff; color:#b45309; cursor:pointer; font-size:11.5px; white-space:nowrap; }
+  .hub-pop ul { list-style:none; max-height:240px; overflow-y:auto; }
+  .hub-pop li { padding:8px 14px; border-bottom:1px solid #f7f8fa; font-size:12px; line-height:1.6; }
+  .hub-pop li .u { color:#2563eb; font-weight:600; }
+  .hub-pop li .t { color:#c0c4cc; font-size:11px; margin-left:6px; }
+  .hub-pop li.pending { background:#fff7ed; }
+  .hub-pop .hp-empty { padding:18px 14px; color:#909399; font-size:12px; text-align:center; }
+  .topbar input { height:32px; border:1px solid #dcdfe6; border-radius:4px; padding:0 10px; width:220px; outline:none; }
+  .topbar input:focus { border-color:#2563eb; }
+  .topbar a.btn, .topbar .btn { height:30px; padding:0 12px; line-height:28px; border-radius:4px; font-size:12px; cursor:pointer; text-decoration:none; border:1px solid #dcdfe6; color:#606266; background:#fff; white-space:nowrap; }
+  .list { flex:1; overflow-y:auto; padding:16px 20px; }
+  .cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px; }
+  .card { background:#fff; border:1px solid #ebeef5; border-radius:8px; padding:14px 16px; cursor:pointer; transition:box-shadow .15s,border-color .15s; }
+  .card:hover { border-color:#93c5fd; box-shadow:0 2px 10px rgba(37,99,235,.12); }
+  .card.sel { border-color:#2563eb; box-shadow:0 0 0 2px rgba(37,99,235,.18); }
+  .card h3 { font-size:14px; margin-bottom:6px; display:flex; align-items:center; gap:8px; }
+  .card h3 .st { font-size:11px; font-weight:400; color:#2563eb; background:#eff6ff; padding:1px 7px; border-radius:3px; }
+  .meta-row { color:#909399; font-size:12px; line-height:1.8; }
+  .meta-row .src { color:#0e7490; cursor:pointer; }
+  .meta-row a { color:#2563eb; text-decoration:none; }
+  .meta-row .pend { color:#c0c4cc; }
+  .card .ops { margin-top:8px; display:flex; gap:8px; }
+  .card .ops span { font-size:12px; color:#2563eb; }
+  .card .ops .off { color:#c0c4cc; cursor:default; }
+  .empty-tip { text-align:center; color:#909399; padding:60px 0; grid-column:1/-1; }
+  /* 右侧预览 */
+  .preview { width:46%; min-width:420px; flex-shrink:0; background:#fff; border-left:1px solid #e4e7ed; display:flex; flex-direction:column; }
+  .preview.off { display:none; }
+  .pv-head { height:56px; border-bottom:1px solid #ebeef5; display:flex; align-items:center; padding:0 16px; gap:10px; }
+  .pv-head b { flex:1; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
+  .pv-head .x { cursor:pointer; color:#909399; font-size:17px; padding:0 4px; }
+  .pv-bar { height:34px; background:#f5f7fa; display:flex; align-items:center; gap:8px; padding:0 12px; font-size:11px; color:#909399; border-bottom:1px solid #ebeef5; }
+  .pv-bar a { color:#2563eb; text-decoration:none; }
+  .pv-bar .ph { color:#c0c4cc; }
+  iframe { flex:1; border:none; width:100%; background:#fff; }
+  .pv-empty { flex:1; display:flex; align-items:center; justify-content:center; color:#c0c4cc; flex-direction:column; gap:10px; }
+</style>
+</head>
+<body>
+  <div class="nav">
+    <div class="logo">恒隆原型库<br><span style="font-size:10px;font-weight:400;color:#7f95ad">补充重构·二开</span></div>
+    <div class="group-title">全部模块</div>
+    <div class="item active" data-d="全部">全部 <span class="cnt" id="cntAll"></span></div>
+    <div class="group-title">业务域</div>
+    <div id="domains"></div>
+  </div>
+  <div class="mid">
+    <div class="topbar">
+      <b>原型门户</b>
+      <span class="sub" id="subTitle"></span>
+      <input id="kw" placeholder="搜索页面名称/状态…">
+      <span class="hub-wrap">
+        <span class="hub-dot s-gray" id="hubDot" title="协同状态,点击查看详情">
+          <span class="led"></span><span id="hubLabel">协同…</span>
+        </span>
+        <div class="hub-pop" id="hubPop">
+          <div class="hp-head"><span id="hubState"></span>
+            <button class="btn-ok" id="hubAck" onclick="ackSync()">✔ 我已同步(proto_sync)</button>
+          </div>
+          <ul id="hubList"></ul>
+        </div>
+      </span>
+      <a class="btn" id="liveBtn" target="_blank">🖥 线上系统</a>
+      <a class="btn" id="repoBtn" target="_blank">📦 Gogs 仓库</a>
+    </div>
+    <div class="list"><div class="cards" id="cards"></div></div>
+  </div>
+  <div class="preview off" id="preview">
+    <div class="pv-head"><b id="pvTitle"></b><a class="btn" id="pvOpen" target="_blank" style="height:28px;line-height:26px;font-size:12px;padding:0 10px;border:1px solid #dcdfe6;border-radius:4px;color:#2563eb;text-decoration:none">新标签打开</a><span class="x" onclick="closePv()">✕</span></div>
+    <div class="pv-bar" id="pvBar"></div>
+    <iframe id="pvFrame"></iframe>
+    <div class="pv-empty" id="pvEmpty"><div style="font-size:36px">👁</div>点击左侧卡片在此预览原型<br><span style="font-size:12px">原型内「ⓘ 逻辑标注」等交互均可在预览中操作</span></div>
+  </div>
+<script src="_meta.js"></script>
+<script>
+var M = window.PROTO_META, curDomain = "全部", curPage = null;
+document.getElementById("subTitle").textContent = M.system + " · " + M.repo.desc;
+document.getElementById("repoBtn").href = M.repo.url;
+var liveBtn = document.getElementById("liveBtn");
+if (M.live.url) { liveBtn.href = M.live.url; } else { liveBtn.title = M.live.note; liveBtn.style.color = "#c0c4cc"; liveBtn.onclick = function () { alert("线上系统地址待登记:编辑 _meta.js 的 live.url"); return false; }; }
+/* 域导航 */
+var dbox = document.getElementById("domains");
+M.domains.forEach(function (d) {
+  var n = M.pages.filter(function (p) { return p.domain === d; }).length;
+  var el = document.createElement("div"); el.className = "item"; el.dataset.d = d;
+  el.innerHTML = d + (n ? ' <span class="cnt">' + n + "</span>" : "");
+  if (!n) { el.style.color = "#5b6b7d"; el.title = "暂无原型,欢迎补充"; }
+  dbox.appendChild(el);
+});
+document.getElementById("cntAll").textContent = M.pages.length;
+document.querySelector(".nav").addEventListener("click", function (e) {
+  var it = e.target.closest(".item"); if (!it) return;
+  document.querySelectorAll(".nav .item").forEach(function (x) { x.classList.remove("active"); });
+  it.classList.add("active"); curDomain = it.dataset.d; render();
+});
+document.getElementById("kw").addEventListener("input", render);
+function typeBadge(t) {
+  var c = { "墨刀": "#7c3aed", "线上系统": "#0e7490", "需求文档": "#b45309", "新设计": "#16a34a" }[t] || "#909399";
+  return '<b style="color:' + c + ';font-weight:600">[' + t + ']</b>';
+}
+function render() {
+  var kw = (document.getElementById("kw").value || "").trim();
+  var box = document.getElementById("cards"); box.innerHTML = "";
+  var list = M.pages.filter(function (p) {
+    if (curDomain !== "全部" && p.domain !== curDomain) return false;
+    if (kw && !(p.name + p.status + p.domain).includes(kw)) return false;
+    return true;
+  });
+  if (!list.length) { box.innerHTML = '<div class="empty-tip">该模块暂无原型<br><span style="font-size:12px">用 reproto 流程重构后收录,并更新 _meta.js</span></div>'; return; }
+  list.forEach(function (p) {
+    var c = document.createElement("div");
+    c.className = "card" + (curPage === p.file ? " sel" : "");
+    var src = p.initialSource;
+    c.innerHTML =
+      "<h3>" + p.domain + " · " + p.name + ' <span class="st">' + p.status + "</span></h3>" +
+      '<div class="meta-row">初始版本:' + typeBadge(src.type) +
+      (src.url ? ' <a href="' + src.url + '" target="_blank" onclick="event.stopPropagation()">' + (src.desc || "查看来源") + "</a>" : " " + (src.desc || "")) + "</div>" +
+      '<div class="meta-row">线上对照:' + (p.liveUrl ? ' <a href="' + p.liveUrl + '" target="_blank" onclick="event.stopPropagation()">打开线上页面</a>' : ' <span class="pend">待登记(_meta.js liveUrl)</span>') +
+      ' · 更新:' + p.updated + "</div>" +
+      (p.related ? '<div class="meta-row" style="white-space:normal;color:#b0b6bf">' + p.related + "</div>" : "") +
+      '<div class="ops"><span>👁 点击预览</span></div>';
+    c.onclick = function () { openPv(p); };
+    box.appendChild(c);
+  });
+}
+function openPv(p) {
+  curPage = p.file; render();
+  document.getElementById("preview").classList.remove("off");
+  document.getElementById("pvEmpty").style.display = "none";
+  document.getElementById("pvFrame").style.display = "block";
+  document.getElementById("pvTitle").textContent = p.domain + " · " + p.name + "(" + p.status + ")";
+  document.getElementById("pvOpen").href = p.file;
+  document.getElementById("pvBar").innerHTML =
+    "本地: " + p.file + " · 线上: " + (p.liveUrl ? '<a href="' + p.liveUrl + '" target="_blank">' + p.liveUrl + "</a>" : '<span class="ph">待登记</span>');
+  document.getElementById("pvFrame").src = p.file;
+}
+function closePv() {
+  document.getElementById("preview").classList.add("off");
+  document.getElementById("pvFrame").src = "about:blank";
+  document.getElementById("pvFrame").style.display = "none";
+  document.getElementById("pvEmpty").style.display = "flex";
+  curPage = null; render();
+}
+render();
+/* ── 协同状态灯(常驻):绿=已最新 红=有待同步 灰=hub未连通;点击弹详情面板,同步动作交给AI/MCP ── */
+(function () {
+  var H = window.PROTO_META.hub;
+  var dot = document.getElementById("hubDot"), pop = document.getElementById("hubPop");
+  if (!H || !H.url) { dot.classList.add("s-gray"); document.getElementById("hubLabel").textContent = "协同未配置"; return; }
+  var LS = "wedo_lastSynced_" + (H.repo || "default");
+  var lastEvs = [];                     /* 最近一次轮询到的事件(详情面板渲染用) */
+  function fetchAll() {
+    return fetch(H.url.replace(/\/$/, "") + "/events?repo=" + encodeURIComponent(H.repo || "") + "&since=0",
+      { headers: H.token ? { "x-wedo-token": H.token } : {} }).then(function (r) { return r.json(); });
+  }
+  function fmtTs(ts) {
+    var t = new Date(ts);
+    return ("0" + t.getHours()).slice(-2) + ":" + ("0" + t.getMinutes()).slice(-2);
+  }
+  function setState(st, label) {        /* st: green|red|gray */
+    dot.classList.remove("s-green", "s-red", "s-gray");
+    dot.classList.add("s-" + st);
+    document.getElementById("hubLabel").textContent = label;
+    var head = document.getElementById("hubState");
+    head.className = "st-" + st;
+    head.textContent = st === "green" ? "✓ 已是最新,无待同步改动"
+      : st === "red" ? "🔔 有待同步的原型更新(下方橙色条目)" : "⚠ hub 未连通(检查网络/服务)";
+    document.getElementById("hubAck").style.display = st === "red" ? "" : "none";
+  }
+  function renderPop(pendingTs) {
+    var ul = document.getElementById("hubList");
+    if (!lastEvs.length) { ul.innerHTML = '<div class="hp-empty">暂无协同事件</div>'; return; }
+    ul.innerHTML = lastEvs.slice(-8).reverse().map(function (e) {
+      return '<li class="' + (e.ts > pendingTs ? "pending" : "") + '"><span class="u">' + e.user + '</span><span class="t">' + fmtTs(e.ts) + '</span><br>' + e.message + "</li>";
+    }).join("");
+  }
+  function check() {
+    fetchAll().then(function (d) {
+      lastEvs = (d && d.events) || [];
+      if (!lastEvs.length) { setState("green", "协同·无事件"); renderPop(Infinity); return; }
+      var last = lastEvs[lastEvs.length - 1];
+      var mine = localStorage.getItem(LS);
+      if (mine === null) { localStorage.setItem(LS, String(last.ts)); mine = String(last.ts); }  /* 首访以最新为基线,不误报 */
+      if (last.ts > Number(mine)) { setState("red", "有更新待同步"); renderPop(Number(mine)); }
+      else { setState("green", "协同·已最新"); renderPop(Infinity); }
+    }).catch(function () { setState("gray", "协同·未连通"); });
+  }
+  dot.addEventListener("click", function (e) {
+    e.stopPropagation();
+    pop.classList.toggle("show");
+  });
+  document.addEventListener("click", function (e) {
+    if (!e.target.closest(".hub-wrap")) pop.classList.remove("show");
+  });
+  window.ackSync = function () {
+    fetchAll().then(function (d) {
+      var evs = (d && d.events) || [];
+      if (evs.length) localStorage.setItem(LS, String(evs[evs.length - 1].ts));
+      setState("green", "协同·已最新"); renderPop(Infinity);
+    }).catch(function () { setState("gray", "协同·未连通"); });
+  };
+  check();
+  setInterval(check, 2 * 60 * 1000);
+})();
+</script>
+</body>
+</html>