import type { McpApprovalView, McpApprovalViewState } from "../mcp/approval-route.js"; /** * The browser side of an MCP approval review: an app page reads the review * and sends the decision through the framework route, which checks the * browser session, the grant's owner and app, and the decision token. */ export { MCP_APPROVAL_HASH_PARAM, readMcpApprovalId, } from "../shared/mcp-approval-review.js"; export { mcpApprovalMessagesForLocale, type McpApprovalMessages, } from "../localization/mcp-approval-messages.js"; export { formatApprovalTime, formatRequestedTime, formatWallTime, } from "../mcp/approval-time.js"; export { describeFieldValue } from "../mcp/approval-summary.js"; export type { McpApprovalRequester, McpApprovalView, McpApprovalViewState, } from "../mcp/approval-route.js"; export type { McpApprovalField, McpApprovalSummary, } from "../mcp/approval-summary.js"; export type { McpApprovalPriorRun } from "../mcp/execute-action-call.js"; type McpApprovalUnauthorized = { status: "signed-out"; } /** The app's own authentication can't sign anyone in to this page. */ | { status: "sign-in-unavailable"; }; export type McpApprovalLoadResult = { status: "ready"; view: McpApprovalView; } /** No grant with this id is the reader's; `otherOrganization` when it is theirs elsewhere. */ | { status: "not-found"; otherOrganization: boolean; } | McpApprovalUnauthorized; export type McpApprovalDecisionResult = /** The grant's state now: the decision, or one made first elsewhere. */ { status: "decided"; state: McpApprovalViewState; expiresAt: number; } /** The token is for another session or user; read the review again. */ | { status: "out-of-date"; } | { status: "not-found"; } | McpApprovalUnauthorized; /** A response the review page can't act on. */ export declare class McpApprovalRequestError extends Error { readonly status: number; constructor(status: number); } /** Reads one review for the signed-in user. Throws when the server can't answer. */ export declare function fetchMcpApproval(id: string, options?: { signal?: AbortSignal; }): Promise; /** Approves or denies one review with the token its view carried. */ export declare function sendMcpApprovalDecision(id: string, decision: "approve" | "deny", csrfToken: string): Promise;