load-skills 0.2.1 → 0.3.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGzE,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;IAC5C,MAAM,EAAE,oBAAoB,EAAE,CAAC;CAChC;AAED,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,eAAe,CAAC,CA6D1B"}
1
+ {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAGzE,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,oBAAoB,EAAE,mBAAmB,EAAE,CAAC;IAC5C,MAAM,EAAE,oBAAoB,EAAE,CAAC;CAChC;AAED,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,eAAe,CAAC,CAyD1B"}
package/dist/discovery.js CHANGED
@@ -12,7 +12,6 @@ export async function discoverSkillFiles(config) {
12
12
  }));
13
13
  const report = [];
14
14
  const discoveredSkillFiles = [];
15
- const discovered = new Set();
16
15
  for (const pair of pathPairs) {
17
16
  const rootPath = pair.resolvedPath;
18
17
  const inputPath = pair.inputPath;
@@ -40,14 +39,11 @@ export async function discoverSkillFiles(config) {
40
39
  const pathReportIndex = report.length;
41
40
  for (const skillFilePath of found) {
42
41
  const canonical = await realpath(skillFilePath);
43
- if (!discovered.has(canonical)) {
44
- discovered.add(canonical);
45
- discoveredSkillFiles.push({
46
- skillFilePath: canonical,
47
- pathReportIndex,
48
- inputPath,
49
- });
50
- }
42
+ discoveredSkillFiles.push({
43
+ skillFilePath: canonical,
44
+ pathReportIndex,
45
+ inputPath,
46
+ });
51
47
  }
52
48
  report.push(reportItem);
53
49
  }
@@ -60,10 +56,15 @@ async function discoverNonRecursive(rootPath) {
60
56
  const entries = await readdir(rootPath, { withFileTypes: true });
61
57
  const paths = [];
62
58
  for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
63
- if (!entry.isDirectory()) {
59
+ if (!entry.isDirectory() && !entry.isSymbolicLink()) {
60
+ continue;
61
+ }
62
+ const candidateDir = path.join(rootPath, entry.name);
63
+ const candidateDirStat = await stat(candidateDir).catch(() => null);
64
+ if (!candidateDirStat?.isDirectory()) {
64
65
  continue;
65
66
  }
66
- const candidate = path.join(rootPath, entry.name, "SKILL.md");
67
+ const candidate = path.join(candidateDir, "SKILL.md");
67
68
  if (await isReadableFile(candidate)) {
68
69
  paths.push(candidate);
69
70
  }
@@ -80,7 +81,11 @@ async function discoverRecursive(rootPath) {
80
81
  paths.push(fullPath);
81
82
  continue;
82
83
  }
83
- if (entry.isDirectory()) {
84
+ if (entry.isDirectory() || entry.isSymbolicLink()) {
85
+ const directoryStat = await stat(fullPath).catch(() => null);
86
+ if (!directoryStat?.isDirectory()) {
87
+ continue;
88
+ }
84
89
  await walk(fullPath);
85
90
  }
86
91
  }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { loadSkills } from "./loadSkills.js";
1
+ export { loadSkills } from "./load-skills.js";
2
2
  export type { IgnoredDuplicateSkill, InvalidSkill, LoadSkillsConfig, LoadSkillsPathError, LoadSkillsPathReport, LoadSkillsReport, LoadSkillsResult, Skill, SkillMeta, SkillScript, SkillScriptType, SkillWarning, SkillWarningCode, } from "./types.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EACV,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,WAAW,EACX,eAAe,EACf,YAAY,EACZ,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EACV,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,WAAW,EACX,eAAe,EACf,YAAY,EACZ,gBAAgB,GACjB,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { loadSkills } from "./loadSkills.js";
1
+ export { loadSkills } from "./load-skills.js";
@@ -1,3 +1,3 @@
1
1
  import type { LoadSkillsConfig, LoadSkillsResult } from "./types.js";
2
2
  export declare function loadSkills(config?: LoadSkillsConfig): Promise<LoadSkillsResult>;
3
- //# sourceMappingURL=loadSkills.d.ts.map
3
+ //# sourceMappingURL=load-skills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-skills.d.ts","sourceRoot":"","sources":["../src/load-skills.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAGV,gBAAgB,EAChB,gBAAgB,EAKjB,MAAM,YAAY,CAAC;AAIpB,wBAAsB,UAAU,CAC9B,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,gBAAgB,CAAC,CA2G3B"}
@@ -2,9 +2,9 @@ import { constants } from "node:fs";
2
2
  import { open, readdir, readFile, stat } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { discoverSkillFiles } from "./discovery.js";
5
- import { parseSkillDocument } from "./parseSkill.js";
5
+ import { parseSkillDocument } from "./parse-skill.js";
6
6
  import { getErrorMessage, pathExists } from "./utils.js";
7
- import { applyValidationRules } from "./validateSkill.js";
7
+ import { applyValidationRules } from "./validate-skill.js";
8
8
  export async function loadSkills(config) {
9
9
  const resolvedConfig = config ?? {};
10
10
  const discovery = await discoverSkillFiles(resolvedConfig);
@@ -1,3 +1,3 @@
1
1
  import type { ParseSkillResult } from "./types.js";
2
2
  export declare function parseSkillDocument(rawText: string): ParseSkillResult;
3
- //# sourceMappingURL=parseSkill.d.ts.map
3
+ //# sourceMappingURL=parse-skill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-skill.d.ts","sourceRoot":"","sources":["../src/parse-skill.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,YAAY,CAAC;AAGjE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAwFpE"}
@@ -8,4 +8,4 @@ export declare function applyValidationRules(input: {
8
8
  isValid: boolean;
9
9
  meta?: SkillMeta;
10
10
  };
11
- //# sourceMappingURL=validateSkill.d.ts.map
11
+ //# sourceMappingURL=validate-skill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-skill.d.ts","sourceRoot":"","sources":["../src/validate-skill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAa1D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B,GAAG;IACF,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAoDA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "load-skills",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Load and validate agent skills from configurable paths.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,6 +31,14 @@
31
31
  ],
32
32
  "author": "",
33
33
  "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/agent-tooling/load-skills.git"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/agent-tooling/load-skills/issues"
40
+ },
41
+ "homepage": "https://github.com/agent-tooling/load-skills#readme",
34
42
  "dependencies": {
35
43
  "yaml": "^2.8.2"
36
44
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"loadSkills.d.ts","sourceRoot":"","sources":["../src/loadSkills.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAGV,gBAAgB,EAChB,gBAAgB,EAKjB,MAAM,YAAY,CAAC;AAIpB,wBAAsB,UAAU,CAC9B,MAAM,CAAC,EAAE,gBAAgB,GACxB,OAAO,CAAC,gBAAgB,CAAC,CA2G3B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseSkill.d.ts","sourceRoot":"","sources":["../src/parseSkill.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,YAAY,CAAC;AAGjE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAwFpE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateSkill.d.ts","sourceRoot":"","sources":["../src/validateSkill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAa1D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B,GAAG;IACF,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAoDA"}
File without changes
File without changes