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