summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useGeminiStream.ts
diff options
context:
space:
mode:
authorSeth Troisi <[email protected]>2025-04-30 00:26:07 +0000
committerSeth Troisi <[email protected]>2025-04-30 22:17:08 +0000
commit5f5edb4c9bac24c4875ffc1a5a97ad8cf11f4436 (patch)
tree376f7f0863d0db0c354ec6f2212d16f9c20cd995 /packages/cli/src/ui/hooks/useGeminiStream.ts
parent68a3020044b3c8567641c8fdcd5a369366dab981 (diff)
Added bang(!) commands as a shell passthrough
Diffstat (limited to 'packages/cli/src/ui/hooks/useGeminiStream.ts')
-rw-r--r--packages/cli/src/ui/hooks/useGeminiStream.ts22
1 files changed, 18 insertions, 4 deletions
diff --git a/packages/cli/src/ui/hooks/useGeminiStream.ts b/packages/cli/src/ui/hooks/useGeminiStream.ts
index f166bc1e..89cd5223 100644
--- a/packages/cli/src/ui/hooks/useGeminiStream.ts
+++ b/packages/cli/src/ui/hooks/useGeminiStream.ts
@@ -29,6 +29,7 @@ import {
} from '../types.js';
import { isAtCommand } from '../utils/commandUtils.js'; // Import the @ command checker
import { useSlashCommandProcessor } from './slashCommandProcessor.js';
+import { useShellCommandProcessor } from './shellCommandProcessor.js';
import { usePassthroughProcessor } from './passthroughCommandProcessor.js';
import { handleAtCommand } from './atCommandProcessor.js'; // Import the @ command handler
import { findSafeSplitPoint } from '../utils/markdownUtilities.js'; // Import the split point finder
@@ -75,6 +76,14 @@ export const useGeminiStream = (
getNextMessageId,
);
+ const { handleShellCommand } = useShellCommandProcessor(
+ setHistory,
+ setStreamingState,
+ setDebugMessage,
+ getNextMessageId,
+ config,
+ );
+
const { handlePassthroughCommand } = usePassthroughProcessor(
setHistory,
setStreamingState,
@@ -154,14 +163,19 @@ export const useGeminiStream = (
const trimmedQuery = query.trim();
setDebugMessage(`User query: '${trimmedQuery}'`);
- // 1. Check for Slash Commands
+ // 1. Check for Slash Commands (/)
if (handleSlashCommand(trimmedQuery)) {
- return; // Handled, exit
+ return;
+ }
+
+ // 2. Check for Shell Commands (! or $)
+ if (handleShellCommand(trimmedQuery)) {
+ return;
}
- // 2. Check for Passthrough Commands
+ // 3. Check for Passthrough Commands
if (handlePassthroughCommand(trimmedQuery)) {
- return; // Handled, exit
+ return;
}
// 3. Check for @ Commands using the utility function