fix: Resolve symlinked skill dirs in permission-gate
Skill locations like ~/.claude symlinked to ~/.dotfiles/ai/claude/
failed to match after realpathSync on the file being read.

Assisted-by: Claude Opus 4.6 via pi
change zpkqvxlzxzqmlmqnynmvxxttlrookmtr
commit c34ff0258c11c62ab3585384df8107583e843c62
author Alpha Chen <alpha@kejadlen.dev>
date
parent lpwysolw
diff --git a/.pi/agent/extensions/permission-gate.ts b/.pi/agent/extensions/permission-gate.ts
index 50744b76..261e6d3e 100644
--- a/.pi/agent/extensions/permission-gate.ts
+++ b/.pi/agent/extensions/permission-gate.ts
@@ -187,7 +187,12 @@ function getSkillsDirectories(ctx: ExtensionContext): Set<string> {
   const locationRe = /<location>(.*?)<\/location>/g;
   let match;
   while ((match = locationRe.exec(prompt)) !== null) {
-    dirs.add(path.dirname(match[1]));
+    const dir = path.dirname(match[1]);
+    dirs.add(dir);
+    // Also resolve symlinks so that paths through symlinked directories
+    // (e.g. ~/.claude -> ~/.dotfiles/ai/claude/) still match after
+    // realpathSync is applied to the file being read.
+    try { dirs.add(fs.realpathSync(dir)); } catch { /* ignore */ }
   }
   skillsDirs = dirs;
   return skillsDirs;