@cannbot-ai/install-helper 0.0.2-beta.74 → 0.0.2-beta.76

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 CHANGED
@@ -15,7 +15,7 @@ curl -fsSL https://raw.gitcode.com/cann/cannbot-skills/raw/master/install.sh | b
15
15
  ### Windows
16
16
 
17
17
  ```powershell
18
- irm https://cdn.jsdelivr.net/npm/@cannbot-ai/install-helper@latest/dist/install.ps1 | iex
18
+ iwr -useb https://raw.gitcode.com/cann/cannbot-skills/raw/master/install.ps1 | iex
19
19
  ```
20
20
 
21
21
  ### npm(全平台,需要 Node.js 18+)
package/dist/index.js CHANGED
@@ -595,8 +595,8 @@ var embedded_plugins_default = [
595
595
  "direct",
596
596
  "kernel"
597
597
  ],
598
- skills: 16,
599
- agents: 3,
598
+ skills: 19,
599
+ agents: 4,
600
600
  description: "Ascend C \u76F4\u8C03\u5168\u6D41\u7A0B\uFF1A\u73AF\u5883\u2192\u8BBE\u8BA1\u2192\u5F00\u53D1\u2192\u5BA1\u67E5\u2192\u6027\u80FD\u9A8C\u6536",
601
601
  version: "1.2.2",
602
602
  configFile: "AGENTS.md",
@@ -655,7 +655,7 @@ var embedded_plugins_default = [
655
655
  "flash",
656
656
  "kernel-flash"
657
657
  ],
658
- skills: 1,
658
+ skills: 7,
659
659
  agents: 1,
660
660
  description: "\u4ECE\u6570\u5B66\u516C\u5F0F\u6216\u4EE3\u7801\u7247\u6BB5\u5FEB\u901F\u6784\u5EFA\u5E76\u9A8C\u8BC1 Ascend NPU \u6838\u51FD\u6570",
661
661
  version: "1.2.2",
@@ -699,8 +699,8 @@ var embedded_plugins_default = [
699
699
  "ascendc-registry",
700
700
  "registry"
701
701
  ],
702
- skills: 12,
703
- agents: 4,
702
+ skills: 26,
703
+ agents: 3,
704
704
  description: "\u751F\u4EA7\u7EA7 ACLNN \u6CE8\u518C\u7B97\u5B50\u5168\u6D41\u7A0B\uFF1A\u4EE3\u7801\u2192UT/ST\u2192\u4E0A\u5E93",
705
705
  version: "1.2.2",
706
706
  configFile: "AGENTS.md",
@@ -772,7 +772,7 @@ var embedded_plugins_default = [
772
772
  aliases: [
773
773
  "catlass"
774
774
  ],
775
- skills: 10,
775
+ skills: 14,
776
776
  agents: 3,
777
777
  description: "Catlass \u6A21\u677F\u62FC\u88C5 GEMM/Matmul/Epilogue \u7B97\u5B50\u5F00\u53D1",
778
778
  version: "1.2.2",
@@ -822,7 +822,7 @@ var embedded_plugins_default = [
822
822
  "infer",
823
823
  "inference"
824
824
  ],
825
- skills: 11,
825
+ skills: 12,
826
826
  agents: 3,
827
827
  description: "NPU \u6A21\u578B\u63A8\u7406\u7AEF\u5230\u7AEF\u4F18\u5316\uFF08\u5E76\u884C/KVCache/\u878D\u5408/\u91CF\u5316/\u56FE\u6A21\u5F0F/\u591A\u6D41/SuperKernel\uFF09",
828
828
  version: "1.2.2",
@@ -958,7 +958,7 @@ var embedded_plugins_default = [
958
958
  "triton"
959
959
  ],
960
960
  skills: 6,
961
- agents: 1,
961
+ agents: 0,
962
962
  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",
963
963
  version: "1.2.2",
964
964
  configFile: "AGENTS.md",
@@ -1022,7 +1022,7 @@ var embedded_plugins_default = [
1022
1022
  "review"
1023
1023
  ],
1024
1024
  skills: 5,
1025
- agents: 1,
1025
+ agents: 2,
1026
1026
  description: "Ascend C \u7B97\u5B50\u4EE3\u7801 4 \u9636\u6BB5\u5168\u91CF\u68C0\u89C6\uFF08\u4E3B Agent \u7F16\u6392 + \u5B50 Agent \u5E76\u884C\u68C0\u89C6\uFF09",
1027
1027
  version: "1.2.2",
1028
1028
  configFile: "AGENTS.md",
@@ -1473,13 +1473,9 @@ function verifyPluginFilesExist(configRoot, manifest, tool, level) {
1473
1473
  });
1474
1474
  if (!hasAnyAgent) return false;
1475
1475
  }
1476
- let agentsMdPath;
1477
- if (tool === "opencode" && level === "project") {
1478
- agentsMdPath = join5(configRoot, "..", "AGENTS.md");
1479
- } else {
1480
- agentsMdPath = join5(configRoot, "AGENTS.md");
1481
- }
1482
- if (!existsSync5(agentsMdPath)) return false;
1476
+ const agentsFileName = getAgentsFileName(tool);
1477
+ const configFilePath = level === "project" ? join5(configRoot, "..", agentsFileName) : join5(configRoot, agentsFileName);
1478
+ if (!existsSync5(configFilePath)) return false;
1483
1479
  return true;
1484
1480
  }
1485
1481
 
@@ -2869,7 +2865,7 @@ function writeCannbotManifest(configRoot, pluginId, version, level, tool, skills
2869
2865
  brand_dir: configRoot,
2870
2866
  install_time: (/* @__PURE__ */ new Date()).toISOString()
2871
2867
  };
2872
- const manifestPath = join11(configRoot, "cannbot-manifest.json");
2868
+ const manifestPath = join11(configRoot, `${pluginId}-manifest.json`);
2873
2869
  writeFileSync2(manifestPath, JSON.stringify(manifest, null, 2), "utf-8");
2874
2870
  return manifest;
2875
2871
  }
@@ -3003,6 +2999,8 @@ async function installPlugin(opts) {
3003
2999
  warnings: []
3004
3000
  };
3005
3001
  }
3002
+ }
3003
+ if (currentPlugin) {
3006
3004
  backupInfo = createBackup(
3007
3005
  configRoot,
3008
3006
  opts.tool,
@@ -3163,8 +3161,8 @@ async function installPlugin(opts) {
3163
3161
  }
3164
3162
 
3165
3163
  // src/core/skill-installer.ts
3166
- import { existsSync as existsSync14, mkdirSync as mkdirSync6, symlinkSync as symlinkSync2, unlinkSync as unlinkSync5, readdirSync as readdirSync4, rmdirSync, realpathSync as realpathSync2 } from "fs";
3167
- import { join as join13, dirname as dirname6 } from "path";
3164
+ import { existsSync as existsSync14, mkdirSync as mkdirSync6, symlinkSync as symlinkSync2, unlinkSync as unlinkSync5, readdirSync as readdirSync4, rmSync as rmSync2, realpathSync as realpathSync2 } from "fs";
3165
+ import { join as join13, dirname as dirname6, isAbsolute } from "path";
3168
3166
  import { select as select3, checkbox, Separator as Separator2 } from "@inquirer/prompts";
3169
3167
  import chalk5 from "chalk";
3170
3168
  import Table from "cli-table3";
@@ -3191,6 +3189,17 @@ async function installSkills(skillIds, tool, level, repoPath) {
3191
3189
  }
3192
3190
  try {
3193
3191
  const resolvedSource = realpathSync2(sourcePath);
3192
+ if (isSymlink(targetPath)) {
3193
+ try {
3194
+ const currentTarget = realpathSync2(targetPath);
3195
+ if (currentTarget === resolvedSource) {
3196
+ results.push({ skillId, success: true });
3197
+ installedIds.push(skillId);
3198
+ continue;
3199
+ }
3200
+ } catch {
3201
+ }
3202
+ }
3194
3203
  if (existsSync14(targetPath) || isSymlink(targetPath)) {
3195
3204
  unlinkSync5(targetPath);
3196
3205
  }
@@ -3239,7 +3248,7 @@ async function uninstallSkills(skillIds, tool, level) {
3239
3248
  try {
3240
3249
  const entries = readdirSync4(skillsDir);
3241
3250
  if (entries.length === 0) {
3242
- rmdirSync(skillsDir);
3251
+ rmSync2(skillsDir, { recursive: true });
3243
3252
  logger.step(` ${t("uninstall_clean_empty_dir")}: skills/`);
3244
3253
  }
3245
3254
  } catch {
@@ -3418,7 +3427,7 @@ function listAllSkills() {
3418
3427
  }
3419
3428
  function resolveSkillSourcePath(skill, repoPath) {
3420
3429
  if (skill.filePath) {
3421
- const absPath = skill.filePath.startsWith("/") ? skill.filePath : join13(repoPath, skill.filePath);
3430
+ const absPath = isAbsolute(skill.filePath) ? skill.filePath : join13(repoPath, skill.filePath);
3422
3431
  if (existsSync14(absPath)) {
3423
3432
  return dirname6(absPath);
3424
3433
  }
@@ -4232,7 +4241,7 @@ async function installPlugins(pluginIds, tool, level, repoPath, installPath, yes
4232
4241
  }
4233
4242
 
4234
4243
  // src/commands/uninstall.ts
4235
- import { existsSync as existsSync17, unlinkSync as unlinkSync7, rmdirSync as rmdirSync2, readdirSync as readdirSync6 } from "fs";
4244
+ import { existsSync as existsSync17, unlinkSync as unlinkSync7, rmdirSync, readdirSync as readdirSync6 } from "fs";
4236
4245
  import { resolve, basename as basename3, sep } from "path";
4237
4246
  import chalk11 from "chalk";
4238
4247
  async function uninstallCommand(names, options) {
@@ -4292,7 +4301,7 @@ async function uninstallCommand(names, options) {
4292
4301
  if (existsSync17(dirPath)) {
4293
4302
  const entries = readdirSync6(dirPath);
4294
4303
  if (entries.length === 0) {
4295
- rmdirSync2(dirPath);
4304
+ rmdirSync(dirPath);
4296
4305
  const name = basename3(dirPath);
4297
4306
  logger.step(` ${t("uninstall_clean_empty_dir")}: ${name}/`);
4298
4307
  removedDirs++;