summaryrefslogtreecommitdiff
path: root/packages/core/src/config/config.ts
diff options
context:
space:
mode:
authorTolik Malibroda <[email protected]>2025-06-02 22:05:45 +0200
committerGitHub <[email protected]>2025-06-02 22:05:45 +0200
commit0795e55f0e7d2f2822bcd83eaf066eb99c67f858 (patch)
tree3fd259976c8cfc5df79bba2d37f0a17fa3f683a4 /packages/core/src/config/config.ts
parent42bedbc3d39265932cbd6c9b818b6a7fbcbdd022 (diff)
feat: Add --yolo mode that automatically accepts all tools executions (#695)
Co-authored-by: N. Taylor Mullen <[email protected]>
Diffstat (limited to 'packages/core/src/config/config.ts')
-rw-r--r--packages/core/src/config/config.ts21
1 files changed, 13 insertions, 8 deletions
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 {