/** * Extracted command handlers from InteractiveMode. * All methods receive dependencies via CommandContext rather than * reaching back into the parent class. */ import type { Model } from "@kolisachint/hoocode-ai"; import type { EditorComponent, MarkdownTheme, TUI } from "@kolisachint/hoocode-tui"; import { type Container } from "@kolisachint/hoocode-tui"; import type { AgentSession } from "../../core/agent-session.js"; import type { AgentSessionRuntime } from "../../core/agent-session-runtime.js"; import type { KeybindingsManager } from "../../core/keybindings.js"; import { MissingSessionCwdError } from "../../core/session-cwd.js"; import type { SessionManager } from "../../core/session-manager.js"; import type { FooterComponent } from "./components/footer.js"; export interface CommandContext { session: AgentSession; sessionManager: SessionManager; runtimeHost: AgentSessionRuntime; ui: TUI; editor: EditorComponent; editorContainer: Container; chatContainer: Container; statusContainer: Container; footer: FooterComponent; keybindings: KeybindingsManager; /** What a command has to say, on the band above the prompt; gone in seconds. */ showStatus: (message: string) => void; /** * A status the transcript keeps, for the handful that carry something the * screen cannot answer for later: a share URL, a path written to. */ showRecord: (message: string) => void; /** A glimpse on the band above the prompt; gone in a few seconds. */ notify: (message: string, note?: string) => void; showError: (message: string) => void; showWarning: (message: string) => void; updateEditorBorderColor: () => void; renderCurrentSessionState: () => void; rebuildChatFromMessages: () => void; getMarkdownThemeWithSettings: () => MarkdownTheme; stopLoadingAnimation: () => void; findExactModelMatch: (searchTerm: string) => Promise | undefined>; maybeWarnAboutAnthropicSubscriptionAuth: (model?: Model) => Promise; showModelSelector: (searchTerm?: string) => void; showExtensionConfirm: (title: string, message: string) => Promise; promptForMissingSessionCwd: (error: MissingSessionCwdError) => Promise; handleFatalRuntimeError: (prefix: string, error: unknown) => Promise; } export declare class CommandExecutor { private readonly ctx; /** Where `/cd -` returns to. Set on every successful move, session-local. */ private previousCwd?; constructor(ctx: CommandContext); handleModel(searchTerm?: string): Promise; handleClone(): Promise; handleSubagent(text: string): Promise; handleExport(text: string): Promise; private getPathArgument; handleImport(text: string): Promise; handleShare(): Promise; /** * `/copy`, `/copy all`, `/copy ` — the conversation, not a picture of it. * * What is on screen is markdown already rendered: a table is box drawing, a * code block is a bordered panel, every line is wrapped to whatever width * the window happened to be. Dragging over that and pasting it into a * document pastes the drawing — dotted rules, broken table edges, and * wrapping frozen at eighty columns — because a terminal's clipboard carries * glyphs and nothing else. * * So the copy goes back to the source and puts it on the clipboard twice: * the markdown as text, and HTML for anything that takes a rich paste. Word * and Confluence then paste real headings, lists and tables; a terminal or a * commit message still gets the markdown. Which flavours landed depends on * the platform (see `copyRichToClipboard`), so the status line says. */ handleCopy(text?: string): Promise; /** The session's chip as it currently renders, for echoing back after a change. */ private currentChip; handleName(text: string): void; /** * `/color ` sets the session's chip colour directly, where a slot is a * number, a name (`green`), or a name's initial (`g`). Bare `/color` is * handled by the caller, which opens the swatch picker instead — the names * describe a hue family rather than the exact colour a theme fills the slot * with, so which one reads best here is still a thing you look at. * * The confirmation names the slot it landed on, because the aliases fold * neighbouring hues together: `/color red` answering with "magenta" is how * you learn the palette has no red of its own. */ handleColor(text: string): boolean; handleSession(): void; handleChangelog(): void; handleHotkeys(): void; handleClear(): Promise; /** * `/cd [path]` — move the whole session to another directory. * * Written for the case it exists to serve: you are done in one repo and want * to work in the next one without losing the process, its provider auth, or * its warmed model list. Bare `/cd` goes home, `/cd -` goes back to where you * came from, `~` and relative paths resolve as a shell would. * * The move starts a fresh session rooted in the target — see * `AgentSessionRuntime.changeDirectory` for why the whole runtime is rebuilt * rather than a cwd string reassigned. */ handleChangeDirectory(text: string): Promise; /** Directory completions for `/cd `, plus the two shell shorthands. */ getChangeDirectoryCompletions(argumentPrefix: string): Array<{ value: string; label: string; }>; handleDebug(): void; } //# sourceMappingURL=command-executor.d.ts.map