(config: ServerConfig, cwd: string)
| 21 | } |
| 22 | |
| 23 | export function effectiveSkillPaths(config: ServerConfig, cwd: string): string[] { |
| 24 | const defaultPaths = [ |
| 25 | join(homedir(), ".agents", "skills"), |
| 26 | resolve(cwd, ".agents", "skills"), |
| 27 | join(config.agentDir, "skills"), |
| 28 | ].filter((path) => existsSync(path)); |
| 29 | |
| 30 | const seen = new Set<string>(); |
| 31 | return [...defaultPaths, ...config.skillPaths] |
| 32 | .map((path) => resolveSkillPath(path, cwd)) |
| 33 | .filter((path) => { |
| 34 | if (seen.has(path)) return false; |
| 35 | seen.add(path); |
| 36 | return true; |
| 37 | }); |
| 38 | } |
| 39 | |
| 40 | function resolveSkillPath(path: string, cwd: string): string { |
| 41 | return resolve(cwd, expandHomePath(path)); |
no test coverage detected