import type { InstanceAiEnsureThreadResponse, InstanceAiRichMessagesResponse, InstanceAiThreadInfo, InstanceAiThreadListResponse, InstanceAiThreadMessagesResponse } from '@n8n/api-types'; import { Logger } from '@n8n/backend-common'; import { GlobalConfig } from '@n8n/config'; import { type AgentTreeSnapshot } from '@n8n/instance-ai'; import { DbSnapshotStorage } from './storage/db-snapshot-storage'; import { InstanceAiCheckpointRepository } from './repositories/instance-ai-checkpoint.repository'; import { InstanceAiPendingConfirmationRepository } from './repositories/instance-ai-pending-confirmation.repository'; import { TypeORMAgentMemory } from './storage/typeorm-agent-memory'; export declare class InstanceAiMemoryService { private readonly logger; private readonly agentMemory; private readonly dbSnapshotStorage; private readonly checkpointRepository; private readonly pendingConfirmationRepository; private readonly instanceAiConfig; constructor(logger: Logger, globalConfig: GlobalConfig, agentMemory: TypeORMAgentMemory, dbSnapshotStorage: DbSnapshotStorage, checkpointRepository: InstanceAiCheckpointRepository, pendingConfirmationRepository: InstanceAiPendingConfirmationRepository); listThreads(userId: string, page?: number, perPage?: number): Promise; ensureThread(userId: string, threadId: string, projectId: string): Promise; getThreadMessages(_userId: string, threadId: string, options?: { limit?: number; page?: number; }): Promise; getRichMessages(_userId: string, threadId: string, options?: { limit?: number; page?: number; excludeRunIds?: string[]; }): Promise>; private flagExpiredConfirmations; private loadInFlightCheckpointMessages; getLatestRunSnapshot(threadId: string, options?: { messageGroupId?: string; runId?: string; }): Promise; validateThreadOwnership(userId: string, threadId: string): Promise; checkThreadOwnership(userId: string, threadId: string): Promise<'owned' | 'not_found' | 'other_user'>; deleteThread(threadId: string): Promise; renameThread(threadId: string, title: string): Promise; updateThread(threadId: string, updates: { title?: string; metadata?: Record; }): Promise; getThreadMetadata(userId: string, threadId: string): Promise | undefined>; cleanupExpiredThreads(onThreadDeleted?: (threadId: string) => Promise): Promise; private toThreadInfo; private toThreadMessage; }