Public declaration syntax from forge-ts/packages/forge-mcp/src/transport.ts Original source SHA-256: dd3f582cd3ac5f9b13270efde557b0088264174bef27051dd22b9a22ebdc90b7 Function bodies and constant values are omitted. This is not the complete implementation. Source line 23 export type TransportConfig = | { readonly type: 'stdio' } | { readonly type: 'sse'; readonly url: string } | { readonly type: 'http'; readonly url: string }; Source line 43 export interface McpTransport { /** * Sends a JSON-RPC 2.0 request. * * @param request - The request to send. * @throws {ForgeMcpError} If the send fails. */ send(request: McpRequest): Promise; /** * Receives the next JSON-RPC 2.0 response. * * @returns The response message. * @throws {ForgeMcpError} If the receive fails or the transport is closed. */ receive(): Promise; /** * Closes the transport connection. * * After closing, no further sends or receives are allowed. */ close(): Promise; } Source line 71 export interface StdioLineReader { /** * Reads the next newline-delimited JSON line. * * Returns `null` on clean EOF. */ readLine(): Promise; } Source line 83 export interface StdioLineWriter { /** * Writes a single JSON line without a trailing newline. */ writeLine(line: string): Promise; } Source line 93 export interface StdioTransportOptions { readonly reader?: StdioLineReader; readonly writer?: StdioLineWriter; } Source line 228 export class StdioTransport implements McpTransport { constructor(options?: StdioTransportOptions); async send(request: McpRequest): Promise; async receive(): Promise; async close(): Promise; } Source line 300 export class SseTransport implements McpTransport { constructor(url: string); async send(request: McpRequest): Promise; async receive(): Promise; async close(): Promise; } Source line 496 export class HttpTransport implements McpTransport { constructor(url: string); async send(request: McpRequest): Promise; async receive(): Promise; async close(): Promise; } Source line 563 export function createTransport(config: TransportConfig): McpTransport;