diff options
| author | Allen Hutchison <[email protected]> | 2025-05-07 12:30:32 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-07 12:30:32 -0700 |
| commit | 6b3ef9f93986a6c5f892b5f011b25b6826e522a1 (patch) | |
| tree | 3af7fda7863a72a27185b48630dad2e3526337d9 /packages/cli/src/ui/hooks/atCommandProcessor.ts | |
| parent | 46490263123bf855c40da35ef8be62f2b9b134b2 (diff) | |
Refactor: Enhance @-command, Autocomplete, and Input Stability (#279)
Diffstat (limited to 'packages/cli/src/ui/hooks/atCommandProcessor.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/atCommandProcessor.ts | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/cli/src/ui/hooks/atCommandProcessor.ts b/packages/cli/src/ui/hooks/atCommandProcessor.ts index 2d93d1cb..50e81589 100644 --- a/packages/cli/src/ui/hooks/atCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/atCommandProcessor.ts @@ -106,16 +106,25 @@ export async function handleAtCommand({ // Add the original user query to history first addItem({ type: 'user', text: query }, userMessageTimestamp); + // If the atPath is just "@", pass the original query to the LLM + if (atPath === '@') { + setDebugMessage('Lone @ detected, passing directly to LLM.'); + return { processedQuery: [{ text: query }], shouldProceed: true }; + } + const pathPart = atPath.substring(1); // Remove leading '@' + // This error condition is for cases where pathPart becomes empty *after* the initial "@" check, + // which is unlikely with the current parser but good for robustness. if (!pathPart) { addItem( - { type: 'error', text: 'Error: No path specified after @.' }, + { type: 'error', text: 'Error: No valid path specified after @ symbol.' }, userMessageTimestamp, ); return { processedQuery: null, shouldProceed: false }; } + const contentLabel = pathPart; const toolRegistry = config.getToolRegistry(); const readManyFilesTool = toolRegistry.getTool('read_many_files'); @@ -129,7 +138,6 @@ export async function handleAtCommand({ // Determine path spec (file or directory glob) let pathSpec = pathPart; - const contentLabel = pathPart; try { const absolutePath = path.resolve(config.getTargetDir(), pathPart); const stats = await fs.stat(absolutePath); |
