@collectui/cli 0.2.18 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@collectui/cli",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "description": "One CLI for every shadcn library on CollectUI Dash \u2014 login once, configure registries & MCP, scaffold agent-ready projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/catalog.mjs CHANGED
@@ -103,6 +103,9 @@ export const MCP_PRODUCTS = {
103
103
  kind: "stdio",
104
104
  packageName: "@collectui/bdui",
105
105
  args: ["mcp"],
106
+ // keyMode "args":与 bdui CLI 同 key,`--key <key>` 内嵌(bdui mcp 官方
107
+ // 通道);不进无效的 env API_KEY 字段
108
+ keyMode: "args",
106
109
  serverName: "boardui",
107
110
  keyPrefix: "bdui",
108
111
  },
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
- if (!unit.mcp) {
43
- if (unit.shadcnUiMcp) needsShadcn = true;
44
- continue;
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 key = resolveLibKeys(unit, me).mcp;
52
- if (!key) {
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
  );
@@ -74,7 +80,13 @@ export function buildMcpEntries({ units, me, dashToken, registryBase, dashBase,
74
80
  ...(product.args?.length
75
81
  ? { args: ["-y", `${product.packageName}@latest`, ...product.args] }
76
82
  : {}),
77
- env: { API_KEY: key, ...(product.extraEnv ?? {}) },
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
+ : {}),
78
90
  site: unit.site,
79
91
  product: product.id,
80
92
  key,
@@ -130,7 +142,10 @@ export function renderEntry(entry, client) {
130
142
  return base;
131
143
  }
132
144
  // stdio
133
- const args = entry.args ?? ["-y", `${entry.packageName}@latest`];
145
+ const args = [
146
+ ...(entry.args ?? ["-y", `${entry.packageName}@latest`]),
147
+ ...(entry.keyArgs ?? []),
148
+ ];
134
149
  if (entry.command && !entry.packageName) {
135
150
  const value = { command: entry.command, args: [...args] };
136
151
  if (spec?.type) return { type: "stdio", ...value };