/** * [WHO]: Provides InputSubmitController + InputSubmitContext — editor submit pipeline orchestration * [FROM]: Depends on @catui/ai content types, AgentSession prompt options, image pipeline attachment type * [TO]: Consumed by modes/interactive/interactive-mode.ts as the default editor onSubmit handler * [HERE]: modes/interactive/controllers/input-submit-controller.ts — P5 input-submit slice (UI06, rewrite) * * Owns submit classification and ordering only. Slash dispatch, image/attachment processing, bash execution, * session prompt/steer, and rendering details are delegated through ports. */ import type { ImageContent, Model, TextContent } from "@catui/ai/types"; import type { PromptOptions } from "../../../core/runtime/agent-session.js"; import type { Attachment } from "./image-pipeline-controller.js"; type AnyModel = Model; export interface InputSubmitEditorPort { setText(text: string): void; addToHistory(text: string): void; handleExternalInput(text: string): boolean; setBashMode(enabled: boolean): void; updateBorderColor(): void; } export interface InputSubmitSlashPort { execute(text: string): Promise; } export interface InputSubmitImagePort { awaitPendingPaste(): Promise; extractImagesFromText(text: string): Promise<{ text: string; images: ImageContent[]; }>; takePendingAttachments(): Attachment[]; processAttachmentFiles(attachments: Attachment[]): Promise; cleanupClipboardImages(): void; } export interface InputSubmitSessionPort { isBashRunning(): boolean; isCompacting(): boolean; isStreaming(): boolean; getModel(): AnyModel | undefined; getCwd(): string; promptAfterRender(text: string, options?: PromptOptions): Promise; queueCompactionMessage(text: string, mode: "steer" | "followUp"): void; } export interface InputSubmitCommandPort { isExtensionCommand(text: string): boolean; handlePersonaCommand(text: string): Promise; handleBashCommand(command: string, excludeFromContext: boolean): Promise; } export interface InputSubmitRenderPort { showStatus(message: string): void; showWarning(message: string): void; showError(message: string): void; notify(message: string, options?: { key?: string; priority?: "immediate" | "high" | "medium" | "low"; type?: "info" | "warning" | "error"; duration?: number; }): void; requestRender(): void; flushPendingBashComponents(): void; updatePendingMessagesDisplay(): void; addOptimisticUserMessage(text: string, content: Array): void; rollbackFirstOptimisticUserMessageIfMatches(text: string): void; } export interface InputSubmitContext { editor: InputSubmitEditorPort; slash: InputSubmitSlashPort; image: InputSubmitImagePort; session: InputSubmitSessionPort; commands: InputSubmitCommandPort; render: InputSubmitRenderPort; } export declare class InputSubmitController { private readonly ctx; constructor(ctx: InputSubmitContext); handleSubmit(rawText: string): Promise; private handleStreamingSubmit; private handleIdleSubmit; private imageSupportSuggestion; } export {};