import { FactoryStorageDomain } from '@mastra/core/storage'; import type { CollectionSchema } from '@mastra/core/storage'; /** * A user's persisted memory (observational-memory) configuration. The * DB-backed tenant counterpart of the local `settings.json` OM fields * (`observerModelOverride`, `reflectorModelOverride`, `omObservationThreshold`, * `omReflectionThreshold`, `omObserveAttachments`): one row per `(org, user)`, * every knob nullable so only explicitly-changed values are stored. */ export interface MemorySettingsRecord { orgId: string; userId: string; observerModelId: string | null; reflectorModelId: string | null; observationThreshold: number | null; reflectionThreshold: number | null; observeAttachments: 'auto' | boolean | null; createdAt: Date; updatedAt: Date; } /** Partial update — only the provided knobs are written. */ export interface MemorySettingsPatch { observerModelId?: string; reflectorModelId?: string; observationThreshold?: number; reflectionThreshold?: number; observeAttachments?: 'auto' | boolean; } /** * Knobs written only when the stored value is still unset (`NULL`). The check * happens inside the backend's atomic-update primitive, so a concurrent * explicit write to the same knob is never clobbered by a fill. */ export interface MemorySettingsFillIfUnset { observerModelId?: string; reflectorModelId?: string; } /** * Sentinel `user_id` for a factory project's shared memory settings. Factory * runs are org-shared, so their OM configuration lives on the project — this * key reuses the same `(org, user)` table without a schema change. Real user * ids are WorkOS ids (`user_…`) or the `local` sentinel, so the prefix cannot * collide. */ export declare function factoryMemorySettingsUserId(factoryProjectId: string): string; export declare const MEMORY_SETTINGS_SCHEMA: CollectionSchema; export declare class MemorySettingsStorage extends FactoryStorageDomain { #private; constructor(); init(): Promise; dangerouslyClearAll(): Promise; get({ orgId, userId }: { orgId: string; userId: string; }): Promise; /** * Upsert the user's row, writing only the knobs present in `patch`. * `fillIfUnset` knobs are written only where the stored value is still * `NULL`, decided inside the atomic update so concurrent explicit writes * win over fills. Concurrent first writes are resolved via the shared * insert-then-catch-unique-violation pattern (see `queue_health`). */ patch({ orgId, userId, patch, fillIfUnset, }: { orgId: string; userId: string; patch: MemorySettingsPatch; fillIfUnset?: MemorySettingsFillIfUnset; }): Promise; } //# sourceMappingURL=base.d.ts.map