@henryqw/pi-add-dir 1.0.3 → 2.0.0

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.
@@ -20,6 +20,7 @@ import {
20
20
  } from "./add-dir-helpers.ts";
21
21
 
22
22
  const STATE_TYPE = "add-dir:state";
23
+ const PROMPT_SECTION = "pi_add_dir";
23
24
  const DEFAULT_MAX_RESULTS = 50;
24
25
  const MAX_RESULTS = 1_000;
25
26
 
@@ -285,9 +286,9 @@ export default function addDirExtension(pi: ExtensionAPI): void {
285
286
  if (reconstructState(ctx)) pi.sendUserMessage("/dir-reload", { expandPromptTemplates: true });
286
287
  });
287
288
 
288
- pi.on("before_agent_start", async (event) => {
289
+ pi.on("before_agent_start", (event) => {
289
290
  if (addedDirs.length === 0) return;
290
- return { systemPrompt: event.systemPrompt + buildContextInjection(addedDirs) };
291
+ event.systemPromptOptions.sections[PROMPT_SECTION] = buildContextInjection(addedDirs);
291
292
  });
292
293
 
293
294
  pi.registerCommand("dir-reload", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-add-dir",
3
- "version": "1.0.3",
3
+ "version": "2.0.0",
4
4
  "description": "Add external directories to a Pi session with context, skills, and file search.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -25,8 +25,8 @@
25
25
  "pack:check": "npm pack --dry-run"
26
26
  },
27
27
  "peerDependencies": {
28
- "@earendil-works/pi-coding-agent": "^0.85.1",
29
- "@earendil-works/pi-tui": "^0.85.1",
28
+ "@earendil-works/pi-coding-agent": "^0.86.0",
29
+ "@earendil-works/pi-tui": "^0.86.0",
30
30
  "typebox": "^1.3.15"
31
31
  },
32
32
  "repository": {
@@ -45,5 +45,9 @@
45
45
  "./extensions/add-dir.ts"
46
46
  ],
47
47
  "image": "https://raw.githubusercontent.com/HenryQW/pi-harness/main/extensions/pi-add-dir/example.png"
48
+ },
49
+ "devDependencies": {
50
+ "@earendil-works/pi-coding-agent": "0.86.0",
51
+ "@earendil-works/pi-tui": "0.86.0"
48
52
  }
49
53
  }