Skip to content

Commit 8bf7b00

Browse files
committed
merge commit
1 parent 9f565d3 commit 8bf7b00

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/experimental/fetchStreamableHttpServerTransport.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import {
1515
MessageExtraInfo,
1616
RequestInfo,
1717
isInitializeRequest,
18-
isJSONRPCError,
18+
isJSONRPCErrorResponse,
1919
isJSONRPCRequest,
20-
isJSONRPCResponse,
20+
isJSONRPCResultResponse,
2121
JSONRPCMessage,
2222
JSONRPCMessageSchema,
2323
RequestId,
@@ -841,7 +841,7 @@ export class FetchStreamableHTTPServerTransport implements Transport {
841841

842842
async send(message: JSONRPCMessage, options?: { relatedRequestId?: RequestId }): Promise<void> {
843843
let 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
846846
requestId = message.id;
847847
}
@@ -851,7 +851,7 @@ export class FetchStreamableHTTPServerTransport implements Transport {
851851
// Those will be sent via dedicated response SSE streams
852852
if (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)) {
855855
throw 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 {
895895
this.writeSSEEvent(stream.controller, stream.encoder, message, eventId);
896896
}
897897

898-
if (isJSONRPCResponse(message) || isJSONRPCError(message)) {
898+
if (isJSONRPCResultResponse(message) || isJSONRPCErrorResponse(message)) {
899899
this._requestResponseMap.set(requestId, message);
900900
const relatedIds = Array.from(this._requestToStreamMapping.entries())
901901
.filter(([_, sid]) => sid === streamId)

0 commit comments

Comments
 (0)