diff options
| author | Brandon Keiji <[email protected]> | 2025-05-13 23:55:49 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-13 16:55:49 -0700 |
| commit | d3303fd3a004ee816c2c498c2f7ffa51753afc07 (patch) | |
| tree | c8764197104ed1d33c5c0efa5cb1dfc69b6df38f /packages/cli/src/ui/hooks/atCommandProcessor.ts | |
| parent | c4c11f1d65233f31751cee65e29aa6ae3f7f2410 (diff) | |
refactor: move nested debugmessage and slashcommand hooks outside of useGeminiStream (#341)
Diffstat (limited to 'packages/cli/src/ui/hooks/atCommandProcessor.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/atCommandProcessor.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/cli/src/ui/hooks/atCommandProcessor.ts b/packages/cli/src/ui/hooks/atCommandProcessor.ts index a13a7d36..e0cf65c5 100644 --- a/packages/cli/src/ui/hooks/atCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/atCommandProcessor.ts @@ -24,7 +24,7 @@ interface HandleAtCommandParams { query: string; config: Config; addItem: UseHistoryManagerReturn['addItem']; - setDebugMessage: React.Dispatch<React.SetStateAction<string>>; + onDebugMessage: (message: string) => void; messageId: number; signal: AbortSignal; } @@ -89,7 +89,7 @@ export async function handleAtCommand({ query, config, addItem, - setDebugMessage, + onDebugMessage, messageId: userMessageTimestamp, signal, }: HandleAtCommandParams): Promise<HandleAtCommandResult> { @@ -109,7 +109,7 @@ export async function handleAtCommand({ // If the atPath is just "@", pass the original query to the LLM if (atPath === '@') { - setDebugMessage('Lone @ detected, passing directly to LLM.'); + onDebugMessage('Lone @ detected, passing directly to LLM.'); return { processedQuery: [{ text: query }], shouldProceed: true }; } @@ -144,18 +144,18 @@ export async function handleAtCommand({ const stats = await fs.stat(absolutePath); if (stats.isDirectory()) { pathSpec = pathPart.endsWith('/') ? `${pathPart}**` : `${pathPart}/**`; - setDebugMessage(`Path resolved to directory, using glob: ${pathSpec}`); + onDebugMessage(`Path resolved to directory, using glob: ${pathSpec}`); } else { - setDebugMessage(`Path resolved to file: ${pathSpec}`); + onDebugMessage(`Path resolved to file: ${pathSpec}`); } } catch (error) { // If stat fails (e.g., not found), proceed with original path. // The tool itself will handle the error during execution. if (isNodeError(error) && error.code === 'ENOENT') { - setDebugMessage(`Path not found, proceeding with original: ${pathSpec}`); + onDebugMessage(`Path not found, proceeding with original: ${pathSpec}`); } else { console.error(`Error stating path ${pathPart}:`, error); - setDebugMessage( + onDebugMessage( `Error stating path, proceeding with original: ${pathSpec}`, ); } |
