@frontmcp/sdk 0.7.2 → 0.8.0
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,309 @@
|
|
|
1
|
+
import { Token } from '@frontmcp/di';
|
|
2
|
+
import { EntryLineage, EntryOwnerRef, SkillEntry, SkillType, SkillToolValidationMode } from '../common';
|
|
3
|
+
import { SkillChangeEvent } from './skill.events';
|
|
4
|
+
import { SkillInstance } from './skill.instance';
|
|
5
|
+
import { SkillRecord } from '../common/records';
|
|
6
|
+
import ProviderRegistry from '../provider/provider.registry';
|
|
7
|
+
import { RegistryAbstract, RegistryBuildMapResult } from '../regsitry';
|
|
8
|
+
import { Scope } from '../scope';
|
|
9
|
+
import { SkillSearchOptions, SkillSearchResult, SkillLoadResult, SkillListOptions, SkillListResult } from './skill-storage.interface';
|
|
10
|
+
import type { ExternalSkillProviderBase } from './providers/external-skill.provider';
|
|
11
|
+
import type { SyncResult } from './sync/sync-state.interface';
|
|
12
|
+
import { ServerCapabilities } from '@modelcontextprotocol/sdk/types.js';
|
|
13
|
+
import { SkillValidationReport } from './errors/skill-validation.error';
|
|
14
|
+
/**
|
|
15
|
+
* Indexed skill for efficient lookup.
|
|
16
|
+
*/
|
|
17
|
+
export interface IndexedSkill {
|
|
18
|
+
token: Token;
|
|
19
|
+
instance: SkillInstance;
|
|
20
|
+
baseName: string;
|
|
21
|
+
lineage: EntryLineage;
|
|
22
|
+
ownerKey: string;
|
|
23
|
+
qualifiedName: string;
|
|
24
|
+
qualifiedId: string;
|
|
25
|
+
source: SkillRegistry;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Options for configuring SkillRegistry behavior.
|
|
29
|
+
*/
|
|
30
|
+
export interface SkillRegistryOptions {
|
|
31
|
+
/**
|
|
32
|
+
* Default validation mode for all skills in this registry.
|
|
33
|
+
* Can be overridden per-skill via SkillMetadata.toolValidation.
|
|
34
|
+
*
|
|
35
|
+
* @default 'warn'
|
|
36
|
+
*/
|
|
37
|
+
defaultToolValidation?: SkillToolValidationMode;
|
|
38
|
+
/**
|
|
39
|
+
* Whether to fail the entire registry initialization if any skill fails validation.
|
|
40
|
+
* Only applies when toolValidation is 'strict'.
|
|
41
|
+
*
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
failOnInvalidSkills?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Options for getting skills from the registry.
|
|
48
|
+
*/
|
|
49
|
+
export interface GetSkillsOptions {
|
|
50
|
+
/**
|
|
51
|
+
* Whether to include hidden skills.
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
includeHidden?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Filter by visibility context.
|
|
57
|
+
* - 'mcp': Only skills visible via MCP (visibility = 'mcp' or 'both')
|
|
58
|
+
* - 'http': Only skills visible via HTTP (visibility = 'http' or 'both')
|
|
59
|
+
* - 'all': All skills regardless of visibility (default)
|
|
60
|
+
*/
|
|
61
|
+
visibility?: 'mcp' | 'http' | 'all';
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Interface for SkillRegistry consumers.
|
|
65
|
+
*/
|
|
66
|
+
export interface SkillRegistryInterface {
|
|
67
|
+
owner: EntryOwnerRef;
|
|
68
|
+
/**
|
|
69
|
+
* Get all skills in the registry.
|
|
70
|
+
* @param options - Options for filtering skills (or boolean for backwards compatibility)
|
|
71
|
+
*/
|
|
72
|
+
getSkills(options?: boolean | GetSkillsOptions): SkillEntry[];
|
|
73
|
+
/**
|
|
74
|
+
* Find a skill by name.
|
|
75
|
+
* @param name - The skill name
|
|
76
|
+
*/
|
|
77
|
+
findByName(name: string): SkillEntry | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Find a skill by qualified name (includes owner prefix).
|
|
80
|
+
* @param qualifiedName - The qualified name (e.g., "my-app:review-pr")
|
|
81
|
+
*/
|
|
82
|
+
findByQualifiedName(qualifiedName: string): SkillEntry | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Search for skills matching a query.
|
|
85
|
+
* @param query - Search query string
|
|
86
|
+
* @param options - Search options
|
|
87
|
+
*/
|
|
88
|
+
search(query: string, options?: SkillSearchOptions): Promise<SkillSearchResult[]>;
|
|
89
|
+
/**
|
|
90
|
+
* Load a skill by ID.
|
|
91
|
+
* @param skillId - The skill identifier
|
|
92
|
+
*/
|
|
93
|
+
loadSkill(skillId: string): Promise<SkillLoadResult | undefined>;
|
|
94
|
+
/**
|
|
95
|
+
* List skills with pagination.
|
|
96
|
+
* @param options - List options
|
|
97
|
+
*/
|
|
98
|
+
listSkills(options?: SkillListOptions): Promise<SkillListResult>;
|
|
99
|
+
/**
|
|
100
|
+
* Check if any skills exist.
|
|
101
|
+
*/
|
|
102
|
+
hasAny(): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Get total skill count.
|
|
105
|
+
* @param options - Count options
|
|
106
|
+
*/
|
|
107
|
+
count(options?: {
|
|
108
|
+
tags?: string[];
|
|
109
|
+
includeHidden?: boolean;
|
|
110
|
+
}): Promise<number>;
|
|
111
|
+
/**
|
|
112
|
+
* Subscribe to skill change events.
|
|
113
|
+
* @param opts - Subscription options
|
|
114
|
+
* @param cb - Callback function
|
|
115
|
+
*/
|
|
116
|
+
subscribe(opts: {
|
|
117
|
+
immediate?: boolean;
|
|
118
|
+
filter?: (skill: SkillEntry) => boolean;
|
|
119
|
+
}, cb: (event: SkillChangeEvent) => void): () => void;
|
|
120
|
+
/**
|
|
121
|
+
* Get MCP capabilities for skills.
|
|
122
|
+
*/
|
|
123
|
+
getCapabilities(): Partial<ServerCapabilities>;
|
|
124
|
+
/**
|
|
125
|
+
* Validate all skills against the current tool registry.
|
|
126
|
+
* Should be called after all tools (including from plugins/adapters) are registered.
|
|
127
|
+
*
|
|
128
|
+
* @returns Validation report for all skills
|
|
129
|
+
* @throws SkillValidationError if failOnInvalidSkills is true and any skill fails
|
|
130
|
+
*/
|
|
131
|
+
validateAllTools(): Promise<SkillValidationReport>;
|
|
132
|
+
/**
|
|
133
|
+
* Sync local skills to external storage.
|
|
134
|
+
* Only available when an external provider in persistent mode is set.
|
|
135
|
+
*
|
|
136
|
+
* @returns Sync result with added/updated/unchanged/removed counts, or null if no external provider
|
|
137
|
+
*/
|
|
138
|
+
syncToExternal(): Promise<SyncResult | null>;
|
|
139
|
+
/**
|
|
140
|
+
* Get the external provider if one is configured.
|
|
141
|
+
*/
|
|
142
|
+
getExternalProvider(): ExternalSkillProviderBase | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* Check if the registry has an external provider.
|
|
145
|
+
*/
|
|
146
|
+
hasExternalProvider(): boolean;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Registry for managing skills.
|
|
150
|
+
*
|
|
151
|
+
* The SkillRegistry is the main facade for:
|
|
152
|
+
* - Managing local skills (registered via @Skill decorator or skill() helper)
|
|
153
|
+
* - Searching skills using TF-IDF
|
|
154
|
+
* - Loading skill content (including fetching from URLs)
|
|
155
|
+
* - Tracking skill changes
|
|
156
|
+
*/
|
|
157
|
+
export default class SkillRegistry extends RegistryAbstract<SkillInstance, SkillRecord, SkillType[]> implements SkillRegistryInterface {
|
|
158
|
+
/** Owner of this registry */
|
|
159
|
+
owner: EntryOwnerRef;
|
|
160
|
+
/** Local skills indexed for lookup */
|
|
161
|
+
private localRows;
|
|
162
|
+
/** Adopted skills from child registries */
|
|
163
|
+
private adopted;
|
|
164
|
+
/** Children registries */
|
|
165
|
+
private children;
|
|
166
|
+
/** O(1) indexes */
|
|
167
|
+
private byQualifiedId;
|
|
168
|
+
private byName;
|
|
169
|
+
private byOwnerAndName;
|
|
170
|
+
/** Version and emitter for change tracking */
|
|
171
|
+
private version;
|
|
172
|
+
private emitter;
|
|
173
|
+
/** Internal storage provider for search */
|
|
174
|
+
private storageProvider;
|
|
175
|
+
/** External skill provider for sync operations */
|
|
176
|
+
private externalProvider?;
|
|
177
|
+
/** Tool validator for checking tool availability */
|
|
178
|
+
private toolValidator?;
|
|
179
|
+
/** The scope this registry operates in */
|
|
180
|
+
readonly scope: Scope;
|
|
181
|
+
/** Registry-level options for validation behavior */
|
|
182
|
+
private readonly options;
|
|
183
|
+
constructor(providers: ProviderRegistry, list: SkillType[], owner: EntryOwnerRef, options?: SkillRegistryOptions);
|
|
184
|
+
protected buildMap(list: SkillType[]): RegistryBuildMapResult<SkillRecord>;
|
|
185
|
+
protected buildGraph(): void;
|
|
186
|
+
protected initialize(): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Adopt skills from a child registry.
|
|
189
|
+
*/
|
|
190
|
+
adoptFromChild(child: SkillRegistry, _childOwner: EntryOwnerRef): Promise<void>;
|
|
191
|
+
/**
|
|
192
|
+
* Get all skills in the registry.
|
|
193
|
+
* @param options - Options for filtering skills (or boolean for backwards compatibility)
|
|
194
|
+
*/
|
|
195
|
+
getSkills(options?: boolean | GetSkillsOptions): SkillEntry[];
|
|
196
|
+
/**
|
|
197
|
+
* Get inline (local) skills only.
|
|
198
|
+
*/
|
|
199
|
+
getInlineSkills(): SkillInstance[];
|
|
200
|
+
/**
|
|
201
|
+
* Find a skill by name.
|
|
202
|
+
*/
|
|
203
|
+
findByName(name: string): SkillEntry | undefined;
|
|
204
|
+
/**
|
|
205
|
+
* Find a skill by qualified name.
|
|
206
|
+
*/
|
|
207
|
+
findByQualifiedName(qualifiedName: string): SkillEntry | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* Search for skills matching a query.
|
|
210
|
+
*/
|
|
211
|
+
search(query: string, options?: SkillSearchOptions): Promise<SkillSearchResult[]>;
|
|
212
|
+
/**
|
|
213
|
+
* Load a skill by ID or name.
|
|
214
|
+
* Supports looking up by:
|
|
215
|
+
* - metadata.id (the unique identifier)
|
|
216
|
+
* - metadata.name (the display name)
|
|
217
|
+
* - qualified name (owner:name format)
|
|
218
|
+
*/
|
|
219
|
+
loadSkill(skillId: string): Promise<SkillLoadResult | undefined>;
|
|
220
|
+
/**
|
|
221
|
+
* List skills with pagination.
|
|
222
|
+
*/
|
|
223
|
+
listSkills(options?: SkillListOptions): Promise<SkillListResult>;
|
|
224
|
+
/**
|
|
225
|
+
* Check if any skills exist.
|
|
226
|
+
*/
|
|
227
|
+
hasAny(): boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Get total skill count.
|
|
230
|
+
*/
|
|
231
|
+
count(options?: {
|
|
232
|
+
tags?: string[];
|
|
233
|
+
includeHidden?: boolean;
|
|
234
|
+
}): Promise<number>;
|
|
235
|
+
/**
|
|
236
|
+
* Subscribe to skill change events.
|
|
237
|
+
*/
|
|
238
|
+
subscribe(opts: {
|
|
239
|
+
immediate?: boolean;
|
|
240
|
+
filter?: (skill: SkillEntry) => boolean;
|
|
241
|
+
}, cb: (event: SkillChangeEvent) => void): () => void;
|
|
242
|
+
/**
|
|
243
|
+
* Get MCP capabilities for skills.
|
|
244
|
+
*/
|
|
245
|
+
getCapabilities(): Partial<ServerCapabilities>;
|
|
246
|
+
/**
|
|
247
|
+
* Validate all skills against the current tool registry.
|
|
248
|
+
* Should be called after all tools (including from plugins/adapters) are registered.
|
|
249
|
+
*
|
|
250
|
+
* This method:
|
|
251
|
+
* 1. Checks each skill's tool references against the tool registry
|
|
252
|
+
* 2. Respects per-skill and registry-level validation modes
|
|
253
|
+
* 3. Emits a 'validated' event with results
|
|
254
|
+
* 4. Optionally throws if failOnInvalidSkills is enabled
|
|
255
|
+
*
|
|
256
|
+
* @returns Validation report for all skills
|
|
257
|
+
* @throws SkillValidationError if failOnInvalidSkills is true and any skill fails
|
|
258
|
+
*/
|
|
259
|
+
validateAllTools(): Promise<SkillValidationReport>;
|
|
260
|
+
private listAllIndexed;
|
|
261
|
+
private listAllInstances;
|
|
262
|
+
private reindex;
|
|
263
|
+
private makeRow;
|
|
264
|
+
private relineage;
|
|
265
|
+
private bump;
|
|
266
|
+
/**
|
|
267
|
+
* Set an external storage provider for skills.
|
|
268
|
+
*
|
|
269
|
+
* In read-only mode:
|
|
270
|
+
* - Search/list/load operations will query the external provider
|
|
271
|
+
*
|
|
272
|
+
* In persistent mode:
|
|
273
|
+
* - Local skills will be synced to external storage on syncToExternal()
|
|
274
|
+
* - Search/list/load operations still use local storage
|
|
275
|
+
*
|
|
276
|
+
* @param provider - External provider instance extending ExternalSkillProviderBase
|
|
277
|
+
*/
|
|
278
|
+
setExternalProvider(provider: ExternalSkillProviderBase): void;
|
|
279
|
+
/**
|
|
280
|
+
* Get the external provider if one is configured.
|
|
281
|
+
*/
|
|
282
|
+
getExternalProvider(): ExternalSkillProviderBase | undefined;
|
|
283
|
+
/**
|
|
284
|
+
* Check if the registry has an external provider.
|
|
285
|
+
*/
|
|
286
|
+
hasExternalProvider(): boolean;
|
|
287
|
+
/**
|
|
288
|
+
* Sync local skills to external storage.
|
|
289
|
+
*
|
|
290
|
+
* This method:
|
|
291
|
+
* 1. Collects all local skill content
|
|
292
|
+
* 2. Calls syncSkills on the external provider
|
|
293
|
+
* 3. Returns the sync result with changes detected
|
|
294
|
+
*
|
|
295
|
+
* Only available when an external provider in persistent mode is configured.
|
|
296
|
+
*
|
|
297
|
+
* @returns Sync result or null if no external provider or in read-only mode
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```typescript
|
|
301
|
+
* const result = await registry.syncToExternal();
|
|
302
|
+
* if (result) {
|
|
303
|
+
* console.log(`Synced: ${result.added.length} added, ${result.updated.length} updated`);
|
|
304
|
+
* }
|
|
305
|
+
* ```
|
|
306
|
+
*/
|
|
307
|
+
syncToExternal(): Promise<SyncResult | null>;
|
|
308
|
+
}
|
|
309
|
+
//# sourceMappingURL=skill.registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.registry.d.ts","sourceRoot":"","sources":["../../src/skill/skill.registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAa,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAExG,OAAO,EAAE,gBAAgB,EAAgB,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAuB,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAEL,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,E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AC,UAAU,GAAG,IAAI,CAAC;CAkDnD"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Token } from '@frontmcp/di';
|
|
2
|
+
import { SkillMetadata, SkillRecord, SkillType, SkillInstructionSource } from '../common';
|
|
3
|
+
import { SkillContent } from '../common/interfaces';
|
|
4
|
+
/**
|
|
5
|
+
* Collect skill metadata from a decorated class.
|
|
6
|
+
*
|
|
7
|
+
* @param cls - The class to collect metadata from
|
|
8
|
+
* @returns The skill metadata
|
|
9
|
+
*/
|
|
10
|
+
export declare function collectSkillMetadata(cls: SkillType): SkillMetadata;
|
|
11
|
+
/**
|
|
12
|
+
* Normalize any skill input to a SkillRecord.
|
|
13
|
+
*
|
|
14
|
+
* Handles:
|
|
15
|
+
* - Class with @Skill decorator → SkillClassTokenRecord
|
|
16
|
+
* - SkillValueRecord (from skill() helper) → passthrough
|
|
17
|
+
* - SkillFileRecord → passthrough
|
|
18
|
+
*
|
|
19
|
+
* @param item - The skill input to normalize
|
|
20
|
+
* @returns A normalized SkillRecord
|
|
21
|
+
* @throws Error if the input is invalid
|
|
22
|
+
*/
|
|
23
|
+
export declare function normalizeSkill(item: unknown): SkillRecord;
|
|
24
|
+
/**
|
|
25
|
+
* Check if an object is a SkillRecord.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isSkillRecord(item: unknown): item is SkillRecord;
|
|
28
|
+
/**
|
|
29
|
+
* Get dependency tokens from a skill record for DI graph validation.
|
|
30
|
+
*
|
|
31
|
+
* @param rec - The skill record
|
|
32
|
+
* @returns Array of dependency tokens
|
|
33
|
+
*/
|
|
34
|
+
export declare function skillDiscoveryDeps(rec: SkillRecord): Token[];
|
|
35
|
+
/**
|
|
36
|
+
* Load instructions from a skill instruction source.
|
|
37
|
+
*
|
|
38
|
+
* @param source - The instruction source (inline, file, or URL)
|
|
39
|
+
* @param basePath - Base path for resolving relative file paths
|
|
40
|
+
* @returns The loaded instructions as a string
|
|
41
|
+
*/
|
|
42
|
+
export declare function loadInstructions(source: SkillInstructionSource, basePath?: string): Promise<string>;
|
|
43
|
+
/**
|
|
44
|
+
* Build SkillContent from metadata and resolved instructions.
|
|
45
|
+
*
|
|
46
|
+
* @param metadata - The skill metadata
|
|
47
|
+
* @param instructions - The resolved instructions string
|
|
48
|
+
* @returns The full skill content
|
|
49
|
+
*/
|
|
50
|
+
export declare function buildSkillContent(metadata: SkillMetadata, instructions: string): SkillContent;
|
|
51
|
+
/**
|
|
52
|
+
* Format a skill for LLM consumption.
|
|
53
|
+
*
|
|
54
|
+
* Creates a markdown-formatted string with the skill instructions,
|
|
55
|
+
* tool information, and any warnings about missing tools.
|
|
56
|
+
*
|
|
57
|
+
* @param skill - The loaded skill content
|
|
58
|
+
* @param availableTools - List of available tools
|
|
59
|
+
* @param missingTools - List of missing tools
|
|
60
|
+
* @returns Formatted skill content as markdown
|
|
61
|
+
*/
|
|
62
|
+
export declare function formatSkillForLLM(skill: SkillContent, availableTools: string[], missingTools: string[]): string;
|
|
63
|
+
/**
|
|
64
|
+
* Generate next steps guidance after loading skills.
|
|
65
|
+
*
|
|
66
|
+
* @param skills - Array of loaded skills with their tool availability
|
|
67
|
+
* @param allToolsAvailable - Whether all tools across all skills are available
|
|
68
|
+
* @returns Human-readable guidance string
|
|
69
|
+
*/
|
|
70
|
+
export declare function generateNextSteps(skills: Array<{
|
|
71
|
+
name: string;
|
|
72
|
+
isComplete: boolean;
|
|
73
|
+
tools: Array<{
|
|
74
|
+
name: string;
|
|
75
|
+
available: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
}>, allToolsAvailable: boolean): string;
|
|
78
|
+
/**
|
|
79
|
+
* Generate search guidance based on results.
|
|
80
|
+
*
|
|
81
|
+
* @param skills - Array of search results with executability info
|
|
82
|
+
* @param query - The original search query
|
|
83
|
+
* @returns Human-readable guidance string
|
|
84
|
+
*/
|
|
85
|
+
export declare function generateSearchGuidance(skills: Array<{
|
|
86
|
+
name: string;
|
|
87
|
+
score: number;
|
|
88
|
+
canExecute: boolean;
|
|
89
|
+
}>, query: string): string;
|
|
90
|
+
//# sourceMappingURL=skill.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.utils.d.ts","sourceRoot":"","sources":["../../src/skill/skill.utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAA2C,MAAM,cAAc,CAAC;AAC9E,OAAO,EACL,aAAa,EAEb,WAAW,EAIX,SAAS,EAIT,sBAAsB,EAEvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,SAAS,GAAG,aAAa,CAWlE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,CA4BzD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,WAAW,CAwBhE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,KAAK,EAAE,CAS5D;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBzG;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,GAAG,YAAY,CAU7F;AAmCD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM,CA6D/G;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,EACxG,iBAAiB,EAAE,OAAO,GACzB,MAAM,CA4BR;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,EACnE,KAAK,EAAE,MAAM,GACZ,MAAM,CAyBR"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill Sync Module
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities for synchronizing local skills with external vector databases.
|
|
5
|
+
* Supports two modes:
|
|
6
|
+
* - Read-only: Pull skills from external source (no local persistence)
|
|
7
|
+
* - Persistent: SHA-based change detection, sync local skills to external store
|
|
8
|
+
*
|
|
9
|
+
* @module skill/sync
|
|
10
|
+
*/
|
|
11
|
+
export { computeSkillHash, computeSkillHashComponents, areSkillsEqual } from './skill-hash';
|
|
12
|
+
export type { SkillHashComponents } from './skill-hash';
|
|
13
|
+
export { createEmptySyncState, serializeSyncState, deserializeSyncState } from './sync-state.interface';
|
|
14
|
+
export type { SkillSyncStatus, SkillSyncEntry, SkillSyncState, SerializedSkillSyncState, SkillSyncStateStore, SyncResult, } from './sync-state.interface';
|
|
15
|
+
export { MemorySyncStateStore } from './memory-sync-state.store';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/skill/sync/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAGH,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5F,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACxG,YAAY,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,UAAU,GACX,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { SkillSyncState, SkillSyncStateStore } from './sync-state.interface';
|
|
2
|
+
/**
|
|
3
|
+
* In-memory implementation of SkillSyncStateStore.
|
|
4
|
+
*
|
|
5
|
+
* Suitable for:
|
|
6
|
+
* - Development and testing
|
|
7
|
+
* - Single-instance deployments where persistence isn't required
|
|
8
|
+
* - Stateless sync operations (re-sync on each startup)
|
|
9
|
+
*
|
|
10
|
+
* Note: State is lost when the process exits.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const store = new MemorySyncStateStore();
|
|
15
|
+
*
|
|
16
|
+
* // Save state
|
|
17
|
+
* await store.save({ version: 1, lastFullSync: Date.now(), entries: new Map() });
|
|
18
|
+
*
|
|
19
|
+
* // Load state
|
|
20
|
+
* const state = await store.load();
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare class MemorySyncStateStore implements SkillSyncStateStore {
|
|
24
|
+
private state;
|
|
25
|
+
/**
|
|
26
|
+
* Load the sync state from memory.
|
|
27
|
+
* @returns The stored state or null if not set
|
|
28
|
+
*/
|
|
29
|
+
load(): Promise<SkillSyncState | null>;
|
|
30
|
+
/**
|
|
31
|
+
* Save the sync state to memory.
|
|
32
|
+
* @param state - The state to store
|
|
33
|
+
*/
|
|
34
|
+
save(state: SkillSyncState): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Clear the sync state from memory.
|
|
37
|
+
*/
|
|
38
|
+
clear(): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Check if any state is stored.
|
|
41
|
+
* Useful for determining if a full sync is needed.
|
|
42
|
+
*/
|
|
43
|
+
hasState(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Get the number of tracked skills.
|
|
46
|
+
*/
|
|
47
|
+
getEntryCount(): number;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=memory-sync-state.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory-sync-state.store.d.ts","sourceRoot":"","sources":["../../../src/skill/sync/memory-sync-state.store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,oBAAqB,YAAW,mBAAmB;IAC9D,OAAO,CAAC,KAAK,CAA+B;IAE5C;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAa5C;;;OAGG;IACG,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAShD;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B;;;OAGG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,aAAa,IAAI,MAAM;CAGxB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { SkillContent } from '../../common/interfaces';
|
|
2
|
+
/**
|
|
3
|
+
* Components of a skill hash, useful for debugging and partial updates.
|
|
4
|
+
*/
|
|
5
|
+
export interface SkillHashComponents {
|
|
6
|
+
/**
|
|
7
|
+
* SHA-256 hash of the instructions only.
|
|
8
|
+
*/
|
|
9
|
+
instructionsHash: string;
|
|
10
|
+
/**
|
|
11
|
+
* SHA-256 hash of the tools array (sorted by name).
|
|
12
|
+
*/
|
|
13
|
+
toolsHash: string;
|
|
14
|
+
/**
|
|
15
|
+
* SHA-256 hash of metadata (id, name, description).
|
|
16
|
+
*/
|
|
17
|
+
metadataHash: string;
|
|
18
|
+
/**
|
|
19
|
+
* Combined hash of all components.
|
|
20
|
+
*/
|
|
21
|
+
combinedHash: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Compute a deterministic SHA-256 hash of a skill's content.
|
|
25
|
+
* Used for change detection during sync operations.
|
|
26
|
+
*
|
|
27
|
+
* @param skill - The skill content to hash
|
|
28
|
+
* @returns Hexadecimal SHA-256 hash string
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const hash1 = computeSkillHash(skill);
|
|
33
|
+
* // ... modify skill ...
|
|
34
|
+
* const hash2 = computeSkillHash(skill);
|
|
35
|
+
* if (hash1 !== hash2) {
|
|
36
|
+
* // Skill content changed, need to sync
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function computeSkillHash(skill: SkillContent): string;
|
|
41
|
+
/**
|
|
42
|
+
* Compute detailed hash components for a skill.
|
|
43
|
+
* Useful for understanding what changed between versions.
|
|
44
|
+
*
|
|
45
|
+
* @param skill - The skill content to hash
|
|
46
|
+
* @returns Individual hash components and combined hash
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* const components = computeSkillHashComponents(skill);
|
|
51
|
+
* if (components.instructionsHash !== prevComponents.instructionsHash) {
|
|
52
|
+
* console.log('Instructions changed');
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function computeSkillHashComponents(skill: SkillContent): SkillHashComponents;
|
|
57
|
+
/**
|
|
58
|
+
* Compare two skills for content equality using their hashes.
|
|
59
|
+
*
|
|
60
|
+
* @param skill1 - First skill
|
|
61
|
+
* @param skill2 - Second skill
|
|
62
|
+
* @returns True if skills have identical content
|
|
63
|
+
*/
|
|
64
|
+
export declare function areSkillsEqual(skill1: SkillContent, skill2: SkillContent): boolean;
|
|
65
|
+
//# sourceMappingURL=skill-hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-hash.d.ts","sourceRoot":"","sources":["../../../src/skill/sync/skill-hash.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB;AAiCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAG5D;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,YAAY,GAAG,mBAAmB,CAmBnF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAElF"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status of a skill's synchronization with external storage.
|
|
3
|
+
*/
|
|
4
|
+
export type SkillSyncStatus = 'synced' | 'pending' | 'failed';
|
|
5
|
+
/**
|
|
6
|
+
* Entry tracking the sync state of a single skill.
|
|
7
|
+
*/
|
|
8
|
+
export interface SkillSyncEntry {
|
|
9
|
+
/**
|
|
10
|
+
* The skill's unique identifier.
|
|
11
|
+
*/
|
|
12
|
+
skillId: string;
|
|
13
|
+
/**
|
|
14
|
+
* SHA-256 hash of the skill content at last sync.
|
|
15
|
+
*/
|
|
16
|
+
hash: string;
|
|
17
|
+
/**
|
|
18
|
+
* Timestamp of the last successful sync (epoch ms).
|
|
19
|
+
*/
|
|
20
|
+
lastSyncedAt: number;
|
|
21
|
+
/**
|
|
22
|
+
* Current sync status.
|
|
23
|
+
*/
|
|
24
|
+
status: SkillSyncStatus;
|
|
25
|
+
/**
|
|
26
|
+
* Error message if status is 'failed'.
|
|
27
|
+
*/
|
|
28
|
+
error?: string;
|
|
29
|
+
/**
|
|
30
|
+
* External storage ID if different from skillId.
|
|
31
|
+
* Used when external storage assigns its own identifiers.
|
|
32
|
+
*/
|
|
33
|
+
externalId?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Full sync state tracking all skills.
|
|
37
|
+
*/
|
|
38
|
+
export interface SkillSyncState {
|
|
39
|
+
/**
|
|
40
|
+
* Version of the sync state format.
|
|
41
|
+
* Allows for future migrations.
|
|
42
|
+
*/
|
|
43
|
+
version: number;
|
|
44
|
+
/**
|
|
45
|
+
* Timestamp of the last complete sync operation (epoch ms).
|
|
46
|
+
*/
|
|
47
|
+
lastFullSync: number;
|
|
48
|
+
/**
|
|
49
|
+
* Map of skill ID to sync entry.
|
|
50
|
+
*/
|
|
51
|
+
entries: Map<string, SkillSyncEntry>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Serialized form of SkillSyncState for persistence.
|
|
55
|
+
*/
|
|
56
|
+
export interface SerializedSkillSyncState {
|
|
57
|
+
version: number;
|
|
58
|
+
lastFullSync: number;
|
|
59
|
+
entries: Array<[string, SkillSyncEntry]>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Interface for persisting skill sync state.
|
|
63
|
+
* Implementations can use memory, file system, or databases.
|
|
64
|
+
*/
|
|
65
|
+
export interface SkillSyncStateStore {
|
|
66
|
+
/**
|
|
67
|
+
* Load the sync state from storage.
|
|
68
|
+
* @returns The sync state or null if not found
|
|
69
|
+
*/
|
|
70
|
+
load(): Promise<SkillSyncState | null>;
|
|
71
|
+
/**
|
|
72
|
+
* Save the sync state to storage.
|
|
73
|
+
* @param state - The state to persist
|
|
74
|
+
*/
|
|
75
|
+
save(state: SkillSyncState): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Clear the sync state from storage.
|
|
78
|
+
*/
|
|
79
|
+
clear(): Promise<void>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Result of a sync operation.
|
|
83
|
+
*/
|
|
84
|
+
export interface SyncResult {
|
|
85
|
+
/**
|
|
86
|
+
* IDs of newly added skills.
|
|
87
|
+
*/
|
|
88
|
+
added: string[];
|
|
89
|
+
/**
|
|
90
|
+
* IDs of skills that were updated due to content changes.
|
|
91
|
+
*/
|
|
92
|
+
updated: string[];
|
|
93
|
+
/**
|
|
94
|
+
* IDs of skills that were unchanged (hash matched).
|
|
95
|
+
*/
|
|
96
|
+
unchanged: string[];
|
|
97
|
+
/**
|
|
98
|
+
* IDs of skills that were removed from external storage.
|
|
99
|
+
*/
|
|
100
|
+
removed: string[];
|
|
101
|
+
/**
|
|
102
|
+
* IDs of skills that failed to sync with their errors.
|
|
103
|
+
*/
|
|
104
|
+
failed: Array<{
|
|
105
|
+
skillId: string;
|
|
106
|
+
error: string;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Total duration of the sync operation in milliseconds.
|
|
110
|
+
*/
|
|
111
|
+
durationMs: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Create an empty sync state with defaults.
|
|
115
|
+
*/
|
|
116
|
+
export declare function createEmptySyncState(): SkillSyncState;
|
|
117
|
+
/**
|
|
118
|
+
* Serialize sync state for persistence.
|
|
119
|
+
*/
|
|
120
|
+
export declare function serializeSyncState(state: SkillSyncState): SerializedSkillSyncState;
|
|
121
|
+
/**
|
|
122
|
+
* Deserialize sync state from persistence.
|
|
123
|
+
*/
|
|
124
|
+
export declare function deserializeSyncState(data: SerializedSkillSyncState): SkillSyncState;
|
|
125
|
+
//# sourceMappingURL=sync-state.interface.d.ts.map
|