From 0795e55f0e7d2f2822bcd83eaf066eb99c67f858 Mon Sep 17 00:00:00 2001 From: Tolik Malibroda <54813212+tolikmalibroda@users.noreply.github.com> Date: Mon, 2 Jun 2025 22:05:45 +0200 Subject: feat: Add --yolo mode that automatically accepts all tools executions (#695) Co-authored-by: N. Taylor Mullen --- packages/core/src/config/config.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'packages/core/src/config') diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index a6279e2e..71c4a7d2 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -22,6 +22,12 @@ import { ReadManyFilesTool } from '../tools/read-many-files.js'; import { MemoryTool, setGeminiMdFilename } from '../tools/memoryTool.js'; import { WebSearchTool } from '../tools/web-search.js'; +export enum ApprovalMode { + DEFAULT = 'default', + AUTO_EDIT = 'autoEdit', + YOLO = 'yolo', +} + export class MCPServerConfig { constructor( // For stdio transport @@ -53,7 +59,7 @@ export interface ConfigParameters { userAgent: string; userMemory?: string; geminiMdFileCount?: number; - alwaysSkipModificationConfirmation?: boolean; + approvalMode?: ApprovalMode; vertexai?: boolean; showMemoryUsage?: boolean; contextFileName?: string; @@ -76,7 +82,7 @@ export class Config { private readonly userAgent: string; private userMemory: string; private geminiMdFileCount: number; - private alwaysSkipModificationConfirmation: boolean; + private approvalMode: ApprovalMode; private readonly vertexai: boolean | undefined; private readonly showMemoryUsage: boolean; @@ -96,8 +102,7 @@ export class Config { this.userAgent = params.userAgent; this.userMemory = params.userMemory ?? ''; this.geminiMdFileCount = params.geminiMdFileCount ?? 0; - this.alwaysSkipModificationConfirmation = - params.alwaysSkipModificationConfirmation ?? false; + this.approvalMode = params.approvalMode ?? ApprovalMode.DEFAULT; this.vertexai = params.vertexai; this.showMemoryUsage = params.showMemoryUsage ?? false; @@ -179,12 +184,12 @@ export class Config { this.geminiMdFileCount = count; } - getAlwaysSkipModificationConfirmation(): boolean { - return this.alwaysSkipModificationConfirmation; + getApprovalMode(): ApprovalMode { + return this.approvalMode; } - setAlwaysSkipModificationConfirmation(skip: boolean): void { - this.alwaysSkipModificationConfirmation = skip; + setApprovalMode(mode: ApprovalMode): void { + this.approvalMode = mode; } getVertexAI(): boolean | undefined { -- cgit v1.2.3