import type pino from "pino";
import { type ChatMessage, type ChatRoomDetail } from "./chat-types.js";
export declare function parseMentionAgentIds(body: string): string[];
export declare class ChatServiceError extends Error {
    readonly code: string;
    constructor(code: string, message: string);
}
export interface CreateChatRoomInput {
    name: string;
    purpose?: string | null;
}
export interface InspectChatRoomInput {
    room: string;
}
export interface DeleteChatRoomInput {
    room: string;
}
export interface PostChatMessageInput {
    room: string;
    authorAgentId: string;
    body: string;
    replyToMessageId?: string | null;
}
export interface ReadChatMessagesInput {
    room: string;
    limit?: number;
    since?: string;
    authorAgentId?: string;
}
export interface WaitForChatMessagesInput {
    room: string;
    afterMessageId?: string | null;
    timeoutMs?: number;
}
export interface DeleteChatRoomResult {
    room: ChatRoomDetail;
}
export interface InspectChatRoomResult {
    room: ChatRoomDetail;
}
export declare class FileBackedChatService {
    private readonly filePath;
    private readonly logger;
    private loaded;
    private readonly rooms;
    private readonly messagesByRoomId;
    private persistQueue;
    private readonly waitersByRoomId;
    constructor(options: {
        seaworkHome: string;
        logger: pino.Logger;
    });
    initialize(): Promise<void>;
    createRoom(input: CreateChatRoomInput): Promise<ChatRoomDetail>;
    listRooms(): Promise<ChatRoomDetail[]>;
    inspectRoom(input: InspectChatRoomInput): Promise<InspectChatRoomResult>;
    deleteRoom(input: DeleteChatRoomInput): Promise<DeleteChatRoomResult>;
    postMessage(input: PostChatMessageInput): Promise<ChatMessage>;
    readMessages(input: ReadChatMessagesInput): Promise<ChatMessage[]>;
    waitForMessages(input: WaitForChatMessagesInput): Promise<ChatMessage[]>;
    private load;
    private enqueuePersist;
    private persist;
    private findRoomByName;
    private resolveRoom;
    private getRoomMessages;
    private toRoomDetail;
    private normalizeLimit;
    private selectMessagesAfter;
    private notifyWaiters;
    private removeWaiter;
    private rejectWaiters;
}
//# sourceMappingURL=chat-service.d.ts.map