mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 19:44:30 -07:00
feat(plan): add core logic and exit_plan_mode tool definition (#18110)
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
type ToolConfirmationResponse,
|
||||
type Question,
|
||||
} from '../confirmation-bus/types.js';
|
||||
import { type ApprovalMode } from '../policy/types.js';
|
||||
|
||||
/**
|
||||
* Represents a validated and ready-to-execute tool call.
|
||||
@@ -701,9 +702,19 @@ export interface ToolAskUserConfirmationPayload {
|
||||
answers: { [questionIndex: string]: string };
|
||||
}
|
||||
|
||||
export interface ToolExitPlanModeConfirmationPayload {
|
||||
/** Whether the user approved the plan */
|
||||
approved: boolean;
|
||||
/** If approved, the approval mode to use for implementation */
|
||||
approvalMode?: ApprovalMode;
|
||||
/** If rejected, the user's feedback */
|
||||
feedback?: string;
|
||||
}
|
||||
|
||||
export type ToolConfirmationPayload =
|
||||
| ToolEditConfirmationPayload
|
||||
| ToolAskUserConfirmationPayload;
|
||||
| ToolAskUserConfirmationPayload
|
||||
| ToolExitPlanModeConfirmationPayload;
|
||||
|
||||
export interface ToolExecuteConfirmationDetails {
|
||||
type: 'exec';
|
||||
@@ -742,12 +753,23 @@ export interface ToolAskUserConfirmationDetails {
|
||||
) => Promise<void>;
|
||||
}
|
||||
|
||||
export interface ToolExitPlanModeConfirmationDetails {
|
||||
type: 'exit_plan_mode';
|
||||
title: string;
|
||||
planPath: string;
|
||||
onConfirm: (
|
||||
outcome: ToolConfirmationOutcome,
|
||||
payload?: ToolConfirmationPayload,
|
||||
) => Promise<void>;
|
||||
}
|
||||
|
||||
export type ToolCallConfirmationDetails =
|
||||
| ToolEditConfirmationDetails
|
||||
| ToolExecuteConfirmationDetails
|
||||
| ToolMcpConfirmationDetails
|
||||
| ToolInfoConfirmationDetails
|
||||
| ToolAskUserConfirmationDetails;
|
||||
| ToolAskUserConfirmationDetails
|
||||
| ToolExitPlanModeConfirmationDetails;
|
||||
|
||||
export enum ToolConfirmationOutcome {
|
||||
ProceedOnce = 'proceed_once',
|
||||
@@ -769,6 +791,7 @@ export enum Kind {
|
||||
Think = 'think',
|
||||
Fetch = 'fetch',
|
||||
Communicate = 'communicate',
|
||||
Plan = 'plan',
|
||||
Other = 'other',
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user