@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.
Files changed (49) hide show
  1. package/auth/auth-ui/auth-ui.render.d.ts.map +1 -1
  2. package/browser/auth/auth-ui/auth-ui.render.mjs +1 -4
  3. package/browser/builtin/config/providers/config-loader.mjs +1 -1
  4. package/browser/direct/direct-client.mjs +3 -6
  5. package/browser/esm-loader/semver.utils.mjs +9 -7
  6. package/browser/index.cjs +567 -537
  7. package/browser/remote-mcp/mcp-client.service.mjs +1 -5
  8. package/browser/skill/sep-2640/sep-2640.builders.mjs +1 -1
  9. package/browser/skill/skill-md-parser.mjs +1 -1
  10. package/browser/third-party/js-yaml.mjs +6 -0
  11. package/browser/third-party/semver.mjs +17 -0
  12. package/browser/third-party/uipack-render.mjs +6 -0
  13. package/browser/transport/adapters/transport.sse.adapter.mjs +17 -5
  14. package/browser/transport/in-memory-server.mjs +7 -15
  15. package/browser/transport/transport.registry.mjs +4 -1
  16. package/browser/transport/web-standard-mcp.mjs +1 -15
  17. package/builtin/config/providers/config-loader.d.ts.map +1 -1
  18. package/esm/index.mjs +17 -17
  19. package/esm-loader/semver.utils.d.ts.map +1 -1
  20. package/index.js +17 -17
  21. package/package.json +25 -10
  22. package/remote-mcp/mcp-client.service.d.ts.map +1 -1
  23. package/remote-mcp/mcp-client.types.d.ts +2 -1
  24. package/remote-mcp/mcp-client.types.d.ts.map +1 -1
  25. package/third-party/js-yaml.d.ts +2 -0
  26. package/third-party/js-yaml.d.ts.map +1 -0
  27. package/third-party/js-yaml.js +1 -0
  28. package/third-party/lazy-js-yaml.d.ts +2 -0
  29. package/third-party/lazy-js-yaml.d.ts.map +1 -0
  30. package/third-party/lazy-js-yaml.js +1 -0
  31. package/third-party/lazy-semver.d.ts +2 -0
  32. package/third-party/lazy-semver.d.ts.map +1 -0
  33. package/third-party/lazy-semver.js +1 -0
  34. package/third-party/lazy-uipack-render.d.ts +2 -0
  35. package/third-party/lazy-uipack-render.d.ts.map +1 -0
  36. package/third-party/lazy-uipack-render.js +1 -0
  37. package/third-party/semver.d.ts +8 -0
  38. package/third-party/semver.d.ts.map +1 -0
  39. package/third-party/semver.js +1 -0
  40. package/third-party/uipack-render.d.ts +2 -0
  41. package/third-party/uipack-render.d.ts.map +1 -0
  42. package/third-party/uipack-render.js +1 -0
  43. package/transport/adapters/transport.sse.adapter.d.ts +2 -1
  44. package/transport/adapters/transport.sse.adapter.d.ts.map +1 -1
  45. package/transport/in-memory-server.d.ts +1 -1
  46. package/transport/in-memory-server.d.ts.map +1 -1
  47. package/transport/index.d.ts +1 -1
  48. package/transport/transport.registry.d.ts.map +1 -1
  49. package/transport/web-standard-mcp.d.ts.map +1 -1
package/browser/index.cjs CHANGED
@@ -8354,24 +8354,6 @@ var init_skills_mcp_types = __esm({
8354
8354
  }
8355
8355
  });
8356
8356
 
8357
- // libs/sdk/src/utils/dynamic-import.utils.ts
8358
- async function importWithRequireFallback(dynamicImport, requireFallback) {
8359
- try {
8360
- return await dynamicImport();
8361
- } catch (importError) {
8362
- try {
8363
- return requireFallback();
8364
- } catch {
8365
- throw importError;
8366
- }
8367
- }
8368
- }
8369
- var init_dynamic_import_utils = __esm({
8370
- "libs/sdk/src/utils/dynamic-import.utils.ts"() {
8371
- "use strict";
8372
- }
8373
- });
8374
-
8375
8357
  // libs/sdk/src/common/availability/availability.utils.ts
8376
8358
  function callSurfaceOf(ctx) {
8377
8359
  const surface = ctx?.surface;
@@ -10851,13 +10833,9 @@ __export(in_memory_server_exports, {
10851
10833
  createInMemoryServer: () => createInMemoryServer
10852
10834
  });
10853
10835
  async function createInMemoryServer(scope, options) {
10854
- const { ElicitResultSchema: ElicitResultSchema3, ErrorCode, InMemoryTransport, McpError: McpError4, McpServer: McpServer3 } = await importWithRequireFallback(
10855
- () => import("@frontmcp/protocol"),
10856
- () => require("@frontmcp/protocol")
10857
- );
10858
10836
  const { createMcpHandlers: createMcpHandlers2 } = await Promise.resolve().then(() => (init_mcp_handlers(), mcp_handlers_exports));
10859
10837
  const sessionId = options?.sessionId ?? `in-memory:${(0, import_utils32.randomUUID)()}`;
10860
- const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
10838
+ const [clientTransport, serverTransport] = import_protocol28.InMemoryTransport.createLinkedPair();
10861
10839
  let currentAuthInfo = options?.authInfo ?? {};
10862
10840
  const elicitTransport = {
10863
10841
  type: "in-memory",
@@ -10877,12 +10855,12 @@ async function createInMemoryServer(scope, options) {
10877
10855
  method: "elicitation/create",
10878
10856
  params: { ...requestParams, _meta: { [ELICITATION_META_KEY]: { elicitId, expiresAt } } }
10879
10857
  },
10880
- ElicitResultSchema3,
10858
+ import_protocol28.ElicitResultSchema,
10881
10859
  { relatedRequestId, timeout: ttl }
10882
10860
  );
10883
10861
  } catch (error) {
10884
10862
  await scope.elicitationStore?.deletePending(sessionId);
10885
- if (error instanceof McpError4 && error.code === ErrorCode.RequestTimeout) {
10863
+ if (error instanceof import_protocol28.McpError && error.code === import_protocol28.ErrorCode.RequestTimeout) {
10886
10864
  throw new ElicitationTimeoutError(elicitId, ttl);
10887
10865
  }
10888
10866
  throw error;
@@ -10892,7 +10870,7 @@ async function createInMemoryServer(scope, options) {
10892
10870
  }
10893
10871
  };
10894
10872
  const serverOptions = buildScopedServerOptions(scope);
10895
- const mcpServer = new McpServer3(scope.metadata.info, serverOptions);
10873
+ const mcpServer = new import_protocol28.McpServer(scope.metadata.info, serverOptions);
10896
10874
  const composeInstructions = (caller) => composeCallerInstructions(scope, { ctx: caller, skillUriHints: true });
10897
10875
  const handlers = createMcpHandlers2({ scope, serverOptions, composeInstructions });
10898
10876
  for (const handler of handlers) {
@@ -10925,16 +10903,16 @@ async function createInMemoryServer(scope, options) {
10925
10903
  }
10926
10904
  };
10927
10905
  }
10928
- var import_lazy_zod43, import_utils32;
10906
+ var import_lazy_zod43, import_protocol28, import_utils32;
10929
10907
  var init_in_memory_server = __esm({
10930
10908
  "libs/sdk/src/transport/in-memory-server.ts"() {
10931
10909
  "use strict";
10932
10910
  import_lazy_zod43 = require("@frontmcp/lazy-zod");
10911
+ import_protocol28 = require("@frontmcp/protocol");
10933
10912
  import_utils32 = require("@frontmcp/utils");
10934
10913
  init_elicitation_meta();
10935
10914
  init_errors();
10936
10915
  init_skill_instructions_helper();
10937
- init_dynamic_import_utils();
10938
10916
  init_build_scoped_server_options();
10939
10917
  }
10940
10918
  });
@@ -10983,17 +10961,17 @@ function walkForFile(dir, targetRelative, fs, path, matches, maxDepth = 10) {
10983
10961
  } catch {
10984
10962
  }
10985
10963
  }
10986
- var import_protocol28, import_utils33, DirectClientImpl;
10964
+ var import_protocol29, import_client, import_utils33, DirectClientImpl;
10987
10965
  var init_direct_client = __esm({
10988
10966
  "libs/sdk/src/direct/direct-client.ts"() {
10989
10967
  "use strict";
10990
- import_protocol28 = require("@frontmcp/protocol");
10968
+ import_protocol29 = require("@frontmcp/protocol");
10969
+ import_client = require("@frontmcp/protocol/client");
10991
10970
  import_utils33 = require("@frontmcp/utils");
10992
10971
  init_list_all_pages_utils();
10993
10972
  init_elicitation_meta();
10994
10973
  init_errors();
10995
10974
  init_skills_mcp_types();
10996
- init_dynamic_import_utils();
10997
10975
  init_llm_platform();
10998
10976
  DirectClientImpl = class _DirectClientImpl {
10999
10977
  // Use a flexible type to handle dynamic import type differences between ESM/CJS
@@ -11062,7 +11040,7 @@ var init_direct_client = __esm({
11062
11040
  ...options?.capabilities
11063
11041
  }
11064
11042
  };
11065
- const mcpClient = new import_protocol28.Client(clientInfo, clientCapabilities);
11043
+ const mcpClient = new import_client.Client(clientInfo, clientCapabilities);
11066
11044
  await mcpClient.connect(clientTransport);
11067
11045
  const serverInfo = mcpClient.getServerVersion();
11068
11046
  const serverCapabilities = mcpClient.getServerCapabilities();
@@ -11096,13 +11074,9 @@ var init_direct_client = __esm({
11096
11074
  */
11097
11075
  async setupNotificationHandlers(mcpClient) {
11098
11076
  try {
11099
- const { ResourceUpdatedNotificationSchema, ElicitRequestSchema } = await importWithRequireFallback(
11100
- () => import("@frontmcp/protocol"),
11101
- () => require("@frontmcp/protocol")
11102
- );
11103
11077
  if (typeof mcpClient.setNotificationHandler === "function") {
11104
11078
  mcpClient.setNotificationHandler(
11105
- ResourceUpdatedNotificationSchema,
11079
+ import_protocol29.ResourceUpdatedNotificationSchema,
11106
11080
  (notification) => {
11107
11081
  const uri = notification.params?.uri;
11108
11082
  if (uri) {
@@ -11123,7 +11097,7 @@ var init_direct_client = __esm({
11123
11097
  };
11124
11098
  }
11125
11099
  if (typeof mcpClient.setRequestHandler === "function") {
11126
- mcpClient.setRequestHandler(ElicitRequestSchema, async (request) => {
11100
+ mcpClient.setRequestHandler(import_protocol29.ElicitRequestSchema, async (request) => {
11127
11101
  const params = request.params;
11128
11102
  if (params) {
11129
11103
  return this.handleElicitationRequestInternal(toElicitationRequest(params));
@@ -13171,14 +13145,14 @@ function linkedAbortController(signal) {
13171
13145
  else signal?.addEventListener("abort", () => controller.abort(signal.reason), { once: true });
13172
13146
  return controller;
13173
13147
  }
13174
- var import_auth23, import_guard5, import_lazy_zod46, import_protocol29, import_utils37, inputSchema, outputSchema, stateSchema, plan, name, toolClassHooksJoin, Stage, resolvedTools, CallToolFlow;
13148
+ var import_auth23, import_guard5, import_lazy_zod46, import_protocol30, import_utils37, inputSchema, outputSchema, stateSchema, plan, name, toolClassHooksJoin, Stage, resolvedTools, CallToolFlow;
13175
13149
  var init_call_tool_flow = __esm({
13176
13150
  "libs/sdk/src/tool/flows/call-tool.flow.ts"() {
13177
13151
  "use strict";
13178
13152
  import_auth23 = require("@frontmcp/auth");
13179
13153
  import_guard5 = require("@frontmcp/guard");
13180
13154
  import_lazy_zod46 = require("@frontmcp/lazy-zod");
13181
- import_protocol29 = require("@frontmcp/protocol");
13155
+ import_protocol30 = require("@frontmcp/protocol");
13182
13156
  import_utils37 = require("@frontmcp/utils");
13183
13157
  init_remote_capabilities_utils();
13184
13158
  init_authorized_apps_utils();
@@ -13205,11 +13179,11 @@ var init_call_tool_flow = __esm({
13205
13179
  init_ui_shared();
13206
13180
  init_tool_credentials_gate();
13207
13181
  inputSchema = import_lazy_zod46.z.object({
13208
- request: import_protocol29.CallToolRequestSchema,
13182
+ request: import_protocol30.CallToolRequestSchema,
13209
13183
  // z.any() used because ctx is the MCP SDK's ToolCallExtra type which varies by SDK version
13210
13184
  ctx: import_lazy_zod46.z.any()
13211
13185
  });
13212
- outputSchema = import_protocol29.CallToolResultSchema;
13186
+ outputSchema = import_protocol30.CallToolResultSchema;
13213
13187
  stateSchema = import_lazy_zod46.z.object({
13214
13188
  input: import_lazy_zod46.z.looseObject({
13215
13189
  name: import_lazy_zod46.z.string().min(1).max(64),
@@ -14914,17 +14888,17 @@ async function registerRuntimeTool(scope, definition) {
14914
14888
  appTools.unregisterToolInstance(provide);
14915
14889
  };
14916
14890
  }
14917
- var import_protocol30, import_utils39, MAX_TOOL_NAME_LENGTH, listedInputSchema;
14891
+ var import_protocol31, import_utils39, MAX_TOOL_NAME_LENGTH, listedInputSchema;
14918
14892
  var init_runtime_tools = __esm({
14919
14893
  "libs/sdk/src/direct/runtime-tools.ts"() {
14920
14894
  "use strict";
14921
- import_protocol30 = require("@frontmcp/protocol");
14895
+ import_protocol31 = require("@frontmcp/protocol");
14922
14896
  import_utils39 = require("@frontmcp/utils");
14923
14897
  init_common();
14924
14898
  init_errors();
14925
14899
  init_tool_instance();
14926
14900
  MAX_TOOL_NAME_LENGTH = 64;
14927
- listedInputSchema = import_protocol30.ToolSchema.shape.inputSchema;
14901
+ listedInputSchema = import_protocol31.ToolSchema.shape.inputSchema;
14928
14902
  }
14929
14903
  });
14930
14904
 
@@ -15992,13 +15966,13 @@ var init_utils2 = __esm({
15992
15966
  function findPromptForGet(prompts, name48) {
15993
15967
  return prompts.findByName(name48) ?? prompts.getPrompts(true).find((entry) => entry.fullName === name48);
15994
15968
  }
15995
- var import_auth24, import_lazy_zod49, import_protocol31, inputSchema2, outputSchema2, stateSchema2, plan2, name2, promptClassHooksJoin, Stage2, resolvedPrompts, GetPromptFlow;
15969
+ var import_auth24, import_lazy_zod49, import_protocol32, inputSchema2, outputSchema2, stateSchema2, plan2, name2, promptClassHooksJoin, Stage2, resolvedPrompts, GetPromptFlow;
15996
15970
  var init_get_prompt_flow = __esm({
15997
15971
  "libs/sdk/src/prompt/flows/get-prompt.flow.ts"() {
15998
15972
  "use strict";
15999
15973
  import_auth24 = require("@frontmcp/auth");
16000
15974
  import_lazy_zod49 = require("@frontmcp/lazy-zod");
16001
- import_protocol31 = require("@frontmcp/protocol");
15975
+ import_protocol32 = require("@frontmcp/protocol");
16002
15976
  init_remote_capabilities_utils();
16003
15977
  init_public_access_utils();
16004
15978
  init_common();
@@ -16010,11 +15984,11 @@ var init_get_prompt_flow = __esm({
16010
15984
  init_flow_context_providers();
16011
15985
  init_lineage_utils();
16012
15986
  inputSchema2 = import_lazy_zod49.z.object({
16013
- request: import_protocol31.GetPromptRequestSchema,
15987
+ request: import_protocol32.GetPromptRequestSchema,
16014
15988
  // z.any() used because ctx is the MCP SDK's PromptGetExtra type which varies by SDK version
16015
15989
  ctx: import_lazy_zod49.z.any()
16016
15990
  });
16017
- outputSchema2 = import_protocol31.GetPromptResultSchema;
15991
+ outputSchema2 = import_protocol32.GetPromptResultSchema;
16018
15992
  stateSchema2 = import_lazy_zod49.z.object({
16019
15993
  input: import_lazy_zod49.z.object({
16020
15994
  name: import_lazy_zod49.z.string().min(1),
@@ -16319,22 +16293,22 @@ var init_get_prompt_flow = __esm({
16319
16293
  });
16320
16294
 
16321
16295
  // libs/sdk/src/prompt/flows/prompts-list.flow.ts
16322
- var import_reflect_metadata4, import_lazy_zod50, import_protocol32, inputSchema3, outputSchema3, stateSchema3, plan3, name3, Stage3, PromptsListFlow;
16296
+ var import_reflect_metadata4, import_lazy_zod50, import_protocol33, inputSchema3, outputSchema3, stateSchema3, plan3, name3, Stage3, PromptsListFlow;
16323
16297
  var init_prompts_list_flow = __esm({
16324
16298
  "libs/sdk/src/prompt/flows/prompts-list.flow.ts"() {
16325
16299
  "use strict";
16326
16300
  init_common();
16327
16301
  import_reflect_metadata4 = require("reflect-metadata");
16328
16302
  import_lazy_zod50 = require("@frontmcp/lazy-zod");
16329
- import_protocol32 = require("@frontmcp/protocol");
16303
+ import_protocol33 = require("@frontmcp/protocol");
16330
16304
  init_public_access_utils();
16331
16305
  init_availability();
16332
16306
  init_errors();
16333
16307
  inputSchema3 = import_lazy_zod50.z.object({
16334
- request: import_protocol32.ListPromptsRequestSchema,
16308
+ request: import_protocol33.ListPromptsRequestSchema,
16335
16309
  ctx: import_lazy_zod50.z.unknown()
16336
16310
  });
16337
- outputSchema3 = import_protocol32.ListPromptsResultSchema;
16311
+ outputSchema3 = import_protocol33.ListPromptsResultSchema;
16338
16312
  stateSchema3 = import_lazy_zod50.z.object({
16339
16313
  cursor: import_lazy_zod50.z.string().optional(),
16340
16314
  prompts: import_lazy_zod50.z.array(
@@ -16690,11 +16664,11 @@ var init_prompt_utils = __esm({
16690
16664
  });
16691
16665
 
16692
16666
  // libs/sdk/src/prompt/prompt.instance.ts
16693
- var import_protocol33, PromptInstance, FunctionPromptContext;
16667
+ var import_protocol34, PromptInstance, FunctionPromptContext;
16694
16668
  var init_prompt_instance = __esm({
16695
16669
  "libs/sdk/src/prompt/prompt.instance.ts"() {
16696
16670
  "use strict";
16697
- import_protocol33 = require("@frontmcp/protocol");
16671
+ import_protocol34 = require("@frontmcp/protocol");
16698
16672
  init_common();
16699
16673
  init_errors();
16700
16674
  init_entry_class_hooks();
@@ -16794,7 +16768,7 @@ var init_prompt_instance = __esm({
16794
16768
  * Convert the raw prompt return value into an MCP GetPromptResult.
16795
16769
  */
16796
16770
  parseOutput(raw) {
16797
- return import_protocol33.GetPromptResultSchema.parse(buildParsedPromptResult(raw, this.metadata));
16771
+ return import_protocol34.GetPromptResultSchema.parse(buildParsedPromptResult(raw, this.metadata));
16798
16772
  }
16799
16773
  /**
16800
16774
  * Safe version of parseOutput that returns success/error instead of throwing.
@@ -17524,6 +17498,21 @@ var init_esm_auth_types = __esm({
17524
17498
  }
17525
17499
  });
17526
17500
 
17501
+ // libs/sdk/src/third-party/semver.ts
17502
+ var import_compare, import_gt, import_rcompare, import_satisfies, import_valid, import_max_satisfying, import_valid2;
17503
+ var init_semver = __esm({
17504
+ "libs/sdk/src/third-party/semver.ts"() {
17505
+ "use strict";
17506
+ import_compare = __toESM(require("semver/functions/compare.js"));
17507
+ import_gt = __toESM(require("semver/functions/gt.js"));
17508
+ import_rcompare = __toESM(require("semver/functions/rcompare.js"));
17509
+ import_satisfies = __toESM(require("semver/functions/satisfies.js"));
17510
+ import_valid = __toESM(require("semver/functions/valid.js"));
17511
+ import_max_satisfying = __toESM(require("semver/ranges/max-satisfying.js"));
17512
+ import_valid2 = __toESM(require("semver/ranges/valid.js"));
17513
+ }
17514
+ });
17515
+
17527
17516
  // libs/sdk/src/esm-loader/semver.utils.ts
17528
17517
  function isDistTag(range) {
17529
17518
  return /^[a-zA-Z][a-zA-Z0-9]*$/.test(range) && (0, import_valid2.default)(range) === null;
@@ -17552,17 +17541,10 @@ function compareVersions(v1, v2) {
17552
17541
  function isNewerVersion(v1, v2) {
17553
17542
  return (0, import_gt.default)(v1, v2);
17554
17543
  }
17555
- var import_compare, import_gt, import_rcompare, import_satisfies, import_valid, import_max_satisfying, import_valid2;
17556
17544
  var init_semver_utils = __esm({
17557
17545
  "libs/sdk/src/esm-loader/semver.utils.ts"() {
17558
17546
  "use strict";
17559
- import_compare = __toESM(require("semver/functions/compare.js"));
17560
- import_gt = __toESM(require("semver/functions/gt.js"));
17561
- import_rcompare = __toESM(require("semver/functions/rcompare.js"));
17562
- import_satisfies = __toESM(require("semver/functions/satisfies.js"));
17563
- import_valid = __toESM(require("semver/functions/valid.js"));
17564
- import_max_satisfying = __toESM(require("semver/ranges/max-satisfying.js"));
17565
- import_valid2 = __toESM(require("semver/ranges/valid.js"));
17547
+ init_semver();
17566
17548
  }
17567
17549
  });
17568
17550
 
@@ -18075,17 +18057,17 @@ function loadPackageOnce(scope, specifier, options) {
18075
18057
  const packageLoader = options?.loader ?? scope.metadata.loader;
18076
18058
  const loaderFingerprint = (0, import_utils48.sha256Hex)(JSON.stringify({ packageLoader, cacheTTL: options?.cacheTTL })).slice(0, 16);
18077
18059
  const key = `${specifier.fullName}@${specifier.range}#${loaderFingerprint}`;
18078
- let load3 = loads.get(key);
18079
- if (!load3) {
18060
+ let load2 = loads.get(key);
18061
+ if (!load2) {
18080
18062
  const loader = createPackageModuleLoader({
18081
18063
  loader: packageLoader,
18082
18064
  cacheTTL: options?.cacheTTL,
18083
18065
  logger: scope.logger
18084
18066
  });
18085
- load3 = loader.load(specifier);
18086
- loads.set(key, load3);
18067
+ load2 = loader.load(specifier);
18068
+ loads.set(key, load2);
18087
18069
  }
18088
- return load3;
18070
+ return load2;
18089
18071
  }
18090
18072
  async function loadEsmEntries(scope, entryKind, source, recordsOf) {
18091
18073
  const { manifest } = await loadPackageOnce(scope, source.specifier, source.options).catch((error) => {
@@ -18312,7 +18294,7 @@ function readParamHeaders(headers) {
18312
18294
  }
18313
18295
  function metaProtocolVersion(body) {
18314
18296
  const meta = body?.params?._meta;
18315
- const value = meta?.[import_protocol34.MCP_20260728_META.protocolVersion];
18297
+ const value = meta?.[import_protocol35.MCP_20260728_META.protocolVersion];
18316
18298
  return typeof value === "string" ? value : void 0;
18317
18299
  }
18318
18300
  function declaresProtocol20260728(params) {
@@ -18342,7 +18324,7 @@ function headerMismatch(message) {
18342
18324
  return {
18343
18325
  ok: false,
18344
18326
  status: 400,
18345
- error: { code: import_protocol34.MCP_20260728_ERROR_CODES.headerMismatch, message: `Header mismatch: ${message}` }
18327
+ error: { code: import_protocol35.MCP_20260728_ERROR_CODES.headerMismatch, message: `Header mismatch: ${message}` }
18346
18328
  };
18347
18329
  }
18348
18330
  function collectHeaderParams(schema, path = [], out = /* @__PURE__ */ new Map()) {
@@ -18385,7 +18367,7 @@ function validate20260728Request(options) {
18385
18367
  return (headerVersion ? versionSupported(headerVersion) : void 0) ?? { ok: true, version };
18386
18368
  }
18387
18369
  if (!bodyVersion && strictHeaders) {
18388
- return headerMismatch(`request params._meta must declare "${import_protocol34.MCP_20260728_META.protocolVersion}"`);
18370
+ return headerMismatch(`request params._meta must declare "${import_protocol35.MCP_20260728_META.protocolVersion}"`);
18389
18371
  }
18390
18372
  if (headerVersion && bodyVersion && headerVersion !== bodyVersion) {
18391
18373
  return headerMismatch(
@@ -18441,7 +18423,7 @@ function versionSupported(version) {
18441
18423
  ok: false,
18442
18424
  status: 400,
18443
18425
  error: {
18444
- code: import_protocol34.MCP_20260728_ERROR_CODES.unsupportedProtocolVersion,
18426
+ code: import_protocol35.MCP_20260728_ERROR_CODES.unsupportedProtocolVersion,
18445
18427
  message: `Unsupported protocol version: ${version}`,
18446
18428
  data: { supported: [...FRONTMCP_SUPPORTED_PROTOCOL_VERSIONS], requested: version }
18447
18429
  }
@@ -18484,14 +18466,14 @@ function validateParamHeaders(headers, params, lookupToolSchema, strictHeaders)
18484
18466
  }
18485
18467
  return void 0;
18486
18468
  }
18487
- var import_protocol34, IMPLEMENTED_PROTOCOL_VERSION;
18469
+ var import_protocol35, IMPLEMENTED_PROTOCOL_VERSION;
18488
18470
  var init_request_validation = __esm({
18489
18471
  "libs/sdk/src/transport/mcp-20260728/request-validation.ts"() {
18490
18472
  "use strict";
18491
- import_protocol34 = require("@frontmcp/protocol");
18473
+ import_protocol35 = require("@frontmcp/protocol");
18492
18474
  init_header_codec();
18493
18475
  init_protocol_20260728_constants();
18494
- IMPLEMENTED_PROTOCOL_VERSION = import_protocol34.PROTOCOL_2026_07_28;
18476
+ IMPLEMENTED_PROTOCOL_VERSION = import_protocol35.PROTOCOL_2026_07_28;
18495
18477
  }
18496
18478
  });
18497
18479
 
@@ -18689,7 +18671,7 @@ function decorateResult(result, options) {
18689
18671
  _meta: {
18690
18672
  ...existingMeta,
18691
18673
  ...traceContext ?? {},
18692
- [import_protocol35.MCP_20260728_META.serverInfo]: serverInfo
18674
+ [import_protocol36.MCP_20260728_META.serverInfo]: serverInfo
18693
18675
  }
18694
18676
  };
18695
18677
  if (CACHEABLE_METHODS.includes(method)) {
@@ -18719,11 +18701,11 @@ function isShapedPerCaller(scope, method) {
18719
18701
  function resolveCacheScope(isAnonymous, shapedPerCaller = true) {
18720
18702
  return isAnonymous && !shapedPerCaller ? "public" : "private";
18721
18703
  }
18722
- var import_protocol35, ORDERED_LIST_FIELDS, RESULT_SHAPING_FLOWS;
18704
+ var import_protocol36, ORDERED_LIST_FIELDS, RESULT_SHAPING_FLOWS;
18723
18705
  var init_result_decorator = __esm({
18724
18706
  "libs/sdk/src/transport/mcp-20260728/result-decorator.ts"() {
18725
18707
  "use strict";
18726
- import_protocol35 = require("@frontmcp/protocol");
18708
+ import_protocol36 = require("@frontmcp/protocol");
18727
18709
  init_protocol_20260728_constants();
18728
18710
  ORDERED_LIST_FIELDS = {
18729
18711
  "tools/list": "tools",
@@ -19094,10 +19076,10 @@ function createSubscriptionStream(options) {
19094
19076
  try {
19095
19077
  yield frame({
19096
19078
  jsonrpc: "2.0",
19097
- method: import_protocol36.SUBSCRIPTIONS_ACKNOWLEDGED_METHOD,
19079
+ method: import_protocol37.SUBSCRIPTIONS_ACKNOWLEDGED_METHOD,
19098
19080
  params: {
19099
19081
  notifications: acknowledged,
19100
- _meta: { [import_protocol36.MCP_20260728_META.subscriptionId]: subscriptionId }
19082
+ _meta: { [import_protocol37.MCP_20260728_META.subscriptionId]: subscriptionId }
19101
19083
  }
19102
19084
  });
19103
19085
  for (; ; ) {
@@ -19108,7 +19090,7 @@ function createSubscriptionStream(options) {
19108
19090
  method: next.method,
19109
19091
  params: {
19110
19092
  ...next.params,
19111
- _meta: { [import_protocol36.MCP_20260728_META.subscriptionId]: subscriptionId }
19093
+ _meta: { [import_protocol37.MCP_20260728_META.subscriptionId]: subscriptionId }
19112
19094
  }
19113
19095
  });
19114
19096
  }
@@ -19132,11 +19114,11 @@ function createSubscriptionStream(options) {
19132
19114
  }
19133
19115
  return { acknowledged, stream: generate() };
19134
19116
  }
19135
- var import_protocol36, KEEPALIVE_INTERVAL_MS, encoder2, KEEPALIVE_FRAME;
19117
+ var import_protocol37, KEEPALIVE_INTERVAL_MS, encoder2, KEEPALIVE_FRAME;
19136
19118
  var init_subscriptions = __esm({
19137
19119
  "libs/sdk/src/transport/mcp-20260728/subscriptions.ts"() {
19138
19120
  "use strict";
19139
- import_protocol36 = require("@frontmcp/protocol");
19121
+ import_protocol37 = require("@frontmcp/protocol");
19140
19122
  init_channel_utils();
19141
19123
  KEEPALIVE_INTERVAL_MS = 15e3;
19142
19124
  encoder2 = new TextEncoder();
@@ -19327,7 +19309,7 @@ function toJsonRpcError(error) {
19327
19309
  return {
19328
19310
  status: 400,
19329
19311
  error: {
19330
- code: import_protocol37.MCP_20260728_ERROR_CODES.missingRequiredClientCapability,
19312
+ code: import_protocol38.MCP_20260728_ERROR_CODES.missingRequiredClientCapability,
19331
19313
  message: error.getPublicMessage(),
19332
19314
  data: { requiredCapabilities: error.requiredCapabilities }
19333
19315
  }
@@ -19366,7 +19348,7 @@ async function dispatch20260728(options) {
19366
19348
  const cacheScope = resolveCacheScope(isAnonymous, isShapedPerCaller(scope, method));
19367
19349
  const serverInfo = scope.metadata.info;
19368
19350
  const decorate = (raw) => decorateResult(orderListResult(method, raw), { method, serverInfo, cacheScope, traceContext });
19369
- if (import_protocol37.MCP_20260728_REMOVED_METHODS.includes(method)) {
19351
+ if (import_protocol38.MCP_20260728_REMOVED_METHODS.includes(method)) {
19370
19352
  return {
19371
19353
  kind: "error",
19372
19354
  status: 404,
@@ -19379,7 +19361,7 @@ async function dispatch20260728(options) {
19379
19361
  kind: "error",
19380
19362
  status: 400,
19381
19363
  error: {
19382
- code: import_protocol37.MCP_20260728_ERROR_CODES.missingRequiredClientCapability,
19364
+ code: import_protocol38.MCP_20260728_ERROR_CODES.missingRequiredClientCapability,
19383
19365
  message: `${method} requires the ${TASKS_EXTENSION_ID} extension`,
19384
19366
  data: { requiredCapabilities: { extensions: { [TASKS_EXTENSION_ID]: {} } } }
19385
19367
  }
@@ -19452,7 +19434,7 @@ async function dispatch20260728(options) {
19452
19434
  authInfo: taskDecision.kind === "create" ? { ...authInfo ?? {}, sessionId: taskDecision.owner } : authInfo,
19453
19435
  sendNotification: async () => void 0,
19454
19436
  sendRequest: async () => {
19455
- throw new import_protocol37.McpError(-32603, "Server-initiated requests were removed in protocol 2026-07-28; use MRTR");
19437
+ throw new import_protocol38.McpError(-32603, "Server-initiated requests were removed in protocol 2026-07-28; use MRTR");
19456
19438
  }
19457
19439
  };
19458
19440
  try {
@@ -19480,12 +19462,12 @@ async function dispatch20260728(options) {
19480
19462
  return { kind: "error", status: mapped.status, error: mapped.error };
19481
19463
  }
19482
19464
  }
19483
- var import_auth25, import_protocol37, import_utils50, MRTR_CAPABLE_METHODS;
19465
+ var import_auth25, import_protocol38, import_utils50, MRTR_CAPABLE_METHODS;
19484
19466
  var init_dispatcher = __esm({
19485
19467
  "libs/sdk/src/transport/mcp-20260728/dispatcher.ts"() {
19486
19468
  "use strict";
19487
19469
  import_auth25 = require("@frontmcp/auth");
19488
- import_protocol37 = require("@frontmcp/protocol");
19470
+ import_protocol38 = require("@frontmcp/protocol");
19489
19471
  import_utils50 = require("@frontmcp/utils");
19490
19472
  init_errors();
19491
19473
  init_build_scoped_server_options();
@@ -19585,11 +19567,11 @@ function retryAfterMsOf(header) {
19585
19567
  const ms = Number.isNaN(seconds) ? Date.parse(header) - Date.now() : seconds * 1e3;
19586
19568
  return Number.isNaN(ms) ? void 0 : Math.max(0, ms);
19587
19569
  }
19588
- var import_protocol38, McpStatelessError, DEFAULT_CLIENT_INFO, McpStatelessClient, TASKS_CLIENT_CAPABILITY;
19570
+ var import_protocol39, McpStatelessError, DEFAULT_CLIENT_INFO, McpStatelessClient, TASKS_CLIENT_CAPABILITY;
19589
19571
  var init_mcp_stateless_client = __esm({
19590
19572
  "libs/sdk/src/transport/mcp-20260728/client/mcp-stateless.client.ts"() {
19591
19573
  "use strict";
19592
- import_protocol38 = require("@frontmcp/protocol");
19574
+ import_protocol39 = require("@frontmcp/protocol");
19593
19575
  init_list_all_pages_utils();
19594
19576
  init_header_codec();
19595
19577
  init_protocol_20260728_constants();
@@ -19851,16 +19833,16 @@ var init_mcp_stateless_client = __esm({
19851
19833
  /** Assemble the JSON-RPC body and its mirrored HTTP headers. */
19852
19834
  buildRequest(method, params, id) {
19853
19835
  const meta = {
19854
- [import_protocol38.MCP_20260728_META.protocolVersion]: import_protocol38.PROTOCOL_2026_07_28,
19855
- [import_protocol38.MCP_20260728_META.clientInfo]: this.options.clientInfo ?? DEFAULT_CLIENT_INFO,
19856
- [import_protocol38.MCP_20260728_META.clientCapabilities]: this.options.capabilities ?? {}
19836
+ [import_protocol39.MCP_20260728_META.protocolVersion]: import_protocol39.PROTOCOL_2026_07_28,
19837
+ [import_protocol39.MCP_20260728_META.clientInfo]: this.options.clientInfo ?? DEFAULT_CLIENT_INFO,
19838
+ [import_protocol39.MCP_20260728_META.clientCapabilities]: this.options.capabilities ?? {}
19857
19839
  };
19858
- if (this.options.logLevel) meta[import_protocol38.MCP_20260728_META.logLevel] = this.options.logLevel;
19840
+ if (this.options.logLevel) meta[import_protocol39.MCP_20260728_META.logLevel] = this.options.logLevel;
19859
19841
  const body = { jsonrpc: "2.0", id, method, params: { ...params, _meta: meta } };
19860
19842
  const headers = {
19861
19843
  "content-type": "application/json",
19862
19844
  accept: "application/json, text/event-stream",
19863
- "MCP-Protocol-Version": import_protocol38.PROTOCOL_2026_07_28,
19845
+ "MCP-Protocol-Version": import_protocol39.PROTOCOL_2026_07_28,
19864
19846
  "Mcp-Method": method,
19865
19847
  ...this.options.headers ?? {}
19866
19848
  };
@@ -20586,12 +20568,12 @@ var init_resilience = __esm({
20586
20568
  });
20587
20569
 
20588
20570
  // libs/sdk/src/remote-mcp/mcp-client.service.ts
20589
- var import_auth26, import_protocol39, DEFAULT_RETRY_OPTIONS2, DEFAULT_CIRCUIT_BREAKER_OPTIONS, DEFAULT_HEALTH_CHECK_OPTIONS, DEFAULT_OPTIONS3, McpClientService;
20571
+ var import_auth26, import_client2, DEFAULT_RETRY_OPTIONS2, DEFAULT_CIRCUIT_BREAKER_OPTIONS, DEFAULT_HEALTH_CHECK_OPTIONS, DEFAULT_OPTIONS3, McpClientService;
20590
20572
  var init_mcp_client_service = __esm({
20591
20573
  "libs/sdk/src/remote-mcp/mcp-client.service.ts"() {
20592
20574
  "use strict";
20593
20575
  import_auth26 = require("@frontmcp/auth");
20594
- import_protocol39 = require("@frontmcp/protocol");
20576
+ import_client2 = require("@frontmcp/protocol/client");
20595
20577
  init_list_all_pages_utils();
20596
20578
  init_mcp_error();
20597
20579
  init_remote_errors();
@@ -20700,7 +20682,7 @@ var init_mcp_client_service = __esm({
20700
20682
  return connection2026;
20701
20683
  }
20702
20684
  let transport = this.createTransport(request, headers);
20703
- const client = new import_protocol39.Client(
20685
+ const client = new import_client2.Client(
20704
20686
  {
20705
20687
  name: this.options.clientName,
20706
20688
  version: this.options.clientVersion
@@ -21194,9 +21176,9 @@ var init_mcp_client_service = __esm({
21194
21176
  };
21195
21177
  switch (transportType) {
21196
21178
  case "http":
21197
- return new import_protocol39.StreamableHTTPClientTransport(new URL(url), options);
21179
+ return new import_client2.StreamableHTTPClientTransport(new URL(url), options);
21198
21180
  case "sse":
21199
- return new import_protocol39.SSEClientTransport(new URL(url), options);
21181
+ return new import_client2.SSEClientTransport(new URL(url), options);
21200
21182
  case "worker":
21201
21183
  case "npm":
21202
21184
  case "esm":
@@ -21209,7 +21191,7 @@ var init_mcp_client_service = __esm({
21209
21191
  * Create fallback SSE transport when Streamable HTTP fails
21210
21192
  */
21211
21193
  createFallbackSSETransport(request, headers) {
21212
- return new import_protocol39.SSEClientTransport(new URL(request.url), {
21194
+ return new import_client2.SSEClientTransport(new URL(request.url), {
21213
21195
  requestInit: headers ? { headers } : void 0,
21214
21196
  fetch: createRemoteRequestFetch(headers !== void 0)
21215
21197
  });
@@ -26203,6 +26185,15 @@ var init_config_symbols = __esm({
26203
26185
  }
26204
26186
  });
26205
26187
 
26188
+ // libs/sdk/src/third-party/js-yaml.ts
26189
+ var import_js_yaml;
26190
+ var init_js_yaml = __esm({
26191
+ "libs/sdk/src/third-party/js-yaml.ts"() {
26192
+ "use strict";
26193
+ import_js_yaml = require("js-yaml");
26194
+ }
26195
+ });
26196
+
26206
26197
  // libs/sdk/src/builtin/config/providers/env-loader.ts
26207
26198
  function parseEnvContent(content) {
26208
26199
  const result = {};
@@ -26412,7 +26403,7 @@ async function loadYamlConfig(basePath, configPath) {
26412
26403
  const fullPath = (0, import_utils61.pathResolve)(basePath, baseName + ext);
26413
26404
  if (await (0, import_utils61.fileExists)(fullPath)) {
26414
26405
  const content = await (0, import_utils61.readFile)(fullPath);
26415
- const parsed = yaml.load(content);
26406
+ const parsed = import_js_yaml.load(content);
26416
26407
  if (parsed && typeof parsed === "object") {
26417
26408
  return parsed;
26418
26409
  }
@@ -26452,12 +26443,12 @@ function deepMerge(target, source) {
26452
26443
  }
26453
26444
  return result;
26454
26445
  }
26455
- var yaml, import_utils61, UNSAFE_MERGE_KEYS;
26446
+ var import_utils61, UNSAFE_MERGE_KEYS;
26456
26447
  var init_config_loader = __esm({
26457
26448
  "libs/sdk/src/builtin/config/providers/config-loader.ts"() {
26458
26449
  "use strict";
26459
- yaml = __toESM(require("js-yaml"));
26460
26450
  import_utils61 = require("@frontmcp/utils");
26451
+ init_js_yaml();
26461
26452
  init_config_service();
26462
26453
  init_env_loader();
26463
26454
  UNSAFE_MERGE_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
@@ -30424,7 +30415,7 @@ function parseSkillMdFrontmatter(content) {
30424
30415
  const body = trimmed.substring(bodyStart);
30425
30416
  let frontmatter = {};
30426
30417
  try {
30427
- const parsed = yaml2.load(yamlBlock);
30418
+ const parsed = import_js_yaml.load(yamlBlock);
30428
30419
  if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
30429
30420
  frontmatter = parsed;
30430
30421
  }
@@ -30576,12 +30567,12 @@ function stripFrontmatter(content) {
30576
30567
  const { body } = parseSkillMdFrontmatter(content);
30577
30568
  return body;
30578
30569
  }
30579
- var yaml2, import_utils69;
30570
+ var import_utils69;
30580
30571
  var init_skill_md_parser = __esm({
30581
30572
  "libs/sdk/src/skill/skill-md-parser.ts"() {
30582
30573
  "use strict";
30583
- yaml2 = __toESM(require("js-yaml"));
30584
30574
  import_utils69 = require("@frontmcp/utils");
30575
+ init_js_yaml();
30585
30576
  }
30586
30577
  });
30587
30578
 
@@ -31223,6 +31214,24 @@ var init_skill_instance = __esm({
31223
31214
  }
31224
31215
  });
31225
31216
 
31217
+ // libs/sdk/src/utils/dynamic-import.utils.ts
31218
+ async function importWithRequireFallback(dynamicImport, requireFallback) {
31219
+ try {
31220
+ return await dynamicImport();
31221
+ } catch (importError) {
31222
+ try {
31223
+ return requireFallback();
31224
+ } catch {
31225
+ throw importError;
31226
+ }
31227
+ }
31228
+ }
31229
+ var init_dynamic_import_utils = __esm({
31230
+ "libs/sdk/src/utils/dynamic-import.utils.ts"() {
31231
+ "use strict";
31232
+ }
31233
+ });
31234
+
31226
31235
  // libs/sdk/src/skill/providers/memory-skill.provider.ts
31227
31236
  var memory_skill_provider_exports = {};
31228
31237
  __export(memory_skill_provider_exports, {
@@ -32859,11 +32868,11 @@ var init_skill_registry = __esm({
32859
32868
  /** The search and storage provider; the in-memory one, with its search index, is built the first time a skill needs it. */
32860
32869
  storage() {
32861
32870
  if (!this.storageProviderLoad) {
32862
- const load3 = this.createMemoryProvider().catch((error) => {
32863
- if (this.storageProviderLoad === load3) this.storageProviderLoad = void 0;
32871
+ const load2 = this.createMemoryProvider().catch((error) => {
32872
+ if (this.storageProviderLoad === load2) this.storageProviderLoad = void 0;
32864
32873
  throw error;
32865
32874
  });
32866
- this.storageProviderLoad = load3;
32875
+ this.storageProviderLoad = load2;
32867
32876
  }
32868
32877
  return this.storageProviderLoad;
32869
32878
  }
@@ -39925,7 +39934,7 @@ function buildFrontmatter(skill) {
39925
39934
  }
39926
39935
  function serializeSkillMd(skill, rawInstructions) {
39927
39936
  const fm = buildFrontmatter(skill);
39928
- const yamlBlock = yaml3.dump(fm, {
39937
+ const yamlBlock = import_js_yaml.dump(fm, {
39929
39938
  lineWidth: -1,
39930
39939
  // don't wrap long lines (descriptions, allowed-tools)
39931
39940
  noRefs: true,
@@ -39939,11 +39948,10 @@ ${yamlBlock}
39939
39948
  ${body}
39940
39949
  `;
39941
39950
  }
39942
- var yaml3;
39943
39951
  var init_sep_2640_builders = __esm({
39944
39952
  "libs/sdk/src/skill/sep-2640/sep-2640.builders.ts"() {
39945
39953
  "use strict";
39946
- yaml3 = __toESM(require("js-yaml"));
39954
+ init_js_yaml();
39947
39955
  init_sep_2640_constants();
39948
39956
  init_sep_2640_uri();
39949
39957
  }
@@ -43895,12 +43903,8 @@ __export(web_standard_mcp_exports, {
43895
43903
  runWebStandardMcp: () => runWebStandardMcp
43896
43904
  });
43897
43905
  async function wireServer(scope, serverOptions, sessionId, sessionIdGenerator, enableJsonResponse) {
43898
- const { McpServer: McpServer3, WebStandardStreamableHTTPServerTransport: WebStandardStreamableHTTPServerTransport2 } = await importWithRequireFallback(
43899
- () => import("@frontmcp/protocol"),
43900
- () => require("@frontmcp/protocol")
43901
- );
43902
43906
  const { createMcpHandlers: createMcpHandlers2 } = await Promise.resolve().then(() => (init_mcp_handlers(), mcp_handlers_exports));
43903
- const mcpServer = new McpServer3(scope.metadata.info, serverOptions);
43907
+ const mcpServer = new import_protocol50.McpServer(scope.metadata.info, serverOptions);
43904
43908
  const composeInstructions = (caller) => composeCallerInstructions(scope, { ctx: caller, skillUriHints: true });
43905
43909
  for (const handler of createMcpHandlers2({ scope, serverOptions, composeInstructions })) {
43906
43910
  const originalHandler = handler.handler;
@@ -43911,7 +43915,7 @@ async function wireServer(scope, serverOptions, sessionId, sessionIdGenerator, e
43911
43915
  };
43912
43916
  mcpServer.setRequestHandler(handler.requestSchema, wrappedHandler);
43913
43917
  }
43914
- const transport = new WebStandardStreamableHTTPServerTransport2({
43918
+ const transport = new import_protocol50.WebStandardStreamableHTTPServerTransport({
43915
43919
  sessionIdGenerator,
43916
43920
  enableJsonResponse,
43917
43921
  maxRequestBodySize: mcpTransportBodyLimit(scope.metadata.http?.bodyLimit)
@@ -43951,13 +43955,13 @@ async function runWebStandardMcp(scope, request, options) {
43951
43955
  }
43952
43956
  return response;
43953
43957
  }
43954
- var import_utils89;
43958
+ var import_protocol50, import_utils89;
43955
43959
  var init_web_standard_mcp = __esm({
43956
43960
  "libs/sdk/src/transport/web-standard-mcp.ts"() {
43957
43961
  "use strict";
43962
+ import_protocol50 = require("@frontmcp/protocol");
43958
43963
  import_utils89 = require("@frontmcp/utils");
43959
43964
  init_skill_instructions_helper();
43960
- init_dynamic_import_utils();
43961
43965
  init_body_limit();
43962
43966
  init_build_scoped_server_options();
43963
43967
  }
@@ -45697,50 +45701,6 @@ var init_session_store_factory = __esm({
45697
45701
  }
45698
45702
  });
45699
45703
 
45700
- // libs/sdk/src/transport/event-stores/session-scoped.event-store.ts
45701
- function createSessionScopedEventStore(store, sessionId) {
45702
- const prefix = `${sessionId}${SCOPE_SEPARATOR}`;
45703
- const scope = (streamId) => `${prefix}${streamId}`;
45704
- const unscope = (streamId) => {
45705
- const value = String(streamId);
45706
- return value.startsWith(prefix) ? value.slice(prefix.length) : value;
45707
- };
45708
- const resolveOwnedStream = async (eventId) => {
45709
- const lookup = store.getStreamIdForEventId;
45710
- if (lookup) {
45711
- const resolved = await lookup.call(store, eventId);
45712
- return resolved !== void 0 && String(resolved).startsWith(prefix) ? resolved : void 0;
45713
- }
45714
- if (!String(eventId).startsWith(prefix)) return void 0;
45715
- const value = String(eventId);
45716
- const lastColon = value.lastIndexOf(":");
45717
- return lastColon === -1 ? void 0 : value.slice(0, lastColon);
45718
- };
45719
- return {
45720
- async storeEvent(streamId, message) {
45721
- return store.storeEvent(scope(streamId), message);
45722
- },
45723
- async getStreamIdForEventId(eventId) {
45724
- const owned = await resolveOwnedStream(eventId);
45725
- return owned === void 0 ? void 0 : unscope(owned);
45726
- },
45727
- async replayEventsAfter(lastEventId, options) {
45728
- const owned = await resolveOwnedStream(lastEventId);
45729
- if (owned === void 0) {
45730
- return "default-stream";
45731
- }
45732
- return unscope(await store.replayEventsAfter(lastEventId, options));
45733
- }
45734
- };
45735
- }
45736
- var SCOPE_SEPARATOR;
45737
- var init_session_scoped_event_store = __esm({
45738
- "libs/sdk/src/transport/event-stores/session-scoped.event-store.ts"() {
45739
- "use strict";
45740
- SCOPE_SEPARATOR = " ";
45741
- }
45742
- });
45743
-
45744
45704
  // libs/sdk/src/transport/transport.error.ts
45745
45705
  var import_utils92, JSON_RPC2, rpcError, rpcRequest;
45746
45706
  var init_transport_error = __esm({
@@ -45788,11 +45748,11 @@ function mergeExperimental(fragments) {
45788
45748
  if (sawExtensions) out["extensions"] = extensions;
45789
45749
  return out;
45790
45750
  }
45791
- var import_protocol50, LocalTransportAdapter;
45751
+ var import_protocol51, LocalTransportAdapter;
45792
45752
  var init_transport_local_adapter = __esm({
45793
45753
  "libs/sdk/src/transport/adapters/transport.local.adapter.ts"() {
45794
45754
  "use strict";
45795
- import_protocol50 = require("@frontmcp/protocol");
45755
+ import_protocol51 = require("@frontmcp/protocol");
45796
45756
  init_common();
45797
45757
  init_errors();
45798
45758
  init_skill_instructions_helper();
@@ -45911,7 +45871,7 @@ var init_transport_local_adapter = __esm({
45911
45871
  capabilities: JSON.stringify(serverOptions.capabilities),
45912
45872
  serverInfo: JSON.stringify(serverOptions.serverInfo)
45913
45873
  });
45914
- this.server = new import_protocol50.McpServer(info, serverOptions);
45874
+ this.server = new import_protocol51.McpServer(info, serverOptions);
45915
45875
  const handlers = createMcpHandlers({
45916
45876
  scope: this.scope,
45917
45877
  serverOptions,
@@ -45955,7 +45915,7 @@ var init_transport_local_adapter = __esm({
45955
45915
  async ping(timeoutMs = 1e4) {
45956
45916
  try {
45957
45917
  await this.ready;
45958
- await this.server.request({ method: "ping" }, import_protocol50.EmptyResultSchema, { timeout: timeoutMs });
45918
+ await this.server.request({ method: "ping" }, import_protocol51.EmptyResultSchema, { timeout: timeoutMs });
45959
45919
  return true;
45960
45920
  } catch {
45961
45921
  return false;
@@ -46076,7 +46036,7 @@ var init_transport_local_adapter = __esm({
46076
46036
  return true;
46077
46037
  }
46078
46038
  }
46079
- const parsed = import_protocol50.ElicitResultSchema.safeParse(req.body?.result);
46039
+ const parsed = import_protocol51.ElicitResultSchema.safeParse(req.body?.result);
46080
46040
  if (!parsed.success) {
46081
46041
  return false;
46082
46042
  }
@@ -46143,18 +46103,334 @@ var init_transport_local_adapter = __esm({
46143
46103
  }
46144
46104
  });
46145
46105
 
46106
+ // libs/sdk/src/transport/adapters/polyfills/browser-sse-transport.ts
46107
+ var SSEServerTransport;
46108
+ var init_browser_sse_transport = __esm({
46109
+ "libs/sdk/src/transport/adapters/polyfills/browser-sse-transport.ts"() {
46110
+ "use strict";
46111
+ SSEServerTransport = class {
46112
+ constructor(_endpoint, _res, _options) {
46113
+ throw new Error("SSEServerTransport is not available in browser environments");
46114
+ }
46115
+ };
46116
+ }
46117
+ });
46118
+
46119
+ // libs/sdk/src/transport/adapters/sse-transport.ts
46120
+ var sse_transport_exports = {};
46121
+ __export(sse_transport_exports, {
46122
+ RecreateableSSEServerTransport: () => RecreateableSSEServerTransport
46123
+ });
46124
+ var RecreateableSSEServerTransport;
46125
+ var init_sse_transport = __esm({
46126
+ "libs/sdk/src/transport/adapters/sse-transport.ts"() {
46127
+ "use strict";
46128
+ init_browser_sse_transport();
46129
+ RecreateableSSEServerTransport = class extends SSEServerTransport {
46130
+ _isRecreatedSession = false;
46131
+ constructor(endpoint, res, options) {
46132
+ super(endpoint, res, options);
46133
+ if (options?.initialEventId !== void 0 && this.isValidEventId(options.initialEventId)) {
46134
+ this.setEventIdCounter(options.initialEventId);
46135
+ this._isRecreatedSession = true;
46136
+ }
46137
+ }
46138
+ /**
46139
+ * Validates that an event ID is a valid non-negative integer.
46140
+ * Protects against negative values, NaN, Infinity, and non-integer values.
46141
+ */
46142
+ isValidEventId(eventId) {
46143
+ return Number.isInteger(eventId) && eventId >= 0 && eventId <= Number.MAX_SAFE_INTEGER;
46144
+ }
46145
+ /**
46146
+ * Returns whether this is a recreated session.
46147
+ */
46148
+ get isRecreatedSession() {
46149
+ return this._isRecreatedSession;
46150
+ }
46151
+ /**
46152
+ * Returns the current event ID counter value.
46153
+ * Alias for lastEventId for consistency with the recreation API.
46154
+ */
46155
+ get eventIdCounter() {
46156
+ return this.lastEventId;
46157
+ }
46158
+ /**
46159
+ * Sets the event ID counter for session recreation.
46160
+ * Use this when recreating a session from stored state to maintain
46161
+ * event ID continuity for SSE reconnection support.
46162
+ *
46163
+ * @param eventId - The event ID to restore (must be a non-negative integer)
46164
+ */
46165
+ setEventIdCounter(eventId) {
46166
+ if (!this.isValidEventId(eventId)) {
46167
+ console.warn(
46168
+ `[RecreateableSSEServerTransport] Invalid eventId: ${eventId}. Must be a non-negative integer. Ignoring.`
46169
+ );
46170
+ return;
46171
+ }
46172
+ super.setEventIdCounter(eventId);
46173
+ }
46174
+ /**
46175
+ * Sets the transport to a recreated session state.
46176
+ * Use this when recreating a transport from a stored session.
46177
+ *
46178
+ * @param sessionId - The session ID (for verification, should match constructor)
46179
+ * @param lastEventId - The last event ID that was sent to the client
46180
+ */
46181
+ setSessionState(sessionId, lastEventId) {
46182
+ if (this.sessionId !== sessionId) {
46183
+ const redact = (id) => `${id.slice(0, 8)}\u2026`;
46184
+ console.warn(
46185
+ `RecreateableSSEServerTransport: session ID mismatch. Expected ${redact(this.sessionId)}, got ${redact(sessionId)}. Using constructor value.`
46186
+ );
46187
+ }
46188
+ if (lastEventId !== void 0) {
46189
+ this.setEventIdCounter(lastEventId);
46190
+ }
46191
+ this._isRecreatedSession = true;
46192
+ }
46193
+ };
46194
+ }
46195
+ });
46196
+
46197
+ // libs/sdk/src/transport/adapters/transport.sse.adapter.ts
46198
+ async function loadSseTransport() {
46199
+ RecreateableTransport ??= (await Promise.resolve().then(() => (init_sse_transport(), sse_transport_exports))).RecreateableSSEServerTransport;
46200
+ }
46201
+ function sseTransportClass() {
46202
+ if (!RecreateableTransport) {
46203
+ throw new InternalMcpError("The SSE transport was used before loadSseTransport() loaded it");
46204
+ }
46205
+ return RecreateableTransport;
46206
+ }
46207
+ var import_lazy_zod74, RecreateableTransport, TransportSSEAdapter;
46208
+ var init_transport_sse_adapter = __esm({
46209
+ "libs/sdk/src/transport/adapters/transport.sse.adapter.ts"() {
46210
+ "use strict";
46211
+ import_lazy_zod74 = require("@frontmcp/lazy-zod");
46212
+ init_elicitation_types();
46213
+ init_errors();
46214
+ init_transport_error();
46215
+ init_transport_local_adapter();
46216
+ TransportSSEAdapter = class extends LocalTransportAdapter {
46217
+ sessionId;
46218
+ /**
46219
+ * Configures common error and close handlers for SSE transports.
46220
+ */
46221
+ configureTransportHandlers(transport) {
46222
+ transport.onerror = (error) => {
46223
+ console.error("SSE error:", error instanceof Error ? error.message : "Unknown error");
46224
+ };
46225
+ transport.onclose = this.destroy.bind(this);
46226
+ }
46227
+ createTransport(sessionId, res) {
46228
+ this.sessionId = sessionId;
46229
+ this.logger.info(`new transport session: ${sessionId.slice(0, 40)}`);
46230
+ const SseTransport = sseTransportClass();
46231
+ const transport = new SseTransport(`${this.scope.fullPath}/message`, res, {
46232
+ sessionId
46233
+ });
46234
+ this.configureTransportHandlers(transport);
46235
+ return transport;
46236
+ }
46237
+ /**
46238
+ * Recreates a transport with preserved session state.
46239
+ * Use this when restoring a session from Redis or other storage.
46240
+ *
46241
+ * @param sessionId - The session ID to restore
46242
+ * @param res - The new response stream for SSE
46243
+ * @param lastEventId - The last event ID that was sent (for reconnection support)
46244
+ */
46245
+ createTransportFromSession(sessionId, res, lastEventId) {
46246
+ this.sessionId = sessionId;
46247
+ this.logger.info(`recreating transport session: ${sessionId.slice(0, 40)}, lastEventId: ${lastEventId ?? "none"}`);
46248
+ const SseTransport = sseTransportClass();
46249
+ const transport = new SseTransport(`${this.scope.fullPath}/message`, res, {
46250
+ sessionId,
46251
+ initialEventId: lastEventId
46252
+ });
46253
+ this.configureTransportHandlers(transport);
46254
+ return transport;
46255
+ }
46256
+ initialize(req, res) {
46257
+ this.logger.verbose(`[${this.sessionId}] handle initialize request`);
46258
+ this.ensureAuthInfo(req, this);
46259
+ return Promise.resolve();
46260
+ }
46261
+ async handleRequest(req, res) {
46262
+ await this.ready;
46263
+ const authInfo = this.ensureAuthInfo(req, this);
46264
+ if (this.handleIfElicitResult(req)) {
46265
+ this.logger.verbose(`[${this.sessionId}] handled elicitation result`);
46266
+ res.writeHead(202, { "Content-Type": "application/json" });
46267
+ res.end(JSON.stringify({ jsonrpc: "2.0", id: null, result: {} }));
46268
+ return;
46269
+ }
46270
+ if (req.method === "GET") {
46271
+ this.logger.verbose(`[${this.sessionId}] handle get request`);
46272
+ return this.transport.handleMessage(req.body, {
46273
+ requestInfo: {
46274
+ headers: req.headers
46275
+ },
46276
+ authInfo
46277
+ });
46278
+ } else {
46279
+ this.logger.verbose(`[${this.sessionId}] handle post request`);
46280
+ return this.transport.handlePostMessage(req, res, req.body);
46281
+ }
46282
+ }
46283
+ /**
46284
+ * Send an elicitation request to the client.
46285
+ *
46286
+ * Only one elicit per session is allowed. A new elicit will cancel any pending one.
46287
+ * On timeout, an ElicitationTimeoutError is thrown to kill tool execution.
46288
+ *
46289
+ * In distributed mode, the pending elicitation is stored in Redis and results
46290
+ * are routed via pub/sub, allowing the response to be received by any node.
46291
+ */
46292
+ async sendElicitRequest(relatedRequestId, message, requestedSchema, options) {
46293
+ const { mode = "form", ttl = DEFAULT_ELICIT_TTL, elicitationId, url } = options ?? {};
46294
+ if (mode === "url" && !url) {
46295
+ throw new InvalidInputError('url is required when mode is "url"');
46296
+ }
46297
+ await this.cancelPendingElicit();
46298
+ const elicitId = elicitationId || `elicit-${this.newRequestId}`;
46299
+ const sessionId = this.key.sessionId;
46300
+ const expiresAt = Date.now() + ttl;
46301
+ const store = this.requireElicitStore();
46302
+ await store.setPending({
46303
+ elicitId,
46304
+ sessionId,
46305
+ createdAt: Date.now(),
46306
+ expiresAt,
46307
+ message,
46308
+ mode
46309
+ });
46310
+ const params = {
46311
+ mode,
46312
+ message,
46313
+ requestedSchema: (0, import_lazy_zod74.toJSONSchema)(requestedSchema)
46314
+ };
46315
+ if (mode === "url") {
46316
+ params["elicitationId"] = elicitId;
46317
+ params["url"] = url;
46318
+ }
46319
+ this.logger.info("sendElicitRequest", { relatedRequestId, elicitId, mode, ttl });
46320
+ await this.transport.send(rpcRequest(this.newRequestId, "elicitation/create", params));
46321
+ return new Promise((resolve, reject) => {
46322
+ let settled = false;
46323
+ let unsubscribe;
46324
+ const cleanup = () => {
46325
+ clearTimeout(timeoutHandle);
46326
+ this.pendingElicit = void 0;
46327
+ void unsubscribe?.();
46328
+ };
46329
+ const safeResolve = (result) => {
46330
+ if (settled) return;
46331
+ settled = true;
46332
+ cleanup();
46333
+ resolve(result);
46334
+ };
46335
+ const safeReject = (err) => {
46336
+ if (settled) return;
46337
+ settled = true;
46338
+ cleanup();
46339
+ reject(err);
46340
+ };
46341
+ const timeoutHandle = setTimeout(async () => {
46342
+ if (settled) return;
46343
+ settled = true;
46344
+ this.pendingElicit = void 0;
46345
+ await unsubscribe?.();
46346
+ await store.deletePending(sessionId);
46347
+ reject(new ElicitationTimeoutError(elicitId, ttl));
46348
+ }, ttl);
46349
+ store.subscribeResult(
46350
+ elicitId,
46351
+ (result) => {
46352
+ safeResolve(result);
46353
+ },
46354
+ sessionId
46355
+ ).then((unsub) => {
46356
+ unsubscribe = unsub;
46357
+ }).catch(async (err) => {
46358
+ if (settled) return;
46359
+ settled = true;
46360
+ clearTimeout(timeoutHandle);
46361
+ this.pendingElicit = void 0;
46362
+ await unsubscribe?.();
46363
+ await store.deletePending(sessionId);
46364
+ reject(err);
46365
+ });
46366
+ this.pendingElicit = {
46367
+ elicitId,
46368
+ timeoutHandle,
46369
+ resolve: safeResolve,
46370
+ reject: safeReject
46371
+ };
46372
+ });
46373
+ }
46374
+ };
46375
+ }
46376
+ });
46377
+
46378
+ // libs/sdk/src/transport/event-stores/session-scoped.event-store.ts
46379
+ function createSessionScopedEventStore(store, sessionId) {
46380
+ const prefix = `${sessionId}${SCOPE_SEPARATOR}`;
46381
+ const scope = (streamId) => `${prefix}${streamId}`;
46382
+ const unscope = (streamId) => {
46383
+ const value = String(streamId);
46384
+ return value.startsWith(prefix) ? value.slice(prefix.length) : value;
46385
+ };
46386
+ const resolveOwnedStream = async (eventId) => {
46387
+ const lookup = store.getStreamIdForEventId;
46388
+ if (lookup) {
46389
+ const resolved = await lookup.call(store, eventId);
46390
+ return resolved !== void 0 && String(resolved).startsWith(prefix) ? resolved : void 0;
46391
+ }
46392
+ if (!String(eventId).startsWith(prefix)) return void 0;
46393
+ const value = String(eventId);
46394
+ const lastColon = value.lastIndexOf(":");
46395
+ return lastColon === -1 ? void 0 : value.slice(0, lastColon);
46396
+ };
46397
+ return {
46398
+ async storeEvent(streamId, message) {
46399
+ return store.storeEvent(scope(streamId), message);
46400
+ },
46401
+ async getStreamIdForEventId(eventId) {
46402
+ const owned = await resolveOwnedStream(eventId);
46403
+ return owned === void 0 ? void 0 : unscope(owned);
46404
+ },
46405
+ async replayEventsAfter(lastEventId, options) {
46406
+ const owned = await resolveOwnedStream(lastEventId);
46407
+ if (owned === void 0) {
46408
+ return "default-stream";
46409
+ }
46410
+ return unscope(await store.replayEventsAfter(lastEventId, options));
46411
+ }
46412
+ };
46413
+ }
46414
+ var SCOPE_SEPARATOR;
46415
+ var init_session_scoped_event_store = __esm({
46416
+ "libs/sdk/src/transport/event-stores/session-scoped.event-store.ts"() {
46417
+ "use strict";
46418
+ SCOPE_SEPARATOR = " ";
46419
+ }
46420
+ });
46421
+
46146
46422
  // libs/sdk/src/transport/adapters/streamable-http-transport.ts
46147
46423
  var streamable_http_transport_exports = {};
46148
46424
  __export(streamable_http_transport_exports, {
46149
46425
  RecreateableStreamableHTTPServerTransport: () => RecreateableStreamableHTTPServerTransport
46150
46426
  });
46151
- var import_protocol51, RecreateableStreamableHTTPServerTransport;
46427
+ var import_protocol52, RecreateableStreamableHTTPServerTransport;
46152
46428
  var init_streamable_http_transport = __esm({
46153
46429
  "libs/sdk/src/transport/adapters/streamable-http-transport.ts"() {
46154
46430
  "use strict";
46155
- import_protocol51 = require("@frontmcp/protocol");
46431
+ import_protocol52 = require("@frontmcp/protocol");
46156
46432
  init_transport_errors();
46157
- RecreateableStreamableHTTPServerTransport = class extends import_protocol51.StreamableHTTPServerTransport {
46433
+ RecreateableStreamableHTTPServerTransport = class extends import_protocol52.StreamableHTTPServerTransport {
46158
46434
  /**
46159
46435
  * Stores pending initialization state when setInitializationState is called
46160
46436
  * before _webStandardTransport is ready. Applied on first handleRequest.
@@ -46263,7 +46539,7 @@ var init_streamable_http_transport = __esm({
46263
46539
  async handleRequest(req, res, body) {
46264
46540
  const oldWebTransport = this._webStandardTransport;
46265
46541
  if (oldWebTransport && this._isStateless && oldWebTransport._hasHandledRequest) {
46266
- const fresh = new import_protocol51.WebStandardStreamableHTTPServerTransport(this._constructorOptions);
46542
+ const fresh = new import_protocol52.WebStandardStreamableHTTPServerTransport(this._constructorOptions);
46267
46543
  fresh.onmessage = oldWebTransport.onmessage;
46268
46544
  fresh.onclose = oldWebTransport.onclose;
46269
46545
  fresh.onerror = oldWebTransport.onerror;
@@ -46286,13 +46562,13 @@ var init_streamable_http_transport = __esm({
46286
46562
 
46287
46563
  // libs/sdk/src/transport/adapters/transport.streamable-http.adapter.ts
46288
46564
  async function loadStreamableHttpTransport() {
46289
- RecreateableTransport ??= (await Promise.resolve().then(() => (init_streamable_http_transport(), streamable_http_transport_exports))).RecreateableStreamableHTTPServerTransport;
46565
+ RecreateableTransport2 ??= (await Promise.resolve().then(() => (init_streamable_http_transport(), streamable_http_transport_exports))).RecreateableStreamableHTTPServerTransport;
46290
46566
  }
46291
- var import_lazy_zod74, RecreateableTransport, resolveSessionIdGenerator, TransportStreamableHttpAdapter;
46567
+ var import_lazy_zod75, RecreateableTransport2, resolveSessionIdGenerator, TransportStreamableHttpAdapter;
46292
46568
  var init_transport_streamable_http_adapter = __esm({
46293
46569
  "libs/sdk/src/transport/adapters/transport.streamable-http.adapter.ts"() {
46294
46570
  "use strict";
46295
- import_lazy_zod74 = require("@frontmcp/lazy-zod");
46571
+ import_lazy_zod75 = require("@frontmcp/lazy-zod");
46296
46572
  init_errors();
46297
46573
  init_session_scoped_event_store();
46298
46574
  init_transport_error();
@@ -46307,12 +46583,12 @@ var init_transport_streamable_http_adapter = __esm({
46307
46583
  const sharedEventStore = this.scope.eventStore;
46308
46584
  const eventStore = sharedEventStore ? createSessionScopedEventStore(sharedEventStore, sessionId) : void 0;
46309
46585
  const isStateless = this.key.type === "stateless-http";
46310
- if (!RecreateableTransport) {
46586
+ if (!RecreateableTransport2) {
46311
46587
  throw new InternalMcpError(
46312
46588
  "The Streamable HTTP transport was used before loadStreamableHttpTransport() loaded it"
46313
46589
  );
46314
46590
  }
46315
- return new RecreateableTransport({
46591
+ return new RecreateableTransport2({
46316
46592
  sessionIdGenerator,
46317
46593
  isStateless,
46318
46594
  onsessionclosed: () => {
@@ -46344,7 +46620,7 @@ var init_transport_streamable_http_adapter = __esm({
46344
46620
  });
46345
46621
  await this.ready;
46346
46622
  this.logger.verbose("[StreamableHttpAdapter] transport state before handleRequest", {
46347
- isRecreatable: RecreateableTransport !== void 0 && this.transport instanceof RecreateableTransport,
46623
+ isRecreatable: RecreateableTransport2 !== void 0 && this.transport instanceof RecreateableTransport2,
46348
46624
  hasWebTransport: !!this.transport._webStandardTransport,
46349
46625
  webTransportInitialized: this.transport._webStandardTransport?._initialized,
46350
46626
  webTransportStarted: this.transport._webStandardTransport?._started,
@@ -46410,7 +46686,7 @@ var init_transport_streamable_http_adapter = __esm({
46410
46686
  relatedRequestId,
46411
46687
  sessionId,
46412
46688
  message,
46413
- requestedSchema: (0, import_lazy_zod74.toJSONSchema)(requestedSchema),
46689
+ requestedSchema: (0, import_lazy_zod75.toJSONSchema)(requestedSchema),
46414
46690
  options
46415
46691
  });
46416
46692
  const { elicitId, expiresAt, requestParams, pendingRecord } = flowOutput;
@@ -46592,13 +46868,13 @@ function toClientInfo(value) {
46592
46868
  const { name: name48, version } = value;
46593
46869
  return typeof name48 === "string" && typeof version === "string" ? { name: name48, version } : void 0;
46594
46870
  }
46595
- var import_auth44, import_lazy_zod75, import_protocol52, import_utils93, plan22, subscriptionParamsSchema, requestIdSchema, stateSchema20, name22, Stage22, encoder3, TRACE_META_KEYS, HandleMcp20260728Flow;
46871
+ var import_auth44, import_lazy_zod76, import_protocol53, import_utils93, plan22, subscriptionParamsSchema, requestIdSchema, stateSchema20, name22, Stage22, encoder3, TRACE_META_KEYS, HandleMcp20260728Flow;
46596
46872
  var init_handle_mcp_20260728_flow = __esm({
46597
46873
  "libs/sdk/src/transport/flows/handle.mcp-20260728.flow.ts"() {
46598
46874
  "use strict";
46599
46875
  import_auth44 = require("@frontmcp/auth");
46600
- import_lazy_zod75 = require("@frontmcp/lazy-zod");
46601
- import_protocol52 = require("@frontmcp/protocol");
46876
+ import_lazy_zod76 = require("@frontmcp/lazy-zod");
46877
+ import_protocol53 = require("@frontmcp/protocol");
46602
46878
  import_utils93 = require("@frontmcp/utils");
46603
46879
  init_common();
46604
46880
  init_tool_lookup_utils();
@@ -46612,22 +46888,22 @@ var init_handle_mcp_20260728_flow = __esm({
46612
46888
  post: [],
46613
46889
  finalize: ["cleanup"]
46614
46890
  };
46615
- subscriptionParamsSchema = import_lazy_zod75.z.object({
46616
- notifications: import_lazy_zod75.z.object({
46617
- toolsListChanged: import_lazy_zod75.z.boolean().optional(),
46618
- promptsListChanged: import_lazy_zod75.z.boolean().optional(),
46619
- resourcesListChanged: import_lazy_zod75.z.boolean().optional(),
46620
- resourceSubscriptions: import_lazy_zod75.z.array(import_lazy_zod75.z.string()).optional()
46891
+ subscriptionParamsSchema = import_lazy_zod76.z.object({
46892
+ notifications: import_lazy_zod76.z.object({
46893
+ toolsListChanged: import_lazy_zod76.z.boolean().optional(),
46894
+ promptsListChanged: import_lazy_zod76.z.boolean().optional(),
46895
+ resourcesListChanged: import_lazy_zod76.z.boolean().optional(),
46896
+ resourceSubscriptions: import_lazy_zod76.z.array(import_lazy_zod76.z.string()).optional()
46621
46897
  }).default({})
46622
46898
  });
46623
- requestIdSchema = import_lazy_zod75.z.union([import_lazy_zod75.z.string(), import_lazy_zod75.z.number()]);
46624
- stateSchema20 = import_lazy_zod75.z.object({
46899
+ requestIdSchema = import_lazy_zod76.z.union([import_lazy_zod76.z.string(), import_lazy_zod76.z.number()]);
46900
+ stateSchema20 = import_lazy_zod76.z.object({
46625
46901
  /** Negotiated protocol version for this request. */
46626
- version: import_lazy_zod75.z.string().optional(),
46627
- requestType: import_lazy_zod75.z.enum(["notification", "subscriptions", "message"]).optional(),
46628
- isAnonymous: import_lazy_zod75.z.boolean().default(true),
46902
+ version: import_lazy_zod76.z.string().optional(),
46903
+ requestType: import_lazy_zod76.z.enum(["notification", "subscriptions", "message"]).optional(),
46904
+ isAnonymous: import_lazy_zod76.z.boolean().default(true),
46629
46905
  /** Whether the client declared this revision itself (not served under it by default). */
46630
- clientDeclaredRevision: import_lazy_zod75.z.boolean().optional()
46906
+ clientDeclaredRevision: import_lazy_zod76.z.boolean().optional()
46631
46907
  });
46632
46908
  name22 = "handle:mcp-202607280728";
46633
46909
  ({ Stage: Stage22 } = FlowHooksOf(name22));
@@ -46771,7 +47047,7 @@ var init_handle_mcp_20260728_flow = __esm({
46771
47047
  * session that initializes with that capability is subscribed to.
46772
47048
  */
46773
47049
  async listenedChannels(meta) {
46774
- const capabilities = meta?.[import_protocol52.MCP_20260728_META.clientCapabilities];
47050
+ const capabilities = meta?.[import_protocol53.MCP_20260728_META.clientCapabilities];
46775
47051
  if (!supportsChannels(capabilities) || !this.scope.channels) return [];
46776
47052
  const listed = await this.scope.runFlowForOutput("channels:list", {});
46777
47053
  return listed.channels.map((channel2) => channel2.name);
@@ -46783,12 +47059,12 @@ var init_handle_mcp_20260728_flow = __esm({
46783
47059
  const meta = params["_meta"] ?? {};
46784
47060
  const auth = request[ServerRequestTokens.auth];
46785
47061
  const stdio = this.stdioOrigin;
46786
- const clientCapabilities = meta[import_protocol52.MCP_20260728_META.clientCapabilities] ?? {};
46787
- const logLevel = typeof meta[import_protocol52.MCP_20260728_META.logLevel] === "string" ? meta[import_protocol52.MCP_20260728_META.logLevel] : void 0;
47062
+ const clientCapabilities = meta[import_protocol53.MCP_20260728_META.clientCapabilities] ?? {};
47063
+ const logLevel = typeof meta[import_protocol53.MCP_20260728_META.logLevel] === "string" ? meta[import_protocol53.MCP_20260728_META.logLevel] : void 0;
46788
47064
  const rawProgressToken = meta["progressToken"];
46789
47065
  const progressToken = typeof rawProgressToken === "string" || typeof rawProgressToken === "number" ? rawProgressToken : void 0;
46790
47066
  const sink = new RequestNotificationSink(logLevel, progressToken);
46791
- const clientInfo = toClientInfo(meta[import_protocol52.MCP_20260728_META.clientInfo]);
47067
+ const clientInfo = toClientInfo(meta[import_protocol53.MCP_20260728_META.clientInfo]);
46792
47068
  if (clientInfo) {
46793
47069
  const platformType = resolvePlatformType(
46794
47070
  clientInfo,
@@ -46933,11 +47209,11 @@ function resolveLegacySseSession(params) {
46933
47209
  }
46934
47210
  return { session: createSession(), createdNew: true, responded404: false };
46935
47211
  }
46936
- var import_lazy_zod76, plan23, stateSessionSchema, stateSchema21, name23, Stage23, HandleSseFlow;
47212
+ var import_lazy_zod77, plan23, stateSessionSchema, stateSchema21, name23, Stage23, HandleSseFlow;
46937
47213
  var init_handle_sse_flow = __esm({
46938
47214
  "libs/sdk/src/transport/flows/handle.sse.flow.ts"() {
46939
47215
  "use strict";
46940
- import_lazy_zod76 = require("@frontmcp/lazy-zod");
47216
+ import_lazy_zod77 = require("@frontmcp/lazy-zod");
46941
47217
  init_session_id_utils();
46942
47218
  init_common();
46943
47219
  init_errors();
@@ -46949,22 +47225,22 @@ var init_handle_sse_flow = __esm({
46949
47225
  post: [],
46950
47226
  finalize: ["cleanup"]
46951
47227
  };
46952
- stateSessionSchema = import_lazy_zod76.z.object({
46953
- id: import_lazy_zod76.z.string(),
46954
- payload: import_lazy_zod76.z.object({
46955
- nodeId: import_lazy_zod76.z.string(),
46956
- authSig: import_lazy_zod76.z.string(),
46957
- uuid: import_lazy_zod76.z.string().uuid(),
46958
- iat: import_lazy_zod76.z.number(),
46959
- protocol: import_lazy_zod76.z.enum(["legacy-sse", "sse", "streamable-http", "stateful-http", "stateless-http"]).optional(),
46960
- isPublic: import_lazy_zod76.z.boolean().optional(),
46961
- platformType: import_lazy_zod76.z.enum(["openai", "claude", "gemini", "cursor", "continue", "cody", "generic-mcp", "ext-apps", "unknown"]).optional()
47228
+ stateSessionSchema = import_lazy_zod77.z.object({
47229
+ id: import_lazy_zod77.z.string(),
47230
+ payload: import_lazy_zod77.z.object({
47231
+ nodeId: import_lazy_zod77.z.string(),
47232
+ authSig: import_lazy_zod77.z.string(),
47233
+ uuid: import_lazy_zod77.z.string().uuid(),
47234
+ iat: import_lazy_zod77.z.number(),
47235
+ protocol: import_lazy_zod77.z.enum(["legacy-sse", "sse", "streamable-http", "stateful-http", "stateless-http"]).optional(),
47236
+ isPublic: import_lazy_zod77.z.boolean().optional(),
47237
+ platformType: import_lazy_zod77.z.enum(["openai", "claude", "gemini", "cursor", "continue", "cody", "generic-mcp", "ext-apps", "unknown"]).optional()
46962
47238
  }).optional()
46963
47239
  });
46964
- stateSchema21 = import_lazy_zod76.z.object({
46965
- token: import_lazy_zod76.z.string(),
47240
+ stateSchema21 = import_lazy_zod77.z.object({
47241
+ token: import_lazy_zod77.z.string(),
46966
47242
  session: stateSessionSchema,
46967
- requestType: import_lazy_zod76.z.enum(["initialize", "message", "elicitResult"]).optional()
47243
+ requestType: import_lazy_zod77.z.enum(["initialize", "message", "elicitResult"]).optional()
46968
47244
  });
46969
47245
  name23 = "handle:legacy-sse";
46970
47246
  ({ Stage: Stage23 } = FlowHooksOf(name23));
@@ -47094,12 +47370,12 @@ var init_handle_sse_flow = __esm({
47094
47370
  });
47095
47371
 
47096
47372
  // libs/sdk/src/transport/flows/handle.stateless-http.flow.ts
47097
- var import_lazy_zod77, import_protocol53, plan24, stateSchema22, name24, Stage24, HandleStatelessHttpFlow;
47373
+ var import_lazy_zod78, import_protocol54, plan24, stateSchema22, name24, Stage24, HandleStatelessHttpFlow;
47098
47374
  var init_handle_stateless_http_flow = __esm({
47099
47375
  "libs/sdk/src/transport/flows/handle.stateless-http.flow.ts"() {
47100
47376
  "use strict";
47101
- import_lazy_zod77 = require("@frontmcp/lazy-zod");
47102
- import_protocol53 = require("@frontmcp/protocol");
47377
+ import_lazy_zod78 = require("@frontmcp/lazy-zod");
47378
+ import_protocol54 = require("@frontmcp/protocol");
47103
47379
  init_common();
47104
47380
  init_errors();
47105
47381
  init_ha_headers();
@@ -47110,10 +47386,10 @@ var init_handle_stateless_http_flow = __esm({
47110
47386
  post: [],
47111
47387
  finalize: ["cleanup"]
47112
47388
  };
47113
- stateSchema22 = import_lazy_zod77.z.object({
47114
- token: import_lazy_zod77.z.string().optional(),
47115
- isAuthenticated: import_lazy_zod77.z.boolean(),
47116
- requestType: import_lazy_zod77.z.enum(["initialize", "message"]).optional()
47389
+ stateSchema22 = import_lazy_zod78.z.object({
47390
+ token: import_lazy_zod78.z.string().optional(),
47391
+ isAuthenticated: import_lazy_zod78.z.boolean(),
47392
+ requestType: import_lazy_zod78.z.enum(["initialize", "message"]).optional()
47117
47393
  });
47118
47394
  name24 = "handle:stateless-http";
47119
47395
  ({ Stage: Stage24 } = FlowHooksOf(name24));
@@ -47144,7 +47420,7 @@ var init_handle_stateless_http_flow = __esm({
47144
47420
  if (method === "initialize") {
47145
47421
  this.state.set("requestType", "initialize");
47146
47422
  logger.verbose("router: requestType=initialize, method=POST");
47147
- } else if (method && import_protocol53.RequestSchema.safeParse(request.body).success) {
47423
+ } else if (method && import_protocol54.RequestSchema.safeParse(request.body).success) {
47148
47424
  this.state.set("requestType", "message");
47149
47425
  logger.verbose(`router: requestType=message, method=${method}`);
47150
47426
  } else {
@@ -47674,10 +47950,10 @@ function classifyStreamableHttpRequest(params) {
47674
47950
  if (typeof jsonRpcMethod === "string" && (jsonRpcMethod.startsWith("ui/") || jsonRpcMethod === "notifications/message")) {
47675
47951
  return { requestType: "extApps" };
47676
47952
  }
47677
- if (import_protocol54.ElicitResultSchema.safeParse(body?.result).success) {
47953
+ if (import_protocol55.ElicitResultSchema.safeParse(body?.result).success) {
47678
47954
  return { requestType: "elicitResult" };
47679
47955
  }
47680
- if (jsonRpcMethod && import_protocol54.RequestSchema.safeParse(body).success) {
47956
+ if (jsonRpcMethod && import_protocol55.RequestSchema.safeParse(body).success) {
47681
47957
  return { requestType: "message" };
47682
47958
  }
47683
47959
  return { error: "Invalid Request" };
@@ -47731,12 +48007,12 @@ async function lookupStreamableHttpTransport(params) {
47731
48007
  }
47732
48008
  return { kind: "session-not-initialized", recreationError };
47733
48009
  }
47734
- var import_lazy_zod78, import_protocol54, plan25, stateSessionSchema2, stateSchema23, name25, Stage25, HandleStreamableHttpFlow;
48010
+ var import_lazy_zod79, import_protocol55, plan25, stateSessionSchema2, stateSchema23, name25, Stage25, HandleStreamableHttpFlow;
47735
48011
  var init_handle_streamable_http_flow = __esm({
47736
48012
  "libs/sdk/src/transport/flows/handle.streamable-http.flow.ts"() {
47737
48013
  "use strict";
47738
- import_lazy_zod78 = require("@frontmcp/lazy-zod");
47739
- import_protocol54 = require("@frontmcp/protocol");
48014
+ import_lazy_zod79 = require("@frontmcp/lazy-zod");
48015
+ import_protocol55 = require("@frontmcp/protocol");
47740
48016
  init_session_id_utils();
47741
48017
  init_common();
47742
48018
  init_errors();
@@ -47750,22 +48026,22 @@ var init_handle_streamable_http_flow = __esm({
47750
48026
  post: [],
47751
48027
  finalize: ["cleanup"]
47752
48028
  };
47753
- stateSessionSchema2 = import_lazy_zod78.z.object({
47754
- id: import_lazy_zod78.z.string(),
47755
- payload: import_lazy_zod78.z.object({
47756
- nodeId: import_lazy_zod78.z.string(),
47757
- authSig: import_lazy_zod78.z.string(),
47758
- uuid: import_lazy_zod78.z.string().uuid(),
47759
- iat: import_lazy_zod78.z.number(),
47760
- protocol: import_lazy_zod78.z.enum(["legacy-sse", "sse", "streamable-http", "stateful-http", "stateless-http"]).optional(),
47761
- isPublic: import_lazy_zod78.z.boolean().optional(),
47762
- platformType: import_lazy_zod78.z.enum(["openai", "claude", "gemini", "cursor", "continue", "cody", "generic-mcp", "ext-apps", "unknown"]).optional()
48029
+ stateSessionSchema2 = import_lazy_zod79.z.object({
48030
+ id: import_lazy_zod79.z.string(),
48031
+ payload: import_lazy_zod79.z.object({
48032
+ nodeId: import_lazy_zod79.z.string(),
48033
+ authSig: import_lazy_zod79.z.string(),
48034
+ uuid: import_lazy_zod79.z.string().uuid(),
48035
+ iat: import_lazy_zod79.z.number(),
48036
+ protocol: import_lazy_zod79.z.enum(["legacy-sse", "sse", "streamable-http", "stateful-http", "stateless-http"]).optional(),
48037
+ isPublic: import_lazy_zod79.z.boolean().optional(),
48038
+ platformType: import_lazy_zod79.z.enum(["openai", "claude", "gemini", "cursor", "continue", "cody", "generic-mcp", "ext-apps", "unknown"]).optional()
47763
48039
  }).optional()
47764
48040
  });
47765
- stateSchema23 = import_lazy_zod78.z.object({
47766
- token: import_lazy_zod78.z.string(),
48041
+ stateSchema23 = import_lazy_zod79.z.object({
48042
+ token: import_lazy_zod79.z.string(),
47767
48043
  session: stateSessionSchema2,
47768
- requestType: import_lazy_zod78.z.enum(["initialize", "message", "elicitResult", "sseListener", "extApps"]).optional()
48044
+ requestType: import_lazy_zod79.z.enum(["initialize", "message", "elicitResult", "sseListener", "extApps"]).optional()
47769
48045
  });
47770
48046
  name25 = "handle:streamable-http";
47771
48047
  ({ Stage: Stage25 } = FlowHooksOf(name25));
@@ -48161,7 +48437,7 @@ var init_handle_streamable_http_flow = __esm({
48161
48437
  _skipUI: true
48162
48438
  }
48163
48439
  });
48164
- const parsed = import_protocol54.CallToolResultSchema.safeParse(result);
48440
+ const parsed = import_protocol55.CallToolResultSchema.safeParse(result);
48165
48441
  if (parsed.success) {
48166
48442
  return parsed.data;
48167
48443
  }
@@ -48570,264 +48846,6 @@ var init_relay_http = __esm({
48570
48846
  }
48571
48847
  });
48572
48848
 
48573
- // libs/sdk/src/transport/adapters/polyfills/browser-sse-transport.ts
48574
- var SSEServerTransport;
48575
- var init_browser_sse_transport = __esm({
48576
- "libs/sdk/src/transport/adapters/polyfills/browser-sse-transport.ts"() {
48577
- "use strict";
48578
- SSEServerTransport = class {
48579
- constructor(_endpoint, _res, _options) {
48580
- throw new Error("SSEServerTransport is not available in browser environments");
48581
- }
48582
- };
48583
- }
48584
- });
48585
-
48586
- // libs/sdk/src/transport/adapters/sse-transport.ts
48587
- var RecreateableSSEServerTransport;
48588
- var init_sse_transport = __esm({
48589
- "libs/sdk/src/transport/adapters/sse-transport.ts"() {
48590
- "use strict";
48591
- init_browser_sse_transport();
48592
- RecreateableSSEServerTransport = class extends SSEServerTransport {
48593
- _isRecreatedSession = false;
48594
- constructor(endpoint, res, options) {
48595
- super(endpoint, res, options);
48596
- if (options?.initialEventId !== void 0 && this.isValidEventId(options.initialEventId)) {
48597
- this.setEventIdCounter(options.initialEventId);
48598
- this._isRecreatedSession = true;
48599
- }
48600
- }
48601
- /**
48602
- * Validates that an event ID is a valid non-negative integer.
48603
- * Protects against negative values, NaN, Infinity, and non-integer values.
48604
- */
48605
- isValidEventId(eventId) {
48606
- return Number.isInteger(eventId) && eventId >= 0 && eventId <= Number.MAX_SAFE_INTEGER;
48607
- }
48608
- /**
48609
- * Returns whether this is a recreated session.
48610
- */
48611
- get isRecreatedSession() {
48612
- return this._isRecreatedSession;
48613
- }
48614
- /**
48615
- * Returns the current event ID counter value.
48616
- * Alias for lastEventId for consistency with the recreation API.
48617
- */
48618
- get eventIdCounter() {
48619
- return this.lastEventId;
48620
- }
48621
- /**
48622
- * Sets the event ID counter for session recreation.
48623
- * Use this when recreating a session from stored state to maintain
48624
- * event ID continuity for SSE reconnection support.
48625
- *
48626
- * @param eventId - The event ID to restore (must be a non-negative integer)
48627
- */
48628
- setEventIdCounter(eventId) {
48629
- if (!this.isValidEventId(eventId)) {
48630
- console.warn(
48631
- `[RecreateableSSEServerTransport] Invalid eventId: ${eventId}. Must be a non-negative integer. Ignoring.`
48632
- );
48633
- return;
48634
- }
48635
- super.setEventIdCounter(eventId);
48636
- }
48637
- /**
48638
- * Sets the transport to a recreated session state.
48639
- * Use this when recreating a transport from a stored session.
48640
- *
48641
- * @param sessionId - The session ID (for verification, should match constructor)
48642
- * @param lastEventId - The last event ID that was sent to the client
48643
- */
48644
- setSessionState(sessionId, lastEventId) {
48645
- if (this.sessionId !== sessionId) {
48646
- const redact = (id) => `${id.slice(0, 8)}\u2026`;
48647
- console.warn(
48648
- `RecreateableSSEServerTransport: session ID mismatch. Expected ${redact(this.sessionId)}, got ${redact(sessionId)}. Using constructor value.`
48649
- );
48650
- }
48651
- if (lastEventId !== void 0) {
48652
- this.setEventIdCounter(lastEventId);
48653
- }
48654
- this._isRecreatedSession = true;
48655
- }
48656
- };
48657
- }
48658
- });
48659
-
48660
- // libs/sdk/src/transport/adapters/transport.sse.adapter.ts
48661
- var import_lazy_zod79, TransportSSEAdapter;
48662
- var init_transport_sse_adapter = __esm({
48663
- "libs/sdk/src/transport/adapters/transport.sse.adapter.ts"() {
48664
- "use strict";
48665
- import_lazy_zod79 = require("@frontmcp/lazy-zod");
48666
- init_elicitation_types();
48667
- init_errors();
48668
- init_transport_error();
48669
- init_sse_transport();
48670
- init_transport_local_adapter();
48671
- TransportSSEAdapter = class extends LocalTransportAdapter {
48672
- sessionId;
48673
- /**
48674
- * Configures common error and close handlers for SSE transports.
48675
- */
48676
- configureTransportHandlers(transport) {
48677
- transport.onerror = (error) => {
48678
- console.error("SSE error:", error instanceof Error ? error.message : "Unknown error");
48679
- };
48680
- transport.onclose = this.destroy.bind(this);
48681
- }
48682
- createTransport(sessionId, res) {
48683
- this.sessionId = sessionId;
48684
- this.logger.info(`new transport session: ${sessionId.slice(0, 40)}`);
48685
- const transport = new RecreateableSSEServerTransport(`${this.scope.fullPath}/message`, res, {
48686
- sessionId
48687
- });
48688
- this.configureTransportHandlers(transport);
48689
- return transport;
48690
- }
48691
- /**
48692
- * Recreates a transport with preserved session state.
48693
- * Use this when restoring a session from Redis or other storage.
48694
- *
48695
- * @param sessionId - The session ID to restore
48696
- * @param res - The new response stream for SSE
48697
- * @param lastEventId - The last event ID that was sent (for reconnection support)
48698
- */
48699
- createTransportFromSession(sessionId, res, lastEventId) {
48700
- this.sessionId = sessionId;
48701
- this.logger.info(`recreating transport session: ${sessionId.slice(0, 40)}, lastEventId: ${lastEventId ?? "none"}`);
48702
- const transport = new RecreateableSSEServerTransport(`${this.scope.fullPath}/message`, res, {
48703
- sessionId,
48704
- initialEventId: lastEventId
48705
- });
48706
- this.configureTransportHandlers(transport);
48707
- return transport;
48708
- }
48709
- initialize(req, res) {
48710
- this.logger.verbose(`[${this.sessionId}] handle initialize request`);
48711
- this.ensureAuthInfo(req, this);
48712
- return Promise.resolve();
48713
- }
48714
- async handleRequest(req, res) {
48715
- await this.ready;
48716
- const authInfo = this.ensureAuthInfo(req, this);
48717
- if (this.handleIfElicitResult(req)) {
48718
- this.logger.verbose(`[${this.sessionId}] handled elicitation result`);
48719
- res.writeHead(202, { "Content-Type": "application/json" });
48720
- res.end(JSON.stringify({ jsonrpc: "2.0", id: null, result: {} }));
48721
- return;
48722
- }
48723
- if (req.method === "GET") {
48724
- this.logger.verbose(`[${this.sessionId}] handle get request`);
48725
- return this.transport.handleMessage(req.body, {
48726
- requestInfo: {
48727
- headers: req.headers
48728
- },
48729
- authInfo
48730
- });
48731
- } else {
48732
- this.logger.verbose(`[${this.sessionId}] handle post request`);
48733
- return this.transport.handlePostMessage(req, res, req.body);
48734
- }
48735
- }
48736
- /**
48737
- * Send an elicitation request to the client.
48738
- *
48739
- * Only one elicit per session is allowed. A new elicit will cancel any pending one.
48740
- * On timeout, an ElicitationTimeoutError is thrown to kill tool execution.
48741
- *
48742
- * In distributed mode, the pending elicitation is stored in Redis and results
48743
- * are routed via pub/sub, allowing the response to be received by any node.
48744
- */
48745
- async sendElicitRequest(relatedRequestId, message, requestedSchema, options) {
48746
- const { mode = "form", ttl = DEFAULT_ELICIT_TTL, elicitationId, url } = options ?? {};
48747
- if (mode === "url" && !url) {
48748
- throw new InvalidInputError('url is required when mode is "url"');
48749
- }
48750
- await this.cancelPendingElicit();
48751
- const elicitId = elicitationId || `elicit-${this.newRequestId}`;
48752
- const sessionId = this.key.sessionId;
48753
- const expiresAt = Date.now() + ttl;
48754
- const store = this.requireElicitStore();
48755
- await store.setPending({
48756
- elicitId,
48757
- sessionId,
48758
- createdAt: Date.now(),
48759
- expiresAt,
48760
- message,
48761
- mode
48762
- });
48763
- const params = {
48764
- mode,
48765
- message,
48766
- requestedSchema: (0, import_lazy_zod79.toJSONSchema)(requestedSchema)
48767
- };
48768
- if (mode === "url") {
48769
- params["elicitationId"] = elicitId;
48770
- params["url"] = url;
48771
- }
48772
- this.logger.info("sendElicitRequest", { relatedRequestId, elicitId, mode, ttl });
48773
- await this.transport.send(rpcRequest(this.newRequestId, "elicitation/create", params));
48774
- return new Promise((resolve, reject) => {
48775
- let settled = false;
48776
- let unsubscribe;
48777
- const cleanup = () => {
48778
- clearTimeout(timeoutHandle);
48779
- this.pendingElicit = void 0;
48780
- void unsubscribe?.();
48781
- };
48782
- const safeResolve = (result) => {
48783
- if (settled) return;
48784
- settled = true;
48785
- cleanup();
48786
- resolve(result);
48787
- };
48788
- const safeReject = (err) => {
48789
- if (settled) return;
48790
- settled = true;
48791
- cleanup();
48792
- reject(err);
48793
- };
48794
- const timeoutHandle = setTimeout(async () => {
48795
- if (settled) return;
48796
- settled = true;
48797
- this.pendingElicit = void 0;
48798
- await unsubscribe?.();
48799
- await store.deletePending(sessionId);
48800
- reject(new ElicitationTimeoutError(elicitId, ttl));
48801
- }, ttl);
48802
- store.subscribeResult(
48803
- elicitId,
48804
- (result) => {
48805
- safeResolve(result);
48806
- },
48807
- sessionId
48808
- ).then((unsub) => {
48809
- unsubscribe = unsub;
48810
- }).catch(async (err) => {
48811
- if (settled) return;
48812
- settled = true;
48813
- clearTimeout(timeoutHandle);
48814
- this.pendingElicit = void 0;
48815
- await unsubscribe?.();
48816
- await store.deletePending(sessionId);
48817
- reject(err);
48818
- });
48819
- this.pendingElicit = {
48820
- elicitId,
48821
- timeoutHandle,
48822
- resolve: safeResolve,
48823
- reject: safeReject
48824
- };
48825
- });
48826
- }
48827
- };
48828
- }
48829
- });
48830
-
48831
48849
  // libs/sdk/src/transport/transport.local.ts
48832
48850
  var LocalTransporter;
48833
48851
  var init_transport_local = __esm({
@@ -48983,6 +49001,7 @@ var init_transport_registry = __esm({
48983
49001
  init_session_id_utils();
48984
49002
  init_auth_info_utils();
48985
49003
  init_transport_errors();
49004
+ init_transport_sse_adapter();
48986
49005
  init_transport_streamable_http_adapter();
48987
49006
  init_handle_mcp_20260728_flow();
48988
49007
  init_handle_sse_flow();
@@ -49049,10 +49068,12 @@ var init_transport_registry = __esm({
49049
49068
  * Key: JSON-encoded {t: type, h: tokenHash, s: sessionId}, Value: Promise that resolves when creation completes
49050
49069
  */
49051
49070
  creationMutex = /* @__PURE__ */ new Map();
49052
- // The Streamable HTTP transport class loads with the first session that uses it, so stdio and SSE servers never load it.
49071
+ // Each transport class loads with the first session that uses it, so a stdio server loads neither.
49053
49072
  async newLocalTransporter(key, res, onDispose) {
49054
49073
  if (key.type === "streamable-http" || key.type === "stateless-http") {
49055
49074
  await loadStreamableHttpTransport();
49075
+ } else if (key.type === "sse") {
49076
+ await loadSseTransport();
49056
49077
  }
49057
49078
  return new LocalTransporter(this.scope, key, res, onDispose);
49058
49079
  }
@@ -53623,20 +53644,20 @@ var init_execute_task_flag = __esm({
53623
53644
  });
53624
53645
 
53625
53646
  // libs/sdk/src/task/flows/tasks-get.flow.ts
53626
- var import_lazy_zod80, import_protocol55, inputSchema20, outputSchema19, stateSchema24, plan26, name26, Stage26, TasksGetFlow;
53647
+ var import_lazy_zod80, import_protocol56, inputSchema20, outputSchema19, stateSchema24, plan26, name26, Stage26, TasksGetFlow;
53627
53648
  var init_tasks_get_flow = __esm({
53628
53649
  "libs/sdk/src/task/flows/tasks-get.flow.ts"() {
53629
53650
  "use strict";
53630
53651
  import_lazy_zod80 = require("@frontmcp/lazy-zod");
53631
- import_protocol55 = require("@frontmcp/protocol");
53652
+ import_protocol56 = require("@frontmcp/protocol");
53632
53653
  init_common();
53633
53654
  init_errors();
53634
53655
  init_task_types();
53635
53656
  inputSchema20 = import_lazy_zod80.z.object({
53636
- request: import_protocol55.GetTaskRequestSchema,
53657
+ request: import_protocol56.GetTaskRequestSchema,
53637
53658
  ctx: import_lazy_zod80.z.any()
53638
53659
  });
53639
- outputSchema19 = import_protocol55.GetTaskResultSchema;
53660
+ outputSchema19 = import_protocol56.GetTaskResultSchema;
53640
53661
  stateSchema24 = import_lazy_zod80.z.object({
53641
53662
  taskId: import_lazy_zod80.z.string(),
53642
53663
  sessionId: import_lazy_zod80.z.string(),
@@ -53699,20 +53720,20 @@ var init_tasks_get_flow = __esm({
53699
53720
  });
53700
53721
 
53701
53722
  // libs/sdk/src/task/flows/tasks-result.flow.ts
53702
- var import_lazy_zod81, import_protocol56, inputSchema21, outputSchema20, stateSchema25, plan27, name27, Stage27, TasksResultFlow, JsonRpcReplayError;
53723
+ var import_lazy_zod81, import_protocol57, inputSchema21, outputSchema20, stateSchema25, plan27, name27, Stage27, TasksResultFlow, JsonRpcReplayError;
53703
53724
  var init_tasks_result_flow = __esm({
53704
53725
  "libs/sdk/src/task/flows/tasks-result.flow.ts"() {
53705
53726
  "use strict";
53706
53727
  import_lazy_zod81 = require("@frontmcp/lazy-zod");
53707
- import_protocol56 = require("@frontmcp/protocol");
53728
+ import_protocol57 = require("@frontmcp/protocol");
53708
53729
  init_common();
53709
53730
  init_errors();
53710
53731
  init_task_types();
53711
53732
  inputSchema21 = import_lazy_zod81.z.object({
53712
- request: import_protocol56.GetTaskPayloadRequestSchema,
53733
+ request: import_protocol57.GetTaskPayloadRequestSchema,
53713
53734
  ctx: import_lazy_zod81.z.any()
53714
53735
  });
53715
- outputSchema20 = import_protocol56.GetTaskPayloadResultSchema;
53736
+ outputSchema20 = import_protocol57.GetTaskPayloadResultSchema;
53716
53737
  stateSchema25 = import_lazy_zod81.z.object({
53717
53738
  taskId: import_lazy_zod81.z.string(),
53718
53739
  sessionId: import_lazy_zod81.z.string(),
@@ -53875,20 +53896,20 @@ var init_tasks_result_flow = __esm({
53875
53896
  });
53876
53897
 
53877
53898
  // libs/sdk/src/task/flows/tasks-cancel.flow.ts
53878
- var import_lazy_zod82, import_protocol57, inputSchema22, outputSchema21, stateSchema26, plan28, name28, Stage28, TasksCancelFlow;
53899
+ var import_lazy_zod82, import_protocol58, inputSchema22, outputSchema21, stateSchema26, plan28, name28, Stage28, TasksCancelFlow;
53879
53900
  var init_tasks_cancel_flow = __esm({
53880
53901
  "libs/sdk/src/task/flows/tasks-cancel.flow.ts"() {
53881
53902
  "use strict";
53882
53903
  import_lazy_zod82 = require("@frontmcp/lazy-zod");
53883
- import_protocol57 = require("@frontmcp/protocol");
53904
+ import_protocol58 = require("@frontmcp/protocol");
53884
53905
  init_common();
53885
53906
  init_errors();
53886
53907
  init_task_types();
53887
53908
  inputSchema22 = import_lazy_zod82.z.object({
53888
- request: import_protocol57.CancelTaskRequestSchema,
53909
+ request: import_protocol58.CancelTaskRequestSchema,
53889
53910
  ctx: import_lazy_zod82.z.any()
53890
53911
  });
53891
- outputSchema21 = import_protocol57.CancelTaskResultSchema;
53912
+ outputSchema21 = import_protocol58.CancelTaskResultSchema;
53892
53913
  stateSchema26 = import_lazy_zod82.z.object({
53893
53914
  taskId: import_lazy_zod82.z.string(),
53894
53915
  sessionId: import_lazy_zod82.z.string(),
@@ -53985,20 +54006,20 @@ var init_tasks_cancel_flow = __esm({
53985
54006
  });
53986
54007
 
53987
54008
  // libs/sdk/src/task/flows/tasks-list.flow.ts
53988
- var import_lazy_zod83, import_protocol58, inputSchema23, outputSchema22, stateSchema27, plan29, name29, Stage29, TasksListFlow;
54009
+ var import_lazy_zod83, import_protocol59, inputSchema23, outputSchema22, stateSchema27, plan29, name29, Stage29, TasksListFlow;
53989
54010
  var init_tasks_list_flow = __esm({
53990
54011
  "libs/sdk/src/task/flows/tasks-list.flow.ts"() {
53991
54012
  "use strict";
53992
54013
  import_lazy_zod83 = require("@frontmcp/lazy-zod");
53993
- import_protocol58 = require("@frontmcp/protocol");
54014
+ import_protocol59 = require("@frontmcp/protocol");
53994
54015
  init_common();
53995
54016
  init_errors();
53996
54017
  init_task_types();
53997
54018
  inputSchema23 = import_lazy_zod83.z.object({
53998
- request: import_protocol58.ListTasksRequestSchema,
54019
+ request: import_protocol59.ListTasksRequestSchema,
53999
54020
  ctx: import_lazy_zod83.z.any()
54000
54021
  });
54001
- outputSchema22 = import_protocol58.ListTasksResultSchema;
54022
+ outputSchema22 = import_protocol59.ListTasksResultSchema;
54002
54023
  stateSchema27 = import_lazy_zod83.z.object({
54003
54024
  sessionId: import_lazy_zod83.z.string(),
54004
54025
  cursor: import_lazy_zod83.z.string().optional(),
@@ -54133,9 +54154,9 @@ function bundledOptionalModules() {
54133
54154
  function registerOptionalModule(moduleName, moduleExports) {
54134
54155
  bundledOptionalModules().set(moduleName, moduleExports);
54135
54156
  }
54136
- function requireOptionalModule(moduleName, load3) {
54157
+ function requireOptionalModule(moduleName, load2) {
54137
54158
  const registry = bundledOptionalModules();
54138
- return registry.has(moduleName) ? registry.get(moduleName) : load3();
54159
+ return registry.has(moduleName) ? registry.get(moduleName) : load2();
54139
54160
  }
54140
54161
  var BUNDLED_OPTIONAL_MODULES;
54141
54162
  var init_optional_dependency_util = __esm({
@@ -60805,6 +60826,15 @@ var init_auth_ui_registry = __esm({
60805
60826
  }
60806
60827
  });
60807
60828
 
60829
+ // libs/sdk/src/third-party/uipack-render.ts
60830
+ var import_uipack;
60831
+ var init_uipack_render = __esm({
60832
+ "libs/sdk/src/third-party/uipack-render.ts"() {
60833
+ "use strict";
60834
+ import_uipack = require("@frontmcp/uipack");
60835
+ }
60836
+ });
60837
+
60808
60838
  // libs/sdk/src/auth/auth-ui/auth-ui.render.ts
60809
60839
  function authUiExtraPath(fullPath) {
60810
60840
  return `${fullPath.replace(/\/+$/, "")}/oauth/ui/extra`;
@@ -60915,11 +60945,11 @@ function defaultTitle(slot) {
60915
60945
  return "Authorization";
60916
60946
  }
60917
60947
  }
60918
- var import_uipack, UNSAFE_FORM_TARGET_SCHEMES, AUTH_UI_CSP;
60948
+ var UNSAFE_FORM_TARGET_SCHEMES, AUTH_UI_CSP;
60919
60949
  var init_auth_ui_render = __esm({
60920
60950
  "libs/sdk/src/auth/auth-ui/auth-ui.render.ts"() {
60921
60951
  "use strict";
60922
- import_uipack = require("@frontmcp/uipack");
60952
+ init_uipack_render();
60923
60953
  init_auth_ui_contract();
60924
60954
  UNSAFE_FORM_TARGET_SCHEMES = /* @__PURE__ */ new Set(["javascript:", "data:", "blob:", "filesystem:", "about:", "file:"]);
60925
60955
  AUTH_UI_CSP = authUiCsp();
@@ -71918,11 +71948,11 @@ function isAsyncIterable(stream) {
71918
71948
  function internalError(id) {
71919
71949
  return { jsonrpc: "2.0", id, error: { code: -32603, message: "Internal error" } };
71920
71950
  }
71921
- var import_protocol59, EVENT_SEPARATOR, EVENT_DATA_FIELD, StdioRevisionRouter;
71951
+ var import_protocol60, EVENT_SEPARATOR, EVENT_DATA_FIELD, StdioRevisionRouter;
71922
71952
  var init_stdio_revision_router = __esm({
71923
71953
  "libs/sdk/src/transport/stdio-revision-router.ts"() {
71924
71954
  "use strict";
71925
- import_protocol59 = require("@frontmcp/protocol");
71955
+ import_protocol60 = require("@frontmcp/protocol");
71926
71956
  init_common();
71927
71957
  init_flow_error_output();
71928
71958
  init_mcp_20260728();
@@ -71951,7 +71981,7 @@ var init_stdio_revision_router = __esm({
71951
71981
  await this.inner.start();
71952
71982
  }
71953
71983
  async send(message, options) {
71954
- if (this.era === "modern" && (0, import_protocol59.isJSONRPCNotification)(message)) return;
71984
+ if (this.era === "modern" && (0, import_protocol60.isJSONRPCNotification)(message)) return;
71955
71985
  await this.inner.send(message, options);
71956
71986
  }
71957
71987
  async close() {
@@ -71960,12 +71990,12 @@ var init_stdio_revision_router = __esm({
71960
71990
  }
71961
71991
  route(message, extra) {
71962
71992
  if (this.cancelsModernRequest(message)) return;
71963
- if (((0, import_protocol59.isJSONRPCRequest)(message) || (0, import_protocol59.isJSONRPCNotification)(message)) && this.servesModern(message)) {
71993
+ if (((0, import_protocol60.isJSONRPCRequest)(message) || (0, import_protocol60.isJSONRPCNotification)(message)) && this.servesModern(message)) {
71964
71994
  if (this.era === "unknown") this.era = "modern";
71965
71995
  void this.serveModern(message);
71966
71996
  return;
71967
71997
  }
71968
- if ((0, import_protocol59.isJSONRPCRequest)(message) && message.method === "initialize") this.era = "legacy";
71998
+ if ((0, import_protocol60.isJSONRPCRequest)(message) && message.method === "initialize") this.era = "legacy";
71969
71999
  this.onmessage?.(message, extra);
71970
72000
  }
71971
72001
  servesModern(message) {
@@ -71977,7 +72007,7 @@ var init_stdio_revision_router = __esm({
71977
72007
  });
71978
72008
  }
71979
72009
  cancelsModernRequest(message) {
71980
- if (!(0, import_protocol59.isJSONRPCNotification)(message) || message.method !== "notifications/cancelled") return false;
72010
+ if (!(0, import_protocol60.isJSONRPCNotification)(message) || message.method !== "notifications/cancelled") return false;
71981
72011
  const requestId = message.params?.["requestId"];
71982
72012
  if (typeof requestId !== "string" && typeof requestId !== "number") return false;
71983
72013
  const controller = this.inFlight.get(requestId);
@@ -71987,7 +72017,7 @@ var init_stdio_revision_router = __esm({
71987
72017
  return true;
71988
72018
  }
71989
72019
  async serveModern(message) {
71990
- const id = (0, import_protocol59.isJSONRPCRequest)(message) ? message.id : void 0;
72020
+ const id = (0, import_protocol60.isJSONRPCRequest)(message) ? message.id : void 0;
71991
72021
  const controller = new AbortController();
71992
72022
  if (id !== void 0) this.inFlight.set(id, controller);
71993
72023
  try {
@@ -72029,7 +72059,7 @@ var init_stdio_revision_router = __esm({
72029
72059
  }
72030
72060
  if (signal.aborted) return;
72031
72061
  const body = output?.kind === "json" ? output.body : void 0;
72032
- const isReply = (0, import_protocol59.isJSONRPCResultResponse)(body) || (0, import_protocol59.isJSONRPCErrorResponse)(body);
72062
+ const isReply = (0, import_protocol60.isJSONRPCResultResponse)(body) || (0, import_protocol60.isJSONRPCErrorResponse)(body);
72033
72063
  await this.inner.send(isReply ? body : internalError(id));
72034
72064
  }
72035
72065
  cancelAll() {
@@ -72055,11 +72085,11 @@ function resolveConfigInput(optionsOrClass) {
72055
72085
  }
72056
72086
  return optionsOrClass;
72057
72087
  }
72058
- var import_protocol60, import_utils136, stdioServing, FrontMcpInstance;
72088
+ var import_protocol61, import_utils136, stdioServing, FrontMcpInstance;
72059
72089
  var init_front_mcp = __esm({
72060
72090
  "libs/sdk/src/front-mcp/front-mcp.ts"() {
72061
72091
  "use strict";
72062
- import_protocol60 = require("@frontmcp/protocol");
72092
+ import_protocol61 = require("@frontmcp/protocol");
72063
72093
  import_utils136 = require("@frontmcp/utils");
72064
72094
  init_common();
72065
72095
  init_direct();
@@ -72669,7 +72699,7 @@ var init_front_mcp = __esm({
72669
72699
  },
72670
72700
  serverInfo: scope.metadata.info
72671
72701
  };
72672
- const mcpServer = new import_protocol60.McpServer(scope.metadata.info, serverOptions);
72702
+ const mcpServer = new import_protocol61.McpServer(scope.metadata.info, serverOptions);
72673
72703
  startupCleanups.push(() => mcpServer.close());
72674
72704
  const sessionId = `stdio:${(0, import_utils136.randomUUID)()}`;
72675
72705
  const handlers = createMcpHandlers2({ scope, serverOptions, composeInstructions });
@@ -72687,7 +72717,7 @@ var init_front_mcp = __esm({
72687
72717
  }
72688
72718
  const { IpcServerTransport: IpcServerTransport2, isIpcStdioRequested: isIpcStdioRequested2 } = await Promise.resolve().then(() => (init_ipc_server_transport(), ipc_server_transport_exports));
72689
72719
  const { StdioRevisionRouter: StdioRevisionRouter2 } = await Promise.resolve().then(() => (init_stdio_revision_router(), stdio_revision_router_exports));
72690
- const stdioTransport = isIpcStdioRequested2() ? new IpcServerTransport2() : new import_protocol60.StdioServerTransport();
72720
+ const stdioTransport = isIpcStdioRequested2() ? new IpcServerTransport2() : new import_protocol61.StdioServerTransport();
72691
72721
  const transport = new StdioRevisionRouter2(stdioTransport, { scope, principal: sessionId });
72692
72722
  startupCleanups.push(() => transport.close());
72693
72723
  await mcpServer.connect(transport);
@@ -74926,7 +74956,7 @@ __export(index_exports, {
74926
74956
  OrchestratorJwksNotAvailableError: () => import_auth15.OrchestratorJwksNotAvailableError,
74927
74957
  PLATFORM_CLIENT_INFO: () => PLATFORM_CLIENT_INFO,
74928
74958
  PRIMITIVE_FILTER_KEYS: () => PRIMITIVE_FILTER_KEYS,
74929
- PROTOCOL_2026_07_28: () => import_protocol61.PROTOCOL_2026_07_28,
74959
+ PROTOCOL_2026_07_28: () => import_protocol62.PROTOCOL_2026_07_28,
74930
74960
  PROTOCOL_PRESETS: () => PROTOCOL_PRESETS,
74931
74961
  PayloadTooLargeError: () => PayloadTooLargeError,
74932
74962
  Plugin: () => FrontMcpPlugin,
@@ -76296,7 +76326,7 @@ init_mcp_20260728();
76296
76326
  init_mcp_20260728();
76297
76327
  init_mcp_20260728();
76298
76328
  init_mcp_stateless_client_adapter();
76299
- var import_protocol61 = require("@frontmcp/protocol");
76329
+ var import_protocol62 = require("@frontmcp/protocol");
76300
76330
  init_web_standard_mcp();
76301
76331
  init_transport_types();
76302
76332
  init_ext_apps2();