import { InterruptStore, PgClientLike } from "../contracts/interrupt-store.contract.mjs"; //#region ../ai/src/human/stores/pg.d.ts /** * Options for the Postgres {@link InterruptStore}. * * Two mutually-supportive ways to supply the connection: * - **`client`** — pass an already-built `pg.Pool` / `pg.Client` (anything * satisfying {@link PgClientLike}). The store only ever calls `query` * and never opens or closes it; a single pool can back both an * orchestrator's checkpoint/snapshot stores and this interrupt table. * - **`connectionString`** — let the store lazily `import("pg")` and build * its own `Pool`. `@warlock.js/ai` takes **no** hard dependency on * `pg` (it is an optional peer); when it is absent the store throws a * curated install string at first use, never a raw module-resolution * stack trace at import. * * Exactly one of the two must be present. */ interface PgInterruptOptions { /** An already-built `pg.Pool` / `pg.Client` — anything matching {@link PgClientLike}. */ client?: PgClientLike; /** Connection string the store passes to a lazily-imported `pg.Pool`. */ connectionString?: string; /** * Backing table name. Defaults to `warlock_ai_human_interrupts`. Must be * a safe SQL identifier — it is interpolated into DDL/DML. */ table?: string; } /** * Create a Postgres-backed {@link InterruptStore}. Either pass a live * `pg.Pool` / `pg.Client` (`{ client }`) — `@warlock.js/ai` never * imports `pg` in that case — or a `{ connectionString }` and let the * store lazily `import("pg")` to build its own pool. When `pg` is not * installed, the curated install string surfaces on first use, never at * import. Run {@link InterruptStore.schema} through your migration tool * once before use; the store never auto-migrates. * * @example * import { Pool } from "pg"; * import { ai } from "@warlock.js/ai"; * * const pool = new Pool({ connectionString: process.env.DATABASE_URL }); * const store = ai.human.interrupt.pg({ client: pool }); * * // Once, via your migration tooling: * // await pool.query(store.schema()); * * @example * // Let the store build its own pool from a connection string: * const store = ai.human.interrupt.pg({ * connectionString: process.env.DATABASE_URL, * }); */ declare function pg(options: PgInterruptOptions): InterruptStore; //#endregion export { PgInterruptOptions, pg }; //# sourceMappingURL=pg.d.mts.map