commandkit 1.2.1 → 1.2.2

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 (271) hide show
  1. package/README.md +1 -1
  2. package/cache.cjs +2 -0
  3. package/cache.d.ts +1 -0
  4. package/dist/{ActionRow-Bt9qi0Mb.d.ts → ActionRow-DSh9roc5.d.ts} +2 -3
  5. package/dist/{Button-DxJLcZIU.d.ts → Button-BPsE5ju0.d.ts} +5 -6
  6. package/dist/{ButtonKit-BfcyvWfj.d.ts → ButtonKit-CNPmVg3h.d.ts} +2 -3
  7. package/dist/{ChannelSelectMenuKit-DYkudikb.d.ts → ChannelSelectMenuKit-CcOdaLQ6.d.ts} +3 -4
  8. package/dist/CommandTree-qu-8oAEV.d.ts +55 -0
  9. package/dist/CommandsRouter-Co225Ae5.d.ts +242 -0
  10. package/dist/{EventInterceptor-D9JKMcfi.d.ts → EventInterceptor-wg378vJp.d.ts} +1 -2
  11. package/dist/{EventsRouter-EuuSu6NH.d.ts → EventsRouter-Bt63ZuEF.d.ts} +21 -2
  12. package/dist/{MentionableSelectMenuKit-Mu4xqP6B.d.ts → MentionableSelectMenuKit-8_Nkgn_a.d.ts} +3 -4
  13. package/dist/{MessageCommandParser-DPCbHXCS.d.ts → MessageCommandParser-BYbxHOSK.d.ts} +7 -2
  14. package/dist/{Modal-v9rrcMl-.d.ts → Modal-DbWK6VmV.d.ts} +5 -6
  15. package/dist/{ModalKit-XJSM65SV.d.ts → ModalKit-CnmUVpw-.d.ts} +2 -3
  16. package/dist/{RoleSelectMenuKit-CCjcp3HY.d.ts → RoleSelectMenuKit-Bei7DHqD.d.ts} +3 -4
  17. package/dist/{SelectMenu-CY0vvoSu.d.ts → SelectMenu-Bce_PClo.d.ts} +8 -9
  18. package/dist/{StringSelectMenuKit-G5nBTicX.d.ts → StringSelectMenuKit-CBeB9HqT.d.ts} +3 -4
  19. package/dist/TreeArtifact-D6FZ5SVd.d.ts +27 -0
  20. package/dist/{UserSelectMenuKit-D3SO_fXA.d.ts → UserSelectMenuKit-DZmeZ_Tp.d.ts} +3 -4
  21. package/dist/analytics/analytics-engine.d.ts +1 -1
  22. package/dist/analytics/analytics-engine.js +1 -1
  23. package/dist/analytics/analytics-provider.d.ts +1 -1
  24. package/dist/analytics/constants.js +0 -1
  25. package/dist/analytics/constants.js.map +1 -1
  26. package/dist/analytics/utils.js +1 -1
  27. package/dist/{analytics-engine-DnRsHBId.d.ts → analytics-engine-Bz1p7ud3.d.ts} +178 -30
  28. package/dist/app/commands/AppCommandRunner.d.ts +1 -1
  29. package/dist/app/commands/AppCommandRunner.js +1 -1
  30. package/dist/app/commands/Context.d.ts +1 -1
  31. package/dist/app/commands/Context.js +1 -1
  32. package/dist/app/commands/MessageCommandParser.d.ts +1 -1
  33. package/dist/app/commands/MessageCommandParser.js +79 -71
  34. package/dist/app/commands/MessageCommandParser.js.map +1 -1
  35. package/dist/app/commands/helpers.d.ts +1 -1
  36. package/dist/app/commands/helpers.js +0 -1
  37. package/dist/app/commands/helpers.js.map +1 -1
  38. package/dist/app/events/EventWorkerContext.d.ts +3 -3
  39. package/dist/app/events/EventWorkerContext.js +0 -1
  40. package/dist/app/events/EventWorkerContext.js.map +1 -1
  41. package/dist/app/handlers/AppCommandHandler.d.ts +1 -1
  42. package/dist/app/handlers/AppCommandHandler.js +1 -1
  43. package/dist/app/handlers/AppEventsHandler.d.ts +1 -1
  44. package/dist/app/handlers/AppEventsHandler.js +1 -1
  45. package/dist/app/index.d.ts +5 -5
  46. package/dist/app/index.js +1 -1
  47. package/dist/app/interrupt/signals.d.ts +1 -1
  48. package/dist/app/interrupt/signals.js.map +1 -1
  49. package/dist/app/middlewares/permissions.d.ts +1 -2
  50. package/dist/app/middlewares/permissions.js +1 -1
  51. package/dist/app/register/CommandRegistrar.d.ts +1 -1
  52. package/dist/app/register/CommandRegistrar.js +1 -1
  53. package/dist/app/router/CommandTree.d.ts +2 -0
  54. package/dist/app/router/CommandTree.js +1 -0
  55. package/dist/app/router/CommandsRouter.d.ts +2 -2
  56. package/dist/app/router/CommandsRouter.js +445 -24
  57. package/dist/app/router/CommandsRouter.js.map +1 -1
  58. package/dist/app/router/EventsRouter.d.ts +2 -2
  59. package/dist/app/router/EventsRouter.js +56 -3
  60. package/dist/app/router/EventsRouter.js.map +1 -1
  61. package/dist/app/router/TreeArtifact.d.ts +2 -0
  62. package/dist/app/router/TreeArtifact.js +87 -0
  63. package/dist/app/router/TreeArtifact.js.map +1 -0
  64. package/dist/app/router/index.d.ts +6 -3
  65. package/dist/app/router/index.js +8 -1
  66. package/dist/checkbox-DoR0Pcxm.d.ts +27 -0
  67. package/dist/cli/app-process.d.ts +2 -3
  68. package/dist/cli/app-process.js +15 -4
  69. package/dist/cli/app-process.js.map +1 -1
  70. package/dist/cli/build.d.ts +4 -9
  71. package/dist/cli/build.js +33 -5
  72. package/dist/cli/build.js.map +1 -1
  73. package/dist/cli/common.d.ts +3 -6
  74. package/dist/cli/common.js +2 -2
  75. package/dist/cli/common.js.map +1 -1
  76. package/dist/cli/development.d.ts +5 -6
  77. package/dist/cli/development.js +12 -12
  78. package/dist/cli/development.js.map +1 -1
  79. package/dist/cli/env.js.map +1 -1
  80. package/dist/cli/generators.js +0 -1
  81. package/dist/cli/generators.js.map +1 -1
  82. package/dist/cli/information.js +5 -5
  83. package/dist/cli/information.js.map +1 -1
  84. package/dist/cli/init.d.ts +1 -3
  85. package/dist/cli/init.js +37 -12
  86. package/dist/cli/init.js.map +1 -1
  87. package/dist/cli/production.d.ts +1 -3
  88. package/dist/cli/production.js +4 -4
  89. package/dist/cli/production.js.map +1 -1
  90. package/dist/cli/type-checker.js +0 -1
  91. package/dist/cli/type-checker.js.map +1 -1
  92. package/dist/cli/utils.d.ts +0 -1
  93. package/dist/cli/utils.js.map +1 -1
  94. package/dist/{commandkit-Bh7C1_c7.js → commandkit-DNbfLwyR.js} +786 -200
  95. package/dist/commandkit-DNbfLwyR.js.map +1 -0
  96. package/dist/commandkit.d.ts +1 -1
  97. package/dist/commandkit.js +1 -1
  98. package/dist/{common-CCvvgnxi.d.ts → common-CIbPzguv.d.ts} +2 -3
  99. package/dist/components/common/EventInterceptor.d.ts +1 -1
  100. package/dist/components/common/EventInterceptor.js +1 -0
  101. package/dist/components/common/EventInterceptor.js.map +1 -1
  102. package/dist/components/common/element.d.ts +1 -1
  103. package/dist/components/common/element.js +1 -1
  104. package/dist/components/common/types.d.ts +1 -1
  105. package/dist/components/display/common.d.ts +0 -1
  106. package/dist/components/display/common.js +1 -1
  107. package/dist/components/display/container.d.ts +1 -1
  108. package/dist/components/display/container.js +1 -1
  109. package/dist/components/display/file.d.ts +1 -1
  110. package/dist/components/display/file.js +0 -1
  111. package/dist/components/display/file.js.map +1 -1
  112. package/dist/components/display/index.d.ts +9 -8
  113. package/dist/components/display/index.js +1 -1
  114. package/dist/components/display/label.d.ts +1 -1
  115. package/dist/components/display/label.js +1 -1
  116. package/dist/components/display/media-gallery.d.ts +1 -1
  117. package/dist/components/display/media-gallery.js +1 -1
  118. package/dist/components/display/poll.d.ts +1 -1
  119. package/dist/components/display/poll.js +4 -10
  120. package/dist/components/display/poll.js.map +1 -1
  121. package/dist/components/display/section.d.ts +1 -1
  122. package/dist/components/display/section.js +1 -1
  123. package/dist/components/display/separator.d.ts +1 -1
  124. package/dist/components/display/separator.js +0 -1
  125. package/dist/components/display/separator.js.map +1 -1
  126. package/dist/components/display/text-display.d.ts +1 -1
  127. package/dist/components/display/text-display.js +0 -1
  128. package/dist/components/display/text-display.js.map +1 -1
  129. package/dist/components/index.d.ts +26 -23
  130. package/dist/components/index.js +6 -1
  131. package/dist/components/interactive/action-row/ActionRow.d.ts +1 -1
  132. package/dist/components/interactive/action-row/ActionRow.js +0 -1
  133. package/dist/components/interactive/action-row/ActionRow.js.map +1 -1
  134. package/dist/components/interactive/button/Button.d.ts +1 -1
  135. package/dist/components/interactive/button/Button.js +1 -1
  136. package/dist/components/interactive/button/ButtonKit.d.ts +1 -1
  137. package/dist/components/interactive/button/ButtonKit.js +1 -1
  138. package/dist/components/interactive/checkbox/checkbox.d.ts +2 -0
  139. package/dist/components/interactive/checkbox/checkbox.js +6 -0
  140. package/dist/components/interactive/modal/Modal.d.ts +1 -1
  141. package/dist/components/interactive/modal/Modal.js +1 -1
  142. package/dist/components/interactive/modal/ModalKit.d.ts +1 -1
  143. package/dist/components/interactive/modal/ModalKit.js +1 -1
  144. package/dist/components/interactive/radio/radio.d.ts +2 -0
  145. package/dist/components/interactive/radio/radio.js +5 -0
  146. package/dist/components/interactive/select-menu/ChannelSelectMenuKit.d.ts +1 -1
  147. package/dist/components/interactive/select-menu/ChannelSelectMenuKit.js +1 -1
  148. package/dist/components/interactive/select-menu/MentionableSelectMenuKit.d.ts +1 -1
  149. package/dist/components/interactive/select-menu/MentionableSelectMenuKit.js +1 -1
  150. package/dist/components/interactive/select-menu/RoleSelectMenuKit.d.ts +1 -1
  151. package/dist/components/interactive/select-menu/RoleSelectMenuKit.js +1 -1
  152. package/dist/components/interactive/select-menu/SelectMenu.d.ts +1 -1
  153. package/dist/components/interactive/select-menu/SelectMenu.js +1 -1
  154. package/dist/components/interactive/select-menu/StringSelectMenuKit.d.ts +1 -1
  155. package/dist/components/interactive/select-menu/StringSelectMenuKit.js +1 -1
  156. package/dist/components/interactive/select-menu/UserSelectMenuKit.d.ts +1 -1
  157. package/dist/components/interactive/select-menu/UserSelectMenuKit.js +1 -1
  158. package/dist/components/interactive/select-menu/common.d.ts +1 -1
  159. package/dist/config/config.d.ts +1 -2
  160. package/dist/config/config.js +1 -1
  161. package/dist/config/default.d.ts +1 -2
  162. package/dist/config/default.js +1 -1
  163. package/dist/config/loader.d.ts +1 -2
  164. package/dist/config/loader.js +1 -1
  165. package/dist/config/types.d.ts +2 -2
  166. package/dist/config/utils.d.ts +1 -1
  167. package/dist/config/utils.js.map +1 -1
  168. package/dist/{constants-DqtJY0t-.d.ts → constants-B7AfnOFa.d.ts} +1 -1
  169. package/dist/{constants-DwxpkIeH.d.ts → constants-kWgE3L9F.d.ts} +15 -2
  170. package/dist/{container-CYojOA9d.d.ts → container-NVgblXmw.d.ts} +1 -2
  171. package/dist/context/async-context.d.ts +1 -1
  172. package/dist/context/async-context.js +1 -1
  173. package/dist/context/environment.d.ts +1 -1
  174. package/dist/context/environment.js +1 -1
  175. package/dist/{element-DeLvTMfZ.d.ts → element-BMZYAAQ-.d.ts} +3 -4
  176. package/dist/events/CommandKitEventsChannel.d.ts +1 -1
  177. package/dist/events/CommandKitEventsChannel.js +3 -2
  178. package/dist/events/CommandKitEventsChannel.js.map +1 -1
  179. package/dist/{file-DLO1zEcH.d.ts → file-DYAmr697.d.ts} +1 -2
  180. package/dist/flags/FlagProvider.d.ts +1 -1
  181. package/dist/flags/FlagProvider.js +1 -0
  182. package/dist/flags/FlagProvider.js.map +1 -1
  183. package/dist/flags/feature-flags.d.ts +1 -1
  184. package/dist/flags/feature-flags.js +1 -1
  185. package/dist/flags/store.d.ts +1 -1
  186. package/dist/flags/store.js +0 -1
  187. package/dist/flags/store.js.map +1 -1
  188. package/dist/{helpers-zmC44Mcu.d.ts → helpers-vlnRvNJv.d.ts} +1 -2
  189. package/dist/index-CAFaKBs_.d.ts +8 -0
  190. package/dist/index-COt7nfC9.d.ts +2 -0
  191. package/dist/index-DvqHpiuh.d.ts +16 -0
  192. package/dist/index.d.ts +37 -31
  193. package/dist/index.js +14 -2
  194. package/dist/kv/constants.d.ts +1 -1
  195. package/dist/kv/constants.js.map +1 -1
  196. package/dist/kv/dotprops.js.map +1 -1
  197. package/dist/kv/kv.d.ts +0 -1
  198. package/dist/kv/kv.js +1 -1
  199. package/dist/kv/kv.js.map +1 -1
  200. package/dist/kv/serde.d.ts +1 -2
  201. package/dist/kv/serde.js +27 -27
  202. package/dist/kv/serde.js.map +1 -1
  203. package/dist/{label-DqGRqodo.d.ts → label-DClaYktn.d.ts} +1 -2
  204. package/dist/logger/DefaultLogger.d.ts +0 -1
  205. package/dist/logger/DefaultLogger.js +1 -1
  206. package/dist/logger/Logger.d.ts +0 -1
  207. package/dist/logger/Logger.js +1 -1
  208. package/dist/logger/NoopLogger.d.ts +0 -1
  209. package/dist/logger/NoopLogger.js.map +1 -1
  210. package/dist/{media-gallery-Ca8es-eB.d.ts → media-gallery-z2Snzz-u.d.ts} +1 -2
  211. package/dist/plugins/CompilerPlugin.d.ts +1 -1
  212. package/dist/plugins/CompilerPlugin.js +2 -2
  213. package/dist/plugins/CompilerPlugin.js.map +1 -1
  214. package/dist/plugins/PluginCommon.d.ts +1 -1
  215. package/dist/plugins/PluginCommon.js +1 -1
  216. package/dist/plugins/PluginCommon.js.map +1 -1
  217. package/dist/plugins/RuntimePlugin.d.ts +1 -1
  218. package/dist/plugins/RuntimePlugin.js +2 -2
  219. package/dist/plugins/RuntimePlugin.js.map +1 -1
  220. package/dist/plugins/index.d.ts +1 -1
  221. package/dist/plugins/index.js +1 -1
  222. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -1
  223. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +1 -1
  224. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -1
  225. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +1 -1
  226. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -1
  227. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +1 -1
  228. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -2
  229. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +1 -1
  230. package/dist/plugins/plugin-runtime/runtime.d.ts +1 -1
  231. package/dist/plugins/types.d.ts +1 -1
  232. package/dist/{poll-DQ6DX_Tt.d.ts → poll-D2QDStsw.d.ts} +4 -14
  233. package/dist/radio-CJH_N4lq.d.ts +20 -0
  234. package/dist/{section-Q8nwx_-q.d.ts → section-DrFBT5b-.d.ts} +1 -2
  235. package/dist/{separator-B8P-kdIK.d.ts → separator-BVm3w6yd.d.ts} +1 -2
  236. package/dist/{signals-CBXwugBW.d.ts → signals-DRMDrCOn.d.ts} +1 -1
  237. package/dist/{text-display-CL9C2yMc.d.ts → text-display-BG0nNqy3.d.ts} +1 -2
  238. package/dist/{types-DZy7U-Ld.d.ts → types-ur7SvktF.d.ts} +1 -1
  239. package/dist/types.d.ts +1 -1
  240. package/dist/utils/colors.d.ts +1 -3
  241. package/dist/utils/colors.js +0 -1
  242. package/dist/utils/colors.js.map +1 -1
  243. package/dist/utils/constants.d.ts +2 -2
  244. package/dist/utils/constants.js +19 -0
  245. package/dist/utils/constants.js.map +1 -1
  246. package/dist/utils/dev-hooks.d.ts +1 -1
  247. package/dist/utils/dev-hooks.js +1 -1
  248. package/dist/utils/error-codes.js +15 -0
  249. package/dist/utils/error-codes.js.map +1 -1
  250. package/dist/utils/resolve-file-url.js +2 -2
  251. package/dist/utils/resolve-file-url.js.map +1 -1
  252. package/dist/utils/types-package.d.ts +6 -2
  253. package/dist/utils/types-package.js +31 -38
  254. package/dist/utils/types-package.js.map +1 -1
  255. package/dist/utils/useful-stuff/async-queue.js.map +1 -1
  256. package/dist/utils/useful-stuff/mutex.js.map +1 -1
  257. package/dist/utils/useful-stuff/ratelimiter.js +4 -1
  258. package/dist/utils/useful-stuff/ratelimiter.js.map +1 -1
  259. package/dist/utils/useful-stuff/semaphore.js.map +1 -1
  260. package/dist/utils/utilities.js +1 -1
  261. package/dist/utils/warning.d.ts +1 -5
  262. package/dist/utils/warning.js.map +1 -1
  263. package/dist/version.js +1 -1
  264. package/dist/version.js.map +1 -1
  265. package/package.json +17 -17
  266. package/dist/CommandsRouter-DiNoF0dq.d.ts +0 -145
  267. package/dist/commandkit-Bh7C1_c7.js.map +0 -1
  268. package/dist/index-BIsCUWAs.d.ts +0 -1
  269. package/dist/index-CwHYpK-f.d.ts +0 -1
  270. package/dist/index-DHrsNvX1.d.ts +0 -1
  271. /package/dist/{chunk-BE-pF4vm.js → rolldown-runtime-C_NdSu1c.js} +0 -0
@@ -1,2 +1,2 @@
1
- import { a as IdentifyEvent, i as AnalyticsProvider, r as AnalyticsEvent } from "../analytics-engine-DnRsHBId.js";
1
+ import { a as IdentifyEvent, i as AnalyticsProvider, r as AnalyticsEvent } from "../analytics-engine-Bz1p7ud3.js";
2
2
  export { AnalyticsEvent, AnalyticsProvider, IdentifyEvent };
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_chunk = require('../chunk-BE-pF4vm.js');
3
2
  let node_crypto = require("node:crypto");
4
3
 
5
4
  //#region src/analytics/constants.ts
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":[],"sources":["../../src/analytics/constants.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\n\n/**\n * @private\n * @internal\n */\nexport const DO_NOT_TRACK_KEY = `COMMANDKIT_ANALYTICS__DO_NOT_TRACK::${randomUUID()}`;\n\n/**\n * The analytics events that are used in CommandKit.\n * These events are used to track various actions and metrics within the CommandKit framework.\n */\nexport const AnalyticsEvents = {\n // commands\n COMMAND_EXECUTION: 'command_execution',\n // feature flags\n FEATURE_FLAG_METRICS: 'feature_flag_metrics',\n FEATURE_FLAG_DECISION: 'feature_flag_decision',\n // @commandkit/cache\n CACHE_HIT: 'cache_hit',\n CACHE_MISS: 'cache_miss',\n CACHE_REVALIDATED: 'cache_revalidated',\n} as const;\n\n/**\n * The type of analytics events that can be tracked in CommandKit.\n * This type is derived from the keys of the `AnalyticsEvents` object.\n * It ensures that only valid analytics events can be used in the tracking functions.\n */\nexport type AnalyticsEvent =\n (typeof AnalyticsEvents)[keyof typeof AnalyticsEvents];\n"],"mappings":";;;;;;;;;AAMA,MAAa,mBAAmB,oEAAmD;;;;;AAMnF,MAAa,kBAAkB;CAE7B,mBAAmB;CAEnB,sBAAsB;CACtB,uBAAuB;CAEvB,WAAW;CACX,YAAY;CACZ,mBAAmB;CACpB"}
1
+ {"version":3,"file":"constants.js","names":[],"sources":[],"mappings":""}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_commandkit = require('../commandkit-Bh7C1_c7.js');
2
+ const require_commandkit = require('../commandkit-DNbfLwyR.js');
3
3
 
4
4
  exports.getDoNotTrack = require_commandkit.getDoNotTrack;
5
5
  exports.noAnalytics = require_commandkit.noAnalytics;
@@ -1,17 +1,19 @@
1
- import { t as EventInterceptor } from "./EventInterceptor-D9JKMcfi.js";
2
- import { a as Fragment, c as createElement } from "./element-DeLvTMfZ.js";
3
- import { t as MaybeArray } from "./types-DZy7U-Ld.js";
4
- import { r as MessageCommandParser, t as MessageCommandOptions } from "./MessageCommandParser-DPCbHXCS.js";
5
- import { i as Middleware, n as CommandsRouter, t as Command } from "./CommandsRouter-DiNoF0dq.js";
6
- import { i as ParsedEvent, t as EventsRouter } from "./EventsRouter-EuuSu6NH.js";
7
- import { o as HMREventType } from "./constants-DwxpkIeH.js";
1
+ import { t as EventInterceptor } from "./EventInterceptor-wg378vJp.js";
2
+ import { a as Fragment, c as createElement } from "./element-BMZYAAQ-.js";
3
+ import { t as MaybeArray } from "./types-ur7SvktF.js";
4
+ import "./index-DvqHpiuh.js";
5
+ import { r as MessageCommandParser, t as MessageCommandOptions } from "./MessageCommandParser-BYbxHOSK.js";
6
+ import "./helpers-vlnRvNJv.js";
7
+ import { i as Middleware, n as CommandsRouter, o as RouterFileChangeType, t as Command } from "./CommandsRouter-Co225Ae5.js";
8
+ import { a as ParsedEvent, n as EventsRouterFileChangeType, t as EventsRouter } from "./EventsRouter-Bt63ZuEF.js";
9
+ import "./index-COt7nfC9.js";
10
+ import { o as HMREventChangeType, s as HMREventType } from "./constants-kWgE3L9F.js";
8
11
  import EventEmitter from "node:events";
9
12
  import { AutocompleteInteraction, Awaitable, CacheType, ChatInputCommandInteraction, Client, ClientEvents, Collection, Constructable, ContextMenuCommandBuilder, ContextMenuCommandInteraction, Guild, Interaction, Locale, Message, MessageContextMenuCommandInteraction, PermissionsString, RESTPostAPIApplicationCommandsJSONBody, SlashCommandBuilder, TextBasedChannel, UserContextMenuCommandInteraction } from "discord.js";
10
13
  import { DirectiveTransformerOptions } from "directive-to-hof";
11
14
  import { InlineConfig } from "tsdown";
12
-
13
15
  //#region src/types.d.ts
14
- type Prettify<T> = { [K in keyof T]: T[K] } & {};
16
+ type Prettify<T> = { [K in keyof T]: T[K]; } & {};
15
17
  /**
16
18
  * Options for instantiating a CommandKit handler.
17
19
  */
@@ -352,6 +354,10 @@ declare class MiddlewareContext<T extends CommandExecutionMode = CommandExecutio
352
354
  }
353
355
  //#endregion
354
356
  //#region src/app/register/CommandRegistrar.d.ts
357
+ type RegistrationCommandData = CommandData & {
358
+ __metadata?: CommandMetadata;
359
+ __applyId(id: string): void;
360
+ };
355
361
  /**
356
362
  * Event object passed to plugins before command registration.
357
363
  */
@@ -375,12 +381,33 @@ declare class CommandRegistrar {
375
381
  */
376
382
  constructor(commandkit: CommandKit);
377
383
  /**
378
- * Gets the commands data.
384
+ * Gets the commands data, consuming pre-generated context menu entries when available.
385
+ */
386
+ getCommandsData(): RegistrationCommandData[];
387
+ /**
388
+ * Gets flat command data, consuming pre-generated context menu entries when available.
389
+ */
390
+ private getFlatCommandsData;
391
+ /**
392
+ * Gets hierarchical chat-input command payloads compiled from cached tree nodes.
393
+ */
394
+ private getHierarchicalCommandsData;
395
+ /**
396
+ * Removes internal runtime-only fields before Discord registration data is emitted.
397
+ */
398
+ private sanitizeCommandData;
399
+ /**
400
+ * Builds a top-level Discord payload for a hierarchical command root.
379
401
  */
380
- getCommandsData(): (CommandData & {
381
- __metadata?: CommandMetadata;
382
- __applyId(id: string): void;
383
- })[];
402
+ private buildHierarchicalRootPayload;
403
+ /**
404
+ * Builds a nested subcommand or subcommand-group option from a hierarchical node.
405
+ */
406
+ private buildHierarchicalOption;
407
+ /**
408
+ * Collects normalized guild scopes for all chat-input leaves within a hierarchical subtree.
409
+ */
410
+ private collectHierarchicalGuildScopes;
384
411
  /**
385
412
  * Registers loaded commands.
386
413
  */
@@ -388,17 +415,11 @@ declare class CommandRegistrar {
388
415
  /**
389
416
  * Updates the global commands.
390
417
  */
391
- updateGlobalCommands(commands: (CommandData & {
392
- __metadata?: CommandMetadata;
393
- __applyId(id: string): void;
394
- })[]): Promise<void>;
418
+ updateGlobalCommands(commands: RegistrationCommandData[]): Promise<void>;
395
419
  /**
396
420
  * Updates the guild commands.
397
421
  */
398
- updateGuildCommands(commands: (CommandData & {
399
- __metadata?: CommandMetadata;
400
- __applyId(id: string): void;
401
- })[]): Promise<void>;
422
+ updateGuildCommands(commands: RegistrationCommandData[]): Promise<void>;
402
423
  }
403
424
  //#endregion
404
425
  //#region src/context/environment.d.ts
@@ -743,10 +764,20 @@ interface LoadedCommand {
743
764
  */
744
765
  data: AppCommand;
745
766
  }
767
+ /**
768
+ * Global registry used to infer strongly-typed command identifiers.
769
+ * This namespace is augmented by generated `commandkit/types` declarations.
770
+ */
771
+ declare global {
772
+ namespace CommandKitTypes {
773
+ interface Registry {}
774
+ }
775
+ }
776
+ type CommandTypeDataRegistryKeys = Exclude<keyof CommandKitTypes.Registry, '__commandkit_wide__'>;
746
777
  /**
747
778
  * Type representing command data identifier.
748
779
  */
749
- type CommandTypeData = string;
780
+ type CommandTypeData = [CommandTypeDataRegistryKeys] extends [never] ? string : Extract<CommandTypeDataRegistryKeys, string>;
750
781
  /**
751
782
  * Type for commands that can be resolved by the handler.
752
783
  */
@@ -809,6 +840,20 @@ declare class AppCommandHandler {
809
840
  * @internal
810
841
  */
811
842
  private loadedCommands;
843
+ /**
844
+ * Executable runtime commands indexed by canonical route key.
845
+ * This includes flat commands and hierarchical executable leaves.
846
+ * @private
847
+ * @internal
848
+ */
849
+ private runtimeRouteIndex;
850
+ /**
851
+ * Loaded hierarchical command nodes keyed by tree node id.
852
+ * Container nodes are cached here for registration compilation.
853
+ * @private
854
+ * @internal
855
+ */
856
+ private hierarchicalNodes;
812
857
  /**
813
858
  * @private
814
859
  * @internal
@@ -850,14 +895,39 @@ declare class AppCommandHandler {
850
895
  */
851
896
  printBanner(): void;
852
897
  /**
853
- * Gets an array of all loaded commands.
898
+ * Gets an array of all loaded commands, including pre-generated context menu entries.
854
899
  * @returns Array of loaded commands
855
900
  */
856
901
  getCommandsArray(): LoadedCommand[];
902
+ /**
903
+ * Gets all executable runtime routes, including hierarchical leaves.
904
+ * @returns Array of route-indexed commands
905
+ */
906
+ getRuntimeCommandsArray(): LoadedCommand[];
907
+ /**
908
+ * Gets loaded hierarchical command nodes, including non-executable containers.
909
+ * @returns Array of hierarchical node definitions
910
+ */
911
+ getHierarchicalNodesArray(): LoadedCommand[];
857
912
  /**
858
913
  * Registers event handlers for Discord interactions and messages.
859
914
  */
860
915
  registerCommandHandler(): void;
916
+ /**
917
+ * @private
918
+ * @internal
919
+ */
920
+ private normalizeRouteKey;
921
+ /**
922
+ * @private
923
+ * @internal
924
+ */
925
+ private buildInteractionRouteKey;
926
+ /**
927
+ * @private
928
+ * @internal
929
+ */
930
+ private buildMessageRouteKey;
861
931
  /**
862
932
  * Prepares a command for execution by resolving the command and its middleware.
863
933
  * @param source - The interaction or message that triggered the command
@@ -872,11 +942,23 @@ declare class AppCommandHandler {
872
942
  * @returns The loaded command or null if not found
873
943
  */
874
944
  private findCommandByName;
945
+ /**
946
+ * Finds a command by its canonical route key.
947
+ * @param route - The command route or command name
948
+ * @param allowFlatAliasFallback - Whether to check flat aliases if the route key was not found
949
+ * @returns The loaded command or null if not found
950
+ */
951
+ private findCommandByRoute;
952
+ /**
953
+ * @private
954
+ * @internal
955
+ */
956
+ private getRouteKeyFor;
875
957
  resolveMessageCommandName(name: string): string;
876
958
  /**
877
959
  * Reloads all commands and middleware from scratch.
878
960
  */
879
- reloadCommands(): Promise<void>;
961
+ reloadCommands(path?: string, changeType?: RouterFileChangeType): Promise<void>;
880
962
  /**
881
963
  * Adds external middleware data to be loaded.
882
964
  * @param data - Array of middleware data to add
@@ -906,11 +988,33 @@ declare class AppCommandHandler {
906
988
  * @internal
907
989
  */
908
990
  private loadMiddleware;
991
+ /**
992
+ * @private
993
+ * @internal
994
+ */
995
+ private shouldIndexAsRuntimeRoute;
996
+ /**
997
+ * @private
998
+ * @internal
999
+ */
1000
+ private registerRuntimeRoute;
1001
+ /**
1002
+ * @private
1003
+ * @internal
1004
+ */
1005
+ private processCommandFile;
909
1006
  /**
910
1007
  * @private
911
1008
  * @internal
912
1009
  */
913
1010
  private loadCommand;
1011
+ /**
1012
+ * Loads a hierarchical command node into the hierarchical cache.
1013
+ * Executable leaves are also added to the runtime route index.
1014
+ * @private
1015
+ * @internal
1016
+ */
1017
+ private loadHierarchicalNode;
914
1018
  /**
915
1019
  * Gets the metadata for a command.
916
1020
  * @param command - The command name to get metadata for
@@ -918,6 +1022,12 @@ declare class AppCommandHandler {
918
1022
  * @returns The command metadata or null if not found
919
1023
  */
920
1024
  getMetadataFor(command: string, hint?: 'user' | 'message'): CommandMetadata | null;
1025
+ /**
1026
+ * Generates context menu commands for the loaded command.
1027
+ * @private
1028
+ * @internal
1029
+ */
1030
+ private generateContextMenuCommands;
921
1031
  }
922
1032
  //#endregion
923
1033
  //#region src/events/CommandKitEventsChannel.d.ts
@@ -1010,6 +1120,7 @@ interface LoadedEvent {
1010
1120
  event: ParsedEvent;
1011
1121
  listeners: EventListener[];
1012
1122
  mainListener?: EventListener;
1123
+ onceListener?: EventListener;
1013
1124
  executedOnceListeners?: Set<ListenerFunction>;
1014
1125
  }
1015
1126
  /**
@@ -1045,11 +1156,16 @@ declare class AppEventsHandler {
1045
1156
  /**
1046
1157
  * Reloads all events by unregistering existing ones and loading them again.
1047
1158
  */
1048
- reloadEvents(): Promise<void>;
1159
+ reloadEvents(path?: string, changeType?: EventsRouterFileChangeType): Promise<void>;
1049
1160
  /**
1050
1161
  * Loads all events from the events router and registers them with Discord.js client.
1051
1162
  */
1052
1163
  loadEvents(): Promise<void>;
1164
+ /**
1165
+ * @private
1166
+ * @internal
1167
+ */
1168
+ private loadEventsFromTree;
1053
1169
  /**
1054
1170
  * Unregisters all event listeners and clears loaded events.
1055
1171
  */
@@ -1077,6 +1193,10 @@ interface IpcMessageCommand {
1077
1193
  * The path associated with the HMR event.
1078
1194
  */
1079
1195
  path: string;
1196
+ /**
1197
+ * The original filesystem change type that triggered this HMR event.
1198
+ */
1199
+ changeType?: HMREventChangeType;
1080
1200
  /**
1081
1201
  * An optional identifier for the HMR event, used for acknowledgment.
1082
1202
  */
@@ -1094,6 +1214,10 @@ interface CommandKitHMREvent {
1094
1214
  * The path associated with the HMR event.
1095
1215
  */
1096
1216
  path: string;
1217
+ /**
1218
+ * The original filesystem change type that triggered this HMR event.
1219
+ */
1220
+ changeType?: HMREventChangeType;
1097
1221
  /**
1098
1222
  * Accepts the HMR event, indicating that it has been handled.
1099
1223
  * This prevents further processing of the event.
@@ -1849,6 +1973,10 @@ declare function flag<Returns = boolean, Entity = Record<any, any>>(options: Fea
1849
1973
  declare class FlagStore extends Collection<string, FeatureFlag<any, any>> {}
1850
1974
  //#endregion
1851
1975
  //#region src/config/types.d.ts
1976
+ /**
1977
+ * The JavaScript runtime to use for the development server.
1978
+ */
1979
+ type CommandKitJsRuntime = 'node' | 'bun' | 'deno' | 'auto';
1852
1980
  interface CommandKitCompilerOptions {
1853
1981
  /**
1854
1982
  * The macro compiler options to use with CommandKit.
@@ -1965,17 +2093,37 @@ interface CommandKitConfig {
1965
2093
  * @default true
1966
2094
  */
1967
2095
  jsxDefaultOptionalComponents?: boolean;
2096
+ /**
2097
+ * Experimental features configuration. These features are not stable and may be removed or changed without a major version bump. Use with caution.
2098
+ */
2099
+ experimental?: {
2100
+ /**
2101
+ * The runtime to use for the development server. This is an experimental feature and may be removed or changed without a major version bump. Use with caution.
2102
+ * @default null
2103
+ */
2104
+ devServerRuntime?: CommandKitJsRuntime | null;
2105
+ /**
2106
+ * Whether to emit and hydrate a pre-generated commands/events artifact in production builds.
2107
+ * @default false
2108
+ */
2109
+ pregenerateCommands?: boolean;
2110
+ /**
2111
+ * Whether to use incremental router reconciliation in development HMR.
2112
+ * @default false
2113
+ */
2114
+ incrementalRouter?: boolean;
2115
+ };
1968
2116
  }
1969
2117
  //#endregion
1970
2118
  //#region src/config/utils.d.ts
1971
2119
  /**
1972
2120
  * @private
1973
2121
  */
1974
- type DeepRequired<T, OptionalKeys extends keyof T = never> = { [P in keyof T]-?: P extends OptionalKeys ? Partial<T[P]> : DeepRequired<T[P]> };
2122
+ type DeepRequired<T, OptionalKeys extends keyof T = never> = { [P in keyof T]-?: P extends OptionalKeys ? Partial<T[P]> : DeepRequired<T[P]>; };
1975
2123
  /**
1976
2124
  * @private
1977
2125
  */
1978
- type DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]> };
2126
+ type DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]>; };
1979
2127
  /**
1980
2128
  * @private
1981
2129
  * @example
@@ -2274,5 +2422,5 @@ declare class AnalyticsEngine {
2274
2422
  track(event: AnalyticsEvent): Promise<void>;
2275
2423
  }
2276
2424
  //#endregion
2277
- export { isRuntimePlugin as $, MessageCommand as $t, flag as A, makeContextAwareFunction as At, CommonPluginRuntime as B, PreRegisterCommandsEvent as Bt, EvaluationContext as C, RunCommandOptions as Ct, FlagRunner as D, getCommandKit as Dt, FeatureFlagDefinition as E, exitContext as Et, CommandKitPluginRuntime as F, CommandKitEnvironmentInternalData as Ft, PluginTransformParameters as G, ChatInputCommand as Gt, CommonDirectiveTransformer as H, AutocompleteCommand as Ht, PluginCommon as I, CommandKitEnvironmentType as It, CommandKitEventDispatch as J, CommandExecutionMode as Jt, TransformedResult as K, ChatInputCommandContext as Kt, PluginOptions as L, after as Lt, FlagConfiguration as M, useEnvironment as Mt, FlagProvider as N, useStore as Nt, IdentifyFunction as O, getContext as Ot, JsonFlagProvider as P, CommandKitEnvironment as Pt, RuntimePlugin as Q, InteractionCommandMiddlewareContext as Qt, PluginType as R, cancelAfter as Rt, DecideFunction as S, AppCommandRunner as St, FeatureFlag as T, GenericFunction as Tt, CommonDirectiveTransformerOptions as U, AutocompleteCommandContext as Ut, CompilerPluginRuntime as V, AnyCommandExecute as Vt, CompilerPlugin as W, AutocompleteCommandMiddlewareContext as Wt, MaybeFalsey as X, ContextParameters as Xt, CommandKitPlugin as Y, Context as Yt, TemplateHandler as Z, InteractionCommandContext as Zt, CommandKitConfig as _, CustomAppCommandProps as _t, IdentifyEvent as a, MiddlewareContext as an, EventListener as at, CustomEvaluationContext as b, ResolvableCommand as bt, CommandKitConfiguration as c, UserContextMenuCommand as cn, ListenerFunction as ct, onBootstrap as d, CommandContext as dn, AppCommandNative as dt, MessageCommandContext as en, CommandKitHMREvent as et, DeepPartial as f, CommandData as fn, CommandBuilderLike as ft, CommandKitCompilerOptions as g, EventHandler as gn, CommandTypeData as gt, mergeDeep as h, CommandMetadataFunction as hn, CommandDataSchemaValue as ht, AnalyticsProvider as i, MessageContextMenuCommandMiddlewareContext as in, AppEventsHandlerLoadedData as it, setFlagProvider as j, provideContext as jt, MaybePromise as k, isCommandWorkerContext as kt, commandkit as l, UserContextMenuCommandContext as ln, AppCommand as lt, ResolvedCommandKitConfig as m, CommandMetadata as mn, CommandDataSchemaKey as mt, FilterFunction as n, MessageContextMenuCommand as nn, registerDevHooks as nt, BootstrapFunction as o, MiddlewareContextArgs as on, LoadedEvent as ot, DeepRequired as p, CommandKitOptions as pn, CommandDataSchema as pt, isCompilerPlugin as q, CommandContextOptions as qt, AnalyticsEvent as r, MessageContextMenuCommandContext as rn, AppEventsHandler as rt, CommandKit as s, SlashCommandMiddlewareContext as sn, CommandKitEventsChannel as st, AnalyticsEngine as t, MessageCommandMiddlewareContext as tn, IpcMessageCommand as tt, onApplicationBootstrap as u, UserContextMenuCommandMiddlewareContext as un, AppCommandHandler as ut, FlagStore as v, LoadedCommand as vt, EventFlagContext as w, AsyncFunction as wt, CustomEvaluationFunction as x, RunCommand as xt, CommandFlagContext as y, PreparedAppCommandExecution as yt, isPlugin as z, CommandRegistrar as zt };
2278
- //# sourceMappingURL=analytics-engine-DnRsHBId.d.ts.map
2425
+ export { RuntimePlugin as $, InteractionCommandMiddlewareContext as $t, MaybePromise as A, isCommandWorkerContext as At, isPlugin as B, CommandRegistrar as Bt, DecideFunction as C, AppCommandRunner as Ct, FeatureFlagDefinition as D, exitContext as Dt, FeatureFlag as E, GenericFunction as Et, JsonFlagProvider as F, CommandKitEnvironment as Ft, CompilerPlugin as G, AutocompleteCommandMiddlewareContext as Gt, CompilerPluginRuntime as H, AnyCommandExecute as Ht, CommandKitPluginRuntime as I, CommandKitEnvironmentInternalData as It, isCompilerPlugin as J, CommandContextOptions as Jt, PluginTransformParameters as K, ChatInputCommand as Kt, PluginCommon as L, CommandKitEnvironmentType as Lt, setFlagProvider as M, provideContext as Mt, FlagConfiguration as N, useEnvironment as Nt, FlagRunner as O, getCommandKit as Ot, FlagProvider as P, useStore as Pt, TemplateHandler as Q, InteractionCommandContext as Qt, PluginOptions as R, after as Rt, CustomEvaluationFunction as S, RunCommand as St, EventFlagContext as T, AsyncFunction as Tt, CommonDirectiveTransformer as U, AutocompleteCommand as Ut, CommonPluginRuntime as V, PreRegisterCommandsEvent as Vt, CommonDirectiveTransformerOptions as W, AutocompleteCommandContext as Wt, CommandKitPlugin as X, Context as Xt, CommandKitEventDispatch as Y, CommandExecutionMode as Yt, MaybeFalsey as Z, ContextParameters as Zt, CommandKitConfig as _, EventHandler as _n, CommandTypeData as _t, IdentifyEvent as a, MessageContextMenuCommandMiddlewareContext as an, AppEventsHandlerLoadedData as at, CommandFlagContext as b, PreparedAppCommandExecution as bt, CommandKitConfiguration as c, SlashCommandMiddlewareContext as cn, CommandKitEventsChannel as ct, onBootstrap as d, UserContextMenuCommandMiddlewareContext as dn, AppCommandHandler as dt, MessageCommand as en, isRuntimePlugin as et, DeepPartial as f, CommandContext as fn, AppCommandNative as ft, CommandKitCompilerOptions as g, CommandMetadataFunction as gn, CommandDataSchemaValue as gt, mergeDeep as h, CommandMetadata as hn, CommandDataSchemaKey as ht, AnalyticsProvider as i, MessageContextMenuCommandContext as in, AppEventsHandler as it, flag as j, makeContextAwareFunction as jt, IdentifyFunction as k, getContext as kt, commandkit as l, UserContextMenuCommand as ln, ListenerFunction as lt, ResolvedCommandKitConfig as m, CommandKitOptions as mn, CommandDataSchema as mt, FilterFunction as n, MessageCommandMiddlewareContext as nn, IpcMessageCommand as nt, BootstrapFunction as o, MiddlewareContext as on, EventListener as ot, DeepRequired as p, CommandData as pn, CommandBuilderLike as pt, TransformedResult as q, ChatInputCommandContext as qt, AnalyticsEvent as r, MessageContextMenuCommand as rn, registerDevHooks as rt, CommandKit as s, MiddlewareContextArgs as sn, LoadedEvent as st, AnalyticsEngine as t, MessageCommandContext as tn, CommandKitHMREvent as tt, onApplicationBootstrap as u, UserContextMenuCommandContext as un, AppCommand as ut, CommandKitJsRuntime as v, CustomAppCommandProps as vt, EvaluationContext as w, RunCommandOptions as wt, CustomEvaluationContext as x, ResolvableCommand as xt, FlagStore as y, LoadedCommand as yt, PluginType as z, cancelAfter as zt };
2426
+ //# sourceMappingURL=analytics-engine-Bz1p7ud3.d.ts.map
@@ -1,2 +1,2 @@
1
- import { Ct as RunCommandOptions, St as AppCommandRunner } from "../../analytics-engine-DnRsHBId.js";
1
+ import { Ct as AppCommandRunner, wt as RunCommandOptions } from "../../analytics-engine-Bz1p7ud3.js";
2
2
  export { AppCommandRunner, RunCommandOptions };
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_commandkit = require('../../commandkit-Bh7C1_c7.js');
2
+ const require_commandkit = require('../../commandkit-DNbfLwyR.js');
3
3
 
4
4
  exports.AppCommandRunner = require_commandkit.AppCommandRunner;
@@ -1,2 +1,2 @@
1
- import { $t as MessageCommand, Gt as ChatInputCommand, Ht as AutocompleteCommand, Jt as CommandExecutionMode, Kt as ChatInputCommandContext, Qt as InteractionCommandMiddlewareContext, Ut as AutocompleteCommandContext, Vt as AnyCommandExecute, Wt as AutocompleteCommandMiddlewareContext, Xt as ContextParameters, Yt as Context, Zt as InteractionCommandContext, an as MiddlewareContext, cn as UserContextMenuCommand, en as MessageCommandContext, in as MessageContextMenuCommandMiddlewareContext, ln as UserContextMenuCommandContext, nn as MessageContextMenuCommand, on as MiddlewareContextArgs, qt as CommandContextOptions, rn as MessageContextMenuCommandContext, sn as SlashCommandMiddlewareContext, tn as MessageCommandMiddlewareContext, un as UserContextMenuCommandMiddlewareContext } from "../../analytics-engine-DnRsHBId.js";
1
+ import { $t as InteractionCommandMiddlewareContext, Gt as AutocompleteCommandMiddlewareContext, Ht as AnyCommandExecute, Jt as CommandContextOptions, Kt as ChatInputCommand, Qt as InteractionCommandContext, Ut as AutocompleteCommand, Wt as AutocompleteCommandContext, Xt as Context, Yt as CommandExecutionMode, Zt as ContextParameters, an as MessageContextMenuCommandMiddlewareContext, cn as SlashCommandMiddlewareContext, dn as UserContextMenuCommandMiddlewareContext, en as MessageCommand, in as MessageContextMenuCommandContext, ln as UserContextMenuCommand, nn as MessageCommandMiddlewareContext, on as MiddlewareContext, qt as ChatInputCommandContext, rn as MessageContextMenuCommand, sn as MiddlewareContextArgs, tn as MessageCommandContext, un as UserContextMenuCommandContext } from "../../analytics-engine-Bz1p7ud3.js";
2
2
  export { AnyCommandExecute, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandContextOptions, CommandExecutionMode, Context, ContextParameters, InteractionCommandContext, InteractionCommandMiddlewareContext, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_commandkit = require('../../commandkit-Bh7C1_c7.js');
2
+ const require_commandkit = require('../../commandkit-DNbfLwyR.js');
3
3
 
4
4
  exports.CommandExecutionMode = require_commandkit.CommandExecutionMode;
5
5
  exports.Context = require_commandkit.Context;
@@ -1,2 +1,2 @@
1
- import { i as ParsedMessageCommand, n as MessageCommandOptionsSchema, r as MessageCommandParser, t as MessageCommandOptions } from "../../MessageCommandParser-DPCbHXCS.js";
1
+ import { i as ParsedMessageCommand, n as MessageCommandOptionsSchema, r as MessageCommandParser, t as MessageCommandOptions } from "../../MessageCommandParser-BYbxHOSK.js";
2
2
  export { MessageCommandOptions, MessageCommandOptionsSchema, MessageCommandParser, ParsedMessageCommand };
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_chunk = require('../../chunk-BE-pF4vm.js');
3
2
  const require_utils_error_codes = require('../../utils/error-codes.js');
4
3
  let discord_js = require("discord.js");
5
4
 
@@ -8,6 +7,9 @@ let discord_js = require("discord.js");
8
7
  * Parses message content into structured command data with options and subcommands.
9
8
  */
10
9
  var MessageCommandParser = class {
10
+ message;
11
+ prefix;
12
+ schema;
11
13
  /**
12
14
  * @private
13
15
  * @internal
@@ -66,6 +68,13 @@ var MessageCommandParser = class {
66
68
  return this.parse().command;
67
69
  }
68
70
  /**
71
+ * Gets the full command route as an array of segments.
72
+ * @returns Array of command segments
73
+ */
74
+ getFullRoute() {
75
+ return this.parse().fullRoute;
76
+ }
77
+ /**
69
78
  * Gets the subcommand name if present.
70
79
  * @returns The subcommand name or undefined
71
80
  */
@@ -95,11 +104,7 @@ var MessageCommandParser = class {
95
104
  * @returns The complete command string
96
105
  */
97
106
  getFullCommand() {
98
- return [
99
- this.getCommand(),
100
- this.getSubcommandGroup(),
101
- this.getSubcommand()
102
- ].filter((v) => v).join(" ");
107
+ return this.getFullRoute().join(" ");
103
108
  }
104
109
  /**
105
110
  * Parses the message content into structured command data.
@@ -110,79 +115,81 @@ var MessageCommandParser = class {
110
115
  const content = this.message.content;
111
116
  const prefix = this.getPrefix();
112
117
  if (!prefix) throw require_utils_error_codes.createCommandKitError(require_utils_error_codes.CommandKitErrorCodes.InvalidCommandPrefix);
113
- const parts = content.slice(prefix.length).trim().split(" ");
114
- const command = parts.shift();
118
+ const body = content.slice(prefix.length).trim();
119
+ if (!body) throw require_utils_error_codes.createCommandKitError(require_utils_error_codes.CommandKitErrorCodes.InvalidCommandPrefix);
120
+ const parts = body.split(" ");
121
+ const commandToken = parts.shift();
115
122
  this.#args = parts;
123
+ let command = "";
116
124
  let subcommandGroup;
117
125
  let subcommand;
118
- if (command === null || command === void 0 ? void 0 : command.includes(":")) {
119
- const [, group, cmd] = command.split(":");
120
- if (!cmd && group) subcommand = group;
121
- else if (cmd && group) {
122
- subcommandGroup = group;
123
- subcommand = cmd;
126
+ const fullRoute = (commandToken === null || commandToken === void 0 ? void 0 : commandToken.split(":")) ?? [];
127
+ if (fullRoute.length) {
128
+ command = fullRoute[0];
129
+ if (fullRoute.length === 2) subcommand = fullRoute[1];
130
+ else if (fullRoute.length >= 3) {
131
+ subcommandGroup = fullRoute[1];
132
+ subcommand = fullRoute[fullRoute.length - 1];
124
133
  }
125
134
  }
126
- const schema = this.schema([
127
- command,
128
- subcommandGroup,
129
- subcommand
130
- ].filter(Boolean).join(" ").trim());
135
+ const schema = this.schema(fullRoute.join(" ").trim());
136
+ const options = parts.map((part) => {
137
+ try {
138
+ const [name, value] = part.split(":");
139
+ if (!(name in schema)) return null;
140
+ switch (schema[name]) {
141
+ case discord_js.ApplicationCommandOptionType.Boolean: return {
142
+ name,
143
+ value: value === "true"
144
+ };
145
+ case discord_js.ApplicationCommandOptionType.Integer: return {
146
+ name,
147
+ value: parseInt(value, 10)
148
+ };
149
+ case discord_js.ApplicationCommandOptionType.Number: return {
150
+ name,
151
+ value: parseFloat(value)
152
+ };
153
+ case discord_js.ApplicationCommandOptionType.String: return {
154
+ name,
155
+ value
156
+ };
157
+ case discord_js.ApplicationCommandOptionType.User: return {
158
+ name,
159
+ value: this.message.mentions.users.find((u) => {
160
+ return u.id === value.replace(/[<@!>]/g, "");
161
+ })
162
+ };
163
+ case discord_js.ApplicationCommandOptionType.Channel: return {
164
+ name,
165
+ value: this.message.mentions.channels.find((c) => {
166
+ return c.id === value.replace(/[<#>]/g, "");
167
+ })
168
+ };
169
+ case discord_js.ApplicationCommandOptionType.Role: return {
170
+ name,
171
+ value: this.message.mentions.roles.find((r) => {
172
+ return r.id === value.replace(/[<@&>]/g, "");
173
+ })
174
+ };
175
+ case discord_js.ApplicationCommandOptionType.Attachment: return {
176
+ name,
177
+ value: this.message.attachments.find((a) => {
178
+ return a.name === value;
179
+ })
180
+ };
181
+ default: return null;
182
+ }
183
+ } catch {
184
+ return null;
185
+ }
186
+ }).filter((v) => v !== null);
131
187
  this.#parsed = {
132
188
  command,
133
- options: parts.map((part) => {
134
- try {
135
- const [name, value] = part.split(":");
136
- if (!(name in schema)) return null;
137
- switch (schema[name]) {
138
- case discord_js.ApplicationCommandOptionType.Boolean: return {
139
- name,
140
- value: value === "true"
141
- };
142
- case discord_js.ApplicationCommandOptionType.Integer: return {
143
- name,
144
- value: parseInt(value, 10)
145
- };
146
- case discord_js.ApplicationCommandOptionType.Number: return {
147
- name,
148
- value: parseFloat(value)
149
- };
150
- case discord_js.ApplicationCommandOptionType.String: return {
151
- name,
152
- value
153
- };
154
- case discord_js.ApplicationCommandOptionType.User: return {
155
- name,
156
- value: this.message.mentions.users.find((u) => {
157
- return u.id === value.replace(/[<@!>]/g, "");
158
- })
159
- };
160
- case discord_js.ApplicationCommandOptionType.Channel: return {
161
- name,
162
- value: this.message.mentions.channels.find((c) => {
163
- return c.id === value.replace(/[<#>]/g, "");
164
- })
165
- };
166
- case discord_js.ApplicationCommandOptionType.Role: return {
167
- name,
168
- value: this.message.mentions.roles.find((r) => {
169
- return r.id === value.replace(/[<@&>]/g, "");
170
- })
171
- };
172
- case discord_js.ApplicationCommandOptionType.Attachment: return {
173
- name,
174
- value: this.message.attachments.find((a) => {
175
- return a.name === value;
176
- })
177
- };
178
- default: return null;
179
- }
180
- } catch {
181
- return null;
182
- }
183
- }).filter((v) => v !== null),
189
+ options,
184
190
  subcommand,
185
- subcommandGroup
191
+ subcommandGroup,
192
+ fullRoute
186
193
  };
187
194
  return this.#parsed;
188
195
  }
@@ -191,6 +198,7 @@ var MessageCommandParser = class {
191
198
  * Provides typed access to message command options with methods similar to Discord.js interaction options.
192
199
  */
193
200
  var MessageCommandOptions = class {
201
+ parser;
194
202
  /**
195
203
  * Creates a new message command options instance.
196
204
  * @param parser - The message command parser instance