Added bang(!) commands as a shell passthrough

This commit is contained in:
Seth Troisi
2025-04-30 00:26:07 +00:00
parent 68a3020044
commit 5f5edb4c9b
6 changed files with 157 additions and 27 deletions

View File

@@ -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 Passthrough Commands
// 2. Check for Shell Commands (! or $)
if (handleShellCommand(trimmedQuery)) {
return;
}
// 3. Check for Passthrough Commands
if (handlePassthroughCommand(trimmedQuery)) {
return; // Handled, exit
return;
}
// 3. Check for @ Commands using the utility function