@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.
- package/app/instances/app.esm.instance.d.ts.map +1 -1
- package/app/instances/empty-app-registries.d.ts +1 -0
- package/app/instances/empty-app-registries.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts +5 -0
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.connect.flow.d.ts +4 -2
- package/auth/flows/oauth.connect.flow.d.ts.map +1 -1
- package/auth/vault/auth-providers.providers.d.ts +7 -16
- package/auth/vault/auth-providers.providers.d.ts.map +1 -1
- package/auth/vault/index.d.ts +1 -2
- package/auth/vault/index.d.ts.map +1 -1
- package/auth/vault/unconfigured-auth-providers.d.ts +4 -0
- package/auth/vault/unconfigured-auth-providers.d.ts.map +1 -0
- package/browser/app/instances/app.esm.instance.mjs +2 -0
- package/browser/app/instances/empty-app-registries.mjs +2 -0
- package/browser/auth/flows/oauth.callback.flow.mjs +26 -1
- package/browser/auth/flows/oauth.connect.flow.mjs +31 -24
- package/browser/auth/vault/auth-providers.providers.mjs +96 -0
- package/browser/auth/vault/credential-cache.mjs +5 -0
- package/browser/auth/vault/unconfigured-auth-providers.mjs +21 -0
- package/browser/common/entries/scope.entry.mjs +23 -4
- package/browser/common/interfaces/execution-context.interface.mjs +5 -0
- package/browser/common/interfaces/server.interface.mjs +2 -0
- package/browser/common/metadata/front-mcp.metadata.mjs +3 -0
- package/browser/common/tokens/front-mcp.tokens.mjs +1 -0
- package/browser/direct/direct-client.mjs +2 -1
- package/browser/direct/token-auth-info.mjs +2 -0
- package/browser/elicitation/helpers/elicit.helper.mjs +10 -7
- package/browser/errors/index.mjs +1 -1
- package/browser/errors/misconfiguration.mjs +3 -1
- package/browser/errors/plugin.errors.mjs +20 -0
- package/browser/errors/tool-credentials-required.error.mjs +18 -5
- package/browser/front-mcp/front-mcp.mjs +1 -3
- package/browser/health/health.service.mjs +14 -10
- package/browser/index.cjs +2846 -2335
- package/browser/index.mjs +9 -3
- package/browser/notification/notification.service.mjs +5 -5
- package/browser/plugin/plugin.registry.mjs +39 -2
- package/browser/provider/provider.registry.mjs +2 -0
- package/browser/scope/dev-events-observability.mjs +9 -5
- package/browser/scope/scope.instance.mjs +9 -2
- package/browser/skill/errors/skill-bundle-not-loaded.error.mjs +21 -0
- package/browser/skill/flows/load-skill.flow.mjs +13 -9
- package/browser/skill/flows/search-skills.flow.mjs +10 -2
- package/browser/skill/index.mjs +2 -0
- package/browser/skill/sep-2640/resources/skill-index.resource.mjs +2 -0
- package/browser/skill/sep-2640/sep-2640.resource-helpers.mjs +5 -2
- package/browser/skill/skill-catalog-source.mjs +33 -1
- package/browser/skill/skill-instructions.helper.mjs +14 -14
- package/browser/skill/skill.registry.mjs +6 -0
- package/browser/surface/index.mjs +6 -0
- package/browser/surface/list-change-batch.mjs +51 -0
- package/browser/surface/live-surface.mjs +2 -2
- package/browser/tool/flows/call-tool.flow.mjs +18 -4
- package/browser/tool/flows/tool-credentials.gate.mjs +60 -10
- package/browser/tool/tool.registry.mjs +9 -2
- package/browser/transport/mcp-20260728/mrtr.mjs +13 -6
- package/browser/transport/mcp-20260728/subscriptions.mjs +6 -6
- package/browser/transport/mcp-handlers/skills-list-request.handler.mjs +19 -7
- package/browser/transport/mcp-handlers/skills-mcp.types.mjs +6 -4
- package/browser/transport/web-fetch-handler.mjs +6 -8
- package/common/entries/scope.entry.d.ts +15 -3
- package/common/entries/scope.entry.d.ts.map +1 -1
- package/common/interfaces/execution-context.interface.d.ts +3 -1
- package/common/interfaces/execution-context.interface.d.ts.map +1 -1
- package/common/interfaces/server.interface.d.ts +2 -0
- package/common/interfaces/server.interface.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +304 -92
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/types/options/elicitation/schema.d.ts +1 -1
- package/common/types/options/redis/schema.d.ts +3 -3
- package/common/types/options/redis/schema.d.ts.map +1 -1
- package/common/types/options/skills-http/schema.d.ts +2 -2
- package/common/types/options/transport/schema.d.ts +4 -4
- package/context/frontmcp-context.d.ts +1 -1
- package/context/frontmcp-context.d.ts.map +1 -1
- package/direct/client.types.d.ts +48 -28
- package/direct/client.types.d.ts.map +1 -1
- package/direct/index.d.ts +1 -1
- package/direct/index.d.ts.map +1 -1
- package/direct/token-auth-info.d.ts +5 -1
- package/direct/token-auth-info.d.ts.map +1 -1
- package/elicitation/helpers/elicit.helper.d.ts +5 -0
- package/elicitation/helpers/elicit.helper.d.ts.map +1 -1
- package/errors/error-handler.d.ts +1 -0
- package/errors/error-handler.d.ts.map +1 -1
- package/errors/mcp.error.d.ts +2 -0
- package/errors/mcp.error.d.ts.map +1 -1
- package/errors/misconfiguration.d.ts.map +1 -1
- package/errors/plugin.errors.d.ts +8 -0
- package/errors/plugin.errors.d.ts.map +1 -1
- package/errors/tool-credentials-required.error.d.ts +10 -2
- package/errors/tool-credentials-required.error.d.ts.map +1 -1
- package/esm/index.mjs +31 -31
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/health/health.service.d.ts +8 -4
- package/health/health.service.d.ts.map +1 -1
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js +38 -38
- package/package.json +10 -10
- package/plugin/plugin.registry.d.ts +3 -1
- package/plugin/plugin.registry.d.ts.map +1 -1
- package/provider/provider.registry.d.ts.map +1 -1
- package/scope/dev-events-observability.d.ts +2 -0
- package/scope/dev-events-observability.d.ts.map +1 -1
- package/scope/scope.instance.d.ts.map +1 -1
- package/server/adapters/utf8-json.parser.d.ts +2 -0
- package/server/adapters/utf8-json.parser.d.ts.map +1 -1
- package/skill/errors/index.d.ts +1 -0
- package/skill/errors/index.d.ts.map +1 -1
- package/skill/errors/skill-bundle-not-loaded.error.d.ts +16 -0
- package/skill/errors/skill-bundle-not-loaded.error.d.ts.map +1 -0
- package/skill/flows/load-skill.flow.d.ts +2 -2
- package/skill/flows/load-skill.flow.d.ts.map +1 -1
- package/skill/flows/search-skills.flow.d.ts +5 -1
- package/skill/flows/search-skills.flow.d.ts.map +1 -1
- package/skill/index.d.ts +1 -0
- package/skill/index.d.ts.map +1 -1
- package/skill/sep-2640/resources/skill-index.resource.d.ts.map +1 -1
- package/skill/sep-2640/sep-2640.resource-helpers.d.ts +2 -1
- package/skill/sep-2640/sep-2640.resource-helpers.d.ts.map +1 -1
- package/skill/skill-catalog-source.d.ts +24 -2
- package/skill/skill-catalog-source.d.ts.map +1 -1
- package/skill/skill-instructions.helper.d.ts +5 -0
- package/skill/skill-instructions.helper.d.ts.map +1 -1
- package/skill/skill.registry.d.ts +9 -0
- package/skill/skill.registry.d.ts.map +1 -1
- package/surface/index.d.ts +1 -0
- package/surface/index.d.ts.map +1 -1
- package/surface/list-change-batch.d.ts +28 -0
- package/surface/list-change-batch.d.ts.map +1 -0
- package/tool/flows/call-tool.flow.d.ts +5 -2
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tool-credentials.gate.d.ts +26 -0
- package/tool/flows/tool-credentials.gate.d.ts.map +1 -1
- package/tool/tool.registry.d.ts +2 -0
- package/tool/tool.registry.d.ts.map +1 -1
- package/transport/mcp-20260728/mrtr.d.ts +6 -2
- package/transport/mcp-20260728/mrtr.d.ts.map +1 -1
- package/transport/mcp-20260728/subscriptions.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-list-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-mcp.types.d.ts +3 -1
- package/transport/mcp-handlers/skills-mcp.types.d.ts.map +1 -1
- package/auth/vault/auth-providers.context-extension.d.ts +0 -68
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
|
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
|
-
|
|
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.
|
|
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.
|
|
131
|
+
return this.getProbes().length;
|
|
128
132
|
}
|
|
129
133
|
/**
|
|
130
|
-
* Get
|
|
134
|
+
* Get the probes the next check runs (used for aggregation across scopes).
|
|
131
135
|
*/
|
|
132
136
|
getProbes() {
|
|
133
|
-
return this.
|
|
137
|
+
return this.probeSources.flatMap((source) => source());
|
|
134
138
|
}
|
|
135
139
|
/**
|
|
136
140
|
* Set the scope view for catalog computation (used for composite services).
|