import { type AgentPostgresStatement, type AgentSqlQueryRunner } from "../../agent-sql/postgres.js"; export declare function assertNoSensitiveFrameworkTables(sql: string, operation: "read" | "write" | "patch"): void; /** * Reads one db-query statement and applies every check that needs no * database. Returns the statement as it will run. */ export declare function readRawDbReadStatement(sql: string): AgentPostgresStatement; /** * Reads one db-exec statement and applies every check that needs no * database, including the access-control write rules. `label` prefixes * errors, e.g. "Statement 2". */ export declare function readRawDbWriteStatement(sql: string, label?: string): AgentPostgresStatement; /** * Converts `?` placeholders and re-reads the result, so the guards have seen * exactly the text that executes. Refuses if converting again would change * the text, since the PGlite client converts a second time. */ export declare function finalRawDbSql(sql: string, kind: "read" | "write" | "patch", label?: string): { sql: string; statement: AgentPostgresStatement; }; /** * The database-side checks: run inside the transaction, after the per-user * views exist and immediately before the statement executes. * `columnsByTable` comes from the scoping context; it lets an INSERT without a * column list be refused when the table has access-control columns. */ export declare function verifyRawDbStatement(db: AgentSqlQueryRunner, statement: AgentPostgresStatement, options?: { columnsByTable?: Map; label?: string; }): Promise; /** * The table an INSERT writes and the columns it lists, or null when the * statement is not an INSERT the guards can read. `columns` is null when the * INSERT has no column list. */ export declare function rawDbInsertTarget(statement: AgentPostgresStatement): { table: string; columns: string[] | null; } | null; export declare function assertNoRawDbAccessControlPatchTarget(table: string, column: string): void; /** * Validates db-patch's `--where`, which is spliced into a SELECT and an * UPDATE. Both full statements are read and verified again before they run. */ export declare function validateRawDbPatchWhere(where: string): void; /** Reads a statement db-patch built from its arguments. */ export declare function readRawDbPatchStatement(sql: string, keyword: "select" | "update"): AgentPostgresStatement;