import type { MastraMessageContentV2 } from '@mastra/core/agent'; import type { MastraDBMessage, StorageThreadType } from '@mastra/core/memory'; import { MemoryStorage } from '@mastra/core/storage'; import type { RunFence, StorageResourceType, StorageListMessagesInput, StorageListMessagesOutput, StorageListThreadsInput, StorageListThreadsOutput, PruneOptions, PruneResult, RetentionTablesDescriptor, TableRetentionPolicy } from '@mastra/core/storage'; import type { D1DomainConfig } from '../../db/index.js'; export declare class MemoryStorageD1 extends MemoryStorage { #private; /** * Tables `prune()` can clean up. Run fences anchor on `retiredAt` (epoch ms), which stays unset until the * execution holding the fence settles, so a running execution's fence is * never pruned. */ static readonly retentionTables: RetentionTablesDescriptor; readonly supportsPartialThreadUpdate = true; constructor(config: D1DomainConfig); init(): Promise; prune(policies: Record, options?: PruneOptions): Promise; dangerouslyClearAll(): Promise; supportsRunFencing(): boolean; raiseRunFence(fence: RunFence): Promise; retireRunFence(fence: RunFence): Promise; getResourceById({ resourceId }: { resourceId: string; }): Promise; saveResource({ resource }: { resource: StorageResourceType; }): Promise; updateResource({ resourceId, workingMemory, metadata, fence, }: { resourceId: string; workingMemory?: string; metadata?: Record; fence?: RunFence; }): Promise; getThreadById({ threadId, resourceId, }: { threadId: string; resourceId?: string; }): Promise; listThreads(args: StorageListThreadsInput): Promise; saveThread({ thread, fence }: { thread: StorageThreadType; fence?: RunFence; }): Promise; updateThread({ id, title, metadata, fence, }: { id: string; title?: string; metadata?: Record; fence?: RunFence; }): Promise; deleteThread({ threadId }: { threadId: string; }): Promise; saveMessages(args: { messages: MastraDBMessage[]; fence?: RunFence; }): Promise<{ messages: MastraDBMessage[]; }>; private _sortMessages; /** * Fetches the messages named by `include` together with their surrounding context. * * @param include - Message ids to pin, each with an optional before/after window. * @param resourceId - When set, restricts both the pinned messages and their context * to that resource so an id from another resource returns nothing. */ private _getIncludedMessages; listMessagesById({ messageIds }: { messageIds: string[]; }): Promise<{ messages: MastraDBMessage[]; }>; listMessages(args: StorageListMessagesInput): Promise; updateMessages(args: { messages: Partial> & { id: string; content?: { metadata?: MastraMessageContentV2['metadata']; content?: MastraMessageContentV2['content']; }; }[]; fence?: RunFence; }): Promise; deleteMessages(messageIds: string[], options?: { fence?: RunFence; }): Promise; } //# sourceMappingURL=index.d.ts.map