@collectui/cli 0.2.17 → 0.2.19
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/package.json +1 -1
- package/src/catalog.mjs +14 -0
- package/src/mcp.mjs +27 -8
package/package.json
CHANGED
package/src/catalog.mjs
CHANGED
|
@@ -97,6 +97,18 @@ export const MCP_PRODUCTS = {
|
|
|
97
97
|
serverName: "21st",
|
|
98
98
|
keyPrefix: "21st_mcp",
|
|
99
99
|
},
|
|
100
|
+
boardui: {
|
|
101
|
+
id: "boardui",
|
|
102
|
+
label: "BoardUI",
|
|
103
|
+
kind: "stdio",
|
|
104
|
+
packageName: "@collectui/bdui",
|
|
105
|
+
args: ["mcp"],
|
|
106
|
+
// keyMode "args":与 bdui CLI 同 key,`--key <key>` 内嵌(bdui mcp 官方
|
|
107
|
+
// 通道);不进无效的 env API_KEY 字段
|
|
108
|
+
keyMode: "args",
|
|
109
|
+
serverName: "boardui",
|
|
110
|
+
keyPrefix: "bdui",
|
|
111
|
+
},
|
|
100
112
|
};
|
|
101
113
|
|
|
102
114
|
/** 官方 shadcn 通用 MCP(读 components.json 里全部 registries)。 */
|
|
@@ -336,6 +348,8 @@ export const LIBS = [
|
|
|
336
348
|
},
|
|
337
349
|
],
|
|
338
350
|
env: [{ name: "BOARDUI_API_KEY", from: "cliKey" }],
|
|
351
|
+
// 专属 stdio MCP(bdui mcp)+ shadcn 通用 MCP 备选(远端目录同款)
|
|
352
|
+
mcp: "boardui",
|
|
339
353
|
shadcnUiMcp: true,
|
|
340
354
|
verify: ["@boardui/theme"],
|
|
341
355
|
freeVerify: ["@boardui/theme"],
|
package/src/mcp.mjs
CHANGED
|
@@ -39,17 +39,23 @@ export function buildMcpEntries({ units, me, dashToken, registryBase, dashBase,
|
|
|
39
39
|
let needsShadcn = false;
|
|
40
40
|
|
|
41
41
|
for (const unit of units) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
// shadcn 通用 MCP 的需求先记:unit.mcp 分支因 key 缺失 continue 时不能
|
|
43
|
+
// 把 shadcn server 陪葬(2026-12-01 boardui 盲测 P0)
|
|
44
|
+
if (unit.shadcnUiMcp) needsShadcn = true;
|
|
45
|
+
if (!unit.mcp) continue;
|
|
46
46
|
const product = mcpProduct(unit.mcp);
|
|
47
47
|
if (!product) {
|
|
48
48
|
reporter?.warn(`MCP product "${unit.mcp}" is not in the catalog; skipped.`);
|
|
49
49
|
continue;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
|
|
51
|
+
const resolved = resolveLibKeys(unit, me);
|
|
52
|
+
// keyMode "args"(boardui 型:本地 stdio 与 CLI 同 key,官方通道是
|
|
53
|
+
// `--key <key>` 内嵌 args 或本机 login 落盘):回退 cli key,且无 key
|
|
54
|
+
// 也生成裸 server(免费层可浏览安装,Pro 靠 login 落盘解锁)。
|
|
55
|
+
// 默认 "env"(http/通用 stdio):key 进 env/headers,缺 key 跳过。
|
|
56
|
+
const argsMode = product.kind === "stdio" && product.keyMode === "args";
|
|
57
|
+
const key = argsMode ? resolved.mcp ?? resolved.cli : resolved.mcp;
|
|
58
|
+
if (!key && !argsMode) {
|
|
53
59
|
reporter?.warn(
|
|
54
60
|
`No MCP key bound for ${unit.siteName}; its MCP server was skipped (CLI/registry config is unaffected).`
|
|
55
61
|
);
|
|
@@ -70,7 +76,17 @@ export function buildMcpEntries({ units, me, dashToken, registryBase, dashBase,
|
|
|
70
76
|
kind: "stdio",
|
|
71
77
|
serverName: product.serverName ?? product.id,
|
|
72
78
|
packageName: product.packageName,
|
|
73
|
-
|
|
79
|
+
// 子命令尾参(boardui mcp 首例):拼进完整 args,renderEntry 原样用
|
|
80
|
+
...(product.args?.length
|
|
81
|
+
? { args: ["-y", `${product.packageName}@latest`, ...product.args] }
|
|
82
|
+
: {}),
|
|
83
|
+
// keyMode "args":key 作为 `--key <key>` 追加(官方通道),不进 env——
|
|
84
|
+
// 通用 env API_KEY 对 bdui 型 server 无效,还把 key 写进无效字段
|
|
85
|
+
...(argsMode && key
|
|
86
|
+
? { keyArgs: ["--key", key] }
|
|
87
|
+
: !argsMode
|
|
88
|
+
? { env: { API_KEY: key, ...(product.extraEnv ?? {}) } }
|
|
89
|
+
: {}),
|
|
74
90
|
site: unit.site,
|
|
75
91
|
product: product.id,
|
|
76
92
|
key,
|
|
@@ -126,7 +142,10 @@ export function renderEntry(entry, client) {
|
|
|
126
142
|
return base;
|
|
127
143
|
}
|
|
128
144
|
// stdio
|
|
129
|
-
const args =
|
|
145
|
+
const args = [
|
|
146
|
+
...(entry.args ?? ["-y", `${entry.packageName}@latest`]),
|
|
147
|
+
...(entry.keyArgs ?? []),
|
|
148
|
+
];
|
|
130
149
|
if (entry.command && !entry.packageName) {
|
|
131
150
|
const value = { command: entry.command, args: [...args] };
|
|
132
151
|
if (spec?.type) return { type: "stdio", ...value };
|