import type { ChatLogRecord, ConversationStatus, DispatchableJob, InboundMessageInput, InboundMessageRecord, ResolvedConversation } from "./types.ts";
export declare class ConversationRuntime {
    readonly conversation: ResolvedConversation;
    private readonly ownerId;
    private records;
    private nextRecordId;
    private pendingJobs;
    private activeJob;
    private armedAfterRecordId;
    constructor(conversation: ResolvedConversation, ownerId: string);
    static connect(conversation: ResolvedConversation, ownerId: string): Promise<ConversationRuntime>;
    private initialize;
    armAfterCurrentTail(): void;
    isArmed(): boolean;
    disconnect(): Promise<void>;
    private appendRecord;
    private getLastQueuedTriggerRecordId;
    private getLastCompletedTriggerRecordId;
    private isAllowedInput;
    private isAllowedMessage;
    parseControlCommand(input: InboundMessageInput): "stop" | "new" | "compact" | "status" | "help" | undefined;
    matchesStopCommand(input: InboundMessageInput): boolean;
    private shouldTriggerJob;
    private shouldQueueTrigger;
    getLastCheckpoint(): {
        cursor?: string;
        messageId?: string;
    };
    noteCheckpoint(checkpoint: {
        cursor?: string;
        messageId?: string;
    }): Promise<void>;
    ingestInbound(input: InboundMessageInput, checkpoint?: {
        cursor?: string;
        messageId?: string;
    }): Promise<{
        record: InboundMessageRecord;
        jobQueued: boolean;
    }>;
    beginNextJob(): DispatchableJob | undefined;
    private buildPrompt;
    /**
     * Directly queue a proactive (nudge) job without an inbound user message.
     * Returns false if there is already an active job or pending jobs in the queue.
     */
    queueProactiveJob(prompt: string): boolean;
    completeActiveJob(text: string, remoteMessageId?: string, attachmentPaths?: string[]): Promise<void>;
    failActiveJob(error: string): Promise<void>;
    appendError(message: string): Promise<void>;
    findHistory(options: {
        query?: string;
        after?: string;
        before?: string;
        limit?: number;
    }): Array<ChatLogRecord>;
    getStatus(): ConversationStatus;
}
//# sourceMappingURL=runtime.d.ts.map