import { type AssertPurgeAllowed, type LifecycleHostStep, type UserDataLifecycle, type UserDataLifecycleAdapter } from "./lifecycle"; /** * Minimal transaction boundary required by the durable lifecycle runtime. * Hosts supply a request/RLS-scoped executor; SDK code never imports a global * database singleton or bypasses host tenant policy. */ export type LifecycleScopedDatabaseExecutor = (context: Readonly<{ actorUserId: string; requestId: string; signal?: AbortSignal; }>, operation: () => Promise) => Promise; /** * Public persistent lifecycle composition contract. The OSS persistence * saga is supplied by the backend runtime; external hosts attach their own steps * and RLS executor without private imports. */ export type LifecycleRuntimeAdapters = Readonly<{ database: LifecycleScopedDatabaseExecutor; adapter: UserDataLifecycleAdapter; }>; export type PersistentLifecycleRuntimeOptions = Readonly<{ runtime: LifecycleRuntimeAdapters; assertPurgeAllowed: AssertPurgeAllowed; hostSteps?: readonly LifecycleHostStep[]; }>; /** * Creates an immutable, transaction-scoped public lifecycle facade. * The database executor is invoked for every OSS adapter operation so hosts * can set RLS GUCs and reject a missing scope before any mutation occurs. */ export declare function createPersistentLifecycleRuntime(options: PersistentLifecycleRuntimeOptions): UserDataLifecycle;