mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 09:17:53 +00:00
refactor(vscode-ide-companion): introduce ApprovalMode enum and improve mode handling
- Create new approvalModeTypes.ts with ApprovalMode enum and helper functions - Replace hardcoded string literals with ApprovalModeValue type - Consolidate mode mapping logic using new helper functions
This commit is contained in:
@@ -10,6 +10,7 @@ import type {
|
||||
AcpPermissionRequest,
|
||||
AcpResponse,
|
||||
AcpSessionUpdate,
|
||||
ApprovalModeValue,
|
||||
} from '../types/acpTypes.js';
|
||||
import type { ChildProcess, SpawnOptions } from 'child_process';
|
||||
import { spawn } from 'child_process';
|
||||
@@ -380,9 +381,7 @@ export class AcpConnection {
|
||||
/**
|
||||
* Set approval mode
|
||||
*/
|
||||
async setMode(
|
||||
modeId: 'plan' | 'default' | 'auto-edit' | 'yolo',
|
||||
): Promise<AcpResponse> {
|
||||
async setMode(modeId: ApprovalModeValue): Promise<AcpResponse> {
|
||||
return this.sessionManager.setMode(
|
||||
modeId,
|
||||
this.child,
|
||||
|
||||
Reference in New Issue
Block a user