mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-29 12:11:09 +00:00
refactor: move nested debugmessage and slashcommand hooks outside of useGeminiStream (#341)
This commit is contained in:
parent
c4c11f1d65
commit
d3303fd3a0
5 changed files with 42 additions and 49 deletions
|
|
@ -19,7 +19,7 @@ import { UseHistoryManagerReturn } from './useHistoryManager.js';
|
|||
export const useShellCommandProcessor = (
|
||||
addItemToHistory: UseHistoryManagerReturn['addItem'],
|
||||
setStreamingState: React.Dispatch<React.SetStateAction<StreamingState>>,
|
||||
setDebugMessage: React.Dispatch<React.SetStateAction<string>>,
|
||||
onDebugMessage: (message: string) => void,
|
||||
config: Config,
|
||||
) => {
|
||||
/**
|
||||
|
|
@ -50,7 +50,7 @@ export const useShellCommandProcessor = (
|
|||
}
|
||||
|
||||
const targetDir = config.getTargetDir();
|
||||
setDebugMessage(
|
||||
onDebugMessage(
|
||||
`Executing shell command in ${targetDir}: ${commandToExecute}`,
|
||||
);
|
||||
const execOptions = {
|
||||
|
|
@ -80,7 +80,7 @@ export const useShellCommandProcessor = (
|
|||
|
||||
return true; // Command was initiated
|
||||
},
|
||||
[config, setDebugMessage, addItemToHistory, setStreamingState],
|
||||
[config, onDebugMessage, addItemToHistory, setStreamingState],
|
||||
);
|
||||
|
||||
return { handleShellCommand };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue