@cannbot-ai/install-helper 1.1.6-beta.3 → 1.1.6-beta.5

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 CHANGED
@@ -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,25 @@ 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
- return recordedSkills.filter((skillId) => {
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) && !fromRecord.includes(entry)) {
2896
+ fromFs.push(entry);
2897
+ }
2898
+ }
2899
+ } catch {
2900
+ }
2901
+ }
2902
+ return [...fromRecord, ...fromFs];
2888
2903
  }
2889
2904
  function getLastBatchSkills(tool, level, installPath) {
2890
2905
  const record = readSkillRecord();
@@ -2903,7 +2918,7 @@ function getLastBatchSkills(tool, level, installPath) {
2903
2918
 
2904
2919
  // src/core/backup.ts
2905
2920
  init_manifest();
2906
- import { existsSync as existsSync12, copyFileSync, readdirSync as readdirSync3, unlinkSync as unlinkSync4 } from "fs";
2921
+ import { existsSync as existsSync12, copyFileSync, readdirSync as readdirSync4, unlinkSync as unlinkSync4 } from "fs";
2907
2922
  import { join as join11 } from "path";
2908
2923
  init_registry();
2909
2924
  init_paths();
@@ -2968,7 +2983,7 @@ function findBackups(configRoot) {
2968
2983
  if (!existsSync12(configRoot)) {
2969
2984
  return [];
2970
2985
  }
2971
- const files = readdirSync3(configRoot);
2986
+ const files = readdirSync4(configRoot);
2972
2987
  const backups = [];
2973
2988
  for (const file of files) {
2974
2989
  if (file.includes(".cannbot-backup.")) {
@@ -3564,7 +3579,7 @@ init_fs_helpers();
3564
3579
  init_constants();
3565
3580
  init_logger();
3566
3581
  init_i18n();
3567
- import { existsSync as existsSync15, mkdirSync as mkdirSync6, symlinkSync as symlinkSync2, readdirSync as readdirSync4, rmSync as rmSync4, realpathSync as realpathSync2, readlinkSync as readlinkSync2, cpSync as cpSync2 } from "fs";
3582
+ 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
3583
  import { join as join14, dirname as dirname5, isAbsolute } from "path";
3569
3584
  import { select as select3, checkbox, Separator as Separator2 } from "@inquirer/prompts";
3570
3585
  import chalk5 from "chalk";
@@ -3664,7 +3679,7 @@ async function uninstallSkills(skillIds, tool, level) {
3664
3679
  }
3665
3680
  if (existsSync15(skillsDir)) {
3666
3681
  try {
3667
- const entries = readdirSync4(skillsDir);
3682
+ const entries = readdirSync5(skillsDir);
3668
3683
  if (entries.length === 0) {
3669
3684
  rmSync4(skillsDir, { recursive: true });
3670
3685
  logger.step(` ${t("uninstall_clean_empty_dir")}: skills/`);
@@ -4381,7 +4396,7 @@ init_manifest();
4381
4396
  init_paths();
4382
4397
  init_i18n();
4383
4398
  import chalk8 from "chalk";
4384
- import { existsSync as existsSync17, readdirSync as readdirSync5, lstatSync as lstatSync2, unlinkSync as unlinkSync5, mkdirSync as mkdirSync7 } from "fs";
4399
+ import { existsSync as existsSync17, readdirSync as readdirSync6, lstatSync as lstatSync2, unlinkSync as unlinkSync5, mkdirSync as mkdirSync7 } from "fs";
4385
4400
  import { join as join16 } from "path";
4386
4401
  async function doctorCommand(options = {}) {
4387
4402
  console.log();
@@ -4440,7 +4455,7 @@ async function doctorCommand(options = {}) {
4440
4455
  if (existsSync17(skillsDir)) {
4441
4456
  const brokenLinks = checkBrokenLinks(skillsDir);
4442
4457
  if (brokenLinks === 0) {
4443
- const count = readdirSync5(skillsDir).length;
4458
+ const count = readdirSync6(skillsDir).length;
4444
4459
  console.log(chalk8.green(" \u2713") + ` ${skillsDir} \u2014 ${t("doctor_links_valid").replace("{count}", String(count))}`);
4445
4460
  } else {
4446
4461
  console.log(chalk8.yellow(" \u26A0") + ` ${skillsDir} \u2014 ${t("doctor_broken_links").replace("{count}", String(brokenLinks))}`);
@@ -4462,7 +4477,7 @@ async function doctorCommand(options = {}) {
4462
4477
  if (existsSync17(agentsDir)) {
4463
4478
  const brokenLinks = checkBrokenLinks(agentsDir);
4464
4479
  if (brokenLinks === 0) {
4465
- const count = readdirSync5(agentsDir).length;
4480
+ const count = readdirSync6(agentsDir).length;
4466
4481
  console.log(chalk8.green(" \u2713") + ` ${agentsDir} \u2014 ${t("doctor_links_valid").replace("{count}", String(count))}`);
4467
4482
  } else {
4468
4483
  console.log(chalk8.yellow(" \u26A0") + ` ${agentsDir} \u2014 ${t("doctor_broken_links").replace("{count}", String(brokenLinks))}`);
@@ -4509,7 +4524,7 @@ async function doctorCommand(options = {}) {
4509
4524
  function checkBrokenLinks(dir) {
4510
4525
  let broken = 0;
4511
4526
  try {
4512
- const entries = readdirSync5(dir);
4527
+ const entries = readdirSync6(dir);
4513
4528
  for (const entry of entries) {
4514
4529
  const fullPath = join16(dir, entry);
4515
4530
  try {
@@ -4530,7 +4545,7 @@ function checkBrokenLinks(dir) {
4530
4545
  function fixBrokenLinks(dir) {
4531
4546
  let fixed = 0;
4532
4547
  try {
4533
- const entries = readdirSync5(dir);
4548
+ const entries = readdirSync6(dir);
4534
4549
  for (const entry of entries) {
4535
4550
  const fullPath = join16(dir, entry);
4536
4551
  try {
@@ -4917,7 +4932,7 @@ async function installPlugins(pluginIds, tool, level, repoPath, installPath, yes
4917
4932
 
4918
4933
  // src/commands/uninstall.ts
4919
4934
  init_registry();
4920
- import { existsSync as existsSync18, unlinkSync as unlinkSync6, rmdirSync, readdirSync as readdirSync6 } from "fs";
4935
+ import { existsSync as existsSync18, unlinkSync as unlinkSync6, rmdirSync, readdirSync as readdirSync7 } from "fs";
4921
4936
  import { resolve, basename as basename3, sep } from "path";
4922
4937
  import chalk11 from "chalk";
4923
4938
  import { select as select5, checkbox as checkbox2, Separator as Separator4, confirm as confirm3 } from "@inquirer/prompts";
@@ -5178,7 +5193,7 @@ async function uninstallPluginById(pluginId, batchMode) {
5178
5193
  continue;
5179
5194
  }
5180
5195
  if (existsSync18(dirPath)) {
5181
- const entries = readdirSync6(dirPath);
5196
+ const entries = readdirSync7(dirPath);
5182
5197
  if (entries.length === 0) {
5183
5198
  rmdirSync(dirPath);
5184
5199
  const name = basename3(dirPath);
@@ -5339,7 +5354,7 @@ async function updateCommand(pluginNames, options) {
5339
5354
  // src/commands/info.ts
5340
5355
  init_registry();
5341
5356
  import chalk13 from "chalk";
5342
- import { existsSync as existsSync19, readdirSync as readdirSync7 } from "fs";
5357
+ import { existsSync as existsSync19, readdirSync as readdirSync8 } from "fs";
5343
5358
  import { join as join18 } from "path";
5344
5359
  init_manifest();
5345
5360
  init_i18n();
@@ -5373,7 +5388,7 @@ async function infoCommand(pluginName) {
5373
5388
  }
5374
5389
  const agentsDir = join18(repoPath, plugin.dir, "agents");
5375
5390
  if (existsSync19(agentsDir)) {
5376
- const agentFiles = readdirSync7(agentsDir).filter((f) => f.endsWith(".md"));
5391
+ const agentFiles = readdirSync8(agentsDir).filter((f) => f.endsWith(".md"));
5377
5392
  if (agentFiles.length > 0) {
5378
5393
  console.log();
5379
5394
  console.log(` ${chalk13.bold("Agents:")}`);