@frontmcp/sdk 1.11.2 → 1.11.3
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/README.md +9 -0
- package/agent/adapters/anthropic.adapter.d.ts +4 -4
- package/agent/adapters/anthropic.adapter.d.ts.map +1 -1
- package/agent/adapters/base.adapter.d.ts +12 -2
- package/agent/adapters/base.adapter.d.ts.map +1 -1
- package/agent/adapters/index.d.ts +1 -1
- package/agent/adapters/index.d.ts.map +1 -1
- package/agent/adapters/openai.adapter.d.ts +7 -7
- package/agent/adapters/openai.adapter.d.ts.map +1 -1
- package/agent/agent-execution-loop.d.ts +27 -14
- package/agent/agent-execution-loop.d.ts.map +1 -1
- package/agent/agent.registry.d.ts +9 -0
- package/agent/agent.registry.d.ts.map +1 -1
- package/agent/flows/call-agent.flow.d.ts.map +1 -1
- package/app/instances/app.esm.instance.d.ts +27 -5
- package/app/instances/app.esm.instance.d.ts.map +1 -1
- package/app/instances/app.remote.instance.d.ts.map +1 -1
- package/app/instances/esm-normalize.utils.d.ts +3 -1
- package/app/instances/esm-normalize.utils.d.ts.map +1 -1
- package/app/instances/esm-package-version.d.ts +48 -0
- package/app/instances/esm-package-version.d.ts.map +1 -0
- package/auth/auth-ui/auth-ui.contract.d.ts +27 -0
- package/auth/auth-ui/auth-ui.contract.d.ts.map +1 -1
- package/auth/auth-ui/auth-ui.state.d.ts +2 -1
- package/auth/auth-ui/auth-ui.state.d.ts.map +1 -1
- package/auth/auth-ui/index.d.ts +1 -1
- package/auth/auth-ui/index.d.ts.map +1 -1
- package/auth/authorization/orchestrated.context-extension.d.ts +1 -1
- package/auth/authorization/orchestrated.context-extension.d.ts.map +1 -1
- package/auth/authorized-apps.utils.d.ts +22 -0
- package/auth/authorized-apps.utils.d.ts.map +1 -1
- package/auth/federated-steps.d.ts +66 -0
- package/auth/federated-steps.d.ts.map +1 -0
- package/auth/flows/oauth.authorize.flow.d.ts +2 -2
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts +17 -6
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.register.flow.d.ts +1 -1
- package/auth/flows/oauth.register.flow.d.ts.map +1 -1
- package/auth/flows/oauth.token.flow.d.ts +9 -0
- package/auth/flows/oauth.token.flow.d.ts.map +1 -1
- package/auth/flows/oauth.userinfo.flow.d.ts +1 -1
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts +3 -0
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts.map +1 -1
- package/auth/flows/well-known.prm.flow.d.ts.map +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +38 -7
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/required-providers.utils.d.ts +19 -0
- package/auth/required-providers.utils.d.ts.map +1 -0
- package/browser/agent/adapters/anthropic.adapter.mjs +14 -10
- package/browser/agent/adapters/base.adapter.mjs +10 -3
- package/browser/agent/adapters/openai.adapter.mjs +39 -25
- package/browser/agent/agent-execution-loop.mjs +102 -70
- package/browser/agent/agent.registry.mjs +56 -20
- package/browser/agent/flows/call-agent.flow.mjs +2 -1
- package/browser/agent/index.mjs +1 -1
- package/browser/app/instances/app.esm.instance.mjs +120 -154
- package/browser/app/instances/app.remote.instance.mjs +3 -4
- package/browser/app/instances/esm-normalize.utils.mjs +10 -5
- package/browser/app/instances/esm-package-version.mjs +118 -0
- package/browser/auth/auth-ui/auth-ui.state.mjs +1 -1
- package/browser/auth/authorization/orchestrated.context-extension.mjs +2 -2
- package/browser/auth/authorized-apps.utils.mjs +24 -2
- package/browser/auth/federated-steps.mjs +199 -0
- package/browser/auth/flows/oauth.authorize.flow.mjs +61 -76
- package/browser/auth/flows/oauth.callback.flow.mjs +112 -42
- package/browser/auth/flows/oauth.provider-callback.flow.mjs +14 -2
- package/browser/auth/flows/oauth.register.flow.mjs +3 -3
- package/browser/auth/flows/oauth.token.flow.mjs +33 -3
- package/browser/auth/flows/session.verify.flow.mjs +1 -1
- package/browser/auth/flows/well-known.oauth-authorization-server.flow.mjs +11 -6
- package/browser/auth/flows/well-known.prm.flow.mjs +2 -1
- package/browser/auth/instances/instance.local-primary-auth.mjs +131 -37
- package/browser/auth/required-providers.utils.mjs +16 -0
- package/browser/channel/channel-scope.helper.mjs +2 -2
- package/browser/channel/flows/send-channel-notification.flow.mjs +1 -1
- package/browser/common/entries/tool.entry.mjs +21 -4
- package/browser/common/index.mjs +2 -2
- package/browser/common/interfaces/agent.interface.mjs +25 -4
- package/browser/common/interfaces/tool.interface.mjs +31 -5
- package/browser/common/metadata/app.metadata.mjs +8 -2
- package/browser/common/metadata/index.mjs +1 -1
- package/browser/common/metadata/output-policy.mjs +4 -0
- package/browser/common/metadata/workflow.metadata.mjs +3 -1
- package/browser/common/tokens/workflow.tokens.mjs +1 -0
- package/browser/common/types/options/transport/schema.mjs +3 -0
- package/browser/common/utils/auth-info.utils.mjs +1 -2
- package/browser/common/utils/index.mjs +1 -1
- package/browser/common/utils/principal.utils.mjs +25 -1
- package/browser/context/frontmcp-context-storage.mjs +14 -3
- package/browser/context/frontmcp-context.mjs +24 -2
- package/browser/elicitation/helpers/checked-elicit-answer.mjs +18 -0
- package/browser/elicitation/helpers/elicit.helper.mjs +5 -21
- package/browser/elicitation/store/elicitation-encryption.mjs +6 -6
- package/browser/elicitation/store/encrypted-elicitation.store.mjs +2 -2
- package/browser/elicitation/store/storage-elicitation.store.mjs +1 -2
- package/browser/errors/auth-internal.errors.mjs +2 -0
- package/browser/errors/index.mjs +6 -1
- package/browser/errors/mcp.error.mjs +22 -3
- package/browser/errors/misconfiguration.mjs +2 -0
- package/browser/errors/remote.errors.mjs +1 -1
- package/browser/errors/tool-ui.errors.mjs +22 -0
- package/browser/errors/workflow.errors.mjs +7 -1
- package/browser/esm-loader/esm-cache.mjs +2 -2
- package/browser/esm-loader/esm-entries.mjs +15 -1
- package/browser/esm-loader/esm-manifest.mjs +32 -25
- package/browser/esm-loader/esm-module-loader.mjs +22 -4
- package/browser/esm-loader/factories/esm-context-factories.mjs +3 -3
- package/browser/esm-loader/factories/esm-instance-factories.mjs +7 -3
- package/browser/esm-loader/factories/esm-record-builders.mjs +27 -2
- package/browser/esm-loader/semver.utils.mjs +3 -5
- package/browser/esm-loader/version-poller.mjs +1 -1
- package/browser/esm-loader/version-resolver.mjs +5 -1
- package/browser/ext-apps/ext-apps.handler.mjs +6 -1
- package/browser/flows/flow.http-path.mjs +5 -1
- package/browser/flows/flow.instance.mjs +42 -9
- package/browser/front-mcp/front-mcp.mjs +19 -2
- package/browser/front-mcp/session-secret.check.mjs +22 -0
- package/browser/http-route/http-route.table.mjs +23 -3
- package/browser/index.cjs +30225 -27807
- package/browser/index.mjs +8 -4
- package/browser/job/execution/job-execution.manager.mjs +20 -17
- package/browser/job/flows/execute-job.flow.mjs +5 -3
- package/browser/job/index.mjs +2 -2
- package/browser/job/job-attempt.mjs +15 -10
- package/browser/job/job-context-providers.mjs +2 -1
- package/browser/job/job-scope.helper.mjs +76 -4
- package/browser/job/job.registry.mjs +30 -0
- package/browser/job/tools/index.mjs +3 -1
- package/browser/job/tools/list-jobs.tool.mjs +7 -5
- package/browser/job/tools/update-job.tool.mjs +75 -0
- package/browser/logger/instances/instance.logger.mjs +31 -6
- package/browser/notification/notification.service.mjs +26 -5
- package/browser/prompt/flows/get-prompt.flow.mjs +3 -3
- package/browser/prompt/flows/prompts-list.flow.mjs +11 -4
- package/browser/provider/provider.registry.mjs +1 -1
- package/browser/remote-mcp/factories/instance-factories.mjs +4 -4
- package/browser/remote-mcp/factories/record-builders.mjs +5 -0
- package/browser/remote-mcp/mcp-client.service.mjs +113 -68
- package/browser/remote-mcp/mcp-stateless-client.adapter.mjs +2 -2
- package/browser/remote-mcp/remote-entries.mjs +2 -1
- package/browser/remote-mcp/remote-oauth.mjs +102 -0
- package/browser/remote-mcp/remote-request-headers.mjs +42 -12
- package/browser/remote-mcp/resilience/circuit-breaker.mjs +3 -2
- package/browser/resource/flows/read-resource.flow.mjs +6 -4
- package/browser/resource/flows/resource-templates-list.flow.mjs +24 -9
- package/browser/resource/flows/resources-list.flow.mjs +11 -4
- package/browser/scope/flows/http.request.flow.mjs +1 -1
- package/browser/scope/observability-scope.helper.mjs +6 -1
- package/browser/scope/scope.instance.mjs +284 -81
- package/browser/skill/errors/tool-not-allowed.error.mjs +2 -2
- package/browser/skill/flows/filter-skills.flow.mjs +1 -1
- package/browser/skill/flows/load-skill.flow.mjs +27 -15
- package/browser/skill/guards/tool-authorization.guard.mjs +1 -1
- package/browser/skill/hooks/skill-tool.hook.mjs +32 -24
- package/browser/skill/providers/external-skill.provider.mjs +4 -2
- package/browser/skill/session/skill-session-store.interface.mjs +10 -0
- package/browser/skill/session/skill-session.manager.mjs +8 -0
- package/browser/skill/skill-authorities.helper.mjs +9 -3
- package/browser/skill/skill-scope.helper.mjs +7 -2
- package/browser/skill/skill.registry.mjs +21 -2
- package/browser/subsystems.mjs +6 -2
- package/browser/surface/entry-authorized.mjs +15 -0
- package/browser/tool/flows/call-tool.flow.mjs +59 -13
- package/browser/tool/flows/tools-list.flow.mjs +11 -4
- package/browser/tool/tool.utils.mjs +46 -61
- package/browser/tool/ui/serving-mode-default.mjs +11 -2
- package/browser/tool/ui/template-detection.mjs +1 -1
- package/browser/tool/ui/ui-option-warnings.mjs +1 -28
- package/browser/tool/ui/ui-render.mjs +6 -0
- package/browser/tool/ui/ui-resource.handler.mjs +50 -6
- package/browser/tool/ui/ui-shared.mjs +61 -7
- package/browser/tool/ui/widget-routes.mjs +73 -0
- package/browser/tool/ui/widget-serving.mjs +112 -0
- package/browser/transport/flows/handle.mcp-20260728.flow.mjs +1 -1
- package/browser/transport/flows/handle.stateless-http.flow.mjs +1 -2
- package/browser/transport/mcp-20260728/client/index.mjs +1 -1
- package/browser/transport/mcp-20260728/client/mcp-stateless.client.mjs +2 -1
- package/browser/transport/mcp-20260728/index.mjs +1 -1
- package/browser/transport/web-fetch-handler.mjs +5 -1
- package/browser/utils/abort.utils.mjs +7 -2
- package/browser/utils/content.utils.mjs +1 -1
- package/browser/workflow/engine/workflow-step.executor.mjs +1 -1
- package/browser/workflow/engine/workflow.engine.mjs +13 -10
- package/browser/workflow/index.mjs +2 -2
- package/browser/workflow/tools/execute-workflow.tool.mjs +1 -1
- package/browser/workflow/tools/index.mjs +3 -1
- package/browser/workflow/tools/list-workflows.tool.mjs +4 -2
- package/browser/workflow/tools/register-workflow.tool.mjs +11 -2
- package/browser/workflow/tools/update-workflow.tool.mjs +80 -0
- package/browser/workflow/trigger/workflow-events.mjs +39 -0
- package/browser/workflow/trigger/workflow-triggers.mjs +80 -0
- package/browser/workflow/trigger/workflow-webhook.routes.mjs +104 -0
- package/browser/workflow/trigger/workflow-webhook.signature.mjs +59 -0
- package/browser/workflow/workflow.registry.mjs +27 -0
- package/browser/workflow/workflow.utils.mjs +13 -2
- package/builtin/authorities/authorities.plugin.d.ts +1 -1
- package/builtin/authorities/authorities.plugin.d.ts.map +1 -1
- package/builtin/authorities/authorities.plugin.options.d.ts +1 -1
- package/builtin/authorities/authorities.plugin.options.d.ts.map +1 -1
- package/builtin/config/config-resolver.d.ts.map +1 -1
- package/channel/channel-scope.helper.d.ts +2 -0
- package/channel/channel-scope.helper.d.ts.map +1 -1
- package/channel/channel.types.d.ts +1 -1
- package/channel/channel.types.d.ts.map +1 -1
- package/channel/sources/agent-completion.source.d.ts +1 -1
- package/channel/sources/agent-completion.source.d.ts.map +1 -1
- package/common/decorators/app.decorator.d.ts +1 -1
- package/common/decorators/app.decorator.d.ts.map +1 -1
- package/common/entries/provider.entry.d.ts +2 -2
- package/common/entries/provider.entry.d.ts.map +1 -1
- package/common/entries/scope.entry.d.ts +25 -3
- package/common/entries/scope.entry.d.ts.map +1 -1
- package/common/entries/tool.entry.d.ts +5 -3
- package/common/entries/tool.entry.d.ts.map +1 -1
- package/common/interfaces/agent.interface.d.ts +4 -2
- package/common/interfaces/agent.interface.d.ts.map +1 -1
- package/common/interfaces/llm-adapter.interface.d.ts +5 -0
- package/common/interfaces/llm-adapter.interface.d.ts.map +1 -1
- package/common/interfaces/logger.interface.d.ts +2 -1
- package/common/interfaces/logger.interface.d.ts.map +1 -1
- package/common/interfaces/tool.interface.d.ts +12 -2
- package/common/interfaces/tool.interface.d.ts.map +1 -1
- package/common/metadata/agent.metadata.d.ts +7 -2
- package/common/metadata/agent.metadata.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +35 -11
- package/common/metadata/app.metadata.d.ts.map +1 -1
- package/common/metadata/flow.metadata.d.ts +14 -0
- package/common/metadata/flow.metadata.d.ts.map +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +2 -1
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/metadata/job.metadata.d.ts +11 -0
- package/common/metadata/job.metadata.d.ts.map +1 -1
- package/common/metadata/output-policy.d.ts +2 -0
- package/common/metadata/output-policy.d.ts.map +1 -1
- package/common/metadata/remote-primitive.metadata.d.ts +6 -3
- package/common/metadata/remote-primitive.metadata.d.ts.map +1 -1
- package/common/metadata/resource.metadata.d.ts +1 -1
- package/common/metadata/workflow.metadata.d.ts +50 -14
- package/common/metadata/workflow.metadata.d.ts.map +1 -1
- package/common/tokens/workflow.tokens.d.ts +1 -0
- package/common/tokens/workflow.tokens.d.ts.map +1 -1
- package/common/types/options/logging/interfaces.d.ts +3 -1
- package/common/types/options/logging/interfaces.d.ts.map +1 -1
- package/common/types/options/observability/interfaces.d.ts +4 -2
- package/common/types/options/observability/interfaces.d.ts.map +1 -1
- package/common/types/options/transport/interfaces.d.ts +3 -0
- package/common/types/options/transport/interfaces.d.ts.map +1 -1
- package/common/types/options/transport/schema.d.ts.map +1 -1
- package/common/utils/auth-info.utils.d.ts +1 -0
- package/common/utils/auth-info.utils.d.ts.map +1 -1
- package/common/utils/global-config.utils.d.ts.map +1 -1
- package/common/utils/principal.utils.d.ts +24 -0
- package/common/utils/principal.utils.d.ts.map +1 -1
- package/context/frontmcp-context-storage.d.ts +3 -1
- package/context/frontmcp-context-storage.d.ts.map +1 -1
- package/context/frontmcp-context.d.ts +9 -1
- package/context/frontmcp-context.d.ts.map +1 -1
- package/elicitation/helpers/checked-elicit-answer.d.ts +10 -0
- package/elicitation/helpers/checked-elicit-answer.d.ts.map +1 -0
- package/elicitation/helpers/elicit.helper.d.ts.map +1 -1
- package/elicitation/store/elicitation-encryption.d.ts.map +1 -1
- package/elicitation/store/encrypted-elicitation.store.d.ts +2 -2
- package/elicitation/store/encrypted-elicitation.store.d.ts.map +1 -1
- package/elicitation/store/storage-elicitation.store.d.ts +3 -3
- package/elicitation/store/storage-elicitation.store.d.ts.map +1 -1
- package/errors/auth-internal.errors.d.ts +1 -1
- package/errors/auth-internal.errors.d.ts.map +1 -1
- package/errors/error-handler.d.ts.map +1 -1
- package/errors/index.d.ts +3 -2
- package/errors/index.d.ts.map +1 -1
- package/errors/mcp.error.d.ts +6 -1
- package/errors/mcp.error.d.ts.map +1 -1
- package/errors/misconfiguration.d.ts.map +1 -1
- package/errors/remote.errors.d.ts +1 -1
- package/errors/remote.errors.d.ts.map +1 -1
- package/errors/tool-ui.errors.d.ts +13 -0
- package/errors/tool-ui.errors.d.ts.map +1 -0
- package/errors/workflow.errors.d.ts +4 -0
- package/errors/workflow.errors.d.ts.map +1 -1
- package/esm/index.mjs +46 -45
- package/esm/job/tools/index.mjs +3 -2
- package/esm/workflow/tools/index.mjs +3 -2
- package/esm-loader/app-helpers.d.ts +4 -4
- package/esm-loader/app-helpers.d.ts.map +1 -1
- package/esm-loader/esm-entries.d.ts +11 -1
- package/esm-loader/esm-entries.d.ts.map +1 -1
- package/esm-loader/esm-manifest.d.ts +11 -8
- package/esm-loader/esm-manifest.d.ts.map +1 -1
- package/esm-loader/esm-module-loader.d.ts +6 -1
- package/esm-loader/esm-module-loader.d.ts.map +1 -1
- package/esm-loader/factories/esm-context-factories.d.ts +6 -3
- package/esm-loader/factories/esm-context-factories.d.ts.map +1 -1
- package/esm-loader/factories/esm-instance-factories.d.ts +3 -3
- package/esm-loader/factories/esm-instance-factories.d.ts.map +1 -1
- package/esm-loader/factories/esm-record-builders.d.ts.map +1 -1
- package/esm-loader/semver.utils.d.ts +8 -0
- package/esm-loader/semver.utils.d.ts.map +1 -1
- package/esm-loader/version-resolver.d.ts.map +1 -1
- package/ext-apps/ext-apps.handler.d.ts +2 -1
- package/ext-apps/ext-apps.handler.d.ts.map +1 -1
- package/flows/flow.http-path.d.ts +8 -0
- package/flows/flow.http-path.d.ts.map +1 -1
- package/flows/flow.instance.d.ts +9 -0
- package/flows/flow.instance.d.ts.map +1 -1
- package/front-mcp/front-mcp.d.ts +2 -0
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/front-mcp/session-secret.check.d.ts +19 -0
- package/front-mcp/session-secret.check.d.ts.map +1 -0
- package/http-route/http-route.table.d.ts.map +1 -1
- package/index.d.ts +4 -4
- package/index.d.ts.map +1 -1
- package/index.js +53 -52
- package/job/execution/job-execution.manager.d.ts +8 -3
- package/job/execution/job-execution.manager.d.ts.map +1 -1
- package/job/flows/execute-job.flow.d.ts +1 -0
- package/job/flows/execute-job.flow.d.ts.map +1 -1
- package/job/job-attempt.d.ts +7 -2
- package/job/job-attempt.d.ts.map +1 -1
- package/job/job-context-providers.d.ts +2 -2
- package/job/job-context-providers.d.ts.map +1 -1
- package/job/job-scope.helper.d.ts +26 -0
- package/job/job-scope.helper.d.ts.map +1 -1
- package/job/job.registry.d.ts +11 -0
- package/job/job.registry.d.ts.map +1 -1
- package/job/tools/index.d.ts +1 -0
- package/job/tools/index.d.ts.map +1 -1
- package/job/tools/index.js +4 -2
- package/job/tools/list-jobs.tool.d.ts +3 -3
- package/job/tools/list-jobs.tool.d.ts.map +1 -1
- package/job/tools/update-job.tool.d.ts +16 -0
- package/job/tools/update-job.tool.d.ts.map +1 -0
- package/logger/instances/instance.logger.d.ts +1 -0
- package/logger/instances/instance.logger.d.ts.map +1 -1
- package/notification/notification.service.d.ts +10 -3
- package/notification/notification.service.d.ts.map +1 -1
- package/package.json +10 -10
- package/prompt/flows/prompts-list.flow.d.ts.map +1 -1
- package/provider/provider.registry.d.ts.map +1 -1
- package/remote-mcp/factories/instance-factories.d.ts +4 -4
- package/remote-mcp/factories/instance-factories.d.ts.map +1 -1
- package/remote-mcp/factories/record-builders.d.ts.map +1 -1
- package/remote-mcp/mcp-client.service.d.ts +11 -0
- package/remote-mcp/mcp-client.service.d.ts.map +1 -1
- package/remote-mcp/mcp-client.types.d.ts +15 -2
- package/remote-mcp/mcp-client.types.d.ts.map +1 -1
- package/remote-mcp/mcp-stateless-client.adapter.d.ts +1 -1
- package/remote-mcp/mcp-stateless-client.adapter.d.ts.map +1 -1
- package/remote-mcp/remote-entries.d.ts +2 -1
- package/remote-mcp/remote-entries.d.ts.map +1 -1
- package/remote-mcp/remote-oauth.d.ts +27 -0
- package/remote-mcp/remote-oauth.d.ts.map +1 -0
- package/remote-mcp/remote-request-headers.d.ts +8 -2
- package/remote-mcp/remote-request-headers.d.ts.map +1 -1
- package/remote-mcp/resilience/circuit-breaker.d.ts +3 -2
- package/remote-mcp/resilience/circuit-breaker.d.ts.map +1 -1
- 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.map +1 -1
- package/scope/observability-scope.helper.d.ts.map +1 -1
- package/scope/scope.instance.d.ts +35 -1
- package/scope/scope.instance.d.ts.map +1 -1
- package/skill/errors/tool-not-allowed.error.d.ts.map +1 -1
- package/skill/flows/load-skill.flow.d.ts.map +1 -1
- package/skill/guards/tool-authorization.guard.d.ts +1 -1
- package/skill/guards/tool-authorization.guard.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/providers/external-skill.provider.d.ts +2 -2
- package/skill/providers/external-skill.provider.d.ts.map +1 -1
- package/skill/session/skill-session-store.interface.d.ts +5 -0
- package/skill/session/skill-session-store.interface.d.ts.map +1 -1
- package/skill/session/skill-session.manager.d.ts +4 -0
- package/skill/session/skill-session.manager.d.ts.map +1 -1
- package/skill/session/skill-session.types.d.ts +1 -1
- package/skill/skill-authorities.helper.d.ts +6 -3
- package/skill/skill-authorities.helper.d.ts.map +1 -1
- package/skill/skill-scope.helper.d.ts +5 -0
- package/skill/skill-scope.helper.d.ts.map +1 -1
- package/skill/skill.registry.d.ts +7 -0
- package/skill/skill.registry.d.ts.map +1 -1
- package/subsystems.d.ts +2 -2
- package/subsystems.d.ts.map +1 -1
- package/surface/entry-authorized.d.ts +5 -0
- package/surface/entry-authorized.d.ts.map +1 -0
- package/tool/flows/call-tool.flow.d.ts +6 -0
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tools-list.flow.d.ts +1 -1
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- package/tool/tool.utils.d.ts.map +1 -1
- package/tool/ui/serving-mode-default.d.ts +6 -2
- package/tool/ui/serving-mode-default.d.ts.map +1 -1
- package/tool/ui/ui-option-warnings.d.ts.map +1 -1
- package/tool/ui/ui-render.d.ts +2 -2
- package/tool/ui/ui-render.d.ts.map +1 -1
- package/tool/ui/ui-resource.handler.d.ts +10 -2
- package/tool/ui/ui-resource.handler.d.ts.map +1 -1
- package/tool/ui/ui-shared.d.ts +31 -5
- package/tool/ui/ui-shared.d.ts.map +1 -1
- package/tool/ui/widget-routes.d.ts +38 -0
- package/tool/ui/widget-routes.d.ts.map +1 -0
- package/tool/ui/widget-serving.d.ts +37 -0
- package/tool/ui/widget-serving.d.ts.map +1 -0
- package/transport/mcp-20260728/client/mcp-stateless.client.d.ts +2 -0
- package/transport/mcp-20260728/client/mcp-stateless.client.d.ts.map +1 -1
- package/transport/web-fetch-handler.d.ts.map +1 -1
- package/utils/abort.utils.d.ts +5 -0
- package/utils/abort.utils.d.ts.map +1 -1
- package/workflow/engine/workflow.engine.d.ts +8 -1
- package/workflow/engine/workflow.engine.d.ts.map +1 -1
- package/workflow/tools/execute-workflow.tool.d.ts.map +1 -1
- package/workflow/tools/index.d.ts +1 -0
- package/workflow/tools/index.d.ts.map +1 -1
- package/workflow/tools/index.js +4 -2
- 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/update-workflow.tool.d.ts +21 -0
- package/workflow/tools/update-workflow.tool.d.ts.map +1 -0
- package/workflow/trigger/workflow-events.d.ts +22 -0
- package/workflow/trigger/workflow-events.d.ts.map +1 -0
- package/workflow/trigger/workflow-triggers.d.ts +34 -0
- package/workflow/trigger/workflow-triggers.d.ts.map +1 -0
- package/workflow/trigger/workflow-webhook.routes.d.ts +16 -0
- package/workflow/trigger/workflow-webhook.routes.d.ts.map +1 -0
- package/workflow/trigger/workflow-webhook.signature.d.ts +41 -0
- package/workflow/trigger/workflow-webhook.signature.d.ts.map +1 -0
- package/workflow/workflow.registry.d.ts +11 -0
- package/workflow/workflow.registry.d.ts.map +1 -1
- package/workflow/workflow.utils.d.ts +7 -0
- package/workflow/workflow.utils.d.ts.map +1 -1
|
@@ -59,11 +59,11 @@ var McpStatelessClientAdapter = class {
|
|
|
59
59
|
async close() {
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
-
async function negotiateRemoteProtocol(url, configured, headers, fetchImpl = fetch) {
|
|
62
|
+
async function negotiateRemoteProtocol(url, configured, headers, fetchImpl = fetch, options = {}) {
|
|
63
63
|
if (configured === "2026-07-28") return "2026-07-28";
|
|
64
64
|
if (configured !== "auto") return "legacy";
|
|
65
65
|
try {
|
|
66
|
-
const probe = new McpStatelessClient({ url, headers, fetchImpl });
|
|
66
|
+
const probe = new McpStatelessClient({ url, headers, fetchImpl, ...options });
|
|
67
67
|
const result = await probe.discover();
|
|
68
68
|
const supported = result["supportedVersions"];
|
|
69
69
|
return Array.isArray(supported) && supported.includes("2026-07-28") ? "2026-07-28" : "legacy";
|
|
@@ -31,7 +31,8 @@ function buildRemoteConnectRequest(target) {
|
|
|
31
31
|
protocolVersion: transportOptions?.protocolVersion
|
|
32
32
|
},
|
|
33
33
|
auth: target.remoteAuth,
|
|
34
|
-
namespace: target.namespace
|
|
34
|
+
namespace: target.namespace,
|
|
35
|
+
refreshInterval: target.refreshInterval
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
var remoteServersByScope = /* @__PURE__ */ new WeakMap();
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// libs/sdk/src/remote-mcp/remote-oauth.ts
|
|
2
|
+
import { base64Encode } from "@frontmcp/utils";
|
|
3
|
+
import { RemoteAuthError } from "../errors/remote.errors.mjs";
|
|
4
|
+
var EXPIRY_MARGIN_MS = 3e4;
|
|
5
|
+
var RemoteOAuthTokenSource = class {
|
|
6
|
+
constructor(appId, remoteUrl, credentials) {
|
|
7
|
+
this.appId = appId;
|
|
8
|
+
this.remoteUrl = remoteUrl;
|
|
9
|
+
this.credentials = credentials;
|
|
10
|
+
}
|
|
11
|
+
appId;
|
|
12
|
+
remoteUrl;
|
|
13
|
+
credentials;
|
|
14
|
+
endpoint;
|
|
15
|
+
token;
|
|
16
|
+
/** The `Authorization` header value for the next request: the cached token, or a new one once it is about to expire. */
|
|
17
|
+
async authorization() {
|
|
18
|
+
const current = this.token;
|
|
19
|
+
const next = current ? current.then(
|
|
20
|
+
(cached) => isFresh(cached) ? cached : this.requestToken(),
|
|
21
|
+
() => this.requestToken()
|
|
22
|
+
) : this.requestToken();
|
|
23
|
+
this.token = next;
|
|
24
|
+
return `Bearer ${(await next).accessToken}`;
|
|
25
|
+
}
|
|
26
|
+
/** Drops the cached token, after the remote refused it. */
|
|
27
|
+
invalidate() {
|
|
28
|
+
this.token = void 0;
|
|
29
|
+
}
|
|
30
|
+
async requestToken() {
|
|
31
|
+
this.endpoint ??= this.findTokenEndpoint().catch((error) => {
|
|
32
|
+
this.endpoint = void 0;
|
|
33
|
+
throw error;
|
|
34
|
+
});
|
|
35
|
+
const endpoint = await this.endpoint;
|
|
36
|
+
const { clientId, clientSecret, scope } = this.credentials;
|
|
37
|
+
const body = new URLSearchParams({ grant_type: "client_credentials", resource: endpoint.resource });
|
|
38
|
+
if (scope) body.set("scope", scope);
|
|
39
|
+
const headers = {
|
|
40
|
+
"content-type": "application/x-www-form-urlencoded",
|
|
41
|
+
accept: "application/json"
|
|
42
|
+
};
|
|
43
|
+
if (endpoint.postsSecret) {
|
|
44
|
+
body.set("client_id", clientId);
|
|
45
|
+
body.set("client_secret", clientSecret);
|
|
46
|
+
} else {
|
|
47
|
+
const pair = `${encodeURIComponent(clientId)}:${encodeURIComponent(clientSecret)}`;
|
|
48
|
+
headers["authorization"] = `Basic ${base64Encode(new TextEncoder().encode(pair))}`;
|
|
49
|
+
}
|
|
50
|
+
const response = await fetch(endpoint.url, { method: "POST", headers, body: body.toString() });
|
|
51
|
+
const answer = await response.json().catch(() => ({}));
|
|
52
|
+
if (!response.ok || typeof answer["access_token"] !== "string") {
|
|
53
|
+
const reason = typeof answer["error"] === "string" ? `: ${answer["error"]}` : "";
|
|
54
|
+
throw new RemoteAuthError(this.appId, `the token endpoint answered HTTP ${response.status}${reason}`);
|
|
55
|
+
}
|
|
56
|
+
const expiresIn = answer["expires_in"];
|
|
57
|
+
return {
|
|
58
|
+
accessToken: answer["access_token"],
|
|
59
|
+
expiresAt: typeof expiresIn === "number" ? Date.now() + expiresIn * 1e3 : void 0
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
async findTokenEndpoint() {
|
|
63
|
+
const remote = new URL(this.remoteUrl);
|
|
64
|
+
const resourceMetadata = await firstJson(wellKnownUrls(remote, "oauth-protected-resource"));
|
|
65
|
+
const resource = typeof resourceMetadata?.["resource"] === "string" ? resourceMetadata["resource"] : this.remoteUrl;
|
|
66
|
+
if (this.credentials.tokenUrl) return { url: this.credentials.tokenUrl, resource, postsSecret: false };
|
|
67
|
+
const servers = resourceMetadata?.["authorization_servers"];
|
|
68
|
+
const issuer = new URL(Array.isArray(servers) && typeof servers[0] === "string" ? servers[0] : remote.origin);
|
|
69
|
+
const serverMetadata = await firstJson([
|
|
70
|
+
...wellKnownUrls(issuer, "oauth-authorization-server"),
|
|
71
|
+
...wellKnownUrls(issuer, "openid-configuration"),
|
|
72
|
+
new URL(`${issuer.href.replace(/\/$/, "")}/.well-known/openid-configuration`)
|
|
73
|
+
]);
|
|
74
|
+
const tokenUrl = serverMetadata?.["token_endpoint"];
|
|
75
|
+
if (typeof tokenUrl !== "string") {
|
|
76
|
+
throw new RemoteAuthError(this.appId, `no token endpoint found for ${issuer.href}; set remoteAuth.tokenUrl`);
|
|
77
|
+
}
|
|
78
|
+
const methods = serverMetadata?.["token_endpoint_auth_methods_supported"];
|
|
79
|
+
const postsSecret = Array.isArray(methods) && !methods.includes("client_secret_basic") && methods.includes("client_secret_post");
|
|
80
|
+
return { url: tokenUrl, resource, postsSecret };
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
function isFresh(token) {
|
|
84
|
+
return token.expiresAt === void 0 || token.expiresAt - EXPIRY_MARGIN_MS > Date.now();
|
|
85
|
+
}
|
|
86
|
+
function wellKnownUrls(url, name) {
|
|
87
|
+
const path = url.pathname.replace(/\/$/, "");
|
|
88
|
+
const root = new URL(`/.well-known/${name}`, url.origin);
|
|
89
|
+
return path ? [new URL(`/.well-known/${name}${path}`, url.origin), root] : [root];
|
|
90
|
+
}
|
|
91
|
+
async function firstJson(urls) {
|
|
92
|
+
for (const url of urls) {
|
|
93
|
+
const response = await fetch(url, { headers: { accept: "application/json" } }).catch(() => void 0);
|
|
94
|
+
if (!response?.ok) continue;
|
|
95
|
+
const json = await response.json().catch(() => void 0);
|
|
96
|
+
if (json && typeof json === "object") return json;
|
|
97
|
+
}
|
|
98
|
+
return void 0;
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
RemoteOAuthTokenSource
|
|
102
|
+
};
|
|
@@ -1,20 +1,50 @@
|
|
|
1
1
|
// libs/sdk/src/remote-mcp/remote-request-headers.ts
|
|
2
2
|
import { AsyncLocalStorage } from "@frontmcp/utils";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { retryAfterMsOf } from "../transport/mcp-20260728/client/mcp-stateless.client.mjs";
|
|
4
|
+
import { remoteHttpFailureOf } from "./resilience/retry.mjs";
|
|
5
|
+
var requestScopes = new AsyncLocalStorage();
|
|
6
|
+
async function withRemoteRequestHeaders(headers, operation) {
|
|
7
|
+
const scope = { headers };
|
|
8
|
+
try {
|
|
9
|
+
return await requestScopes.run(scope, operation);
|
|
10
|
+
} catch (error) {
|
|
11
|
+
throw withRefusal(error, scope.refusal);
|
|
12
|
+
}
|
|
6
13
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
function withRefusal(error, refusal) {
|
|
15
|
+
const failure = remoteHttpFailureOf(error);
|
|
16
|
+
if (refusal?.retryAfterMs === void 0 || failure?.status !== refusal.status || failure.retryAfterMs !== void 0) {
|
|
17
|
+
return error;
|
|
18
|
+
}
|
|
19
|
+
return Object.assign(error, { http: refusal });
|
|
20
|
+
}
|
|
21
|
+
function createRemoteRequestFetch(connectionCarriesHeaders, oauth) {
|
|
22
|
+
return async (input, init) => {
|
|
23
|
+
const scope = requestScopes.getStore();
|
|
24
|
+
const extra = scope?.headers ?? {};
|
|
25
|
+
const carriesCredentials = connectionCarriesHeaders || oauth !== void 0 || Object.keys(extra).length > 0;
|
|
26
|
+
const send = async () => {
|
|
27
|
+
const credentials = oauth ? { authorization: await oauth.authorization() } : {};
|
|
28
|
+
return carriesCredentials ? fetch(input, withHeaders(init, { ...credentials, ...extra })) : fetch(input, init);
|
|
29
|
+
};
|
|
30
|
+
let response = await send();
|
|
31
|
+
if (oauth && response.status === 401) {
|
|
32
|
+
await response.body?.cancel().catch(() => void 0);
|
|
33
|
+
oauth.invalidate();
|
|
34
|
+
response = await send();
|
|
35
|
+
}
|
|
36
|
+
if (scope && response.status >= 400) {
|
|
37
|
+
scope.refusal = { status: response.status, retryAfterMs: retryAfterMsOf(response.headers.get("retry-after")) };
|
|
38
|
+
}
|
|
39
|
+
return response;
|
|
16
40
|
};
|
|
17
41
|
}
|
|
42
|
+
function withHeaders(init, extra) {
|
|
43
|
+
const headers = new Headers(init?.headers);
|
|
44
|
+
for (const [name, value] of Object.entries(extra)) headers.set(name, value);
|
|
45
|
+
const redirect = init?.redirect === "error" ? "error" : "manual";
|
|
46
|
+
return { ...init, headers, redirect };
|
|
47
|
+
}
|
|
18
48
|
export {
|
|
19
49
|
createRemoteRequestFetch,
|
|
20
50
|
withRemoteRequestHeaders
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// libs/sdk/src/remote-mcp/resilience/circuit-breaker.ts
|
|
2
|
+
import { PublicMcpError } from "../../errors/mcp.error.mjs";
|
|
2
3
|
var DEFAULT_OPTIONS = {
|
|
3
4
|
failureThreshold: 5,
|
|
4
5
|
resetTimeoutMs: 3e4,
|
|
@@ -133,12 +134,12 @@ var CircuitBreaker = class {
|
|
|
133
134
|
this.failures = this.failures.filter((f) => f.timestamp > cutoff);
|
|
134
135
|
}
|
|
135
136
|
};
|
|
136
|
-
var CircuitOpenError = class extends
|
|
137
|
+
var CircuitOpenError = class extends PublicMcpError {
|
|
137
138
|
appId;
|
|
138
139
|
nextAttemptTime;
|
|
139
140
|
constructor(appId, nextAttemptTime) {
|
|
140
141
|
const waitTime = nextAttemptTime ? Math.ceil((nextAttemptTime - Date.now()) / 1e3) : 0;
|
|
141
|
-
super(`Circuit breaker is open for ${appId}. Retry in ${waitTime}s
|
|
142
|
+
super(`Circuit breaker is open for ${appId}. Retry in ${waitTime}s`, "REMOTE_CIRCUIT_OPEN", 503);
|
|
142
143
|
this.name = "CircuitOpenError";
|
|
143
144
|
this.appId = appId;
|
|
144
145
|
this.nextAttemptTime = nextAttemptTime;
|
|
@@ -27,15 +27,16 @@ import {
|
|
|
27
27
|
resolveOutputBudget
|
|
28
28
|
} from "../../common/index.mjs";
|
|
29
29
|
import { availabilityForCall, callSurfaceOf, entryUnavailableError } from "../../common/availability/index.mjs";
|
|
30
|
+
import { getPinnedPublicUrl } from "../../common/utils/path.utils.mjs";
|
|
30
31
|
import { runOnSurface } from "../../context/call-surface.mjs";
|
|
31
32
|
import {
|
|
32
33
|
InvalidInputError,
|
|
33
34
|
InvalidMethodError,
|
|
34
|
-
InvalidOutputError,
|
|
35
35
|
isClientFacingError,
|
|
36
36
|
ResourceNotFoundError,
|
|
37
37
|
ResourceReadError
|
|
38
38
|
} from "../../errors/index.mjs";
|
|
39
|
+
import { invalidOutputFromParseFailure } from "../../errors/mcp.error.mjs";
|
|
39
40
|
import { ResolvedEntries } from "../../flows/resolved-entries.mjs";
|
|
40
41
|
import { entryClassHooksJoin } from "../../hooks/entry-class-hooks.mjs";
|
|
41
42
|
import { hooksBoundTo } from "../../hooks/hooks.utils.mjs";
|
|
@@ -188,7 +189,8 @@ var ReadResourceFlow = class extends FlowBase {
|
|
|
188
189
|
throw new ResourceNotFoundError(uri);
|
|
189
190
|
}
|
|
190
191
|
const { handleUIResourceRead } = await import("../../tool/ui/ui-resource.handler.mjs");
|
|
191
|
-
const
|
|
192
|
+
const serverUrl = this.tryGetContext()?.metadata.serverUrl ?? getPinnedPublicUrl();
|
|
193
|
+
const uiResult = handleUIResourceRead(uri, this.scope.toolUI, platformType, serverUrl);
|
|
192
194
|
if (uiResult.handled) {
|
|
193
195
|
if (uiResult.error) {
|
|
194
196
|
this.logger.warn(`findResource: UI resource error - ${uiResult.error}`);
|
|
@@ -378,7 +380,7 @@ var ReadResourceFlow = class extends FlowBase {
|
|
|
378
380
|
resource: resource.metadata.name,
|
|
379
381
|
errors: parseResult.error
|
|
380
382
|
});
|
|
381
|
-
throw
|
|
383
|
+
throw invalidOutputFromParseFailure("Resource", parseResult.error);
|
|
382
384
|
}
|
|
383
385
|
this.respond(parseResult.data);
|
|
384
386
|
this.logger.verbose("finalize:done");
|
|
@@ -440,7 +442,7 @@ ReadResourceFlow = __decorateClass([
|
|
|
440
442
|
plan,
|
|
441
443
|
inputSchema,
|
|
442
444
|
outputSchema,
|
|
443
|
-
access: "
|
|
445
|
+
access: "public"
|
|
444
446
|
})
|
|
445
447
|
], ReadResourceFlow);
|
|
446
448
|
export {
|
|
@@ -23,9 +23,11 @@ import {
|
|
|
23
23
|
ListResourceTemplatesRequestSchema,
|
|
24
24
|
ListResourceTemplatesResultSchema
|
|
25
25
|
} from "@frontmcp/protocol";
|
|
26
|
+
import { annotationsForClient, callerClientProfile } from "../../answer/index.mjs";
|
|
26
27
|
import { callSurfaceOf, isOfferedOnSurface } from "../../common/availability/index.mjs";
|
|
27
28
|
import { InvalidInputError, InvalidMethodError } from "../../errors/index.mjs";
|
|
28
29
|
import { enabledItems, SURFACE_META_KEY, surfaceHash } from "../../surface/index.mjs";
|
|
30
|
+
import { isListedByAuthorities } from "../../surface/entry-authorized.mjs";
|
|
29
31
|
var inputSchema = z.object({
|
|
30
32
|
request: ListResourceTemplatesRequestSchema,
|
|
31
33
|
ctx: z.unknown()
|
|
@@ -152,9 +154,15 @@ var ResourceTemplatesListFlow = class extends FlowBase {
|
|
|
152
154
|
const metadata = item.template.metadata;
|
|
153
155
|
const authorities = metadata["authorities"];
|
|
154
156
|
if (!authorities) return item;
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
const listed = await isListedByAuthorities(
|
|
158
|
+
engine,
|
|
159
|
+
ctxBuilder,
|
|
160
|
+
authorities,
|
|
161
|
+
authInfo,
|
|
162
|
+
item.template.fullName || item.template.name,
|
|
163
|
+
this.logger
|
|
164
|
+
);
|
|
165
|
+
return listed ? item : null;
|
|
158
166
|
})
|
|
159
167
|
);
|
|
160
168
|
this.state.set(
|
|
@@ -196,6 +204,11 @@ var ResourceTemplatesListFlow = class extends FlowBase {
|
|
|
196
204
|
this.logger.verbose("parseTemplates:start");
|
|
197
205
|
try {
|
|
198
206
|
const resolved = this.state.required.resolvedTemplates;
|
|
207
|
+
const annotationsMode = callerClientProfile(this.scope.metadata.clients, {
|
|
208
|
+
context: this.tryGetContext(),
|
|
209
|
+
authInfo: this.input.ctx?.authInfo,
|
|
210
|
+
notifications: this.scope.notifications
|
|
211
|
+
})?.annotations;
|
|
199
212
|
const resourceTemplates = resolved.filter(({ template }) => template.uriTemplate != null).map(({ finalName, template }) => {
|
|
200
213
|
const uriTemplate = template.uriTemplate;
|
|
201
214
|
const item = {
|
|
@@ -206,12 +219,14 @@ var ResourceTemplatesListFlow = class extends FlowBase {
|
|
|
206
219
|
mimeType: template.metadata.mimeType,
|
|
207
220
|
icons: template.metadata.icons
|
|
208
221
|
};
|
|
222
|
+
const annotations = annotationsForClient(template.metadata.annotations, annotationsMode, false);
|
|
223
|
+
if (annotations) item.annotations = annotations;
|
|
224
|
+
const metaFromMetadata = template.metadata._meta;
|
|
225
|
+
if (metaFromMetadata && Object.keys(metaFromMetadata).length > 0) item._meta = { ...metaFromMetadata };
|
|
209
226
|
if (template.metadata.mimeType === "text/html;profile=mcp-app") {
|
|
210
|
-
item._meta
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
};
|
|
227
|
+
const rawUi = item._meta?.["ui"];
|
|
228
|
+
const existingUi = rawUi !== null && typeof rawUi === "object" && !Array.isArray(rawUi) ? rawUi : {};
|
|
229
|
+
item._meta = { ...item._meta ?? {}, ui: { ...existingUi, resourceUri: uriTemplate } };
|
|
215
230
|
}
|
|
216
231
|
return item;
|
|
217
232
|
});
|
|
@@ -258,7 +273,7 @@ ResourceTemplatesListFlow = __decorateClass([
|
|
|
258
273
|
plan,
|
|
259
274
|
inputSchema,
|
|
260
275
|
outputSchema,
|
|
261
|
-
access: "
|
|
276
|
+
access: "public"
|
|
262
277
|
})
|
|
263
278
|
], ResourceTemplatesListFlow);
|
|
264
279
|
export {
|
|
@@ -26,6 +26,7 @@ import { InvalidInputError, InvalidMethodError } from "../../errors/index.mjs";
|
|
|
26
26
|
import { SEP_2640_META_NAMESPACE } from "../../skill/sep-2640/sep-2640.constants.mjs";
|
|
27
27
|
import { filterServableSkills } from "../../skill/skill-filter.helper.mjs";
|
|
28
28
|
import { enabledItems, SURFACE_META_KEY, surfaceHash } from "../../surface/index.mjs";
|
|
29
|
+
import { isListedByAuthorities } from "../../surface/entry-authorized.mjs";
|
|
29
30
|
var inputSchema = z.object({
|
|
30
31
|
request: ListResourcesRequestSchema,
|
|
31
32
|
ctx: z.unknown()
|
|
@@ -159,9 +160,15 @@ var ResourcesListFlow = class extends FlowBase {
|
|
|
159
160
|
const metadata = item.resource.metadata;
|
|
160
161
|
const authorities = metadata["authorities"];
|
|
161
162
|
if (!authorities) return item;
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
const listed = await isListedByAuthorities(
|
|
164
|
+
engine,
|
|
165
|
+
ctxBuilder,
|
|
166
|
+
authorities,
|
|
167
|
+
authInfo,
|
|
168
|
+
item.resource.fullName || item.resource.name,
|
|
169
|
+
this.logger
|
|
170
|
+
);
|
|
171
|
+
return listed ? item : null;
|
|
165
172
|
})
|
|
166
173
|
);
|
|
167
174
|
this.state.set(
|
|
@@ -312,7 +319,7 @@ ResourcesListFlow = __decorateClass([
|
|
|
312
319
|
plan,
|
|
313
320
|
inputSchema,
|
|
314
321
|
outputSchema,
|
|
315
|
-
access: "
|
|
322
|
+
access: "public"
|
|
316
323
|
})
|
|
317
324
|
], ResourcesListFlow);
|
|
318
325
|
export {
|
|
@@ -257,7 +257,7 @@ var HttpRequestFlow = class extends FlowBase {
|
|
|
257
257
|
if (ctx) {
|
|
258
258
|
const { token, user } = result.authorization;
|
|
259
259
|
const presentedSessionId = this.servesProtocol20260728() ? void 0 : sessionIdPresentedBy(request);
|
|
260
|
-
ctx.
|
|
260
|
+
ctx.recordAuthorization(authInfoFromAuthorization(result.authorization, presentedSessionId));
|
|
261
261
|
await this.bindOrchestrationAccessor(ctx, token, user);
|
|
262
262
|
}
|
|
263
263
|
}
|
|
@@ -9,10 +9,14 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
// libs/sdk/src/scope/observability-scope.helper.ts
|
|
12
|
+
import { getRuntimeContext } from "@frontmcp/utils";
|
|
12
13
|
import { FrontMcpContextStorage } from "../context/index.mjs";
|
|
13
14
|
import LoggerRegistry from "../logger/logger.registry.mjs";
|
|
14
15
|
import { probeOptionalDependency, requireOptionalModule } from "./optional-dependency.util.mjs";
|
|
15
16
|
import { hasRegisteredTracerProvider, registerExportingTracerProvider } from "./tracer-provider.utils.mjs";
|
|
17
|
+
function defaultLogSinks() {
|
|
18
|
+
return [{ type: getRuntimeContext().runtime === "browser" ? "console" : "stdout" }];
|
|
19
|
+
}
|
|
16
20
|
function observabilityPlugins({
|
|
17
21
|
config: observabilityConfig,
|
|
18
22
|
logger,
|
|
@@ -61,7 +65,8 @@ function observabilityPlugins({
|
|
|
61
65
|
if (loggerRegistry && typeof loggerRegistry.addTransport === "function" && !loggerRegistry._hasStructuredTransport) {
|
|
62
66
|
const rawLogging = pluginOptions.logging;
|
|
63
67
|
const loggingOpts = rawLogging === true ? {} : typeof rawLogging === "object" ? rawLogging : {};
|
|
64
|
-
const
|
|
68
|
+
const sinkConfigs = loggingOpts["sinks"] ?? (rawLogging === void 0 ? [] : defaultLogSinks());
|
|
69
|
+
const sinks = createSinks(sinkConfigs);
|
|
65
70
|
let contextStorage;
|
|
66
71
|
try {
|
|
67
72
|
contextStorage = globalProviders.get(FrontMcpContextStorage);
|