From 408ff15a921d8aa6716331966fcd068b660050cd Mon Sep 17 00:00:00 2001 From: katayama8000 Date: Thu, 30 Jul 2026 22:55:42 +0900 Subject: [PATCH] docs(core): note that the protocol version constants are legacy-era only LATEST_PROTOCOL_VERSION, DEFAULT_NEGOTIATED_PROTOCOL_VERSION and SUPPORTED_PROTOCOL_VERSIONS are exported from the package root but carry no TSDoc, so nothing on the public surface says they describe only the legacy `initialize` era. Reading LATEST_PROTOCOL_VERSION === '2025-11-25' therefore looks like "v2 does not implement 2026-07-28". The two-era split is already documented internally, in packages/core-internal/src/shared/protocolEras.ts. This copies that reasoning onto the public constants. Comments only; no behaviour or API change. Co-Authored-By: Claude Opus 5 (1M context) --- packages/core/src/constants.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index 72b5f1c763..4623648f90 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -1,5 +1,30 @@ +/* Legacy-era protocol revisions. These three constants describe only the legacy + * protocol era — the 2025-11-25 family and earlier, negotiated via the `initialize` + * handshake. The modern era (2026-07-28 and later) has no `initialize` handshake and + * is versioned separately, so no modern revision ever appears here. */ + +/** + * The newest protocol revision negotiable via the legacy `initialize` handshake. + * + * This is **not** the newest revision this SDK implements, and it is not a usable + * signal for whether the installed version supports a given spec revision — modern-era + * (2026-07-28+) support is deliberately kept out of this constant so that a modern + * version string can never leak into a legacy handshake. + */ export const LATEST_PROTOCOL_VERSION = '2025-11-25'; + +/** + * The revision assumed for a legacy-era HTTP request that carries no + * `MCP-Protocol-Version` header, per the 2025-06-18 spec's backwards-compatibility rule. + */ export const DEFAULT_NEGOTIATED_PROTOCOL_VERSION = '2025-03-26'; + +/** + * Legacy-era revisions this SDK can negotiate via `initialize`, in preference order. + * + * Used to validate the `MCP-Protocol-Version` header on the legacy HTTP transport. + * Modern-era revisions are tracked separately and are never members of this list. + */ export const SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, '2025-06-18', '2025-03-26', '2024-11-05', '2024-10-07']; /**