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
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('/');