import { z } from "zod"; import type * as smoltalk from "smoltalk"; import { MemoryGraph } from "./graph.js"; export declare const ExtractionResultSchema: z.ZodObject<{ entities: z.ZodArray; }, z.core.$strip>>; relations: z.ZodArray>; expirations: z.ZodArray>; }, z.core.$strip>; export type ExtractionResult = z.infer; /** * Validate that an LLM extraction response has the shape we expect. * Returns null on JSON-parse failure or schema mismatch so the caller * can safely skip rather than throw. */ export declare function parseExtractionResult(text: string): ExtractionResult | null; export declare function buildExtractionPrompt(messages: smoltalk.Message[], graph: MemoryGraph): string; /** * One newly-added observation. `entityId` is captured at add-time * (the entity is in scope where `addObservation` is called) so * downstream consumers — the obs→entity reverse index in * `MemoryCacheEntry` — can register the pair in O(1) instead of * scanning the whole graph to find which entity owns each obs id. */ export type NewObservation = { id: string; entityId: string; }; export type ApplyExtractionOutcome = { newObservations: NewObservation[]; expiredObservationIds: string[]; }; export declare function applyExtractionResult(graph: MemoryGraph, result: ExtractionResult, source: string): ApplyExtractionOutcome;