pi-render-btw 0.6.9 → 0.6.10

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 CHANGED
@@ -94,7 +94,7 @@ pi install /path/to/pi-render-btw
94
94
  - `Alt+/` toggles focus between BTW and the main editor without closing the overlay
95
95
  - `Ctrl+Alt+W` is a fallback focus toggle for terminals that do not deliver `Alt+/` as a usable shortcut
96
96
  - `Ctrl+G` opens the current BTW draft in `$VISUAL`/`$EDITOR` (falling back to `nano`) and reads it back when the editor exits successfully
97
- - the composer uses Pi's native editor behavior for undo, paste, prompt history, and Tab file-path completion relative to the BTW working directory
97
+ - the composer uses Pi's native editor behavior for undo, paste, prompt history, and Tab file-path completion (including `@` prefixes) relative to the BTW working directory
98
98
  - `Esc` still dismisses BTW immediately while the overlay is focused
99
99
  - BTW opens top-centered so the main session remains visible underneath it
100
100
 
@@ -165,4 +165,20 @@ describe("BTW transcript message layout", () => {
165
165
  expect(opened).toBe(1);
166
166
  expect(component.getDraft()).toBe("draft prompt");
167
167
  });
168
+
169
+ it("configures fd-backed completion for @ path suggestions", () => {
170
+ const component = new BtwOverlayComponent(
171
+ tui,
172
+ theme,
173
+ keybindings,
174
+ () => [],
175
+ () => null,
176
+ () => "contextual",
177
+ () => {},
178
+ () => {},
179
+ () => {},
180
+ );
181
+
182
+ expect((component as any).input.autocompleteProvider.fdPath).toBeTruthy();
183
+ });
168
184
  });
package/extensions/btw.ts CHANGED
@@ -57,6 +57,18 @@ function matchesBtwFocusShortcut(data: string): boolean {
57
57
  return BTW_FOCUS_SHORTCUTS.some((shortcut) => matchesKey(data, shortcut));
58
58
  }
59
59
 
60
+ function findFdPath(): string | null {
61
+ const lookup = process.platform === "win32" ? "where" : "which";
62
+ for (const candidate of process.platform === "win32" ? ["fd.exe", "fd"] : ["fd", "fdfind"]) {
63
+ const result = spawnSync(lookup, [candidate], { encoding: "utf8" });
64
+ if (result.status === 0) {
65
+ const resolved = String(result.stdout ?? "").split(/\r?\n/).find(Boolean)?.trim();
66
+ if (resolved) return resolved;
67
+ }
68
+ }
69
+ return null;
70
+ }
71
+
60
72
  const BTW_SYSTEM_PROMPT = [
61
73
  "You are having an aside conversation with the user, separate from their main working session.",
62
74
  "If main session messages are provided, they are for context only — that work is being handled by another agent.",
@@ -1136,7 +1148,7 @@ export class BtwOverlayComponent extends Container implements Focusable {
1136
1148
 
1137
1149
  // Wire up autocomplete (file-path completion only, no commands)
1138
1150
  const cwdPath = cwd ?? process.cwd();
1139
- const autocompleteProvider = new CombinedAutocompleteProvider([], cwdPath);
1151
+ const autocompleteProvider = new CombinedAutocompleteProvider([], cwdPath, findFdPath());
1140
1152
  this.input.setAutocompleteProvider(autocompleteProvider);
1141
1153
 
1142
1154
  this.peekState = createPeekState();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-render-btw",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
4
4
  "description": "A pi extension for parallel side conversations with /btw — with markdown rendering in the floating window",
5
5
  "type": "module",
6
6
  "license": "MIT",