@cannbot-ai/install-helper 1.2.3-beta.0 → 1.2.4-beta.0

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
@@ -125,6 +125,8 @@ install-helper uninstall ops-direct-invoke # 卸载
125
125
 
126
126
  超出上述委托矩阵(qoder / cursor / copilot / codearts 工具或 global 级别)时,未显式指定 `--source cannbot` 的安装会自动回退到本仓冻结副本并提示原因;显式指定 `--source cannbot` 仍按报错处理,仅存于 cannbot 仓、无本地副本可回退的插件(如 triton-op-generator)则给出结构化错误。
127
127
 
128
+ 已迁移且本仓删除的插件(如 `triton-op-generator`)经内置迁移清单自动路由到 cannbot 仓安装:按 id / 历史别名(如 `triton`)/ 前缀均可解析,旧版安装记录也能被 `update` 继续管理,无需等待安装器 npm 发版收录。
129
+
128
130
  ### 更新
129
131
 
130
132
  ```bash
package/dist/index.js CHANGED
@@ -634,13 +634,18 @@ function isQoderCliLayout() {
634
634
  if (process.env.CANNBOT_QODER_LAYOUT === "cli") return true;
635
635
  if (process.env.CANNBOT_QODER_LAYOUT === "ide") return false;
636
636
  if (qoderCliLayoutCache === void 0) {
637
+ let cli = false;
637
638
  try {
638
639
  const whichCmd = process.platform === "win32" ? "where" : "which";
639
640
  const result = spawnSync(whichCmd, ["qodercn"], { timeout: 5e3 });
640
- qoderCliLayoutCache = result.status === 0;
641
+ cli = result.status === 0;
641
642
  } catch {
642
- qoderCliLayoutCache = false;
643
+ cli = false;
643
644
  }
645
+ if (!cli) {
646
+ cli = existsSync2(join2(homedir(), ".qoder-cn"));
647
+ }
648
+ qoderCliLayoutCache = cli;
644
649
  }
645
650
  return qoderCliLayoutCache;
646
651
  }
@@ -1060,6 +1065,30 @@ var init_scanner = __esm({
1060
1065
  }
1061
1066
  });
1062
1067
 
1068
+ // src/core/migrated-plugins.ts
1069
+ function isMigratedPlugin(id) {
1070
+ return MIGRATED_PLUGINS.some((p) => p.id === id);
1071
+ }
1072
+ var MIGRATED_PLUGINS;
1073
+ var init_migrated_plugins = __esm({
1074
+ "src/core/migrated-plugins.ts"() {
1075
+ "use strict";
1076
+ MIGRATED_PLUGINS = [
1077
+ {
1078
+ id: "triton-op-generator",
1079
+ dir: "",
1080
+ displayName: "Triton \u7B97\u5B50\u5F00\u53D1",
1081
+ script: "cannbot",
1082
+ aliases: ["triton"],
1083
+ skills: 8,
1084
+ agents: 0,
1085
+ 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\uFF1B\u5DF2\u8FC1\u79FB\u81F3 cannbot \u4ED3\uFF0C\u7ECF\u6258\u7BA1\u5B89\u88C5\u5668\u5B89\u88C5",
1086
+ source: "cannbot"
1087
+ }
1088
+ ];
1089
+ }
1090
+ });
1091
+
1063
1092
  // src/embedded-plugins.json
1064
1093
  var embedded_plugins_default;
1065
1094
  var init_embedded_plugins = __esm({
@@ -1594,6 +1623,10 @@ function findPlugin(query, options) {
1594
1623
  (p) => p.aliases.some((a) => a === normalized)
1595
1624
  );
1596
1625
  if (cannbotAlias) return cannbotAlias;
1626
+ const tombstone = MIGRATED_PLUGINS.find(
1627
+ (p) => p.id === normalized || p.id === query.trim() || p.aliases.some((a) => a === normalized)
1628
+ );
1629
+ if (tombstone) return tombstone;
1597
1630
  }
1598
1631
  const exactMatch = PLUGIN_REGISTRY.find(
1599
1632
  (p) => p.id === normalized || p.id === query.trim()
@@ -1609,17 +1642,24 @@ function findPlugin(query, options) {
1609
1642
  }
1610
1643
  const prefixMatches = PLUGIN_REGISTRY.filter((p) => p.id.startsWith(normalized));
1611
1644
  if (prefixMatches.length === 1) return prefixMatches[0];
1645
+ if (wantCannbot) {
1646
+ const tombstonePrefixes = MIGRATED_PLUGINS.filter((p) => p.id.startsWith(normalized));
1647
+ if (tombstonePrefixes.length === 1) return tombstonePrefixes[0];
1648
+ }
1612
1649
  return void 0;
1613
1650
  }
1614
1651
  function getAllPlugins() {
1615
- return [...CANNBOT_PLUGINS, ...PLUGIN_REGISTRY].sort(
1652
+ const tombstones = MIGRATED_PLUGINS.filter((t2) => !CANNBOT_PLUGINS.some((c) => c.id === t2.id));
1653
+ return [...CANNBOT_PLUGINS, ...PLUGIN_REGISTRY, ...tombstones].sort(
1616
1654
  (a, b) => a.displayName < b.displayName ? -1 : a.displayName > b.displayName ? 1 : 0
1617
1655
  );
1618
1656
  }
1619
1657
  function getPluginById(id) {
1620
1658
  const cannbot = CANNBOT_PLUGINS.find((p) => p.id === id);
1621
1659
  if (cannbot) return cannbot;
1622
- return PLUGIN_REGISTRY.find((p) => p.id === id);
1660
+ const legacy = PLUGIN_REGISTRY.find((p) => p.id === id);
1661
+ if (legacy) return legacy;
1662
+ return MIGRATED_PLUGINS.find((p) => p.id === id);
1623
1663
  }
1624
1664
  var PLUGIN_REGISTRY, CANNBOT_PLUGINS;
1625
1665
  var init_registry = __esm({
@@ -1627,6 +1667,7 @@ var init_registry = __esm({
1627
1667
  "use strict";
1628
1668
  init_fs_helpers();
1629
1669
  init_scanner();
1670
+ init_migrated_plugins();
1630
1671
  init_embedded_plugins();
1631
1672
  PLUGIN_REGISTRY = loadPlugins();
1632
1673
  CANNBOT_PLUGINS = [];
@@ -3850,6 +3891,7 @@ function findOrphanedDelegatedRecords(target) {
3850
3891
 
3851
3892
  // src/core/cannbot-delegate.ts
3852
3893
  init_registry();
3894
+ init_migrated_plugins();
3853
3895
 
3854
3896
  // src/core/installer.ts
3855
3897
  init_registry();
@@ -4897,7 +4939,7 @@ async function delegateInstall(options) {
4897
4939
  );
4898
4940
  return result;
4899
4941
  }
4900
- if (!discoverCannbotPlugins().some((p) => p.id === pluginId)) {
4942
+ if (!isMigratedPlugin(pluginId) && !discoverCannbotPlugins().some((p) => p.id === pluginId)) {
4901
4943
  try {
4902
4944
  await ensureCannbotInstaller({ force: true });
4903
4945
  } catch {
@@ -7129,6 +7171,7 @@ async function uninstallSkillsByName(skills, tool, level) {
7129
7171
 
7130
7172
  // src/commands/update.ts
7131
7173
  init_registry();
7174
+ init_migrated_plugins();
7132
7175
  init_manifest();
7133
7176
  init_logger();
7134
7177
  init_i18n();
@@ -7157,7 +7200,15 @@ async function updateCommand(pluginNames, options) {
7157
7200
  return;
7158
7201
  }
7159
7202
  targets = [
7160
- ...installed.map((p) => ({ pluginId: p.id, tool: p.tool, level: p.level, source: "skills" })),
7203
+ ...installed.map((p) => ({
7204
+ pluginId: p.id,
7205
+ tool: p.tool,
7206
+ level: p.level,
7207
+ // Migrated plugins have no legacy tree left in this repo — route their
7208
+ // legacy records to the cannbot source so update re-installs from the
7209
+ // cannbot repo.
7210
+ source: isMigratedPlugin(p.id) ? "cannbot" : "skills"
7211
+ })),
7161
7212
  ...cannbotInstalled.map((e) => ({ pluginId: e.id, tool: e.tool, level: "project", source: "cannbot" }))
7162
7213
  ];
7163
7214
  } else {
@@ -7178,9 +7229,11 @@ async function updateCommand(pluginNames, options) {
7178
7229
  continue;
7179
7230
  }
7180
7231
  const legacyMatches = cannbotMatches.length === 0 && legacyPlugin ? installed.filter((p) => p.id === legacyPlugin.id) : [];
7232
+ const migratedLegacy = cannbotMatches.length === 0 && !legacyPlugin && isMigratedPlugin(name) ? installed.filter((p) => p.id === name) : [];
7181
7233
  const matches = [
7182
7234
  ...cannbotMatches.map((e) => ({ pluginId: e.id, tool: e.tool, level: "project", source: "cannbot" })),
7183
- ...legacyMatches.map((p) => ({ pluginId: p.id, tool: p.tool, level: p.level, source: "skills" }))
7235
+ ...legacyMatches.map((p) => ({ pluginId: p.id, tool: p.tool, level: p.level, source: "skills" })),
7236
+ ...migratedLegacy.map((p) => ({ pluginId: p.id, tool: p.tool, level: p.level, source: "cannbot" }))
7184
7237
  ];
7185
7238
  if (matches.length > 0) {
7186
7239
  for (const match of matches) {