fix(ext): WS response → tryApprovalStrategies 직접 호출 (파일 경유 제거)
This commit is contained in:
@@ -41,6 +41,26 @@ const lastSeenStep = new Map<string, number>();
|
||||
const lastSnapshotText = new Map<string, string>();
|
||||
const registeredSessions = new Set<string>(); // track which sessions have been registered
|
||||
|
||||
/**
|
||||
* Get current approval context for WS response routing.
|
||||
* Used by extension.ts onResponse handler to call tryApprovalStrategies.
|
||||
*/
|
||||
export function getApprovalContext(): { sessionId: string; stepIndex: number } {
|
||||
return {
|
||||
sessionId: ctx.activeSessionId || '',
|
||||
stepIndex: ctx.lastPendingStepIndex ?? -1,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset pending state after successful approval.
|
||||
* Called after WS response triggers approval in extension.ts.
|
||||
*/
|
||||
export function resetPendingState(): void {
|
||||
ctx.stallProbed = false;
|
||||
ctx.sawRunningAfterPending = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a registration file for the Bot to discover session → project mapping.
|
||||
* Called automatically on first step event per session.
|
||||
|
||||
Reference in New Issue
Block a user