openviber 0.5.0 → 0.5.1

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/cli/index.js CHANGED
@@ -4313,21 +4313,38 @@ import * as path8 from "path";
4313
4313
  import * as yaml2 from "yaml";
4314
4314
  import { fileURLToPath as fileURLToPath2 } from "url";
4315
4315
  function getDefaultSkillsPath() {
4316
- const cwdPath = path8.resolve(process.cwd(), "src/skills");
4316
+ const userSkillsPath = path8.join(getViberRoot(), "skills");
4317
4317
  try {
4318
- fsSync.accessSync(cwdPath);
4319
- console.log(`[SkillRegistry] Using skills path (cwd): ${cwdPath}`);
4320
- return cwdPath;
4318
+ fsSync.accessSync(userSkillsPath);
4319
+ console.log(`[SkillRegistry] Using skills path (user): ${userSkillsPath}`);
4320
+ return userSkillsPath;
4321
4321
  } catch {
4322
- const relativePath = path8.resolve(__dirname2, ".");
4322
+ const bundledPath = path8.resolve(__dirname2, ".");
4323
4323
  try {
4324
- fsSync.accessSync(relativePath);
4325
- console.log(`[SkillRegistry] Using skills path (relative): ${relativePath}`);
4326
- return relativePath;
4324
+ fsSync.accessSync(bundledPath);
4325
+ const hasSkillDirs = fsSync.readdirSync(bundledPath).some((f) => {
4326
+ const skillMd = path8.join(bundledPath, f, "SKILL.md");
4327
+ try {
4328
+ fsSync.accessSync(skillMd);
4329
+ return true;
4330
+ } catch {
4331
+ return false;
4332
+ }
4333
+ });
4334
+ if (hasSkillDirs) {
4335
+ console.log(`[SkillRegistry] Using skills path (bundled): ${bundledPath}`);
4336
+ return bundledPath;
4337
+ }
4338
+ } catch {
4339
+ }
4340
+ const devPath = path8.resolve(process.cwd(), "src/skills");
4341
+ try {
4342
+ fsSync.accessSync(devPath);
4343
+ console.log(`[SkillRegistry] Using skills path (dev): ${devPath}`);
4344
+ return devPath;
4327
4345
  } catch {
4328
- const viberPath = path8.join(getViberRoot(), "skills");
4329
- console.log(`[SkillRegistry] Using skills path (viber root): ${viberPath}`);
4330
- return viberPath;
4346
+ console.log(`[SkillRegistry] Using skills path (default): ${userSkillsPath}`);
4347
+ return userSkillsPath;
4331
4348
  }
4332
4349
  }
4333
4350
  }