@vendure/mcp-plugin 3.8.0-minor-bootstrap.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/lib/api/api-extensions.d.ts +2 -0
- package/lib/api/api-extensions.js +239 -0
- package/lib/api/api-extensions.js.map +1 -0
- package/lib/api/mcp-actor.service.d.ts +19 -0
- package/lib/api/mcp-actor.service.js +52 -0
- package/lib/api/mcp-actor.service.js.map +1 -0
- package/lib/api/mcp-admin.resolver.d.ts +105 -0
- package/lib/api/mcp-admin.resolver.js +463 -0
- package/lib/api/mcp-admin.resolver.js.map +1 -0
- package/lib/api/mcp-shop.resolver.d.ts +25 -0
- package/lib/api/mcp-shop.resolver.js +74 -0
- package/lib/api/mcp-shop.resolver.js.map +1 -0
- package/lib/check-options.d.ts +7 -0
- package/lib/check-options.js +130 -0
- package/lib/check-options.js.map +1 -0
- package/lib/constants.d.ts +48 -0
- package/lib/constants.js +72 -0
- package/lib/constants.js.map +1 -0
- package/lib/delete-in-batches.d.ts +5 -0
- package/lib/delete-in-batches.js +28 -0
- package/lib/delete-in-batches.js.map +1 -0
- package/lib/entities/index.d.ts +5 -0
- package/lib/entities/index.js +22 -0
- package/lib/entities/index.js.map +1 -0
- package/lib/entities/mcp-authorization-code.entity.d.ts +33 -0
- package/lib/entities/mcp-authorization-code.entity.js +77 -0
- package/lib/entities/mcp-authorization-code.entity.js.map +1 -0
- package/lib/entities/mcp-authorization-request.entity.d.ts +31 -0
- package/lib/entities/mcp-authorization-request.entity.js +73 -0
- package/lib/entities/mcp-authorization-request.entity.js.map +1 -0
- package/lib/entities/mcp-oauth-client.entity.d.ts +56 -0
- package/lib/entities/mcp-oauth-client.entity.js +70 -0
- package/lib/entities/mcp-oauth-client.entity.js.map +1 -0
- package/lib/entities/mcp-oauth-grant.entity.d.ts +77 -0
- package/lib/entities/mcp-oauth-grant.entity.js +121 -0
- package/lib/entities/mcp-oauth-grant.entity.js.map +1 -0
- package/lib/entities/mcp-tool-call-log.entity.d.ts +50 -0
- package/lib/entities/mcp-tool-call-log.entity.js +101 -0
- package/lib/entities/mcp-tool-call-log.entity.js.map +1 -0
- package/lib/events/mcp-tool-call.event.d.ts +17 -0
- package/lib/events/mcp-tool-call.event.js +23 -0
- package/lib/events/mcp-tool-call.event.js.map +1 -0
- package/lib/get-client-ip.d.ts +2 -0
- package/lib/get-client-ip.js +10 -0
- package/lib/get-client-ip.js.map +1 -0
- package/lib/get-language-code.d.ts +3 -0
- package/lib/get-language-code.js +12 -0
- package/lib/get-language-code.js.map +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +26 -0
- package/lib/index.js.map +1 -0
- package/lib/internal-types.d.ts +27 -0
- package/lib/internal-types.js +3 -0
- package/lib/internal-types.js.map +1 -0
- package/lib/logging/mcp-tool-call-log-retention.service.d.ts +8 -0
- package/lib/logging/mcp-tool-call-log-retention.service.js +54 -0
- package/lib/logging/mcp-tool-call-log-retention.service.js.map +1 -0
- package/lib/logging/mcp-tool-call-log.service.d.ts +24 -0
- package/lib/logging/mcp-tool-call-log.service.js +128 -0
- package/lib/logging/mcp-tool-call-log.service.js.map +1 -0
- package/lib/oauth/cimd/cimd-client-resolver.service.d.ts +18 -0
- package/lib/oauth/cimd/cimd-client-resolver.service.js +109 -0
- package/lib/oauth/cimd/cimd-client-resolver.service.js.map +1 -0
- package/lib/oauth/cimd/cimd-document.d.ts +11 -0
- package/lib/oauth/cimd/cimd-document.js +66 -0
- package/lib/oauth/cimd/cimd-document.js.map +1 -0
- package/lib/oauth/cimd/cimd-fetch.d.ts +14 -0
- package/lib/oauth/cimd/cimd-fetch.js +192 -0
- package/lib/oauth/cimd/cimd-fetch.js.map +1 -0
- package/lib/oauth/cimd/cimd-url.d.ts +5 -0
- package/lib/oauth/cimd/cimd-url.js +94 -0
- package/lib/oauth/cimd/cimd-url.js.map +1 -0
- package/lib/oauth/grant-session.service.d.ts +19 -0
- package/lib/oauth/grant-session.service.js +141 -0
- package/lib/oauth/grant-session.service.js.map +1 -0
- package/lib/oauth/oauth-error.d.ts +18 -0
- package/lib/oauth/oauth-error.js +60 -0
- package/lib/oauth/oauth-error.js.map +1 -0
- package/lib/oauth/oauth-metadata.service.d.ts +34 -0
- package/lib/oauth/oauth-metadata.service.js +107 -0
- package/lib/oauth/oauth-metadata.service.js.map +1 -0
- package/lib/oauth/oauth-retention.service.d.ts +23 -0
- package/lib/oauth/oauth-retention.service.js +103 -0
- package/lib/oauth/oauth-retention.service.js.map +1 -0
- package/lib/oauth/oauth-types.d.ts +61 -0
- package/lib/oauth/oauth-types.js +32 -0
- package/lib/oauth/oauth-types.js.map +1 -0
- package/lib/oauth/oauth-utils.d.ts +20 -0
- package/lib/oauth/oauth-utils.js +111 -0
- package/lib/oauth/oauth-utils.js.map +1 -0
- package/lib/oauth/oauth.controller.d.ts +31 -0
- package/lib/oauth/oauth.controller.js +132 -0
- package/lib/oauth/oauth.controller.js.map +1 -0
- package/lib/oauth/oauth.service.d.ts +69 -0
- package/lib/oauth/oauth.service.js +650 -0
- package/lib/oauth/oauth.service.js.map +1 -0
- package/lib/oauth/token-hash.d.ts +6 -0
- package/lib/oauth/token-hash.js +21 -0
- package/lib/oauth/token-hash.js.map +1 -0
- package/lib/plugin.d.ts +54 -0
- package/lib/plugin.js +171 -0
- package/lib/plugin.js.map +1 -0
- package/lib/rate-limit/ip-bucket-key.d.ts +1 -0
- package/lib/rate-limit/ip-bucket-key.js +35 -0
- package/lib/rate-limit/ip-bucket-key.js.map +1 -0
- package/lib/rate-limit/mcp-oauth-rate-limit.guard.d.ts +20 -0
- package/lib/rate-limit/mcp-oauth-rate-limit.guard.js +63 -0
- package/lib/rate-limit/mcp-oauth-rate-limit.guard.js.map +1 -0
- package/lib/rate-limit/mcp-rate-limiter.service.d.ts +47 -0
- package/lib/rate-limit/mcp-rate-limiter.service.js +248 -0
- package/lib/rate-limit/mcp-rate-limiter.service.js.map +1 -0
- package/lib/registry/bm25.d.ts +12 -0
- package/lib/registry/bm25.js +60 -0
- package/lib/registry/bm25.js.map +1 -0
- package/lib/registry/mcp-tool-execution.service.d.ts +45 -0
- package/lib/registry/mcp-tool-execution.service.js +72 -0
- package/lib/registry/mcp-tool-execution.service.js.map +1 -0
- package/lib/registry/mcp-tool-registry.service.d.ts +89 -0
- package/lib/registry/mcp-tool-registry.service.js +668 -0
- package/lib/registry/mcp-tool-registry.service.js.map +1 -0
- package/lib/registry/mcp-tool-schema.service.d.ts +42 -0
- package/lib/registry/mcp-tool-schema.service.js +229 -0
- package/lib/registry/mcp-tool-schema.service.js.map +1 -0
- package/lib/registry/registry-types.d.ts +32 -0
- package/lib/registry/registry-types.js +3 -0
- package/lib/registry/registry-types.js.map +1 -0
- package/lib/resolve-options.d.ts +7 -0
- package/lib/resolve-options.js +85 -0
- package/lib/resolve-options.js.map +1 -0
- package/lib/shared/endpoint-paths.d.ts +8 -0
- package/lib/shared/endpoint-paths.js +12 -0
- package/lib/shared/endpoint-paths.js.map +1 -0
- package/lib/shared/loopback.d.ts +2 -0
- package/lib/shared/loopback.js +9 -0
- package/lib/shared/loopback.js.map +1 -0
- package/lib/shop-session/mcp-shop-session.service.d.ts +47 -0
- package/lib/shop-session/mcp-shop-session.service.js +132 -0
- package/lib/shop-session/mcp-shop-session.service.js.map +1 -0
- package/lib/tasks/mcp-oauth-retention.task.d.ts +9 -0
- package/lib/tasks/mcp-oauth-retention.task.js +21 -0
- package/lib/tasks/mcp-oauth-retention.task.js.map +1 -0
- package/lib/tasks/mcp-tool-call-log-retention.task.d.ts +7 -0
- package/lib/tasks/mcp-tool-call-log-retention.task.js +22 -0
- package/lib/tasks/mcp-tool-call-log-retention.task.js.map +1 -0
- package/lib/tools/built-in/active-order.service.d.ts +26 -0
- package/lib/tools/built-in/active-order.service.js +125 -0
- package/lib/tools/built-in/active-order.service.js.map +1 -0
- package/lib/tools/built-in/admin/add-customer-to-group.tool.d.ts +23 -0
- package/lib/tools/built-in/admin/add-customer-to-group.tool.js +68 -0
- package/lib/tools/built-in/admin/add-customer-to-group.tool.js.map +1 -0
- package/lib/tools/built-in/admin/add-note-to-order.tool.d.ts +104 -0
- package/lib/tools/built-in/admin/add-note-to-order.tool.js +66 -0
- package/lib/tools/built-in/admin/add-note-to-order.tool.js.map +1 -0
- package/lib/tools/built-in/admin/adjust-stock.tool.d.ts +26 -0
- package/lib/tools/built-in/admin/adjust-stock.tool.js +88 -0
- package/lib/tools/built-in/admin/adjust-stock.tool.js.map +1 -0
- package/lib/tools/built-in/admin/cancel-order.tool.d.ts +17 -0
- package/lib/tools/built-in/admin/cancel-order.tool.js +60 -0
- package/lib/tools/built-in/admin/cancel-order.tool.js.map +1 -0
- package/lib/tools/built-in/admin/channel-access.d.ts +2 -0
- package/lib/tools/built-in/admin/channel-access.js +9 -0
- package/lib/tools/built-in/admin/channel-access.js.map +1 -0
- package/lib/tools/built-in/admin/create-customer.tool.d.ts +41 -0
- package/lib/tools/built-in/admin/create-customer.tool.js +57 -0
- package/lib/tools/built-in/admin/create-customer.tool.js.map +1 -0
- package/lib/tools/built-in/admin/create-fulfillment.tool.d.ts +118 -0
- package/lib/tools/built-in/admin/create-fulfillment.tool.js +156 -0
- package/lib/tools/built-in/admin/create-fulfillment.tool.js.map +1 -0
- package/lib/tools/built-in/admin/create-product.tool.d.ts +52 -0
- package/lib/tools/built-in/admin/create-product.tool.js +61 -0
- package/lib/tools/built-in/admin/create-product.tool.js.map +1 -0
- package/lib/tools/built-in/admin/create-variant.tool.d.ts +48 -0
- package/lib/tools/built-in/admin/create-variant.tool.js +79 -0
- package/lib/tools/built-in/admin/create-variant.tool.js.map +1 -0
- package/lib/tools/built-in/admin/entity-field-schemas.d.ts +36 -0
- package/lib/tools/built-in/admin/entity-field-schemas.js +63 -0
- package/lib/tools/built-in/admin/entity-field-schemas.js.map +1 -0
- package/lib/tools/built-in/admin/get-customer.tool.d.ts +28 -0
- package/lib/tools/built-in/admin/get-customer.tool.js +55 -0
- package/lib/tools/built-in/admin/get-customer.tool.js.map +1 -0
- package/lib/tools/built-in/admin/get-order.tool.d.ts +100 -0
- package/lib/tools/built-in/admin/get-order.tool.js +68 -0
- package/lib/tools/built-in/admin/get-order.tool.js.map +1 -0
- package/lib/tools/built-in/admin/get-product.tool.d.ts +69 -0
- package/lib/tools/built-in/admin/get-product.tool.js +77 -0
- package/lib/tools/built-in/admin/get-product.tool.js.map +1 -0
- package/lib/tools/built-in/admin/get-stock-levels.tool.d.ts +23 -0
- package/lib/tools/built-in/admin/get-stock-levels.tool.js +61 -0
- package/lib/tools/built-in/admin/get-stock-levels.tool.js.map +1 -0
- package/lib/tools/built-in/admin/index.d.ts +25 -0
- package/lib/tools/built-in/admin/index.js +54 -0
- package/lib/tools/built-in/admin/index.js.map +1 -0
- package/lib/tools/built-in/admin/list-channels.tool.d.ts +24 -0
- package/lib/tools/built-in/admin/list-channels.tool.js +56 -0
- package/lib/tools/built-in/admin/list-channels.tool.js.map +1 -0
- package/lib/tools/built-in/admin/list-customer-groups.tool.d.ts +23 -0
- package/lib/tools/built-in/admin/list-customer-groups.tool.js +52 -0
- package/lib/tools/built-in/admin/list-customer-groups.tool.js.map +1 -0
- package/lib/tools/built-in/admin/list-customers.tool.d.ts +62 -0
- package/lib/tools/built-in/admin/list-customers.tool.js +66 -0
- package/lib/tools/built-in/admin/list-customers.tool.js.map +1 -0
- package/lib/tools/built-in/admin/list-orders.tool.d.ts +142 -0
- package/lib/tools/built-in/admin/list-orders.tool.js +87 -0
- package/lib/tools/built-in/admin/list-orders.tool.js.map +1 -0
- package/lib/tools/built-in/admin/list-products.tool.d.ts +63 -0
- package/lib/tools/built-in/admin/list-products.tool.js +71 -0
- package/lib/tools/built-in/admin/list-products.tool.js.map +1 -0
- package/lib/tools/built-in/admin/refund-order.tool.d.ts +38 -0
- package/lib/tools/built-in/admin/refund-order.tool.js +115 -0
- package/lib/tools/built-in/admin/refund-order.tool.js.map +1 -0
- package/lib/tools/built-in/admin/set-active-channel.tool.d.ts +22 -0
- package/lib/tools/built-in/admin/set-active-channel.tool.js +84 -0
- package/lib/tools/built-in/admin/set-active-channel.tool.js.map +1 -0
- package/lib/tools/built-in/admin/translation-schemas.d.ts +12 -0
- package/lib/tools/built-in/admin/translation-schemas.js +17 -0
- package/lib/tools/built-in/admin/translation-schemas.js.map +1 -0
- package/lib/tools/built-in/admin/update-customer.tool.d.ts +42 -0
- package/lib/tools/built-in/admin/update-customer.tool.js +59 -0
- package/lib/tools/built-in/admin/update-customer.tool.js.map +1 -0
- package/lib/tools/built-in/admin/update-order-state.tool.d.ts +16 -0
- package/lib/tools/built-in/admin/update-order-state.tool.js +58 -0
- package/lib/tools/built-in/admin/update-order-state.tool.js.map +1 -0
- package/lib/tools/built-in/admin/update-product.tool.d.ts +53 -0
- package/lib/tools/built-in/admin/update-product.tool.js +68 -0
- package/lib/tools/built-in/admin/update-product.tool.js.map +1 -0
- package/lib/tools/built-in/admin/update-variant.tool.d.ts +46 -0
- package/lib/tools/built-in/admin/update-variant.tool.js +77 -0
- package/lib/tools/built-in/admin/update-variant.tool.js.map +1 -0
- package/lib/tools/built-in/admin/upload-asset.tool.d.ts +32 -0
- package/lib/tools/built-in/admin/upload-asset.tool.js +56 -0
- package/lib/tools/built-in/admin/upload-asset.tool.js.map +1 -0
- package/lib/tools/built-in/catalog-query.service.d.ts +21 -0
- package/lib/tools/built-in/catalog-query.service.js +128 -0
- package/lib/tools/built-in/catalog-query.service.js.map +1 -0
- package/lib/tools/built-in/custom-field-input.service.d.ts +10 -0
- package/lib/tools/built-in/custom-field-input.service.js +64 -0
- package/lib/tools/built-in/custom-field-input.service.js.map +1 -0
- package/lib/tools/built-in/email-schema.d.ts +2 -0
- package/lib/tools/built-in/email-schema.js +12 -0
- package/lib/tools/built-in/email-schema.js.map +1 -0
- package/lib/tools/built-in/id-schema.d.ts +3 -0
- package/lib/tools/built-in/id-schema.js +11 -0
- package/lib/tools/built-in/id-schema.js.map +1 -0
- package/lib/tools/built-in/int32-schema.d.ts +4 -0
- package/lib/tools/built-in/int32-schema.js +8 -0
- package/lib/tools/built-in/int32-schema.js.map +1 -0
- package/lib/tools/built-in/list-helpers.d.ts +48 -0
- package/lib/tools/built-in/list-helpers.js +76 -0
- package/lib/tools/built-in/list-helpers.js.map +1 -0
- package/lib/tools/built-in/order-list-helpers.d.ts +20 -0
- package/lib/tools/built-in/order-list-helpers.js +48 -0
- package/lib/tools/built-in/order-list-helpers.js.map +1 -0
- package/lib/tools/built-in/providers.d.ts +2 -0
- package/lib/tools/built-in/providers.js +7 -0
- package/lib/tools/built-in/providers.js.map +1 -0
- package/lib/tools/built-in/remote-asset.d.ts +4 -0
- package/lib/tools/built-in/remote-asset.js +54 -0
- package/lib/tools/built-in/remote-asset.js.map +1 -0
- package/lib/tools/built-in/serializer.service.d.ts +327 -0
- package/lib/tools/built-in/serializer.service.js +413 -0
- package/lib/tools/built-in/serializer.service.js.map +1 -0
- package/lib/tools/built-in/shop/add-to-cart.tool.d.ts +21 -0
- package/lib/tools/built-in/shop/add-to-cart.tool.js +100 -0
- package/lib/tools/built-in/shop/add-to-cart.tool.js.map +1 -0
- package/lib/tools/built-in/shop/address-schema.d.ts +15 -0
- package/lib/tools/built-in/shop/address-schema.js +20 -0
- package/lib/tools/built-in/shop/address-schema.js.map +1 -0
- package/lib/tools/built-in/shop/apply-coupon-code.tool.d.ts +17 -0
- package/lib/tools/built-in/shop/apply-coupon-code.tool.js +62 -0
- package/lib/tools/built-in/shop/apply-coupon-code.tool.js.map +1 -0
- package/lib/tools/built-in/shop/collection-lookup.d.ts +15 -0
- package/lib/tools/built-in/shop/collection-lookup.js +35 -0
- package/lib/tools/built-in/shop/collection-lookup.js.map +1 -0
- package/lib/tools/built-in/shop/get-cart.tool.d.ts +94 -0
- package/lib/tools/built-in/shop/get-cart.tool.js +55 -0
- package/lib/tools/built-in/shop/get-cart.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-collection.tool.d.ts +42 -0
- package/lib/tools/built-in/shop/get-collection.tool.js +64 -0
- package/lib/tools/built-in/shop/get-collection.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.d.ts +26 -0
- package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.js +58 -0
- package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.d.ts +30 -0
- package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.js +59 -0
- package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-my-account.tool.d.ts +22 -0
- package/lib/tools/built-in/shop/get-my-account.tool.js +57 -0
- package/lib/tools/built-in/shop/get-my-account.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-order.tool.d.ts +100 -0
- package/lib/tools/built-in/shop/get-order.tool.js +67 -0
- package/lib/tools/built-in/shop/get-order.tool.js.map +1 -0
- package/lib/tools/built-in/shop/get-product.tool.d.ts +57 -0
- package/lib/tools/built-in/shop/get-product.tool.js +81 -0
- package/lib/tools/built-in/shop/get-product.tool.js.map +1 -0
- package/lib/tools/built-in/shop/index.d.ts +19 -0
- package/lib/tools/built-in/shop/index.js +42 -0
- package/lib/tools/built-in/shop/index.js.map +1 -0
- package/lib/tools/built-in/shop/list-collections.tool.d.ts +42 -0
- package/lib/tools/built-in/shop/list-collections.tool.js +75 -0
- package/lib/tools/built-in/shop/list-collections.tool.js.map +1 -0
- package/lib/tools/built-in/shop/list-my-orders.tool.d.ts +100 -0
- package/lib/tools/built-in/shop/list-my-orders.tool.js +63 -0
- package/lib/tools/built-in/shop/list-my-orders.tool.js.map +1 -0
- package/lib/tools/built-in/shop/place-order.tool.d.ts +188 -0
- package/lib/tools/built-in/shop/place-order.tool.js +152 -0
- package/lib/tools/built-in/shop/place-order.tool.js.map +1 -0
- package/lib/tools/built-in/shop/product-search-query.d.ts +4 -0
- package/lib/tools/built-in/shop/product-search-query.js +34 -0
- package/lib/tools/built-in/shop/product-search-query.js.map +1 -0
- package/lib/tools/built-in/shop/remove-coupon-code.tool.d.ts +17 -0
- package/lib/tools/built-in/shop/remove-coupon-code.tool.js +63 -0
- package/lib/tools/built-in/shop/remove-coupon-code.tool.js.map +1 -0
- package/lib/tools/built-in/shop/remove-from-cart.tool.d.ts +17 -0
- package/lib/tools/built-in/shop/remove-from-cart.tool.js +58 -0
- package/lib/tools/built-in/shop/remove-from-cart.tool.js.map +1 -0
- package/lib/tools/built-in/shop/search-products.tool.d.ts +48 -0
- package/lib/tools/built-in/shop/search-products.tool.js +95 -0
- package/lib/tools/built-in/shop/search-products.tool.js.map +1 -0
- package/lib/tools/built-in/shop/set-checkout-details.tool.d.ts +56 -0
- package/lib/tools/built-in/shop/set-checkout-details.tool.js +187 -0
- package/lib/tools/built-in/shop/set-checkout-details.tool.js.map +1 -0
- package/lib/tools/built-in/shop/set-shipping-method.tool.d.ts +17 -0
- package/lib/tools/built-in/shop/set-shipping-method.tool.js +58 -0
- package/lib/tools/built-in/shop/set-shipping-method.tool.js.map +1 -0
- package/lib/tools/built-in/shop/update-cart-line.tool.d.ts +18 -0
- package/lib/tools/built-in/shop/update-cart-line.tool.js +60 -0
- package/lib/tools/built-in/shop/update-cart-line.tool.js.map +1 -0
- package/lib/tools/built-in/string-schemas.d.ts +4 -0
- package/lib/tools/built-in/string-schemas.js +13 -0
- package/lib/tools/built-in/string-schemas.js.map +1 -0
- package/lib/transport/mcp-server.factory.d.ts +13 -0
- package/lib/transport/mcp-server.factory.js +32 -0
- package/lib/transport/mcp-server.factory.js.map +1 -0
- package/lib/transport/mcp-transport.controller.d.ts +77 -0
- package/lib/transport/mcp-transport.controller.js +442 -0
- package/lib/transport/mcp-transport.controller.js.map +1 -0
- package/lib/types.d.ts +432 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/package.json +42 -0
- package/src/dashboard/components/activity-block.tsx +72 -0
- package/src/dashboard/components/actor-cell.tsx +31 -0
- package/src/dashboard/components/connection-dialog.tsx +106 -0
- package/src/dashboard/components/empty-cell.tsx +7 -0
- package/src/dashboard/components/grants-block.tsx +218 -0
- package/src/dashboard/components/stats-block.tsx +275 -0
- package/src/dashboard/components/tools-block.tsx +274 -0
- package/src/dashboard/components/tooltip-button.tsx +28 -0
- package/src/dashboard/components/use-mcp-table-state.ts +47 -0
- package/src/dashboard/i18n/ar.po +311 -0
- package/src/dashboard/i18n/bg.po +311 -0
- package/src/dashboard/i18n/cs.po +311 -0
- package/src/dashboard/i18n/de.po +311 -0
- package/src/dashboard/i18n/en.po +311 -0
- package/src/dashboard/i18n/es.po +311 -0
- package/src/dashboard/i18n/fa.po +311 -0
- package/src/dashboard/i18n/fr.po +311 -0
- package/src/dashboard/i18n/he.po +311 -0
- package/src/dashboard/i18n/hr.po +311 -0
- package/src/dashboard/i18n/hu.po +311 -0
- package/src/dashboard/i18n/it.po +311 -0
- package/src/dashboard/i18n/ja.po +311 -0
- package/src/dashboard/i18n/ko.po +311 -0
- package/src/dashboard/i18n/nb.po +311 -0
- package/src/dashboard/i18n/ne.po +311 -0
- package/src/dashboard/i18n/nl.po +311 -0
- package/src/dashboard/i18n/pl.po +311 -0
- package/src/dashboard/i18n/pt_BR.po +311 -0
- package/src/dashboard/i18n/pt_PT.po +311 -0
- package/src/dashboard/i18n/ro.po +311 -0
- package/src/dashboard/i18n/ru.po +311 -0
- package/src/dashboard/i18n/sv.po +311 -0
- package/src/dashboard/i18n/tr.po +311 -0
- package/src/dashboard/i18n/uk.po +311 -0
- package/src/dashboard/i18n/uz.po +311 -0
- package/src/dashboard/i18n/zh_Hans.po +311 -0
- package/src/dashboard/i18n/zh_Hant.po +311 -0
- package/src/dashboard/index.tsx +30 -0
- package/src/dashboard/mcp-activity-route.tsx +38 -0
- package/src/dashboard/mcp-authorize-route.tsx +369 -0
- package/src/dashboard/mcp-grants-route.tsx +38 -0
- package/src/dashboard/mcp-overview-route.tsx +46 -0
- package/src/dashboard/mcp-server-redirect-route.tsx +15 -0
- package/src/dashboard/mcp-tools-route.tsx +38 -0
- package/src/dashboard/mcp.graphql.ts +127 -0
- package/src/dashboard/published-files.spec.ts +54 -0
- package/src/dashboard/tsconfig.json +9 -0
- package/src/shared/endpoint-paths.ts +8 -0
- package/src/shared/loopback.ts +6 -0
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shopApiExtensions = exports.adminApiExtensions = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.adminApiExtensions = (0, graphql_tag_1.gql) `
|
|
6
|
+
"Which endpoint a tool is served from."
|
|
7
|
+
enum McpToolset {
|
|
8
|
+
shop
|
|
9
|
+
admin
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
"What a tool does to data: readonly tools only read it, mutating tools change it, and destructive tools ask for confirmation first."
|
|
13
|
+
enum McpToolBehavior {
|
|
14
|
+
readonly
|
|
15
|
+
mutating
|
|
16
|
+
destructive
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
"Whether an administrator or a customer approved an OAuth grant."
|
|
20
|
+
enum McpGrantUserType {
|
|
21
|
+
customer
|
|
22
|
+
admin
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
"Who a tool call ran as. anonymous means nobody was signed in."
|
|
26
|
+
enum McpActorType {
|
|
27
|
+
customer
|
|
28
|
+
admin
|
|
29
|
+
anonymous
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
"The three states an OAuth grant can be in."
|
|
33
|
+
enum McpOauthGrantStatus {
|
|
34
|
+
active
|
|
35
|
+
expired
|
|
36
|
+
revoked
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
"Whether a logged tool call succeeded or failed."
|
|
40
|
+
enum McpToolCallStatus {
|
|
41
|
+
success
|
|
42
|
+
error
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
"Whether clients see every tool directly, or only the two discovery tools."
|
|
46
|
+
enum McpToolExposureMode {
|
|
47
|
+
direct
|
|
48
|
+
discovery
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
"Who the shop endpoint accepts: anyone, signed-in customers only, or nobody."
|
|
52
|
+
enum McpShopAccess {
|
|
53
|
+
anonymous
|
|
54
|
+
authenticated
|
|
55
|
+
disabled
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
"A registered tool and whether it is currently enabled."
|
|
59
|
+
type McpToolInfo {
|
|
60
|
+
id: ID!
|
|
61
|
+
name: String!
|
|
62
|
+
toolset: McpToolset!
|
|
63
|
+
description: String!
|
|
64
|
+
pluginSource: String!
|
|
65
|
+
behavior: McpToolBehavior!
|
|
66
|
+
enabled: Boolean!
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
"An OAuth grant, summarised for the admin overview. Revoked and expired grants are included only when requested."
|
|
70
|
+
type McpOauthGrant implements Node {
|
|
71
|
+
id: ID!
|
|
72
|
+
createdAt: DateTime!
|
|
73
|
+
updatedAt: DateTime!
|
|
74
|
+
actorId: String
|
|
75
|
+
actorType: McpGrantUserType
|
|
76
|
+
"The name of the person who approved the grant. Null when the account no longer exists."
|
|
77
|
+
actorName: String
|
|
78
|
+
"The Customer id when the grant was approved by a customer, so the dashboard can link to them. Null otherwise."
|
|
79
|
+
customerId: ID
|
|
80
|
+
channelId: ID
|
|
81
|
+
oauthClientName: String
|
|
82
|
+
lastActivityAt: DateTime!
|
|
83
|
+
expiresAt: DateTime!
|
|
84
|
+
revokedAt: DateTime
|
|
85
|
+
"Worked out from revokedAt and expiresAt rather than stored, so it is always current."
|
|
86
|
+
status: McpOauthGrantStatus!
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
type McpOauthGrantList implements PaginatedList {
|
|
90
|
+
items: [McpOauthGrant!]!
|
|
91
|
+
totalItems: Int!
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
"""
|
|
95
|
+
One logged tool call. input and output are null unless the server is set to
|
|
96
|
+
capture full call bodies and the caller also holds the ReadCustomer permission.
|
|
97
|
+
"""
|
|
98
|
+
type McpToolCallLog implements Node {
|
|
99
|
+
id: ID!
|
|
100
|
+
createdAt: DateTime!
|
|
101
|
+
updatedAt: DateTime!
|
|
102
|
+
grantId: ID
|
|
103
|
+
"The id of the Vendure user the call ran as. Null when nobody was signed in."
|
|
104
|
+
actor: String
|
|
105
|
+
actorType: McpActorType!
|
|
106
|
+
"The name of the person the call ran as. Null when nobody was signed in or the account no longer exists."
|
|
107
|
+
actorName: String
|
|
108
|
+
"The Customer id when the call ran as a customer, so the dashboard can link to them. Null otherwise."
|
|
109
|
+
customerId: ID
|
|
110
|
+
"Stored only when logging.captureClientIp is enabled. Requires the ReadCustomer permission to read."
|
|
111
|
+
clientIp: String
|
|
112
|
+
channelId: ID
|
|
113
|
+
toolName: String!
|
|
114
|
+
pluginSource: String
|
|
115
|
+
input: JSON
|
|
116
|
+
output: JSON
|
|
117
|
+
durationMs: Int
|
|
118
|
+
status: McpToolCallStatus!
|
|
119
|
+
oauthClientId: ID
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
type McpToolCallLogList implements PaginatedList {
|
|
123
|
+
items: [McpToolCallLog!]!
|
|
124
|
+
totalItems: Int!
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
type McpTopTool {
|
|
128
|
+
toolName: String!
|
|
129
|
+
count: Int!
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
type McpStats {
|
|
133
|
+
totalCalls: Int!
|
|
134
|
+
successRate: Float!
|
|
135
|
+
errorRate: Float!
|
|
136
|
+
p50LatencyMs: Int
|
|
137
|
+
p95LatencyMs: Int
|
|
138
|
+
callsPerHour: Float!
|
|
139
|
+
topTools: [McpTopTool!]!
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
"How this MCP server is configured, so the dashboard can show only what applies."
|
|
143
|
+
type McpServerConfig {
|
|
144
|
+
toolExposure: McpToolExposureMode!
|
|
145
|
+
shopAccess: McpShopAccess!
|
|
146
|
+
"Whether an oauth block is configured. Without it the admin endpoint and grants cannot be used."
|
|
147
|
+
oauthConfigured: Boolean!
|
|
148
|
+
"The OAuth issuer origin, or null when OAuth is not configured."
|
|
149
|
+
issuer: String
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
extend type Query {
|
|
153
|
+
"Every registered tool with its enabled state."
|
|
154
|
+
mcpTools: [McpToolInfo!]!
|
|
155
|
+
"OAuth grants, newest activity first. Lists active grants by default; pass includeInactive: true to also include revoked and expired ones."
|
|
156
|
+
mcpOauthGrants(
|
|
157
|
+
includeInactive: Boolean! = false
|
|
158
|
+
options: McpOauthGrantListOptions
|
|
159
|
+
): McpOauthGrantList!
|
|
160
|
+
"The tool-call log, paginated and filterable."
|
|
161
|
+
mcpToolCallLogs(options: McpToolCallLogListOptions): McpToolCallLogList!
|
|
162
|
+
"Usage stats for a time window. timeRange is one of 1h, 24h, 7d, 30d (default 24h); other values are rejected."
|
|
163
|
+
mcpStats(timeRange: String): McpStats!
|
|
164
|
+
"The server-side configuration the dashboard needs to explain its own pages."
|
|
165
|
+
mcpServerConfig: McpServerConfig!
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
"Where to send the browser once an administrator has approved or denied an MCP client."
|
|
169
|
+
type McpAuthorizationResult {
|
|
170
|
+
redirectUrl: String!
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
extend type Mutation {
|
|
174
|
+
"Enable or disable a tool. Returns the tool with its new state."
|
|
175
|
+
setMcpToolEnabled(toolName: String!, toolset: McpToolset!, enabled: Boolean!): McpToolInfo!
|
|
176
|
+
"Revoke an OAuth grant. Returns false if no grant has that id."
|
|
177
|
+
revokeMcpOauthGrant(id: ID!): Boolean!
|
|
178
|
+
"Delete tool-call logs past the retention window. Returns how many were deleted."
|
|
179
|
+
removeExpiredMcpToolCallLogs: Int!
|
|
180
|
+
"""
|
|
181
|
+
Records the signed-in administrator's decision on a pending MCP authorization request.
|
|
182
|
+
Both approval and denial require the UpdateMcpServer permission.
|
|
183
|
+
"""
|
|
184
|
+
authorizeMcpClient(requestToken: String!, approved: Boolean!): McpAuthorizationResult!
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
# Auto-generated at runtime
|
|
188
|
+
input McpToolCallLogListOptions
|
|
189
|
+
|
|
190
|
+
# Auto-generated at runtime
|
|
191
|
+
input McpOauthGrantListOptions
|
|
192
|
+
|
|
193
|
+
# Vendure builds the sort and filter inputs from these types at run time, but it only offers
|
|
194
|
+
# scalar fields for sorting. Declaring the enum-typed columns here keeps them sortable; the
|
|
195
|
+
# generator merges these fields into the input it builds.
|
|
196
|
+
input McpToolCallLogSortParameter {
|
|
197
|
+
actorType: SortOrder
|
|
198
|
+
status: SortOrder
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
input McpOauthGrantSortParameter {
|
|
202
|
+
actorType: SortOrder
|
|
203
|
+
status: SortOrder
|
|
204
|
+
}
|
|
205
|
+
`;
|
|
206
|
+
exports.shopApiExtensions = (0, graphql_tag_1.gql) `
|
|
207
|
+
"Where to send the browser once a customer has approved or denied an MCP client."
|
|
208
|
+
type McpAuthorizationResult {
|
|
209
|
+
redirectUrl: String!
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
"One of the signed-in customer's own active MCP OAuth grants, summarised for a connected-assistants page."
|
|
213
|
+
type McpCustomerOauthGrantInfo {
|
|
214
|
+
id: ID!
|
|
215
|
+
createdAt: DateTime!
|
|
216
|
+
oauthClientName: String
|
|
217
|
+
lastActivityAt: DateTime!
|
|
218
|
+
expiresAt: DateTime!
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
extend type Query {
|
|
222
|
+
"The signed-in customer's own active (not revoked, not expired) MCP OAuth grants, across every channel."
|
|
223
|
+
activeMcpClientGrants: [McpCustomerOauthGrantInfo!]!
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
extend type Mutation {
|
|
227
|
+
"""
|
|
228
|
+
Records the signed-in customer's decision on a pending MCP authorization request.
|
|
229
|
+
Denial does not require a signed-in customer; approval does.
|
|
230
|
+
"""
|
|
231
|
+
authorizeMcpClient(requestToken: String!, approved: Boolean!): McpAuthorizationResult!
|
|
232
|
+
"""
|
|
233
|
+
Revokes one of the signed-in customer's own MCP OAuth grants. Throws if no such grant
|
|
234
|
+
exists for the signed-in customer.
|
|
235
|
+
"""
|
|
236
|
+
revokeMcpClientGrant(id: ID!): Boolean!
|
|
237
|
+
}
|
|
238
|
+
`;
|
|
239
|
+
//# sourceMappingURL=api-extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-extensions.js","sourceRoot":"","sources":["../../src/api/api-extensions.ts"],"names":[],"mappings":";;;AAAA,6CAAkC;AAErB,QAAA,kBAAkB,GAAG,IAAA,iBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwMpC,CAAC;AAEW,QAAA,iBAAiB,GAAG,IAAA,iBAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCnC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AdministratorService, CustomerService, ID, RequestContext, RequestContextCacheService } from '@vendure/core';
|
|
2
|
+
import { McpActorType, McpGrantUserType } from '../types';
|
|
3
|
+
interface McpActorIdentity {
|
|
4
|
+
name: string | null;
|
|
5
|
+
customerId: ID | null;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Turns the user id stored on a tool-call log or an OAuth grant into a display name, and into a
|
|
9
|
+
* Customer id when the user is a customer.
|
|
10
|
+
*/
|
|
11
|
+
export declare class McpActorService {
|
|
12
|
+
private readonly customerService;
|
|
13
|
+
private readonly administratorService;
|
|
14
|
+
private readonly requestContextCache;
|
|
15
|
+
constructor(customerService: CustomerService, administratorService: AdministratorService, requestContextCache: RequestContextCacheService);
|
|
16
|
+
resolveIdentity(ctx: RequestContext, userId: ID | string | null | undefined, actorType: McpActorType | McpGrantUserType | null | undefined): Promise<McpActorIdentity>;
|
|
17
|
+
private lookUpIdentity;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.McpActorService = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_1 = require("@vendure/core");
|
|
15
|
+
const NO_ACTOR = { name: null, customerId: null };
|
|
16
|
+
function fullName(person) {
|
|
17
|
+
return `${person.firstName} ${person.lastName}`.trim();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Turns the user id stored on a tool-call log or an OAuth grant into a display name, and into a
|
|
21
|
+
* Customer id when the user is a customer.
|
|
22
|
+
*/
|
|
23
|
+
let McpActorService = class McpActorService {
|
|
24
|
+
constructor(customerService, administratorService, requestContextCache) {
|
|
25
|
+
this.customerService = customerService;
|
|
26
|
+
this.administratorService = administratorService;
|
|
27
|
+
this.requestContextCache = requestContextCache;
|
|
28
|
+
}
|
|
29
|
+
// Cached for the request's lifetime, since a list page asks for the same actor on many rows.
|
|
30
|
+
resolveIdentity(ctx, userId, actorType) {
|
|
31
|
+
if (userId == null || actorType == null || actorType === 'anonymous') {
|
|
32
|
+
return Promise.resolve(NO_ACTOR);
|
|
33
|
+
}
|
|
34
|
+
return this.requestContextCache.get(ctx, `McpActorService:${actorType}:${String(userId)}`, () => this.lookUpIdentity(ctx, userId, actorType));
|
|
35
|
+
}
|
|
36
|
+
async lookUpIdentity(ctx, userId, actorType) {
|
|
37
|
+
if (actorType === 'customer') {
|
|
38
|
+
const customer = await this.customerService.findOneByUserId(ctx, userId);
|
|
39
|
+
return customer ? { name: fullName(customer), customerId: customer.id } : NO_ACTOR;
|
|
40
|
+
}
|
|
41
|
+
const administrator = await this.administratorService.findOneByUserId(ctx, userId);
|
|
42
|
+
return administrator ? { name: fullName(administrator), customerId: null } : NO_ACTOR;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.McpActorService = McpActorService;
|
|
46
|
+
exports.McpActorService = McpActorService = __decorate([
|
|
47
|
+
(0, common_1.Injectable)(),
|
|
48
|
+
__metadata("design:paramtypes", [core_1.CustomerService,
|
|
49
|
+
core_1.AdministratorService,
|
|
50
|
+
core_1.RequestContextCacheService])
|
|
51
|
+
], McpActorService);
|
|
52
|
+
//# sourceMappingURL=mcp-actor.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-actor.service.js","sourceRoot":"","sources":["../../src/api/mcp-actor.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wCAMuB;AASvB,MAAM,QAAQ,GAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAEpE,SAAS,QAAQ,CAAC,MAA+C;IAC7D,OAAO,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;AAC3D,CAAC;AAED;;;GAGG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAe;IACxB,YACqB,eAAgC,EAChC,oBAA0C,EAC1C,mBAA+C;QAF/C,oBAAe,GAAf,eAAe,CAAiB;QAChC,yBAAoB,GAApB,oBAAoB,CAAsB;QAC1C,wBAAmB,GAAnB,mBAAmB,CAA4B;IACjE,CAAC;IAEJ,6FAA6F;IAC7F,eAAe,CACX,GAAmB,EACnB,MAAsC,EACtC,SAA6D;QAE7D,IAAI,MAAM,IAAI,IAAI,IAAI,SAAS,IAAI,IAAI,IAAI,SAAS,KAAK,WAAW,EAAE,CAAC;YACnE,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,GAAG,EAAE,mBAAmB,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAC5F,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,CAC9C,CAAC;IACN,CAAC;IAEO,KAAK,CAAC,cAAc,CACxB,GAAmB,EACnB,MAAmB,EACnB,SAA0C;QAE1C,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;YAC3B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YACzE,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;QACvF,CAAC;QACD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACnF,OAAO,aAAa,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC1F,CAAC;CACJ,CAAA;AAjCY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAG6B,sBAAe;QACV,2BAAoB;QACrB,iCAA0B;GAJ3D,eAAe,CAiC3B"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { CacheService, ID, ListQueryBuilder, ListQueryOptions, RequestContext, TransactionalConnection } from '@vendure/core';
|
|
2
|
+
import { McpToolBehavior, McpToolset } from '@vendure/mcp-sdk';
|
|
3
|
+
import { McpOauthGrant, McpToolCallLog } from '../entities';
|
|
4
|
+
import { ResolvedMcpPluginOptions } from '../internal-types';
|
|
5
|
+
import { McpToolCallLogRetentionService } from '../logging/mcp-tool-call-log-retention.service';
|
|
6
|
+
import { McpOauthService } from '../oauth/oauth.service';
|
|
7
|
+
import { McpToolRegistryService } from '../registry/mcp-tool-registry.service';
|
|
8
|
+
import { McpToolExposureMode } from '../types';
|
|
9
|
+
import { McpActorService } from './mcp-actor.service';
|
|
10
|
+
/** A registered tool and whether it is currently enabled. */
|
|
11
|
+
interface McpToolInfo {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
toolset: McpToolset;
|
|
15
|
+
description: string;
|
|
16
|
+
pluginSource: string;
|
|
17
|
+
behavior: McpToolBehavior;
|
|
18
|
+
enabled: boolean;
|
|
19
|
+
}
|
|
20
|
+
type McpStats = {
|
|
21
|
+
totalCalls: number;
|
|
22
|
+
successRate: number;
|
|
23
|
+
errorRate: number;
|
|
24
|
+
p50LatencyMs: number | null;
|
|
25
|
+
p95LatencyMs: number | null;
|
|
26
|
+
callsPerHour: number;
|
|
27
|
+
topTools: Array<{
|
|
28
|
+
toolName: string;
|
|
29
|
+
count: number;
|
|
30
|
+
}>;
|
|
31
|
+
};
|
|
32
|
+
/** How this MCP server is configured, so the dashboard can show only what applies. */
|
|
33
|
+
interface McpServerConfig {
|
|
34
|
+
toolExposure: McpToolExposureMode;
|
|
35
|
+
shopAccess: NonNullable<ResolvedMcpPluginOptions['shopAccess']>;
|
|
36
|
+
oauthConfigured: boolean;
|
|
37
|
+
issuer: string | null;
|
|
38
|
+
}
|
|
39
|
+
export declare class McpAdminResolver {
|
|
40
|
+
private readonly connection;
|
|
41
|
+
private readonly registry;
|
|
42
|
+
private readonly oauthService;
|
|
43
|
+
private readonly cacheService;
|
|
44
|
+
private readonly listQueryBuilder;
|
|
45
|
+
private readonly options;
|
|
46
|
+
private readonly toolCallLogRetention;
|
|
47
|
+
constructor(connection: TransactionalConnection, registry: McpToolRegistryService, oauthService: McpOauthService, cacheService: CacheService, listQueryBuilder: ListQueryBuilder, options: ResolvedMcpPluginOptions, toolCallLogRetention: McpToolCallLogRetentionService);
|
|
48
|
+
mcpTools(ctx: RequestContext): Promise<McpToolInfo[]>;
|
|
49
|
+
mcpOauthGrants(ctx: RequestContext, args: {
|
|
50
|
+
includeInactive: boolean;
|
|
51
|
+
options?: ListQueryOptions<McpOauthGrant>;
|
|
52
|
+
}): Promise<{
|
|
53
|
+
items: McpOauthGrant[];
|
|
54
|
+
totalItems: number;
|
|
55
|
+
}>;
|
|
56
|
+
mcpToolCallLogs(ctx: RequestContext, args: {
|
|
57
|
+
options?: ListQueryOptions<McpToolCallLog>;
|
|
58
|
+
}): Promise<{
|
|
59
|
+
items: McpToolCallLog[];
|
|
60
|
+
totalItems: number;
|
|
61
|
+
}>;
|
|
62
|
+
mcpStats(ctx: RequestContext, args: {
|
|
63
|
+
timeRange?: string;
|
|
64
|
+
}): Promise<McpStats>;
|
|
65
|
+
mcpServerConfig(): McpServerConfig;
|
|
66
|
+
setMcpToolEnabled(ctx: RequestContext, args: {
|
|
67
|
+
toolName: string;
|
|
68
|
+
toolset: McpToolset;
|
|
69
|
+
enabled: boolean;
|
|
70
|
+
}): Promise<McpToolInfo>;
|
|
71
|
+
revokeMcpOauthGrant(ctx: RequestContext, args: {
|
|
72
|
+
id: ID;
|
|
73
|
+
}): Promise<boolean>;
|
|
74
|
+
removeExpiredMcpToolCallLogs(ctx: RequestContext): Promise<number>;
|
|
75
|
+
authorizeMcpClient(ctx: RequestContext, args: {
|
|
76
|
+
requestToken: string;
|
|
77
|
+
approved: boolean;
|
|
78
|
+
}): Promise<{
|
|
79
|
+
redirectUrl: string;
|
|
80
|
+
}>;
|
|
81
|
+
private toToolInfo;
|
|
82
|
+
private computeStats;
|
|
83
|
+
private durationPercentiles;
|
|
84
|
+
private windowedQuery;
|
|
85
|
+
private limitToWindow;
|
|
86
|
+
private scopeToChannel;
|
|
87
|
+
private applyDefaultOrder;
|
|
88
|
+
}
|
|
89
|
+
export declare class McpToolCallLogEntityResolver {
|
|
90
|
+
private readonly actorService;
|
|
91
|
+
constructor(actorService: McpActorService);
|
|
92
|
+
input(log: McpToolCallLog, ctx: RequestContext): unknown;
|
|
93
|
+
output(log: McpToolCallLog, ctx: RequestContext): unknown;
|
|
94
|
+
clientIp(log: McpToolCallLog, ctx: RequestContext): string | null;
|
|
95
|
+
actorName(log: McpToolCallLog, ctx: RequestContext): Promise<string | null>;
|
|
96
|
+
customerId(log: McpToolCallLog, ctx: RequestContext): Promise<ID | null>;
|
|
97
|
+
}
|
|
98
|
+
export declare class McpOauthGrantEntityResolver {
|
|
99
|
+
private readonly actorService;
|
|
100
|
+
constructor(actorService: McpActorService);
|
|
101
|
+
oauthClientName(grant: McpOauthGrant): string | null;
|
|
102
|
+
actorName(grant: McpOauthGrant, ctx: RequestContext): Promise<string | null>;
|
|
103
|
+
customerId(grant: McpOauthGrant, ctx: RequestContext): Promise<ID | null>;
|
|
104
|
+
}
|
|
105
|
+
export {};
|