@henryqw/pi-add-dir 3.2.0 → 3.2.1
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 +24 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@henryqw/pi-add-dir`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use external context, external skills, and searchable files in Pi without copying or linking external directories.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|
|
|
@@ -12,35 +12,31 @@ pi install npm:@henryqw/pi-add-dir
|
|
|
12
12
|
|
|
13
13
|
## Use
|
|
14
14
|
|
|
15
|
-
Run `/dir-add
|
|
16
|
-
|
|
17
|
-
Humans use the slash commands from the Pi prompt. Pi agents use the tools.
|
|
15
|
+
Run `/dir-add`, enter a directory, then run `/dir-ls` to verify it. Humans use commands; agents use tools.
|
|
18
16
|
|
|
19
17
|
| Surface | Type | Purpose |
|
|
20
18
|
| --- | --- | --- |
|
|
21
|
-
| `/dir-add [path]` | command | Add to this session by default.
|
|
22
|
-
| `/dir-ls` | command | List directories
|
|
19
|
+
| `/dir-add [--project\|--global] [path]` | command | Add to this session by default. Use `--project` for this repository and linked worktrees, or `--global` for every workspace. Omit the path for interactive input. Supports `~`. |
|
|
20
|
+
| `/dir-ls` | command | List directories and scopes; select one to remove it from that scope. |
|
|
23
21
|
| `/dir-reload` | command | Reload external directory resources. |
|
|
24
|
-
| `add_directory(path)` | tool | Add
|
|
25
|
-
| `search_external_files(pattern, maxResults?)` | tool | Search added directories with a glob.
|
|
26
|
-
| `@` file autocomplete | ui |
|
|
27
|
-
| External directory widget | ui |
|
|
22
|
+
| `add_directory(path)` | tool | Add session-only context and return instructions. Model-only: scripts and other tools cannot call it. |
|
|
23
|
+
| `search_external_files(pattern, maxResults?)` | tool | Search added directories with a glob. Default: 50 results; maximum: 1,000. Codemode receives structured results. |
|
|
24
|
+
| `@` file autocomplete | ui | For users: find external files and insert absolute paths. |
|
|
25
|
+
| External directory widget | ui | For users: show directories; use `/dir-ls` to manage them. |
|
|
28
26
|
|
|
29
|
-
External
|
|
27
|
+
Pi adds root `AGENTS.md`, `CLAUDE.md`, `.pi/AGENTS.md`, and `.pi/CLAUDE.md` to later prompts. External skills come from `.pi/skills`, `.agents/skills`, and `.claude/skills`.
|
|
30
28
|
|
|
31
|
-
-
|
|
32
|
-
- External skills that Pi loads from `.pi/skills`, `.agents/skills`, and `.claude/skills`.
|
|
33
|
-
- Files in the editor's `@` autocomplete, with absolute paths.
|
|
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.
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
External instructions and skills enter through a model-visible tool call or user command. This package does not enable codemode.
|
|
36
32
|
|
|
37
|
-
###
|
|
33
|
+
### Search results
|
|
38
34
|
|
|
39
|
-
`search_external_files` declares an output schema.
|
|
35
|
+
`search_external_files` declares an output schema. Scripts receive `{ pattern, maxResults, searchedDirectories, totalFound, truncated, directories }`.
|
|
40
36
|
|
|
41
|
-
`
|
|
37
|
+
`directories` contains only matching directories, with labels and absolute file paths. `searchedDirectories` includes searched directories without matches, but excludes directories skipped after the limit.
|
|
42
38
|
|
|
43
|
-
|
|
39
|
+
`truncated: true` means the limit stopped the search; later files or directories can have more matches. Models receive the same matches as text. With no external directories, the tool returns an error; scripts reject with its message.
|
|
44
40
|
|
|
45
41
|
## Config
|
|
46
42
|
|
|
@@ -48,24 +44,24 @@ Package-owned: `~/.pi/agent/config/pi-add-dir/config.json`
|
|
|
48
44
|
|
|
49
45
|
| Name | Description | Values | Default |
|
|
50
46
|
| --- | --- | --- | --- |
|
|
51
|
-
| `directories` | Directories
|
|
47
|
+
| `directories` | Directories for every workspace. `/dir-add --global` updates this list. | Array of unique absolute paths without control characters. | `[]` |
|
|
52
48
|
|
|
53
|
-
|
|
49
|
+
Missing files use the default. At launch, Pi warns about each unknown key and invalid or duplicate entry, skips them, and loads valid directories. Malformed files or non-array `directories` produce a warning and use the default. The file stays unchanged.
|
|
54
50
|
|
|
55
|
-
|
|
51
|
+
Global additions and removals fail until you fix reported config problems. Reload Pi after manual edits.
|
|
56
52
|
|
|
57
53
|
## State and storage
|
|
58
54
|
|
|
59
|
-
|
|
55
|
+
Session directories belong to the current session branch. New additions reject directories inside or containing Pi's working directory, or overlapping active external directories. Restored session entries do not repeat overlap checks when the working directory changes.
|
|
60
56
|
|
|
61
|
-
Project directories use
|
|
57
|
+
Project directories use repeatable local Git config key `pi-add-dir.directory`, shared by linked worktrees. This machine-local config cannot come from a clone. `/dir-add --project` requires a Git repository.
|
|
62
58
|
|
|
63
|
-
|
|
59
|
+
Select persistent scopes explicitly: external directories can inject `AGENTS.md`, `CLAUDE.md`, and skills.
|
|
64
60
|
|
|
65
61
|
## Limits and recovery
|
|
66
62
|
|
|
67
|
-
Search supports basename and relative-path globs. It skips `.git
|
|
63
|
+
Search uses Node and supports basename and relative-path globs. It skips `.git`, `node_modules`, and symbolic links.
|
|
68
64
|
|
|
69
|
-
Missing or overlapping
|
|
65
|
+
Missing or overlapping project and global directories stay configured but are skipped with warnings. Restore missing paths or correct overlaps, then run `/dir-reload`.
|
|
70
66
|
|
|
71
|
-
To change or discard a
|
|
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.
|