/** * Persistence for Observational Memory entries. * * Owner-scoped throughout: every read and write takes an `ownerEmail` and the * SQL always filters by it, so the ownable table is never read or written * cross-owner (per the `security` skill). Dialect-agnostic — only `getDbExec()` * and parameterized SQL, never raw SQLite/Postgres types or string interpolation * of user data. * * `ensureTable()` lazily creates the table on first use (the same belt-and- * suspenders pattern as `chat-threads/store.ts`), so OM works in tests and at * runtime even before the migration plugin is registered. */ import type { ObservationalMemoryEntry, ObservationalMemoryOwner, ObservationalMemoryTier } from "./types.js"; /** Reset the cached ensureTable promise — test-only seam. */ export declare function __resetObservationalMemoryTableCache(): void; export interface InsertObservationalMemoryInput extends ObservationalMemoryOwner { threadId: string; tier: ObservationalMemoryTier; text: string; tokenEstimate: number; sourceStartIndex?: number | null; sourceEndIndex?: number | null; sourceMessageCount?: number; visibility?: "private" | "org" | "public"; } /** Insert one OM entry, returning the persisted row. */ export declare function insertObservationalMemory(input: InsertObservationalMemoryInput): Promise; export interface ListObservationalMemoryOptions extends ObservationalMemoryOwner { threadId: string; /** When set, only entries of this tier are returned. */ tier?: ObservationalMemoryTier; } /** * List a thread's OM entries for an owner, oldest → newest. Always * owner-scoped; `org_id` is matched too when supplied so org-visible rows * don't leak across orgs. */ export declare function listObservationalMemory(options: ListObservationalMemoryOptions): Promise; /** * The highest source-message index already folded into an observation for this * thread/owner, or -1 if none. The Observer uses this to know which messages * are still unobserved. */ export declare function getObservedThroughIndex(options: ObservationalMemoryOwner & { threadId: string; }): Promise; /** Sum the token estimates of a thread's observation entries for an owner. */ export declare function getObservationLogTokens(options: ObservationalMemoryOwner & { threadId: string; }): Promise; //# sourceMappingURL=store.d.ts.map