Skip to content

Commit 7edefb3

Browse files
chore(mcp): upgrade client to 2.0.0 (#39369)
Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: Aiden Cline <[email protected]>
1 parent 017a597 commit 7edefb3

5 files changed

Lines changed: 37 additions & 37 deletions

File tree

‎bun.lock‎

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎bunfig.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
exact = true
33
# Only install newly resolved package versions published at least 3 days ago.
44
minimumReleaseAge = 259200
5-
minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"]
5+
minimumReleaseAgeExcludes = ["@ai-sdk/amazon-bedrock", "@ai-sdk/anthropic", "@modelcontextprotocol/client", "@modelcontextprotocol/core", "@modelcontextprotocol/server", "@opentui/core", "@opentui/core-darwin-arm64", "@opentui/core-darwin-x64", "@opentui/core-linux-arm64", "@opentui/core-linux-arm64-musl", "@opentui/core-linux-x64", "@opentui/core-linux-x64-musl", "@opentui/core-win32-arm64", "@opentui/core-win32-x64", "@opentui/keymap", "@opentui/solid", "opentui-spinner", "gitlab-ai-provider", "opencode-gitlab-auth", "@ff-labs/fff-node", "@ff-labs/fff-bun", "@ff-labs/fff-bin-darwin-arm64", "@ff-labs/fff-bin-darwin-x64", "@ff-labs/fff-bin-linux-arm64-gnu", "@ff-labs/fff-bin-linux-arm64-musl", "@ff-labs/fff-bin-linux-x64-gnu", "@ff-labs/fff-bin-linux-x64-musl", "@ff-labs/fff-bin-win32-arm64", "@ff-labs/fff-bin-win32-x64", "@pierre/diffs", "@pierre/theming", "app-builder-lib", "dmg-builder", "electron-builder", "electron-publish"]
66

77
[test]
88
root = "./do-not-run-tests-from-root"

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,6 @@
157157
"@pierre/[email protected]": "patches/@pierre%[email protected]",
158158
159159
"@tanstack/[email protected]": "patches/@tanstack%[email protected]",
160-
"@modelcontextprotocol/[email protected]-beta.5": "patches/@modelcontextprotocol%[email protected]-beta.5.patch"
160+
"@modelcontextprotocol/[email protected]": "patches/@modelcontextprotocol%[email protected]"
161161
}
162162
}

‎packages/opencode/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"devDependencies": {
3232
"@babel/core": "7.28.4",
33-
"@modelcontextprotocol/server": "2.0.0-beta.5",
33+
"@modelcontextprotocol/server": "2.0.0",
3434
"@octokit/webhooks-types": "7.6.1",
3535
"@opencode-ai/core": "workspace:*",
3636
"@opencode-ai/http-recorder": "workspace:*",
@@ -81,7 +81,7 @@
8181
"@effect/platform-node": "catalog:",
8282
"@ff-labs/fff-bun": "0.9.4",
8383
"@gitlab/opencode-gitlab-auth": "1.3.3",
84-
"@modelcontextprotocol/client": "2.0.0-beta.5",
84+
"@modelcontextprotocol/client": "2.0.0",
8585
"@octokit/graphql": "9.0.2",
8686
"@octokit/rest": "catalog:",
8787
"@openauthjs/openauth": "catalog:",
Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
diff --git a/dist/index.cjs b/dist/index.cjs
2-
index 1c43bac25a1037416fdf2ddfb4534ba0897a2e69..7e2108326f368ccbc48897195d57e370a4553855 100644
2+
index 635f1c0..9214f0b 100644
33
--- a/dist/index.cjs
44
+++ b/dist/index.cjs
5-
@@ -3154,6 +3154,7 @@ var Client = class extends require_src.Protocol {
5+
@@ -3211,6 +3211,7 @@ var Client = class extends require_src.Protocol {
66
*/
77
async _connectPlainLegacy(transport, options) {
88
await super.connect(transport);
99
+ transport.onsessionexpired = () => this._legacyHandshake(transport, options);
1010
if (transport.sessionId !== void 0) {
1111
const negotiatedProtocolVersion = this._negotiatedProtocolVersion;
1212
if (negotiatedProtocolVersion !== void 0) transport.setProtocolVersion?.(negotiatedProtocolVersion);
13-
@@ -3170,6 +3171,7 @@ var Client = class extends require_src.Protocol {
13+
@@ -3227,6 +3228,7 @@ var Client = class extends require_src.Protocol {
1414
* the handshake; its completion sets the negotiated (legacy) version.
1515
*/
1616
async _legacyHandshake(transport, options) {
1717
+ transport.onsessionexpired = () => this._legacyHandshake(transport, options);
1818
const legacyVersions = require_src.legacyProtocolVersions(this._supportedProtocolVersions);
1919
try {
2020
const offeredVersion = legacyVersions[0];
21-
@@ -3208,6 +3210,7 @@ var Client = class extends require_src.Protocol {
21+
@@ -3265,6 +3267,7 @@ var Client = class extends require_src.Protocol {
2222
await super.connect(transport);
2323
const negotiatedProtocolVersion = this._negotiatedProtocolVersion;
2424
if (negotiatedProtocolVersion !== void 0 && transport.setProtocolVersion) transport.setProtocolVersion(negotiatedProtocolVersion);
2525
+ if (negotiatedProtocolVersion !== void 0 && !require_src.isModernProtocolVersion(negotiatedProtocolVersion)) transport.onsessionexpired = () => this._legacyHandshake(transport, options);
2626
return;
2727
}
2828
this._resetConnectionState();
29-
@@ -5211,10 +5214,32 @@ var StreamableHTTPClientTransport = class {
29+
@@ -5294,10 +5297,32 @@ var StreamableHTTPClientTransport = class {
3030
}
3131
}
3232
async send(message, options) {
@@ -61,7 +61,7 @@ index 1c43bac25a1037416fdf2ddfb4534ba0897a2e69..7e2108326f368ccbc48897195d57e370
6161
const { resumptionToken, onresumptiontoken } = options || {};
6262
if (resumptionToken) {
6363
this._startOrAuthSse({
64-
@@ -5226,8 +5251,8 @@ var StreamableHTTPClientTransport = class {
64+
@@ -5309,8 +5334,8 @@ var StreamableHTTPClientTransport = class {
6565
}
6666
const headers = await this._commonHeaders();
6767
this._applyBodyDerivedHeaders(headers, message);
@@ -71,7 +71,7 @@ index 1c43bac25a1037416fdf2ddfb4534ba0897a2e69..7e2108326f368ccbc48897195d57e370
7171
if (options?.headers !== void 0) for (const [name, value] of Object.entries(options.headers)) {
7272
if (RESERVED_REQUEST_HEADER_NAMES.has(name.toLowerCase())) continue;
7373
headers.set(name, value);
74-
@@ -5249,8 +5274,14 @@ var StreamableHTTPClientTransport = class {
74+
@@ -5332,8 +5357,14 @@ var StreamableHTTPClientTransport = class {
7575
signal
7676
};
7777
const response = await (this._fetch ?? fetch)(this._url, init);
@@ -87,53 +87,53 @@ index 1c43bac25a1037416fdf2ddfb4534ba0897a2e69..7e2108326f368ccbc48897195d57e370
8787
if (response.status === 401 && this._authProvider) {
8888
if (response.headers.has("www-authenticate")) {
8989
const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response);
90-
@@ -5264,7 +5295,7 @@ var StreamableHTTPClientTransport = class {
91-
fetchFn: this._fetchWithInit
92-
});
90+
@@ -5351,7 +5382,7 @@ var StreamableHTTPClientTransport = class {
91+
throw markAuthSeamEscape(error);
92+
}
9393
await response.text?.().catch(() => {});
9494
- return this._send(message, options, true, stepUpRetries);
9595
+ return this._send(message, options, true, stepUpRetries, isSessionRetry);
9696
}
9797
await response.text?.().catch(() => {});
98-
if (isAuthRetry) throw new require_src.SdkHttpError(require_src.SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", {
99-
@@ -5284,7 +5315,7 @@ var StreamableHTTPClientTransport = class {
98+
if (isAuthRetry) throw markAuthSeamEscape(new require_src.SdkHttpError(require_src.SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", {
99+
@@ -5371,7 +5402,7 @@ var StreamableHTTPClientTransport = class {
100100
statusText: response.statusText,
101101
text
102-
}, stepUpRetries) !== "AUTHORIZED") throw new UnauthorizedError();
102+
}, stepUpRetries) !== "AUTHORIZED") throw markAuthSeamEscape(new UnauthorizedError());
103103
- return this._send(message, options, isAuthRetry, stepUpRetries + 1);
104104
+ return this._send(message, options, isAuthRetry, stepUpRetries + 1, isSessionRetry);
105105
}
106106
}
107107
if (response.status === 400 && typeof text === "string" && this._isModernEnvelopedRequest(message)) try {
108108
diff --git a/dist/index.mjs b/dist/index.mjs
109-
index 77e2389913cb5c5c2b047f95d990ab2892bef923..4b5e4ff2869189d600ca644488a7749668c39747 100644
109+
index f02ce3c..0a5a649 100644
110110
--- a/dist/index.mjs
111111
+++ b/dist/index.mjs
112-
@@ -3151,6 +3151,7 @@ var Client = class extends Protocol {
112+
@@ -3208,6 +3208,7 @@ var Client = class extends Protocol {
113113
*/
114114
async _connectPlainLegacy(transport, options) {
115115
await super.connect(transport);
116116
+ transport.onsessionexpired = () => this._legacyHandshake(transport, options);
117117
if (transport.sessionId !== void 0) {
118118
const negotiatedProtocolVersion = this._negotiatedProtocolVersion;
119119
if (negotiatedProtocolVersion !== void 0) transport.setProtocolVersion?.(negotiatedProtocolVersion);
120-
@@ -3167,6 +3168,7 @@ var Client = class extends Protocol {
120+
@@ -3224,6 +3225,7 @@ var Client = class extends Protocol {
121121
* the handshake; its completion sets the negotiated (legacy) version.
122122
*/
123123
async _legacyHandshake(transport, options) {
124124
+ transport.onsessionexpired = () => this._legacyHandshake(transport, options);
125125
const legacyVersions = legacyProtocolVersions(this._supportedProtocolVersions);
126126
try {
127127
const offeredVersion = legacyVersions[0];
128-
@@ -3205,6 +3207,7 @@ var Client = class extends Protocol {
128+
@@ -3262,6 +3264,7 @@ var Client = class extends Protocol {
129129
await super.connect(transport);
130130
const negotiatedProtocolVersion = this._negotiatedProtocolVersion;
131131
if (negotiatedProtocolVersion !== void 0 && transport.setProtocolVersion) transport.setProtocolVersion(negotiatedProtocolVersion);
132132
+ if (negotiatedProtocolVersion !== void 0 && !isModernProtocolVersion(negotiatedProtocolVersion)) transport.onsessionexpired = () => this._legacyHandshake(transport, options);
133133
return;
134134
}
135135
this._resetConnectionState();
136-
@@ -5208,10 +5211,32 @@ var StreamableHTTPClientTransport = class {
136+
@@ -5291,10 +5294,32 @@ var StreamableHTTPClientTransport = class {
137137
}
138138
}
139139
async send(message, options) {
@@ -168,7 +168,7 @@ index 77e2389913cb5c5c2b047f95d990ab2892bef923..4b5e4ff2869189d600ca644488a77496
168168
const { resumptionToken, onresumptiontoken } = options || {};
169169
if (resumptionToken) {
170170
this._startOrAuthSse({
171-
@@ -5223,8 +5248,8 @@ var StreamableHTTPClientTransport = class {
171+
@@ -5306,8 +5331,8 @@ var StreamableHTTPClientTransport = class {
172172
}
173173
const headers = await this._commonHeaders();
174174
this._applyBodyDerivedHeaders(headers, message);
@@ -178,7 +178,7 @@ index 77e2389913cb5c5c2b047f95d990ab2892bef923..4b5e4ff2869189d600ca644488a77496
178178
if (options?.headers !== void 0) for (const [name, value] of Object.entries(options.headers)) {
179179
if (RESERVED_REQUEST_HEADER_NAMES.has(name.toLowerCase())) continue;
180180
headers.set(name, value);
181-
@@ -5246,8 +5271,14 @@ var StreamableHTTPClientTransport = class {
181+
@@ -5329,8 +5354,14 @@ var StreamableHTTPClientTransport = class {
182182
signal
183183
};
184184
const response = await (this._fetch ?? fetch)(this._url, init);
@@ -194,19 +194,19 @@ index 77e2389913cb5c5c2b047f95d990ab2892bef923..4b5e4ff2869189d600ca644488a77496
194194
if (response.status === 401 && this._authProvider) {
195195
if (response.headers.has("www-authenticate")) {
196196
const { resourceMetadataUrl, scope } = extractWWWAuthenticateParams(response);
197-
@@ -5261,7 +5292,7 @@ var StreamableHTTPClientTransport = class {
198-
fetchFn: this._fetchWithInit
199-
});
197+
@@ -5348,7 +5379,7 @@ var StreamableHTTPClientTransport = class {
198+
throw markAuthSeamEscape(error);
199+
}
200200
await response.text?.().catch(() => {});
201201
- return this._send(message, options, true, stepUpRetries);
202202
+ return this._send(message, options, true, stepUpRetries, isSessionRetry);
203203
}
204204
await response.text?.().catch(() => {});
205-
if (isAuthRetry) throw new SdkHttpError(SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", {
206-
@@ -5281,7 +5312,7 @@ var StreamableHTTPClientTransport = class {
205+
if (isAuthRetry) throw markAuthSeamEscape(new SdkHttpError(SdkErrorCode.ClientHttpAuthentication, "Server returned 401 after re-authentication", {
206+
@@ -5368,7 +5399,7 @@ var StreamableHTTPClientTransport = class {
207207
statusText: response.statusText,
208208
text
209-
}, stepUpRetries) !== "AUTHORIZED") throw new UnauthorizedError();
209+
}, stepUpRetries) !== "AUTHORIZED") throw markAuthSeamEscape(new UnauthorizedError());
210210
- return this._send(message, options, isAuthRetry, stepUpRetries + 1);
211211
+ return this._send(message, options, isAuthRetry, stepUpRetries + 1, isSessionRetry);
212212
}

0 commit comments

Comments
 (0)