load-skills 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. package/dist/discovery.js +12 -3
  2. package/package.json +1 -1
package/dist/discovery.js CHANGED
@@ -60,10 +60,15 @@ async function discoverNonRecursive(rootPath) {
60
60
  const entries = await readdir(rootPath, { withFileTypes: true });
61
61
  const paths = [];
62
62
  for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
63
- if (!entry.isDirectory()) {
63
+ if (!entry.isDirectory() && !entry.isSymbolicLink()) {
64
64
  continue;
65
65
  }
66
- const candidate = path.join(rootPath, entry.name, "SKILL.md");
66
+ const candidateDir = path.join(rootPath, entry.name);
67
+ const candidateDirStat = await stat(candidateDir).catch(() => null);
68
+ if (!candidateDirStat?.isDirectory()) {
69
+ continue;
70
+ }
71
+ const candidate = path.join(candidateDir, "SKILL.md");
67
72
  if (await isReadableFile(candidate)) {
68
73
  paths.push(candidate);
69
74
  }
@@ -80,7 +85,11 @@ async function discoverRecursive(rootPath) {
80
85
  paths.push(fullPath);
81
86
  continue;
82
87
  }
83
- if (entry.isDirectory()) {
88
+ if (entry.isDirectory() || entry.isSymbolicLink()) {
89
+ const directoryStat = await stat(fullPath).catch(() => null);
90
+ if (!directoryStat?.isDirectory()) {
91
+ continue;
92
+ }
84
93
  await walk(fullPath);
85
94
  }
86
95
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "load-skills",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Load and validate agent skills from configurable paths.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",