@open-wa/api 5.0.0-alpha.8 → 5.1.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 (244) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +1 -1
  3. package/dashboard-neo/dist/assets/AgentScalarDrawer.vue-Bq0juj-E.js +25 -0
  4. package/dashboard-neo/dist/assets/basic-shape-diamond.svg-Bu9cSItR.js +1 -0
  5. package/dashboard-neo/dist/assets/basic-shape-hexagon.svg-BJoiyAUL.js +1 -0
  6. package/dashboard-neo/dist/assets/basic-shape-primary-circle-ellipse-round.svg-Daoaje72.js +1 -0
  7. package/dashboard-neo/dist/assets/basic-shape-primary-square-rectangle.svg-YLGG3FKF.js +1 -0
  8. package/dashboard-neo/dist/assets/basic-shape-shield.svg-DqNRriX3.js +1 -0
  9. package/dashboard-neo/dist/assets/browser-J5x-7eFP.js +40 -0
  10. package/dashboard-neo/dist/assets/browser-plEqmk2G.js +113 -0
  11. package/dashboard-neo/dist/assets/computer-device-desktop-monitor.svg-WQ9f9Yyd.js +1 -0
  12. package/dashboard-neo/dist/assets/computer-device-desktop.svg-C1QoHpfb.js +1 -0
  13. package/dashboard-neo/dist/assets/computer-device-laptop.svg-DftDi_i4.js +1 -0
  14. package/dashboard-neo/dist/assets/computer-device-mobile-phone-android-samsung-back.svg-CKgWwk-M.js +1 -0
  15. package/dashboard-neo/dist/assets/computer-device-mobile-phone-android-samsung.svg-ZImmEqwi.js +1 -0
  16. package/dashboard-neo/dist/assets/computer-device-mobile-phone-iphone-x-back.svg-xBrw0QqX.js +1 -0
  17. package/dashboard-neo/dist/assets/computer-device-mobile-phone-iphone-x.svg-DDxQeDBi.js +1 -0
  18. package/dashboard-neo/dist/assets/computer-device-mobile-tablet-touch.svg-DYfniPU8.js +1 -0
  19. package/dashboard-neo/dist/assets/computer-device-mobile-tablet.svg-Dq0gutQK.js +1 -0
  20. package/dashboard-neo/dist/assets/computer-device-network-ethernet-cat6.svg-CwHOvloq.js +1 -0
  21. package/dashboard-neo/dist/assets/computer-device-network-lan-www.svg-C8Bh80nT.js +1 -0
  22. package/dashboard-neo/dist/assets/computer-device-network-wifi-connection.svg-5hFcG1t3.js +1 -0
  23. package/dashboard-neo/dist/assets/computer-device-network-wifi-router.svg-BgDGwjhn.js +1 -0
  24. package/dashboard-neo/dist/assets/ecology-science-erlenmeyer-flask.svg-Bu4pbH8x.js +1 -0
  25. package/dashboard-neo/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  26. package/dashboard-neo/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  27. package/dashboard-neo/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  28. package/dashboard-neo/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  29. package/dashboard-neo/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  30. package/dashboard-neo/dist/assets/image-flash-lightning.svg-D5m0nHLE.js +1 -0
  31. package/dashboard-neo/dist/assets/image-picture-flower.svg-DCs_cHUn.js +1 -0
  32. package/dashboard-neo/dist/assets/index-DM5k7cbF.css +1 -0
  33. package/dashboard-neo/dist/assets/index-DO9OELB4.js +2149 -0
  34. package/dashboard-neo/dist/assets/interface-alert-exclamation-diamond.svg-2G3xLwqx.js +1 -0
  35. package/dashboard-neo/dist/assets/interface-alert-exclamation-triangle-warning.svg-CbZWnWWp.js +1 -0
  36. package/dashboard-neo/dist/assets/interface-alert-information-circle.svg-D0Rq0ioQ.js +1 -0
  37. package/dashboard-neo/dist/assets/interface-award-crown.svg-BPfuHoAi.js +1 -0
  38. package/dashboard-neo/dist/assets/interface-bookmark-tag.svg-CUSjRJiw.js +1 -0
  39. package/dashboard-neo/dist/assets/interface-bookmark.svg-CUSjRJiw.js +1 -0
  40. package/dashboard-neo/dist/assets/interface-calendar-date-one.svg-BAvbb3-o.js +1 -0
  41. package/dashboard-neo/dist/assets/interface-content-book-open-pages.svg-DRedEoaB.js +1 -0
  42. package/dashboard-neo/dist/assets/interface-content-book-page.svg-bnWYwJAk.js +1 -0
  43. package/dashboard-neo/dist/assets/interface-content-file.svg-BqNPbXHO.js +1 -0
  44. package/dashboard-neo/dist/assets/interface-copy-clipboard.svg-Dyphh54o.js +1 -0
  45. package/dashboard-neo/dist/assets/interface-edit-attachment.svg-BuRbX7t8.js +1 -0
  46. package/dashboard-neo/dist/assets/interface-edit-binocular.svg-CYYevEGv.js +1 -0
  47. package/dashboard-neo/dist/assets/interface-edit-magic-wand.svg-DR2BzOMe.js +1 -0
  48. package/dashboard-neo/dist/assets/interface-edit-tool-paint-roller.svg-BNgZ4_-f.js +1 -0
  49. package/dashboard-neo/dist/assets/interface-edit-tool-pencil.svg-CTbomxh-.js +1 -0
  50. package/dashboard-neo/dist/assets/interface-favorite-award.svg-Bw67_iOy.js +1 -0
  51. package/dashboard-neo/dist/assets/interface-favorite-flag.svg-DaNMlOpZ.js +1 -0
  52. package/dashboard-neo/dist/assets/interface-favorite-heart.svg-r70vyk7c.js +1 -0
  53. package/dashboard-neo/dist/assets/interface-favorite-star.svg-DkU3mkcO.js +1 -0
  54. package/dashboard-neo/dist/assets/interface-favorite-stars-sparkles.svg-BxWiHdGA.js +1 -0
  55. package/dashboard-neo/dist/assets/interface-hierarchy-flowchart.svg-BPHEXJJS.js +1 -0
  56. package/dashboard-neo/dist/assets/interface-home-house.svg-B63-LGqz.js +1 -0
  57. package/dashboard-neo/dist/assets/interface-hyperlink.svg-C_lm0LzO.js +1 -0
  58. package/dashboard-neo/dist/assets/interface-lighting-brightness.svg-DmqVOdtF.js +1 -0
  59. package/dashboard-neo/dist/assets/interface-lock-closed.svg-xwC9xUEf.js +1 -0
  60. package/dashboard-neo/dist/assets/interface-lock-open-unlock.svg-0P7d1Er7.js +1 -0
  61. package/dashboard-neo/dist/assets/interface-login-key.svg-DSUnFVoR.js +1 -0
  62. package/dashboard-neo/dist/assets/interface-search.svg-Cki10DmM.js +1 -0
  63. package/dashboard-neo/dist/assets/interface-setting-cog.svg-B1g7SeN7.js +1 -0
  64. package/dashboard-neo/dist/assets/interface-share-megaphone-bullhorn.svg-Bn-98V1I.js +1 -0
  65. package/dashboard-neo/dist/assets/interface-share-rocket.svg-CxDqnOQE.js +1 -0
  66. package/dashboard-neo/dist/assets/interface-share-satellite.svg-Dr6tbP-H.js +1 -0
  67. package/dashboard-neo/dist/assets/interface-share-space-ship.svg-BcrSZOha.js +1 -0
  68. package/dashboard-neo/dist/assets/interface-share.svg-WJStd-hf.js +1 -0
  69. package/dashboard-neo/dist/assets/interface-signal-square.svg-sR1Jwdkj.js +1 -0
  70. package/dashboard-neo/dist/assets/interface-time-clock-circle.svg-CI-FR3Z0.js +1 -0
  71. package/dashboard-neo/dist/assets/interface-time-hour-glass.svg-BCH_wujz.js +1 -0
  72. package/dashboard-neo/dist/assets/interface-users-multiple.svg-7liAj7tU.js +1 -0
  73. package/dashboard-neo/dist/assets/interface-weather-moon.svg-CEEqAhxr.js +1 -0
  74. package/dashboard-neo/dist/assets/mail-chat-bubble-square.svg-DgBmT6at.js +1 -0
  75. package/dashboard-neo/dist/assets/mail-send-email-paper-airplane.svg-BtW62yNd.js +1 -0
  76. package/dashboard-neo/dist/assets/mail-send-envelope.svg-B2ofGi0G.js +1 -0
  77. package/dashboard-neo/dist/assets/markdown-BSj1FMVF.js +68 -0
  78. package/dashboard-neo/dist/assets/modal-74dUeivw.js +5 -0
  79. package/dashboard-neo/dist/assets/money-cashier-receipt.svg-oYv7RkCx.js +1 -0
  80. package/dashboard-neo/dist/assets/money-currency-dollar-pay.svg-BRFYydmz.js +1 -0
  81. package/dashboard-neo/dist/assets/money-graph-arrow-increase.svg-ChmHgfEP.js +1 -0
  82. package/dashboard-neo/dist/assets/money-graph-bar-chart-increase.svg-D6G7lFzR.js +1 -0
  83. package/dashboard-neo/dist/assets/nature-ecology-leaf.svg-C0Sj6pgM.js +1 -0
  84. package/dashboard-neo/dist/assets/parse-html-description-DHRmA6ou.js +5 -0
  85. package/dashboard-neo/dist/assets/phone-telephone.svg-2UFzF1dr.js +1 -0
  86. package/dashboard-neo/dist/assets/preload-helper-CJLUz7BA.js +16 -0
  87. package/dashboard-neo/dist/assets/programming-bug.svg-22hsMxQO.js +1 -0
  88. package/dashboard-neo/dist/assets/programming-cloud.svg-CLQxx35l.js +1 -0
  89. package/dashboard-neo/dist/assets/programming-computer-database-server.svg-DfQW4OzL.js +1 -0
  90. package/dashboard-neo/dist/assets/programming-computer-database.svg-BA4JjA4C.js +1 -0
  91. package/dashboard-neo/dist/assets/programming-module-four-layout.svg-ZqZ8jvaZ.js +1 -0
  92. package/dashboard-neo/dist/assets/programming-module-three.svg-C4IJTyw0.js +1 -0
  93. package/dashboard-neo/dist/assets/programming-module.svg-iETi-2b0.js +1 -0
  94. package/dashboard-neo/dist/assets/programming-script-code.svg-rCOsoRKw.js +1 -0
  95. package/dashboard-neo/dist/assets/reactivity.esm-bundler-BNk6Zv_g.js +1 -0
  96. package/dashboard-neo/dist/assets/runtime-core.esm-bundler-2tpRQTw-.js +18 -0
  97. package/dashboard-neo/dist/assets/shopping-cart.svg-Dc4piS12.js +1 -0
  98. package/dashboard-neo/dist/assets/shopping-gift-present.svg--51cUtCZ.js +1 -0
  99. package/dashboard-neo/dist/assets/shopping-shipping-box-parcel-package.svg-BDlugNqF.js +1 -0
  100. package/dashboard-neo/dist/assets/tag-new-circle.svg-IzWjXHZQ.js +1 -0
  101. package/dashboard-neo/dist/assets/travel-map-earth-globe.svg-BdyEHtN7.js +1 -0
  102. package/dashboard-neo/dist/assets/workspace-events-eIuzLwDq.js +100 -0
  103. package/dashboard-neo/dist/index.html +8 -2
  104. package/dist/index.cjs +43 -32
  105. package/dist/index.d.cts +11 -13
  106. package/dist/index.d.cts.map +1 -1
  107. package/package.json +15 -12
  108. package/src/auth/api-key.ts +28 -0
  109. package/src/compat/args.ts +1 -0
  110. package/src/compat/deprecation.ts +35 -0
  111. package/src/compat/session-path.ts +19 -0
  112. package/src/createApiMiddleware.ts +184 -0
  113. package/src/createApiServer.ts +466 -0
  114. package/src/dashboard/middleware.ts +94 -0
  115. package/src/docs/openapi.ts +77 -0
  116. package/src/docs/postman.ts +42 -0
  117. package/src/events/EventBridge.ts +4 -0
  118. package/src/events/EventBroadcaster.ts +126 -0
  119. package/src/execution/kernel.ts +1 -0
  120. package/src/health/HealthStore.ts +252 -0
  121. package/src/index.ts +9 -0
  122. package/src/invoke-client-method.ts +1 -0
  123. package/src/middleware/rate-limit.ts +30 -0
  124. package/src/monitoring/elastic.ts +104 -0
  125. package/src/routes/agent-discovery.ts +150 -0
  126. package/src/routes/debug.ts +99 -0
  127. package/src/routes/meta.ts +512 -0
  128. package/src/types.ts +31 -0
  129. package/dashboard-neo/dist/assets/AgentScalarChatInterface.vue-IhMa-3z5.js +0 -18
  130. package/dashboard-neo/dist/assets/Collection.vue-vsnc4RWv.js +0 -1
  131. package/dashboard-neo/dist/assets/CollectionAuthentication.vue-ZmqbpvJI.js +0 -1
  132. package/dashboard-neo/dist/assets/CollectionCookies.vue-iA2EFW6x.js +0 -1
  133. package/dashboard-neo/dist/assets/CollectionEnvironment.vue-DzSQF28B.js +0 -1
  134. package/dashboard-neo/dist/assets/CollectionOverview.vue-BMQzT6QD.js +0 -1
  135. package/dashboard-neo/dist/assets/CollectionScripts.vue-C6MHKuv8.js +0 -1
  136. package/dashboard-neo/dist/assets/CollectionServers.vue-Be6H5f7W.js +0 -1
  137. package/dashboard-neo/dist/assets/CollectionSettings.vue-9OvMj2mR.js +0 -1
  138. package/dashboard-neo/dist/assets/CollectionSync.vue-DF5GF55x.js +0 -1
  139. package/dashboard-neo/dist/assets/Cookies.vue-BjAXczeM.js +0 -1
  140. package/dashboard-neo/dist/assets/DataTableInput.vue-3lVVMj0z.js +0 -1
  141. package/dashboard-neo/dist/assets/DeleteSidebarListElement.vue-CdZK3_A9.js +0 -1
  142. package/dashboard-neo/dist/assets/EditSidebarListElement.vue-CfCtSnjA.js +0 -1
  143. package/dashboard-neo/dist/assets/EmptyState.vue-C9x87jvf.js +0 -22
  144. package/dashboard-neo/dist/assets/Environment.vue-36l5-PEA.js +0 -1
  145. package/dashboard-neo/dist/assets/EnvironmentModal.vue-CUUBVKgE.js +0 -1
  146. package/dashboard-neo/dist/assets/Form.vue-CNZe2Nab.js +0 -1
  147. package/dashboard-neo/dist/assets/IconSelector.vue-B8O9gEB6.js +0 -1
  148. package/dashboard-neo/dist/assets/Request.vue-BPyTupdg.js +0 -1
  149. package/dashboard-neo/dist/assets/RequestAuth.vue-Buirvybo.js +0 -1
  150. package/dashboard-neo/dist/assets/RequestRoot.vue-3wE_aGh5.js +0 -19
  151. package/dashboard-neo/dist/assets/Settings.vue-BHgUJt8Z.js +0 -1
  152. package/dashboard-neo/dist/assets/SidebarButton.vue-BqzqREDC.js +0 -1
  153. package/dashboard-neo/dist/assets/SidebarListElement.vue-BX9S2JrO.js +0 -1
  154. package/dashboard-neo/dist/assets/basic-shape-diamond.svg-BnAqd4Qb.js +0 -1
  155. package/dashboard-neo/dist/assets/basic-shape-hexagon.svg-N4HUwYpu.js +0 -1
  156. package/dashboard-neo/dist/assets/basic-shape-primary-circle-ellipse-round.svg-BRFLE-uL.js +0 -1
  157. package/dashboard-neo/dist/assets/basic-shape-primary-square-rectangle.svg-gaCLc8WX.js +0 -1
  158. package/dashboard-neo/dist/assets/basic-shape-shield.svg-D_MZxWhV.js +0 -1
  159. package/dashboard-neo/dist/assets/build-request-security-CDsXoaGl.js +0 -1
  160. package/dashboard-neo/dist/assets/computer-device-desktop-monitor.svg-BinQTWmG.js +0 -1
  161. package/dashboard-neo/dist/assets/computer-device-desktop.svg-C4XWLrGR.js +0 -1
  162. package/dashboard-neo/dist/assets/computer-device-laptop.svg-B-58K0VA.js +0 -1
  163. package/dashboard-neo/dist/assets/computer-device-mobile-phone-android-samsung-back.svg-wR9FrcRK.js +0 -1
  164. package/dashboard-neo/dist/assets/computer-device-mobile-phone-android-samsung.svg-CTpx3CX0.js +0 -1
  165. package/dashboard-neo/dist/assets/computer-device-mobile-phone-iphone-x-back.svg-DY-7m64q.js +0 -1
  166. package/dashboard-neo/dist/assets/computer-device-mobile-phone-iphone-x.svg-D0Ge9pbN.js +0 -1
  167. package/dashboard-neo/dist/assets/computer-device-mobile-tablet-touch.svg-dxrJ79yq.js +0 -1
  168. package/dashboard-neo/dist/assets/computer-device-mobile-tablet.svg-C-xYgooW.js +0 -1
  169. package/dashboard-neo/dist/assets/computer-device-network-ethernet-cat6.svg-Bi7ytDmN.js +0 -1
  170. package/dashboard-neo/dist/assets/computer-device-network-lan-www.svg-DIZnffSf.js +0 -1
  171. package/dashboard-neo/dist/assets/computer-device-network-wifi-connection.svg-BJdx4QtB.js +0 -1
  172. package/dashboard-neo/dist/assets/computer-device-network-wifi-router.svg-CEZuX2Uj.js +0 -1
  173. package/dashboard-neo/dist/assets/dist-BmLg9yXc.js +0 -1
  174. package/dashboard-neo/dist/assets/ecology-science-erlenmeyer-flask.svg-B22nfI21.js +0 -1
  175. package/dashboard-neo/dist/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
  176. package/dashboard-neo/dist/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
  177. package/dashboard-neo/dist/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
  178. package/dashboard-neo/dist/assets/image-flash-lightning.svg-8jwGfYvi.js +0 -1
  179. package/dashboard-neo/dist/assets/image-picture-flower.svg-DQBnIqvN.js +0 -1
  180. package/dashboard-neo/dist/assets/index-DYk4kNI6.js +0 -2355
  181. package/dashboard-neo/dist/assets/index-Oo2D96Pi.css +0 -1
  182. package/dashboard-neo/dist/assets/interface-alert-exclamation-diamond.svg-DgRtf5Rc.js +0 -1
  183. package/dashboard-neo/dist/assets/interface-alert-exclamation-triangle-warning.svg-Dyn4j9mr.js +0 -1
  184. package/dashboard-neo/dist/assets/interface-alert-information-circle.svg-C9LjBTNm.js +0 -1
  185. package/dashboard-neo/dist/assets/interface-award-crown.svg-DQeadu4b.js +0 -1
  186. package/dashboard-neo/dist/assets/interface-bookmark-tag.svg-Dw4A9QP0.js +0 -1
  187. package/dashboard-neo/dist/assets/interface-bookmark.svg-BYgwvhSS.js +0 -1
  188. package/dashboard-neo/dist/assets/interface-calendar-date-one.svg-DwmoQPdQ.js +0 -1
  189. package/dashboard-neo/dist/assets/interface-content-book-open-pages.svg-C9ob_aws.js +0 -1
  190. package/dashboard-neo/dist/assets/interface-content-book-page.svg-CjiBev76.js +0 -1
  191. package/dashboard-neo/dist/assets/interface-content-file.svg-CWFq2U8P.js +0 -1
  192. package/dashboard-neo/dist/assets/interface-content-folder.svg-Bkn67HmI.js +0 -1
  193. package/dashboard-neo/dist/assets/interface-copy-clipboard.svg-Clc6G5I7.js +0 -1
  194. package/dashboard-neo/dist/assets/interface-edit-attachment.svg-CNMMsyab.js +0 -1
  195. package/dashboard-neo/dist/assets/interface-edit-binocular.svg-TGAy1fMT.js +0 -1
  196. package/dashboard-neo/dist/assets/interface-edit-magic-wand.svg-BLav18Nm.js +0 -1
  197. package/dashboard-neo/dist/assets/interface-edit-tool-paint-roller.svg-CT8EnzBj.js +0 -1
  198. package/dashboard-neo/dist/assets/interface-edit-tool-pencil.svg-DpSBkLUs.js +0 -1
  199. package/dashboard-neo/dist/assets/interface-favorite-award.svg-DfBa9MD6.js +0 -1
  200. package/dashboard-neo/dist/assets/interface-favorite-flag.svg-C54BHnv1.js +0 -1
  201. package/dashboard-neo/dist/assets/interface-favorite-heart.svg-Bh_rbKoY.js +0 -1
  202. package/dashboard-neo/dist/assets/interface-favorite-star.svg-SCjMZVBW.js +0 -1
  203. package/dashboard-neo/dist/assets/interface-favorite-stars-sparkles.svg-DJqbuWIG.js +0 -1
  204. package/dashboard-neo/dist/assets/interface-hierarchy-flowchart.svg-Ib8RzCZm.js +0 -1
  205. package/dashboard-neo/dist/assets/interface-home-house.svg-BLUofUg_.js +0 -1
  206. package/dashboard-neo/dist/assets/interface-hyperlink.svg-D6ONBTc-.js +0 -1
  207. package/dashboard-neo/dist/assets/interface-lighting-brightness.svg-vr5Pi6NJ.js +0 -1
  208. package/dashboard-neo/dist/assets/interface-lock-closed.svg-ChWe_wVK.js +0 -1
  209. package/dashboard-neo/dist/assets/interface-lock-open-unlock.svg-C0a5Ndh0.js +0 -1
  210. package/dashboard-neo/dist/assets/interface-login-key.svg-DTV_5JRq.js +0 -1
  211. package/dashboard-neo/dist/assets/interface-search.svg-kRyqMnuK.js +0 -1
  212. package/dashboard-neo/dist/assets/interface-setting-cog.svg-CMnJqZqX.js +0 -1
  213. package/dashboard-neo/dist/assets/interface-share-megaphone-bullhorn.svg-Bu5Cw-Vm.js +0 -1
  214. package/dashboard-neo/dist/assets/interface-share-rocket.svg-CKf_bxS6.js +0 -1
  215. package/dashboard-neo/dist/assets/interface-share-satellite.svg-BlzZz1oC.js +0 -1
  216. package/dashboard-neo/dist/assets/interface-share-space-ship.svg-s8hu33mx.js +0 -1
  217. package/dashboard-neo/dist/assets/interface-share.svg-B0Ub4b2x.js +0 -1
  218. package/dashboard-neo/dist/assets/interface-signal-square.svg-5tH005TO.js +0 -1
  219. package/dashboard-neo/dist/assets/interface-time-clock-circle.svg-CofCX43H.js +0 -1
  220. package/dashboard-neo/dist/assets/interface-time-hour-glass.svg-BDK7FtcN.js +0 -1
  221. package/dashboard-neo/dist/assets/interface-users-multiple.svg-C2Ln3ld5.js +0 -1
  222. package/dashboard-neo/dist/assets/interface-weather-moon.svg-fVygBRng.js +0 -1
  223. package/dashboard-neo/dist/assets/mail-chat-bubble-square.svg-5FzWjeNp.js +0 -1
  224. package/dashboard-neo/dist/assets/mail-send-email-paper-airplane.svg-DxrjUhpJ.js +0 -1
  225. package/dashboard-neo/dist/assets/mail-send-envelope.svg-BuB28niF.js +0 -1
  226. package/dashboard-neo/dist/assets/money-cashier-receipt.svg-D_GvIulV.js +0 -1
  227. package/dashboard-neo/dist/assets/money-currency-dollar-pay.svg-lor_qHu1.js +0 -1
  228. package/dashboard-neo/dist/assets/money-graph-arrow-increase.svg-B4RYHlr3.js +0 -1
  229. package/dashboard-neo/dist/assets/money-graph-bar-chart-increase.svg-72f8xc7w.js +0 -1
  230. package/dashboard-neo/dist/assets/nature-ecology-leaf.svg-CEGVsRZv.js +0 -1
  231. package/dashboard-neo/dist/assets/phone-telephone.svg-DscYURKn.js +0 -1
  232. package/dashboard-neo/dist/assets/programming-bug.svg-4943T3tI.js +0 -1
  233. package/dashboard-neo/dist/assets/programming-cloud.svg-BV5nARkP.js +0 -1
  234. package/dashboard-neo/dist/assets/programming-computer-database-server.svg-CJ9Ij8Ik.js +0 -1
  235. package/dashboard-neo/dist/assets/programming-computer-database.svg-DzSq_dNJ.js +0 -1
  236. package/dashboard-neo/dist/assets/programming-module-four-layout.svg-9CEcYueG.js +0 -1
  237. package/dashboard-neo/dist/assets/programming-module-three.svg-CcJVLuuG.js +0 -1
  238. package/dashboard-neo/dist/assets/programming-module.svg-DPrCy6FI.js +0 -1
  239. package/dashboard-neo/dist/assets/programming-script-code.svg-m0VZs3ss.js +0 -1
  240. package/dashboard-neo/dist/assets/shopping-cart.svg-WKnlnAd8.js +0 -1
  241. package/dashboard-neo/dist/assets/shopping-gift-present.svg-Ciyb9-h6.js +0 -1
  242. package/dashboard-neo/dist/assets/shopping-shipping-box-parcel-package.svg-BnWK1YMQ.js +0 -1
  243. package/dashboard-neo/dist/assets/tag-new-circle.svg-C_SLASqF.js +0 -1
  244. package/dashboard-neo/dist/assets/travel-map-earth-globe.svg-DnQnavM3.js +0 -1
@@ -0,0 +1,126 @@
1
+ export interface SseEventEnvelope {
2
+ id: string;
3
+ event: string;
4
+ payload: unknown;
5
+ ts: number;
6
+ sessionId: string;
7
+ }
8
+
9
+ interface EventSubscriber {
10
+ topics: Set<string> | null;
11
+ push: (chunk: string) => void;
12
+ }
13
+
14
+ export interface EventStreamOptions {
15
+ keepaliveMs?: number;
16
+ signal?: AbortSignal;
17
+ topics?: string[];
18
+ }
19
+
20
+ const DEFAULT_KEEPALIVE_MS = 20_000;
21
+
22
+ function normalizeTopics(topics?: string[]): Set<string> | null {
23
+ if (!topics || topics.length === 0 || topics.includes('*')) {
24
+ return null;
25
+ }
26
+
27
+ return new Set(topics);
28
+ }
29
+
30
+ function formatEventFrame(envelope: SseEventEnvelope): string {
31
+ return `id: ${envelope.id}\nevent: ${envelope.event}\ndata: ${JSON.stringify(envelope)}\n\n`;
32
+ }
33
+
34
+ export class EventBroadcaster {
35
+ private readonly encoder = new TextEncoder();
36
+ private readonly sessionId: string;
37
+ private nextEventId = 0;
38
+ private nextSubscriberId = 0;
39
+ private subscribers = new Map<number, EventSubscriber>();
40
+
41
+ constructor(sessionId?: string) {
42
+ this.sessionId = sessionId ?? '';
43
+ }
44
+
45
+ public broadcast(event: string, payload: unknown): SseEventEnvelope {
46
+ const envelope: SseEventEnvelope = {
47
+ id: String(++this.nextEventId),
48
+ event,
49
+ payload,
50
+ ts: Date.now(),
51
+ sessionId: this.sessionId,
52
+ };
53
+
54
+ const frame = formatEventFrame(envelope);
55
+
56
+ for (const subscriber of this.subscribers.values()) {
57
+ if (subscriber.topics && !subscriber.topics.has(event)) {
58
+ continue;
59
+ }
60
+
61
+ subscriber.push(frame);
62
+ }
63
+
64
+ return envelope;
65
+ }
66
+
67
+ public createStream(options: EventStreamOptions = {}): ReadableStream<Uint8Array> {
68
+ const topics = normalizeTopics(options.topics);
69
+ const keepaliveMs = options.keepaliveMs ?? DEFAULT_KEEPALIVE_MS;
70
+ let cleanup = () => {};
71
+
72
+ return new ReadableStream<Uint8Array>({
73
+ start: (controller) => {
74
+ const subscriberId = ++this.nextSubscriberId;
75
+
76
+ let closed = false;
77
+
78
+ const keepaliveTimer: ReturnType<typeof setInterval> = setInterval(() => {
79
+ push(':keepalive\n\n');
80
+ }, keepaliveMs);
81
+
82
+ cleanup = () => {
83
+ if (closed) {
84
+ return;
85
+ }
86
+
87
+ closed = true;
88
+ this.subscribers.delete(subscriberId);
89
+ clearInterval(keepaliveTimer);
90
+ options.signal?.removeEventListener('abort', cleanup);
91
+ };
92
+
93
+ const push = (chunk: string) => {
94
+ if (closed) {
95
+ return;
96
+ }
97
+
98
+ try {
99
+ controller.enqueue(this.encoder.encode(chunk));
100
+ } catch {
101
+ cleanup();
102
+ }
103
+ };
104
+
105
+ if (typeof keepaliveTimer.unref === 'function') {
106
+ keepaliveTimer.unref();
107
+ }
108
+
109
+ this.subscribers.set(subscriberId, {
110
+ topics,
111
+ push,
112
+ });
113
+
114
+ options.signal?.addEventListener('abort', cleanup, { once: true });
115
+ push('retry: 3000\n\n');
116
+ },
117
+ cancel: () => {
118
+ cleanup();
119
+ },
120
+ });
121
+ }
122
+
123
+ public getSubscriberCount(): number {
124
+ return this.subscribers.size;
125
+ }
126
+ }
@@ -0,0 +1 @@
1
+ export { executeCapability, type ExecutionContext, type ExecutionResult } from '@open-wa/mcp';
@@ -0,0 +1,252 @@
1
+ /**
2
+ * HealthStore
3
+ *
4
+ * Lightweight in-memory accumulator for system health data.
5
+ * Captures launch timeline, patches, license info, and reconnection events
6
+ * from the core event emitter. Exposed via the `/health` REST endpoint
7
+ * so the dashboard can poll it without maintaining a persistent socket subscription.
8
+ *
9
+ * Memory-efficient: uses bounded arrays (max 100 reconnections) and
10
+ * only stores small summaries — no message payloads.
11
+ */
12
+
13
+ const MAX_RECONNECTIONS = 100;
14
+ const MAX_TIMELINE_STEPS = 50;
15
+
16
+ export interface TimelineStep {
17
+ step: string;
18
+ status: 'done' | 'failed';
19
+ durationMs: number;
20
+ details?: Record<string, unknown>;
21
+ timestamp: number;
22
+ }
23
+
24
+ export interface PatchInfo {
25
+ patchId: string;
26
+ description: string;
27
+ required: boolean;
28
+ outcome: 'applied' | 'not_applicable' | 'failed';
29
+ }
30
+
31
+ export interface LicenseInfo {
32
+ status: 'valid' | 'metadata_only' | 'missing' | 'invalid' | 'expired';
33
+ source: string;
34
+ keyType: string;
35
+ detail: string;
36
+ }
37
+
38
+ export interface ReconnectionEntry {
39
+ timestamp: number;
40
+ reason: string;
41
+ downtimeMs: number;
42
+ success: boolean;
43
+ }
44
+
45
+ export interface HealthSnapshot {
46
+ launchTimeline: TimelineStep[];
47
+ patches: PatchInfo[];
48
+ license: LicenseInfo | null;
49
+ reconnections: ReconnectionEntry[];
50
+ startedAt: number | null;
51
+ lastEventAt: number | null;
52
+ }
53
+
54
+ export class HealthStore {
55
+ private timeline: TimelineStep[] = [];
56
+ private patches: PatchInfo[] = [];
57
+ private license: LicenseInfo | null = null;
58
+ private reconnections: ReconnectionEntry[] = [];
59
+ private startedAt: number | null = null;
60
+ private lastEventAt: number | null = null;
61
+
62
+ // Step start times for computing durations
63
+ private stepStarts: Map<string, number> = new Map();
64
+
65
+ /**
66
+ * Process an event from the core emitter.
67
+ * Call this from the onAny bridge with the event name and payload.
68
+ */
69
+ processEvent(event: string, payload: unknown) {
70
+ const data = payload as Record<string, unknown> | undefined;
71
+ const ts = Date.now();
72
+ this.lastEventAt = ts;
73
+
74
+ // ── Launch timeline ──
75
+ if (event.startsWith('launch.') && event.endsWith('.before')) {
76
+ const step = event.replace('.before', '');
77
+ this.stepStarts.set(step, ts);
78
+ return;
79
+ }
80
+
81
+ if (event.startsWith('launch.') && event.endsWith('.after')) {
82
+ const step = event.replace('.after', '');
83
+ const startTime = this.stepStarts.get(step);
84
+ const durationMs = startTime ? ts - startTime : 0;
85
+ this.stepStarts.delete(step);
86
+
87
+ const details = data?.details && typeof data.details === 'object'
88
+ ? data.details as Record<string, unknown>
89
+ : data;
90
+ const hasFailed = details?.success === false || details?.blockingFailure === true;
91
+
92
+ this.addTimelineStep({
93
+ step,
94
+ status: hasFailed ? 'failed' : 'done',
95
+ durationMs: (data?.durationMs as number) ?? durationMs,
96
+ details: details ? this.sanitizeDetails(details) : undefined,
97
+ timestamp: ts,
98
+ });
99
+
100
+ // Special: capture patch info from launch.patch.init.after
101
+ if (step === 'launch.patch.init') {
102
+ this.capturePatchInfo(details);
103
+ }
104
+
105
+ // Special: capture license info from launch.license.preload.after or launch.license.check.after
106
+ if (step === 'launch.license.preload' || step === 'launch.license.check') {
107
+ this.captureLicenseInfo(details);
108
+ }
109
+ return;
110
+ }
111
+
112
+ if (event === 'license.inject.after') {
113
+ const details = data?.details;
114
+ if (details && typeof details === 'object') {
115
+ this.captureLicenseInfo(details as Record<string, unknown>);
116
+ }
117
+ return;
118
+ }
119
+
120
+ // ── Direct step events (without .before/.after pattern) ──
121
+ if (event === 'launch.create.start') {
122
+ this.startedAt = ts;
123
+ this.addTimelineStep({
124
+ step: event,
125
+ status: 'done',
126
+ durationMs: 0,
127
+ details: data ? this.sanitizeDetails(data) : undefined,
128
+ timestamp: ts,
129
+ });
130
+ return;
131
+ }
132
+
133
+ if (event === 'launch.create.ready') {
134
+ this.addTimelineStep({
135
+ step: event,
136
+ status: 'done',
137
+ durationMs: 0,
138
+ details: data ? this.sanitizeDetails(data) : undefined,
139
+ timestamp: ts,
140
+ });
141
+ return;
142
+ }
143
+
144
+ // ── Reconnection tracking ──
145
+ if (event === 'session.connection.disconnected') {
146
+ // We'll start tracking a disconnect; only add if we later get a reconnect
147
+ this.reconnections.push({
148
+ timestamp: Math.floor(ts / 1000),
149
+ reason: (data?.reason as string) || 'unknown',
150
+ downtimeMs: 0,
151
+ success: false,
152
+ });
153
+ if (this.reconnections.length > MAX_RECONNECTIONS) {
154
+ this.reconnections.shift();
155
+ }
156
+ return;
157
+ }
158
+
159
+ if (event === 'session.connection.reconnected') {
160
+ // Find the last disconnect and mark it as successful
161
+ const last = this.reconnections[this.reconnections.length - 1];
162
+ if (last && !last.success) {
163
+ last.success = true;
164
+ last.downtimeMs = (data?.downtimeMs as number) || 0;
165
+ } else {
166
+ this.reconnections.push({
167
+ timestamp: Math.floor(ts / 1000),
168
+ reason: 'reconnected',
169
+ downtimeMs: (data?.downtimeMs as number) || 0,
170
+ success: true,
171
+ });
172
+ if (this.reconnections.length > MAX_RECONNECTIONS) {
173
+ this.reconnections.shift();
174
+ }
175
+ }
176
+ return;
177
+ }
178
+
179
+ // ── Session state changes ──
180
+ if (event === 'session.state.changed') {
181
+ this.addTimelineStep({
182
+ step: event,
183
+ status: 'done',
184
+ durationMs: 0,
185
+ details: data ? this.sanitizeDetails(data) : undefined,
186
+ timestamp: ts,
187
+ });
188
+ }
189
+ }
190
+
191
+ /**
192
+ * Get a snapshot of all accumulated health data.
193
+ * This is what gets returned by the /health endpoint.
194
+ */
195
+ getSnapshot(): HealthSnapshot {
196
+ return {
197
+ launchTimeline: [...this.timeline],
198
+ patches: [...this.patches],
199
+ license: this.license ? { ...this.license } : null,
200
+ reconnections: [...this.reconnections],
201
+ startedAt: this.startedAt,
202
+ lastEventAt: this.lastEventAt,
203
+ };
204
+ }
205
+
206
+ private addTimelineStep(step: TimelineStep) {
207
+ this.timeline.push(step);
208
+ if (this.timeline.length > MAX_TIMELINE_STEPS) {
209
+ this.timeline.shift();
210
+ }
211
+ }
212
+
213
+ private capturePatchInfo(details?: Record<string, unknown>) {
214
+ if (!details) return;
215
+ const applied = (details.applied as string[]) || [];
216
+ const available = (details.available as string[]) || applied;
217
+ const outcome = details.outcome as string;
218
+
219
+ this.patches = available.map((id) => ({
220
+ patchId: id,
221
+ description: `Patch ${id}`,
222
+ required: true,
223
+ outcome: applied.includes(id) ? 'applied' as const : (outcome === 'none' ? 'not_applicable' as const : 'failed' as const),
224
+ }));
225
+ }
226
+
227
+ private captureLicenseInfo(details?: Record<string, unknown>) {
228
+ if (!details) return;
229
+ this.license = {
230
+ status: (details.status as LicenseInfo['status']) || 'missing',
231
+ source: (details.source as string) || this.license?.source || 'unknown',
232
+ keyType: (details.keyType as string) || this.license?.keyType || 'unknown',
233
+ detail: (details.detail as string) || `License ${details.status || 'check complete'}`,
234
+ };
235
+ }
236
+
237
+ /** Remove large/noisy fields from details to keep memory lean */
238
+ private sanitizeDetails(data: Record<string, unknown>): Record<string, unknown> {
239
+ const clean: Record<string, unknown> = {};
240
+ for (const [key, val] of Object.entries(data)) {
241
+ // Skip internal fields
242
+ if (key === 'correlationId' || key === 'ts' || key === 'step') continue;
243
+ // Skip large arrays/objects
244
+ if (Array.isArray(val) && val.length > 10) {
245
+ clean[key] = `[${val.length} items]`;
246
+ continue;
247
+ }
248
+ clean[key] = val;
249
+ }
250
+ return clean;
251
+ }
252
+ }
package/src/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ export { ApiServer, createApiServer } from './createApiServer';
2
+ export { createApiMiddleware } from './createApiMiddleware';
3
+ export { apiKeyMiddleware } from './auth/api-key';
4
+ export { rateLimitMiddleware } from './middleware/rate-limit';
5
+ export { type EventBridge } from './events/EventBridge';
6
+ export { EventBroadcaster, type EventStreamOptions, type SseEventEnvelope } from './events/EventBroadcaster';
7
+ export { invokeClientMethod, type ClientMethodDefinitionLike } from './invoke-client-method';
8
+ export { ElasticEmitter, type ElasticConfig, type ElasticDoc } from './monitoring/elastic';
9
+ export type { ApiMiddlewareOptions, ApiServerOptions, ClientMethodMap, ClientSource } from './types';
@@ -0,0 +1 @@
1
+ export { invokeClientMethod, type ClientMethodDefinitionLike } from '@open-wa/mcp';
@@ -0,0 +1,30 @@
1
+ import type { Context, Next } from 'hono';
2
+
3
+ const requests = new Map<string, number[]>();
4
+
5
+ function getRequestKey(c: Context): string {
6
+ const forwarded = c.req.header('x-forwarded-for');
7
+
8
+ if (forwarded) {
9
+ return forwarded.split(',')[0].trim();
10
+ }
11
+
12
+ return c.req.header('x-real-ip') || 'unknown';
13
+ }
14
+
15
+ export function rateLimitMiddleware(maxRequests = 100, windowMs = 60000) {
16
+ return async (c: Context, next: Next) => {
17
+ const requestKey = getRequestKey(c);
18
+ const now = Date.now();
19
+ const recentRequests = (requests.get(requestKey) || []).filter((time) => now - time < windowMs);
20
+
21
+ if (recentRequests.length >= maxRequests) {
22
+ return c.json({ error: 'Too Many Requests', details: 'Rate limit exceeded' }, 429);
23
+ }
24
+
25
+ recentRequests.push(now);
26
+ requests.set(requestKey, recentRequests);
27
+
28
+ return await next();
29
+ };
30
+ }
@@ -0,0 +1,104 @@
1
+ import { Client as ElasticClient } from '@elastic/elasticsearch';
2
+
3
+ export interface ElasticConfig {
4
+ url: string;
5
+ username?: string;
6
+ password?: string;
7
+ bufferSize?: number;
8
+ pipeline?: string;
9
+ indexPrefix?: string;
10
+ }
11
+
12
+ export interface ElasticDoc {
13
+ timestamp: string;
14
+ level?: 'info' | 'warn' | 'error' | 'debug';
15
+ message: string;
16
+ component?: string;
17
+ sessionId?: string;
18
+ schemaId?: string;
19
+ requestId?: string;
20
+ driver?: string;
21
+ method?: string;
22
+ event?: string;
23
+ duration?: number;
24
+ statusCode?: number;
25
+ userAgent?: string;
26
+ ip?: string;
27
+ [key: string]: any;
28
+ }
29
+
30
+ export class ElasticEmitter {
31
+ private client: ElasticClient;
32
+ private config: ElasticConfig;
33
+ private buffer: ElasticDoc[] = [];
34
+ private flushInterval?: NodeJS.Timeout;
35
+
36
+ constructor(config: ElasticConfig) {
37
+ this.config = {
38
+ bufferSize: 50,
39
+ indexPrefix: 'open-wa-',
40
+ ...config,
41
+ };
42
+
43
+ this.client = new ElasticClient({
44
+ node: this.config.url,
45
+ auth:
46
+ this.config.username && this.config.password
47
+ ? {
48
+ username: this.config.username,
49
+ password: this.config.password,
50
+ }
51
+ : undefined,
52
+ maxRetries: 3,
53
+ requestTimeout: 5000,
54
+ sniffOnStart: true,
55
+ });
56
+ }
57
+
58
+ public async start(): Promise<void> {
59
+ await this.client.ping();
60
+ this.flushInterval = setInterval(() => {
61
+ void this.flush();
62
+ }, 10000);
63
+ }
64
+
65
+ public log(logEntry: Omit<ElasticDoc, 'timestamp'>): void {
66
+ this.buffer.push({
67
+ timestamp: new Date().toISOString(),
68
+ level: logEntry.level || 'info',
69
+ ...logEntry,
70
+ });
71
+
72
+ if (this.buffer.length >= (this.config.bufferSize || 50)) {
73
+ void this.flush();
74
+ }
75
+ }
76
+
77
+ public async flush(): Promise<void> {
78
+ if (this.buffer.length === 0) {
79
+ return;
80
+ }
81
+
82
+ const docs = [...this.buffer];
83
+ this.buffer = [];
84
+ const indexName = `${this.config.indexPrefix}${new Date().toISOString().split('T')[0]}`;
85
+
86
+ try {
87
+ await this.client.bulk({
88
+ body: docs.flatMap((document) => [{ index: { _index: indexName } }, document]),
89
+ });
90
+ } catch (error) {
91
+ console.error('Failed to flush to ElasticSearch:', error);
92
+ this.buffer.unshift(...docs);
93
+ }
94
+ }
95
+
96
+ public async stop(): Promise<void> {
97
+ if (this.flushInterval) {
98
+ clearInterval(this.flushInterval);
99
+ }
100
+
101
+ await this.flush();
102
+ await this.client.close();
103
+ }
104
+ }
@@ -0,0 +1,150 @@
1
+ import type { Config, HttpMethodDefinition } from '@open-wa/schema';
2
+
3
+ function getExternalBase(c: any) {
4
+ return c.req.header('x-openwa-external-base') || '';
5
+ }
6
+
7
+ function joinPath(...parts: string[]) {
8
+ const normalized = parts
9
+ .filter(Boolean)
10
+ .map((part, index) => {
11
+ if (index === 0) {
12
+ return part.replace(/\/+$/, '');
13
+ }
14
+
15
+ return part.replace(/^\/+/, '').replace(/\/+$/, '');
16
+ })
17
+ .filter(Boolean)
18
+ .join('/');
19
+
20
+ return normalized.startsWith('/') ? normalized : `/${normalized}`;
21
+ }
22
+
23
+ export function registerAgentDiscoveryRoutes(
24
+ app: any,
25
+ options: { config: Config; methodDefinitions: HttpMethodDefinition[] }
26
+ ) {
27
+ app.get('/robots.txt', (c: any) => {
28
+ const origin = new URL(c.req.url).origin;
29
+ const sitemapUrl = joinPath(origin, 'sitemap.xml');
30
+ const content = `User-agent: GPTBot
31
+ Allow: /
32
+
33
+ User-agent: Claude-Web
34
+ Allow: /
35
+
36
+ User-agent: *
37
+ Allow: /
38
+
39
+ Sitemap: ${sitemapUrl}
40
+ `;
41
+ // Add Content-Signal header for isitagentready check
42
+ c.header('Content-Signal', 'ai-train=no, search=yes, ai-input=no');
43
+ return c.text(content);
44
+ });
45
+
46
+ app.get('/sitemap.xml', (c: any) => {
47
+ const origin = new URL(c.req.url).origin;
48
+ const now = new Date().toISOString();
49
+ const content = `<?xml version="1.0" encoding="UTF-8"?>
50
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
51
+ <url>
52
+ <loc>${origin}/</loc>
53
+ <lastmod>${now}</lastmod>
54
+ <changefreq>daily</changefreq>
55
+ <priority>1.0</priority>
56
+ </url>
57
+ <url>
58
+ <loc>${origin}/api-docs</loc>
59
+ <lastmod>${now}</lastmod>
60
+ <changefreq>weekly</changefreq>
61
+ <priority>0.8</priority>
62
+ </url>
63
+ </urlset>`;
64
+ c.header('Content-Type', 'application/xml');
65
+ return c.text(content);
66
+ });
67
+
68
+ app.get('/.well-known/http-message-signatures-directory', (c: any) => {
69
+ return c.json({ keys: [] });
70
+ });
71
+
72
+ app.get('/.well-known/api-catalog', (c: any) => {
73
+ const origin = new URL(c.req.url).origin;
74
+ c.header('Content-Type', 'application/linkset+json');
75
+ return c.json({
76
+ linkset: [
77
+ {
78
+ anchor: joinPath(origin, 'api'),
79
+ 'service-desc': [{ href: joinPath(origin, 'api-docs') }],
80
+ status: [{ href: joinPath(origin, 'health') }],
81
+ },
82
+ ],
83
+ });
84
+ });
85
+
86
+ app.get('/.well-known/oauth-authorization-server', (c: any) => {
87
+ const origin = new URL(c.req.url).origin;
88
+ return c.json({
89
+ issuer: origin,
90
+ authorization_endpoint: joinPath(origin, 'api'),
91
+ token_endpoint: joinPath(origin, 'api'),
92
+ grant_types_supported: ["client_credentials"],
93
+ note: "Easy API uses X-API-Key headers strictly for authentication."
94
+ });
95
+ });
96
+
97
+ app.get('/.well-known/openid-configuration', (c: any) => {
98
+ // Alias for OAuth Auth Server
99
+ const origin = new URL(c.req.url).origin;
100
+ return c.json({
101
+ issuer: origin,
102
+ authorization_endpoint: joinPath(origin, 'api'),
103
+ token_endpoint: joinPath(origin, 'api'),
104
+ grant_types_supported: ["client_credentials"],
105
+ note: "Easy API uses X-API-Key headers strictly for authentication."
106
+ });
107
+ });
108
+
109
+ app.get('/.well-known/oauth-protected-resource', (c: any) => {
110
+ const origin = new URL(c.req.url).origin;
111
+ return c.json({
112
+ resource: joinPath(origin, 'api'),
113
+ authorization_servers: [origin],
114
+ scopes_supported: ["all"],
115
+ });
116
+ });
117
+
118
+ app.get('/.well-known/mcp/server-card.json', (c: any) => {
119
+ const endpoint = options.config.mcp?.path || '/mcp';
120
+ return c.json({
121
+ serverInfo: { name: "open-wa", version: "5.0.0" },
122
+ transport: { type: "sse", endpoint },
123
+ capabilities: {}
124
+ });
125
+ });
126
+
127
+ app.get('/.well-known/agent-card.json', (c: any) => {
128
+ return c.json({
129
+ name: "open-wa-bot",
130
+ version: "5.0.0",
131
+ supportedInterfaces: ["mcp"]
132
+ });
133
+ });
134
+
135
+ app.get('/.well-known/agent-skills/index.json', (c: any) => {
136
+ const origin = new URL(c.req.url).origin;
137
+ return c.json({
138
+ $schema: "https://agentskills.io/schema.json",
139
+ skills: [
140
+ {
141
+ name: "check-health",
142
+ type: "rest",
143
+ description: "Check session health",
144
+ url: joinPath(origin, 'health'),
145
+ digest: "sha256-dummy",
146
+ }
147
+ ]
148
+ });
149
+ });
150
+ }