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