@@ -15,9 +15,9 @@ import{
1515MessageExtraInfo ,
1616RequestInfo ,
1717isInitializeRequest ,
18- isJSONRPCError ,
18+ isJSONRPCErrorResponse ,
1919isJSONRPCRequest ,
20- isJSONRPCResponse ,
20+ isJSONRPCResultResponse ,
2121JSONRPCMessage ,
2222JSONRPCMessageSchema ,
2323RequestId ,
@@ -841,7 +841,7 @@ export class FetchStreamableHTTPServerTransport implements Transport{
841841
842842async send ( message : JSONRPCMessage , options ?: { relatedRequestId ?: RequestId } ) : Promise < void > {
843843let requestId = options ?. relatedRequestId ;
844- if ( isJSONRPCResponse ( message ) || isJSONRPCError ( message ) ) {
844+ if ( isJSONRPCResultResponse ( message ) || isJSONRPCErrorResponse ( message ) ) {
845845// If the message is a response, use the request ID from the message
846846requestId = message . id ;
847847}
@@ -851,7 +851,7 @@ export class FetchStreamableHTTPServerTransport implements Transport{
851851// Those will be sent via dedicated response SSE streams
852852if ( requestId === undefined ) {
853853// For standalone SSE streams, we can only send requests and notifications
854- if ( isJSONRPCResponse ( message ) || isJSONRPCError ( message ) ) {
854+ if ( isJSONRPCResultResponse ( message ) || isJSONRPCErrorResponse ( message ) ) {
855855throw new Error ( 'Cannot send a response on a standalone SSE stream unless resuming a previous client request' ) ;
856856}
857857
@@ -895,7 +895,7 @@ export class FetchStreamableHTTPServerTransport implements Transport{
895895this . writeSSEEvent ( stream . controller , stream . encoder , message , eventId ) ;
896896}
897897
898- if ( isJSONRPCResponse ( message ) || isJSONRPCError ( message ) ) {
898+ if ( isJSONRPCResultResponse ( message ) || isJSONRPCErrorResponse ( message ) ) {
899899this . _requestResponseMap . set ( requestId , message ) ;
900900const relatedIds = Array . from ( this . _requestToStreamMapping . entries ( ) )
901901. filter ( ( [ _ , sid ] ) => sid === streamId )
0 commit comments