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

Function getModesSection

src/core/prompts/sections/modes.ts:8–35  ·  view source on GitHub ↗
(context: vscode.ExtensionContext)

Source from the content-addressed store, hash-verified

6import { ensureSettingsDirectoryExists } from "../../../utils/globalContext"
7
8export async function getModesSection(context: vscode.ExtensionContext): Promise<string> {
9 // Make sure path gets created
10 await ensureSettingsDirectoryExists(context)
11
12 // Get all modes with their overrides from extension state
13 const allModes = await getAllModesWithPrompts(context)
14
15 const modesContent = `====
16
17MODES
18
19- These are the currently available modes:
20${allModes
21 .map((mode: ModeConfig) => {
22 let description: string
23 if (mode.whenToUse && mode.whenToUse.trim() !== "") {
24 // Use whenToUse as the primary description, indenting subsequent lines for readability
25 description = mode.whenToUse.replace(/\n/g, "\n ")
26 } else {
27 // Fallback to the first sentence of roleDefinition if whenToUse is not available
28 description = mode.roleDefinition.split(".")[0]
29 }
30 return ` * "${mode.name}" mode (${mode.slug}) - ${description}`
31 })
32 .join("\n")}`
33
34 return modesContent
35}

Callers 1

generatePromptFunction · 0.90

Calls 3

getAllModesWithPromptsFunction · 0.90
replaceMethod · 0.65

Tested by

no test coverage detected