/** * The LLM-facing `search_memory` tool — the explicit-query half of the memory * read surface. `preloadMemoryContext` is the other half: automatic, * facts-only, injected every turn. This tool is model-initiated and reaches * every extractor the agent declares, not just `facts`. * * Mirrors `memoryBlockTool.ts`'s addressing pattern exactly: the model's * `slug` argument is a `z.enum` built from the extractors the agent declares, * so an undeclared slug is not rejected at runtime, it cannot be expressed. * `ExtractedValueStore` has no `list()` (deliberately — enumerating every * value for an owner is exactly what a leak looks like), and the enum is what * makes that unnecessary: this tool loads exactly the declared slugs and * never asks the store what else is there. */ import { z } from 'zod'; import type { AiSdkTool } from '../../tools/Tool.js'; import type { MemoryBlockScope } from '../blocks/types.js'; import type { ExtractedValueStore } from './store.js'; import type { AnyResolvedExtractor } from './types.js'; export interface SearchMemoryToolOptions { store: ExtractedValueStore; /** The extractors this agent declares. The model can search these and nothing else. * Heterogeneous — see `AnyResolvedExtractor`. */ extractors: AnyResolvedExtractor[]; /** Owner for a scope, or undefined when this session has none. * There is deliberately no placeholder — see `resolveWorkingMemoryOwner`. */ resolveOwner: (scope: MemoryBlockScope) => string | undefined; /** Max entries returned. Default 10, matching preloadMemoryContext. */ limit?: number; } declare function buildInputSchema(slugs: [string, ...string[]]): z.ZodObject<{ query: z.ZodString; slug: z.ZodOptional>; }, z.core.$strip>; type Input = z.infer>; interface SearchMemoryResult { slug: string; entry: string; score: number; } export declare function buildSearchMemoryTool(options: SearchMemoryToolOptions): AiSdkTool; export {};