mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
feat: Add --yolo mode that automatically accepts all tools executions (#695)
Co-authored-by: N. Taylor Mullen <ntaylormullen@google.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user