@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,463 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
15
|
+
var t = {};
|
|
16
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
17
|
+
t[p] = s[p];
|
|
18
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
19
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
20
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
21
|
+
t[p[i]] = s[p[i]];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.McpOauthGrantEntityResolver = exports.McpToolCallLogEntityResolver = exports.McpAdminResolver = void 0;
|
|
27
|
+
const common_1 = require("@nestjs/common");
|
|
28
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
29
|
+
const core_1 = require("@vendure/core");
|
|
30
|
+
const DateUtils_1 = require("typeorm/util/DateUtils");
|
|
31
|
+
const constants_1 = require("../constants");
|
|
32
|
+
const entities_1 = require("../entities");
|
|
33
|
+
const mcp_tool_call_log_retention_service_1 = require("../logging/mcp-tool-call-log-retention.service");
|
|
34
|
+
const oauth_service_1 = require("../oauth/oauth.service");
|
|
35
|
+
const mcp_tool_registry_service_1 = require("../registry/mcp-tool-registry.service");
|
|
36
|
+
const mcp_actor_service_1 = require("./mcp-actor.service");
|
|
37
|
+
const STATS_TIME_RANGE_HOURS = new Map([
|
|
38
|
+
['1h', 1],
|
|
39
|
+
['24h', 24],
|
|
40
|
+
['7d', 24 * 7],
|
|
41
|
+
['30d', 24 * 30],
|
|
42
|
+
]);
|
|
43
|
+
const STATS_CACHE_TTL_MS = 60000;
|
|
44
|
+
let McpAdminResolver = class McpAdminResolver {
|
|
45
|
+
constructor(connection, registry, oauthService, cacheService, listQueryBuilder, options, toolCallLogRetention) {
|
|
46
|
+
this.connection = connection;
|
|
47
|
+
this.registry = registry;
|
|
48
|
+
this.oauthService = oauthService;
|
|
49
|
+
this.cacheService = cacheService;
|
|
50
|
+
this.listQueryBuilder = listQueryBuilder;
|
|
51
|
+
this.options = options;
|
|
52
|
+
this.toolCallLogRetention = toolCallLogRetention;
|
|
53
|
+
}
|
|
54
|
+
async mcpTools(ctx) {
|
|
55
|
+
const toggles = await this.registry.getToolToggles(ctx);
|
|
56
|
+
return this.registry.getRegistrySnapshot().map(tool => this.toToolInfo(tool, toggles));
|
|
57
|
+
}
|
|
58
|
+
async mcpOauthGrants(ctx, args) {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
const qb = this.listQueryBuilder.build(entities_1.McpOauthGrant, (_a = args.options) !== null && _a !== void 0 ? _a : undefined, {
|
|
61
|
+
ctx,
|
|
62
|
+
relations: ['oauthClient'],
|
|
63
|
+
customPropertyMap: { oauthClientName: 'oauthClient.clientName' },
|
|
64
|
+
});
|
|
65
|
+
if (!args.includeInactive) {
|
|
66
|
+
qb.andWhere('mcpoauthgrant.revokedAt IS NULL').andWhere('mcpoauthgrant.expiresAt > :now', {
|
|
67
|
+
now: new Date(),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
this.scopeToChannel(qb, 'mcpoauthgrant', ctx.channelId);
|
|
71
|
+
this.applyDefaultOrder(qb, 'mcpoauthgrant', (_b = args.options) === null || _b === void 0 ? void 0 : _b.sort, 'lastActivityAt');
|
|
72
|
+
const [items, totalItems] = await qb.getManyAndCount();
|
|
73
|
+
return { items, totalItems };
|
|
74
|
+
}
|
|
75
|
+
async mcpToolCallLogs(ctx, args) {
|
|
76
|
+
var _a, _b;
|
|
77
|
+
// Filtering or sorting by clientIp would reveal the addresses the field resolver hides.
|
|
78
|
+
if (!ctx.userHasPermissions([core_1.Permission.ReadCustomer]) &&
|
|
79
|
+
listOptionsUseField(args.options, 'clientIp')) {
|
|
80
|
+
throw new core_1.ForbiddenError();
|
|
81
|
+
}
|
|
82
|
+
const qb = this.listQueryBuilder.build(entities_1.McpToolCallLog, (_a = args.options) !== null && _a !== void 0 ? _a : undefined, {
|
|
83
|
+
ctx,
|
|
84
|
+
entityAlias: 'log',
|
|
85
|
+
});
|
|
86
|
+
this.scopeToChannel(qb, 'log', ctx.channelId);
|
|
87
|
+
this.applyDefaultOrder(qb, 'log', (_b = args.options) === null || _b === void 0 ? void 0 : _b.sort, 'createdAt');
|
|
88
|
+
const [items, totalItems] = await qb.getManyAndCount();
|
|
89
|
+
return { items, totalItems };
|
|
90
|
+
}
|
|
91
|
+
async mcpStats(ctx, args) {
|
|
92
|
+
var _a;
|
|
93
|
+
const timeRange = (_a = args.timeRange) !== null && _a !== void 0 ? _a : '24h';
|
|
94
|
+
const hours = STATS_TIME_RANGE_HOURS.get(timeRange);
|
|
95
|
+
if (hours == null) {
|
|
96
|
+
throw new core_1.UserInputError(`Invalid timeRange "${timeRange}" - use one of ${Array.from(STATS_TIME_RANGE_HOURS.keys()).join(', ')}`);
|
|
97
|
+
}
|
|
98
|
+
const cacheKey = `mcp:stats:${String(ctx.channelId)}:${timeRange}`;
|
|
99
|
+
const cached = await this.cacheService.get(cacheKey);
|
|
100
|
+
if (cached) {
|
|
101
|
+
return cached;
|
|
102
|
+
}
|
|
103
|
+
const stats = await this.computeStats(ctx, hours);
|
|
104
|
+
await this.cacheService.set(cacheKey, stats, { ttl: STATS_CACHE_TTL_MS });
|
|
105
|
+
return stats;
|
|
106
|
+
}
|
|
107
|
+
mcpServerConfig() {
|
|
108
|
+
var _a, _b;
|
|
109
|
+
return {
|
|
110
|
+
toolExposure: this.options.toolExposure,
|
|
111
|
+
shopAccess: this.options.shopAccess,
|
|
112
|
+
oauthConfigured: this.options.oauth != null,
|
|
113
|
+
issuer: (_b = (_a = this.options.oauth) === null || _a === void 0 ? void 0 : _a.issuer) !== null && _b !== void 0 ? _b : null,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
async setMcpToolEnabled(ctx, args) {
|
|
117
|
+
const tool = this.registry
|
|
118
|
+
.getRegistrySnapshot()
|
|
119
|
+
.find(t => t.name === args.toolName && t.toolset === args.toolset);
|
|
120
|
+
if (!tool) {
|
|
121
|
+
throw new core_1.UserInputError(`Unknown MCP tool "${args.toolName}" in toolset "${args.toolset}"`);
|
|
122
|
+
}
|
|
123
|
+
await this.registry.setToolEnabled(ctx, args.toolset, args.toolName, args.enabled);
|
|
124
|
+
const toggles = await this.registry.getToolToggles(ctx);
|
|
125
|
+
return this.toToolInfo(tool, toggles);
|
|
126
|
+
}
|
|
127
|
+
async revokeMcpOauthGrant(ctx, args) {
|
|
128
|
+
return this.oauthService.revokeGrantById(ctx, args.id);
|
|
129
|
+
}
|
|
130
|
+
async removeExpiredMcpToolCallLogs(ctx) {
|
|
131
|
+
return this.toolCallLogRetention.deleteExpiredToolCallLogs(ctx, ctx.channelId);
|
|
132
|
+
}
|
|
133
|
+
async authorizeMcpClient(ctx, args) {
|
|
134
|
+
return this.oauthService.approveAdminRequest(ctx, args.requestToken, args.approved);
|
|
135
|
+
}
|
|
136
|
+
toToolInfo(tool, toggles) {
|
|
137
|
+
return {
|
|
138
|
+
id: this.registry.toolKey(tool.toolset, tool.name),
|
|
139
|
+
name: tool.name,
|
|
140
|
+
toolset: tool.toolset,
|
|
141
|
+
description: tool.description,
|
|
142
|
+
pluginSource: tool.pluginSource,
|
|
143
|
+
behavior: tool.resolvedBehavior,
|
|
144
|
+
enabled: this.registry.isToolEnabled(tool, toggles),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
async computeStats(ctx, hours) {
|
|
148
|
+
const since = DateUtils_1.DateUtils.mixedDateToUtcDatetimeString(new Date(Date.now() - hours * 3600000));
|
|
149
|
+
const statusRows = await this.windowedQuery(ctx, since)
|
|
150
|
+
.select('log.status', 'status')
|
|
151
|
+
.addSelect('COUNT(*)', 'count')
|
|
152
|
+
.groupBy('log.status')
|
|
153
|
+
.getRawMany();
|
|
154
|
+
let totalCalls = 0;
|
|
155
|
+
let successCount = 0;
|
|
156
|
+
for (const row of statusRows) {
|
|
157
|
+
const count = Number(row.count);
|
|
158
|
+
totalCalls += count;
|
|
159
|
+
if (row.status === 'success') {
|
|
160
|
+
successCount += count;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const topToolRows = await this.windowedQuery(ctx, since)
|
|
164
|
+
.select('log.toolName', 'toolName')
|
|
165
|
+
.addSelect('COUNT(*)', 'count')
|
|
166
|
+
.groupBy('log.toolName')
|
|
167
|
+
.orderBy('count', 'DESC')
|
|
168
|
+
// Secondary key so tools with equal counts sort deterministically instead of in DB-dependent order
|
|
169
|
+
.addOrderBy('log.toolName', 'ASC')
|
|
170
|
+
.limit(10)
|
|
171
|
+
.getRawMany();
|
|
172
|
+
const topTools = topToolRows.map(row => ({ toolName: row.toolName, count: Number(row.count) }));
|
|
173
|
+
const durationCount = await this.windowedQuery(ctx, since)
|
|
174
|
+
.andWhere('log.durationMs IS NOT NULL')
|
|
175
|
+
.getCount();
|
|
176
|
+
const { p50LatencyMs, p95LatencyMs } = await this.durationPercentiles(ctx, since, durationCount);
|
|
177
|
+
return {
|
|
178
|
+
totalCalls,
|
|
179
|
+
successRate: totalCalls === 0 ? 0 : successCount / totalCalls,
|
|
180
|
+
errorRate: totalCalls === 0 ? 0 : (totalCalls - successCount) / totalCalls,
|
|
181
|
+
p50LatencyMs,
|
|
182
|
+
p95LatencyMs,
|
|
183
|
+
callsPerHour: totalCalls / hours,
|
|
184
|
+
topTools,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
// Numbers the rows in duration order and picks the two positions, in one statement.
|
|
188
|
+
async durationPercentiles(ctx, since, total) {
|
|
189
|
+
if (total === 0) {
|
|
190
|
+
return { p50LatencyMs: null, p95LatencyMs: null };
|
|
191
|
+
}
|
|
192
|
+
// 1-based position of the nth-percentile row in duration order.
|
|
193
|
+
const positionOf = (percentile) => Math.floor((total - 1) * percentile) + 1;
|
|
194
|
+
const p50Position = positionOf(0.5);
|
|
195
|
+
const p95Position = positionOf(0.95);
|
|
196
|
+
// Lower-case aliases: Postgres folds these unquoted column names to lower case.
|
|
197
|
+
const rows = await this.connection
|
|
198
|
+
.getRepository(ctx, entities_1.McpToolCallLog)
|
|
199
|
+
.manager.createQueryBuilder()
|
|
200
|
+
.select('ranked.duration_ms', 'duration_ms')
|
|
201
|
+
.addSelect('ranked.row_position', 'row_position')
|
|
202
|
+
.from(subQuery => {
|
|
203
|
+
const ranked = subQuery
|
|
204
|
+
.select('log.durationMs', 'duration_ms')
|
|
205
|
+
.addSelect('ROW_NUMBER() OVER (ORDER BY log.durationMs ASC)', 'row_position')
|
|
206
|
+
.from(entities_1.McpToolCallLog, 'log');
|
|
207
|
+
return this.limitToWindow(ranked, ctx, since).andWhere('log.durationMs IS NOT NULL');
|
|
208
|
+
}, 'ranked')
|
|
209
|
+
.where('ranked.row_position IN (:...positions)', { positions: [p50Position, p95Position] })
|
|
210
|
+
.getRawMany();
|
|
211
|
+
const durationAt = (position) => {
|
|
212
|
+
const row = rows.find(r => Number(r.row_position) === position);
|
|
213
|
+
return row ? Number(row.duration_ms) : null;
|
|
214
|
+
};
|
|
215
|
+
return { p50LatencyMs: durationAt(p50Position), p95LatencyMs: durationAt(p95Position) };
|
|
216
|
+
}
|
|
217
|
+
windowedQuery(ctx, since) {
|
|
218
|
+
const qb = this.connection.getRepository(ctx, entities_1.McpToolCallLog).createQueryBuilder('log');
|
|
219
|
+
return this.limitToWindow(qb, ctx, since);
|
|
220
|
+
}
|
|
221
|
+
limitToWindow(qb, ctx, since) {
|
|
222
|
+
qb.where('log.createdAt >= :since', { since });
|
|
223
|
+
this.scopeToChannel(qb, 'log', ctx.channelId);
|
|
224
|
+
return qb;
|
|
225
|
+
}
|
|
226
|
+
// Shared by the grants list, the tool-call log list and the statistics window.
|
|
227
|
+
scopeToChannel(qb, alias, channelId) {
|
|
228
|
+
qb.andWhere(`${alias}.channelId = :channelId`, { channelId });
|
|
229
|
+
}
|
|
230
|
+
// Newest first by default, with id DESC always last so same-timestamp rows stay in a stable order.
|
|
231
|
+
applyDefaultOrder(qb, alias, sort, column) {
|
|
232
|
+
if (Object.keys(sort !== null && sort !== void 0 ? sort : {}).length === 0) {
|
|
233
|
+
qb.orderBy(`${alias}.${column}`, 'DESC');
|
|
234
|
+
}
|
|
235
|
+
qb.addOrderBy(`${alias}.id`, 'DESC');
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
exports.McpAdminResolver = McpAdminResolver;
|
|
239
|
+
__decorate([
|
|
240
|
+
(0, graphql_1.Query)(),
|
|
241
|
+
(0, core_1.Allow)(constants_1.mcpServerPermission.Read),
|
|
242
|
+
__param(0, (0, core_1.Ctx)()),
|
|
243
|
+
__metadata("design:type", Function),
|
|
244
|
+
__metadata("design:paramtypes", [core_1.RequestContext]),
|
|
245
|
+
__metadata("design:returntype", Promise)
|
|
246
|
+
], McpAdminResolver.prototype, "mcpTools", null);
|
|
247
|
+
__decorate([
|
|
248
|
+
(0, graphql_1.Query)(),
|
|
249
|
+
(0, core_1.Allow)(constants_1.mcpServerPermission.Read),
|
|
250
|
+
__param(0, (0, core_1.Ctx)()),
|
|
251
|
+
__param(1, (0, graphql_1.Args)()),
|
|
252
|
+
__metadata("design:type", Function),
|
|
253
|
+
__metadata("design:paramtypes", [core_1.RequestContext, Object]),
|
|
254
|
+
__metadata("design:returntype", Promise)
|
|
255
|
+
], McpAdminResolver.prototype, "mcpOauthGrants", null);
|
|
256
|
+
__decorate([
|
|
257
|
+
(0, graphql_1.Query)(),
|
|
258
|
+
(0, core_1.Allow)(constants_1.mcpServerPermission.Read),
|
|
259
|
+
__param(0, (0, core_1.Ctx)()),
|
|
260
|
+
__param(1, (0, graphql_1.Args)()),
|
|
261
|
+
__metadata("design:type", Function),
|
|
262
|
+
__metadata("design:paramtypes", [core_1.RequestContext, Object]),
|
|
263
|
+
__metadata("design:returntype", Promise)
|
|
264
|
+
], McpAdminResolver.prototype, "mcpToolCallLogs", null);
|
|
265
|
+
__decorate([
|
|
266
|
+
(0, graphql_1.Query)(),
|
|
267
|
+
(0, core_1.Allow)(constants_1.mcpServerPermission.Read),
|
|
268
|
+
__param(0, (0, core_1.Ctx)()),
|
|
269
|
+
__param(1, (0, graphql_1.Args)()),
|
|
270
|
+
__metadata("design:type", Function),
|
|
271
|
+
__metadata("design:paramtypes", [core_1.RequestContext, Object]),
|
|
272
|
+
__metadata("design:returntype", Promise)
|
|
273
|
+
], McpAdminResolver.prototype, "mcpStats", null);
|
|
274
|
+
__decorate([
|
|
275
|
+
(0, graphql_1.Query)(),
|
|
276
|
+
(0, core_1.Allow)(constants_1.mcpServerPermission.Read),
|
|
277
|
+
__metadata("design:type", Function),
|
|
278
|
+
__metadata("design:paramtypes", []),
|
|
279
|
+
__metadata("design:returntype", Object)
|
|
280
|
+
], McpAdminResolver.prototype, "mcpServerConfig", null);
|
|
281
|
+
__decorate([
|
|
282
|
+
(0, graphql_1.Mutation)(),
|
|
283
|
+
(0, core_1.Allow)(constants_1.mcpServerPermission.Update),
|
|
284
|
+
__param(0, (0, core_1.Ctx)()),
|
|
285
|
+
__param(1, (0, graphql_1.Args)()),
|
|
286
|
+
__metadata("design:type", Function),
|
|
287
|
+
__metadata("design:paramtypes", [core_1.RequestContext, Object]),
|
|
288
|
+
__metadata("design:returntype", Promise)
|
|
289
|
+
], McpAdminResolver.prototype, "setMcpToolEnabled", null);
|
|
290
|
+
__decorate([
|
|
291
|
+
(0, graphql_1.Mutation)(),
|
|
292
|
+
(0, core_1.Allow)(constants_1.mcpServerPermission.Update),
|
|
293
|
+
__param(0, (0, core_1.Ctx)()),
|
|
294
|
+
__param(1, (0, graphql_1.Args)()),
|
|
295
|
+
__metadata("design:type", Function),
|
|
296
|
+
__metadata("design:paramtypes", [core_1.RequestContext, Object]),
|
|
297
|
+
__metadata("design:returntype", Promise)
|
|
298
|
+
], McpAdminResolver.prototype, "revokeMcpOauthGrant", null);
|
|
299
|
+
__decorate([
|
|
300
|
+
(0, graphql_1.Mutation)(),
|
|
301
|
+
(0, core_1.Allow)(constants_1.mcpServerPermission.Update),
|
|
302
|
+
__param(0, (0, core_1.Ctx)()),
|
|
303
|
+
__metadata("design:type", Function),
|
|
304
|
+
__metadata("design:paramtypes", [core_1.RequestContext]),
|
|
305
|
+
__metadata("design:returntype", Promise)
|
|
306
|
+
], McpAdminResolver.prototype, "removeExpiredMcpToolCallLogs", null);
|
|
307
|
+
__decorate([
|
|
308
|
+
(0, graphql_1.Mutation)(),
|
|
309
|
+
(0, core_1.Allow)(core_1.Permission.Authenticated),
|
|
310
|
+
__param(0, (0, core_1.Ctx)()),
|
|
311
|
+
__param(1, (0, graphql_1.Args)()),
|
|
312
|
+
__metadata("design:type", Function),
|
|
313
|
+
__metadata("design:paramtypes", [core_1.RequestContext, Object]),
|
|
314
|
+
__metadata("design:returntype", Promise)
|
|
315
|
+
], McpAdminResolver.prototype, "authorizeMcpClient", null);
|
|
316
|
+
exports.McpAdminResolver = McpAdminResolver = __decorate([
|
|
317
|
+
(0, graphql_1.Resolver)(),
|
|
318
|
+
__param(5, (0, common_1.Inject)(constants_1.MCP_PLUGIN_OPTIONS)),
|
|
319
|
+
__metadata("design:paramtypes", [core_1.TransactionalConnection,
|
|
320
|
+
mcp_tool_registry_service_1.McpToolRegistryService,
|
|
321
|
+
oauth_service_1.McpOauthService,
|
|
322
|
+
core_1.CacheService,
|
|
323
|
+
core_1.ListQueryBuilder, Object, mcp_tool_call_log_retention_service_1.McpToolCallLogRetentionService])
|
|
324
|
+
], McpAdminResolver);
|
|
325
|
+
/** A field that holds personal data: visible only with ReadCustomer on top of the MCP read permission. */
|
|
326
|
+
function personalField(ctx, value) {
|
|
327
|
+
return ctx.userHasPermissions([core_1.Permission.ReadCustomer]) ? value : null;
|
|
328
|
+
}
|
|
329
|
+
/** True when the list options sort by the field or filter on it, including inside nested `_and` / `_or` groups. */
|
|
330
|
+
function listOptionsUseField(options, field) {
|
|
331
|
+
if ((options === null || options === void 0 ? void 0 : options.sort) && field in options.sort) {
|
|
332
|
+
return true;
|
|
333
|
+
}
|
|
334
|
+
return filterUsesField(options === null || options === void 0 ? void 0 : options.filter, field);
|
|
335
|
+
}
|
|
336
|
+
function filterUsesField(filter, field) {
|
|
337
|
+
if (!filter || typeof filter !== 'object') {
|
|
338
|
+
return false;
|
|
339
|
+
}
|
|
340
|
+
const _a = filter, { _and, _or } = _a, fields = __rest(_a, ["_and", "_or"]);
|
|
341
|
+
if (field in fields) {
|
|
342
|
+
return true;
|
|
343
|
+
}
|
|
344
|
+
return [_and, _or].some(group => Array.isArray(group) && group.some(item => filterUsesField(item, field)));
|
|
345
|
+
}
|
|
346
|
+
// Input, output and clientIp need the ReadCustomer permission on top of the MCP read permission,
|
|
347
|
+
// since they can hold personal data; without it they resolve to null rather than an error.
|
|
348
|
+
let McpToolCallLogEntityResolver = class McpToolCallLogEntityResolver {
|
|
349
|
+
constructor(actorService) {
|
|
350
|
+
this.actorService = actorService;
|
|
351
|
+
}
|
|
352
|
+
// Not `@Allow`: that would error on every row, and the log should stay readable for admins without customer access.
|
|
353
|
+
input(log, ctx) {
|
|
354
|
+
return personalField(ctx, log.input);
|
|
355
|
+
}
|
|
356
|
+
output(log, ctx) {
|
|
357
|
+
return personalField(ctx, log.output);
|
|
358
|
+
}
|
|
359
|
+
clientIp(log, ctx) {
|
|
360
|
+
return personalField(ctx, log.clientIp);
|
|
361
|
+
}
|
|
362
|
+
// Resolved per row rather than joined, since the stored id points at either a Customer or an Administrator.
|
|
363
|
+
async actorName(log, ctx) {
|
|
364
|
+
const identity = await this.actorService.resolveIdentity(ctx, log.actor, log.actorType);
|
|
365
|
+
return identity.name;
|
|
366
|
+
}
|
|
367
|
+
async customerId(log, ctx) {
|
|
368
|
+
const identity = await this.actorService.resolveIdentity(ctx, log.actor, log.actorType);
|
|
369
|
+
return identity.customerId;
|
|
370
|
+
}
|
|
371
|
+
};
|
|
372
|
+
exports.McpToolCallLogEntityResolver = McpToolCallLogEntityResolver;
|
|
373
|
+
__decorate([
|
|
374
|
+
(0, graphql_1.ResolveField)(),
|
|
375
|
+
__param(0, (0, graphql_1.Parent)()),
|
|
376
|
+
__param(1, (0, core_1.Ctx)()),
|
|
377
|
+
__metadata("design:type", Function),
|
|
378
|
+
__metadata("design:paramtypes", [entities_1.McpToolCallLog, core_1.RequestContext]),
|
|
379
|
+
__metadata("design:returntype", Object)
|
|
380
|
+
], McpToolCallLogEntityResolver.prototype, "input", null);
|
|
381
|
+
__decorate([
|
|
382
|
+
(0, graphql_1.ResolveField)(),
|
|
383
|
+
__param(0, (0, graphql_1.Parent)()),
|
|
384
|
+
__param(1, (0, core_1.Ctx)()),
|
|
385
|
+
__metadata("design:type", Function),
|
|
386
|
+
__metadata("design:paramtypes", [entities_1.McpToolCallLog, core_1.RequestContext]),
|
|
387
|
+
__metadata("design:returntype", Object)
|
|
388
|
+
], McpToolCallLogEntityResolver.prototype, "output", null);
|
|
389
|
+
__decorate([
|
|
390
|
+
(0, graphql_1.ResolveField)(),
|
|
391
|
+
__param(0, (0, graphql_1.Parent)()),
|
|
392
|
+
__param(1, (0, core_1.Ctx)()),
|
|
393
|
+
__metadata("design:type", Function),
|
|
394
|
+
__metadata("design:paramtypes", [entities_1.McpToolCallLog, core_1.RequestContext]),
|
|
395
|
+
__metadata("design:returntype", Object)
|
|
396
|
+
], McpToolCallLogEntityResolver.prototype, "clientIp", null);
|
|
397
|
+
__decorate([
|
|
398
|
+
(0, graphql_1.ResolveField)(),
|
|
399
|
+
__param(0, (0, graphql_1.Parent)()),
|
|
400
|
+
__param(1, (0, core_1.Ctx)()),
|
|
401
|
+
__metadata("design:type", Function),
|
|
402
|
+
__metadata("design:paramtypes", [entities_1.McpToolCallLog, core_1.RequestContext]),
|
|
403
|
+
__metadata("design:returntype", Promise)
|
|
404
|
+
], McpToolCallLogEntityResolver.prototype, "actorName", null);
|
|
405
|
+
__decorate([
|
|
406
|
+
(0, graphql_1.ResolveField)(),
|
|
407
|
+
__param(0, (0, graphql_1.Parent)()),
|
|
408
|
+
__param(1, (0, core_1.Ctx)()),
|
|
409
|
+
__metadata("design:type", Function),
|
|
410
|
+
__metadata("design:paramtypes", [entities_1.McpToolCallLog, core_1.RequestContext]),
|
|
411
|
+
__metadata("design:returntype", Promise)
|
|
412
|
+
], McpToolCallLogEntityResolver.prototype, "customerId", null);
|
|
413
|
+
exports.McpToolCallLogEntityResolver = McpToolCallLogEntityResolver = __decorate([
|
|
414
|
+
(0, graphql_1.Resolver)('McpToolCallLog'),
|
|
415
|
+
__metadata("design:paramtypes", [mcp_actor_service_1.McpActorService])
|
|
416
|
+
], McpToolCallLogEntityResolver);
|
|
417
|
+
let McpOauthGrantEntityResolver = class McpOauthGrantEntityResolver {
|
|
418
|
+
constructor(actorService) {
|
|
419
|
+
this.actorService = actorService;
|
|
420
|
+
}
|
|
421
|
+
// The client is loaded as a relation by the list query; the schema exposes only its name.
|
|
422
|
+
oauthClientName(grant) {
|
|
423
|
+
var _a, _b;
|
|
424
|
+
return (_b = (_a = grant.oauthClient) === null || _a === void 0 ? void 0 : _a.clientName) !== null && _b !== void 0 ? _b : null;
|
|
425
|
+
}
|
|
426
|
+
async actorName(grant, ctx) {
|
|
427
|
+
const identity = await this.actorService.resolveIdentity(ctx, grant.actorId, grant.actorType);
|
|
428
|
+
return identity.name;
|
|
429
|
+
}
|
|
430
|
+
async customerId(grant, ctx) {
|
|
431
|
+
const identity = await this.actorService.resolveIdentity(ctx, grant.actorId, grant.actorType);
|
|
432
|
+
return identity.customerId;
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
exports.McpOauthGrantEntityResolver = McpOauthGrantEntityResolver;
|
|
436
|
+
__decorate([
|
|
437
|
+
(0, graphql_1.ResolveField)(),
|
|
438
|
+
__param(0, (0, graphql_1.Parent)()),
|
|
439
|
+
__metadata("design:type", Function),
|
|
440
|
+
__metadata("design:paramtypes", [entities_1.McpOauthGrant]),
|
|
441
|
+
__metadata("design:returntype", Object)
|
|
442
|
+
], McpOauthGrantEntityResolver.prototype, "oauthClientName", null);
|
|
443
|
+
__decorate([
|
|
444
|
+
(0, graphql_1.ResolveField)(),
|
|
445
|
+
__param(0, (0, graphql_1.Parent)()),
|
|
446
|
+
__param(1, (0, core_1.Ctx)()),
|
|
447
|
+
__metadata("design:type", Function),
|
|
448
|
+
__metadata("design:paramtypes", [entities_1.McpOauthGrant, core_1.RequestContext]),
|
|
449
|
+
__metadata("design:returntype", Promise)
|
|
450
|
+
], McpOauthGrantEntityResolver.prototype, "actorName", null);
|
|
451
|
+
__decorate([
|
|
452
|
+
(0, graphql_1.ResolveField)(),
|
|
453
|
+
__param(0, (0, graphql_1.Parent)()),
|
|
454
|
+
__param(1, (0, core_1.Ctx)()),
|
|
455
|
+
__metadata("design:type", Function),
|
|
456
|
+
__metadata("design:paramtypes", [entities_1.McpOauthGrant, core_1.RequestContext]),
|
|
457
|
+
__metadata("design:returntype", Promise)
|
|
458
|
+
], McpOauthGrantEntityResolver.prototype, "customerId", null);
|
|
459
|
+
exports.McpOauthGrantEntityResolver = McpOauthGrantEntityResolver = __decorate([
|
|
460
|
+
(0, graphql_1.Resolver)('McpOauthGrant'),
|
|
461
|
+
__metadata("design:paramtypes", [mcp_actor_service_1.McpActorService])
|
|
462
|
+
], McpOauthGrantEntityResolver);
|
|
463
|
+
//# sourceMappingURL=mcp-admin.resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-admin.resolver.js","sourceRoot":"","sources":["../../src/api/mcp-admin.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,6CAAwF;AACxF,wCAeuB;AAGvB,sDAAmD;AAEnD,4CAAuE;AACvE,0CAA4D;AAE5D,wGAAgG;AAChG,0DAAyD;AACzD,qFAA+E;AAI/E,2DAAsD;AAgCtD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAiB;IACnD,CAAC,IAAI,EAAE,CAAC,CAAC;IACT,CAAC,KAAK,EAAE,EAAE,CAAC;IACX,CAAC,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;IACd,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,KAAM,CAAC;AAG3B,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IACzB,YACqB,UAAmC,EACnC,QAAgC,EAChC,YAA6B,EAC7B,YAA0B,EAC1B,gBAAkC,EACN,OAAiC,EAC7D,oBAAoD;QANpD,eAAU,GAAV,UAAU,CAAyB;QACnC,aAAQ,GAAR,QAAQ,CAAwB;QAChC,iBAAY,GAAZ,YAAY,CAAiB;QAC7B,iBAAY,GAAZ,Y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IADC,IAAA,sBAAY,GAAE;IACE,WAAA,IAAA,gBAAM,GAAE,CAAA;;qCAAQ,wBAAa;;kEAE7C;AAGK;IADL,IAAA,sBAAY,GAAE;IACE,WAAA,IAAA,gBAAM,GAAE,CAAA;IAAwB,WAAA,IAAA,UAAG,GAAE,CAAA;;qCAArB,wBAAa,EAAc,qBAAc;;4DAGzE;AAGK;IADL,IAAA,sBAAY,GAAE;IACG,WAAA,IAAA,gBAAM,GAAE,CAAA;IAAwB,WAAA,IAAA,UAAG,GAAE,CAAA;;qCAArB,wBAAa,EAAc,qBAAc;;6DAG1E;sCAnBQ,2BAA2B;IADvC,IAAA,kBAAQ,EAAC,eAAe,CAAC;qCAEqB,mCAAe;GADjD,2BAA2B,CAoBvC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ID, RequestContext } from '@vendure/core';
|
|
2
|
+
import { McpOauthService } from '../oauth/oauth.service';
|
|
3
|
+
/** One of the signed-in customer's own active MCP OAuth grants, summarised for a connected-assistants page. */
|
|
4
|
+
interface McpCustomerOauthGrantInfo {
|
|
5
|
+
id: ID;
|
|
6
|
+
createdAt: Date;
|
|
7
|
+
oauthClientName: string | null;
|
|
8
|
+
lastActivityAt: Date;
|
|
9
|
+
expiresAt: Date;
|
|
10
|
+
}
|
|
11
|
+
export declare class McpShopResolver {
|
|
12
|
+
private readonly oauthService;
|
|
13
|
+
constructor(oauthService: McpOauthService);
|
|
14
|
+
authorizeMcpClient(ctx: RequestContext, args: {
|
|
15
|
+
requestToken: string;
|
|
16
|
+
approved: boolean;
|
|
17
|
+
}): Promise<{
|
|
18
|
+
redirectUrl: string;
|
|
19
|
+
}>;
|
|
20
|
+
activeMcpClientGrants(ctx: RequestContext): Promise<McpCustomerOauthGrantInfo[]>;
|
|
21
|
+
revokeMcpClientGrant(ctx: RequestContext, args: {
|
|
22
|
+
id: ID;
|
|
23
|
+
}): Promise<boolean>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.McpShopResolver = void 0;
|
|
16
|
+
const graphql_1 = require("@nestjs/graphql");
|
|
17
|
+
const core_1 = require("@vendure/core");
|
|
18
|
+
const oauth_service_1 = require("../oauth/oauth.service");
|
|
19
|
+
let McpShopResolver = class McpShopResolver {
|
|
20
|
+
constructor(oauthService) {
|
|
21
|
+
this.oauthService = oauthService;
|
|
22
|
+
}
|
|
23
|
+
async authorizeMcpClient(ctx, args) {
|
|
24
|
+
return this.oauthService.approveCustomerRequest(ctx, args.requestToken, args.approved);
|
|
25
|
+
}
|
|
26
|
+
async activeMcpClientGrants(ctx) {
|
|
27
|
+
const grants = await this.oauthService.listCustomerGrants(ctx);
|
|
28
|
+
return grants.map(grant => {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
return ({
|
|
31
|
+
id: grant.id,
|
|
32
|
+
createdAt: grant.createdAt,
|
|
33
|
+
oauthClientName: (_b = (_a = grant.oauthClient) === null || _a === void 0 ? void 0 : _a.clientName) !== null && _b !== void 0 ? _b : null,
|
|
34
|
+
lastActivityAt: grant.lastActivityAt,
|
|
35
|
+
expiresAt: grant.expiresAt,
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async revokeMcpClientGrant(ctx, args) {
|
|
40
|
+
return this.oauthService.revokeCustomerGrant(ctx, args.id);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.McpShopResolver = McpShopResolver;
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, graphql_1.Mutation)(),
|
|
46
|
+
(0, core_1.Allow)(core_1.Permission.Public),
|
|
47
|
+
__param(0, (0, core_1.Ctx)()),
|
|
48
|
+
__param(1, (0, graphql_1.Args)()),
|
|
49
|
+
__metadata("design:type", Function),
|
|
50
|
+
__metadata("design:paramtypes", [core_1.RequestContext, Object]),
|
|
51
|
+
__metadata("design:returntype", Promise)
|
|
52
|
+
], McpShopResolver.prototype, "authorizeMcpClient", null);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, graphql_1.Query)(),
|
|
55
|
+
(0, core_1.Allow)(core_1.Permission.Owner),
|
|
56
|
+
__param(0, (0, core_1.Ctx)()),
|
|
57
|
+
__metadata("design:type", Function),
|
|
58
|
+
__metadata("design:paramtypes", [core_1.RequestContext]),
|
|
59
|
+
__metadata("design:returntype", Promise)
|
|
60
|
+
], McpShopResolver.prototype, "activeMcpClientGrants", null);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, graphql_1.Mutation)(),
|
|
63
|
+
(0, core_1.Allow)(core_1.Permission.Owner),
|
|
64
|
+
__param(0, (0, core_1.Ctx)()),
|
|
65
|
+
__param(1, (0, graphql_1.Args)()),
|
|
66
|
+
__metadata("design:type", Function),
|
|
67
|
+
__metadata("design:paramtypes", [core_1.RequestContext, Object]),
|
|
68
|
+
__metadata("design:returntype", Promise)
|
|
69
|
+
], McpShopResolver.prototype, "revokeMcpClientGrant", null);
|
|
70
|
+
exports.McpShopResolver = McpShopResolver = __decorate([
|
|
71
|
+
(0, graphql_1.Resolver)(),
|
|
72
|
+
__metadata("design:paramtypes", [oauth_service_1.McpOauthService])
|
|
73
|
+
], McpShopResolver);
|
|
74
|
+
//# sourceMappingURL=mcp-shop.resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-shop.resolver.js","sourceRoot":"","sources":["../../src/api/mcp-shop.resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAkE;AAClE,wCAA2E;AAE3E,0DAAyD;AAYlD,IAAM,eAAe,GAArB,MAAM,eAAe;IACxB,YAA6B,YAA6B;QAA7B,iBAAY,GAAZ,YAAY,CAAiB;IAAG,CAAC;IAIxD,AAAN,KAAK,CAAC,kBAAkB,CACb,GAAmB,EAClB,IAAiD;QAEzD,OAAO,IAAI,CAAC,YAAY,CAAC,sBAAsB,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3F,CAAC;IAIK,AAAN,KAAK,CAAC,qBAAqB,CAAQ,GAAmB;QAClD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC/D,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;;YAAC,OAAA,CAAC;gBACxB,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,eAAe,EAAE,MAAA,MAAA,KAAK,CAAC,WAAW,0CAAE,UAAU,mCAAI,IAAI;gBACtD,cAAc,EAAE,KAAK,CAAC,cAAc;gBACpC,SAAS,EAAE,KAAK,CAAC,SAAS;aAC7B,CAAC,CAAA;SAAA,CAAC,CAAC;IACR,CAAC;IAIK,AAAN,KAAK,CAAC,oBAAoB,CAAQ,GAAmB,EAAU,IAAgB;QAC3E,OAAO,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/D,CAAC;CACJ,CAAA;AA9BY,0CAAe;AAKlB;IAFL,IAAA,kBAAQ,GAAE;IACV,IAAA,YAAK,EAAC,iBAAU,CAAC,MAAM,CAAC;IAEpB,WAAA,IAAA,UAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAI,GAAE,CAAA;;qCADK,qBAAc;;yDAI7B;AAIK;IAFL,IAAA,eAAK,GAAE;IACP,IAAA,YAAK,EAAC,iBAAU,CAAC,KAAK,CAAC;IACK,WAAA,IAAA,UAAG,GAAE,CAAA;;qCAAM,qBAAc;;4DASrD;AAIK;IAFL,IAAA,kBAAQ,GAAE;IACV,IAAA,YAAK,EAAC,iBAAU,CAAC,KAAK,CAAC;IACI,WAAA,IAAA,UAAG,GAAE,CAAA;IAAuB,WAAA,IAAA,cAAI,GAAE,CAAA;;qCAAvB,qBAAc;;2DAEpD;0BA7BQ,eAAe;IAD3B,IAAA,kBAAQ,GAAE;qCAEoC,+BAAe;GADjD,eAAe,CA8B3B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ResolvedMcpPluginOptions } from './internal-types';
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* Checks the resolved plugin options at startup: warns about settings that only matter on a real
|
|
5
|
+
* deployment, and throws when an OAuth option is shaped in a way nothing can work with.
|
|
6
|
+
*/
|
|
7
|
+
export declare function checkMcpPluginOptions(options: ResolvedMcpPluginOptions): void;
|