@henryqw/pi-add-dir 3.2.1 → 3.2.3
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.
- package/README.md +2 -4
- package/extensions/add-dir-helpers.ts +1 -1
- package/extensions/add-dir.ts +2 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Pi adds root `AGENTS.md`, `CLAUDE.md`, `.pi/AGENTS.md`, and `.pi/CLAUDE.md` to l
|
|
|
28
28
|
|
|
29
29
|
`/dir-add` reloads only when discovered external skill paths change, not merely because skills exist. If `add_directory` asks for `/reload`, run it to update skills.
|
|
30
30
|
|
|
31
|
-
External instructions and skills enter through a model-visible tool call or user command.
|
|
31
|
+
External instructions and skills enter through a model-visible tool call or user command.
|
|
32
32
|
|
|
33
33
|
### Search results
|
|
34
34
|
|
|
@@ -62,6 +62,4 @@ Select persistent scopes explicitly: external directories can inject `AGENTS.md`
|
|
|
62
62
|
|
|
63
63
|
Search uses Node and supports basename and relative-path globs. It skips `.git`, `node_modules`, and symbolic links.
|
|
64
64
|
|
|
65
|
-
Missing or overlapping project and global directories stay configured but are skipped with warnings. Restore missing paths or
|
|
66
|
-
|
|
67
|
-
To change or discard a path, remove it with `/dir-ls`. Add corrected paths with `/dir-add`; `/dir-ls` cannot repair paths in place.
|
|
65
|
+
Missing or overlapping project and global directories stay configured but are skipped with warnings. Restore missing paths, or remove an incorrect path with `/dir-ls` and add the corrected path with `/dir-add`; then run `/dir-reload`.
|
|
@@ -18,7 +18,7 @@ const CONTEXT_FILES = ["AGENTS.md", "CLAUDE.md"] as const;
|
|
|
18
18
|
const SKILL_DIRS = [".pi/skills", ".agents/skills", ".claude/skills"] as const;
|
|
19
19
|
const SKIPPED_SEARCH_DIRS = new Set([".git", "node_modules"]);
|
|
20
20
|
|
|
21
|
-
function isMissingPathError(error: unknown): boolean {
|
|
21
|
+
export function isMissingPathError(error: unknown): boolean {
|
|
22
22
|
if (!error || typeof error !== "object" || !("code" in error)) return false;
|
|
23
23
|
return error.code === "ENOENT" || error.code === "ENOTDIR";
|
|
24
24
|
}
|
package/extensions/add-dir.ts
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
collectSkillPaths,
|
|
17
17
|
dirExists,
|
|
18
18
|
findFiles,
|
|
19
|
+
isMissingPathError,
|
|
19
20
|
resolveDir,
|
|
20
21
|
scanDirContext,
|
|
21
22
|
type AddedDir,
|
|
@@ -129,9 +130,7 @@ function hasGitMarker(cwd: string): boolean {
|
|
|
129
130
|
lstatSync(join(directory, ".git"));
|
|
130
131
|
return true;
|
|
131
132
|
} catch (error) {
|
|
132
|
-
if (!
|
|
133
|
-
throw error;
|
|
134
|
-
}
|
|
133
|
+
if (!isMissingPathError(error)) throw error;
|
|
135
134
|
}
|
|
136
135
|
const parent = dirname(directory);
|
|
137
136
|
if (parent === directory) return false;
|