@cannbot-ai/install-helper 1.2.0-beta.1 → 1.2.0-beta.2

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
@@ -4563,6 +4563,14 @@ async function runDelegate(args, target) {
4563
4563
  };
4564
4564
  }
4565
4565
  }
4566
+ function installerSupportsBundledFlag() {
4567
+ try {
4568
+ const binSource = readFileSync12(getCannbotBinPath(), "utf-8");
4569
+ return binSource.includes('"--bundled"');
4570
+ } catch {
4571
+ return false;
4572
+ }
4573
+ }
4566
4574
  async function delegateInstall(options) {
4567
4575
  const { pluginId, tool, level } = options;
4568
4576
  const target = resolve2(options.target || process.cwd());
@@ -4606,7 +4614,7 @@ async function delegateInstall(options) {
4606
4614
  }
4607
4615
  result.warnings.push(...migrateSymlinkedInstructions(target, tool));
4608
4616
  let run = await runDelegate(["install", pluginId, "--tool", tool, "--target", target], target);
4609
- const hitRenameGap = !run.ok && (run.stdout.includes(`plugin not found: ${pluginId}`) || run.stderr.includes(`plugin not found: ${pluginId}`));
4617
+ const hitRenameGap = !run.ok && installerSupportsBundledFlag() && (run.stdout.includes(`plugin not found: ${pluginId}`) || run.stderr.includes(`plugin not found: ${pluginId}`));
4610
4618
  if (hitRenameGap) {
4611
4619
  result.warnings.push(t("cannbot_bundled_fallback"));
4612
4620
  run = await runDelegate(