@frontmcp/sdk 0.12.2 → 1.0.0-beta.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/adapter/adapter.instance.d.ts +6 -0
- package/adapter/adapter.instance.d.ts.map +1 -1
- package/agent/adapters/adapter.factory.d.ts +7 -9
- package/agent/adapters/adapter.factory.d.ts.map +1 -1
- package/agent/adapters/anthropic.adapter.d.ts +151 -0
- package/agent/adapters/anthropic.adapter.d.ts.map +1 -0
- package/agent/adapters/base.adapter.d.ts.map +1 -1
- package/agent/adapters/index.d.ts +38 -24
- package/agent/adapters/index.d.ts.map +1 -1
- package/agent/adapters/openai.adapter.d.ts +288 -0
- package/agent/adapters/openai.adapter.d.ts.map +1 -0
- package/agent/adapters/providers/index.d.ts +9 -7
- package/agent/adapters/providers/index.d.ts.map +1 -1
- package/agent/adapters/providers/types.d.ts +5 -1
- package/agent/adapters/providers/types.d.ts.map +1 -1
- package/agent/agent-execution-loop.d.ts.map +1 -1
- package/agent/agent.instance.d.ts +5 -2
- package/agent/agent.instance.d.ts.map +1 -1
- package/agent/agent.registry.d.ts +1 -1
- package/agent/agent.registry.d.ts.map +1 -1
- package/agent/agent.scope.d.ts +38 -46
- package/agent/agent.scope.d.ts.map +1 -1
- package/agent/flows/call-agent.flow.d.ts +12 -3
- package/agent/flows/call-agent.flow.d.ts.map +1 -1
- package/agent/index.d.ts +12 -6
- package/agent/index.d.ts.map +1 -1
- package/app/app.registry.d.ts.map +1 -1
- package/app/app.utils.d.ts.map +1 -1
- package/app/instances/app.esm.instance.d.ts +77 -0
- package/app/instances/app.esm.instance.d.ts.map +1 -0
- package/app/instances/esm-normalize.utils.d.ts +72 -0
- package/app/instances/esm-normalize.utils.d.ts.map +1 -0
- package/app/instances/index.d.ts +1 -0
- package/app/instances/index.d.ts.map +1 -1
- package/auth/auth.registry.d.ts.map +1 -1
- package/auth/cimd/index.d.ts +1 -1
- package/auth/cimd/index.d.ts.map +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +2 -3
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/instances/instance.remote-primary-auth.d.ts +0 -1
- package/auth/instances/instance.remote-primary-auth.d.ts.map +1 -1
- package/auth/session/record/session.base.d.ts.map +1 -1
- package/auth/session/transport-session.manager.d.ts.map +1 -1
- package/builtin/config/config.plugin.d.ts.map +1 -1
- package/builtin/config/index.d.ts +2 -1
- package/builtin/config/index.d.ts.map +1 -1
- package/builtin/config/providers/config-loader.d.ts.map +1 -1
- package/builtin/config/providers/env-loader.d.ts.map +1 -1
- package/common/decorators/adapter.decorator.d.ts +1 -1
- package/common/decorators/adapter.decorator.d.ts.map +1 -1
- package/common/decorators/agent.decorator.d.ts +13 -4
- package/common/decorators/agent.decorator.d.ts.map +1 -1
- package/common/decorators/app.decorator.d.ts +33 -3
- package/common/decorators/app.decorator.d.ts.map +1 -1
- package/common/decorators/auth-provider.decorator.d.ts +1 -1
- package/common/decorators/auth-provider.decorator.d.ts.map +1 -1
- package/common/decorators/flow.decorator.d.ts +1 -1
- package/common/decorators/flow.decorator.d.ts.map +1 -1
- package/common/decorators/front-mcp.decorator.d.ts.map +1 -1
- package/common/decorators/job.decorator.d.ts +11 -1
- package/common/decorators/job.decorator.d.ts.map +1 -1
- package/common/decorators/logger.decorator.d.ts +1 -1
- package/common/decorators/logger.decorator.d.ts.map +1 -1
- package/common/decorators/prompt.decorator.d.ts +13 -3
- package/common/decorators/prompt.decorator.d.ts.map +1 -1
- package/common/decorators/provider.decorator.d.ts +1 -1
- package/common/decorators/provider.decorator.d.ts.map +1 -1
- package/common/decorators/resource.decorator.d.ts +12 -2
- package/common/decorators/resource.decorator.d.ts.map +1 -1
- package/common/decorators/skill.decorator.d.ts +11 -1
- package/common/decorators/skill.decorator.d.ts.map +1 -1
- package/common/decorators/tool.decorator.d.ts +20 -44
- package/common/decorators/tool.decorator.d.ts.map +1 -1
- package/common/dynamic/dynamic.utils.d.ts +1 -1
- package/common/entries/adapter.entry.d.ts.map +1 -1
- package/common/entries/agent.entry.d.ts +5 -7
- package/common/entries/agent.entry.d.ts.map +1 -1
- package/common/entries/logger.entry.d.ts.map +1 -1
- package/common/entries/prompt.entry.d.ts +3 -3
- package/common/entries/prompt.entry.d.ts.map +1 -1
- package/common/entries/resource.entry.d.ts +3 -3
- package/common/entries/resource.entry.d.ts.map +1 -1
- package/common/entries/tool.entry.d.ts +15 -4
- package/common/entries/tool.entry.d.ts.map +1 -1
- package/common/interfaces/adapter.interface.d.ts +15 -0
- package/common/interfaces/adapter.interface.d.ts.map +1 -1
- package/common/interfaces/agent.interface.d.ts +2 -2
- package/common/interfaces/agent.interface.d.ts.map +1 -1
- package/common/interfaces/auth-hook.interface.d.ts.map +1 -1
- package/common/interfaces/execution-context.interface.d.ts +1 -2
- package/common/interfaces/execution-context.interface.d.ts.map +1 -1
- package/common/interfaces/flow.interface.d.ts.map +1 -1
- package/common/interfaces/front-mcp.interface.d.ts.map +1 -1
- package/common/interfaces/internal/registry.interface.d.ts +3 -5
- package/common/interfaces/internal/registry.interface.d.ts.map +1 -1
- package/common/interfaces/job.interface.d.ts +1 -1
- package/common/interfaces/job.interface.d.ts.map +1 -1
- package/common/interfaces/prompt.interface.d.ts +3 -3
- package/common/interfaces/prompt.interface.d.ts.map +1 -1
- package/common/interfaces/resource.interface.d.ts +1 -1
- package/common/interfaces/resource.interface.d.ts.map +1 -1
- package/common/interfaces/server.interface.d.ts +1 -1
- package/common/interfaces/server.interface.d.ts.map +1 -1
- package/common/interfaces/skill.interface.d.ts +1 -1
- package/common/interfaces/skill.interface.d.ts.map +1 -1
- package/common/interfaces/tool.interface.d.ts +1 -1
- package/common/interfaces/tool.interface.d.ts.map +1 -1
- package/common/interfaces/workflow.interface.d.ts +1 -1
- package/common/interfaces/workflow.interface.d.ts.map +1 -1
- package/common/metadata/adapter.metadata.d.ts.map +1 -1
- package/common/metadata/agent.metadata.d.ts +56 -7
- package/common/metadata/agent.metadata.d.ts.map +1 -1
- package/common/metadata/app-filter.metadata.d.ts +78 -0
- package/common/metadata/app-filter.metadata.d.ts.map +1 -0
- package/common/metadata/app.metadata.d.ts +198 -76
- package/common/metadata/app.metadata.d.ts.map +1 -1
- package/common/metadata/auth-provider.metadata.d.ts.map +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +2143 -426
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/metadata/index.d.ts +2 -0
- package/common/metadata/index.d.ts.map +1 -1
- package/common/metadata/job.metadata.d.ts +1 -1
- package/common/metadata/logger.metadata.d.ts.map +1 -1
- package/common/metadata/plugin.metadata.d.ts +1 -1
- package/common/metadata/prompt.metadata.d.ts +2 -2
- package/common/metadata/prompt.metadata.d.ts.map +1 -1
- package/common/metadata/remote-primitive.metadata.d.ts +35 -0
- package/common/metadata/remote-primitive.metadata.d.ts.map +1 -0
- package/common/metadata/resource.metadata.d.ts +1 -1
- package/common/metadata/resource.metadata.d.ts.map +1 -1
- package/common/metadata/tool-ui.metadata.d.ts +1 -1
- package/common/metadata/tool-ui.metadata.d.ts.map +1 -1
- package/common/metadata/tool.metadata.d.ts +86 -19
- package/common/metadata/tool.metadata.d.ts.map +1 -1
- package/common/metadata/workflow.metadata.d.ts +1 -1
- package/common/records/agent.record.d.ts +43 -2
- package/common/records/agent.record.d.ts.map +1 -1
- package/common/records/flow.record.d.ts.map +1 -1
- package/common/records/job.record.d.ts +35 -2
- package/common/records/job.record.d.ts.map +1 -1
- package/common/records/prompt.record.d.ts +35 -2
- package/common/records/prompt.record.d.ts.map +1 -1
- package/common/records/resource.record.d.ts +35 -2
- package/common/records/resource.record.d.ts.map +1 -1
- package/common/records/skill.record.d.ts +44 -2
- package/common/records/skill.record.d.ts.map +1 -1
- package/common/records/tool.record.d.ts +35 -2
- package/common/records/tool.record.d.ts.map +1 -1
- package/common/records/workflow.record.d.ts +35 -2
- package/common/records/workflow.record.d.ts.map +1 -1
- package/common/schemas/annotated-class.schema.d.ts +2 -2
- package/common/schemas/annotated-class.schema.d.ts.map +1 -1
- package/common/schemas/http-input.schema.d.ts.map +1 -1
- package/common/schemas/http-output.schema.d.ts +2 -2
- package/common/schemas/http-output.schema.d.ts.map +1 -1
- package/common/tokens/adapter.tokens.d.ts.map +1 -1
- package/common/tokens/agent.tokens.d.ts +3 -0
- package/common/tokens/agent.tokens.d.ts.map +1 -1
- package/common/tokens/app.tokens.d.ts.map +1 -1
- package/common/tokens/auth-provider.tokens.d.ts.map +1 -1
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/tokens/logger.tokens.d.ts.map +1 -1
- package/common/tokens/prompt.tokens.d.ts +1 -0
- package/common/tokens/prompt.tokens.d.ts.map +1 -1
- package/common/tokens/provider.tokens.d.ts.map +1 -1
- package/common/tokens/tool.tokens.d.ts +3 -2
- package/common/tokens/tool.tokens.d.ts.map +1 -1
- package/common/types/common.types.d.ts +2 -2
- package/common/types/common.types.d.ts.map +1 -1
- package/common/types/options/auth/app-auth.schema.d.ts +2 -271
- package/common/types/options/auth/app-auth.schema.d.ts.map +1 -1
- package/common/types/options/auth/index.d.ts +6 -6
- package/common/types/options/auth/index.d.ts.map +1 -1
- package/common/types/options/auth/interfaces.d.ts +1 -430
- package/common/types/options/auth/interfaces.d.ts.map +1 -1
- package/common/types/options/auth/orchestrated.schema.d.ts +2 -457
- package/common/types/options/auth/orchestrated.schema.d.ts.map +1 -1
- package/common/types/options/auth/public.schema.d.ts +2 -21
- package/common/types/options/auth/public.schema.d.ts.map +1 -1
- package/common/types/options/auth/schema.d.ts +2 -280
- package/common/types/options/auth/schema.d.ts.map +1 -1
- package/common/types/options/auth/shared.schemas.d.ts +2 -2
- package/common/types/options/auth/shared.schemas.d.ts.map +1 -1
- package/common/types/options/auth/transparent.schema.d.ts +2 -35
- package/common/types/options/auth/transparent.schema.d.ts.map +1 -1
- package/common/types/options/auth/typecheck.d.ts.map +1 -1
- package/common/types/options/auth/utils.d.ts +1 -32
- package/common/types/options/auth/utils.d.ts.map +1 -1
- package/common/types/options/elicitation/schema.d.ts +2 -4
- package/common/types/options/elicitation/schema.d.ts.map +1 -1
- package/common/types/options/ext-apps/index.d.ts +1 -1
- package/common/types/options/ext-apps/index.d.ts.map +1 -1
- package/common/types/options/ext-apps/interfaces.d.ts +55 -0
- package/common/types/options/ext-apps/interfaces.d.ts.map +1 -1
- package/common/types/options/ext-apps/schema.d.ts +3 -1
- package/common/types/options/ext-apps/schema.d.ts.map +1 -1
- package/common/types/options/ext-apps/typecheck.d.ts +2 -0
- package/common/types/options/ext-apps/typecheck.d.ts.map +1 -0
- package/common/types/options/http/schema.d.ts +3 -1
- package/common/types/options/http/schema.d.ts.map +1 -1
- package/common/types/options/http/typecheck.d.ts +2 -0
- package/common/types/options/http/typecheck.d.ts.map +1 -0
- package/common/types/options/logging/schema.d.ts +3 -2
- package/common/types/options/logging/schema.d.ts.map +1 -1
- package/common/types/options/redis/index.d.ts +1 -1
- package/common/types/options/redis/index.d.ts.map +1 -1
- package/common/types/options/redis/interfaces.d.ts +4 -0
- package/common/types/options/redis/interfaces.d.ts.map +1 -1
- package/common/types/options/redis/schema.d.ts +7 -4
- package/common/types/options/redis/schema.d.ts.map +1 -1
- package/common/types/options/redis/typecheck.d.ts +2 -0
- package/common/types/options/redis/typecheck.d.ts.map +1 -0
- package/common/types/options/server-info/interfaces.d.ts +1 -1
- package/common/types/options/server-info/interfaces.d.ts.map +1 -1
- package/common/types/options/skills-http/schema.d.ts +3 -2
- package/common/types/options/skills-http/schema.d.ts.map +1 -1
- package/common/types/options/skills-http/typecheck.d.ts +2 -0
- package/common/types/options/skills-http/typecheck.d.ts.map +1 -0
- package/common/types/options/sqlite/index.d.ts +1 -0
- package/common/types/options/sqlite/index.d.ts.map +1 -1
- package/common/types/options/sqlite/interfaces.d.ts +25 -0
- package/common/types/options/sqlite/interfaces.d.ts.map +1 -0
- package/common/types/options/sqlite/schema.d.ts +3 -1
- package/common/types/options/sqlite/schema.d.ts.map +1 -1
- package/common/types/options/sqlite/typecheck.d.ts +2 -0
- package/common/types/options/sqlite/typecheck.d.ts.map +1 -0
- package/common/types/options/transport/schema.d.ts.map +1 -1
- package/common/utils/index.d.ts +2 -0
- package/common/utils/index.d.ts.map +1 -1
- package/common/utils/primitive-filter.d.ts +24 -0
- package/common/utils/primitive-filter.d.ts.map +1 -0
- package/common/utils/validate-remote-url.d.ts +13 -0
- package/common/utils/validate-remote-url.d.ts.map +1 -0
- package/context/frontmcp-context-storage.d.ts +1 -6
- package/context/frontmcp-context-storage.d.ts.map +1 -1
- package/context/frontmcp-context.d.ts +1 -1
- package/context/frontmcp-context.d.ts.map +1 -1
- package/context/index.d.ts +5 -4
- package/context/index.d.ts.map +1 -1
- package/direct/client.types.d.ts +11 -1
- package/direct/client.types.d.ts.map +1 -1
- package/direct/connect.d.ts +4 -1
- package/direct/connect.d.ts.map +1 -1
- package/direct/direct-server.d.ts +1 -1
- package/direct/direct-server.d.ts.map +1 -1
- package/direct/direct.types.d.ts +1 -1
- package/direct/direct.types.d.ts.map +1 -1
- package/direct/index.d.ts +1 -1
- package/direct/index.d.ts.map +1 -1
- package/direct/llm-platform.d.ts +3 -3
- package/direct/llm-platform.d.ts.map +1 -1
- package/elicitation/send-elicitation-result.tool.d.ts.map +1 -1
- package/elicitation/store/elicitation-encryption.d.ts.map +1 -1
- package/errors/error-handler.d.ts.map +1 -1
- package/errors/esm.errors.d.ts +59 -0
- package/errors/esm.errors.d.ts.map +1 -0
- package/errors/index.d.ts +5 -2
- package/errors/index.d.ts.map +1 -1
- package/errors/mcp.error.d.ts.map +1 -1
- package/esm/index.mjs +5904 -2414
- package/esm-loader/app-helpers.d.ts +60 -0
- package/esm-loader/app-helpers.d.ts.map +1 -0
- package/esm-loader/esm-auth.types.d.ts +53 -0
- package/esm-loader/esm-auth.types.d.ts.map +1 -0
- package/esm-loader/esm-cache.d.ts +87 -0
- package/esm-loader/esm-cache.d.ts.map +1 -0
- package/esm-loader/esm-manifest.d.ts +82 -0
- package/esm-loader/esm-manifest.d.ts.map +1 -0
- package/esm-loader/esm-module-loader.d.ts +100 -0
- package/esm-loader/esm-module-loader.d.ts.map +1 -0
- package/esm-loader/factories/esm-context-factories.d.ts +52 -0
- package/esm-loader/factories/esm-context-factories.d.ts.map +1 -0
- package/esm-loader/factories/esm-instance-factories.d.ts +48 -0
- package/esm-loader/factories/esm-instance-factories.d.ts.map +1 -0
- package/esm-loader/factories/esm-record-builders.d.ts +72 -0
- package/esm-loader/factories/esm-record-builders.d.ts.map +1 -0
- package/esm-loader/factories/index.d.ts +4 -0
- package/esm-loader/factories/index.d.ts.map +1 -0
- package/esm-loader/index.d.ts +10 -0
- package/esm-loader/index.d.ts.map +1 -0
- package/esm-loader/package-specifier.d.ts +60 -0
- package/esm-loader/package-specifier.d.ts.map +1 -0
- package/esm-loader/semver.utils.d.ts +41 -0
- package/esm-loader/semver.utils.d.ts.map +1 -0
- package/esm-loader/version-poller.d.ts +101 -0
- package/esm-loader/version-poller.d.ts.map +1 -0
- package/esm-loader/version-resolver.d.ts +47 -0
- package/esm-loader/version-resolver.d.ts.map +1 -0
- package/ext-apps/ext-apps.handler.d.ts.map +1 -1
- package/front-mcp/front-mcp.d.ts +10 -0
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/front-mcp/front-mcp.providers.d.ts +860 -178
- package/front-mcp/front-mcp.providers.d.ts.map +1 -1
- package/index.d.ts +11 -5
- package/index.d.ts.map +1 -1
- package/index.js +6395 -2834
- package/job/execution/index.d.ts +2 -1
- package/job/execution/index.d.ts.map +1 -1
- package/job/job.instance.d.ts +4 -1
- package/job/job.instance.d.ts.map +1 -1
- package/job/job.utils.d.ts.map +1 -1
- package/job/tools/list-jobs.tool.d.ts +1 -0
- package/job/tools/list-jobs.tool.d.ts.map +1 -1
- package/logger/instances/instance.console-logger.d.ts +0 -1
- package/logger/instances/instance.console-logger.d.ts.map +1 -1
- package/logger/instances/instance.logger.d.ts.map +1 -1
- package/logger/logger.registry.d.ts.map +1 -1
- package/logger/logger.types.d.ts.map +1 -1
- package/notification/notification.service.d.ts +4 -4
- package/notification/notification.service.d.ts.map +1 -1
- package/package.json +29 -17
- package/prompt/flows/get-prompt.flow.d.ts +1 -1
- package/prompt/flows/get-prompt.flow.d.ts.map +1 -1
- package/prompt/prompt.registry.d.ts +7 -1
- package/prompt/prompt.registry.d.ts.map +1 -1
- package/prompt/prompt.utils.d.ts +1 -1
- package/prompt/prompt.utils.d.ts.map +1 -1
- package/provider/provider.registry.d.ts.map +1 -1
- package/provider/provider.types.d.ts +0 -13
- package/provider/provider.types.d.ts.map +1 -1
- package/rate-limit/index.d.ts +13 -0
- package/rate-limit/index.d.ts.map +1 -0
- package/remote-mcp/cache/index.d.ts +2 -1
- package/remote-mcp/cache/index.d.ts.map +1 -1
- package/remote-mcp/factories/context-factories.d.ts +1 -1
- package/remote-mcp/factories/context-factories.d.ts.map +1 -1
- package/remote-mcp/factories/instance-factories.d.ts +1 -1
- package/remote-mcp/factories/instance-factories.d.ts.map +1 -1
- package/remote-mcp/factories/record-builders.d.ts +1 -1
- package/remote-mcp/factories/record-builders.d.ts.map +1 -1
- package/remote-mcp/mcp-client.service.d.ts +2 -2
- package/remote-mcp/mcp-client.service.d.ts.map +1 -1
- package/remote-mcp/mcp-client.types.d.ts +4 -4
- package/remote-mcp/mcp-client.types.d.ts.map +1 -1
- package/resource/flows/read-resource.flow.d.ts +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/resource/resource.registry.d.ts +7 -1
- package/resource/resource.registry.d.ts.map +1 -1
- package/resource/resource.utils.d.ts.map +1 -1
- package/scope/flows/http.request.flow.d.ts +1 -0
- package/scope/flows/http.request.flow.d.ts.map +1 -1
- package/scope/index.d.ts.map +1 -1
- package/scope/scope.instance.d.ts +16 -6
- package/scope/scope.instance.d.ts.map +1 -1
- package/server/adapters/polyfills/browser-express-host.d.ts +7 -0
- package/server/adapters/polyfills/browser-express-host.d.ts.map +1 -0
- package/server/adapters/polyfills/node-express-host.d.ts +2 -0
- package/server/adapters/polyfills/node-express-host.d.ts.map +1 -0
- package/server/noop-server.d.ts +15 -0
- package/server/noop-server.d.ts.map +1 -0
- package/server/server.types.d.ts +11 -9
- package/server/server.types.d.ts.map +1 -1
- package/server/server.validation.d.ts.map +1 -1
- package/skill/cache/index.d.ts +2 -1
- package/skill/cache/index.d.ts.map +1 -1
- package/skill/index.d.ts +3 -3
- package/skill/index.d.ts.map +1 -1
- package/skill/providers/memory-skill.provider.d.ts +5 -0
- package/skill/providers/memory-skill.provider.d.ts.map +1 -1
- package/skill/session/skill-session.manager.d.ts +1 -1
- package/skill/session/skill-session.manager.d.ts.map +1 -1
- package/skill/skill-directory-loader.d.ts.map +1 -1
- package/skill/skill.registry.d.ts +1 -1
- package/skill/skill.registry.d.ts.map +1 -1
- package/skill/skill.utils.d.ts.map +1 -1
- package/skill/tools/index.d.ts +1 -5
- package/skill/tools/index.d.ts.map +1 -1
- package/skill/tools/load-skills.tool.d.ts +1 -4
- package/skill/tools/load-skills.tool.d.ts.map +1 -1
- package/tool/flows/call-tool.flow.d.ts +12 -3
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tools-list.flow.d.ts +12 -4
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- package/tool/tool.instance.d.ts +5 -2
- package/tool/tool.instance.d.ts.map +1 -1
- package/tool/tool.registry.d.ts +7 -1
- package/tool/tool.registry.d.ts.map +1 -1
- package/tool/tool.utils.d.ts.map +1 -1
- package/tool/ui/index.d.ts +29 -9
- package/tool/ui/index.d.ts.map +1 -1
- package/tool/ui/platform-adapters.d.ts +27 -5
- package/tool/ui/platform-adapters.d.ts.map +1 -1
- package/tool/ui/template-helpers.d.ts +1 -7
- package/tool/ui/template-helpers.d.ts.map +1 -1
- package/tool/ui/ui-resource-template.d.ts +1 -1
- package/tool/ui/ui-resource.handler.d.ts +2 -2
- package/tool/ui/ui-resource.handler.d.ts.map +1 -1
- package/tool/ui/ui-shared.d.ts +35 -0
- package/tool/ui/ui-shared.d.ts.map +1 -0
- package/transport/{legacy/legacy.sse.tranporter.d.ts → adapters/base-sse-transport.d.ts} +2 -4
- package/transport/adapters/base-sse-transport.d.ts.map +1 -0
- package/transport/adapters/polyfills/browser-sse-transport.d.ts +10 -0
- package/transport/adapters/polyfills/browser-sse-transport.d.ts.map +1 -0
- package/transport/adapters/polyfills/node-sse-transport.d.ts +2 -0
- package/transport/adapters/polyfills/node-sse-transport.d.ts.map +1 -0
- package/transport/adapters/sse-transport.d.ts +1 -1
- package/transport/adapters/sse-transport.d.ts.map +1 -1
- package/transport/adapters/streamable-http-transport.d.ts +1 -1
- package/transport/adapters/streamable-http-transport.d.ts.map +1 -1
- package/transport/adapters/transport.local.adapter.d.ts +4 -6
- package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
- package/transport/adapters/transport.sse.adapter.d.ts +1 -1
- package/transport/adapters/transport.sse.adapter.d.ts.map +1 -1
- package/transport/adapters/transport.streamable-http.adapter.d.ts +1 -1
- package/transport/adapters/transport.streamable-http.adapter.d.ts.map +1 -1
- package/transport/event-stores/event-store.factory.d.ts +1 -1
- package/transport/event-stores/event-store.factory.d.ts.map +1 -1
- package/transport/event-stores/memory.event-store.d.ts +2 -2
- package/transport/event-stores/memory.event-store.d.ts.map +1 -1
- package/transport/event-stores/redis.event-store.d.ts +2 -2
- package/transport/event-stores/redis.event-store.d.ts.map +1 -1
- package/transport/in-memory-server.d.ts +3 -3
- package/transport/in-memory-server.d.ts.map +1 -1
- package/transport/index.d.ts +8 -5
- package/transport/index.d.ts.map +1 -1
- package/transport/mcp-handlers/Initialized-notification.hanlder.d.ts +1 -1
- package/transport/mcp-handlers/Initialized-notification.hanlder.d.ts.map +1 -1
- package/transport/mcp-handlers/call-tool-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/call-tool-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/complete-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/complete-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/get-prompt-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/get-prompt-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/index.d.ts +6 -6
- package/transport/mcp-handlers/initialize-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/initialize-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-prompts-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/list-prompts-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-resource-templates-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/list-resource-templates-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-resources-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/list-resources-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-tools-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/list-tools-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/logging-set-level-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/logging-set-level-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/mcp-handlers.types.d.ts +6 -9
- package/transport/mcp-handlers/mcp-handlers.types.d.ts.map +1 -1
- package/transport/mcp-handlers/read-resource-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/read-resource-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/roots-list-changed-notification.handler.d.ts +2 -2
- package/transport/mcp-handlers/roots-list-changed-notification.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/subscribe-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/subscribe-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/unsubscribe-request.handler.d.ts +1 -1
- package/transport/mcp-handlers/unsubscribe-request.handler.d.ts.map +1 -1
- package/transport/transport.error.d.ts +2 -2
- package/transport/transport.error.d.ts.map +1 -1
- package/transport/transport.registry.d.ts +8 -0
- package/transport/transport.registry.d.ts.map +1 -1
- package/types/drinen-hooks.types.d.ts.map +1 -1
- package/types/invoke.type.d.ts.map +1 -1
- package/types/zod.types.d.ts.map +1 -1
- package/utils/index.d.ts +2 -1
- package/utils/index.d.ts.map +1 -1
- package/agent/adapters/langchain.adapter.d.ts +0 -178
- package/agent/adapters/langchain.adapter.d.ts.map +0 -1
- package/esm/package.json +0 -104
- package/transport/legacy/legacy.sse.tranporter.d.ts.map +0 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file app-helpers.ts
|
|
3
|
+
* @description Unified API for declaring external apps in @FrontMcp({ apps: [...] }).
|
|
4
|
+
*
|
|
5
|
+
* Provides `app.esm()` for loading @App classes from npm packages and
|
|
6
|
+
* `app.remote()` for connecting to external MCP servers.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { FrontMcp, app } from '@frontmcp/sdk';
|
|
11
|
+
*
|
|
12
|
+
* @FrontMcp({
|
|
13
|
+
* info: { name: 'Gateway', version: '1.0.0' },
|
|
14
|
+
* apps: [
|
|
15
|
+
* LocalApp,
|
|
16
|
+
* app.esm('@acme/tools@^1.0.0', { namespace: 'acme' }),
|
|
17
|
+
* app.remote('https://api.example.com/mcp', { namespace: 'api' }),
|
|
18
|
+
* ],
|
|
19
|
+
* })
|
|
20
|
+
* export default class Server {}
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import type { RemoteAppMetadata } from '../common/metadata/app.metadata';
|
|
24
|
+
import type { EsmAppOptions, RemoteUrlAppOptions } from '../common/metadata/app.metadata';
|
|
25
|
+
export type { EsmAppOptions, RemoteUrlAppOptions } from '../common/metadata/app.metadata';
|
|
26
|
+
export type { PackageLoader } from '../common/metadata/app.metadata';
|
|
27
|
+
export type { AppFilterConfig, PrimitiveFilterMap } from '../common/metadata/app-filter.metadata';
|
|
28
|
+
/**
|
|
29
|
+
* Unified namespace for declaring external apps.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* // Load @App class from npm
|
|
34
|
+
* app.esm('@acme/tools@^1.0.0', { namespace: 'acme' })
|
|
35
|
+
*
|
|
36
|
+
* // Connect to external MCP server
|
|
37
|
+
* app.remote('https://api.example.com/mcp', { namespace: 'api' })
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare const app: {
|
|
41
|
+
/**
|
|
42
|
+
* Declare an npm package to load at runtime.
|
|
43
|
+
* The package should export an `@App`-decorated class as its default export.
|
|
44
|
+
*
|
|
45
|
+
* @param specifier - npm package specifier (e.g., '@acme/tools@^1.0.0')
|
|
46
|
+
* @param options - Optional per-app overrides
|
|
47
|
+
* @returns A `RemoteAppMetadata` ready for use in `@FrontMcp({ apps: [...] })`
|
|
48
|
+
*/
|
|
49
|
+
readonly esm: (specifier: string, options?: EsmAppOptions) => RemoteAppMetadata;
|
|
50
|
+
/**
|
|
51
|
+
* Connect to an external MCP server via HTTP.
|
|
52
|
+
* The remote server's tools, resources, and prompts are proxied through your gateway.
|
|
53
|
+
*
|
|
54
|
+
* @param url - MCP server endpoint URL (e.g., 'https://api.example.com/mcp')
|
|
55
|
+
* @param options - Optional per-app overrides
|
|
56
|
+
* @returns A `RemoteAppMetadata` ready for use in `@FrontMcp({ apps: [...] })`
|
|
57
|
+
*/
|
|
58
|
+
readonly remote: (url: string, options?: RemoteUrlAppOptions) => RemoteAppMetadata;
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=app-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-helpers.d.ts","sourceRoot":"","sources":["../../src/esm-loader/app-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAE1F,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC1F,YAAY,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAMlG;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,GAAG;IACd;;;;;;;OAOG;8BACY,MAAM,YAAY,aAAa,KAAG,iBAAiB;IAmClE;;;;;;;OAOG;2BACS,MAAM,YAAY,mBAAmB,KAAG,iBAAiB;CAwB7D,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file esm-auth.types.ts
|
|
3
|
+
* @description Authentication configuration for private npm registries and esm.sh CDN.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* Authentication configuration for accessing private npm registries.
|
|
8
|
+
* Used both for version resolution (npm registry API) and ESM bundle fetching.
|
|
9
|
+
*/
|
|
10
|
+
export interface EsmRegistryAuth {
|
|
11
|
+
/**
|
|
12
|
+
* Custom registry URL (e.g., 'https://npm.pkg.github.com').
|
|
13
|
+
* If not provided, defaults to 'https://registry.npmjs.org'.
|
|
14
|
+
*/
|
|
15
|
+
registryUrl?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Bearer token for authentication.
|
|
18
|
+
* Mutually exclusive with `tokenEnvVar`.
|
|
19
|
+
*/
|
|
20
|
+
token?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Environment variable name containing the bearer token.
|
|
23
|
+
* Resolved at runtime for security (avoids storing tokens in config).
|
|
24
|
+
* Mutually exclusive with `token`.
|
|
25
|
+
*/
|
|
26
|
+
tokenEnvVar?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Zod schema for EsmRegistryAuth validation.
|
|
30
|
+
*/
|
|
31
|
+
export declare const esmRegistryAuthSchema: z.ZodObject<{
|
|
32
|
+
registryUrl: z.ZodOptional<z.ZodString>;
|
|
33
|
+
token: z.ZodOptional<z.ZodString>;
|
|
34
|
+
tokenEnvVar: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
/**
|
|
37
|
+
* Default npm registry URL.
|
|
38
|
+
*/
|
|
39
|
+
export declare const DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org";
|
|
40
|
+
/**
|
|
41
|
+
* Resolve the bearer token from an EsmRegistryAuth configuration.
|
|
42
|
+
* Handles both direct tokens and environment variable references.
|
|
43
|
+
*
|
|
44
|
+
* @param auth - Registry auth configuration (optional)
|
|
45
|
+
* @returns The resolved token, or undefined if no auth configured
|
|
46
|
+
* @throws Error if tokenEnvVar is specified but the environment variable is not set
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveRegistryToken(auth?: EsmRegistryAuth): string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Get the registry URL from auth configuration, falling back to default.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getRegistryUrl(auth?: EsmRegistryAuth): string;
|
|
53
|
+
//# sourceMappingURL=esm-auth.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esm-auth.types.d.ts","sourceRoot":"","sources":["../../src/esm-loader/esm-auth.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;iBAQ9B,CAAC;AAEL;;GAEG;AACH,eAAO,MAAM,oBAAoB,+BAA+B,CAAC;AAEjE;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAkB/E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM,CAE7D"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file esm-cache.ts
|
|
3
|
+
* @description Cache manager for downloaded ESM bundles.
|
|
4
|
+
*
|
|
5
|
+
* Supports two modes:
|
|
6
|
+
* - **Node.js**: File-based cache with `.mjs`/`.cjs` bundles and metadata JSON
|
|
7
|
+
* - **Browser**: In-memory cache (no file system access)
|
|
8
|
+
*
|
|
9
|
+
* The mode is auto-detected. In-memory cache is always used as a fast first-level cache,
|
|
10
|
+
* with disk persistence as a second level in Node.js environments.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Metadata stored alongside each cached ESM bundle.
|
|
14
|
+
*/
|
|
15
|
+
export interface EsmCacheEntry {
|
|
16
|
+
/** Full package URL used to fetch */
|
|
17
|
+
packageUrl: string;
|
|
18
|
+
/** Full package name (e.g., '@acme/mcp-tools') */
|
|
19
|
+
packageName: string;
|
|
20
|
+
/** Concrete resolved version */
|
|
21
|
+
resolvedVersion: string;
|
|
22
|
+
/** Timestamp when cached */
|
|
23
|
+
cachedAt: number;
|
|
24
|
+
/** Path to the cached bundle file (.mjs for ESM, .cjs for bridged CJS; empty in browser) */
|
|
25
|
+
bundlePath: string;
|
|
26
|
+
/** HTTP ETag for conditional requests */
|
|
27
|
+
etag?: string;
|
|
28
|
+
/** In-memory bundle content (used in browser mode and as fast cache in Node.js) */
|
|
29
|
+
bundleContent?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Options for the ESM cache manager.
|
|
33
|
+
*/
|
|
34
|
+
export interface EsmCacheOptions {
|
|
35
|
+
/**
|
|
36
|
+
* Root cache directory for disk persistence. Environment-aware default:
|
|
37
|
+
* - **Browser**: empty string (disk cache disabled, in-memory only)
|
|
38
|
+
* - **Node.js server** (project has `node_modules/`): `{cwd}/node_modules/.cache/frontmcp-esm/`
|
|
39
|
+
* - **CLI binary** (no `node_modules/`): `~/.frontmcp/esm-cache/`
|
|
40
|
+
*/
|
|
41
|
+
cacheDir?: string;
|
|
42
|
+
/** Maximum age of cached entries in milliseconds. Defaults to 24 hours. */
|
|
43
|
+
maxAgeMs?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Cache manager for ESM bundles.
|
|
47
|
+
*
|
|
48
|
+
* **Node.js mode**: File-based disk cache with in-memory first-level cache.
|
|
49
|
+
* ```
|
|
50
|
+
* {cacheDir}/{hash}/
|
|
51
|
+
* bundle.mjs|cjs - Native ESM or bridged CJS bundle code
|
|
52
|
+
* meta.json - Cache metadata (version, timestamp, etag)
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* **Browser mode**: In-memory Map only (no file system).
|
|
56
|
+
*/
|
|
57
|
+
export declare class EsmCacheManager {
|
|
58
|
+
private readonly cacheDir;
|
|
59
|
+
private readonly maxAgeMs;
|
|
60
|
+
private readonly memoryStore;
|
|
61
|
+
constructor(options?: EsmCacheOptions);
|
|
62
|
+
/**
|
|
63
|
+
* Get a cached ESM bundle entry if it exists and is not expired.
|
|
64
|
+
*/
|
|
65
|
+
get(packageName: string, version: string): Promise<EsmCacheEntry | undefined>;
|
|
66
|
+
/**
|
|
67
|
+
* Store an ESM bundle in the cache.
|
|
68
|
+
*/
|
|
69
|
+
put(packageName: string, version: string, bundleContent: string, packageUrl: string, etag?: string): Promise<EsmCacheEntry>;
|
|
70
|
+
/**
|
|
71
|
+
* Invalidate all cached versions for a package.
|
|
72
|
+
*/
|
|
73
|
+
invalidate(packageName: string): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Remove expired cache entries.
|
|
76
|
+
*/
|
|
77
|
+
cleanup(maxAgeMs?: number): Promise<number>;
|
|
78
|
+
/**
|
|
79
|
+
* Read the cached bundle content from a cache entry.
|
|
80
|
+
*/
|
|
81
|
+
readBundle(entry: EsmCacheEntry): Promise<string>;
|
|
82
|
+
/**
|
|
83
|
+
* Get the cache directory for a specific package+version combination.
|
|
84
|
+
*/
|
|
85
|
+
private getEntryDir;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=esm-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esm-cache.d.ts","sourceRoot":"","sources":["../../src/esm-loader/esm-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA0DH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,4FAA4F;IAC5F,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA+CD;;;;;;;;;;;GAWG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoC;gBAEpD,OAAO,CAAC,EAAE,eAAe;IAKrC;;OAEG;IACG,GAAG,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IA+CnF;;OAEG;IACG,GAAG,CACP,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,CAAC;IAoDzB;;OAEG;IACG,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyCpD;;OAEG;IACG,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAkDjD;;OAEG;IACG,UAAU,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAYvD;;OAEG;IACH,OAAO,CAAC,WAAW;CAKpB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file esm-manifest.ts
|
|
3
|
+
* @description Package manifest interface and normalizer for ESM-loaded packages.
|
|
4
|
+
* Defines the contract that npm packages must follow to be loadable by FrontMCP.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* The manifest that ESM packages export to declare their MCP primitives.
|
|
9
|
+
*
|
|
10
|
+
* Package authors export this as the default export of their package:
|
|
11
|
+
* ```typescript
|
|
12
|
+
* export default {
|
|
13
|
+
* name: '@acme/mcp-tools',
|
|
14
|
+
* version: '1.0.0',
|
|
15
|
+
* tools: [SearchTool, CreateIssueTool],
|
|
16
|
+
* skills: [{ name: 'triage', ... }],
|
|
17
|
+
* } satisfies FrontMcpPackageManifest;
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export interface FrontMcpPackageManifest {
|
|
21
|
+
/** Package name (should match npm package name) */
|
|
22
|
+
name: string;
|
|
23
|
+
/** Package version (should match npm package version) */
|
|
24
|
+
version: string;
|
|
25
|
+
/** Package description */
|
|
26
|
+
description?: string;
|
|
27
|
+
/** Tool classes or function-style tools */
|
|
28
|
+
tools?: unknown[];
|
|
29
|
+
/** Prompt classes or function-style prompts */
|
|
30
|
+
prompts?: unknown[];
|
|
31
|
+
/** Resource classes or function-style resources */
|
|
32
|
+
resources?: unknown[];
|
|
33
|
+
/** Skill definitions (can include embedded tools via the skill's tools array) */
|
|
34
|
+
skills?: unknown[];
|
|
35
|
+
/** Agent classes or function-style agents */
|
|
36
|
+
agents?: unknown[];
|
|
37
|
+
/** Job classes or function-style jobs */
|
|
38
|
+
jobs?: unknown[];
|
|
39
|
+
/** Workflow classes or function-style workflows */
|
|
40
|
+
workflows?: unknown[];
|
|
41
|
+
/** Shared providers for dependency injection */
|
|
42
|
+
providers?: unknown[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Zod schema for basic manifest validation.
|
|
46
|
+
* We validate the shape loosely since the actual primitives are validated
|
|
47
|
+
* by their respective registries during registration.
|
|
48
|
+
*/
|
|
49
|
+
export declare const frontMcpPackageManifestSchema: z.ZodObject<{
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
version: z.ZodString;
|
|
52
|
+
description: z.ZodOptional<z.ZodString>;
|
|
53
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
54
|
+
prompts: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
55
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
56
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
57
|
+
agents: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
58
|
+
jobs: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
59
|
+
workflows: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
60
|
+
providers: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
/**
|
|
63
|
+
* Primitive type keys available in a manifest.
|
|
64
|
+
*/
|
|
65
|
+
export declare const MANIFEST_PRIMITIVE_KEYS: readonly ["tools", "prompts", "resources", "skills", "agents", "jobs", "workflows", "providers"];
|
|
66
|
+
export type ManifestPrimitiveKey = (typeof MANIFEST_PRIMITIVE_KEYS)[number];
|
|
67
|
+
/**
|
|
68
|
+
* Normalize the default export of an ESM module into a FrontMcpPackageManifest.
|
|
69
|
+
*
|
|
70
|
+
* Handles five formats:
|
|
71
|
+
* 1. A plain manifest object with tools/prompts/etc arrays
|
|
72
|
+
* 2. A class decorated with @FrontMcp (detected via reflect-metadata)
|
|
73
|
+
* 3. A module with named exports (tools, prompts, etc. arrays)
|
|
74
|
+
* 4. A single default export of a decorated primitive class (@Tool, @Resource, etc.)
|
|
75
|
+
* 5. Named exports of individual decorated classes (scanned and grouped by type)
|
|
76
|
+
*
|
|
77
|
+
* @param moduleExport - The raw module export (result of dynamic import())
|
|
78
|
+
* @returns Normalized FrontMcpPackageManifest
|
|
79
|
+
* @throws Error if the export cannot be normalized
|
|
80
|
+
*/
|
|
81
|
+
export declare function normalizeEsmExport(moduleExport: unknown): FrontMcpPackageManifest;
|
|
82
|
+
//# sourceMappingURL=esm-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esm-manifest.d.ts","sourceRoot":"","sources":["../../src/esm-loader/esm-manifest.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,uBAAuB;IACtC,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC;IACpB,mDAAmD;IACnD,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,iFAAiF;IACjF,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACnB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC;IACnB,yCAAyC;IACzC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;IACjB,mDAAmD;IACnD,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IACtB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;iBAYxC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB,kGAS1B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,OAAO,GAAG,uBAAuB,CAyDjF"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file esm-module-loader.ts
|
|
3
|
+
* @description Core engine for dynamically loading npm packages.
|
|
4
|
+
*
|
|
5
|
+
* Supports two runtime environments:
|
|
6
|
+
* - **Node.js**: fetch → cache to disk → import() from file:// URL
|
|
7
|
+
* - **Browser**: fetch → in-memory cache → evaluate via Function constructor
|
|
8
|
+
*/
|
|
9
|
+
import type { FrontMcpLogger } from '../common';
|
|
10
|
+
import type { EsmRegistryAuth } from './esm-auth.types';
|
|
11
|
+
import type { EsmCacheManager } from './esm-cache';
|
|
12
|
+
import type { ParsedPackageSpecifier } from './package-specifier';
|
|
13
|
+
import type { FrontMcpPackageManifest } from './esm-manifest';
|
|
14
|
+
/**
|
|
15
|
+
* Result of loading an ESM package.
|
|
16
|
+
*/
|
|
17
|
+
export interface EsmLoadResult {
|
|
18
|
+
/** Normalized package manifest with primitives */
|
|
19
|
+
manifest: FrontMcpPackageManifest;
|
|
20
|
+
/** Concrete version that was loaded */
|
|
21
|
+
resolvedVersion: string;
|
|
22
|
+
/** Whether the bundle came from cache or network */
|
|
23
|
+
source: 'cache' | 'network';
|
|
24
|
+
/** Timestamp when the load completed */
|
|
25
|
+
loadedAt: number;
|
|
26
|
+
/** The raw module export (for direct access to classes/functions) */
|
|
27
|
+
rawModule: unknown;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Options for the ESM module loader.
|
|
31
|
+
*/
|
|
32
|
+
export interface EsmModuleLoaderOptions {
|
|
33
|
+
/** Cache manager for storing ESM bundles */
|
|
34
|
+
cache: EsmCacheManager;
|
|
35
|
+
/** Authentication for private registries */
|
|
36
|
+
registryAuth?: EsmRegistryAuth;
|
|
37
|
+
/** Request timeout in milliseconds (default: 30000) */
|
|
38
|
+
timeout?: number;
|
|
39
|
+
/** Logger instance */
|
|
40
|
+
logger?: FrontMcpLogger;
|
|
41
|
+
/** Custom ESM CDN base URL */
|
|
42
|
+
esmBaseUrl?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Core ESM module loader.
|
|
46
|
+
*
|
|
47
|
+
* Loads npm packages dynamically at runtime:
|
|
48
|
+
* 1. Resolves semver range to concrete version via npm registry
|
|
49
|
+
* 2. Checks cache for the resolved version (in-memory + disk)
|
|
50
|
+
* 3. On cache miss, fetches the bundle from esm.sh (or custom CDN)
|
|
51
|
+
* 4. Caches the bundle (disk in Node.js, in-memory in browser)
|
|
52
|
+
* 5. Evaluates the module (import() in Node.js, Function constructor in browser)
|
|
53
|
+
* 6. Normalizes the module export into a FrontMcpPackageManifest
|
|
54
|
+
*/
|
|
55
|
+
export declare class EsmModuleLoader {
|
|
56
|
+
private readonly cache;
|
|
57
|
+
private readonly versionResolver;
|
|
58
|
+
private readonly timeout;
|
|
59
|
+
private readonly logger?;
|
|
60
|
+
private readonly esmBaseUrl?;
|
|
61
|
+
constructor(options: EsmModuleLoaderOptions);
|
|
62
|
+
/**
|
|
63
|
+
* Load an npm package and return its normalized manifest.
|
|
64
|
+
*
|
|
65
|
+
* @param specifier - Parsed package specifier
|
|
66
|
+
* @returns Load result with manifest and metadata
|
|
67
|
+
*/
|
|
68
|
+
load(specifier: ParsedPackageSpecifier): Promise<EsmLoadResult>;
|
|
69
|
+
/**
|
|
70
|
+
* Resolve a package specifier's range to a concrete version.
|
|
71
|
+
*/
|
|
72
|
+
resolveVersion(specifier: ParsedPackageSpecifier): Promise<string>;
|
|
73
|
+
/**
|
|
74
|
+
* Load a module from a cached bundle.
|
|
75
|
+
*/
|
|
76
|
+
private loadFromCache;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch ESM bundle from esm.sh, cache it, and load it.
|
|
79
|
+
*/
|
|
80
|
+
private fetchAndCache;
|
|
81
|
+
/**
|
|
82
|
+
* Import a bundle from a local file path (Node.js only).
|
|
83
|
+
* Uses dynamic import with file:// URL for cross-platform compatibility.
|
|
84
|
+
*/
|
|
85
|
+
private importFromPath;
|
|
86
|
+
/**
|
|
87
|
+
* Import a bundle from its source text.
|
|
88
|
+
* Detects ESM vs CJS and uses the appropriate evaluation strategy.
|
|
89
|
+
*/
|
|
90
|
+
private importBundle;
|
|
91
|
+
/**
|
|
92
|
+
* Heuristic: content uses ESM export/import syntax at line boundaries.
|
|
93
|
+
*/
|
|
94
|
+
private looksLikeEsm;
|
|
95
|
+
/**
|
|
96
|
+
* Import ESM content via Blob URL (browser) or temp file (Node.js).
|
|
97
|
+
*/
|
|
98
|
+
private importEsmBundle;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=esm-module-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esm-module-loader.d.ts","sourceRoot":"","sources":["../../src/esm-loader/esm-module-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,aAAa,CAAC;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAK9D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,kDAAkD;IAClD,QAAQ,EAAE,uBAAuB,CAAC;IAClC,uCAAuC;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,4CAA4C;IAC5C,KAAK,EAAE,eAAe,CAAC;IACvB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sBAAsB;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,8BAA8B;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;IAClD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAS;gBAEzB,OAAO,EAAE,sBAAsB;IAW3C;;;;;OAKG;IACG,IAAI,CAAC,SAAS,EAAE,sBAAsB,GAAG,OAAO,CAAC,aAAa,CAAC;IAmBrE;;OAEG;IACG,cAAc,CAAC,SAAS,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IAKxE;;OAEG;YACW,aAAa;IAsC3B;;OAEG;YACW,aAAa;IAyD3B;;;OAGG;YACW,cAAc;IAQ5B;;;OAGG;YACW,YAAY;IAW1B;;OAEG;IACH,OAAO,CAAC,YAAY;IAIpB;;OAEG;YACW,eAAe;CA2B9B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file esm-context-factories.ts
|
|
3
|
+
* @description Factory functions that create context classes for ESM-loaded primitives.
|
|
4
|
+
*
|
|
5
|
+
* Unlike remote-mcp context factories (which proxy to a remote MCP server),
|
|
6
|
+
* these factories create classes that execute code locally in-process.
|
|
7
|
+
* The ESM module's functions are closed over via closure.
|
|
8
|
+
*/
|
|
9
|
+
import { Type } from '@frontmcp/di';
|
|
10
|
+
import { ToolContext, ToolInputType, ToolOutputType, ResourceContext, PromptContext } from '../../common';
|
|
11
|
+
import type { CallToolResult, ReadResourceResult, GetPromptResult } from '@frontmcp/protocol';
|
|
12
|
+
/**
|
|
13
|
+
* Handler type for ESM tool execution.
|
|
14
|
+
* This is the execute function exported by the ESM package.
|
|
15
|
+
*/
|
|
16
|
+
export type EsmToolExecuteHandler = (input: Record<string, unknown>) => Promise<CallToolResult>;
|
|
17
|
+
/**
|
|
18
|
+
* Handler type for ESM resource reading.
|
|
19
|
+
*/
|
|
20
|
+
export type EsmResourceReadHandler = (uri: string, params: Record<string, string>) => Promise<ReadResourceResult>;
|
|
21
|
+
/**
|
|
22
|
+
* Handler type for ESM prompt execution.
|
|
23
|
+
*/
|
|
24
|
+
export type EsmPromptExecuteHandler = (args: Record<string, string>) => Promise<GetPromptResult>;
|
|
25
|
+
/**
|
|
26
|
+
* Creates an ESM tool context class that executes locally in-process.
|
|
27
|
+
*
|
|
28
|
+
* The returned class closes over the ESM module's execute function.
|
|
29
|
+
* When called, it runs the tool handler directly in the same Node.js process.
|
|
30
|
+
*
|
|
31
|
+
* @param executeFn - The tool's execute function from the ESM module
|
|
32
|
+
* @param toolName - The name of the tool (for debugging)
|
|
33
|
+
* @returns A ToolContext class that executes the ESM tool locally
|
|
34
|
+
*/
|
|
35
|
+
export declare function createEsmToolContextClass(executeFn: EsmToolExecuteHandler, toolName: string): Type<ToolContext<ToolInputType, ToolOutputType, unknown, CallToolResult>>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates an ESM resource context class that reads locally in-process.
|
|
38
|
+
*
|
|
39
|
+
* @param readFn - The resource's read function from the ESM module
|
|
40
|
+
* @param resourceName - The name of the resource (for debugging)
|
|
41
|
+
* @returns A ResourceContext class that reads the ESM resource locally
|
|
42
|
+
*/
|
|
43
|
+
export declare function createEsmResourceContextClass<Params extends Record<string, string> = Record<string, string>>(readFn: EsmResourceReadHandler, resourceName: string): Type<ResourceContext<Params, ReadResourceResult>>;
|
|
44
|
+
/**
|
|
45
|
+
* Creates an ESM prompt context class that executes locally in-process.
|
|
46
|
+
*
|
|
47
|
+
* @param executeFn - The prompt's execute function from the ESM module
|
|
48
|
+
* @param promptName - The name of the prompt (for debugging)
|
|
49
|
+
* @returns A PromptContext class that executes the ESM prompt locally
|
|
50
|
+
*/
|
|
51
|
+
export declare function createEsmPromptContextClass(executeFn: EsmPromptExecuteHandler, promptName: string): Type<PromptContext>;
|
|
52
|
+
//# sourceMappingURL=esm-context-factories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esm-context-factories.d.ts","sourceRoot":"","sources":["../../../src/esm-loader/factories/esm-context-factories.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC1G,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE9F;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;AAEhG;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAElH;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;AAEjG;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,qBAAqB,EAChC,QAAQ,EAAE,MAAM,GACf,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAW3E;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1G,MAAM,EAAE,sBAAsB,EAC9B,YAAY,EAAE,MAAM,GACnB,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAUnD;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,uBAAuB,EAClC,UAAU,EAAE,MAAM,GACjB,IAAI,CAAC,aAAa,CAAC,CAUrB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file esm-instance-factories.ts
|
|
3
|
+
* @description Factory functions that create standard instances for ESM-loaded primitives.
|
|
4
|
+
*
|
|
5
|
+
* Uses the esm-record-builders to create records, then instantiates standard
|
|
6
|
+
* ToolInstance, ResourceInstance, and PromptInstance. This allows ESM-loaded
|
|
7
|
+
* entities to use the same hook lifecycle and registry infrastructure as local entities.
|
|
8
|
+
*/
|
|
9
|
+
import type { EntryOwnerRef } from '../../common';
|
|
10
|
+
import type ProviderRegistry from '../../provider/provider.registry';
|
|
11
|
+
import { ToolInstance } from '../../tool/tool.instance';
|
|
12
|
+
import { ResourceInstance } from '../../resource/resource.instance';
|
|
13
|
+
import { PromptInstance } from '../../prompt/prompt.instance';
|
|
14
|
+
import type { EsmToolDefinition, EsmResourceDefinition, EsmPromptDefinition } from './esm-record-builders';
|
|
15
|
+
/**
|
|
16
|
+
* Create a standard ToolInstance for an ESM-loaded tool.
|
|
17
|
+
*
|
|
18
|
+
* The resulting ToolInstance executes the tool's code locally in-process
|
|
19
|
+
* and participates fully in the hook lifecycle.
|
|
20
|
+
*
|
|
21
|
+
* @param tool - ESM tool definition with execute function
|
|
22
|
+
* @param providers - The provider registry for DI and scope access
|
|
23
|
+
* @param owner - The entry owner reference (app owner)
|
|
24
|
+
* @param namespace - Optional namespace prefix for the tool name
|
|
25
|
+
* @returns A standard ToolInstance that executes the ESM tool locally
|
|
26
|
+
*/
|
|
27
|
+
export declare function createEsmToolInstance(tool: EsmToolDefinition, providers: ProviderRegistry, owner: EntryOwnerRef, namespace?: string): ToolInstance;
|
|
28
|
+
/**
|
|
29
|
+
* Create a standard ResourceInstance for an ESM-loaded resource.
|
|
30
|
+
*
|
|
31
|
+
* @param resource - ESM resource definition with read function
|
|
32
|
+
* @param providers - The provider registry for DI and scope access
|
|
33
|
+
* @param owner - The entry owner reference (app owner)
|
|
34
|
+
* @param namespace - Optional namespace prefix
|
|
35
|
+
* @returns A standard ResourceInstance that reads the ESM resource locally
|
|
36
|
+
*/
|
|
37
|
+
export declare function createEsmResourceInstance(resource: EsmResourceDefinition, providers: ProviderRegistry, owner: EntryOwnerRef, namespace?: string): ResourceInstance;
|
|
38
|
+
/**
|
|
39
|
+
* Create a standard PromptInstance for an ESM-loaded prompt.
|
|
40
|
+
*
|
|
41
|
+
* @param prompt - ESM prompt definition with execute function
|
|
42
|
+
* @param providers - The provider registry for DI and scope access
|
|
43
|
+
* @param owner - The entry owner reference (app owner)
|
|
44
|
+
* @param namespace - Optional namespace prefix
|
|
45
|
+
* @returns A standard PromptInstance that executes the ESM prompt locally
|
|
46
|
+
*/
|
|
47
|
+
export declare function createEsmPromptInstance(prompt: EsmPromptDefinition, providers: ProviderRegistry, owner: EntryOwnerRef, namespace?: string): PromptInstance;
|
|
48
|
+
//# sourceMappingURL=esm-instance-factories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esm-instance-factories.d.ts","sourceRoot":"","sources":["../../../src/esm-loader/factories/esm-instance-factories.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,gBAAgB,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE3G;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,iBAAiB,EACvB,SAAS,EAAE,gBAAgB,EAC3B,KAAK,EAAE,aAAa,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,YAAY,CAGd;AAED;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,qBAAqB,EAC/B,SAAS,EAAE,gBAAgB,EAC3B,KAAK,EAAE,aAAa,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,gBAAgB,CAGlB;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,SAAS,EAAE,gBAAgB,EAC3B,KAAK,EAAE,aAAa,EACpB,SAAS,CAAC,EAAE,MAAM,GACjB,cAAc,CAGhB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file esm-record-builders.ts
|
|
3
|
+
* @description Functions that build standard records for ESM-loaded primitives.
|
|
4
|
+
*
|
|
5
|
+
* Unlike remote-mcp record-builders (which proxy to a remote server), these builders
|
|
6
|
+
* create records for tools/resources/prompts that execute locally in-process.
|
|
7
|
+
*/
|
|
8
|
+
import type { ToolClassTokenRecord, ResourceClassTokenRecord, PromptClassTokenRecord } from '../../common';
|
|
9
|
+
import type { EsmToolExecuteHandler, EsmResourceReadHandler, EsmPromptExecuteHandler } from './esm-context-factories';
|
|
10
|
+
/**
|
|
11
|
+
* Metadata for an ESM-loaded tool (simplified shape for tools loaded from packages).
|
|
12
|
+
*/
|
|
13
|
+
export interface EsmToolDefinition {
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
inputSchema?: Record<string, unknown>;
|
|
17
|
+
outputSchema?: unknown;
|
|
18
|
+
execute: EsmToolExecuteHandler;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Metadata for an ESM-loaded resource.
|
|
22
|
+
*/
|
|
23
|
+
export interface EsmResourceDefinition {
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
uri: string;
|
|
27
|
+
mimeType?: string;
|
|
28
|
+
read: EsmResourceReadHandler;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Metadata for an ESM-loaded prompt.
|
|
32
|
+
*/
|
|
33
|
+
export interface EsmPromptDefinition {
|
|
34
|
+
name: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
arguments?: Array<{
|
|
37
|
+
name: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
required?: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
execute: EsmPromptExecuteHandler;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Build a ToolClassTokenRecord for an ESM-loaded tool.
|
|
45
|
+
*
|
|
46
|
+
* Detects whether the tool's `inputSchema` is a Zod raw shape or JSON Schema
|
|
47
|
+
* and routes accordingly:
|
|
48
|
+
* - Zod shape → stored in `inputSchema` (converted by `getInputJsonSchema()`)
|
|
49
|
+
* - JSON Schema → stored in `rawInputSchema` (used as-is)
|
|
50
|
+
*
|
|
51
|
+
* @param tool - ESM tool definition with execute function
|
|
52
|
+
* @param namespace - Optional namespace prefix for the tool name
|
|
53
|
+
* @returns Standard ToolClassTokenRecord for use with ToolInstance
|
|
54
|
+
*/
|
|
55
|
+
export declare function buildEsmToolRecord(tool: EsmToolDefinition, namespace?: string): ToolClassTokenRecord;
|
|
56
|
+
/**
|
|
57
|
+
* Build a ResourceClassTokenRecord for an ESM-loaded resource.
|
|
58
|
+
*
|
|
59
|
+
* @param resource - ESM resource definition with read function
|
|
60
|
+
* @param namespace - Optional namespace prefix
|
|
61
|
+
* @returns Standard ResourceClassTokenRecord
|
|
62
|
+
*/
|
|
63
|
+
export declare function buildEsmResourceRecord(resource: EsmResourceDefinition, namespace?: string): ResourceClassTokenRecord;
|
|
64
|
+
/**
|
|
65
|
+
* Build a PromptClassTokenRecord for an ESM-loaded prompt.
|
|
66
|
+
*
|
|
67
|
+
* @param prompt - ESM prompt definition with execute function
|
|
68
|
+
* @param namespace - Optional namespace prefix
|
|
69
|
+
* @returns Standard PromptClassTokenRecord
|
|
70
|
+
*/
|
|
71
|
+
export declare function buildEsmPromptRecord(prompt: EsmPromptDefinition, namespace?: string): PromptClassTokenRecord;
|
|
72
|
+
//# sourceMappingURL=esm-record-builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"esm-record-builders.d.ts","sourceRoot":"","sources":["../../../src/esm-loader/factories/esm-record-builders.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAeH,OAAO,KAAK,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAM3G,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAEtH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,qBAAqB,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,sBAAsB,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC9E,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAUD;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAoCpG;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,wBAAwB,CAiBpH;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,sBAAsB,CAqB5G"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createEsmToolContextClass, createEsmResourceContextClass, createEsmPromptContextClass, type EsmToolExecuteHandler, type EsmResourceReadHandler, type EsmPromptExecuteHandler, } from './esm-context-factories';
|
|
2
|
+
export { buildEsmToolRecord, buildEsmResourceRecord, buildEsmPromptRecord, type EsmToolDefinition, type EsmResourceDefinition, type EsmPromptDefinition, } from './esm-record-builders';
|
|
3
|
+
export { createEsmToolInstance, createEsmResourceInstance, createEsmPromptInstance } from './esm-instance-factories';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/esm-loader/factories/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { parsePackageSpecifier, isPackageSpecifier, buildEsmShUrl, ESM_SH_BASE_URL, type ParsedPackageSpecifier, } from './package-specifier';
|
|
2
|
+
export { type EsmRegistryAuth, esmRegistryAuthSchema, resolveRegistryToken, getRegistryUrl, DEFAULT_NPM_REGISTRY, } from './esm-auth.types';
|
|
3
|
+
export { satisfiesRange, maxSatisfying, isValidRange, isValidVersion, compareVersions, isNewerVersion, } from './semver.utils';
|
|
4
|
+
export { EsmCacheManager, type EsmCacheEntry, type EsmCacheOptions } from './esm-cache';
|
|
5
|
+
export { normalizeEsmExport, frontMcpPackageManifestSchema, MANIFEST_PRIMITIVE_KEYS, type FrontMcpPackageManifest, type ManifestPrimitiveKey, } from './esm-manifest';
|
|
6
|
+
export { VersionResolver, type VersionResolutionResult, type VersionResolverOptions } from './version-resolver';
|
|
7
|
+
export { EsmModuleLoader, type EsmLoadResult, type EsmModuleLoaderOptions } from './esm-module-loader';
|
|
8
|
+
export { VersionPoller, type VersionPollerOptions, type VersionCheckResult } from './version-poller';
|
|
9
|
+
export { createEsmToolContextClass, createEsmResourceContextClass, createEsmPromptContextClass, type EsmToolExecuteHandler, type EsmResourceReadHandler, type EsmPromptExecuteHandler, buildEsmToolRecord, buildEsmResourceRecord, buildEsmPromptRecord, type EsmToolDefinition, type EsmResourceDefinition, type EsmPromptDefinition, createEsmToolInstance, createEsmResourceInstance, createEsmPromptInstance, } from './factories';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/esm-loader/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACL,KAAK,eAAe,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,cAAc,EACd,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAKxF,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,GAC1B,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,eAAe,EAAE,KAAK,uBAAuB,EAAE,KAAK,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAKhH,OAAO,EAAE,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAKvG,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAKrG,OAAO,EAEL,yBAAyB,EACzB,6BAA6B,EAC7B,2BAA2B,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAE5B,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EAExB,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,GACxB,MAAM,aAAa,CAAC"}
|