@frontmcp/sdk 1.10.9-rc.3 → 1.10.9-rc.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/auth-ui/auth-ui.render.d.ts.map +1 -1
- package/browser/auth/auth-ui/auth-ui.render.mjs +1 -4
- package/browser/builtin/config/providers/config-loader.mjs +1 -1
- package/browser/direct/direct-client.mjs +3 -6
- package/browser/esm-loader/semver.utils.mjs +9 -7
- package/browser/index.cjs +567 -537
- package/browser/remote-mcp/mcp-client.service.mjs +1 -5
- package/browser/skill/sep-2640/sep-2640.builders.mjs +1 -1
- package/browser/skill/skill-md-parser.mjs +1 -1
- package/browser/third-party/js-yaml.mjs +6 -0
- package/browser/third-party/semver.mjs +17 -0
- package/browser/third-party/uipack-render.mjs +6 -0
- package/browser/transport/adapters/transport.sse.adapter.mjs +17 -5
- package/browser/transport/in-memory-server.mjs +7 -15
- package/browser/transport/transport.registry.mjs +4 -1
- package/browser/transport/web-standard-mcp.mjs +1 -15
- package/builtin/config/providers/config-loader.d.ts.map +1 -1
- package/esm/index.mjs +17 -17
- package/esm-loader/semver.utils.d.ts.map +1 -1
- package/index.js +17 -17
- package/package.json +25 -10
- package/remote-mcp/mcp-client.service.d.ts.map +1 -1
- package/remote-mcp/mcp-client.types.d.ts +2 -1
- package/remote-mcp/mcp-client.types.d.ts.map +1 -1
- package/third-party/js-yaml.d.ts +2 -0
- package/third-party/js-yaml.d.ts.map +1 -0
- package/third-party/js-yaml.js +1 -0
- package/third-party/lazy-js-yaml.d.ts +2 -0
- package/third-party/lazy-js-yaml.d.ts.map +1 -0
- package/third-party/lazy-js-yaml.js +1 -0
- package/third-party/lazy-semver.d.ts +2 -0
- package/third-party/lazy-semver.d.ts.map +1 -0
- package/third-party/lazy-semver.js +1 -0
- package/third-party/lazy-uipack-render.d.ts +2 -0
- package/third-party/lazy-uipack-render.d.ts.map +1 -0
- package/third-party/lazy-uipack-render.js +1 -0
- package/third-party/semver.d.ts +8 -0
- package/third-party/semver.d.ts.map +1 -0
- package/third-party/semver.js +1 -0
- package/third-party/uipack-render.d.ts +2 -0
- package/third-party/uipack-render.d.ts.map +1 -0
- package/third-party/uipack-render.js +1 -0
- package/transport/adapters/transport.sse.adapter.d.ts +2 -1
- package/transport/adapters/transport.sse.adapter.d.ts.map +1 -1
- package/transport/in-memory-server.d.ts +1 -1
- package/transport/in-memory-server.d.ts.map +1 -1
- package/transport/index.d.ts +1 -1
- package/transport/transport.registry.d.ts.map +1 -1
- package/transport/web-standard-mcp.d.ts.map +1 -1
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
// libs/sdk/src/remote-mcp/mcp-client.service.ts
|
|
2
2
|
import { decodeJwtPayloadSafe } from "@frontmcp/auth";
|
|
3
|
-
import {
|
|
4
|
-
Client,
|
|
5
|
-
SSEClientTransport,
|
|
6
|
-
StreamableHTTPClientTransport
|
|
7
|
-
} from "@frontmcp/protocol";
|
|
3
|
+
import { Client, SSEClientTransport, StreamableHTTPClientTransport } from "@frontmcp/protocol/client";
|
|
8
4
|
import { listAllPages } from "../common/utils/list-all-pages.utils.mjs";
|
|
9
5
|
import { InternalMcpError } from "../errors/mcp.error.mjs";
|
|
10
6
|
import {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// libs/sdk/src/skill/sep-2640/sep-2640.builders.ts
|
|
2
|
-
import * as yaml from "js-yaml";
|
|
2
|
+
import * as yaml from "../../third-party/js-yaml.mjs";
|
|
3
3
|
import { SKILL_INDEX_SCHEMA_URI } from "./sep-2640.constants.mjs";
|
|
4
4
|
import { buildSkillUri } from "./sep-2640.uri.mjs";
|
|
5
5
|
function buildSkillMdIndexEntry(input) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// libs/sdk/src/skill/skill-md-parser.ts
|
|
2
|
-
import * as yaml from "js-yaml";
|
|
3
2
|
import { readFile } from "@frontmcp/utils";
|
|
3
|
+
import * as yaml from "../third-party/js-yaml.mjs";
|
|
4
4
|
function parseSkillMdFrontmatter(content) {
|
|
5
5
|
const trimmed = content.trimStart();
|
|
6
6
|
if (!trimmed.startsWith("---")) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// libs/sdk/src/third-party/semver.ts
|
|
2
|
+
import { default as default2 } from "semver/functions/compare.js";
|
|
3
|
+
import { default as default3 } from "semver/functions/gt.js";
|
|
4
|
+
import { default as default4 } from "semver/functions/rcompare.js";
|
|
5
|
+
import { default as default5 } from "semver/functions/satisfies.js";
|
|
6
|
+
import { default as default6 } from "semver/functions/valid.js";
|
|
7
|
+
import { default as default7 } from "semver/ranges/max-satisfying.js";
|
|
8
|
+
import { default as default8 } from "semver/ranges/valid.js";
|
|
9
|
+
export {
|
|
10
|
+
default2 as compare,
|
|
11
|
+
default3 as gt,
|
|
12
|
+
default7 as maxSatisfying,
|
|
13
|
+
default4 as rcompare,
|
|
14
|
+
default5 as satisfies,
|
|
15
|
+
default6 as valid,
|
|
16
|
+
default8 as validRange
|
|
17
|
+
};
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
// libs/sdk/src/transport/adapters/transport.sse.adapter.ts
|
|
2
2
|
import { toJSONSchema } from "@frontmcp/lazy-zod";
|
|
3
3
|
import { DEFAULT_ELICIT_TTL } from "../../elicitation/elicitation.types.mjs";
|
|
4
|
-
import { ElicitationTimeoutError, InvalidInputError } from "../../errors/index.mjs";
|
|
4
|
+
import { ElicitationTimeoutError, InternalMcpError, InvalidInputError } from "../../errors/index.mjs";
|
|
5
5
|
import { rpcRequest } from "../transport.error.mjs";
|
|
6
|
-
import { RecreateableSSEServerTransport } from "./sse-transport.mjs";
|
|
7
6
|
import { LocalTransportAdapter } from "./transport.local.adapter.mjs";
|
|
7
|
+
var RecreateableTransport;
|
|
8
|
+
async function loadSseTransport() {
|
|
9
|
+
RecreateableTransport ??= (await import("./sse-transport.mjs")).RecreateableSSEServerTransport;
|
|
10
|
+
}
|
|
11
|
+
function sseTransportClass() {
|
|
12
|
+
if (!RecreateableTransport) {
|
|
13
|
+
throw new InternalMcpError("The SSE transport was used before loadSseTransport() loaded it");
|
|
14
|
+
}
|
|
15
|
+
return RecreateableTransport;
|
|
16
|
+
}
|
|
8
17
|
var TransportSSEAdapter = class extends LocalTransportAdapter {
|
|
9
18
|
sessionId;
|
|
10
19
|
/**
|
|
@@ -19,7 +28,8 @@ var TransportSSEAdapter = class extends LocalTransportAdapter {
|
|
|
19
28
|
createTransport(sessionId, res) {
|
|
20
29
|
this.sessionId = sessionId;
|
|
21
30
|
this.logger.info(`new transport session: ${sessionId.slice(0, 40)}`);
|
|
22
|
-
const
|
|
31
|
+
const SseTransport = sseTransportClass();
|
|
32
|
+
const transport = new SseTransport(`${this.scope.fullPath}/message`, res, {
|
|
23
33
|
sessionId
|
|
24
34
|
});
|
|
25
35
|
this.configureTransportHandlers(transport);
|
|
@@ -36,7 +46,8 @@ var TransportSSEAdapter = class extends LocalTransportAdapter {
|
|
|
36
46
|
createTransportFromSession(sessionId, res, lastEventId) {
|
|
37
47
|
this.sessionId = sessionId;
|
|
38
48
|
this.logger.info(`recreating transport session: ${sessionId.slice(0, 40)}, lastEventId: ${lastEventId ?? "none"}`);
|
|
39
|
-
const
|
|
49
|
+
const SseTransport = sseTransportClass();
|
|
50
|
+
const transport = new SseTransport(`${this.scope.fullPath}/message`, res, {
|
|
40
51
|
sessionId,
|
|
41
52
|
initialEventId: lastEventId
|
|
42
53
|
});
|
|
@@ -163,5 +174,6 @@ var TransportSSEAdapter = class extends LocalTransportAdapter {
|
|
|
163
174
|
}
|
|
164
175
|
};
|
|
165
176
|
export {
|
|
166
|
-
TransportSSEAdapter
|
|
177
|
+
TransportSSEAdapter,
|
|
178
|
+
loadSseTransport
|
|
167
179
|
};
|
|
@@ -1,26 +1,18 @@
|
|
|
1
|
-
var __frontmcpModule = typeof process !== "undefined" && typeof process.getBuiltinModule === "function" ? process.getBuiltinModule("module") : undefined;
|
|
2
|
-
const require = __frontmcpModule ? __frontmcpModule.createRequire(import.meta.url || 'file:///') : undefined;
|
|
3
|
-
// __frontmcpCreateRequire
|
|
4
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
5
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
6
|
-
}) : x)(function(x) {
|
|
7
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
8
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
1
|
// libs/sdk/src/transport/in-memory-server.ts
|
|
12
2
|
import { toJSONSchema } from "@frontmcp/lazy-zod";
|
|
3
|
+
import {
|
|
4
|
+
ElicitResultSchema,
|
|
5
|
+
ErrorCode,
|
|
6
|
+
InMemoryTransport,
|
|
7
|
+
McpError,
|
|
8
|
+
McpServer
|
|
9
|
+
} from "@frontmcp/protocol";
|
|
13
10
|
import { randomUUID, runRequestExclusive } from "@frontmcp/utils";
|
|
14
11
|
import { ELICITATION_META_KEY } from "../elicitation/elicitation-meta.mjs";
|
|
15
12
|
import { ElicitationTimeoutError } from "../errors/index.mjs";
|
|
16
13
|
import { composeCallerInstructions } from "../skill/skill-instructions.helper.mjs";
|
|
17
|
-
import { importWithRequireFallback } from "../utils/dynamic-import.utils.mjs";
|
|
18
14
|
import { buildScopedServerOptions } from "./build-scoped-server-options.mjs";
|
|
19
15
|
async function createInMemoryServer(scope, options) {
|
|
20
|
-
const { ElicitResultSchema, ErrorCode, InMemoryTransport, McpError, McpServer } = await importWithRequireFallback(
|
|
21
|
-
() => import("@frontmcp/protocol"),
|
|
22
|
-
() => __require("@frontmcp/protocol")
|
|
23
|
-
);
|
|
24
16
|
const { createMcpHandlers } = await import("./mcp-handlers/index.mjs");
|
|
25
17
|
const sessionId = options?.sessionId ?? `in-memory:${randomUUID()}`;
|
|
26
18
|
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
|
|
@@ -4,6 +4,7 @@ import { createSessionStore } from "../auth/session/session-store.factory.mjs";
|
|
|
4
4
|
import { isDeploymentSessionId } from "../auth/session/utils/session-id.utils.mjs";
|
|
5
5
|
import { sessionIdPresentedBy } from "../common/utils/auth-info.utils.mjs";
|
|
6
6
|
import { InvalidTransportSessionError, SessionClaimConflictError } from "../errors/transport.errors.mjs";
|
|
7
|
+
import { loadSseTransport } from "./adapters/transport.sse.adapter.mjs";
|
|
7
8
|
import { loadStreamableHttpTransport } from "./adapters/transport.streamable-http.adapter.mjs";
|
|
8
9
|
import HandleMcp20260728Flow from "./flows/handle.mcp-20260728.flow.mjs";
|
|
9
10
|
import HandleSseFlow from "./flows/handle.sse.flow.mjs";
|
|
@@ -72,10 +73,12 @@ var TransportService = class {
|
|
|
72
73
|
* Key: JSON-encoded {t: type, h: tokenHash, s: sessionId}, Value: Promise that resolves when creation completes
|
|
73
74
|
*/
|
|
74
75
|
creationMutex = /* @__PURE__ */ new Map();
|
|
75
|
-
//
|
|
76
|
+
// Each transport class loads with the first session that uses it, so a stdio server loads neither.
|
|
76
77
|
async newLocalTransporter(key, res, onDispose) {
|
|
77
78
|
if (key.type === "streamable-http" || key.type === "stateless-http") {
|
|
78
79
|
await loadStreamableHttpTransport();
|
|
80
|
+
} else if (key.type === "sse") {
|
|
81
|
+
await loadSseTransport();
|
|
79
82
|
}
|
|
80
83
|
return new LocalTransporter(this.scope, key, res, onDispose);
|
|
81
84
|
}
|
|
@@ -1,24 +1,10 @@
|
|
|
1
|
-
var __frontmcpModule = typeof process !== "undefined" && typeof process.getBuiltinModule === "function" ? process.getBuiltinModule("module") : undefined;
|
|
2
|
-
const require = __frontmcpModule ? __frontmcpModule.createRequire(import.meta.url || 'file:///') : undefined;
|
|
3
|
-
// __frontmcpCreateRequire
|
|
4
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
5
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
6
|
-
}) : x)(function(x) {
|
|
7
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
8
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
1
|
// libs/sdk/src/transport/web-standard-mcp.ts
|
|
2
|
+
import { McpServer, WebStandardStreamableHTTPServerTransport } from "@frontmcp/protocol";
|
|
12
3
|
import { randomUUID } from "@frontmcp/utils";
|
|
13
4
|
import { composeCallerInstructions } from "../skill/skill-instructions.helper.mjs";
|
|
14
|
-
import { importWithRequireFallback } from "../utils/dynamic-import.utils.mjs";
|
|
15
5
|
import { mcpTransportBodyLimit } from "./body-limit.mjs";
|
|
16
6
|
import { buildScopedServerOptions } from "./build-scoped-server-options.mjs";
|
|
17
7
|
async function wireServer(scope, serverOptions, sessionId, sessionIdGenerator, enableJsonResponse) {
|
|
18
|
-
const { McpServer, WebStandardStreamableHTTPServerTransport } = await importWithRequireFallback(
|
|
19
|
-
() => import("@frontmcp/protocol"),
|
|
20
|
-
() => __require("@frontmcp/protocol")
|
|
21
|
-
);
|
|
22
8
|
const { createMcpHandlers } = await import("./mcp-handlers/index.mjs");
|
|
23
9
|
const mcpServer = new McpServer(scope.metadata.info, serverOptions);
|
|
24
10
|
const composeInstructions = (caller) => composeCallerInstructions(scope, { ctx: caller, skillUriHints: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../../../src/builtin/config/providers/config-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../../../src/builtin/config/providers/config-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAK5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAUzD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yGAAyG;IACzG,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACpD;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,CAAC,SAAS,MAAM,EAC/C,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EACpB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,CAAC,CAAC,CAiDZ;AA8DD;;;;;;;;GAQG;AACH,iBAAS,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA2B5G;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|