commandkit 1.2.0-rc.2 → 1.2.0-rc.4

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 (178) hide show
  1. package/README.md +4 -12
  2. package/dist/ActionRow-CmTHbo2t.js.map +1 -1
  3. package/dist/CommandKitEventsChannel-Bgw0XCOl.js.map +1 -1
  4. package/dist/{CommandsRouter-Ci1Pe8Vd.js → CommandsRouter-tMAivEfv.js} +10 -7
  5. package/dist/{CommandsRouter-Ci1Pe8Vd.js.map → CommandsRouter-tMAivEfv.js.map} +1 -1
  6. package/dist/CompilerPlugin-CjoZAAR8.js.map +1 -1
  7. package/dist/{DefaultLogger-Cy55-uPl.d.ts → DefaultLogger-XCOl5nLd.d.ts} +19 -12
  8. package/dist/EventInterceptor-CQ4PBpBJ.js.map +1 -1
  9. package/dist/{EventWorkerContext-DJUi1W3T.d.ts → EventWorkerContext-BEezHh5-.d.ts} +2 -2
  10. package/dist/{EventWorkerContext-CSlD9rbx.js → EventWorkerContext-TZIKxVCu.js} +1 -1
  11. package/dist/{EventWorkerContext-CSlD9rbx.js.map → EventWorkerContext-TZIKxVCu.js.map} +1 -1
  12. package/dist/EventsRouter-C_J0M3uO.js.map +1 -1
  13. package/dist/ILogger-BW8GM-YZ.d.ts +64 -0
  14. package/dist/{Logger-iSjA-DWN.d.ts → Logger-DyfkPk7u.d.ts} +2 -2
  15. package/dist/{MessageCommandParser-B_BEQ3p8.js → MessageCommandParser-TPEPhjvx.js} +2 -2
  16. package/dist/{MessageCommandParser-B_BEQ3p8.js.map → MessageCommandParser-TPEPhjvx.js.map} +1 -1
  17. package/dist/PluginCommon-Di1xIa8d.js.map +1 -1
  18. package/dist/RuntimePlugin-CBgBLXTG.js.map +1 -1
  19. package/dist/analytics/analytics-engine.d.ts +2 -2
  20. package/dist/analytics/analytics-engine.js +7 -7
  21. package/dist/analytics/analytics-provider.d.ts +2 -2
  22. package/dist/analytics/constants.js +1 -1
  23. package/dist/analytics/utils.js +7 -7
  24. package/dist/{analytics-engine-vA4MaJYx.d.ts → analytics-engine-Iu_1uJop.d.ts} +84 -27
  25. package/dist/app/commands/AppCommandRunner.d.ts +2 -2
  26. package/dist/app/commands/AppCommandRunner.js +7 -7
  27. package/dist/app/commands/Context.d.ts +2 -2
  28. package/dist/app/commands/Context.js +7 -7
  29. package/dist/app/commands/MessageCommandParser.js +2 -2
  30. package/dist/app/events/EventWorkerContext.d.ts +3 -3
  31. package/dist/app/events/EventWorkerContext.js +1 -1
  32. package/dist/app/handlers/AppCommandHandler.d.ts +2 -2
  33. package/dist/app/handlers/AppCommandHandler.js +7 -7
  34. package/dist/app/handlers/AppEventsHandler.d.ts +2 -2
  35. package/dist/app/handlers/AppEventsHandler.js +7 -7
  36. package/dist/app/index.d.ts +3 -3
  37. package/dist/app/index.js +9 -9
  38. package/dist/app/interrupt/signals.d.ts +2 -2
  39. package/dist/app/interrupt/signals.js +5 -5
  40. package/dist/app/middlewares/permissions.d.ts +42 -0
  41. package/dist/app/middlewares/permissions.js +38 -0
  42. package/dist/app/register/CommandRegistrar.d.ts +2 -2
  43. package/dist/app/register/CommandRegistrar.js +7 -7
  44. package/dist/app/router/CommandsRouter.js +1 -1
  45. package/dist/app/router/index.js +1 -1
  46. package/dist/app-process-CjMovpoZ.js.map +1 -1
  47. package/dist/{build-DXl8uEv4.js → build-Yhb1VjD0.js} +2 -2
  48. package/dist/build-Yhb1VjD0.js.map +1 -0
  49. package/dist/cli/build.d.ts +2 -2
  50. package/dist/cli/build.js +8 -8
  51. package/dist/cli/common.d.ts +2 -2
  52. package/dist/cli/development.js +9 -9
  53. package/dist/cli/development.js.map +1 -1
  54. package/dist/cli/generators.js.map +1 -1
  55. package/dist/cli/information.js +1 -1
  56. package/dist/cli/information.js.map +1 -1
  57. package/dist/cli/init.js +8 -8
  58. package/dist/cli/production.js +8 -8
  59. package/dist/cli/production.js.map +1 -1
  60. package/dist/{commandkit-DMEW0kJg.js → commandkit-c0sAaK0G.js} +352 -202
  61. package/dist/commandkit-c0sAaK0G.js.map +1 -0
  62. package/dist/commandkit.d.ts +2 -2
  63. package/dist/commandkit.js +7 -7
  64. package/dist/common-DNADUU3_.js.map +1 -1
  65. package/dist/common-vnMIelAE.js.map +1 -1
  66. package/dist/components/index.js +7 -7
  67. package/dist/components/v1/button/Button.js +7 -7
  68. package/dist/components/v1/button/ButtonKit.js +7 -7
  69. package/dist/components/v1/modal/Modal.js +7 -7
  70. package/dist/components/v1/modal/ModalKit.js +7 -7
  71. package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +7 -7
  72. package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +7 -7
  73. package/dist/components/v1/select-menu/RoleSelectMenuKit.js +7 -7
  74. package/dist/components/v1/select-menu/SelectMenu.js +7 -7
  75. package/dist/components/v1/select-menu/StringSelectMenuKit.js +7 -7
  76. package/dist/components/v1/select-menu/UserSelectMenuKit.js +7 -7
  77. package/dist/config/config.d.ts +3 -3
  78. package/dist/config/config.js +7 -7
  79. package/dist/config/default.d.ts +2 -2
  80. package/dist/config/default.js +7 -7
  81. package/dist/config/loader.d.ts +2 -2
  82. package/dist/config/loader.js +7 -7
  83. package/dist/config/types.d.ts +2 -2
  84. package/dist/config/utils.d.ts +2 -2
  85. package/dist/{config-CcWJ-vz5.d.ts → config-ClEaYnf1.d.ts} +2 -2
  86. package/dist/constants-4oxxvaJA.js.map +1 -1
  87. package/dist/constants-B5_Ta7PR.js.map +1 -1
  88. package/dist/{constants-DrjIvQd6.d.ts → constants-D8PMA9on.d.ts} +1 -1
  89. package/dist/{constants-CUND8XkG.js → constants-DxfYtA6t.js} +1 -1
  90. package/dist/{constants-CUND8XkG.js.map → constants-DxfYtA6t.js.map} +1 -1
  91. package/dist/container-z621KfH5.js.map +1 -1
  92. package/dist/context/async-context.d.ts +2 -2
  93. package/dist/context/async-context.js +7 -7
  94. package/dist/context/environment.d.ts +2 -2
  95. package/dist/context/environment.js +7 -7
  96. package/dist/dotprops-C_4L7RPD.js.map +1 -1
  97. package/dist/element-Bak9llw_.js.map +1 -1
  98. package/dist/env-_68PRRoA.js.map +1 -1
  99. package/dist/error-codes-B4TyW4Ct.d.ts +54 -0
  100. package/dist/{error-codes-C-ViHyu-.js → error-codes-Ds0bnPvT.js} +2 -2
  101. package/dist/error-codes-Ds0bnPvT.js.map +1 -0
  102. package/dist/events/CommandKitEventsChannel.d.ts +2 -2
  103. package/dist/{feature-flags-Cxl9JtVG.js → feature-flags-Dxi9TI2e.js} +5 -5
  104. package/dist/{feature-flags-Cxl9JtVG.js.map → feature-flags-Dxi9TI2e.js.map} +1 -1
  105. package/dist/file-DVZC0QXI.js.map +1 -1
  106. package/dist/flags/FlagProvider.d.ts +2 -2
  107. package/dist/flags/FlagProvider.js.map +1 -1
  108. package/dist/flags/feature-flags.d.ts +2 -2
  109. package/dist/flags/feature-flags.js +8 -8
  110. package/dist/flags/store.d.ts +2 -2
  111. package/dist/helpers-BUlN3lIz.js.map +1 -1
  112. package/dist/index.d.ts +9 -8
  113. package/dist/index.js +22 -15
  114. package/dist/index.js.map +1 -0
  115. package/dist/{init-DTBFphOg.js → init-CrFvqdxZ.js} +2 -2
  116. package/dist/{init-DTBFphOg.js.map → init-CrFvqdxZ.js.map} +1 -1
  117. package/dist/kv/constants.d.ts +1 -1
  118. package/dist/kv/kv.d.ts +2 -2
  119. package/dist/kv/kv.js.map +1 -1
  120. package/dist/kv/serde.d.ts +2 -2
  121. package/dist/logger/DefaultLogger.d.ts +2 -2
  122. package/dist/logger/DefaultLogger.js +7 -7
  123. package/dist/logger/ILogger.d.ts +1 -1
  124. package/dist/logger/Logger.d.ts +2 -2
  125. package/dist/logger/Logger.js +7 -7
  126. package/dist/logger/NoopLogger.d.ts +41 -11
  127. package/dist/logger/NoopLogger.js +5 -25
  128. package/dist/logger/NoopLogger.js.map +1 -1
  129. package/dist/media-gallery-CIKypjbJ.js.map +1 -1
  130. package/dist/plugins/CompilerPlugin.d.ts +2 -2
  131. package/dist/plugins/PluginCommon.d.ts +2 -2
  132. package/dist/plugins/RuntimePlugin.d.ts +2 -2
  133. package/dist/plugins/index.d.ts +2 -2
  134. package/dist/plugins/index.js +7 -7
  135. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +2 -2
  136. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +7 -7
  137. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +2 -2
  138. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +7 -7
  139. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +2 -2
  140. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +7 -7
  141. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +2 -2
  142. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +7 -7
  143. package/dist/plugins/plugin-runtime/runtime.d.ts +2 -2
  144. package/dist/plugins/types.d.ts +2 -2
  145. package/dist/resolve-file-url-DHTQj2mU.js.map +1 -1
  146. package/dist/section-CuYr0Inu.js.map +1 -1
  147. package/dist/separator-DLdWBjSN.js.map +1 -1
  148. package/dist/{serde-BUDI03pX.d.ts → serde-BYaKrsOV.d.ts} +2 -2
  149. package/dist/serde-CHySNpFr.js.map +1 -1
  150. package/dist/{signals-BQbEfy3X.d.ts → signals-SHg7J1U_.d.ts} +4 -7
  151. package/dist/{signals-DHdYrd-n.js → signals-r7qPAvOR.js} +12 -15
  152. package/dist/signals-r7qPAvOR.js.map +1 -0
  153. package/dist/store-CiqLHedg.js.map +1 -1
  154. package/dist/text-display--p2-BoUa.js.map +1 -1
  155. package/dist/type-checker-1Iu1jJcy.js.map +1 -1
  156. package/dist/types-package-DrnIdWLg.js.map +1 -1
  157. package/dist/types.d.ts +3 -3
  158. package/dist/utils/dev-hooks.d.ts +2 -2
  159. package/dist/utils/dev-hooks.js +7 -7
  160. package/dist/utils/error-codes.d.ts +2 -54
  161. package/dist/utils/error-codes.js +1 -1
  162. package/dist/utils/useful-stuff/async-queue.js.map +1 -1
  163. package/dist/utils/useful-stuff/mutex.js.map +1 -1
  164. package/dist/utils/useful-stuff/ratelimiter.js.map +1 -1
  165. package/dist/utils/useful-stuff/semaphore.js.map +1 -1
  166. package/dist/utils/utilities.js +7 -7
  167. package/dist/utils/warn-unstable.js.map +1 -1
  168. package/dist/utils-BnXM4eKk.js.map +1 -1
  169. package/dist/utils-DCSnVAZ6.js.map +1 -1
  170. package/dist/{version-Df1T7P2K.js → version-BoHnO-Go.js} +2 -2
  171. package/dist/{version-Df1T7P2K.js.map → version-BoHnO-Go.js.map} +1 -1
  172. package/dist/version.js +1 -1
  173. package/package.json +60 -59
  174. package/dist/ILogger-DBGON5wx.d.ts +0 -34
  175. package/dist/build-DXl8uEv4.js.map +0 -1
  176. package/dist/commandkit-DMEW0kJg.js.map +0 -1
  177. package/dist/error-codes-C-ViHyu-.js.map +0 -1
  178. package/dist/signals-DHdYrd-n.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"constants-CUND8XkG.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;;;;;AAMhC,MAAa,kBAAkB;CAE7B,mBAAmB;CAEnB,sBAAsB;CACtB,uBAAuB;CAEvB,WAAW;CACX,YAAY;CACZ,mBAAmB;CACpB"}
1
+ {"version":3,"file":"constants-DxfYtA6t.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;;;;;AAMhC,MAAa,kBAAkB;CAE7B,mBAAmB;CAEnB,sBAAsB;CACtB,uBAAuB;CAEvB,WAAW;CACX,YAAY;CACZ,mBAAmB"}
@@ -1 +1 @@
1
- {"version":3,"file":"container-z621KfH5.js","names":[],"sources":["../src/components/v2/container.ts"],"sourcesContent":["import {\n ActionRowBuilder,\n ColorResolvable,\n ComponentBuilder,\n ContainerBuilder,\n ContainerComponentData,\n FileBuilder,\n MediaGalleryBuilder,\n resolveColor,\n SectionBuilder,\n SeparatorBuilder,\n TextDisplayBuilder,\n} from 'discord.js';\nimport { applyId } from './common';\n\n/**\n * Represents the properties for a container component.\n */\nexport interface ContainerProps\n extends Omit<ContainerComponentData, 'type' | 'components' | 'accentColor'> {\n accentColor?: ColorResolvable;\n children?: ComponentBuilder[];\n}\n\n/**\n * The components v2 container component\n * @param props - The properties for the container component.\n * @returns the container builder instance.\n * @example ```tsx\n * import { Container } from 'commandkit';\n *\n * const container = <Container>...</Container>;\n * ```\n */\nexport function Container(props: ContainerProps): ContainerBuilder {\n const container = new ContainerBuilder();\n\n applyId(props, container);\n\n if (typeof props.accentColor != null) {\n container.setAccentColor(resolveColor(props.accentColor!));\n }\n\n if (props.spoiler != null) {\n container.setSpoiler(props.spoiler);\n }\n\n if (props.children != null) {\n if (!Array.isArray(props.children)) props.children = [props.children];\n if (props.children.length === 0) return container;\n\n for (const child of props.children.flat()) {\n if (child instanceof TextDisplayBuilder) {\n container.addTextDisplayComponents(child);\n }\n\n if (child instanceof FileBuilder) {\n container.addFileComponents(child);\n }\n\n if (child instanceof ActionRowBuilder) {\n container.addActionRowComponents(child);\n }\n\n if (child instanceof SeparatorBuilder) {\n container.addSeparatorComponents(child);\n }\n\n if (child instanceof SectionBuilder) {\n container.addSectionComponents(child);\n }\n\n if (child instanceof MediaGalleryBuilder) {\n container.addMediaGalleryComponents(child);\n }\n }\n }\n\n return container;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,SAAgB,UAAU,OAAyC;CACjE,MAAM,YAAY,IAAI;AAEtB,wBAAQ,OAAO;AAGb,WAAU,4CAA4B,MAAM;AAG9C,KAAI,MAAM,WAAW,KACnB,WAAU,WAAW,MAAM;AAG7B,KAAI,MAAM,YAAY,MAAM;AAC1B,MAAI,CAAC,MAAM,QAAQ,MAAM,UAAW,OAAM,WAAW,CAAC,MAAM,SAAS;AACrE,MAAI,MAAM,SAAS,WAAW,EAAG,QAAO;AAExC,OAAK,MAAM,SAAS,MAAM,SAAS,QAAQ;AACzC,OAAI,iBAAiB,8BACnB,WAAU,yBAAyB;AAGrC,OAAI,iBAAiB,uBACnB,WAAU,kBAAkB;AAG9B,OAAI,iBAAiB,4BACnB,WAAU,uBAAuB;AAGnC,OAAI,iBAAiB,4BACnB,WAAU,uBAAuB;AAGnC,OAAI,iBAAiB,0BACnB,WAAU,qBAAqB;AAGjC,OAAI,iBAAiB,+BACnB,WAAU,0BAA0B;EAExC;CACF;AAEA,QAAO;AACT"}
1
+ {"version":3,"file":"container-z621KfH5.js","names":[],"sources":["../src/components/v2/container.ts"],"sourcesContent":["import {\n ActionRowBuilder,\n ColorResolvable,\n ComponentBuilder,\n ContainerBuilder,\n ContainerComponentData,\n FileBuilder,\n MediaGalleryBuilder,\n resolveColor,\n SectionBuilder,\n SeparatorBuilder,\n TextDisplayBuilder,\n} from 'discord.js';\nimport { applyId } from './common';\n\n/**\n * Represents the properties for a container component.\n */\nexport interface ContainerProps\n extends Omit<ContainerComponentData, 'type' | 'components' | 'accentColor'> {\n accentColor?: ColorResolvable;\n children?: ComponentBuilder[];\n}\n\n/**\n * The components v2 container component\n * @param props - The properties for the container component.\n * @returns the container builder instance.\n * @example ```tsx\n * import { Container } from 'commandkit';\n *\n * const container = <Container>...</Container>;\n * ```\n */\nexport function Container(props: ContainerProps): ContainerBuilder {\n const container = new ContainerBuilder();\n\n applyId(props, container);\n\n if (typeof props.accentColor != null) {\n container.setAccentColor(resolveColor(props.accentColor!));\n }\n\n if (props.spoiler != null) {\n container.setSpoiler(props.spoiler);\n }\n\n if (props.children != null) {\n if (!Array.isArray(props.children)) props.children = [props.children];\n if (props.children.length === 0) return container;\n\n for (const child of props.children.flat()) {\n if (child instanceof TextDisplayBuilder) {\n container.addTextDisplayComponents(child);\n }\n\n if (child instanceof FileBuilder) {\n container.addFileComponents(child);\n }\n\n if (child instanceof ActionRowBuilder) {\n container.addActionRowComponents(child);\n }\n\n if (child instanceof SeparatorBuilder) {\n container.addSeparatorComponents(child);\n }\n\n if (child instanceof SectionBuilder) {\n container.addSectionComponents(child);\n }\n\n if (child instanceof MediaGalleryBuilder) {\n container.addMediaGalleryComponents(child);\n }\n }\n }\n\n return container;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,SAAgB,UAAU,OAAyC;CACjE,MAAM,YAAY,IAAI;AAEtB,wBAAQ,OAAO;AAGb,WAAU,4CAA4B,MAAM;AAG9C,KAAI,MAAM,WAAW,KACnB,WAAU,WAAW,MAAM;AAG7B,KAAI,MAAM,YAAY,MAAM;AAC1B,MAAI,CAAC,MAAM,QAAQ,MAAM,UAAW,OAAM,WAAW,CAAC,MAAM;AAC5D,MAAI,MAAM,SAAS,WAAW,EAAG,QAAO;AAExC,OAAK,MAAM,SAAS,MAAM,SAAS,QAAQ;AACzC,OAAI,iBAAiB,8BACnB,WAAU,yBAAyB;AAGrC,OAAI,iBAAiB,uBACnB,WAAU,kBAAkB;AAG9B,OAAI,iBAAiB,4BACnB,WAAU,uBAAuB;AAGnC,OAAI,iBAAiB,4BACnB,WAAU,uBAAuB;AAGnC,OAAI,iBAAiB,0BACnB,WAAU,qBAAqB;AAGjC,OAAI,iBAAiB,+BACnB,WAAU,0BAA0B;;;AAK1C,QAAO"}
@@ -1,4 +1,4 @@
1
- import { AsyncFunction, GenericFunction, exitContext, getCommandKit, getContext, isCommandWorkerContext, makeContextAwareFunction, provideContext, useEnvironment } from "../analytics-engine-vA4MaJYx.js";
1
+ import { AsyncFunction, GenericFunction, exitContext, getCommandKit, getContext, isCommandWorkerContext, makeContextAwareFunction, provideContext, useEnvironment } from "../analytics-engine-Iu_1uJop.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
23
23
  import "../index-DSBMRX9A.js";
24
24
  import "../index-DdqikUQD.js";
25
25
  import "../MessageCommandParser-ROLibZPX.js";
26
- import "../signals-BQbEfy3X.js";
26
+ import "../signals-SHg7J1U_.js";
27
27
  import "../helpers-Wg6P5fRQ.js";
28
28
  import "../CommandsRouter-CoOA7hkf.js";
29
29
  import "../EventsRouter-BacqK6z3.js";
@@ -1,7 +1,7 @@
1
1
  require('../colors-Cd4Oz-r-.js');
2
2
  require('../ActionRow-CmTHbo2t.js');
3
- require('../error-codes-C-ViHyu-.js');
4
- const require_commandkit = require('../commandkit-DMEW0kJg.js');
3
+ require('../error-codes-Ds0bnPvT.js');
4
+ const require_commandkit = require('../commandkit-c0sAaK0G.js');
5
5
  require('../common-CcfjYnPG.js');
6
6
  require('../common-vnMIelAE.js');
7
7
  require('../container-z621KfH5.js');
@@ -23,11 +23,11 @@ require('../runtime-5fxB4uhe.js');
23
23
  require('../utils-BnXM4eKk.js');
24
24
  require('../resolve-file-url-DHTQj2mU.js');
25
25
  require('../types-package-DrnIdWLg.js');
26
- require('../EventWorkerContext-CSlD9rbx.js');
27
- require('../signals-DHdYrd-n.js');
28
- require('../constants-CUND8XkG.js');
29
- require('../MessageCommandParser-B_BEQ3p8.js');
30
- require('../CommandsRouter-Ci1Pe8Vd.js');
26
+ require('../constants-DxfYtA6t.js');
27
+ require('../EventWorkerContext-TZIKxVCu.js');
28
+ require('../signals-r7qPAvOR.js');
29
+ require('../MessageCommandParser-TPEPhjvx.js');
30
+ require('../CommandsRouter-tMAivEfv.js');
31
31
  require('../EventsRouter-C_J0M3uO.js');
32
32
  require('../router-DHnFRADH.js');
33
33
  require('../common-DNADUU3_.js');
@@ -1,4 +1,4 @@
1
- import { CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, after, cancelAfter } from "../analytics-engine-vA4MaJYx.js";
1
+ import { CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, after, cancelAfter } from "../analytics-engine-Iu_1uJop.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
23
23
  import "../index-DSBMRX9A.js";
24
24
  import "../index-DdqikUQD.js";
25
25
  import "../MessageCommandParser-ROLibZPX.js";
26
- import "../signals-BQbEfy3X.js";
26
+ import "../signals-SHg7J1U_.js";
27
27
  import "../helpers-Wg6P5fRQ.js";
28
28
  import "../CommandsRouter-CoOA7hkf.js";
29
29
  import "../EventsRouter-BacqK6z3.js";
@@ -1,7 +1,7 @@
1
1
  require('../colors-Cd4Oz-r-.js');
2
2
  require('../ActionRow-CmTHbo2t.js');
3
- require('../error-codes-C-ViHyu-.js');
4
- const require_commandkit = require('../commandkit-DMEW0kJg.js');
3
+ require('../error-codes-Ds0bnPvT.js');
4
+ const require_commandkit = require('../commandkit-c0sAaK0G.js');
5
5
  require('../common-CcfjYnPG.js');
6
6
  require('../common-vnMIelAE.js');
7
7
  require('../container-z621KfH5.js');
@@ -23,11 +23,11 @@ require('../runtime-5fxB4uhe.js');
23
23
  require('../utils-BnXM4eKk.js');
24
24
  require('../resolve-file-url-DHTQj2mU.js');
25
25
  require('../types-package-DrnIdWLg.js');
26
- require('../EventWorkerContext-CSlD9rbx.js');
27
- require('../signals-DHdYrd-n.js');
28
- require('../constants-CUND8XkG.js');
29
- require('../MessageCommandParser-B_BEQ3p8.js');
30
- require('../CommandsRouter-Ci1Pe8Vd.js');
26
+ require('../constants-DxfYtA6t.js');
27
+ require('../EventWorkerContext-TZIKxVCu.js');
28
+ require('../signals-r7qPAvOR.js');
29
+ require('../MessageCommandParser-TPEPhjvx.js');
30
+ require('../CommandsRouter-tMAivEfv.js');
31
31
  require('../EventsRouter-C_J0M3uO.js');
32
32
  require('../router-DHnFRADH.js');
33
33
  require('../common-DNADUU3_.js');
@@ -1 +1 @@
1
- {"version":3,"file":"dotprops-C_4L7RPD.js","names":[],"sources":["../src/kv/dotprops.ts"],"sourcesContent":["export function getNestedValue(obj: any, path: string): any {\n const keys = path.split('.');\n let current = obj;\n\n for (const key of keys) {\n if (current === null || current === undefined) {\n return undefined;\n }\n current = current[key];\n }\n\n return current;\n}\n\nexport function setNestedValue(obj: any, path: string, value: any): void {\n const keys = path.split('.');\n const lastKey = keys.pop()!;\n let current = obj;\n\n for (const key of keys) {\n if (current[key] === null || current[key] === undefined) {\n current[key] = {};\n }\n current = current[key];\n }\n\n current[lastKey] = value;\n}\n"],"mappings":";;AAAA,SAAgB,eAAe,KAAU,MAAmB;CAC1D,MAAM,OAAO,KAAK,MAAM;CACxB,IAAI,UAAU;AAEd,MAAK,MAAM,OAAO,MAAM;AACtB,MAAI,YAAY,QAAQ,YAAY,OAClC,QAAO;AAET,YAAU,QAAQ;CACpB;AAEA,QAAO;AACT;AAEA,SAAgB,eAAe,KAAU,MAAc,OAAkB;CACvE,MAAM,OAAO,KAAK,MAAM;CACxB,MAAM,UAAU,KAAK;CACrB,IAAI,UAAU;AAEd,MAAK,MAAM,OAAO,MAAM;AACtB,MAAI,QAAQ,SAAS,QAAQ,QAAQ,SAAS,OAC5C,SAAQ,OAAO,EAAE;AAEnB,YAAU,QAAQ;CACpB;AAEA,SAAQ,WAAW;AACrB"}
1
+ {"version":3,"file":"dotprops-C_4L7RPD.js","names":[],"sources":["../src/kv/dotprops.ts"],"sourcesContent":["export function getNestedValue(obj: any, path: string): any {\n const keys = path.split('.');\n let current = obj;\n\n for (const key of keys) {\n if (current === null || current === undefined) {\n return undefined;\n }\n current = current[key];\n }\n\n return current;\n}\n\nexport function setNestedValue(obj: any, path: string, value: any): void {\n const keys = path.split('.');\n const lastKey = keys.pop()!;\n let current = obj;\n\n for (const key of keys) {\n if (current[key] === null || current[key] === undefined) {\n current[key] = {};\n }\n current = current[key];\n }\n\n current[lastKey] = value;\n}\n"],"mappings":";;AAAA,SAAgB,eAAe,KAAU,MAAmB;CAC1D,MAAM,OAAO,KAAK,MAAM;CACxB,IAAI,UAAU;AAEd,MAAK,MAAM,OAAO,MAAM;AACtB,MAAI,YAAY,QAAQ,YAAY,OAClC,QAAO;AAET,YAAU,QAAQ;;AAGpB,QAAO;;AAGT,SAAgB,eAAe,KAAU,MAAc,OAAkB;CACvE,MAAM,OAAO,KAAK,MAAM;CACxB,MAAM,UAAU,KAAK;CACrB,IAAI,UAAU;AAEd,MAAK,MAAM,OAAO,MAAM;AACtB,MAAI,QAAQ,SAAS,QAAQ,QAAQ,SAAS,OAC5C,SAAQ,OAAO;AAEjB,YAAU,QAAQ;;AAGpB,SAAQ,WAAW"}
@@ -1 +1 @@
1
- {"version":3,"file":"element-Bak9llw_.js","names":[],"sources":["../src/components/common/element.ts"],"sourcesContent":["import { ActionRowBuilder, TextInputBuilder } from 'discord.js';\nimport type { ButtonKit } from '../v1/button/ButtonKit';\nimport { warnUnstable } from '../../utils/warn-unstable';\nimport { ModalKit } from '../v1/modal/ModalKit';\n\n/**\n * Represents the types of elements that can be used in CommandKit.\n */\nexport const ElementType = {\n ActionRow: 'action-row',\n Button: 'button-kit',\n Modal: 'modal',\n TextInput: 'text-input',\n} as const;\n\n/**\n * The type of element that can be used in CommandKit.\n * This is a union of the keys of the ElementType object.\n */\nexport type ElementType = (typeof ElementType)[keyof typeof ElementType];\n\n/**\n * The data structure that maps each ElementType to its corresponding CommandKit element.\n */\nexport interface CommandKitElementData {\n [ElementType.ActionRow]: ActionRowBuilder;\n [ElementType.Button]: ButtonKit;\n [ElementType.Modal]: ModalKit;\n [ElementType.TextInput]: TextInputBuilder;\n}\n\n/**\n * Represents a CommandKit element with a specific type and data.\n */\nexport type CommandKitElement<Type extends ElementType> =\n CommandKitElementData[Type];\n\n/**\n * Represents any CommandKit element, which can be of any type defined in CommandKitElementData.\n */\nexport type AnyCommandKitElement = CommandKitElement<ElementType>;\n\n/**\n * Checks if the given element is a CommandKit element.\n * @param element The element to check.\n * @returns True if the element is a CommandKit element, false otherwise.\n */\nexport function isCommandKitElement(\n element: unknown,\n): element is CommandKitElement<ElementType> {\n if (typeof element !== 'object' || element === null) return false;\n if (!Reflect.has(element, 'type')) return false;\n if (!Reflect.has(element, 'data')) return false;\n\n return true;\n}\n\n/**\n * Gets the element data for a specific CommandKit element.\n * @param element The CommandKit element to get the data for.\n * @returns The element data for the specified CommandKit element.\n */\nexport function getElement<\n T extends ElementType,\n E extends CommandKitElement<T>,\n>(element: E): CommandKitElementData[T] {\n return element.data as CommandKitElementData[T];\n}\n\n/**\n * Represents the properties for a fragment element in CommandKit.\n */\nexport interface FragmentElementProps {\n children: [];\n}\n\n/**\n * Represents a fragment of CommandKit elements.\n * @param props The properties for the fragment.\n * @returns The fragment element.\n */\nexport function Fragment(\n props: FragmentElementProps,\n): CommandKitElementData[ElementType][] {\n return Array.isArray(props.children)\n ? props.children.flat()\n : [props.children];\n}\n\n/**\n * The createElement function is used to create CommandKit elements.\n * @param type The type of the element to create.\n * @param props The properties for the element.\n * @param children The children of the element.\n * @returns The created CommandKit element.\n */\nexport function createElement(\n type: Function,\n props: Record<string, unknown>,\n ...children: any[]\n): CommandKitElement<ElementType> {\n return type({ ...props, children: props.children ?? children });\n}\n\nexport { createElement as jsx, createElement as jsxs };\n"],"mappings":";;;;;AAQA,MAAa,cAAc;CACzB,WAAW;CACX,QAAQ;CACR,OAAO;CACP,WAAW;CACZ;;;;;;AAkCD,SAAgB,oBAChB,SAC4C;AAC1C,KAAI,OAAO,YAAY,YAAY,YAAY,KAAM,QAAO;AAC5D,KAAI,CAAC,QAAQ,IAAI,SAAS,QAAS,QAAO;AAC1C,KAAI,CAAC,QAAQ,IAAI,SAAS,QAAS,QAAO;AAE1C,QAAO;AACT;;;;;;AAOA,SAAgB,WAGhB,SAAsC;AACpC,QAAO,QAAQ;AACjB;;;;;;AAcA,SAAgB,SAChB,OACuC;AACrC,QAAO,MAAM,QAAQ,MAAM,YAC3B,MAAM,SAAS,SACf,CAAC,MAAM,SAAS;AAClB;;;;;;;;AASA,SAAgB,cAChB,MACA,OACA,GAAG,UAC8B;AAC/B,QAAO,KAAK;EAAE,GAAG;EAAO,UAAU,MAAM,YAAY;EAAU;AAChE"}
1
+ {"version":3,"file":"element-Bak9llw_.js","names":[],"sources":["../src/components/common/element.ts"],"sourcesContent":["import { ActionRowBuilder, TextInputBuilder } from 'discord.js';\nimport type { ButtonKit } from '../v1/button/ButtonKit';\nimport { warnUnstable } from '../../utils/warn-unstable';\nimport { ModalKit } from '../v1/modal/ModalKit';\n\n/**\n * Represents the types of elements that can be used in CommandKit.\n */\nexport const ElementType = {\n ActionRow: 'action-row',\n Button: 'button-kit',\n Modal: 'modal',\n TextInput: 'text-input',\n} as const;\n\n/**\n * The type of element that can be used in CommandKit.\n * This is a union of the keys of the ElementType object.\n */\nexport type ElementType = (typeof ElementType)[keyof typeof ElementType];\n\n/**\n * The data structure that maps each ElementType to its corresponding CommandKit element.\n */\nexport interface CommandKitElementData {\n [ElementType.ActionRow]: ActionRowBuilder;\n [ElementType.Button]: ButtonKit;\n [ElementType.Modal]: ModalKit;\n [ElementType.TextInput]: TextInputBuilder;\n}\n\n/**\n * Represents a CommandKit element with a specific type and data.\n */\nexport type CommandKitElement<Type extends ElementType> =\n CommandKitElementData[Type];\n\n/**\n * Represents any CommandKit element, which can be of any type defined in CommandKitElementData.\n */\nexport type AnyCommandKitElement = CommandKitElement<ElementType>;\n\n/**\n * Checks if the given element is a CommandKit element.\n * @param element The element to check.\n * @returns True if the element is a CommandKit element, false otherwise.\n */\nexport function isCommandKitElement(\n element: unknown,\n): element is CommandKitElement<ElementType> {\n if (typeof element !== 'object' || element === null) return false;\n if (!Reflect.has(element, 'type')) return false;\n if (!Reflect.has(element, 'data')) return false;\n\n return true;\n}\n\n/**\n * Gets the element data for a specific CommandKit element.\n * @param element The CommandKit element to get the data for.\n * @returns The element data for the specified CommandKit element.\n */\nexport function getElement<\n T extends ElementType,\n E extends CommandKitElement<T>,\n>(element: E): CommandKitElementData[T] {\n return element.data as CommandKitElementData[T];\n}\n\n/**\n * Represents the properties for a fragment element in CommandKit.\n */\nexport interface FragmentElementProps {\n children: [];\n}\n\n/**\n * Represents a fragment of CommandKit elements.\n * @param props The properties for the fragment.\n * @returns The fragment element.\n */\nexport function Fragment(\n props: FragmentElementProps,\n): CommandKitElementData[ElementType][] {\n return Array.isArray(props.children)\n ? props.children.flat()\n : [props.children];\n}\n\n/**\n * The createElement function is used to create CommandKit elements.\n * @param type The type of the element to create.\n * @param props The properties for the element.\n * @param children The children of the element.\n * @returns The created CommandKit element.\n */\nexport function createElement(\n type: Function,\n props: Record<string, unknown>,\n ...children: any[]\n): CommandKitElement<ElementType> {\n return type({ ...props, children: props.children ?? children });\n}\n\nexport { createElement as jsx, createElement as jsxs };\n"],"mappings":";;;;;AAQA,MAAa,cAAc;CACzB,WAAW;CACX,QAAQ;CACR,OAAO;CACP,WAAW;;;;;;;AAmCb,SAAgB,oBAChB,SAC4C;AAC1C,KAAI,OAAO,YAAY,YAAY,YAAY,KAAM,QAAO;AAC5D,KAAI,CAAC,QAAQ,IAAI,SAAS,QAAS,QAAO;AAC1C,KAAI,CAAC,QAAQ,IAAI,SAAS,QAAS,QAAO;AAE1C,QAAO;;;;;;;AAQT,SAAgB,WAGhB,SAAsC;AACpC,QAAO,QAAQ;;;;;;;AAejB,SAAgB,SAChB,OACuC;AACrC,QAAO,MAAM,QAAQ,MAAM,YAC3B,MAAM,SAAS,SACf,CAAC,MAAM;;;;;;;;;AAUT,SAAgB,cAChB,MACA,OACA,GAAG,UAC8B;AAC/B,QAAO,KAAK;EAAE,GAAG;EAAO,UAAU,MAAM,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"env-_68PRRoA.js","names":[],"sources":["../src/cli/env.ts"],"sourcesContent":["/**\n * @private\n * @internal\n */\nexport function DevEnv(_static = false) {\n const common = {\n NODE_ENV: 'development',\n COMMANDKIT_IS_DEV: 'true',\n };\n\n if (_static) return Object.assign({}, common);\n\n return Object.assign({}, process.env, common);\n}\n\n/**\n * @private\n * @internal\n */\nexport function ProdEnv(_static = false) {\n const common = {\n NODE_ENV: 'production',\n COMMANDKIT_IS_DEV: 'false',\n };\n\n if (_static) return Object.assign({}, common);\n\n return Object.assign({}, process.env, common);\n}\n\n/**\n * @private\n * @internal\n */\nexport const CommonEnvFiles = ['.env', '.env.local'];\n/**\n * @private\n * @internal\n */\nexport const DevEnvFiles = ['.env.development', '.env.development.local'];\n/**\n * @private\n * @internal\n */\nexport const ProdEnvFiles = ['.env.production', '.env.production.local'];\n/**\n * @private\n * @internal\n */\nexport const devEnvFileArgs = [...CommonEnvFiles, ...DevEnvFiles];\n/**\n * @private\n * @internal\n */\nexport const prodEnvFileArgs = [...CommonEnvFiles, ...ProdEnvFiles];\n/**\n * @private\n * @internal\n */\nexport function setCLIEnv() {\n process.env.COMMANDKIT_IS_CLI = 'true';\n}\n"],"mappings":";;;;;;AAIA,SAAgB,OAAO,UAAU,OAAO;CACtC,MAAM,SAAS;EACb,UAAU;EACV,mBAAmB;EACpB;AAED,KAAI,QAAS,QAAO,OAAO,OAAO,EAAE,EAAE;AAEtC,QAAO,OAAO,OAAO,EAAE,EAAE,QAAQ,KAAK;AACxC;;;;;AAMA,SAAgB,QAAQ,UAAU,OAAO;CACvC,MAAM,SAAS;EACb,UAAU;EACV,mBAAmB;EACpB;AAED,KAAI,QAAS,QAAO,OAAO,OAAO,EAAE,EAAE;AAEtC,QAAO,OAAO,OAAO,EAAE,EAAE,QAAQ,KAAK;AACxC;;;;;AAMA,MAAa,iBAAiB,CAAC,QAAQ,aAAa;;;;;AAKpD,MAAa,cAAc,CAAC,oBAAoB,yBAAyB;;;;;AAKzE,MAAa,eAAe,CAAC,mBAAmB,wBAAwB;;;;;AAKxE,MAAa,iBAAiB,CAAC,GAAG,gBAAgB,GAAG,YAAY;;;;;AAKjE,MAAa,kBAAkB,CAAC,GAAG,gBAAgB,GAAG,aAAa;;;;;AAKnE,SAAgB,YAAY;AAC1B,SAAQ,IAAI,oBAAoB;AAClC"}
1
+ {"version":3,"file":"env-_68PRRoA.js","names":[],"sources":["../src/cli/env.ts"],"sourcesContent":["/**\n * @private\n * @internal\n */\nexport function DevEnv(_static = false) {\n const common = {\n NODE_ENV: 'development',\n COMMANDKIT_IS_DEV: 'true',\n };\n\n if (_static) return Object.assign({}, common);\n\n return Object.assign({}, process.env, common);\n}\n\n/**\n * @private\n * @internal\n */\nexport function ProdEnv(_static = false) {\n const common = {\n NODE_ENV: 'production',\n COMMANDKIT_IS_DEV: 'false',\n };\n\n if (_static) return Object.assign({}, common);\n\n return Object.assign({}, process.env, common);\n}\n\n/**\n * @private\n * @internal\n */\nexport const CommonEnvFiles = ['.env', '.env.local'];\n/**\n * @private\n * @internal\n */\nexport const DevEnvFiles = ['.env.development', '.env.development.local'];\n/**\n * @private\n * @internal\n */\nexport const ProdEnvFiles = ['.env.production', '.env.production.local'];\n/**\n * @private\n * @internal\n */\nexport const devEnvFileArgs = [...CommonEnvFiles, ...DevEnvFiles];\n/**\n * @private\n * @internal\n */\nexport const prodEnvFileArgs = [...CommonEnvFiles, ...ProdEnvFiles];\n/**\n * @private\n * @internal\n */\nexport function setCLIEnv() {\n process.env.COMMANDKIT_IS_CLI = 'true';\n}\n"],"mappings":";;;;;;AAIA,SAAgB,OAAO,UAAU,OAAO;CACtC,MAAM,SAAS;EACb,UAAU;EACV,mBAAmB;;AAGrB,KAAI,QAAS,QAAO,OAAO,OAAO,IAAI;AAEtC,QAAO,OAAO,OAAO,IAAI,QAAQ,KAAK;;;;;;AAOxC,SAAgB,QAAQ,UAAU,OAAO;CACvC,MAAM,SAAS;EACb,UAAU;EACV,mBAAmB;;AAGrB,KAAI,QAAS,QAAO,OAAO,OAAO,IAAI;AAEtC,QAAO,OAAO,OAAO,IAAI,QAAQ,KAAK;;;;;;AAOxC,MAAa,iBAAiB,CAAC,QAAQ;;;;;AAKvC,MAAa,cAAc,CAAC,oBAAoB;;;;;AAKhD,MAAa,eAAe,CAAC,mBAAmB;;;;;AAKhD,MAAa,iBAAiB,CAAC,GAAG,gBAAgB,GAAG;;;;;AAKrD,MAAa,kBAAkB,CAAC,GAAG,gBAAgB,GAAG;;;;;AAKtD,SAAgB,YAAY;AAC1B,SAAQ,IAAI,oBAAoB"}
@@ -0,0 +1,54 @@
1
+ //#region src/utils/error-codes.d.ts
2
+ /**
3
+ * The error codes used by CommandKit.
4
+ */
5
+ declare const CommandKitErrorCodes: {
6
+ /**
7
+ * Error code for exiting middleware.
8
+ */
9
+ readonly StopMiddlewares: symbol;
10
+ /**
11
+ * Error code for forwarded commands.
12
+ */
13
+ readonly ForwardedCommand: symbol;
14
+ /**
15
+ * Error code for invalid command prefix.
16
+ */
17
+ readonly InvalidCommandPrefix: symbol;
18
+ /**
19
+ * Error code for plugin capture handle.
20
+ */
21
+ readonly PluginCaptureHandle: symbol;
22
+ /**
23
+ * Error code for event interruption signal
24
+ */
25
+ readonly StopEvents: symbol;
26
+ };
27
+ /**
28
+ * The type for CommandKit errors.
29
+ */
30
+ type CommandKitError = Error & {
31
+ code: symbol;
32
+ };
33
+ /**
34
+ * Creates a new CommandKit error with the specified code.
35
+ * @param code The error code to assign to the error.
36
+ * @returns A new CommandKit error instance.
37
+ */
38
+ declare function createCommandKitError(code: symbol): CommandKitError;
39
+ /**
40
+ * Checks if the given error is a CommandKit error.
41
+ * @param error The error to check.
42
+ * @returns True if the error is a CommandKit error, false otherwise.
43
+ */
44
+ declare function isCommandKitError(error: unknown): error is CommandKitError;
45
+ /**
46
+ * Checks if the given error is of a specific CommandKit error type.
47
+ * @param error The error to check.
48
+ * @param code The error code or an array of error codes to check against.
49
+ * @returns True if the error matches the specified code(s), false otherwise.
50
+ */
51
+ declare function isErrorType(error: unknown, code: symbol | symbol[]): boolean;
52
+ //#endregion
53
+ export { CommandKitError, CommandKitErrorCodes, createCommandKitError, isCommandKitError, isErrorType };
54
+ //# sourceMappingURL=error-codes-B4TyW4Ct.d.ts.map
@@ -4,7 +4,7 @@
4
4
  * The error codes used by CommandKit.
5
5
  */
6
6
  const CommandKitErrorCodes = {
7
- ExitMiddleware: Symbol("kExitMiddleware"),
7
+ StopMiddlewares: Symbol("kStopMiddlewares"),
8
8
  ForwardedCommand: Symbol("kForwardedCommand"),
9
9
  InvalidCommandPrefix: Symbol("kInvalidCommandPrefix"),
10
10
  PluginCaptureHandle: Symbol("kPluginCaptureHandle"),
@@ -70,4 +70,4 @@ Object.defineProperty(exports, 'isErrorType', {
70
70
  return isErrorType;
71
71
  }
72
72
  });
73
- //# sourceMappingURL=error-codes-C-ViHyu-.js.map
73
+ //# sourceMappingURL=error-codes-Ds0bnPvT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-codes-Ds0bnPvT.js","names":[],"sources":["../src/utils/error-codes.ts"],"sourcesContent":["/**\n * The error codes used by CommandKit.\n */\nexport const CommandKitErrorCodes = {\n /**\n * Error code for exiting middleware.\n */\n StopMiddlewares: Symbol('kStopMiddlewares'),\n /**\n * Error code for forwarded commands.\n */\n ForwardedCommand: Symbol('kForwardedCommand'),\n /**\n * Error code for invalid command prefix.\n */\n InvalidCommandPrefix: Symbol('kInvalidCommandPrefix'),\n /**\n * Error code for plugin capture handle.\n */\n PluginCaptureHandle: Symbol('kPluginCaptureHandle'),\n /**\n * Error code for event interruption signal\n */\n StopEvents: Symbol('kStopEvents'),\n} as const;\n\n/**\n * The type for CommandKit errors.\n */\nexport type CommandKitError = Error & { code: symbol };\n\n/**\n * Creates a new CommandKit error with the specified code.\n * @param code The error code to assign to the error.\n * @returns A new CommandKit error instance.\n */\nexport function createCommandKitError(code: symbol): CommandKitError {\n const error = new Error() as CommandKitError;\n\n Reflect.set(error, 'code', code);\n\n return error;\n}\n\n/**\n * Checks if the given error is a CommandKit error.\n * @param error The error to check.\n * @returns True if the error is a CommandKit error, false otherwise.\n */\nexport function isCommandKitError(error: unknown): error is CommandKitError {\n if (!(error instanceof Error)) return false;\n const code = Reflect.get(error, 'code');\n\n for (const key in CommandKitErrorCodes) {\n if (CommandKitErrorCodes[key as keyof typeof CommandKitErrorCodes] === code)\n return true;\n }\n\n return false;\n}\n\n/**\n * Checks if the given error is of a specific CommandKit error type.\n * @param error The error to check.\n * @param code The error code or an array of error codes to check against.\n * @returns True if the error matches the specified code(s), false otherwise.\n */\nexport function isErrorType(error: unknown, code: symbol | symbol[]): boolean {\n if (!isCommandKitError(error)) return false;\n const errorCode = Reflect.get(error, 'code');\n\n if (!errorCode) return false;\n\n if (Array.isArray(code)) return code.includes(errorCode);\n\n return errorCode === code;\n}\n"],"mappings":";;;;;AAGA,MAAa,uBAAuB;CAIlC,iBAAiB,OAAO;CAIxB,kBAAkB,OAAO;CAIzB,sBAAsB,OAAO;CAI7B,qBAAqB,OAAO;CAI5B,YAAY,OAAO;;;;;;;AAarB,SAAgB,sBAAsB,MAA+B;CACnE,MAAM,wBAAQ,IAAI;AAElB,SAAQ,IAAI,OAAO,QAAQ;AAE3B,QAAO;;;;;;;AAQT,SAAgB,kBAAkB,OAA0C;AAC1E,KAAI,EAAE,iBAAiB,OAAQ,QAAO;CACtC,MAAM,OAAO,QAAQ,IAAI,OAAO;AAEhC,MAAK,MAAM,OAAO,qBAChB,KAAI,qBAAqB,SAA8C,KACvE,QAAO;AAGT,QAAO;;;;;;;;AAST,SAAgB,YAAY,OAAgB,MAAkC;AAC5E,KAAI,CAAC,kBAAkB,OAAQ,QAAO;CACtC,MAAM,YAAY,QAAQ,IAAI,OAAO;AAErC,KAAI,CAAC,UAAW,QAAO;AAEvB,KAAI,MAAM,QAAQ,MAAO,QAAO,KAAK,SAAS;AAE9C,QAAO,cAAc"}
@@ -1,4 +1,4 @@
1
- import { CommandKitEventsChannel, ListenerFunction } from "../analytics-engine-vA4MaJYx.js";
1
+ import { CommandKitEventsChannel, ListenerFunction } from "../analytics-engine-Iu_1uJop.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
23
23
  import "../index-DSBMRX9A.js";
24
24
  import "../index-DdqikUQD.js";
25
25
  import "../MessageCommandParser-ROLibZPX.js";
26
- import "../signals-BQbEfy3X.js";
26
+ import "../signals-SHg7J1U_.js";
27
27
  import "../helpers-Wg6P5fRQ.js";
28
28
  import "../CommandsRouter-CoOA7hkf.js";
29
29
  import "../EventsRouter-BacqK6z3.js";
@@ -1,6 +1,6 @@
1
- const require_commandkit = require('./commandkit-DMEW0kJg.js');
2
- const require_EventWorkerContext = require('./EventWorkerContext-CSlD9rbx.js');
3
- const require_constants = require('./constants-CUND8XkG.js');
1
+ const require_commandkit = require('./commandkit-c0sAaK0G.js');
2
+ const require_constants = require('./constants-DxfYtA6t.js');
3
+ const require_EventWorkerContext = require('./EventWorkerContext-TZIKxVCu.js');
4
4
 
5
5
  //#region src/flags/feature-flags.ts
6
6
  let flagProvider = null;
@@ -90,7 +90,7 @@ var FeatureFlag = class {
90
90
  }
91
91
  }
92
92
  } catch (error) {
93
- require_commandkit.Logger.error(`Error fetching flag provider configuration for "${this.options.key}": ${error}`);
93
+ require_commandkit.Logger.error`Error fetching flag provider configuration for "${this.options.key}": ${error}`;
94
94
  }
95
95
  const decisionStart = performance.now();
96
96
  const decisionResult = await decide({
@@ -162,4 +162,4 @@ Object.defineProperty(exports, 'setFlagProvider', {
162
162
  return setFlagProvider;
163
163
  }
164
164
  });
165
- //# sourceMappingURL=feature-flags-Cxl9JtVG.js.map
165
+ //# sourceMappingURL=feature-flags-Dxi9TI2e.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature-flags-Cxl9JtVG.js","names":[],"sources":["../src/flags/feature-flags.ts"],"sourcesContent":["import { getCommandKit, getContext } from '../context/async-context';\nimport { eventWorkerContext } from '../app/events/EventWorkerContext';\nimport { ParsedEvent } from '../app/router';\nimport { CommandKit } from '../commandkit';\nimport {\n AutocompleteInteraction,\n ChatInputCommandInteraction,\n Client,\n ClientEvents,\n ContextMenuCommandInteraction,\n Guild,\n Message,\n TextBasedChannel,\n} from 'discord.js';\nimport { LoadedCommand } from '../app';\nimport { defer, JsonSerialize } from '../utils/utilities';\nimport { AnalyticsEvents } from '../analytics/constants';\nimport { FlagProvider, FlagConfiguration } from './FlagProvider';\nimport { Logger } from '../logger/Logger';\n\n// Global flag provider\nlet flagProvider: FlagProvider | null = null;\n\n/**\n * Set the global flag provider for all feature flags\n */\nexport function setFlagProvider(provider: FlagProvider): void {\n flagProvider = provider;\n}\n\n/**\n * @private\n */\nexport type MaybePromise<T> = T | Promise<T>;\n\n/**\n * Function type for identifying entities in the context of feature flags.\n * This function should return an object representing the entity that will be used\n * to evaluate the feature flag.\n * It can be synchronous or asynchronous.\n */\nexport type IdentifyFunction<R> = (\n context: EvaluationContext,\n) => MaybePromise<R>;\n\n/**\n * Function type for deciding the outcome of a feature flag based on the provided entities.\n * This function receives an object containing the entities and optionally the provider configuration,\n * and should return the result of the decision.\n * It can be synchronous or asynchronous.\n */\nexport type DecideFunction<E, R> = (data: {\n entities: E;\n provider?: FlagConfiguration | null;\n}) => MaybePromise<R>;\n\n/**\n * Definition for a feature flag, including its key, description, identify function,\n * and decide function.\n * The identify function is used to determine the entities that will be evaluated\n * against the feature flag, while the decide function contains the logic for\n * determining the outcome of the flag based on those entities.\n */\nexport interface FeatureFlagDefinition<R, Entity> {\n /**\n * Unique key for the feature flag.\n * Should be a string that identifies the flag.\n */\n key: string;\n /**\n * Optional description of the feature flag.\n * This can be used for documentation or debugging purposes.\n */\n description?: string;\n /**\n * Optional flag to enable integration with an external flag provider.\n * If true, the flag will use the global flag provider to determine its state.\n * Default: false\n */\n identify?: IdentifyFunction<Entity>;\n /**\n * Function to decide the outcome of the feature flag.\n * This function receives the identified entities and should return the result of the decision.\n */\n decide: DecideFunction<Entity, R>;\n /**\n * Whether to disable analytics tracking for this flag.\n * Default: false\n */\n disableAnalytics?: boolean;\n}\n\n/**\n * Context for evaluating command flags in CommandKit.\n */\nexport interface CommandFlagContext {\n /**\n * The Discord client instance.\n * This is the main entry point for interacting with the Discord API.\n */\n client: Client<true>;\n /**\n * The CommandKit instance, which provides access to the command framework.\n * This includes commands, events, and other features of CommandKit.\n */\n commandkit: CommandKit;\n /**\n * The command context, which includes information about the command being executed.\n * This can include the interaction, message, guild, channel, and the loaded command.\n */\n command: {\n /**\n * The interaction object if the command was invoked via an interaction.\n * This can be a ChatInputCommandInteraction, AutocompleteInteraction, or ContextMenuCommandInteraction.\n */\n interaction?:\n | ChatInputCommandInteraction\n | AutocompleteInteraction\n | ContextMenuCommandInteraction;\n /**\n * The message object if the command was invoked via a message.\n */\n message?: Message;\n /**\n * The guild where the command was invoked, if applicable.\n * This will be null for commands invoked in DMs.\n */\n guild: Guild | null;\n /**\n * The channel where the command was invoked.\n * This can be a text channel, DM channel, or any other type of text-based channel.\n */\n channel: TextBasedChannel | null;\n /**\n * The loaded command instance that is being executed.\n * This contains the command's metadata and logic.\n */\n command: LoadedCommand;\n };\n /**\n * The event context is null for command flags, as they are not tied to a specific event.\n * This is used to differentiate between command and event flags.\n */\n event: null;\n}\n\n/**\n * Context for evaluating event flags in CommandKit.\n */\nexport interface EventFlagContext {\n /**\n * The Discord client instance.\n * This is the main entry point for interacting with the Discord API.\n */\n client: Client<true>;\n /**\n * The CommandKit instance, which provides access to the command framework.\n * This includes commands, events, and other features of CommandKit.\n */\n commandkit: CommandKit;\n /**\n * The event context, which includes information about the event being processed.\n * This can include the parsed event data, the event name, and the namespace if applicable.\n */\n event: {\n /**\n * The parsed event data, which contains the raw data from the event.\n * This can include information like user IDs, channel IDs, and other relevant data.\n */\n data: ParsedEvent;\n /**\n * The name of the event being processed.\n * This is the string identifier for the event, such as 'messageCreate' or 'guildMemberAdd'.\n */\n event: string;\n /**\n * The namespace of the event, if applicable.\n * This can be used to group related events or commands together.\n * It is null if the event does not belong to a specific namespace.\n */\n namespace: string | null;\n /**\n * The arguments passed to the event handler.\n * This is an array of arguments that were passed when the event was triggered.\n * It can be used to access specific data related to the event.\n */\n arguments: any[];\n /**\n * A function to retrieve the arguments for a specific event type.\n * This allows for type-safe access to the arguments based on the event name.\n * @param event - The name of the event to retrieve arguments for.\n */\n argumentsAs<E extends keyof ClientEvents>(event: E): ClientEvents[E];\n };\n /**\n * The command context is null for event flags, as they are not tied to a specific command.\n * This is used to differentiate between command and event flags.\n */\n command: null;\n}\n\n/**\n * Combined context type for feature flag evaluation.\n */\nexport type EvaluationContext = CommandFlagContext | EventFlagContext;\n\n/**\n * Function type for custom evaluation of feature flags.\n * This function can be used to provide a custom evaluation context for the flag.\n * It should return an object representing the entities to be evaluated.\n */\nexport type CustomEvaluationFunction<E> = () => MaybePromise<E>;\n\n/**\n * Context for custom evaluation of feature flags.\n * This allows for more flexible evaluation based on custom logic or external data.\n * The identify function can be a direct object or a function that returns the entities.\n */\nexport type CustomEvaluationContext<E> = {\n /**\n * Optional function to identify the entities for evaluation.\n * This can be a function that returns the entities based on the current context.\n */\n identify: E | CustomEvaluationFunction<E>;\n};\n\nexport interface FlagRunner<E, R> {\n /**\n * Execute the feature flag evaluation with the provided entities.\n * This method will run the identify and decide functions to determine the flag's outcome.\n * @param res - Optional entities to use for evaluation. If not provided, it will call the identify function.\n * @returns A promise that resolves to the result of the feature flag evaluation.\n */\n (): Promise<R>;\n /**\n * Run the feature flag evaluation with a custom context.\n * This allows for more flexible evaluation based on custom logic or external data.\n * @param context - The custom evaluation context containing the identify function or object.\n * @returns A promise that resolves to the result of the feature flag evaluation.\n */\n run(context: CustomEvaluationContext<E>): Promise<R>;\n}\n\n/**\n * Class representing a feature flag in CommandKit.\n */\nexport class FeatureFlag<R, T> {\n private commandkit: CommandKit;\n\n /**\n * Create a new feature flag.\n * @param options - The options for the feature flag.\n */\n public constructor(public readonly options: FeatureFlagDefinition<R, T>) {\n this.commandkit = getCommandKit(true);\n const FlagStore = this.commandkit.flags;\n\n if (FlagStore.has(options.key)) {\n throw new Error(`Feature flag with key \"${options.key}\" already exists.`);\n }\n\n FlagStore.set(options.key, this);\n }\n\n private getContext(): EvaluationContext {\n const env = getContext();\n\n if (env?.context) {\n const {\n client,\n commandkit,\n interaction,\n message,\n guild,\n channel,\n command,\n } = env.context;\n\n return {\n client: client as Client<true>,\n commandkit,\n command: {\n interaction,\n message,\n guild,\n channel,\n command,\n },\n event: null,\n };\n }\n\n const eventCtx = eventWorkerContext.getStore();\n\n if (eventCtx) {\n const { commandkit, data, event, namespace } = eventCtx;\n\n return {\n client: commandkit.client as Client<true>,\n commandkit,\n event: {\n data,\n event,\n namespace,\n arguments: eventCtx.arguments,\n argumentsAs: (eventName) => {\n const args = eventCtx.arguments as ClientEvents[typeof eventName];\n return args;\n },\n },\n command: null,\n };\n }\n\n throw new Error(\n 'Could not determine the execution context. Feature flags may only be used inside a command or event.',\n );\n }\n\n /**\n * Execute the feature flag evaluation.\n * @param res - Optional entities to use for evaluation. If not provided, it will call the identify function.\n * @returns A promise that resolves to the result of the feature flag evaluation.\n */\n public async execute(res?: T): Promise<R> {\n const { decide, identify, disableAnalytics } = this.options;\n\n const identificationStart = performance.now();\n const entities =\n res ??\n (await (async () => {\n const ctx = this.getContext();\n return (await identify?.(ctx)) ?? ({} as T);\n })());\n const identificationTime = performance.now() - identificationStart;\n\n // Get provider configuration if global provider is available\n let providerConfig: FlagConfiguration | null = null;\n if (flagProvider) {\n try {\n providerConfig = await flagProvider.getFlag(this.options.key, entities);\n\n // If provider says flag is disabled, return early with default behavior\n if (providerConfig && !providerConfig.enabled) {\n // For boolean flags, return false; for others, let decide function handle it\n if (typeof decide === 'function') {\n const decisionResult = await decide({\n entities,\n provider: providerConfig,\n });\n return decisionResult as R;\n }\n }\n } catch (error) {\n Logger.error(\n `Error fetching flag provider configuration for \"${this.options.key}\": ${error}`,\n );\n // continue with local decision if provider fails\n }\n }\n\n const decisionStart = performance.now();\n const decisionResult = await decide({\n entities,\n provider: providerConfig,\n });\n const decisionTime = performance.now() - decisionStart;\n\n // Skip analytics if disabled\n if (!disableAnalytics) {\n defer(async () => {\n await this.commandkit.analytics.track({\n name: AnalyticsEvents.FEATURE_FLAG_METRICS,\n data: {\n flag: this.options.key,\n identificationTime: identificationTime.toFixed(2),\n decisionTime: decisionTime.toFixed(2),\n usedProvider: flagProvider !== null,\n providerEnabled: providerConfig?.enabled ?? null,\n },\n });\n });\n\n defer(async () => {\n await this.commandkit.analytics.track({\n name: AnalyticsEvents.FEATURE_FLAG_DECISION,\n id:\n entities &&\n typeof entities === 'object' &&\n 'id' in entities &&\n typeof entities.id === 'string'\n ? entities.id\n : undefined,\n data: {\n flag: this.options.key,\n decision: JsonSerialize(decisionResult, 'unknown'),\n providerUsed: flagProvider !== null,\n },\n });\n });\n }\n\n return decisionResult as R;\n }\n}\n\n/**\n * Create a new feature flag.\n * @param options - The options for the feature flag.\n * @returns A new instance of the FeatureFlag class.\n */\nexport function flag<Returns = boolean, Entity = Record<any, any>>(\n options: FeatureFlagDefinition<Returns, Entity>,\n): FlagRunner<Entity, Returns> {\n const flag = new FeatureFlag<Returns, Entity>(options);\n const runner = flag.execute.bind(flag, undefined) as FlagRunner<\n Entity,\n Returns\n >;\n\n runner.run = async function (ctx) {\n if (!ctx?.identify) {\n throw new Error(\n 'Custom evaluation context must have an identify function or object.',\n );\n }\n\n const context = (\n typeof ctx === 'function'\n ? await (ctx as CustomEvaluationFunction<Entity>)()\n : ctx\n ) as Entity;\n\n const decisionResult = await flag.execute(context);\n\n return decisionResult;\n };\n\n return runner;\n}\n"],"mappings":";;;;;AAqBA,IAAI,eAAoC;;;;AAKxC,SAAgB,gBAAgB,UAA8B;AAC5D,gBAAe;AACjB;;;;AA0NA,IAAa,cAAb,MAA+B;CAC7B,AAAQ;;;;;CAMR,AAAO,YAAY,AAAgB,SAAsC;EAAtC;AACjC,OAAK,aAAa,iCAAc;EAChC,MAAM,YAAY,KAAK,WAAW;AAElC,MAAI,UAAU,IAAI,QAAQ,KACxB,OAAM,IAAI,MAAM,0BAA0B,QAAQ,IAAI;AAGxD,YAAU,IAAI,QAAQ,KAAK;CAC7B;CAEA,AAAQ,aAAgC;EACtC,MAAM,MAAM;AAEZ,gDAAI,IAAK,SAAS;GAChB,MAAM,EACJ,QACA,YACA,aACA,SACA,OACA,SACA,SACD,GAAG,IAAI;AAER,UAAO;IACG;IACR;IACA,SAAS;KACP;KACA;KACA;KACA;KACA;KACD;IACD,OAAO;IACR;EACH;EAEA,MAAM,WAAW,8CAAmB;AAEpC,MAAI,UAAU;GACZ,MAAM,EAAE,YAAY,MAAM,OAAO,WAAW,GAAG;AAE/C,UAAO;IACL,QAAQ,WAAW;IACnB;IACA,OAAO;KACL;KACA;KACA;KACA,WAAW,SAAS;KACpB,cAAc,cAAc;MAC1B,MAAM,OAAO,SAAS;AACtB,aAAO;KACR;KACF;IACD,SAAS;IACV;EACH;AAEA,QAAM,IAAI,MACR;CAEJ;;;;;;CAOA,MAAa,QAAQ,KAAqB;EACxC,MAAM,EAAE,QAAQ,UAAU,kBAAkB,GAAG,KAAK;EAEpD,MAAM,sBAAsB,YAAY;EACxC,MAAM,WACN,OACA,OAAO,YAAY;GACjB,MAAM,MAAM,KAAK;AACjB,UAAQ,2DAAM,SAAW,SAAS,EAAE;EACrC;EACD,MAAM,qBAAqB,YAAY,QAAQ;EAG/C,IAAI,iBAA2C;AAC/C,MAAI,aACF,KAAI;AACF,oBAAiB,MAAM,aAAa,QAAQ,KAAK,QAAQ,KAAK;AAG9D,OAAI,kBAAkB,CAAC,eAAe,SAEpC;QAAI,OAAO,WAAW,YAAY;KAChC,MAAM,mBAAiB,MAAM,OAAO;MAClC;MACA,UAAU;MACX;AACD,YAAO;IACT;;EAEH,SAAQ,OAAO;AACd,6BAAO,MACL,mDAAmD,KAAK,QAAQ,IAAI,KAAK;EAG7E;EAGF,MAAM,gBAAgB,YAAY;EAClC,MAAM,iBAAiB,MAAM,OAAO;GAClC;GACA,UAAU;GACX;EACD,MAAM,eAAe,YAAY,QAAQ;AAGzC,MAAI,CAAC,kBAAkB;AACrB,4BAAM,YAAY;AAChB,UAAM,KAAK,WAAW,UAAU,MAAM;KACpC,MAAM,kCAAgB;KACtB,MAAM;MACJ,MAAM,KAAK,QAAQ;MACnB,oBAAoB,mBAAmB,QAAQ;MAC/C,cAAc,aAAa,QAAQ;MACnC,cAAc,iBAAiB;MAC/B,kFAAiB,eAAgB,YAAW;MAC7C;KACF;GACF;AAED,4BAAM,YAAY;AAChB,UAAM,KAAK,WAAW,UAAU,MAAM;KACpC,MAAM,kCAAgB;KACtB,IACA,YACA,OAAO,aAAa,YACpB,QAAQ,YACR,OAAO,SAAS,OAAO,WACvB,SAAS,KACT;KACA,MAAM;MACJ,MAAM,KAAK,QAAQ;MACnB,UAAU,iCAAc,gBAAgB;MACxC,cAAc,iBAAiB;MAChC;KACF;GACF;EACH;AAEA,SAAO;CACT;AACF;;;;;;AAOA,SAAgB,KAChB,SAC8B;CAC5B,MAAM,SAAO,IAAI,YAA6B;CAC9C,MAAM,SAAS,OAAK,QAAQ,KAAK,QAAM;AAKvC,QAAO,MAAM,eAAgB,KAAK;AAChC,MAAI,4CAAC,IAAK,UACR,OAAM,IAAI,MACR;EAIJ,MAAM,UACN,OAAO,QAAQ,aACf,MAAO,QACP;EAGA,MAAM,iBAAiB,MAAM,OAAK,QAAQ;AAE1C,SAAO;CACR;AAED,QAAO;AACT"}
1
+ {"version":3,"file":"feature-flags-Dxi9TI2e.js","names":[],"sources":["../src/flags/feature-flags.ts"],"sourcesContent":["import { getCommandKit, getContext } from '../context/async-context';\nimport { eventWorkerContext } from '../app/events/EventWorkerContext';\nimport { ParsedEvent } from '../app/router';\nimport { CommandKit } from '../commandkit';\nimport {\n AutocompleteInteraction,\n ChatInputCommandInteraction,\n Client,\n ClientEvents,\n ContextMenuCommandInteraction,\n Guild,\n Message,\n TextBasedChannel,\n} from 'discord.js';\nimport { LoadedCommand } from '../app';\nimport { defer, JsonSerialize } from '../utils/utilities';\nimport { AnalyticsEvents } from '../analytics/constants';\nimport { FlagProvider, FlagConfiguration } from './FlagProvider';\nimport { Logger } from '../logger/Logger';\n\n// Global flag provider\nlet flagProvider: FlagProvider | null = null;\n\n/**\n * Set the global flag provider for all feature flags\n */\nexport function setFlagProvider(provider: FlagProvider): void {\n flagProvider = provider;\n}\n\n/**\n * @private\n */\nexport type MaybePromise<T> = T | Promise<T>;\n\n/**\n * Function type for identifying entities in the context of feature flags.\n * This function should return an object representing the entity that will be used\n * to evaluate the feature flag.\n * It can be synchronous or asynchronous.\n */\nexport type IdentifyFunction<R> = (\n context: EvaluationContext,\n) => MaybePromise<R>;\n\n/**\n * Function type for deciding the outcome of a feature flag based on the provided entities.\n * This function receives an object containing the entities and optionally the provider configuration,\n * and should return the result of the decision.\n * It can be synchronous or asynchronous.\n */\nexport type DecideFunction<E, R> = (data: {\n entities: E;\n provider?: FlagConfiguration | null;\n}) => MaybePromise<R>;\n\n/**\n * Definition for a feature flag, including its key, description, identify function,\n * and decide function.\n * The identify function is used to determine the entities that will be evaluated\n * against the feature flag, while the decide function contains the logic for\n * determining the outcome of the flag based on those entities.\n */\nexport interface FeatureFlagDefinition<R, Entity> {\n /**\n * Unique key for the feature flag.\n * Should be a string that identifies the flag.\n */\n key: string;\n /**\n * Optional description of the feature flag.\n * This can be used for documentation or debugging purposes.\n */\n description?: string;\n /**\n * Optional flag to enable integration with an external flag provider.\n * If true, the flag will use the global flag provider to determine its state.\n * Default: false\n */\n identify?: IdentifyFunction<Entity>;\n /**\n * Function to decide the outcome of the feature flag.\n * This function receives the identified entities and should return the result of the decision.\n */\n decide: DecideFunction<Entity, R>;\n /**\n * Whether to disable analytics tracking for this flag.\n * Default: false\n */\n disableAnalytics?: boolean;\n}\n\n/**\n * Context for evaluating command flags in CommandKit.\n */\nexport interface CommandFlagContext {\n /**\n * The Discord client instance.\n * This is the main entry point for interacting with the Discord API.\n */\n client: Client<true>;\n /**\n * The CommandKit instance, which provides access to the command framework.\n * This includes commands, events, and other features of CommandKit.\n */\n commandkit: CommandKit;\n /**\n * The command context, which includes information about the command being executed.\n * This can include the interaction, message, guild, channel, and the loaded command.\n */\n command: {\n /**\n * The interaction object if the command was invoked via an interaction.\n * This can be a ChatInputCommandInteraction, AutocompleteInteraction, or ContextMenuCommandInteraction.\n */\n interaction?:\n | ChatInputCommandInteraction\n | AutocompleteInteraction\n | ContextMenuCommandInteraction;\n /**\n * The message object if the command was invoked via a message.\n */\n message?: Message;\n /**\n * The guild where the command was invoked, if applicable.\n * This will be null for commands invoked in DMs.\n */\n guild: Guild | null;\n /**\n * The channel where the command was invoked.\n * This can be a text channel, DM channel, or any other type of text-based channel.\n */\n channel: TextBasedChannel | null;\n /**\n * The loaded command instance that is being executed.\n * This contains the command's metadata and logic.\n */\n command: LoadedCommand;\n };\n /**\n * The event context is null for command flags, as they are not tied to a specific event.\n * This is used to differentiate between command and event flags.\n */\n event: null;\n}\n\n/**\n * Context for evaluating event flags in CommandKit.\n */\nexport interface EventFlagContext {\n /**\n * The Discord client instance.\n * This is the main entry point for interacting with the Discord API.\n */\n client: Client<true>;\n /**\n * The CommandKit instance, which provides access to the command framework.\n * This includes commands, events, and other features of CommandKit.\n */\n commandkit: CommandKit;\n /**\n * The event context, which includes information about the event being processed.\n * This can include the parsed event data, the event name, and the namespace if applicable.\n */\n event: {\n /**\n * The parsed event data, which contains the raw data from the event.\n * This can include information like user IDs, channel IDs, and other relevant data.\n */\n data: ParsedEvent;\n /**\n * The name of the event being processed.\n * This is the string identifier for the event, such as 'messageCreate' or 'guildMemberAdd'.\n */\n event: string;\n /**\n * The namespace of the event, if applicable.\n * This can be used to group related events or commands together.\n * It is null if the event does not belong to a specific namespace.\n */\n namespace: string | null;\n /**\n * The arguments passed to the event handler.\n * This is an array of arguments that were passed when the event was triggered.\n * It can be used to access specific data related to the event.\n */\n arguments: any[];\n /**\n * A function to retrieve the arguments for a specific event type.\n * This allows for type-safe access to the arguments based on the event name.\n * @param event - The name of the event to retrieve arguments for.\n */\n argumentsAs<E extends keyof ClientEvents>(event: E): ClientEvents[E];\n };\n /**\n * The command context is null for event flags, as they are not tied to a specific command.\n * This is used to differentiate between command and event flags.\n */\n command: null;\n}\n\n/**\n * Combined context type for feature flag evaluation.\n */\nexport type EvaluationContext = CommandFlagContext | EventFlagContext;\n\n/**\n * Function type for custom evaluation of feature flags.\n * This function can be used to provide a custom evaluation context for the flag.\n * It should return an object representing the entities to be evaluated.\n */\nexport type CustomEvaluationFunction<E> = () => MaybePromise<E>;\n\n/**\n * Context for custom evaluation of feature flags.\n * This allows for more flexible evaluation based on custom logic or external data.\n * The identify function can be a direct object or a function that returns the entities.\n */\nexport type CustomEvaluationContext<E> = {\n /**\n * Optional function to identify the entities for evaluation.\n * This can be a function that returns the entities based on the current context.\n */\n identify: E | CustomEvaluationFunction<E>;\n};\n\nexport interface FlagRunner<E, R> {\n /**\n * Execute the feature flag evaluation with the provided entities.\n * This method will run the identify and decide functions to determine the flag's outcome.\n * @param res - Optional entities to use for evaluation. If not provided, it will call the identify function.\n * @returns A promise that resolves to the result of the feature flag evaluation.\n */\n (): Promise<R>;\n /**\n * Run the feature flag evaluation with a custom context.\n * This allows for more flexible evaluation based on custom logic or external data.\n * @param context - The custom evaluation context containing the identify function or object.\n * @returns A promise that resolves to the result of the feature flag evaluation.\n */\n run(context: CustomEvaluationContext<E>): Promise<R>;\n}\n\n/**\n * Class representing a feature flag in CommandKit.\n */\nexport class FeatureFlag<R, T> {\n private commandkit: CommandKit;\n\n /**\n * Create a new feature flag.\n * @param options - The options for the feature flag.\n */\n public constructor(public readonly options: FeatureFlagDefinition<R, T>) {\n this.commandkit = getCommandKit(true);\n const FlagStore = this.commandkit.flags;\n\n if (FlagStore.has(options.key)) {\n throw new Error(`Feature flag with key \"${options.key}\" already exists.`);\n }\n\n FlagStore.set(options.key, this);\n }\n\n private getContext(): EvaluationContext {\n const env = getContext();\n\n if (env?.context) {\n const {\n client,\n commandkit,\n interaction,\n message,\n guild,\n channel,\n command,\n } = env.context;\n\n return {\n client: client as Client<true>,\n commandkit,\n command: {\n interaction,\n message,\n guild,\n channel,\n command,\n },\n event: null,\n };\n }\n\n const eventCtx = eventWorkerContext.getStore();\n\n if (eventCtx) {\n const { commandkit, data, event, namespace } = eventCtx;\n\n return {\n client: commandkit.client as Client<true>,\n commandkit,\n event: {\n data,\n event,\n namespace,\n arguments: eventCtx.arguments,\n argumentsAs: (eventName) => {\n const args = eventCtx.arguments as ClientEvents[typeof eventName];\n return args;\n },\n },\n command: null,\n };\n }\n\n throw new Error(\n 'Could not determine the execution context. Feature flags may only be used inside a command or event.',\n );\n }\n\n /**\n * Execute the feature flag evaluation.\n * @param res - Optional entities to use for evaluation. If not provided, it will call the identify function.\n * @returns A promise that resolves to the result of the feature flag evaluation.\n */\n public async execute(res?: T): Promise<R> {\n const { decide, identify, disableAnalytics } = this.options;\n\n const identificationStart = performance.now();\n const entities =\n res ??\n (await (async () => {\n const ctx = this.getContext();\n return (await identify?.(ctx)) ?? ({} as T);\n })());\n const identificationTime = performance.now() - identificationStart;\n\n // Get provider configuration if global provider is available\n let providerConfig: FlagConfiguration | null = null;\n if (flagProvider) {\n try {\n providerConfig = await flagProvider.getFlag(this.options.key, entities);\n\n // If provider says flag is disabled, return early with default behavior\n if (providerConfig && !providerConfig.enabled) {\n // For boolean flags, return false; for others, let decide function handle it\n if (typeof decide === 'function') {\n const decisionResult = await decide({\n entities,\n provider: providerConfig,\n });\n return decisionResult as R;\n }\n }\n } catch (error) {\n Logger.error`Error fetching flag provider configuration for \"${this.options.key}\": ${error}`;\n // continue with local decision if provider fails\n }\n }\n\n const decisionStart = performance.now();\n const decisionResult = await decide({\n entities,\n provider: providerConfig,\n });\n const decisionTime = performance.now() - decisionStart;\n\n // Skip analytics if disabled\n if (!disableAnalytics) {\n defer(async () => {\n await this.commandkit.analytics.track({\n name: AnalyticsEvents.FEATURE_FLAG_METRICS,\n data: {\n flag: this.options.key,\n identificationTime: identificationTime.toFixed(2),\n decisionTime: decisionTime.toFixed(2),\n usedProvider: flagProvider !== null,\n providerEnabled: providerConfig?.enabled ?? null,\n },\n });\n });\n\n defer(async () => {\n await this.commandkit.analytics.track({\n name: AnalyticsEvents.FEATURE_FLAG_DECISION,\n id:\n entities &&\n typeof entities === 'object' &&\n 'id' in entities &&\n typeof entities.id === 'string'\n ? entities.id\n : undefined,\n data: {\n flag: this.options.key,\n decision: JsonSerialize(decisionResult, 'unknown'),\n providerUsed: flagProvider !== null,\n },\n });\n });\n }\n\n return decisionResult as R;\n }\n}\n\n/**\n * Create a new feature flag.\n * @param options - The options for the feature flag.\n * @returns A new instance of the FeatureFlag class.\n */\nexport function flag<Returns = boolean, Entity = Record<any, any>>(\n options: FeatureFlagDefinition<Returns, Entity>,\n): FlagRunner<Entity, Returns> {\n const flag = new FeatureFlag<Returns, Entity>(options);\n const runner = flag.execute.bind(flag, undefined) as FlagRunner<\n Entity,\n Returns\n >;\n\n runner.run = async function (ctx) {\n if (!ctx?.identify) {\n throw new Error(\n 'Custom evaluation context must have an identify function or object.',\n );\n }\n\n const context = (\n typeof ctx === 'function'\n ? await (ctx as CustomEvaluationFunction<Entity>)()\n : ctx\n ) as Entity;\n\n const decisionResult = await flag.execute(context);\n\n return decisionResult;\n };\n\n return runner;\n}\n"],"mappings":";;;;;AAqBA,IAAI,eAAoC;;;;AAKxC,SAAgB,gBAAgB,UAA8B;AAC5D,gBAAe;;;;;AA2NjB,IAAa,cAAb,MAA+B;CAC7B,AAAQ;;;;;CAMR,AAAO,YAAY,AAAgB,SAAsC;EAAtC;AACjC,OAAK,aAAa,iCAAc;EAChC,MAAM,YAAY,KAAK,WAAW;AAElC,MAAI,UAAU,IAAI,QAAQ,KACxB,OAAM,IAAI,MAAM,0BAA0B,QAAQ,IAAI;AAGxD,YAAU,IAAI,QAAQ,KAAK;;CAG7B,AAAQ,aAAgC;EACtC,MAAM,MAAM;AAEZ,gDAAI,IAAK,SAAS;GAChB,MAAM,EACJ,QACA,YACA,aACA,SACA,OACA,SACA,YACE,IAAI;AAER,UAAO;IACG;IACR;IACA,SAAS;KACP;KACA;KACA;KACA;KACA;;IAEF,OAAO;;;EAIX,MAAM,WAAW,8CAAmB;AAEpC,MAAI,UAAU;GACZ,MAAM,EAAE,YAAY,MAAM,OAAO,cAAc;AAE/C,UAAO;IACL,QAAQ,WAAW;IACnB;IACA,OAAO;KACL;KACA;KACA;KACA,WAAW,SAAS;KACpB,cAAc,cAAc;MAC1B,MAAM,OAAO,SAAS;AACtB,aAAO;;;IAGX,SAAS;;;AAIb,QAAM,IAAI,MACR;;;;;;;CASJ,MAAa,QAAQ,KAAqB;EACxC,MAAM,EAAE,QAAQ,UAAU,qBAAqB,KAAK;EAEpD,MAAM,sBAAsB,YAAY;EACxC,MAAM,WACN,OACA,OAAO,YAAY;GACjB,MAAM,MAAM,KAAK;AACjB,UAAQ,2DAAM,SAAW,SAAS;;EAEpC,MAAM,qBAAqB,YAAY,QAAQ;EAG/C,IAAI,iBAA2C;AAC/C,MAAI,aACF,KAAI;AACF,oBAAiB,MAAM,aAAa,QAAQ,KAAK,QAAQ,KAAK;AAG9D,OAAI,kBAAkB,CAAC,eAAe,SAEpC;QAAI,OAAO,WAAW,YAAY;KAChC,MAAM,mBAAiB,MAAM,OAAO;MAClC;MACA,UAAU;;AAEZ,YAAO;;;WAGJ,OAAO;AACd,6BAAO,KAAK,mDAAmD,KAAK,QAAQ,IAAI,KAAK;;EAKzF,MAAM,gBAAgB,YAAY;EAClC,MAAM,iBAAiB,MAAM,OAAO;GAClC;GACA,UAAU;;EAEZ,MAAM,eAAe,YAAY,QAAQ;AAGzC,MAAI,CAAC,kBAAkB;AACrB,4BAAM,YAAY;AAChB,UAAM,KAAK,WAAW,UAAU,MAAM;KACpC,MAAM,kCAAgB;KACtB,MAAM;MACJ,MAAM,KAAK,QAAQ;MACnB,oBAAoB,mBAAmB,QAAQ;MAC/C,cAAc,aAAa,QAAQ;MACnC,cAAc,iBAAiB;MAC/B,kFAAiB,eAAgB,YAAW;;;;AAKlD,4BAAM,YAAY;AAChB,UAAM,KAAK,WAAW,UAAU,MAAM;KACpC,MAAM,kCAAgB;KACtB,IACA,YACA,OAAO,aAAa,YACpB,QAAQ,YACR,OAAO,SAAS,OAAO,WACvB,SAAS,KACT;KACA,MAAM;MACJ,MAAM,KAAK,QAAQ;MACnB,UAAU,iCAAc,gBAAgB;MACxC,cAAc,iBAAiB;;;;;AAMvC,SAAO;;;;;;;;AASX,SAAgB,KAChB,SAC8B;CAC5B,MAAM,SAAO,IAAI,YAA6B;CAC9C,MAAM,SAAS,OAAK,QAAQ,KAAK,QAAM;AAKvC,QAAO,MAAM,eAAgB,KAAK;AAChC,MAAI,4CAAC,IAAK,UACR,OAAM,IAAI,MACR;EAIJ,MAAM,UACN,OAAO,QAAQ,aACf,MAAO,QACP;EAGA,MAAM,iBAAiB,MAAM,OAAK,QAAQ;AAE1C,SAAO;;AAGT,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"file-DVZC0QXI.js","names":[],"sources":["../src/components/v2/file.ts"],"sourcesContent":["import { FileBuilder, FileComponentData } from 'discord.js';\n\n/**\n * Represents the properties for a file component.\n */\nexport interface FileProps extends Omit<FileComponentData, 'type' | 'file'> {\n url: string;\n}\n\n/**\n * The file component\n * @param props - The properties for the file component.\n * @returns The file builder instance.\n * @example ```tsx\n * import { File } from 'commandkit';\n *\n * const file = <File url=\"https://example.com/file.png\" />;\n * ```\n */\nexport function File(props: FileProps) {\n const file = new FileBuilder(props);\n\n if (props.url != null) {\n file.setURL(props.url);\n }\n\n return file;\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,SAAgB,KAAK,OAAkB;CACrC,MAAM,OAAO,IAAI,uBAAY;AAE7B,KAAI,MAAM,OAAO,KACf,MAAK,OAAO,MAAM;AAGpB,QAAO;AACT"}
1
+ {"version":3,"file":"file-DVZC0QXI.js","names":[],"sources":["../src/components/v2/file.ts"],"sourcesContent":["import { FileBuilder, FileComponentData } from 'discord.js';\n\n/**\n * Represents the properties for a file component.\n */\nexport interface FileProps extends Omit<FileComponentData, 'type' | 'file'> {\n url: string;\n}\n\n/**\n * The file component\n * @param props - The properties for the file component.\n * @returns The file builder instance.\n * @example ```tsx\n * import { File } from 'commandkit';\n *\n * const file = <File url=\"https://example.com/file.png\" />;\n * ```\n */\nexport function File(props: FileProps) {\n const file = new FileBuilder(props);\n\n if (props.url != null) {\n file.setURL(props.url);\n }\n\n return file;\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,SAAgB,KAAK,OAAkB;CACrC,MAAM,OAAO,IAAI,uBAAY;AAE7B,KAAI,MAAM,OAAO,KACf,MAAK,OAAO,MAAM;AAGpB,QAAO"}
@@ -1,4 +1,4 @@
1
- import { FlagConfiguration, FlagProvider, JsonFlagProvider } from "../analytics-engine-vA4MaJYx.js";
1
+ import { FlagConfiguration, FlagProvider, JsonFlagProvider } from "../analytics-engine-Iu_1uJop.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
23
23
  import "../index-DSBMRX9A.js";
24
24
  import "../index-DdqikUQD.js";
25
25
  import "../MessageCommandParser-ROLibZPX.js";
26
- import "../signals-BQbEfy3X.js";
26
+ import "../signals-SHg7J1U_.js";
27
27
  import "../helpers-Wg6P5fRQ.js";
28
28
  import "../CommandsRouter-CoOA7hkf.js";
29
29
  import "../EventsRouter-BacqK6z3.js";
@@ -1 +1 @@
1
- {"version":3,"file":"FlagProvider.js","names":[],"sources":["../../src/flags/FlagProvider.ts"],"sourcesContent":["import type { MaybePromise } from './feature-flags';\n\n/**\n * Interface for external feature flag providers.\n * Implement this interface to integrate with external flag management systems\n * like LaunchDarkly, Split, Unleash, etc.\n */\nexport interface FlagProvider {\n /**\n * Initialize the provider (e.g., establish connections, load initial config)\n */\n initialize?(): MaybePromise<void>;\n\n /**\n * Get the current value/configuration for a feature flag\n * @param key - The feature flag key\n * @param context - Optional context for flag evaluation\n * @returns The flag configuration or null if not found\n */\n getFlag(key: string, context?: any): MaybePromise<FlagConfiguration | null>;\n\n /**\n * Check if a flag exists in the external system\n * @param key - The feature flag key\n */\n hasFlag(key: string): MaybePromise<boolean>;\n\n /**\n * Cleanup resources when the provider is no longer needed\n */\n destroy?(): MaybePromise<void>;\n}\n\n/**\n * Configuration returned by external flag providers\n */\nexport interface FlagConfiguration {\n /**\n * Whether the flag is enabled/disabled at the provider level\n */\n enabled: boolean;\n\n /**\n * Optional configuration data that can be used in the decide function\n */\n config?: Record<string, any>;\n\n /**\n * Optional percentage for gradual rollouts (0-100)\n */\n percentage?: number;\n\n /**\n * Optional targeting rules or segments\n */\n targeting?: {\n segments?: string[];\n rules?: Array<{\n condition: string;\n value: any;\n }>;\n };\n}\n\n/**\n * Example implementation for a simple JSON-based flag provider\n */\nexport class JsonFlagProvider implements FlagProvider {\n private flags: Map<string, FlagConfiguration> = new Map();\n\n public constructor(private config: Record<string, FlagConfiguration>) {\n Object.entries(config).forEach(([key, value]) => {\n this.flags.set(key, value);\n });\n }\n\n public async getFlag(key: string): Promise<FlagConfiguration | null> {\n return this.flags.get(key) || null;\n }\n\n public async hasFlag(key: string): Promise<boolean> {\n return this.flags.has(key);\n }\n\n public async destroy(): Promise<void> {\n this.flags.clear();\n }\n}\n"],"mappings":";;;;;AAmEA,IAAa,mBAAb,MAAsD;CACpD,AAAQ,wBAAwC,IAAI;CAEpD,AAAO,YAAY,AAAQ,QAA2C;EAA3C;AACzB,SAAO,QAAQ,QAAQ,SAAS,CAAC,KAAK,MAAM,KAAK;AAC/C,QAAK,MAAM,IAAI,KAAK;EACrB;CACH;CAEA,MAAa,QAAQ,KAAgD;AACnE,SAAO,KAAK,MAAM,IAAI,QAAQ;CAChC;CAEA,MAAa,QAAQ,KAA+B;AAClD,SAAO,KAAK,MAAM,IAAI;CACxB;CAEA,MAAa,UAAyB;AACpC,OAAK,MAAM;CACb;AACF"}
1
+ {"version":3,"file":"FlagProvider.js","names":[],"sources":["../../src/flags/FlagProvider.ts"],"sourcesContent":["import type { MaybePromise } from './feature-flags';\n\n/**\n * Interface for external feature flag providers.\n * Implement this interface to integrate with external flag management systems\n * like LaunchDarkly, Split, Unleash, etc.\n */\nexport interface FlagProvider {\n /**\n * Initialize the provider (e.g., establish connections, load initial config)\n */\n initialize?(): MaybePromise<void>;\n\n /**\n * Get the current value/configuration for a feature flag\n * @param key - The feature flag key\n * @param context - Optional context for flag evaluation\n * @returns The flag configuration or null if not found\n */\n getFlag(key: string, context?: any): MaybePromise<FlagConfiguration | null>;\n\n /**\n * Check if a flag exists in the external system\n * @param key - The feature flag key\n */\n hasFlag(key: string): MaybePromise<boolean>;\n\n /**\n * Cleanup resources when the provider is no longer needed\n */\n destroy?(): MaybePromise<void>;\n}\n\n/**\n * Configuration returned by external flag providers\n */\nexport interface FlagConfiguration {\n /**\n * Whether the flag is enabled/disabled at the provider level\n */\n enabled: boolean;\n\n /**\n * Optional configuration data that can be used in the decide function\n */\n config?: Record<string, any>;\n\n /**\n * Optional percentage for gradual rollouts (0-100)\n */\n percentage?: number;\n\n /**\n * Optional targeting rules or segments\n */\n targeting?: {\n segments?: string[];\n rules?: Array<{\n condition: string;\n value: any;\n }>;\n };\n}\n\n/**\n * Example implementation for a simple JSON-based flag provider\n */\nexport class JsonFlagProvider implements FlagProvider {\n private flags: Map<string, FlagConfiguration> = new Map();\n\n public constructor(private config: Record<string, FlagConfiguration>) {\n Object.entries(config).forEach(([key, value]) => {\n this.flags.set(key, value);\n });\n }\n\n public async getFlag(key: string): Promise<FlagConfiguration | null> {\n return this.flags.get(key) || null;\n }\n\n public async hasFlag(key: string): Promise<boolean> {\n return this.flags.has(key);\n }\n\n public async destroy(): Promise<void> {\n this.flags.clear();\n }\n}\n"],"mappings":";;;;;AAmEA,IAAa,mBAAb,MAAsD;CACpD,AAAQ,wBAAwC,IAAI;CAEpD,AAAO,YAAY,AAAQ,QAA2C;EAA3C;AACzB,SAAO,QAAQ,QAAQ,SAAS,CAAC,KAAK,WAAW;AAC/C,QAAK,MAAM,IAAI,KAAK;;;CAIxB,MAAa,QAAQ,KAAgD;AACnE,SAAO,KAAK,MAAM,IAAI,QAAQ;;CAGhC,MAAa,QAAQ,KAA+B;AAClD,SAAO,KAAK,MAAM,IAAI;;CAGxB,MAAa,UAAyB;AACpC,OAAK,MAAM"}
@@ -1,4 +1,4 @@
1
- import { CommandFlagContext, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, EvaluationContext, EventFlagContext, FeatureFlag, FeatureFlagDefinition, FlagRunner, IdentifyFunction, MaybePromise, flag, setFlagProvider } from "../analytics-engine-vA4MaJYx.js";
1
+ import { CommandFlagContext, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, EvaluationContext, EventFlagContext, FeatureFlag, FeatureFlagDefinition, FlagRunner, IdentifyFunction, MaybePromise, flag, setFlagProvider } from "../analytics-engine-Iu_1uJop.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
23
23
  import "../index-DSBMRX9A.js";
24
24
  import "../index-DdqikUQD.js";
25
25
  import "../MessageCommandParser-ROLibZPX.js";
26
- import "../signals-BQbEfy3X.js";
26
+ import "../signals-SHg7J1U_.js";
27
27
  import "../helpers-Wg6P5fRQ.js";
28
28
  import "../CommandsRouter-CoOA7hkf.js";
29
29
  import "../EventsRouter-BacqK6z3.js";
@@ -1,7 +1,7 @@
1
1
  require('../colors-Cd4Oz-r-.js');
2
2
  require('../ActionRow-CmTHbo2t.js');
3
- require('../error-codes-C-ViHyu-.js');
4
- require('../commandkit-DMEW0kJg.js');
3
+ require('../error-codes-Ds0bnPvT.js');
4
+ require('../commandkit-c0sAaK0G.js');
5
5
  require('../common-CcfjYnPG.js');
6
6
  require('../common-vnMIelAE.js');
7
7
  require('../container-z621KfH5.js');
@@ -23,17 +23,17 @@ require('../runtime-5fxB4uhe.js');
23
23
  require('../utils-BnXM4eKk.js');
24
24
  require('../resolve-file-url-DHTQj2mU.js');
25
25
  require('../types-package-DrnIdWLg.js');
26
- require('../EventWorkerContext-CSlD9rbx.js');
27
- require('../signals-DHdYrd-n.js');
28
- require('../constants-CUND8XkG.js');
29
- require('../MessageCommandParser-B_BEQ3p8.js');
30
- require('../CommandsRouter-Ci1Pe8Vd.js');
26
+ require('../constants-DxfYtA6t.js');
27
+ require('../EventWorkerContext-TZIKxVCu.js');
28
+ require('../signals-r7qPAvOR.js');
29
+ require('../MessageCommandParser-TPEPhjvx.js');
30
+ require('../CommandsRouter-tMAivEfv.js');
31
31
  require('../EventsRouter-C_J0M3uO.js');
32
32
  require('../router-DHnFRADH.js');
33
33
  require('../common-DNADUU3_.js');
34
34
  require('../CommandKitEventsChannel-Bgw0XCOl.js');
35
35
  require('../store-CiqLHedg.js');
36
- const require_feature_flags = require('../feature-flags-Cxl9JtVG.js');
36
+ const require_feature_flags = require('../feature-flags-Dxi9TI2e.js');
37
37
 
38
38
  exports.FeatureFlag = require_feature_flags.FeatureFlag;
39
39
  exports.flag = require_feature_flags.flag;
@@ -1,4 +1,4 @@
1
- import { FlagStore } from "../analytics-engine-vA4MaJYx.js";
1
+ import { FlagStore } from "../analytics-engine-Iu_1uJop.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -23,7 +23,7 @@ import "../text-display-DRw3r_lK.js";
23
23
  import "../index-DSBMRX9A.js";
24
24
  import "../index-DdqikUQD.js";
25
25
  import "../MessageCommandParser-ROLibZPX.js";
26
- import "../signals-BQbEfy3X.js";
26
+ import "../signals-SHg7J1U_.js";
27
27
  import "../helpers-Wg6P5fRQ.js";
28
28
  import "../CommandsRouter-CoOA7hkf.js";
29
29
  import "../EventsRouter-BacqK6z3.js";
@@ -1 +1 @@
1
- {"version":3,"file":"helpers-BUlN3lIz.js","names":[],"sources":["../src/app/commands/helpers.ts"],"sourcesContent":["import { Interaction, Message } from 'discord.js';\n\n/**\n * Union type representing possible command sources.\n */\nexport type CommandSource = Interaction | Message;\n\n/**\n * Type guard to check if a command source is a Discord message.\n * @param source - The command source to check\n * @returns True if the source is a Message\n */\nexport function isMessageSource(source: CommandSource): source is Message {\n return source instanceof Message;\n}\n\n/**\n * Type guard to check if a command source is a Discord interaction.\n * @param source - The command source to check\n * @returns True if the source is an Interaction\n */\nexport function isInteractionSource(\n source: CommandSource,\n): source is Interaction {\n return !isMessageSource(source);\n}\n"],"mappings":";;;;;;;;;AAYA,SAAgB,gBAAgB,QAA0C;AACxE,QAAO,kBAAkB;AAC3B;;;;;;AAOA,SAAgB,oBAChB,QACwB;AACtB,QAAO,CAAC,gBAAgB;AAC1B"}
1
+ {"version":3,"file":"helpers-BUlN3lIz.js","names":[],"sources":["../src/app/commands/helpers.ts"],"sourcesContent":["import { Interaction, Message } from 'discord.js';\n\n/**\n * Union type representing possible command sources.\n */\nexport type CommandSource = Interaction | Message;\n\n/**\n * Type guard to check if a command source is a Discord message.\n * @param source - The command source to check\n * @returns True if the source is a Message\n */\nexport function isMessageSource(source: CommandSource): source is Message {\n return source instanceof Message;\n}\n\n/**\n * Type guard to check if a command source is a Discord interaction.\n * @param source - The command source to check\n * @returns True if the source is an Interaction\n */\nexport function isInteractionSource(\n source: CommandSource,\n): source is Interaction {\n return !isMessageSource(source);\n}\n"],"mappings":";;;;;;;;;AAYA,SAAgB,gBAAgB,QAA0C;AACxE,QAAO,kBAAkB;;;;;;;AAQ3B,SAAgB,oBAChB,QACwB;AACtB,QAAO,CAAC,gBAAgB"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, EvaluationContext, EventFlagContext, EventHandler, FeatureFlag, FeatureFlagDefinition, FlagRunner, GenericFunction, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginTransformParameters, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, setFlagProvider, useEnvironment } from "./analytics-engine-vA4MaJYx.js";
1
+ import { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandMetadata, CommandMetadataFunction, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, EvaluationContext, EventFlagContext, EventHandler, FeatureFlag, FeatureFlagDefinition, FlagRunner, GenericFunction, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, LegacyCommandMetadata, LoadedCommand, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginTransformParameters, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, setFlagProvider, useEnvironment } from "./analytics-engine-Iu_1uJop.js";
2
2
  import { EventInterceptor, EventInterceptorContextData, EventInterceptorErrorHandler } from "./EventInterceptor-x-R2qshQ.js";
3
3
  import { ButtonKit, ButtonKitPredicate, CommandKitButtonBuilderInteractionCollectorDispatch, CommandKitButtonBuilderInteractionCollectorDispatchContextData, CommandKitButtonBuilderOnEnd, OnButtonKitClick, OnButtonKitEnd } from "./ButtonKit-C7r7RPNf.js";
4
4
  import { CommandKitModalBuilderInteractionCollectorDispatch, CommandKitModalBuilderInteractionCollectorDispatchContextData, CommandKitModalBuilderOnEnd, ModalKit, ModalKitPredicate, OnModalKitEnd, OnModalKitSubmit } from "./ModalKit-Btz58KYn.js";
@@ -23,20 +23,21 @@ import { StringEncodable, TextDisplay, TextDisplayProps } from "./text-display-D
23
23
  import "./index-DSBMRX9A.js";
24
24
  import "./index-DdqikUQD.js";
25
25
  import { MessageCommandOptions, MessageCommandOptionsSchema, MessageCommandParser, ParsedMessageCommand } from "./MessageCommandParser-ROLibZPX.js";
26
- import { exitMiddleware, redirect, rethrow, stopEvents } from "./signals-BQbEfy3X.js";
26
+ import { redirect, rethrow, stopEvents, stopMiddlewares } from "./signals-SHg7J1U_.js";
27
27
  import { CommandSource, isInteractionSource, isMessageSource } from "./helpers-Wg6P5fRQ.js";
28
28
  import { Command, CommandsRouter, CommandsRouterOptions, Middleware, ParsedCommandData } from "./CommandsRouter-CoOA7hkf.js";
29
29
  import { EventsRouter, EventsRouterOptions, EventsTree, ParsedEvent } from "./EventsRouter-BacqK6z3.js";
30
30
  import "./index-DKcmsWXw.js";
31
31
  import { COMMANDKIT_BOOTSTRAP_MODE, COMMANDKIT_CWD, COMMANDKIT_IS_CLI, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, HMREventType } from "./constants-MKu-Q1jh.js";
32
- import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "./EventWorkerContext-DJUi1W3T.js";
32
+ import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "./EventWorkerContext-BEezHh5-.js";
33
33
  import { bootstrapCommandkitCLI } from "./init-DOr-Y3GQ.js";
34
- import { defineConfig, getConfig } from "./config-CcWJ-vz5.js";
35
- import { ILogger } from "./ILogger-DBGON5wx.js";
36
- import { DefaultLogger } from "./DefaultLogger-Cy55-uPl.js";
37
- import { CommandKitLoggerOptions, Logger, LoggerImpl, createLogger } from "./Logger-iSjA-DWN.js";
34
+ import { defineConfig, getConfig } from "./config-ClEaYnf1.js";
35
+ import { ILogger } from "./ILogger-BW8GM-YZ.js";
36
+ import { DefaultLogger } from "./DefaultLogger-XCOl5nLd.js";
37
+ import { CommandKitLoggerOptions, Logger, LoggerImpl, createLogger } from "./Logger-DyfkPk7u.js";
38
38
  import { version } from "./version-CtJtBJXI.js";
39
39
  import { debounce, defer, devOnly, getCurrentDirectory, getSourceDirectories } from "./utilities-DtdPlr4c.js";
40
40
  import { toFileURL } from "./resolve-file-url-yO8bUxok.js";
41
+ import { CommandKitErrorCodes, isErrorType } from "./error-codes-B4TyW4Ct.js";
41
42
  import { Client, Collection } from "discord.js";
42
- export { ActionRow, ActionRowProps, AnyCommandExecute, AnyCommandKitElement, AppCommand, AppCommandHandler, AppCommandNative, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, Button, ButtonChildrenLike, ButtonKit, ButtonKitPredicate, ButtonProps, COMMANDKIT_BOOTSTRAP_MODE, COMMANDKIT_CWD, COMMANDKIT_IS_CLI, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, ChannelSelectMenu, ChannelSelectMenuKit, ChannelSelectMenuKitPredicate, ChannelSelectMenuProps, ChatInputCommand, ChatInputCommandContext, type Client, Collection, Command, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitButtonBuilderInteractionCollectorDispatch, CommandKitButtonBuilderInteractionCollectorDispatchContextData, CommandKitButtonBuilderOnEnd, CommandKitConfiguration, CommandKitElement, CommandKitElementData, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, type CommandKitHMREvent, CommandKitLoggerOptions, CommandKitModalBuilderInteractionCollectorDispatch, CommandKitModalBuilderInteractionCollectorDispatchContextData, CommandKitModalBuilderOnEnd, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, CommandRegistrar, CommandSource, CommandTypeData, CommandsRouter, CommandsRouterOptions, CommonBuilderKit, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CommonSelectMenuProps, CompilerPlugin, CompilerPluginRuntime, Container, ContainerProps, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, DefaultLogger, ElementType, EvaluationContext, EventFlagContext, EventHandler, EventInterceptor, EventInterceptorContextData, EventInterceptorErrorHandler, EventWorkerContext, EventsRouter, EventsRouterOptions, EventsTree, FeatureFlag, FeatureFlagDefinition, File, FileProps, FlagRunner, Fragment, FragmentElementProps, GenericFunction, HMREventType, ILogger, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, Logger, LoggerImpl, MaybeArray, MaybeFalsey, MaybePromise, MediaGallery, MediaGalleryItem, MediaGalleryItemProps, MediaGalleryProps, MentionableSelectMenu, MentionableSelectMenuKit, MentionableSelectMenuKitPredicate, MentionableSelectMenuProps, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageCommandOptions, MessageCommandOptionsSchema, MessageCommandParser, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, Middleware, MiddlewareContext, MiddlewareContextArgs, Modal, ModalKit, ModalKitPredicate, ModalProps, OnButtonKitClick, OnButtonKitEnd, OnChannelSelectMenuKitSubmit, OnMentionableSelectMenuKitSubmit, OnModalKitEnd, OnModalKitSubmit, OnRoleSelectMenuKitSubmit, OnSelectMenuKitEnd, OnSelectMenuKitSubmit, OnStringSelectMenuKitSubmit, OnUserSelectMenuKitSubmit, ParagraphInput, ParsedCommandData, ParsedEvent, ParsedMessageCommand, PluginTransformParameters, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, ResolveBuilderInteraction, RoleSelectMenu, RoleSelectMenuKit, RoleSelectMenuKitPredicate, RoleSelectMenuProps, RunCommand, RuntimePlugin, Section, SectionProps, SelectMenuKitPredicate, SelectMenuProps, Separator, SeparatorProps, ShortInput, SlashCommandMiddlewareContext, StringEncodable, StringSelectMenu, StringSelectMenuKit, StringSelectMenuKitPredicate, StringSelectMenuOption, StringSelectMenuOptionProps, StringSelectMenuProps, TemplateHandler, TextDisplay, TextDisplayProps, TextInput, TextInputProps, Thumbnail, ThumbnailProps, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, UserSelectMenuKitPredicate, UserSelectMenuProps, after, bootstrapCommandkitCLI, cancelAfter, commandkit, createElement, createElement as jsx, createElement as jsxs, createLogger, debounce, CommandKit as default, defer, defineConfig, devOnly, eventWorkerContext, exitContext, exitMiddleware, flag, getCommandKit, getConfig, getContext, getCurrentDirectory, getElement, getEventWorkerContext, getSourceDirectories, isCommandKitElement, isCommandWorkerContext, isCompilerPlugin, isEventWorkerContext, isInteractionSource, isMessageSource, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, redirect, rethrow, runInEventWorkerContext, setFlagProvider, stopEvents, toFileURL, useEnvironment, version };
43
+ export { ActionRow, ActionRowProps, AnyCommandExecute, AnyCommandKitElement, AppCommand, AppCommandHandler, AppCommandNative, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, Button, ButtonChildrenLike, ButtonKit, ButtonKitPredicate, ButtonProps, COMMANDKIT_BOOTSTRAP_MODE, COMMANDKIT_CWD, COMMANDKIT_IS_CLI, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, ChannelSelectMenu, ChannelSelectMenuKit, ChannelSelectMenuKitPredicate, ChannelSelectMenuProps, ChatInputCommand, ChatInputCommandContext, type Client, Collection, Command, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitButtonBuilderInteractionCollectorDispatch, CommandKitButtonBuilderInteractionCollectorDispatchContextData, CommandKitButtonBuilderOnEnd, CommandKitConfiguration, CommandKitElement, CommandKitElementData, CommandKitEnvironment, type CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitErrorCodes, CommandKitEventDispatch, type CommandKitHMREvent, CommandKitLoggerOptions, CommandKitModalBuilderInteractionCollectorDispatch, CommandKitModalBuilderInteractionCollectorDispatchContextData, CommandKitModalBuilderOnEnd, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandKitSelectMenuBuilderInteractionCollectorDispatch, CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, CommandKitSelectMenuBuilderOnEnd, CommandMetadata, CommandMetadataFunction, CommandRegistrar, CommandSource, CommandTypeData, CommandsRouter, CommandsRouterOptions, CommonBuilderKit, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CommonSelectMenuProps, CompilerPlugin, CompilerPluginRuntime, Container, ContainerProps, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, DefaultLogger, ElementType, EvaluationContext, EventFlagContext, EventHandler, EventInterceptor, EventInterceptorContextData, EventInterceptorErrorHandler, EventWorkerContext, EventsRouter, EventsRouterOptions, EventsTree, FeatureFlag, FeatureFlagDefinition, File, FileProps, FlagRunner, Fragment, FragmentElementProps, GenericFunction, HMREventType, ILogger, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, LegacyCommandMetadata, LoadedCommand, Logger, LoggerImpl, MaybeArray, MaybeFalsey, MaybePromise, MediaGallery, MediaGalleryItem, MediaGalleryItemProps, MediaGalleryProps, MentionableSelectMenu, MentionableSelectMenuKit, MentionableSelectMenuKitPredicate, MentionableSelectMenuProps, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageCommandOptions, MessageCommandOptionsSchema, MessageCommandParser, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, Middleware, MiddlewareContext, MiddlewareContextArgs, Modal, ModalKit, ModalKitPredicate, ModalProps, OnButtonKitClick, OnButtonKitEnd, OnChannelSelectMenuKitSubmit, OnMentionableSelectMenuKitSubmit, OnModalKitEnd, OnModalKitSubmit, OnRoleSelectMenuKitSubmit, OnSelectMenuKitEnd, OnSelectMenuKitSubmit, OnStringSelectMenuKitSubmit, OnUserSelectMenuKitSubmit, ParagraphInput, ParsedCommandData, ParsedEvent, ParsedMessageCommand, PluginTransformParameters, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, ResolveBuilderInteraction, RoleSelectMenu, RoleSelectMenuKit, RoleSelectMenuKitPredicate, RoleSelectMenuProps, RunCommand, RuntimePlugin, Section, SectionProps, SelectMenuKitPredicate, SelectMenuProps, Separator, SeparatorProps, ShortInput, SlashCommandMiddlewareContext, StringEncodable, StringSelectMenu, StringSelectMenuKit, StringSelectMenuKitPredicate, StringSelectMenuOption, StringSelectMenuOptionProps, StringSelectMenuProps, TemplateHandler, TextDisplay, TextDisplayProps, TextInput, TextInputProps, Thumbnail, ThumbnailProps, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, UserSelectMenuKitPredicate, UserSelectMenuProps, bootstrapCommandkitCLI, commandkit, createElement, createElement as jsx, createElement as jsxs, createLogger, debounce, CommandKit as default, defer, defineConfig, devOnly, eventWorkerContext, exitContext, flag, getCommandKit, getConfig, getContext, getCurrentDirectory, getElement, getEventWorkerContext, getSourceDirectories, isCommandKitElement, isCommandWorkerContext, isCompilerPlugin, isErrorType, isEventWorkerContext, isInteractionSource, isMessageSource, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, redirect, rethrow, runInEventWorkerContext, setFlagProvider, stopEvents, stopMiddlewares, toFileURL, after as unstable_after, cancelAfter as unstable_cancelAfter, useEnvironment, version };