import { ResourceRef, type SessionRemovedRepository } from "@opengeni/contracts"; import { type Database } from "./database.js"; /** * Approval ids of requests the personal GitHub gateway held for a person's * decision (`gh` in a sandbox): `ghgw:`, with a * `:` round once the same request already ran in the turn. */ export declare const GITHUB_GATEWAY_APPROVAL_PREFIX = "ghgw:"; export declare function isGitHubGatewayApprovalId(value: unknown): value is string; /** Live session facts the gateway rechecks on every request. */ export declare function getSessionGitHubGatewayState(db: Database, workspaceId: string, sessionId: string): Promise<{ resources: ResourceRef[]; removedRepositories: SessionRemovedRepository[]; unattended: boolean; } | null>; /** * The approval id for one exact gateway request in a turn. A request still * waiting, approved or declined keeps its id, so running the same command * again after approval executes it; once it ran (or its outcome is unknown), * the same request again is a new round that is decided afresh. */ export declare function githubGatewayApprovalIdForRequest(db: Database, input: { accountId: string; workspaceId: string; sessionId: string; turnId: string; }, digest: string): Promise; /** * Like `githubGatewayApprovalIdForRequest`, plus the policy action the reused * request was recorded under (null for a new round). Running it again must * use that action: whether a request counts as sensitive can depend on * lookups that differ between tries. */ export declare function githubGatewayApprovalForRequest(db: Database, input: { accountId: string; workspaceId: string; sessionId: string; turnId: string; }, digest: string): Promise<{ approvalId: string; toolName: string | null; }>; export type GitHubGatewayApproval = { approvalId: string; requestId: string; toolName: string; status: string; title: string | null; reviewArguments: string | null; }; /** Gateway requests of one turn that asked for a decision, oldest first. */ export declare function listTurnGitHubGatewayApprovals(db: Database, input: { accountId: string; workspaceId: string; sessionId: string; turnId: string; }): Promise;