refactor(extension): split extension.ts into 3 modules - http-bridge, html-patcher, command-handler (#398)

This commit is contained in:
Variet Worker
2026-03-17 18:48:46 +09:00
parent 1ce8b7c707
commit 6640d42449
7 changed files with 928 additions and 688 deletions

View File

@@ -20,7 +20,7 @@ export interface BridgeContext {
lastPendingStepIndex: number;
stallProbed: boolean;
sawRunningAfterPending: boolean;
clickTrigger: { action: 'approve' | 'reject'; timestamp: number } | null;
setClickTrigger: (action: 'approve' | 'reject') => void;
logToFile: (msg: string) => void;
workspaceUri: string;
diffReviewMetadata: Map<string, { edit_step_indices: number[]; modified_files: string[] }>;
@@ -1453,9 +1453,9 @@ export async function tryApprovalStrategies(approved: boolean, sessionId: string
// ── Strategy 2: Renderer DOM Click via HTTP Bridge (primary fallback) ──
try {
const triggerAction = approved ? 'approve' : 'reject';
ctx.logToFile(`[APPROVAL-2] Setting ctx.clickTrigger=${triggerAction} for renderer DOM click`);
ctx.clickTrigger = { action: triggerAction as 'approve' | 'reject', timestamp: Date.now() };
ctx.logToFile(`[APPROVAL-2] ✅ ctx.clickTrigger set — renderer will poll and click within 2s`);
ctx.logToFile(`[APPROVAL-2] Setting clickTrigger=${triggerAction} for renderer DOM click`);
ctx.setClickTrigger(triggerAction as 'approve' | 'reject');
ctx.logToFile(`[APPROVAL-2] ✅ clickTrigger set — renderer will poll and click within 2s`);
} catch (e: any) {
ctx.logToFile(`[APPROVAL-2] ❌ FAIL: ${e.message}`);
}