commandkit 1.0.0-dev.20250610125321 → 1.0.0-dev.20250611125312

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 (322) hide show
  1. package/dist/ActionRow-CmTHbo2t.js.map +1 -1
  2. package/dist/{ActionRow-D0wafJhZ.d.ts → ActionRow-DKnFVDME.d.ts} +6 -2
  3. package/dist/{Button-Bl5nbwTS.d.ts → Button-4ZUXdA56.d.ts} +11 -4
  4. package/dist/{ButtonKit-BSI7lCI0.d.ts → ButtonKit-C7r7RPNf.d.ts} +21 -2
  5. package/dist/{ChannelSelectMenuKit-L15A2jpT.d.ts → ChannelSelectMenuKit-BrXvBYNH.d.ts} +19 -3
  6. package/dist/{CommandKit-B-mjdP5x.d.ts → CommandKit-BkMUDbou.d.ts} +806 -9
  7. package/dist/{CommandKit-CnLBu_7m.js → CommandKit-C0W3U6jh.js} +621 -20
  8. package/dist/CommandKit-C0W3U6jh.js.map +1 -0
  9. package/dist/CommandKit.d.ts +25 -25
  10. package/dist/CommandKit.js +26 -26
  11. package/dist/CommandKitEventsChannel-BL_YN3Rm.js +87 -0
  12. package/dist/CommandKitEventsChannel-BL_YN3Rm.js.map +1 -0
  13. package/dist/CommandsRouter-CoOA7hkf.d.ts +146 -0
  14. package/dist/{CommandsRouter-BHaPno8o.js → CommandsRouter-DFRh47qD.js} +87 -1
  15. package/dist/CommandsRouter-DFRh47qD.js.map +1 -0
  16. package/dist/{CompilerPlugin-DrnhOC1c.js → CompilerPlugin-Bmy4izKz.js} +13 -2
  17. package/dist/CompilerPlugin-Bmy4izKz.js.map +1 -0
  18. package/dist/{CompilerPluginRuntime-C9wmPMQf.js → CompilerPluginRuntime-CgVU_gU0.js} +59 -1
  19. package/dist/CompilerPluginRuntime-CgVU_gU0.js.map +1 -0
  20. package/dist/DefaultLogger-pWzrSxMd.d.ts +60 -0
  21. package/dist/{EventInterceptor-Bvh05z7n.js → EventInterceptor-DWCHCGRh.js} +5 -1
  22. package/dist/EventInterceptor-DWCHCGRh.js.map +1 -0
  23. package/dist/{EventInterceptor-D_oEWSnF.d.ts → EventInterceptor-x-R2qshQ.d.ts} +8 -1
  24. package/dist/{EventWorkerContext-BYXamZ_4.d.ts → EventWorkerContext-DoFZMT8u.d.ts} +25 -2
  25. package/dist/{EventWorkerContext-BAKiTqJz.js → EventWorkerContext-DxfS_0fJ.js} +24 -1
  26. package/dist/EventWorkerContext-DxfS_0fJ.js.map +1 -0
  27. package/dist/ILogger-Cs5SFzqd.d.ts +34 -0
  28. package/dist/Logger-5ew_YS4P.d.ts +37 -0
  29. package/dist/{MentionableSelectMenuKit-BiUSKUtZ.d.ts → MentionableSelectMenuKit-CPTKqx-O.d.ts} +14 -3
  30. package/dist/{MessageCommandParser-D02-wpZN.js → MessageCommandParser-Cz-3I-wL.js} +70 -2
  31. package/dist/MessageCommandParser-Cz-3I-wL.js.map +1 -0
  32. package/dist/MessageCommandParser-ROLibZPX.d.ts +195 -0
  33. package/dist/{Modal-Cxm6cs5c.d.ts → Modal-C6UTRdYQ.d.ts} +8 -4
  34. package/dist/{ModalKit-CKtQ8eXW.d.ts → ModalKit-Btz58KYn.d.ts} +23 -2
  35. package/dist/{PluginCommon-DPqnQngK.js → PluginCommon-D_Z8Oiic.js} +23 -1
  36. package/dist/PluginCommon-D_Z8Oiic.js.map +1 -0
  37. package/dist/{RoleSelectMenuKit-BSMKkru2.d.ts → RoleSelectMenuKit-C26lU3sN.d.ts} +19 -3
  38. package/dist/{RuntimePlugin-BJoDa8ZR.js → RuntimePlugin-CehKbceZ.js} +5 -2
  39. package/dist/RuntimePlugin-CehKbceZ.js.map +1 -0
  40. package/dist/SelectMenu-Diy87_ba.d.ts +137 -0
  41. package/dist/{StringSelectMenuKit-B9FHTe48.d.ts → StringSelectMenuKit-Bhs8U6WI.d.ts} +19 -3
  42. package/dist/{UserSelectMenuKit-DiP0imyo.d.ts → UserSelectMenuKit-CfqFJdxz.d.ts} +19 -3
  43. package/dist/analytics/analytics-engine.d.ts +25 -25
  44. package/dist/analytics/analytics-engine.js +26 -26
  45. package/dist/analytics/analytics-provider.d.ts +25 -25
  46. package/dist/analytics/constants.d.ts +13 -0
  47. package/dist/analytics/constants.js +1 -1
  48. package/dist/analytics/utils.d.ts +13 -0
  49. package/dist/analytics/utils.js +26 -26
  50. package/dist/app/commands/AppCommandRunner.d.ts +25 -25
  51. package/dist/app/commands/AppCommandRunner.js +26 -26
  52. package/dist/app/commands/Context.d.ts +25 -25
  53. package/dist/app/commands/Context.js +26 -26
  54. package/dist/app/commands/MessageCommandParser.d.ts +1 -1
  55. package/dist/app/commands/MessageCommandParser.js +2 -2
  56. package/dist/app/commands/helpers.d.ts +1 -1
  57. package/dist/app/commands/helpers.js +1 -1
  58. package/dist/app/events/EventWorkerContext.d.ts +26 -26
  59. package/dist/app/events/EventWorkerContext.js +1 -1
  60. package/dist/app/handlers/AppCommandHandler.d.ts +25 -25
  61. package/dist/app/handlers/AppCommandHandler.js +26 -26
  62. package/dist/app/handlers/AppEventsHandler.d.ts +25 -25
  63. package/dist/app/handlers/AppEventsHandler.js +26 -26
  64. package/dist/app/index.d.ts +25 -25
  65. package/dist/app/index.js +27 -27
  66. package/dist/app/middleware/signals.js +2 -2
  67. package/dist/app/register/CommandRegistrar.d.ts +25 -25
  68. package/dist/app/register/CommandRegistrar.js +26 -26
  69. package/dist/app/router/CommandsRouter.d.ts +1 -1
  70. package/dist/app/router/CommandsRouter.js +1 -1
  71. package/dist/app/router/index.d.ts +1 -1
  72. package/dist/app/router/index.js +1 -1
  73. package/dist/{app-process-YbSHvqf-.js → app-process-Bo-LedP8.js} +11 -3
  74. package/dist/app-process-Bo-LedP8.js.map +1 -0
  75. package/dist/{build-BejatFZX.js → build-CWrpkal-.js} +14 -6
  76. package/dist/build-CWrpkal-.js.map +1 -0
  77. package/dist/cli/app-process.d.ts +5 -0
  78. package/dist/cli/app-process.js +5 -5
  79. package/dist/cli/build.d.ts +33 -25
  80. package/dist/cli/build.js +29 -29
  81. package/dist/cli/common.d.ts +57 -27
  82. package/dist/cli/common.js +3 -3
  83. package/dist/cli/development.d.ts +4 -0
  84. package/dist/cli/development.js +46 -30
  85. package/dist/cli/development.js.map +1 -1
  86. package/dist/cli/env.d.ts +32 -0
  87. package/dist/cli/env.js +1 -1
  88. package/dist/cli/generators.d.ts +8 -0
  89. package/dist/cli/generators.js +27 -3
  90. package/dist/cli/generators.js.map +1 -1
  91. package/dist/cli/information.d.ts +4 -0
  92. package/dist/cli/information.js +17 -1
  93. package/dist/cli/information.js.map +1 -1
  94. package/dist/cli/init.js +27 -27
  95. package/dist/cli/production.d.ts +9 -0
  96. package/dist/cli/production.js +39 -31
  97. package/dist/cli/production.js.map +1 -1
  98. package/dist/cli/type-checker.d.ts +2 -0
  99. package/dist/cli/type-checker.js +4 -4
  100. package/dist/cli/utils.d.ts +5 -0
  101. package/dist/cli/utils.js +1 -1
  102. package/dist/{common-pvPJVTfe.d.ts → common-DOCvOVC4.d.ts} +7 -2
  103. package/dist/{common-CW8v7gAn.js → common-Dasi9oKU.js} +44 -2
  104. package/dist/common-Dasi9oKU.js.map +1 -0
  105. package/dist/{common-CeO-vn8Y.js → common-vnMIelAE.js} +4 -1
  106. package/dist/common-vnMIelAE.js.map +1 -0
  107. package/dist/components/common/EventInterceptor.d.ts +1 -1
  108. package/dist/components/common/EventInterceptor.js +1 -1
  109. package/dist/components/common/element.d.ts +4 -4
  110. package/dist/components/common/element.js +2 -2
  111. package/dist/components/index.d.ts +20 -20
  112. package/dist/components/index.js +26 -26
  113. package/dist/components/v1/action-row/ActionRow.d.ts +5 -5
  114. package/dist/components/v1/button/Button.d.ts +5 -5
  115. package/dist/components/v1/button/Button.js +26 -26
  116. package/dist/components/v1/button/ButtonKit.d.ts +2 -2
  117. package/dist/components/v1/button/ButtonKit.js +26 -26
  118. package/dist/components/v1/modal/Modal.d.ts +5 -5
  119. package/dist/components/v1/modal/Modal.js +26 -26
  120. package/dist/components/v1/modal/ModalKit.d.ts +2 -2
  121. package/dist/components/v1/modal/ModalKit.js +26 -26
  122. package/dist/components/v1/select-menu/ChannelSelectMenuKit.d.ts +3 -3
  123. package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +26 -26
  124. package/dist/components/v1/select-menu/MentionableSelectMenuKit.d.ts +3 -3
  125. package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +26 -26
  126. package/dist/components/v1/select-menu/RoleSelectMenuKit.d.ts +3 -3
  127. package/dist/components/v1/select-menu/RoleSelectMenuKit.js +26 -26
  128. package/dist/components/v1/select-menu/SelectMenu.d.ts +8 -8
  129. package/dist/components/v1/select-menu/SelectMenu.js +26 -26
  130. package/dist/components/v1/select-menu/StringSelectMenuKit.d.ts +3 -3
  131. package/dist/components/v1/select-menu/StringSelectMenuKit.js +26 -26
  132. package/dist/components/v1/select-menu/UserSelectMenuKit.d.ts +3 -3
  133. package/dist/components/v1/select-menu/UserSelectMenuKit.js +26 -26
  134. package/dist/components/v1/select-menu/common.d.ts +2 -2
  135. package/dist/components/v2/common.d.ts +4 -0
  136. package/dist/components/v2/common.js +1 -1
  137. package/dist/components/v2/container.d.ts +1 -1
  138. package/dist/components/v2/container.js +2 -2
  139. package/dist/components/v2/file.d.ts +1 -1
  140. package/dist/components/v2/file.js +1 -1
  141. package/dist/components/v2/index.d.ts +6 -6
  142. package/dist/components/v2/index.js +7 -7
  143. package/dist/components/v2/media-gallery.d.ts +1 -1
  144. package/dist/components/v2/media-gallery.js +2 -2
  145. package/dist/components/v2/section.d.ts +1 -1
  146. package/dist/components/v2/section.js +2 -2
  147. package/dist/components/v2/separator.d.ts +1 -1
  148. package/dist/components/v2/separator.js +1 -1
  149. package/dist/components/v2/text-display.d.ts +1 -1
  150. package/dist/components/v2/text-display.js +1 -1
  151. package/dist/config/config.d.ts +28 -28
  152. package/dist/config/config.js +26 -26
  153. package/dist/config/default.d.ts +30 -27
  154. package/dist/config/default.js +26 -26
  155. package/dist/config/loader.d.ts +33 -27
  156. package/dist/config/loader.js +26 -26
  157. package/dist/config/types.d.ts +26 -26
  158. package/dist/config/utils.d.ts +27 -27
  159. package/dist/config/utils.js +3 -0
  160. package/dist/config/utils.js.map +1 -1
  161. package/dist/{config-BjmEZYpx.d.ts → config-aCpqqs1C.d.ts} +3 -3
  162. package/dist/constants-BTttfrm3.d.ts +42 -0
  163. package/dist/{constants-DWe181uQ.js → constants-CXwjhIYH.js} +9 -1
  164. package/dist/constants-CXwjhIYH.js.map +1 -0
  165. package/dist/{constants-CCqS_v55.js → constants-DDRctWlU.js} +14 -8
  166. package/dist/constants-DDRctWlU.js.map +1 -0
  167. package/dist/{container-CpuiLsZM.js → container-DCjIgp-B.js} +12 -2
  168. package/dist/container-DCjIgp-B.js.map +1 -0
  169. package/dist/container-DaUKKPm-.d.ts +24 -0
  170. package/dist/context/async-context.d.ts +25 -25
  171. package/dist/context/async-context.js +26 -26
  172. package/dist/context/environment.d.ts +25 -25
  173. package/dist/context/environment.js +26 -26
  174. package/dist/element-CAXu1XtK.d.ts +72 -0
  175. package/dist/{element-DcqNz1dV.js → element-Cq-LoDjk.js} +27 -2
  176. package/dist/element-Cq-LoDjk.js.map +1 -0
  177. package/dist/{env-ERkaRfQO.js → env-DemeP-uq.js} +33 -1
  178. package/dist/env-DemeP-uq.js.map +1 -0
  179. package/dist/{error-codes-C_UO39jz.js → error-codes-CxlUBdF6.js} +20 -1
  180. package/dist/error-codes-CxlUBdF6.js.map +1 -0
  181. package/dist/events/CommandKitEventsChannel.d.ts +25 -25
  182. package/dist/events/CommandKitEventsChannel.js +1 -1
  183. package/dist/{feature-flags-BFiGn38a.js → feature-flags-CLZLGnAs.js} +4 -4
  184. package/dist/feature-flags-CLZLGnAs.js.map +1 -0
  185. package/dist/file-DTrr-p09.d.ts +24 -0
  186. package/dist/{file-DE69SSOP.js → file-DVZC0QXI.js} +11 -1
  187. package/dist/file-DVZC0QXI.js.map +1 -0
  188. package/dist/flags/FlagProvider.d.ts +25 -25
  189. package/dist/flags/feature-flags.d.ts +25 -25
  190. package/dist/flags/feature-flags.js +27 -27
  191. package/dist/flags/store.d.ts +25 -25
  192. package/dist/flags/store.js +1 -1
  193. package/dist/{helpers-CswC9gKF.js → helpers-CnfXqF_k.js} +11 -1
  194. package/dist/helpers-CnfXqF_k.js.map +1 -0
  195. package/dist/helpers-Wg6P5fRQ.d.ts +23 -0
  196. package/dist/index.d.ts +34 -34
  197. package/dist/index.js +30 -31
  198. package/dist/{init-BDgyvx9E.js → init-_FwacDcI.js} +6 -6
  199. package/dist/{init-BDgyvx9E.js.map → init-_FwacDcI.js.map} +1 -1
  200. package/dist/logger/DefaultLogger.d.ts +2 -2
  201. package/dist/logger/DefaultLogger.js +26 -26
  202. package/dist/logger/ILogger.d.ts +1 -1
  203. package/dist/logger/Logger.d.ts +2 -2
  204. package/dist/logger/Logger.js +26 -26
  205. package/dist/media-gallery-BMsXSot3.d.ts +49 -0
  206. package/dist/{media-gallery-nUEHqKVF.js → media-gallery-CIKypjbJ.js} +27 -2
  207. package/dist/media-gallery-CIKypjbJ.js.map +1 -0
  208. package/dist/plugins/CompilerPlugin.d.ts +25 -25
  209. package/dist/plugins/CompilerPlugin.js +2 -2
  210. package/dist/plugins/PluginCommon.d.ts +25 -25
  211. package/dist/plugins/PluginCommon.js +1 -1
  212. package/dist/plugins/RuntimePlugin.d.ts +25 -25
  213. package/dist/plugins/RuntimePlugin.js +2 -2
  214. package/dist/plugins/index.d.ts +25 -25
  215. package/dist/plugins/index.js +26 -26
  216. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +25 -25
  217. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +26 -26
  218. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +25 -25
  219. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +1 -1
  220. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +25 -25
  221. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +26 -26
  222. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +37 -25
  223. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +26 -26
  224. package/dist/plugins/plugin-runtime/runtime.d.ts +25 -25
  225. package/dist/plugins/types.d.ts +25 -25
  226. package/dist/{section-D6t7tyEZ.js → section-CuYr0Inu.js} +22 -2
  227. package/dist/section-CuYr0Inu.js.map +1 -0
  228. package/dist/section-Dh_FhPeC.d.ts +45 -0
  229. package/dist/separator-CMf6Cyy5.d.ts +22 -0
  230. package/dist/{separator-DYAFK-Jj.js → separator-DLdWBjSN.js} +11 -1
  231. package/dist/separator-DLdWBjSN.js.map +1 -0
  232. package/dist/{signals-scJdEbly.js → signals-CSSSZAZ6.js} +2 -2
  233. package/dist/{signals-scJdEbly.js.map → signals-CSSSZAZ6.js.map} +1 -1
  234. package/dist/{store-Ci6ib2C9.js → store-x93NXUy_.js} +5 -1
  235. package/dist/store-x93NXUy_.js.map +1 -0
  236. package/dist/{text-display-Dy6JHB5X.js → text-display--p2-BoUa.js} +13 -1
  237. package/dist/text-display--p2-BoUa.js.map +1 -0
  238. package/dist/text-display-DRw3r_lK.d.ts +33 -0
  239. package/dist/{type-checker-CXVdS7qc.js → type-checker-P8oyY259.js} +6 -2
  240. package/dist/type-checker-P8oyY259.js.map +1 -0
  241. package/dist/{types-DjL43eQS.d.ts → types-DwmPE0nY.d.ts} +2 -2
  242. package/dist/{types-package-CTSNSM93.js → types-package-BpY3acyl.js} +8 -2
  243. package/dist/types-package-BpY3acyl.js.map +1 -0
  244. package/dist/types.d.ts +25 -25
  245. package/dist/{utilities-DQT4lzAB.d.ts → utilities-D_MFPmTe.d.ts} +45 -2
  246. package/dist/utils/colors.d.ts +2 -2
  247. package/dist/utils/constants.d.ts +2 -2
  248. package/dist/utils/constants.js +1 -2
  249. package/dist/utils/dev-hooks.d.ts +26 -26
  250. package/dist/utils/dev-hooks.js +26 -26
  251. package/dist/utils/error-codes.d.ts +34 -0
  252. package/dist/utils/error-codes.js +1 -1
  253. package/dist/utils/types-package.d.ts +6 -0
  254. package/dist/utils/types-package.js +2 -2
  255. package/dist/utils/utilities.d.ts +1 -1
  256. package/dist/utils/utilities.js +26 -26
  257. package/dist/utils/warn-unstable.d.ts +10 -0
  258. package/dist/utils/warn-unstable.js +1 -1
  259. package/dist/{utils-IYtoeTur.js → utils-C8a_hMvn.js} +5 -1
  260. package/dist/utils-C8a_hMvn.js.map +1 -0
  261. package/dist/{utils-VCdd7XhD.d.ts → utils-DS6OiGvg.d.ts} +12 -2
  262. package/dist/{version-BSsOib4x.js → version-IoXx-oYe.js} +5 -2
  263. package/dist/version-IoXx-oYe.js.map +1 -0
  264. package/dist/version.js +1 -1
  265. package/dist/{warn-unstable-DHLaxPC8.js → warn-unstable-CttBdmlS.js} +11 -1
  266. package/dist/warn-unstable-CttBdmlS.js.map +1 -0
  267. package/package.json +2 -2
  268. package/dist/CommandKit-CnLBu_7m.js.map +0 -1
  269. package/dist/CommandKitEventsChannel-B6LKgxmv.js +0 -44
  270. package/dist/CommandKitEventsChannel-B6LKgxmv.js.map +0 -1
  271. package/dist/CommandsRouter-BHaPno8o.js.map +0 -1
  272. package/dist/CommandsRouter-C7X-eXE2.d.ts +0 -67
  273. package/dist/CompilerPlugin-DrnhOC1c.js.map +0 -1
  274. package/dist/CompilerPluginRuntime-C9wmPMQf.js.map +0 -1
  275. package/dist/DefaultLogger-CcW-Fuq5.d.ts +0 -30
  276. package/dist/EventInterceptor-Bvh05z7n.js.map +0 -1
  277. package/dist/EventWorkerContext-BAKiTqJz.js.map +0 -1
  278. package/dist/ILogger-kqwb2kUu.d.ts +0 -11
  279. package/dist/Logger-B4B_URL-.d.ts +0 -17
  280. package/dist/MessageCommandParser-D02-wpZN.js.map +0 -1
  281. package/dist/MessageCommandParser-tzroBwij.d.ts +0 -62
  282. package/dist/PluginCommon-DPqnQngK.js.map +0 -1
  283. package/dist/RuntimePlugin-BJoDa8ZR.js.map +0 -1
  284. package/dist/SelectMenu-b7jgrkjO.d.ts +0 -36
  285. package/dist/app-process-YbSHvqf-.js.map +0 -1
  286. package/dist/build-BejatFZX.js.map +0 -1
  287. package/dist/common-CW8v7gAn.js.map +0 -1
  288. package/dist/common-CeO-vn8Y.js.map +0 -1
  289. package/dist/constants-BPWSrMkn.d.ts +0 -18
  290. package/dist/constants-CCqS_v55.js.map +0 -1
  291. package/dist/constants-DWe181uQ.js.map +0 -1
  292. package/dist/container-CpuiLsZM.js.map +0 -1
  293. package/dist/container-CwEATQy2.d.ts +0 -10
  294. package/dist/element-D_nyVwgB.d.ts +0 -30
  295. package/dist/element-DcqNz1dV.js.map +0 -1
  296. package/dist/env-ERkaRfQO.js.map +0 -1
  297. package/dist/error-codes-C_UO39jz.js.map +0 -1
  298. package/dist/feature-flags-BFiGn38a.js.map +0 -1
  299. package/dist/file-BdyYwkaI.d.ts +0 -10
  300. package/dist/file-DE69SSOP.js.map +0 -1
  301. package/dist/helpers-CswC9gKF.js.map +0 -1
  302. package/dist/helpers-DAmE106r.d.ts +0 -9
  303. package/dist/media-gallery-DCu02VXc.d.ts +0 -17
  304. package/dist/media-gallery-nUEHqKVF.js.map +0 -1
  305. package/dist/section-D6t7tyEZ.js.map +0 -1
  306. package/dist/section-fktaECHL.d.ts +0 -18
  307. package/dist/separator-CuesaLrC.d.ts +0 -8
  308. package/dist/separator-DYAFK-Jj.js.map +0 -1
  309. package/dist/store-Ci6ib2C9.js.map +0 -1
  310. package/dist/text-display-DNMwmGHJ.d.ts +0 -12
  311. package/dist/text-display-Dy6JHB5X.js.map +0 -1
  312. package/dist/type-checker-CXVdS7qc.js.map +0 -1
  313. package/dist/types-package-CTSNSM93.js.map +0 -1
  314. package/dist/utils/clone.d.ts +0 -5
  315. package/dist/utils/clone.js +0 -9
  316. package/dist/utils/clone.js.map +0 -1
  317. package/dist/utils/get-paths.d.ts +0 -6
  318. package/dist/utils/get-paths.js +0 -34
  319. package/dist/utils/get-paths.js.map +0 -1
  320. package/dist/utils-IYtoeTur.js.map +0 -1
  321. package/dist/version-BSsOib4x.js.map +0 -1
  322. package/dist/warn-unstable-DHLaxPC8.js.map +0 -1
@@ -1,23 +1,23 @@
1
1
  const require_chunk = require('./chunk-nOFOJqeH.js');
2
2
  const require_colors = require('./colors-Cd4Oz-r-.js');
3
- const require_error_codes = require('./error-codes-C_UO39jz.js');
4
- const require_warn_unstable = require('./warn-unstable-DHLaxPC8.js');
5
- const require_element = require('./element-DcqNz1dV.js');
6
- const require_EventInterceptor = require('./EventInterceptor-Bvh05z7n.js');
7
- const require_constants = require('./constants-CCqS_v55.js');
8
- const require_CompilerPlugin = require('./CompilerPlugin-DrnhOC1c.js');
9
- const require_RuntimePlugin = require('./RuntimePlugin-BJoDa8ZR.js');
10
- const require_EventWorkerContext = require('./EventWorkerContext-BAKiTqJz.js');
3
+ const require_error_codes = require('./error-codes-CxlUBdF6.js');
4
+ const require_warn_unstable = require('./warn-unstable-CttBdmlS.js');
5
+ const require_element = require('./element-Cq-LoDjk.js');
6
+ const require_EventInterceptor = require('./EventInterceptor-DWCHCGRh.js');
7
+ const require_constants = require('./constants-DDRctWlU.js');
8
+ const require_CompilerPlugin = require('./CompilerPlugin-Bmy4izKz.js');
9
+ const require_RuntimePlugin = require('./RuntimePlugin-CehKbceZ.js');
10
+ const require_EventWorkerContext = require('./EventWorkerContext-DxfS_0fJ.js');
11
11
  const require_resolve_file_url = require('./resolve-file-url-ifwdwqmq.js');
12
- const require_MessageCommandParser = require('./MessageCommandParser-D02-wpZN.js');
13
- const require_signals = require('./signals-scJdEbly.js');
14
- const require_constants$1 = require('./constants-DWe181uQ.js');
15
- const require_types_package = require('./types-package-CTSNSM93.js');
16
- const require_CommandsRouter = require('./CommandsRouter-BHaPno8o.js');
12
+ const require_MessageCommandParser = require('./MessageCommandParser-Cz-3I-wL.js');
13
+ const require_signals = require('./signals-CSSSZAZ6.js');
14
+ const require_constants$1 = require('./constants-CXwjhIYH.js');
15
+ const require_types_package = require('./types-package-BpY3acyl.js');
16
+ const require_CommandsRouter = require('./CommandsRouter-DFRh47qD.js');
17
17
  const require_EventsRouter = require('./EventsRouter-CqnrlbjN.js');
18
- const require_common = require('./common-CW8v7gAn.js');
19
- const require_CommandKitEventsChannel = require('./CommandKitEventsChannel-B6LKgxmv.js');
20
- const require_store = require('./store-Ci6ib2C9.js');
18
+ const require_common = require('./common-Dasi9oKU.js');
19
+ const require_CommandKitEventsChannel = require('./CommandKitEventsChannel-BL_YN3Rm.js');
20
+ const require_store = require('./store-x93NXUy_.js');
21
21
  const node_events = require_chunk.__toESM(require("node:events"));
22
22
  const discord_js = require_chunk.__toESM(require("discord.js"));
23
23
  const node_async_hooks = require_chunk.__toESM(require("node:async_hooks"));
@@ -29,12 +29,23 @@ const __rollup_plugin_json = require_chunk.__toESM(require("@rollup/plugin-json"
29
29
  //#region src/context/async-context.ts
30
30
  const kCommandWorker = Symbol("commandkitCommandWorker");
31
31
  const context = new node_async_hooks.AsyncLocalStorage();
32
+ /**
33
+ * Checks if the given worker is a CommandKit worker context.
34
+ * @param worker The worker to check.
35
+ * @returns True if the worker is a CommandKit worker context, false otherwise.
36
+ */
32
37
  function isCommandWorkerContext(worker) {
33
38
  return worker && Reflect.get(worker, kCommandWorker) === true;
34
39
  }
35
40
  function exitContext(fn) {
36
41
  return context.exit(fn);
37
42
  }
43
+ /**
44
+ * Executes the provided function within a CommandKit context.
45
+ * @param value The CommandKit environment to use for the context.
46
+ * @param receiver The function to execute within the context.
47
+ * @returns The result of the receiver function.
48
+ */
38
49
  function provideContext(value, receiver) {
39
50
  Reflect.set(value, kCommandWorker, true);
40
51
  return context.run(value, receiver);
@@ -90,6 +101,9 @@ function useEnvironment() {
90
101
 
91
102
  //#endregion
92
103
  //#region src/components/v1/button/ButtonKit.ts
104
+ /**
105
+ * A builder for creating buttons with additional features like interaction collectors and event handling.
106
+ */
93
107
  var ButtonKit = class extends discord_js.ButtonBuilder {
94
108
  #onClickHandler = null;
95
109
  #contextData = {
@@ -196,6 +210,9 @@ var ButtonKit = class extends discord_js.ButtonBuilder {
196
210
  return handler(interaction, this);
197
211
  }, this.#contextData);
198
212
  }
213
+ /**
214
+ * Disposes of the button collector and cleans up resources.
215
+ */
199
216
  dispose() {
200
217
  this.#destroyCollector();
201
218
  return this;
@@ -237,6 +254,11 @@ function Button(props) {
237
254
 
238
255
  //#endregion
239
256
  //#region src/components/v1/modal/ModalKit.ts
257
+ /**
258
+ * A builder for creating modals with additional features like interaction collectors and event handling.
259
+ * This class extends the ModalBuilder from discord.js and adds methods for handling interactions.
260
+ * It allows you to set a handler for when the modal is submitted, filter interactions, and handle the end of the interaction collector.
261
+ */
240
262
  var ModalKit = class extends discord_js.ModalBuilder {
241
263
  #onSubmitHandler = null;
242
264
  #contextData = {
@@ -339,6 +361,9 @@ var ModalKit = class extends discord_js.ModalBuilder {
339
361
  return handler(interaction, this);
340
362
  }, this.#contextData);
341
363
  }
364
+ /**
365
+ * Disposes of the modal collector and cleans up resources.
366
+ */
342
367
  dispose() {
343
368
  this.#destroyCollector();
344
369
  return this;
@@ -421,6 +446,11 @@ function ParagraphInput(props) {
421
446
 
422
447
  //#endregion
423
448
  //#region src/components/v1/select-menu/StringSelectMenuKit.ts
449
+ /**
450
+ * A builder for creating string select menus with additional features like interaction collectors and event handling.
451
+ * This class extends the StringSelectMenuBuilder from discord.js and adds methods for handling interactions.
452
+ * It allows you to set a handler for when the string select menu is submitted, filter interactions, and handle the end of the interaction collector.
453
+ */
424
454
  var StringSelectMenuKit = class extends discord_js.StringSelectMenuBuilder {
425
455
  #onSelectHandler = null;
426
456
  #contextData = {
@@ -523,6 +553,9 @@ var StringSelectMenuKit = class extends discord_js.StringSelectMenuBuilder {
523
553
  return handler(interaction, this);
524
554
  }, this.#contextData);
525
555
  }
556
+ /**
557
+ * Disposes of the interaction collector and cleans up resources.
558
+ */
526
559
  dispose() {
527
560
  this.#destroyCollector();
528
561
  return this;
@@ -538,6 +571,11 @@ var StringSelectMenuKit = class extends discord_js.StringSelectMenuBuilder {
538
571
 
539
572
  //#endregion
540
573
  //#region src/components/v1/select-menu/ChannelSelectMenuKit.ts
574
+ /**
575
+ * A builder for creating channel select menus with additional features like interaction collectors and event handling.
576
+ * This class extends the ChannelSelectMenuBuilder from discord.js and adds methods for handling interactions.
577
+ * It allows you to set a handler for when the channel select menu is submitted, filter interactions, and handle the end of the interaction collector.
578
+ */
541
579
  var ChannelSelectMenuKit = class extends discord_js.ChannelSelectMenuBuilder {
542
580
  #onSelectHandler = null;
543
581
  #contextData = {
@@ -640,6 +678,9 @@ var ChannelSelectMenuKit = class extends discord_js.ChannelSelectMenuBuilder {
640
678
  return handler(interaction, this);
641
679
  }, this.#contextData);
642
680
  }
681
+ /**
682
+ * Cleans up the interaction collector and removes the handler.
683
+ */
643
684
  dispose() {
644
685
  this.#destroyCollector();
645
686
  return this;
@@ -757,6 +798,9 @@ var MentionableSelectMenuKit = class extends discord_js.MentionableSelectMenuBui
757
798
  return handler(interaction, this);
758
799
  }, this.#contextData);
759
800
  }
801
+ /**
802
+ * Disposes of the mentionable select menu kit, cleaning up any resources used by the interaction collector.
803
+ */
760
804
  dispose() {
761
805
  this.#destroyCollector();
762
806
  return this;
@@ -772,6 +816,11 @@ var MentionableSelectMenuKit = class extends discord_js.MentionableSelectMenuBui
772
816
 
773
817
  //#endregion
774
818
  //#region src/components/v1/select-menu/UserSelectMenuKit.ts
819
+ /**
820
+ * A builder for creating user select menus with additional features like interaction collectors and event handling.
821
+ * This class extends the UserSelectMenuBuilder from discord.js and adds methods for handling interactions.
822
+ * It allows you to set a handler for when the user select menu is submitted, filter interactions, and handle the end of the interaction collector.
823
+ */
775
824
  var UserSelectMenuKit = class extends discord_js.UserSelectMenuBuilder {
776
825
  #onSelectHandler = null;
777
826
  #contextData = {
@@ -874,6 +923,9 @@ var UserSelectMenuKit = class extends discord_js.UserSelectMenuBuilder {
874
923
  return handler(interaction, this);
875
924
  }, this.#contextData);
876
925
  }
926
+ /**
927
+ * Disposes of the user select menu kit, cleaning up any collectors and handlers.
928
+ */
877
929
  dispose() {
878
930
  this.#destroyCollector();
879
931
  return this;
@@ -889,6 +941,11 @@ var UserSelectMenuKit = class extends discord_js.UserSelectMenuBuilder {
889
941
 
890
942
  //#endregion
891
943
  //#region src/components/v1/select-menu/RoleSelectMenuKit.ts
944
+ /**
945
+ * A builder for creating role select menus with additional features like interaction collectors and event handling.
946
+ * This class extends the RoleSelectMenuBuilder from discord.js and adds methods for handling interactions.
947
+ * It allows you to set a handler for when the role select menu is submitted, filter interactions, and handle the end of the interaction collector.
948
+ */
892
949
  var RoleSelectMenuKit = class extends discord_js.RoleSelectMenuBuilder {
893
950
  #onSelectHandler = null;
894
951
  #contextData = {
@@ -991,6 +1048,9 @@ var RoleSelectMenuKit = class extends discord_js.RoleSelectMenuBuilder {
991
1048
  return handler(interaction, this);
992
1049
  }, this.#contextData);
993
1050
  }
1051
+ /**
1052
+ * Disposes of the role select menu kit, cleaning up any resources and event listeners.
1053
+ */
994
1054
  dispose() {
995
1055
  this.#destroyCollector();
996
1056
  return this;
@@ -1006,6 +1066,9 @@ var RoleSelectMenuKit = class extends discord_js.RoleSelectMenuBuilder {
1006
1066
 
1007
1067
  //#endregion
1008
1068
  //#region src/components/v1/select-menu/SelectMenu.ts
1069
+ /**
1070
+ * @private
1071
+ */
1009
1072
  function applyPropsToBuilder(builder, props) {
1010
1073
  builder.setCustomId(props.customId ?? `select-menu::${crypto.randomUUID()}`);
1011
1074
  if (props.maxValues != null) builder.setMaxValues(props.maxValues);
@@ -1016,6 +1079,24 @@ function applyPropsToBuilder(builder, props) {
1016
1079
  if (props.onError) builder.onError(props.onError);
1017
1080
  if (props.onSelect) builder.onSelect(props.onSelect, props.options);
1018
1081
  }
1082
+ /**
1083
+ * The StringSelectMenu component.
1084
+ * @param props The properties for the string select menu component.
1085
+ * @returns The string select menu builder instance.
1086
+ * @example ```tsx
1087
+ * import { StringSelectMenu } from 'commandkit';
1088
+ *
1089
+ * const stringSelectMenu = <StringSelectMenu
1090
+ * customId="my-select-menu"
1091
+ * placeholder="Select an option"
1092
+ * maxValues={1}
1093
+ * minValues={1}
1094
+ * >
1095
+ * <StringSelectMenuOption label="Option 1" value="option1" />
1096
+ * <StringSelectMenuOption label="Option 2" value="option2" />
1097
+ * </StringSelectMenu>
1098
+ * ```
1099
+ */
1019
1100
  function StringSelectMenu(props) {
1020
1101
  const builder = new StringSelectMenuKit();
1021
1102
  applyPropsToBuilder(builder, props);
@@ -1023,27 +1104,75 @@ function StringSelectMenu(props) {
1023
1104
  if (props.children) builder.setOptions(Array.isArray(props.children) ? props.children : [props.children]);
1024
1105
  return builder;
1025
1106
  }
1107
+ /**
1108
+ * A select menu option for the string select menu.
1109
+ * @param props The properties for the string select menu option.
1110
+ * @returns The string select menu option builder instance.
1111
+ * @example ```tsx
1112
+ * import { StringSelectMenuOption } from 'commandkit';
1113
+ *
1114
+ * const option = <StringSelectMenuOption label="Option 1" value="option1" />;
1115
+ * ```
1116
+ */
1026
1117
  function StringSelectMenuOption(props) {
1027
1118
  return new discord_js.StringSelectMenuOptionBuilder(props);
1028
1119
  }
1120
+ /**
1121
+ * The UserSelectMenu component.
1122
+ * @param props The properties for the user select menu component.
1123
+ * @returns The user select menu builder instance.
1124
+ * @example ```tsx
1125
+ * import { UserSelectMenu } from 'commandkit';
1126
+ *
1127
+ * const userSelectMenu = <UserSelectMenu />
1128
+ * ```
1129
+ */
1029
1130
  function UserSelectMenu(props) {
1030
1131
  const builder = new UserSelectMenuKit();
1031
1132
  applyPropsToBuilder(builder, props);
1032
1133
  if (props.defaultValues) builder.setDefaultUsers(Array.isArray(props.defaultValues) ? props.defaultValues : [props.defaultValues]);
1033
1134
  return builder;
1034
1135
  }
1136
+ /**
1137
+ * The RoleSelectMenu component.
1138
+ * @param props The properties for the role select menu component.
1139
+ * @returns The role select menu builder instance.
1140
+ * @example ```tsx
1141
+ * import { RoleSelectMenu } from 'commandkit';
1142
+ *
1143
+ * const roleSelectMenu = <RoleSelectMenu />
1144
+ * ```
1145
+ */
1035
1146
  function RoleSelectMenu(props) {
1036
1147
  const builder = new RoleSelectMenuKit();
1037
1148
  applyPropsToBuilder(builder, props);
1038
1149
  if (props.defaultValues) builder.setDefaultRoles(Array.isArray(props.defaultValues) ? props.defaultValues : [props.defaultValues]);
1039
1150
  return builder;
1040
1151
  }
1152
+ /**
1153
+ * The MentionableSelectMenu component.
1154
+ * @param props The properties for the mentionable select menu component.
1155
+ * @returns The mentionable select menu builder instance.
1156
+ * @example ```tsx
1157
+ * import { MentionableSelectMenu } from 'commandkit';
1158
+ * const mentionableSelectMenu = <MentionableSelectMenu />
1159
+ * ```
1160
+ */
1041
1161
  function MentionableSelectMenu(props) {
1042
1162
  const builder = new MentionableSelectMenuKit();
1043
1163
  applyPropsToBuilder(builder, props);
1044
1164
  if (props.defaultValues) builder.setDefaultValues(Array.isArray(props.defaultValues) ? props.defaultValues : [props.defaultValues]);
1045
1165
  return builder;
1046
1166
  }
1167
+ /**
1168
+ * The ChannelSelectMenu component.
1169
+ * @param props The properties for the channel select menu component.
1170
+ * @returns The channel select menu builder instance.
1171
+ * @example ```tsx
1172
+ * import { ChannelSelectMenu } from 'commandkit';
1173
+ * const channelSelectMenu = <ChannelSelectMenu />
1174
+ * ```
1175
+ */
1047
1176
  function ChannelSelectMenu(props) {
1048
1177
  const builder = new ChannelSelectMenuKit();
1049
1178
  applyPropsToBuilder(builder, props);
@@ -1054,6 +1183,9 @@ function ChannelSelectMenu(props) {
1054
1183
 
1055
1184
  //#endregion
1056
1185
  //#region src/logger/DefaultLogger.ts
1186
+ /**
1187
+ * Log levels for the logger.
1188
+ */
1057
1189
  var LogLevel = /* @__PURE__ */ function(LogLevel$1) {
1058
1190
  LogLevel$1[LogLevel$1["DEBUG"] = 0] = "DEBUG";
1059
1191
  LogLevel$1[LogLevel$1["INFO"] = 1] = "INFO";
@@ -1090,8 +1222,17 @@ const BoxChars = {
1090
1222
  verticalRight: "├",
1091
1223
  corner: "└"
1092
1224
  };
1225
+ /**
1226
+ * Default logger implementation that logs messages to the console.
1227
+ * It formats the log messages with timestamps, log levels, and context information.
1228
+ */
1093
1229
  var DefaultLogger = class {
1094
1230
  logger;
1231
+ /**
1232
+ * Creates a new instance of DefaultLogger.
1233
+ * @param stdout The output stream for standard messages (default: process.stdout).
1234
+ * @param stderr The output stream for error messages (default: process.stderr).
1235
+ */
1095
1236
  constructor(stdout = process.stdout, stderr = process.stderr) {
1096
1237
  this.stdout = stdout;
1097
1238
  this.stderr = stderr;
@@ -1151,18 +1292,38 @@ var DefaultLogger = class {
1151
1292
  if (context$1) this.logger.log(`${prefix}\n${context$1} ${require_colors.colors_default.dim(BoxChars.corner)}`, ...args.map((arg) => colorFn(arg)));
1152
1293
  else this.logger.log(`${prefix} ${require_colors.colors_default.dim(BoxChars.corner)}`, ...args.map((arg) => colorFn(arg)));
1153
1294
  }
1295
+ /**
1296
+ * Logs a debug message.
1297
+ * @param args The message arguments to log.
1298
+ */
1154
1299
  debug(...args) {
1155
1300
  this._log(LogLevel.DEBUG, ...args);
1156
1301
  }
1302
+ /**
1303
+ * Logs an error message.
1304
+ * @param args The message arguments to log.
1305
+ */
1157
1306
  error(...args) {
1158
1307
  this._log(LogLevel.ERROR, ...args);
1159
1308
  }
1309
+ /**
1310
+ * Logs a default message.
1311
+ * @param args The message arguments to log.
1312
+ */
1160
1313
  log(...args) {
1161
1314
  this._log(LogLevel.DEFAULT, ...args);
1162
1315
  }
1316
+ /**
1317
+ * Logs an info message.
1318
+ * @param args The message arguments to log.
1319
+ */
1163
1320
  info(...args) {
1164
1321
  this._log(LogLevel.INFO, ...args);
1165
1322
  }
1323
+ /**
1324
+ * Logs a warning message.
1325
+ * @param args The message arguments to log.
1326
+ */
1166
1327
  warn(...args) {
1167
1328
  this._log(LogLevel.WARN, ...args);
1168
1329
  }
@@ -1170,6 +1331,11 @@ var DefaultLogger = class {
1170
1331
 
1171
1332
  //#endregion
1172
1333
  //#region src/logger/Logger.ts
1334
+ /**
1335
+ * Creates a new logger instance with the specified options.
1336
+ * @param options The options for configuring the logger.
1337
+ * @returns A new logger instance.
1338
+ */
1173
1339
  function createLogger(options) {
1174
1340
  let opt = options;
1175
1341
  if (!(opt === null || opt === void 0 ? void 0 : opt.provider)) throw new Error("A logger provider must be provided.");
@@ -1188,21 +1354,44 @@ function createLogger(options) {
1188
1354
  };
1189
1355
  return impl;
1190
1356
  }
1357
+ /**
1358
+ * Default logger instance for CommandKit. This logger uses the DefaultLogger as its provider.
1359
+ * The provider can be replaced with a custom logger implementation using the `configure` method.
1360
+ */
1191
1361
  const Logger = createLogger({ provider: new DefaultLogger() });
1192
1362
 
1193
1363
  //#endregion
1194
1364
  //#region src/plugins/plugin-runtime/CommandKitPluginRuntime.ts
1365
+ /**
1366
+ * Represents the runtime environment for CommandKit plugins.
1367
+ */
1195
1368
  var CommandKitPluginRuntime = class {
1196
1369
  plugins = new discord_js.Collection();
1370
+ /**
1371
+ * Creates a new instance of CommandKitPluginRuntime.
1372
+ * @param commandkit The CommandKit instance associated with this runtime.
1373
+ */
1197
1374
  constructor(commandkit$1) {
1198
1375
  this.commandkit = commandkit$1;
1199
1376
  }
1377
+ /**
1378
+ * Returns the plugins registered in this runtime.
1379
+ * @returns A collection of plugins.
1380
+ */
1200
1381
  getPlugins() {
1201
1382
  return this.plugins;
1202
1383
  }
1384
+ /**
1385
+ * Checks if there are no plugins registered in this runtime.
1386
+ * @returns Boolean indicating whether the runtime is empty.
1387
+ */
1203
1388
  getPlugin(pluginName) {
1204
1389
  return this.plugins.get(pluginName) ?? null;
1205
1390
  }
1391
+ /**
1392
+ * Soft registers a plugin in the runtime.
1393
+ * @param plugin The plugin to be registered.
1394
+ */
1206
1395
  async softRegisterPlugin(plugin) {
1207
1396
  const pluginName = plugin.name;
1208
1397
  if (this.plugins.has(pluginName)) return;
@@ -1213,6 +1402,11 @@ var CommandKitPluginRuntime = class {
1213
1402
  throw new Error(`Failed to activate plugin "${pluginName}": ${(e === null || e === void 0 ? void 0 : e.stack) || e}`);
1214
1403
  }
1215
1404
  }
1405
+ /**
1406
+ * Registers a plugin in the runtime.
1407
+ * @param plugin The plugin to be registered.
1408
+ * @throws If a plugin with the same name already exists.
1409
+ */
1216
1410
  async registerPlugin(plugin) {
1217
1411
  const pluginName = plugin.name;
1218
1412
  if (this.plugins.has(pluginName)) throw new Error(`Plugin with name "${pluginName}" already exists.`);
@@ -1223,6 +1417,11 @@ var CommandKitPluginRuntime = class {
1223
1417
  throw new Error(`Failed to activate plugin "${pluginName}": ${(e === null || e === void 0 ? void 0 : e.stack) || e}`);
1224
1418
  }
1225
1419
  }
1420
+ /**
1421
+ * Unregisters a plugin from the runtime.
1422
+ * @param plugin The plugin to be unregistered.
1423
+ * @throws If the plugin does not exist.
1424
+ */
1226
1425
  async unregisterPlugin(plugin) {
1227
1426
  const pluginName = plugin.name;
1228
1427
  if (!this.plugins.has(pluginName)) throw new Error(`Plugin with name "${pluginName}" does not exist.`);
@@ -1233,12 +1432,23 @@ var CommandKitPluginRuntime = class {
1233
1432
  throw new Error(`Failed to deactivate plugin "${pluginName}": ${(e === null || e === void 0 ? void 0 : e.stack) || e}`);
1234
1433
  }
1235
1434
  }
1435
+ /**
1436
+ * Unregisters all plugins from the runtime.
1437
+ */
1236
1438
  async unregisterAllPlugins() {
1237
1439
  for (const plugin of this.plugins.values()) await this.unregisterPlugin(plugin);
1238
1440
  }
1441
+ /**
1442
+ * Signals the runtime to allow the current plugin take ownership of the execution context.
1443
+ */
1239
1444
  capture() {
1240
1445
  throw require_error_codes.createCommandKitError(require_error_codes.CommandKitErrorCodes.PluginCaptureHandle);
1241
1446
  }
1447
+ /**
1448
+ * Executes a function for each plugin in the runtime.
1449
+ * @param f The function to execute for each plugin.
1450
+ * @returns The result of the last executed function, or undefined if no plugins were executed.
1451
+ */
1242
1452
  async execute(f) {
1243
1453
  let result;
1244
1454
  for (const plugin of this.plugins.values()) try {
@@ -1253,6 +1463,9 @@ var CommandKitPluginRuntime = class {
1253
1463
 
1254
1464
  //#endregion
1255
1465
  //#region src/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.ts
1466
+ /**
1467
+ * Common directive transformer plugin is a compiler plugin that transforms directives to higher-order functions.
1468
+ */
1256
1469
  var CommonDirectiveTransformer = class extends require_CompilerPlugin.CompilerPlugin {
1257
1470
  transformer = null;
1258
1471
  async activate(ctx) {
@@ -1276,6 +1489,18 @@ var CommonDirectiveTransformer = class extends require_CompilerPlugin.CompilerPl
1276
1489
 
1277
1490
  //#endregion
1278
1491
  //#region src/plugins/plugin-runtime/builtin/MacroPlugin.ts
1492
+ /**
1493
+ * Macro plugin enables the use of `"use macro"` directive in the code.
1494
+ * Functions with this directive will be transformed at compile time
1495
+ * and only the result will be included in the final bundle.
1496
+ * @example function myMacro() {
1497
+ * "use macro";
1498
+ * return Math.random();
1499
+ * }
1500
+ *
1501
+ * // This will be transformed to a constant value at compile time.
1502
+ * const result = myMacro();
1503
+ */
1279
1504
  var MacroPlugin = class extends require_CompilerPlugin.CompilerPlugin {
1280
1505
  name = "MacroPlugin";
1281
1506
  macroTransformer;
@@ -1299,6 +1524,9 @@ var MacroPlugin = class extends require_CompilerPlugin.CompilerPlugin {
1299
1524
 
1300
1525
  //#endregion
1301
1526
  //#region src/config/default.ts
1527
+ /**
1528
+ * Default configuration for CommandKit.
1529
+ */
1302
1530
  const defaultConfig = {
1303
1531
  plugins: [new MacroPlugin({ enabled: true })],
1304
1532
  rolldownPlugins: [(0, __rollup_plugin_json.default)()],
@@ -1364,6 +1592,10 @@ function getSrcDir() {
1364
1592
  if (require_constants.COMMANDKIT_IS_DEV) return ".commandkit";
1365
1593
  return getConfig().distDir;
1366
1594
  }
1595
+ /**
1596
+ * Returns the current working directory of the CommandKit application.
1597
+ * This is typically the directory where the source code is located.
1598
+ */
1367
1599
  function getCurrentDirectory() {
1368
1600
  if (currentDir) return currentDir;
1369
1601
  const src = getSrcDir();
@@ -1372,6 +1604,11 @@ function getCurrentDirectory() {
1372
1604
  currentDir = root;
1373
1605
  return root;
1374
1606
  }
1607
+ /**
1608
+ * Returns the possible source directories for the CommandKit application.
1609
+ * This includes the `src`, `.commandkit`, and the distribution directory.
1610
+ * @returns An array of possible source directories.
1611
+ */
1375
1612
  function getSourceDirectories() {
1376
1613
  const dist = getConfig().distDir;
1377
1614
  const locations = [
@@ -1401,6 +1638,14 @@ function findAppDirectory() {
1401
1638
  * @param fn The function to debounce.
1402
1639
  * @param ms The debounce time in milliseconds.
1403
1640
  * @returns The debounced function.
1641
+ * @example
1642
+ * const debouncedFn = debounce(() => {
1643
+ * console.log('Debounced function called');
1644
+ * }, 300);
1645
+ *
1646
+ * debouncedFn(); // Will only execute after 300ms of inactivity
1647
+ * debouncedFn(); // Will reset the timer
1648
+ * debouncedFn(); // Will reset the timer again
1404
1649
  */
1405
1650
  function debounce(fn, ms) {
1406
1651
  let timer = null;
@@ -1424,6 +1669,13 @@ function debounce(fn, ms) {
1424
1669
  /**
1425
1670
  * Defers the execution of a function.
1426
1671
  * @param fn The function to defer.
1672
+ * @param timeout The time in milliseconds to wait before executing the function. Defaults to 0.
1673
+ * @example
1674
+ * defer(() => {
1675
+ * console.log('This will run after a delay');
1676
+ * });
1677
+ *
1678
+ * console.log('This will run immediately');
1427
1679
  */
1428
1680
  function defer(fn, timeout = 0) {
1429
1681
  setTimeout(() => {
@@ -1471,8 +1723,17 @@ var StopEventPropagationError = class extends Error {
1471
1723
  }
1472
1724
  };
1473
1725
  /**
1474
- * Stops event propagation.
1726
+ * Stops event propagation. This function should be called inside an event handler
1727
+ * to prevent further event handling.
1475
1728
  * @throws {StopEventPropagationError}
1729
+ * @example // src/app/events/messageCreate/handler.ts
1730
+ * import { stopEvents } from 'commandkit';
1731
+ *
1732
+ * export default async function messageCreateHandler() {
1733
+ * console.log('Message created');
1734
+ * // Stop further event propagation
1735
+ * stopEvents();
1736
+ * }
1476
1737
  */
1477
1738
  function stopEvents() {
1478
1739
  if (!require_EventWorkerContext.eventWorkerContext.getStore()) throw new Error("stopEvents() may only be called inside an event handler");
@@ -1536,7 +1797,14 @@ function createProxy(target) {
1536
1797
 
1537
1798
  //#endregion
1538
1799
  //#region src/app/register/CommandRegistrar.ts
1800
+ /**
1801
+ * Handles registration of Discord application commands (slash commands, context menus).
1802
+ */
1539
1803
  var CommandRegistrar = class {
1804
+ /**
1805
+ * @private
1806
+ * @internal
1807
+ */
1540
1808
  api = new discord_js.REST();
1541
1809
  /**
1542
1810
  * Creates an instance of CommandRegistrar.
@@ -1690,6 +1958,9 @@ var CommandRegistrar = class {
1690
1958
 
1691
1959
  //#endregion
1692
1960
  //#region src/context/environment.ts
1961
+ /**
1962
+ * Represents the execution environment for CommandKit commands.
1963
+ */
1693
1964
  var CommandKitEnvironment = class {
1694
1965
  #data = {
1695
1966
  executionError: null,
@@ -1835,9 +2106,19 @@ let CommandKitEnvironmentType = /* @__PURE__ */ function(CommandKitEnvironmentTy
1835
2106
  return CommandKitEnvironmentType$1;
1836
2107
  }({});
1837
2108
  /**
1838
- * Runs the given function after the current command has finished executing.
2109
+ * Schedules the given function to run after the current command has finished executing.
1839
2110
  * @param fn The function to run after the current command.
1840
2111
  * @returns The deferred function id. This can be used to cancel the deferred function.
2112
+ * @example import { after } from 'commandkit';
2113
+ *
2114
+ * // inside a command
2115
+ * export const chatInput: ChatInputCommand = async (ctx) => {
2116
+ * after(() => {
2117
+ * console.log('This will run after the command has finished executing.');
2118
+ * });
2119
+ *
2120
+ * // ... command logic
2121
+ * }
1841
2122
  */
1842
2123
  function after(fn) {
1843
2124
  const env = getContext();
@@ -1847,6 +2128,16 @@ function after(fn) {
1847
2128
  /**
1848
2129
  * Cancels a deferred function registered with `after`.
1849
2130
  * @param id The deferred function id to cancel.
2131
+ * @example import { cancelAfter } from 'commandkit';
2132
+ * // inside a command
2133
+ * export const chatInput: ChatInputCommand = async (ctx) => {
2134
+ * const id = after(() => {
2135
+ * console.log('This will run after the command has finished executing.');
2136
+ * });
2137
+ *
2138
+ * // cancel the deferred function if needed
2139
+ * if (something) cancelAfter(id);
2140
+ * }
1850
2141
  */
1851
2142
  function cancelAfter(id) {
1852
2143
  const env = getContext();
@@ -1856,6 +2147,9 @@ function cancelAfter(id) {
1856
2147
 
1857
2148
  //#endregion
1858
2149
  //#region src/app/commands/Context.ts
2150
+ /**
2151
+ * Enumeration of different command execution modes supported by CommandKit.
2152
+ */
1859
2153
  const CommandExecutionMode = {
1860
2154
  ChatInputCommand: "chatInput",
1861
2155
  MessageContextMenu: "messageContextMenu",
@@ -1863,6 +2157,10 @@ const CommandExecutionMode = {
1863
2157
  Autocomplete: "autocomplete",
1864
2158
  Message: "message"
1865
2159
  };
2160
+ /**
2161
+ * Represents the execution context for a command, providing access to Discord.js objects,
2162
+ * command metadata, and various utility methods for command execution.
2163
+ */
1866
2164
  var Context = class Context {
1867
2165
  /**
1868
2166
  * The interaction that triggered the command.
@@ -1896,7 +2194,15 @@ var Context = class Context {
1896
2194
  * The command that this context belongs to.
1897
2195
  */
1898
2196
  command;
2197
+ /**
2198
+ * @private
2199
+ * @internal
2200
+ */
1899
2201
  #store;
2202
+ /**
2203
+ * @private
2204
+ * @internal
2205
+ */
1900
2206
  _locale = null;
1901
2207
  /**
1902
2208
  * Creates a new command context.
@@ -1932,10 +2238,16 @@ var Context = class Context {
1932
2238
  get store() {
1933
2239
  return this.#store;
1934
2240
  }
2241
+ /**
2242
+ * Gets the name of the current command.
2243
+ */
1935
2244
  get commandName() {
1936
2245
  if (this.isInteraction()) return this.interaction.commandName;
1937
2246
  else return this.config.messageCommandParser.getCommand();
1938
2247
  }
2248
+ /**
2249
+ * Gets the command options based on the execution mode.
2250
+ */
1939
2251
  get options() {
1940
2252
  if (this.isMessage()) {
1941
2253
  const parser = this.config.messageCommandParser;
@@ -2062,6 +2374,7 @@ var Context = class Context {
2062
2374
  }
2063
2375
  /**
2064
2376
  * Creates a clone of this context
2377
+ * @param config - Optional partial config to override in the clone
2065
2378
  */
2066
2379
  clone(config) {
2067
2380
  if (!config) return new Context(this.commandkit, this.config);
@@ -2072,9 +2385,16 @@ var Context = class Context {
2072
2385
  });
2073
2386
  return ctx;
2074
2387
  }
2388
+ /**
2389
+ * Checks if this context is a middleware context.
2390
+ */
2075
2391
  isMiddleware() {
2076
2392
  return this instanceof MiddlewareContext;
2077
2393
  }
2394
+ /**
2395
+ * Gets the command arguments (only available for message commands).
2396
+ * @returns Array of command arguments
2397
+ */
2078
2398
  args() {
2079
2399
  if (this.isMessage()) return this.config.messageCommandParser.getArgs();
2080
2400
  return [];
@@ -2089,7 +2409,14 @@ var Context = class Context {
2089
2409
  require_signals.exitMiddleware();
2090
2410
  }
2091
2411
  };
2412
+ /**
2413
+ * Extended context class for middleware execution with additional control methods.
2414
+ */
2092
2415
  var MiddlewareContext = class extends Context {
2416
+ /**
2417
+ * @private
2418
+ * @internal
2419
+ */
2093
2420
  #cancel = false;
2094
2421
  /**
2095
2422
  * Whether the command execution was cancelled.
@@ -2120,10 +2447,24 @@ var MiddlewareContext = class extends Context {
2120
2447
 
2121
2448
  //#endregion
2122
2449
  //#region src/app/commands/AppCommandRunner.ts
2450
+ /**
2451
+ * Handles the execution of application commands for CommandKit.
2452
+ * Manages middleware execution, environment setup, and command invocation.
2453
+ */
2123
2454
  var AppCommandRunner = class {
2455
+ /**
2456
+ * Creates a new AppCommandRunner instance.
2457
+ * @param handler - The app command handler instance to use for command execution
2458
+ */
2124
2459
  constructor(handler) {
2125
2460
  this.handler = handler;
2126
2461
  }
2462
+ /**
2463
+ * Executes a prepared command with middleware support and environment setup.
2464
+ * Handles the complete command lifecycle including before/after middleware execution.
2465
+ * @param prepared - The prepared command execution data
2466
+ * @param source - The source interaction or message that triggered the command
2467
+ */
2127
2468
  async runCommand(prepared, source) {
2128
2469
  const { commandkit: commandkit$1 } = this.handler;
2129
2470
  const executionMode = this.getExecutionMode(source);
@@ -2228,6 +2569,11 @@ var AppCommandRunner = class {
2228
2569
  }
2229
2570
  });
2230
2571
  }
2572
+ /**
2573
+ * @private
2574
+ * @internal
2575
+ * Finalizes command execution by running deferred functions and plugin cleanup.
2576
+ */
2231
2577
  async #finalizer() {
2232
2578
  const env = useEnvironment();
2233
2579
  await env.runDeferredFunctions();
@@ -2236,6 +2582,11 @@ var AppCommandRunner = class {
2236
2582
  await plugin.onAfterCommand(ctx, env);
2237
2583
  });
2238
2584
  }
2585
+ /**
2586
+ * Determines the execution mode based on the source of the command.
2587
+ * @param source - The interaction or message that triggered the command
2588
+ * @returns The appropriate command execution mode
2589
+ */
2239
2590
  getExecutionMode(source) {
2240
2591
  if (source instanceof discord_js.Message) return CommandExecutionMode.Message;
2241
2592
  if (source.isChatInputCommand()) return CommandExecutionMode.ChatInputCommand;
@@ -2248,6 +2599,10 @@ var AppCommandRunner = class {
2248
2599
 
2249
2600
  //#endregion
2250
2601
  //#region src/app/handlers/AppCommandHandler.ts
2602
+ /**
2603
+ * @private
2604
+ * @internal
2605
+ */
2251
2606
  const commandDataSchema = {
2252
2607
  command: (c) => c instanceof discord_js.SlashCommandBuilder || c instanceof discord_js.ContextMenuCommandBuilder || c && typeof c === "object",
2253
2608
  chatInput: (c) => typeof c === "function",
@@ -2256,25 +2611,76 @@ const commandDataSchema = {
2256
2611
  messageContextMenu: (c) => typeof c === "function",
2257
2612
  userContextMenu: (c) => typeof c === "function"
2258
2613
  };
2614
+ /**
2615
+ * @private
2616
+ * @internal
2617
+ */
2259
2618
  const middlewareDataSchema = {
2260
2619
  beforeExecute: (c) => typeof c === "function",
2261
2620
  afterExecute: (c) => typeof c === "function"
2262
2621
  };
2622
+ /**
2623
+ * Handles application commands for CommandKit, including loading, registration, and execution.
2624
+ * Manages both slash commands and message commands with middleware support.
2625
+ */
2263
2626
  var AppCommandHandler = class {
2627
+ /**
2628
+ * @private
2629
+ * @internal
2630
+ */
2264
2631
  loadedCommands = new discord_js.Collection();
2632
+ /**
2633
+ * @private
2634
+ * @internal
2635
+ */
2265
2636
  loadedMiddlewares = new discord_js.Collection();
2637
+ /**
2638
+ * @private
2639
+ * @internal
2640
+ */
2266
2641
  commandNameToId = /* @__PURE__ */ new Map();
2642
+ /**
2643
+ * @private
2644
+ * @internal
2645
+ */
2267
2646
  subcommandPathToId = /* @__PURE__ */ new Map();
2647
+ /**
2648
+ * Command registrar for handling Discord API registration.
2649
+ */
2268
2650
  registrar;
2651
+ /**
2652
+ * @private
2653
+ * @internal
2654
+ */
2269
2655
  onInteraction = null;
2656
+ /**
2657
+ * @private
2658
+ * @internal
2659
+ */
2270
2660
  onMessageCreate = null;
2661
+ /**
2662
+ * Command runner instance for executing commands.
2663
+ */
2271
2664
  commandRunner = new AppCommandRunner(this);
2665
+ /**
2666
+ * External command data storage.
2667
+ */
2272
2668
  externalCommandData = new discord_js.Collection();
2669
+ /**
2670
+ * External middleware data storage.
2671
+ */
2273
2672
  externalMiddlewareData = new discord_js.Collection();
2673
+ /**
2674
+ * Creates a new AppCommandHandler instance.
2675
+ * @param commandkit - The CommandKit instance
2676
+ */
2274
2677
  constructor(commandkit$1) {
2275
2678
  this.commandkit = commandkit$1;
2276
2679
  this.registrar = new CommandRegistrar(this.commandkit);
2277
2680
  }
2681
+ /**
2682
+ * Prints a formatted banner showing all loaded commands organized by category.
2683
+ */
2278
2684
  printBanner() {
2279
2685
  const uncategorized = crypto.randomUUID();
2280
2686
  const categorizedCommands = this.getCommandsArray().reduce((acc, cmd) => {
@@ -2350,9 +2756,16 @@ var AppCommandHandler = class {
2350
2756
  printCategory(category, "", isLast);
2351
2757
  });
2352
2758
  }
2759
+ /**
2760
+ * Gets an array of all loaded commands.
2761
+ * @returns Array of loaded commands
2762
+ */
2353
2763
  getCommandsArray() {
2354
2764
  return Array.from(this.loadedCommands.values());
2355
2765
  }
2766
+ /**
2767
+ * Registers event handlers for Discord interactions and messages.
2768
+ */
2356
2769
  registerCommandHandler() {
2357
2770
  this.onInteraction ??= async (interaction) => {
2358
2771
  const success = await this.commandkit.plugins.execute(async (ctx, plugin) => {
@@ -2378,6 +2791,12 @@ var AppCommandHandler = class {
2378
2791
  this.commandkit.client.on(discord_js.Events.InteractionCreate, this.onInteraction);
2379
2792
  this.commandkit.client.on(discord_js.Events.MessageCreate, this.onMessageCreate);
2380
2793
  }
2794
+ /**
2795
+ * Prepares a command for execution by resolving the command and its middleware.
2796
+ * @param source - The interaction or message that triggered the command
2797
+ * @param cmdName - Optional command name override
2798
+ * @returns Prepared command execution data or null if command not found
2799
+ */
2381
2800
  async prepareCommandRun(source, cmdName) {
2382
2801
  var _loadedCommand$guilds2;
2383
2802
  let parser;
@@ -2427,6 +2846,9 @@ var AppCommandHandler = class {
2427
2846
  messageCommandParser: parser
2428
2847
  };
2429
2848
  }
2849
+ /**
2850
+ * Reloads all commands and middleware from scratch.
2851
+ */
2430
2852
  async reloadCommands() {
2431
2853
  this.loadedCommands.clear();
2432
2854
  this.loadedMiddlewares.clear();
@@ -2436,27 +2858,46 @@ var AppCommandHandler = class {
2436
2858
  this.externalMiddlewareData.clear();
2437
2859
  await this.loadCommands();
2438
2860
  }
2861
+ /**
2862
+ * Adds external middleware data to be loaded.
2863
+ * @param data - Array of middleware data to add
2864
+ */
2439
2865
  async addExternalMiddleware(data) {
2440
2866
  for (const middleware of data) {
2441
2867
  if (!middleware.id) continue;
2442
2868
  this.externalMiddlewareData.set(middleware.id, middleware);
2443
2869
  }
2444
2870
  }
2871
+ /**
2872
+ * Adds external command data to be loaded.
2873
+ * @param data - Array of command data to add
2874
+ */
2445
2875
  async addExternalCommands(data) {
2446
2876
  for (const command of data) {
2447
2877
  if (!command.id) continue;
2448
2878
  this.externalCommandData.set(command.id, command);
2449
2879
  }
2450
2880
  }
2881
+ /**
2882
+ * Registers externally loaded middleware.
2883
+ * @param data - Array of loaded middleware to register
2884
+ */
2451
2885
  async registerExternalLoadedMiddleware(data) {
2452
2886
  for (const middleware of data) this.loadedMiddlewares.set(middleware.middleware.id, middleware);
2453
2887
  }
2888
+ /**
2889
+ * Registers externally loaded commands.
2890
+ * @param data - Array of loaded commands to register
2891
+ */
2454
2892
  async registerExternalLoadedCommands(data) {
2455
2893
  for (const command of data) {
2456
2894
  this.loadedCommands.set(command.command.id, command);
2457
2895
  this.commandNameToId.set(command.command.name, command.command.id);
2458
2896
  }
2459
2897
  }
2898
+ /**
2899
+ * Loads all commands and middleware from the router.
2900
+ */
2460
2901
  async loadCommands() {
2461
2902
  await this.commandkit.plugins.execute((ctx, plugin) => {
2462
2903
  return plugin.onBeforeCommandsLoad(ctx);
@@ -2473,6 +2914,10 @@ var AppCommandHandler = class {
2473
2914
  return plugin.onAfterCommandsLoad(ctx);
2474
2915
  });
2475
2916
  }
2917
+ /**
2918
+ * @private
2919
+ * @internal
2920
+ */
2476
2921
  async loadMiddleware(id, middleware) {
2477
2922
  try {
2478
2923
  const data = await import(`${require_resolve_file_url.toFileURL(middleware.path)}?t=${Date.now()}`);
@@ -2490,6 +2935,10 @@ var AppCommandHandler = class {
2490
2935
  Logger.error(`Failed to load middleware ${id}`, error);
2491
2936
  }
2492
2937
  }
2938
+ /**
2939
+ * @private
2940
+ * @internal
2941
+ */
2493
2942
  async loadCommand(id, command) {
2494
2943
  try {
2495
2944
  if (command.path === null) {
@@ -2533,11 +2982,26 @@ var AppCommandHandler = class {
2533
2982
 
2534
2983
  //#endregion
2535
2984
  //#region src/app/handlers/AppEventsHandler.ts
2985
+ /**
2986
+ * Handles Discord.js events and CommandKit custom events with support for namespacing and middleware.
2987
+ */
2536
2988
  var AppEventsHandler = class {
2989
+ /**
2990
+ * @private
2991
+ * @internal
2992
+ */
2537
2993
  loadedEvents = new discord_js.Collection();
2994
+ /**
2995
+ * Creates a new AppEventsHandler instance.
2996
+ * @param commandkit - The CommandKit instance
2997
+ */
2538
2998
  constructor(commandkit$1) {
2539
2999
  this.commandkit = commandkit$1;
2540
3000
  }
3001
+ /**
3002
+ * Gets information about all loaded events.
3003
+ * @returns Array of loaded event data
3004
+ */
2541
3005
  getEvents() {
2542
3006
  if (this.loadedEvents.size === 0) return [];
2543
3007
  const events = this.loadedEvents.toJSON();
@@ -2549,10 +3013,16 @@ var AppEventsHandler = class {
2549
3013
  metadata: event.event
2550
3014
  }));
2551
3015
  }
3016
+ /**
3017
+ * Reloads all events by unregistering existing ones and loading them again.
3018
+ */
2552
3019
  async reloadEvents() {
2553
3020
  this.unregisterAll();
2554
3021
  await this.loadEvents();
2555
3022
  }
3023
+ /**
3024
+ * Loads all events from the events router and registers them with Discord.js client.
3025
+ */
2556
3026
  async loadEvents() {
2557
3027
  await this.commandkit.plugins.execute((ctx, plugin) => {
2558
3028
  return plugin.onBeforeEventsLoad(ctx);
@@ -2585,10 +3055,16 @@ var AppEventsHandler = class {
2585
3055
  return plugin.onAfterEventsLoad(ctx);
2586
3056
  });
2587
3057
  }
3058
+ /**
3059
+ * Unregisters all event listeners and clears loaded events.
3060
+ */
2588
3061
  unregisterAll() {
2589
3062
  this.unregisterAllClientListeners();
2590
3063
  this.loadedEvents.clear();
2591
3064
  }
3065
+ /**
3066
+ * Registers all loaded events with the Discord.js client and CommandKit event system.
3067
+ */
2592
3068
  registerAllClientEvents() {
2593
3069
  const client = this.commandkit.client;
2594
3070
  for (const [key, data] of this.loadedEvents.entries()) {
@@ -2698,6 +3174,9 @@ var AppEventsHandler = class {
2698
3174
  Logger.info(`🔌 Registered event ${name}${namespace ? ` of namespace ${namespace}` : ""} (${onListeners.length} regular, ${onceListeners.length} once-only)`);
2699
3175
  }
2700
3176
  }
3177
+ /**
3178
+ * Unregisters all client event listeners and cleans up loaded events.
3179
+ */
2701
3180
  unregisterAllClientListeners() {
2702
3181
  const client = this.commandkit.client;
2703
3182
  for (const [key, { name, mainListener, namespace }] of this.loadedEvents.entries()) {
@@ -2719,6 +3198,12 @@ const CONFIG_FILE_NAMES = [
2719
3198
  "commandkit.config.cjs",
2720
3199
  "commandkit.config.ts"
2721
3200
  ];
3201
+ /**
3202
+ * Returns an array of possible configuration file paths based on the provided root directory.
3203
+ * @param root The root directory to search for configuration files.
3204
+ * @returns The array of possible configuration file paths.
3205
+ * @private
3206
+ */
2722
3207
  function getPossibleConfigPaths(root) {
2723
3208
  return CONFIG_FILE_NAMES.map((name) => (0, node_path.join)(root, name));
2724
3209
  }
@@ -2746,6 +3231,10 @@ async function loadConfigFile(entrypoint = process.cwd()) {
2746
3231
 
2747
3232
  //#endregion
2748
3233
  //#region src/utils/dev-hooks.ts
3234
+ /**
3235
+ * Registers development hooks for CommandKit to handle HMR (Hot Module Replacement) events.
3236
+ * @param commandkit - The CommandKit instance to register hooks for.
3237
+ */
2749
3238
  function registerDevHooks(commandkit$1) {
2750
3239
  if (!require_constants.COMMANDKIT_IS_DEV) return;
2751
3240
  process.on("message", async (message) => {
@@ -2797,6 +3286,10 @@ function registerDevHooks(commandkit$1) {
2797
3286
 
2798
3287
  //#endregion
2799
3288
  //#region src/analytics/utils.ts
3289
+ /**
3290
+ * @private
3291
+ * @internal
3292
+ */
2800
3293
  function getVariableStore() {
2801
3294
  const ctx = getContext();
2802
3295
  if (!ctx) try {
@@ -2807,10 +3300,23 @@ function getVariableStore() {
2807
3300
  }
2808
3301
  return ctx.variables;
2809
3302
  }
3303
+ /**
3304
+ * @private
3305
+ * @internal
3306
+ */
2810
3307
  function getDoNotTrack() {
2811
3308
  const variables = getVariableStore();
2812
3309
  return (variables === null || variables === void 0 ? void 0 : variables.get(require_constants$1.DO_NOT_TRACK_KEY)) === true;
2813
3310
  }
3311
+ /**
3312
+ * Signals commandkit to not track further analytics events within current context.
3313
+ * This is useful for scenarios where you want to disable analytics tracking
3314
+ * for a specific command or operation, such as during testing or when the user opts out.
3315
+ * @example import { noAnalytics } from 'commandkit/analytics';
3316
+ *
3317
+ * // inside commandkit context
3318
+ * noAnalytics();
3319
+ */
2814
3320
  function noAnalytics() {
2815
3321
  const variables = getVariableStore();
2816
3322
  if (!variables) throw new Error("noAnalytics may only be used inside commandkit context");
@@ -2819,25 +3325,59 @@ function noAnalytics() {
2819
3325
 
2820
3326
  //#endregion
2821
3327
  //#region src/analytics/analytics-engine.ts
3328
+ /**
3329
+ * AnalyticsEngine class for managing analytics providers and tracking events.
3330
+ * This class allows you to register a provider, set a filter for events, and track or identify events.
3331
+ */
2822
3332
  var AnalyticsEngine = class {
2823
3333
  #provider = null;
2824
3334
  #filter = null;
3335
+ /**
3336
+ * Creates an instance of the AnalyticsEngine.
3337
+ * @param commandkit The CommandKit instance.
3338
+ */
2825
3339
  constructor(commandkit$1) {
2826
3340
  this.commandkit = commandkit$1;
2827
3341
  }
3342
+ /**
3343
+ * Sets a filter function for analytics events.
3344
+ * This function will be called before tracking an event to determine if it should be tracked.
3345
+ * If the filter returns `false`, the event will not be tracked.
3346
+ * If the filter is set to `null`, all events will be tracked unless `doNotTrack` is enabled.
3347
+ * @param filter The filter function to set, or `null` to remove the filter.
3348
+ */
2828
3349
  setFilter(filter) {
2829
3350
  this.#filter = filter;
2830
3351
  }
3352
+ /**
3353
+ * Registers an analytics provider.
3354
+ * This provider will be used to track and identify events.
3355
+ * If a provider is already registered, it will be replaced with the new one.
3356
+ * @param provider The analytics provider to register.
3357
+ */
2831
3358
  registerProvider(provider) {
2832
3359
  require_warn_unstable.warnUnstable("analytics");
2833
3360
  this.#provider = provider;
2834
3361
  }
3362
+ /**
3363
+ * Removes the currently registered analytics provider.
3364
+ * @param provider The analytics provider to remove.
3365
+ */
2835
3366
  removeProvider(provider) {
2836
3367
  if (this.#provider === provider) this.#provider = null;
2837
3368
  }
3369
+ /**
3370
+ * Retrieves the currently registered analytics provider.
3371
+ * @returns The currently registered analytics provider, or `null` if no provider is registered.
3372
+ */
2838
3373
  getProvider() {
2839
3374
  return this.#provider;
2840
3375
  }
3376
+ /**
3377
+ * Identifies a user with the analytics provider.
3378
+ * This method sends an identify event to the provider, which can be used to associate user data with events.
3379
+ * @param event The identify event containing user data to send to the provider.
3380
+ */
2841
3381
  async identify(event) {
2842
3382
  if (!this.#provider) return;
2843
3383
  try {
@@ -2847,6 +3387,12 @@ var AnalyticsEngine = class {
2847
3387
  Logger.error(`Error identifying with provider ${this.#provider.name}`, error);
2848
3388
  }
2849
3389
  }
3390
+ /**
3391
+ * Tracks an analytics event with the registered provider.
3392
+ * This method sends the event to the provider, which can then process it as needed.
3393
+ * If the `doNotTrack` setting is enabled or if the filter function returns `false`, the event will not be tracked.
3394
+ * @param event The analytics event to track.
3395
+ */
2850
3396
  async track(event) {
2851
3397
  if (!this.#provider) return;
2852
3398
  try {
@@ -2900,30 +3446,77 @@ function onBootstrap(fn) {
2900
3446
  function onApplicationBootstrap(fn) {
2901
3447
  onApplicationBootstrapHooks.add(fn);
2902
3448
  }
3449
+ /**
3450
+ * The commandkit class that serves as the main entry point for the CommandKit framework.
3451
+ */
2903
3452
  var CommandKit = class CommandKit extends node_events.default {
2904
3453
  #started = false;
2905
3454
  #clientProxy = createProxy({});
2906
3455
  #client;
3456
+ /**
3457
+ * The event interceptor to quickly register temporary event listeners
3458
+ */
2907
3459
  eventInterceptor;
3460
+ /**
3461
+ * The static createElement function to create jsx elements
3462
+ */
2908
3463
  static createElement = require_element.createElement;
3464
+ /**
3465
+ * The static Fragment component to create jsx fragments
3466
+ */
2909
3467
  static Fragment = require_element.Fragment;
3468
+ /**
3469
+ * The configuration for the CommandKit instance.
3470
+ */
2910
3471
  config = {
2911
3472
  defaultLocale: discord_js.Locale.EnglishUS,
2912
3473
  getMessageCommandPrefix: () => "!"
2913
3474
  };
3475
+ /**
3476
+ * A key-value store for storing arbitrary data.
3477
+ */
2914
3478
  store = /* @__PURE__ */ new Map();
3479
+ /**
3480
+ * A flag store for storing flags that can be used to enable or disable features.
3481
+ */
2915
3482
  flags = new require_store.FlagStore();
3483
+ /**
3484
+ * The command router for the CommandKit instance.
3485
+ */
2916
3486
  commandsRouter;
3487
+ /**
3488
+ * The events router for the CommandKit instance.
3489
+ */
2917
3490
  eventsRouter;
3491
+ /**
3492
+ * The command handler for the CommandKit instance.
3493
+ * This is responsible for handling commands and their execution.
3494
+ */
2918
3495
  commandHandler;
3496
+ /**
3497
+ * The event handler for the CommandKit instance.
3498
+ * This is responsible for handling events and their execution.
3499
+ */
2919
3500
  eventHandler;
3501
+ /**
3502
+ * The plugins runtime for the CommandKit instance.
3503
+ */
2920
3504
  plugins;
3505
+ /**
3506
+ * The events channel for the CommandKit instance. This can be used to emit custom events.
3507
+ */
2921
3508
  events;
3509
+ /**
3510
+ * The analytics engine for the CommandKit instance.
3511
+ * This is responsible for tracking events and user interactions.
3512
+ */
2922
3513
  analytics;
3514
+ /**
3515
+ * The static instance of CommandKit.
3516
+ */
2923
3517
  static instance = void 0;
2924
3518
  /**
2925
3519
  * Create a new command and event handler with CommandKit.
2926
- *
2927
3520
  * @param options - The default CommandKit configuration.
2928
3521
  * @see {@link https://commandkit.js.org/docs/guide/commandkit-setup}
2929
3522
  */
@@ -3108,6 +3701,11 @@ var CommandKit = class CommandKit extends node_events.default {
3108
3701
  getAppDirectory() {
3109
3702
  return findAppDirectory();
3110
3703
  }
3704
+ /**
3705
+ * Get the path to the commands or events directory.
3706
+ * @param to The type of path to get, either 'commands' or 'events'.
3707
+ * @returns The path to the commands or events directory
3708
+ */
3111
3709
  getPath(to) {
3112
3710
  const appDir$1 = this.getAppDirectory();
3113
3711
  if (!appDir$1) return null;
@@ -3118,6 +3716,9 @@ var CommandKit = class CommandKit extends node_events.default {
3118
3716
  }
3119
3717
  }
3120
3718
  };
3719
+ /**
3720
+ * The singleton instance of CommandKit.
3721
+ */
3121
3722
  const commandkit = CommandKit.instance || new CommandKit();
3122
3723
 
3123
3724
  //#endregion
@@ -3511,4 +4112,4 @@ Object.defineProperty(exports, 'useEnvironment', {
3511
4112
  return useEnvironment;
3512
4113
  }
3513
4114
  });
3514
- //# sourceMappingURL=CommandKit-CnLBu_7m.js.map
4115
+ //# sourceMappingURL=CommandKit-C0W3U6jh.js.map