import type { ConversationDocumentContextWire } from "@oscharko-dev/keiko-contracts";
import type { ConversationMemoryActionWire, ConversationMemoryResultWire } from "@oscharko-dev/keiko-contracts/bff-wire";
import { type Chat, type ChatMessage } from "./store/index.js";
import { type ConversationAttachment } from "./conversation-validation.js";
import type { UiHandlerDeps } from "./deps.js";
import type { RouteContext, RouteResult } from "./routes.js";
import { type ConversationMemoryRuntimeContext } from "./memory-conversation-context.js";
export interface GatewayConversationMessage {
    readonly role: "system" | "user" | "assistant";
    readonly content: string;
}
export declare function redactErrorMessage(message: string, deps: UiHandlerDeps): string;
export declare function desktopChatErrorResult(error: unknown, deps: UiHandlerDeps): RouteResult;
export interface SendDesktopChatRequest {
    readonly chatId: string;
    readonly projectPath: string;
    readonly content: string;
    readonly modelId: string | undefined;
    readonly documentContext: readonly ConversationDocumentContextWire[];
    readonly attachments: readonly ConversationAttachment[];
    readonly memory: ParsedConversationMemoryRequest | undefined;
}
interface ParsedConversationMemoryRequest {
    readonly enabled: boolean;
    readonly budgetTokens?: number;
    readonly context: Record<string, unknown>;
}
export declare function createUserMessage(deps: UiHandlerDeps, request: SendDesktopChatRequest): ChatMessage;
export declare function createAssistantMessage(deps: UiHandlerDeps, request: SendDesktopChatRequest, content: string): ChatMessage;
export declare function emptyMemoryResult(enabled: boolean): ConversationMemoryResultWire;
export declare function buildMemoryResult(request: SendDesktopChatRequest, deps: UiHandlerDeps, context: ConversationMemoryRuntimeContext): Promise<ConversationMemoryResultWire>;
export declare function collectMemoryActions(deps: UiHandlerDeps, request: SendDesktopChatRequest, memoryContext: ConversationMemoryRuntimeContext | undefined, modelId: string, assistantText: string): Promise<readonly ConversationMemoryActionWire[]>;
export declare function buildChatPatch(chat: Chat, request: SendDesktopChatRequest, modelId: string): {
    selectedModel: string;
    title?: string;
};
export declare function buildGatewayMessages(deps: UiHandlerDeps, request: SendDesktopChatRequest, memoryText: string): GatewayConversationMessage[];
export declare function handleCreateDesktopChat(ctx: RouteContext, deps: UiHandlerDeps): Promise<RouteResult>;
export interface PreparedDesktopChatSend {
    readonly request: SendDesktopChatRequest;
    readonly chat: Chat;
    readonly modelId: string;
    readonly memoryContext: ConversationMemoryRuntimeContext | undefined;
}
export declare function prepareDesktopChatSend(ctx: RouteContext, deps: UiHandlerDeps): Promise<PreparedDesktopChatSend | RouteResult>;
export declare function handleSendDesktopChat(ctx: RouteContext, deps: UiHandlerDeps): Promise<RouteResult>;
export {};
//# sourceMappingURL=chat-handlers.d.ts.map