fastmcp 4.15.1 → 4.15.2
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.d.cts +8 -0
- package/dist/FastMCP.d.ts +8 -0
- package/dist/FastMCP.js +1 -1
- package/dist/{chunk-JI5H5LIK.js → chunk-4VIPI4GU.js} +16 -10
- package/dist/chunk-4VIPI4GU.js.map +1 -0
- package/dist/{chunk-MD6EC4EY.cjs → chunk-N6ZZF5YB.cjs} +56 -50
- package/dist/chunk-N6ZZF5YB.cjs.map +1 -0
- package/dist/examples/custom-routes.cjs +2 -2
- package/dist/examples/custom-routes.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-JI5H5LIK.js.map +0 -1
- package/dist/chunk-MD6EC4EY.cjs.map +0 -1
package/dist/FastMCP.cjs
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkN6ZZF5YBcjs = require('./chunk-N6ZZF5YB.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 = _chunkN6ZZF5YBcjs.DiscoveryDocumentCache; exports.FastMCP = _chunkN6ZZF5YBcjs.FastMCP; exports.FastMCPError = _chunkN6ZZF5YBcjs.FastMCPError; exports.FastMCPSession = _chunkN6ZZF5YBcjs.FastMCPSession; exports.GitHubProvider = _chunk5FVNY65Mcjs.GitHubProvider; exports.GoogleProvider = _chunk5FVNY65Mcjs.GoogleProvider; exports.MEDIA_FETCH_TIMEOUT_MS = _chunkN6ZZF5YBcjs.MEDIA_FETCH_TIMEOUT_MS; exports.OAuthProvider = _chunk5FVNY65Mcjs.OAuthProvider; exports.ServerState = _chunkN6ZZF5YBcjs.ServerState; exports.SessionError = _chunkN6ZZF5YBcjs.SessionError; exports.UnexpectedStateError = _chunkN6ZZF5YBcjs.UnexpectedStateError; exports.UserError = _chunkN6ZZF5YBcjs.UserError; exports.audioContent = _chunkN6ZZF5YBcjs.audioContent; exports.getAuthSession = _chunk5FVNY65Mcjs.getAuthSession; exports.imageContent = _chunkN6ZZF5YBcjs.imageContent; exports.jsonSchemaAdapter = _chunkN6ZZF5YBcjs.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.d.cts
CHANGED
|
@@ -884,6 +884,14 @@ declare class FastMCPSession<T extends FastMCPSessionAuth = FastMCPSessionAuth>
|
|
|
884
884
|
get loggingLevel(): LoggingLevel;
|
|
885
885
|
get roots(): Root[];
|
|
886
886
|
get server(): Server;
|
|
887
|
+
/**
|
|
888
|
+
* The HTTP session ID, or `undefined` for transports that do not have one.
|
|
889
|
+
*
|
|
890
|
+
* Resolved from the transport on every read rather than captured when the
|
|
891
|
+
* session connects: `StreamableHTTPServerTransport` assigns its `sessionId`
|
|
892
|
+
* while it handles `initialize`, which happens after `connect()` resolves.
|
|
893
|
+
* A value read at connect time is therefore still `undefined`.
|
|
894
|
+
*/
|
|
887
895
|
get sessionId(): string | undefined;
|
|
888
896
|
set sessionId(value: string | undefined);
|
|
889
897
|
constructor({ auth, icons, instructions, logger, name, onToolCall, ping, prompts, resources, resourcesTemplates, roots, sessionId, stateless, streamKeepalive, title, tools, transportType, utils, version, websiteUrl, }: {
|
package/dist/FastMCP.d.ts
CHANGED
|
@@ -884,6 +884,14 @@ declare class FastMCPSession<T extends FastMCPSessionAuth = FastMCPSessionAuth>
|
|
|
884
884
|
get loggingLevel(): LoggingLevel;
|
|
885
885
|
get roots(): Root[];
|
|
886
886
|
get server(): Server;
|
|
887
|
+
/**
|
|
888
|
+
* The HTTP session ID, or `undefined` for transports that do not have one.
|
|
889
|
+
*
|
|
890
|
+
* Resolved from the transport on every read rather than captured when the
|
|
891
|
+
* session connects: `StreamableHTTPServerTransport` assigns its `sessionId`
|
|
892
|
+
* while it handles `initialize`, which happens after `connect()` resolves.
|
|
893
|
+
* A value read at connect time is therefore still `undefined`.
|
|
894
|
+
*/
|
|
887
895
|
get sessionId(): string | undefined;
|
|
888
896
|
set sessionId(value: string | undefined);
|
|
889
897
|
constructor({ auth, icons, instructions, logger, name, onToolCall, ping, prompts, resources, resourcesTemplates, roots, sessionId, stateless, streamKeepalive, title, tools, transportType, utils, version, websiteUrl, }: {
|
package/dist/FastMCP.js
CHANGED
|
@@ -464,8 +464,20 @@ var FastMCPSession = class extends FastMCPSessionEventEmitter {
|
|
|
464
464
|
get server() {
|
|
465
465
|
return this.#server;
|
|
466
466
|
}
|
|
467
|
+
/**
|
|
468
|
+
* The HTTP session ID, or `undefined` for transports that do not have one.
|
|
469
|
+
*
|
|
470
|
+
* Resolved from the transport on every read rather than captured when the
|
|
471
|
+
* session connects: `StreamableHTTPServerTransport` assigns its `sessionId`
|
|
472
|
+
* while it handles `initialize`, which happens after `connect()` resolves.
|
|
473
|
+
* A value read at connect time is therefore still `undefined`.
|
|
474
|
+
*/
|
|
467
475
|
get sessionId() {
|
|
468
|
-
|
|
476
|
+
if (this.#sessionId !== void 0) {
|
|
477
|
+
return this.#sessionId;
|
|
478
|
+
}
|
|
479
|
+
const transport = this.#server.transport;
|
|
480
|
+
return typeof transport?.sessionId === "string" ? transport.sessionId : void 0;
|
|
469
481
|
}
|
|
470
482
|
set sessionId(value) {
|
|
471
483
|
this.#sessionId = value;
|
|
@@ -604,12 +616,6 @@ var FastMCPSession = class extends FastMCPSessionEventEmitter {
|
|
|
604
616
|
this.#connectionState = "connecting";
|
|
605
617
|
try {
|
|
606
618
|
await this.#server.connect(transport);
|
|
607
|
-
if ("sessionId" in transport) {
|
|
608
|
-
const transportWithSessionId = transport;
|
|
609
|
-
if (typeof transportWithSessionId.sessionId === "string") {
|
|
610
|
-
this.#sessionId = transportWithSessionId.sessionId;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
619
|
if (!this.#stateless) {
|
|
614
620
|
let attempt = 0;
|
|
615
621
|
const maxAttempts = 10;
|
|
@@ -806,7 +812,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
|
|
|
806
812
|
log: this.#createLog(),
|
|
807
813
|
requestId: typeof meta?.requestId === "string" ? meta.requestId : void 0,
|
|
808
814
|
session: this.#auth,
|
|
809
|
-
sessionId: this
|
|
815
|
+
sessionId: this.sessionId
|
|
810
816
|
};
|
|
811
817
|
}
|
|
812
818
|
#createLog() {
|
|
@@ -1414,7 +1420,7 @@ ${error instanceof Error ? error.stack : JSON.stringify(error)}`
|
|
|
1414
1420
|
reportProgress,
|
|
1415
1421
|
requestId: typeof request.params?._meta?.requestId === "string" ? request.params._meta.requestId : void 0,
|
|
1416
1422
|
session: this.#auth,
|
|
1417
|
-
sessionId: this
|
|
1423
|
+
sessionId: this.sessionId,
|
|
1418
1424
|
streamContent
|
|
1419
1425
|
})
|
|
1420
1426
|
);
|
|
@@ -2761,4 +2767,4 @@ export {
|
|
|
2761
2767
|
FastMCPSession,
|
|
2762
2768
|
FastMCP
|
|
2763
2769
|
};
|
|
2764
|
-
//# sourceMappingURL=chunk-
|
|
2770
|
+
//# sourceMappingURL=chunk-4VIPI4GU.js.map
|