@frontmcp/sdk 1.10.8 → 1.10.9-rc.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.
Files changed (124) hide show
  1. package/auth/flows/auth.verify.flow.d.ts +1 -1
  2. package/auth/flows/oauth.auth-ui.flow.d.ts +2 -2
  3. package/auth/flows/oauth.authorize.flow.d.ts +2 -2
  4. package/auth/flows/oauth.callback.flow.d.ts +2 -2
  5. package/auth/flows/oauth.connect.flow.d.ts +2 -2
  6. package/auth/flows/oauth.provider-callback.flow.d.ts +2 -2
  7. package/auth/flows/oauth.register.flow.d.ts +2 -2
  8. package/auth/flows/oauth.token.flow.d.ts +2 -2
  9. package/auth/flows/oauth.userinfo.flow.d.ts +2 -2
  10. package/auth/flows/session.verify.flow.d.ts +1 -1
  11. package/auth/flows/well-known.jwks.flow.d.ts +2 -2
  12. package/auth/flows/well-known.oauth-authorization-server.flow.d.ts +2 -2
  13. package/auth/flows/well-known.prm.flow.d.ts +2 -2
  14. package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
  15. package/browser/agent/agent.registry.mjs +1 -1
  16. package/browser/app/instances/app.esm.instance.mjs +4 -4
  17. package/browser/app/instances/app.remote.instance.mjs +6 -6
  18. package/browser/auth/auth-ui/auth-ui.registry.mjs +6 -6
  19. package/browser/auth/flows/oauth.authorize.flow.mjs +5 -5
  20. package/browser/auth/flows/oauth.callback.flow.mjs +11 -11
  21. package/browser/auth/flows/oauth.connect.flow.mjs +1 -1
  22. package/browser/auth/flows/oauth.register.flow.mjs +1 -1
  23. package/browser/auth/flows/oauth.token.flow.mjs +1 -1
  24. package/browser/auth/flows/well-known.oauth-authorization-server.flow.mjs +5 -5
  25. package/browser/auth/instances/instance.local-primary-auth.mjs +35 -11
  26. package/browser/auth/session/utils/session-id.utils.mjs +1 -1
  27. package/browser/common/entries/skill.entry.mjs +2 -2
  28. package/browser/common/entries/tool.entry.mjs +3 -3
  29. package/browser/common/interfaces/channel.interface.mjs +1 -1
  30. package/browser/common/interfaces/execution-context.interface.mjs +4 -4
  31. package/browser/common/interfaces/flow.interface.mjs +10 -0
  32. package/browser/common/interfaces/internal/primary-auth-provider.interface.mjs +2 -2
  33. package/browser/common/metadata/app.metadata.mjs +1 -1
  34. package/browser/common/metadata/front-mcp.metadata.mjs +5 -5
  35. package/browser/common/schemas/http-input.schema.mjs +9 -3
  36. package/browser/common/tokens/app.tokens.mjs +1 -1
  37. package/browser/common/tokens/front-mcp.tokens.mjs +1 -1
  38. package/browser/common/types/options/http/schema.mjs +4 -4
  39. package/browser/common/types/options/redis/schema.mjs +1 -1
  40. package/browser/common/types/options/sqlite/schema.mjs +3 -3
  41. package/browser/common/types/options/transport/schema.mjs +4 -4
  42. package/browser/common/utils/decide-request-intent.utils.mjs +13 -11
  43. package/browser/context/frontmcp-context.mjs +1 -1
  44. package/browser/direct/direct-client.mjs +29 -29
  45. package/browser/direct/direct-server.mjs +14 -14
  46. package/browser/errors/job.errors.mjs +1 -1
  47. package/browser/errors/mcp.error.mjs +4 -4
  48. package/browser/errors/plugin.errors.mjs +1 -1
  49. package/browser/errors/task.error.mjs +1 -1
  50. package/browser/errors/tool-credentials-required.error.mjs +2 -2
  51. package/browser/esm-loader/esm-module-loader.mjs +1 -7
  52. package/browser/esm-loader/import-computed.mjs +11 -0
  53. package/browser/esm-loader/semver.utils.mjs +17 -11
  54. package/browser/flows/flow.instance.mjs +55 -24
  55. package/browser/flows/flow.stages.mjs +3 -2
  56. package/browser/front-mcp/front-mcp.mjs +10 -14
  57. package/browser/ha/ha-manager.mjs +1 -1
  58. package/browser/ha/notification-relay.mjs +1 -1
  59. package/browser/index.cjs +1346 -1490
  60. package/browser/index.mjs +4 -4
  61. package/browser/job/store/job-definition-store.factory.mjs +1 -1
  62. package/browser/job/store/redis-job-definition.store.mjs +2 -2
  63. package/browser/job/tools/get-job-status.tool.mjs +1 -1
  64. package/browser/logger/logger.registry.mjs +1 -1
  65. package/browser/metrics/metrics.service.mjs +3 -3
  66. package/browser/prompt/prompt.registry.mjs +1 -1
  67. package/browser/provider/provider.registry.mjs +4 -4
  68. package/browser/remote-mcp/mcp-client.service.mjs +19 -19
  69. package/browser/remote-mcp/resilience/circuit-breaker.mjs +2 -2
  70. package/browser/resource/resource.registry.mjs +2 -2
  71. package/browser/scope/flows/http.request.flow.mjs +3 -3
  72. package/browser/scope/scope.instance.mjs +4 -4
  73. package/browser/scope/scope.utils.mjs +1 -1
  74. package/browser/skill/providers/memory-skill.provider.mjs +31 -9
  75. package/browser/skill/skill.registry.mjs +10 -10
  76. package/browser/task/flows/tasks-result.flow.mjs +2 -2
  77. package/browser/task/task.registry.mjs +5 -5
  78. package/browser/tool/flows/call-tool.flow.mjs +4 -4
  79. package/browser/tool/tool.instance.mjs +16 -7
  80. package/browser/tool/tool.registry.mjs +4 -4
  81. package/browser/tool/ui/ui-shared.mjs +1 -1
  82. package/browser/transport/adapters/transport.local.adapter.mjs +2 -2
  83. package/browser/transport/adapters/transport.streamable-http.adapter.mjs +13 -4
  84. package/browser/transport/event-stores/redis.event-store.mjs +1 -1
  85. package/browser/transport/mcp-20260728/client/mcp-stateless.client.mjs +1 -1
  86. package/browser/transport/mcp-20260728/request-notifications.mjs +1 -1
  87. package/browser/transport/transport.registry.mjs +15 -9
  88. package/browser/transport/web-response.renderer.mjs +2 -2
  89. package/browser/utils/lineage.utils.mjs +1 -1
  90. package/browser/workflow/tools/get-workflow-status.tool.mjs +1 -1
  91. package/common/interfaces/flow.interface.d.ts.map +1 -1
  92. package/common/schemas/http-input.schema.d.ts +3 -3
  93. package/common/schemas/http-input.schema.d.ts.map +1 -1
  94. package/common/utils/decide-request-intent.utils.d.ts.map +1 -1
  95. package/esm/esm-loader/import-computed.mjs +10 -0
  96. package/esm/index.mjs +136 -77029
  97. package/esm-loader/esm-module-loader.d.ts.map +1 -1
  98. package/esm-loader/import-computed.d.ts +21 -0
  99. package/esm-loader/import-computed.d.ts.map +1 -0
  100. package/esm-loader/import-computed.js +34 -0
  101. package/esm-loader/semver.utils.d.ts.map +1 -1
  102. package/flows/flow.instance.d.ts +1 -0
  103. package/flows/flow.instance.d.ts.map +1 -1
  104. package/flows/flow.stages.d.ts.map +1 -1
  105. package/front-mcp/front-mcp.d.ts.map +1 -1
  106. package/index.d.ts +9 -8
  107. package/index.d.ts.map +1 -1
  108. package/index.js +140 -77685
  109. package/mcp-registry/flows/server-card.flow.d.ts +2 -2
  110. package/mcp-registry/flows/well-known.ai-catalog.flow.d.ts +2 -2
  111. package/mcp-registry/flows/well-known.mcp-registry-auth.flow.d.ts +2 -2
  112. package/package.json +14 -10
  113. package/skill/flows/http/llm-full-txt.flow.d.ts +2 -2
  114. package/skill/flows/http/llm-txt.flow.d.ts +2 -2
  115. package/skill/flows/http/skills-api.flow.d.ts +2 -2
  116. package/skill/providers/memory-skill.provider.d.ts +1 -0
  117. package/skill/providers/memory-skill.provider.d.ts.map +1 -1
  118. package/tool/tool.instance.d.ts +3 -0
  119. package/tool/tool.instance.d.ts.map +1 -1
  120. package/transport/adapters/transport.streamable-http.adapter.d.ts +2 -1
  121. package/transport/adapters/transport.streamable-http.adapter.d.ts.map +1 -1
  122. package/transport/transport.registry.d.ts +1 -0
  123. package/transport/transport.registry.d.ts.map +1 -1
  124. package/browser/transport/index.mjs +0 -32
@@ -3,6 +3,7 @@ import { FrontMcpFlowHookTokens } from "../common/index.mjs";
3
3
  import { resolvePendingTC39HooksForClass } from "../common/decorators/hook.decorator.mjs";
4
4
  var cap = (s) => s ? s[0].toUpperCase() + s.slice(1) : s;
5
5
  var CACHE = /* @__PURE__ */ new WeakMap();
6
+ var NO_NEXT = async () => void 0;
6
7
  function sortStageMap(table) {
7
8
  for (const key of Object.keys(table)) {
8
9
  table[key].sort((a, b) => a._priority - b._priority || a._order - b._order);
@@ -32,7 +33,7 @@ function collectFlowHookMap(FlowClass) {
32
33
  const entry = {
33
34
  _priority: m.priority ?? 0,
34
35
  _order: order++,
35
- method: async (ctx, next = async () => void 0) => {
36
+ method: async (ctx, next = NO_NEXT) => {
36
37
  const skipHook = () => m.type === "around" ? next() : void 0;
37
38
  const target = m.static ? FlowClass : ctx;
38
39
  const impl = typeof m.method === "function" ? m.method : target?.[m.method];
@@ -59,7 +60,7 @@ function mergeHookMetasIntoStageMap(FlowClass, table, metas, orderStart = 1e5, r
59
60
  const entry = {
60
61
  _priority: m.priority ?? 0,
61
62
  _order: order++,
62
- method: async (ctx, next = async () => void 0) => {
63
+ method: async (ctx, next = NO_NEXT) => {
63
64
  const skipHook = () => m.type === "around" ? next() : void 0;
64
65
  const target = m.target;
65
66
  if (!target) {
@@ -9,6 +9,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
9
9
  });
10
10
 
11
11
  // libs/sdk/src/front-mcp/front-mcp.ts
12
+ import { McpServer, StdioServerTransport } from "@frontmcp/protocol";
12
13
  import { getEnv, isEdgeRuntime, randomUUID } from "@frontmcp/utils";
13
14
  import {
14
15
  FrontMcpLogger,
@@ -25,7 +26,6 @@ import ProviderRegistry from "../provider/provider.registry.mjs";
25
26
  import { ScopeRegistry } from "../scope/scope.registry.mjs";
26
27
  import { composeCallerInstructions } from "../skill/skill-instructions.helper.mjs";
27
28
  import { computeTaskCapabilities } from "../task/task-scope.helper.mjs";
28
- import { importWithRequireFallback } from "../utils/dynamic-import.utils.mjs";
29
29
  import { markDirectOnly } from "./direct-only.flag.mjs";
30
30
  import { createMcpGlobalProviders } from "./front-mcp.providers.mjs";
31
31
  import { DEFAULT_SHUTDOWN_DEADLINE_MS, exitOnShutdownSignals } from "./shutdown-signals.mjs";
@@ -212,9 +212,9 @@ var FrontMcpInstance = class _FrontMcpInstance {
212
212
  /**
213
213
  * Wire the `/metrics` service into the server instance (issue #397).
214
214
  *
215
- * Off by default — `metrics.enabled` must be set to `true` explicitly.
215
+ * Off by default \u2014 `metrics.enabled` must be set to `true` explicitly.
216
216
  * The `MetricsService` is instantiated here (not in scope construction)
217
- * because the endpoint is server-wide, not per-app — counters and process
217
+ * because the endpoint is server-wide, not per-app \u2014 counters and process
218
218
  * stats are process-global.
219
219
  */
220
220
  async wireMetricsService(server) {
@@ -291,7 +291,7 @@ var FrontMcpInstance = class _FrontMcpInstance {
291
291
  }
292
292
  /**
293
293
  * Creates and initializes a FrontMCP instance and returns a Web-standard
294
- * `fetch` handler — `(request: Request) => Promise<Response>` — backed by the
294
+ * `fetch` handler \u2014 `(request: Request) => Promise<Response>` \u2014 backed by the
295
295
  * MCP WebStandard transport. Unlike {@link createHandler} this needs no
296
296
  * Express / Node `req`/`res` and runs on V8-isolate targets (Cloudflare
297
297
  * Workers, Deno Deploy, Bun).
@@ -469,7 +469,7 @@ var FrontMcpInstance = class _FrontMcpInstance {
469
469
  * elicitation, sessions) works unchanged over Unix sockets.
470
470
  *
471
471
  * Pass the same config object you give to `@FrontMcp()` (not the decorated
472
- * class — spreading a class yields no config) plus the socket path.
472
+ * class \u2014 spreading a class yields no config) plus the socket path.
473
473
  *
474
474
  * SIGTERM and SIGINT run the graceful {@link shutdown} and exit, as `bootstrap()` does for
475
475
  * the TCP server; `close()` runs the same shutdown without exiting.
@@ -516,27 +516,27 @@ var FrontMcpInstance = class _FrontMcpInstance {
516
516
  * Runs the FrontMCP server over **stdio** (stdin/stdout JSON-RPC) for local
517
517
  * MCP clients such as Claude Desktop, Claude Code, and Cursor. Connects the
518
518
  * transport and returns only when the connection closes. **No TCP port is
519
- * bound** — the HTTP server is disabled for this entry point (#451).
519
+ * bound** \u2014 the HTTP server is disabled for this entry point (#451).
520
520
  *
521
521
  * One connection serves every revision: `initialize` opens a session, a 2026-07-28 request is served statelessly.
522
522
  *
523
523
  * Accepts either a `@FrontMcp`-decorated class or the same config object you
524
524
  * pass to `@FrontMcp()` (#450).
525
525
  *
526
- * IMPORTANT — importing a `@FrontMcp`-decorated class starts an HTTP server at
526
+ * IMPORTANT \u2014 importing a `@FrontMcp`-decorated class starts an HTTP server at
527
527
  * import time unless `FRONTMCP_STDIO=1` is set *before* the import. Two safe
528
528
  * patterns avoid that:
529
529
  *
530
- * 1. Built bundles — `frontmcp build --target node`, then run the emitted
530
+ * 1. Built bundles \u2014 `frontmcp build --target node`, then run the emitted
531
531
  * runner with `--stdio` (it sets `FRONTMCP_STDIO=1` for you, so the
532
532
  * decorator serves over stdio). A `--target cli` binary supports
533
533
  * `<bin> --stdio` the same way.
534
- * 2. Hand-written entry — keep the config object in its own module (no
534
+ * 2. Hand-written entry \u2014 keep the config object in its own module (no
535
535
  * decorated class in the import graph) and pass it directly, as below.
536
536
  *
537
537
  * @example Hand-written stdio entry (config kept separate from the class)
538
538
  * ```typescript
539
- * // server-config.ts — a plain object, no @FrontMcp decorator here
539
+ * // server-config.ts \u2014 a plain object, no @FrontMcp decorator here
540
540
  * export const serverConfig = { info: { name: 'my-server', version: '0.1.0' }, apps: [MyApp] };
541
541
  *
542
542
  * // stdio.ts
@@ -577,10 +577,6 @@ var FrontMcpInstance = class _FrontMcpInstance {
577
577
  let startupSucceeded = false;
578
578
  const startupCleanups = [];
579
579
  try {
580
- const { StdioServerTransport, McpServer } = await importWithRequireFallback(
581
- () => import("@frontmcp/protocol"),
582
- () => __require("@frontmcp/protocol")
583
- );
584
580
  const parsedConfig = frontMcpMetadataSchema.parse({
585
581
  ...options,
586
582
  http: void 0,
@@ -131,7 +131,7 @@ var HaManager = class _HaManager {
131
131
  }
132
132
  /**
133
133
  * Publish a message to another pod's relay channel.
134
- * @returns How many subscribers received it — 0 when that pod does not listen, or when
134
+ * @returns How many subscribers received it \u2014 0 when that pod does not listen, or when
135
135
  * pub/sub is not configured on this pod.
136
136
  */
137
137
  async publishToNode(nodeId, message) {
@@ -49,7 +49,7 @@ var NotificationRelay = class {
49
49
  }
50
50
  /**
51
51
  * Publish any relay message to a target pod's channel.
52
- * @returns How many subscribers received it — 0 when nothing listens on that pod's channel.
52
+ * @returns How many subscribers received it \u2014 0 when nothing listens on that pod's channel.
53
53
  */
54
54
  async send(targetNodeId, message) {
55
55
  return this.publisher.publish(this.channelOf(targetNodeId), JSON.stringify(message));