@frontmcp/sdk 0.7.2 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent/adapters/adapter.factory.d.ts +27 -18
- package/agent/adapters/adapter.factory.d.ts.map +1 -1
- package/agent/agent.instance.d.ts +5 -0
- package/agent/agent.instance.d.ts.map +1 -1
- package/agent/agent.scope.d.ts +54 -72
- package/agent/agent.scope.d.ts.map +1 -1
- package/agent/flows/call-agent.flow.d.ts +1 -0
- package/agent/flows/call-agent.flow.d.ts.map +1 -1
- package/app/instances/app.local.instance.d.ts +3 -0
- package/app/instances/app.local.instance.d.ts.map +1 -1
- package/app/instances/app.remote.instance.d.ts +3 -0
- package/app/instances/app.remote.instance.d.ts.map +1 -1
- package/auth/auth.registry.d.ts.map +1 -1
- package/auth/authorization/authorization.types.d.ts +7 -180
- package/auth/authorization/authorization.types.d.ts.map +1 -1
- package/auth/authorization/index.d.ts +2 -0
- package/auth/authorization/index.d.ts.map +1 -1
- package/auth/authorization/orchestrated.accessor.d.ts +161 -0
- package/auth/authorization/orchestrated.accessor.d.ts.map +1 -0
- package/auth/authorization/orchestrated.authorization.d.ts +19 -4
- package/auth/authorization/orchestrated.authorization.d.ts.map +1 -1
- package/auth/authorization/orchestrated.context-extension.d.ts +108 -0
- package/auth/authorization/orchestrated.context-extension.d.ts.map +1 -0
- package/auth/cimd/index.d.ts +14 -0
- package/auth/cimd/index.d.ts.map +1 -0
- package/auth/flows/auth.verify.flow.d.ts.map +1 -1
- package/auth/flows/oauth.authorize.flow.d.ts +30 -3
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts +11 -3
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.provider-callback.flow.d.ts +118 -0
- package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -0
- package/auth/flows/oauth.register.flow.d.ts +1 -1
- package/auth/flows/oauth.token.flow.d.ts +1 -1
- package/auth/flows/session.verify.flow.d.ts +8 -0
- package/auth/flows/session.verify.flow.d.ts.map +1 -1
- package/auth/flows/well-known.jwks.flow.d.ts +3 -3
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts +3 -2
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts.map +1 -1
- package/auth/flows/well-known.prm.flow.d.ts +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +88 -1
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/machine-id.d.ts +14 -0
- package/auth/machine-id.d.ts.map +1 -1
- package/auth/session/encrypted-authorization-vault.d.ts +2 -3
- package/auth/session/encrypted-authorization-vault.d.ts.map +1 -1
- package/auth/session/federated-auth.session.d.ts +252 -0
- package/auth/session/federated-auth.session.d.ts.map +1 -0
- package/auth/session/index.d.ts +6 -2
- package/auth/session/index.d.ts.map +1 -1
- package/auth/session/orchestrated-token.store.d.ts +155 -0
- package/auth/session/orchestrated-token.store.d.ts.map +1 -0
- package/auth/session/record/session.base.d.ts +7 -7
- package/auth/session/record/session.base.d.ts.map +1 -1
- package/auth/session/record/session.mcp.d.ts +11 -0
- package/auth/session/record/session.mcp.d.ts.map +1 -0
- package/auth/session/redis-session.store.d.ts +10 -5
- package/auth/session/redis-session.store.d.ts.map +1 -1
- package/auth/session/session-crypto.d.ts +6 -9
- package/auth/session/session-crypto.d.ts.map +1 -1
- package/{store/store.factory.d.ts → auth/session/session-store.factory.d.ts} +10 -36
- package/auth/session/session-store.factory.d.ts.map +1 -0
- package/auth/session/session.service.d.ts +4 -8
- package/auth/session/session.service.d.ts.map +1 -1
- package/auth/session/session.transport.d.ts +8 -2
- package/auth/session/session.transport.d.ts.map +1 -1
- package/auth/session/session.types.d.ts +5 -5
- package/auth/session/session.types.d.ts.map +1 -1
- package/auth/session/token.refresh.d.ts +1 -2
- package/auth/session/token.refresh.d.ts.map +1 -1
- package/auth/session/transport-session.manager.d.ts +7 -6
- package/auth/session/transport-session.manager.d.ts.map +1 -1
- package/auth/session/utils/session-id.utils.d.ts +18 -1
- package/auth/session/utils/session-id.utils.d.ts.map +1 -1
- package/auth/session/vercel-kv-session.store.d.ts +16 -16
- package/auth/session/vercel-kv-session.store.d.ts.map +1 -1
- package/auth/utils/authorization-id.utils.d.ts +12 -0
- package/auth/utils/authorization-id.utils.d.ts.map +1 -0
- package/auth/utils/index.d.ts +1 -2
- package/auth/utils/index.d.ts.map +1 -1
- package/auth/vault/auth-providers.accessor.d.ts +153 -0
- package/auth/vault/auth-providers.accessor.d.ts.map +1 -0
- package/auth/vault/auth-providers.accessor.impl.d.ts +52 -0
- package/auth/vault/auth-providers.accessor.impl.d.ts.map +1 -0
- package/auth/vault/auth-providers.context-extension.d.ts +68 -0
- package/auth/vault/auth-providers.context-extension.d.ts.map +1 -0
- package/auth/vault/auth-providers.providers.d.ts +40 -0
- package/auth/vault/auth-providers.providers.d.ts.map +1 -0
- package/auth/vault/auth-providers.registry.d.ts +110 -0
- package/auth/vault/auth-providers.registry.d.ts.map +1 -0
- package/auth/vault/auth-providers.vault.d.ts +93 -0
- package/auth/vault/auth-providers.vault.d.ts.map +1 -0
- package/auth/vault/credential-cache.d.ts +13 -0
- package/auth/vault/credential-cache.d.ts.map +1 -0
- package/auth/vault/credential-loaders/eager-loader.d.ts +46 -0
- package/auth/vault/credential-loaders/eager-loader.d.ts.map +1 -0
- package/auth/vault/credential-loaders/index.d.ts +7 -0
- package/auth/vault/credential-loaders/index.d.ts.map +1 -0
- package/auth/vault/credential-loaders/lazy-loader.d.ts +53 -0
- package/auth/vault/credential-loaders/lazy-loader.d.ts.map +1 -0
- package/auth/vault/index.d.ts +56 -0
- package/auth/vault/index.d.ts.map +1 -0
- package/builtin/config/config-resolver.d.ts +162 -0
- package/builtin/config/config-resolver.d.ts.map +1 -0
- package/builtin/config/config.plugin.d.ts +63 -0
- package/builtin/config/config.plugin.d.ts.map +1 -0
- package/builtin/config/config.symbols.d.ts +7 -0
- package/builtin/config/config.symbols.d.ts.map +1 -0
- package/builtin/config/config.types.d.ts +71 -0
- package/builtin/config/config.types.d.ts.map +1 -0
- package/builtin/config/index.d.ts +68 -0
- package/builtin/config/index.d.ts.map +1 -0
- package/builtin/config/providers/config-loader.d.ts +36 -0
- package/builtin/config/providers/config-loader.d.ts.map +1 -0
- package/builtin/config/providers/config.service.d.ts +108 -0
- package/builtin/config/providers/config.service.d.ts.map +1 -0
- package/builtin/config/providers/env-loader.d.ts +76 -0
- package/builtin/config/providers/env-loader.d.ts.map +1 -0
- package/builtin/index.d.ts +7 -0
- package/builtin/index.d.ts.map +1 -0
- package/common/decorators/front-mcp.decorator.d.ts.map +1 -1
- package/common/decorators/hook.decorator.d.ts +0 -10
- package/common/decorators/hook.decorator.d.ts.map +1 -1
- package/common/decorators/index.d.ts +1 -0
- package/common/decorators/index.d.ts.map +1 -1
- package/common/decorators/skill.decorator.d.ts +105 -0
- package/common/decorators/skill.decorator.d.ts.map +1 -0
- package/common/dynamic/dynamic.adapter.d.ts +14 -4
- package/common/dynamic/dynamic.adapter.d.ts.map +1 -1
- package/common/entries/app.entry.d.ts +2 -0
- package/common/entries/app.entry.d.ts.map +1 -1
- package/common/entries/index.d.ts +1 -0
- package/common/entries/index.d.ts.map +1 -1
- package/common/entries/prompt.entry.d.ts +0 -6
- package/common/entries/prompt.entry.d.ts.map +1 -1
- package/common/entries/resource.entry.d.ts +0 -6
- package/common/entries/resource.entry.d.ts.map +1 -1
- package/common/entries/scope.entry.d.ts +2 -0
- package/common/entries/scope.entry.d.ts.map +1 -1
- package/common/entries/skill.entry.d.ts +95 -0
- package/common/entries/skill.entry.d.ts.map +1 -0
- package/common/entries/tool.entry.d.ts +17 -9
- package/common/entries/tool.entry.d.ts.map +1 -1
- package/common/interfaces/agent.interface.d.ts +35 -6
- package/common/interfaces/agent.interface.d.ts.map +1 -1
- package/common/interfaces/execution-context.interface.d.ts +14 -0
- package/common/interfaces/execution-context.interface.d.ts.map +1 -1
- package/common/interfaces/index.d.ts +1 -0
- package/common/interfaces/index.d.ts.map +1 -1
- package/common/interfaces/internal/primary-auth-provider.interface.d.ts +1 -7
- package/common/interfaces/internal/primary-auth-provider.interface.d.ts.map +1 -1
- package/common/interfaces/internal/registry.interface.d.ts +4 -1
- package/common/interfaces/internal/registry.interface.d.ts.map +1 -1
- package/common/interfaces/skill.interface.d.ts +91 -0
- package/common/interfaces/skill.interface.d.ts.map +1 -0
- package/common/interfaces/tool.interface.d.ts +39 -0
- package/common/interfaces/tool.interface.d.ts.map +1 -1
- package/common/metadata/agent.metadata.d.ts +62 -2
- package/common/metadata/agent.metadata.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +168 -169
- package/common/metadata/app.metadata.d.ts.map +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +2182 -721
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/metadata/index.d.ts +1 -0
- package/common/metadata/index.d.ts.map +1 -1
- package/common/metadata/plugin.metadata.d.ts +8 -1
- package/common/metadata/plugin.metadata.d.ts.map +1 -1
- package/common/metadata/skill.metadata.d.ts +366 -0
- package/common/metadata/skill.metadata.d.ts.map +1 -0
- package/common/metadata/tool.metadata.d.ts +71 -0
- package/common/metadata/tool.metadata.d.ts.map +1 -1
- package/common/records/index.d.ts +1 -0
- package/common/records/index.d.ts.map +1 -1
- package/common/records/skill.record.d.ts +55 -0
- package/common/records/skill.record.d.ts.map +1 -0
- package/common/schemas/annotated-class.schema.d.ts +1 -0
- package/common/schemas/annotated-class.schema.d.ts.map +1 -1
- package/common/schemas/http-output.schema.d.ts +24 -24
- package/common/tokens/app.tokens.d.ts.map +1 -1
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/tokens/index.d.ts +1 -0
- package/common/tokens/index.d.ts.map +1 -1
- package/common/tokens/plugin.tokens.d.ts +1 -0
- package/common/tokens/plugin.tokens.d.ts.map +1 -1
- package/common/tokens/skill.tokens.d.ts +18 -0
- package/common/tokens/skill.tokens.d.ts.map +1 -0
- package/common/tokens/tool.tokens.d.ts +2 -0
- package/common/tokens/tool.tokens.d.ts.map +1 -1
- package/common/types/auth/session.types.d.ts +21 -0
- package/common/types/auth/session.types.d.ts.map +1 -1
- package/common/types/options/auth/app-auth.schema.d.ts +80 -84
- package/common/types/options/auth/app-auth.schema.d.ts.map +1 -1
- package/common/types/options/auth/index.d.ts +6 -8
- package/common/types/options/auth/index.d.ts.map +1 -1
- package/common/types/options/auth/{auth.interfaces.d.ts → interfaces.d.ts} +17 -48
- package/common/types/options/auth/interfaces.d.ts.map +1 -0
- package/common/types/options/auth/orchestrated.schema.d.ts +160 -84
- package/common/types/options/auth/orchestrated.schema.d.ts.map +1 -1
- package/common/types/options/auth/public.schema.d.ts +0 -21
- package/common/types/options/auth/public.schema.d.ts.map +1 -1
- package/common/types/options/auth/{auth.schema.d.ts → schema.d.ts} +81 -85
- package/common/types/options/auth/schema.d.ts.map +1 -0
- package/common/types/options/auth/shared.schemas.d.ts +12 -0
- package/common/types/options/auth/shared.schemas.d.ts.map +1 -1
- package/common/types/options/auth/transparent.schema.d.ts +0 -21
- package/common/types/options/auth/transparent.schema.d.ts.map +1 -1
- package/common/types/options/auth/typecheck.d.ts +2 -0
- package/common/types/options/auth/typecheck.d.ts.map +1 -0
- package/common/types/options/auth/{auth.utils.d.ts → utils.d.ts} +2 -2
- package/common/types/options/auth/utils.d.ts.map +1 -0
- package/common/types/options/elicitation/index.d.ts +4 -0
- package/common/types/options/elicitation/index.d.ts.map +1 -0
- package/common/types/options/elicitation/interfaces.d.ts +80 -0
- package/common/types/options/elicitation/interfaces.d.ts.map +1 -0
- package/common/types/options/elicitation/schema.d.ts +75 -0
- package/common/types/options/elicitation/schema.d.ts.map +1 -0
- package/common/types/options/ext-apps/index.d.ts +3 -0
- package/common/types/options/ext-apps/index.d.ts.map +1 -0
- package/common/types/options/ext-apps/interfaces.d.ts +2 -0
- package/common/types/options/ext-apps/interfaces.d.ts.map +1 -0
- package/common/types/options/ext-apps/schema.d.ts +80 -0
- package/common/types/options/ext-apps/schema.d.ts.map +1 -0
- package/common/types/options/http/index.d.ts +4 -0
- package/common/types/options/http/index.d.ts.map +1 -0
- package/common/types/options/http/interfaces.d.ts +23 -0
- package/common/types/options/http/interfaces.d.ts.map +1 -0
- package/common/types/options/http/schema.d.ts +18 -0
- package/common/types/options/http/schema.d.ts.map +1 -0
- package/common/types/options/index.d.ts +10 -6
- package/common/types/options/index.d.ts.map +1 -1
- package/common/types/options/logging/index.d.ts +5 -0
- package/common/types/options/logging/index.d.ts.map +1 -0
- package/common/types/options/logging/interfaces.d.ts +41 -0
- package/common/types/options/logging/interfaces.d.ts.map +1 -0
- package/common/types/options/logging/schema.d.ts +24 -0
- package/common/types/options/logging/schema.d.ts.map +1 -0
- package/common/types/options/pagination/index.d.ts +4 -0
- package/common/types/options/pagination/index.d.ts.map +1 -0
- package/common/types/options/pagination/interfaces.d.ts +43 -0
- package/common/types/options/pagination/interfaces.d.ts.map +1 -0
- package/common/types/options/pagination/schema.d.ts +41 -0
- package/common/types/options/pagination/schema.d.ts.map +1 -0
- package/common/types/options/redis/index.d.ts +4 -0
- package/common/types/options/redis/index.d.ts.map +1 -0
- package/common/types/options/redis/interfaces.d.ts +81 -0
- package/common/types/options/redis/interfaces.d.ts.map +1 -0
- package/common/types/options/{redis.options.d.ts → redis/schema.d.ts} +2 -2
- package/common/types/options/redis/schema.d.ts.map +1 -0
- package/common/types/options/server-info/index.d.ts +4 -0
- package/common/types/options/server-info/index.d.ts.map +1 -0
- package/common/types/options/server-info/interfaces.d.ts +27 -0
- package/common/types/options/server-info/interfaces.d.ts.map +1 -0
- package/common/types/options/{server-info.options.d.ts → server-info/schema.d.ts} +13 -10
- package/common/types/options/server-info/schema.d.ts.map +1 -0
- package/common/types/options/session/index.d.ts +4 -0
- package/common/types/options/session/index.d.ts.map +1 -0
- package/common/types/options/session/interfaces.d.ts +66 -0
- package/common/types/options/session/interfaces.d.ts.map +1 -0
- package/common/types/options/session/schema.d.ts +79 -0
- package/common/types/options/session/schema.d.ts.map +1 -0
- package/common/types/options/skills-http/index.d.ts +4 -0
- package/common/types/options/skills-http/index.d.ts.map +1 -0
- package/common/types/options/skills-http/interfaces.d.ts +321 -0
- package/common/types/options/skills-http/interfaces.d.ts.map +1 -0
- package/common/types/options/skills-http/schema.d.ts +139 -0
- package/common/types/options/skills-http/schema.d.ts.map +1 -0
- package/common/types/options/transport/index.d.ts +4 -0
- package/common/types/options/transport/index.d.ts.map +1 -0
- package/common/types/options/transport/interfaces.d.ts +354 -0
- package/common/types/options/transport/interfaces.d.ts.map +1 -0
- package/common/types/options/transport/schema.d.ts +309 -0
- package/common/types/options/transport/schema.d.ts.map +1 -0
- package/common/types/options/transport/typecheck.d.ts +2 -0
- package/common/types/options/transport/typecheck.d.ts.map +1 -0
- package/common/utils/decide-request-intent.utils.d.ts +3 -3
- package/common/utils/decide-request-intent.utils.d.ts.map +1 -1
- package/context/context-extension.d.ts +1 -28
- package/context/context-extension.d.ts.map +1 -1
- package/context/frontmcp-context-storage.d.ts.map +1 -1
- package/context/frontmcp-context.d.ts +36 -39
- package/context/frontmcp-context.d.ts.map +1 -1
- package/context/frontmcp-context.provider.d.ts +3 -9
- package/context/frontmcp-context.provider.d.ts.map +1 -1
- package/context/index.d.ts +5 -20
- package/context/index.d.ts.map +1 -1
- package/context/metadata.utils.d.ts +24 -0
- package/context/metadata.utils.d.ts.map +1 -0
- package/direct/client.types.d.ts +447 -0
- package/direct/client.types.d.ts.map +1 -0
- package/direct/connect.d.ts +188 -0
- package/direct/connect.d.ts.map +1 -0
- package/direct/direct-client.d.ts +7 -0
- package/direct/direct-client.d.ts.map +1 -0
- package/direct/direct-server.d.ts +38 -0
- package/direct/direct-server.d.ts.map +1 -0
- package/direct/direct.types.d.ts +134 -0
- package/direct/direct.types.d.ts.map +1 -0
- package/direct/index.d.ts +15 -0
- package/direct/index.d.ts.map +1 -0
- package/direct/llm-platform.d.ts +94 -0
- package/direct/llm-platform.d.ts.map +1 -0
- package/elicitation/elicitation-fallback.schema.d.ts +32 -0
- package/elicitation/elicitation-fallback.schema.d.ts.map +1 -0
- package/elicitation/elicitation.types.d.ts +160 -0
- package/elicitation/elicitation.types.d.ts.map +1 -0
- package/elicitation/flows/elicitation-request.flow.d.ts +98 -0
- package/elicitation/flows/elicitation-request.flow.d.ts.map +1 -0
- package/elicitation/flows/elicitation-result.flow.d.ts +79 -0
- package/elicitation/flows/elicitation-result.flow.d.ts.map +1 -0
- package/elicitation/flows/index.d.ts +10 -0
- package/elicitation/flows/index.d.ts.map +1 -0
- package/elicitation/helpers/elicit.helper.d.ts +65 -0
- package/elicitation/helpers/elicit.helper.d.ts.map +1 -0
- package/elicitation/helpers/extend-output-schema.d.ts +31 -0
- package/elicitation/helpers/extend-output-schema.d.ts.map +1 -0
- package/elicitation/helpers/fallback.helper.d.ts +60 -0
- package/elicitation/helpers/fallback.helper.d.ts.map +1 -0
- package/elicitation/helpers/index.d.ts +12 -0
- package/elicitation/helpers/index.d.ts.map +1 -0
- package/elicitation/helpers/validate-elicitation-content.d.ts +52 -0
- package/elicitation/helpers/validate-elicitation-content.d.ts.map +1 -0
- package/elicitation/hooks/elicitation.hooks.d.ts +66 -0
- package/elicitation/hooks/elicitation.hooks.d.ts.map +1 -0
- package/elicitation/hooks/index.d.ts +9 -0
- package/elicitation/hooks/index.d.ts.map +1 -0
- package/elicitation/index.d.ts +18 -0
- package/elicitation/index.d.ts.map +1 -0
- package/elicitation/send-elicitation-result.tool.d.ts +18 -0
- package/elicitation/send-elicitation-result.tool.d.ts.map +1 -0
- package/elicitation/store/elicitation-encryption.d.ts +134 -0
- package/elicitation/store/elicitation-encryption.d.ts.map +1 -0
- package/elicitation/store/elicitation-store.factory.d.ts +197 -0
- package/elicitation/store/elicitation-store.factory.d.ts.map +1 -0
- package/elicitation/store/elicitation.store.d.ts +191 -0
- package/elicitation/store/elicitation.store.d.ts.map +1 -0
- package/elicitation/store/encrypted-elicitation.store.d.ts +121 -0
- package/elicitation/store/encrypted-elicitation.store.d.ts.map +1 -0
- package/elicitation/store/index.d.ts +14 -0
- package/elicitation/store/index.d.ts.map +1 -0
- package/elicitation/store/storage-elicitation.store.d.ts +118 -0
- package/elicitation/store/storage-elicitation.store.d.ts.map +1 -0
- package/errors/elicitation.error.d.ts +115 -0
- package/errors/elicitation.error.d.ts.map +1 -0
- package/errors/index.d.ts +1 -0
- package/errors/index.d.ts.map +1 -1
- package/esm/index.mjs +30824 -19537
- package/esm/package.json +13 -7
- package/ext-apps/ext-apps.handler.d.ts +177 -0
- package/ext-apps/ext-apps.handler.d.ts.map +1 -0
- package/ext-apps/ext-apps.types.d.ts +273 -0
- package/ext-apps/ext-apps.types.d.ts.map +1 -0
- package/ext-apps/index.d.ts +13 -0
- package/ext-apps/index.d.ts.map +1 -0
- package/flows/flow.instance.d.ts.map +1 -1
- package/front-mcp/front-mcp.d.ts +64 -2
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/front-mcp/front-mcp.providers.d.ts +604 -236
- package/front-mcp/front-mcp.providers.d.ts.map +1 -1
- package/index.d.ts +17 -0
- package/index.d.ts.map +1 -1
- package/index.js +31066 -19707
- package/notification/index.d.ts +1 -1
- package/notification/index.d.ts.map +1 -1
- package/notification/notification.service.d.ts +18 -0
- package/notification/notification.service.d.ts.map +1 -1
- package/package.json +13 -7
- package/plugin/plugin.registry.d.ts +2 -0
- package/plugin/plugin.registry.d.ts.map +1 -1
- package/provider/provider.registry.d.ts +8 -3
- package/provider/provider.registry.d.ts.map +1 -1
- package/scope/flows/http.request.flow.d.ts +4 -0
- package/scope/flows/http.request.flow.d.ts.map +1 -1
- package/scope/scope.instance.d.ts +74 -0
- package/scope/scope.instance.d.ts.map +1 -1
- package/server/server.instance.d.ts +3 -3
- package/server/server.instance.d.ts.map +1 -1
- package/skill/auth/index.d.ts +10 -0
- package/skill/auth/index.d.ts.map +1 -0
- package/skill/auth/skill-http-auth.d.ts +112 -0
- package/skill/auth/skill-http-auth.d.ts.map +1 -0
- package/skill/cache/index.d.ts +13 -0
- package/skill/cache/index.d.ts.map +1 -0
- package/skill/cache/skill-http-cache.d.ts +144 -0
- package/skill/cache/skill-http-cache.d.ts.map +1 -0
- package/skill/cache/skill-http-cache.factory.d.ts +83 -0
- package/skill/cache/skill-http-cache.factory.d.ts.map +1 -0
- package/skill/cache/skill-http-cache.holder.d.ts +35 -0
- package/skill/cache/skill-http-cache.holder.d.ts.map +1 -0
- package/skill/errors/index.d.ts +3 -0
- package/skill/errors/index.d.ts.map +1 -0
- package/skill/errors/skill-validation.error.d.ts +110 -0
- package/skill/errors/skill-validation.error.d.ts.map +1 -0
- package/skill/errors/tool-not-allowed.error.d.ts +66 -0
- package/skill/errors/tool-not-allowed.error.d.ts.map +1 -0
- package/skill/flows/http/index.d.ts +12 -0
- package/skill/flows/http/index.d.ts.map +1 -0
- package/skill/flows/http/llm-full-txt.flow.d.ts +70 -0
- package/skill/flows/http/llm-full-txt.flow.d.ts.map +1 -0
- package/skill/flows/http/llm-txt.flow.d.ts +77 -0
- package/skill/flows/http/llm-txt.flow.d.ts.map +1 -0
- package/skill/flows/http/skills-api.flow.d.ts +81 -0
- package/skill/flows/http/skills-api.flow.d.ts.map +1 -0
- package/skill/flows/index.d.ts +13 -0
- package/skill/flows/index.d.ts.map +1 -0
- package/skill/flows/load-skill.flow.d.ts +169 -0
- package/skill/flows/load-skill.flow.d.ts.map +1 -0
- package/skill/flows/search-skills.flow.d.ts +101 -0
- package/skill/flows/search-skills.flow.d.ts.map +1 -0
- package/skill/guards/index.d.ts +2 -0
- package/skill/guards/index.d.ts.map +1 -0
- package/skill/guards/tool-authorization.guard.d.ts +87 -0
- package/skill/guards/tool-authorization.guard.d.ts.map +1 -0
- package/skill/hooks/index.d.ts +2 -0
- package/skill/hooks/index.d.ts.map +1 -0
- package/skill/hooks/skill-tool.hook.d.ts +52 -0
- package/skill/hooks/skill-tool.hook.d.ts.map +1 -0
- package/skill/index.d.ts +74 -0
- package/skill/index.d.ts.map +1 -0
- package/skill/providers/external-skill.provider.d.ts +240 -0
- package/skill/providers/external-skill.provider.d.ts.map +1 -0
- package/skill/providers/index.d.ts +12 -0
- package/skill/providers/index.d.ts.map +1 -0
- package/skill/providers/memory-skill.provider.d.ts +97 -0
- package/skill/providers/memory-skill.provider.d.ts.map +1 -0
- package/skill/session/index.d.ts +4 -0
- package/skill/session/index.d.ts.map +1 -0
- package/skill/session/skill-session-store.interface.d.ts +79 -0
- package/skill/session/skill-session-store.interface.d.ts.map +1 -0
- package/skill/session/skill-session.manager.d.ts +137 -0
- package/skill/session/skill-session.manager.d.ts.map +1 -0
- package/skill/session/skill-session.types.d.ts +303 -0
- package/skill/session/skill-session.types.d.ts.map +1 -0
- package/skill/skill-http.utils.d.ts +107 -0
- package/skill/skill-http.utils.d.ts.map +1 -0
- package/skill/skill-mode.utils.d.ts +53 -0
- package/skill/skill-mode.utils.d.ts.map +1 -0
- package/skill/skill-scope.helper.d.ts +55 -0
- package/skill/skill-scope.helper.d.ts.map +1 -0
- package/skill/skill-storage.factory.d.ts +194 -0
- package/skill/skill-storage.factory.d.ts.map +1 -0
- package/skill/skill-storage.interface.d.ts +230 -0
- package/skill/skill-storage.interface.d.ts.map +1 -0
- package/skill/skill-validator.d.ts +63 -0
- package/skill/skill-validator.d.ts.map +1 -0
- package/skill/skill.events.d.ts +88 -0
- package/skill/skill.events.d.ts.map +1 -0
- package/skill/skill.instance.d.ts +92 -0
- package/skill/skill.instance.d.ts.map +1 -0
- package/skill/skill.registry.d.ts +309 -0
- package/skill/skill.registry.d.ts.map +1 -0
- package/skill/skill.utils.d.ts +90 -0
- package/skill/skill.utils.d.ts.map +1 -0
- package/skill/sync/index.d.ts +16 -0
- package/skill/sync/index.d.ts.map +1 -0
- package/skill/sync/memory-sync-state.store.d.ts +49 -0
- package/skill/sync/memory-sync-state.store.d.ts.map +1 -0
- package/skill/sync/skill-hash.d.ts +65 -0
- package/skill/sync/skill-hash.d.ts.map +1 -0
- package/skill/sync/sync-state.interface.d.ts +125 -0
- package/skill/sync/sync-state.interface.d.ts.map +1 -0
- package/skill/tools/index.d.ts +21 -0
- package/skill/tools/index.d.ts.map +1 -0
- package/skill/tools/load-skills.tool.d.ts +76 -0
- package/skill/tools/load-skills.tool.d.ts.map +1 -0
- package/skill/tools/search-skills.tool.d.ts +61 -0
- package/skill/tools/search-skills.tool.d.ts.map +1 -0
- package/tool/flows/call-tool.flow.d.ts +1 -0
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tools-list.flow.d.ts +15 -0
- package/tool/flows/tools-list.flow.d.ts.map +1 -1
- package/tool/tool.instance.d.ts +8 -0
- package/tool/tool.instance.d.ts.map +1 -1
- package/tool/tool.registry.d.ts +11 -0
- package/tool/tool.registry.d.ts.map +1 -1
- package/tool/tool.utils.d.ts.map +1 -1
- package/tool/ui/template-helpers.d.ts +0 -5
- package/tool/ui/template-helpers.d.ts.map +1 -1
- package/transport/adapters/streamable-http-transport.d.ts.map +1 -1
- package/transport/adapters/transport.local.adapter.d.ts +54 -9
- package/transport/adapters/transport.local.adapter.d.ts.map +1 -1
- package/transport/adapters/transport.sse.adapter.d.ts +11 -2
- package/transport/adapters/transport.sse.adapter.d.ts.map +1 -1
- package/transport/adapters/transport.streamable-http.adapter.d.ts +21 -2
- package/transport/adapters/transport.streamable-http.adapter.d.ts.map +1 -1
- package/transport/event-stores/event-store.factory.d.ts +96 -0
- package/transport/event-stores/event-store.factory.d.ts.map +1 -0
- package/transport/event-stores/index.d.ts +47 -0
- package/transport/event-stores/index.d.ts.map +1 -0
- package/transport/event-stores/memory.event-store.d.ts +51 -0
- package/transport/event-stores/memory.event-store.d.ts.map +1 -0
- package/transport/event-stores/redis.event-store.d.ts +79 -0
- package/transport/event-stores/redis.event-store.d.ts.map +1 -0
- package/transport/flows/handle.sse.flow.d.ts.map +1 -1
- package/transport/flows/handle.streamable-http.flow.d.ts +3 -1
- package/transport/flows/handle.streamable-http.flow.d.ts.map +1 -1
- package/transport/in-memory-server.d.ts +85 -0
- package/transport/in-memory-server.d.ts.map +1 -0
- package/transport/index.d.ts +47 -0
- package/transport/index.d.ts.map +1 -1
- package/transport/mcp-handlers/complete-request.handler.d.ts +3 -84
- package/transport/mcp-handlers/complete-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/get-prompt-request.handler.d.ts +3 -128
- package/transport/mcp-handlers/get-prompt-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/index.d.ts +463 -490
- package/transport/mcp-handlers/index.d.ts.map +1 -1
- package/transport/mcp-handlers/initialize-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-prompts-request.handler.d.ts +3 -70
- package/transport/mcp-handlers/list-prompts-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-resource-templates-request.handler.d.ts +3 -72
- package/transport/mcp-handlers/list-resource-templates-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-resources-request.handler.d.ts +3 -72
- package/transport/mcp-handlers/list-resources-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/list-tools-request.handler.d.ts +3 -85
- package/transport/mcp-handlers/list-tools-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/read-resource-request.handler.d.ts +3 -61
- package/transport/mcp-handlers/read-resource-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-list-request.handler.d.ts +9 -0
- package/transport/mcp-handlers/skills-list-request.handler.d.ts.map +1 -0
- package/transport/mcp-handlers/skills-load-request.handler.d.ts +9 -0
- package/transport/mcp-handlers/skills-load-request.handler.d.ts.map +1 -0
- package/transport/mcp-handlers/skills-mcp.types.d.ts +157 -0
- package/transport/mcp-handlers/skills-mcp.types.d.ts.map +1 -0
- package/transport/mcp-handlers/skills-search-request.handler.d.ts +9 -0
- package/transport/mcp-handlers/skills-search-request.handler.d.ts.map +1 -0
- package/transport/transport.registry.d.ts +9 -1
- package/transport/transport.registry.d.ts.map +1 -1
- package/transport/transport.types.d.ts +1 -8
- package/transport/transport.types.d.ts.map +1 -1
- package/auth/jwks/dev-key-persistence.d.ts +0 -64
- package/auth/jwks/dev-key-persistence.d.ts.map +0 -1
- package/auth/jwks/index.d.ts +0 -4
- package/auth/jwks/index.d.ts.map +0 -1
- package/auth/jwks/jwks.service.d.ts +0 -58
- package/auth/jwks/jwks.service.d.ts.map +0 -1
- package/auth/jwks/jwks.types.d.ts +0 -33
- package/auth/jwks/jwks.types.d.ts.map +0 -1
- package/auth/jwks/jwks.utils.d.ts +0 -5
- package/auth/jwks/jwks.utils.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.authorize.flow.d.ts +0 -32
- package/auth/oauth/flows/oauth.authorize.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.device-authorization.flow.d.ts +0 -47
- package/auth/oauth/flows/oauth.device-authorization.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.introspect.flow.d.ts +0 -27
- package/auth/oauth/flows/oauth.introspect.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.par.flow.d.ts +0 -28
- package/auth/oauth/flows/oauth.par.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.revoke.flow.d.ts +0 -26
- package/auth/oauth/flows/oauth.revoke.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.token.flow.d.ts +0 -58
- package/auth/oauth/flows/oauth.token.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oauth.userinfo.flow.d.ts +0 -23
- package/auth/oauth/flows/oauth.userinfo.flow.d.ts.map +0 -1
- package/auth/oauth/flows/oidc.logout.flow.d.ts +0 -19
- package/auth/oauth/flows/oidc.logout.flow.d.ts.map +0 -1
- package/auth/session/authorization-vault.d.ts +0 -612
- package/auth/session/authorization-vault.d.ts.map +0 -1
- package/auth/session/authorization.store.d.ts +0 -302
- package/auth/session/authorization.store.d.ts.map +0 -1
- package/auth/session/record/session.stateful.d.ts +0 -21
- package/auth/session/record/session.stateful.d.ts.map +0 -1
- package/auth/session/record/session.stateless.d.ts +0 -18
- package/auth/session/record/session.stateless.d.ts.map +0 -1
- package/auth/session/record/session.transparent.d.ts +0 -18
- package/auth/session/record/session.transparent.d.ts.map +0 -1
- package/auth/session/session.crypto.d.ts +0 -8
- package/auth/session/session.crypto.d.ts.map +0 -1
- package/auth/session/session.schema.d.ts +0 -6
- package/auth/session/session.schema.d.ts.map +0 -1
- package/auth/session/token.store.d.ts +0 -36
- package/auth/session/token.store.d.ts.map +0 -1
- package/auth/session/token.vault.d.ts +0 -27
- package/auth/session/token.vault.d.ts.map +0 -1
- package/auth/session/vault-encryption.d.ts +0 -190
- package/auth/session/vault-encryption.d.ts.map +0 -1
- package/auth/utils/audience.validator.d.ts +0 -130
- package/auth/utils/audience.validator.d.ts.map +0 -1
- package/auth/utils/www-authenticate.utils.d.ts +0 -98
- package/auth/utils/www-authenticate.utils.d.ts.map +0 -1
- package/common/migrate/auth-transport.migrate.d.ts +0 -63
- package/common/migrate/auth-transport.migrate.d.ts.map +0 -1
- package/common/migrate/index.d.ts +0 -2
- package/common/migrate/index.d.ts.map +0 -1
- package/common/types/options/auth/auth.interfaces.d.ts.map +0 -1
- package/common/types/options/auth/auth.schema.d.ts.map +0 -1
- package/common/types/options/auth/auth.typecheck.d.ts +0 -2
- package/common/types/options/auth/auth.typecheck.d.ts.map +0 -1
- package/common/types/options/auth/auth.utils.d.ts.map +0 -1
- package/common/types/options/auth/transport.deprecated.d.ts +0 -64
- package/common/types/options/auth/transport.deprecated.d.ts.map +0 -1
- package/common/types/options/http.options.d.ts +0 -15
- package/common/types/options/http.options.d.ts.map +0 -1
- package/common/types/options/logging.options.d.ts +0 -29
- package/common/types/options/logging.options.d.ts.map +0 -1
- package/common/types/options/redis.options.d.ts.map +0 -1
- package/common/types/options/server-info.options.d.ts.map +0 -1
- package/common/types/options/session.options.d.ts +0 -148
- package/common/types/options/session.options.d.ts.map +0 -1
- package/common/types/options/transport.options.d.ts +0 -178
- package/common/types/options/transport.options.d.ts.map +0 -1
- package/context/request-context-storage.d.ts +0 -90
- package/context/request-context-storage.d.ts.map +0 -1
- package/context/request-context.d.ts +0 -185
- package/context/request-context.d.ts.map +0 -1
- package/context/request-context.provider.d.ts +0 -38
- package/context/request-context.provider.d.ts.map +0 -1
- package/context/session-key.provider.d.ts +0 -46
- package/context/session-key.provider.d.ts.map +0 -1
- package/store/adapters/store.base.adapter.d.ts +0 -22
- package/store/adapters/store.base.adapter.d.ts.map +0 -1
- package/store/adapters/store.memory.adapter.d.ts +0 -27
- package/store/adapters/store.memory.adapter.d.ts.map +0 -1
- package/store/adapters/store.redis.adapter.d.ts +0 -34
- package/store/adapters/store.redis.adapter.d.ts.map +0 -1
- package/store/adapters/store.vercel-kv.adapter.d.ts +0 -87
- package/store/adapters/store.vercel-kv.adapter.d.ts.map +0 -1
- package/store/index.d.ts +0 -11
- package/store/index.d.ts.map +0 -1
- package/store/store.factory.d.ts.map +0 -1
- package/store/store.helpers.d.ts +0 -10
- package/store/store.helpers.d.ts.map +0 -1
- package/store/store.registry.d.ts +0 -14
- package/store/store.registry.d.ts.map +0 -1
- package/store/store.tokens.d.ts +0 -4
- package/store/store.tokens.d.ts.map +0 -1
- package/store/store.types.d.ts +0 -65
- package/store/store.types.d.ts.map +0 -1
- package/store/store.utils.d.ts +0 -9
- package/store/store.utils.d.ts.map +0 -1
- package/transport/transport.event-store.d.ts +0 -11
- package/transport/transport.event-store.d.ts.map +0 -1
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import type { FrontMcpLogger } from '../../common';
|
|
2
|
+
import type { SkillContent } from '../../common/interfaces';
|
|
3
|
+
import type { SkillMetadata } from '../../common/metadata';
|
|
4
|
+
import type { SkillStorageProvider, SkillSearchOptions, SkillSearchResult, SkillLoadResult, SkillListOptions, SkillListResult } from '../skill-storage.interface';
|
|
5
|
+
import type { SkillSyncState, SkillSyncStateStore, SyncResult } from '../sync/sync-state.interface';
|
|
6
|
+
/**
|
|
7
|
+
* Operating mode for external skill providers.
|
|
8
|
+
*
|
|
9
|
+
* - 'read-only': Skills are fetched from external storage, no local writes
|
|
10
|
+
* - 'persistent': Local skills are synced to external storage with SHA-based change detection
|
|
11
|
+
*/
|
|
12
|
+
export type ExternalSkillMode = 'read-only' | 'persistent';
|
|
13
|
+
/**
|
|
14
|
+
* Options for creating an external skill provider.
|
|
15
|
+
*/
|
|
16
|
+
export interface ExternalSkillProviderOptions {
|
|
17
|
+
/**
|
|
18
|
+
* Operating mode for the provider.
|
|
19
|
+
* @see ExternalSkillMode
|
|
20
|
+
*/
|
|
21
|
+
mode: ExternalSkillMode;
|
|
22
|
+
/**
|
|
23
|
+
* Store for persisting sync state.
|
|
24
|
+
* Required for persistent mode, optional for read-only.
|
|
25
|
+
*/
|
|
26
|
+
syncStateStore?: SkillSyncStateStore;
|
|
27
|
+
/**
|
|
28
|
+
* Logger instance for diagnostic output.
|
|
29
|
+
*/
|
|
30
|
+
logger?: FrontMcpLogger;
|
|
31
|
+
/**
|
|
32
|
+
* Default number of search results.
|
|
33
|
+
* @default 10
|
|
34
|
+
*/
|
|
35
|
+
defaultTopK?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Default minimum similarity threshold.
|
|
38
|
+
* @default 0.1
|
|
39
|
+
*/
|
|
40
|
+
defaultMinScore?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Options for skill search in external storage.
|
|
44
|
+
*/
|
|
45
|
+
export interface ExternalSkillSearchOptions extends SkillSearchOptions {
|
|
46
|
+
/**
|
|
47
|
+
* Include metadata like embeddings in results.
|
|
48
|
+
*/
|
|
49
|
+
includeMetadata?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Options for listing skills from external storage.
|
|
53
|
+
*/
|
|
54
|
+
export interface ExternalSkillListOptions extends SkillListOptions {
|
|
55
|
+
/**
|
|
56
|
+
* Cursor for pagination (provider-specific).
|
|
57
|
+
*/
|
|
58
|
+
cursor?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Abstract base class for external skill storage providers.
|
|
62
|
+
*
|
|
63
|
+
* Provides two operating modes:
|
|
64
|
+
*
|
|
65
|
+
* **Read-Only Mode:**
|
|
66
|
+
* - All search/load operations fetch from external storage
|
|
67
|
+
* - No local persistence or modification
|
|
68
|
+
* - Use case: Pull skills from a shared skill repository
|
|
69
|
+
*
|
|
70
|
+
* **Persistent Mode:**
|
|
71
|
+
* - Local skills are synced to external storage
|
|
72
|
+
* - SHA-based change detection minimizes writes
|
|
73
|
+
* - Tracks sync state to detect added/updated/removed skills
|
|
74
|
+
* - Use case: Publish local skills to external vector DB
|
|
75
|
+
*
|
|
76
|
+
* @example Implementing a REST API provider
|
|
77
|
+
* ```typescript
|
|
78
|
+
* class RestSkillProvider extends ExternalSkillProviderBase {
|
|
79
|
+
* constructor(private apiUrl: string, options: ExternalSkillProviderOptions) {
|
|
80
|
+
* super(options);
|
|
81
|
+
* }
|
|
82
|
+
*
|
|
83
|
+
* protected async fetchSkill(skillId: string): Promise<SkillContent | null> {
|
|
84
|
+
* const response = await fetch(`${this.apiUrl}/skills/${skillId}`);
|
|
85
|
+
* if (!response.ok) return null;
|
|
86
|
+
* return response.json();
|
|
87
|
+
* }
|
|
88
|
+
*
|
|
89
|
+
* // ... implement other abstract methods
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare abstract class ExternalSkillProviderBase implements SkillStorageProvider {
|
|
94
|
+
readonly type: "external";
|
|
95
|
+
/** Operating mode */
|
|
96
|
+
protected readonly mode: ExternalSkillMode;
|
|
97
|
+
/** Current sync state (loaded from store on init) */
|
|
98
|
+
protected syncState: SkillSyncState | null;
|
|
99
|
+
/** Store for persisting sync state */
|
|
100
|
+
protected readonly syncStateStore?: SkillSyncStateStore;
|
|
101
|
+
/** Logger instance */
|
|
102
|
+
protected readonly logger?: FrontMcpLogger;
|
|
103
|
+
/** Default search result count */
|
|
104
|
+
protected readonly defaultTopK: number;
|
|
105
|
+
/** Default minimum similarity threshold */
|
|
106
|
+
protected readonly defaultMinScore: number;
|
|
107
|
+
/** Whether the provider has been initialized */
|
|
108
|
+
private initialized;
|
|
109
|
+
constructor(options: ExternalSkillProviderOptions);
|
|
110
|
+
/**
|
|
111
|
+
* Fetch a single skill from external storage.
|
|
112
|
+
*
|
|
113
|
+
* @param skillId - The skill identifier
|
|
114
|
+
* @returns The skill content or null if not found
|
|
115
|
+
*/
|
|
116
|
+
protected abstract fetchSkill(skillId: string): Promise<SkillContent | null>;
|
|
117
|
+
/**
|
|
118
|
+
* Fetch multiple skills from external storage.
|
|
119
|
+
*
|
|
120
|
+
* @param options - List options (pagination, filtering)
|
|
121
|
+
* @returns Array of skill content
|
|
122
|
+
*/
|
|
123
|
+
protected abstract fetchSkills(options?: ExternalSkillListOptions): Promise<SkillContent[]>;
|
|
124
|
+
/**
|
|
125
|
+
* Search for skills in external storage.
|
|
126
|
+
*
|
|
127
|
+
* @param query - Search query string
|
|
128
|
+
* @param options - Search options
|
|
129
|
+
* @returns Array of search results with scores
|
|
130
|
+
*/
|
|
131
|
+
protected abstract searchExternal(query: string, options?: ExternalSkillSearchOptions): Promise<SkillSearchResult[]>;
|
|
132
|
+
/**
|
|
133
|
+
* Add or update a skill in external storage.
|
|
134
|
+
*
|
|
135
|
+
* @param skill - The skill content to upsert
|
|
136
|
+
*/
|
|
137
|
+
protected abstract upsertSkill(skill: SkillContent): Promise<void>;
|
|
138
|
+
/**
|
|
139
|
+
* Delete a skill from external storage.
|
|
140
|
+
*
|
|
141
|
+
* @param skillId - The skill identifier to delete
|
|
142
|
+
*/
|
|
143
|
+
protected abstract deleteSkill(skillId: string): Promise<void>;
|
|
144
|
+
/**
|
|
145
|
+
* Get the total count of skills in external storage.
|
|
146
|
+
*
|
|
147
|
+
* @param options - Filter options
|
|
148
|
+
*/
|
|
149
|
+
protected abstract countExternal(options?: {
|
|
150
|
+
tags?: string[];
|
|
151
|
+
includeHidden?: boolean;
|
|
152
|
+
}): Promise<number>;
|
|
153
|
+
/**
|
|
154
|
+
* Check if a skill exists in external storage.
|
|
155
|
+
*
|
|
156
|
+
* @param skillId - The skill identifier
|
|
157
|
+
*/
|
|
158
|
+
protected abstract existsExternal(skillId: string): Promise<boolean>;
|
|
159
|
+
/**
|
|
160
|
+
* Initialize the provider.
|
|
161
|
+
* Loads sync state for persistent mode.
|
|
162
|
+
*/
|
|
163
|
+
initialize(): Promise<void>;
|
|
164
|
+
/**
|
|
165
|
+
* Search for skills.
|
|
166
|
+
* Delegates to the abstract searchExternal method.
|
|
167
|
+
*/
|
|
168
|
+
search(query: string, options?: SkillSearchOptions): Promise<SkillSearchResult[]>;
|
|
169
|
+
/**
|
|
170
|
+
* Load a skill by ID.
|
|
171
|
+
* Fetches from external storage and constructs a SkillLoadResult.
|
|
172
|
+
*/
|
|
173
|
+
load(skillId: string): Promise<SkillLoadResult | null>;
|
|
174
|
+
/**
|
|
175
|
+
* List skills with pagination.
|
|
176
|
+
*/
|
|
177
|
+
list(options?: SkillListOptions): Promise<SkillListResult>;
|
|
178
|
+
/**
|
|
179
|
+
* Check if a skill exists.
|
|
180
|
+
*/
|
|
181
|
+
exists(skillId: string): Promise<boolean>;
|
|
182
|
+
/**
|
|
183
|
+
* Count skills.
|
|
184
|
+
*/
|
|
185
|
+
count(options?: {
|
|
186
|
+
tags?: string[];
|
|
187
|
+
includeHidden?: boolean;
|
|
188
|
+
}): Promise<number>;
|
|
189
|
+
/**
|
|
190
|
+
* Dispose of resources.
|
|
191
|
+
*/
|
|
192
|
+
dispose(): Promise<void>;
|
|
193
|
+
/**
|
|
194
|
+
* Sync local skills to external storage.
|
|
195
|
+
*
|
|
196
|
+
* This method:
|
|
197
|
+
* 1. Loads previous sync state
|
|
198
|
+
* 2. Computes SHA-256 hash for each local skill
|
|
199
|
+
* 3. Compares hashes to detect changes
|
|
200
|
+
* 4. Upserts new/changed skills
|
|
201
|
+
* 5. Deletes skills no longer present locally
|
|
202
|
+
* 6. Saves updated sync state
|
|
203
|
+
*
|
|
204
|
+
* @param localSkills - Array of local skill content to sync
|
|
205
|
+
* @returns Sync result with added/updated/unchanged/removed counts
|
|
206
|
+
* @throws Error if called in read-only mode
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```typescript
|
|
210
|
+
* const result = await provider.syncSkills(localSkills);
|
|
211
|
+
* console.log(`Synced: ${result.added.length} added, ${result.updated.length} updated`);
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
syncSkills(localSkills: SkillContent[]): Promise<SyncResult>;
|
|
215
|
+
/**
|
|
216
|
+
* Get the current sync state.
|
|
217
|
+
* Returns null if in read-only mode or never synced.
|
|
218
|
+
* Returns a deep copy to prevent external mutation.
|
|
219
|
+
*/
|
|
220
|
+
getSyncState(): SkillSyncState | null;
|
|
221
|
+
/**
|
|
222
|
+
* Clear the sync state.
|
|
223
|
+
* Forces a full re-sync on next syncSkills call.
|
|
224
|
+
*/
|
|
225
|
+
clearSyncState(): Promise<void>;
|
|
226
|
+
/**
|
|
227
|
+
* Check if the provider is operating in read-only mode.
|
|
228
|
+
*/
|
|
229
|
+
isReadOnly(): boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Check if the provider is operating in persistent mode.
|
|
232
|
+
*/
|
|
233
|
+
isPersistent(): boolean;
|
|
234
|
+
/**
|
|
235
|
+
* Convert SkillContent to SkillMetadata.
|
|
236
|
+
* Override in subclasses if additional metadata is available.
|
|
237
|
+
*/
|
|
238
|
+
protected skillToMetadata(skill: SkillContent): SkillMetadata;
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=external-skill.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-skill.provider.d.ts","sourceRoot":"","sources":["../../../src/skill/providers/external-skill.provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAA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AC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAQvF;;;OAGG;IACG,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC;IAkB5D;;OAEG;IACG,IAAI,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAiBhE;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/C;;OAEG;IACG,KAAK,CAAC,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAIpF;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAU9B;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,UAAU,CAAC,WAAW,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IAiIlE;;;;OAIG;IACH,YAAY,IAAI,cAAc,GAAG,IAAI;IAcrC;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAQrC;;OAEG;IACH,UAAU,IAAI,OAAO;IAIrB;;OAEG;IACH,YAAY,IAAI,OAAO;IAQvB;;;OAGG;IACH,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,aAAa;CAqB9D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Storage Providers
|
|
3
|
+
*
|
|
4
|
+
* Implementations of SkillStorageProvider for different backends.
|
|
5
|
+
*
|
|
6
|
+
* @module skill/providers
|
|
7
|
+
*/
|
|
8
|
+
export { MemorySkillProvider } from './memory-skill.provider';
|
|
9
|
+
export type { MemorySkillProviderOptions } from './memory-skill.provider';
|
|
10
|
+
export { ExternalSkillProviderBase } from './external-skill.provider';
|
|
11
|
+
export type { ExternalSkillMode, ExternalSkillProviderOptions, ExternalSkillSearchOptions, ExternalSkillListOptions, } from './external-skill.provider';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/skill/providers/index.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAG1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { SkillContent } from '../../common/interfaces';
|
|
2
|
+
import { SkillToolValidator } from '../skill-validator';
|
|
3
|
+
import { SkillStorageProviderType, SkillSearchOptions, SkillSearchResult, SkillLoadResult, SkillListOptions, SkillListResult, MutableSkillStorageProvider } from '../skill-storage.interface';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for MemorySkillProvider.
|
|
6
|
+
*/
|
|
7
|
+
export interface MemorySkillProviderOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Default number of search results.
|
|
10
|
+
* @default 10
|
|
11
|
+
*/
|
|
12
|
+
defaultTopK?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Default minimum similarity threshold.
|
|
15
|
+
* @default 0.1
|
|
16
|
+
*/
|
|
17
|
+
defaultMinScore?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Optional tool validator for enriching results.
|
|
20
|
+
*/
|
|
21
|
+
toolValidator?: SkillToolValidator;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* In-memory skill storage provider using TF-IDF for search.
|
|
25
|
+
*
|
|
26
|
+
* This is the default provider used when no external storage is configured.
|
|
27
|
+
* It stores skills in memory and uses TF-IDF vectorization for similarity search.
|
|
28
|
+
*/
|
|
29
|
+
export declare class MemorySkillProvider implements MutableSkillStorageProvider {
|
|
30
|
+
readonly type: SkillStorageProviderType;
|
|
31
|
+
private vectorDB;
|
|
32
|
+
private skills;
|
|
33
|
+
private defaultTopK;
|
|
34
|
+
private defaultMinScore;
|
|
35
|
+
private toolValidator?;
|
|
36
|
+
private initialized;
|
|
37
|
+
constructor(options?: MemorySkillProviderOptions);
|
|
38
|
+
/**
|
|
39
|
+
* Set the tool validator after construction.
|
|
40
|
+
* Useful when the validator isn't available at construction time.
|
|
41
|
+
*/
|
|
42
|
+
setToolValidator(validator: SkillToolValidator): void;
|
|
43
|
+
initialize(): Promise<void>;
|
|
44
|
+
search(query: string, options?: SkillSearchOptions): Promise<SkillSearchResult[]>;
|
|
45
|
+
load(skillId: string): Promise<SkillLoadResult | null>;
|
|
46
|
+
list(options?: SkillListOptions): Promise<SkillListResult>;
|
|
47
|
+
exists(skillId: string): Promise<boolean>;
|
|
48
|
+
count(options?: {
|
|
49
|
+
tags?: string[];
|
|
50
|
+
includeHidden?: boolean;
|
|
51
|
+
}): Promise<number>;
|
|
52
|
+
add(skill: SkillContent): Promise<void>;
|
|
53
|
+
update(skillId: string, skill: SkillContent): Promise<void>;
|
|
54
|
+
remove(skillId: string): Promise<void>;
|
|
55
|
+
clear(): Promise<void>;
|
|
56
|
+
dispose(): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Bulk add skills (more efficient than adding one by one).
|
|
59
|
+
*/
|
|
60
|
+
addMany(skills: SkillContent[]): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Index a single skill in the vector database.
|
|
63
|
+
*/
|
|
64
|
+
private indexSkill;
|
|
65
|
+
/**
|
|
66
|
+
* Build searchable text for TF-IDF indexing.
|
|
67
|
+
* Uses term weighting to improve relevance:
|
|
68
|
+
* - Description: 3x weight (most important for matching)
|
|
69
|
+
* - Tags: 2x weight
|
|
70
|
+
* - Tools: 1x weight
|
|
71
|
+
* - Name: 1x weight
|
|
72
|
+
*/
|
|
73
|
+
private buildSearchableText;
|
|
74
|
+
/**
|
|
75
|
+
* Convert SkillContent to SkillMetadata.
|
|
76
|
+
* This is needed because SkillContent doesn't store the original metadata format.
|
|
77
|
+
*/
|
|
78
|
+
private skillToMetadata;
|
|
79
|
+
/**
|
|
80
|
+
* Get tags from a skill (stored in metadata but not in SkillContent directly).
|
|
81
|
+
* We store them in a custom property for now.
|
|
82
|
+
*/
|
|
83
|
+
private getSkillTags;
|
|
84
|
+
/**
|
|
85
|
+
* Check if a skill is hidden from discovery.
|
|
86
|
+
*/
|
|
87
|
+
private isHidden;
|
|
88
|
+
/**
|
|
89
|
+
* Get priority of a skill.
|
|
90
|
+
*/
|
|
91
|
+
private getPriority;
|
|
92
|
+
/**
|
|
93
|
+
* Get visibility of a skill.
|
|
94
|
+
*/
|
|
95
|
+
private getVisibility;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=memory-skill.provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-skill.provider.d.ts","sourceRoot":"","sources":["../../../src/skill/providers/memory-skill.provider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAwB,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,2BAA2B,EAC5B,MAAM,4BAA4B,CAAC;AAmGpC;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;CACp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G,OAAO,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBpD;;OAEG;IACH,OAAO,CAAC,UAAU;IAelB;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IA0D3B;;;OAGG;IACH,OAAO,CAAC,eAAe;IAiCvB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAMpB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAIhB;;OAEG;IACH,OAAO,CAAC,WAAW;IAInB;;OAEG;IACH,OAAO,CAAC,aAAa;CAGtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/skill/session/index.ts"],"names":[],"mappings":"AAEA,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { SkillSessionState } from './skill-session.types';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for skill session storage.
|
|
4
|
+
* Implementations can store session state in memory, Redis, etc.
|
|
5
|
+
*/
|
|
6
|
+
export interface SkillSessionStore {
|
|
7
|
+
/**
|
|
8
|
+
* Save or update a session state.
|
|
9
|
+
*/
|
|
10
|
+
save(session: SkillSessionState): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Get a session state by ID.
|
|
13
|
+
* Returns null if session doesn't exist.
|
|
14
|
+
*/
|
|
15
|
+
get(sessionId: string): Promise<SkillSessionState | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Update specific fields of a session.
|
|
18
|
+
*/
|
|
19
|
+
update(sessionId: string, updates: Partial<SkillSessionState>): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Delete a session.
|
|
22
|
+
*/
|
|
23
|
+
delete(sessionId: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* List active sessions (sessions with an active skill).
|
|
26
|
+
*/
|
|
27
|
+
listActive(options?: {
|
|
28
|
+
limit?: number;
|
|
29
|
+
}): Promise<SkillSessionState[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Clean up expired sessions.
|
|
32
|
+
* @param maxAge - Maximum age in milliseconds
|
|
33
|
+
*/
|
|
34
|
+
cleanup(maxAge: number): Promise<number>;
|
|
35
|
+
/**
|
|
36
|
+
* Store type identifier.
|
|
37
|
+
*/
|
|
38
|
+
readonly type: 'memory' | 'redis' | 'custom';
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* In-memory implementation of SkillSessionStore.
|
|
42
|
+
* Suitable for single-instance deployments or testing.
|
|
43
|
+
*/
|
|
44
|
+
export declare class MemorySkillSessionStore implements SkillSessionStore {
|
|
45
|
+
readonly type: "memory";
|
|
46
|
+
private sessions;
|
|
47
|
+
/**
|
|
48
|
+
* Deep-clone the activeSkills Map and its nested Sets.
|
|
49
|
+
*/
|
|
50
|
+
private cloneActiveSkills;
|
|
51
|
+
save(session: SkillSessionState): Promise<void>;
|
|
52
|
+
get(sessionId: string): Promise<SkillSessionState | null>;
|
|
53
|
+
update(sessionId: string, updates: Partial<SkillSessionState>): Promise<void>;
|
|
54
|
+
delete(sessionId: string): Promise<void>;
|
|
55
|
+
listActive(options?: {
|
|
56
|
+
limit?: number;
|
|
57
|
+
}): Promise<SkillSessionState[]>;
|
|
58
|
+
cleanup(maxAge: number): Promise<number>;
|
|
59
|
+
/**
|
|
60
|
+
* Clear all sessions. Useful for testing.
|
|
61
|
+
*/
|
|
62
|
+
clear(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Get the number of stored sessions.
|
|
65
|
+
*/
|
|
66
|
+
size(): number;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Factory function to create a skill session store.
|
|
70
|
+
*/
|
|
71
|
+
export declare function createSkillSessionStore(options?: {
|
|
72
|
+
type?: 'memory' | 'redis';
|
|
73
|
+
redis?: {
|
|
74
|
+
host?: string;
|
|
75
|
+
port?: number;
|
|
76
|
+
keyPrefix?: string;
|
|
77
|
+
};
|
|
78
|
+
}): SkillSessionStore;
|
|
79
|
+
//# sourceMappingURL=skill-session-store.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-session-store.interface.d.ts","sourceRoot":"","sources":["../../../src/skill/session/skill-session-store.interface.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;;OAGG;IACH,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;IAE1D;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9E;;OAEG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC;;OAEG;IACH,UAAU,CAAC,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAEvE;;;OAGG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC9C;AAED;;;GAGG;AACH,qBAAa,uBAAwB,YAAW,iBAAiB;IAC/D,QAAQ,CAAC,IAAI,EAAG,QAAQ,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAwC;IAExD;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAcnB,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAY/C,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAezD,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB7E,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC,UAAU,CAAC,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAqBtE,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAe9C;;OAEG;IACH,KAAK,IAAI,IAAI;IAIb;;OAEG;IACH,IAAI,IAAI,MAAM;CAGf;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,CAAC,EAAE;IAChD,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,GAAG,iBAAiB,CAgBpB"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
import type { FrontMcpLogger } from '../../common';
|
|
3
|
+
import type { SkillContent } from '../../common/interfaces';
|
|
4
|
+
import type { SkillLoadResult } from '../skill-storage.interface';
|
|
5
|
+
import { SkillSessionState, SkillSessionOptions, SkillActivationResult, ToolAuthorizationResult, SkillSecurityPolicy, SkillPolicyMode } from './skill-session.types';
|
|
6
|
+
import type { SkillSessionStore } from './skill-session-store.interface';
|
|
7
|
+
/**
|
|
8
|
+
* Manages skill session state and tool authorization.
|
|
9
|
+
*
|
|
10
|
+
* Uses AsyncLocalStorage to track the active skill session per request context.
|
|
11
|
+
* This ensures that tool authorization checks are isolated per MCP session.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const manager = new SkillSessionManager({ defaultPolicyMode: 'strict' });
|
|
16
|
+
*
|
|
17
|
+
* // When loading a skill
|
|
18
|
+
* const result = manager.activateSkill('review-pr', skillContent, loadResult);
|
|
19
|
+
*
|
|
20
|
+
* // When calling a tool
|
|
21
|
+
* const authResult = manager.checkToolAuthorization('github_get_pr');
|
|
22
|
+
* if (!authResult.allowed) {
|
|
23
|
+
* throw new ToolNotAllowedError(authResult);
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* // When done with the skill
|
|
27
|
+
* manager.deactivateSkill();
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare class SkillSessionManager extends EventEmitter {
|
|
31
|
+
private readonly storage;
|
|
32
|
+
private readonly options;
|
|
33
|
+
private readonly logger?;
|
|
34
|
+
private readonly store?;
|
|
35
|
+
constructor(options?: SkillSessionOptions, logger?: FrontMcpLogger, store?: SkillSessionStore);
|
|
36
|
+
/**
|
|
37
|
+
* Run a function within a skill session context.
|
|
38
|
+
* The session state will be available via getActiveSession() within the callback.
|
|
39
|
+
*/
|
|
40
|
+
runWithSession<T>(sessionId: string, fn: () => Promise<T>): Promise<T>;
|
|
41
|
+
/**
|
|
42
|
+
* Get the current session state.
|
|
43
|
+
* Returns undefined if not running within a session context.
|
|
44
|
+
*/
|
|
45
|
+
getActiveSession(): SkillSessionState | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Check if there's an active skill in the current session.
|
|
48
|
+
*/
|
|
49
|
+
hasActiveSkill(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Get the number of active skills in the current session.
|
|
52
|
+
*/
|
|
53
|
+
getActiveSkillCount(): number;
|
|
54
|
+
/**
|
|
55
|
+
* Get IDs of all active skills in the current session.
|
|
56
|
+
*/
|
|
57
|
+
getActiveSkillIds(): string[];
|
|
58
|
+
/**
|
|
59
|
+
* Get names of all active skills in the current session.
|
|
60
|
+
*/
|
|
61
|
+
getActiveSkillNames(): string[];
|
|
62
|
+
/**
|
|
63
|
+
* Activate a skill in the current session.
|
|
64
|
+
* This adds the skill to the active skills and expands the tool allowlist.
|
|
65
|
+
* Multiple skills can be active simultaneously, with their tool allowlists combined.
|
|
66
|
+
*
|
|
67
|
+
* @param skillId - The skill identifier
|
|
68
|
+
* @param skillContent - The loaded skill content
|
|
69
|
+
* @param loadResult - The skill load result with tool availability info
|
|
70
|
+
* @param policy - Optional security policy override
|
|
71
|
+
* @returns Activation result with session state and tool availability
|
|
72
|
+
*/
|
|
73
|
+
activateSkill(skillId: string, skillContent: SkillContent, loadResult: SkillLoadResult, policy?: SkillSecurityPolicy): SkillActivationResult;
|
|
74
|
+
/**
|
|
75
|
+
* Rebuild the combined allowedTools and requiredTools sets from all active skills.
|
|
76
|
+
*/
|
|
77
|
+
private rebuildCombinedToolSets;
|
|
78
|
+
/**
|
|
79
|
+
* Deactivate a skill or all skills in the current session.
|
|
80
|
+
*
|
|
81
|
+
* @param skillId - Optional skill ID to deactivate. If not provided, deactivates all skills.
|
|
82
|
+
*/
|
|
83
|
+
deactivateSkill(skillId?: string): void;
|
|
84
|
+
/**
|
|
85
|
+
* Clear all session state (called when no skills remain active).
|
|
86
|
+
*/
|
|
87
|
+
private clearSessionState;
|
|
88
|
+
/**
|
|
89
|
+
* Check if a tool is authorized in the current session.
|
|
90
|
+
* Returns detailed authorization result including reason.
|
|
91
|
+
*
|
|
92
|
+
* @param toolName - The name of the tool to check
|
|
93
|
+
* @returns Authorization result
|
|
94
|
+
*/
|
|
95
|
+
checkToolAuthorization(toolName: string): ToolAuthorizationResult;
|
|
96
|
+
/**
|
|
97
|
+
* Check if a tool is allowed without checking policy mode.
|
|
98
|
+
* Simpler check for quick validation.
|
|
99
|
+
*/
|
|
100
|
+
isToolAllowed(toolName: string): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Get the list of tools allowed by the current skill.
|
|
103
|
+
*/
|
|
104
|
+
getToolAllowlist(): string[];
|
|
105
|
+
/**
|
|
106
|
+
* Dynamically approve a tool for the current session.
|
|
107
|
+
* Used when policyMode is 'approval' and user approves a tool.
|
|
108
|
+
*/
|
|
109
|
+
approveToolForSession(toolName: string): void;
|
|
110
|
+
/**
|
|
111
|
+
* Deny a tool for the current session.
|
|
112
|
+
*/
|
|
113
|
+
denyToolForSession(toolName: string): void;
|
|
114
|
+
/**
|
|
115
|
+
* Record a tool call in the session.
|
|
116
|
+
* Updates the tool call count for rate limiting.
|
|
117
|
+
*/
|
|
118
|
+
recordToolCall(toolName: string): void;
|
|
119
|
+
/**
|
|
120
|
+
* Get the current policy mode.
|
|
121
|
+
*/
|
|
122
|
+
getPolicyMode(): string;
|
|
123
|
+
/**
|
|
124
|
+
* Set the policy mode for the current session.
|
|
125
|
+
* Only applies if there's an active skill.
|
|
126
|
+
*/
|
|
127
|
+
setPolicyMode(mode: SkillPolicyMode): void;
|
|
128
|
+
/**
|
|
129
|
+
* Emit a session event.
|
|
130
|
+
*/
|
|
131
|
+
private emitSessionEvent;
|
|
132
|
+
/**
|
|
133
|
+
* Persist session state to store if available.
|
|
134
|
+
*/
|
|
135
|
+
private persistSession;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=skill-session.manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-session.manager.d.ts","sourceRoot":"","sources":["../../../src/skill/session/skill-session.manager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB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