devflow-ai
Version:
Enterprise-grade AI agent orchestration with swarm management UI dashboard
25 lines (21 loc) • 776 B
text/typescript
/**
* Base transport interface for MCP
*/
import type { MCPRequest, MCPResponse, MCPNotification } from '../../utils/types.js';
export type RequestHandler = (request: MCPRequest) => Promise<MCPResponse>;
export type NotificationHandler = (notification: MCPNotification) => Promise<void>;
export interface ITransport {
start(): Promise<void>;
stop(): Promise<void>;
connect(): Promise<void>;
disconnect(): Promise<void>;
onRequest(handler: RequestHandler): void;
onNotification?(handler: NotificationHandler): void;
sendRequest(request: MCPRequest): Promise<MCPResponse>;
sendNotification?(notification: MCPNotification): Promise<void>;
getHealthStatus(): Promise<{
healthy: boolean;
error?: string;
metrics?: Record<string, number>;
}>;
}