@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.
Files changed (389) hide show
  1. package/lib/api/api-extensions.d.ts +2 -0
  2. package/lib/api/api-extensions.js +239 -0
  3. package/lib/api/api-extensions.js.map +1 -0
  4. package/lib/api/mcp-actor.service.d.ts +19 -0
  5. package/lib/api/mcp-actor.service.js +52 -0
  6. package/lib/api/mcp-actor.service.js.map +1 -0
  7. package/lib/api/mcp-admin.resolver.d.ts +105 -0
  8. package/lib/api/mcp-admin.resolver.js +463 -0
  9. package/lib/api/mcp-admin.resolver.js.map +1 -0
  10. package/lib/api/mcp-shop.resolver.d.ts +25 -0
  11. package/lib/api/mcp-shop.resolver.js +74 -0
  12. package/lib/api/mcp-shop.resolver.js.map +1 -0
  13. package/lib/check-options.d.ts +7 -0
  14. package/lib/check-options.js +130 -0
  15. package/lib/check-options.js.map +1 -0
  16. package/lib/constants.d.ts +48 -0
  17. package/lib/constants.js +72 -0
  18. package/lib/constants.js.map +1 -0
  19. package/lib/delete-in-batches.d.ts +5 -0
  20. package/lib/delete-in-batches.js +28 -0
  21. package/lib/delete-in-batches.js.map +1 -0
  22. package/lib/entities/index.d.ts +5 -0
  23. package/lib/entities/index.js +22 -0
  24. package/lib/entities/index.js.map +1 -0
  25. package/lib/entities/mcp-authorization-code.entity.d.ts +33 -0
  26. package/lib/entities/mcp-authorization-code.entity.js +77 -0
  27. package/lib/entities/mcp-authorization-code.entity.js.map +1 -0
  28. package/lib/entities/mcp-authorization-request.entity.d.ts +31 -0
  29. package/lib/entities/mcp-authorization-request.entity.js +73 -0
  30. package/lib/entities/mcp-authorization-request.entity.js.map +1 -0
  31. package/lib/entities/mcp-oauth-client.entity.d.ts +56 -0
  32. package/lib/entities/mcp-oauth-client.entity.js +70 -0
  33. package/lib/entities/mcp-oauth-client.entity.js.map +1 -0
  34. package/lib/entities/mcp-oauth-grant.entity.d.ts +77 -0
  35. package/lib/entities/mcp-oauth-grant.entity.js +121 -0
  36. package/lib/entities/mcp-oauth-grant.entity.js.map +1 -0
  37. package/lib/entities/mcp-tool-call-log.entity.d.ts +50 -0
  38. package/lib/entities/mcp-tool-call-log.entity.js +101 -0
  39. package/lib/entities/mcp-tool-call-log.entity.js.map +1 -0
  40. package/lib/events/mcp-tool-call.event.d.ts +17 -0
  41. package/lib/events/mcp-tool-call.event.js +23 -0
  42. package/lib/events/mcp-tool-call.event.js.map +1 -0
  43. package/lib/get-client-ip.d.ts +2 -0
  44. package/lib/get-client-ip.js +10 -0
  45. package/lib/get-client-ip.js.map +1 -0
  46. package/lib/get-language-code.d.ts +3 -0
  47. package/lib/get-language-code.js +12 -0
  48. package/lib/get-language-code.js.map +1 -0
  49. package/lib/index.d.ts +6 -0
  50. package/lib/index.js +26 -0
  51. package/lib/index.js.map +1 -0
  52. package/lib/internal-types.d.ts +27 -0
  53. package/lib/internal-types.js +3 -0
  54. package/lib/internal-types.js.map +1 -0
  55. package/lib/logging/mcp-tool-call-log-retention.service.d.ts +8 -0
  56. package/lib/logging/mcp-tool-call-log-retention.service.js +54 -0
  57. package/lib/logging/mcp-tool-call-log-retention.service.js.map +1 -0
  58. package/lib/logging/mcp-tool-call-log.service.d.ts +24 -0
  59. package/lib/logging/mcp-tool-call-log.service.js +128 -0
  60. package/lib/logging/mcp-tool-call-log.service.js.map +1 -0
  61. package/lib/oauth/cimd/cimd-client-resolver.service.d.ts +18 -0
  62. package/lib/oauth/cimd/cimd-client-resolver.service.js +109 -0
  63. package/lib/oauth/cimd/cimd-client-resolver.service.js.map +1 -0
  64. package/lib/oauth/cimd/cimd-document.d.ts +11 -0
  65. package/lib/oauth/cimd/cimd-document.js +66 -0
  66. package/lib/oauth/cimd/cimd-document.js.map +1 -0
  67. package/lib/oauth/cimd/cimd-fetch.d.ts +14 -0
  68. package/lib/oauth/cimd/cimd-fetch.js +192 -0
  69. package/lib/oauth/cimd/cimd-fetch.js.map +1 -0
  70. package/lib/oauth/cimd/cimd-url.d.ts +5 -0
  71. package/lib/oauth/cimd/cimd-url.js +94 -0
  72. package/lib/oauth/cimd/cimd-url.js.map +1 -0
  73. package/lib/oauth/grant-session.service.d.ts +19 -0
  74. package/lib/oauth/grant-session.service.js +141 -0
  75. package/lib/oauth/grant-session.service.js.map +1 -0
  76. package/lib/oauth/oauth-error.d.ts +18 -0
  77. package/lib/oauth/oauth-error.js +60 -0
  78. package/lib/oauth/oauth-error.js.map +1 -0
  79. package/lib/oauth/oauth-metadata.service.d.ts +34 -0
  80. package/lib/oauth/oauth-metadata.service.js +107 -0
  81. package/lib/oauth/oauth-metadata.service.js.map +1 -0
  82. package/lib/oauth/oauth-retention.service.d.ts +23 -0
  83. package/lib/oauth/oauth-retention.service.js +103 -0
  84. package/lib/oauth/oauth-retention.service.js.map +1 -0
  85. package/lib/oauth/oauth-types.d.ts +61 -0
  86. package/lib/oauth/oauth-types.js +32 -0
  87. package/lib/oauth/oauth-types.js.map +1 -0
  88. package/lib/oauth/oauth-utils.d.ts +20 -0
  89. package/lib/oauth/oauth-utils.js +111 -0
  90. package/lib/oauth/oauth-utils.js.map +1 -0
  91. package/lib/oauth/oauth.controller.d.ts +31 -0
  92. package/lib/oauth/oauth.controller.js +132 -0
  93. package/lib/oauth/oauth.controller.js.map +1 -0
  94. package/lib/oauth/oauth.service.d.ts +69 -0
  95. package/lib/oauth/oauth.service.js +650 -0
  96. package/lib/oauth/oauth.service.js.map +1 -0
  97. package/lib/oauth/token-hash.d.ts +6 -0
  98. package/lib/oauth/token-hash.js +21 -0
  99. package/lib/oauth/token-hash.js.map +1 -0
  100. package/lib/plugin.d.ts +54 -0
  101. package/lib/plugin.js +171 -0
  102. package/lib/plugin.js.map +1 -0
  103. package/lib/rate-limit/ip-bucket-key.d.ts +1 -0
  104. package/lib/rate-limit/ip-bucket-key.js +35 -0
  105. package/lib/rate-limit/ip-bucket-key.js.map +1 -0
  106. package/lib/rate-limit/mcp-oauth-rate-limit.guard.d.ts +20 -0
  107. package/lib/rate-limit/mcp-oauth-rate-limit.guard.js +63 -0
  108. package/lib/rate-limit/mcp-oauth-rate-limit.guard.js.map +1 -0
  109. package/lib/rate-limit/mcp-rate-limiter.service.d.ts +47 -0
  110. package/lib/rate-limit/mcp-rate-limiter.service.js +248 -0
  111. package/lib/rate-limit/mcp-rate-limiter.service.js.map +1 -0
  112. package/lib/registry/bm25.d.ts +12 -0
  113. package/lib/registry/bm25.js +60 -0
  114. package/lib/registry/bm25.js.map +1 -0
  115. package/lib/registry/mcp-tool-execution.service.d.ts +45 -0
  116. package/lib/registry/mcp-tool-execution.service.js +72 -0
  117. package/lib/registry/mcp-tool-execution.service.js.map +1 -0
  118. package/lib/registry/mcp-tool-registry.service.d.ts +89 -0
  119. package/lib/registry/mcp-tool-registry.service.js +668 -0
  120. package/lib/registry/mcp-tool-registry.service.js.map +1 -0
  121. package/lib/registry/mcp-tool-schema.service.d.ts +42 -0
  122. package/lib/registry/mcp-tool-schema.service.js +229 -0
  123. package/lib/registry/mcp-tool-schema.service.js.map +1 -0
  124. package/lib/registry/registry-types.d.ts +32 -0
  125. package/lib/registry/registry-types.js +3 -0
  126. package/lib/registry/registry-types.js.map +1 -0
  127. package/lib/resolve-options.d.ts +7 -0
  128. package/lib/resolve-options.js +85 -0
  129. package/lib/resolve-options.js.map +1 -0
  130. package/lib/shared/endpoint-paths.d.ts +8 -0
  131. package/lib/shared/endpoint-paths.js +12 -0
  132. package/lib/shared/endpoint-paths.js.map +1 -0
  133. package/lib/shared/loopback.d.ts +2 -0
  134. package/lib/shared/loopback.js +9 -0
  135. package/lib/shared/loopback.js.map +1 -0
  136. package/lib/shop-session/mcp-shop-session.service.d.ts +47 -0
  137. package/lib/shop-session/mcp-shop-session.service.js +132 -0
  138. package/lib/shop-session/mcp-shop-session.service.js.map +1 -0
  139. package/lib/tasks/mcp-oauth-retention.task.d.ts +9 -0
  140. package/lib/tasks/mcp-oauth-retention.task.js +21 -0
  141. package/lib/tasks/mcp-oauth-retention.task.js.map +1 -0
  142. package/lib/tasks/mcp-tool-call-log-retention.task.d.ts +7 -0
  143. package/lib/tasks/mcp-tool-call-log-retention.task.js +22 -0
  144. package/lib/tasks/mcp-tool-call-log-retention.task.js.map +1 -0
  145. package/lib/tools/built-in/active-order.service.d.ts +26 -0
  146. package/lib/tools/built-in/active-order.service.js +125 -0
  147. package/lib/tools/built-in/active-order.service.js.map +1 -0
  148. package/lib/tools/built-in/admin/add-customer-to-group.tool.d.ts +23 -0
  149. package/lib/tools/built-in/admin/add-customer-to-group.tool.js +68 -0
  150. package/lib/tools/built-in/admin/add-customer-to-group.tool.js.map +1 -0
  151. package/lib/tools/built-in/admin/add-note-to-order.tool.d.ts +104 -0
  152. package/lib/tools/built-in/admin/add-note-to-order.tool.js +66 -0
  153. package/lib/tools/built-in/admin/add-note-to-order.tool.js.map +1 -0
  154. package/lib/tools/built-in/admin/adjust-stock.tool.d.ts +26 -0
  155. package/lib/tools/built-in/admin/adjust-stock.tool.js +88 -0
  156. package/lib/tools/built-in/admin/adjust-stock.tool.js.map +1 -0
  157. package/lib/tools/built-in/admin/cancel-order.tool.d.ts +17 -0
  158. package/lib/tools/built-in/admin/cancel-order.tool.js +60 -0
  159. package/lib/tools/built-in/admin/cancel-order.tool.js.map +1 -0
  160. package/lib/tools/built-in/admin/channel-access.d.ts +2 -0
  161. package/lib/tools/built-in/admin/channel-access.js +9 -0
  162. package/lib/tools/built-in/admin/channel-access.js.map +1 -0
  163. package/lib/tools/built-in/admin/create-customer.tool.d.ts +41 -0
  164. package/lib/tools/built-in/admin/create-customer.tool.js +57 -0
  165. package/lib/tools/built-in/admin/create-customer.tool.js.map +1 -0
  166. package/lib/tools/built-in/admin/create-fulfillment.tool.d.ts +118 -0
  167. package/lib/tools/built-in/admin/create-fulfillment.tool.js +156 -0
  168. package/lib/tools/built-in/admin/create-fulfillment.tool.js.map +1 -0
  169. package/lib/tools/built-in/admin/create-product.tool.d.ts +52 -0
  170. package/lib/tools/built-in/admin/create-product.tool.js +61 -0
  171. package/lib/tools/built-in/admin/create-product.tool.js.map +1 -0
  172. package/lib/tools/built-in/admin/create-variant.tool.d.ts +48 -0
  173. package/lib/tools/built-in/admin/create-variant.tool.js +79 -0
  174. package/lib/tools/built-in/admin/create-variant.tool.js.map +1 -0
  175. package/lib/tools/built-in/admin/entity-field-schemas.d.ts +36 -0
  176. package/lib/tools/built-in/admin/entity-field-schemas.js +63 -0
  177. package/lib/tools/built-in/admin/entity-field-schemas.js.map +1 -0
  178. package/lib/tools/built-in/admin/get-customer.tool.d.ts +28 -0
  179. package/lib/tools/built-in/admin/get-customer.tool.js +55 -0
  180. package/lib/tools/built-in/admin/get-customer.tool.js.map +1 -0
  181. package/lib/tools/built-in/admin/get-order.tool.d.ts +100 -0
  182. package/lib/tools/built-in/admin/get-order.tool.js +68 -0
  183. package/lib/tools/built-in/admin/get-order.tool.js.map +1 -0
  184. package/lib/tools/built-in/admin/get-product.tool.d.ts +69 -0
  185. package/lib/tools/built-in/admin/get-product.tool.js +77 -0
  186. package/lib/tools/built-in/admin/get-product.tool.js.map +1 -0
  187. package/lib/tools/built-in/admin/get-stock-levels.tool.d.ts +23 -0
  188. package/lib/tools/built-in/admin/get-stock-levels.tool.js +61 -0
  189. package/lib/tools/built-in/admin/get-stock-levels.tool.js.map +1 -0
  190. package/lib/tools/built-in/admin/index.d.ts +25 -0
  191. package/lib/tools/built-in/admin/index.js +54 -0
  192. package/lib/tools/built-in/admin/index.js.map +1 -0
  193. package/lib/tools/built-in/admin/list-channels.tool.d.ts +24 -0
  194. package/lib/tools/built-in/admin/list-channels.tool.js +56 -0
  195. package/lib/tools/built-in/admin/list-channels.tool.js.map +1 -0
  196. package/lib/tools/built-in/admin/list-customer-groups.tool.d.ts +23 -0
  197. package/lib/tools/built-in/admin/list-customer-groups.tool.js +52 -0
  198. package/lib/tools/built-in/admin/list-customer-groups.tool.js.map +1 -0
  199. package/lib/tools/built-in/admin/list-customers.tool.d.ts +62 -0
  200. package/lib/tools/built-in/admin/list-customers.tool.js +66 -0
  201. package/lib/tools/built-in/admin/list-customers.tool.js.map +1 -0
  202. package/lib/tools/built-in/admin/list-orders.tool.d.ts +142 -0
  203. package/lib/tools/built-in/admin/list-orders.tool.js +87 -0
  204. package/lib/tools/built-in/admin/list-orders.tool.js.map +1 -0
  205. package/lib/tools/built-in/admin/list-products.tool.d.ts +63 -0
  206. package/lib/tools/built-in/admin/list-products.tool.js +71 -0
  207. package/lib/tools/built-in/admin/list-products.tool.js.map +1 -0
  208. package/lib/tools/built-in/admin/refund-order.tool.d.ts +38 -0
  209. package/lib/tools/built-in/admin/refund-order.tool.js +115 -0
  210. package/lib/tools/built-in/admin/refund-order.tool.js.map +1 -0
  211. package/lib/tools/built-in/admin/set-active-channel.tool.d.ts +22 -0
  212. package/lib/tools/built-in/admin/set-active-channel.tool.js +84 -0
  213. package/lib/tools/built-in/admin/set-active-channel.tool.js.map +1 -0
  214. package/lib/tools/built-in/admin/translation-schemas.d.ts +12 -0
  215. package/lib/tools/built-in/admin/translation-schemas.js +17 -0
  216. package/lib/tools/built-in/admin/translation-schemas.js.map +1 -0
  217. package/lib/tools/built-in/admin/update-customer.tool.d.ts +42 -0
  218. package/lib/tools/built-in/admin/update-customer.tool.js +59 -0
  219. package/lib/tools/built-in/admin/update-customer.tool.js.map +1 -0
  220. package/lib/tools/built-in/admin/update-order-state.tool.d.ts +16 -0
  221. package/lib/tools/built-in/admin/update-order-state.tool.js +58 -0
  222. package/lib/tools/built-in/admin/update-order-state.tool.js.map +1 -0
  223. package/lib/tools/built-in/admin/update-product.tool.d.ts +53 -0
  224. package/lib/tools/built-in/admin/update-product.tool.js +68 -0
  225. package/lib/tools/built-in/admin/update-product.tool.js.map +1 -0
  226. package/lib/tools/built-in/admin/update-variant.tool.d.ts +46 -0
  227. package/lib/tools/built-in/admin/update-variant.tool.js +77 -0
  228. package/lib/tools/built-in/admin/update-variant.tool.js.map +1 -0
  229. package/lib/tools/built-in/admin/upload-asset.tool.d.ts +32 -0
  230. package/lib/tools/built-in/admin/upload-asset.tool.js +56 -0
  231. package/lib/tools/built-in/admin/upload-asset.tool.js.map +1 -0
  232. package/lib/tools/built-in/catalog-query.service.d.ts +21 -0
  233. package/lib/tools/built-in/catalog-query.service.js +128 -0
  234. package/lib/tools/built-in/catalog-query.service.js.map +1 -0
  235. package/lib/tools/built-in/custom-field-input.service.d.ts +10 -0
  236. package/lib/tools/built-in/custom-field-input.service.js +64 -0
  237. package/lib/tools/built-in/custom-field-input.service.js.map +1 -0
  238. package/lib/tools/built-in/email-schema.d.ts +2 -0
  239. package/lib/tools/built-in/email-schema.js +12 -0
  240. package/lib/tools/built-in/email-schema.js.map +1 -0
  241. package/lib/tools/built-in/id-schema.d.ts +3 -0
  242. package/lib/tools/built-in/id-schema.js +11 -0
  243. package/lib/tools/built-in/id-schema.js.map +1 -0
  244. package/lib/tools/built-in/int32-schema.d.ts +4 -0
  245. package/lib/tools/built-in/int32-schema.js +8 -0
  246. package/lib/tools/built-in/int32-schema.js.map +1 -0
  247. package/lib/tools/built-in/list-helpers.d.ts +48 -0
  248. package/lib/tools/built-in/list-helpers.js +76 -0
  249. package/lib/tools/built-in/list-helpers.js.map +1 -0
  250. package/lib/tools/built-in/order-list-helpers.d.ts +20 -0
  251. package/lib/tools/built-in/order-list-helpers.js +48 -0
  252. package/lib/tools/built-in/order-list-helpers.js.map +1 -0
  253. package/lib/tools/built-in/providers.d.ts +2 -0
  254. package/lib/tools/built-in/providers.js +7 -0
  255. package/lib/tools/built-in/providers.js.map +1 -0
  256. package/lib/tools/built-in/remote-asset.d.ts +4 -0
  257. package/lib/tools/built-in/remote-asset.js +54 -0
  258. package/lib/tools/built-in/remote-asset.js.map +1 -0
  259. package/lib/tools/built-in/serializer.service.d.ts +327 -0
  260. package/lib/tools/built-in/serializer.service.js +413 -0
  261. package/lib/tools/built-in/serializer.service.js.map +1 -0
  262. package/lib/tools/built-in/shop/add-to-cart.tool.d.ts +21 -0
  263. package/lib/tools/built-in/shop/add-to-cart.tool.js +100 -0
  264. package/lib/tools/built-in/shop/add-to-cart.tool.js.map +1 -0
  265. package/lib/tools/built-in/shop/address-schema.d.ts +15 -0
  266. package/lib/tools/built-in/shop/address-schema.js +20 -0
  267. package/lib/tools/built-in/shop/address-schema.js.map +1 -0
  268. package/lib/tools/built-in/shop/apply-coupon-code.tool.d.ts +17 -0
  269. package/lib/tools/built-in/shop/apply-coupon-code.tool.js +62 -0
  270. package/lib/tools/built-in/shop/apply-coupon-code.tool.js.map +1 -0
  271. package/lib/tools/built-in/shop/collection-lookup.d.ts +15 -0
  272. package/lib/tools/built-in/shop/collection-lookup.js +35 -0
  273. package/lib/tools/built-in/shop/collection-lookup.js.map +1 -0
  274. package/lib/tools/built-in/shop/get-cart.tool.d.ts +94 -0
  275. package/lib/tools/built-in/shop/get-cart.tool.js +55 -0
  276. package/lib/tools/built-in/shop/get-cart.tool.js.map +1 -0
  277. package/lib/tools/built-in/shop/get-collection.tool.d.ts +42 -0
  278. package/lib/tools/built-in/shop/get-collection.tool.js +64 -0
  279. package/lib/tools/built-in/shop/get-collection.tool.js.map +1 -0
  280. package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.d.ts +26 -0
  281. package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.js +58 -0
  282. package/lib/tools/built-in/shop/get-eligible-payment-methods.tool.js.map +1 -0
  283. package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.d.ts +30 -0
  284. package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.js +59 -0
  285. package/lib/tools/built-in/shop/get-eligible-shipping-methods.tool.js.map +1 -0
  286. package/lib/tools/built-in/shop/get-my-account.tool.d.ts +22 -0
  287. package/lib/tools/built-in/shop/get-my-account.tool.js +57 -0
  288. package/lib/tools/built-in/shop/get-my-account.tool.js.map +1 -0
  289. package/lib/tools/built-in/shop/get-order.tool.d.ts +100 -0
  290. package/lib/tools/built-in/shop/get-order.tool.js +67 -0
  291. package/lib/tools/built-in/shop/get-order.tool.js.map +1 -0
  292. package/lib/tools/built-in/shop/get-product.tool.d.ts +57 -0
  293. package/lib/tools/built-in/shop/get-product.tool.js +81 -0
  294. package/lib/tools/built-in/shop/get-product.tool.js.map +1 -0
  295. package/lib/tools/built-in/shop/index.d.ts +19 -0
  296. package/lib/tools/built-in/shop/index.js +42 -0
  297. package/lib/tools/built-in/shop/index.js.map +1 -0
  298. package/lib/tools/built-in/shop/list-collections.tool.d.ts +42 -0
  299. package/lib/tools/built-in/shop/list-collections.tool.js +75 -0
  300. package/lib/tools/built-in/shop/list-collections.tool.js.map +1 -0
  301. package/lib/tools/built-in/shop/list-my-orders.tool.d.ts +100 -0
  302. package/lib/tools/built-in/shop/list-my-orders.tool.js +63 -0
  303. package/lib/tools/built-in/shop/list-my-orders.tool.js.map +1 -0
  304. package/lib/tools/built-in/shop/place-order.tool.d.ts +188 -0
  305. package/lib/tools/built-in/shop/place-order.tool.js +152 -0
  306. package/lib/tools/built-in/shop/place-order.tool.js.map +1 -0
  307. package/lib/tools/built-in/shop/product-search-query.d.ts +4 -0
  308. package/lib/tools/built-in/shop/product-search-query.js +34 -0
  309. package/lib/tools/built-in/shop/product-search-query.js.map +1 -0
  310. package/lib/tools/built-in/shop/remove-coupon-code.tool.d.ts +17 -0
  311. package/lib/tools/built-in/shop/remove-coupon-code.tool.js +63 -0
  312. package/lib/tools/built-in/shop/remove-coupon-code.tool.js.map +1 -0
  313. package/lib/tools/built-in/shop/remove-from-cart.tool.d.ts +17 -0
  314. package/lib/tools/built-in/shop/remove-from-cart.tool.js +58 -0
  315. package/lib/tools/built-in/shop/remove-from-cart.tool.js.map +1 -0
  316. package/lib/tools/built-in/shop/search-products.tool.d.ts +48 -0
  317. package/lib/tools/built-in/shop/search-products.tool.js +95 -0
  318. package/lib/tools/built-in/shop/search-products.tool.js.map +1 -0
  319. package/lib/tools/built-in/shop/set-checkout-details.tool.d.ts +56 -0
  320. package/lib/tools/built-in/shop/set-checkout-details.tool.js +187 -0
  321. package/lib/tools/built-in/shop/set-checkout-details.tool.js.map +1 -0
  322. package/lib/tools/built-in/shop/set-shipping-method.tool.d.ts +17 -0
  323. package/lib/tools/built-in/shop/set-shipping-method.tool.js +58 -0
  324. package/lib/tools/built-in/shop/set-shipping-method.tool.js.map +1 -0
  325. package/lib/tools/built-in/shop/update-cart-line.tool.d.ts +18 -0
  326. package/lib/tools/built-in/shop/update-cart-line.tool.js +60 -0
  327. package/lib/tools/built-in/shop/update-cart-line.tool.js.map +1 -0
  328. package/lib/tools/built-in/string-schemas.d.ts +4 -0
  329. package/lib/tools/built-in/string-schemas.js +13 -0
  330. package/lib/tools/built-in/string-schemas.js.map +1 -0
  331. package/lib/transport/mcp-server.factory.d.ts +13 -0
  332. package/lib/transport/mcp-server.factory.js +32 -0
  333. package/lib/transport/mcp-server.factory.js.map +1 -0
  334. package/lib/transport/mcp-transport.controller.d.ts +77 -0
  335. package/lib/transport/mcp-transport.controller.js +442 -0
  336. package/lib/transport/mcp-transport.controller.js.map +1 -0
  337. package/lib/types.d.ts +432 -0
  338. package/lib/types.js +3 -0
  339. package/lib/types.js.map +1 -0
  340. package/package.json +42 -0
  341. package/src/dashboard/components/activity-block.tsx +72 -0
  342. package/src/dashboard/components/actor-cell.tsx +31 -0
  343. package/src/dashboard/components/connection-dialog.tsx +106 -0
  344. package/src/dashboard/components/empty-cell.tsx +7 -0
  345. package/src/dashboard/components/grants-block.tsx +218 -0
  346. package/src/dashboard/components/stats-block.tsx +275 -0
  347. package/src/dashboard/components/tools-block.tsx +274 -0
  348. package/src/dashboard/components/tooltip-button.tsx +28 -0
  349. package/src/dashboard/components/use-mcp-table-state.ts +47 -0
  350. package/src/dashboard/i18n/ar.po +311 -0
  351. package/src/dashboard/i18n/bg.po +311 -0
  352. package/src/dashboard/i18n/cs.po +311 -0
  353. package/src/dashboard/i18n/de.po +311 -0
  354. package/src/dashboard/i18n/en.po +311 -0
  355. package/src/dashboard/i18n/es.po +311 -0
  356. package/src/dashboard/i18n/fa.po +311 -0
  357. package/src/dashboard/i18n/fr.po +311 -0
  358. package/src/dashboard/i18n/he.po +311 -0
  359. package/src/dashboard/i18n/hr.po +311 -0
  360. package/src/dashboard/i18n/hu.po +311 -0
  361. package/src/dashboard/i18n/it.po +311 -0
  362. package/src/dashboard/i18n/ja.po +311 -0
  363. package/src/dashboard/i18n/ko.po +311 -0
  364. package/src/dashboard/i18n/nb.po +311 -0
  365. package/src/dashboard/i18n/ne.po +311 -0
  366. package/src/dashboard/i18n/nl.po +311 -0
  367. package/src/dashboard/i18n/pl.po +311 -0
  368. package/src/dashboard/i18n/pt_BR.po +311 -0
  369. package/src/dashboard/i18n/pt_PT.po +311 -0
  370. package/src/dashboard/i18n/ro.po +311 -0
  371. package/src/dashboard/i18n/ru.po +311 -0
  372. package/src/dashboard/i18n/sv.po +311 -0
  373. package/src/dashboard/i18n/tr.po +311 -0
  374. package/src/dashboard/i18n/uk.po +311 -0
  375. package/src/dashboard/i18n/uz.po +311 -0
  376. package/src/dashboard/i18n/zh_Hans.po +311 -0
  377. package/src/dashboard/i18n/zh_Hant.po +311 -0
  378. package/src/dashboard/index.tsx +30 -0
  379. package/src/dashboard/mcp-activity-route.tsx +38 -0
  380. package/src/dashboard/mcp-authorize-route.tsx +369 -0
  381. package/src/dashboard/mcp-grants-route.tsx +38 -0
  382. package/src/dashboard/mcp-overview-route.tsx +46 -0
  383. package/src/dashboard/mcp-server-redirect-route.tsx +15 -0
  384. package/src/dashboard/mcp-tools-route.tsx +38 -0
  385. package/src/dashboard/mcp.graphql.ts +127 -0
  386. package/src/dashboard/published-files.spec.ts +54 -0
  387. package/src/dashboard/tsconfig.json +9 -0
  388. package/src/shared/endpoint-paths.ts +8 -0
  389. package/src/shared/loopback.ts +6 -0
@@ -0,0 +1,413 @@
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.McpToolSerializerService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const core_1 = require("@vendure/core");
15
+ /** How much of a product's description a list item keeps; `get_product` has the whole text. */
16
+ const LIST_ITEM_DESCRIPTION_LENGTH = 200;
17
+ // Every built-in tool that returns an entity goes through this service, so each entity's output
18
+ // shape has a single definition. It needs to be injectable because prices need the store's
19
+ // configured decimal places, which only ConfigService can provide.
20
+ let McpToolSerializerService = class McpToolSerializerService {
21
+ constructor(configService) {
22
+ this.configService = configService;
23
+ }
24
+ // Tool results carry the raw whole-number amount as well as this formatted string, so a
25
+ // language model can quote a price without doing the division itself.
26
+ //
27
+ // The digits are shifted as text rather than divided, because dividing by 100 can introduce
28
+ // floating-point error on real-world prices.
29
+ decimal(value) {
30
+ var _a;
31
+ const precision = (_a = this.configService.entityOptions.moneyStrategy.precision) !== null && _a !== void 0 ? _a : 2;
32
+ // Only matters if a store configures its own money strategy that can hand over a
33
+ // fractional amount; under the default one this is already a whole number.
34
+ const rounded = Math.round(value !== null && value !== void 0 ? value : 0);
35
+ const negative = rounded < 0;
36
+ const digits = String(Math.abs(rounded));
37
+ if (precision === 0) {
38
+ return `${negative ? '-' : ''}${digits}`;
39
+ }
40
+ const padded = digits.padStart(precision + 1, '0');
41
+ const whole = padded.slice(0, -precision);
42
+ const fraction = padded.slice(-precision);
43
+ return `${negative ? '-' : ''}${whole}.${fraction}`;
44
+ }
45
+ // UTC ISO strings so a language model can compare and quote dates without knowing the server's timezone.
46
+ isoDate(value) {
47
+ return value ? new Date(value).toISOString() : null;
48
+ }
49
+ variant(variant) {
50
+ if (!variant)
51
+ return null;
52
+ return {
53
+ id: variant.id,
54
+ name: variant.name,
55
+ sku: variant.sku,
56
+ enabled: variant.enabled,
57
+ price: variant.price,
58
+ priceDecimal: this.decimal(variant.price),
59
+ priceWithTax: variant.priceWithTax,
60
+ priceWithTaxDecimal: this.decimal(variant.priceWithTax),
61
+ currencyCode: variant.currencyCode,
62
+ };
63
+ }
64
+ adminVariant(variant, stockOnHand) {
65
+ return Object.assign(Object.assign({}, this.variant(variant)), { stockOnHand });
66
+ }
67
+ product(product) {
68
+ if (!product)
69
+ return null;
70
+ return {
71
+ id: product.id,
72
+ name: product.name,
73
+ slug: product.slug,
74
+ description: product.description,
75
+ enabled: product.enabled,
76
+ featuredAsset: product.featuredAsset ? this.asset(product.featuredAsset) : null,
77
+ };
78
+ }
79
+ productListItem(product, variants) {
80
+ var _a;
81
+ const description = (_a = product.description) !== null && _a !== void 0 ? _a : '';
82
+ return {
83
+ id: product.id,
84
+ name: product.name,
85
+ slug: product.slug,
86
+ description: description.length > LIST_ITEM_DESCRIPTION_LENGTH
87
+ ? `${description.slice(0, LIST_ITEM_DESCRIPTION_LENGTH)}...`
88
+ : description,
89
+ enabled: product.enabled,
90
+ featuredAsset: product.featuredAsset
91
+ ? { id: product.featuredAsset.id, preview: product.featuredAsset.preview }
92
+ : null,
93
+ priceRange: this.priceRange(variants),
94
+ };
95
+ }
96
+ priceRange(variants) {
97
+ if (variants.length === 0)
98
+ return null;
99
+ const prices = variants.map(variant => variant.priceWithTax);
100
+ const min = Math.min(...prices);
101
+ const max = Math.max(...prices);
102
+ return {
103
+ min,
104
+ minDecimal: this.decimal(min),
105
+ max,
106
+ maxDecimal: this.decimal(max),
107
+ currencyCode: variants[0].currencyCode,
108
+ };
109
+ }
110
+ // The option IDs here are what create_variant and update_variant take.
111
+ optionGroup(group) {
112
+ var _a;
113
+ return {
114
+ id: group.id,
115
+ code: group.code,
116
+ name: group.name,
117
+ options: ((_a = group.options) !== null && _a !== void 0 ? _a : []).map(option => ({
118
+ id: option.id,
119
+ code: option.code,
120
+ name: option.name,
121
+ })),
122
+ };
123
+ }
124
+ // stockLocationId is what adjust_stock needs; the name lets an agent tell locations apart.
125
+ stockLevel(level) {
126
+ var _a, _b;
127
+ return {
128
+ stockLocationId: level.stockLocationId,
129
+ stockLocationName: (_b = (_a = level.stockLocation) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : null,
130
+ stockOnHand: level.stockOnHand,
131
+ stockAllocated: level.stockAllocated,
132
+ };
133
+ }
134
+ collection(collection) {
135
+ if (!collection)
136
+ return null;
137
+ return {
138
+ id: collection.id,
139
+ name: collection.name,
140
+ slug: collection.slug,
141
+ description: collection.description,
142
+ featuredAsset: collection.featuredAsset ? this.asset(collection.featuredAsset) : null,
143
+ };
144
+ }
145
+ channel(channel) {
146
+ return {
147
+ id: channel.id,
148
+ code: channel.code,
149
+ token: channel.token,
150
+ };
151
+ }
152
+ customer(customer, addresses) {
153
+ if (!customer)
154
+ return null;
155
+ return {
156
+ id: customer.id,
157
+ firstName: customer.firstName,
158
+ lastName: customer.lastName,
159
+ emailAddress: customer.emailAddress,
160
+ phoneNumber: customer.phoneNumber,
161
+ addresses: addresses ? addresses.map(address => this.customerAddress(address)) : undefined,
162
+ };
163
+ }
164
+ customerAddress(address) {
165
+ var _a;
166
+ return Object.assign(Object.assign({ id: address.id }, this.address({
167
+ fullName: address.fullName,
168
+ company: address.company,
169
+ streetLine1: address.streetLine1,
170
+ streetLine2: address.streetLine2,
171
+ city: address.city,
172
+ province: address.province,
173
+ postalCode: address.postalCode,
174
+ // A saved address points at a Country entity, while an order stores the code directly.
175
+ countryCode: (_a = address.country) === null || _a === void 0 ? void 0 : _a.code,
176
+ phoneNumber: address.phoneNumber,
177
+ })), { defaultShippingAddress: address.defaultShippingAddress, defaultBillingAddress: address.defaultBillingAddress });
178
+ }
179
+ /** A customer group, whose ID is what `add_customer_to_group` takes. */
180
+ customerGroup(group) {
181
+ return { id: group.id, name: group.name };
182
+ }
183
+ // Errors are returned directly so the registry can report them as failed tool calls.
184
+ customerOrError(result) {
185
+ if (!(0, core_1.isGraphQlErrorResult)(result)) {
186
+ return { customer: this.customer(result) };
187
+ }
188
+ return Object.assign({}, result);
189
+ }
190
+ // State and amount together tell a caller whether this payment finished the checkout or left a balance.
191
+ payment(payment) {
192
+ var _a, _b, _c;
193
+ return {
194
+ id: payment.id,
195
+ method: payment.method,
196
+ amount: payment.amount,
197
+ amountDecimal: this.decimal(payment.amount),
198
+ state: payment.state,
199
+ transactionId: payment.transactionId,
200
+ errorMessage: payment.errorMessage,
201
+ publicMetadata: (_b = (_a = payment.metadata) === null || _a === void 0 ? void 0 : _a.public) !== null && _b !== void 0 ? _b : null,
202
+ refunds: (_c = payment.refunds) === null || _c === void 0 ? void 0 : _c.map(refund => {
203
+ var _a;
204
+ return ({
205
+ id: refund.id,
206
+ state: refund.state,
207
+ total: refund.total,
208
+ totalDecimal: this.decimal(refund.total),
209
+ reason: (_a = refund.reason) !== null && _a !== void 0 ? _a : null,
210
+ });
211
+ }),
212
+ };
213
+ }
214
+ fulfillment(fulfillment, lines) {
215
+ return {
216
+ id: fulfillment.id,
217
+ state: fulfillment.state,
218
+ method: fulfillment.method,
219
+ trackingCode: fulfillment.trackingCode,
220
+ lines: lines.map(line => ({ orderLineId: line.orderLineId, quantity: line.quantity })),
221
+ };
222
+ }
223
+ refund(refund, currencyCode) {
224
+ var _a;
225
+ return {
226
+ id: refund.id,
227
+ state: refund.state,
228
+ total: refund.total,
229
+ totalDecimal: this.decimal(refund.total),
230
+ currencyCode,
231
+ reason: (_a = refund.reason) !== null && _a !== void 0 ? _a : null,
232
+ paymentId: refund.paymentId,
233
+ };
234
+ }
235
+ orderAddress(address) {
236
+ if (!address || Object.keys(address).length === 0)
237
+ return null;
238
+ return this.address(address);
239
+ }
240
+ address(address) {
241
+ // Null fields are dropped rather than sent as null, to save tokens; an empty string is kept
242
+ // since that's a value someone actually typed in.
243
+ const present = {};
244
+ const fields = [
245
+ 'fullName',
246
+ 'company',
247
+ 'streetLine1',
248
+ 'streetLine2',
249
+ 'city',
250
+ 'province',
251
+ 'postalCode',
252
+ 'countryCode',
253
+ 'phoneNumber',
254
+ ];
255
+ for (const field of fields) {
256
+ const value = address[field];
257
+ if (value != null) {
258
+ present[field] = value;
259
+ }
260
+ }
261
+ return present;
262
+ }
263
+ orderNote(entry) {
264
+ return {
265
+ id: entry.id,
266
+ text: entry.data.note,
267
+ isPublic: entry.isPublic,
268
+ createdAt: this.isoDate(entry.createdAt),
269
+ };
270
+ }
271
+ order(order) {
272
+ var _a, _b;
273
+ if (!order)
274
+ return null;
275
+ return {
276
+ id: order.id,
277
+ code: order.code,
278
+ state: order.state,
279
+ active: order.active,
280
+ total: order.total,
281
+ totalDecimal: this.decimal(order.total),
282
+ totalWithTax: order.totalWithTax,
283
+ totalWithTaxDecimal: this.decimal(order.totalWithTax),
284
+ currencyCode: order.currencyCode,
285
+ totalQuantity: order.totalQuantity,
286
+ createdAt: this.isoDate(order.createdAt),
287
+ updatedAt: this.isoDate(order.updatedAt),
288
+ // Null while the order is still an open cart, set when the customer checks out.
289
+ orderPlacedAt: this.isoDate(order.orderPlacedAt),
290
+ couponCodes: order.couponCodes,
291
+ discounts: order.discounts.map(discount => ({
292
+ adjustmentSource: discount.adjustmentSource,
293
+ type: discount.type,
294
+ description: discount.description,
295
+ amount: discount.amount,
296
+ amountDecimal: this.decimal(discount.amount),
297
+ amountWithTax: discount.amountWithTax,
298
+ amountWithTaxDecimal: this.decimal(discount.amountWithTax),
299
+ })),
300
+ lines: (_b = (_a = order.lines) === null || _a === void 0 ? void 0 : _a.map(line => ({
301
+ id: line.id,
302
+ quantity: line.quantity,
303
+ linePriceWithTax: line.linePriceWithTax,
304
+ linePriceWithTaxDecimal: this.decimal(line.linePriceWithTax),
305
+ productVariant: line.productVariant
306
+ ? {
307
+ id: line.productVariant.id,
308
+ name: line.productVariant.name,
309
+ sku: line.productVariant.sku,
310
+ }
311
+ : null,
312
+ }))) !== null && _b !== void 0 ? _b : [],
313
+ payments: order.payments ? order.payments.map(payment => this.payment(payment)) : undefined,
314
+ // Left out by the cart tools, since an open cart has no shipments to report.
315
+ fulfillments: order.fulfillments
316
+ ? order.fulfillments.map(fulfillment => { var _a; return this.fulfillment(fulfillment, (_a = fulfillment.lines) !== null && _a !== void 0 ? _a : []); })
317
+ : undefined,
318
+ customer: this.orderCustomer(order.customer),
319
+ shippingAddress: this.orderAddress(order.shippingAddress),
320
+ billingAddress: this.orderAddress(order.billingAddress),
321
+ shippingWithTax: order.shippingWithTax,
322
+ shippingWithTaxDecimal: this.decimal(order.shippingWithTax),
323
+ shippingLines: order.shippingLines
324
+ ? order.shippingLines.map(line => ({
325
+ id: line.id,
326
+ shippingMethodId: line.shippingMethodId,
327
+ priceWithTax: line.priceWithTax,
328
+ priceWithTaxDecimal: this.decimal(line.priceWithTax),
329
+ }))
330
+ : undefined,
331
+ };
332
+ }
333
+ orderCustomer(customer) {
334
+ if (customer === undefined)
335
+ return undefined;
336
+ if (customer === null)
337
+ return null;
338
+ return {
339
+ id: customer.id,
340
+ emailAddress: customer.emailAddress,
341
+ firstName: customer.firstName,
342
+ lastName: customer.lastName,
343
+ };
344
+ }
345
+ // Errors are returned directly so the registry can report them as failed tool calls.
346
+ orderOrError(result) {
347
+ if (!(0, core_1.isGraphQlErrorResult)(result)) {
348
+ return { order: this.order(result) };
349
+ }
350
+ const errorResult = Object.assign({}, result);
351
+ if (errorResult.order instanceof core_1.Order) {
352
+ errorResult.order = this.order(errorResult.order);
353
+ }
354
+ if (errorResult.errorCode === 'COUPON_REMOVED_DURING_CHECKOUT_ERROR' &&
355
+ typeof errorResult.newTotalWithTax === 'number' &&
356
+ typeof errorResult.previousTotalWithTax === 'number') {
357
+ errorResult.newTotalWithTaxDecimal = this.decimal(errorResult.newTotalWithTax);
358
+ errorResult.previousTotalWithTaxDecimal = this.decimal(errorResult.previousTotalWithTax);
359
+ }
360
+ return errorResult;
361
+ }
362
+ // The currency belongs to the order, not the quote, so the caller passes it in.
363
+ shippingQuote(quote, currencyCode) {
364
+ return Object.assign(Object.assign({}, quote), { customFields: this.shopVisibleCustomFields('ShippingMethod', quote.customFields), priceDecimal: this.decimal(quote.price), priceWithTaxDecimal: this.decimal(quote.priceWithTax), currencyCode });
365
+ }
366
+ /** Same as `shippingQuote`: copies the quote and cuts `customFields` to what the Shop API shows. */
367
+ paymentQuote(quote) {
368
+ return Object.assign(Object.assign({}, quote), { customFields: this.shopVisibleCustomFields('PaymentMethod', quote.customFields) });
369
+ }
370
+ // A shop caller never holds admin permissions, so anything permission-gated is hidden too.
371
+ shopVisibleCustomFields(entityName, customFields) {
372
+ var _a;
373
+ if (customFields == null) {
374
+ return customFields;
375
+ }
376
+ const configs = (_a = this.configService.customFields[entityName]) !== null && _a !== void 0 ? _a : [];
377
+ const visible = {};
378
+ for (const [key, value] of Object.entries(customFields)) {
379
+ const config = configs.find(candidate => candidate.name === key);
380
+ if (config &&
381
+ config.internal !== true &&
382
+ config.public !== false &&
383
+ config.requiresPermission == null) {
384
+ visible[key] = value;
385
+ }
386
+ }
387
+ return visible;
388
+ }
389
+ /**
390
+ * Called directly by `upload_asset`, and from `product()` and `collection()` for the asset
391
+ * fields they carry.
392
+ */
393
+ asset(asset) {
394
+ return {
395
+ id: asset.id,
396
+ name: asset.name,
397
+ type: asset.type,
398
+ mimeType: asset.mimeType,
399
+ width: asset.width,
400
+ height: asset.height,
401
+ fileSize: asset.fileSize,
402
+ source: asset.source,
403
+ preview: asset.preview,
404
+ focalPoint: asset.focalPoint,
405
+ };
406
+ }
407
+ };
408
+ exports.McpToolSerializerService = McpToolSerializerService;
409
+ exports.McpToolSerializerService = McpToolSerializerService = __decorate([
410
+ (0, common_1.Injectable)(),
411
+ __metadata("design:paramtypes", [core_1.ConfigService])
412
+ ], McpToolSerializerService);
413
+ //# sourceMappingURL=serializer.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serializer.service.js","sourceRoot":"","sources":["../../../src/tools/built-in/serializer.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,wCAsBuB;AAEvB,+FAA+F;AAC/F,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEzC,gGAAgG;AAChG,2FAA2F;AAC3F,mEAAmE;AAE5D,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACjC,YAA6B,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAE7D,wFAAwF;IACxF,sEAAsE;IACtE,EAAE;IACF,4FAA4F;IAC5F,6CAA6C;IAC7C,OAAO,CAAC,KAAgC;;QACpC,MAAM,SAAS,GAAG,MAAA,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,CAAC,SAAS,mCAAI,CAAC,CAAC;QAChF,iFAAiF;QACjF,2EAA2E;QAC3E,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,CAAC,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,OAAO,GAAG,CAAC,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QACzC,IAAI,SAAS,KAAK,CAAC,EAAE,CAAC;YAClB,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC;QAC7C,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;QACnD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;QAC1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AM,OAAO,GAAG,MAAA,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,mCAAI,EAAE,CAAC;QAClE,MAAM,OAAO,GAA4B,EAAE,CAAC;QAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;YACtD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;YACjE,IACI,MAAM;gBACN,MAAM,CAAC,QAAQ,KAAK,IAAI;gBACxB,MAAM,CAAC,MAAM,KAAK,KAAK;gBACvB,MAAM,CAAC,kBAAkB,IAAI,IAAI,EACnC,CAAC;gBACC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACzB,CAAC;QACL,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,KAAY;QACd,OAAO;YACH,EAAE,EAAE,KAAK,CAAC,EAAE;YACZ,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,UAAU,EAAE,KAAK,CAAC,UAAU;SAC/B,CAAC;IACN,CAAC;CACJ,CAAA;AA3aY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;qCAEmC,oBAAa;GADhD,wBAAwB,CA2apC"}
@@ -0,0 +1,21 @@
1
+ import { OrderService, ProductVariantService, RequestContext } from '@vendure/core';
2
+ import { McpToolHandler } from '@vendure/mcp-sdk';
3
+ import { z } from 'zod';
4
+ import { McpActiveOrderService } from '../active-order.service';
5
+ import { McpToolSerializerService } from '../serializer.service';
6
+ declare const addToCartInput: z.ZodObject<{
7
+ variantId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
8
+ productId: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
9
+ quantity: z.ZodNumber;
10
+ }, z.core.$strict>;
11
+ type AddToCartInput = z.infer<typeof addToCartInput>;
12
+ export declare class AddToCartTool implements McpToolHandler<AddToCartInput> {
13
+ private readonly activeOrder;
14
+ private readonly orderService;
15
+ private readonly productVariantService;
16
+ private readonly serializer;
17
+ constructor(activeOrder: McpActiveOrderService, orderService: OrderService, productVariantService: ProductVariantService, serializer: McpToolSerializerService);
18
+ execute(ctx: RequestContext, input: AddToCartInput): Promise<Record<string, unknown>>;
19
+ private resolveVariantId;
20
+ }
21
+ export {};
@@ -0,0 +1,100 @@
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.AddToCartTool = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const core_1 = require("@vendure/core");
15
+ const mcp_sdk_1 = require("@vendure/mcp-sdk");
16
+ const zod_1 = require("zod");
17
+ const active_order_service_1 = require("../active-order.service");
18
+ const id_schema_1 = require("../id-schema");
19
+ const int32_schema_1 = require("../int32-schema");
20
+ const serializer_service_1 = require("../serializer.service");
21
+ const addToCartInput = zod_1.z.strictObject({
22
+ variantId: id_schema_1.idSchema
23
+ .describe('Product variant ID, taken from the variants listed by get_product. Give this or productId, not both.')
24
+ .optional(),
25
+ productId: id_schema_1.idSchema
26
+ .describe('Product ID, as returned by search_products or get_product. Never pass a variant ID here. ' +
27
+ 'Use this only when the product has a single variant; if it has several, the call is ' +
28
+ 'refused and the variants are listed so you can pass one as variantId instead.')
29
+ .optional(),
30
+ quantity: int32_schema_1.int32Schema.min(1).describe('Quantity, a whole number of at least 1.'),
31
+ });
32
+ let AddToCartTool = class AddToCartTool {
33
+ constructor(activeOrder, orderService, productVariantService, serializer) {
34
+ this.activeOrder = activeOrder;
35
+ this.orderService = orderService;
36
+ this.productVariantService = productVariantService;
37
+ this.serializer = serializer;
38
+ }
39
+ async execute(ctx, input) {
40
+ const variantId = await this.resolveVariantId(ctx, input);
41
+ const order = await this.activeOrder.findOrCreate(ctx);
42
+ return this.serializer.orderOrError(await this.orderService.addItemToOrder(order.ctx, order.id, variantId, input.quantity));
43
+ }
44
+ // Product and variant IDs can collide, so a product ID passed as a variant ID can silently
45
+ // resolve to the wrong item. Requiring the caller to say which kind of ID it holds prevents that.
46
+ async resolveVariantId(ctx, input) {
47
+ const exactlyOneIdMessage = 'Pass exactly one of variantId or productId.';
48
+ if (input.variantId != null && input.productId != null) {
49
+ throw new core_1.UserInputError(exactlyOneIdMessage);
50
+ }
51
+ if (input.variantId != null) {
52
+ return input.variantId;
53
+ }
54
+ if (input.productId == null) {
55
+ throw new core_1.UserInputError(exactlyOneIdMessage);
56
+ }
57
+ const variants = await this.productVariantService.getVariantsByProductId(ctx, input.productId, {}, []);
58
+ if (variants.items.length === 0) {
59
+ throw new core_1.UserInputError(`Product ${String(input.productId)} has no variants that can be bought.`);
60
+ }
61
+ if (variants.items.length > 1) {
62
+ throw new core_1.UserInputError(
63
+ // totalItems, not items.length, so the count is right even when there are more
64
+ // variants than the lookup's page limit.
65
+ `Product ${String(input.productId)} has ${variants.totalItems} variants. ` +
66
+ 'Nothing was added. Call add_to_cart again with one of these as variantId: ' +
67
+ variants.items
68
+ .map(variant => `${String(variant.id)} (${variant.name}, ${variant.sku})`)
69
+ .join('; '));
70
+ }
71
+ return variants.items[0].id;
72
+ }
73
+ };
74
+ exports.AddToCartTool = AddToCartTool;
75
+ exports.AddToCartTool = AddToCartTool = __decorate([
76
+ (0, mcp_sdk_1.McpTool)({
77
+ name: 'add_to_cart',
78
+ toolset: 'shop',
79
+ description: 'Add a product variant to the active cart. Pass exactly one of variantId or productId. ' +
80
+ 'Product IDs and variant IDs are different things and are not interchangeable.',
81
+ keywords: [
82
+ 'put in my basket',
83
+ 'I want to buy this',
84
+ 'add this item to my bag',
85
+ 'grab this product',
86
+ 'start an order with this',
87
+ 'put this in my shopping bag',
88
+ ],
89
+ permissions: [core_1.Permission.Public],
90
+ behavior: 'mutating',
91
+ usesActiveOrder: true,
92
+ inputSchema: addToCartInput,
93
+ }),
94
+ (0, common_1.Injectable)(),
95
+ __metadata("design:paramtypes", [active_order_service_1.McpActiveOrderService,
96
+ core_1.OrderService,
97
+ core_1.ProductVariantService,
98
+ serializer_service_1.McpToolSerializerService])
99
+ ], AddToCartTool);
100
+ //# sourceMappingURL=add-to-cart.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-to-cart.tool.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/add-to-cart.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,wCAOuB;AACvB,8CAA2D;AAC3D,6BAAwB;AAExB,kEAAgE;AAChE,4CAAwC;AACxC,kDAA8C;AAC9C,8DAAiE;AAEjE,MAAM,cAAc,GAAG,OAAC,CAAC,YAAY,CAAC;IAClC,SAAS,EAAE,oBAAQ;SACd,QAAQ,CACL,sGAAsG,CACzG;SACA,QAAQ,EAAE;IAC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6B;SAChC;QACD,WAAW,EAAE,CAAC,iBAAU,CAAC,MAAM,CAAC;QAChC,QAAQ,EAAE,UAAU;QACpB,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,cAAc;KAC9B,CAAC;IACD,IAAA,mBAAU,GAAE;qCAGyB,4CAAqB;QACpB,mBAAY;QACH,4BAAqB;QAChC,6CAAwB;GALhD,aAAa,CAsDzB"}
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ export declare const addressInputSchema: z.ZodObject<{
3
+ fullName: z.ZodOptional<z.ZodString>;
4
+ company: z.ZodOptional<z.ZodString>;
5
+ streetLine1: z.ZodString;
6
+ streetLine2: z.ZodOptional<z.ZodString>;
7
+ city: z.ZodOptional<z.ZodString>;
8
+ province: z.ZodOptional<z.ZodString>;
9
+ postalCode: z.ZodOptional<z.ZodString>;
10
+ countryCode: z.ZodString;
11
+ phoneNumber: z.ZodOptional<z.ZodString>;
12
+ defaultShippingAddress: z.ZodOptional<z.ZodBoolean>;
13
+ defaultBillingAddress: z.ZodOptional<z.ZodBoolean>;
14
+ customFields: z.ZodOptional<z.ZodObject<{}, z.core.$loose>>;
15
+ }, z.core.$strict>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addressInputSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const string_schemas_1 = require("../string-schemas");
6
+ exports.addressInputSchema = zod_1.z.strictObject({
7
+ fullName: string_schemas_1.shortText.optional(),
8
+ company: string_schemas_1.shortText.optional(),
9
+ streetLine1: string_schemas_1.shortText,
10
+ streetLine2: string_schemas_1.shortText.optional(),
11
+ city: string_schemas_1.shortText.optional(),
12
+ province: string_schemas_1.shortText.optional(),
13
+ postalCode: string_schemas_1.shortText.optional(),
14
+ countryCode: string_schemas_1.shortText,
15
+ phoneNumber: string_schemas_1.shortText.optional(),
16
+ defaultShippingAddress: zod_1.z.boolean().optional(),
17
+ defaultBillingAddress: zod_1.z.boolean().optional(),
18
+ customFields: zod_1.z.looseObject({}).describe('Address custom fields.').optional(),
19
+ });
20
+ //# sourceMappingURL=address-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-schema.js","sourceRoot":"","sources":["../../../../src/tools/built-in/shop/address-schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,sDAA8C;AAEjC,QAAA,kBAAkB,GAAG,OAAC,CAAC,YAAY,CAAC;IAC7C,QAAQ,EAAE,0BAAS,CAAC,QAAQ,EAAE;IAC9B,OAAO,EAAE,0BAAS,CAAC,QAAQ,EAAE;IAC7B,WAAW,EAAE,0BAAS;IACtB,WAAW,EAAE,0BAAS,CAAC,QAAQ,EAAE;IACjC,IAAI,EAAE,0BAAS,CAAC,QAAQ,EAAE;IAC1B,QAAQ,EAAE,0BAAS,CAAC,QAAQ,EAAE;IAC9B,UAAU,EAAE,0BAAS,CAAC,QAAQ,EAAE;IAChC,WAAW,EAAE,0BAAS;IACtB,WAAW,EAAE,0BAAS,CAAC,QAAQ,EAAE;IACjC,sBAAsB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9C,qBAAqB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC7C,YAAY,EAAE,OAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE;CAChF,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { OrderService, RequestContext } from '@vendure/core';
2
+ import { McpToolHandler } from '@vendure/mcp-sdk';
3
+ import { z } from 'zod';
4
+ import { McpActiveOrderService } from '../active-order.service';
5
+ import { McpToolSerializerService } from '../serializer.service';
6
+ declare const applyCouponCodeInput: z.ZodObject<{
7
+ code: z.ZodString;
8
+ }, z.core.$strict>;
9
+ type ApplyCouponCodeInput = z.infer<typeof applyCouponCodeInput>;
10
+ export declare class ApplyCouponCodeTool implements McpToolHandler<ApplyCouponCodeInput> {
11
+ private readonly activeOrder;
12
+ private readonly orderService;
13
+ private readonly serializer;
14
+ constructor(activeOrder: McpActiveOrderService, orderService: OrderService, serializer: McpToolSerializerService);
15
+ execute(ctx: RequestContext, input: ApplyCouponCodeInput): Promise<Record<string, unknown>>;
16
+ }
17
+ export {};