@civic/hub-bridge
Version:
Stdio <-> HTTP/SSE MCP bridge with Civic auth handling
25 lines • 1.06 kB
TypeScript
import { AbstractHook } from "@civic/hook-common";
import type { HookResponse, HookContext, ToolCall } from "@civic/hook-common";
import type { CLIAuthProvider } from "@civic/auth-mcp/client";
/**
* AuthenticationHook listens for special authentication messages and triggers
* authentication flows when needed.
*
* This hook processes incoming tool calls and responses to detect when
* authentication is required and handles the authentication flow.
*/
export declare class AuthenticationHook extends AbstractHook {
private readonly authProvider;
constructor(authProvider: CLIAuthProvider);
get name(): string;
/**
* Check if a response is an authorization required response
*/
private isAuthorizationRequiredResponse;
/**
* Detect if a response contains service authorization flow information
*/
private detectServiceAuthorizationFlow;
processResponse(response: unknown, originalToolCall: ToolCall, context?: HookContext): Promise<HookResponse>;
}
//# sourceMappingURL=authentication-hook.d.ts.map