@frontmcp/sdk 1.11.1-rc.1 → 1.11.1-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/app/instances/app.esm.instance.d.ts.map +1 -1
  2. package/app/instances/empty-app-registries.d.ts +1 -0
  3. package/app/instances/empty-app-registries.d.ts.map +1 -1
  4. package/auth/flows/oauth.callback.flow.d.ts +5 -0
  5. package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
  6. package/auth/flows/oauth.connect.flow.d.ts +4 -2
  7. package/auth/flows/oauth.connect.flow.d.ts.map +1 -1
  8. package/auth/vault/auth-providers.providers.d.ts +7 -16
  9. package/auth/vault/auth-providers.providers.d.ts.map +1 -1
  10. package/auth/vault/index.d.ts +1 -2
  11. package/auth/vault/index.d.ts.map +1 -1
  12. package/auth/vault/unconfigured-auth-providers.d.ts +4 -0
  13. package/auth/vault/unconfigured-auth-providers.d.ts.map +1 -0
  14. package/browser/app/instances/app.esm.instance.mjs +2 -0
  15. package/browser/app/instances/empty-app-registries.mjs +2 -0
  16. package/browser/auth/flows/oauth.callback.flow.mjs +26 -1
  17. package/browser/auth/flows/oauth.connect.flow.mjs +31 -24
  18. package/browser/auth/vault/auth-providers.providers.mjs +96 -0
  19. package/browser/auth/vault/credential-cache.mjs +5 -0
  20. package/browser/auth/vault/unconfigured-auth-providers.mjs +21 -0
  21. package/browser/common/entries/scope.entry.mjs +23 -4
  22. package/browser/common/interfaces/execution-context.interface.mjs +5 -0
  23. package/browser/common/interfaces/server.interface.mjs +2 -0
  24. package/browser/common/metadata/front-mcp.metadata.mjs +3 -0
  25. package/browser/common/tokens/front-mcp.tokens.mjs +1 -0
  26. package/browser/direct/direct-client.mjs +2 -1
  27. package/browser/direct/token-auth-info.mjs +2 -0
  28. package/browser/elicitation/helpers/elicit.helper.mjs +10 -7
  29. package/browser/errors/index.mjs +1 -1
  30. package/browser/errors/misconfiguration.mjs +3 -1
  31. package/browser/errors/plugin.errors.mjs +20 -0
  32. package/browser/errors/tool-credentials-required.error.mjs +18 -5
  33. package/browser/front-mcp/front-mcp.mjs +1 -3
  34. package/browser/health/health.service.mjs +14 -10
  35. package/browser/index.cjs +2846 -2335
  36. package/browser/index.mjs +9 -3
  37. package/browser/notification/notification.service.mjs +5 -5
  38. package/browser/plugin/plugin.registry.mjs +39 -2
  39. package/browser/provider/provider.registry.mjs +2 -0
  40. package/browser/scope/dev-events-observability.mjs +9 -5
  41. package/browser/scope/scope.instance.mjs +9 -2
  42. package/browser/skill/errors/skill-bundle-not-loaded.error.mjs +21 -0
  43. package/browser/skill/flows/load-skill.flow.mjs +13 -9
  44. package/browser/skill/flows/search-skills.flow.mjs +10 -2
  45. package/browser/skill/index.mjs +2 -0
  46. package/browser/skill/sep-2640/resources/skill-index.resource.mjs +2 -0
  47. package/browser/skill/sep-2640/sep-2640.resource-helpers.mjs +5 -2
  48. package/browser/skill/skill-catalog-source.mjs +33 -1
  49. package/browser/skill/skill-instructions.helper.mjs +14 -14
  50. package/browser/skill/skill.registry.mjs +6 -0
  51. package/browser/surface/index.mjs +6 -0
  52. package/browser/surface/list-change-batch.mjs +51 -0
  53. package/browser/surface/live-surface.mjs +2 -2
  54. package/browser/tool/flows/call-tool.flow.mjs +18 -4
  55. package/browser/tool/flows/tool-credentials.gate.mjs +60 -10
  56. package/browser/tool/tool.registry.mjs +9 -2
  57. package/browser/transport/mcp-20260728/mrtr.mjs +13 -6
  58. package/browser/transport/mcp-20260728/subscriptions.mjs +6 -6
  59. package/browser/transport/mcp-handlers/skills-list-request.handler.mjs +19 -7
  60. package/browser/transport/mcp-handlers/skills-mcp.types.mjs +6 -4
  61. package/browser/transport/web-fetch-handler.mjs +6 -8
  62. package/common/entries/scope.entry.d.ts +15 -3
  63. package/common/entries/scope.entry.d.ts.map +1 -1
  64. package/common/interfaces/execution-context.interface.d.ts +3 -1
  65. package/common/interfaces/execution-context.interface.d.ts.map +1 -1
  66. package/common/interfaces/server.interface.d.ts +2 -0
  67. package/common/interfaces/server.interface.d.ts.map +1 -1
  68. package/common/metadata/app.metadata.d.ts +1 -1
  69. package/common/metadata/front-mcp.metadata.d.ts +304 -92
  70. package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
  71. package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
  72. package/common/types/options/elicitation/schema.d.ts +1 -1
  73. package/common/types/options/redis/schema.d.ts +3 -3
  74. package/common/types/options/redis/schema.d.ts.map +1 -1
  75. package/common/types/options/skills-http/schema.d.ts +2 -2
  76. package/common/types/options/transport/schema.d.ts +4 -4
  77. package/context/frontmcp-context.d.ts +1 -1
  78. package/context/frontmcp-context.d.ts.map +1 -1
  79. package/direct/client.types.d.ts +48 -28
  80. package/direct/client.types.d.ts.map +1 -1
  81. package/direct/index.d.ts +1 -1
  82. package/direct/index.d.ts.map +1 -1
  83. package/direct/token-auth-info.d.ts +5 -1
  84. package/direct/token-auth-info.d.ts.map +1 -1
  85. package/elicitation/helpers/elicit.helper.d.ts +5 -0
  86. package/elicitation/helpers/elicit.helper.d.ts.map +1 -1
  87. package/errors/error-handler.d.ts +1 -0
  88. package/errors/error-handler.d.ts.map +1 -1
  89. package/errors/mcp.error.d.ts +2 -0
  90. package/errors/mcp.error.d.ts.map +1 -1
  91. package/errors/misconfiguration.d.ts.map +1 -1
  92. package/errors/plugin.errors.d.ts +8 -0
  93. package/errors/plugin.errors.d.ts.map +1 -1
  94. package/errors/tool-credentials-required.error.d.ts +10 -2
  95. package/errors/tool-credentials-required.error.d.ts.map +1 -1
  96. package/esm/index.mjs +31 -31
  97. package/front-mcp/front-mcp.d.ts.map +1 -1
  98. package/health/health.service.d.ts +8 -4
  99. package/health/health.service.d.ts.map +1 -1
  100. package/index.d.ts +2 -2
  101. package/index.d.ts.map +1 -1
  102. package/index.js +38 -38
  103. package/package.json +10 -10
  104. package/plugin/plugin.registry.d.ts +3 -1
  105. package/plugin/plugin.registry.d.ts.map +1 -1
  106. package/provider/provider.registry.d.ts.map +1 -1
  107. package/scope/dev-events-observability.d.ts +2 -0
  108. package/scope/dev-events-observability.d.ts.map +1 -1
  109. package/scope/scope.instance.d.ts.map +1 -1
  110. package/server/adapters/utf8-json.parser.d.ts +2 -0
  111. package/server/adapters/utf8-json.parser.d.ts.map +1 -1
  112. package/skill/errors/index.d.ts +1 -0
  113. package/skill/errors/index.d.ts.map +1 -1
  114. package/skill/errors/skill-bundle-not-loaded.error.d.ts +16 -0
  115. package/skill/errors/skill-bundle-not-loaded.error.d.ts.map +1 -0
  116. package/skill/flows/load-skill.flow.d.ts +2 -2
  117. package/skill/flows/load-skill.flow.d.ts.map +1 -1
  118. package/skill/flows/search-skills.flow.d.ts +5 -1
  119. package/skill/flows/search-skills.flow.d.ts.map +1 -1
  120. package/skill/index.d.ts +1 -0
  121. package/skill/index.d.ts.map +1 -1
  122. package/skill/sep-2640/resources/skill-index.resource.d.ts.map +1 -1
  123. package/skill/sep-2640/sep-2640.resource-helpers.d.ts +2 -1
  124. package/skill/sep-2640/sep-2640.resource-helpers.d.ts.map +1 -1
  125. package/skill/skill-catalog-source.d.ts +24 -2
  126. package/skill/skill-catalog-source.d.ts.map +1 -1
  127. package/skill/skill-instructions.helper.d.ts +5 -0
  128. package/skill/skill-instructions.helper.d.ts.map +1 -1
  129. package/skill/skill.registry.d.ts +9 -0
  130. package/skill/skill.registry.d.ts.map +1 -1
  131. package/surface/index.d.ts +1 -0
  132. package/surface/index.d.ts.map +1 -1
  133. package/surface/list-change-batch.d.ts +28 -0
  134. package/surface/list-change-batch.d.ts.map +1 -0
  135. package/tool/flows/call-tool.flow.d.ts +5 -2
  136. package/tool/flows/call-tool.flow.d.ts.map +1 -1
  137. package/tool/flows/tool-credentials.gate.d.ts +26 -0
  138. package/tool/flows/tool-credentials.gate.d.ts.map +1 -1
  139. package/tool/tool.registry.d.ts +2 -0
  140. package/tool/tool.registry.d.ts.map +1 -1
  141. package/transport/mcp-20260728/mrtr.d.ts +6 -2
  142. package/transport/mcp-20260728/mrtr.d.ts.map +1 -1
  143. package/transport/mcp-20260728/subscriptions.d.ts.map +1 -1
  144. package/transport/mcp-handlers/skills-list-request.handler.d.ts.map +1 -1
  145. package/transport/mcp-handlers/skills-mcp.types.d.ts +3 -1
  146. package/transport/mcp-handlers/skills-mcp.types.d.ts.map +1 -1
  147. package/auth/vault/auth-providers.context-extension.d.ts +0 -68
  148. package/auth/vault/auth-providers.context-extension.d.ts.map +0 -1
@@ -31,7 +31,27 @@ var DuplicatePluginError = class extends PublicMcpError {
31
31
  );
32
32
  }
33
33
  };
34
+ var DuplicatePluginEntryError = class extends PublicMcpError {
35
+ constructor(pluginName, listName, firstEntry, secondEntry) {
36
+ super(
37
+ `Plugin "${pluginName}" is listed twice in ${listName} (entries ${firstEntry} and ${secondEntry}), and only one entry could be installed. List it once, with all its options in that entry, or install the other configuration on an @App of its own.`,
38
+ "DUPLICATE_PLUGIN_ENTRY",
39
+ 500
40
+ );
41
+ }
42
+ };
43
+ var PluginConfiguredTwiceError = class extends PublicMcpError {
44
+ constructor(pluginClassName, serverOption) {
45
+ super(
46
+ `${pluginClassName} is configured twice: by @FrontMcp({ ${serverOption} }) and by an ${pluginClassName} entry in @FrontMcp({ plugins }). Configure it in one place: move the entry's options to ${serverOption} and remove the entry, or remove ${serverOption}.`,
47
+ "PLUGIN_CONFIGURED_TWICE",
48
+ 500
49
+ );
50
+ }
51
+ };
34
52
  export {
53
+ DuplicatePluginEntryError,
35
54
  DuplicatePluginError,
55
+ PluginConfiguredTwiceError,
36
56
  UnenforcedMetadataError
37
57
  };
@@ -9,13 +9,14 @@ var ToolCredentialsRequiredError = class extends PublicMcpError {
9
9
  providers;
10
10
  /** Connect/authorize URL to (re)authorize the provider(s), if resolvable. */
11
11
  authUrl;
12
+ /** Whether the caller has to sign in to this server before it can connect the provider(s). */
13
+ signInRequired;
12
14
  constructor(params) {
13
- const providerList = params.providers.join(", ");
14
- const defaultMessage = `Tool "${params.toolId}" requires credentials for ${providerList} which are not connected for this session. ` + (params.authUrl ? `Connect via: ${params.authUrl}` : `Please authorize the required provider(s) and retry.`);
15
- super(params.message || defaultMessage, "TOOL_CREDENTIALS_REQUIRED", 401);
15
+ super(params.message || defaultMessageOf(params), "TOOL_CREDENTIALS_REQUIRED", 401);
16
16
  this.toolId = params.toolId;
17
17
  this.providers = params.providers;
18
18
  this.authUrl = params.authUrl;
19
+ this.signInRequired = params.signInRequired === true;
19
20
  }
20
21
  /**
21
22
  * Convert to JSON-RPC error format per MCP specification.
@@ -23,7 +24,7 @@ var ToolCredentialsRequiredError = class extends PublicMcpError {
23
24
  * @example
24
25
  * {
25
26
  * "code": -32001,
26
- * "message": "Tool \"deploy_app\" requires credentials for github ...",
27
+ * "message": "Tool \"deploy_app\" requires credentials for github ... Connect github to continue: open the link in this error's data (authUrl).",
27
28
  * "data": {
28
29
  * "tool": "deploy_app",
29
30
  * "providers": ["github"],
@@ -39,11 +40,23 @@ var ToolCredentialsRequiredError = class extends PublicMcpError {
39
40
  data: {
40
41
  tool: this.toolId,
41
42
  providers: this.providers,
42
- ...this.authUrl ? { authUrl: this.authUrl, auth_url: this.authUrl } : {}
43
+ ...this.authUrl ? { authUrl: this.authUrl, auth_url: this.authUrl } : {},
44
+ ...this.signInRequired ? { signInRequired: true } : {}
43
45
  }
44
46
  };
45
47
  }
46
48
  };
49
+ function defaultMessageOf(params) {
50
+ const providerList = params.providers.join(", ");
51
+ if (params.signInRequired) {
52
+ return `Tool "${params.toolId}" requires credentials for ${providerList}, and this caller isn't signed in. Sign in to this server, then connect ${providerList}.`;
53
+ }
54
+ const notConnected = `Tool "${params.toolId}" requires credentials for ${providerList} which are not connected for this session.`;
55
+ if (params.authUrl) {
56
+ return `${notConnected} Connect ${providerList} to continue: open the link in this error's data (authUrl).`;
57
+ }
58
+ return `${notConnected} Please authorize the required provider(s) and retry.`;
59
+ }
47
60
  export {
48
61
  ToolCredentialsRequiredError
49
62
  };
@@ -244,9 +244,7 @@ var FrontMcpInstance = class _FrontMcpInstance {
244
244
  const { HealthService } = await import("../health/index.mjs");
245
245
  const composite = new HealthService(healthConfig, this.config.info);
246
246
  for (const scopeService of scopeServices) {
247
- for (const probe of scopeService.getProbes()) {
248
- composite.registerProbe(probe);
249
- }
247
+ composite.registerProbeSource(() => scopeService.getProbes());
250
248
  }
251
249
  const primaryScope = this.getPrimaryScope();
252
250
  if (primaryScope) {
@@ -3,7 +3,7 @@ import { getRuntimeContext, sha256Hex } from "@frontmcp/utils";
3
3
  import { createRemoteAppProbe, createTransportSessionProbe } from "./health.probes.mjs";
4
4
  var processStartTime = Date.now();
5
5
  var HealthService = class {
6
- probes = [];
6
+ probeSources = [];
7
7
  config;
8
8
  serverInfo;
9
9
  scopeView;
@@ -18,7 +18,13 @@ var HealthService = class {
18
18
  * Register a health probe.
19
19
  */
20
20
  registerProbe(probe) {
21
- this.probes.push(probe);
21
+ this.probeSources.push(() => [probe]);
22
+ }
23
+ /**
24
+ * Register a list of probes that every check reads again, so a probe added to it or removed from it later counts.
25
+ */
26
+ registerProbeSource(source) {
27
+ this.probeSources.push(source);
22
28
  }
23
29
  /**
24
30
  * Auto-discover and register probes from scope infrastructure.
@@ -26,7 +32,7 @@ var HealthService = class {
26
32
  * Walks the scope's stores and registries to create built-in probes:
27
33
  * - Session store (if transport persistence is configured)
28
34
  * - Remote MCP apps (via existing HealthCheckManager)
29
- * - Probes plugins registered on the scope
35
+ * - Probes plugins register on the scope, at any time
30
36
  * - User-defined probes from config
31
37
  */
32
38
  autoDiscoverProbes(scope) {
@@ -55,9 +61,7 @@ var HealthService = class {
55
61
  }
56
62
  });
57
63
  }
58
- for (const probe of scope.healthProbes ?? []) {
59
- this.registerProbe(probe);
60
- }
64
+ this.registerProbeSource(() => scope.healthProbes ?? []);
61
65
  const userProbes = this.config.probes ?? [];
62
66
  for (const probe of userProbes) {
63
67
  if (probe && typeof probe.check === "function" && typeof probe.name === "string") {
@@ -99,7 +103,7 @@ var HealthService = class {
99
103
  const timeoutMs = this.config.readyz?.timeoutMs ?? 5e3;
100
104
  const includeDetails = this.resolveIncludeDetails();
101
105
  const results = await Promise.all(
102
- this.probes.map(async (probe) => {
106
+ this.getProbes().map(async (probe) => {
103
107
  const result = await this.runProbeWithTimeout(probe, timeoutMs);
104
108
  return { name: probe.name, result };
105
109
  })
@@ -124,13 +128,13 @@ var HealthService = class {
124
128
  * Get the number of registered probes.
125
129
  */
126
130
  getProbeCount() {
127
- return this.probes.length;
131
+ return this.getProbes().length;
128
132
  }
129
133
  /**
130
- * Get all registered probes (used for aggregation across scopes).
134
+ * Get the probes the next check runs (used for aggregation across scopes).
131
135
  */
132
136
  getProbes() {
133
- return this.probes;
137
+ return this.probeSources.flatMap((source) => source());
134
138
  }
135
139
  /**
136
140
  * Set the scope view for catalog computation (used for composite services).