fix(v1.x): preserve strict transport declaration compatibility - #2799
Closed
patschmittdev wants to merge 1 commit into
Closed
fix(v1.x): preserve strict transport declaration compatibility#2799patschmittdev wants to merge 1 commit into
patschmittdev wants to merge 1 commit into
Conversation
Allow explicitly undefined transport callbacks and session IDs to match the Node HTTP accessors while preserving the generic message callback. Express the existing header input domain without the DOM-only HeadersInit alias or widening Node header values. Add SDK-only ESM and CommonJS public consumers, declaration roundtrips, precise negative type cases, and focused runtime regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 37126330-b171-4157-975e-35a6e42f2d18
|
commit: |
patschmittdev
marked this pull request as draft
September 12, 2026 19:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Target:
modelcontextprotocol/typescript-sdk:v1.x, frompatschmittdev/typescript-sdk:patschmittdev-ship-mcp-sdk-fix.This is a type-only maintenance fix based on
v1.xat12b425678a76cd54b0452a2ccf1e5dc7740f73ef. It preserves the existing body-size, batch-request, and resource-URI fixes, package metadata, and 1.30.0 source version.undefinedforTransport.onclose,onerror,onmessage, andsessionId, matching the Node Streamable HTTP accessors and allowingServer.connect(transport)underexactOptionalPropertyTypes. Preserve the genericonmessagesignature.HeadersInitalias innormalizeHeaderswith the domain-identicalHeaders | [string, string][] | Record<string, string> | undefinedunion. This does not broaden accepted values to the array-valued records or loose tuple arrays allowed by Node'sRequestInit['headers'].Only five production type lines change. No runtime implementation, dependencies, ambient shims, or compiler-check bypasses change.
Related work
Addresses the v1 declaration failures reported in #2083 and #2568. #1766 addressed related transport types on the v2 line. This partially overlaps the header fix in #2570; this approach additionally resolves the transport callback mismatch, preserves the original header input domain, and tests both concerns together with strict consumers.
Validation
Fresh validation against this maintenance base, not reused results from the published 1.30.0 baseline:
TS2304,TS2420, andTS2379with the unpatched packedv1.xdeclarations.npm run buildwith the locked TypeScript 5.6.3 toolchain. All 174 emitted JavaScript files are byte-identical to a same-platform, same-toolchain build of unpatchedv1.x.npm run checkpassed on an LF export of the exact staged tree. The Windows checkout has existing CRLF-only Prettier differences; unrelated files were not reformatted.--maxWorkers=1.Server.connect, declaration emission, a second consumer without the first source, and 19 exact invalid callback/header diagnostics (304 rejections total). Node types: 22.20.2 and 24.13.4.strict,exactOptionalPropertyTypes,noUncheckedIndexedAccess,verbatimModuleSyntax, andskipLibCheck: false; DOM cells also assert exact equality with the original header domain.The reusable strict runner and its invocation are documented in
CONTRIBUTING.md. No merge, release, or package publication is part of this PR.