fastmcp 4.27.0 → 4.28.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/FastMCP.cjs +4 -4
- package/dist/FastMCP.d.cts +2 -2
- package/dist/FastMCP.d.ts +2 -2
- package/dist/FastMCP.js +3 -3
- package/dist/{OAuthProvider-CUfrAKTR.d.cts → OAuthProvider-DvIxa9N1.d.cts} +8 -5
- package/dist/{OAuthProvider-CUfrAKTR.d.ts → OAuthProvider-DvIxa9N1.d.ts} +8 -5
- package/dist/auth/index.cjs +2 -2
- package/dist/auth/index.d.cts +2 -2
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{chunk-SQ5JIDOQ.cjs → chunk-2ABBQFJB.cjs} +28 -13
- package/dist/chunk-2ABBQFJB.cjs.map +1 -0
- package/dist/chunk-2NZFMD6I.cjs +120 -0
- package/dist/chunk-2NZFMD6I.cjs.map +1 -0
- package/dist/{chunk-PKJVR5H3.cjs → chunk-3FM67CFK.cjs} +58 -49
- package/dist/chunk-3FM67CFK.cjs.map +1 -0
- package/dist/chunk-AM3HVK4Z.js +120 -0
- package/dist/chunk-AM3HVK4Z.js.map +1 -0
- package/dist/{chunk-TCXNF2SR.js → chunk-NRATQX66.js} +22 -7
- package/dist/chunk-NRATQX66.js.map +1 -0
- package/dist/{chunk-6L7ORLPC.js → chunk-PWSYODM5.js} +49 -40
- package/dist/chunk-PWSYODM5.js.map +1 -0
- package/dist/edge/index.cjs +114 -65
- package/dist/edge/index.cjs.map +1 -1
- package/dist/edge/index.js +90 -41
- package/dist/edge/index.js.map +1 -1
- package/dist/examples/custom-routes.cjs +4 -4
- package/dist/examples/custom-routes.js +3 -3
- package/dist/openapi/index.cjs +26 -15
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.d.cts +4 -4
- package/dist/openapi/index.d.ts +4 -4
- package/dist/openapi/index.js +20 -9
- package/dist/openapi/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-6L7ORLPC.js.map +0 -1
- package/dist/chunk-6TDYSPLC.cjs +0 -44
- package/dist/chunk-6TDYSPLC.cjs.map +0 -1
- package/dist/chunk-OKKFL2M4.js +0 -44
- package/dist/chunk-OKKFL2M4.js.map +0 -1
- package/dist/chunk-PKJVR5H3.cjs.map +0 -1
- package/dist/chunk-SQ5JIDOQ.cjs.map +0 -1
- package/dist/chunk-TCXNF2SR.js.map +0 -1
package/dist/FastMCP.cjs
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunk2ABBQFJBcjs = require('./chunk-2ABBQFJB.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -24,8 +24,8 @@ var _chunkSQ5JIDOQcjs = require('./chunk-SQ5JIDOQ.cjs');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
28
|
-
require('./chunk-
|
|
27
|
+
var _chunk3FM67CFKcjs = require('./chunk-3FM67CFK.cjs');
|
|
28
|
+
require('./chunk-2NZFMD6I.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -50,5 +50,5 @@ require('./chunk-6TDYSPLC.cjs');
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
exports.AuthProvider =
|
|
53
|
+
exports.AuthProvider = _chunk3FM67CFKcjs.AuthProvider; exports.AzureProvider = _chunk3FM67CFKcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunk2ABBQFJBcjs.DiscoveryDocumentCache; exports.FastMCP = _chunk2ABBQFJBcjs.FastMCP; exports.FastMCPError = _chunk2ABBQFJBcjs.FastMCPError; exports.FastMCPSession = _chunk2ABBQFJBcjs.FastMCPSession; exports.GitHubProvider = _chunk3FM67CFKcjs.GitHubProvider; exports.GoogleProvider = _chunk3FM67CFKcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunk2ABBQFJBcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunk3FM67CFKcjs.OAuthProvider; exports.ServerState = _chunk2ABBQFJBcjs.ServerState; exports.SessionError = _chunk2ABBQFJBcjs.SessionError; exports.UnexpectedStateError = _chunk2ABBQFJBcjs.UnexpectedStateError; exports.UserError = _chunk2ABBQFJBcjs.UserError; exports.audioContent = _chunk2ABBQFJBcjs.audioContent; exports.getAuthSession = _chunk3FM67CFKcjs.getAuthSession; exports.imageContent = _chunk2ABBQFJBcjs.imageContent; exports.jsonSchemaAdapter = _chunk2ABBQFJBcjs.jsonSchemaAdapter; exports.requireAll = _chunk3FM67CFKcjs.requireAll; exports.requireAny = _chunk3FM67CFKcjs.requireAny; exports.requireAuth = _chunk3FM67CFKcjs.requireAuth; exports.requireRole = _chunk3FM67CFKcjs.requireRole; exports.requireScopes = _chunk3FM67CFKcjs.requireScopes;
|
|
54
54
|
//# sourceMappingURL=FastMCP.cjs.map
|
package/dist/FastMCP.d.cts
CHANGED
|
@@ -12,8 +12,8 @@ import { CorsOptions } from 'mcp-proxy';
|
|
|
12
12
|
export { CorsOptions } from 'mcp-proxy';
|
|
13
13
|
import { StrictEventEmitter } from 'strict-event-emitter-types';
|
|
14
14
|
import { z } from 'zod';
|
|
15
|
-
import { A as AuthProvider, O as OAuthSession, a as OAuthProxy } from './OAuthProvider-
|
|
16
|
-
export { j as AuthProviderConfig, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, d as OAuthProvider, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from './OAuthProvider-
|
|
15
|
+
import { A as AuthProvider, O as OAuthSession, a as OAuthProxy } from './OAuthProvider-DvIxa9N1.cjs';
|
|
16
|
+
export { j as AuthProviderConfig, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, d as OAuthProvider, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from './OAuthProvider-DvIxa9N1.cjs';
|
|
17
17
|
import 'node:http';
|
|
18
18
|
|
|
19
19
|
declare class DiscoveryDocumentCache {
|
package/dist/FastMCP.d.ts
CHANGED
|
@@ -12,8 +12,8 @@ import { CorsOptions } from 'mcp-proxy';
|
|
|
12
12
|
export { CorsOptions } from 'mcp-proxy';
|
|
13
13
|
import { StrictEventEmitter } from 'strict-event-emitter-types';
|
|
14
14
|
import { z } from 'zod';
|
|
15
|
-
import { A as AuthProvider, O as OAuthSession, a as OAuthProxy } from './OAuthProvider-
|
|
16
|
-
export { j as AuthProviderConfig, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, d as OAuthProvider, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from './OAuthProvider-
|
|
15
|
+
import { A as AuthProvider, O as OAuthSession, a as OAuthProxy } from './OAuthProvider-DvIxa9N1.js';
|
|
16
|
+
export { j as AuthProviderConfig, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, d as OAuthProvider, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from './OAuthProvider-DvIxa9N1.js';
|
|
17
17
|
import 'node:http';
|
|
18
18
|
|
|
19
19
|
declare class DiscoveryDocumentCache {
|
package/dist/FastMCP.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
audioContent,
|
|
12
12
|
imageContent,
|
|
13
13
|
jsonSchemaAdapter
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-NRATQX66.js";
|
|
15
15
|
import {
|
|
16
16
|
AuthProvider,
|
|
17
17
|
AzureProvider,
|
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
requireAuth,
|
|
25
25
|
requireRole,
|
|
26
26
|
requireScopes
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-PWSYODM5.js";
|
|
28
|
+
import "./chunk-AM3HVK4Z.js";
|
|
29
29
|
export {
|
|
30
30
|
AuthProvider,
|
|
31
31
|
AzureProvider,
|
|
@@ -550,11 +550,9 @@ declare class OAuthProxy {
|
|
|
550
550
|
private consentManager;
|
|
551
551
|
private jwtIssuer?;
|
|
552
552
|
/**
|
|
553
|
-
* The fallback storage this proxy created for itself, if any.
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
* through nothing else. A caller-supplied storage is deliberately not
|
|
557
|
-
* recorded here: its lifetime belongs to the caller.
|
|
553
|
+
* The fallback storage this proxy created for itself, if any. Keep a
|
|
554
|
+
* reference so `destroy()` can stop its cleanup timer even when the storage
|
|
555
|
+
* is wrapped for encryption. Caller-supplied storage has its own lifetime.
|
|
558
556
|
*/
|
|
559
557
|
private ownedTokenStorage;
|
|
560
558
|
/**
|
|
@@ -613,6 +611,10 @@ declare class OAuthProxy {
|
|
|
613
611
|
tokenEndpointAuthSigningAlgValuesSupported?: string[];
|
|
614
612
|
uiLocalesSupported?: string[];
|
|
615
613
|
};
|
|
614
|
+
/**
|
|
615
|
+
* Get the configured OAuth callback path, including the default.
|
|
616
|
+
*/
|
|
617
|
+
getRedirectPath(): string;
|
|
616
618
|
/**
|
|
617
619
|
* Handle OAuth callback from upstream provider
|
|
618
620
|
*/
|
|
@@ -777,6 +779,7 @@ declare class OAuthProxy {
|
|
|
777
779
|
* itself is a live upstream credential.
|
|
778
780
|
*/
|
|
779
781
|
private passthroughRefreshKey;
|
|
782
|
+
private redirectToClient;
|
|
780
783
|
/**
|
|
781
784
|
* Redirect to upstream OAuth provider
|
|
782
785
|
*/
|
|
@@ -550,11 +550,9 @@ declare class OAuthProxy {
|
|
|
550
550
|
private consentManager;
|
|
551
551
|
private jwtIssuer?;
|
|
552
552
|
/**
|
|
553
|
-
* The fallback storage this proxy created for itself, if any.
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
* through nothing else. A caller-supplied storage is deliberately not
|
|
557
|
-
* recorded here: its lifetime belongs to the caller.
|
|
553
|
+
* The fallback storage this proxy created for itself, if any. Keep a
|
|
554
|
+
* reference so `destroy()` can stop its cleanup timer even when the storage
|
|
555
|
+
* is wrapped for encryption. Caller-supplied storage has its own lifetime.
|
|
558
556
|
*/
|
|
559
557
|
private ownedTokenStorage;
|
|
560
558
|
/**
|
|
@@ -613,6 +611,10 @@ declare class OAuthProxy {
|
|
|
613
611
|
tokenEndpointAuthSigningAlgValuesSupported?: string[];
|
|
614
612
|
uiLocalesSupported?: string[];
|
|
615
613
|
};
|
|
614
|
+
/**
|
|
615
|
+
* Get the configured OAuth callback path, including the default.
|
|
616
|
+
*/
|
|
617
|
+
getRedirectPath(): string;
|
|
616
618
|
/**
|
|
617
619
|
* Handle OAuth callback from upstream provider
|
|
618
620
|
*/
|
|
@@ -777,6 +779,7 @@ declare class OAuthProxy {
|
|
|
777
779
|
* itself is a live upstream credential.
|
|
778
780
|
*/
|
|
779
781
|
private passthroughRefreshKey;
|
|
782
|
+
private redirectToClient;
|
|
780
783
|
/**
|
|
781
784
|
* Redirect to upstream OAuth provider
|
|
782
785
|
*/
|
package/dist/auth/index.cjs
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _chunk3FM67CFKcjs = require('../chunk-3FM67CFK.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
@@ -53,5 +53,5 @@ var _chunkPKJVR5H3cjs = require('../chunk-PKJVR5H3.cjs');
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
exports.AuthProvider =
|
|
56
|
+
exports.AuthProvider = _chunk3FM67CFKcjs.AuthProvider; exports.AzureProvider = _chunk3FM67CFKcjs.AzureProvider; exports.ConsentManager = _chunk3FM67CFKcjs.ConsentManager; exports.DEFAULT_ACCESS_TOKEN_TTL = _chunk3FM67CFKcjs.DEFAULT_ACCESS_TOKEN_TTL; exports.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH = _chunk3FM67CFKcjs.DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH; exports.DEFAULT_AUTHORIZATION_CODE_TTL = _chunk3FM67CFKcjs.DEFAULT_AUTHORIZATION_CODE_TTL; exports.DEFAULT_REFRESH_TOKEN_TTL = _chunk3FM67CFKcjs.DEFAULT_REFRESH_TOKEN_TTL; exports.DEFAULT_TRANSACTION_TTL = _chunk3FM67CFKcjs.DEFAULT_TRANSACTION_TTL; exports.DiskStore = _chunk3FM67CFKcjs.DiskStore; exports.EncryptedTokenStorage = _chunk3FM67CFKcjs.EncryptedTokenStorage; exports.GitHubProvider = _chunk3FM67CFKcjs.GitHubProvider; exports.GoogleProvider = _chunk3FM67CFKcjs.GoogleProvider; exports.JWKSVerifier = _chunk3FM67CFKcjs.JWKSVerifier; exports.JWTIssuer = _chunk3FM67CFKcjs.JWTIssuer; exports.MemoryTokenStorage = _chunk3FM67CFKcjs.MemoryTokenStorage; exports.OAuthProvider = _chunk3FM67CFKcjs.OAuthProvider; exports.OAuthProxy = _chunk3FM67CFKcjs.OAuthProxy; exports.OAuthProxyError = _chunk3FM67CFKcjs.OAuthProxyError; exports.PKCEUtils = _chunk3FM67CFKcjs.PKCEUtils; exports.TOKEN_ENDPOINT_AUTH_METHODS = _chunk3FM67CFKcjs.TOKEN_ENDPOINT_AUTH_METHODS; exports.getAuthSession = _chunk3FM67CFKcjs.getAuthSession; exports.requireAll = _chunk3FM67CFKcjs.requireAll; exports.requireAny = _chunk3FM67CFKcjs.requireAny; exports.requireAuth = _chunk3FM67CFKcjs.requireAuth; exports.requireRole = _chunk3FM67CFKcjs.requireRole; exports.requireScopes = _chunk3FM67CFKcjs.requireScopes;
|
|
57
57
|
//# sourceMappingURL=index.cjs.map
|
package/dist/auth/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as OAuthTransaction, C as ConsentData, T as TokenStorage, q as TokenVerifier, s as TokenVerificationResult, P as PKCEPair } from '../OAuthProvider-
|
|
2
|
-
export { A as AuthProvider, j as AuthProviderConfig, z as AuthorizationParams, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, B as ClientCode, E as DCRClientMetadata, F as DCRRequest, H as DCRResponse, D as DEFAULT_ACCESS_TOKEN_TTL, u as DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH, v as DEFAULT_AUTHORIZATION_CODE_TTL, w as DEFAULT_REFRESH_TOKEN_TTL, x as DEFAULT_TRANSACTION_TTL, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, I as OAuthError, d as OAuthProvider, J as OAuthProviderConfig, a as OAuthProxy, K as OAuthProxyConfig, t as OAuthProxyError, O as OAuthSession, L as ProxyDCRClient, R as RefreshRequest, y as TOKEN_ENDPOINT_AUTH_METHODS, M as TokenEndpointAuthMethod, N as TokenMapping, Q as TokenRequest, S as TokenResponse, U as UpstreamTokenSet, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from '../OAuthProvider-
|
|
1
|
+
import { p as OAuthTransaction, C as ConsentData, T as TokenStorage, q as TokenVerifier, s as TokenVerificationResult, P as PKCEPair } from '../OAuthProvider-DvIxa9N1.cjs';
|
|
2
|
+
export { A as AuthProvider, j as AuthProviderConfig, z as AuthorizationParams, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, B as ClientCode, E as DCRClientMetadata, F as DCRRequest, H as DCRResponse, D as DEFAULT_ACCESS_TOKEN_TTL, u as DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH, v as DEFAULT_AUTHORIZATION_CODE_TTL, w as DEFAULT_REFRESH_TOKEN_TTL, x as DEFAULT_TRANSACTION_TTL, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, I as OAuthError, d as OAuthProvider, J as OAuthProviderConfig, a as OAuthProxy, K as OAuthProxyConfig, t as OAuthProxyError, O as OAuthSession, L as ProxyDCRClient, R as RefreshRequest, y as TOKEN_ENDPOINT_AUTH_METHODS, M as TokenEndpointAuthMethod, N as TokenMapping, Q as TokenRequest, S as TokenResponse, U as UpstreamTokenSet, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from '../OAuthProvider-DvIxa9N1.cjs';
|
|
3
3
|
import 'node:http';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as OAuthTransaction, C as ConsentData, T as TokenStorage, q as TokenVerifier, s as TokenVerificationResult, P as PKCEPair } from '../OAuthProvider-
|
|
2
|
-
export { A as AuthProvider, j as AuthProviderConfig, z as AuthorizationParams, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, B as ClientCode, E as DCRClientMetadata, F as DCRRequest, H as DCRResponse, D as DEFAULT_ACCESS_TOKEN_TTL, u as DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH, v as DEFAULT_AUTHORIZATION_CODE_TTL, w as DEFAULT_REFRESH_TOKEN_TTL, x as DEFAULT_TRANSACTION_TTL, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, I as OAuthError, d as OAuthProvider, J as OAuthProviderConfig, a as OAuthProxy, K as OAuthProxyConfig, t as OAuthProxyError, O as OAuthSession, L as ProxyDCRClient, R as RefreshRequest, y as TOKEN_ENDPOINT_AUTH_METHODS, M as TokenEndpointAuthMethod, N as TokenMapping, Q as TokenRequest, S as TokenResponse, U as UpstreamTokenSet, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from '../OAuthProvider-
|
|
1
|
+
import { p as OAuthTransaction, C as ConsentData, T as TokenStorage, q as TokenVerifier, s as TokenVerificationResult, P as PKCEPair } from '../OAuthProvider-DvIxa9N1.js';
|
|
2
|
+
export { A as AuthProvider, j as AuthProviderConfig, z as AuthorizationParams, b as AzureProvider, k as AzureProviderConfig, l as AzureSession, B as ClientCode, E as DCRClientMetadata, F as DCRRequest, H as DCRResponse, D as DEFAULT_ACCESS_TOKEN_TTL, u as DEFAULT_ACCESS_TOKEN_TTL_NO_REFRESH, v as DEFAULT_AUTHORIZATION_CODE_TTL, w as DEFAULT_REFRESH_TOKEN_TTL, x as DEFAULT_TRANSACTION_TTL, m as GenericOAuthProviderConfig, G as GitHubProvider, n as GitHubSession, c as GoogleProvider, o as GoogleSession, I as OAuthError, d as OAuthProvider, J as OAuthProviderConfig, a as OAuthProxy, K as OAuthProxyConfig, t as OAuthProxyError, O as OAuthSession, L as ProxyDCRClient, R as RefreshRequest, y as TOKEN_ENDPOINT_AUTH_METHODS, M as TokenEndpointAuthMethod, N as TokenMapping, Q as TokenRequest, S as TokenResponse, U as UpstreamTokenSet, g as getAuthSession, r as requireAll, e as requireAny, f as requireAuth, h as requireRole, i as requireScopes } from '../OAuthProvider-DvIxa9N1.js';
|
|
3
3
|
import 'node:http';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/auth/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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
|
|
3
|
+
var _chunk3FM67CFKcjs = require('./chunk-3FM67CFK.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk2NZFMD6Icjs = require('./chunk-2NZFMD6I.cjs');
|
|
9
9
|
|
|
10
10
|
// src/FastMCP.ts
|
|
11
11
|
var _indexjs = require('@modelcontextprotocol/sdk/server/index.js');
|
|
@@ -141,7 +141,7 @@ var DiscoveryDocumentCache = class {
|
|
|
141
141
|
throw error;
|
|
142
142
|
}
|
|
143
143
|
if (!res.ok) {
|
|
144
|
-
await
|
|
144
|
+
await _chunk3FM67CFKcjs.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
|
|
261
|
+
await _chunk3FM67CFKcjs.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
|
|
343
|
+
await _chunk3FM67CFKcjs.cancelResponseBody.call(void 0, response);
|
|
344
344
|
throw new Error(
|
|
345
345
|
`Server responded with status: ${response.status} - ${response.statusText}`
|
|
346
346
|
);
|
|
@@ -1438,6 +1438,9 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
|
|
|
1438
1438
|
)
|
|
1439
1439
|
);
|
|
1440
1440
|
} catch (error) {
|
|
1441
|
+
if (error instanceof _typesjs.McpError) {
|
|
1442
|
+
throw error;
|
|
1443
|
+
}
|
|
1441
1444
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1442
1445
|
throw new (0, _typesjs.McpError)(
|
|
1443
1446
|
_typesjs.ErrorCode.InternalError,
|
|
@@ -1539,6 +1542,9 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
|
|
|
1539
1542
|
)
|
|
1540
1543
|
);
|
|
1541
1544
|
} catch (error) {
|
|
1545
|
+
if (error instanceof _typesjs.McpError) {
|
|
1546
|
+
throw error;
|
|
1547
|
+
}
|
|
1542
1548
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1543
1549
|
throw new (0, _typesjs.McpError)(
|
|
1544
1550
|
_typesjs.ErrorCode.InternalError,
|
|
@@ -1649,8 +1655,8 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
|
|
|
1649
1655
|
tools.map(async (tool) => {
|
|
1650
1656
|
let inputSchema;
|
|
1651
1657
|
try {
|
|
1652
|
-
inputSchema = tool.parameters ?
|
|
1653
|
-
tool.parameters["~standard"].vendor === "zod" && "_zod" in tool.parameters ?
|
|
1658
|
+
inputSchema = tool.parameters ? _chunk2NZFMD6Icjs.strictInputSchema.call(void 0,
|
|
1659
|
+
tool.parameters["~standard"].vendor === "zod" && "_zod" in tool.parameters ? _chunk2NZFMD6Icjs.zodInputSchema.call(void 0, tool.parameters, "draft-7") : await _xsschema.toJsonSchema.call(void 0, tool.parameters)
|
|
1654
1660
|
) : {
|
|
1655
1661
|
additionalProperties: false,
|
|
1656
1662
|
properties: {},
|
|
@@ -1666,7 +1672,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
|
|
|
1666
1672
|
let outputSchema;
|
|
1667
1673
|
if (tool.outputSchema) {
|
|
1668
1674
|
try {
|
|
1669
|
-
outputSchema =
|
|
1675
|
+
outputSchema = _chunk2NZFMD6Icjs.objectRootSchema.call(void 0,
|
|
1670
1676
|
await _xsschema.toJsonSchema.call(void 0, tool.outputSchema)
|
|
1671
1677
|
);
|
|
1672
1678
|
} catch (error) {
|
|
@@ -1731,21 +1737,28 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
|
|
|
1731
1737
|
const progressToken = _optionalChain([request, 'access', _62 => _62.params, 'optionalAccess', _63 => _63._meta, 'optionalAccess', _64 => _64.progressToken]);
|
|
1732
1738
|
let result;
|
|
1733
1739
|
const timeoutAbort = new AbortController();
|
|
1734
|
-
const
|
|
1740
|
+
const sourceSignal = AbortSignal.any([
|
|
1735
1741
|
timeoutAbort.signal,
|
|
1736
1742
|
this.#abortController.signal,
|
|
1737
1743
|
// Only ever aborted for an explicit `notifications/cancelled`; the
|
|
1738
1744
|
// session signal above is what covers a client that simply left.
|
|
1739
1745
|
...extra.signal ? [extra.signal] : []
|
|
1740
1746
|
]);
|
|
1747
|
+
const callAbort = new AbortController();
|
|
1748
|
+
const forwardAbort = () => callAbort.abort(sourceSignal.reason);
|
|
1749
|
+
sourceSignal.addEventListener("abort", forwardAbort, { once: true });
|
|
1750
|
+
if (sourceSignal.aborted) {
|
|
1751
|
+
forwardAbort();
|
|
1752
|
+
}
|
|
1753
|
+
const signal = callAbort.signal;
|
|
1741
1754
|
const sendNotification = async (notification) => {
|
|
1742
|
-
if (
|
|
1755
|
+
if (sourceSignal.aborted) {
|
|
1743
1756
|
return;
|
|
1744
1757
|
}
|
|
1745
1758
|
try {
|
|
1746
1759
|
await extra.sendNotification(notification);
|
|
1747
1760
|
} catch (error) {
|
|
1748
|
-
if (!
|
|
1761
|
+
if (!sourceSignal.aborted) {
|
|
1749
1762
|
throw error;
|
|
1750
1763
|
}
|
|
1751
1764
|
}
|
|
@@ -1922,6 +1935,8 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
|
|
|
1922
1935
|
],
|
|
1923
1936
|
isError: true
|
|
1924
1937
|
};
|
|
1938
|
+
} finally {
|
|
1939
|
+
sourceSignal.removeEventListener("abort", forwardAbort);
|
|
1925
1940
|
}
|
|
1926
1941
|
return result;
|
|
1927
1942
|
}
|
|
@@ -3193,7 +3208,7 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
3193
3208
|
}
|
|
3194
3209
|
return;
|
|
3195
3210
|
}
|
|
3196
|
-
if (req.method === "GET" && oauthPath ===
|
|
3211
|
+
if (req.method === "GET" && oauthPath === oauthProxy.getRedirectPath()) {
|
|
3197
3212
|
try {
|
|
3198
3213
|
const mockRequest = new Request(`http://${host}${req.url}`, {
|
|
3199
3214
|
headers: cookieHeaders(req)
|
|
@@ -3691,4 +3706,4 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
3691
3706
|
|
|
3692
3707
|
|
|
3693
3708
|
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;
|
|
3694
|
-
//# sourceMappingURL=chunk-
|
|
3709
|
+
//# sourceMappingURL=chunk-2ABBQFJB.cjs.map
|