/** * [WHO]: AppKeybinding, KeybindingsManager, KeybindingsConfig * [FROM]: Depends on tui, node:fs, node:path, config * [TO]: Consumed by main.ts, cli/session-picker.ts, modes/interactive/interactive-mode.ts, modes/interactive/components/session-selector.ts, modes/interactive/components/custom-editor.ts, modes/interactive/components/extension-editor.ts, modes/interactive/components/keybinding-hints.ts * [HERE]: core/platform/keybindings.ts - application-level keybindings management */ import { type EditorAction, type KeyId } from "@catui/tui"; import { type AgentDirContext } from "../agent-dir/agent-dir-context.js"; /** * Application-level actions (coding agent specific). */ export type AppAction = "interrupt" | "showResources" | "clear" | "exit" | "suspend" | "cycleThinkingLevel" | "cycleModelForward" | "cycleModelBackward" | "selectModel" | "selectProviderThenModel" | "expandTools" | "toggleThinking" | "toggleSessionNamedFilter" | "externalEditor" | "followUp" | "dequeue" | "pasteImage" | "newSession" | "tree" | "fork" | "resume"; /** * All configurable actions. */ export type KeyAction = AppAction | EditorAction; /** * Full keybindings configuration (app + editor actions). */ export type KeybindingsConfig = { [K in KeyAction]?: KeyId | KeyId[]; }; /** * Default application keybindings. */ export declare const DEFAULT_APP_KEYBINDINGS: Record; /** * All default keybindings (app + editor). */ export declare const DEFAULT_KEYBINDINGS: Required; /** * Manages all keybindings (app + editor). */ export declare class KeybindingsManager { private config; private appActionToKeys; private constructor(); /** * Create from config file and set up editor keybindings. */ static create(ctx?: AgentDirContext): KeybindingsManager; /** * Create in-memory. */ static inMemory(config?: KeybindingsConfig): KeybindingsManager; private static loadFromFile; private buildMaps; /** * Check if input matches an app action. */ matches(data: string, action: AppAction): boolean; /** * Get keys bound to an app action. */ getKeys(action: AppAction): KeyId[]; /** * Get the full effective config. */ getEffectiveConfig(): Required; } export type { EditorAction, KeyId };