@frontmcp/sdk 1.12.0 → 1.12.1
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/agent/agent.instance.d.ts +3 -0
- package/agent/agent.instance.d.ts.map +1 -1
- package/agent/agent.registry.d.ts.map +1 -1
- package/agent/flows/call-agent.flow.d.ts +1 -1
- package/agent/flows/call-agent.flow.d.ts.map +1 -1
- package/answer/answer-budget.d.ts.map +1 -1
- package/answer/client-profile.d.ts.map +1 -1
- package/auth/auth-ui/auth-ui.registry.d.ts.map +1 -1
- package/auth/auth.registry.d.ts.map +1 -1
- package/auth/authorized-apps.utils.d.ts +8 -0
- package/auth/authorized-apps.utils.d.ts.map +1 -1
- package/auth/flows/form-body.utils.d.ts.map +1 -1
- package/auth/flows/oauth.authorize.flow.d.ts +3 -1
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.register.flow.d.ts +5 -0
- package/auth/flows/oauth.register.flow.d.ts.map +1 -1
- package/auth/flows/oauth.token.flow.d.ts +3 -2
- package/auth/flows/oauth.token.flow.d.ts.map +1 -1
- package/auth/session/session-store.factory.d.ts.map +1 -1
- package/browser/agent/agent.instance.mjs +4 -0
- package/browser/agent/agent.registry.mjs +2 -2
- package/browser/agent/flows/call-agent.flow.mjs +10 -6
- package/browser/answer/answer-budget.mjs +35 -7
- package/browser/answer/client-profile.mjs +3 -3
- package/browser/auth/auth-ui/auth-ui.registry.mjs +8 -0
- package/browser/auth/auth.registry.mjs +4 -0
- package/browser/auth/authorized-apps.utils.mjs +5 -0
- package/browser/auth/flows/form-body.utils.mjs +4 -2
- package/browser/auth/flows/oauth.authorize.flow.mjs +38 -6
- package/browser/auth/flows/oauth.callback.flow.mjs +30 -16
- package/browser/auth/flows/oauth.register.flow.mjs +17 -5
- package/browser/auth/flows/oauth.token.flow.mjs +17 -8
- package/browser/auth/session/session-store.factory.mjs +5 -1
- package/browser/builtin/authorities/authorities-not-configured.mjs +5 -0
- package/browser/channel/channel-notification.service.mjs +16 -12
- package/browser/channel/channel.instance.mjs +9 -12
- package/browser/channel/channel.utils.mjs +18 -3
- package/browser/channel/flows/send-channel-notification.flow.mjs +4 -2
- package/browser/common/metadata/app.metadata.mjs +2 -1
- package/browser/common/metadata/event.metadata.mjs +10 -10
- package/browser/common/schemas/http-output.schema.mjs +6 -1
- package/browser/common/types/options/metrics/schema.mjs +2 -1
- package/browser/common/utils/content-disposition.utils.mjs +7 -0
- package/browser/common/utils/forward-headers.utils.mjs +5 -5
- package/browser/common/utils/issuer-subject.utils.mjs +17 -0
- package/browser/completion/flows/complete.flow.mjs +9 -1
- package/browser/context/frontmcp-context.mjs +5 -1
- package/browser/direct/connect.mjs +14 -4
- package/browser/direct/direct-server.mjs +3 -1
- package/browser/duty/duty.lifecycle.mjs +5 -3
- package/browser/duty/lease-store.mjs +6 -2
- package/browser/elicitation/flows/elicitation-request.flow.mjs +3 -2
- package/browser/elicitation/flows/elicitation-result.flow.mjs +5 -4
- package/browser/elicitation/questions/question-scope.helper.mjs +4 -2
- package/browser/elicitation/store/elicitation-store.factory.mjs +17 -9
- package/browser/elicitation/store/encrypted-elicitation.store.mjs +1 -1
- package/browser/elicitation/store/storage-elicitation.store.mjs +83 -63
- package/browser/errors/error-handler.mjs +4 -4
- package/browser/errors/event.errors.mjs +3 -1
- package/browser/errors/misconfiguration.mjs +7 -1
- package/browser/errors/transport.errors.mjs +1 -1
- package/browser/esm-loader/esm-cache.mjs +5 -1
- package/browser/esm-loader/esm-module-loader.mjs +6 -6
- package/browser/esm-loader/version-resolver.mjs +1 -1
- package/browser/event/event-scope.helper.mjs +13 -5
- package/browser/event/flows/event-poll.flow.mjs +1 -1
- package/browser/event/flows/event-publish-http.flow.mjs +5 -2
- package/browser/event/flows/event-stream.flow.mjs +1 -1
- package/browser/ext-apps/ext-apps.handler.mjs +26 -14
- package/browser/flows/flow.registry.mjs +2 -1
- package/browser/front-mcp/authorities-rules.check.mjs +16 -0
- package/browser/front-mcp/front-mcp.mjs +8 -2
- package/browser/index.cjs +2035 -1340
- package/browser/job/execution/job-execution.manager.mjs +5 -5
- package/browser/job/job-permission.guard.mjs +7 -0
- package/browser/job/job-run-access.mjs +12 -2
- package/browser/job/tools/list-jobs.tool.mjs +2 -7
- package/browser/job/tools/remove-job.tool.mjs +6 -0
- package/browser/job/tools/update-job.tool.mjs +3 -0
- package/browser/logger/instances/instance.console-logger.mjs +14 -4
- package/browser/logger/instances/instance.file-logger.mjs +3 -2
- package/browser/logger/session-id-hash.mjs +8 -0
- package/browser/metrics/metrics.service.mjs +2 -1
- package/browser/offload/offload-worker.globals.mjs +3 -3
- package/browser/offload/worker-jobs.mjs +9 -2
- package/browser/offload/worker-resources.mjs +7 -1
- package/browser/plugin/enforced-metadata.check.mjs +24 -7
- package/browser/prompt/flows/get-prompt.flow.mjs +10 -3
- package/browser/prompt/flows/prompts-list.flow.mjs +1 -1
- package/browser/provider/provider.registry.mjs +21 -10
- package/browser/remote-mcp/mcp-client.service.mjs +4 -3
- package/browser/remote-mcp/remote-entries.mjs +15 -1
- package/browser/remote-mcp/remote-oauth.mjs +29 -2
- package/browser/resource/flows/read-resource.flow.mjs +23 -13
- package/browser/resource/flows/resource-templates-list.flow.mjs +1 -1
- package/browser/resource/flows/resources-list.flow.mjs +1 -1
- package/browser/resource/flows/subscribe-resource.flow.mjs +9 -1
- package/browser/resource/resource.instance.mjs +10 -1
- package/browser/scope/flows/http.request.flow.mjs +15 -3
- package/browser/scope/optional-dependency.util.mjs +1 -13
- package/browser/scope/scope.instance.mjs +39 -30
- package/browser/server/security/replaceable-directory.mjs +7 -2
- package/browser/server/security/resolve-allowed-hosts.mjs +3 -3
- package/browser/server/server.validation.mjs +3 -5
- package/browser/skill/cache/skill-http-cache.catalog.mjs +18 -0
- package/browser/skill/flows/http/llm-full-txt.flow.mjs +3 -2
- package/browser/skill/flows/http/llm-txt.flow.mjs +3 -2
- package/browser/skill/flows/load-skill.flow.mjs +10 -3
- package/browser/skill/hooks/skill-tool.hook.mjs +7 -7
- package/browser/skill/sep-2640/sep-2640.resource-helpers.mjs +29 -10
- package/browser/skill/session/skill-session.manager.mjs +32 -35
- package/browser/skill/session/skill-session.types.mjs +2 -0
- package/browser/skill/skill-authorities.helper.mjs +11 -4
- package/browser/skill/skill-directory-loader.mjs +15 -1
- package/browser/skill/skill-filter.helper.mjs +35 -7
- package/browser/skill/skill-md-parser.mjs +17 -2
- package/browser/skill/skill.instance.mjs +7 -0
- package/browser/storage/sqlite-on-edge.mjs +28 -0
- package/browser/task/store/task-store.factory.mjs +8 -3
- package/browser/tool/flows/call-tool.flow.mjs +29 -14
- package/browser/tool/flows/tools-list.flow.mjs +1 -4
- package/browser/transport/adapters/transport.local.adapter.mjs +3 -2
- package/browser/transport/event-stores/event-store.factory.mjs +5 -1
- package/browser/transport/event-stores/redis.event-store.mjs +13 -9
- package/browser/transport/flows/handle.streamable-http.flow.mjs +13 -6
- package/browser/transport/in-memory-server.mjs +5 -3
- package/browser/transport/mcp-20260728/client/mcp-stateless.client.mjs +25 -6
- package/browser/transport/mcp-20260728/dispatcher.mjs +4 -9
- package/browser/transport/mcp-handlers/index.mjs +19 -1
- package/browser/transport/mcp-handlers/skills-list-request.handler.mjs +2 -1
- package/browser/transport/mcp-handlers/skills-mcp.types.mjs +3 -1
- package/browser/transport/web-fetch-handler.mjs +3 -3
- package/browser/transport/web-response.renderer.mjs +5 -4
- package/browser/transport/web-standard-mcp.mjs +2 -2
- package/browser/worker/worker.lifecycle.mjs +7 -4
- package/browser/workflow/tools/list-workflows.tool.mjs +6 -7
- package/browser/workflow/tools/register-workflow.tool.mjs +3 -2
- package/browser/workflow/tools/remove-workflow.tool.mjs +6 -0
- package/browser/workflow/tools/runtime-workflow.limits.mjs +5 -0
- package/browser/workflow/tools/update-workflow.tool.mjs +6 -2
- package/browser/workflow/trigger/workflow-webhook.routes.mjs +15 -6
- package/browser/workflow/trigger/workflow-webhook.signature.mjs +5 -8
- package/builtin/authorities/authorities-not-configured.d.ts +3 -0
- package/builtin/authorities/authorities-not-configured.d.ts.map +1 -0
- package/channel/channel-notification.service.d.ts +8 -3
- package/channel/channel-notification.service.d.ts.map +1 -1
- package/channel/channel.instance.d.ts +10 -8
- package/channel/channel.instance.d.ts.map +1 -1
- package/channel/channel.utils.d.ts +6 -1
- package/channel/channel.utils.d.ts.map +1 -1
- package/channel/flows/send-channel-notification.flow.d.ts +1 -1
- package/channel/flows/send-channel-notification.flow.d.ts.map +1 -1
- package/common/entries/channel.entry.d.ts +1 -1
- package/common/entries/channel.entry.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +11 -3
- package/common/metadata/app.metadata.d.ts.map +1 -1
- package/common/metadata/channel.metadata.d.ts +7 -4
- package/common/metadata/channel.metadata.d.ts.map +1 -1
- package/common/metadata/duty.metadata.d.ts +1 -1
- package/common/metadata/duty.metadata.d.ts.map +1 -1
- package/common/metadata/event.metadata.d.ts +15 -12
- package/common/metadata/event.metadata.d.ts.map +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +59 -59
- package/common/metadata/worker.metadata.d.ts +1 -1
- package/common/metadata/worker.metadata.d.ts.map +1 -1
- package/common/schemas/http-output.schema.d.ts +1 -1
- package/common/schemas/http-output.schema.d.ts.map +1 -1
- package/common/types/options/http/interfaces.d.ts +3 -2
- package/common/types/options/http/interfaces.d.ts.map +1 -1
- package/common/types/options/metrics/interfaces.d.ts +3 -2
- package/common/types/options/metrics/interfaces.d.ts.map +1 -1
- package/common/types/options/metrics/schema.d.ts +1 -1
- package/common/types/options/metrics/schema.d.ts.map +1 -1
- package/common/utils/content-disposition.utils.d.ts +6 -0
- package/common/utils/content-disposition.utils.d.ts.map +1 -0
- package/common/utils/issuer-subject.utils.d.ts +8 -0
- package/common/utils/issuer-subject.utils.d.ts.map +1 -0
- package/completion/flows/complete.flow.d.ts.map +1 -1
- package/context/frontmcp-context.d.ts +5 -1
- package/context/frontmcp-context.d.ts.map +1 -1
- package/direct/connect.d.ts.map +1 -1
- package/direct/direct-server.d.ts.map +1 -1
- package/duty/duty.lifecycle.d.ts +1 -1
- package/duty/duty.lifecycle.d.ts.map +1 -1
- package/duty/lease-store.d.ts +4 -2
- package/duty/lease-store.d.ts.map +1 -1
- package/elicitation/flows/elicitation-request.flow.d.ts.map +1 -1
- package/elicitation/flows/elicitation-result.flow.d.ts.map +1 -1
- package/elicitation/questions/question-scope.helper.d.ts +4 -1
- package/elicitation/questions/question-scope.helper.d.ts.map +1 -1
- package/elicitation/store/elicitation-store.factory.d.ts.map +1 -1
- package/elicitation/store/elicitation.store.d.ts +8 -8
- package/elicitation/store/storage-elicitation.store.d.ts +11 -11
- package/elicitation/store/storage-elicitation.store.d.ts.map +1 -1
- package/errors/duty.errors.d.ts +1 -1
- package/errors/duty.errors.d.ts.map +1 -1
- package/errors/error-handler.d.ts.map +1 -1
- package/errors/event.errors.d.ts +9 -2
- package/errors/event.errors.d.ts.map +1 -1
- package/errors/misconfiguration.d.ts +10 -0
- package/errors/misconfiguration.d.ts.map +1 -1
- package/errors/worker.errors.d.ts +1 -1
- package/esm/index.mjs +62 -58
- package/esm-loader/esm-cache.d.ts.map +1 -1
- package/esm-loader/esm-module-loader.d.ts.map +1 -1
- package/event/event-scope.helper.d.ts.map +1 -1
- package/event/flows/event-publish-http.flow.d.ts +3 -2
- package/event/flows/event-publish-http.flow.d.ts.map +1 -1
- package/ext-apps/ext-apps.handler.d.ts +3 -0
- package/ext-apps/ext-apps.handler.d.ts.map +1 -1
- package/flows/flow.registry.d.ts.map +1 -1
- package/front-mcp/authorities-rules.check.d.ts +2 -1
- package/front-mcp/authorities-rules.check.d.ts.map +1 -1
- package/front-mcp/front-mcp.d.ts +3 -0
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/index.js +68 -64
- package/job/execution/job-execution.manager.d.ts.map +1 -1
- package/job/job-permission.guard.d.ts +2 -0
- package/job/job-permission.guard.d.ts.map +1 -1
- package/job/job-run-access.d.ts +7 -3
- package/job/job-run-access.d.ts.map +1 -1
- package/job/store/job-state.interface.d.ts +2 -0
- package/job/store/job-state.interface.d.ts.map +1 -1
- package/job/tools/list-jobs.tool.d.ts.map +1 -1
- package/job/tools/remove-job.tool.d.ts.map +1 -1
- package/job/tools/update-job.tool.d.ts.map +1 -1
- package/logger/instances/instance.console-logger.d.ts +1 -1
- package/logger/instances/instance.console-logger.d.ts.map +1 -1
- package/logger/instances/instance.file-logger.d.ts +2 -1
- package/logger/instances/instance.file-logger.d.ts.map +1 -1
- package/logger/session-id-hash.d.ts +3 -0
- package/logger/session-id-hash.d.ts.map +1 -0
- package/metrics/metrics.service.d.ts.map +1 -1
- package/offload/offload-worker.globals.d.ts +2 -2
- package/offload/offload-worker.globals.d.ts.map +1 -1
- package/offload/worker-jobs.d.ts.map +1 -1
- package/package.json +10 -10
- package/plugin/enforced-metadata.check.d.ts +3 -3
- package/plugin/enforced-metadata.check.d.ts.map +1 -1
- package/prompt/flows/get-prompt.flow.d.ts +1 -0
- package/prompt/flows/get-prompt.flow.d.ts.map +1 -1
- package/prompt/flows/prompts-list.flow.d.ts +2 -1
- package/prompt/flows/prompts-list.flow.d.ts.map +1 -1
- package/provider/provider.registry.d.ts +2 -0
- package/provider/provider.registry.d.ts.map +1 -1
- package/provider/provider.utils.d.ts +2 -2
- package/provider/provider.utils.d.ts.map +1 -1
- package/remote-mcp/mcp-client.service.d.ts.map +1 -1
- package/remote-mcp/mcp-client.types.d.ts +2 -0
- package/remote-mcp/mcp-client.types.d.ts.map +1 -1
- package/remote-mcp/remote-entries.d.ts.map +1 -1
- package/remote-mcp/remote-oauth.d.ts +4 -2
- package/remote-mcp/remote-oauth.d.ts.map +1 -1
- package/resource/flows/read-resource.flow.d.ts +1 -0
- package/resource/flows/read-resource.flow.d.ts.map +1 -1
- package/resource/flows/resource-templates-list.flow.d.ts.map +1 -1
- package/resource/flows/resources-list.flow.d.ts +2 -1
- package/resource/flows/resources-list.flow.d.ts.map +1 -1
- package/resource/flows/subscribe-resource.flow.d.ts.map +1 -1
- package/resource/resource.instance.d.ts.map +1 -1
- package/scope/flows/http.request.flow.d.ts +2 -0
- package/scope/flows/http.request.flow.d.ts.map +1 -1
- package/scope/optional-dependency.util.d.ts +1 -12
- package/scope/optional-dependency.util.d.ts.map +1 -1
- package/scope/scope.instance.d.ts.map +1 -1
- package/server/security/replaceable-directory.d.ts +4 -1
- package/server/security/replaceable-directory.d.ts.map +1 -1
- package/server/security/resolve-allowed-hosts.d.ts.map +1 -1
- package/server/server.validation.d.ts.map +1 -1
- package/shared/shared-endpoint.d.ts.map +1 -1
- package/skill/cache/skill-http-cache.catalog.d.ts +6 -0
- package/skill/cache/skill-http-cache.catalog.d.ts.map +1 -0
- package/skill/flows/http/llm-full-txt.flow.d.ts.map +1 -1
- package/skill/flows/http/llm-txt.flow.d.ts.map +1 -1
- package/skill/flows/load-skill.flow.d.ts.map +1 -1
- package/skill/hooks/skill-tool.hook.d.ts +2 -0
- package/skill/hooks/skill-tool.hook.d.ts.map +1 -1
- package/skill/sep-2640/sep-2640.resource-helpers.d.ts +5 -4
- package/skill/sep-2640/sep-2640.resource-helpers.d.ts.map +1 -1
- package/skill/session/skill-session.manager.d.ts +2 -0
- package/skill/session/skill-session.manager.d.ts.map +1 -1
- package/skill/session/skill-session.types.d.ts +6 -0
- package/skill/session/skill-session.types.d.ts.map +1 -1
- package/skill/skill-authorities.helper.d.ts +4 -5
- package/skill/skill-authorities.helper.d.ts.map +1 -1
- package/skill/skill-directory-loader.d.ts.map +1 -1
- package/skill/skill-filter.helper.d.ts +15 -15
- package/skill/skill-filter.helper.d.ts.map +1 -1
- package/skill/skill-md-parser.d.ts.map +1 -1
- package/skill/skill.instance.d.ts +5 -0
- package/skill/skill.instance.d.ts.map +1 -1
- package/storage/sqlite-on-edge.d.ts +5 -0
- package/storage/sqlite-on-edge.d.ts.map +1 -0
- package/task/store/task-store.factory.d.ts.map +1 -1
- package/tool/flows/call-tool.flow.d.ts +5 -2
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tools-list.flow.d.ts +2 -1
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
- package/transport/event-stores/event-store.factory.d.ts.map +1 -1
- package/transport/event-stores/redis.event-store.d.ts.map +1 -1
- package/transport/flows/handle.streamable-http.flow.d.ts.map +1 -1
- package/transport/in-memory-server.d.ts.map +1 -1
- package/transport/mcp-20260728/client/mcp-stateless.client.d.ts +8 -2
- package/transport/mcp-20260728/client/mcp-stateless.client.d.ts.map +1 -1
- package/transport/mcp-20260728/dispatcher.d.ts +3 -1
- package/transport/mcp-20260728/dispatcher.d.ts.map +1 -1
- package/transport/mcp-handlers/index.d.ts +32 -24
- package/transport/mcp-handlers/index.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 +2 -0
- package/transport/mcp-handlers/skills-mcp.types.d.ts.map +1 -1
- package/transport/web-fetch-handler.d.ts +10 -8
- package/transport/web-fetch-handler.d.ts.map +1 -1
- package/transport/web-response.renderer.d.ts.map +1 -1
- package/worker/worker.lifecycle.d.ts +2 -2
- package/worker/worker.lifecycle.d.ts.map +1 -1
- package/workflow/tools/list-workflows.tool.d.ts.map +1 -1
- package/workflow/tools/register-workflow.tool.d.ts.map +1 -1
- package/workflow/tools/remove-workflow.tool.d.ts.map +1 -1
- package/workflow/tools/runtime-workflow.limits.d.ts +3 -0
- package/workflow/tools/runtime-workflow.limits.d.ts.map +1 -0
- package/workflow/tools/update-workflow.tool.d.ts.map +1 -1
- package/workflow/trigger/workflow-webhook.signature.d.ts +8 -5
- package/workflow/trigger/workflow-webhook.signature.d.ts.map +1 -1
|
@@ -20,11 +20,16 @@ function findMisconfiguration(error) {
|
|
|
20
20
|
if (typeof code === "string" && Object.prototype.hasOwnProperty.call(MISCONFIGURATION_REMEDIES, code)) {
|
|
21
21
|
return { code, remedy: MISCONFIGURATION_REMEDIES[code] };
|
|
22
22
|
}
|
|
23
|
-
if (current.name === "ZodError") return { code: "CONFIG_INVALID", remedy: CONFIG_INVALID_REMEDY };
|
|
24
23
|
current = current.cause;
|
|
25
24
|
}
|
|
26
25
|
return void 0;
|
|
27
26
|
}
|
|
27
|
+
function findStartupMisconfiguration(error) {
|
|
28
|
+
const coded = findMisconfiguration(error);
|
|
29
|
+
if (coded) return coded;
|
|
30
|
+
if (describeConfigIssues(error) === void 0) return void 0;
|
|
31
|
+
return { code: "CONFIG_INVALID", remedy: CONFIG_INVALID_REMEDY };
|
|
32
|
+
}
|
|
28
33
|
function flattenConfigIssue(issue, parentPath) {
|
|
29
34
|
const path = [...parentPath, ...issue.path ?? []];
|
|
30
35
|
const branches = issue.errors?.filter((branch) => branch.length > 0) ?? [];
|
|
@@ -55,5 +60,6 @@ export {
|
|
|
55
60
|
MISCONFIGURATION_REMEDIES,
|
|
56
61
|
describeConfigIssues,
|
|
57
62
|
findMisconfiguration,
|
|
63
|
+
findStartupMisconfiguration,
|
|
58
64
|
misconfigurationBody
|
|
59
65
|
};
|
|
@@ -45,7 +45,7 @@ var TransportServiceNotAvailableError = class extends InternalMcpError {
|
|
|
45
45
|
};
|
|
46
46
|
var SessionClaimConflictError = class extends InternalMcpError {
|
|
47
47
|
constructor(sessionId) {
|
|
48
|
-
super(`Session ${sessionId} claimed by another pod`, "SESSION_CLAIM_CONFLICT");
|
|
48
|
+
super(`Session ${sessionId.slice(0, 20)} claimed by another pod`, "SESSION_CLAIM_CONFLICT");
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
var SessionOwnerUnreachableError = class extends PublicMcpError {
|
|
@@ -58,7 +58,7 @@ function getDefaultCacheDir() {
|
|
|
58
58
|
return path.join(os.homedir(), ".frontmcp", "esm-cache");
|
|
59
59
|
} catch {
|
|
60
60
|
}
|
|
61
|
-
return
|
|
61
|
+
return "";
|
|
62
62
|
} catch {
|
|
63
63
|
return "";
|
|
64
64
|
}
|
|
@@ -112,6 +112,10 @@ var EsmCacheManager = class {
|
|
|
112
112
|
if (Date.now() - meta.cachedAt >= this.maxAgeMs) {
|
|
113
113
|
return void 0;
|
|
114
114
|
}
|
|
115
|
+
const ownBundles = [path.join(entryDir, "bundle.mjs"), path.join(entryDir, "bundle.cjs")];
|
|
116
|
+
if (!ownBundles.includes(meta.bundlePath)) {
|
|
117
|
+
return void 0;
|
|
118
|
+
}
|
|
115
119
|
if (!await fileExists(meta.bundlePath)) {
|
|
116
120
|
return void 0;
|
|
117
121
|
}
|
|
@@ -9,7 +9,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
// libs/sdk/src/esm-loader/esm-module-loader.ts
|
|
12
|
-
import { sha256Hex } from "@frontmcp/utils";
|
|
12
|
+
import { isNode, sha256Hex } from "@frontmcp/utils";
|
|
13
13
|
import { importComputed } from "./import-computed.mjs";
|
|
14
14
|
import { EsmCacheError, EsmManifestInvalidError, EsmPackageLoadError } from "../errors/esm.errors.mjs";
|
|
15
15
|
import { resolveRegistryToken } from "./esm-auth.types.mjs";
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
importMapPackages
|
|
22
22
|
} from "./package-specifier.mjs";
|
|
23
23
|
import { VersionResolver } from "./version-resolver.mjs";
|
|
24
|
+
var moduleDirectory;
|
|
24
25
|
var EsmModuleLoader = class {
|
|
25
26
|
cache;
|
|
26
27
|
versionResolver;
|
|
@@ -209,7 +210,7 @@ var EsmModuleLoader = class {
|
|
|
209
210
|
* Import ESM content via Blob URL (browser) or temp file (Node.js).
|
|
210
211
|
*/
|
|
211
212
|
async importEsmBundle(bundleContent) {
|
|
212
|
-
if (typeof Blob !== "undefined" && typeof URL?.createObjectURL === "function") {
|
|
213
|
+
if (!isNode() && typeof Blob !== "undefined" && typeof URL?.createObjectURL === "function") {
|
|
213
214
|
const blob = new Blob([bundleContent], { type: "text/javascript" });
|
|
214
215
|
const url = URL.createObjectURL(blob);
|
|
215
216
|
try {
|
|
@@ -218,13 +219,12 @@ var EsmModuleLoader = class {
|
|
|
218
219
|
URL.revokeObjectURL(url);
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
|
-
const {
|
|
222
|
+
const { fileExists, mkdtemp, sha256Hex: sha256Hex2, writeFile } = await import("@frontmcp/utils");
|
|
222
223
|
const nodePath = __require("node:path");
|
|
223
224
|
const nodeOs = __require("node:os");
|
|
224
225
|
const { pathToFileURL } = __require("node:url");
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const tempPath = nodePath.join(dir, `${sha256Hex2(bundleContent)}.mjs`);
|
|
226
|
+
moduleDirectory ??= await mkdtemp(nodePath.join(nodeOs.tmpdir(), "frontmcp-esm-modules-"));
|
|
227
|
+
const tempPath = nodePath.join(moduleDirectory, `${sha256Hex2(bundleContent)}.mjs`);
|
|
228
228
|
if (!await fileExists(tempPath)) {
|
|
229
229
|
await writeFile(tempPath, bundleContent);
|
|
230
230
|
}
|
|
@@ -85,7 +85,7 @@ var VersionResolver = class {
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
if (data["dist-tags"]?.[specifier.range]) {
|
|
88
|
+
if (isDistTag(specifier.range) && data["dist-tags"]?.[specifier.range]) {
|
|
89
89
|
const tagVersion = data["dist-tags"][specifier.range];
|
|
90
90
|
if (isValidVersion(tagVersion)) {
|
|
91
91
|
return {
|
|
@@ -188,6 +188,18 @@ async function enablePollDelivery(scope, eventRegistry, eventsConfig, logger) {
|
|
|
188
188
|
function canHoldStreams() {
|
|
189
189
|
return getRuntimeContext().deployment !== "serverless";
|
|
190
190
|
}
|
|
191
|
+
function describeUnrelayedStreams(scope, eventsConfig) {
|
|
192
|
+
const carried = "Event streams carry what this process publishes.";
|
|
193
|
+
if (!eventsConfig.store?.redis) {
|
|
194
|
+
return `${carried} With several processes, set events.store.redis so an event published on one reaches the streams the others hold.`;
|
|
195
|
+
}
|
|
196
|
+
const reasons = [];
|
|
197
|
+
if (!eventsConfig.webhook.enabled) reasons.push("events.webhook.enabled is false, so remove that setting");
|
|
198
|
+
if (!canIdentifyCallers(scope)) {
|
|
199
|
+
reasons.push("the server runs in public auth mode, so configure an auth mode that signs callers in");
|
|
200
|
+
}
|
|
201
|
+
return `${carried} events.store.redis is set, but it relays events between processes only with webhook delivery, which is off: ${reasons.join("; ")}. Then an event published on one process reaches the streams the others hold.`;
|
|
202
|
+
}
|
|
191
203
|
async function enableStreamDelivery(scope, eventRegistry, buffer, eventsConfig, storage, logger) {
|
|
192
204
|
const streams = new EventStreams({
|
|
193
205
|
buffer,
|
|
@@ -199,11 +211,7 @@ async function enableStreamDelivery(scope, eventRegistry, buffer, eventsConfig,
|
|
|
199
211
|
eventRegistry.streams = streams;
|
|
200
212
|
await streams.start();
|
|
201
213
|
scope.onDispose(() => streams.stop());
|
|
202
|
-
if (!streams.isRelayed)
|
|
203
|
-
logger.info(
|
|
204
|
-
"Event streams carry what this process publishes. With several processes, set events.store.redis so an event published on one reaches the streams the others hold."
|
|
205
|
-
);
|
|
206
|
-
}
|
|
214
|
+
if (!streams.isRelayed) logger.info(describeUnrelayedStreams(scope, eventsConfig));
|
|
207
215
|
eventRegistry.enableDeliveryMode("push");
|
|
208
216
|
await scope.registryFlows(EventStreamFlow);
|
|
209
217
|
}
|
|
@@ -146,7 +146,7 @@ var EventPollFlow = class extends FlowBase {
|
|
|
146
146
|
if (!context.onSubscribe && !context.onUnsubscribe) return;
|
|
147
147
|
if (!leases.has(subscription.id) && leases.isFull(reader.principalKey)) {
|
|
148
148
|
const { maxPerPrincipal } = this.events.config.subscriptions;
|
|
149
|
-
throw new EventResourceExhaustedError(this.codes, "
|
|
149
|
+
throw new EventResourceExhaustedError(this.codes, "pollLeases", maxPerPrincipal);
|
|
150
150
|
}
|
|
151
151
|
await leases.renew({
|
|
152
152
|
subscription,
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
HttpJsonSchema,
|
|
26
26
|
httpRespond
|
|
27
27
|
} from "../../common/index.mjs";
|
|
28
|
+
import { PublicMcpError } from "../../errors/index.mjs";
|
|
28
29
|
import { matchRoutePath } from "../../flows/flow.http-path.mjs";
|
|
29
30
|
import { verifyWorkflowWebhook } from "../../workflow/trigger/workflow-webhook.signature.mjs";
|
|
30
31
|
import { eventSubscriberOf } from "../event-subscriber.mjs";
|
|
@@ -55,7 +56,8 @@ var stateSchema = z.object({
|
|
|
55
56
|
event: z.instanceof(EventEntry),
|
|
56
57
|
claimedEventId: z.string().optional(),
|
|
57
58
|
claimToken: z.string().optional(),
|
|
58
|
-
result: z.object({ eventId: z.string(), matched: z.number() })
|
|
59
|
+
result: z.object({ eventId: z.string(), matched: z.number() }),
|
|
60
|
+
flowError: z.instanceof(Error).optional()
|
|
59
61
|
});
|
|
60
62
|
var plan = {
|
|
61
63
|
pre: [
|
|
@@ -110,8 +112,9 @@ var EventPublishHttpFlow = class extends FlowBase {
|
|
|
110
112
|
get httpRequest() {
|
|
111
113
|
return this.rawInput.request;
|
|
112
114
|
}
|
|
113
|
-
/** Answer the request with an error and end the flow. */
|
|
115
|
+
/** Answer the request with an error and end the flow; the refusal is the run's failure, for its span and hooks. */
|
|
114
116
|
refuse(status, error, details = {}, headers) {
|
|
117
|
+
this.state.set("flowError", new PublicMcpError(`HTTP ${status}: ${error}`, "EVENT_PUBLISH_REFUSED", status));
|
|
115
118
|
return FlowControl.respond(httpRespond.json({ error, ...details }, { status, headers }));
|
|
116
119
|
}
|
|
117
120
|
async checkIpFilter() {
|
|
@@ -145,7 +145,7 @@ var EventStreamFlow = class extends FlowBase {
|
|
|
145
145
|
});
|
|
146
146
|
if (!streams.reserve(stream)) {
|
|
147
147
|
stream.close();
|
|
148
|
-
throw new EventResourceExhaustedError(this.codes, "
|
|
148
|
+
throw new EventResourceExhaustedError(this.codes, "streams", config.subscriptions.maxPerPrincipal);
|
|
149
149
|
}
|
|
150
150
|
try {
|
|
151
151
|
await context.onSubscribe?.(subscriptionArguments, subscription);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// libs/sdk/src/ext-apps/ext-apps.handler.ts
|
|
2
|
-
import { isDevelopment } from "@frontmcp/utils";
|
|
2
|
+
import { escapeControlCharacters, isDevelopment } from "@frontmcp/utils";
|
|
3
|
+
import { toMcpError } from "../errors/index.mjs";
|
|
3
4
|
import {
|
|
4
5
|
EXT_APPS_ERROR_CODES
|
|
5
6
|
} from "./ext-apps.types.mjs";
|
|
@@ -36,7 +37,7 @@ var ExtAppsMessageHandler = class {
|
|
|
36
37
|
*/
|
|
37
38
|
async handleRequest(request) {
|
|
38
39
|
const { id, method, params } = request;
|
|
39
|
-
this.logger.verbose(`handleRequest: method=${method}, id=${id}`);
|
|
40
|
+
this.logger.verbose(`handleRequest: method=${escapeControlCharacters(method)}, id=${escapeControlCharacters(id)}`);
|
|
40
41
|
try {
|
|
41
42
|
const result = await this.routeMethod(method, params);
|
|
42
43
|
return {
|
|
@@ -47,13 +48,15 @@ var ExtAppsMessageHandler = class {
|
|
|
47
48
|
} catch (error) {
|
|
48
49
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
49
50
|
const errorCode = this.getErrorCode(error);
|
|
50
|
-
this.logger.warn(
|
|
51
|
+
this.logger.warn(
|
|
52
|
+
`handleRequest: method=${escapeControlCharacters(method)} failed: ${escapeControlCharacters(errorMessage)}`
|
|
53
|
+
);
|
|
51
54
|
return {
|
|
52
55
|
jsonrpc: "2.0",
|
|
53
56
|
id,
|
|
54
57
|
error: {
|
|
55
58
|
code: errorCode,
|
|
56
|
-
message:
|
|
59
|
+
message: this.widgetMessageOf(error),
|
|
57
60
|
// Only include stack traces in development to avoid leaking internals in production
|
|
58
61
|
data: isDevelopment() && error instanceof Error ? { stack: error.stack } : void 0
|
|
59
62
|
}
|
|
@@ -71,7 +74,7 @@ var ExtAppsMessageHandler = class {
|
|
|
71
74
|
async handleNotification(notification) {
|
|
72
75
|
const { method, params } = notification;
|
|
73
76
|
if (method !== "notifications/message" && method !== "ui/notifications/request-teardown") {
|
|
74
|
-
this.logger.verbose(`handleNotification: ignoring method=${method}`);
|
|
77
|
+
this.logger.verbose(`handleNotification: ignoring method=${escapeControlCharacters(method)}`);
|
|
75
78
|
return;
|
|
76
79
|
}
|
|
77
80
|
if (method === "ui/notifications/request-teardown" && !this.context.close) {
|
|
@@ -82,7 +85,9 @@ var ExtAppsMessageHandler = class {
|
|
|
82
85
|
await this.routeMethod(method, params);
|
|
83
86
|
} catch (error) {
|
|
84
87
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
85
|
-
this.logger.warn(
|
|
88
|
+
this.logger.warn(
|
|
89
|
+
`handleNotification: method=${escapeControlCharacters(method)} failed: ${escapeControlCharacters(errorMessage)}`
|
|
90
|
+
);
|
|
86
91
|
}
|
|
87
92
|
}
|
|
88
93
|
/**
|
|
@@ -135,7 +140,7 @@ var ExtAppsMessageHandler = class {
|
|
|
135
140
|
handleInitialize(params) {
|
|
136
141
|
const { appInfo, protocolVersion } = params;
|
|
137
142
|
this.logger.verbose(
|
|
138
|
-
`handleInitialize: app=${appInfo?.name || "unknown"} v${appInfo?.version || "unknown"}, protocol=${protocolVersion}`
|
|
143
|
+
`handleInitialize: app=${escapeControlCharacters(appInfo?.name || "unknown")} v${escapeControlCharacters(appInfo?.version || "unknown")}, protocol=${escapeControlCharacters(protocolVersion)}`
|
|
139
144
|
);
|
|
140
145
|
return {
|
|
141
146
|
hostCapabilities: this.hostCapabilities,
|
|
@@ -153,7 +158,7 @@ var ExtAppsMessageHandler = class {
|
|
|
153
158
|
if (!name || typeof name !== "string") {
|
|
154
159
|
throw new ExtAppsInvalidParamsError("Tool name is required");
|
|
155
160
|
}
|
|
156
|
-
this.logger.verbose(`handleCallServerTool: tool=${name}`);
|
|
161
|
+
this.logger.verbose(`handleCallServerTool: tool=${escapeControlCharacters(name)}`);
|
|
157
162
|
return this.context.callTool(name, args);
|
|
158
163
|
}
|
|
159
164
|
/**
|
|
@@ -213,7 +218,7 @@ var ExtAppsMessageHandler = class {
|
|
|
213
218
|
`URL scheme '${parsed.protocol}' not allowed. Only http: and https: are permitted.`
|
|
214
219
|
);
|
|
215
220
|
}
|
|
216
|
-
this.logger.verbose(`handleOpenLink: url=${url}`);
|
|
221
|
+
this.logger.verbose(`handleOpenLink: url=${escapeControlCharacters(url)}`);
|
|
217
222
|
await this.context.openLink(url);
|
|
218
223
|
}
|
|
219
224
|
/**
|
|
@@ -231,7 +236,7 @@ var ExtAppsMessageHandler = class {
|
|
|
231
236
|
if (!this.context.setDisplayMode) {
|
|
232
237
|
throw new ExtAppsNotSupportedError("Display mode change not supported by host");
|
|
233
238
|
}
|
|
234
|
-
this.logger.verbose(`handleSetDisplayMode: mode=${mode}`);
|
|
239
|
+
this.logger.verbose(`handleSetDisplayMode: mode=${escapeControlCharacters(mode)}`);
|
|
235
240
|
await this.context.setDisplayMode(mode);
|
|
236
241
|
return { mode };
|
|
237
242
|
}
|
|
@@ -244,7 +249,7 @@ var ExtAppsMessageHandler = class {
|
|
|
244
249
|
throw new ExtAppsNotSupportedError("Widget close not supported by host");
|
|
245
250
|
}
|
|
246
251
|
const { reason } = params;
|
|
247
|
-
this.logger.verbose(`handleClose: reason=${reason || "none"}`);
|
|
252
|
+
this.logger.verbose(`handleClose: reason=${escapeControlCharacters(reason || "none")}`);
|
|
248
253
|
await this.context.close(reason);
|
|
249
254
|
}
|
|
250
255
|
/**
|
|
@@ -285,8 +290,10 @@ var ExtAppsMessageHandler = class {
|
|
|
285
290
|
this.writeWidgetLog(serverLevel, logger ?? "widget log", data);
|
|
286
291
|
}
|
|
287
292
|
}
|
|
288
|
-
|
|
293
|
+
/** Write a widget's log message to the server log, on one line whatever it holds. */
|
|
294
|
+
writeWidgetLog(level, text, data) {
|
|
289
295
|
const widgetLogger = this.logger.child(`Widget:${this.context.sessionId}`);
|
|
296
|
+
const message = escapeControlCharacters(text);
|
|
290
297
|
switch (level) {
|
|
291
298
|
case "debug":
|
|
292
299
|
widgetLogger.verbose(message, data);
|
|
@@ -324,7 +331,7 @@ var ExtAppsMessageHandler = class {
|
|
|
324
331
|
if (!inputSchema || typeof inputSchema !== "object" || Array.isArray(inputSchema)) {
|
|
325
332
|
throw new ExtAppsInvalidParamsError("Tool input schema must be a non-null object");
|
|
326
333
|
}
|
|
327
|
-
this.logger.verbose(`handleRegisterTool: name=${name}`);
|
|
334
|
+
this.logger.verbose(`handleRegisterTool: name=${escapeControlCharacters(name)}`);
|
|
328
335
|
await this.context.registerTool(name, description, inputSchema);
|
|
329
336
|
}
|
|
330
337
|
/**
|
|
@@ -341,9 +348,14 @@ var ExtAppsMessageHandler = class {
|
|
|
341
348
|
if (!name || typeof name !== "string") {
|
|
342
349
|
throw new ExtAppsInvalidParamsError("Tool name is required");
|
|
343
350
|
}
|
|
344
|
-
this.logger.verbose(`handleUnregisterTool: name=${name}`);
|
|
351
|
+
this.logger.verbose(`handleUnregisterTool: name=${escapeControlCharacters(name)}`);
|
|
345
352
|
await this.context.unregisterTool(name);
|
|
346
353
|
}
|
|
354
|
+
/** The message a widget is answered with: an internal failure's own message stays in the server log outside development. */
|
|
355
|
+
widgetMessageOf(error) {
|
|
356
|
+
if (error instanceof ExtAppsError || isDevelopment()) return error instanceof Error ? error.message : String(error);
|
|
357
|
+
return toMcpError(error).getPublicMessage();
|
|
358
|
+
}
|
|
347
359
|
/**
|
|
348
360
|
* Get the appropriate error code for an error.
|
|
349
361
|
*/
|
|
@@ -83,8 +83,9 @@ var FlowRegistry = class extends RegistryAbstract {
|
|
|
83
83
|
const mcpCtx = input?.ctx;
|
|
84
84
|
const inProcessMetadata = mcpCtx?.metadata;
|
|
85
85
|
const inProcessPlatformEnv = mcpCtx?.platformEnv;
|
|
86
|
+
const ownRequest = mcpCtx?.ownRequest === true || Boolean(inProcessMetadata) || inProcessPlatformEnv !== void 0;
|
|
86
87
|
const existingContext = contextStorage.getStore();
|
|
87
|
-
if (existingContext && !
|
|
88
|
+
if (existingContext && !ownRequest) {
|
|
88
89
|
return flow.run(input, deps ?? /* @__PURE__ */ new Map());
|
|
89
90
|
}
|
|
90
91
|
const scope = this.providers.getActiveScope();
|
|
@@ -17,6 +17,7 @@ function assertAuthoritiesRules(engine, entries) {
|
|
|
17
17
|
function assertEntryAuthorities(engine, contextBuilder, entries) {
|
|
18
18
|
if (engine && contextBuilder) {
|
|
19
19
|
assertAuthoritiesRules(engine, entries);
|
|
20
|
+
assertRelationshipResolver(engine, contextBuilder, entries);
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
22
23
|
if (entries.length === 0) return;
|
|
@@ -27,6 +28,21 @@ function assertEntryAuthorities(engine, contextBuilder, entries) {
|
|
|
27
28
|
{ suggestion: "Add authorities config to @FrontMcp() or remove authorities from entry metadata" }
|
|
28
29
|
);
|
|
29
30
|
}
|
|
31
|
+
function assertRelationshipResolver(engine, contextBuilder, entries) {
|
|
32
|
+
if (contextBuilder.hasRelationshipResolver !== false) return;
|
|
33
|
+
const users = [
|
|
34
|
+
...engine.profilesCheckingRelationships().map((name) => `profile "${name}"`),
|
|
35
|
+
...entries.filter(({ authorities }) => engine.ruleChecksRelationships(authorities)).map(({ label }) => label)
|
|
36
|
+
];
|
|
37
|
+
if (users.length === 0) return;
|
|
38
|
+
const suffix = users.length > 5 ? ` and ${users.length - 5} more` : "";
|
|
39
|
+
throw new AuthConfigurationError(
|
|
40
|
+
`Relationship resolver required: ${users.slice(0, 5).join(", ")}${suffix} check 'relationships', but no relationshipResolver is configured, so those checks can never pass.`,
|
|
41
|
+
{
|
|
42
|
+
suggestion: "Add 'authorities: { relationshipResolver: { check: (type, resource, resourceId, userSub) => ... } }' to your @FrontMcp() decorator (or relationshipResolver in the authorities plugin options), or remove the 'relationships' checks."
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
30
46
|
export {
|
|
31
47
|
assertAuthoritiesRules,
|
|
32
48
|
assertEntryAuthorities
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
frontMcpMetadataSchema,
|
|
8
8
|
FrontMcpServer,
|
|
9
9
|
getDecoratorConfig,
|
|
10
|
+
loggingOptionsSchema,
|
|
10
11
|
parseFrontMcpConfigLite
|
|
11
12
|
} from "../common/index.mjs";
|
|
12
13
|
import { withoutStores } from "../common/metadata/front-mcp-stores.mjs";
|
|
@@ -61,6 +62,7 @@ async function parseCliConfig(options, { fileLog }) {
|
|
|
61
62
|
parsedConfig.logging.transports = transports;
|
|
62
63
|
} else {
|
|
63
64
|
parsedConfig["logging"] = {
|
|
65
|
+
...loggingOptionsSchema.parse({}),
|
|
64
66
|
enableConsole: verbose,
|
|
65
67
|
transports: fileLogTransport ? [fileLogTransport] : []
|
|
66
68
|
};
|
|
@@ -611,6 +613,9 @@ var FrontMcpInstance = class _FrontMcpInstance {
|
|
|
611
613
|
*
|
|
612
614
|
* One connection serves every revision: `initialize` opens a session, a 2026-07-28 request is served statelessly.
|
|
613
615
|
*
|
|
616
|
+
* Log lines go to stderr and to a file under `~/.frontmcp/logs/`, never to stdout, which carries the JSON-RPC
|
|
617
|
+
* frames. Without a `logging` option they are written as with `logging: {}`: at `FRONTMCP_LOG_LEVEL`, or `info`.
|
|
618
|
+
*
|
|
614
619
|
* When stdin ends or the parent process exits, the server shuts down as on SIGTERM and exits 0, so a client that
|
|
615
620
|
* dies leaves no orphan behind; when stdin ends, the requests in flight are answered first (for up to 2 seconds).
|
|
616
621
|
* `lifecycle: { exitWhenOrphaned: false }` turns that off.
|
|
@@ -679,6 +684,7 @@ var FrontMcpInstance = class _FrontMcpInstance {
|
|
|
679
684
|
parsedConfig.logging.transports = transports;
|
|
680
685
|
} else {
|
|
681
686
|
parsedConfig["logging"] = {
|
|
687
|
+
...loggingOptionsSchema.parse({}),
|
|
682
688
|
enableConsole: true,
|
|
683
689
|
transports: [fileLogTransport]
|
|
684
690
|
};
|
|
@@ -692,7 +698,7 @@ var FrontMcpInstance = class _FrontMcpInstance {
|
|
|
692
698
|
throw new InternalMcpError("No scopes initialized. Ensure at least one app is configured.");
|
|
693
699
|
}
|
|
694
700
|
const scope = primaryScope;
|
|
695
|
-
const { createMcpHandlers } = await import("../transport/mcp-handlers/index.mjs");
|
|
701
|
+
const { createMcpHandlers, registerMcpHandler } = await import("../transport/mcp-handlers/index.mjs");
|
|
696
702
|
const hasRemoteApps = scope.apps?.getApps().some((app) => app.isRemote) ?? false;
|
|
697
703
|
const hasResources = scope.resources.hasAny() || hasRemoteApps;
|
|
698
704
|
const hasPrompts = scope.prompts.hasAny() || hasRemoteApps;
|
|
@@ -735,7 +741,7 @@ var FrontMcpInstance = class _FrontMcpInstance {
|
|
|
735
741
|
};
|
|
736
742
|
return originalHandler(request, enrichedCtx);
|
|
737
743
|
};
|
|
738
|
-
mcpServer
|
|
744
|
+
registerMcpHandler(mcpServer, handler.requestSchema, wrappedHandler);
|
|
739
745
|
}
|
|
740
746
|
const { IpcServerTransport, isIpcStdioRequested } = await import("../transport/ipc-server.transport.mjs");
|
|
741
747
|
const { StdioRevisionRouter } = await import("../transport/stdio-revision-router.mjs");
|