mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
prefactor: add rootCommands as array so it can be used for policy parsing (#16640)
This commit is contained in:
@@ -208,6 +208,7 @@ describe('<HistoryItemDisplay />', () => {
|
|||||||
title: 'Run Shell Command',
|
title: 'Run Shell Command',
|
||||||
command: 'echo "\u001b[31mhello\u001b[0m"',
|
command: 'echo "\u001b[31mhello\u001b[0m"',
|
||||||
rootCommand: 'echo',
|
rootCommand: 'echo',
|
||||||
|
rootCommands: ['echo'],
|
||||||
onConfirm: async () => {},
|
onConfirm: async () => {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ describe('ToolConfirmationMessage', () => {
|
|||||||
title: 'Confirm Execution',
|
title: 'Confirm Execution',
|
||||||
command: 'echo "hello"',
|
command: 'echo "hello"',
|
||||||
rootCommand: 'echo',
|
rootCommand: 'echo',
|
||||||
|
rootCommands: ['echo'],
|
||||||
onConfirm: vi.fn(),
|
onConfirm: vi.fn(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ describe('textUtils', () => {
|
|||||||
type: 'exec',
|
type: 'exec',
|
||||||
command: '\u001b[31mmls -l\u001b[0m',
|
command: '\u001b[31mmls -l\u001b[0m',
|
||||||
rootCommand: '\u001b[32msudo apt-get update\u001b[0m',
|
rootCommand: '\u001b[32msudo apt-get update\u001b[0m',
|
||||||
|
rootCommands: ['sudo'],
|
||||||
onConfirm: async () => {},
|
onConfirm: async () => {},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1245,6 +1245,7 @@ describe('CoreToolScheduler request queueing', () => {
|
|||||||
title: 'Confirm Shell Command',
|
title: 'Confirm Shell Command',
|
||||||
command: String(params['command'] ?? ''),
|
command: String(params['command'] ?? ''),
|
||||||
rootCommand: 'git',
|
rootCommand: 'git',
|
||||||
|
rootCommands: ['git'],
|
||||||
onConfirm: async () => {},
|
onConfirm: async () => {},
|
||||||
}),
|
}),
|
||||||
execute: () => executeFn({}),
|
execute: () => executeFn({}),
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ export const MOCK_TOOL_SHOULD_CONFIRM_EXECUTE = () =>
|
|||||||
title: 'Confirm mockTool',
|
title: 'Confirm mockTool',
|
||||||
command: 'mockTool',
|
command: 'mockTool',
|
||||||
rootCommand: 'mockTool',
|
rootCommand: 'mockTool',
|
||||||
|
rootCommands: ['mockTool'],
|
||||||
onConfirm: async () => {},
|
onConfirm: async () => {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ export class ShellToolInvocation extends BaseToolInvocation<
|
|||||||
title: 'Confirm Shell Command',
|
title: 'Confirm Shell Command',
|
||||||
command: this.params.command,
|
command: this.params.command,
|
||||||
rootCommand: rootCommands.join(', '),
|
rootCommand: rootCommands.join(', '),
|
||||||
|
rootCommands,
|
||||||
onConfirm: async (outcome: ToolConfirmationOutcome) => {
|
onConfirm: async (outcome: ToolConfirmationOutcome) => {
|
||||||
await this.publishPolicyUpdate(outcome);
|
await this.publishPolicyUpdate(outcome);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -693,6 +693,7 @@ export interface ToolExecuteConfirmationDetails {
|
|||||||
onConfirm: (outcome: ToolConfirmationOutcome) => Promise<void>;
|
onConfirm: (outcome: ToolConfirmationOutcome) => Promise<void>;
|
||||||
command: string;
|
command: string;
|
||||||
rootCommand: string;
|
rootCommand: string;
|
||||||
|
rootCommands: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ToolMcpConfirmationDetails {
|
export interface ToolMcpConfirmationDetails {
|
||||||
|
|||||||
Reference in New Issue
Block a user