(_input, context)
| 75 | renderToolResultMessage, |
| 76 | renderToolUseRejectedMessage, |
| 77 | async call(_input, context) { |
| 78 | if (context.agentId) { |
| 79 | throw new Error('EnterPlanMode tool cannot be used in agent contexts') |
| 80 | } |
| 81 | |
| 82 | const appState = context.getAppState() |
| 83 | handlePlanModeTransition(appState.toolPermissionContext.mode, 'plan') |
| 84 | |
| 85 | // Update the permission mode to 'plan'. prepareContextForPlanMode runs |
| 86 | // the classifier activation side effects when the user's defaultMode is |
| 87 | // 'auto' — see permissionSetup.ts for the full lifecycle. |
| 88 | context.setAppState(prev => ({ |
| 89 | ...prev, |
| 90 | toolPermissionContext: applyPermissionUpdate( |
| 91 | prepareContextForPlanMode(prev.toolPermissionContext), |
| 92 | { type: 'setMode', mode: 'plan', destination: 'session' }, |
| 93 | ), |
| 94 | })) |
| 95 | |
| 96 | return { |
| 97 | data: { |
| 98 | message: |
| 99 | 'Entered plan mode. You should now focus on exploring the codebase and designing an implementation approach.', |
| 100 | }, |
| 101 | } |
| 102 | }, |
| 103 | mapToolResultToToolResultBlockParam({ message }, toolUseID) { |
| 104 | const instructions = isPlanModeInterviewPhaseEnabled() |
| 105 | ? `${message} |
nothing calls this directly
no test coverage detected