import type { Database } from "../data/database.js"; import { type AttachmentLocation } from "../files/attachments.js"; import { type ConversationIdentity } from "./conversations.js"; import { type MemberCursorConfirmation } from "./cursors.js"; import { type Message } from "./messages.js"; export interface UnreadSummary { total: number; shown: number; firstSeq: number | null; lastSeq: number | null; fromSeq: number; senders: Array<{ name: string; count: number; }>; taskEvents: number; knowledgeEvents: number; } export interface ChatContextSnapshot { sourceRef: string; kind: ConversationIdentity["kind"]; chatName: string; chatShortId: string | null; lastRead: number | null; trigger: Message; replyTarget: Message | null; unread: UnreadSummary | null; attachmentLocation: AttachmentLocation; cursor: MemberCursorConfirmation | null; replyExpected: boolean; } export interface PreparedAgentInput { prompt: string; trigger: "chat-message"; replySources: string[]; } /** Capture all SQL-backed chat context while the message/admission transaction * is open. The returned snapshot contains no live lookups. */ export declare function captureChatContext(db: Database, input: { scopeId: string; memberId: string; messageId: string; replyExpected: boolean; unreadLimit?: number; }): ChatContextSnapshot; /** Application-owned display identity; chat rendering never reads configuration. */ export declare function connectChatUserDisplayName(read: () => string): () => void; /** Message bytes, identity, reply target, attachment paths, chat short id and * last_read were frozen in the snapshot; the app supplies the user display name. * One chat_message element per delivered message (spec unified-user-prompt * v1.7); the queue dispatches one input per turn, so no batch wrapper. */ export declare function renderChatInput(snapshot: ChatContextSnapshot): PreparedAgentInput; //# sourceMappingURL=context.d.ts.map