MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / getAllModesWithPrompts

Function getAllModesWithPrompts

src/shared/modes.ts:161–173  ·  view source on GitHub ↗
(context: vscode.ExtensionContext)

Source from the content-addressed store, hash-verified

159
160// Helper function to get all modes with their prompt overrides from extension state
161export 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
176export async function getFullModeDetails(

Callers 1

getModesSectionFunction · 0.90

Calls 1

getAllModesFunction · 0.85

Tested by

no test coverage detected