@cannbot-ai/install-helper 1.1.6-beta.3 → 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 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,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
- 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) || 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 readdirSync3, unlinkSync as unlinkSync4 } from "fs";
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 = readdirSync3(configRoot);
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 readdirSync4, rmSync as rmSync4, realpathSync as realpathSync2, readlinkSync as readlinkSync2, cpSync as cpSync2 } from "fs";
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 = readdirSync4(skillsDir);
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 readdirSync5, lstatSync as lstatSync2, unlinkSync as unlinkSync5, mkdirSync as mkdirSync7 } from "fs";
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 = readdirSync5(skillsDir).length;
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 = readdirSync5(agentsDir).length;
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 = readdirSync5(dir);
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 = readdirSync5(dir);
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 readdirSync6 } from "fs";
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 = readdirSync6(dirPath);
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 readdirSync7 } from "fs";
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 = readdirSync7(agentsDir).filter((f) => f.endsWith(".md"));
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:")}`);