import type { MastraDBMessage } from '@mastra/core/agent'; import type { MemoryConfigInternal } from '@mastra/core/memory'; export type RecallDetail = 'low' | 'high'; type RecallThread = { id: string; title?: string; resourceId: string; createdAt: Date; updatedAt: Date; }; type RecallSearchResult = { threadId: string; score: number; groupId?: string; range?: string; text?: string; observedAt?: Date; }; type RecallMemory = { getMemoryStore: () => Promise<{ listMessagesById: (args: { messageIds: string[]; }) => Promise<{ messages: MastraDBMessage[]; }>; }>; recall: (args: { threadId: string; resourceId?: string; page: number; perPage: number | false; orderBy?: { field: 'createdAt'; direction: 'ASC' | 'DESC'; }; filter?: { dateRange?: { start?: Date; end?: Date; startExclusive?: boolean; endExclusive?: boolean; }; }; }) => Promise<{ messages: MastraDBMessage[]; total: number; page: number; perPage: number | false; hasMore: boolean; }>; listThreads: (args: { perPage?: number | false; page?: number; orderBy?: { field: string; direction: 'ASC' | 'DESC'; }; filter?: { resourceId?: string; metadata?: Record; }; }) => Promise<{ threads: RecallThread[]; total: number; hasMore: boolean; page: number; }>; searchMessages?: (args: { query: string; resourceId: string; topK?: number; filter?: { threadId?: string; observedAfter?: Date; observedBefore?: Date; }; }) => Promise<{ results: RecallSearchResult[]; }>; getThreadById?: (args: { threadId: string; }) => Promise; }; export declare function listThreadsForResource({ memory, resourceId, currentThreadId, page, limit, before, after, }: { memory: RecallMemory; resourceId: string; currentThreadId: string; page?: number; limit?: number; before?: string; after?: string; }): Promise<{ threads: string; count: number; page: number; hasMore: boolean; }>; export declare function searchMessagesForResource({ memory, resourceId, currentThreadId, query, topK, maxTokens, before, after, threadScope, }: { memory: RecallMemory; resourceId: string; currentThreadId?: string; query: string; topK?: number; maxTokens?: number; before?: string; after?: string; /** When set, restrict search results to only this thread */ threadScope?: string; }): Promise<{ results: string; count: number; }>; export declare function recallPart({ memory, threadId, resourceId, cursor, partIndex, threadScope, maxTokens, }: { memory: RecallMemory; threadId: string; resourceId?: string; cursor: string; partIndex: number; threadScope?: string; maxTokens?: number; }): Promise<{ text: string; messageId: string; partIndex: number; role: string; type: string; truncated: boolean; }>; export interface RecallResult { messages: string; count: number; cursor: string; page: number; limit: number; detail: RecallDetail; hasNextPage: boolean; hasPrevPage: boolean; truncated: boolean; tokenOffset: number; } export declare function recallMessages({ memory, threadId, resourceId, cursor, page, limit, detail, partType, toolName, threadScope, maxTokens, }: { memory: RecallMemory; threadId: string; resourceId?: string; cursor: string; page?: number; limit?: number; detail?: RecallDetail; partType?: 'text' | 'tool-call' | 'tool-result' | 'reasoning' | 'image' | 'file'; toolName?: string; threadScope?: string; maxTokens?: number; }): Promise; export declare function recallThreadFromStart({ memory, threadId, resourceId, page, limit, detail, partType, toolName, anchor, maxTokens, }: { memory: RecallMemory; threadId: string; resourceId?: string; page?: number; limit?: number; detail?: RecallDetail; partType?: 'text' | 'tool-call' | 'tool-result' | 'reasoning' | 'image' | 'file'; toolName?: string; anchor?: 'start' | 'end'; maxTokens?: number; }): Promise; export declare const recallTool: (_memoryConfig?: MemoryConfigInternal, options?: { retrievalScope?: "thread" | "resource"; }) => import("@mastra/core/tools").Tool<{ query?: string | undefined; cursor?: string | undefined; anchor?: "start" | "end" | undefined; page?: number | undefined; limit?: number | undefined; detail?: "low" | "high" | undefined; partType?: "text" | "reasoning" | "file" | "image" | "tool-call" | "tool-result" | undefined; toolName?: string | undefined; partIndex?: number | undefined; mode?: "messages" | "search" | "threads" | undefined; }, unknown, unknown, unknown, import("@mastra/core/tools").ToolExecutionContext, "recall", unknown>; export {}; //# sourceMappingURL=om-tools.d.ts.map