commandkit 1.0.0-next-beta.20240203223402 → 1.2.0-dev.20250818125640

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 (578) hide show
  1. package/LICENSE +5 -0
  2. package/README.md +22 -80
  3. package/ai.cjs +21 -0
  4. package/ai.d.ts +1 -0
  5. package/analytics.cjs +21 -0
  6. package/analytics.d.ts +9 -0
  7. package/async-queue.cjs +9 -0
  8. package/async-queue.d.ts +1 -0
  9. package/bin/index.mjs +5 -0
  10. package/cache.cjs +23 -0
  11. package/cache.d.ts +13 -0
  12. package/components.cjs +1 -0
  13. package/components.d.ts +1 -0
  14. package/config.cjs +5 -0
  15. package/config.d.ts +1 -0
  16. package/dist/ActionRow-CmTHbo2t.js +25 -0
  17. package/dist/ActionRow-CmTHbo2t.js.map +1 -0
  18. package/dist/ActionRow-DKnFVDME.d.ts +20 -0
  19. package/dist/Button-4ZUXdA56.d.ts +39 -0
  20. package/dist/ButtonKit-C7r7RPNf.d.ts +87 -0
  21. package/dist/ChannelSelectMenuKit-BrXvBYNH.d.ts +67 -0
  22. package/dist/CommandKitEventsChannel-Bgw0XCOl.js +87 -0
  23. package/dist/CommandKitEventsChannel-Bgw0XCOl.js.map +1 -0
  24. package/dist/CommandsRouter-Ci1Pe8Vd.js +214 -0
  25. package/dist/CommandsRouter-Ci1Pe8Vd.js.map +1 -0
  26. package/dist/CommandsRouter-CoOA7hkf.d.ts +146 -0
  27. package/dist/CompilerPlugin-CjoZAAR8.js +43 -0
  28. package/dist/CompilerPlugin-CjoZAAR8.js.map +1 -0
  29. package/dist/DefaultLogger-Cy55-uPl.d.ts +60 -0
  30. package/dist/EventInterceptor-CQ4PBpBJ.js +144 -0
  31. package/dist/EventInterceptor-CQ4PBpBJ.js.map +1 -0
  32. package/dist/EventInterceptor-x-R2qshQ.d.ts +91 -0
  33. package/dist/EventWorkerContext-CSlD9rbx.js +68 -0
  34. package/dist/EventWorkerContext-CSlD9rbx.js.map +1 -0
  35. package/dist/EventWorkerContext-DJUi1W3T.d.ts +43 -0
  36. package/dist/EventsRouter-BacqK6z3.d.ts +90 -0
  37. package/dist/EventsRouter-C_J0M3uO.js +133 -0
  38. package/dist/EventsRouter-C_J0M3uO.js.map +1 -0
  39. package/dist/ILogger-DBGON5wx.d.ts +34 -0
  40. package/dist/ILogger-dQ7Y9X1f.js +0 -0
  41. package/dist/Logger-iSjA-DWN.d.ts +37 -0
  42. package/dist/MentionableSelectMenuKit-CPTKqx-O.d.ts +62 -0
  43. package/dist/MessageCommandParser-B_BEQ3p8.js +268 -0
  44. package/dist/MessageCommandParser-B_BEQ3p8.js.map +1 -0
  45. package/dist/MessageCommandParser-ROLibZPX.d.ts +195 -0
  46. package/dist/Modal-C6UTRdYQ.d.ts +62 -0
  47. package/dist/ModalKit-Btz58KYn.d.ts +87 -0
  48. package/dist/PluginCommon-Di1xIa8d.js +70 -0
  49. package/dist/PluginCommon-Di1xIa8d.js.map +1 -0
  50. package/dist/RoleSelectMenuKit-C26lU3sN.d.ts +67 -0
  51. package/dist/RuntimePlugin-CBgBLXTG.js +133 -0
  52. package/dist/RuntimePlugin-CBgBLXTG.js.map +1 -0
  53. package/dist/SelectMenu-Diy87_ba.d.ts +137 -0
  54. package/dist/StringSelectMenuKit-Bhs8U6WI.d.ts +67 -0
  55. package/dist/UserSelectMenuKit-CfqFJdxz.d.ts +67 -0
  56. package/dist/analytics/analytics-engine.d.ts +32 -0
  57. package/dist/analytics/analytics-engine.js +37 -0
  58. package/dist/analytics/analytics-provider.d.ts +32 -0
  59. package/dist/analytics/analytics-provider.js +0 -0
  60. package/dist/analytics/constants.d.ts +27 -0
  61. package/dist/analytics/constants.js +4 -0
  62. package/dist/analytics/utils.d.ts +19 -0
  63. package/dist/analytics/utils.js +38 -0
  64. package/dist/analytics-engine-vA4MaJYx.d.ts +2183 -0
  65. package/dist/app/commands/AppCommandRunner.d.ts +32 -0
  66. package/dist/app/commands/AppCommandRunner.js +37 -0
  67. package/dist/app/commands/Context.d.ts +32 -0
  68. package/dist/app/commands/Context.js +39 -0
  69. package/dist/app/commands/MessageCommandParser.d.ts +2 -0
  70. package/dist/app/commands/MessageCommandParser.js +5 -0
  71. package/dist/app/commands/helpers.d.ts +2 -0
  72. package/dist/app/commands/helpers.js +4 -0
  73. package/dist/app/events/EventWorkerContext.d.ts +33 -0
  74. package/dist/app/events/EventWorkerContext.js +6 -0
  75. package/dist/app/handlers/AppCommandHandler.d.ts +32 -0
  76. package/dist/app/handlers/AppCommandHandler.js +37 -0
  77. package/dist/app/handlers/AppEventsHandler.d.ts +32 -0
  78. package/dist/app/handlers/AppEventsHandler.js +37 -0
  79. package/dist/app/index.d.ts +32 -0
  80. package/dist/app/index.js +51 -0
  81. package/dist/app/interrupt/signals.d.ts +2 -0
  82. package/dist/app/interrupt/signals.js +8 -0
  83. package/dist/app/register/CommandRegistrar.d.ts +32 -0
  84. package/dist/app/register/CommandRegistrar.js +37 -0
  85. package/dist/app/router/CommandsRouter.d.ts +2 -0
  86. package/dist/app/router/CommandsRouter.js +3 -0
  87. package/dist/app/router/EventsRouter.d.ts +2 -0
  88. package/dist/app/router/EventsRouter.js +3 -0
  89. package/dist/app/router/index.d.ts +4 -0
  90. package/dist/app/router/index.js +6 -0
  91. package/dist/app-HN1cVg8J.js +0 -0
  92. package/dist/app-process-CjMovpoZ.js +65 -0
  93. package/dist/app-process-CjMovpoZ.js.map +1 -0
  94. package/dist/build-DXl8uEv4.js +170 -0
  95. package/dist/build-DXl8uEv4.js.map +1 -0
  96. package/dist/chunk-nOFOJqeH.js +30 -0
  97. package/dist/cli/app-process.d.ts +12 -0
  98. package/dist/cli/app-process.js +8 -0
  99. package/dist/cli/build.d.ts +56 -0
  100. package/dist/cli/build.js +40 -0
  101. package/dist/cli/common.d.ts +73 -0
  102. package/dist/cli/common.js +12 -0
  103. package/dist/cli/development.d.ts +9 -0
  104. package/dist/cli/development.js +207 -0
  105. package/dist/cli/development.js.map +1 -0
  106. package/dist/cli/env.d.ts +50 -0
  107. package/dist/cli/env.js +10 -0
  108. package/dist/cli/generators.d.ts +14 -0
  109. package/dist/cli/generators.js +115 -0
  110. package/dist/cli/generators.js.map +1 -0
  111. package/dist/cli/information.d.ts +9 -0
  112. package/dist/cli/information.js +132 -0
  113. package/dist/cli/information.js.map +1 -0
  114. package/dist/cli/init.d.ts +2 -0
  115. package/dist/cli/init.js +38 -0
  116. package/dist/cli/production.d.ts +17 -0
  117. package/dist/cli/production.js +79 -0
  118. package/dist/cli/production.js.map +1 -0
  119. package/dist/cli/type-checker.d.ts +11 -0
  120. package/dist/cli/type-checker.js +7 -0
  121. package/dist/cli/utils.d.ts +12 -0
  122. package/dist/cli/utils.js +3 -0
  123. package/dist/colors-Cd4Oz-r-.js +14 -0
  124. package/dist/colors-Cd4Oz-r-.js.map +1 -0
  125. package/dist/commandkit-DMEW0kJg.js +4315 -0
  126. package/dist/commandkit-DMEW0kJg.js.map +1 -0
  127. package/dist/commandkit.d.ts +32 -0
  128. package/dist/commandkit.js +40 -0
  129. package/dist/common-CcfjYnPG.js +0 -0
  130. package/dist/common-DNADUU3_.js +211 -0
  131. package/dist/common-DNADUU3_.js.map +1 -0
  132. package/dist/common-DOCvOVC4.d.ts +30 -0
  133. package/dist/common-vnMIelAE.js +17 -0
  134. package/dist/common-vnMIelAE.js.map +1 -0
  135. package/dist/components/common/EventInterceptor.d.ts +2 -0
  136. package/dist/components/common/EventInterceptor.js +3 -0
  137. package/dist/components/common/element.d.ts +5 -0
  138. package/dist/components/common/element.js +9 -0
  139. package/dist/components/common/types.d.ts +2 -0
  140. package/dist/components/common/types.js +1 -0
  141. package/dist/components/index.d.ts +24 -0
  142. package/dist/components/index.js +71 -0
  143. package/dist/components/v1/action-row/ActionRow.d.ts +6 -0
  144. package/dist/components/v1/action-row/ActionRow.js +3 -0
  145. package/dist/components/v1/button/Button.d.ts +7 -0
  146. package/dist/components/v1/button/Button.js +37 -0
  147. package/dist/components/v1/button/ButtonKit.d.ts +3 -0
  148. package/dist/components/v1/button/ButtonKit.js +37 -0
  149. package/dist/components/v1/modal/Modal.d.ts +7 -0
  150. package/dist/components/v1/modal/Modal.js +40 -0
  151. package/dist/components/v1/modal/ModalKit.d.ts +3 -0
  152. package/dist/components/v1/modal/ModalKit.js +37 -0
  153. package/dist/components/v1/select-menu/ChannelSelectMenuKit.d.ts +4 -0
  154. package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +37 -0
  155. package/dist/components/v1/select-menu/MentionableSelectMenuKit.d.ts +4 -0
  156. package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +37 -0
  157. package/dist/components/v1/select-menu/RoleSelectMenuKit.d.ts +4 -0
  158. package/dist/components/v1/select-menu/RoleSelectMenuKit.js +37 -0
  159. package/dist/components/v1/select-menu/SelectMenu.d.ts +10 -0
  160. package/dist/components/v1/select-menu/SelectMenu.js +42 -0
  161. package/dist/components/v1/select-menu/StringSelectMenuKit.d.ts +4 -0
  162. package/dist/components/v1/select-menu/StringSelectMenuKit.js +37 -0
  163. package/dist/components/v1/select-menu/UserSelectMenuKit.d.ts +4 -0
  164. package/dist/components/v1/select-menu/UserSelectMenuKit.js +37 -0
  165. package/dist/components/v1/select-menu/common.d.ts +3 -0
  166. package/dist/components/v1/select-menu/common.js +1 -0
  167. package/dist/components/v2/common.d.ts +13 -0
  168. package/dist/components/v2/common.js +3 -0
  169. package/dist/components/v2/container.d.ts +2 -0
  170. package/dist/components/v2/container.js +4 -0
  171. package/dist/components/v2/file.d.ts +2 -0
  172. package/dist/components/v2/file.js +3 -0
  173. package/dist/components/v2/index.d.ts +8 -0
  174. package/dist/components/v2/index.js +17 -0
  175. package/dist/components/v2/media-gallery.d.ts +2 -0
  176. package/dist/components/v2/media-gallery.js +5 -0
  177. package/dist/components/v2/section.d.ts +2 -0
  178. package/dist/components/v2/section.js +5 -0
  179. package/dist/components/v2/separator.d.ts +2 -0
  180. package/dist/components/v2/separator.js +3 -0
  181. package/dist/components/v2/text-display.d.ts +2 -0
  182. package/dist/components/v2/text-display.js +3 -0
  183. package/dist/config/config.d.ts +33 -0
  184. package/dist/config/config.js +38 -0
  185. package/dist/config/default.d.ts +40 -0
  186. package/dist/config/default.js +37 -0
  187. package/dist/config/loader.d.ts +48 -0
  188. package/dist/config/loader.js +38 -0
  189. package/dist/config/types.d.ts +32 -0
  190. package/dist/config/types.js +0 -0
  191. package/dist/config/utils.d.ts +32 -0
  192. package/dist/config/utils.js +3 -0
  193. package/dist/config-CcWJ-vz5.d.ts +16 -0
  194. package/dist/constants-4oxxvaJA.js +27 -0
  195. package/dist/constants-4oxxvaJA.js.map +1 -0
  196. package/dist/constants-B5_Ta7PR.js +70 -0
  197. package/dist/constants-B5_Ta7PR.js.map +1 -0
  198. package/dist/constants-CUND8XkG.js +36 -0
  199. package/dist/constants-CUND8XkG.js.map +1 -0
  200. package/dist/constants-DrjIvQd6.d.ts +19 -0
  201. package/dist/constants-MKu-Q1jh.d.ts +46 -0
  202. package/dist/container-DHBELeJ3.d.ts +25 -0
  203. package/dist/container-z621KfH5.js +43 -0
  204. package/dist/container-z621KfH5.js.map +1 -0
  205. package/dist/context/async-context.d.ts +32 -0
  206. package/dist/context/async-context.js +43 -0
  207. package/dist/context/environment.d.ts +32 -0
  208. package/dist/context/environment.js +40 -0
  209. package/dist/dotprops-C_4L7RPD.js +36 -0
  210. package/dist/dotprops-C_4L7RPD.js.map +1 -0
  211. package/dist/element-Bak9llw_.js +84 -0
  212. package/dist/element-Bak9llw_.js.map +1 -0
  213. package/dist/element-CAXu1XtK.d.ts +72 -0
  214. package/dist/env-_68PRRoA.js +109 -0
  215. package/dist/env-_68PRRoA.js.map +1 -0
  216. package/dist/error-codes-C-ViHyu-.js +73 -0
  217. package/dist/error-codes-C-ViHyu-.js.map +1 -0
  218. package/dist/events/CommandKitEventsChannel.d.ts +32 -0
  219. package/dist/events/CommandKitEventsChannel.js +3 -0
  220. package/dist/feature-flags-Cxl9JtVG.js +165 -0
  221. package/dist/feature-flags-Cxl9JtVG.js.map +1 -0
  222. package/dist/file-DTrr-p09.d.ts +24 -0
  223. package/dist/file-DVZC0QXI.js +28 -0
  224. package/dist/file-DVZC0QXI.js.map +1 -0
  225. package/dist/flags/FlagProvider.d.ts +32 -0
  226. package/dist/flags/FlagProvider.js +27 -0
  227. package/dist/flags/FlagProvider.js.map +1 -0
  228. package/dist/flags/feature-flags.d.ts +32 -0
  229. package/dist/flags/feature-flags.js +40 -0
  230. package/dist/flags/store.d.ts +32 -0
  231. package/dist/flags/store.js +3 -0
  232. package/dist/helpers-BUlN3lIz.js +35 -0
  233. package/dist/helpers-BUlN3lIz.js.map +1 -0
  234. package/dist/helpers-Wg6P5fRQ.d.ts +23 -0
  235. package/dist/index-DKcmsWXw.d.ts +1 -0
  236. package/dist/index-DSBMRX9A.d.ts +1 -0
  237. package/dist/index-DdqikUQD.d.ts +1 -0
  238. package/dist/index.d.ts +42 -0
  239. package/dist/index.js +150 -0
  240. package/dist/init-DOr-Y3GQ.d.ts +13 -0
  241. package/dist/init-DTBFphOg.js +92 -0
  242. package/dist/init-DTBFphOg.js.map +1 -0
  243. package/dist/kv/constants.d.ts +2 -0
  244. package/dist/kv/constants.js +3 -0
  245. package/dist/kv/dotprops.d.ts +6 -0
  246. package/dist/kv/dotprops.js +4 -0
  247. package/dist/kv/kv.d.ts +397 -0
  248. package/dist/kv/kv.js +575 -0
  249. package/dist/kv/kv.js.map +1 -0
  250. package/dist/kv/serde.d.ts +3 -0
  251. package/dist/kv/serde.js +5 -0
  252. package/dist/logger/DefaultLogger.d.ts +3 -0
  253. package/dist/logger/DefaultLogger.js +37 -0
  254. package/dist/logger/ILogger.d.ts +2 -0
  255. package/dist/logger/ILogger.js +1 -0
  256. package/dist/logger/Logger.d.ts +3 -0
  257. package/dist/logger/Logger.js +38 -0
  258. package/dist/logger/NoopLogger.d.ts +37 -0
  259. package/dist/logger/NoopLogger.js +36 -0
  260. package/dist/logger/NoopLogger.js.map +1 -0
  261. package/dist/media-gallery-BMsXSot3.d.ts +49 -0
  262. package/dist/media-gallery-CIKypjbJ.js +61 -0
  263. package/dist/media-gallery-CIKypjbJ.js.map +1 -0
  264. package/dist/plugins/CompilerPlugin.d.ts +32 -0
  265. package/dist/plugins/CompilerPlugin.js +5 -0
  266. package/dist/plugins/PluginCommon.d.ts +32 -0
  267. package/dist/plugins/PluginCommon.js +5 -0
  268. package/dist/plugins/RuntimePlugin.d.ts +32 -0
  269. package/dist/plugins/RuntimePlugin.js +5 -0
  270. package/dist/plugins/index.d.ts +32 -0
  271. package/dist/plugins/index.js +43 -0
  272. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +32 -0
  273. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +37 -0
  274. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +32 -0
  275. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +37 -0
  276. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +32 -0
  277. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +37 -0
  278. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +55 -0
  279. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +37 -0
  280. package/dist/plugins/plugin-runtime/runtime.d.ts +32 -0
  281. package/dist/plugins/plugin-runtime/runtime.js +1 -0
  282. package/dist/plugins/types.d.ts +32 -0
  283. package/dist/plugins/types.js +1 -0
  284. package/dist/resolve-file-url-DHTQj2mU.js +23 -0
  285. package/dist/resolve-file-url-DHTQj2mU.js.map +1 -0
  286. package/dist/resolve-file-url-yO8bUxok.d.ts +11 -0
  287. package/dist/router-DHnFRADH.js +0 -0
  288. package/dist/runtime-5fxB4uhe.js +0 -0
  289. package/dist/section-CuYr0Inu.js +60 -0
  290. package/dist/section-CuYr0Inu.js.map +1 -0
  291. package/dist/section-Dh_FhPeC.d.ts +45 -0
  292. package/dist/separator-CMf6Cyy5.d.ts +22 -0
  293. package/dist/separator-DLdWBjSN.js +27 -0
  294. package/dist/separator-DLdWBjSN.js.map +1 -0
  295. package/dist/serde-BUDI03pX.d.ts +12 -0
  296. package/dist/serde-CHySNpFr.js +97 -0
  297. package/dist/serde-CHySNpFr.js.map +1 -0
  298. package/dist/signals-BQbEfy3X.d.ts +41 -0
  299. package/dist/signals-DHdYrd-n.js +77 -0
  300. package/dist/signals-DHdYrd-n.js.map +1 -0
  301. package/dist/store-CiqLHedg.js +18 -0
  302. package/dist/store-CiqLHedg.js.map +1 -0
  303. package/dist/text-display--p2-BoUa.js +31 -0
  304. package/dist/text-display--p2-BoUa.js.map +1 -0
  305. package/dist/text-display-DRw3r_lK.d.ts +33 -0
  306. package/dist/type-checker-1Iu1jJcy.js +88 -0
  307. package/dist/type-checker-1Iu1jJcy.js.map +1 -0
  308. package/dist/types-CJ-XvOFN.d.ts +5 -0
  309. package/dist/types-CUZOquUl.js +0 -0
  310. package/dist/types-package-DrnIdWLg.js +72 -0
  311. package/dist/types-package-DrnIdWLg.js.map +1 -0
  312. package/dist/types-q0Nm882H.js +0 -0
  313. package/dist/types.d.ts +32 -0
  314. package/dist/types.js +0 -0
  315. package/dist/utilities-DtdPlr4c.d.ts +87 -0
  316. package/dist/utils/colors.d.ts +6 -0
  317. package/dist/utils/colors.js +4 -0
  318. package/dist/utils/constants.d.ts +2 -0
  319. package/dist/utils/constants.js +8 -0
  320. package/dist/utils/dev-hooks.d.ts +32 -0
  321. package/dist/utils/dev-hooks.js +37 -0
  322. package/dist/utils/error-codes.d.ts +54 -0
  323. package/dist/utils/error-codes.js +6 -0
  324. package/dist/utils/resolve-file-url.d.ts +2 -0
  325. package/dist/utils/resolve-file-url.js +3 -0
  326. package/dist/utils/types-package.d.ts +12 -0
  327. package/dist/utils/types-package.js +5 -0
  328. package/dist/utils/useful-stuff/async-queue.d.ts +84 -0
  329. package/dist/utils/useful-stuff/async-queue.js +136 -0
  330. package/dist/utils/useful-stuff/async-queue.js.map +1 -0
  331. package/dist/utils/useful-stuff/mutex.d.ts +188 -0
  332. package/dist/utils/useful-stuff/mutex.js +214 -0
  333. package/dist/utils/useful-stuff/mutex.js.map +1 -0
  334. package/dist/utils/useful-stuff/ratelimiter.d.ts +193 -0
  335. package/dist/utils/useful-stuff/ratelimiter.js +223 -0
  336. package/dist/utils/useful-stuff/ratelimiter.js.map +1 -0
  337. package/dist/utils/useful-stuff/semaphore.d.ts +227 -0
  338. package/dist/utils/useful-stuff/semaphore.js +267 -0
  339. package/dist/utils/useful-stuff/semaphore.js.map +1 -0
  340. package/dist/utils/utilities.d.ts +2 -0
  341. package/dist/utils/utilities.js +44 -0
  342. package/dist/utils/warn-unstable.d.ts +16 -0
  343. package/dist/utils/warn-unstable.js +26 -0
  344. package/dist/utils/warn-unstable.js.map +1 -0
  345. package/dist/utils-BnXM4eKk.js +34 -0
  346. package/dist/utils-BnXM4eKk.js.map +1 -0
  347. package/dist/utils-DCSnVAZ6.js +23 -0
  348. package/dist/utils-DCSnVAZ6.js.map +1 -0
  349. package/dist/v2-DofkPKHs.js +0 -0
  350. package/dist/version-C1IgTOgS.js +18 -0
  351. package/dist/version-C1IgTOgS.js.map +1 -0
  352. package/dist/version-CtJtBJXI.d.ts +8 -0
  353. package/dist/version.d.ts +2 -0
  354. package/dist/version.js +3 -0
  355. package/env.cjs +15 -0
  356. package/env.d.ts +7 -0
  357. package/events.cjs +6 -0
  358. package/events.d.ts +7 -0
  359. package/flag.cjs +6 -0
  360. package/flag.d.ts +1 -0
  361. package/hooks.cjs +58 -0
  362. package/hooks.d.ts +18 -0
  363. package/i18n.cjs +6 -0
  364. package/i18n.d.ts +1 -0
  365. package/jsx-runtime.cjs +7 -0
  366. package/jsx-runtime.d.ts +1 -0
  367. package/kv.cjs +6 -0
  368. package/kv.d.ts +1 -0
  369. package/logger.cjs +13 -0
  370. package/logger.d.ts +11 -0
  371. package/mutex.cjs +21 -0
  372. package/mutex.d.ts +1 -0
  373. package/package.json +160 -38
  374. package/plugin.cjs +17 -0
  375. package/plugin.d.ts +9 -0
  376. package/ratelimit.cjs +26 -0
  377. package/ratelimit.d.ts +1 -0
  378. package/semaphore.cjs +23 -0
  379. package/semaphore.d.ts +1 -0
  380. package/bin/index.cjs +0 -4
  381. package/dist/CommandKit-zTvOEN7S.d.mts +0 -452
  382. package/dist/CommandKit.d.mts +0 -5
  383. package/dist/CommandKit.mjs +0 -22
  384. package/dist/CommandKit.mjs.map +0 -1
  385. package/dist/bootstrap/client.d.mts +0 -30
  386. package/dist/bootstrap/client.mjs +0 -48
  387. package/dist/bootstrap/client.mjs.map +0 -1
  388. package/dist/bootstrap/loadEnv.d.mts +0 -3
  389. package/dist/bootstrap/loadEnv.mjs +0 -9
  390. package/dist/bootstrap/loadEnv.mjs.map +0 -1
  391. package/dist/chunk-36PQ6EPA.mjs +0 -19
  392. package/dist/chunk-36PQ6EPA.mjs.map +0 -1
  393. package/dist/chunk-4QUBNPUD.mjs +0 -43
  394. package/dist/chunk-4QUBNPUD.mjs.map +0 -1
  395. package/dist/chunk-7ORB4BQP.mjs +0 -172
  396. package/dist/chunk-7ORB4BQP.mjs.map +0 -1
  397. package/dist/chunk-A76ALGBU.mjs +0 -32
  398. package/dist/chunk-A76ALGBU.mjs.map +0 -1
  399. package/dist/chunk-AHIKHJPW.mjs +0 -100
  400. package/dist/chunk-AHIKHJPW.mjs.map +0 -1
  401. package/dist/chunk-BH4GZ445.mjs +0 -15
  402. package/dist/chunk-BH4GZ445.mjs.map +0 -1
  403. package/dist/chunk-BZNDFBJV.mjs +0 -28
  404. package/dist/chunk-BZNDFBJV.mjs.map +0 -1
  405. package/dist/chunk-DP5YVP6F.mjs +0 -8
  406. package/dist/chunk-DP5YVP6F.mjs.map +0 -1
  407. package/dist/chunk-E77IVDYN.mjs +0 -259
  408. package/dist/chunk-E77IVDYN.mjs.map +0 -1
  409. package/dist/chunk-EFIIKXVE.mjs +0 -215
  410. package/dist/chunk-EFIIKXVE.mjs.map +0 -1
  411. package/dist/chunk-FFJ53DFW.mjs +0 -376
  412. package/dist/chunk-FFJ53DFW.mjs.map +0 -1
  413. package/dist/chunk-GFYW3WH2.mjs +0 -16
  414. package/dist/chunk-GFYW3WH2.mjs.map +0 -1
  415. package/dist/chunk-H74LIKJ4.mjs +0 -60
  416. package/dist/chunk-H74LIKJ4.mjs.map +0 -1
  417. package/dist/chunk-I2HXJCCV.mjs +0 -85
  418. package/dist/chunk-I2HXJCCV.mjs.map +0 -1
  419. package/dist/chunk-IKDBPQHH.mjs +0 -127
  420. package/dist/chunk-IKDBPQHH.mjs.map +0 -1
  421. package/dist/chunk-J5R7OCMN.mjs +0 -85
  422. package/dist/chunk-J5R7OCMN.mjs.map +0 -1
  423. package/dist/chunk-LII2L2MR.mjs +0 -55
  424. package/dist/chunk-LII2L2MR.mjs.map +0 -1
  425. package/dist/chunk-M5FMJETI.mjs +0 -1
  426. package/dist/chunk-M5FMJETI.mjs.map +0 -1
  427. package/dist/chunk-NF6DMD5M.mjs +0 -108
  428. package/dist/chunk-NF6DMD5M.mjs.map +0 -1
  429. package/dist/chunk-NKZVASPJ.mjs +0 -55
  430. package/dist/chunk-NKZVASPJ.mjs.map +0 -1
  431. package/dist/chunk-O2GIY7JB.mjs +0 -14
  432. package/dist/chunk-O2GIY7JB.mjs.map +0 -1
  433. package/dist/chunk-PFU3PH6M.mjs +0 -1
  434. package/dist/chunk-PFU3PH6M.mjs.map +0 -1
  435. package/dist/chunk-PIBEHEXO.mjs +0 -28
  436. package/dist/chunk-PIBEHEXO.mjs.map +0 -1
  437. package/dist/chunk-QCV3VHXF.mjs +0 -24
  438. package/dist/chunk-QCV3VHXF.mjs.map +0 -1
  439. package/dist/chunk-RS7RJSRW.mjs +0 -50
  440. package/dist/chunk-RS7RJSRW.mjs.map +0 -1
  441. package/dist/chunk-WDQQRJGG.mjs +0 -21
  442. package/dist/chunk-WDQQRJGG.mjs.map +0 -1
  443. package/dist/chunk-WQEPYQ4F.mjs +0 -33
  444. package/dist/chunk-WQEPYQ4F.mjs.map +0 -1
  445. package/dist/chunk-ZCQVH7JT.mjs +0 -46
  446. package/dist/chunk-ZCQVH7JT.mjs.map +0 -1
  447. package/dist/components/ButtonKit.d.mts +0 -55
  448. package/dist/components/ButtonKit.mjs +0 -8
  449. package/dist/components/ButtonKit.mjs.map +0 -1
  450. package/dist/components/index.d.mts +0 -2
  451. package/dist/components/index.mjs +0 -9
  452. package/dist/components/index.mjs.map +0 -1
  453. package/dist/config.d.mts +0 -63
  454. package/dist/config.mjs +0 -10
  455. package/dist/config.mjs.map +0 -1
  456. package/dist/environment/actions/common.d.mts +0 -12
  457. package/dist/environment/actions/common.mjs +0 -10
  458. package/dist/environment/actions/common.mjs.map +0 -1
  459. package/dist/environment/actions/development.d.mts +0 -10
  460. package/dist/environment/actions/development.mjs +0 -36
  461. package/dist/environment/actions/development.mjs.map +0 -1
  462. package/dist/environment/bundler/bundle.d.mts +0 -3
  463. package/dist/environment/bundler/bundle.mjs +0 -11
  464. package/dist/environment/bundler/bundle.mjs.map +0 -1
  465. package/dist/environment/bundler/codegen.d.mts +0 -3
  466. package/dist/environment/bundler/codegen.mjs +0 -48
  467. package/dist/environment/bundler/codegen.mjs.map +0 -1
  468. package/dist/environment/bundler/shims.d.mts +0 -3
  469. package/dist/environment/bundler/shims.mjs +0 -8
  470. package/dist/environment/bundler/shims.mjs.map +0 -1
  471. package/dist/environment/cli.d.mts +0 -2
  472. package/dist/environment/cli.mjs +0 -55
  473. package/dist/environment/cli.mjs.map +0 -1
  474. package/dist/environment/common/config.d.mts +0 -11
  475. package/dist/environment/common/config.mjs +0 -10
  476. package/dist/environment/common/config.mjs.map +0 -1
  477. package/dist/environment/common/logger.d.mts +0 -9
  478. package/dist/environment/common/logger.mjs +0 -9
  479. package/dist/environment/common/logger.mjs.map +0 -1
  480. package/dist/environment/env.d.mts +0 -11
  481. package/dist/environment/env.mjs +0 -10
  482. package/dist/environment/env.mjs.map +0 -1
  483. package/dist/handlers/command-handler/CommandHandler.d.mts +0 -5
  484. package/dist/handlers/command-handler/CommandHandler.mjs +0 -18
  485. package/dist/handlers/command-handler/CommandHandler.mjs.map +0 -1
  486. package/dist/handlers/command-handler/functions/loadCommandsWithRest.d.mts +0 -35
  487. package/dist/handlers/command-handler/functions/loadCommandsWithRest.mjs +0 -9
  488. package/dist/handlers/command-handler/functions/loadCommandsWithRest.mjs.map +0 -1
  489. package/dist/handlers/command-handler/functions/registerCommands.d.mts +0 -20
  490. package/dist/handlers/command-handler/functions/registerCommands.mjs +0 -10
  491. package/dist/handlers/command-handler/functions/registerCommands.mjs.map +0 -1
  492. package/dist/handlers/command-handler/typings.d.mts +0 -5
  493. package/dist/handlers/command-handler/typings.mjs +0 -1
  494. package/dist/handlers/command-handler/typings.mjs.map +0 -1
  495. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.d.mts +0 -9
  496. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.mjs +0 -8
  497. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.mjs.map +0 -1
  498. package/dist/handlers/command-handler/validations/devOnly.d.mts +0 -9
  499. package/dist/handlers/command-handler/validations/devOnly.mjs +0 -8
  500. package/dist/handlers/command-handler/validations/devOnly.mjs.map +0 -1
  501. package/dist/handlers/command-handler/validations/index.d.mts +0 -10
  502. package/dist/handlers/command-handler/validations/index.mjs +0 -10
  503. package/dist/handlers/command-handler/validations/index.mjs.map +0 -1
  504. package/dist/handlers/command-handler/validations/permissions.d.mts +0 -9
  505. package/dist/handlers/command-handler/validations/permissions.mjs +0 -8
  506. package/dist/handlers/command-handler/validations/permissions.mjs.map +0 -1
  507. package/dist/handlers/event-handler/EventHandler.d.mts +0 -5
  508. package/dist/handlers/event-handler/EventHandler.mjs +0 -12
  509. package/dist/handlers/event-handler/EventHandler.mjs.map +0 -1
  510. package/dist/handlers/event-handler/typings.d.mts +0 -5
  511. package/dist/handlers/event-handler/typings.mjs +0 -1
  512. package/dist/handlers/event-handler/typings.mjs.map +0 -1
  513. package/dist/handlers/index.d.mts +0 -5
  514. package/dist/handlers/index.mjs +0 -27
  515. package/dist/handlers/index.mjs.map +0 -1
  516. package/dist/handlers/validation-handler/ValidationHandler.d.mts +0 -14
  517. package/dist/handlers/validation-handler/ValidationHandler.mjs +0 -12
  518. package/dist/handlers/validation-handler/ValidationHandler.mjs.map +0 -1
  519. package/dist/handlers/validation-handler/typings.d.mts +0 -14
  520. package/dist/handlers/validation-handler/typings.mjs +0 -1
  521. package/dist/handlers/validation-handler/typings.mjs.map +0 -1
  522. package/dist/hooks/common.d.mts +0 -12
  523. package/dist/hooks/common.mjs +0 -40
  524. package/dist/hooks/common.mjs.map +0 -1
  525. package/dist/hooks/index.d.mts +0 -14
  526. package/dist/hooks/index.mjs +0 -50
  527. package/dist/hooks/index.mjs.map +0 -1
  528. package/dist/hooks/response.d.mts +0 -7
  529. package/dist/hooks/response.mjs +0 -34
  530. package/dist/hooks/response.mjs.map +0 -1
  531. package/dist/hooks/useChannel.d.mts +0 -5
  532. package/dist/hooks/useChannel.mjs +0 -34
  533. package/dist/hooks/useChannel.mjs.map +0 -1
  534. package/dist/hooks/useClient.d.mts +0 -5
  535. package/dist/hooks/useClient.mjs +0 -34
  536. package/dist/hooks/useClient.mjs.map +0 -1
  537. package/dist/hooks/useCommandData.d.mts +0 -5
  538. package/dist/hooks/useCommandData.mjs +0 -34
  539. package/dist/hooks/useCommandData.mjs.map +0 -1
  540. package/dist/hooks/useCommandKit.d.mts +0 -9
  541. package/dist/hooks/useCommandKit.mjs +0 -34
  542. package/dist/hooks/useCommandKit.mjs.map +0 -1
  543. package/dist/hooks/useGuild.d.mts +0 -5
  544. package/dist/hooks/useGuild.mjs +0 -34
  545. package/dist/hooks/useGuild.mjs.map +0 -1
  546. package/dist/hooks/useInteraction.d.mts +0 -9
  547. package/dist/hooks/useInteraction.mjs +0 -34
  548. package/dist/hooks/useInteraction.mjs.map +0 -1
  549. package/dist/hooks/useMember.d.mts +0 -5
  550. package/dist/hooks/useMember.mjs +0 -34
  551. package/dist/hooks/useMember.mjs.map +0 -1
  552. package/dist/hooks/useUser.d.mts +0 -5
  553. package/dist/hooks/useUser.mjs +0 -34
  554. package/dist/hooks/useUser.mjs.map +0 -1
  555. package/dist/index.d.mts +0 -26
  556. package/dist/index.mjs +0 -77
  557. package/dist/index.mjs.map +0 -1
  558. package/dist/types/index.d.mts +0 -5
  559. package/dist/types/index.mjs +0 -12
  560. package/dist/types/index.mjs.map +0 -1
  561. package/dist/typings.d.mts +0 -5
  562. package/dist/typings.mjs +0 -1
  563. package/dist/typings.mjs.map +0 -1
  564. package/dist/utils/clone.d.mts +0 -3
  565. package/dist/utils/clone.mjs +0 -8
  566. package/dist/utils/clone.mjs.map +0 -1
  567. package/dist/utils/colors.d.mts +0 -27
  568. package/dist/utils/colors.mjs +0 -8
  569. package/dist/utils/colors.mjs.map +0 -1
  570. package/dist/utils/get-paths.d.mts +0 -4
  571. package/dist/utils/get-paths.mjs +0 -10
  572. package/dist/utils/get-paths.mjs.map +0 -1
  573. package/dist/utils/resolve-file-url.d.mts +0 -8
  574. package/dist/utils/resolve-file-url.mjs +0 -8
  575. package/dist/utils/resolve-file-url.mjs.map +0 -1
  576. package/dist/utils/signal.d.mts +0 -21
  577. package/dist/utils/signal.mjs +0 -10
  578. package/dist/utils/signal.mjs.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,5 @@
1
+ Copyright 2025 Avraj Sahota
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.
4
+
5
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <div align="center">
2
- <img src="https://raw.githubusercontent.com/underctrl-io/commandkit/master/apps/docs/public/ckit_logo.svg" width="60%" />
2
+ <img src="https://raw.githubusercontent.com/underctrl-io/commandkit/main/apps/website/static/img/ckit_logo.svg" width="60%" />
3
3
  <br />
4
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>
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>
@@ -15,100 +15,42 @@ CommandKit is a library that makes it easy to handle commands and events in your
15
15
  ## Features
16
16
 
17
17
  - Beginner friendly 🚀
18
- - Slash + context menu commands support
19
- - Multiple dev guilds, users, & roles support 🤝
20
- - Automatic command updates 🤖
21
- - REST registration behaviour 📍
22
- - Easy command line interface 🖥️
23
- - And much more! 🧪
18
+ - Suitable for both beginners and advanced users 👶👨‍💻
19
+ - Slash + context menu commands + prefix commands support
20
+ - Automatic command registration and updates 🤖
21
+ - Command middlewares for easy command management 🛠️
22
+ - Localization support through `@commandkit/i18n` plugin 🌍
23
+ - Plugin system to extend functionality 🔌
24
+ - Built-in command line interface for easy development 🖥️
25
+ - Out-of-the-box support for TypeScript and JavaScript 📜
26
+ - Built-in customizable cache system for speedy data storage and retrieval 🗄️
27
+ - User installable/guild scoped commands 🔧
28
+ - Custom events support 🔔
29
+ - JSX support for declaring Discord interaction components and modals 🎨
30
+ - Easy to use interaction components and modals system (forget about collectors) 🧩
31
+ - Less boilerplate code, more productivity 💪
32
+ - and much more...
24
33
 
25
34
  ## Documentation
26
35
 
27
- You can find the full documentation [here](https://commandkit.js.org).
36
+ You can find the full documentation [here](https://commandkit.dev).
28
37
 
29
38
  ## Installation
30
39
 
31
40
  [![npm](https://nodei.co/npm/commandkit.png)](https://nodei.co/npm/commandkit/)
32
41
 
33
- To install CommandKit, simply run the following command:
42
+ To create a new CommandKit project, you can use the following command:
34
43
 
35
- For npm:
36
44
 
37
45
  ```bash
38
- npm install commandkit
46
+ npm create commandkit
39
47
  ```
40
48
 
41
- Yarn:
49
+ This will prompt you to enter few details about your project. Once you have entered the details, you can simply run `commandkit dev` to start the bot application.
42
50
 
43
- ```bash
44
- yarn add commandkit
45
- ```
46
-
47
- pnpm:
48
-
49
- ```bash
50
- pnpm add commandkit
51
- ```
52
-
53
- ### Install development version
54
-
55
- To install the development version of CommandKit, run the following command:
56
-
57
- ```bash
58
- npm install commandkit@dev
59
- ```
60
-
61
- > ⚠️ The development version is likely to have bugs.
62
-
63
- ## Usage
51
+ ## Getting Started
64
52
 
65
- This is a simple overview of how to set up this library with all the options. You can read more in the [full documentation](https://commandkit.js.org)
66
-
67
- ```js
68
- // index.js
69
- const { Client, GatewayIntentBits } = require('discord.js');
70
- const { CommandKit } = require('commandkit');
71
- const path = require('path');
72
-
73
- const client = new Client({
74
- intents: [
75
- GatewayIntentBits.Guilds,
76
- GatewayIntentBits.GuildMessages,
77
- GatewayIntentBits.MessageContent,
78
- ],
79
- });
80
-
81
- new CommandKit({
82
- // Your discord.js client object
83
- client,
84
-
85
- // Path to the commands folder
86
- commandsPath: path.join(__dirname, 'commands'),
87
-
88
- // Path to the events folder
89
- eventsPath: path.join(__dirname, 'events'),
90
-
91
- // Path to the validations folder (only valid if "commandsPath" was provided)
92
- validationsPath: path.join(__dirname, 'validations'),
93
-
94
- // Array of development server IDs (used to register and run devOnly commands)
95
- devGuildIds: ['1234567890', '0987654321'],
96
-
97
- // Array of developer user IDs (used for devOnly commands)
98
- devUserIds: ['1234567890', '0987654321'],
99
-
100
- // Array of developer role IDs (used for devOnly commands)
101
- devRoleIds: ['1234567890', '0987654321'],
102
-
103
- // Disable CommandKit's built-in validations
104
- skipBuiltInValidations: true,
105
-
106
- // Update command registration/reload behaviour to register all commands at once
107
- bulkRegister: true,
108
- });
109
-
110
- client.login('YOUR_TOKEN_HERE');
111
- ```
53
+ To get started with CommandKit, you can check out the [quick start guide](https://commandkit.dev/docs/next/guide/installation).
112
54
 
113
55
  ## Support and Suggestions
114
56
 
package/ai.cjs ADDED
@@ -0,0 +1,21 @@
1
+ const {
2
+ AiContext,
3
+ AiPlugin,
4
+ configureAI,
5
+ createSystemPrompt,
6
+ createTool,
7
+ getAIConfig,
8
+ useAIContext,
9
+ ai,
10
+ } = require('@commandkit/ai');
11
+
12
+ module.exports = {
13
+ AiContext,
14
+ AiPlugin,
15
+ configureAI,
16
+ createSystemPrompt,
17
+ createTool,
18
+ getAIConfig,
19
+ useAIContext,
20
+ ai,
21
+ };
package/ai.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from '@commandkit/ai';
package/analytics.cjs ADDED
@@ -0,0 +1,21 @@
1
+ const { getCommandKit } = require('./dist/context/async-context.js');
2
+ const { AnalyticsEngine } = require('./dist/analytics/analytics-engine.js');
3
+ const { noAnalytics } = require('./dist/analytics/utils.js');
4
+ const { AnalyticsEvents } = require('./dist/analytics/constants.js');
5
+
6
+ function useAnalytics() {
7
+ const commandkit = getCommandKit(true);
8
+ return commandkit.analytics;
9
+ }
10
+
11
+ function track(event) {
12
+ return useAnalytics().track(event);
13
+ }
14
+
15
+ module.exports = {
16
+ AnalyticsEvents,
17
+ AnalyticsEngine,
18
+ useAnalytics,
19
+ noAnalytics,
20
+ track,
21
+ };
package/analytics.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import type { AnalyticsEngine } from './dist/analytics/analytics-engine';
2
+
3
+ export * from './dist/analytics/analytics-engine';
4
+ export * from './dist/analytics/analytics-provider';
5
+ export { noAnalytics } from './dist/analytics/utils';
6
+ export { AnalyticsEvents } from './dist/analytics/constants';
7
+
8
+ export function useAnalytics(): AnalyticsEngine;
9
+ export function track(event: AnalyticsEvent): Promise<void>;
@@ -0,0 +1,9 @@
1
+ const {
2
+ AsyncQueue,
3
+ createAsyncQueue,
4
+ } = require('./dist/utils/useful-stuff/async-queue.js');
5
+
6
+ module.exports = {
7
+ AsyncQueue,
8
+ createAsyncQueue,
9
+ };
@@ -0,0 +1 @@
1
+ export * from './dist/utils/useful-stuff/async-queue.js';
package/bin/index.mjs ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { bootstrapCommandkitCLI } from '../dist/index.js';
4
+
5
+ await bootstrapCommandkitCLI(process.argv);
package/cache.cjs ADDED
@@ -0,0 +1,23 @@
1
+ const {
2
+ cacheTag,
3
+ cacheLife,
4
+ revalidateTag,
5
+ cleanup,
6
+ MemoryCache,
7
+ CacheProvider,
8
+ isCachedFunction,
9
+ setCacheProvider,
10
+ getCacheProvider,
11
+ } = require('@commandkit/cache');
12
+
13
+ module.exports = {
14
+ cacheTag,
15
+ cacheLife,
16
+ revalidateTag,
17
+ cleanup,
18
+ MemoryCache,
19
+ CacheProvider,
20
+ isCachedFunction,
21
+ setCacheProvider,
22
+ getCacheProvider,
23
+ };
package/cache.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ export {
2
+ cacheTag,
3
+ cacheLife,
4
+ revalidateTag,
5
+ cleanup,
6
+ MemoryCache,
7
+ CacheProvider,
8
+ CacheEntry,
9
+ isCachedFunction,
10
+ setCacheProvider,
11
+ getCacheProvider,
12
+ // @ts-ignore
13
+ } from '@commandkit/cache';
package/components.cjs ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/components/index.js');
@@ -0,0 +1 @@
1
+ export * from './dist/components/index';
package/config.cjs ADDED
@@ -0,0 +1,5 @@
1
+ const { defineConfig } = require('./dist/config/config.js');
2
+
3
+ module.exports = {
4
+ defineConfig,
5
+ };
package/config.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { defineConfig, CommandKitConfiguration as Config } from './dist/index';
@@ -0,0 +1,25 @@
1
+ const require_chunk = require('./chunk-nOFOJqeH.js');
2
+ const discord_js = require_chunk.__toESM(require("discord.js"));
3
+
4
+ //#region src/components/v1/action-row/ActionRow.ts
5
+ /**
6
+ * The action row component.
7
+ * @param props The action row properties.
8
+ * @returns The commandkit element.
9
+ * @example <ActionRow><Button label="Click me" style={ButtonStyle.Primary} customId="click_me" /></ActionRow>
10
+ */
11
+ function ActionRow(props) {
12
+ const row = new discord_js.ActionRowBuilder();
13
+ if (Array.isArray(props.children)) row.setComponents(...props.children);
14
+ else if (props.children) row.setComponents(props.children);
15
+ return row;
16
+ }
17
+
18
+ //#endregion
19
+ Object.defineProperty(exports, 'ActionRow', {
20
+ enumerable: true,
21
+ get: function () {
22
+ return ActionRow;
23
+ }
24
+ });
25
+ //# sourceMappingURL=ActionRow-CmTHbo2t.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionRow-CmTHbo2t.js","names":[],"sources":["../src/components/v1/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;AAEhB,KAAI,MAAM,QAAQ,MAAM,UAEtB,KAAI,cAAc,GAAG,MAAM;UAClB,MAAM,SAEf,KAAI,cAAc,MAAM;AAG1B,QAAO;AACT"}
@@ -0,0 +1,20 @@
1
+ import { AnyCommandKitElement, CommandKitElement } from "./element-CAXu1XtK.js";
2
+
3
+ //#region src/components/v1/action-row/ActionRow.d.ts
4
+
5
+ /**
6
+ * The properties for the action row component.
7
+ */
8
+ interface ActionRowProps {
9
+ children?: AnyCommandKitElement[] | AnyCommandKitElement;
10
+ }
11
+ /**
12
+ * The action row component.
13
+ * @param props The action row properties.
14
+ * @returns The commandkit element.
15
+ * @example <ActionRow><Button label="Click me" style={ButtonStyle.Primary} customId="click_me" /></ActionRow>
16
+ */
17
+ declare function ActionRow(props: ActionRowProps): CommandKitElement<'action-row'>;
18
+ //#endregion
19
+ export { ActionRow, ActionRowProps };
20
+ //# sourceMappingURL=ActionRow-DKnFVDME.d.ts.map
@@ -0,0 +1,39 @@
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";
5
+ import { ButtonStyle, ComponentEmojiResolvable } from "discord.js";
6
+
7
+ //#region src/components/v1/button/Button.d.ts
8
+
9
+ /**
10
+ * The button children type.
11
+ */
12
+ type ButtonChildrenLike = string | number | boolean;
13
+ /**
14
+ * The button props
15
+ */
16
+ interface ButtonProps {
17
+ label?: string;
18
+ style?: ButtonStyle;
19
+ emoji?: ComponentEmojiResolvable;
20
+ disabled?: boolean;
21
+ customId?: string;
22
+ url?: string;
23
+ skuId?: string;
24
+ onClick?: CommandKitButtonBuilderInteractionCollectorDispatch;
25
+ onError?: EventInterceptorErrorHandler;
26
+ options?: CommandKitButtonBuilderInteractionCollectorDispatchContextData;
27
+ onEnd?: CommandKitButtonBuilderOnEnd;
28
+ children?: MaybeArray<ButtonChildrenLike>;
29
+ }
30
+ /**
31
+ * The button component.
32
+ * @param props The button properties.
33
+ * @returns The commandkit element.
34
+ * @example <Button style={ButtonStyle.Primary} customId="click_me">Click Me</Button>
35
+ */
36
+ declare function Button(props: ButtonProps): CommandKitElement<'button-kit'>;
37
+ //#endregion
38
+ export { Button, ButtonChildrenLike, ButtonProps };
39
+ //# sourceMappingURL=Button-4ZUXdA56.d.ts.map
@@ -0,0 +1,87 @@
1
+ import { EventInterceptorContextData, EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
2
+ import { Awaitable, ButtonBuilder, ButtonInteraction, Events } from "discord.js";
3
+
4
+ //#region src/components/v1/button/ButtonKit.d.ts
5
+
6
+ /**
7
+ * The predicate function that filters button interactions.
8
+ * It receives a ButtonInteraction and returns a boolean or a Promise that resolves to a boolean.
9
+ */
10
+ type ButtonKitPredicate = (interaction: ButtonInteraction) => Awaitable<boolean>;
11
+ /**
12
+ * The handler to run when a button is clicked. This handler is called with the interaction as the first argument.
13
+ * If the first argument is null, it means that the interaction collector has been destroyed.
14
+ */
15
+ type OnButtonKitClick = CommandKitButtonBuilderInteractionCollectorDispatch;
16
+ /**
17
+ * The handler to run when the interaction collector ends. This handler is called with the reason as the first argument.
18
+ * If the first argument is null, it means that the interaction collector has been destroyed.
19
+ */
20
+ type OnButtonKitEnd = CommandKitButtonBuilderOnEnd;
21
+ /**
22
+ * The handler to run when a button is clicked. This handler is called with the interaction as the first argument.
23
+ * If the first argument is null, it means that the interaction collector has been destroyed.
24
+ */
25
+ type CommandKitButtonBuilderInteractionCollectorDispatch = (interaction: ButtonInteraction, context: ButtonKit) => Awaitable<void>;
26
+ /**
27
+ * The handler to run when the interaction collector ends. This handler is called with the reason as the first argument.
28
+ * If the first argument is null, it means that the interaction collector has been destroyed.
29
+ */
30
+ type CommandKitButtonBuilderOnEnd = (reason: string) => Awaitable<void>;
31
+ /**
32
+ * The context data for the interaction collector.
33
+ * This includes the autoReset, time, filter, onEnd, and onError properties.
34
+ */
35
+ type CommandKitButtonBuilderInteractionCollectorDispatchContextData = EventInterceptorContextData<Events.InteractionCreate>;
36
+ /**
37
+ * A builder for creating buttons with additional features like interaction collectors and event handling.
38
+ */
39
+ declare class ButtonKit extends ButtonBuilder {
40
+ #private;
41
+ /**
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
+ */
66
+ onClick(handler: CommandKitButtonBuilderInteractionCollectorDispatch, data?: CommandKitButtonBuilderInteractionCollectorDispatchContextData): this;
67
+ onEnd(handler: CommandKitButtonBuilderOnEnd): this;
68
+ /**
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
+ */
73
+ onError(handler: EventInterceptorErrorHandler): this;
74
+ /**
75
+ * Sets a filter for the interaction collector.
76
+ * @param predicate The filter to use for the interaction collector
77
+ */
78
+ filter(predicate: ButtonKitPredicate): this;
79
+ private get customId();
80
+ /**
81
+ * Disposes of the button collector and cleans up resources.
82
+ */
83
+ dispose(): this;
84
+ }
85
+ //#endregion
86
+ export { ButtonKit, ButtonKitPredicate, CommandKitButtonBuilderInteractionCollectorDispatch, CommandKitButtonBuilderInteractionCollectorDispatchContextData, CommandKitButtonBuilderOnEnd, OnButtonKitClick, OnButtonKitEnd };
87
+ //# sourceMappingURL=ButtonKit-C7r7RPNf.d.ts.map
@@ -0,0 +1,67 @@
1
+ import { EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
2
+ import { CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, OnSelectMenuKitSubmit, SelectMenuKitPredicate } from "./common-DOCvOVC4.js";
3
+ import { ChannelSelectMenuBuilder, ChannelSelectMenuInteraction } from "discord.js";
4
+
5
+ //#region src/components/v1/select-menu/ChannelSelectMenuKit.d.ts
6
+
7
+ /**
8
+ * Type for the handler function that is called when the channel select menu is submitted.
9
+ */
10
+ type OnChannelSelectMenuKitSubmit = OnSelectMenuKitSubmit<ChannelSelectMenuInteraction, ChannelSelectMenuKit>;
11
+ /**
12
+ * Type for the predicate function that filters channel select menu interactions.
13
+ * It receives a ChannelSelectMenuInteraction and returns a boolean or a Promise that resolves to a boolean.
14
+ */
15
+ type ChannelSelectMenuKitPredicate = SelectMenuKitPredicate<ChannelSelectMenuInteraction>;
16
+ /**
17
+ * A builder for creating channel select menus with additional features like interaction collectors and event handling.
18
+ * This class extends the ChannelSelectMenuBuilder from discord.js and adds methods for handling interactions.
19
+ * 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.
20
+ */
21
+ declare class ChannelSelectMenuKit extends ChannelSelectMenuBuilder {
22
+ #private;
23
+ /**
24
+ * Sets the handler to run when the modal is submitted.
25
+ * @param handler - The handler to run when the modal is submitted.
26
+ * @param data - The context data for the interaction collector.
27
+ * @returns This instance of the modal builder.
28
+ * @example
29
+ * ```ts
30
+ * const modal = new ChannelSelectMenuKit()
31
+ * .setTitle('My Modal')
32
+ * .setCustomId('my-modal')
33
+ * .filter((interaction) => interaction.Channel.id === '1234567890')
34
+ * .onSelect(async (interaction) => {
35
+ * await interaction.reply('You submitted the modal!');
36
+ * })
37
+ * .addComponents(actionRow1, actionRow2);
38
+ * ```
39
+ */
40
+ onSelect(handler: CommandKitSelectMenuBuilderInteractionCollectorDispatch<ChannelSelectMenuInteraction, ChannelSelectMenuKit>, data?: CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData): this;
41
+ /**
42
+ * Sets the handler to run when the interaction collector ends.
43
+ * @param handler - The handler to run when the interaction collector ends.
44
+ * @returns This instance of the modal builder.
45
+ */
46
+ onEnd(handler: CommandKitSelectMenuBuilderOnEnd): this;
47
+ /**
48
+ * Sets the handler to run when the interaction collector ends.
49
+ * @param handler - The handler to run when the interaction collector ends.
50
+ * @returns This instance of the modal builder.
51
+ */
52
+ onError(handler: EventInterceptorErrorHandler): this;
53
+ /**
54
+ * Sets a filter for the interaction collector.
55
+ * @param predicate - The filter to use for the interaction collector.
56
+ * @returns This instance of the modal builder.
57
+ */
58
+ filter(predicate: SelectMenuKitPredicate<ChannelSelectMenuInteraction>): this;
59
+ private get customId();
60
+ /**
61
+ * Cleans up the interaction collector and removes the handler.
62
+ */
63
+ dispose(): this;
64
+ }
65
+ //#endregion
66
+ export { ChannelSelectMenuKit, ChannelSelectMenuKitPredicate, OnChannelSelectMenuKitSubmit };
67
+ //# sourceMappingURL=ChannelSelectMenuKit-BrXvBYNH.d.ts.map
@@ -0,0 +1,87 @@
1
+ const require_chunk = require('./chunk-nOFOJqeH.js');
2
+ const node_events = require_chunk.__toESM(require("node:events"));
3
+
4
+ //#region src/events/CommandKitEventsChannel.ts
5
+ /**
6
+ * Represents a channel for emitting and listening to events in CommandKit.
7
+ * This class provides methods to manage event listeners and emit events
8
+ * within a specific namespace.
9
+ */
10
+ var CommandKitEventsChannel = class {
11
+ emitter = new node_events.default();
12
+ /**
13
+ * Creates a new instance of CommandKitEventsChannel.
14
+ * @param commandkit The CommandKit instance that this channel belongs to.
15
+ */
16
+ constructor(commandkit) {
17
+ this.commandkit = commandkit;
18
+ }
19
+ /**
20
+ * Creates a namespaced event channel. This allows you to manage events
21
+ * within a specific namespace, preventing conflicts with other event channels.
22
+ * This is useful for organizing events related to different parts of your application.
23
+ * @param namespace The namespace for the event channel.
24
+ * @returns An object containing methods for managing events within the namespace.
25
+ * @example commandkit.events.to('customNamespace').emit('eventName', data);
26
+ */
27
+ to(namespace) {
28
+ return {
29
+ on: this.on.bind(this, namespace),
30
+ off: this.off.bind(this, namespace),
31
+ once: this.once.bind(this, namespace),
32
+ emit: this.emit.bind(this, namespace),
33
+ removeAllListeners: this.removeAllListeners.bind(this, namespace)
34
+ };
35
+ }
36
+ /**
37
+ * Register an event listener for a specific event within the namespace.
38
+ * @param namespace The namespace for the event channel.
39
+ * @param event The name of the event to listen for.
40
+ * @param listener The function to call when the event is emitted.
41
+ */
42
+ on(namespace, event, listener) {
43
+ this.emitter.on(`${namespace}:${event}`, listener);
44
+ }
45
+ /**
46
+ * Unregister an event listener for a specific event within the namespace.
47
+ * @param namespace The namespace for the event channel.
48
+ * @param event The name of the event to stop listening for.
49
+ * @param listener The function that was registered as the listener.
50
+ */
51
+ off(namespace, event, listener) {
52
+ this.emitter.off(`${namespace}:${event}`, listener);
53
+ }
54
+ /**
55
+ * Register an event listener that will be called only once for a specific event
56
+ * within the namespace.
57
+ * @param namespace The namespace for the event channel.
58
+ * @param event The name of the event to listen for.
59
+ * @param listener The function to call when the event is emitted.
60
+ */
61
+ once(namespace, event, listener) {
62
+ this.emitter.once(`${namespace}:${event}`, listener);
63
+ }
64
+ /**
65
+ * Emit an event within the specified namespace, calling all registered listeners.
66
+ * @param namespace The namespace for the event channel.
67
+ * @param event The name of the event to emit.
68
+ * @param args The arguments to pass to the listeners.
69
+ * @returns A boolean indicating whether any listeners were called.
70
+ */
71
+ emit(namespace, event, ...args) {
72
+ return this.emitter.emit(`${namespace}:${event}`, ...args);
73
+ }
74
+ removeAllListeners(namespace, event) {
75
+ if (event) this.emitter.removeAllListeners(`${namespace}:${event}`);
76
+ else this.emitter.removeAllListeners(namespace);
77
+ }
78
+ };
79
+
80
+ //#endregion
81
+ Object.defineProperty(exports, 'CommandKitEventsChannel', {
82
+ enumerable: true,
83
+ get: function () {
84
+ return CommandKitEventsChannel;
85
+ }
86
+ });
87
+ //# sourceMappingURL=CommandKitEventsChannel-Bgw0XCOl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommandKitEventsChannel-Bgw0XCOl.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;;;;;CAMtB,AAAO,YAAY,AAAgB,YAAwB;EAAxB;CAAyB;;;;;;;;;CAU5D,AAAO,GAAG,WAAmB;AAC3B,SAAO;GACL,IAAI,KAAK,GAAG,KAAK,MAAM;GACvB,KAAK,KAAK,IAAI,KAAK,MAAM;GACzB,MAAM,KAAK,KAAK,KAAK,MAAM;GAC3B,MAAM,KAAK,KAAK,KAAK,MAAM;GAC3B,oBAAoB,KAAK,mBAAmB,KAAK,MAAM;GACxD;CACH;;;;;;;CAQA,AAAO,GAAG,WAAmB,OAAe,UAA4B;AACtE,OAAK,QAAQ,GAAG,GAAG,UAAU,GAAG,SAAS;CAC3C;;;;;;;CAQA,AAAO,IAAI,WAAmB,OAAe,UAA4B;AACvE,OAAK,QAAQ,IAAI,GAAG,UAAU,GAAG,SAAS;CAC5C;;;;;;;;CASA,AAAO,KAAK,WAAmB,OAAe,UAA4B;AACxE,OAAK,QAAQ,KAAK,GAAG,UAAU,GAAG,SAAS;CAC7C;;;;;;;;CASA,AAAO,KAAK,WAAmB,OAAe,GAAG,MAAa;AAC5D,SAAO,KAAK,QAAQ,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG;CACvD;CASA,AAAO,mBAAmB,WAAmB,OAAsB;AACjE,MAAI,MACF,MAAK,QAAQ,mBAAmB,GAAG,UAAU,GAAG;MAEhD,MAAK,QAAQ,mBAAmB;CAEpC;AACF"}