/** * MCP Apps Consent Types * * Type definitions for the inline consent UI rendered via MCP Apps. * These match the structuredContent shape produced by * MCPIRuntimeBase.buildConsentUIResult(). */ /** Parameters passed via structuredContent from the runtime */ export interface ConsentParams { type: "consent_required"; /** Auth mode: "consent-only" (default) or "credentials" (username/password form) */ authMode?: "consent-only" | "credentials"; tool: string; scopes: string[]; agentDid: string; agentName: string; sessionId: string; projectId: string; resumeToken: string; serverUrl: string; /** Fallback URL if the iframe can't reach the server */ consentUrl: string; /** Credential provider name (only present when authMode is "credentials") */ provider?: string; } /** Response from POST /consent/approve */ export interface ConsentApprovalResponse { success: boolean; delegation_id?: string; delegation_token?: string; error?: string; error_code?: string; }