( fromMode: string, toMode: string, )
| 1363 | } |
| 1364 | |
| 1365 | export function handlePlanModeTransition( |
| 1366 | fromMode: string, |
| 1367 | toMode: string, |
| 1368 | ): void { |
| 1369 | // If switching TO plan mode, clear any pending exit attachment |
| 1370 | // This prevents sending both plan_mode and plan_mode_exit when user toggles quickly |
| 1371 | if (toMode === 'plan' && fromMode !== 'plan') { |
| 1372 | STATE.needsPlanModeExitAttachment = false |
| 1373 | } |
| 1374 | |
| 1375 | // If switching out of plan mode, trigger the plan_mode_exit attachment |
| 1376 | if (fromMode === 'plan' && toMode !== 'plan') { |
| 1377 | STATE.needsPlanModeExitAttachment = true |
| 1378 | } |
| 1379 | } |
| 1380 | |
| 1381 | export function needsAutoModeExitAttachment(): boolean { |
| 1382 | return STATE.needsAutoModeExitAttachment |
no outgoing calls
no test coverage detected