@cannbot-ai/install-helper 1.2.0 → 1.2.1-beta.0
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 +5 -5
- package/dist/config/repository.yaml +1 -1
- package/dist/index.js +17 -5
- package/dist/index.js.map +1 -1
- package/dist/locales/en_US.json +1 -0
- package/dist/locales/zh_CN.json +1 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -101,18 +101,18 @@ install-helper install --list # 查看所有可用 Sk
|
|
|
101
101
|
|------|------|
|
|
102
102
|
| `--tool <tool>` | 指定 AI 工具(opencode, claude, trae, cursor, codex, copilot, codearts) |
|
|
103
103
|
| `--level <level>` | 安装级别(project, global),默认 project |
|
|
104
|
-
| `--source <source>` | 同名插件的安装来源(cannbot, skills):默认 cannbot
|
|
104
|
+
| `--source <source>` | 同名插件的安装来源(cannbot, skills):默认 cannbot 仓插件优先,`--source skills` 强制安装 cannbot-skills 仓旧版 |
|
|
105
105
|
| `--all` `-a` | 安装全部 Skills |
|
|
106
106
|
| `--list` | 按类别列出所有可用 Skills |
|
|
107
107
|
| `--yes` `-y` | 跳过所有确认提示 |
|
|
108
108
|
|
|
109
|
-
### 安装 cannbot
|
|
109
|
+
### 安装 cannbot 仓插件(双源)
|
|
110
110
|
|
|
111
|
-
插件编排已拆分至 [cannbot 仓](https://gitcode.com/cann/cannbot)(`ops-direct-invoke` v3、`ascendc-st-design`、`model-infer-optimize`、`ops-registry-invoke`
|
|
111
|
+
插件编排已拆分至 [cannbot 仓](https://gitcode.com/cann/cannbot)(`ops-direct-invoke` v3、`ascendc-st-design`、`model-infer-optimize`、`ops-registry-invoke` 等 cannbot 仓插件)。install-helper 以**委托转发**方式兼容其安装方式:自动托管 `@cannbot-plugin/cannbot` 安装器(npm 拉取到 `~/.cannbot/installers/cannbot`,按通道 + TTL 自动刷新),安装时委托其执行,产物布局(`.agents/skills`、标记块 AGENTS.md、`.cannbot/plugins/` 资产、`cannbot-plugin.json` 注册表)与 `npx @cannbot-plugin/cannbot install` 直装**完全一致**。
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
|
-
install-helper install ops-direct-invoke --tool opencode # cannbot
|
|
115
|
-
install-helper install ops-direct-invoke --source skills --tool opencode #
|
|
114
|
+
install-helper install ops-direct-invoke --tool opencode # cannbot 仓插件(默认)
|
|
115
|
+
install-helper install ops-direct-invoke --source skills --tool opencode # cannbot-skills 仓旧版
|
|
116
116
|
install-helper update ops-direct-invoke # 更新 = 重新委托安装
|
|
117
117
|
install-helper uninstall ops-direct-invoke # 按 cannbot-plugin.json 注册表精确卸载
|
|
118
118
|
```
|
|
@@ -28,7 +28,7 @@ pluginDirs:
|
|
|
28
28
|
|
|
29
29
|
scanCacheTtlHours: 24
|
|
30
30
|
|
|
31
|
-
# cannbot 仓(https://gitcode.com/cann/cannbot
|
|
31
|
+
# cannbot 仓(https://gitcode.com/cann/cannbot)插件的安装器托管配置。
|
|
32
32
|
# install-helper 以委托转发方式安装 cannbot 型插件:按通道将
|
|
33
33
|
# @cannbot-plugin/cannbot 安装到 ~/.cannbot/installers/cannbot,
|
|
34
34
|
# 超过 ttlHours 后自动按通道刷新。
|
package/dist/index.js
CHANGED
|
@@ -112,6 +112,7 @@ var init_zh_CN = __esm({
|
|
|
112
112
|
error_skill_not_found: "\u672A\u5728\u6CE8\u518C\u8868\u4E2D\u627E\u5230 Skill",
|
|
113
113
|
error_source_not_found: "\u672A\u627E\u5230\u6E90\u6587\u4EF6: {path}",
|
|
114
114
|
error_script_not_found: "\u672A\u627E\u5230\u5B89\u88C5\u811A\u672C: {path}",
|
|
115
|
+
error_cannbot_requires_delegation: "\u63D2\u4EF6 {plugin} \u4E3A cannbot \u4ED3\u59D4\u6258\u5B89\u88C5\u6E90\uFF0C\u987B\u7ECF installPluginRouted \u8DEF\u7531\u5B89\u88C5\uFF08\u5185\u90E8\u8DEF\u7531\u9519\u8BEF\uFF0C\u8BF7\u63D0 Issue \u53CD\u9988\uFF09",
|
|
115
116
|
error_unknown: "\u672A\u77E5\u9519\u8BEF",
|
|
116
117
|
error_not_installed: "\u672A\u5B89\u88C5",
|
|
117
118
|
error_no_shell: "\u672A\u627E\u5230 bash \u6216 sh\uFF0C\u65E0\u6CD5\u6267\u884C\u5B89\u88C5\u811A\u672C\u3002\u8BF7\u5B89\u88C5 Git Bash \u6216 WSL",
|
|
@@ -363,6 +364,7 @@ var init_en_US = __esm({
|
|
|
363
364
|
error_skill_not_found: "Skill not found in registry",
|
|
364
365
|
error_source_not_found: "Source not found: {path}",
|
|
365
366
|
error_script_not_found: "Script not found: {path}",
|
|
367
|
+
error_cannbot_requires_delegation: "Plugin {plugin} is a cannbot-source entry and must be installed via installPluginRouted delegation (internal routing error \u2014 please report an issue)",
|
|
366
368
|
error_unknown: "Unknown error",
|
|
367
369
|
error_not_installed: "Not installed",
|
|
368
370
|
error_no_shell: "bash or sh not found, cannot execute install script. Please install Git Bash or WSL",
|
|
@@ -3757,7 +3759,7 @@ init_registry();
|
|
|
3757
3759
|
init_manifest();
|
|
3758
3760
|
init_paths();
|
|
3759
3761
|
import { existsSync as existsSync16, readFileSync as readFileSync11 } from "fs";
|
|
3760
|
-
import { join as join15, basename as basename2 } from "path";
|
|
3762
|
+
import { join as join15, basename as basename2, isAbsolute } from "path";
|
|
3761
3763
|
import { execa as execa5, execaSync as execaSync2 } from "execa";
|
|
3762
3764
|
|
|
3763
3765
|
// src/core/backup.ts
|
|
@@ -4281,7 +4283,7 @@ function scriptSupportsTool(scriptPath, tool) {
|
|
|
4281
4283
|
}
|
|
4282
4284
|
}
|
|
4283
4285
|
async function installPlugin(opts) {
|
|
4284
|
-
const plugin = getPluginById(opts.pluginId);
|
|
4286
|
+
const plugin = opts.plugin ?? getPluginById(opts.pluginId);
|
|
4285
4287
|
if (!plugin) {
|
|
4286
4288
|
return {
|
|
4287
4289
|
success: false,
|
|
@@ -4292,7 +4294,17 @@ async function installPlugin(opts) {
|
|
|
4292
4294
|
warnings: []
|
|
4293
4295
|
};
|
|
4294
4296
|
}
|
|
4295
|
-
|
|
4297
|
+
if (plugin.source === "cannbot") {
|
|
4298
|
+
return {
|
|
4299
|
+
success: false,
|
|
4300
|
+
pluginId: opts.pluginId,
|
|
4301
|
+
skillsCount: 0,
|
|
4302
|
+
agentsCount: 0,
|
|
4303
|
+
errors: [t("error_cannbot_requires_delegation").replace("{plugin}", plugin.displayName)],
|
|
4304
|
+
warnings: []
|
|
4305
|
+
};
|
|
4306
|
+
}
|
|
4307
|
+
const pluginDir = isAbsolute(plugin.dir) ? plugin.dir : join15(opts.repoPath, plugin.dir);
|
|
4296
4308
|
const cwd = opts.installPath || process.cwd();
|
|
4297
4309
|
const configRoot = getConfigRoot(opts.tool, opts.level, opts.installPath);
|
|
4298
4310
|
const agentsFile = join15(configRoot, getAgentsFileName(opts.tool));
|
|
@@ -4713,7 +4725,7 @@ init_constants();
|
|
|
4713
4725
|
init_logger();
|
|
4714
4726
|
init_i18n();
|
|
4715
4727
|
import { existsSync as existsSync18, mkdirSync as mkdirSync7, symlinkSync as symlinkSync2, readdirSync as readdirSync9, rmSync as rmSync5, realpathSync as realpathSync2, readlinkSync as readlinkSync2, cpSync as cpSync2 } from "fs";
|
|
4716
|
-
import { join as join17, dirname as dirname7, basename as basename3, isAbsolute } from "path";
|
|
4728
|
+
import { join as join17, dirname as dirname7, basename as basename3, isAbsolute as isAbsolute2 } from "path";
|
|
4717
4729
|
import { select as select3, checkbox, Separator as Separator2 } from "@inquirer/prompts";
|
|
4718
4730
|
import chalk5 from "chalk";
|
|
4719
4731
|
import Table from "cli-table3";
|
|
@@ -5232,7 +5244,7 @@ function listAllSkills() {
|
|
|
5232
5244
|
}
|
|
5233
5245
|
function resolveSkillSourcePath(skill, repoPath) {
|
|
5234
5246
|
if (skill.filePath) {
|
|
5235
|
-
const absPath =
|
|
5247
|
+
const absPath = isAbsolute2(skill.filePath) ? skill.filePath : join17(repoPath, skill.filePath);
|
|
5236
5248
|
if (existsSync18(absPath)) {
|
|
5237
5249
|
return dirname7(absPath);
|
|
5238
5250
|
}
|