* Forward an ACP `session/set_mode` request to the underlying SDK * session. * * Phase 12.2 supports the full 4-mode taxonomy (PLAN D9 at * `PLAN.md:85-106`): * * - `'default'` → `setPlanMode(false)` + `setPermission('manual')` * - `'plan'` → `setPlanMode(true)` + `setPerm
(modeId: SessionModeId)
| 438 | * will see the rejection and can re-query state). |
| 439 | */ |
| 440 | async setMode(modeId: SessionModeId): Promise<void> { |
| 441 | if (!isAcpModeId(modeId)) { |
| 442 | throw RequestError.invalidParams({ modeId }, `Unknown sessionModeId: ${modeId}`); |
| 443 | } |
| 444 | const { plan, permission } = acpModeToToggles(modeId); |
| 445 | await this.session.setPlanMode(plan); |
| 446 | await this.session.setPermission(permission); |
| 447 | this.currentModeIdInternal = modeId; |
| 448 | await this.emitConfigOptionUpdate(); |
| 449 | } |
| 450 | |
| 451 | /** |
| 452 | * Push a `config_option_update` session notification carrying the |
no test coverage detected