@cannbot-ai/install-helper 1.1.6-beta.11 → 1.1.6-beta.13
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 +34 -2
- package/dist/index.js +42 -9
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -125,13 +125,45 @@ install-helper uninstall --all --tool opencode --level project # 指定范围
|
|
|
125
125
|
|
|
126
126
|
根据安装记录精确删除所有产物,自动清理空目录。
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
**交互式卸载**:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
install-helper uninstall
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- 自动检测已安装内容,跳过只有单一选项的步骤(如仅一个工具/级别有内容时自动选中)
|
|
135
|
+
- 若 Skills 和 Plugins 都已安装,先选择卸载类型
|
|
136
|
+
- ≤15 个已安装 Skill 时显示扁平列表,>15 个时按类别导航
|
|
137
|
+
- **勾选=卸载**(标准 checkbox 语义),勾选后确认即可批量卸载
|
|
138
|
+
- 支持跨类别累积选择
|
|
139
|
+
|
|
140
|
+
**`--all` 一键卸载**:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
install-helper uninstall --all --yes
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
卸载指定范围内全部已安装的 Skills 和 Plugins。通过 `--tool` / `--level` 限定范围,未指定时默认 project 级别。
|
|
147
|
+
|
|
148
|
+
**`--recent` 批次卸载**:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
install-helper uninstall --recent --yes
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
仅卸载最近一次安装批次中的 Skills。每次 `install-helper install` 会自动记录安装批次,`--recent` 精确卸载最后一批,不影响更早安装的内容。
|
|
155
|
+
|
|
156
|
+
**安全机制**:
|
|
157
|
+
|
|
158
|
+
- 仅删除 `install-helper` 安装的 symlink,不影响用户手动创建的目录或文件
|
|
159
|
+
- 无安装记录时自动回退到文件系统扫描(识别 symlink)和 manifest 文件,确保残留内容可清理
|
|
160
|
+
- Plugin 卸载时完整清理 skills、agents、配置文件(AGENTS.md/CLAUDE.md)、manifest、外部仓库链接
|
|
129
161
|
|
|
130
162
|
**选项:**
|
|
131
163
|
|
|
132
164
|
| 选项 | 说明 |
|
|
133
165
|
|------|------|
|
|
134
|
-
| `--tool <tool>` | 指定 AI
|
|
166
|
+
| `--tool <tool>` | 指定 AI 工具(opencode, claude, trae, cursor, copilot, codearts) |
|
|
135
167
|
| `--level <level>` | 安装级别(project, global),默认 project |
|
|
136
168
|
| `--yes` `-y` | 跳过确认提示 |
|
|
137
169
|
| `--all` `-a` | 卸载全部已安装 Skills 和 Plugins |
|
package/dist/index.js
CHANGED
|
@@ -479,7 +479,7 @@ var init_embedded_plugins = __esm({
|
|
|
479
479
|
aliases: [
|
|
480
480
|
"triton"
|
|
481
481
|
],
|
|
482
|
-
skills:
|
|
482
|
+
skills: 8,
|
|
483
483
|
agents: 0,
|
|
484
484
|
description: "Triton-Ascend \u7B97\u5B50 6 \u9636\u6BB5\u81EA\u52A8\u751F\u6210\u4E0E\u4F18\u5316\uFF08\u63CF\u8FF0\u2192\u4EE3\u7801\u2192\u9A8C\u8BC1\u2192\u4F18\u5316\uFF09",
|
|
485
485
|
version: "1.0.2",
|
|
@@ -495,7 +495,8 @@ var init_embedded_plugins = __esm({
|
|
|
495
495
|
"triton-op-verifier",
|
|
496
496
|
"triton-latency-optimizer",
|
|
497
497
|
"npu-arch",
|
|
498
|
-
"triton-precision-debug"
|
|
498
|
+
"triton-precision-debug",
|
|
499
|
+
"triton-simulator-optimizer"
|
|
499
500
|
]
|
|
500
501
|
}
|
|
501
502
|
],
|
|
@@ -2891,7 +2892,7 @@ function removeSkillsFromRecord(skillIds, tool, level, installPath) {
|
|
|
2891
2892
|
}
|
|
2892
2893
|
writeSkillRecord(record);
|
|
2893
2894
|
}
|
|
2894
|
-
function getInstalledSkills(tool, level, installPath) {
|
|
2895
|
+
function getInstalledSkills(tool, level, installPath, allowFsScan = true) {
|
|
2895
2896
|
const record = readSkillRecord();
|
|
2896
2897
|
const recordedSkills = record[tool]?.[level]?.[installPath]?.skills || [];
|
|
2897
2898
|
const configRoot = getConfigRoot(tool, level);
|
|
@@ -2900,6 +2901,9 @@ function getInstalledSkills(tool, level, installPath) {
|
|
|
2900
2901
|
const skillPath = join10(skillsDir, skillId);
|
|
2901
2902
|
return existsSync11(skillPath) || isSymlink(skillPath);
|
|
2902
2903
|
});
|
|
2904
|
+
if (!allowFsScan) {
|
|
2905
|
+
return fromRecord;
|
|
2906
|
+
}
|
|
2903
2907
|
const fromFs = [];
|
|
2904
2908
|
if (existsSync11(skillsDir)) {
|
|
2905
2909
|
try {
|
|
@@ -2923,7 +2927,7 @@ function getLastBatchSkills(tool, level, installPath) {
|
|
|
2923
2927
|
return null;
|
|
2924
2928
|
}
|
|
2925
2929
|
const lastBatch = entry.batches[entry.batches.length - 1];
|
|
2926
|
-
const configRoot = getConfigRoot(tool, level);
|
|
2930
|
+
const configRoot = level === "project" ? getConfigRoot(tool, level, installPath) : getConfigRoot(tool, level);
|
|
2927
2931
|
const skillsDir = join10(configRoot, "skills");
|
|
2928
2932
|
return lastBatch.skills.filter((skillId) => {
|
|
2929
2933
|
const skillPath = join10(skillsDir, skillId);
|
|
@@ -4995,7 +4999,7 @@ async function installPlugins(pluginIds, tool, level, repoPath, installPath, yes
|
|
|
4995
4999
|
|
|
4996
5000
|
// src/commands/uninstall.ts
|
|
4997
5001
|
init_registry();
|
|
4998
|
-
import { existsSync as existsSync18, unlinkSync as unlinkSync6, rmdirSync, readdirSync as readdirSync7 } from "fs";
|
|
5002
|
+
import { existsSync as existsSync18, unlinkSync as unlinkSync6, rmdirSync, readdirSync as readdirSync7, readFileSync as readFileSync9 } from "fs";
|
|
4999
5003
|
import { resolve, basename as basename3, sep, join as join18 } from "path";
|
|
5000
5004
|
import chalk11 from "chalk";
|
|
5001
5005
|
import { select as select5, checkbox as checkbox2, Separator as Separator4, confirm as confirm3 } from "@inquirer/prompts";
|
|
@@ -5044,7 +5048,7 @@ async function uninstallCommand(names, options) {
|
|
|
5044
5048
|
}
|
|
5045
5049
|
async function uninstallAll(tool, level, yes) {
|
|
5046
5050
|
const installPath = level === "project" ? process.cwd() : getConfigRoot(tool, level);
|
|
5047
|
-
const installedSkills = getInstalledSkills(tool, level, installPath);
|
|
5051
|
+
const installedSkills = getInstalledSkills(tool, level, installPath, !yes);
|
|
5048
5052
|
const installedPlugins = scanInstalled().filter((p) => p.tool === tool && p.level === level);
|
|
5049
5053
|
const totalItems = installedSkills.length + installedPlugins.length;
|
|
5050
5054
|
if (totalItems === 0) {
|
|
@@ -5277,7 +5281,36 @@ async function uninstallPlugins(pluginIds, batchMode) {
|
|
|
5277
5281
|
async function uninstallPluginById(pluginId, batchMode) {
|
|
5278
5282
|
const plugin = findPlugin(pluginId);
|
|
5279
5283
|
if (!plugin) return;
|
|
5280
|
-
|
|
5284
|
+
let record = readRecord(plugin.id);
|
|
5285
|
+
if (!record) {
|
|
5286
|
+
for (const toolName of VALID_TOOLS) {
|
|
5287
|
+
for (const lvl of ["project", "global"]) {
|
|
5288
|
+
const configRoot2 = getConfigRoot(toolName, lvl);
|
|
5289
|
+
const manifestPath = join18(configRoot2, `${pluginId}-manifest.json`);
|
|
5290
|
+
if (!existsSync18(manifestPath)) continue;
|
|
5291
|
+
let manifest = null;
|
|
5292
|
+
try {
|
|
5293
|
+
manifest = JSON.parse(readFileSync9(manifestPath, "utf-8"));
|
|
5294
|
+
} catch {
|
|
5295
|
+
continue;
|
|
5296
|
+
}
|
|
5297
|
+
const installPath = lvl === "project" ? process.cwd() : configRoot2;
|
|
5298
|
+
record = scanInstalledFiles(
|
|
5299
|
+
pluginId,
|
|
5300
|
+
plugin.displayName,
|
|
5301
|
+
toolName,
|
|
5302
|
+
lvl,
|
|
5303
|
+
installPath,
|
|
5304
|
+
configRoot2,
|
|
5305
|
+
manifest,
|
|
5306
|
+
plugin.externalRepos?.map((r) => basename3(r.dir)),
|
|
5307
|
+
plugin.configRootConfigLink
|
|
5308
|
+
);
|
|
5309
|
+
break;
|
|
5310
|
+
}
|
|
5311
|
+
if (record) break;
|
|
5312
|
+
}
|
|
5313
|
+
}
|
|
5281
5314
|
if (!record) {
|
|
5282
5315
|
logger.warn(`${plugin.displayName} ${t("uninstall_no_record")}`);
|
|
5283
5316
|
logger.info(`${t("uninstall_no_record_hint")}`);
|
|
@@ -5569,7 +5602,7 @@ async function langCommand(action, value) {
|
|
|
5569
5602
|
// src/cli.ts
|
|
5570
5603
|
init_config();
|
|
5571
5604
|
init_i18n();
|
|
5572
|
-
import { readFileSync as
|
|
5605
|
+
import { readFileSync as readFileSync10, existsSync as existsSync20 } from "fs";
|
|
5573
5606
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
5574
5607
|
import { dirname as dirname6, join as join20 } from "path";
|
|
5575
5608
|
function readVersion() {
|
|
@@ -5589,7 +5622,7 @@ function readVersion() {
|
|
|
5589
5622
|
];
|
|
5590
5623
|
for (const pkgPath of candidates) {
|
|
5591
5624
|
if (existsSync20(pkgPath)) {
|
|
5592
|
-
const pkg = JSON.parse(
|
|
5625
|
+
const pkg = JSON.parse(readFileSync10(pkgPath, "utf-8"));
|
|
5593
5626
|
if (pkg.version && (pkg.name === "@cannbot-ai/install-helper" || pkg.name?.startsWith("@cannbot-ai/install-helper-"))) {
|
|
5594
5627
|
return pkg.version;
|
|
5595
5628
|
}
|