@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.
@@ -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.0";
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 serialized = JSON.stringify(tokens);
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