UNPKG

@kya-os/mcp-i

Version:

COMING SOON:Production-ready MCP Identity with automatic registration, key rotation, and optimized performance

52 lines 1.74 kB
/** * Transport abstraction for HTTP requests * Supports both axios and native fetch with runtime detection */ export interface TransportOptions { timeout?: number; headers?: Record<string, string>; } export interface TransportResponse<T = any> { data: T; status: number; headers: Record<string, string>; } export interface Transport { post<T = any>(url: string, data: any, options?: TransportOptions): Promise<TransportResponse<T>>; get<T = any>(url: string, options?: TransportOptions): Promise<TransportResponse<T>>; } /** * Native fetch-based transport (preferred for Edge runtimes) */ export declare class FetchTransport implements Transport { post<T = any>(url: string, data: any, options?: TransportOptions): Promise<TransportResponse<T>>; get<T = any>(url: string, options?: TransportOptions): Promise<TransportResponse<T>>; } /** * Axios-based transport (for Node.js environments) */ export declare class AxiosTransport implements Transport { private axiosInstance; post<T = any>(url: string, data: any, options?: TransportOptions): Promise<TransportResponse<T>>; get<T = any>(url: string, options?: TransportOptions): Promise<TransportResponse<T>>; private getAxios; } /** * Runtime detection for optimal transport selection */ export declare class RuntimeDetector { static isEdgeRuntime(): boolean; static isNodeRuntime(): boolean; static isNextJs(): boolean; static hasFetch(): boolean; static isLambda(): boolean; } /** * Transport factory with runtime detection */ export declare class TransportFactory { static create(options?: { transport?: 'axios' | 'fetch' | 'auto'; }): Transport; } //# sourceMappingURL=transport.d.ts.map