import type { MastraMessageContentV2 } from '@mastra/core/agent';
import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory';
import type { CreateObservationalMemoryInput, CreateReflectionGenerationInput, ObservationalMemoryRecord, StorageCloneThreadInput, StorageCloneThreadOutput, StorageListMessagesByResourceIdInput, StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsInput, StorageListThreadsOutput, StorageResourceType, SwapBufferedReflectionToActiveInput, SwapBufferedToActiveInput, SwapBufferedToActiveResult, UpdateBufferedReflectionInput, UpdateBufferedObservationsInput, UpdateActiveObservationsInput } from '@mastra/core/storage';
import { MemoryStorage } from '@mastra/core/storage';
import { InstanceAiMessageRepository } from '../repositories/instance-ai-message.repository';
import { InstanceAiObservationalMemoryRepository } from '../repositories/instance-ai-observational-memory.repository';
import { InstanceAiResourceRepository } from '../repositories/instance-ai-resource.repository';
import { InstanceAiThreadRepository } from '../repositories/instance-ai-thread.repository';
export declare class TypeORMMemoryStorage extends MemoryStorage {
    private readonly threadRepo;
    private readonly messageRepo;
    private readonly resourceRepo;
    private readonly omRepo;
    readonly supportsObservationalMemory = true;
    private static readonly threadMutationQueues;
    constructor(threadRepo: InstanceAiThreadRepository, messageRepo: InstanceAiMessageRepository, resourceRepo: InstanceAiResourceRepository, omRepo: InstanceAiObservationalMemoryRepository);
    dangerouslyClearAll(): Promise<void>;
    getThreadById({ threadId }: {
        threadId: string;
    }): Promise<StorageThreadType | null>;
    listThreads(args: StorageListThreadsInput): Promise<StorageListThreadsOutput>;
    saveThread({ thread, }: {
        thread: StorageThreadType;
    }): Promise<StorageThreadType>;
    updateThread({ id, title, metadata, }: {
        id: string;
        title: string;
        metadata: Record<string, unknown>;
    }): Promise<StorageThreadType>;
    patchThread({ threadId, update, }: {
        threadId: string;
        update: (current: StorageThreadType) => {
            title?: string;
            metadata?: Record<string, unknown>;
        } | null | undefined;
    }): Promise<StorageThreadType | null>;
    deleteThread({ threadId }: {
        threadId: string;
    }): Promise<void>;
    private toStorageThread;
    private serializeThreadMutation;
    listMessages(args: StorageListMessagesInput): Promise<StorageListMessagesOutput>;
    private getIncludedMessages;
    listMessagesByResourceId(args: StorageListMessagesByResourceIdInput): Promise<StorageListMessagesOutput>;
    listMessagesById({ messageIds, }: {
        messageIds: string[];
    }): Promise<{
        messages: MastraDBMessage[];
    }>;
    saveMessages({ messages, }: {
        messages: MastraDBMessage[];
    }): Promise<{
        messages: MastraDBMessage[];
    }>;
    updateMessages({ messages, }: {
        messages: Array<Partial<Omit<MastraDBMessage, 'createdAt'>> & {
            id: string;
            content?: {
                metadata?: MastraMessageContentV2['metadata'];
                content?: MastraMessageContentV2['content'];
            };
        }>;
    }): Promise<MastraDBMessage[]>;
    deleteMessages(messageIds: string[]): Promise<void>;
    getResourceById({ resourceId, }: {
        resourceId: string;
    }): Promise<StorageResourceType | null>;
    saveResource({ resource, }: {
        resource: StorageResourceType;
    }): Promise<StorageResourceType>;
    updateResource({ resourceId, workingMemory, metadata, }: {
        resourceId: string;
        workingMemory?: string;
        metadata?: Record<string, unknown>;
    }): Promise<StorageResourceType>;
    cloneThread(args: StorageCloneThreadInput): Promise<StorageCloneThreadOutput>;
    private omLookupKey;
    private entityToOMRecord;
    getObservationalMemory(threadId: string | null, resourceId: string): Promise<ObservationalMemoryRecord | null>;
    getObservationalMemoryHistory(threadId: string | null, resourceId: string, limit?: number): Promise<ObservationalMemoryRecord[]>;
    initializeObservationalMemory(input: CreateObservationalMemoryInput): Promise<ObservationalMemoryRecord>;
    insertObservationalMemoryRecord(record: ObservationalMemoryRecord): Promise<void>;
    updateActiveObservations(input: UpdateActiveObservationsInput): Promise<void>;
    updateBufferedObservations(input: UpdateBufferedObservationsInput): Promise<void>;
    swapBufferedToActive(input: SwapBufferedToActiveInput): Promise<SwapBufferedToActiveResult>;
    createReflectionGeneration(input: CreateReflectionGenerationInput): Promise<ObservationalMemoryRecord>;
    updateBufferedReflection(input: UpdateBufferedReflectionInput): Promise<void>;
    swapBufferedReflectionToActive(input: SwapBufferedReflectionToActiveInput): Promise<ObservationalMemoryRecord>;
    setReflectingFlag(id: string, isReflecting: boolean): Promise<void>;
    setObservingFlag(id: string, isObserving: boolean): Promise<void>;
    setBufferingObservationFlag(id: string, isBuffering: boolean, lastBufferedAtTokens?: number): Promise<void>;
    setBufferingReflectionFlag(id: string, isBuffering: boolean): Promise<void>;
    clearObservationalMemory(threadId: string | null, resourceId: string): Promise<void>;
    setPendingMessageTokens(id: string, tokenCount: number): Promise<void>;
    private entityToMessage;
}
