@mcp-use/client 2.4.5-canary.0 → 2.4.5-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/auth/session-store.d.ts.map +1 -1
- package/dist/index-browser.js +6 -2
- package/dist/index-browser.js.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/react/index.js +9 -2
- package/dist/react/index.js.map +1 -1
- package/dist/react/token-expiry.d.ts +3 -1
- package/dist/react/token-expiry.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1979,7 +1979,7 @@ var HttpConnector = class extends BaseConnector {
|
|
|
1979
1979
|
};
|
|
1980
1980
|
|
|
1981
1981
|
// src/utils/version.ts
|
|
1982
|
-
var VERSION = "2.4.5-canary.
|
|
1982
|
+
var VERSION = "2.4.5-canary.1";
|
|
1983
1983
|
function getPackageVersion() {
|
|
1984
1984
|
return VERSION;
|
|
1985
1985
|
}
|
|
@@ -2369,7 +2369,11 @@ var OAuthSessionStore = class _OAuthSessionStore {
|
|
|
2369
2369
|
return (await this.readCredential("tokens", ctx))?.value;
|
|
2370
2370
|
}
|
|
2371
2371
|
async saveTokens(tokens, ctx) {
|
|
2372
|
-
const
|
|
2372
|
+
const stored = typeof tokens.expires_in === "number" ? {
|
|
2373
|
+
...tokens,
|
|
2374
|
+
mcp_use_expires_at: Date.now() + tokens.expires_in * 1e3
|
|
2375
|
+
} : tokens;
|
|
2376
|
+
const serialized = JSON.stringify(stored);
|
|
2373
2377
|
await this.store.set(this.credentialKey("tokens", ctx), serialized);
|
|
2374
2378
|
if (ctx) await this.store.set(this.credentialKey("tokens"), serialized);
|
|
2375
2379
|
await this.store.remove(this.getKey("code_verifier"));
|
|
@@ -5272,6 +5276,9 @@ function getOAuthTokenExpiry(tokens) {
|
|
|
5272
5276
|
if (typeof payload.exp === "number") return payload.exp * 1e3;
|
|
5273
5277
|
} catch {
|
|
5274
5278
|
}
|
|
5279
|
+
if (typeof tokens.mcp_use_expires_at === "number") {
|
|
5280
|
+
return tokens.mcp_use_expires_at;
|
|
5281
|
+
}
|
|
5275
5282
|
return typeof tokens.expires_in === "number" ? Date.now() + tokens.expires_in * 1e3 : void 0;
|
|
5276
5283
|
}
|
|
5277
5284
|
|