UNPKG

@civic/nexus-bridge

Version:

Stdio <-> HTTP/SSE MCP bridge with Civic auth handling

36 lines 1.31 kB
/** * serviceAuthorization.ts * * Handles service authorization flows and job continuation * as described in section 4.5 of the Civic Nexus Bridge spec. */ import type { ToolCallResult } from "./types.js"; import type { Client } from '@modelcontextprotocol/sdk/client/index.js'; /** * Class to handle the service authorization process * Instantiated per request flow */ export declare class ServiceAuthorizationHandler { private remoteClient; private maxRetries; private initialWaitMs; private retryIntervalMs; /** * Create a new ServiceAuthorizationHandler * @param remoteClient The MCP client to use for communication with the remote server */ constructor(remoteClient: Client); /** * Main method to handle service authorization if needed * @param response The MCPResponse to check and potentially handle * @returns The original response if no auth needed, or the final response after auth */ handleServiceAuthorization(response: ToolCallResult): Promise<ToolCallResult>; /** * Poll the server to check if authorization is complete * @param jobId The job ID to continue * @returns The final MCPResponse from the server */ private pollForCompletion; } //# sourceMappingURL=serviceAuthorization.d.ts.map