bfi-cli 0.1.101 → 0.1.102
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/README.md +2 -2
- package/dist/_chunks/command.mjs +2 -2
- package/dist/cli.mjs +31 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,7 +101,7 @@ Codex 不支持独立旧 SSE、拼接变量或 env_vars 重命名。`cwd` 仅在
|
|
|
101
101
|
|
|
102
102
|
`src/lib/installation/contracts.ts` 与 `test-fixtures/installation/collection-v1.json` 固定后续 Java/TypeScript 契约:ID 均为字符串;直接安装根明确列举,嵌套 SKILL.md 只是支持文件;MCP 只允许凭据占位符。当前解析器检查 schema、根重叠、大小写冲突、路径和字面凭据,不下载或执行文件,不开放服务端接口。每文件上限 50 MiB、总计 500 MiB、文件数 20,000,未来服务端必须使用相同限制或更严格限制。
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
单个技能与技能组合都沿用原有安装路径:`bfi skills add` 安装单个技能,`bfi skills package install` 安装组合内的全部技能;组合关联的 MCP 使用 `bfi mcp install` 单独安装。组合 ZIP 为各技能文件夹加根目录 `mcp.json`(仅当组合关联 MCP 时存在)。其它 Git/本地技能来源仍走既有 skills.sh 路径;独立 MCP 和显式 `--as plugin` 不变。缺 Agent/范围时分别询问,不默认增加 universal Agent。非交互必须显式给出目标、范围和 `-y`;不支持 `--skills-only`,关联 MCP 不可取消。
|
|
105
105
|
|
|
106
106
|
```sh
|
|
107
107
|
bfi skills add @global/bfi-configuring-ui
|
|
@@ -134,7 +134,7 @@ MCP 连接结构复用已有标准化校验;已知凭据字段、敏感输入
|
|
|
134
134
|
|
|
135
135
|
### P4 网页安装入口与运行时检查
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
技能组合的安装卡片直接列出 CLI 命令(登录、安装组合、安装关联 MCP)并提供 ZIP 下载,不解析内容计划;单个技能使用原有的 `bfi skills add` 命令和技能原始 ZIP 下载;插件的安装抽屉先解析固定内容计划,再生成 `--content-plan` 实际命令。目标 Agent 和范围可独立省略,CLI 交互确认。安装、npm 升级与登录命令均可复制。
|
|
138
138
|
|
|
139
139
|
服务端 `INSTALLATION_VERIFIED_CLI_VERSION` 和 `INSTALLATION_VERIFIED_CLI_CAPABILITIES` 默认空,不再作为网页展示命令的前置条件。本机执行 `bfi capabilities --json` 检查实际能力;npm 版尚未发布这些能力时可用当前开发构建验证,不把命令展示等同于已经发布。`COLLECTION_MCP_WRITE_ENABLED` 默认开启,可显式关闭;`COLLECTION_INSTALL_ENABLED=false` 会让含 MCP 的组合失败关闭,保留数据,不退回仅安装技能。旧 v1 组合读取/下载要求声明 `collection-mcp-v1` 才允许处理含 MCP 的组合;能力声明不替代授权。
|
|
140
140
|
|
package/dist/_chunks/command.mjs
CHANGED
|
@@ -689,8 +689,8 @@ async function dispatchInstallation(raw) {
|
|
|
689
689
|
"remove",
|
|
690
690
|
"rm"
|
|
691
691
|
].includes(verb ?? "") ? "uninstall" : void 0;
|
|
692
|
-
const requested = tail.some((value) => /^(--content-plan|--
|
|
693
|
-
if (!command || !
|
|
692
|
+
const requested = tail.some((value) => /^(--content-plan|--from-archive|--operation)(=|$)/.test(value));
|
|
693
|
+
if (!command || !requested) return false;
|
|
694
694
|
await runInstallation(command, collection ? "COLLECTION" : "SKILL", tail);
|
|
695
695
|
return true;
|
|
696
696
|
}
|
package/dist/cli.mjs
CHANGED
|
@@ -513,7 +513,7 @@ function installationArgumentError(args) {
|
|
|
513
513
|
"--skills-only"
|
|
514
514
|
];
|
|
515
515
|
const found = command.find((argument) => reserved.includes(argument.split("=")[0]));
|
|
516
|
-
if (found) return `当前命令不支持 ${found.split("=")[0]}
|
|
516
|
+
if (found) return `当前命令不支持 ${found.split("=")[0]}。安装范围请使用 -g/--global;完整安装请从技能组合入口并显式提供 --content-plan/--from-archive/--operation。现有安装不会静默忽略此参数。`;
|
|
517
517
|
}
|
|
518
518
|
var api_exports = /* @__PURE__ */ __exportAll({ SkillHubAPI: () => SkillHubAPI });
|
|
519
519
|
var SkillHubAPI = class {
|
|
@@ -721,6 +721,10 @@ var SkillHubAPI = class {
|
|
|
721
721
|
const body = (await this.request("GET", `/namespaces/${namespace}/packages/${slug}`, { headers: { "X-BFI-Capabilities": getCapabilities("").capabilities.join(",") } })).body;
|
|
722
722
|
return body.data || body;
|
|
723
723
|
}
|
|
724
|
+
async getPackageMcps(namespace, slug) {
|
|
725
|
+
const body = (await this.request("GET", `/namespaces/${namespace}/packages/${slug}/mcps`)).body;
|
|
726
|
+
return body.data || body;
|
|
727
|
+
}
|
|
724
728
|
async listComponentFiles(namespace, slug, componentId) {
|
|
725
729
|
const body = (await this.request("GET", `/namespaces/${namespace}/packages/${slug}/components/${componentId}/files`)).body;
|
|
726
730
|
return body.data || body;
|
|
@@ -7036,7 +7040,7 @@ function printPackageHelp() {
|
|
|
7036
7040
|
console.log(` ${DIM$3}bfi skills package search <query>${RESET$3} 搜索包`);
|
|
7037
7041
|
console.log();
|
|
7038
7042
|
console.log(`${BOLD$1}服务端管理:${RESET$3}`);
|
|
7039
|
-
console.log(` ${DIM$3}bfi skills package create <slug>${RESET$3}
|
|
7043
|
+
console.log(` ${DIM$3}bfi skills package create <slug> --skill <ref>${RESET$3} 创建包(至少一个技能)`);
|
|
7040
7044
|
console.log(` ${DIM$3}bfi skills package add-skills <ref> [skills...]${RESET$3} 添加技能到包`);
|
|
7041
7045
|
console.log(` ${DIM$3}bfi skills package remove-skills <ref> [skills...]${RESET$3} 从包移除技能`);
|
|
7042
7046
|
console.log();
|
|
@@ -7053,6 +7057,7 @@ function printPackageHelp() {
|
|
|
7053
7057
|
console.log(` -g, --global 安装到主目录而非当前项目`);
|
|
7054
7058
|
console.log(` --name <name> 显示名称(create 时)`);
|
|
7055
7059
|
console.log(` --description <t> 描述(create 时)`);
|
|
7060
|
+
console.log(` --skill <ref> create 时的关联技能,至少一个,可重复`);
|
|
7056
7061
|
console.log(` --json JSON 输出`);
|
|
7057
7062
|
console.log();
|
|
7058
7063
|
}
|
|
@@ -7428,6 +7433,14 @@ async function handleInstall(args, api, globalOpts) {
|
|
|
7428
7433
|
};
|
|
7429
7434
|
}
|
|
7430
7435
|
saveLockfile(cwd, lock);
|
|
7436
|
+
try {
|
|
7437
|
+
const mcpNames = ((await api.getPackageMcps(namespace, slug))?.mcps ?? []).filter((entry) => entry?.mcpEntryId).map((entry) => entry.lastKnownName).filter((name) => typeof name === "string" && name.length > 0);
|
|
7438
|
+
if (mcpNames.length > 0) {
|
|
7439
|
+
console.log();
|
|
7440
|
+
console.log(`${DIM$3}该组合关联 MCP:${mcpNames.join("、")}${RESET$3}`);
|
|
7441
|
+
console.log(`${DIM$3}安装 MCP:bfi mcp install ${mcpNames.join(" ")} --agent <agent>${RESET$3}`);
|
|
7442
|
+
}
|
|
7443
|
+
} catch {}
|
|
7431
7444
|
for (const skillRef of installedSkills) await reportInstallEventForSkill(api, {
|
|
7432
7445
|
skillId: skills.find((entry) => `@${entry.namespace || namespace}/${entry.slug}` === skillRef)?.skillId,
|
|
7433
7446
|
agentTarget: targetAgents[0]
|
|
@@ -7589,19 +7602,33 @@ async function handleSearch(args, api, globalOpts) {
|
|
|
7589
7602
|
async function handleCreate(args, api, globalOpts) {
|
|
7590
7603
|
const slug = args[0];
|
|
7591
7604
|
if (!slug) {
|
|
7592
|
-
console.error("用法:bfi skills package create <slug> [options]");
|
|
7605
|
+
console.error("用法:bfi skills package create <slug> --skill <@空间/技能> [--skill ...] [options]");
|
|
7593
7606
|
process.exit(1);
|
|
7594
7607
|
}
|
|
7595
7608
|
const namespace = getOptionValue(args, "--namespace") || globalOpts.namespace || "global";
|
|
7596
7609
|
const name = getOptionValue(args, "--name");
|
|
7597
7610
|
const description = getOptionValue(args, "--description");
|
|
7598
7611
|
const visibility = getOptionValue(args, "--visibility") || "private";
|
|
7612
|
+
const skillRefs = [];
|
|
7613
|
+
for (let index = 0; index < args.length; index++) if (args[index] === "--skill" && args[index + 1]) skillRefs.push(args[++index]);
|
|
7614
|
+
if (skillRefs.length === 0) {
|
|
7615
|
+
console.error(`${RED$1}技能组合至少需要关联一个技能,请使用 --skill <@空间/技能> 指定。${RESET$3}`);
|
|
7616
|
+
process.exit(1);
|
|
7617
|
+
}
|
|
7618
|
+
const skills = skillRefs.map((ref) => {
|
|
7619
|
+
const identity = parseSkillRef(ref, namespace);
|
|
7620
|
+
return {
|
|
7621
|
+
namespace: identity.namespace,
|
|
7622
|
+
slug: identity.slug
|
|
7623
|
+
};
|
|
7624
|
+
});
|
|
7599
7625
|
try {
|
|
7600
7626
|
const result = await api.createPackage(namespace, {
|
|
7601
7627
|
slug,
|
|
7602
7628
|
displayName: name || slug,
|
|
7603
7629
|
description: description || "",
|
|
7604
|
-
visibility: visibility.toUpperCase()
|
|
7630
|
+
visibility: visibility.toUpperCase(),
|
|
7631
|
+
skills
|
|
7605
7632
|
});
|
|
7606
7633
|
console.log(`${GREEN$2}✓ 已创建包 ${toSkillRefString(namespace, slug)}${RESET$3}`);
|
|
7607
7634
|
const pkg = result.package || result.data || result;
|