( fromMode: string, toMode: string, )
| 1347 | } |
| 1348 | |
| 1349 | export function handlePlanModeTransition( |
| 1350 | fromMode: string, |
| 1351 | toMode: string, |
| 1352 | ): void { |
| 1353 | // If switching TO plan mode, clear any pending exit attachment |
| 1354 | // This prevents sending both plan_mode and plan_mode_exit when user toggles quickly |
| 1355 | if (toMode === 'plan' && fromMode !== 'plan') { |
| 1356 | STATE.needsPlanModeExitAttachment = false |
| 1357 | } |
| 1358 | |
| 1359 | // If switching out of plan mode, trigger the plan_mode_exit attachment |
| 1360 | if (fromMode === 'plan' && toMode !== 'plan') { |
| 1361 | STATE.needsPlanModeExitAttachment = true |
| 1362 | } |
| 1363 | } |
| 1364 | |
| 1365 | export function needsAutoModeExitAttachment(): boolean { |
| 1366 | return STATE.needsAutoModeExitAttachment |
no outgoing calls
no test coverage detected