import type { Database } from "../data/memory/schema.js"; import type { IThreadRepository, ISessionRepository } from "../data/interfaces.js"; export declare enum ThreadState { Created = "created", Spawning = "spawning", Active = "active", Dormant = "dormant", Stuck = "stuck", Exiting = "exiting", Exited = "exited", Archived = "archived", Expired = "expired" } type ThreadRecord = NonNullable>; type RegisterThreadInput = Parameters[1] & { chatId?: string; aliases?: string[]; telegramTopicId?: number | null; }; type ActivateThreadInput = Partial>; type TouchThreadInput = Partial>; type RemapTopicInput = { threadId: number; chatId: string; topicName: string; telegramTopicId: number; aliases?: string[]; }; export interface ThreadLifecycleTelegramGateway { sendMessage(chatId: string, text: string, parseMode?: string, threadId?: number): Promise; } export interface ThreadLifecycleLogger { info(message: string): void; warn(message: string): void; } export declare class ThreadLifecycleService { private readonly threadRepository; private readonly sessionRepository; private readonly telegramGateway; private readonly logger; constructor(threadRepository: IThreadRepository, sessionRepository: ISessionRepository, telegramGateway: ThreadLifecycleTelegramGateway, logger: ThreadLifecycleLogger); registerThread(db: Database, entry: RegisterThreadInput): ThreadRecord; activateThread(db: Database, threadId: number, updates?: ActivateThreadInput): ThreadRecord; touchThread(db: Database, threadId: number, updates?: TouchThreadInput): ThreadRecord; markExited(db: Database, threadId: number): ThreadRecord; archiveThread(db: Database, threadId: number): ThreadRecord; remapTopic(db: Database, input: RemapTopicInput): ThreadRecord; getThreadState(db: Database, threadId: number): ThreadState | null; transitionThread(db: Database, threadId: number, targetState: ThreadState): ThreadRecord; private requireThread; private assertTransition; private syncTopicMappings; private toLifecycleState; private toPersistedState; } export {}; //# sourceMappingURL=thread-lifecycle.service.d.ts.map