commandkit 1.2.0-rc.11 → 1.2.0-rc.13

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 (411) hide show
  1. package/{COPYING.md → LICENSE.md} +3 -3
  2. package/README.md +3 -3
  3. package/bin/index.mjs +1 -1
  4. package/cli.d.ts +19 -0
  5. package/config.cjs +3 -0
  6. package/config.d.ts +1 -0
  7. package/dist/{ActionRow-DKnFVDME.d.ts → ActionRow-B-CGmjDp.d.ts} +4 -5
  8. package/dist/{ActionRow-CbdGFWMT.js → ActionRow-CSN_UKmM.js} +3 -4
  9. package/dist/ActionRow-CSN_UKmM.js.map +1 -0
  10. package/dist/{Button-4ZUXdA56.d.ts → Button-C-GPeFA3.d.ts} +7 -8
  11. package/dist/{ButtonKit-C7r7RPNf.d.ts → ButtonKit-DKu0VAe4.d.ts} +37 -38
  12. package/dist/ChannelSelectMenuKit-HQZ4hH5s.d.ts +66 -0
  13. package/dist/{CommandKitEventsChannel-BtRzr3Tz.js → CommandKitEventsChannel-CnT5ymYe.js} +2 -2
  14. package/dist/{CommandKitEventsChannel-BtRzr3Tz.js.map → CommandKitEventsChannel-CnT5ymYe.js.map} +1 -1
  15. package/dist/{CommandsRouter-CoOA7hkf.d.ts → CommandsRouter-C7dZEepB.d.ts} +49 -50
  16. package/dist/{CommandsRouter-Dmzw-ikm.js → CommandsRouter-C_HLsrGX.js} +2 -6
  17. package/dist/{CommandsRouter-Dmzw-ikm.js.map → CommandsRouter-C_HLsrGX.js.map} +1 -1
  18. package/dist/{CompilerPlugin-M8r3yNAl.js → CompilerPlugin-CUsGAfgl.js} +2 -2
  19. package/dist/{CompilerPlugin-M8r3yNAl.js.map → CompilerPlugin-CUsGAfgl.js.map} +1 -1
  20. package/dist/{EventInterceptor-CQEXyUTp.js → EventInterceptor-BWoEJMHZ.js} +1 -1
  21. package/dist/{EventInterceptor-CQEXyUTp.js.map → EventInterceptor-BWoEJMHZ.js.map} +1 -1
  22. package/dist/{EventInterceptor-x-R2qshQ.d.ts → EventInterceptor-CZmWpS08.d.ts} +40 -40
  23. package/dist/{EventWorkerContext-Dq29tieI.js → EventWorkerContext-Dfhgv329.js} +2 -3
  24. package/dist/EventWorkerContext-Dfhgv329.js.map +1 -0
  25. package/dist/EventsRouter-DZ37r54v.d.ts +90 -0
  26. package/dist/{EventsRouter-3Gygh-km.js → EventsRouter-DZYIha6m.js} +2 -6
  27. package/dist/{EventsRouter-3Gygh-km.js.map → EventsRouter-DZYIha6m.js.map} +1 -1
  28. package/dist/MentionableSelectMenuKit-7URDUM3-.d.ts +61 -0
  29. package/dist/{MessageCommandParser-Dl0xxtdr.js → MessageCommandParser-Bs9fimmd.js} +53 -55
  30. package/dist/{MessageCommandParser-Dl0xxtdr.js.map → MessageCommandParser-Bs9fimmd.js.map} +1 -1
  31. package/dist/MessageCommandParser-q3dQcE5N.d.ts +194 -0
  32. package/dist/{Modal-C6UTRdYQ.d.ts → Modal-CZT9MZsy.d.ts} +25 -12
  33. package/dist/{ModalKit-Btz58KYn.d.ts → ModalKit-BWXI3Z26.d.ts} +34 -35
  34. package/dist/{PluginCommon-Cvl5yYM_.js → PluginCommon-BLxWww5u.js} +6 -7
  35. package/dist/{PluginCommon-Cvl5yYM_.js.map → PluginCommon-BLxWww5u.js.map} +1 -1
  36. package/dist/RoleSelectMenuKit-BY-JJ18w.d.ts +66 -0
  37. package/dist/{RuntimePlugin-BUecuBIU.js → RuntimePlugin-CtobluSU.js} +2 -2
  38. package/dist/{RuntimePlugin-BUecuBIU.js.map → RuntimePlugin-CtobluSU.js.map} +1 -1
  39. package/dist/{SelectMenu-Diy87_ba.d.ts → SelectMenu-q_b3Mjv9.d.ts} +10 -11
  40. package/dist/StringSelectMenuKit-lVhUMc3g.d.ts +66 -0
  41. package/dist/UserSelectMenuKit-CCj4Fpkr.d.ts +66 -0
  42. package/dist/analytics/analytics-engine.d.ts +1 -31
  43. package/dist/analytics/analytics-engine.js +24 -36
  44. package/dist/analytics/analytics-provider.d.ts +1 -31
  45. package/dist/analytics/constants.js +1 -1
  46. package/dist/analytics/utils.js +24 -36
  47. package/dist/{analytics-engine-AaAl3kQM.d.ts → analytics-engine-WQhXmx3H.d.ts} +855 -830
  48. package/dist/app/commands/AppCommandRunner.d.ts +1 -31
  49. package/dist/app/commands/AppCommandRunner.js +24 -36
  50. package/dist/app/commands/Context.d.ts +1 -31
  51. package/dist/app/commands/Context.js +24 -36
  52. package/dist/app/commands/MessageCommandParser.d.ts +1 -1
  53. package/dist/app/commands/MessageCommandParser.js +1 -2
  54. package/dist/app/commands/helpers.d.ts +1 -1
  55. package/dist/app/commands/helpers.js +1 -1
  56. package/dist/app/events/EventWorkerContext.d.ts +42 -33
  57. package/dist/app/events/EventWorkerContext.js +1 -1
  58. package/dist/app/handlers/AppCommandHandler.d.ts +1 -31
  59. package/dist/app/handlers/AppCommandHandler.js +24 -36
  60. package/dist/app/handlers/AppEventsHandler.d.ts +1 -31
  61. package/dist/app/handlers/AppEventsHandler.js +24 -36
  62. package/dist/app/index.d.ts +4 -31
  63. package/dist/app/index.js +24 -37
  64. package/dist/app/interrupt/signals.d.ts +1 -1
  65. package/dist/app/interrupt/signals.js +2 -3
  66. package/dist/app/middlewares/permissions.d.ts +1 -31
  67. package/dist/app/middlewares/permissions.js +24 -36
  68. package/dist/app/register/CommandRegistrar.d.ts +1 -31
  69. package/dist/app/register/CommandRegistrar.js +24 -36
  70. package/dist/app/router/CommandsRouter.d.ts +1 -1
  71. package/dist/app/router/CommandsRouter.js +1 -1
  72. package/dist/app/router/EventsRouter.d.ts +1 -1
  73. package/dist/app/router/EventsRouter.js +1 -1
  74. package/dist/app/router/index.d.ts +2 -3
  75. package/dist/app/router/index.js +3 -3
  76. package/dist/{chunk-nOFOJqeH.js → chunk-kSYXY2_d.js} +10 -6
  77. package/dist/cli/app-process.d.ts +0 -1
  78. package/dist/cli/app-process.js +62 -7
  79. package/dist/cli/app-process.js.map +1 -0
  80. package/dist/cli/build.d.ts +2 -31
  81. package/dist/cli/build.js +191 -41
  82. package/dist/cli/build.js.map +1 -0
  83. package/dist/cli/common.d.ts +1 -31
  84. package/dist/cli/common.js +4 -4
  85. package/dist/cli/development.d.ts +18 -1
  86. package/dist/cli/development.js +43 -48
  87. package/dist/cli/development.js.map +1 -1
  88. package/dist/cli/env.d.ts +4 -0
  89. package/dist/cli/env.js +1 -1
  90. package/dist/cli/generators.js +5 -8
  91. package/dist/cli/generators.js.map +1 -1
  92. package/dist/cli/information.js +5 -5
  93. package/dist/cli/information.js.map +1 -1
  94. package/dist/cli/init.d.ts +12 -2
  95. package/dist/cli/init.js +102 -38
  96. package/dist/cli/init.js.map +1 -0
  97. package/dist/cli/production.d.ts +0 -1
  98. package/dist/cli/production.js +38 -49
  99. package/dist/cli/production.js.map +1 -1
  100. package/dist/cli/type-checker.js +5 -5
  101. package/dist/cli/utils.d.ts +0 -1
  102. package/dist/cli/utils.js +17 -2
  103. package/dist/cli/utils.js.map +1 -0
  104. package/dist/{colors-DL3ucTiT.js → colors-Csc0X4QJ.js} +2 -3
  105. package/dist/{colors-DL3ucTiT.js.map → colors-Csc0X4QJ.js.map} +1 -1
  106. package/dist/{commandkit-ZoBBh0Q_.js → commandkit-SIjTLD2R.js} +229 -88
  107. package/dist/commandkit-SIjTLD2R.js.map +1 -0
  108. package/dist/commandkit.d.ts +1 -31
  109. package/dist/commandkit.js +24 -36
  110. package/dist/{common-vnMIelAE.js → common-CEordwf3.js} +3 -3
  111. package/dist/common-CEordwf3.js.map +1 -0
  112. package/dist/{common-CrqwC-sx.js → common-DSRs_mfw.js} +10 -14
  113. package/dist/{common-CrqwC-sx.js.map → common-DSRs_mfw.js.map} +1 -1
  114. package/dist/{common-DOCvOVC4.d.ts → common-DnwCYit8.d.ts} +4 -5
  115. package/dist/components/common/EventInterceptor.d.ts +1 -1
  116. package/dist/components/common/EventInterceptor.js +1 -1
  117. package/dist/components/common/element.d.ts +1 -4
  118. package/dist/components/common/element.js +1 -1
  119. package/dist/components/common/types.d.ts +1 -1
  120. package/dist/components/common/types.js +0 -1
  121. package/dist/components/{v2 → display}/common.d.ts +1 -2
  122. package/dist/components/display/common.js +3 -0
  123. package/dist/components/display/container.d.ts +2 -0
  124. package/dist/components/display/container.js +3 -0
  125. package/dist/components/display/file.d.ts +2 -0
  126. package/dist/components/display/file.js +3 -0
  127. package/dist/components/display/index.d.ts +9 -0
  128. package/dist/components/display/index.js +22 -0
  129. package/dist/components/display/label.d.ts +2 -0
  130. package/dist/components/display/label.js +3 -0
  131. package/dist/components/display/media-gallery.d.ts +2 -0
  132. package/dist/components/{v2 → display}/media-gallery.js +1 -2
  133. package/dist/components/display/poll.d.ts +2 -0
  134. package/dist/components/display/poll.js +5 -0
  135. package/dist/components/display/section.d.ts +2 -0
  136. package/dist/components/display/section.js +4 -0
  137. package/dist/components/display/separator.d.ts +2 -0
  138. package/dist/components/display/separator.js +3 -0
  139. package/dist/components/display/text-display.d.ts +2 -0
  140. package/dist/components/display/text-display.js +3 -0
  141. package/dist/components/index.d.ts +23 -24
  142. package/dist/components/index.js +30 -37
  143. package/dist/components/interactive/action-row/ActionRow.d.ts +2 -0
  144. package/dist/components/interactive/action-row/ActionRow.js +3 -0
  145. package/dist/components/interactive/button/Button.d.ts +2 -0
  146. package/dist/components/interactive/button/Button.js +26 -0
  147. package/dist/components/interactive/button/ButtonKit.d.ts +2 -0
  148. package/dist/components/interactive/button/ButtonKit.js +26 -0
  149. package/dist/components/interactive/modal/Modal.d.ts +2 -0
  150. package/dist/components/interactive/modal/Modal.js +30 -0
  151. package/dist/components/interactive/modal/ModalKit.d.ts +2 -0
  152. package/dist/components/interactive/modal/ModalKit.js +26 -0
  153. package/dist/components/interactive/select-menu/ChannelSelectMenuKit.d.ts +2 -0
  154. package/dist/components/interactive/select-menu/ChannelSelectMenuKit.js +26 -0
  155. package/dist/components/interactive/select-menu/MentionableSelectMenuKit.d.ts +2 -0
  156. package/dist/components/interactive/select-menu/MentionableSelectMenuKit.js +26 -0
  157. package/dist/components/interactive/select-menu/RoleSelectMenuKit.d.ts +2 -0
  158. package/dist/components/interactive/select-menu/RoleSelectMenuKit.js +26 -0
  159. package/dist/components/interactive/select-menu/SelectMenu.d.ts +2 -0
  160. package/dist/components/interactive/select-menu/SelectMenu.js +31 -0
  161. package/dist/components/interactive/select-menu/StringSelectMenuKit.d.ts +2 -0
  162. package/dist/components/interactive/select-menu/StringSelectMenuKit.js +26 -0
  163. package/dist/components/interactive/select-menu/UserSelectMenuKit.d.ts +2 -0
  164. package/dist/components/interactive/select-menu/UserSelectMenuKit.js +26 -0
  165. package/dist/components/interactive/select-menu/common.d.ts +2 -0
  166. package/dist/config/config.d.ts +15 -33
  167. package/dist/config/config.js +24 -36
  168. package/dist/config/default.d.ts +1 -31
  169. package/dist/config/default.js +24 -36
  170. package/dist/config/loader.d.ts +1 -31
  171. package/dist/config/loader.js +24 -36
  172. package/dist/config/types.d.ts +1 -31
  173. package/dist/config/utils.d.ts +1 -31
  174. package/dist/config/utils.js +1 -1
  175. package/dist/constants-BFFK-hfP.js +27 -0
  176. package/dist/{constants-4oxxvaJA.js.map → constants-BFFK-hfP.js.map} +1 -1
  177. package/dist/{constants-MKu-Q1jh.d.ts → constants-CuYW0K10.d.ts} +14 -8
  178. package/dist/{constants-BOOGN85p.js → constants-Cw8VjCVz.js} +2 -3
  179. package/dist/{constants-BOOGN85p.js.map → constants-Cw8VjCVz.js.map} +1 -1
  180. package/dist/{constants-B5_Ta7PR.js → constants-CxkFFZ7p.js} +16 -1
  181. package/dist/constants-CxkFFZ7p.js.map +1 -0
  182. package/dist/{constants-D8PMA9on.d.ts → constants-EpKcj0dH.d.ts} +2 -2
  183. package/dist/{container-C6GtfAPW.js → container-DCPljKVH.js} +4 -5
  184. package/dist/container-DCPljKVH.js.map +1 -0
  185. package/dist/{container-DHBELeJ3.d.ts → container-DYcb7zGw.d.ts} +3 -4
  186. package/dist/context/async-context.d.ts +1 -31
  187. package/dist/context/async-context.js +24 -36
  188. package/dist/context/environment.d.ts +1 -31
  189. package/dist/context/environment.js +24 -36
  190. package/dist/{element-Bak9llw_.js → element-DibzzA5L.js} +1 -1
  191. package/dist/element-DibzzA5L.js.map +1 -0
  192. package/dist/{element-CAXu1XtK.d.ts → element-wQo0heGj.d.ts} +4 -5
  193. package/dist/{env-_68PRRoA.js → env-CmspDhHy.js} +7 -3
  194. package/dist/env-CmspDhHy.js.map +1 -0
  195. package/dist/error-codes-Ds0bnPvT.js.map +1 -1
  196. package/dist/events/CommandKitEventsChannel.d.ts +1 -31
  197. package/dist/events/CommandKitEventsChannel.js +1 -1
  198. package/dist/{file-DVOELoNv.js → file-Ca1kpEtE.js} +3 -4
  199. package/dist/file-Ca1kpEtE.js.map +1 -0
  200. package/dist/{file-DTrr-p09.d.ts → file-CrV4lSnl.d.ts} +3 -4
  201. package/dist/flags/FlagProvider.d.ts +1 -31
  202. package/dist/flags/feature-flags.d.ts +1 -31
  203. package/dist/flags/feature-flags.js +165 -40
  204. package/dist/flags/feature-flags.js.map +1 -0
  205. package/dist/flags/store.d.ts +1 -31
  206. package/dist/flags/store.js +1 -1
  207. package/dist/{helpers-Wg6P5fRQ.d.ts → helpers-AQPLVY35.d.ts} +2 -3
  208. package/dist/{helpers-Dl8wW6aO.js → helpers-Btx1FSZx.js} +2 -3
  209. package/dist/{helpers-Dl8wW6aO.js.map → helpers-Btx1FSZx.js.map} +1 -1
  210. package/dist/index.d.ts +41 -42
  211. package/dist/index.js +47 -46
  212. package/dist/index.js.map +1 -1
  213. package/dist/kv/constants.d.ts +1 -1
  214. package/dist/kv/constants.js +1 -1
  215. package/dist/kv/dotprops.js +25 -3
  216. package/dist/kv/dotprops.js.map +1 -0
  217. package/dist/kv/kv.d.ts +289 -290
  218. package/dist/kv/kv.js +14 -18
  219. package/dist/kv/kv.js.map +1 -1
  220. package/dist/kv/serde.d.ts +12 -3
  221. package/dist/kv/serde.js +86 -4
  222. package/dist/kv/serde.js.map +1 -0
  223. package/dist/label-37kaNWMH.d.ts +28 -0
  224. package/dist/label-B6vXvwLM.js +35 -0
  225. package/dist/label-B6vXvwLM.js.map +1 -0
  226. package/dist/logger/DefaultLogger.d.ts +66 -3
  227. package/dist/logger/DefaultLogger.js +24 -36
  228. package/dist/logger/ILogger.d.ts +64 -2
  229. package/dist/logger/ILogger.js +0 -1
  230. package/dist/logger/Logger.d.ts +36 -3
  231. package/dist/logger/Logger.js +24 -36
  232. package/dist/logger/NoopLogger.d.ts +36 -37
  233. package/dist/{media-gallery-BMsXSot3.d.ts → media-gallery-Ci3I4ElH.d.ts} +3 -4
  234. package/dist/{media-gallery-zDtJ3kxb.js → media-gallery-u3gjX7yD.js} +4 -5
  235. package/dist/media-gallery-u3gjX7yD.js.map +1 -0
  236. package/dist/plugins/CompilerPlugin.d.ts +1 -31
  237. package/dist/plugins/CompilerPlugin.js +1 -2
  238. package/dist/plugins/PluginCommon.d.ts +1 -31
  239. package/dist/plugins/PluginCommon.js +1 -1
  240. package/dist/plugins/RuntimePlugin.d.ts +1 -31
  241. package/dist/plugins/RuntimePlugin.js +1 -2
  242. package/dist/plugins/index.d.ts +1 -31
  243. package/dist/plugins/index.js +26 -36
  244. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -31
  245. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +24 -36
  246. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -31
  247. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +24 -36
  248. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -31
  249. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +24 -36
  250. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -31
  251. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +24 -36
  252. package/dist/plugins/plugin-runtime/runtime.d.ts +1 -31
  253. package/dist/plugins/plugin-runtime/runtime.js +0 -1
  254. package/dist/plugins/types.d.ts +1 -31
  255. package/dist/plugins/types.js +0 -1
  256. package/dist/poll-CFe8yvoJ.js +100 -0
  257. package/dist/poll-CFe8yvoJ.js.map +1 -0
  258. package/dist/poll-Ddtapd6n.d.ts +88 -0
  259. package/dist/{resolve-file-url-ChIyw-Vf.js → resolve-file-url-CdHqwWs3.js} +2 -2
  260. package/dist/{resolve-file-url-ChIyw-Vf.js.map → resolve-file-url-CdHqwWs3.js.map} +1 -1
  261. package/dist/{section-DlvrDoJK.js → section-BC8LF-B2.js} +4 -5
  262. package/dist/section-BC8LF-B2.js.map +1 -0
  263. package/dist/{section-Dh_FhPeC.d.ts → section-DkUKULnB.d.ts} +3 -4
  264. package/dist/{separator-DL6QH5H1.js → separator-BUTiW7uz.js} +3 -4
  265. package/dist/separator-BUTiW7uz.js.map +1 -0
  266. package/dist/{separator-CMf6Cyy5.d.ts → separator-CbXsIFCa.d.ts} +3 -4
  267. package/dist/{signals-ChFMD7mB.js → signals-B8z1wJ6W.js} +2 -2
  268. package/dist/{signals-ChFMD7mB.js.map → signals-B8z1wJ6W.js.map} +1 -1
  269. package/dist/{signals-SHg7J1U_.d.ts → signals-BbTgTc0i.d.ts} +2 -2
  270. package/dist/{store-CM6pWVZh.js → store-D8r_hryO.js} +2 -3
  271. package/dist/{store-CM6pWVZh.js.map → store-D8r_hryO.js.map} +1 -1
  272. package/dist/{text-display-DRw3r_lK.d.ts → text-display-D7j39VC-.d.ts} +3 -4
  273. package/dist/{text-display-DbMumig_.js → text-display-DANahMN3.js} +3 -4
  274. package/dist/text-display-DANahMN3.js.map +1 -0
  275. package/dist/{type-checker-ocNSZh0W.js → type-checker-cVd3Hpnh.js} +4 -6
  276. package/dist/{type-checker-ocNSZh0W.js.map → type-checker-cVd3Hpnh.js.map} +1 -1
  277. package/dist/{types-CJ-XvOFN.d.ts → types-BywA9d2Z.d.ts} +2 -2
  278. package/dist/{types-package-BWArjyBF.js → types-package-CsTNfvv2.js} +4 -8
  279. package/dist/{types-package-BWArjyBF.js.map → types-package-CsTNfvv2.js.map} +1 -1
  280. package/dist/types.d.ts +1 -31
  281. package/dist/utils/colors.js +1 -1
  282. package/dist/utils/constants.d.ts +2 -2
  283. package/dist/utils/constants.js +3 -2
  284. package/dist/utils/dev-hooks.d.ts +1 -31
  285. package/dist/utils/dev-hooks.js +24 -36
  286. package/dist/utils/error-codes.d.ts +54 -2
  287. package/dist/utils/resolve-file-url.d.ts +11 -2
  288. package/dist/utils/resolve-file-url.js +1 -1
  289. package/dist/utils/types-package.js +2 -2
  290. package/dist/utils/useful-stuff/async-queue.d.ts +21 -21
  291. package/dist/utils/useful-stuff/async-queue.js +1 -2
  292. package/dist/utils/useful-stuff/async-queue.js.map +1 -1
  293. package/dist/utils/useful-stuff/mutex.d.ts +62 -62
  294. package/dist/utils/useful-stuff/ratelimiter.d.ts +56 -56
  295. package/dist/utils/useful-stuff/ratelimiter.js +1 -2
  296. package/dist/utils/useful-stuff/ratelimiter.js.map +1 -1
  297. package/dist/utils/useful-stuff/semaphore.d.ts +82 -82
  298. package/dist/utils/useful-stuff/semaphore.js +1 -3
  299. package/dist/utils/useful-stuff/semaphore.js.map +1 -1
  300. package/dist/utils/utilities.d.ts +113 -2
  301. package/dist/utils/utilities.js +27 -37
  302. package/dist/utils/{warn-unstable.d.ts → warning.d.ts} +12 -3
  303. package/dist/utils/warning.js +5 -0
  304. package/dist/{utils-KsNof0Xz.js → utils-Br3eenD1.js} +1 -1
  305. package/dist/{utils-KsNof0Xz.js.map → utils-Br3eenD1.js.map} +1 -1
  306. package/dist/version.d.ts +8 -2
  307. package/dist/version.js +12 -2
  308. package/dist/version.js.map +1 -0
  309. package/dist/warning-CszH8HeS.js +53 -0
  310. package/dist/warning-CszH8HeS.js.map +1 -0
  311. package/hooks.cjs +11 -4
  312. package/package.json +14 -7
  313. package/dist/ActionRow-CbdGFWMT.js.map +0 -1
  314. package/dist/ChannelSelectMenuKit-BrXvBYNH.d.ts +0 -67
  315. package/dist/DefaultLogger-XCOl5nLd.d.ts +0 -67
  316. package/dist/EventWorkerContext-Dq29tieI.js.map +0 -1
  317. package/dist/EventWorkerContext-XNgriym3.d.ts +0 -43
  318. package/dist/EventsRouter-BacqK6z3.d.ts +0 -90
  319. package/dist/ILogger-BW8GM-YZ.d.ts +0 -64
  320. package/dist/Logger-DyfkPk7u.d.ts +0 -37
  321. package/dist/MentionableSelectMenuKit-CPTKqx-O.d.ts +0 -62
  322. package/dist/MessageCommandParser-BsGMOTDo.d.ts +0 -195
  323. package/dist/RoleSelectMenuKit-C26lU3sN.d.ts +0 -67
  324. package/dist/StringSelectMenuKit-Bhs8U6WI.d.ts +0 -67
  325. package/dist/UserSelectMenuKit-CfqFJdxz.d.ts +0 -67
  326. package/dist/app-process-cj2vF12T.js +0 -68
  327. package/dist/app-process-cj2vF12T.js.map +0 -1
  328. package/dist/build-B5qTswWF.js +0 -174
  329. package/dist/build-B5qTswWF.js.map +0 -1
  330. package/dist/commandkit-ZoBBh0Q_.js.map +0 -1
  331. package/dist/common-vnMIelAE.js.map +0 -1
  332. package/dist/components/v1/action-row/ActionRow.d.ts +0 -6
  333. package/dist/components/v1/action-row/ActionRow.js +0 -3
  334. package/dist/components/v1/button/Button.d.ts +0 -7
  335. package/dist/components/v1/button/Button.js +0 -38
  336. package/dist/components/v1/button/ButtonKit.d.ts +0 -3
  337. package/dist/components/v1/button/ButtonKit.js +0 -38
  338. package/dist/components/v1/modal/Modal.d.ts +0 -7
  339. package/dist/components/v1/modal/Modal.js +0 -41
  340. package/dist/components/v1/modal/ModalKit.d.ts +0 -3
  341. package/dist/components/v1/modal/ModalKit.js +0 -38
  342. package/dist/components/v1/select-menu/ChannelSelectMenuKit.d.ts +0 -4
  343. package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +0 -38
  344. package/dist/components/v1/select-menu/MentionableSelectMenuKit.d.ts +0 -4
  345. package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +0 -38
  346. package/dist/components/v1/select-menu/RoleSelectMenuKit.d.ts +0 -4
  347. package/dist/components/v1/select-menu/RoleSelectMenuKit.js +0 -38
  348. package/dist/components/v1/select-menu/SelectMenu.d.ts +0 -10
  349. package/dist/components/v1/select-menu/SelectMenu.js +0 -43
  350. package/dist/components/v1/select-menu/StringSelectMenuKit.d.ts +0 -4
  351. package/dist/components/v1/select-menu/StringSelectMenuKit.js +0 -38
  352. package/dist/components/v1/select-menu/UserSelectMenuKit.d.ts +0 -4
  353. package/dist/components/v1/select-menu/UserSelectMenuKit.js +0 -38
  354. package/dist/components/v1/select-menu/common.d.ts +0 -3
  355. package/dist/components/v1/select-menu/common.js +0 -1
  356. package/dist/components/v2/common.js +0 -3
  357. package/dist/components/v2/container.d.ts +0 -2
  358. package/dist/components/v2/container.js +0 -4
  359. package/dist/components/v2/file.d.ts +0 -2
  360. package/dist/components/v2/file.js +0 -3
  361. package/dist/components/v2/index.d.ts +0 -8
  362. package/dist/components/v2/index.js +0 -17
  363. package/dist/components/v2/media-gallery.d.ts +0 -2
  364. package/dist/components/v2/section.d.ts +0 -2
  365. package/dist/components/v2/section.js +0 -5
  366. package/dist/components/v2/separator.d.ts +0 -2
  367. package/dist/components/v2/separator.js +0 -3
  368. package/dist/components/v2/text-display.d.ts +0 -2
  369. package/dist/components/v2/text-display.js +0 -3
  370. package/dist/config-D-JMp2IO.d.ts +0 -16
  371. package/dist/constants-4oxxvaJA.js +0 -27
  372. package/dist/constants-B5_Ta7PR.js.map +0 -1
  373. package/dist/container-C6GtfAPW.js.map +0 -1
  374. package/dist/dotprops-tnhpnszJ.js +0 -36
  375. package/dist/dotprops-tnhpnszJ.js.map +0 -1
  376. package/dist/element-Bak9llw_.js.map +0 -1
  377. package/dist/env-_68PRRoA.js.map +0 -1
  378. package/dist/error-codes-B4TyW4Ct.d.ts +0 -54
  379. package/dist/feature-flags-CKNrjgqg.js +0 -160
  380. package/dist/feature-flags-CKNrjgqg.js.map +0 -1
  381. package/dist/file-DVOELoNv.js.map +0 -1
  382. package/dist/init-DOr-Y3GQ.d.ts +0 -13
  383. package/dist/init-_7_QDifv.js +0 -95
  384. package/dist/init-_7_QDifv.js.map +0 -1
  385. package/dist/media-gallery-zDtJ3kxb.js.map +0 -1
  386. package/dist/resolve-file-url-yO8bUxok.d.ts +0 -11
  387. package/dist/section-DlvrDoJK.js.map +0 -1
  388. package/dist/separator-DL6QH5H1.js.map +0 -1
  389. package/dist/serde-BYaKrsOV.d.ts +0 -12
  390. package/dist/serde-Cc8iUa9J.js +0 -97
  391. package/dist/serde-Cc8iUa9J.js.map +0 -1
  392. package/dist/text-display-DbMumig_.js.map +0 -1
  393. package/dist/utilities-DtdPlr4c.d.ts +0 -87
  394. package/dist/utils/warn-unstable.js +0 -26
  395. package/dist/utils/warn-unstable.js.map +0 -1
  396. package/dist/utils-DCSnVAZ6.js +0 -23
  397. package/dist/utils-DCSnVAZ6.js.map +0 -1
  398. package/dist/v2-DofkPKHs.js +0 -0
  399. package/dist/version--Q1nmlBz.js +0 -18
  400. package/dist/version--Q1nmlBz.js.map +0 -1
  401. package/dist/version-CtJtBJXI.d.ts +0 -8
  402. /package/dist/{ILogger-dQ7Y9X1f.js → common-C2jAjX4U.js} +0 -0
  403. /package/dist/{app-HN1cVg8J.js → components/interactive/select-menu/common.js} +0 -0
  404. /package/dist/{common-CcfjYnPG.js → display-WDb9wMCv.js} +0 -0
  405. /package/dist/{index-CUPkUUOR.d.ts → index-BJfko-dP.d.ts} +0 -0
  406. /package/dist/{index-Dw5cCt-A.d.ts → index-CCggO_hw.d.ts} +0 -0
  407. /package/dist/{index-E7Wvm5uX.d.ts → index-CLjpoGi1.d.ts} +0 -0
  408. /package/dist/{router-Dn35v30f.js → router-BvamdzoF.js} +0 -0
  409. /package/dist/{runtime-DB9CiPfe.js → runtime-Skt5NiOc.js} +0 -0
  410. /package/dist/{types-CUZOquUl.js → types-Cdh4uaFR.js} +0 -0
  411. /package/dist/{types-q0Nm882H.js → types-TC4g3w91.js} +0 -0
@@ -639,8 +639,8 @@ attach them to the start of each source file to most effectively state
639
639
  the exclusion of warranty; and each file should have at least the
640
640
  "copyright" line and a pointer to where the full notice is found.
641
641
 
642
- <one line to give the program's name and a brief idea of what it does.>
643
- Copyright (C) <year> <name of author>
642
+ CommandKit is a discord.js metaframework
643
+ Copyright (C) 2026 Neplex
644
644
 
645
645
  This program is free software: you can redistribute it and/or modify
646
646
  it under the terms of the GNU General Public License as published by
@@ -661,7 +661,7 @@ mail.
661
661
  If the program does terminal interaction, make it output a short
662
662
  notice like this when it starts in an interactive mode:
663
663
 
664
- <program> Copyright (C) <year> <name of author>
664
+ CommandKit Copyright (C) 2026 Neplex
665
665
  This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
666
666
  This is free software, and you are welcome to redistribute it
667
667
  under certain conditions; type `show c' for details.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <div align="center">
2
- <img src="https://raw.githubusercontent.com/underctrl-io/commandkit/main/apps/website/static/img/ckit_logo.svg" width="75%" />
2
+ <img src="https://raw.githubusercontent.com/neplextech/commandkit/main/apps/website/static/img/ckit_logo.svg" width="75%" />
3
3
  <br />
4
- <a href="https://ctrl.lol/discord"><img src="https://img.shields.io/discord/1055188344188973066?color=5865F2&logo=discord&logoColor=white" alt="support server" /></a>
4
+ <a href="https://commandkit.dev/discord"><img src="https://img.shields.io/discord/1055188344188973066?color=5865F2&logo=discord&logoColor=white" alt="support server" /></a>
5
5
  <a href="https://www.npmjs.com/package/commandkit"><img src="https://img.shields.io/npm/v/commandkit?maxAge=3600" alt="npm version" /></a>
6
6
  <a href="https://www.npmjs.com/package/commandkit"><img src="https://img.shields.io/npm/dt/commandkit?maxAge=3600" alt="npm downloads" /></a>
7
7
  </div>
@@ -46,4 +46,4 @@ This will prompt you to enter few details about your project. Once you have ente
46
46
 
47
47
  ## Support and Suggestions
48
48
 
49
- Submit any queries or suggestions in our [Discord community](https://ctrl.lol/discord).
49
+ Submit any queries or suggestions in our [Discord community](https://commandkit.dev/discord).
package/bin/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { bootstrapCommandkitCLI } from '../dist/index.js';
3
+ import { bootstrapCommandkitCLI } from '../dist/cli/init.js';
4
4
 
5
5
  await bootstrapCommandkitCLI(process.argv);
package/cli.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import * as development from './dist/cli/development.js';
2
+ import * as production from './dist/cli/production.js';
3
+ import * as env from './dist/cli/env.js';
4
+ import * as cli from './dist/cli/init.js';
5
+ import * as compiler from './dist/cli/build.js';
6
+ import * as appProcess from './dist/cli/app-process.js';
7
+ import * as typeChecker from './dist/cli/type-checker.js';
8
+ import * as utilities from './dist/cli/common.js';
9
+
10
+ export {
11
+ development,
12
+ production,
13
+ env,
14
+ cli,
15
+ compiler,
16
+ appProcess,
17
+ typeChecker,
18
+ utilities,
19
+ };
package/config.cjs CHANGED
@@ -1,5 +1,8 @@
1
1
  const { defineConfig } = require('./dist/config/config.js');
2
+ const { buildOnly, noBuildOnly } = require('./dist/utils/utilities.js');
2
3
 
3
4
  module.exports = {
4
5
  defineConfig,
6
+ buildOnly,
7
+ noBuildOnly,
5
8
  };
package/config.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { defineConfig, CommandKitConfiguration as Config } from './dist/index';
2
+ export { buildOnly, noBuildOnly } from './dist/utils/utilities';
@@ -1,7 +1,6 @@
1
- import { AnyCommandKitElement, CommandKitElement } from "./element-CAXu1XtK.js";
2
-
3
- //#region src/components/v1/action-row/ActionRow.d.ts
1
+ import { n as CommandKitElement, t as AnyCommandKitElement } from "./element-wQo0heGj.js";
4
2
 
3
+ //#region src/components/interactive/action-row/ActionRow.d.ts
5
4
  /**
6
5
  * The properties for the action row component.
7
6
  */
@@ -16,5 +15,5 @@ interface ActionRowProps {
16
15
  */
17
16
  declare function ActionRow(props: ActionRowProps): CommandKitElement<'action-row'>;
18
17
  //#endregion
19
- export { ActionRow, ActionRowProps };
20
- //# sourceMappingURL=ActionRow-DKnFVDME.d.ts.map
18
+ export { ActionRowProps as n, ActionRow as t };
19
+ //# sourceMappingURL=ActionRow-B-CGmjDp.d.ts.map
@@ -1,8 +1,7 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
1
+ const require_chunk = require('./chunk-kSYXY2_d.js');
2
2
  let discord_js = require("discord.js");
3
- discord_js = require_chunk.__toESM(discord_js);
4
3
 
5
- //#region src/components/v1/action-row/ActionRow.ts
4
+ //#region src/components/interactive/action-row/ActionRow.ts
6
5
  /**
7
6
  * The action row component.
8
7
  * @param props The action row properties.
@@ -23,4 +22,4 @@ Object.defineProperty(exports, 'ActionRow', {
23
22
  return ActionRow;
24
23
  }
25
24
  });
26
- //# sourceMappingURL=ActionRow-CbdGFWMT.js.map
25
+ //# sourceMappingURL=ActionRow-CSN_UKmM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionRow-CSN_UKmM.js","names":[],"sources":["../src/components/interactive/action-row/ActionRow.ts"],"sourcesContent":["import { ActionRowBuilder } from 'discord.js';\nimport { AnyCommandKitElement, CommandKitElement } from '../../common/element';\n\n/**\n * The properties for the action row component.\n */\nexport interface ActionRowProps {\n children?: AnyCommandKitElement[] | AnyCommandKitElement;\n}\n\n/**\n * The action row component.\n * @param props The action row properties.\n * @returns The commandkit element.\n * @example <ActionRow><Button label=\"Click me\" style={ButtonStyle.Primary} customId=\"click_me\" /></ActionRow>\n */\nexport function ActionRow(\n props: ActionRowProps,\n): CommandKitElement<'action-row'> {\n const row = new ActionRowBuilder();\n\n if (Array.isArray(props.children)) {\n // @ts-ignore\n row.setComponents(...props.children);\n } else if (props.children) {\n // @ts-ignore\n row.setComponents(props.children);\n }\n\n return row;\n}\n"],"mappings":";;;;;;;;;;AAgBA,SAAgB,UAChB,OACkC;CAChC,MAAM,MAAM,IAAI,6BAAkB;AAElC,KAAI,MAAM,QAAQ,MAAM,SAAS,CAE/B,KAAI,cAAc,GAAG,MAAM,SAAS;UAC3B,MAAM,SAEf,KAAI,cAAc,MAAM,SAAS;AAGnC,QAAO"}
@@ -1,11 +1,10 @@
1
- import { EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
2
- import { CommandKitButtonBuilderInteractionCollectorDispatch, CommandKitButtonBuilderInteractionCollectorDispatchContextData, CommandKitButtonBuilderOnEnd } from "./ButtonKit-C7r7RPNf.js";
3
- import { CommandKitElement } from "./element-CAXu1XtK.js";
4
- import { MaybeArray } from "./types-CJ-XvOFN.js";
1
+ import { r as EventInterceptorErrorHandler } from "./EventInterceptor-CZmWpS08.js";
2
+ import { a as CommandKitButtonBuilderOnEnd, i as CommandKitButtonBuilderInteractionCollectorDispatchContextData, r as CommandKitButtonBuilderInteractionCollectorDispatch } from "./ButtonKit-DKu0VAe4.js";
3
+ import { n as CommandKitElement } from "./element-wQo0heGj.js";
4
+ import { t as MaybeArray } from "./types-BywA9d2Z.js";
5
5
  import { ButtonStyle, ComponentEmojiResolvable } from "discord.js";
6
6
 
7
- //#region src/components/v1/button/Button.d.ts
8
-
7
+ //#region src/components/interactive/button/Button.d.ts
9
8
  /**
10
9
  * The button children type.
11
10
  */
@@ -35,5 +34,5 @@ interface ButtonProps {
35
34
  */
36
35
  declare function Button(props: ButtonProps): CommandKitElement<'button-kit'>;
37
36
  //#endregion
38
- export { Button, ButtonChildrenLike, ButtonProps };
39
- //# sourceMappingURL=Button-4ZUXdA56.d.ts.map
37
+ export { ButtonChildrenLike as n, ButtonProps as r, Button as t };
38
+ //# sourceMappingURL=Button-C-GPeFA3.d.ts.map
@@ -1,8 +1,7 @@
1
- import { EventInterceptorContextData, EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
1
+ import { n as EventInterceptorContextData, r as EventInterceptorErrorHandler } from "./EventInterceptor-CZmWpS08.js";
2
2
  import { Awaitable, ButtonBuilder, ButtonInteraction, Events } from "discord.js";
3
3
 
4
- //#region src/components/v1/button/ButtonKit.d.ts
5
-
4
+ //#region src/components/interactive/button/ButtonKit.d.ts
6
5
  /**
7
6
  * The predicate function that filters button interactions.
8
7
  * It receives a ButtonInteraction and returns a boolean or a Promise that resolves to a boolean.
@@ -39,49 +38,49 @@ type CommandKitButtonBuilderInteractionCollectorDispatchContextData = EventInter
39
38
  declare class ButtonKit extends ButtonBuilder {
40
39
  #private;
41
40
  /**
42
- * Sets up an inline interaction collector for this button. This collector by default allows as many interactions as possible if it is actively used.
43
- * If unused, this expires after 24 hours or custom time if specified.
44
- * @param handler The handler to run when the button is clicked
45
- * @param data The context data to use for the interaction collector
46
- * @returns This button
47
- * @example
48
- * ```ts
49
- * const button = new ButtonKit()
50
- * .setLabel('Click me')
51
- * .setStyle(ButtonStyle.Primary)
52
- * .setCustomId('click_me')
53
- * .filter((interaction) => interaction.user.id === '1234567890')
54
- * .onClick(async (interaction) => {
55
- * await interaction.reply('You clicked me!');
56
- * });
57
- *
58
- * const row = new ActionRowBuilder().addComponents(button);
59
- *
60
- * const message = await channel.send({ content: 'Click the button', components: [row] });
61
- *
62
- * // Remove onClick handler and destroy the interaction collector
63
- * button.onClick(null);
64
- * ```
65
- */
41
+ * Sets up an inline interaction collector for this button. This collector by default allows as many interactions as possible if it is actively used.
42
+ * If unused, this expires after 24 hours or custom time if specified.
43
+ * @param handler The handler to run when the button is clicked
44
+ * @param data The context data to use for the interaction collector
45
+ * @returns This button
46
+ * @example
47
+ * ```ts
48
+ * const button = new ButtonKit()
49
+ * .setLabel('Click me')
50
+ * .setStyle(ButtonStyle.Primary)
51
+ * .setCustomId('click_me')
52
+ * .filter((interaction) => interaction.user.id === '1234567890')
53
+ * .onClick(async (interaction) => {
54
+ * await interaction.reply('You clicked me!');
55
+ * });
56
+ *
57
+ * const row = new ActionRowBuilder().addComponents(button);
58
+ *
59
+ * const message = await channel.send({ content: 'Click the button', components: [row] });
60
+ *
61
+ * // Remove onClick handler and destroy the interaction collector
62
+ * button.onClick(null);
63
+ * ```
64
+ */
66
65
  onClick(handler: CommandKitButtonBuilderInteractionCollectorDispatch, data?: CommandKitButtonBuilderInteractionCollectorDispatchContextData): this;
67
66
  onEnd(handler: CommandKitButtonBuilderOnEnd): this;
68
67
  /**
69
- * Sets the handler to run when the interaction collector ends.
70
- * @param handler - The handler to run when the interaction collector ends.
71
- * @returns This instance of the modal builder.
72
- */
68
+ * Sets the handler to run when the interaction collector ends.
69
+ * @param handler - The handler to run when the interaction collector ends.
70
+ * @returns This instance of the modal builder.
71
+ */
73
72
  onError(handler: EventInterceptorErrorHandler): this;
74
73
  /**
75
- * Sets a filter for the interaction collector.
76
- * @param predicate The filter to use for the interaction collector
77
- */
74
+ * Sets a filter for the interaction collector.
75
+ * @param predicate The filter to use for the interaction collector
76
+ */
78
77
  filter(predicate: ButtonKitPredicate): this;
79
78
  private get customId();
80
79
  /**
81
- * Disposes of the button collector and cleans up resources.
82
- */
80
+ * Disposes of the button collector and cleans up resources.
81
+ */
83
82
  dispose(): this;
84
83
  }
85
84
  //#endregion
86
- export { ButtonKit, ButtonKitPredicate, CommandKitButtonBuilderInteractionCollectorDispatch, CommandKitButtonBuilderInteractionCollectorDispatchContextData, CommandKitButtonBuilderOnEnd, OnButtonKitClick, OnButtonKitEnd };
87
- //# sourceMappingURL=ButtonKit-C7r7RPNf.d.ts.map
85
+ export { CommandKitButtonBuilderOnEnd as a, CommandKitButtonBuilderInteractionCollectorDispatchContextData as i, ButtonKitPredicate as n, OnButtonKitClick as o, CommandKitButtonBuilderInteractionCollectorDispatch as r, OnButtonKitEnd as s, ButtonKit as t };
86
+ //# sourceMappingURL=ButtonKit-DKu0VAe4.d.ts.map
@@ -0,0 +1,66 @@
1
+ import { r as EventInterceptorErrorHandler } from "./EventInterceptor-CZmWpS08.js";
2
+ import { a as OnSelectMenuKitSubmit, n as CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, o as SelectMenuKitPredicate, r as CommandKitSelectMenuBuilderOnEnd, t as CommandKitSelectMenuBuilderInteractionCollectorDispatch } from "./common-DnwCYit8.js";
3
+ import { ChannelSelectMenuBuilder, ChannelSelectMenuInteraction } from "discord.js";
4
+
5
+ //#region src/components/interactive/select-menu/ChannelSelectMenuKit.d.ts
6
+ /**
7
+ * Type for the handler function that is called when the channel select menu is submitted.
8
+ */
9
+ type OnChannelSelectMenuKitSubmit = OnSelectMenuKitSubmit<ChannelSelectMenuInteraction, ChannelSelectMenuKit>;
10
+ /**
11
+ * Type for the predicate function that filters channel select menu interactions.
12
+ * It receives a ChannelSelectMenuInteraction and returns a boolean or a Promise that resolves to a boolean.
13
+ */
14
+ type ChannelSelectMenuKitPredicate = SelectMenuKitPredicate<ChannelSelectMenuInteraction>;
15
+ /**
16
+ * A builder for creating channel select menus with additional features like interaction collectors and event handling.
17
+ * This class extends the ChannelSelectMenuBuilder from discord.js and adds methods for handling interactions.
18
+ * 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.
19
+ */
20
+ declare class ChannelSelectMenuKit extends ChannelSelectMenuBuilder {
21
+ #private;
22
+ /**
23
+ * Sets the handler to run when the modal is submitted.
24
+ * @param handler - The handler to run when the modal is submitted.
25
+ * @param data - The context data for the interaction collector.
26
+ * @returns This instance of the modal builder.
27
+ * @example
28
+ * ```ts
29
+ * const modal = new ChannelSelectMenuKit()
30
+ * .setTitle('My Modal')
31
+ * .setCustomId('my-modal')
32
+ * .filter((interaction) => interaction.Channel.id === '1234567890')
33
+ * .onSelect(async (interaction) => {
34
+ * await interaction.reply('You submitted the modal!');
35
+ * })
36
+ * .addComponents(actionRow1, actionRow2);
37
+ * ```
38
+ */
39
+ onSelect(handler: CommandKitSelectMenuBuilderInteractionCollectorDispatch<ChannelSelectMenuInteraction, ChannelSelectMenuKit>, data?: CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData): this;
40
+ /**
41
+ * Sets the handler to run when the interaction collector ends.
42
+ * @param handler - The handler to run when the interaction collector ends.
43
+ * @returns This instance of the modal builder.
44
+ */
45
+ onEnd(handler: CommandKitSelectMenuBuilderOnEnd): this;
46
+ /**
47
+ * Sets the handler to run when the interaction collector ends.
48
+ * @param handler - The handler to run when the interaction collector ends.
49
+ * @returns This instance of the modal builder.
50
+ */
51
+ onError(handler: EventInterceptorErrorHandler): this;
52
+ /**
53
+ * Sets a filter for the interaction collector.
54
+ * @param predicate - The filter to use for the interaction collector.
55
+ * @returns This instance of the modal builder.
56
+ */
57
+ filter(predicate: SelectMenuKitPredicate<ChannelSelectMenuInteraction>): this;
58
+ private get customId();
59
+ /**
60
+ * Cleans up the interaction collector and removes the handler.
61
+ */
62
+ dispose(): this;
63
+ }
64
+ //#endregion
65
+ export { ChannelSelectMenuKitPredicate as n, OnChannelSelectMenuKitSubmit as r, ChannelSelectMenuKit as t };
66
+ //# sourceMappingURL=ChannelSelectMenuKit-HQZ4hH5s.d.ts.map
@@ -1,4 +1,4 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
1
+ const require_chunk = require('./chunk-kSYXY2_d.js');
2
2
  let node_events = require("node:events");
3
3
  node_events = require_chunk.__toESM(node_events);
4
4
 
@@ -85,4 +85,4 @@ Object.defineProperty(exports, 'CommandKitEventsChannel', {
85
85
  return CommandKitEventsChannel;
86
86
  }
87
87
  });
88
- //# sourceMappingURL=CommandKitEventsChannel-BtRzr3Tz.js.map
88
+ //# sourceMappingURL=CommandKitEventsChannel-CnT5ymYe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommandKitEventsChannel-BtRzr3Tz.js","names":[],"sources":["../src/events/CommandKitEventsChannel.ts"],"sourcesContent":["import EventEmitter from 'node:events';\nimport type { CommandKit } from '../commandkit';\nimport type { AsyncFunction, GenericFunction } from '../context/async-context';\n\n/**\n * The function type for event listeners.\n */\nexport type ListenerFunction = GenericFunction | AsyncFunction;\n\n/**\n * Represents a channel for emitting and listening to events in CommandKit.\n * This class provides methods to manage event listeners and emit events\n * within a specific namespace.\n */\nexport class CommandKitEventsChannel {\n private emitter = new EventEmitter();\n\n /**\n * Creates a new instance of CommandKitEventsChannel.\n * @param commandkit The CommandKit instance that this channel belongs to.\n */\n public constructor(public readonly commandkit: CommandKit) {}\n\n /**\n * Creates a namespaced event channel. This allows you to manage events\n * within a specific namespace, preventing conflicts with other event channels.\n * This is useful for organizing events related to different parts of your application.\n * @param namespace The namespace for the event channel.\n * @returns An object containing methods for managing events within the namespace.\n * @example commandkit.events.to('customNamespace').emit('eventName', data);\n */\n public to(namespace: string) {\n return {\n on: this.on.bind(this, namespace),\n off: this.off.bind(this, namespace),\n once: this.once.bind(this, namespace),\n emit: this.emit.bind(this, namespace),\n removeAllListeners: this.removeAllListeners.bind(this, namespace),\n };\n }\n\n /**\n * Register an event listener for a specific event within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to listen for.\n * @param listener The function to call when the event is emitted.\n */\n public on(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.on(`${namespace}:${event}`, listener);\n }\n\n /**\n * Unregister an event listener for a specific event within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to stop listening for.\n * @param listener The function that was registered as the listener.\n */\n public off(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.off(`${namespace}:${event}`, listener);\n }\n\n /**\n * Register an event listener that will be called only once for a specific event\n * within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to listen for.\n * @param listener The function to call when the event is emitted.\n */\n public once(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.once(`${namespace}:${event}`, listener);\n }\n\n /**\n * Emit an event within the specified namespace, calling all registered listeners.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to emit.\n * @param args The arguments to pass to the listeners.\n * @returns A boolean indicating whether any listeners were called.\n */\n public emit(namespace: string, event: string, ...args: any[]) {\n return this.emitter.emit(`${namespace}:${event}`, ...args);\n }\n\n /**\n * Remove all listeners for a specific event or all events within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to remove listeners for. If not provided, all listeners for all events in the namespace will be removed.\n */\n public removeAllListeners(namespace: string): void;\n public removeAllListeners(namespace: string, event: string): void;\n public removeAllListeners(namespace: string, event?: string): void {\n if (event) {\n this.emitter.removeAllListeners(`${namespace}:${event}`);\n } else {\n this.emitter.removeAllListeners(namespace);\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAcA,IAAa,0BAAb,MAAqC;CACnC,AAAQ,UAAU,IAAI,qBAAc;;;;;CAMpC,AAAO,YAAY,AAAgB,YAAwB;EAAxB;;;;;;;;;;CAUnC,AAAO,GAAG,WAAmB;AAC3B,SAAO;GACL,IAAI,KAAK,GAAG,KAAK,MAAM,UAAU;GACjC,KAAK,KAAK,IAAI,KAAK,MAAM,UAAU;GACnC,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU;GACrC,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU;GACrC,oBAAoB,KAAK,mBAAmB,KAAK,MAAM,UAAU;GAClE;;;;;;;;CASH,AAAO,GAAG,WAAmB,OAAe,UAA4B;AACtE,OAAK,QAAQ,GAAG,GAAG,UAAU,GAAG,SAAS,SAAS;;;;;;;;CASpD,AAAO,IAAI,WAAmB,OAAe,UAA4B;AACvE,OAAK,QAAQ,IAAI,GAAG,UAAU,GAAG,SAAS,SAAS;;;;;;;;;CAUrD,AAAO,KAAK,WAAmB,OAAe,UAA4B;AACxE,OAAK,QAAQ,KAAK,GAAG,UAAU,GAAG,SAAS,SAAS;;;;;;;;;CAUtD,AAAO,KAAK,WAAmB,OAAe,GAAG,MAAa;AAC5D,SAAO,KAAK,QAAQ,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK;;CAU5D,AAAO,mBAAmB,WAAmB,OAAsB;AACjE,MAAI,MACF,MAAK,QAAQ,mBAAmB,GAAG,UAAU,GAAG,QAAQ;MAExD,MAAK,QAAQ,mBAAmB,UAAU"}
1
+ {"version":3,"file":"CommandKitEventsChannel-CnT5ymYe.js","names":[],"sources":["../src/events/CommandKitEventsChannel.ts"],"sourcesContent":["import EventEmitter from 'node:events';\nimport type { CommandKit } from '../commandkit';\nimport type { AsyncFunction, GenericFunction } from '../context/async-context';\n\n/**\n * The function type for event listeners.\n */\nexport type ListenerFunction = GenericFunction | AsyncFunction;\n\n/**\n * Represents a channel for emitting and listening to events in CommandKit.\n * This class provides methods to manage event listeners and emit events\n * within a specific namespace.\n */\nexport class CommandKitEventsChannel {\n private emitter = new EventEmitter();\n\n /**\n * Creates a new instance of CommandKitEventsChannel.\n * @param commandkit The CommandKit instance that this channel belongs to.\n */\n public constructor(public readonly commandkit: CommandKit) {}\n\n /**\n * Creates a namespaced event channel. This allows you to manage events\n * within a specific namespace, preventing conflicts with other event channels.\n * This is useful for organizing events related to different parts of your application.\n * @param namespace The namespace for the event channel.\n * @returns An object containing methods for managing events within the namespace.\n * @example commandkit.events.to('customNamespace').emit('eventName', data);\n */\n public to(namespace: string) {\n return {\n on: this.on.bind(this, namespace),\n off: this.off.bind(this, namespace),\n once: this.once.bind(this, namespace),\n emit: this.emit.bind(this, namespace),\n removeAllListeners: this.removeAllListeners.bind(this, namespace),\n };\n }\n\n /**\n * Register an event listener for a specific event within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to listen for.\n * @param listener The function to call when the event is emitted.\n */\n public on(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.on(`${namespace}:${event}`, listener);\n }\n\n /**\n * Unregister an event listener for a specific event within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to stop listening for.\n * @param listener The function that was registered as the listener.\n */\n public off(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.off(`${namespace}:${event}`, listener);\n }\n\n /**\n * Register an event listener that will be called only once for a specific event\n * within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to listen for.\n * @param listener The function to call when the event is emitted.\n */\n public once(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.once(`${namespace}:${event}`, listener);\n }\n\n /**\n * Emit an event within the specified namespace, calling all registered listeners.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to emit.\n * @param args The arguments to pass to the listeners.\n * @returns A boolean indicating whether any listeners were called.\n */\n public emit(namespace: string, event: string, ...args: any[]) {\n return this.emitter.emit(`${namespace}:${event}`, ...args);\n }\n\n /**\n * Remove all listeners for a specific event or all events within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to remove listeners for. If not provided, all listeners for all events in the namespace will be removed.\n */\n public removeAllListeners(namespace: string): void;\n public removeAllListeners(namespace: string, event: string): void;\n public removeAllListeners(namespace: string, event?: string): void {\n if (event) {\n this.emitter.removeAllListeners(`${namespace}:${event}`);\n } else {\n this.emitter.removeAllListeners(namespace);\n }\n }\n}\n"],"mappings":";;;;;;;;;;AAcA,IAAa,0BAAb,MAAqC;CACnC,AAAQ,UAAU,IAAI,qBAAc;;;;;CAMpC,AAAO,YAAY,AAAgB,YAAwB;EAAxB;;;;;;;;;;CAUnC,AAAO,GAAG,WAAmB;AAC3B,SAAO;GACL,IAAI,KAAK,GAAG,KAAK,MAAM,UAAU;GACjC,KAAK,KAAK,IAAI,KAAK,MAAM,UAAU;GACnC,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU;GACrC,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU;GACrC,oBAAoB,KAAK,mBAAmB,KAAK,MAAM,UAAU;GAClE;;;;;;;;CASH,AAAO,GAAG,WAAmB,OAAe,UAA4B;AACtE,OAAK,QAAQ,GAAG,GAAG,UAAU,GAAG,SAAS,SAAS;;;;;;;;CASpD,AAAO,IAAI,WAAmB,OAAe,UAA4B;AACvE,OAAK,QAAQ,IAAI,GAAG,UAAU,GAAG,SAAS,SAAS;;;;;;;;;CAUrD,AAAO,KAAK,WAAmB,OAAe,UAA4B;AACxE,OAAK,QAAQ,KAAK,GAAG,UAAU,GAAG,SAAS,SAAS;;;;;;;;;CAUtD,AAAO,KAAK,WAAmB,OAAe,GAAG,MAAa;AAC5D,SAAO,KAAK,QAAQ,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK;;CAU5D,AAAO,mBAAmB,WAAmB,OAAsB;AACjE,MAAI,MACF,MAAK,QAAQ,mBAAmB,GAAG,UAAU,GAAG,QAAQ;MAExD,MAAK,QAAQ,mBAAmB,UAAU"}
@@ -1,7 +1,6 @@
1
1
  import { Collection } from "discord.js";
2
2
 
3
3
  //#region src/app/router/CommandsRouter.d.ts
4
-
5
4
  /**
6
5
  * Represents a command with its metadata and middleware associations.
7
6
  */
@@ -45,53 +44,53 @@ interface CommandsRouterOptions {
45
44
  declare class CommandsRouter {
46
45
  private readonly options;
47
46
  /**
48
- * @private
49
- * @internal
50
- */
47
+ * @private
48
+ * @internal
49
+ */
51
50
  private commands;
52
51
  /**
53
- * @private
54
- * @internal
55
- */
52
+ * @private
53
+ * @internal
54
+ */
56
55
  private middlewares;
57
56
  /**
58
- * Creates a new CommandsRouter instance.
59
- * @param options - Configuration options for the router
60
- */
57
+ * Creates a new CommandsRouter instance.
58
+ * @param options - Configuration options for the router
59
+ */
61
60
  constructor(options: CommandsRouterOptions);
62
61
  /**
63
- * Populates the router with existing command and middleware data.
64
- * @param data - Parsed command data to populate with
65
- */
62
+ * Populates the router with existing command and middleware data.
63
+ * @param data - Parsed command data to populate with
64
+ */
66
65
  populate(data: ParsedCommandData): void;
67
66
  /**
68
- * Checks if the configured entrypoint path exists.
69
- * @returns True if the path exists
70
- */
67
+ * Checks if the configured entrypoint path exists.
68
+ * @returns True if the path exists
69
+ */
71
70
  isValidPath(): boolean;
72
71
  /**
73
- * @private
74
- * @internal
75
- */
72
+ * @private
73
+ * @internal
74
+ */
76
75
  private isCommand;
77
76
  /**
78
- * @private
79
- * @internal
80
- */
77
+ * @private
78
+ * @internal
79
+ */
81
80
  private isMiddleware;
82
81
  /**
83
- * @private
84
- * @internal
85
- */
82
+ * @private
83
+ * @internal
84
+ */
86
85
  private isCategory;
87
86
  /**
88
- * Clears all loaded commands and middleware.
89
- */
87
+ * Clears all loaded commands and middleware.
88
+ */
90
89
  clear(): void;
91
90
  /**
92
- * Scans the filesystem for commands and middleware files.
93
- * @returns Parsed command data
94
- */
91
+ * Scans the filesystem for commands and middleware files.
92
+ * @returns Parsed command data
93
+ */
95
94
  scan(): Promise<{
96
95
  commands: {
97
96
  [k: string]: Command;
@@ -101,17 +100,17 @@ declare class CommandsRouter {
101
100
  };
102
101
  }>;
103
102
  /**
104
- * Gets the raw command and middleware collections.
105
- * @returns Object containing commands and middlewares collections
106
- */
103
+ * Gets the raw command and middleware collections.
104
+ * @returns Object containing commands and middlewares collections
105
+ */
107
106
  getData(): {
108
107
  commands: Collection<string, Command>;
109
108
  middlewares: Collection<string, Middleware>;
110
109
  };
111
110
  /**
112
- * Converts the loaded data to a JSON-serializable format.
113
- * @returns Plain object with commands and middlewares
114
- */
111
+ * Converts the loaded data to a JSON-serializable format.
112
+ * @returns Plain object with commands and middlewares
113
+ */
115
114
  toJSON(): {
116
115
  commands: {
117
116
  [k: string]: Command;
@@ -121,26 +120,26 @@ declare class CommandsRouter {
121
120
  };
122
121
  };
123
122
  /**
124
- * @private
125
- * @internal
126
- */
123
+ * @private
124
+ * @internal
125
+ */
127
126
  private traverse;
128
127
  /**
129
- * @private
130
- * @internal
131
- */
128
+ * @private
129
+ * @internal
130
+ */
132
131
  private handle;
133
132
  /**
134
- * @private
135
- * @internal
136
- */
133
+ * @private
134
+ * @internal
135
+ */
137
136
  private applyMiddlewares;
138
137
  /**
139
- * @private
140
- * @internal
141
- */
138
+ * @private
139
+ * @internal
140
+ */
142
141
  private replaceEntrypoint;
143
142
  }
144
143
  //#endregion
145
- export { Command, CommandsRouter, CommandsRouterOptions, Middleware, ParsedCommandData };
146
- //# sourceMappingURL=CommandsRouter-CoOA7hkf.d.ts.map
144
+ export { ParsedCommandData as a, Middleware as i, CommandsRouter as n, CommandsRouterOptions as r, Command as t };
145
+ //# sourceMappingURL=CommandsRouter-C7dZEepB.d.ts.map
@@ -1,12 +1,8 @@
1
- const require_chunk = require('./chunk-nOFOJqeH.js');
1
+ const require_chunk = require('./chunk-kSYXY2_d.js');
2
2
  let discord_js = require("discord.js");
3
- discord_js = require_chunk.__toESM(discord_js);
4
3
  let node_fs = require("node:fs");
5
- node_fs = require_chunk.__toESM(node_fs);
6
4
  let node_path = require("node:path");
7
- node_path = require_chunk.__toESM(node_path);
8
5
  let node_fs_promises = require("node:fs/promises");
9
- node_fs_promises = require_chunk.__toESM(node_fs_promises);
10
6
 
11
7
  //#region src/app/router/CommandsRouter.ts
12
8
  /**
@@ -216,4 +212,4 @@ Object.defineProperty(exports, 'CommandsRouter', {
216
212
  return CommandsRouter;
217
213
  }
218
214
  });
219
- //# sourceMappingURL=CommandsRouter-Dmzw-ikm.js.map
215
+ //# sourceMappingURL=CommandsRouter-C_HLsrGX.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CommandsRouter-Dmzw-ikm.js","names":[],"sources":["../src/app/router/CommandsRouter.ts"],"sourcesContent":["import { Collection } from 'discord.js';\nimport { Dirent, existsSync } from 'node:fs';\nimport { readdir } from 'node:fs/promises';\nimport { basename, extname, join, normalize } from 'node:path';\n\n/**\n * Represents a command with its metadata and middleware associations.\n */\nexport interface Command {\n id: string;\n name: string;\n path: string;\n relativePath: string;\n parentPath: string;\n middlewares: Array<string>;\n category: string | null;\n}\n\n/**\n * Represents a middleware with its metadata and scope.\n */\nexport interface Middleware {\n id: string;\n name: string;\n path: string;\n relativePath: string;\n parentPath: string;\n global: boolean;\n command: string | null;\n}\n\n/**\n * Data structure containing parsed commands and middleware.\n */\nexport interface ParsedCommandData {\n commands: Record<string, Command>;\n middlewares: Record<string, Middleware>;\n}\n\n/**\n * Configuration options for the commands router.\n */\nexport interface CommandsRouterOptions {\n entrypoint: string;\n}\n\n/**\n * @private\n * @internal\n */\nconst MIDDLEWARE_PATTERN = /^\\+middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst COMMAND_MIDDLEWARE_PATTERN =\n /^\\+([^+().][^().]*)\\.middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst GLOBAL_MIDDLEWARE_PATTERN = /^\\+global-middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst COMMAND_PATTERN = /^([^+().][^().]*)\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst CATEGORY_PATTERN = /^\\(.+\\)$/;\n\n/**\n * Handles discovery and parsing of command and middleware files in the filesystem.\n */\nexport class CommandsRouter {\n /**\n * @private\n * @internal\n */\n private commands = new Collection<string, Command>();\n\n /**\n * @private\n * @internal\n */\n private middlewares = new Collection<string, Middleware>();\n\n /**\n * Creates a new CommandsRouter instance.\n * @param options - Configuration options for the router\n */\n public constructor(private readonly options: CommandsRouterOptions) {}\n\n /**\n * Populates the router with existing command and middleware data.\n * @param data - Parsed command data to populate with\n */\n public populate(data: ParsedCommandData) {\n for (const [id, command] of Object.entries(data.commands)) {\n this.commands.set(id, command);\n }\n\n for (const [id, middleware] of Object.entries(data.middlewares)) {\n this.middlewares.set(id, middleware);\n }\n }\n\n /**\n * Checks if the configured entrypoint path exists.\n * @returns True if the path exists\n */\n public isValidPath(): boolean {\n return existsSync(this.options.entrypoint);\n }\n\n /**\n * @private\n * @internal\n */\n private isCommand(name: string): boolean {\n return COMMAND_PATTERN.test(name);\n }\n\n /**\n * @private\n * @internal\n */\n private isMiddleware(name: string): boolean {\n return (\n MIDDLEWARE_PATTERN.test(name) ||\n GLOBAL_MIDDLEWARE_PATTERN.test(name) ||\n COMMAND_MIDDLEWARE_PATTERN.test(name)\n );\n }\n\n /**\n * @private\n * @internal\n */\n private isCategory(name: string): boolean {\n return CATEGORY_PATTERN.test(name);\n }\n\n /**\n * Clears all loaded commands and middleware.\n */\n public clear() {\n this.commands.clear();\n this.middlewares.clear();\n }\n\n /**\n * Scans the filesystem for commands and middleware files.\n * @returns Parsed command data\n */\n public async scan() {\n const entries = await readdir(this.options.entrypoint, {\n withFileTypes: true,\n });\n\n for (const entry of entries) {\n // ignore _ prefixed files\n if (entry.name.startsWith('_')) continue;\n\n const fullPath = join(this.options.entrypoint, entry.name);\n\n if (entry.isDirectory()) {\n const category = this.isCategory(entry.name)\n ? entry.name.slice(1, -1)\n : null;\n\n await this.traverse(fullPath, category);\n } else {\n await this.handle(entry);\n }\n }\n\n await this.applyMiddlewares();\n\n return this.toJSON();\n }\n\n /**\n * Gets the raw command and middleware collections.\n * @returns Object containing commands and middlewares collections\n */\n public getData() {\n return {\n commands: this.commands,\n middlewares: this.middlewares,\n };\n }\n\n /**\n * Converts the loaded data to a JSON-serializable format.\n * @returns Plain object with commands and middlewares\n */\n public toJSON() {\n return {\n commands: Object.fromEntries(this.commands.entries()),\n middlewares: Object.fromEntries(this.middlewares.entries()),\n };\n }\n\n /**\n * @private\n * @internal\n */\n private async traverse(path: string, category: string | null) {\n const entries = await readdir(path, {\n withFileTypes: true,\n });\n\n for (const entry of entries) {\n // ignore _ prefixed files\n if (entry.name.startsWith('_')) continue;\n\n if (entry.isFile()) {\n if (this.isCommand(entry.name) || this.isMiddleware(entry.name)) {\n await this.handle(entry, category);\n }\n } else if (\n entry.isDirectory() &&\n this.isCategory(entry.name) &&\n category\n ) {\n // nested category\n const nestedCategory = this.isCategory(entry.name)\n ? `${category}:${entry.name.slice(1, -1)}`\n : null;\n await this.traverse(join(path, entry.name), nestedCategory);\n }\n\n // TODO: handle subcommands\n }\n }\n\n /**\n * @private\n * @internal\n */\n private async handle(entry: Dirent, category: string | null = null) {\n const name = entry.name;\n const path = join(entry.parentPath, entry.name);\n\n if (this.isCommand(name)) {\n const command: Command = {\n id: crypto.randomUUID(),\n name: basename(path, extname(path)),\n path,\n category,\n parentPath: entry.parentPath,\n relativePath: this.replaceEntrypoint(path),\n middlewares: [],\n };\n\n this.commands.set(command.id, command);\n } else if (this.isMiddleware(name)) {\n const middleware: Middleware = {\n id: crypto.randomUUID(),\n name: basename(path, extname(path)),\n path,\n relativePath: this.replaceEntrypoint(path),\n parentPath: entry.parentPath,\n global: GLOBAL_MIDDLEWARE_PATTERN.test(name),\n command: COMMAND_MIDDLEWARE_PATTERN.test(name)\n ? name.match(COMMAND_MIDDLEWARE_PATTERN)?.[1] || null\n : null,\n };\n\n this.middlewares.set(middleware.id, middleware);\n }\n }\n\n /**\n * @private\n * @internal\n */\n private applyMiddlewares() {\n this.commands.forEach((command) => {\n const commandPath = command.parentPath;\n const allMiddlewares = Array.from(this.middlewares.values());\n\n const commandSpecificMiddlewares = allMiddlewares\n .filter((middleware) => middleware.command === command.name)\n .map((middleware) => middleware.id);\n\n const directorySpecificMiddlewares = allMiddlewares\n .filter(\n (middleware) =>\n !middleware.global &&\n !middleware.command &&\n middleware.parentPath === commandPath,\n )\n .map((middleware) => middleware.id);\n\n const globalMiddlewares = allMiddlewares\n .filter((middleware) => middleware.global)\n .map((middleware) => middleware.id);\n\n command.middlewares = [\n ...globalMiddlewares,\n ...directorySpecificMiddlewares,\n ...commandSpecificMiddlewares,\n ];\n });\n }\n\n /**\n * @private\n * @internal\n */\n private replaceEntrypoint(path: string) {\n const normalized = normalize(path);\n return normalized.replace(this.options.entrypoint, '');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkDA,MAAM,qBAAqB;;;;;AAM3B,MAAM,6BACN;;;;;AAMA,MAAM,4BAA4B;;;;;AAMlC,MAAM,kBAAkB;;;;;AAMxB,MAAM,mBAAmB;;;;AAKzB,IAAa,iBAAb,MAA4B;;;;;CAK1B,AAAQ,WAAW,IAAI,uBAA6B;;;;;CAMpD,AAAQ,cAAc,IAAI,uBAAgC;;;;;CAM1D,AAAO,YAAY,AAAiB,SAAgC;EAAhC;;;;;;CAMpC,AAAO,SAAS,MAAyB;AACvC,OAAK,MAAM,CAAC,IAAI,YAAY,OAAO,QAAQ,KAAK,SAAS,CACvD,MAAK,SAAS,IAAI,IAAI,QAAQ;AAGhC,OAAK,MAAM,CAAC,IAAI,eAAe,OAAO,QAAQ,KAAK,YAAY,CAC7D,MAAK,YAAY,IAAI,IAAI,WAAW;;;;;;CAQxC,AAAO,cAAuB;AAC5B,iCAAkB,KAAK,QAAQ,WAAW;;;;;;CAO5C,AAAQ,UAAU,MAAuB;AACvC,SAAO,gBAAgB,KAAK,KAAK;;;;;;CAOnC,AAAQ,aAAa,MAAuB;AAC1C,SACE,mBAAmB,KAAK,KAAK,IAC7B,0BAA0B,KAAK,KAAK,IACpC,2BAA2B,KAAK,KAAI;;;;;;CAQxC,AAAQ,WAAW,MAAuB;AACxC,SAAO,iBAAiB,KAAK,KAAK;;;;;CAMpC,AAAO,QAAQ;AACb,OAAK,SAAS,OAAO;AACrB,OAAK,YAAY,OAAO;;;;;;CAO1B,MAAa,OAAO;EAClB,MAAM,UAAU,oCAAc,KAAK,QAAQ,YAAY,EACrD,eAAe,MAChB,CAAC;AAEF,OAAK,MAAM,SAAS,SAAS;AAE3B,OAAI,MAAM,KAAK,WAAW,IAAI,CAAE;GAEhC,MAAM,+BAAgB,KAAK,QAAQ,YAAY,MAAM,KAAK;AAE1D,OAAI,MAAM,aAAa,EAAE;IACvB,MAAM,WAAW,KAAK,WAAW,MAAM,KAAI,GAC3C,MAAM,KAAK,MAAM,GAAG,GAAG,GACvB;AAEA,UAAM,KAAK,SAAS,UAAU,SAAS;SAEvC,OAAM,KAAK,OAAO,MAAM;;AAI5B,QAAM,KAAK,kBAAkB;AAE7B,SAAO,KAAK,QAAQ;;;;;;CAOtB,AAAO,UAAU;AACf,SAAO;GACL,UAAU,KAAK;GACf,aAAa,KAAK;GACnB;;;;;;CAOH,AAAO,SAAS;AACd,SAAO;GACL,UAAU,OAAO,YAAY,KAAK,SAAS,SAAS,CAAC;GACrD,aAAa,OAAO,YAAY,KAAK,YAAY,SAAS,CAAC;GAC5D;;;;;;CAOH,MAAc,SAAS,MAAc,UAAyB;EAC5D,MAAM,UAAU,oCAAc,MAAM,EAClC,eAAe,MAChB,CAAC;AAEF,OAAK,MAAM,SAAS,SAAS;AAE3B,OAAI,MAAM,KAAK,WAAW,IAAI,CAAE;AAEhC,OAAI,MAAM,QAAQ,EAChB;QAAI,KAAK,UAAU,MAAM,KAAK,IAAI,KAAK,aAAa,MAAM,KAAK,CAC7D,OAAM,KAAK,OAAO,OAAO,SAAS;cAGtC,MAAM,aAAa,IACnB,KAAK,WAAW,MAAM,KAAK,IAC3B,UACA;IAEE,MAAM,iBAAiB,KAAK,WAAW,MAAM,KAAI,GACjD,GAAG,SAAS,GAAG,MAAM,KAAK,MAAM,GAAG,GAAG,KACtC;AACA,UAAM,KAAK,6BAAc,MAAM,MAAM,KAAK,EAAE,eAAe;;;;;;;;CAWjE,MAAc,OAAO,OAAe,WAA0B,MAAM;EAClE,MAAM,OAAO,MAAM;EACnB,MAAM,2BAAY,MAAM,YAAY,MAAM,KAAK;AAE/C,MAAI,KAAK,UAAU,KAAK,EAAE;GACxB,MAAM,UAAmB;IACvB,IAAI,OAAO,YAAY;IACvB,8BAAe,6BAAc,KAAK,CAAC;IACnC;IACA;IACA,YAAY,MAAM;IAClB,cAAc,KAAK,kBAAkB,KAAK;IAC1C,aAAa,EAAE;IAChB;AAED,QAAK,SAAS,IAAI,QAAQ,IAAI,QAAQ;aAC7B,KAAK,aAAa,KAAK,EAAE;;GAClC,MAAM,aAAyB;IAC7B,IAAI,OAAO,YAAY;IACvB,8BAAe,6BAAc,KAAK,CAAC;IACnC;IACA,cAAc,KAAK,kBAAkB,KAAK;IAC1C,YAAY,MAAM;IAClB,QAAQ,0BAA0B,KAAK,KAAK;IAC5C,SAAS,2BAA2B,KAAK,KAAI,mBAC7C,KAAK,MAAM,2BAA2B,4DAAG,OAAM,OAC/C;IACD;AAED,QAAK,YAAY,IAAI,WAAW,IAAI,WAAW;;;;;;;CAQnD,AAAQ,mBAAmB;AACzB,OAAK,SAAS,SAAS,YAAY;GACjC,MAAM,cAAc,QAAQ;GAC5B,MAAM,iBAAiB,MAAM,KAAK,KAAK,YAAY,QAAQ,CAAC;GAE5D,MAAM,6BAA6B,eACnC,QAAQ,eAAe,WAAW,YAAY,QAAQ,KAAK,CAC3D,KAAK,eAAe,WAAW,GAAG;GAElC,MAAM,+BAA+B,eACrC,QACG,eACD,CAAC,WAAW,UACZ,CAAC,WAAW,WACZ,WAAW,eAAe,YAC3B,CACD,KAAK,eAAe,WAAW,GAAG;AAMlC,WAAQ,cAAc;IACtB,GAL0B,eAC1B,QAAQ,eAAe,WAAW,OAAO,CACzC,KAAK,eAAe,WAAW,GAAG;IAIlC,GAAG;IACH,GAAG;IAA2B;IAE9B;;;;;;CAOJ,AAAQ,kBAAkB,MAAc;AAEtC,kCAD6B,KAAK,CAChB,QAAQ,KAAK,QAAQ,YAAY,GAAG"}
1
+ {"version":3,"file":"CommandsRouter-C_HLsrGX.js","names":[],"sources":["../src/app/router/CommandsRouter.ts"],"sourcesContent":["import { Collection } from 'discord.js';\nimport { Dirent, existsSync } from 'node:fs';\nimport { readdir } from 'node:fs/promises';\nimport { basename, extname, join, normalize } from 'node:path';\n\n/**\n * Represents a command with its metadata and middleware associations.\n */\nexport interface Command {\n id: string;\n name: string;\n path: string;\n relativePath: string;\n parentPath: string;\n middlewares: Array<string>;\n category: string | null;\n}\n\n/**\n * Represents a middleware with its metadata and scope.\n */\nexport interface Middleware {\n id: string;\n name: string;\n path: string;\n relativePath: string;\n parentPath: string;\n global: boolean;\n command: string | null;\n}\n\n/**\n * Data structure containing parsed commands and middleware.\n */\nexport interface ParsedCommandData {\n commands: Record<string, Command>;\n middlewares: Record<string, Middleware>;\n}\n\n/**\n * Configuration options for the commands router.\n */\nexport interface CommandsRouterOptions {\n entrypoint: string;\n}\n\n/**\n * @private\n * @internal\n */\nconst MIDDLEWARE_PATTERN = /^\\+middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst COMMAND_MIDDLEWARE_PATTERN =\n /^\\+([^+().][^().]*)\\.middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst GLOBAL_MIDDLEWARE_PATTERN = /^\\+global-middleware\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst COMMAND_PATTERN = /^([^+().][^().]*)\\.(m|c)?(j|t)sx?$/;\n\n/**\n * @private\n * @internal\n */\nconst CATEGORY_PATTERN = /^\\(.+\\)$/;\n\n/**\n * Handles discovery and parsing of command and middleware files in the filesystem.\n */\nexport class CommandsRouter {\n /**\n * @private\n * @internal\n */\n private commands = new Collection<string, Command>();\n\n /**\n * @private\n * @internal\n */\n private middlewares = new Collection<string, Middleware>();\n\n /**\n * Creates a new CommandsRouter instance.\n * @param options - Configuration options for the router\n */\n public constructor(private readonly options: CommandsRouterOptions) {}\n\n /**\n * Populates the router with existing command and middleware data.\n * @param data - Parsed command data to populate with\n */\n public populate(data: ParsedCommandData) {\n for (const [id, command] of Object.entries(data.commands)) {\n this.commands.set(id, command);\n }\n\n for (const [id, middleware] of Object.entries(data.middlewares)) {\n this.middlewares.set(id, middleware);\n }\n }\n\n /**\n * Checks if the configured entrypoint path exists.\n * @returns True if the path exists\n */\n public isValidPath(): boolean {\n return existsSync(this.options.entrypoint);\n }\n\n /**\n * @private\n * @internal\n */\n private isCommand(name: string): boolean {\n return COMMAND_PATTERN.test(name);\n }\n\n /**\n * @private\n * @internal\n */\n private isMiddleware(name: string): boolean {\n return (\n MIDDLEWARE_PATTERN.test(name) ||\n GLOBAL_MIDDLEWARE_PATTERN.test(name) ||\n COMMAND_MIDDLEWARE_PATTERN.test(name)\n );\n }\n\n /**\n * @private\n * @internal\n */\n private isCategory(name: string): boolean {\n return CATEGORY_PATTERN.test(name);\n }\n\n /**\n * Clears all loaded commands and middleware.\n */\n public clear() {\n this.commands.clear();\n this.middlewares.clear();\n }\n\n /**\n * Scans the filesystem for commands and middleware files.\n * @returns Parsed command data\n */\n public async scan() {\n const entries = await readdir(this.options.entrypoint, {\n withFileTypes: true,\n });\n\n for (const entry of entries) {\n // ignore _ prefixed files\n if (entry.name.startsWith('_')) continue;\n\n const fullPath = join(this.options.entrypoint, entry.name);\n\n if (entry.isDirectory()) {\n const category = this.isCategory(entry.name)\n ? entry.name.slice(1, -1)\n : null;\n\n await this.traverse(fullPath, category);\n } else {\n await this.handle(entry);\n }\n }\n\n await this.applyMiddlewares();\n\n return this.toJSON();\n }\n\n /**\n * Gets the raw command and middleware collections.\n * @returns Object containing commands and middlewares collections\n */\n public getData() {\n return {\n commands: this.commands,\n middlewares: this.middlewares,\n };\n }\n\n /**\n * Converts the loaded data to a JSON-serializable format.\n * @returns Plain object with commands and middlewares\n */\n public toJSON() {\n return {\n commands: Object.fromEntries(this.commands.entries()),\n middlewares: Object.fromEntries(this.middlewares.entries()),\n };\n }\n\n /**\n * @private\n * @internal\n */\n private async traverse(path: string, category: string | null) {\n const entries = await readdir(path, {\n withFileTypes: true,\n });\n\n for (const entry of entries) {\n // ignore _ prefixed files\n if (entry.name.startsWith('_')) continue;\n\n if (entry.isFile()) {\n if (this.isCommand(entry.name) || this.isMiddleware(entry.name)) {\n await this.handle(entry, category);\n }\n } else if (\n entry.isDirectory() &&\n this.isCategory(entry.name) &&\n category\n ) {\n // nested category\n const nestedCategory = this.isCategory(entry.name)\n ? `${category}:${entry.name.slice(1, -1)}`\n : null;\n await this.traverse(join(path, entry.name), nestedCategory);\n }\n\n // TODO: handle subcommands\n }\n }\n\n /**\n * @private\n * @internal\n */\n private async handle(entry: Dirent, category: string | null = null) {\n const name = entry.name;\n const path = join(entry.parentPath, entry.name);\n\n if (this.isCommand(name)) {\n const command: Command = {\n id: crypto.randomUUID(),\n name: basename(path, extname(path)),\n path,\n category,\n parentPath: entry.parentPath,\n relativePath: this.replaceEntrypoint(path),\n middlewares: [],\n };\n\n this.commands.set(command.id, command);\n } else if (this.isMiddleware(name)) {\n const middleware: Middleware = {\n id: crypto.randomUUID(),\n name: basename(path, extname(path)),\n path,\n relativePath: this.replaceEntrypoint(path),\n parentPath: entry.parentPath,\n global: GLOBAL_MIDDLEWARE_PATTERN.test(name),\n command: COMMAND_MIDDLEWARE_PATTERN.test(name)\n ? name.match(COMMAND_MIDDLEWARE_PATTERN)?.[1] || null\n : null,\n };\n\n this.middlewares.set(middleware.id, middleware);\n }\n }\n\n /**\n * @private\n * @internal\n */\n private applyMiddlewares() {\n this.commands.forEach((command) => {\n const commandPath = command.parentPath;\n const allMiddlewares = Array.from(this.middlewares.values());\n\n const commandSpecificMiddlewares = allMiddlewares\n .filter((middleware) => middleware.command === command.name)\n .map((middleware) => middleware.id);\n\n const directorySpecificMiddlewares = allMiddlewares\n .filter(\n (middleware) =>\n !middleware.global &&\n !middleware.command &&\n middleware.parentPath === commandPath,\n )\n .map((middleware) => middleware.id);\n\n const globalMiddlewares = allMiddlewares\n .filter((middleware) => middleware.global)\n .map((middleware) => middleware.id);\n\n command.middlewares = [\n ...globalMiddlewares,\n ...directorySpecificMiddlewares,\n ...commandSpecificMiddlewares,\n ];\n });\n }\n\n /**\n * @private\n * @internal\n */\n private replaceEntrypoint(path: string) {\n const normalized = normalize(path);\n return normalized.replace(this.options.entrypoint, '');\n }\n}\n"],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- const require_PluginCommon = require('./PluginCommon-Cvl5yYM_.js');
1
+ const require_PluginCommon = require('./PluginCommon-BLxWww5u.js');
2
2
 
3
3
  //#region src/plugins/CompilerPlugin.ts
4
4
  /**
@@ -40,4 +40,4 @@ Object.defineProperty(exports, 'isCompilerPlugin', {
40
40
  return isCompilerPlugin;
41
41
  }
42
42
  });
43
- //# sourceMappingURL=CompilerPlugin-M8r3yNAl.js.map
43
+ //# sourceMappingURL=CompilerPlugin-CUsGAfgl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CompilerPlugin-M8r3yNAl.js","names":[],"sources":["../src/plugins/CompilerPlugin.ts"],"sourcesContent":["import {\n isPlugin,\n PluginCommon,\n PluginOptions,\n PluginType,\n} from './PluginCommon';\nimport { MaybeFalsey } from './types';\nimport { CompilerPluginRuntime } from './plugin-runtime/CompilerPluginRuntime';\n\n/**\n * The parameters for the transformation function of a compiler plugin.\n */\nexport interface PluginTransformParameters {\n /**\n * The code to be transformed.\n */\n code: string;\n /**\n * The filename of the code being transformed.\n */\n id: string;\n}\n\nexport interface TransformedResult {\n /**\n * The transformed code.\n */\n code?: string;\n /**\n * The source map for the transformed code, if applicable.\n */\n map?: string | null;\n}\n\n/**\n * CommandKit plugin that runs at compile time.\n */\nexport abstract class CompilerPlugin<\n T extends PluginOptions = PluginOptions,\n> extends PluginCommon<T, CompilerPluginRuntime> {\n /**\n * The type of the plugin, which is Compiler.\n */\n public readonly type = PluginType.Compiler;\n\n /**\n * Called when transformation is requested to this plugin\n * @param params The parameters for the transformation\n * @returns The transformed result\n */\n public async transform(\n params: PluginTransformParameters,\n ): Promise<MaybeFalsey<TransformedResult>> {\n return null;\n }\n}\n\n/**\n * Type guard to check if the given object is a CompilerPlugin.\n * @param plugin The object to check.\n * @returns Boolean indicating whether the object is a CompilerPlugin.\n */\nexport function isCompilerPlugin(plugin: unknown): plugin is CompilerPlugin {\n return (\n plugin instanceof CompilerPlugin ||\n (isPlugin(plugin) && plugin.type === PluginType.Compiler)\n );\n}\n"],"mappings":";;;;;;AAqCA,IAAsB,iBAAtB,cAEA,kCAAuC;;;;CAIrC,AAAgB,OAAO,gCAAW;;;;;;CAOlC,MAAa,UACb,QAC0C;AACxC,SAAO;;;;;;;;AASX,SAAgB,iBAAiB,QAA2C;AAC1E,QACE,kBAAkB,kBAClB,8BAAS,OAAO,IAAI,OAAO,SAAS,gCAAW"}
1
+ {"version":3,"file":"CompilerPlugin-CUsGAfgl.js","names":[],"sources":["../src/plugins/CompilerPlugin.ts"],"sourcesContent":["import {\n isPlugin,\n PluginCommon,\n PluginOptions,\n PluginType,\n} from './PluginCommon';\nimport { MaybeFalsey } from './types';\nimport { CompilerPluginRuntime } from './plugin-runtime/CompilerPluginRuntime';\n\n/**\n * The parameters for the transformation function of a compiler plugin.\n */\nexport interface PluginTransformParameters {\n /**\n * The code to be transformed.\n */\n code: string;\n /**\n * The filename of the code being transformed.\n */\n id: string;\n}\n\nexport interface TransformedResult {\n /**\n * The transformed code.\n */\n code?: string;\n /**\n * The source map for the transformed code, if applicable.\n */\n map?: string | null;\n}\n\n/**\n * CommandKit plugin that runs at compile time.\n */\nexport abstract class CompilerPlugin<\n T extends PluginOptions = PluginOptions,\n> extends PluginCommon<T, CompilerPluginRuntime> {\n /**\n * The type of the plugin, which is Compiler.\n */\n public readonly type = PluginType.Compiler;\n\n /**\n * Called when transformation is requested to this plugin\n * @param params The parameters for the transformation\n * @returns The transformed result\n */\n public async transform(\n params: PluginTransformParameters,\n ): Promise<MaybeFalsey<TransformedResult>> {\n return null;\n }\n}\n\n/**\n * Type guard to check if the given object is a CompilerPlugin.\n * @param plugin The object to check.\n * @returns Boolean indicating whether the object is a CompilerPlugin.\n */\nexport function isCompilerPlugin(plugin: unknown): plugin is CompilerPlugin {\n return (\n plugin instanceof CompilerPlugin ||\n (isPlugin(plugin) && plugin.type === PluginType.Compiler)\n );\n}\n"],"mappings":";;;;;;AAqCA,IAAsB,iBAAtB,cAEA,kCAA0B;;;;CAIxB,AAAgB,OAAO,gCAAW;;;;;;CAOlC,MAAa,UACb,QAC0C;AACxC,SAAO;;;;;;;;AASX,SAAgB,iBAAiB,QAA2C;AAC1E,QACE,kBAAkB,kBAClB,8BAAS,OAAO,IAAI,OAAO,SAAS,gCAAW"}
@@ -139,4 +139,4 @@ Object.defineProperty(exports, 'EventInterceptor', {
139
139
  return EventInterceptor;
140
140
  }
141
141
  });
142
- //# sourceMappingURL=EventInterceptor-CQEXyUTp.js.map
142
+ //# sourceMappingURL=EventInterceptor-BWoEJMHZ.js.map