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/index.cjs CHANGED
@@ -4516,21 +4516,38 @@ __export(registry_exports, {
4516
4516
  defaultRegistry: () => defaultRegistry
4517
4517
  });
4518
4518
  function getDefaultSkillsPath() {
4519
- const cwdPath = path8.resolve(process.cwd(), "src/skills");
4519
+ const userSkillsPath = path8.join(getViberRoot(), "skills");
4520
4520
  try {
4521
- fsSync.accessSync(cwdPath);
4522
- console.log(`[SkillRegistry] Using skills path (cwd): ${cwdPath}`);
4523
- return cwdPath;
4521
+ fsSync.accessSync(userSkillsPath);
4522
+ console.log(`[SkillRegistry] Using skills path (user): ${userSkillsPath}`);
4523
+ return userSkillsPath;
4524
4524
  } catch {
4525
- const relativePath = path8.resolve(__dirname2, ".");
4525
+ const bundledPath = path8.resolve(__dirname2, ".");
4526
4526
  try {
4527
- fsSync.accessSync(relativePath);
4528
- console.log(`[SkillRegistry] Using skills path (relative): ${relativePath}`);
4529
- return relativePath;
4527
+ fsSync.accessSync(bundledPath);
4528
+ const hasSkillDirs = fsSync.readdirSync(bundledPath).some((f) => {
4529
+ const skillMd = path8.join(bundledPath, f, "SKILL.md");
4530
+ try {
4531
+ fsSync.accessSync(skillMd);
4532
+ return true;
4533
+ } catch {
4534
+ return false;
4535
+ }
4536
+ });
4537
+ if (hasSkillDirs) {
4538
+ console.log(`[SkillRegistry] Using skills path (bundled): ${bundledPath}`);
4539
+ return bundledPath;
4540
+ }
4541
+ } catch {
4542
+ }
4543
+ const devPath = path8.resolve(process.cwd(), "src/skills");
4544
+ try {
4545
+ fsSync.accessSync(devPath);
4546
+ console.log(`[SkillRegistry] Using skills path (dev): ${devPath}`);
4547
+ return devPath;
4530
4548
  } catch {
4531
- const viberPath = path8.join(getViberRoot(), "skills");
4532
- console.log(`[SkillRegistry] Using skills path (viber root): ${viberPath}`);
4533
- return viberPath;
4549
+ console.log(`[SkillRegistry] Using skills path (default): ${userSkillsPath}`);
4550
+ return userSkillsPath;
4534
4551
  }
4535
4552
  }
4536
4553
  }