@cannbot-ai/install-helper 0.0.2-beta.37 → 0.0.2-beta.38

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
@@ -195,8 +195,19 @@ function isDirectory(path) {
195
195
  // src/core/registry.ts
196
196
  var __filename2 = fileURLToPath2(import.meta.url);
197
197
  var __dirname2 = dirname2(__filename2);
198
+ function findPluginsDir() {
199
+ const candidates = [
200
+ join2(__dirname2, "plugins.d"),
201
+ join2(__dirname2, "..", "plugins.d"),
202
+ join2(__dirname2, "..", "..", "plugins.d")
203
+ ];
204
+ for (const dir of candidates) {
205
+ if (existsSync(dir)) return dir;
206
+ }
207
+ return candidates[0];
208
+ }
198
209
  function loadPluginsFromYaml() {
199
- const pluginsDir = join2(__dirname2, "plugins.d");
210
+ const pluginsDir = findPluginsDir();
200
211
  const defaultsPath = join2(pluginsDir, "_defaults.yml");
201
212
  let defaults = {};
202
213
  try {
@@ -388,6 +399,9 @@ function getConfigRoot(tool, level, base) {
388
399
  function getConfigFileName(tool) {
389
400
  return tool === "claude" ? "CLAUDE.md" : "AGENTS.md";
390
401
  }
402
+ function getAgentsFileName(tool) {
403
+ return getConfigFileName(tool);
404
+ }
391
405
  function getSkillsDir(configRoot) {
392
406
  return join3(configRoot, "skills");
393
407
  }
@@ -1866,7 +1880,7 @@ async function installPlugin(opts) {
1866
1880
  }
1867
1881
  const cwd = opts.installPath || process.cwd();
1868
1882
  const configRoot = getConfigRoot(opts.tool, opts.level, opts.installPath);
1869
- const agentsFile = join11(configRoot, getAgentsFileName2(opts.tool));
1883
+ const agentsFile = join11(configRoot, getAgentsFileName(opts.tool));
1870
1884
  let backupInfo = null;
1871
1885
  if (existsSync11(agentsFile)) {
1872
1886
  const currentPlugin = detectCurrentPlugin(configRoot, opts.tool);