diff --git a/packages/coding-agent/src/core/custom-tools/loader.ts b/packages/coding-agent/src/core/custom-tools/loader.ts index ccd5f814..17bd48c8 100644 --- a/packages/coding-agent/src/core/custom-tools/loader.ts +++ b/packages/coding-agent/src/core/custom-tools/loader.ts @@ -224,7 +224,7 @@ export async function loadCustomTools( /** * Discover tool files from a directory. - * Returns all .ts files in the directory (non-recursive). + * Returns all .ts files (and symlinks to .ts files) in the directory (non-recursive). */ function discoverToolsInDir(dir: string): string[] { if (!fs.existsSync(dir)) { @@ -233,7 +233,9 @@ function discoverToolsInDir(dir: string): string[] { try { const entries = fs.readdirSync(dir, { withFileTypes: true }); - return entries.filter((e) => e.isFile() && e.name.endsWith(".ts")).map((e) => path.join(dir, e.name)); + return entries + .filter((e) => (e.isFile() || e.isSymbolicLink()) && e.name.endsWith(".ts")) + .map((e) => path.join(dir, e.name)); } catch { return []; } diff --git a/packages/coding-agent/src/core/hooks/loader.ts b/packages/coding-agent/src/core/hooks/loader.ts index f4af4988..50cef601 100644 --- a/packages/coding-agent/src/core/hooks/loader.ts +++ b/packages/coding-agent/src/core/hooks/loader.ts @@ -198,7 +198,7 @@ export async function loadHooks(paths: string[], cwd: string): Promise e.isFile() && e.name.endsWith(".ts")).map((e) => path.join(dir, e.name)); + return entries + .filter((e) => (e.isFile() || e.isSymbolicLink()) && e.name.endsWith(".ts")) + .map((e) => path.join(dir, e.name)); } catch { return []; }