@frontmcp/sdk 1.0.0-beta.3 → 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/auth/session/utils/session-id.utils.d.ts +9 -6
- package/auth/session/utils/session-id.utils.d.ts.map +1 -1
- package/esm/index.mjs +69 -22
- package/index.js +69 -22
- package/package.json +9 -9
- package/transport/adapters/transport.local.adapter.d.ts +13 -0
- package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
- package/transport/mcp-handlers/initialize-request.handler.d.ts.map +1 -1
|
@@ -34,15 +34,18 @@ export declare function createSessionId(protocol: TransportProtocolType, token:
|
|
|
34
34
|
export declare function generateSessionCookie(sessionId: string, ttlInMinutes?: number): string;
|
|
35
35
|
export declare function extractSessionFromCookie(cookie?: string): string | undefined;
|
|
36
36
|
/**
|
|
37
|
-
* Update a cached session payload with new data
|
|
38
|
-
*
|
|
39
|
-
* after the initial session creation.
|
|
37
|
+
* Update a cached session payload with new data and re-encrypt to produce
|
|
38
|
+
* a new session ID that carries the updated payload.
|
|
40
39
|
*
|
|
41
|
-
*
|
|
40
|
+
* This ensures that any node in a distributed system (including Vercel Edge
|
|
41
|
+
* and Cloudflare Workers) can decrypt the session ID and get the full
|
|
42
|
+
* payload with initialization data (e.g., supportsElicitation, platformType).
|
|
43
|
+
*
|
|
44
|
+
* @param sessionId - The current session ID to update
|
|
42
45
|
* @param updates - Partial payload updates to merge
|
|
43
|
-
* @returns
|
|
46
|
+
* @returns The new session ID with the updated payload baked in, or null if session was invalid
|
|
44
47
|
*/
|
|
45
|
-
export declare function updateSessionPayload(sessionId: string, updates: Partial<SessionIdPayload>):
|
|
48
|
+
export declare function updateSessionPayload(sessionId: string, updates: Partial<SessionIdPayload>): string | null;
|
|
46
49
|
/**
|
|
47
50
|
* Retrieve client info (name/version) from a session ID.
|
|
48
51
|
* Useful for logging, stateless access, or when NotificationService is not available.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-id.utils.d.ts","sourceRoot":"","sources":["../../../../src/auth/session/utils/session-id.utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAkB,MAAM,gBAAgB,CAAC;AAE9F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AA8CrF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAe/E;AAMD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,KAAK,EAAE,MAAM,GACZ;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAA;CAAE,GAAG,SAAS,CAmBvD;AAED,MAAM,WAAW,oBAAoB;IACnC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB;;;EA0B7G;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,SAAU,GAAG,MAAM,CAGvF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI5E;AAED
|
|
1
|
+
{"version":3,"file":"session-id.utils.d.ts","sourceRoot":"","sources":["../../../../src/auth/session/utils/session-id.utils.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAkB,MAAM,gBAAgB,CAAC;AAE9F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AA8CrF;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAe/E;AAMD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,KAAK,EAAE,MAAM,GACZ;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAA;CAAE,GAAG,SAAS,CAmBvD;AAED,MAAM,WAAW,oBAAoB;IACnC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAClD;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB;;;EA0B7G;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,SAAU,GAAG,MAAM,CAGvF;AAED,wBAAgB,wBAAwB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI5E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,MAAM,GAAG,IAAI,CA0BzG;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAiBlG"}
|
package/esm/index.mjs
CHANGED
|
@@ -24280,20 +24280,22 @@ function createSessionId(protocol, token, options) {
|
|
|
24280
24280
|
return { id, payload };
|
|
24281
24281
|
}
|
|
24282
24282
|
function updateSessionPayload(sessionId, updates) {
|
|
24283
|
+
let payload;
|
|
24283
24284
|
const existing = cache.get(sessionId);
|
|
24284
24285
|
if (existing) {
|
|
24285
|
-
|
|
24286
|
-
|
|
24287
|
-
|
|
24288
|
-
|
|
24289
|
-
|
|
24290
|
-
|
|
24291
|
-
const payload = decrypted;
|
|
24292
|
-
Object.assign(payload, updates);
|
|
24293
|
-
cache.set(sessionId, payload);
|
|
24294
|
-
return true;
|
|
24286
|
+
payload = existing;
|
|
24287
|
+
} else {
|
|
24288
|
+
const decrypted = safeDecrypt(sessionId);
|
|
24289
|
+
if (hasValidSessionStructure(decrypted) || isValidPublicSessionPayload(decrypted)) {
|
|
24290
|
+
payload = decrypted;
|
|
24291
|
+
}
|
|
24295
24292
|
}
|
|
24296
|
-
return
|
|
24293
|
+
if (!payload) return null;
|
|
24294
|
+
Object.assign(payload, updates);
|
|
24295
|
+
const newSessionId = encryptJson(payload);
|
|
24296
|
+
cache.set(sessionId, payload);
|
|
24297
|
+
cache.set(newSessionId, payload);
|
|
24298
|
+
return newSessionId;
|
|
24297
24299
|
}
|
|
24298
24300
|
var cache;
|
|
24299
24301
|
var init_session_id_utils = __esm({
|
|
@@ -28340,6 +28342,11 @@ var init_sse_transport = __esm({
|
|
|
28340
28342
|
// libs/sdk/src/transport/mcp-handlers/initialize-request.handler.ts
|
|
28341
28343
|
import { InitializeRequestSchema } from "@frontmcp/protocol";
|
|
28342
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
|
+
}
|
|
28343
28350
|
function guardClientVersion(clientVersion) {
|
|
28344
28351
|
const parsed = new Date(clientVersion);
|
|
28345
28352
|
if (isNaN(parsed.getTime())) {
|
|
@@ -28400,22 +28407,30 @@ function initializeRequestHandler({
|
|
|
28400
28407
|
if (finalPlatform) {
|
|
28401
28408
|
ctx.authInfo.sessionIdPayload.platformType = finalPlatform;
|
|
28402
28409
|
}
|
|
28403
|
-
|
|
28404
|
-
|
|
28405
|
-
|
|
28406
|
-
|
|
28407
|
-
|
|
28408
|
-
|
|
28410
|
+
persistInitPayload(
|
|
28411
|
+
sessionId,
|
|
28412
|
+
{
|
|
28413
|
+
clientName,
|
|
28414
|
+
clientVersion,
|
|
28415
|
+
supportsElicitation: clientSupportsElicitation,
|
|
28416
|
+
...finalPlatform && { platformType: finalPlatform }
|
|
28417
|
+
},
|
|
28418
|
+
ctx
|
|
28419
|
+
);
|
|
28409
28420
|
}
|
|
28410
28421
|
} else if (ctx.authInfo?.sessionIdPayload) {
|
|
28411
28422
|
ctx.authInfo.sessionIdPayload.supportsElicitation = clientSupportsElicitation;
|
|
28412
28423
|
if (detectedPlatform) {
|
|
28413
28424
|
ctx.authInfo.sessionIdPayload.platformType = detectedPlatform;
|
|
28414
28425
|
}
|
|
28415
|
-
|
|
28416
|
-
|
|
28417
|
-
|
|
28418
|
-
|
|
28426
|
+
persistInitPayload(
|
|
28427
|
+
sessionId,
|
|
28428
|
+
{
|
|
28429
|
+
supportsElicitation: clientSupportsElicitation,
|
|
28430
|
+
...detectedPlatform && { platformType: detectedPlatform }
|
|
28431
|
+
},
|
|
28432
|
+
ctx
|
|
28433
|
+
);
|
|
28419
28434
|
}
|
|
28420
28435
|
}
|
|
28421
28436
|
const requestedVersion = request.params.protocolVersion;
|
|
@@ -29395,6 +29410,21 @@ var init_transport_local_adapter = __esm({
|
|
|
29395
29410
|
* New elicit requests will cancel any pending one.
|
|
29396
29411
|
*/
|
|
29397
29412
|
pendingElicit;
|
|
29413
|
+
/**
|
|
29414
|
+
* Session payload fields set during MCP initialize.
|
|
29415
|
+
* Stored on the adapter instance so they survive across requests in SSE mode
|
|
29416
|
+
* (where each POST creates a fresh anonymous HTTP session) and are available
|
|
29417
|
+
* in distributed environments without relying on local in-memory caches.
|
|
29418
|
+
*/
|
|
29419
|
+
initSessionPayload;
|
|
29420
|
+
/**
|
|
29421
|
+
* Called by the initialize request handler to persist initialization data
|
|
29422
|
+
* on the transport adapter instance. This data is merged into the session
|
|
29423
|
+
* payload on every subsequent request via ensureAuthInfo().
|
|
29424
|
+
*/
|
|
29425
|
+
setInitSessionPayload(payload) {
|
|
29426
|
+
this.initSessionPayload = payload;
|
|
29427
|
+
}
|
|
29398
29428
|
#requestId = 1;
|
|
29399
29429
|
ready;
|
|
29400
29430
|
server;
|
|
@@ -29413,6 +29443,7 @@ var init_transport_local_adapter = __esm({
|
|
|
29413
29443
|
const hasAgents = this.scope.agents.hasAny();
|
|
29414
29444
|
const completionsCapability = hasPrompts || hasResources ? { completions: {} } : {};
|
|
29415
29445
|
const remoteCapabilities = hasRemoteApps ? this.buildRemoteCapabilities() : {};
|
|
29446
|
+
const elicitationCapability = this.scope.metadata.elicitation?.enabled ? { elicitation: {} } : {};
|
|
29416
29447
|
const serverOptions = {
|
|
29417
29448
|
instructions: "",
|
|
29418
29449
|
capabilities: {
|
|
@@ -29425,7 +29456,8 @@ var init_transport_local_adapter = __esm({
|
|
|
29425
29456
|
// Include agent capabilities (agents as tools)
|
|
29426
29457
|
...completionsCapability,
|
|
29427
29458
|
// MCP logging protocol support - allows clients to set log level via logging/setLevel
|
|
29428
|
-
logging: {}
|
|
29459
|
+
logging: {},
|
|
29460
|
+
...elicitationCapability
|
|
29429
29461
|
},
|
|
29430
29462
|
serverInfo: info
|
|
29431
29463
|
};
|
|
@@ -29492,6 +29524,21 @@ var init_transport_local_adapter = __esm({
|
|
|
29492
29524
|
const { token, user, session } = req[ServerRequestTokens.auth];
|
|
29493
29525
|
const sessionId = session?.id ?? `fallback:${Date.now()}`;
|
|
29494
29526
|
const sessionPayload = session?.payload ?? { protocol: "streamable-http" };
|
|
29527
|
+
if (this.initSessionPayload) {
|
|
29528
|
+
const init = this.initSessionPayload;
|
|
29529
|
+
if (init.supportsElicitation !== void 0 && sessionPayload.supportsElicitation === void 0) {
|
|
29530
|
+
sessionPayload.supportsElicitation = init.supportsElicitation;
|
|
29531
|
+
}
|
|
29532
|
+
if (init.platformType !== void 0 && sessionPayload.platformType === void 0) {
|
|
29533
|
+
sessionPayload["platformType"] = init.platformType;
|
|
29534
|
+
}
|
|
29535
|
+
if (init.clientName !== void 0 && sessionPayload.clientName === void 0) {
|
|
29536
|
+
sessionPayload.clientName = init.clientName;
|
|
29537
|
+
}
|
|
29538
|
+
if (init.clientVersion !== void 0 && sessionPayload.clientVersion === void 0) {
|
|
29539
|
+
sessionPayload.clientVersion = init.clientVersion;
|
|
29540
|
+
}
|
|
29541
|
+
}
|
|
29495
29542
|
const authInfo = {
|
|
29496
29543
|
token,
|
|
29497
29544
|
user,
|
package/index.js
CHANGED
|
@@ -24257,20 +24257,22 @@ function createSessionId(protocol, token, options) {
|
|
|
24257
24257
|
return { id, payload };
|
|
24258
24258
|
}
|
|
24259
24259
|
function updateSessionPayload(sessionId, updates) {
|
|
24260
|
+
let payload;
|
|
24260
24261
|
const existing = cache.get(sessionId);
|
|
24261
24262
|
if (existing) {
|
|
24262
|
-
|
|
24263
|
-
|
|
24264
|
-
|
|
24265
|
-
|
|
24266
|
-
|
|
24267
|
-
|
|
24268
|
-
const payload = decrypted;
|
|
24269
|
-
Object.assign(payload, updates);
|
|
24270
|
-
cache.set(sessionId, payload);
|
|
24271
|
-
return true;
|
|
24263
|
+
payload = existing;
|
|
24264
|
+
} else {
|
|
24265
|
+
const decrypted = (0, import_auth13.safeDecrypt)(sessionId);
|
|
24266
|
+
if (hasValidSessionStructure(decrypted) || isValidPublicSessionPayload(decrypted)) {
|
|
24267
|
+
payload = decrypted;
|
|
24268
|
+
}
|
|
24272
24269
|
}
|
|
24273
|
-
return
|
|
24270
|
+
if (!payload) return null;
|
|
24271
|
+
Object.assign(payload, updates);
|
|
24272
|
+
const newSessionId = (0, import_auth13.encryptJson)(payload);
|
|
24273
|
+
cache.set(sessionId, payload);
|
|
24274
|
+
cache.set(newSessionId, payload);
|
|
24275
|
+
return newSessionId;
|
|
24274
24276
|
}
|
|
24275
24277
|
var import_utils39, import_auth13, import_auth14, cache;
|
|
24276
24278
|
var init_session_id_utils = __esm({
|
|
@@ -28276,6 +28278,11 @@ var init_sse_transport = __esm({
|
|
|
28276
28278
|
});
|
|
28277
28279
|
|
|
28278
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
|
+
}
|
|
28279
28286
|
function guardClientVersion(clientVersion) {
|
|
28280
28287
|
const parsed = new Date(clientVersion);
|
|
28281
28288
|
if (isNaN(parsed.getTime())) {
|
|
@@ -28336,22 +28343,30 @@ function initializeRequestHandler({
|
|
|
28336
28343
|
if (finalPlatform) {
|
|
28337
28344
|
ctx.authInfo.sessionIdPayload.platformType = finalPlatform;
|
|
28338
28345
|
}
|
|
28339
|
-
|
|
28340
|
-
|
|
28341
|
-
|
|
28342
|
-
|
|
28343
|
-
|
|
28344
|
-
|
|
28346
|
+
persistInitPayload(
|
|
28347
|
+
sessionId,
|
|
28348
|
+
{
|
|
28349
|
+
clientName,
|
|
28350
|
+
clientVersion,
|
|
28351
|
+
supportsElicitation: clientSupportsElicitation,
|
|
28352
|
+
...finalPlatform && { platformType: finalPlatform }
|
|
28353
|
+
},
|
|
28354
|
+
ctx
|
|
28355
|
+
);
|
|
28345
28356
|
}
|
|
28346
28357
|
} else if (ctx.authInfo?.sessionIdPayload) {
|
|
28347
28358
|
ctx.authInfo.sessionIdPayload.supportsElicitation = clientSupportsElicitation;
|
|
28348
28359
|
if (detectedPlatform) {
|
|
28349
28360
|
ctx.authInfo.sessionIdPayload.platformType = detectedPlatform;
|
|
28350
28361
|
}
|
|
28351
|
-
|
|
28352
|
-
|
|
28353
|
-
|
|
28354
|
-
|
|
28362
|
+
persistInitPayload(
|
|
28363
|
+
sessionId,
|
|
28364
|
+
{
|
|
28365
|
+
supportsElicitation: clientSupportsElicitation,
|
|
28366
|
+
...detectedPlatform && { platformType: detectedPlatform }
|
|
28367
|
+
},
|
|
28368
|
+
ctx
|
|
28369
|
+
);
|
|
28355
28370
|
}
|
|
28356
28371
|
}
|
|
28357
28372
|
const requestedVersion = request.params.protocolVersion;
|
|
@@ -29345,6 +29360,21 @@ var init_transport_local_adapter = __esm({
|
|
|
29345
29360
|
* New elicit requests will cancel any pending one.
|
|
29346
29361
|
*/
|
|
29347
29362
|
pendingElicit;
|
|
29363
|
+
/**
|
|
29364
|
+
* Session payload fields set during MCP initialize.
|
|
29365
|
+
* Stored on the adapter instance so they survive across requests in SSE mode
|
|
29366
|
+
* (where each POST creates a fresh anonymous HTTP session) and are available
|
|
29367
|
+
* in distributed environments without relying on local in-memory caches.
|
|
29368
|
+
*/
|
|
29369
|
+
initSessionPayload;
|
|
29370
|
+
/**
|
|
29371
|
+
* Called by the initialize request handler to persist initialization data
|
|
29372
|
+
* on the transport adapter instance. This data is merged into the session
|
|
29373
|
+
* payload on every subsequent request via ensureAuthInfo().
|
|
29374
|
+
*/
|
|
29375
|
+
setInitSessionPayload(payload) {
|
|
29376
|
+
this.initSessionPayload = payload;
|
|
29377
|
+
}
|
|
29348
29378
|
#requestId = 1;
|
|
29349
29379
|
ready;
|
|
29350
29380
|
server;
|
|
@@ -29363,6 +29393,7 @@ var init_transport_local_adapter = __esm({
|
|
|
29363
29393
|
const hasAgents = this.scope.agents.hasAny();
|
|
29364
29394
|
const completionsCapability = hasPrompts || hasResources ? { completions: {} } : {};
|
|
29365
29395
|
const remoteCapabilities = hasRemoteApps ? this.buildRemoteCapabilities() : {};
|
|
29396
|
+
const elicitationCapability = this.scope.metadata.elicitation?.enabled ? { elicitation: {} } : {};
|
|
29366
29397
|
const serverOptions = {
|
|
29367
29398
|
instructions: "",
|
|
29368
29399
|
capabilities: {
|
|
@@ -29375,7 +29406,8 @@ var init_transport_local_adapter = __esm({
|
|
|
29375
29406
|
// Include agent capabilities (agents as tools)
|
|
29376
29407
|
...completionsCapability,
|
|
29377
29408
|
// MCP logging protocol support - allows clients to set log level via logging/setLevel
|
|
29378
|
-
logging: {}
|
|
29409
|
+
logging: {},
|
|
29410
|
+
...elicitationCapability
|
|
29379
29411
|
},
|
|
29380
29412
|
serverInfo: info
|
|
29381
29413
|
};
|
|
@@ -29442,6 +29474,21 @@ var init_transport_local_adapter = __esm({
|
|
|
29442
29474
|
const { token, user, session } = req[ServerRequestTokens.auth];
|
|
29443
29475
|
const sessionId = session?.id ?? `fallback:${Date.now()}`;
|
|
29444
29476
|
const sessionPayload = session?.payload ?? { protocol: "streamable-http" };
|
|
29477
|
+
if (this.initSessionPayload) {
|
|
29478
|
+
const init = this.initSessionPayload;
|
|
29479
|
+
if (init.supportsElicitation !== void 0 && sessionPayload.supportsElicitation === void 0) {
|
|
29480
|
+
sessionPayload.supportsElicitation = init.supportsElicitation;
|
|
29481
|
+
}
|
|
29482
|
+
if (init.platformType !== void 0 && sessionPayload.platformType === void 0) {
|
|
29483
|
+
sessionPayload["platformType"] = init.platformType;
|
|
29484
|
+
}
|
|
29485
|
+
if (init.clientName !== void 0 && sessionPayload.clientName === void 0) {
|
|
29486
|
+
sessionPayload.clientName = init.clientName;
|
|
29487
|
+
}
|
|
29488
|
+
if (init.clientVersion !== void 0 && sessionPayload.clientVersion === void 0) {
|
|
29489
|
+
sessionPayload.clientVersion = init.clientVersion;
|
|
29490
|
+
}
|
|
29491
|
+
}
|
|
29445
29492
|
const authInfo = {
|
|
29446
29493
|
token,
|
|
29447
29494
|
user,
|
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",
|
|
@@ -72,9 +72,8 @@
|
|
|
72
72
|
"cors": "^2.8.5",
|
|
73
73
|
"raw-body": "^3.0.0",
|
|
74
74
|
"content-type": "^1.0.5",
|
|
75
|
-
"vectoriadb": "^2.1.3",
|
|
76
75
|
"@vercel/kv": "^3.0.0",
|
|
77
|
-
"@frontmcp/storage-sqlite": "1.0.0-beta.
|
|
76
|
+
"@frontmcp/storage-sqlite": "1.0.0-beta.5",
|
|
78
77
|
"@enclave-vm/core": "^2.11.1",
|
|
79
78
|
"openai": "^4.0.0 || ^5.0.0 || ^6.0.0",
|
|
80
79
|
"@anthropic-ai/sdk": "^0.30.0 || ^0.78.0"
|
|
@@ -98,13 +97,14 @@
|
|
|
98
97
|
},
|
|
99
98
|
"dependencies": {
|
|
100
99
|
"@types/cors": "^2.8.17",
|
|
101
|
-
"@frontmcp/utils": "1.0.0-beta.
|
|
102
|
-
"@frontmcp/guard": "1.0.0-beta.
|
|
103
|
-
"@frontmcp/di": "1.0.0-beta.
|
|
104
|
-
"@frontmcp/uipack": "1.0.0-beta.
|
|
105
|
-
"@frontmcp/auth": "1.0.0-beta.
|
|
106
|
-
"@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",
|
|
107
106
|
"ioredis": "^5.8.0",
|
|
107
|
+
"vectoriadb": "^2.1.3",
|
|
108
108
|
"js-yaml": "^4.1.1",
|
|
109
109
|
"jose": "^6.1.3",
|
|
110
110
|
"reflect-metadata": "^0.2.2",
|
|
@@ -28,6 +28,19 @@ export declare abstract class LocalTransportAdapter<T extends SupportedTransport
|
|
|
28
28
|
* New elicit requests will cancel any pending one.
|
|
29
29
|
*/
|
|
30
30
|
protected pendingElicit?: PendingElicit;
|
|
31
|
+
/**
|
|
32
|
+
* Session payload fields set during MCP initialize.
|
|
33
|
+
* Stored on the adapter instance so they survive across requests in SSE mode
|
|
34
|
+
* (where each POST creates a fresh anonymous HTTP session) and are available
|
|
35
|
+
* in distributed environments without relying on local in-memory caches.
|
|
36
|
+
*/
|
|
37
|
+
private initSessionPayload?;
|
|
38
|
+
/**
|
|
39
|
+
* Called by the initialize request handler to persist initialization data
|
|
40
|
+
* on the transport adapter instance. This data is merged into the session
|
|
41
|
+
* payload on every subsequent request via ensureAuthInfo().
|
|
42
|
+
*/
|
|
43
|
+
setInitSessionPayload(payload: NonNullable<LocalTransportAdapter<T>['initSessionPayload']>): void;
|
|
31
44
|
ready: Promise<void>;
|
|
32
45
|
server: McpServer;
|
|
33
46
|
constructor(scope: Scope, key: TransportKey, onDispose: () => void, res: ServerResponse);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.local.adapter.d.ts","sourceRoot":"","sources":["../../../src/transport/adapters/transport.local.adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAe,MAAM,2BAA2B,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAqB,SAAS,EAAsB,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,yCAAyC,EAAE,MAAM,6BAA6B,CAAC;AACxF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAuB,cAAc,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAmB,MAAM,mBAAmB,CAAC;AAGlH;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAC1B,6BAA6B,GAC7B,kBAAkB,GAClB,yCAAyC,GACzC,8BAA8B,CAAC;AAEnC,8BAAsB,qBAAqB,CAAC,CAAC,SAAS,kBAAkB;;
|
|
1
|
+
{"version":3,"file":"transport.local.adapter.d.ts","sourceRoot":"","sources":["../../../src/transport/adapters/transport.local.adapter.ts"],"names":[],"mappings":"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"}
|
|
@@ -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"}
|