summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/hooks')
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.test.ts3
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.ts7
2 files changed, 6 insertions, 4 deletions
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
index a17fcd1e..beee1418 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.test.ts
@@ -102,6 +102,7 @@ describe('useSlashCommandProcessor', () => {
mockOpenThemeDialog,
mockPerformMemoryRefresh,
mockCorgiMode,
+ 'test-version',
),
);
return result.current;
@@ -248,7 +249,7 @@ describe('useSlashCommandProcessor', () => {
sandboxEnvVar?: string,
seatbeltProfileVar?: string,
) => {
- const cliVersion = process.env.npm_package_version || 'Unknown';
+ const cliVersion = 'test-version';
const osVersion = `${process.platform} ${process.version}`;
let sandboxEnvStr = 'no sandbox';
if (sandboxEnvVar && sandboxEnvVar !== 'sandbox-exec') {
diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
index 9f6a6d5e..858897f0 100644
--- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts
+++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts
@@ -24,15 +24,16 @@ export interface SlashCommand {
* Hook to define and process slash commands (e.g., /help, /clear).
*/
export const useSlashCommandProcessor = (
- config: Config | null, // Add config here
+ config: Config | null,
addItem: UseHistoryManagerReturn['addItem'],
clearItems: UseHistoryManagerReturn['clearItems'],
refreshStatic: () => void,
setShowHelp: React.Dispatch<React.SetStateAction<boolean>>,
onDebugMessage: (message: string) => void,
openThemeDialog: () => void,
- performMemoryRefresh: () => Promise<void>, // Add performMemoryRefresh prop
+ performMemoryRefresh: () => Promise<void>,
toggleCorgiMode: () => void,
+ cliVersion: string,
) => {
const addMessage = useCallback(
(message: Message) => {
@@ -149,7 +150,6 @@ export const useSlashCommandProcessor = (
}
bugDescription = bugDescription.trim();
- const cliVersion = process.env.npm_package_version || 'Unknown';
const osVersion = `${process.platform} ${process.version}`;
let sandboxEnv = 'no sandbox';
if (process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec') {
@@ -226,6 +226,7 @@ Add any other context about the problem here.
addMessage,
toggleCorgiMode,
config, // Added config to dependency array
+ cliVersion,
],
);