(context: vscode.ExtensionContext)
| 159 | |
| 160 | // Helper function to get all modes with their prompt overrides from extension state |
| 161 | export async function getAllModesWithPrompts(context: vscode.ExtensionContext): Promise<ModeConfig[]> { |
| 162 | const customModes = (await context.globalState.get<ModeConfig[]>("customModes")) || [] |
| 163 | const customModePrompts = (await context.globalState.get<CustomModePrompts>("customModePrompts")) || {} |
| 164 | |
| 165 | const allModes = getAllModes(customModes) |
| 166 | return allModes.map((mode) => ({ |
| 167 | ...mode, |
| 168 | roleDefinition: customModePrompts[mode.slug]?.roleDefinition ?? mode.roleDefinition, |
| 169 | whenToUse: customModePrompts[mode.slug]?.whenToUse ?? mode.whenToUse, |
| 170 | customInstructions: customModePrompts[mode.slug]?.customInstructions ?? mode.customInstructions, |
| 171 | // description is not overridable via customModePrompts, so we keep the original |
| 172 | })) |
| 173 | } |
| 174 | |
| 175 | // Helper function to get complete mode details with all overrides |
| 176 | export async function getFullModeDetails( |
no test coverage detected