Squashed 'packages/mcp-typescript/' changes from e665be0..7d70db8
7d70db8 Merge pull request #20 from modelcontextprotocol/ashwin/progress 65a8613 fix schema definitions for RequestSchema git-subtree-dir: packages/mcp-typescript git-subtree-split: 7d70db805740c53f21153d72be6f34d70818a9da
This commit is contained in:
39
dist/shared/transport.d.ts
generated
vendored
Normal file
39
dist/shared/transport.d.ts
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
import { JSONRPCMessage } from "../types.js";
|
||||
/**
|
||||
* Describes the minimal contract for a MCP transport that a client or server can communicate over.
|
||||
*/
|
||||
export interface Transport {
|
||||
/**
|
||||
* Starts processing messages on the transport, including any connection steps that might need to be taken.
|
||||
*
|
||||
* This method should only be called after callbacks are installed, or else messages may be lost.
|
||||
*
|
||||
* NOTE: This method should not be called explicitly when using Client, Server, or Protocol classes, as they will implicitly call start().
|
||||
*/
|
||||
start(): Promise<void>;
|
||||
/**
|
||||
* Sends a JSON-RPC message (request or response).
|
||||
*/
|
||||
send(message: JSONRPCMessage): Promise<void>;
|
||||
/**
|
||||
* Closes the connection.
|
||||
*/
|
||||
close(): Promise<void>;
|
||||
/**
|
||||
* Callback for when the connection is closed for any reason.
|
||||
*
|
||||
* This should be invoked when close() is called as well.
|
||||
*/
|
||||
onclose?: () => void;
|
||||
/**
|
||||
* Callback for when an error occurs.
|
||||
*
|
||||
* Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
|
||||
*/
|
||||
onerror?: (error: Error) => void;
|
||||
/**
|
||||
* Callback for when a message (request or response) is received over the connection.
|
||||
*/
|
||||
onmessage?: (message: JSONRPCMessage) => void;
|
||||
}
|
||||
//# sourceMappingURL=transport.d.ts.map
|
||||
Reference in New Issue
Block a user