From 28767b369f6d59ef822954f22667bdf87507e756 Mon Sep 17 00:00:00 2001 From: Allen Hutchison Date: Tue, 29 Apr 2025 13:29:57 -0700 Subject: Refactor useGeminiStream to pull slash commands and passthrough comma… (#215) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refactor useGeminiStream to pull slash commands and passthrough commands into their own processors. * whitespace lint errors. * Add sugestions from code review. --- packages/cli/src/ui/utils/commandUtils.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages/cli/src/ui/utils') diff --git a/packages/cli/src/ui/utils/commandUtils.ts b/packages/cli/src/ui/utils/commandUtils.ts index 8c7934dc..4f731bb3 100644 --- a/packages/cli/src/ui/utils/commandUtils.ts +++ b/packages/cli/src/ui/utils/commandUtils.ts @@ -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('/'); -- cgit v1.2.3