(state: SessionState, config: PluginConfig)
| 42 | } |
| 43 | |
| 44 | export function formatHelpMessage(state: SessionState, config: PluginConfig): string { |
| 45 | const commands = getVisibleCommands(state, config) |
| 46 | const colWidth = Math.max(...commands.map(([cmd]) => cmd.length)) + 4 |
| 47 | const lines: string[] = [] |
| 48 | |
| 49 | lines.push("╭─────────────────────────────────────────────────────────────────────────╮") |
| 50 | lines.push("│ DCP Commands │") |
| 51 | lines.push("╰─────────────────────────────────────────────────────────────────────────╯") |
| 52 | lines.push("") |
| 53 | lines.push(` ${"Manual mode:".padEnd(colWidth)}${state.manualMode ? "ON" : "OFF"}`) |
| 54 | lines.push("") |
| 55 | lines.push(" Open the command palette for DCP modal commands.") |
| 56 | lines.push(" Use /dcp-compress [focus] when you want DCP to ask the model to run compression.") |
| 57 | lines.push("") |
| 58 | for (const [cmd, desc] of commands) { |
| 59 | lines.push(` ${cmd.padEnd(colWidth)}${desc}`) |
| 60 | } |
| 61 | lines.push("") |
| 62 | |
| 63 | return lines.join("\n") |
| 64 | } |
| 65 | |
| 66 | export async function handleHelpCommand(ctx: HelpCommandContext): Promise<void> { |
| 67 | const { client, state, logger, sessionId, messages } = ctx |
no test coverage detected