@cannbot-ai/install-helper 0.0.2-beta.67 → 0.0.2-beta.68

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.
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  // ----------------------------------------------------------------------------------------------------------
2
3
  // Copyright (c) 2026 Huawei Technologies Co., Ltd.
3
4
  // This program is free software, you can redistribute it and/or modify it under the terms and conditions of
@@ -8,7 +9,6 @@
8
9
  // See LICENSE in the root of the software repository for the full text of the License.
9
10
  // ----------------------------------------------------------------------------------------------------------
10
11
 
11
- #!/usr/bin/env node
12
12
 
13
13
  const { spawn } = require("child_process");
14
14
  const { existsSync } = require("fs");
@@ -10,7 +10,7 @@
10
10
 
11
11
  # Default configuration for install-helper
12
12
  repository:
13
- url: "https://gitcode.com/yanhf/cann_skills.git"
13
+ url: "https://gitcode.com/cann/cannbot-skills.git"
14
14
  name: "cannbot-skills"
15
15
 
16
16
  scanDirs:
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",
@@ -1150,14 +1150,14 @@ function mergeDynamicPlugins(repoPath) {
1150
1150
  function findPlugin(query) {
1151
1151
  const normalized = query.toLowerCase().trim();
1152
1152
  const exactMatch = PLUGIN_REGISTRY.find(
1153
- (p) => p.id === normalized || p.id === query.trim()
1153
+ (p) => p.id.toLowerCase() === normalized || p.id === query.trim()
1154
1154
  );
1155
1155
  if (exactMatch) return exactMatch;
1156
1156
  const aliasMatch = PLUGIN_REGISTRY.find(
1157
- (p) => p.aliases.some((a) => a === normalized)
1157
+ (p) => p.aliases.some((a) => a.toLowerCase() === normalized)
1158
1158
  );
1159
1159
  if (aliasMatch) return aliasMatch;
1160
- const prefixMatch = PLUGIN_REGISTRY.find((p) => p.id.startsWith(normalized));
1160
+ const prefixMatch = PLUGIN_REGISTRY.find((p) => p.id.toLowerCase().startsWith(normalized));
1161
1161
  if (prefixMatch) return prefixMatch;
1162
1162
  return void 0;
1163
1163
  }
@@ -1401,7 +1401,6 @@ function readManifest(configRoot) {
1401
1401
  }
1402
1402
  function readAllManifests(configRoot) {
1403
1403
  const manifests = [];
1404
- const plugins = getAllPlugins();
1405
1404
  const standardPath = getManifestPath(configRoot);
1406
1405
  if (existsSync5(standardPath)) {
1407
1406
  try {
@@ -1410,16 +1409,6 @@ function readAllManifests(configRoot) {
1410
1409
  } catch {
1411
1410
  }
1412
1411
  }
1413
- for (const plugin of plugins) {
1414
- const pluginManifestPath = join5(configRoot, `${plugin.id}-manifest.json`);
1415
- if (existsSync5(pluginManifestPath)) {
1416
- try {
1417
- const content = readFileSync3(pluginManifestPath, "utf-8");
1418
- manifests.push(JSON.parse(content));
1419
- } catch {
1420
- }
1421
- }
1422
- }
1423
1412
  return manifests;
1424
1413
  }
1425
1414
  function scanInstalled() {
@@ -1473,13 +1462,9 @@ function verifyPluginFilesExist(configRoot, manifest, tool, level) {
1473
1462
  });
1474
1463
  if (!hasAnyAgent) return false;
1475
1464
  }
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;
1465
+ const agentsFileName = getAgentsFileName(tool);
1466
+ const configFilePath = level === "project" ? join5(configRoot, "..", agentsFileName) : join5(configRoot, agentsFileName);
1467
+ if (!existsSync5(configFilePath)) return false;
1483
1468
  return true;
1484
1469
  }
1485
1470
 
@@ -2234,7 +2219,7 @@ function deduplicate(skills) {
2234
2219
  function findSkill(query) {
2235
2220
  const normalized = query.toLowerCase().trim();
2236
2221
  const pool = getActiveSkills();
2237
- return pool.find((s) => s.id === normalized);
2222
+ return pool.find((s) => s.id.toLowerCase() === normalized);
2238
2223
  }
2239
2224
  function getAllSkills() {
2240
2225
  return getActiveSkills();
@@ -2263,9 +2248,9 @@ function loadRepoUrl() {
2263
2248
  const configPath = join8(__dirname4, "config", "repository.yaml");
2264
2249
  try {
2265
2250
  const config = parseYaml3(readFileSync6(configPath, "utf-8"));
2266
- return config.repository?.url || "https://gitcode.com/yanhf/cann_skills.git";
2251
+ return config.repository?.url || "https://gitcode.com/cann/cannbot-skills.git";
2267
2252
  } catch {
2268
- return "https://gitcode.com/yanhf/cann_skills.git";
2253
+ return "https://gitcode.com/cann/cannbot-skills.git";
2269
2254
  }
2270
2255
  }
2271
2256
  var REPO_URL = loadRepoUrl();
@@ -2432,11 +2417,13 @@ function scanInstalledFiles(pluginId, displayName, tool, level, installPath, con
2432
2417
  directories.push(agentsDir);
2433
2418
  for (const agentName of manifest.installed_agents || []) {
2434
2419
  const agentPath = join9(agentsDir, agentName);
2435
- const agentPathMd = join9(agentsDir, agentName + ".md");
2436
2420
  if (existsSync10(agentPath) || isSymlink(agentPath)) {
2437
2421
  files.push(agentPath);
2438
- } else if (existsSync10(agentPathMd) || isSymlink(agentPathMd)) {
2439
- files.push(agentPathMd);
2422
+ } else if (!agentName.endsWith(".md")) {
2423
+ const agentPathMd = join9(agentsDir, agentName + ".md");
2424
+ if (existsSync10(agentPathMd) || isSymlink(agentPathMd)) {
2425
+ files.push(agentPathMd);
2426
+ }
2440
2427
  }
2441
2428
  }
2442
2429
  }
@@ -2449,10 +2436,6 @@ function scanInstalledFiles(pluginId, displayName, tool, level, installPath, con
2449
2436
  if (existsSync10(manifestPath)) {
2450
2437
  files.push(manifestPath);
2451
2438
  }
2452
- const pluginManifestPath = join9(configRoot, `${pluginId}-manifest.json`);
2453
- if (existsSync10(pluginManifestPath)) {
2454
- files.push(pluginManifestPath);
2455
- }
2456
2439
  const configFileName = tool === "claude" ? "CLAUDE.md" : "AGENTS.md";
2457
2440
  const configFilePath = level === "project" ? join9(installPath, configFileName) : join9(configRoot, configFileName);
2458
2441
  if (existsSync10(configFilePath)) {
@@ -3163,8 +3146,8 @@ async function installPlugin(opts) {
3163
3146
  }
3164
3147
 
3165
3148
  // 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";
3149
+ import { existsSync as existsSync14, mkdirSync as mkdirSync6, symlinkSync as symlinkSync2, unlinkSync as unlinkSync5, readdirSync as readdirSync4, rmSync as rmSync2, realpathSync as realpathSync2, copyFileSync as copyFileSync3 } from "fs";
3150
+ import { join as join13, dirname as dirname6, isAbsolute } from "path";
3168
3151
  import { select as select3, checkbox, Separator as Separator2 } from "@inquirer/prompts";
3169
3152
  import chalk5 from "chalk";
3170
3153
  import Table from "cli-table3";
@@ -3194,7 +3177,15 @@ async function installSkills(skillIds, tool, level, repoPath) {
3194
3177
  if (existsSync14(targetPath) || isSymlink(targetPath)) {
3195
3178
  unlinkSync5(targetPath);
3196
3179
  }
3197
- symlinkSync2(resolvedSource, targetPath);
3180
+ try {
3181
+ symlinkSync2(resolvedSource, targetPath);
3182
+ } catch (e) {
3183
+ if (e instanceof Error && e.message.includes("EPERM")) {
3184
+ copyFileSync3(resolvedSource, targetPath);
3185
+ } else {
3186
+ throw e;
3187
+ }
3188
+ }
3198
3189
  results.push({ skillId, success: true });
3199
3190
  installedIds.push(skillId);
3200
3191
  } catch (error) {
@@ -3239,7 +3230,7 @@ async function uninstallSkills(skillIds, tool, level) {
3239
3230
  try {
3240
3231
  const entries = readdirSync4(skillsDir);
3241
3232
  if (entries.length === 0) {
3242
- rmdirSync(skillsDir);
3233
+ rmSync2(skillsDir, { recursive: true });
3243
3234
  logger.step(` ${t("uninstall_clean_empty_dir")}: skills/`);
3244
3235
  }
3245
3236
  } catch {
@@ -3418,7 +3409,7 @@ function listAllSkills() {
3418
3409
  }
3419
3410
  function resolveSkillSourcePath(skill, repoPath) {
3420
3411
  if (skill.filePath) {
3421
- const absPath = skill.filePath.startsWith("/") ? skill.filePath : join13(repoPath, skill.filePath);
3412
+ const absPath = isAbsolute(skill.filePath) ? skill.filePath : join13(repoPath, skill.filePath);
3422
3413
  if (existsSync14(absPath)) {
3423
3414
  return dirname6(absPath);
3424
3415
  }
@@ -4232,7 +4223,7 @@ async function installPlugins(pluginIds, tool, level, repoPath, installPath, yes
4232
4223
  }
4233
4224
 
4234
4225
  // src/commands/uninstall.ts
4235
- import { existsSync as existsSync17, unlinkSync as unlinkSync7, rmdirSync as rmdirSync2, readdirSync as readdirSync6 } from "fs";
4226
+ import { existsSync as existsSync17, unlinkSync as unlinkSync7, rmdirSync, readdirSync as readdirSync6 } from "fs";
4236
4227
  import { resolve, basename as basename3, sep } from "path";
4237
4228
  import chalk11 from "chalk";
4238
4229
  async function uninstallCommand(names, options) {
@@ -4292,7 +4283,7 @@ async function uninstallCommand(names, options) {
4292
4283
  if (existsSync17(dirPath)) {
4293
4284
  const entries = readdirSync6(dirPath);
4294
4285
  if (entries.length === 0) {
4295
- rmdirSync2(dirPath);
4286
+ rmdirSync(dirPath);
4296
4287
  const name = basename3(dirPath);
4297
4288
  logger.step(` ${t("uninstall_clean_empty_dir")}: ${name}/`);
4298
4289
  removedDirs++;