fastmcp 4.16.3 → 4.16.5
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 +2 -2
- package/dist/FastMCP.js +1 -1
- package/dist/{chunk-KLA3HXAN.js → chunk-A3BOXAJQ.js} +15 -1
- package/dist/{chunk-KLA3HXAN.js.map → chunk-A3BOXAJQ.js.map} +1 -1
- package/dist/{chunk-GTUJ3UXA.cjs → chunk-Q67RBSU5.cjs} +19 -5
- package/dist/chunk-Q67RBSU5.cjs.map +1 -0
- package/dist/edge/index.cjs +31 -5
- package/dist/edge/index.cjs.map +1 -1
- package/dist/edge/index.d.cts +0 -3
- package/dist/edge/index.d.ts +0 -3
- package/dist/edge/index.js +41 -15
- package/dist/edge/index.js.map +1 -1
- package/dist/examples/custom-routes.cjs +2 -2
- package/dist/examples/custom-routes.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-GTUJ3UXA.cjs.map +0 -1
package/dist/FastMCP.cjs
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkQ67RBSU5cjs = require('./chunk-Q67RBSU5.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -49,5 +49,5 @@ var _chunk5FVNY65Mcjs = require('./chunk-5FVNY65M.cjs');
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
exports.AuthProvider = _chunk5FVNY65Mcjs.AuthProvider; exports.AzureProvider = _chunk5FVNY65Mcjs.AzureProvider; exports.DiscoveryDocumentCache =
|
|
52
|
+
exports.AuthProvider = _chunk5FVNY65Mcjs.AuthProvider; exports.AzureProvider = _chunk5FVNY65Mcjs.AzureProvider; exports.DiscoveryDocumentCache = _chunkQ67RBSU5cjs.DiscoveryDocumentCache; exports.FastMCP = _chunkQ67RBSU5cjs.FastMCP; exports.FastMCPError = _chunkQ67RBSU5cjs.FastMCPError; exports.FastMCPSession = _chunkQ67RBSU5cjs.FastMCPSession; exports.GitHubProvider = _chunk5FVNY65Mcjs.GitHubProvider; exports.GoogleProvider = _chunk5FVNY65Mcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkQ67RBSU5cjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunk5FVNY65Mcjs.OAuthProvider; exports.ServerState = _chunkQ67RBSU5cjs.ServerState; exports.SessionError = _chunkQ67RBSU5cjs.SessionError; exports.UnexpectedStateError = _chunkQ67RBSU5cjs.UnexpectedStateError; exports.UserError = _chunkQ67RBSU5cjs.UserError; exports.audioContent = _chunkQ67RBSU5cjs.audioContent; exports.getAuthSession = _chunk5FVNY65Mcjs.getAuthSession; exports.imageContent = _chunkQ67RBSU5cjs.imageContent; exports.jsonSchemaAdapter = _chunkQ67RBSU5cjs.jsonSchemaAdapter; exports.requireAll = _chunk5FVNY65Mcjs.requireAll; exports.requireAny = _chunk5FVNY65Mcjs.requireAny; exports.requireAuth = _chunk5FVNY65Mcjs.requireAuth; exports.requireRole = _chunk5FVNY65Mcjs.requireRole; exports.requireScopes = _chunk5FVNY65Mcjs.requireScopes;
|
|
53
53
|
//# sourceMappingURL=FastMCP.cjs.map
|
package/dist/FastMCP.js
CHANGED
|
@@ -27,6 +27,17 @@ import parseURITemplate from "uri-templates";
|
|
|
27
27
|
import { strictJsonSchema, toJsonSchema } from "xsschema";
|
|
28
28
|
import { z } from "zod";
|
|
29
29
|
|
|
30
|
+
// src/cancelResponseBody.ts
|
|
31
|
+
var cancelResponseBody = async (response) => {
|
|
32
|
+
if (!response.body) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
await response.body.cancel();
|
|
37
|
+
} catch {
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
30
41
|
// src/DiscoveryDocumentCache.ts
|
|
31
42
|
var DiscoveryDocumentCache = class {
|
|
32
43
|
get size() {
|
|
@@ -114,6 +125,7 @@ var DiscoveryDocumentCache = class {
|
|
|
114
125
|
throw error;
|
|
115
126
|
}
|
|
116
127
|
if (!res.ok) {
|
|
128
|
+
await cancelResponseBody(res);
|
|
117
129
|
throw new Error(
|
|
118
130
|
`Failed to fetch discovery document from ${url}: ${res.status} ${res.statusText}`
|
|
119
131
|
);
|
|
@@ -207,6 +219,7 @@ var imageContent = async (input) => {
|
|
|
207
219
|
signal: AbortSignal.timeout(timeoutMs)
|
|
208
220
|
});
|
|
209
221
|
if (!response.ok) {
|
|
222
|
+
await cancelResponseBody(response);
|
|
210
223
|
throw new Error(
|
|
211
224
|
`Server responded with status: ${response.status} - ${response.statusText}`
|
|
212
225
|
);
|
|
@@ -268,6 +281,7 @@ var audioContent = async (input) => {
|
|
|
268
281
|
signal: AbortSignal.timeout(timeoutMs)
|
|
269
282
|
});
|
|
270
283
|
if (!response.ok) {
|
|
284
|
+
await cancelResponseBody(response);
|
|
271
285
|
throw new Error(
|
|
272
286
|
`Server responded with status: ${response.status} - ${response.statusText}`
|
|
273
287
|
);
|
|
@@ -2805,4 +2819,4 @@ export {
|
|
|
2805
2819
|
FastMCPSession,
|
|
2806
2820
|
FastMCP
|
|
2807
2821
|
};
|
|
2808
|
-
//# sourceMappingURL=chunk-
|
|
2822
|
+
//# sourceMappingURL=chunk-A3BOXAJQ.js.map
|