mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-17 17:41:24 -07:00
feat(plan): refactor ToolConfirmationPayload to union type (#17980)
This commit is contained in:
@@ -180,7 +180,7 @@ export class AskUserInvocation extends BaseToolInvocation<
|
||||
payload?: ToolConfirmationPayload,
|
||||
) => {
|
||||
this.confirmationOutcome = outcome;
|
||||
if (payload?.answers) {
|
||||
if (payload && 'answers' in payload) {
|
||||
this.userAnswers = payload.answers;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -693,14 +693,18 @@ export interface ToolEditConfirmationDetails {
|
||||
ideConfirmation?: Promise<DiffUpdateResult>;
|
||||
}
|
||||
|
||||
export interface ToolConfirmationPayload {
|
||||
// used to override `modifiedProposedContent` for modifiable tools in the
|
||||
// inline modify flow
|
||||
newContent?: string;
|
||||
// used for askuser tool to return user's answers
|
||||
answers?: { [questionIndex: string]: string };
|
||||
export interface ToolEditConfirmationPayload {
|
||||
newContent: string;
|
||||
}
|
||||
|
||||
export interface ToolAskUserConfirmationPayload {
|
||||
answers: { [questionIndex: string]: string };
|
||||
}
|
||||
|
||||
export type ToolConfirmationPayload =
|
||||
| ToolEditConfirmationPayload
|
||||
| ToolAskUserConfirmationPayload;
|
||||
|
||||
export interface ToolExecuteConfirmationDetails {
|
||||
type: 'exec';
|
||||
title: string;
|
||||
|
||||
Reference in New Issue
Block a user