|
|
@@ -1,20 +1,22 @@
|
|
|
import * as path from "path"
|
|
|
import * as vscode from "vscode"
|
|
|
import { promises as fs } from "fs"
|
|
|
-import { modes, ModeConfig } from "../../../shared/modes"
|
|
|
+import { ModeConfig, getAllModesWithPrompts } from "../../../shared/modes"
|
|
|
|
|
|
export async function getModesSection(context: vscode.ExtensionContext): Promise<string> {
|
|
|
const settingsDir = path.join(context.globalStorageUri.fsPath, "settings")
|
|
|
await fs.mkdir(settingsDir, { recursive: true })
|
|
|
const customModesPath = path.join(settingsDir, "cline_custom_modes.json")
|
|
|
|
|
|
+ // Get all modes with their overrides from extension state
|
|
|
+ const allModes = await getAllModesWithPrompts(context)
|
|
|
+
|
|
|
return `====
|
|
|
|
|
|
MODES
|
|
|
|
|
|
-- When referring to modes, always use their display names. The built-in modes are:
|
|
|
-${modes.map((mode: ModeConfig) => ` * "${mode.name}" mode - ${mode.roleDefinition.split(".")[0]}`).join("\n")}
|
|
|
- Custom modes will be referred to by their configured name property.
|
|
|
+- These are the currently available modes:
|
|
|
+${allModes.map((mode: ModeConfig) => ` * "${mode.name}" mode (${mode.slug}) - ${mode.roleDefinition.split(".")[0]}`).join("\n")}
|
|
|
|
|
|
- Custom modes can be configured in two ways:
|
|
|
1. Globally via '${customModesPath}' (created automatically on startup)
|