fastmcp 4.29.2 → 4.30.0

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/FastMCP.cjs CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkTN6CWWVWcjs = require('./chunk-TN6CWWVW.cjs');
14
+ var _chunk4JEDH2ONcjs = require('./chunk-4JEDH2ON.cjs');
15
15
 
16
16
 
17
17
 
@@ -24,7 +24,7 @@ var _chunkTN6CWWVWcjs = require('./chunk-TN6CWWVW.cjs');
24
24
 
25
25
 
26
26
 
27
- var _chunkXP4NENWXcjs = require('./chunk-XP4NENWX.cjs');
27
+ var _chunkCZGQ2WTQcjs = require('./chunk-CZGQ2WTQ.cjs');
28
28
  require('./chunk-FBDPX4H2.cjs');
29
29
 
30
30
 
@@ -50,5 +50,5 @@ require('./chunk-FBDPX4H2.cjs');
50
50
 
51
51
 
52
52
 
53
- exports.AuthProvider = _chunkXP4NENWXcjs.AuthProvider; exports.AzureProvider = _chunkXP4NENWXcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkTN6CWWVWcjs.DiscoveryDocumentCache; exports.FastMCP = _chunkTN6CWWVWcjs.FastMCP; exports.FastMCPError = _chunkTN6CWWVWcjs.FastMCPError; exports.FastMCPSession = _chunkTN6CWWVWcjs.FastMCPSession; exports.GitHubProvider = _chunkXP4NENWXcjs.GitHubProvider; exports.GoogleProvider = _chunkXP4NENWXcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkTN6CWWVWcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunkXP4NENWXcjs.OAuthProvider; exports.ServerState = _chunkTN6CWWVWcjs.ServerState; exports.SessionError = _chunkTN6CWWVWcjs.SessionError; exports.UnexpectedStateError = _chunkTN6CWWVWcjs.UnexpectedStateError; exports.UserError = _chunkTN6CWWVWcjs.UserError; exports.audioContent = _chunkTN6CWWVWcjs.audioContent; exports.getAuthSession = _chunkXP4NENWXcjs.getAuthSession; exports.imageContent = _chunkTN6CWWVWcjs.imageContent; exports.jsonSchemaAdapter = _chunkTN6CWWVWcjs.jsonSchemaAdapter; exports.requireAll = _chunkXP4NENWXcjs.requireAll; exports.requireAny = _chunkXP4NENWXcjs.requireAny; exports.requireAuth = _chunkXP4NENWXcjs.requireAuth; exports.requireRole = _chunkXP4NENWXcjs.requireRole; exports.requireScopes = _chunkXP4NENWXcjs.requireScopes;
53
+ exports.AuthProvider = _chunkCZGQ2WTQcjs.AuthProvider; exports.AzureProvider = _chunkCZGQ2WTQcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunk4JEDH2ONcjs.DiscoveryDocumentCache; exports.FastMCP = _chunk4JEDH2ONcjs.FastMCP; exports.FastMCPError = _chunk4JEDH2ONcjs.FastMCPError; exports.FastMCPSession = _chunk4JEDH2ONcjs.FastMCPSession; exports.GitHubProvider = _chunkCZGQ2WTQcjs.GitHubProvider; exports.GoogleProvider = _chunkCZGQ2WTQcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunk4JEDH2ONcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunkCZGQ2WTQcjs.OAuthProvider; exports.ServerState = _chunk4JEDH2ONcjs.ServerState; exports.SessionError = _chunk4JEDH2ONcjs.SessionError; exports.UnexpectedStateError = _chunk4JEDH2ONcjs.UnexpectedStateError; exports.UserError = _chunk4JEDH2ONcjs.UserError; exports.audioContent = _chunk4JEDH2ONcjs.audioContent; exports.getAuthSession = _chunkCZGQ2WTQcjs.getAuthSession; exports.imageContent = _chunk4JEDH2ONcjs.imageContent; exports.jsonSchemaAdapter = _chunk4JEDH2ONcjs.jsonSchemaAdapter; exports.requireAll = _chunkCZGQ2WTQcjs.requireAll; exports.requireAny = _chunkCZGQ2WTQcjs.requireAny; exports.requireAuth = _chunkCZGQ2WTQcjs.requireAuth; exports.requireRole = _chunkCZGQ2WTQcjs.requireRole; exports.requireScopes = _chunkCZGQ2WTQcjs.requireScopes;
54
54
  //# sourceMappingURL=FastMCP.cjs.map
package/dist/FastMCP.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  audioContent,
12
12
  imageContent,
13
13
  jsonSchemaAdapter
14
- } from "./chunk-T7EFBHCA.js";
14
+ } from "./chunk-5KA6SOWT.js";
15
15
  import {
16
16
  AuthProvider,
17
17
  AzureProvider,
@@ -24,7 +24,7 @@ import {
24
24
  requireAuth,
25
25
  requireRole,
26
26
  requireScopes
27
- } from "./chunk-PA3GWZUK.js";
27
+ } from "./chunk-XPTUOWUT.js";
28
28
  import "./chunk-JCKJRUCE.js";
29
29
  export {
30
30
  AuthProvider,
@@ -25,7 +25,7 @@
25
25
 
26
26
 
27
27
 
28
- var _chunkXP4NENWXcjs = require('../chunk-XP4NENWX.cjs');
28
+ var _chunkCZGQ2WTQcjs = require('../chunk-CZGQ2WTQ.cjs');
29
29
 
30
30
 
31
31
 
@@ -53,5 +53,5 @@ var _chunkXP4NENWXcjs = require('../chunk-XP4NENWX.cjs');
53
53
 
54
54
 
55
55
 
56
- exports.AuthProvider = _chunkXP4NENWXcjs.AuthProvider; exports.AzureProvider = _chunkXP4NENWXcjs.AzureProvider; exports.ConsentManager = _chunkXP4NENWXcjs.ConsentManager; exports.DEFAULT_ACCESS_TOKEN_TTL = _chunkXP4NENWXcjs.DEFAULT_ACCESS_TOKEN_TTL; exports.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH = _chunkXP4NENWXcjs.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH; exports.DEFAULT_AUTHORIZATION_CODE_TTL = _chunkXP4NENWXcjs.DEFAULT_AUTHORIZATION_CODE_TTL; exports.DEFAULT_REFRESH_TOKEN_TTL = _chunkXP4NENWXcjs.DEFAULT_REFRESH_TOKEN_TTL; exports.DEFAULT_TRANSACTION_TTL = _chunkXP4NENWXcjs.DEFAULT_TRANSACTION_TTL; exports.DiskStore = _chunkXP4NENWXcjs.DiskStore; exports.EncryptedTokenStorage = _chunkXP4NENWXcjs.EncryptedTokenStorage; exports.GitHubProvider = _chunkXP4NENWXcjs.GitHubProvider; exports.GoogleProvider = _chunkXP4NENWXcjs.GoogleProvider; exports.JWKSVerifier = _chunkXP4NENWXcjs.JWKSVerifier; exports.JWTIssuer = _chunkXP4NENWXcjs.JWTIssuer; exports.MemoryTokenStorage = _chunkXP4NENWXcjs.MemoryTokenStorage; exports.OAuthProvider = _chunkXP4NENWXcjs.OAuthProvider; exports.OAuthProxy = _chunkXP4NENWXcjs.OAuthProxy; exports.OAuthProxyError = _chunkXP4NENWXcjs.OAuthProxyError; exports.PKCEUtils = _chunkXP4NENWXcjs.PKCEUtils; exports.TOKEN_ENDPOINT_AUTH_METHODS = _chunkXP4NENWXcjs.TOKEN_ENDPOINT_AUTH_METHODS; exports.getAuthSession = _chunkXP4NENWXcjs.getAuthSession; exports.requireAll = _chunkXP4NENWXcjs.requireAll; exports.requireAny = _chunkXP4NENWXcjs.requireAny; exports.requireAuth = _chunkXP4NENWXcjs.requireAuth; exports.requireRole = _chunkXP4NENWXcjs.requireRole; exports.requireScopes = _chunkXP4NENWXcjs.requireScopes;
56
+ exports.AuthProvider = _chunkCZGQ2WTQcjs.AuthProvider; exports.AzureProvider = _chunkCZGQ2WTQcjs.AzureProvider; exports.ConsentManager = _chunkCZGQ2WTQcjs.ConsentManager; exports.DEFAULT_ACCESS_TOKEN_TTL = _chunkCZGQ2WTQcjs.DEFAULT_ACCESS_TOKEN_TTL; exports.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH = _chunkCZGQ2WTQcjs.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH; exports.DEFAULT_AUTHORIZATION_CODE_TTL = _chunkCZGQ2WTQcjs.DEFAULT_AUTHORIZATION_CODE_TTL; exports.DEFAULT_REFRESH_TOKEN_TTL = _chunkCZGQ2WTQcjs.DEFAULT_REFRESH_TOKEN_TTL; exports.DEFAULT_TRANSACTION_TTL = _chunkCZGQ2WTQcjs.DEFAULT_TRANSACTION_TTL; exports.DiskStore = _chunkCZGQ2WTQcjs.DiskStore; exports.EncryptedTokenStorage = _chunkCZGQ2WTQcjs.EncryptedTokenStorage; exports.GitHubProvider = _chunkCZGQ2WTQcjs.GitHubProvider; exports.GoogleProvider = _chunkCZGQ2WTQcjs.GoogleProvider; exports.JWKSVerifier = _chunkCZGQ2WTQcjs.JWKSVerifier; exports.JWTIssuer = _chunkCZGQ2WTQcjs.JWTIssuer; exports.MemoryTokenStorage = _chunkCZGQ2WTQcjs.MemoryTokenStorage; exports.OAuthProvider = _chunkCZGQ2WTQcjs.OAuthProvider; exports.OAuthProxy = _chunkCZGQ2WTQcjs.OAuthProxy; exports.OAuthProxyError = _chunkCZGQ2WTQcjs.OAuthProxyError; exports.PKCEUtils = _chunkCZGQ2WTQcjs.PKCEUtils; exports.TOKEN_ENDPOINT_AUTH_METHODS = _chunkCZGQ2WTQcjs.TOKEN_ENDPOINT_AUTH_METHODS; exports.getAuthSession = _chunkCZGQ2WTQcjs.getAuthSession; exports.requireAll = _chunkCZGQ2WTQcjs.requireAll; exports.requireAny = _chunkCZGQ2WTQcjs.requireAny; exports.requireAuth = _chunkCZGQ2WTQcjs.requireAuth; exports.requireRole = _chunkCZGQ2WTQcjs.requireRole; exports.requireScopes = _chunkCZGQ2WTQcjs.requireScopes;
57
57
  //# sourceMappingURL=index.cjs.map
@@ -129,9 +129,30 @@ declare class DiskStore implements TokenStorage {
129
129
  */
130
130
  private ensureDirectory;
131
131
  /**
132
- * Get file path for a key
132
+ * Get file path for a key.
133
+ *
134
+ * The file name must not let a key escape the directory, and distinct keys
135
+ * must get distinct files, also on case-insensitive filesystems (the macOS
136
+ * and Windows defaults). Lowercase letters, digits and `-` are kept; every
137
+ * other UTF-8 byte, uppercase letters and `_` included, becomes `_` and two
138
+ * lowercase hex digits, so neither `client:a.b` and `client:a_b` nor
139
+ * `code:A` and `code:a` share a file. Names that would get too long for
140
+ * common filesystems are replaced by a SHA-256 digest, under a prefix the
141
+ * escaping above never produces.
133
142
  */
134
143
  private getFilePath;
144
+ /**
145
+ * The paths a key's entry may be stored at: its current file, then the
146
+ * file name earlier versions used. The earlier scheme replaced every other
147
+ * character with `_`, so distinct keys could share a file; it is still read
148
+ * so that entries persisted before an upgrade survive it.
149
+ */
150
+ private getFilePaths;
151
+ /**
152
+ * The file name earlier versions stored a key under, or `undefined` when
153
+ * that name is too long to have ever been written.
154
+ */
155
+ private getLegacyFilePath;
135
156
  /**
136
157
  * Windows can temporarily deny replacing a file that is being read. Retry
137
158
  * the atomic rename, never deleting the previous entry to make room. Five
@@ -129,9 +129,30 @@ declare class DiskStore implements TokenStorage {
129
129
  */
130
130
  private ensureDirectory;
131
131
  /**
132
- * Get file path for a key
132
+ * Get file path for a key.
133
+ *
134
+ * The file name must not let a key escape the directory, and distinct keys
135
+ * must get distinct files, also on case-insensitive filesystems (the macOS
136
+ * and Windows defaults). Lowercase letters, digits and `-` are kept; every
137
+ * other UTF-8 byte, uppercase letters and `_` included, becomes `_` and two
138
+ * lowercase hex digits, so neither `client:a.b` and `client:a_b` nor
139
+ * `code:A` and `code:a` share a file. Names that would get too long for
140
+ * common filesystems are replaced by a SHA-256 digest, under a prefix the
141
+ * escaping above never produces.
133
142
  */
134
143
  private getFilePath;
144
+ /**
145
+ * The paths a key's entry may be stored at: its current file, then the
146
+ * file name earlier versions used. The earlier scheme replaced every other
147
+ * character with `_`, so distinct keys could share a file; it is still read
148
+ * so that entries persisted before an upgrade survive it.
149
+ */
150
+ private getFilePaths;
151
+ /**
152
+ * The file name earlier versions stored a key under, or `undefined` when
153
+ * that name is too long to have ever been written.
154
+ */
155
+ private getLegacyFilePath;
135
156
  /**
136
157
  * Windows can temporarily deny replacing a file that is being read. Retry
137
158
  * the atomic rename, never deleting the previous entry to make room. Five
@@ -25,7 +25,7 @@ import {
25
25
  requireAuth,
26
26
  requireRole,
27
27
  requireScopes
28
- } from "../chunk-PA3GWZUK.js";
28
+ } from "../chunk-XPTUOWUT.js";
29
29
  export {
30
30
  AuthProvider,
31
31
  AzureProvider,
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkXP4NENWXcjs = require('./chunk-XP4NENWX.cjs');
3
+ var _chunkCZGQ2WTQcjs = require('./chunk-CZGQ2WTQ.cjs');
4
4
 
5
5
 
6
6
 
@@ -141,7 +141,7 @@ var DiscoveryDocumentCache = class {
141
141
  throw error;
142
142
  }
143
143
  if (!res.ok) {
144
- await _chunkXP4NENWXcjs.cancelResponseBody.call(void 0, res);
144
+ await _chunkCZGQ2WTQcjs.cancelResponseBody.call(void 0, res);
145
145
  throw new Error(
146
146
  `Failed to fetch discovery document from ${url}: ${res.status} ${res.statusText}`
147
147
  );
@@ -258,7 +258,7 @@ var imageContent = async (input) => {
258
258
  signal: AbortSignal.timeout(timeoutMs)
259
259
  });
260
260
  if (!response.ok) {
261
- await _chunkXP4NENWXcjs.cancelResponseBody.call(void 0, response);
261
+ await _chunkCZGQ2WTQcjs.cancelResponseBody.call(void 0, response);
262
262
  throw new Error(
263
263
  `Server responded with status: ${response.status} - ${response.statusText}`
264
264
  );
@@ -340,7 +340,7 @@ var audioContent = async (input) => {
340
340
  signal: AbortSignal.timeout(timeoutMs)
341
341
  });
342
342
  if (!response.ok) {
343
- await _chunkXP4NENWXcjs.cancelResponseBody.call(void 0, response);
343
+ await _chunkCZGQ2WTQcjs.cancelResponseBody.call(void 0, response);
344
344
  throw new Error(
345
345
  `Server responded with status: ${response.status} - ${response.statusText}`
346
346
  );
@@ -3699,4 +3699,4 @@ var FastMCP = class extends FastMCPEventEmitter {
3699
3699
 
3700
3700
 
3701
3701
  exports.DiscoveryDocumentCache = DiscoveryDocumentCache; exports.jsonSchemaAdapter = jsonSchemaAdapter; exports.MEDIA_FETCH_TIMEOUT_MS = MEDIA_FETCH_TIMEOUT_MS; exports.imageContent = imageContent; exports.audioContent = audioContent; exports.FastMCPError = FastMCPError; exports.SessionError = SessionError; exports.UnexpectedStateError = UnexpectedStateError; exports.UserError = UserError; exports.ServerState = ServerState; exports.FastMCPSession = FastMCPSession; exports.FastMCP = FastMCP;
3702
- //# sourceMappingURL=chunk-TN6CWWVW.cjs.map
3702
+ //# sourceMappingURL=chunk-4JEDH2ON.cjs.map