/** * Handler for `POST /api/mcp-auth`. * * Starts the OAuth flow for a locally configured MCP server managed by * `spectral serve`. Delegates to the shared non-blocking helper * (`startMcpAuthFlow`) used by the agent `mcp` tool: `startAuth` captures * the authorization URL through the provider's `onRedirect` hook, and the * flow is completed in the background once the local callback server * receives the code. `openBrowser: true` in the body launches the system * browser (default: headless — the caller renders `authUrl`). * * Pure handler pattern — no framework, no side effects on the wire. The * caller (the relay dispatcher) injects `McpExtensionState`; validation * failures throw `BadRequestError` which `relay/rest.ts` maps to 400. */ import type { McpExtensionState } from "../../mcp/state.js"; export type McpAuthResult = { status: "already-authenticated"; } | { status: "auth_url_ready"; authUrl: string; }; export interface McpAuthBody { name?: unknown; openBrowser?: boolean; } export declare function handleStartMcpAuth(state: McpExtensionState | undefined, body: McpAuthBody): Promise; //# sourceMappingURL=mcp-auth.d.ts.map