import { Editor, type EditorOptions, type EditorTheme, type TUI } from "@earendil-works/pi-tui"; import type { AppKeybinding, KeybindingsManager } from "../../../core/keybindings.ts"; import type { AtomicWorkingLoader } from "./atomic-working-status.ts"; export interface CustomEditorOptions extends EditorOptions { promptPrefix?: string; placeholder?: string | (() => string); /** Render the streaming working status in the editor's top border. */ embedWorkingStatus?: boolean; } /** * Custom editor that handles app-level keybindings for coding-agent. */ export declare class CustomEditor extends Editor { private keybindings; private promptPrefix; private placeholder; private workingStatusIndicator; readonly embedWorkingStatus: boolean; actionHandlers: Map void>; onEscape?: () => void; onCtrlD?: () => void; onPasteImage?: () => void; /** Handler for extension-registered shortcuts. Returns true if handled. */ onExtensionShortcut?: (data: string) => boolean; constructor(tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager, options?: CustomEditorOptions); setWorkingStatusIndicator(indicator: AtomicWorkingLoader | undefined): void; setPlaceholder(placeholder: string | (() => string) | undefined): void; render(width: number): string[]; private renderPlaceholder; private renderTopBorderWithWorkingStatus; private isEditorBorderLine; private extendBorderLine; private padLine; /** * Register a handler for an app action. */ onAction(action: AppKeybinding, handler: () => void): void; /** * Buffer captured immediately before the base editor consumed an input event. * * pi-tui's `submitValue()` expands paste markers, trims, and clears the editor * before it calls `onSubmit`, so the callback argument can never be the text * the user actually had. Atomic needs the pre-trim buffer to put an unaccepted * submission back exactly as typed, and 0.82.1 exposes no pre-trim hook. */ private submittedDraftSnapshot; /** Consume the buffer captured for the submission currently being dispatched. */ takeSubmittedDraft(): string | undefined; handleInput(data: string): boolean; /** * 0.86 Editor retriggers slash suggestions only for `[A-Za-z0-9._-]`. * Atomic skill selectors are `/skill:name@scope`, so `:` and `@` must keep * discovery live after the picker closed on a non-matching prefix. */ private continueSlashSkillAutocomplete; } //# sourceMappingURL=custom-editor.d.ts.map