Refactor useGeminiStream to pull slash commands and passthrough comma… (#215)

* Refactor useGeminiStream to pull slash commands and passthrough commands into their own processors.

* whitespace lint errors.

* Add sugestions from code review.
This commit is contained in:
Allen Hutchison 2025-04-29 13:29:57 -07:00 committed by GitHub
parent 4793e86f04
commit 28767b369f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 278 additions and 131 deletions

View file

@ -15,3 +15,12 @@
export const isPotentiallyAtCommand = (query: string): boolean =>
// Check if starts with @ OR has a space, then @, then a non-space character.
query.startsWith('@') || /\s@\S/.test(query);
/**
* Checks if a query string represents a slash command (starts with '/').
*
* @param query The input query string.
* @returns True if the query is a slash command, false otherwise.
*/
export const isSlashCommand = (query: string): boolean =>
query.trim().startsWith('/');