@cannbot-ai/install-helper 1.1.6-beta.2 → 1.1.6-beta.4
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/dist/index.js +36 -19
- package/dist/index.js.map +1 -1
- package/dist/locales/en_US.json +2 -2
- package/dist/locales/zh_CN.json +2 -2
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -849,7 +849,7 @@ var init_zh_CN = __esm({
|
|
|
849
849
|
uninstall_type_skill: "\u5378\u8F7D Skills",
|
|
850
850
|
uninstall_type_plugin: "\u5378\u8F7D Plugins",
|
|
851
851
|
uninstall_checkbox_hint: "\u52FE\u9009=\u4FDD\u7559\uFF0C\u53D6\u6D88\u52FE\u9009=\u5378\u8F7D",
|
|
852
|
-
uninstall_uncheck_all: "\
|
|
852
|
+
uninstall_uncheck_all: "\u5378\u8F7D\u5168\u90E8",
|
|
853
853
|
uninstall_confirm_count: "\u786E\u8BA4\u5378\u8F7D\uFF08{count} \u4E2A\u5C06\u5378\u8F7D\uFF09",
|
|
854
854
|
uninstall_no_installed: "\u6CA1\u6709\u5DF2\u5B89\u88C5\u7684 Skills \u6216 Plugins",
|
|
855
855
|
uninstall_no_installed_skills: "\u6CA1\u6709\u5DF2\u5B89\u88C5\u7684 Skills",
|
|
@@ -866,7 +866,7 @@ var init_zh_CN = __esm({
|
|
|
866
866
|
uninstall_select_items: "\u7BA1\u7406\u5DF2\u5B89\u88C5\u7684 Skills\uFF08\u7A7A\u683C\u5207\u6362\uFF0C\u56DE\u8F66\u786E\u8BA4\uFF09",
|
|
867
867
|
uninstall_select_plugins: "\u7BA1\u7406\u5DF2\u5B89\u88C5\u7684 Plugins\uFF08\u7A7A\u683C\u5207\u6362\uFF0C\u56DE\u8F66\u786E\u8BA4\uFF09",
|
|
868
868
|
uninstall_select_category: "\u9009\u62E9\u8981\u7BA1\u7406\u7684 Skill \u7C7B\u522B",
|
|
869
|
-
uninstall_uncheck_all_category: "\
|
|
869
|
+
uninstall_uncheck_all_category: "\u5378\u8F7D\u672C\u7C7B\u522B\u5168\u90E8",
|
|
870
870
|
uninstall_continue_or_confirm: "\u5DF2\u6807\u8BB0 {count} \u4E2A\u5F85\u5378\u8F7D\uFF0C\u8BF7\u9009\u62E9\u64CD\u4F5C",
|
|
871
871
|
uninstall_marked_count: "\u5DF2\u6807\u8BB0 {count} \u4E2A\u5F85\u5378\u8F7D",
|
|
872
872
|
uninstall_uncategorized: "\u672A\u5206\u7C7B"
|
|
@@ -1071,7 +1071,7 @@ var init_en_US = __esm({
|
|
|
1071
1071
|
uninstall_type_skill: "Uninstall Skills",
|
|
1072
1072
|
uninstall_type_plugin: "Uninstall Plugins",
|
|
1073
1073
|
uninstall_checkbox_hint: "Checked = keep, unchecked = uninstall",
|
|
1074
|
-
uninstall_uncheck_all: "
|
|
1074
|
+
uninstall_uncheck_all: "Uninstall all",
|
|
1075
1075
|
uninstall_confirm_count: "Confirm uninstall ({count} will be removed)",
|
|
1076
1076
|
uninstall_no_installed: "No installed Skills or Plugins",
|
|
1077
1077
|
uninstall_no_installed_skills: "No installed Skills",
|
|
@@ -1088,7 +1088,7 @@ var init_en_US = __esm({
|
|
|
1088
1088
|
uninstall_select_items: "Manage installed Skills (space to toggle, enter to confirm)",
|
|
1089
1089
|
uninstall_select_plugins: "Manage installed Plugins (space to toggle, enter to confirm)",
|
|
1090
1090
|
uninstall_select_category: "Select Skill category to manage",
|
|
1091
|
-
uninstall_uncheck_all_category: "
|
|
1091
|
+
uninstall_uncheck_all_category: "Uninstall all in this category",
|
|
1092
1092
|
uninstall_continue_or_confirm: "{count} marked for uninstall, choose an action",
|
|
1093
1093
|
uninstall_marked_count: "{count} marked for uninstall",
|
|
1094
1094
|
uninstall_uncategorized: "Uncategorized"
|
|
@@ -2699,7 +2699,7 @@ init_fs();
|
|
|
2699
2699
|
init_fs_helpers();
|
|
2700
2700
|
init_logger();
|
|
2701
2701
|
init_i18n();
|
|
2702
|
-
import { existsSync as existsSync11, mkdirSync as mkdirSync4, readFileSync as readFileSync7, unlinkSync as unlinkSync3 } from "fs";
|
|
2702
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync4, readFileSync as readFileSync7, unlinkSync as unlinkSync3, readdirSync as readdirSync3 } from "fs";
|
|
2703
2703
|
import { join as join10 } from "path";
|
|
2704
2704
|
function getInstallsDir() {
|
|
2705
2705
|
return join10(getCannbotConfigDir(), "installs");
|
|
@@ -2881,10 +2881,27 @@ function getInstalledSkills(tool, level, installPath) {
|
|
|
2881
2881
|
const recordedSkills = record[tool]?.[level]?.[installPath]?.skills || [];
|
|
2882
2882
|
const configRoot = getConfigRoot(tool, level);
|
|
2883
2883
|
const skillsDir = join10(configRoot, "skills");
|
|
2884
|
-
|
|
2884
|
+
const fromRecord = recordedSkills.filter((skillId) => {
|
|
2885
2885
|
const skillPath = join10(skillsDir, skillId);
|
|
2886
2886
|
return existsSync11(skillPath) || isSymlink(skillPath);
|
|
2887
2887
|
});
|
|
2888
|
+
const fromFs = [];
|
|
2889
|
+
if (existsSync11(skillsDir)) {
|
|
2890
|
+
try {
|
|
2891
|
+
const entries = readdirSync3(skillsDir);
|
|
2892
|
+
for (const entry of entries) {
|
|
2893
|
+
if (entry === "." || entry === "..") continue;
|
|
2894
|
+
const entryPath = join10(skillsDir, entry);
|
|
2895
|
+
if (isSymlink(entryPath) || existsSync11(entryPath)) {
|
|
2896
|
+
if (!fromRecord.includes(entry)) {
|
|
2897
|
+
fromFs.push(entry);
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
} catch {
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
return [...fromRecord, ...fromFs];
|
|
2888
2905
|
}
|
|
2889
2906
|
function getLastBatchSkills(tool, level, installPath) {
|
|
2890
2907
|
const record = readSkillRecord();
|
|
@@ -2903,7 +2920,7 @@ function getLastBatchSkills(tool, level, installPath) {
|
|
|
2903
2920
|
|
|
2904
2921
|
// src/core/backup.ts
|
|
2905
2922
|
init_manifest();
|
|
2906
|
-
import { existsSync as existsSync12, copyFileSync, readdirSync as
|
|
2923
|
+
import { existsSync as existsSync12, copyFileSync, readdirSync as readdirSync4, unlinkSync as unlinkSync4 } from "fs";
|
|
2907
2924
|
import { join as join11 } from "path";
|
|
2908
2925
|
init_registry();
|
|
2909
2926
|
init_paths();
|
|
@@ -2968,7 +2985,7 @@ function findBackups(configRoot) {
|
|
|
2968
2985
|
if (!existsSync12(configRoot)) {
|
|
2969
2986
|
return [];
|
|
2970
2987
|
}
|
|
2971
|
-
const files =
|
|
2988
|
+
const files = readdirSync4(configRoot);
|
|
2972
2989
|
const backups = [];
|
|
2973
2990
|
for (const file of files) {
|
|
2974
2991
|
if (file.includes(".cannbot-backup.")) {
|
|
@@ -3564,7 +3581,7 @@ init_fs_helpers();
|
|
|
3564
3581
|
init_constants();
|
|
3565
3582
|
init_logger();
|
|
3566
3583
|
init_i18n();
|
|
3567
|
-
import { existsSync as existsSync15, mkdirSync as mkdirSync6, symlinkSync as symlinkSync2, readdirSync as
|
|
3584
|
+
import { existsSync as existsSync15, mkdirSync as mkdirSync6, symlinkSync as symlinkSync2, readdirSync as readdirSync5, rmSync as rmSync4, realpathSync as realpathSync2, readlinkSync as readlinkSync2, cpSync as cpSync2 } from "fs";
|
|
3568
3585
|
import { join as join14, dirname as dirname5, isAbsolute } from "path";
|
|
3569
3586
|
import { select as select3, checkbox, Separator as Separator2 } from "@inquirer/prompts";
|
|
3570
3587
|
import chalk5 from "chalk";
|
|
@@ -3664,7 +3681,7 @@ async function uninstallSkills(skillIds, tool, level) {
|
|
|
3664
3681
|
}
|
|
3665
3682
|
if (existsSync15(skillsDir)) {
|
|
3666
3683
|
try {
|
|
3667
|
-
const entries =
|
|
3684
|
+
const entries = readdirSync5(skillsDir);
|
|
3668
3685
|
if (entries.length === 0) {
|
|
3669
3686
|
rmSync4(skillsDir, { recursive: true });
|
|
3670
3687
|
logger.step(` ${t("uninstall_clean_empty_dir")}: skills/`);
|
|
@@ -4381,7 +4398,7 @@ init_manifest();
|
|
|
4381
4398
|
init_paths();
|
|
4382
4399
|
init_i18n();
|
|
4383
4400
|
import chalk8 from "chalk";
|
|
4384
|
-
import { existsSync as existsSync17, readdirSync as
|
|
4401
|
+
import { existsSync as existsSync17, readdirSync as readdirSync6, lstatSync as lstatSync2, unlinkSync as unlinkSync5, mkdirSync as mkdirSync7 } from "fs";
|
|
4385
4402
|
import { join as join16 } from "path";
|
|
4386
4403
|
async function doctorCommand(options = {}) {
|
|
4387
4404
|
console.log();
|
|
@@ -4440,7 +4457,7 @@ async function doctorCommand(options = {}) {
|
|
|
4440
4457
|
if (existsSync17(skillsDir)) {
|
|
4441
4458
|
const brokenLinks = checkBrokenLinks(skillsDir);
|
|
4442
4459
|
if (brokenLinks === 0) {
|
|
4443
|
-
const count =
|
|
4460
|
+
const count = readdirSync6(skillsDir).length;
|
|
4444
4461
|
console.log(chalk8.green(" \u2713") + ` ${skillsDir} \u2014 ${t("doctor_links_valid").replace("{count}", String(count))}`);
|
|
4445
4462
|
} else {
|
|
4446
4463
|
console.log(chalk8.yellow(" \u26A0") + ` ${skillsDir} \u2014 ${t("doctor_broken_links").replace("{count}", String(brokenLinks))}`);
|
|
@@ -4462,7 +4479,7 @@ async function doctorCommand(options = {}) {
|
|
|
4462
4479
|
if (existsSync17(agentsDir)) {
|
|
4463
4480
|
const brokenLinks = checkBrokenLinks(agentsDir);
|
|
4464
4481
|
if (brokenLinks === 0) {
|
|
4465
|
-
const count =
|
|
4482
|
+
const count = readdirSync6(agentsDir).length;
|
|
4466
4483
|
console.log(chalk8.green(" \u2713") + ` ${agentsDir} \u2014 ${t("doctor_links_valid").replace("{count}", String(count))}`);
|
|
4467
4484
|
} else {
|
|
4468
4485
|
console.log(chalk8.yellow(" \u26A0") + ` ${agentsDir} \u2014 ${t("doctor_broken_links").replace("{count}", String(brokenLinks))}`);
|
|
@@ -4509,7 +4526,7 @@ async function doctorCommand(options = {}) {
|
|
|
4509
4526
|
function checkBrokenLinks(dir) {
|
|
4510
4527
|
let broken = 0;
|
|
4511
4528
|
try {
|
|
4512
|
-
const entries =
|
|
4529
|
+
const entries = readdirSync6(dir);
|
|
4513
4530
|
for (const entry of entries) {
|
|
4514
4531
|
const fullPath = join16(dir, entry);
|
|
4515
4532
|
try {
|
|
@@ -4530,7 +4547,7 @@ function checkBrokenLinks(dir) {
|
|
|
4530
4547
|
function fixBrokenLinks(dir) {
|
|
4531
4548
|
let fixed = 0;
|
|
4532
4549
|
try {
|
|
4533
|
-
const entries =
|
|
4550
|
+
const entries = readdirSync6(dir);
|
|
4534
4551
|
for (const entry of entries) {
|
|
4535
4552
|
const fullPath = join16(dir, entry);
|
|
4536
4553
|
try {
|
|
@@ -4917,7 +4934,7 @@ async function installPlugins(pluginIds, tool, level, repoPath, installPath, yes
|
|
|
4917
4934
|
|
|
4918
4935
|
// src/commands/uninstall.ts
|
|
4919
4936
|
init_registry();
|
|
4920
|
-
import { existsSync as existsSync18, unlinkSync as unlinkSync6, rmdirSync, readdirSync as
|
|
4937
|
+
import { existsSync as existsSync18, unlinkSync as unlinkSync6, rmdirSync, readdirSync as readdirSync7 } from "fs";
|
|
4921
4938
|
import { resolve, basename as basename3, sep } from "path";
|
|
4922
4939
|
import chalk11 from "chalk";
|
|
4923
4940
|
import { select as select5, checkbox as checkbox2, Separator as Separator4, confirm as confirm3 } from "@inquirer/prompts";
|
|
@@ -5178,7 +5195,7 @@ async function uninstallPluginById(pluginId, batchMode) {
|
|
|
5178
5195
|
continue;
|
|
5179
5196
|
}
|
|
5180
5197
|
if (existsSync18(dirPath)) {
|
|
5181
|
-
const entries =
|
|
5198
|
+
const entries = readdirSync7(dirPath);
|
|
5182
5199
|
if (entries.length === 0) {
|
|
5183
5200
|
rmdirSync(dirPath);
|
|
5184
5201
|
const name = basename3(dirPath);
|
|
@@ -5339,7 +5356,7 @@ async function updateCommand(pluginNames, options) {
|
|
|
5339
5356
|
// src/commands/info.ts
|
|
5340
5357
|
init_registry();
|
|
5341
5358
|
import chalk13 from "chalk";
|
|
5342
|
-
import { existsSync as existsSync19, readdirSync as
|
|
5359
|
+
import { existsSync as existsSync19, readdirSync as readdirSync8 } from "fs";
|
|
5343
5360
|
import { join as join18 } from "path";
|
|
5344
5361
|
init_manifest();
|
|
5345
5362
|
init_i18n();
|
|
@@ -5373,7 +5390,7 @@ async function infoCommand(pluginName) {
|
|
|
5373
5390
|
}
|
|
5374
5391
|
const agentsDir = join18(repoPath, plugin.dir, "agents");
|
|
5375
5392
|
if (existsSync19(agentsDir)) {
|
|
5376
|
-
const agentFiles =
|
|
5393
|
+
const agentFiles = readdirSync8(agentsDir).filter((f) => f.endsWith(".md"));
|
|
5377
5394
|
if (agentFiles.length > 0) {
|
|
5378
5395
|
console.log();
|
|
5379
5396
|
console.log(` ${chalk13.bold("Agents:")}`);
|