import type { DbExec } from "../db/client.js"; export { hashAgentToolApprovalKey } from "./approval-key.js"; export declare const agentToolApprovalsStore: import("../db/store-registry.js").Store; export declare function ensureAgentToolApprovalTable(): Promise; export declare const agentToolApprovalPoliciesStore: import("../db/store-registry.js").Store; export declare function ensureAgentToolApprovalPolicyTable(): Promise; export interface AgentToolApprovalBinding { ownerEmail: string; orgId?: string | null; threadId?: string | null; turnId?: string | null; toolName: string; /** Null for entries without a revision, and for rows written before one existed. */ toolRevision?: string | null; callId: string; approvalKey: string; /** Fingerprint of the arguments the call runs with; consuming requires the same. */ argumentsHash?: string | null; approvalId?: string; expiresAt?: number; } export interface AgentToolApprovalPolicyBinding { ownerEmail: string; orgId?: string | null; toolName: string; toolRevision?: string | null; } export declare class AgentToolApprovalNotFoundError extends Error { constructor(); } /** Denial is a durable resolution so queued turns can resume after a pause. */ export declare function denyAgentToolApproval(input: { approvalId: string; ownerEmail: string; orgId?: string | null; threadId: string; }): Promise<"denied" | "already_resolved" | "not_applied">; /** * Saves "always allow" for one tool name. With `approvalId`, the grant takes * the revision of that approval row, the card the user clicked, so it never * covers a revision they were not shown. Without one, it covers only an entry * that declares no revision. */ export declare function setAgentToolApprovalPolicy(input: { binding: Omit; enabled: boolean; approvalId?: string; }): Promise; export declare function isAgentToolAlwaysAllowed(input: AgentToolApprovalPolicyBinding): Promise; export declare function getPendingCurrentTurnApprovals(threadId: string, tx: DbExec, turnId?: string): Promise>; export declare function hasPendingCurrentTurnApproval(threadId: string, tx: DbExec, turnId?: string): Promise; export declare function resolveAgentToolApprovalTurnId(binding: { ownerEmail: string; orgId?: string | null; threadId?: string | null; requestedTurnId?: string | null; approvalKeys: readonly string[]; approvalId?: string; }): Promise; export declare function createAgentToolApproval(binding: AgentToolApprovalBinding): Promise; /** * Atomically consume the server-created approval for one logical tool call. * The model's call id is transport metadata and can change when Dispatch * reconstructs a paused turn, so it is deliberately not part of authorization. * The pending row remains the boundary: client history and approval keys alone * cannot manufacture a grant. */ export declare function consumeAgentToolApproval(binding: AgentToolApprovalBinding): Promise;