@frontmcp/sdk 1.11.1-rc.1 → 1.11.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/app/instances/app.esm.instance.d.ts.map +1 -1
- package/app/instances/empty-app-registries.d.ts +1 -0
- package/app/instances/empty-app-registries.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts +5 -0
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.connect.flow.d.ts +4 -2
- package/auth/flows/oauth.connect.flow.d.ts.map +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +2 -0
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/vault/auth-providers.providers.d.ts +22 -16
- package/auth/vault/auth-providers.providers.d.ts.map +1 -1
- package/auth/vault/index.d.ts +1 -2
- package/auth/vault/index.d.ts.map +1 -1
- package/auth/vault/unconfigured-auth-providers.d.ts +4 -0
- package/auth/vault/unconfigured-auth-providers.d.ts.map +1 -0
- package/browser/app/instances/app.esm.instance.mjs +2 -0
- package/browser/app/instances/empty-app-registries.mjs +2 -0
- package/browser/auth/flows/oauth.callback.flow.mjs +26 -1
- package/browser/auth/flows/oauth.connect.flow.mjs +31 -24
- package/browser/auth/instances/instance.local-primary-auth.mjs +3 -0
- package/browser/auth/vault/auth-providers.providers.mjs +114 -0
- package/browser/auth/vault/credential-cache.mjs +5 -0
- package/browser/auth/vault/unconfigured-auth-providers.mjs +21 -0
- package/browser/common/entries/scope.entry.mjs +23 -4
- package/browser/common/interfaces/execution-context.interface.mjs +5 -0
- package/browser/common/interfaces/internal/primary-auth-provider.interface.mjs +4 -0
- package/browser/common/interfaces/server.interface.mjs +2 -0
- package/browser/common/metadata/front-mcp.metadata.mjs +3 -0
- package/browser/common/tokens/front-mcp.tokens.mjs +1 -0
- package/browser/direct/direct-client.mjs +2 -1
- package/browser/direct/token-auth-info.mjs +2 -0
- package/browser/elicitation/helpers/elicit.helper.mjs +10 -7
- package/browser/errors/index.mjs +1 -1
- package/browser/errors/misconfiguration.mjs +3 -1
- package/browser/errors/plugin.errors.mjs +20 -0
- package/browser/errors/tool-credentials-required.error.mjs +18 -5
- package/browser/front-mcp/front-mcp.mjs +1 -3
- package/browser/health/health.service.mjs +14 -10
- package/browser/index.cjs +2873 -2332
- package/browser/index.mjs +9 -3
- package/browser/notification/notification.service.mjs +5 -5
- package/browser/plugin/plugin.registry.mjs +39 -2
- package/browser/provider/provider.registry.mjs +2 -0
- package/browser/scope/dev-events-observability.mjs +9 -5
- package/browser/scope/scope.instance.mjs +15 -2
- package/browser/skill/errors/skill-bundle-not-loaded.error.mjs +21 -0
- package/browser/skill/flows/load-skill.flow.mjs +13 -9
- package/browser/skill/flows/search-skills.flow.mjs +10 -2
- package/browser/skill/index.mjs +2 -0
- package/browser/skill/sep-2640/resources/skill-index.resource.mjs +2 -0
- package/browser/skill/sep-2640/sep-2640.resource-helpers.mjs +5 -2
- package/browser/skill/skill-catalog-source.mjs +33 -1
- package/browser/skill/skill-instructions.helper.mjs +14 -14
- package/browser/skill/skill.registry.mjs +6 -0
- package/browser/surface/index.mjs +6 -0
- package/browser/surface/list-change-batch.mjs +51 -0
- package/browser/surface/live-surface.mjs +2 -2
- package/browser/tool/flows/call-tool.flow.mjs +18 -4
- package/browser/tool/flows/tool-credentials.gate.mjs +60 -10
- package/browser/tool/tool.registry.mjs +9 -2
- package/browser/transport/mcp-20260728/mrtr.mjs +13 -6
- package/browser/transport/mcp-20260728/subscriptions.mjs +6 -6
- package/browser/transport/mcp-handlers/skills-list-request.handler.mjs +19 -7
- package/browser/transport/mcp-handlers/skills-mcp.types.mjs +6 -4
- package/browser/transport/web-fetch-handler.mjs +6 -8
- package/common/entries/scope.entry.d.ts +15 -3
- package/common/entries/scope.entry.d.ts.map +1 -1
- package/common/interfaces/execution-context.interface.d.ts +3 -1
- package/common/interfaces/execution-context.interface.d.ts.map +1 -1
- package/common/interfaces/internal/primary-auth-provider.interface.d.ts +3 -0
- package/common/interfaces/internal/primary-auth-provider.interface.d.ts.map +1 -1
- package/common/interfaces/server.interface.d.ts +2 -0
- package/common/interfaces/server.interface.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +1 -1
- package/common/metadata/front-mcp.metadata.d.ts +304 -92
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/types/options/elicitation/schema.d.ts +1 -1
- package/common/types/options/redis/schema.d.ts +3 -3
- package/common/types/options/redis/schema.d.ts.map +1 -1
- package/common/types/options/skills-http/schema.d.ts +2 -2
- package/common/types/options/transport/schema.d.ts +4 -4
- package/context/frontmcp-context.d.ts +1 -1
- package/context/frontmcp-context.d.ts.map +1 -1
- package/direct/client.types.d.ts +48 -28
- package/direct/client.types.d.ts.map +1 -1
- package/direct/index.d.ts +1 -1
- package/direct/index.d.ts.map +1 -1
- package/direct/token-auth-info.d.ts +5 -1
- package/direct/token-auth-info.d.ts.map +1 -1
- package/elicitation/helpers/elicit.helper.d.ts +5 -0
- package/elicitation/helpers/elicit.helper.d.ts.map +1 -1
- package/errors/error-handler.d.ts +1 -0
- package/errors/error-handler.d.ts.map +1 -1
- package/errors/mcp.error.d.ts +2 -0
- package/errors/mcp.error.d.ts.map +1 -1
- package/errors/misconfiguration.d.ts.map +1 -1
- package/errors/plugin.errors.d.ts +8 -0
- package/errors/plugin.errors.d.ts.map +1 -1
- package/errors/tool-credentials-required.error.d.ts +10 -2
- package/errors/tool-credentials-required.error.d.ts.map +1 -1
- package/esm/index.mjs +31 -31
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/health/health.service.d.ts +8 -4
- package/health/health.service.d.ts.map +1 -1
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js +38 -38
- package/package.json +10 -10
- package/plugin/plugin.registry.d.ts +3 -1
- package/plugin/plugin.registry.d.ts.map +1 -1
- package/provider/provider.registry.d.ts.map +1 -1
- package/scope/dev-events-observability.d.ts +2 -0
- package/scope/dev-events-observability.d.ts.map +1 -1
- package/scope/scope.instance.d.ts.map +1 -1
- package/server/adapters/utf8-json.parser.d.ts +2 -0
- package/server/adapters/utf8-json.parser.d.ts.map +1 -1
- package/skill/errors/index.d.ts +1 -0
- package/skill/errors/index.d.ts.map +1 -1
- package/skill/errors/skill-bundle-not-loaded.error.d.ts +16 -0
- package/skill/errors/skill-bundle-not-loaded.error.d.ts.map +1 -0
- package/skill/flows/load-skill.flow.d.ts +2 -2
- package/skill/flows/load-skill.flow.d.ts.map +1 -1
- package/skill/flows/search-skills.flow.d.ts +5 -1
- package/skill/flows/search-skills.flow.d.ts.map +1 -1
- package/skill/index.d.ts +1 -0
- package/skill/index.d.ts.map +1 -1
- package/skill/sep-2640/resources/skill-index.resource.d.ts.map +1 -1
- package/skill/sep-2640/sep-2640.resource-helpers.d.ts +2 -1
- package/skill/sep-2640/sep-2640.resource-helpers.d.ts.map +1 -1
- package/skill/skill-catalog-source.d.ts +24 -2
- package/skill/skill-catalog-source.d.ts.map +1 -1
- package/skill/skill-instructions.helper.d.ts +5 -0
- package/skill/skill-instructions.helper.d.ts.map +1 -1
- package/skill/skill.registry.d.ts +9 -0
- package/skill/skill.registry.d.ts.map +1 -1
- package/surface/index.d.ts +1 -0
- package/surface/index.d.ts.map +1 -1
- package/surface/list-change-batch.d.ts +28 -0
- package/surface/list-change-batch.d.ts.map +1 -0
- package/tool/flows/call-tool.flow.d.ts +5 -2
- package/tool/flows/call-tool.flow.d.ts.map +1 -1
- package/tool/flows/tool-credentials.gate.d.ts +26 -0
- package/tool/flows/tool-credentials.gate.d.ts.map +1 -1
- package/tool/tool.registry.d.ts +2 -0
- package/tool/tool.registry.d.ts.map +1 -1
- package/transport/mcp-20260728/mrtr.d.ts +6 -2
- package/transport/mcp-20260728/mrtr.d.ts.map +1 -1
- package/transport/mcp-20260728/subscriptions.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-list-request.handler.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-mcp.types.d.ts +3 -1
- package/transport/mcp-handlers/skills-mcp.types.d.ts.map +1 -1
- package/auth/vault/auth-providers.context-extension.d.ts +0 -68
- package/auth/vault/auth-providers.context-extension.d.ts.map +0 -1
package/browser/index.mjs
CHANGED
|
@@ -19,14 +19,18 @@ import {
|
|
|
19
19
|
fitResourceAnswer,
|
|
20
20
|
fitToolAnswer
|
|
21
21
|
} from "./answer/index.mjs";
|
|
22
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
fileSignal,
|
|
24
|
+
SURFACE_META_KEY,
|
|
25
|
+
surfaceHash
|
|
26
|
+
} from "./surface/index.mjs";
|
|
23
27
|
import {
|
|
24
28
|
MATERIALIZED_META_KEY,
|
|
25
29
|
MaterializedResourceContext,
|
|
26
30
|
resourceStore,
|
|
27
31
|
ResourceStore
|
|
28
32
|
} from "./resource/materialized/index.mjs";
|
|
29
|
-
export { AgentCallDepthExceededError, AgentConfigKeyNotFoundError, AgentConfigurationError, AgentExecutionError, AgentLlmError, AgentLoopExceededError, AgentMethodNotAvailableError, AgentNotConfiguredError, AgentNotFoundError, AgentTimeoutError, AgentToolExecutionError, AgentToolNotFoundError, AgentVisibilityError, AuthConfigurationError, AuthProvidersNotConfiguredError, AuthorizationRequiredError, BrowserEntryPointUnavailableError, BrowserStoreUnavailableError, CallRecorderConfigurationError, ConfigNotFoundError, ContextExtensionNotAvailableError, CredentialProviderAlreadyRegisteredError, CrossOriginRequestError, DependencyCycleError, DependencyNotFoundError, DuplicateAppIdError, DutyNameConflictError, DynamicAdapterNameError, DynamicJobDirectExecutionError, ElicitationDisabledError, ElicitationEncryptionError, ElicitationFallbackRequired, ElicitationNotOwnedError, ElicitationNotSupportedError, ElicitationSecretRequiredError, ElicitationStoreNotInitializedError, ElicitationSubscriptionError, ElicitationTimeoutError, EnclaveExecutionError, EncryptionContextNotSetError, EncryptionKeyNotConfiguredError, EntryUnavailableError, EntryValidationError, ErrorHandler, EsmCacheError, EsmInvalidSpecifierError, EsmManifestInvalidError, EsmPackageLoadError, EsmRegistryAuthError, EsmVersionResolutionError, ExternalEntryError, ExternalEntryLoadError, ExternalEntryNotFoundError, ExternalEntryNotSupportedError, FeatureOffError, FlowExitedWithoutOutputError, FlowInputMissingError, FlowNotRegisteredError, GenericServerError, GlobalConfigNotFoundError, GuardLimitMcpError, HaConfigurationError, HookOrderCycleError, HookTargetNotDefinedError, InMemoryStoreRequiredError, InputRequiredSignal, InternalMcpError, InvalidDecoratorMetadataError, InvalidDependencyScopeError, InvalidEntityError, InvalidFileSignalError, InvalidHookFlowError, InvalidHttpRouteError, InvalidHttpRouteResponseError, InvalidInputError, InvalidInstructionSourceError, InvalidMethodError, InvalidOffloadCallError, InvalidOutputError, InvalidPeopleAuthOptionsError, InvalidPluginScopeError, InvalidRegistryKindError, InvalidResourceStoreError, InvalidResourceUriError, InvalidRetryOptionsError, InvalidSharedServerOptionsError, InvalidSkillError, InvalidTransportSessionError, InvalidUseClassError, InvalidUseFactoryError, InvalidUseValueError, InvokeStateMissingKeyError, JwtSecretRequiredError, JwtSecretWeakError, LazyAppConfigurationError, LazyAppLoadError, MCP_ERROR_CODES, McpError, MethodNotImplementedError, MissingClientCapabilityError, MissingPromptArgumentError, MissingProvideError, NameDisambiguationError, NoProviderIdError, OffloadAbortedError, OffloadBudgetExceededError, OffloadNotCloneableError, OffloadUnsupportedRuntimeError, OffloadWorkerError, OrchestratedAuthNotAvailableError, OrchestratorJwksNotAvailableError, PayloadTooLargeError, PersonNotSignedInError, PluginDependencyError, PromptExecutionError, PromptNotFoundError, ProviderBootstrapError, ProviderConstructionError, ProviderDependencyError, ProviderNotAvailableError, ProviderNotInstantiatedError, ProviderNotRegisteredError, ProviderScopeMismatchError, ProviderScopedAccessError, PublicAccessDeniedError, PublicMcpError, QuotaExceededError, RateLimitError, RegistryDefinitionNotFoundError, RegistryDependencyNotRegisteredError, RegistryGraphEntryNotFoundError, RegistryNotInitializedError, RemoteAuthError, RemoteAuthorizationError, RemoteCapabilityDiscoveryError, RemoteCapabilityNotSupportedError, RemoteConfigurationError, RemoteConnectionError, RemoteDisconnectError, RemoteNotConnectedError, RemotePromptGetError, RemotePromptNotFoundError, RemoteResourceNotFoundError, RemoteResourceReadError, RemoteTimeoutError, RemoteToolExecutionError, RemoteToolNotFoundError, RemoteTransportError, RemoteUnsupportedTransportError, RequestContextNotAvailableError, RequiredConfigUndefinedError, ReservedAppIdError, ResourceNotFoundError, ResourceReadError, SamplingNotAvailableError, ScopeConfigurationError, ScopeDeniedError, ServerNotFoundError, ServerlessHandlerNotInitializedError, SessionClaimConflictError, SessionIdEmptyError, SessionIdentityRequiredError, SessionMissingError, SessionOwnerUnreachableError, SessionSecretRequiredError, SessionVerificationFailedError, SharedServerIdentityError, SharedServerStartError, SignInLockedError, SignInRefusedError, SkillContextNotImplementedError, SkillInstructionFetchError, SkillSessionError, SocketInUseError, SocketPathConflictError, SocketPermissionError, StaleToolListError, StoreNotOpenedInBuildError, TaskAlreadyTerminalError, TaskAugmentationNotSupportedError, TaskAugmentationRequiredError, TaskConcurrencyLimitError, TaskNotFoundError, TaskStoreNotInitializedError, TokenLeakDetectedError, TokenNotAvailableError, TokenStoreRequiredError, ToolAliasConflictError, ToolCallError, ToolCredentialsRequiredError, ToolExecutionError, ToolNameConflictError, ToolNotConsentedError, ToolNotFoundError, TransportAlreadyStartedError, TransportBusRequiredError, TransportNotConnectedError, TransportServiceNotAvailableError, UnauthorizedError, UnsafeDutyStoreError, UnsafeSharedServerDirectoryError, UnsafeSocketDirectoryError, UnsupportedClientVersionError, UnsupportedContentTypeError, UnsupportedHookOwnerKindError, UnsupportedTransportTypeError, VaultLoadError, VaultNotFoundError, VercelKvAsyncInitRequiredError, VercelKvNotSupportedError, WorkflowDagValidationError, WorkflowJobTimeoutError, WorkflowStepNotFoundError, WorkflowTimeoutError, authorizationRequiredDataSchema, authorizationRequiredMetaSchema, authorizationRequiredParamsSchema, createErrorHandler, describeConfigIssues, extractPublicMessage, formatMcpErrorResponse, isClientFacingError, isMrtrSignal, isPublicError, refused, shouldStopExecution, toMcpError, DynamicJobRegistrationDisabledError, JobAdmissionTimeoutError, JobCancelledError, JobInterruptedError, JobNotAuthorizedError, JobRunFinishedError, JobRunNotCancellableError, JobRunNotFoundError, JobRunnerBootError, JobRunnerUnavailableError, JobStoreNotSupportedError, JobTimeoutError, DuplicatePluginError, UnenforcedMetadataError } from "./errors/index.mjs";
|
|
33
|
+
export { AgentCallDepthExceededError, AgentConfigKeyNotFoundError, AgentConfigurationError, AgentExecutionError, AgentLlmError, AgentLoopExceededError, AgentMethodNotAvailableError, AgentNotConfiguredError, AgentNotFoundError, AgentTimeoutError, AgentToolExecutionError, AgentToolNotFoundError, AgentVisibilityError, AuthConfigurationError, AuthProvidersNotConfiguredError, AuthorizationRequiredError, BrowserEntryPointUnavailableError, BrowserStoreUnavailableError, CallRecorderConfigurationError, ConfigNotFoundError, ContextExtensionNotAvailableError, CredentialProviderAlreadyRegisteredError, CrossOriginRequestError, DependencyCycleError, DependencyNotFoundError, DuplicateAppIdError, DutyNameConflictError, DynamicAdapterNameError, DynamicJobDirectExecutionError, ElicitationDisabledError, ElicitationEncryptionError, ElicitationFallbackRequired, ElicitationNotOwnedError, ElicitationNotSupportedError, ElicitationSecretRequiredError, ElicitationStoreNotInitializedError, ElicitationSubscriptionError, ElicitationTimeoutError, EnclaveExecutionError, EncryptionContextNotSetError, EncryptionKeyNotConfiguredError, EntryUnavailableError, EntryValidationError, ErrorHandler, EsmCacheError, EsmInvalidSpecifierError, EsmManifestInvalidError, EsmPackageLoadError, EsmRegistryAuthError, EsmVersionResolutionError, ExternalEntryError, ExternalEntryLoadError, ExternalEntryNotFoundError, ExternalEntryNotSupportedError, FeatureOffError, FlowExitedWithoutOutputError, FlowInputMissingError, FlowNotRegisteredError, GenericServerError, GlobalConfigNotFoundError, GuardLimitMcpError, HaConfigurationError, HookOrderCycleError, HookTargetNotDefinedError, InMemoryStoreRequiredError, InputRequiredSignal, InternalMcpError, InvalidDecoratorMetadataError, InvalidDependencyScopeError, InvalidEntityError, InvalidFileSignalError, InvalidHookFlowError, InvalidHttpRouteError, InvalidHttpRouteResponseError, InvalidInputError, InvalidInstructionSourceError, InvalidMethodError, InvalidOffloadCallError, InvalidOutputError, InvalidPeopleAuthOptionsError, InvalidPluginScopeError, InvalidRegistryKindError, InvalidResourceStoreError, InvalidResourceUriError, InvalidRetryOptionsError, InvalidSharedServerOptionsError, InvalidSkillError, InvalidTransportSessionError, InvalidUseClassError, InvalidUseFactoryError, InvalidUseValueError, InvokeStateMissingKeyError, JwtSecretRequiredError, JwtSecretWeakError, LazyAppConfigurationError, LazyAppLoadError, MCP_ERROR_CODES, McpError, MethodNotImplementedError, MissingClientCapabilityError, MissingPromptArgumentError, MissingProvideError, NameDisambiguationError, NoProviderIdError, OffloadAbortedError, OffloadBudgetExceededError, OffloadNotCloneableError, OffloadUnsupportedRuntimeError, OffloadWorkerError, OrchestratedAuthNotAvailableError, OrchestratorJwksNotAvailableError, PayloadTooLargeError, PersonNotSignedInError, PluginDependencyError, PromptExecutionError, PromptNotFoundError, ProviderBootstrapError, ProviderConstructionError, ProviderDependencyError, ProviderNotAvailableError, ProviderNotInstantiatedError, ProviderNotRegisteredError, ProviderScopeMismatchError, ProviderScopedAccessError, PublicAccessDeniedError, PublicMcpError, QuotaExceededError, RateLimitError, RegistryDefinitionNotFoundError, RegistryDependencyNotRegisteredError, RegistryGraphEntryNotFoundError, RegistryNotInitializedError, RemoteAuthError, RemoteAuthorizationError, RemoteCapabilityDiscoveryError, RemoteCapabilityNotSupportedError, RemoteConfigurationError, RemoteConnectionError, RemoteDisconnectError, RemoteNotConnectedError, RemotePromptGetError, RemotePromptNotFoundError, RemoteResourceNotFoundError, RemoteResourceReadError, RemoteTimeoutError, RemoteToolExecutionError, RemoteToolNotFoundError, RemoteTransportError, RemoteUnsupportedTransportError, RequestContextNotAvailableError, RequiredConfigUndefinedError, ReservedAppIdError, ResourceNotFoundError, ResourceReadError, SamplingNotAvailableError, ScopeConfigurationError, ScopeDeniedError, ServerNotFoundError, ServerlessHandlerNotInitializedError, SessionClaimConflictError, SessionIdEmptyError, SessionIdentityRequiredError, SessionMissingError, SessionOwnerUnreachableError, SessionSecretRequiredError, SessionVerificationFailedError, SharedServerIdentityError, SharedServerStartError, SignInLockedError, SignInRefusedError, SkillContextNotImplementedError, SkillInstructionFetchError, SkillSessionError, SocketInUseError, SocketPathConflictError, SocketPermissionError, StaleToolListError, StoreNotOpenedInBuildError, TaskAlreadyTerminalError, TaskAugmentationNotSupportedError, TaskAugmentationRequiredError, TaskConcurrencyLimitError, TaskNotFoundError, TaskStoreNotInitializedError, TokenLeakDetectedError, TokenNotAvailableError, TokenStoreRequiredError, ToolAliasConflictError, ToolCallError, ToolCredentialsRequiredError, ToolExecutionError, ToolNameConflictError, ToolNotConsentedError, ToolNotFoundError, TransportAlreadyStartedError, TransportBusRequiredError, TransportNotConnectedError, TransportServiceNotAvailableError, UnauthorizedError, UnsafeDutyStoreError, UnsafeSharedServerDirectoryError, UnsafeSocketDirectoryError, UnsupportedClientVersionError, UnsupportedContentTypeError, UnsupportedHookOwnerKindError, UnsupportedTransportTypeError, VaultLoadError, VaultNotFoundError, VercelKvAsyncInitRequiredError, VercelKvNotSupportedError, WorkflowDagValidationError, WorkflowJobTimeoutError, WorkflowStepNotFoundError, WorkflowTimeoutError, authorizationRequiredDataSchema, authorizationRequiredMetaSchema, authorizationRequiredParamsSchema, createErrorHandler, describeConfigIssues, extractPublicMessage, formatMcpErrorResponse, isClientFacingError, isMrtrSignal, isPublicError, refused, shouldStopExecution, toMcpError, DynamicJobRegistrationDisabledError, JobAdmissionTimeoutError, JobCancelledError, JobInterruptedError, JobNotAuthorizedError, JobRunFinishedError, JobRunNotCancellableError, JobRunNotFoundError, JobRunnerBootError, JobRunnerUnavailableError, JobStoreNotSupportedError, JobTimeoutError, DuplicatePluginEntryError, DuplicatePluginError, PluginConfiguredTwiceError, UnenforcedMetadataError } from "./errors/index.mjs";
|
|
30
34
|
import {
|
|
31
35
|
addHookObserver,
|
|
32
36
|
HOOK_OBSERVER_KEY,
|
|
@@ -217,7 +221,8 @@ import {
|
|
|
217
221
|
authorizeSkillHttpRequest,
|
|
218
222
|
createSkillHttpAuthValidator,
|
|
219
223
|
SkillHttpAuthValidator,
|
|
220
|
-
SkillValidationError
|
|
224
|
+
SkillValidationError,
|
|
225
|
+
SkillBundleNotLoadedError
|
|
221
226
|
} from "./skill/index.mjs";
|
|
222
227
|
import {
|
|
223
228
|
Agent,
|
|
@@ -448,6 +453,7 @@ export {
|
|
|
448
453
|
SSEServerTransport,
|
|
449
454
|
STATELESS_SESSION_ID,
|
|
450
455
|
SURFACE_META_KEY,
|
|
456
|
+
SkillBundleNotLoadedError,
|
|
451
457
|
SkillCatalogSourceToken,
|
|
452
458
|
SkillEmitter,
|
|
453
459
|
SkillHttpAuthValidator,
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ListRootsResultSchema
|
|
4
4
|
} from "@frontmcp/protocol";
|
|
5
5
|
import { awaitOutsideRequest } from "@frontmcp/utils";
|
|
6
|
-
import {
|
|
6
|
+
import { announcesListChangeNow } from "../surface/list-change-batch.mjs";
|
|
7
7
|
var MCP_APPS_EXTENSION_KEY = "io.modelcontextprotocol/ui";
|
|
8
8
|
function hasMcpAppsExtension(capabilities) {
|
|
9
9
|
const declared = capabilities?.experimental?.[MCP_APPS_EXTENSION_KEY] ?? capabilities?.extensions?.[MCP_APPS_EXTENSION_KEY];
|
|
@@ -159,20 +159,20 @@ var NotificationService = class _NotificationService {
|
|
|
159
159
|
if (event.changeScope === "global") {
|
|
160
160
|
if (event.kind === "updated" && event.updatedUri) {
|
|
161
161
|
this.notifyResourceUpdated(event.updatedUri);
|
|
162
|
-
} else if (
|
|
162
|
+
} else if (announcesListChangeNow(this.scope, "resources")) {
|
|
163
163
|
this.broadcastNotification("notifications/resources/list_changed");
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
167
|
this.unsubscribers.push(unsubResources);
|
|
168
168
|
const unsubTools = this.scope.tools.subscribe({ immediate: false }, (event) => {
|
|
169
|
-
if (event.changeScope === "global" &&
|
|
169
|
+
if (event.changeScope === "global" && announcesListChangeNow(this.scope, "tools")) {
|
|
170
170
|
this.broadcastNotification("notifications/tools/list_changed");
|
|
171
171
|
}
|
|
172
172
|
});
|
|
173
173
|
this.unsubscribers.push(unsubTools);
|
|
174
174
|
const unsubPrompts = this.scope.prompts.subscribe({ immediate: false }, (event) => {
|
|
175
|
-
if (event.changeScope === "global" &&
|
|
175
|
+
if (event.changeScope === "global" && announcesListChangeNow(this.scope, "prompts")) {
|
|
176
176
|
this.broadcastNotification("notifications/prompts/list_changed");
|
|
177
177
|
}
|
|
178
178
|
});
|
|
@@ -180,7 +180,7 @@ var NotificationService = class _NotificationService {
|
|
|
180
180
|
const skillRegistry = this.scope.skills;
|
|
181
181
|
if (skillRegistry?.subscribe) {
|
|
182
182
|
const unsubSkills = skillRegistry.subscribe({ immediate: false }, (event) => {
|
|
183
|
-
if (event.changeScope === "global") {
|
|
183
|
+
if (event.changeScope === "global" && announcesListChangeNow(this.scope, "skills")) {
|
|
184
184
|
this.broadcastNotification("notifications/skills/list_changed");
|
|
185
185
|
}
|
|
186
186
|
});
|
|
@@ -12,6 +12,7 @@ import { initOptionsOf } from "../common/dynamic/dynamic.plugin.mjs";
|
|
|
12
12
|
import { collectDynamicProviders, collectDynamicTools, dedupePluginProviders } from "../common/dynamic/dynamic.utils.mjs";
|
|
13
13
|
import { installContextExtensions } from "../context/context-extension.mjs";
|
|
14
14
|
import {
|
|
15
|
+
DuplicatePluginEntryError,
|
|
15
16
|
DuplicatePluginError,
|
|
16
17
|
InvalidPluginScopeError,
|
|
17
18
|
InvalidRegistryKindError,
|
|
@@ -47,6 +48,35 @@ function isConfiguredByOptions(klass) {
|
|
|
47
48
|
const hooks = klass;
|
|
48
49
|
return typeof hooks.dynamicProviders === "function" || typeof hooks.dynamicTools === "function";
|
|
49
50
|
}
|
|
51
|
+
function pluginListName(owner, hostPluginName) {
|
|
52
|
+
if (hostPluginName !== void 0) return `the plugins of plugin "${hostPluginName}"`;
|
|
53
|
+
if (owner === void 0) return "one plugins list";
|
|
54
|
+
if (owner.kind === "scope") return "@FrontMcp({ plugins })";
|
|
55
|
+
return `the plugins of ${owner.kind} "${owner.id}"`;
|
|
56
|
+
}
|
|
57
|
+
function refuseDuplicateEntries(list, listName) {
|
|
58
|
+
const firstEntries = /* @__PURE__ */ new Map();
|
|
59
|
+
for (const [index, raw] of list.entries()) {
|
|
60
|
+
const { provide, metadata } = normalizePlugin(raw);
|
|
61
|
+
const firstEntry = firstEntries.get(provide);
|
|
62
|
+
if (firstEntry === void 0) {
|
|
63
|
+
firstEntries.set(provide, {
|
|
64
|
+
entryNumber: index + 1,
|
|
65
|
+
name: metadata.name,
|
|
66
|
+
oncePerServer: metadata.oncePerServer !== void 0
|
|
67
|
+
});
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const sameOncePerServerPlugin = firstEntry.oncePerServer && metadata.oncePerServer !== void 0 && firstEntry.name === metadata.name;
|
|
71
|
+
if (sameOncePerServerPlugin) continue;
|
|
72
|
+
throw new DuplicatePluginEntryError(
|
|
73
|
+
metadata.name ?? tokenName(provide),
|
|
74
|
+
listName,
|
|
75
|
+
firstEntry.entryNumber,
|
|
76
|
+
index + 1
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
50
80
|
var PluginRegistry = class _PluginRegistry extends RegistryAbstract {
|
|
51
81
|
/** providers by token */
|
|
52
82
|
pProviders = /* @__PURE__ */ new Map();
|
|
@@ -66,7 +96,8 @@ var PluginRegistry = class _PluginRegistry extends RegistryAbstract {
|
|
|
66
96
|
scopeInfo;
|
|
67
97
|
owner;
|
|
68
98
|
logger;
|
|
69
|
-
constructor(providers, list, owner, scopeInfo) {
|
|
99
|
+
constructor(providers, list, owner, scopeInfo, hostPluginName) {
|
|
100
|
+
refuseDuplicateEntries(list, pluginListName(owner, hostPluginName));
|
|
70
101
|
super("PluginRegistry", providers, list);
|
|
71
102
|
this.scope = providers.getActiveScope();
|
|
72
103
|
this.scopeInfo = scopeInfo;
|
|
@@ -150,7 +181,13 @@ var PluginRegistry = class _PluginRegistry extends RegistryAbstract {
|
|
|
150
181
|
ref: token
|
|
151
182
|
};
|
|
152
183
|
const nestedHookOwner = this.owner?.kind === "app" || this.owner?.kind === "agent" || this.owner?.kind === "scope" ? this.owner : pluginOwner;
|
|
153
|
-
const plugins = new _PluginRegistry(
|
|
184
|
+
const plugins = new _PluginRegistry(
|
|
185
|
+
providers,
|
|
186
|
+
rec.metadata.plugins ?? [],
|
|
187
|
+
nestedHookOwner,
|
|
188
|
+
this.scopeInfo,
|
|
189
|
+
rec.metadata.name
|
|
190
|
+
);
|
|
154
191
|
await plugins.ready;
|
|
155
192
|
const adapters = new AdapterRegistry(providers, rec.metadata.adapters ?? []);
|
|
156
193
|
await adapters.ready;
|
|
@@ -340,6 +340,7 @@ var ProviderRegistry = class _ProviderRegistry extends RegistryAbstract {
|
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
342
|
async resolveFactoryArg(t, store, scopeKey) {
|
|
343
|
+
if (t === _ProviderRegistry) return this;
|
|
343
344
|
if (store.has(t)) return store.get(t);
|
|
344
345
|
if (this.instances.has(t)) return this.instances.get(t);
|
|
345
346
|
const rec = this.defs.get(t);
|
|
@@ -1012,6 +1013,7 @@ var ProviderRegistry = class _ProviderRegistry extends RegistryAbstract {
|
|
|
1012
1013
|
* Resolve a dependency from the available views (context \u2192 global).
|
|
1013
1014
|
*/
|
|
1014
1015
|
async resolveFromViews(token, contextStore, globalStore, scopeKey) {
|
|
1016
|
+
if (token === _ProviderRegistry) return this;
|
|
1015
1017
|
if (contextStore.has(token)) return contextStore.get(token);
|
|
1016
1018
|
if (globalStore.has(token)) return globalStore.get(token);
|
|
1017
1019
|
if (this.instances.has(token)) return this.instances.get(token);
|
|
@@ -3,12 +3,16 @@ import { getEnv } from "@frontmcp/utils";
|
|
|
3
3
|
import { normalizePlugin } from "../plugin/plugin.utils.mjs";
|
|
4
4
|
function devEventsObservabilityConfig(installedPlugins) {
|
|
5
5
|
const underFrontmcpDev = !!getEnv("FRONTMCP_DEV_EVENTS_FILE") || getEnv("FRONTMCP_DEV_EVENTS_IPC") === "1";
|
|
6
|
-
if (!underFrontmcpDev) return void 0;
|
|
7
|
-
for (const plugin of installedPlugins) {
|
|
8
|
-
if (normalizePlugin(plugin).metadata.name === "observability") return void 0;
|
|
9
|
-
}
|
|
6
|
+
if (!underFrontmcpDev || listsObservabilityPlugin(installedPlugins)) return void 0;
|
|
10
7
|
return { tracing: false, logging: false };
|
|
11
8
|
}
|
|
9
|
+
function listsObservabilityPlugin(plugins) {
|
|
10
|
+
for (const plugin of plugins) {
|
|
11
|
+
if (normalizePlugin(plugin).metadata.name === "observability") return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
12
15
|
export {
|
|
13
|
-
devEventsObservabilityConfig
|
|
16
|
+
devEventsObservabilityConfig,
|
|
17
|
+
listsObservabilityPlugin
|
|
14
18
|
};
|
|
@@ -31,7 +31,7 @@ import CompleteFlow from "../completion/flows/complete.flow.mjs";
|
|
|
31
31
|
import { FrontMcpContextProvider, FrontMcpContextStorage } from "../context/index.mjs";
|
|
32
32
|
import { proxyTrustOf } from "../context/metadata.utils.mjs";
|
|
33
33
|
import { AuthConfigurationError, FlowExitedWithoutOutputError } from "../errors/index.mjs";
|
|
34
|
-
import { UnenforcedMetadataError } from "../errors/plugin.errors.mjs";
|
|
34
|
+
import { PluginConfiguredTwiceError, UnenforcedMetadataError } from "../errors/plugin.errors.mjs";
|
|
35
35
|
import FlowRegistry from "../flows/flow.registry.mjs";
|
|
36
36
|
import { assertAuthoritiesRules } from "../front-mcp/authorities-rules.check.mjs";
|
|
37
37
|
import { isEntryServer, isJobWorker } from "../front-mcp/detached-job.flag.mjs";
|
|
@@ -64,7 +64,7 @@ import { hasUIConfig, ToolUIRegistry } from "../tool/ui/ui-shared.mjs";
|
|
|
64
64
|
import { warnIfRequestStateKeyNotShared } from "../transport/mcp-20260728/request-state.mjs";
|
|
65
65
|
import { warnIfSessionModeIgnored } from "../transport/session-mode.check.mjs";
|
|
66
66
|
import { guardStorageInBrowser, refuseServerStoresInBrowser, refuseStoresInBrowser } from "./browser-stores.mjs";
|
|
67
|
-
import { devEventsObservabilityConfig } from "./dev-events-observability.mjs";
|
|
67
|
+
import { devEventsObservabilityConfig, listsObservabilityPlugin } from "./dev-events-observability.mjs";
|
|
68
68
|
import { registerServerEntries } from "./server-entries.helper.mjs";
|
|
69
69
|
import { reportStartup } from "./startup-report.helper.mjs";
|
|
70
70
|
var SCOPE_NON_DISPATCHABLE_FLOWS = /* @__PURE__ */ new Set(["http:request"]);
|
|
@@ -434,6 +434,16 @@ var Scope = class _Scope extends ScopeEntry {
|
|
|
434
434
|
if (tasksPromise) batch1.push(tasksPromise);
|
|
435
435
|
if (rateLimitPromise) batch1.push(rateLimitPromise);
|
|
436
436
|
await Promise.all(batch1);
|
|
437
|
+
if (this.metadata.authProvidersVault) {
|
|
438
|
+
const { registerAuthProvidersVault } = await import("../auth/vault/auth-providers.providers.mjs");
|
|
439
|
+
const closeVaultStorage = await registerAuthProvidersVault(
|
|
440
|
+
scopeProviders,
|
|
441
|
+
this.metadata.authProvidersVault,
|
|
442
|
+
this.auth.tokenStorageAdapter,
|
|
443
|
+
this.logger
|
|
444
|
+
);
|
|
445
|
+
if (closeVaultStorage) this.onDispose(closeVaultStorage);
|
|
446
|
+
}
|
|
437
447
|
const serverHooks = serverProviderHooks(this.scopeProviders, this.metadata.providers, scopeRef);
|
|
438
448
|
if (serverHooks.length > 0) await this.scopeHooks.registerHooks(false, ...serverHooks);
|
|
439
449
|
this.logger.verbose("HookRegistry initialized");
|
|
@@ -447,6 +457,9 @@ var Scope = class _Scope extends ScopeEntry {
|
|
|
447
457
|
const impliedObservability = this.metadata.observability === void 0 ? devEventsObservabilityConfig([...serverPlugins, ...appPlugins]) : void 0;
|
|
448
458
|
const observabilityConfig = this.metadata.observability ?? impliedObservability;
|
|
449
459
|
if (observabilityConfig) {
|
|
460
|
+
if (listsObservabilityPlugin(serverPlugins)) {
|
|
461
|
+
throw new PluginConfiguredTwiceError("ObservabilityPlugin", "observability");
|
|
462
|
+
}
|
|
450
463
|
const { observabilityPlugins } = await import("./observability-scope.helper.mjs");
|
|
451
464
|
serverPlugins.push(
|
|
452
465
|
...observabilityPlugins({
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// libs/sdk/src/skill/errors/skill-bundle-not-loaded.error.ts
|
|
2
|
+
import { MCP_ERROR_CODES, PublicMcpError } from "../../errors/index.mjs";
|
|
3
|
+
var SkillBundleNotLoadedError = class extends PublicMcpError {
|
|
4
|
+
constructor(reason) {
|
|
5
|
+
super(`No skill bundle is loaded: ${reason}`, "SKILL_BUNDLE_NOT_LOADED", 503);
|
|
6
|
+
}
|
|
7
|
+
toJsonRpcError() {
|
|
8
|
+
return {
|
|
9
|
+
code: MCP_ERROR_CODES.INTERNAL_ERROR,
|
|
10
|
+
message: this.getPublicMessage(),
|
|
11
|
+
data: { code: this.code, retryable: true }
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
toMcpError(isDevelopment = false) {
|
|
15
|
+
const response = super.toMcpError(isDevelopment);
|
|
16
|
+
return response._meta ? { ...response, _meta: { ...response._meta, retryable: true } } : response;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
SkillBundleNotLoadedError
|
|
21
|
+
};
|
|
@@ -14,7 +14,9 @@ import { internalZ as z } from "@frontmcp/lazy-zod";
|
|
|
14
14
|
import { Flow, FlowBase, FlowHooksOf } from "../../common/index.mjs";
|
|
15
15
|
import { InvalidInputError, PublicMcpError } from "../../errors/index.mjs";
|
|
16
16
|
import { SkillsLoadRequestSchema, SkillsLoadResultSchema } from "../../transport/mcp-handlers/skills-mcp.types.mjs";
|
|
17
|
+
import { SkillBundleNotLoadedError } from "../errors/skill-bundle-not-loaded.error.mjs";
|
|
17
18
|
import { assertSkillAuthorized } from "../skill-authorities.helper.mjs";
|
|
19
|
+
import { readySkillCatalog } from "../skill-catalog-source.mjs";
|
|
18
20
|
import { createSkillEntryResolver } from "../skill-entry.resolver.mjs";
|
|
19
21
|
import { isSkillServable, skillToolsForCaller } from "../skill-filter.helper.mjs";
|
|
20
22
|
import { formatSkillForLLMWithSchemas } from "../skill-http.utils.mjs";
|
|
@@ -63,11 +65,13 @@ var LoadSkillFlow = class extends FlowBase {
|
|
|
63
65
|
}
|
|
64
66
|
const ctx = this.rawInput["ctx"];
|
|
65
67
|
const authInfo = ctx?.["authInfo"] ?? {};
|
|
68
|
+
const { notLoadedReason } = await readySkillCatalog(this.scope);
|
|
66
69
|
const loadResults = [];
|
|
67
70
|
const resolveEntry = createSkillEntryResolver(skillRegistry);
|
|
68
71
|
for (const skillId of skillIds) {
|
|
69
72
|
const result = await skillRegistry.loadSkill(skillId);
|
|
70
73
|
if (!result) {
|
|
74
|
+
if (notLoadedReason !== void 0) throw new SkillBundleNotLoadedError(notLoadedReason);
|
|
71
75
|
warnings.push(`Skill "${skillId}" not found`);
|
|
72
76
|
continue;
|
|
73
77
|
}
|
|
@@ -123,10 +127,11 @@ var LoadSkillFlow = class extends FlowBase {
|
|
|
123
127
|
this.logger.verbose("finalize:start");
|
|
124
128
|
const { loadResults = [], warnings = [], format, activateSession } = this.state.required;
|
|
125
129
|
const toolRegistry = this.scope.tools;
|
|
126
|
-
const
|
|
127
|
-
const
|
|
130
|
+
const markdownOnly = format === "markdown";
|
|
131
|
+
const markdownWithSchemas = format !== "instructions-only";
|
|
132
|
+
const toolsWithSchemas = format === "full";
|
|
128
133
|
const toolsByName = new Map(
|
|
129
|
-
|
|
134
|
+
toolsWithSchemas && toolRegistry ? toolRegistry.getTools(false).map((t) => [t.name, t]) : []
|
|
130
135
|
);
|
|
131
136
|
const allToolNames = /* @__PURE__ */ new Set();
|
|
132
137
|
let allToolsAvailable = true;
|
|
@@ -136,7 +141,7 @@ var LoadSkillFlow = class extends FlowBase {
|
|
|
136
141
|
for (const tool of skill.tools) allToolNames.add(tool.name);
|
|
137
142
|
const tools = skill.tools.map(({ name: name2, purpose }) => {
|
|
138
143
|
const available = availableTools.includes(name2);
|
|
139
|
-
const toolEntry =
|
|
144
|
+
const toolEntry = toolsWithSchemas && available ? toolsByName.get(name2) : void 0;
|
|
140
145
|
return { name: name2, purpose, available, ...toolEntry && { inputSchema: toolEntry.getInputJsonSchema() } };
|
|
141
146
|
});
|
|
142
147
|
const session = activationResult ? {
|
|
@@ -145,9 +150,7 @@ var LoadSkillFlow = class extends FlowBase {
|
|
|
145
150
|
policyMode: activationResult.session.policyMode,
|
|
146
151
|
allowedTools: activationResult.availableTools
|
|
147
152
|
} : { activated: false };
|
|
148
|
-
const
|
|
149
|
-
formattedContent: toolRegistry ? formatSkillForLLMWithSchemas(skill, availableTools, missingTools, toolRegistry) : formatSkillForLLM(skill, availableTools, missingTools)
|
|
150
|
-
} : {
|
|
153
|
+
const fields = markdownOnly ? {} : {
|
|
151
154
|
instructions: skill.instructions,
|
|
152
155
|
parameters: skill.parameters?.map(({ name: name2, description, required, type }) => ({
|
|
153
156
|
name: name2,
|
|
@@ -161,10 +164,11 @@ var LoadSkillFlow = class extends FlowBase {
|
|
|
161
164
|
name: skill.name,
|
|
162
165
|
description: skill.description ?? "",
|
|
163
166
|
tools,
|
|
164
|
-
...
|
|
167
|
+
...fields,
|
|
165
168
|
availableTools,
|
|
166
169
|
missingTools,
|
|
167
170
|
isComplete,
|
|
171
|
+
formattedContent: toolRegistry && markdownWithSchemas ? formatSkillForLLMWithSchemas(skill, availableTools, missingTools, toolRegistry) : formatSkillForLLM(skill, availableTools, missingTools),
|
|
168
172
|
session: activateSession ? session : void 0
|
|
169
173
|
};
|
|
170
174
|
});
|
|
@@ -176,7 +180,7 @@ var LoadSkillFlow = class extends FlowBase {
|
|
|
176
180
|
allToolsAvailable,
|
|
177
181
|
combinedWarnings: warnings.length > 0 ? warnings : void 0
|
|
178
182
|
},
|
|
179
|
-
nextSteps: skills.length > 0 ? `Loaded ${skills.length} skill(s). Follow ${
|
|
183
|
+
nextSteps: skills.length > 0 ? `Loaded ${skills.length} skill(s). Follow ${markdownOnly ? "each formattedContent" : "the instructions"} to complete the task.` : "No skills were loaded. Check the skill IDs and try again."
|
|
180
184
|
});
|
|
181
185
|
this.logger.verbose("finalize:done");
|
|
182
186
|
}
|
|
@@ -15,6 +15,7 @@ import { Flow, FlowBase, FlowHooksOf } from "../../common/index.mjs";
|
|
|
15
15
|
import { extractToolNames } from "../../common/metadata/skill.metadata.mjs";
|
|
16
16
|
import { DependencyNotFoundError, InvalidInputError, ProviderNotAvailableError, PublicMcpError } from "../../errors/index.mjs";
|
|
17
17
|
import { SkillsSearchRequestSchema, SkillsSearchResultSchema } from "../../transport/mcp-handlers/skills-mcp.types.mjs";
|
|
18
|
+
import { assertSkillCatalogLoaded } from "../skill-catalog-source.mjs";
|
|
18
19
|
import { filterDiscoverableSkillResults } from "../skill-filter.helper.mjs";
|
|
19
20
|
var TELEMETRY_ACCESSOR_TOKEN = /* @__PURE__ */ Symbol.for("frontmcp:observability:telemetry-accessor");
|
|
20
21
|
function tryGetTelemetry(flow) {
|
|
@@ -46,7 +47,7 @@ var stateSchema = z.object({
|
|
|
46
47
|
output: outputSchema
|
|
47
48
|
});
|
|
48
49
|
var plan = {
|
|
49
|
-
pre: ["parseInput"],
|
|
50
|
+
pre: ["parseInput", "ensureSkillsLoaded"],
|
|
50
51
|
execute: ["search"],
|
|
51
52
|
finalize: ["finalize"]
|
|
52
53
|
};
|
|
@@ -67,6 +68,9 @@ var SearchSkillsFlow = class extends FlowBase {
|
|
|
67
68
|
this.state.set({ query, options });
|
|
68
69
|
this.logger.verbose("parseInput:done");
|
|
69
70
|
}
|
|
71
|
+
async ensureSkillsLoaded() {
|
|
72
|
+
await assertSkillCatalogLoaded(this.scope);
|
|
73
|
+
}
|
|
70
74
|
async search() {
|
|
71
75
|
this.logger.verbose("search:start");
|
|
72
76
|
const { query, options } = this.state.required;
|
|
@@ -113,7 +117,8 @@ var SearchSkillsFlow = class extends FlowBase {
|
|
|
113
117
|
name: name2,
|
|
114
118
|
available: result.availableTools.includes(name2)
|
|
115
119
|
})),
|
|
116
|
-
source: result.source
|
|
120
|
+
source: result.source,
|
|
121
|
+
...result.bundleVersion !== void 0 && { bundleVersion: result.bundleVersion }
|
|
117
122
|
}));
|
|
118
123
|
const output = {
|
|
119
124
|
skills,
|
|
@@ -129,6 +134,9 @@ var SearchSkillsFlow = class extends FlowBase {
|
|
|
129
134
|
__decorateClass([
|
|
130
135
|
Stage("parseInput")
|
|
131
136
|
], SearchSkillsFlow.prototype, "parseInput", 1);
|
|
137
|
+
__decorateClass([
|
|
138
|
+
Stage("ensureSkillsLoaded")
|
|
139
|
+
], SearchSkillsFlow.prototype, "ensureSkillsLoaded", 1);
|
|
132
140
|
__decorateClass([
|
|
133
141
|
Stage("search")
|
|
134
142
|
], SearchSkillsFlow.prototype, "search", 1);
|
package/browser/skill/index.mjs
CHANGED
|
@@ -85,6 +85,7 @@ import { ToolAuthorizationGuard } from "./guards/tool-authorization.guard.mjs";
|
|
|
85
85
|
import { createSkillToolGuardHook } from "./hooks/index.mjs";
|
|
86
86
|
import { ToolNotAllowedError, ToolApprovalRequiredError } from "./errors/tool-not-allowed.error.mjs";
|
|
87
87
|
import { SkillValidationError } from "./errors/skill-validation.error.mjs";
|
|
88
|
+
import { SkillBundleNotLoadedError } from "./errors/skill-bundle-not-loaded.error.mjs";
|
|
88
89
|
import { registerSkillCapabilities } from "./skill-scope.helper.mjs";
|
|
89
90
|
import { registerSkillAuditWriter, setSkillAuditFactory, hasSkillAuditFactory } from "./skill-audit.helper.mjs";
|
|
90
91
|
import { detectSkillsOnlyMode, isSkillsOnlyRequest, isSkillsOnlySession } from "./skill-mode.utils.mjs";
|
|
@@ -129,6 +130,7 @@ export {
|
|
|
129
130
|
Sep2640SkillFileResource,
|
|
130
131
|
Sep2640SkillIndexResource,
|
|
131
132
|
Sep2640SkillMdResource,
|
|
133
|
+
SkillBundleNotLoadedError,
|
|
132
134
|
SkillCatalogSourceToken,
|
|
133
135
|
SkillEmitter,
|
|
134
136
|
SkillHttpAuthValidator,
|
|
@@ -13,12 +13,14 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
13
13
|
import { Resource } from "../../../common/index.mjs";
|
|
14
14
|
import { ResourceContext } from "../../../common/interfaces/index.mjs";
|
|
15
15
|
import { filterSkillsByAuthorities } from "../../skill-authorities.helper.mjs";
|
|
16
|
+
import { assertSkillCatalogLoaded } from "../../skill-catalog-source.mjs";
|
|
16
17
|
import { filterServableSkills } from "../../skill-filter.helper.mjs";
|
|
17
18
|
import { buildResourceTemplateIndexEntry, buildSkillIndex, buildSkillMdIndexEntry } from "../sep-2640.builders.mjs";
|
|
18
19
|
import { SKILL_INDEX_MIME_TYPE, SKILL_INDEX_URI } from "../sep-2640.constants.mjs";
|
|
19
20
|
import { getExternalProviderSkills, getSepVisibleSkills } from "../sep-2640.resource-helpers.mjs";
|
|
20
21
|
var Sep2640SkillIndexResource = class extends ResourceContext {
|
|
21
22
|
async execute(uri) {
|
|
23
|
+
await assertSkillCatalogLoaded(this.scope);
|
|
22
24
|
const visible = getSepVisibleSkills(this.scope);
|
|
23
25
|
const authorized = await filterSkillsByAuthorities(
|
|
24
26
|
this.scope,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// libs/sdk/src/skill/sep-2640/sep-2640.resource-helpers.ts
|
|
2
2
|
import { isAbsolute, joinPath, pathResolve, readFileBuffer } from "@frontmcp/utils";
|
|
3
3
|
import { PublicMcpError, ResourceNotFoundError } from "../../errors/index.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { SkillBundleNotLoadedError } from "../errors/skill-bundle-not-loaded.error.mjs";
|
|
5
|
+
import { findSkillCatalogSource, readySkillCatalog } from "../skill-catalog-source.mjs";
|
|
5
6
|
import { isSkillServable } from "../skill-filter.helper.mjs";
|
|
6
7
|
import { parseSkillMdFrontmatter } from "../skill-md-parser.mjs";
|
|
7
8
|
import { serializeSkillMd } from "./sep-2640.builders.mjs";
|
|
@@ -38,11 +39,13 @@ function findSkillByPath(scope, skillPath) {
|
|
|
38
39
|
return visible.find((s) => s.metadata.id === lastSegment && s.getSkillPath() === s.metadata.name);
|
|
39
40
|
}
|
|
40
41
|
async function findAndLoadSkillByPath(scope, skillPath) {
|
|
42
|
+
const { notLoadedReason } = await readySkillCatalog(scope);
|
|
43
|
+
const entry = findSkillByPath(scope, skillPath);
|
|
44
|
+
if (!entry && notLoadedReason !== void 0) throw new SkillBundleNotLoadedError(notLoadedReason);
|
|
41
45
|
const registry = scope.skills;
|
|
42
46
|
if (!registry || !registry.hasAny()) {
|
|
43
47
|
throw new PublicMcpError("Skills are not available in this scope.", "CAPABILITY_NOT_AVAILABLE", 501);
|
|
44
48
|
}
|
|
45
|
-
const entry = findSkillByPath(scope, skillPath);
|
|
46
49
|
if (!entry || !await isSkillServable(scope, entry)) {
|
|
47
50
|
throw new ResourceNotFoundError(`skill://${skillPath}/SKILL.md`);
|
|
48
51
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// libs/sdk/src/skill/skill-catalog-source.ts
|
|
2
2
|
import { DependencyNotFoundError, ProviderNotAvailableError, ProviderNotRegisteredError } from "../errors/index.mjs";
|
|
3
|
+
import { SkillBundleNotLoadedError } from "./errors/skill-bundle-not-loaded.error.mjs";
|
|
3
4
|
var SkillCatalogSourceToken = /* @__PURE__ */ Symbol.for(
|
|
4
5
|
"frontmcp:SKILL_CATALOG_SOURCE"
|
|
5
6
|
);
|
|
@@ -17,7 +18,38 @@ function findSkillCatalogSource(scope) {
|
|
|
17
18
|
return void 0;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
21
|
+
async function readySkillCatalog(scope) {
|
|
22
|
+
const source = findSkillCatalogSource(scope);
|
|
23
|
+
if (!source) return {};
|
|
24
|
+
try {
|
|
25
|
+
await source.ready();
|
|
26
|
+
} catch (error) {
|
|
27
|
+
scope.logger.warn("a skill source failed to load; serving the skills registered so far", {
|
|
28
|
+
error: error instanceof Error ? error.message : String(error)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return { source, notLoadedReason: notLoadedReasonOf(source, scope) };
|
|
32
|
+
}
|
|
33
|
+
function notLoadedReasonOf(source, scope) {
|
|
34
|
+
try {
|
|
35
|
+
return source.notLoadedReason?.();
|
|
36
|
+
} catch (error) {
|
|
37
|
+
scope.logger.warn(
|
|
38
|
+
"a skill source failed to report whether its skills loaded; serving the skills registered so far",
|
|
39
|
+
{
|
|
40
|
+
error: error instanceof Error ? error.message : String(error)
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
return void 0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function assertSkillCatalogLoaded(scope) {
|
|
47
|
+
const { notLoadedReason } = await readySkillCatalog(scope);
|
|
48
|
+
if (notLoadedReason !== void 0) throw new SkillBundleNotLoadedError(notLoadedReason);
|
|
49
|
+
}
|
|
20
50
|
export {
|
|
21
51
|
SkillCatalogSourceToken,
|
|
22
|
-
|
|
52
|
+
assertSkillCatalogLoaded,
|
|
53
|
+
findSkillCatalogSource,
|
|
54
|
+
readySkillCatalog
|
|
23
55
|
};
|
|
@@ -4,7 +4,7 @@ import { callSurfaceOf } from "../common/availability/index.mjs";
|
|
|
4
4
|
import { mcpRequestSurface } from "../transport/mcp-handlers/mcp-surface.mjs";
|
|
5
5
|
import { SKILL_INDEX_URI } from "./sep-2640/sep-2640.constants.mjs";
|
|
6
6
|
import { filterSkillsByAuthorities } from "./skill-authorities.helper.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { readySkillCatalog } from "./skill-catalog-source.mjs";
|
|
8
8
|
import { filterServableSkills } from "./skill-filter.helper.mjs";
|
|
9
9
|
var DEFAULT_POLICY = "compact";
|
|
10
10
|
var MAX_SKILL_CATALOG_CHARS = 16e3;
|
|
@@ -73,6 +73,10 @@ function buildCompactSkillsLine(skillRegistry, options) {
|
|
|
73
73
|
if (servesExternalSkills) skills = "skills";
|
|
74
74
|
return `This server has ${skills}: ${pointersFor(options).compact}`;
|
|
75
75
|
}
|
|
76
|
+
function buildSkillsNotLoadedLine(reason) {
|
|
77
|
+
const singleLineReason = reason.replace(/\s+/g, " ").trim();
|
|
78
|
+
return `This server's skills have not loaded yet (${singleLineReason}). Ask for them again shortly; the server sends notifications/skills/list_changed once they load.`;
|
|
79
|
+
}
|
|
76
80
|
function composeInitializeInstructions(options) {
|
|
77
81
|
const policy = options.policy ?? DEFAULT_POLICY;
|
|
78
82
|
const user = (options.userInstructions ?? "").trim();
|
|
@@ -85,6 +89,10 @@ function composeInitializeInstructions(options) {
|
|
|
85
89
|
if (policy === "off") {
|
|
86
90
|
return joinSections([user, channel]);
|
|
87
91
|
}
|
|
92
|
+
if (options.skillsNotLoaded !== void 0) {
|
|
93
|
+
const notLoaded = buildSkillsNotLoadedLine(options.skillsNotLoaded);
|
|
94
|
+
return joinSections(policy === "prepend" ? [notLoaded, channel, user] : [user, channel, notLoaded]);
|
|
95
|
+
}
|
|
88
96
|
const summaryOptions = {
|
|
89
97
|
mcpResources: options.mcpResources,
|
|
90
98
|
skills: options.skills,
|
|
@@ -111,25 +119,17 @@ function instructionsPolicyFor(scope, clientName) {
|
|
|
111
119
|
}
|
|
112
120
|
async function composeCallerInstructions(scope, options = {}) {
|
|
113
121
|
const skillsConfig = scope.metadata.skillsConfig;
|
|
114
|
-
const source =
|
|
115
|
-
if (source) {
|
|
116
|
-
try {
|
|
117
|
-
await source.ready();
|
|
118
|
-
} catch (error) {
|
|
119
|
-
scope.logger.warn("initialize instructions: a skill source failed to load; composed without its skills", {
|
|
120
|
-
error: error instanceof Error ? error.message : String(error)
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
}
|
|
122
|
+
const { source, notLoadedReason } = await readySkillCatalog(scope);
|
|
124
123
|
const composeOptions = {
|
|
125
124
|
userInstructions: scope.metadata.instructions,
|
|
126
125
|
channelInstructions: buildChannelInstructions(scope.channels),
|
|
127
126
|
skillRegistry: scope.skills,
|
|
128
127
|
policy: instructionsPolicyFor(scope, options.clientName),
|
|
129
128
|
mcpResources: skillsConfig?.mcpResources,
|
|
130
|
-
pointers: source?.pointers
|
|
129
|
+
pointers: source?.pointers,
|
|
130
|
+
skillsNotLoaded: notLoadedReason
|
|
131
131
|
};
|
|
132
|
-
const withUriHints = options.skillUriHints === true && skillUriHintsEnabled(scope);
|
|
132
|
+
const withUriHints = options.skillUriHints === true && notLoadedReason === void 0 && skillUriHintsEnabled(scope);
|
|
133
133
|
const listsSkills = withUriHints || includesSkillCatalog(composeOptions);
|
|
134
134
|
let skills = [];
|
|
135
135
|
if (listsSkills) {
|
|
@@ -164,7 +164,7 @@ function skillUriHintsEnabled(scope) {
|
|
|
164
164
|
}
|
|
165
165
|
function includesSkillCatalog(options) {
|
|
166
166
|
const policy = options.policy ?? DEFAULT_POLICY;
|
|
167
|
-
if (policy === "off") return false;
|
|
167
|
+
if (policy === "off" || options.skillsNotLoaded !== void 0) return false;
|
|
168
168
|
return !(policy === "replace" && (options.userInstructions ?? "").trim().length > 0);
|
|
169
169
|
}
|
|
170
170
|
async function skillsVisibleTo(scope, ctx) {
|
|
@@ -610,6 +610,9 @@ var SkillRegistry = class _SkillRegistry extends RegistryAbstract {
|
|
|
610
610
|
servesSkills() {
|
|
611
611
|
return this.dynamicSkillsExpected || this.hasAny() || this.externalProvider?.isReadOnly() === true;
|
|
612
612
|
}
|
|
613
|
+
bundleVersionOf(skillId) {
|
|
614
|
+
return this.dynamicContents.get(skillId)?.bundleVersion;
|
|
615
|
+
}
|
|
613
616
|
/**
|
|
614
617
|
* Get total skill count.
|
|
615
618
|
*
|
|
@@ -749,6 +752,9 @@ var SkillRegistry = class _SkillRegistry extends RegistryAbstract {
|
|
|
749
752
|
}
|
|
750
753
|
return this.emitter.on((e) => cb({ ...e, snapshot: this.listAllInstances().filter(filter) }));
|
|
751
754
|
}
|
|
755
|
+
notifyListChanged() {
|
|
756
|
+
this.bump("reset");
|
|
757
|
+
}
|
|
752
758
|
/* -------------------- Capabilities -------------------- */
|
|
753
759
|
/**
|
|
754
760
|
* Get MCP capabilities for skills.
|
|
@@ -7,14 +7,20 @@ import {
|
|
|
7
7
|
surfaceHash
|
|
8
8
|
} from "./live-surface.mjs";
|
|
9
9
|
import { keepingListsUnchanged, listsUnchanged } from "./unchanged-lists.mjs";
|
|
10
|
+
import {
|
|
11
|
+
announcesListChangeNow,
|
|
12
|
+
runListChangeBatch
|
|
13
|
+
} from "./list-change-batch.mjs";
|
|
10
14
|
export {
|
|
11
15
|
LiveSurface,
|
|
12
16
|
SURFACE_META_KEY,
|
|
17
|
+
announcesListChangeNow,
|
|
13
18
|
assertEntryEnabled,
|
|
14
19
|
enabledItems,
|
|
15
20
|
fileSignal,
|
|
16
21
|
isEntryEnabled,
|
|
17
22
|
keepingListsUnchanged,
|
|
18
23
|
listsUnchanged,
|
|
24
|
+
runListChangeBatch,
|
|
19
25
|
surfaceHash
|
|
20
26
|
};
|