@frontmcp/sdk 1.0.0-beta.4 → 1.0.0-beta.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/esm/index.mjs +23 -16
- package/index.js +23 -16
- package/package.json +8 -8
- package/transport/mcp-handlers/initialize-request.handler.d.ts.map +1 -1
package/esm/index.mjs
CHANGED
|
@@ -28342,6 +28342,11 @@ var init_sse_transport = __esm({
|
|
|
28342
28342
|
// libs/sdk/src/transport/mcp-handlers/initialize-request.handler.ts
|
|
28343
28343
|
import { InitializeRequestSchema } from "@frontmcp/protocol";
|
|
28344
28344
|
import { LATEST_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS } from "@frontmcp/protocol";
|
|
28345
|
+
function persistInitPayload(sessionId, initPayload, ctx) {
|
|
28346
|
+
updateSessionPayload(sessionId, initPayload);
|
|
28347
|
+
const transport = ctx.authInfo?.transport;
|
|
28348
|
+
transport?.setInitSessionPayload(initPayload);
|
|
28349
|
+
}
|
|
28345
28350
|
function guardClientVersion(clientVersion) {
|
|
28346
28351
|
const parsed = new Date(clientVersion);
|
|
28347
28352
|
if (isNaN(parsed.getTime())) {
|
|
@@ -28402,28 +28407,30 @@ function initializeRequestHandler({
|
|
|
28402
28407
|
if (finalPlatform) {
|
|
28403
28408
|
ctx.authInfo.sessionIdPayload.platformType = finalPlatform;
|
|
28404
28409
|
}
|
|
28405
|
-
|
|
28406
|
-
|
|
28407
|
-
|
|
28408
|
-
|
|
28409
|
-
|
|
28410
|
-
|
|
28411
|
-
|
|
28412
|
-
|
|
28413
|
-
|
|
28410
|
+
persistInitPayload(
|
|
28411
|
+
sessionId,
|
|
28412
|
+
{
|
|
28413
|
+
clientName,
|
|
28414
|
+
clientVersion,
|
|
28415
|
+
supportsElicitation: clientSupportsElicitation,
|
|
28416
|
+
...finalPlatform && { platformType: finalPlatform }
|
|
28417
|
+
},
|
|
28418
|
+
ctx
|
|
28419
|
+
);
|
|
28414
28420
|
}
|
|
28415
28421
|
} else if (ctx.authInfo?.sessionIdPayload) {
|
|
28416
28422
|
ctx.authInfo.sessionIdPayload.supportsElicitation = clientSupportsElicitation;
|
|
28417
28423
|
if (detectedPlatform) {
|
|
28418
28424
|
ctx.authInfo.sessionIdPayload.platformType = detectedPlatform;
|
|
28419
28425
|
}
|
|
28420
|
-
|
|
28421
|
-
|
|
28422
|
-
|
|
28423
|
-
|
|
28424
|
-
|
|
28425
|
-
|
|
28426
|
-
|
|
28426
|
+
persistInitPayload(
|
|
28427
|
+
sessionId,
|
|
28428
|
+
{
|
|
28429
|
+
supportsElicitation: clientSupportsElicitation,
|
|
28430
|
+
...detectedPlatform && { platformType: detectedPlatform }
|
|
28431
|
+
},
|
|
28432
|
+
ctx
|
|
28433
|
+
);
|
|
28427
28434
|
}
|
|
28428
28435
|
}
|
|
28429
28436
|
const requestedVersion = request.params.protocolVersion;
|
package/index.js
CHANGED
|
@@ -28278,6 +28278,11 @@ var init_sse_transport = __esm({
|
|
|
28278
28278
|
});
|
|
28279
28279
|
|
|
28280
28280
|
// libs/sdk/src/transport/mcp-handlers/initialize-request.handler.ts
|
|
28281
|
+
function persistInitPayload(sessionId, initPayload, ctx) {
|
|
28282
|
+
updateSessionPayload(sessionId, initPayload);
|
|
28283
|
+
const transport = ctx.authInfo?.transport;
|
|
28284
|
+
transport?.setInitSessionPayload(initPayload);
|
|
28285
|
+
}
|
|
28281
28286
|
function guardClientVersion(clientVersion) {
|
|
28282
28287
|
const parsed = new Date(clientVersion);
|
|
28283
28288
|
if (isNaN(parsed.getTime())) {
|
|
@@ -28338,28 +28343,30 @@ function initializeRequestHandler({
|
|
|
28338
28343
|
if (finalPlatform) {
|
|
28339
28344
|
ctx.authInfo.sessionIdPayload.platformType = finalPlatform;
|
|
28340
28345
|
}
|
|
28341
|
-
|
|
28342
|
-
|
|
28343
|
-
|
|
28344
|
-
|
|
28345
|
-
|
|
28346
|
-
|
|
28347
|
-
|
|
28348
|
-
|
|
28349
|
-
|
|
28346
|
+
persistInitPayload(
|
|
28347
|
+
sessionId,
|
|
28348
|
+
{
|
|
28349
|
+
clientName,
|
|
28350
|
+
clientVersion,
|
|
28351
|
+
supportsElicitation: clientSupportsElicitation,
|
|
28352
|
+
...finalPlatform && { platformType: finalPlatform }
|
|
28353
|
+
},
|
|
28354
|
+
ctx
|
|
28355
|
+
);
|
|
28350
28356
|
}
|
|
28351
28357
|
} else if (ctx.authInfo?.sessionIdPayload) {
|
|
28352
28358
|
ctx.authInfo.sessionIdPayload.supportsElicitation = clientSupportsElicitation;
|
|
28353
28359
|
if (detectedPlatform) {
|
|
28354
28360
|
ctx.authInfo.sessionIdPayload.platformType = detectedPlatform;
|
|
28355
28361
|
}
|
|
28356
|
-
|
|
28357
|
-
|
|
28358
|
-
|
|
28359
|
-
|
|
28360
|
-
|
|
28361
|
-
|
|
28362
|
-
|
|
28362
|
+
persistInitPayload(
|
|
28363
|
+
sessionId,
|
|
28364
|
+
{
|
|
28365
|
+
supportsElicitation: clientSupportsElicitation,
|
|
28366
|
+
...detectedPlatform && { platformType: detectedPlatform }
|
|
28367
|
+
},
|
|
28368
|
+
ctx
|
|
28369
|
+
);
|
|
28363
28370
|
}
|
|
28364
28371
|
}
|
|
28365
28372
|
const requestedVersion = request.params.protocolVersion;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/sdk",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.5",
|
|
4
4
|
"description": "FrontMCP SDK",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://docs.agentfront.dev",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"raw-body": "^3.0.0",
|
|
74
74
|
"content-type": "^1.0.5",
|
|
75
75
|
"@vercel/kv": "^3.0.0",
|
|
76
|
-
"@frontmcp/storage-sqlite": "1.0.0-beta.
|
|
76
|
+
"@frontmcp/storage-sqlite": "1.0.0-beta.5",
|
|
77
77
|
"@enclave-vm/core": "^2.11.1",
|
|
78
78
|
"openai": "^4.0.0 || ^5.0.0 || ^6.0.0",
|
|
79
79
|
"@anthropic-ai/sdk": "^0.30.0 || ^0.78.0"
|
|
@@ -97,12 +97,12 @@
|
|
|
97
97
|
},
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@types/cors": "^2.8.17",
|
|
100
|
-
"@frontmcp/utils": "1.0.0-beta.
|
|
101
|
-
"@frontmcp/guard": "1.0.0-beta.
|
|
102
|
-
"@frontmcp/di": "1.0.0-beta.
|
|
103
|
-
"@frontmcp/uipack": "1.0.0-beta.
|
|
104
|
-
"@frontmcp/auth": "1.0.0-beta.
|
|
105
|
-
"@frontmcp/protocol": "1.0.0-beta.
|
|
100
|
+
"@frontmcp/utils": "1.0.0-beta.5",
|
|
101
|
+
"@frontmcp/guard": "1.0.0-beta.5",
|
|
102
|
+
"@frontmcp/di": "1.0.0-beta.5",
|
|
103
|
+
"@frontmcp/uipack": "1.0.0-beta.5",
|
|
104
|
+
"@frontmcp/auth": "1.0.0-beta.5",
|
|
105
|
+
"@frontmcp/protocol": "1.0.0-beta.5",
|
|
106
106
|
"ioredis": "^5.8.0",
|
|
107
107
|
"vectoriadb": "^2.1.3",
|
|
108
108
|
"js-yaml": "^4.1.1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize-request.handler.d.ts","sourceRoot":"","sources":["../../../src/transport/mcp-handlers/initialize-request.handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"initialize-request.handler.d.ts","sourceRoot":"","sources":["../../../src/transport/mcp-handlers/initialize-request.handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAwCrE,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,aAAa,EACb,KAAK,GACN,EAAE,iBAAiB,GAAG,UAAU,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CA+IrE"}
|