Continue allowing 2024-10-07 in version negotiation
This commit is contained in:
parent
0bf7e66e98
commit
b618157c93
1 changed files with 40 additions and 41 deletions
|
|
@ -1,36 +1,37 @@
|
|||
import { ProgressCallback, Protocol } from "../shared/protocol.js";
|
||||
import { Transport } from "../shared/transport.js";
|
||||
import {
|
||||
CallToolRequest,
|
||||
CallToolResultSchema,
|
||||
ClientNotification,
|
||||
ClientRequest,
|
||||
ClientResult,
|
||||
CompleteRequest,
|
||||
CompleteResultSchema,
|
||||
EmptyResultSchema,
|
||||
GetPromptRequest,
|
||||
GetPromptResultSchema,
|
||||
Implementation,
|
||||
InitializeResultSchema,
|
||||
LATEST_PROTOCOL_VERSION,
|
||||
ListPromptsRequest,
|
||||
ListPromptsResultSchema,
|
||||
ListResourcesRequest,
|
||||
ListResourcesResultSchema,
|
||||
ListResourceTemplatesRequest,
|
||||
ListResourceTemplatesResultSchema,
|
||||
ListToolsRequest,
|
||||
ListToolsResultSchema,
|
||||
LoggingLevel,
|
||||
Notification,
|
||||
PROTOCOL_VERSION,
|
||||
ReadResourceRequest,
|
||||
ReadResourceResultSchema,
|
||||
Request,
|
||||
Result,
|
||||
ServerCapabilities,
|
||||
CompleteRequest,
|
||||
GetPromptRequest,
|
||||
ListPromptsRequest,
|
||||
ListResourcesRequest,
|
||||
ReadResourceRequest,
|
||||
SubscribeRequest,
|
||||
UnsubscribeRequest,
|
||||
CallToolRequest,
|
||||
ListToolsRequest,
|
||||
CompleteResultSchema,
|
||||
GetPromptResultSchema,
|
||||
ListPromptsResultSchema,
|
||||
ListResourcesResultSchema,
|
||||
ReadResourceResultSchema,
|
||||
CallToolResultSchema,
|
||||
ListToolsResultSchema,
|
||||
EmptyResultSchema,
|
||||
LoggingLevel,
|
||||
ListResourceTemplatesRequest,
|
||||
ListResourceTemplatesResultSchema,
|
||||
SUPPORTED_PROTOCOL_VERSIONS,
|
||||
UnsubscribeRequest
|
||||
} from "../types.js";
|
||||
|
||||
/**
|
||||
|
|
@ -84,7 +85,7 @@ export class Client<
|
|||
{
|
||||
method: "initialize",
|
||||
params: {
|
||||
protocolVersion: PROTOCOL_VERSION,
|
||||
protocolVersion: LATEST_PROTOCOL_VERSION,
|
||||
capabilities: {},
|
||||
clientInfo: this._clientInfo,
|
||||
},
|
||||
|
|
@ -96,7 +97,7 @@ export class Client<
|
|||
throw new Error(`Server sent invalid initialize result: ${result}`);
|
||||
}
|
||||
|
||||
if (result.protocolVersion !== PROTOCOL_VERSION) {
|
||||
if (!SUPPORTED_PROTOCOL_VERSIONS.includes(result.protocolVersion)) {
|
||||
throw new Error(
|
||||
`Server's protocol version is not supported: ${result.protocolVersion}`,
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue