mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 04:54:25 -07:00
refactor(core): replace manual syncPlanModeTools with declarative policy rules (#20596)
This commit is contained in:
@@ -28,9 +28,11 @@ export class AskUserTool extends BaseDeclarativeTool<
|
||||
AskUserParams,
|
||||
ToolResult
|
||||
> {
|
||||
static readonly Name = ASK_USER_TOOL_NAME;
|
||||
|
||||
constructor(messageBus: MessageBus) {
|
||||
super(
|
||||
ASK_USER_TOOL_NAME,
|
||||
AskUserTool.Name,
|
||||
ASK_USER_DISPLAY_NAME,
|
||||
ASK_USER_DEFINITION.base.description!,
|
||||
Kind.Communicate,
|
||||
|
||||
@@ -27,12 +27,14 @@ export class EnterPlanModeTool extends BaseDeclarativeTool<
|
||||
EnterPlanModeParams,
|
||||
ToolResult
|
||||
> {
|
||||
static readonly Name = ENTER_PLAN_MODE_TOOL_NAME;
|
||||
|
||||
constructor(
|
||||
private config: Config,
|
||||
messageBus: MessageBus,
|
||||
) {
|
||||
super(
|
||||
ENTER_PLAN_MODE_TOOL_NAME,
|
||||
EnterPlanModeTool.Name,
|
||||
'Enter Plan Mode',
|
||||
ENTER_PLAN_MODE_DEFINITION.base.description!,
|
||||
Kind.Plan,
|
||||
|
||||
@@ -35,6 +35,8 @@ export class ExitPlanModeTool extends BaseDeclarativeTool<
|
||||
ExitPlanModeParams,
|
||||
ToolResult
|
||||
> {
|
||||
static readonly Name = EXIT_PLAN_MODE_TOOL_NAME;
|
||||
|
||||
constructor(
|
||||
private config: Config,
|
||||
messageBus: MessageBus,
|
||||
@@ -42,7 +44,7 @@ export class ExitPlanModeTool extends BaseDeclarativeTool<
|
||||
const plansDir = config.storage.getPlansDir();
|
||||
const definition = getExitPlanModeDefinition(plansDir);
|
||||
super(
|
||||
EXIT_PLAN_MODE_TOOL_NAME,
|
||||
ExitPlanModeTool.Name,
|
||||
'Exit Plan Mode',
|
||||
definition.base.description!,
|
||||
Kind.Plan,
|
||||
|
||||
Reference in New Issue
Block a user