import type { Database } from "bun:sqlite"; import type { ApiPrincipal } from "./types.js"; import type { ExecutionGrant, ExecutionGrantPolicy } from "../lib/execution-grants.js"; export interface ExecutionGrantStore { get(principal: ApiPrincipal, profileId: string, revision?: string): Promise; /** Atomically change the current revision and append immutable history. Null is a CAS conflict. */ save(principal: ApiPrincipal, profileId: string, grants: ExecutionGrant[], expected: string | null): Promise; } type Row = Record; export declare class MemoryExecutionGrantStore implements ExecutionGrantStore { private current; private history; get(p: ApiPrincipal, id: string, revision?: string): Promise; save(p: ApiPrincipal, id: string, grants: ExecutionGrant[], expected: string | null): Promise; } export declare class SqliteExecutionGrantStore implements ExecutionGrantStore { private db; constructor(db: Database); get(p: ApiPrincipal, id: string, revision?: string): Promise; save(p: ApiPrincipal, id: string, grants: ExecutionGrant[], expected: string | null): Promise; } type Sql = (strings: TemplateStringsArray, ...values: unknown[]) => Promise; export declare class PostgresExecutionGrantStore implements ExecutionGrantStore { private sql; constructor(sql: Sql); get(p: ApiPrincipal, id: string, revision?: string): Promise; save(p: ApiPrincipal, id: string, grants: ExecutionGrant[], expected: string | null): Promise; } export {};