diff options
| author | Allen Hutchison <[email protected]> | 2025-04-29 15:39:36 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-04-29 15:39:36 -0700 |
| commit | 889200d400c4dec60de0d7b5cdd77261bbb63edb (patch) | |
| tree | e107628611d870d4a00435731d2754305888128f /packages/cli/src/ui/utils/commandUtils.ts | |
| parent | c1b23c008a378c6c4b7f50fabc0ebf0280e0e5ad (diff) | |
Add @ command handling to useGeminiStream (#217)
* First integration of at commands into useGeminiStream.ts
* feat: Integrate @ command for file/directory reading
- Adds support for `@<path>` commands in the CLI UI to read file or directory contents using the `read_many_files` tool.
- Refactors `useGeminiStream` hook to handle slash, passthrough, and @ commands before sending queries to the Gemini API.
- Improves history item ID generation to prevent React duplicate key warnings.
* fix: Handle additional text after @ command path
- Modifies the `@` command processor to parse text following the file/directory path (e.g., `@README.md explain this`).
- Includes both the fetched file content and the subsequent text in the query sent to the Gemini API.
- Resolves the TODO item in `atCommandProcessor.ts`.
* feat: Allow @ command anywhere in query and fix build
- Update `atCommandProcessor` to correctly parse `@<path>` commands regardless of their position in the input string using regex. This enables queries like "Explain @README.md to me".
- Fix build error in `useGeminiStream` by importing the missing `findSafeSplitPoint` function.
* rename isPotentiallyAtCommand to isAtCommand
* respond to review comments.
Diffstat (limited to 'packages/cli/src/ui/utils/commandUtils.ts')
| -rw-r--r-- | packages/cli/src/ui/utils/commandUtils.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/cli/src/ui/utils/commandUtils.ts b/packages/cli/src/ui/utils/commandUtils.ts index 4f731bb3..89e207d9 100644 --- a/packages/cli/src/ui/utils/commandUtils.ts +++ b/packages/cli/src/ui/utils/commandUtils.ts @@ -12,7 +12,7 @@ * @param query The input query string. * @returns True if the query looks like an '@' command, false otherwise. */ -export const isPotentiallyAtCommand = (query: string): boolean => +export const isAtCommand = (query: string): boolean => // Check if starts with @ OR has a space, then @, then a non-space character. query.startsWith('@') || /\s@\S/.test(query); |
