fix: file @ autocomplete performance using fd

- Replace slow synchronous directory walking with fd for fuzzy file search
- Auto-download fd to ~/.pi/agent/tools/ if not found in PATH
- Performance improved from ~900ms to ~10ms per keystroke on large repos
- Remove minimatch dependency from tui package
- Graceful degradation if fd unavailable (empty results)

Fixes #69
This commit is contained in:
Mario Zechner 2025-11-28 23:38:44 +01:00
parent 754e745b1f
commit a61eca5dee
7 changed files with 250 additions and 108 deletions

View file

@ -105,6 +105,7 @@ export class TuiRenderer {
changelogMarkdown: string | null = null,
newVersion: string | null = null,
scopedModels: Array<{ model: Model<any>; thinkingLevel: ThinkingLevel }> = [],
fdPath: string | null = null,
) {
this.agent = agent;
this.sessionManager = sessionManager;
@ -194,6 +195,7 @@ export class TuiRenderer {
clearCommand,
],
process.cwd(),
fdPath,
);
this.editor.setAutocompleteProvider(autocompleteProvider);
}