commandkit 1.0.0-dev.20250712125002 → 1.0.0-dev.20250713022516

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 (99) hide show
  1. package/dist/CommandKitEventsChannel-BSdcgY3Q.js.map +1 -1
  2. package/dist/{EventWorkerContext-BIed73bA.d.ts → EventWorkerContext-CGIqPuh6.d.ts} +2 -2
  3. package/dist/EventWorkerContext-DxfS_0fJ.js.map +1 -1
  4. package/dist/analytics/analytics-engine.d.ts +1 -1
  5. package/dist/analytics/analytics-engine.js +2 -2
  6. package/dist/analytics/analytics-provider.d.ts +1 -1
  7. package/dist/analytics/utils.js +3 -3
  8. package/dist/{CommandKit-Bt5GNyzq.d.ts → analytics-engine-CA_TBn6w.d.ts} +97 -97
  9. package/dist/app/commands/AppCommandRunner.d.ts +1 -1
  10. package/dist/app/commands/AppCommandRunner.js +2 -2
  11. package/dist/app/commands/Context.d.ts +1 -1
  12. package/dist/app/commands/Context.js +4 -4
  13. package/dist/app/events/EventWorkerContext.d.ts +2 -2
  14. package/dist/app/handlers/AppCommandHandler.d.ts +1 -1
  15. package/dist/app/handlers/AppCommandHandler.js +2 -2
  16. package/dist/app/handlers/AppEventsHandler.d.ts +1 -1
  17. package/dist/app/handlers/AppEventsHandler.js +2 -2
  18. package/dist/app/index.d.ts +1 -1
  19. package/dist/app/index.js +6 -6
  20. package/dist/app/register/CommandRegistrar.d.ts +1 -1
  21. package/dist/app/register/CommandRegistrar.js +2 -2
  22. package/dist/{build-DXo8U0Mv.js → build-BylWoAy4.js} +18 -7
  23. package/dist/build-BylWoAy4.js.map +1 -0
  24. package/dist/cli/build.d.ts +1 -1
  25. package/dist/cli/build.js +2 -2
  26. package/dist/cli/common.d.ts +1 -1
  27. package/dist/cli/development.js +5 -5
  28. package/dist/cli/information.js +1 -1
  29. package/dist/cli/init.d.ts +1 -1
  30. package/dist/cli/init.js +2 -2
  31. package/dist/cli/production.d.ts +2 -2
  32. package/dist/cli/production.js +4 -4
  33. package/dist/{CommandKit-BBC-yzRf.js → commandkit-DYYj5_OH.js} +2 -2
  34. package/dist/{CommandKit-BBC-yzRf.js.map → commandkit-DYYj5_OH.js.map} +1 -1
  35. package/dist/{CommandKit.d.ts → commandkit.d.ts} +1 -1
  36. package/dist/{CommandKit.js → commandkit.js} +5 -5
  37. package/dist/components/index.js +19 -19
  38. package/dist/components/v1/button/Button.js +2 -2
  39. package/dist/components/v1/button/ButtonKit.js +2 -2
  40. package/dist/components/v1/modal/Modal.js +5 -5
  41. package/dist/components/v1/modal/ModalKit.js +2 -2
  42. package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +2 -2
  43. package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +2 -2
  44. package/dist/components/v1/select-menu/RoleSelectMenuKit.js +2 -2
  45. package/dist/components/v1/select-menu/SelectMenu.js +7 -7
  46. package/dist/components/v1/select-menu/StringSelectMenuKit.js +2 -2
  47. package/dist/components/v1/select-menu/UserSelectMenuKit.js +2 -2
  48. package/dist/config/config.d.ts +2 -2
  49. package/dist/config/config.js +3 -3
  50. package/dist/config/default.d.ts +1 -1
  51. package/dist/config/default.js +2 -2
  52. package/dist/config/loader.d.ts +1 -1
  53. package/dist/config/loader.js +3 -3
  54. package/dist/config/types.d.ts +1 -1
  55. package/dist/config/utils.d.ts +1 -1
  56. package/dist/{config-CuyEJdAz.d.ts → config-GcJ2yAdr.d.ts} +2 -2
  57. package/dist/context/async-context.d.ts +1 -1
  58. package/dist/context/async-context.js +8 -8
  59. package/dist/context/environment.d.ts +1 -1
  60. package/dist/context/environment.js +5 -5
  61. package/dist/events/CommandKitEventsChannel.d.ts +1 -1
  62. package/dist/{feature-flags-5JXbEcqH.js → feature-flags-aCvzjoPi.js} +8 -8
  63. package/dist/{feature-flags-5JXbEcqH.js.map → feature-flags-aCvzjoPi.js.map} +1 -1
  64. package/dist/flags/FlagProvider.d.ts +1 -1
  65. package/dist/flags/feature-flags.d.ts +1 -1
  66. package/dist/flags/feature-flags.js +2 -2
  67. package/dist/flags/store.d.ts +1 -1
  68. package/dist/index.d.ts +4 -4
  69. package/dist/index.js +56 -56
  70. package/dist/index.js.map +1 -1
  71. package/dist/{init-Cc9uNaNk.js → init-5BxpQb8k.js} +4 -4
  72. package/dist/{init-Cc9uNaNk.js.map → init-5BxpQb8k.js.map} +1 -1
  73. package/dist/{init-DsaK1AfD.d.ts → init-Dy6N3ICb.d.ts} +3 -3
  74. package/dist/logger/DefaultLogger.js +2 -2
  75. package/dist/logger/Logger.js +3 -3
  76. package/dist/plugins/CompilerPlugin.d.ts +1 -1
  77. package/dist/plugins/PluginCommon.d.ts +1 -1
  78. package/dist/plugins/RuntimePlugin.d.ts +1 -1
  79. package/dist/plugins/index.d.ts +1 -1
  80. package/dist/plugins/index.js +4 -4
  81. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +1 -1
  82. package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +2 -2
  83. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +1 -1
  84. package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +2 -2
  85. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +1 -1
  86. package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +2 -2
  87. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +1 -1
  88. package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +2 -2
  89. package/dist/plugins/plugin-runtime/runtime.d.ts +1 -1
  90. package/dist/plugins/types.d.ts +1 -1
  91. package/dist/types.d.ts +1 -1
  92. package/dist/utils/dev-hooks.d.ts +1 -1
  93. package/dist/utils/dev-hooks.js +2 -2
  94. package/dist/utils/utilities.js +9 -9
  95. package/dist/{version-B4iuxKPp.js → version-DFwFkmv2.js} +2 -2
  96. package/dist/{version-B4iuxKPp.js.map → version-DFwFkmv2.js.map} +1 -1
  97. package/dist/version.js +1 -1
  98. package/package.json +2 -2
  99. package/dist/build-DXo8U0Mv.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CommandKitEventsChannel-BSdcgY3Q.js","names":[],"sources":["../src/events/CommandKitEventsChannel.ts"],"sourcesContent":["import EventEmitter from 'node:events';\nimport type { CommandKit } from '../CommandKit';\nimport type { AsyncFunction, GenericFunction } from '../context/async-context';\n\n/**\n * The function type for event listeners.\n */\nexport type ListenerFunction = GenericFunction | AsyncFunction;\n\n/**\n * Represents a channel for emitting and listening to events in CommandKit.\n * This class provides methods to manage event listeners and emit events\n * within a specific namespace.\n */\nexport class CommandKitEventsChannel {\n private emitter = new EventEmitter();\n\n /**\n * Creates a new instance of CommandKitEventsChannel.\n * @param commandkit The CommandKit instance that this channel belongs to.\n */\n public constructor(public readonly commandkit: CommandKit) {}\n\n /**\n * Creates a namespaced event channel. This allows you to manage events\n * within a specific namespace, preventing conflicts with other event channels.\n * This is useful for organizing events related to different parts of your application.\n * @param namespace The namespace for the event channel.\n * @returns An object containing methods for managing events within the namespace.\n * @example commandkit.events.to('customNamespace').emit('eventName', data);\n */\n public to(namespace: string) {\n return {\n on: this.on.bind(this, namespace),\n off: this.off.bind(this, namespace),\n once: this.once.bind(this, namespace),\n emit: this.emit.bind(this, namespace),\n removeAllListeners: this.removeAllListeners.bind(this, namespace),\n };\n }\n\n /**\n * Register an event listener for a specific event within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to listen for.\n * @param listener The function to call when the event is emitted.\n */\n public on(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.on(`${namespace}:${event}`, listener);\n }\n\n /**\n * Unregister an event listener for a specific event within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to stop listening for.\n * @param listener The function that was registered as the listener.\n */\n public off(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.off(`${namespace}:${event}`, listener);\n }\n\n /**\n * Register an event listener that will be called only once for a specific event\n * within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to listen for.\n * @param listener The function to call when the event is emitted.\n */\n public once(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.once(`${namespace}:${event}`, listener);\n }\n\n /**\n * Emit an event within the specified namespace, calling all registered listeners.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to emit.\n * @param args The arguments to pass to the listeners.\n * @returns A boolean indicating whether any listeners were called.\n */\n public emit(namespace: string, event: string, ...args: any[]) {\n return this.emitter.emit(`${namespace}:${event}`, ...args);\n }\n\n /**\n * Remove all listeners for a specific event or all events within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to remove listeners for. If not provided, all listeners for all events in the namespace will be removed.\n */\n public removeAllListeners(namespace: string): void;\n public removeAllListeners(namespace: string, event: string): void;\n public removeAllListeners(namespace: string, event?: string): void {\n if (event) {\n this.emitter.removeAllListeners(`${namespace}:${event}`);\n } else {\n this.emitter.removeAllListeners(namespace);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAcA,IAAa,0BAAb,MAAqC;CACnC,AAAQ,UAAU,IAAI;;;;;CAMtB,AAAO,YAA4B,YAAwB;EAAxB;CAAyB;;;;;;;;;CAU5D,AAAO,GAAG,WAAmB;AAC3B,SAAO;GACL,IAAI,KAAK,GAAG,KAAK,MAAM,UAAU;GACjC,KAAK,KAAK,IAAI,KAAK,MAAM,UAAU;GACnC,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU;GACrC,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU;GACrC,oBAAoB,KAAK,mBAAmB,KAAK,MAAM,UAAU;EAClE;CACH;;;;;;;CAQA,AAAO,GAAG,WAAmB,OAAe,UAA4B;AACtE,OAAK,QAAQ,MAAM,UAAU,GAAG,SAAS,SAAS;CACpD;;;;;;;CAQA,AAAO,IAAI,WAAmB,OAAe,UAA4B;AACvE,OAAK,QAAQ,OAAO,UAAU,GAAG,SAAS,SAAS;CACrD;;;;;;;;CASA,AAAO,KAAK,WAAmB,OAAe,UAA4B;AACxE,OAAK,QAAQ,QAAQ,UAAU,GAAG,SAAS,SAAS;CACtD;;;;;;;;CASA,AAAO,KAAK,WAAmB,OAAe,GAAG,MAAa;AAC5D,SAAO,KAAK,QAAQ,QAAQ,UAAU,GAAG,SAAS,GAAG,KAAK;CAC5D;CASA,AAAO,mBAAmB,WAAmB,OAAsB;AACjE,MAAI,MACF,MAAK,QAAQ,sBAAsB,UAAU,GAAG,QAAQ;MAExD,MAAK,QAAQ,mBAAmB,UAAU;CAE9C;AACF"}
1
+ {"version":3,"file":"CommandKitEventsChannel-BSdcgY3Q.js","names":[],"sources":["../src/events/CommandKitEventsChannel.ts"],"sourcesContent":["import EventEmitter from 'node:events';\nimport type { CommandKit } from '../commandkit';\nimport type { AsyncFunction, GenericFunction } from '../context/async-context';\n\n/**\n * The function type for event listeners.\n */\nexport type ListenerFunction = GenericFunction | AsyncFunction;\n\n/**\n * Represents a channel for emitting and listening to events in CommandKit.\n * This class provides methods to manage event listeners and emit events\n * within a specific namespace.\n */\nexport class CommandKitEventsChannel {\n private emitter = new EventEmitter();\n\n /**\n * Creates a new instance of CommandKitEventsChannel.\n * @param commandkit The CommandKit instance that this channel belongs to.\n */\n public constructor(public readonly commandkit: CommandKit) {}\n\n /**\n * Creates a namespaced event channel. This allows you to manage events\n * within a specific namespace, preventing conflicts with other event channels.\n * This is useful for organizing events related to different parts of your application.\n * @param namespace The namespace for the event channel.\n * @returns An object containing methods for managing events within the namespace.\n * @example commandkit.events.to('customNamespace').emit('eventName', data);\n */\n public to(namespace: string) {\n return {\n on: this.on.bind(this, namespace),\n off: this.off.bind(this, namespace),\n once: this.once.bind(this, namespace),\n emit: this.emit.bind(this, namespace),\n removeAllListeners: this.removeAllListeners.bind(this, namespace),\n };\n }\n\n /**\n * Register an event listener for a specific event within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to listen for.\n * @param listener The function to call when the event is emitted.\n */\n public on(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.on(`${namespace}:${event}`, listener);\n }\n\n /**\n * Unregister an event listener for a specific event within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to stop listening for.\n * @param listener The function that was registered as the listener.\n */\n public off(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.off(`${namespace}:${event}`, listener);\n }\n\n /**\n * Register an event listener that will be called only once for a specific event\n * within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to listen for.\n * @param listener The function to call when the event is emitted.\n */\n public once(namespace: string, event: string, listener: ListenerFunction) {\n this.emitter.once(`${namespace}:${event}`, listener);\n }\n\n /**\n * Emit an event within the specified namespace, calling all registered listeners.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to emit.\n * @param args The arguments to pass to the listeners.\n * @returns A boolean indicating whether any listeners were called.\n */\n public emit(namespace: string, event: string, ...args: any[]) {\n return this.emitter.emit(`${namespace}:${event}`, ...args);\n }\n\n /**\n * Remove all listeners for a specific event or all events within the namespace.\n * @param namespace The namespace for the event channel.\n * @param event The name of the event to remove listeners for. If not provided, all listeners for all events in the namespace will be removed.\n */\n public removeAllListeners(namespace: string): void;\n public removeAllListeners(namespace: string, event: string): void;\n public removeAllListeners(namespace: string, event?: string): void {\n if (event) {\n this.emitter.removeAllListeners(`${namespace}:${event}`);\n } else {\n this.emitter.removeAllListeners(namespace);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAcA,IAAa,0BAAb,MAAqC;CACnC,AAAQ,UAAU,IAAI;;;;;CAMtB,AAAO,YAA4B,YAAwB;EAAxB;CAAyB;;;;;;;;;CAU5D,AAAO,GAAG,WAAmB;AAC3B,SAAO;GACL,IAAI,KAAK,GAAG,KAAK,MAAM,UAAU;GACjC,KAAK,KAAK,IAAI,KAAK,MAAM,UAAU;GACnC,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU;GACrC,MAAM,KAAK,KAAK,KAAK,MAAM,UAAU;GACrC,oBAAoB,KAAK,mBAAmB,KAAK,MAAM,UAAU;EAClE;CACH;;;;;;;CAQA,AAAO,GAAG,WAAmB,OAAe,UAA4B;AACtE,OAAK,QAAQ,MAAM,UAAU,GAAG,SAAS,SAAS;CACpD;;;;;;;CAQA,AAAO,IAAI,WAAmB,OAAe,UAA4B;AACvE,OAAK,QAAQ,OAAO,UAAU,GAAG,SAAS,SAAS;CACrD;;;;;;;;CASA,AAAO,KAAK,WAAmB,OAAe,UAA4B;AACxE,OAAK,QAAQ,QAAQ,UAAU,GAAG,SAAS,SAAS;CACtD;;;;;;;;CASA,AAAO,KAAK,WAAmB,OAAe,GAAG,MAAa;AAC5D,SAAO,KAAK,QAAQ,QAAQ,UAAU,GAAG,SAAS,GAAG,KAAK;CAC5D;CASA,AAAO,mBAAmB,WAAmB,OAAsB;AACjE,MAAI,MACF,MAAK,QAAQ,sBAAsB,UAAU,GAAG,QAAQ;MAExD,MAAK,QAAQ,mBAAmB,UAAU;CAE9C;AACF"}
@@ -1,4 +1,4 @@
1
- import { CommandKit } from "./CommandKit-Bt5GNyzq.js";
1
+ import { CommandKit } from "./analytics-engine-CA_TBn6w.js";
2
2
  import { ParsedEvent } from "./EventsRouter-BacqK6z3.js";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
4
 
@@ -40,4 +40,4 @@ declare function getEventWorkerContext(): EventWorkerContext;
40
40
  declare function isEventWorkerContext(worker: any): worker is EventWorkerContext;
41
41
  //#endregion
42
42
  export { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext };
43
- //# sourceMappingURL=EventWorkerContext-BIed73bA.d.ts.map
43
+ //# sourceMappingURL=EventWorkerContext-CGIqPuh6.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventWorkerContext-DxfS_0fJ.js","names":[],"sources":["../src/app/events/EventWorkerContext.ts"],"sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks';\nimport { ParsedEvent } from '../router';\nimport { CommandKit } from '../../CommandKit';\n\n/**\n * Context object containing information about the currently executing event.\n */\nexport interface EventWorkerContext {\n event: string;\n namespace: string | null;\n data: ParsedEvent;\n commandkit: CommandKit;\n arguments: any[];\n variables: Map<string, any>;\n}\n\n/**\n * @private\n * @internal\n */\nconst kEventWorker = Symbol('commandkitEventWorker');\n\n/**\n * Async local storage for event worker context.\n */\nexport const eventWorkerContext = new AsyncLocalStorage<EventWorkerContext>();\n\n/**\n * Runs a callback within an event worker context.\n * @param context - The event worker context\n * @param callback - The callback to execute\n * @returns The result of the callback\n */\nexport function runInEventWorkerContext<T>(\n context: EventWorkerContext,\n callback: () => T,\n): T {\n Reflect.set(context, kEventWorker, true);\n\n return eventWorkerContext.run(context, callback);\n}\n\n/**\n * Gets the current event worker context.\n * @returns The current event worker context\n * @throws Error if no context is found\n */\nexport function getEventWorkerContext(): EventWorkerContext {\n const context = eventWorkerContext.getStore();\n\n if (!context) {\n throw new Error('Event worker context not found');\n }\n\n return context;\n}\n\n/**\n * Type guard to check if an object is an event worker context.\n * @param worker - The object to check\n * @returns True if the object is an event worker context\n */\nexport function isEventWorkerContext(\n worker: any,\n): worker is EventWorkerContext {\n return worker && Reflect.get(worker, kEventWorker) === true;\n}\n"],"mappings":";;;;;;;;AAoBA,MAAM,eAAe,OAAO,wBAAwB;;;;AAKpD,MAAa,qBAAqB,IAAI;;;;;;;AAQtC,SAAgB,wBAChB,SACA,UACI;AACF,SAAQ,IAAI,SAAS,cAAc,KAAK;AAExC,QAAO,mBAAmB,IAAI,SAAS,SAAS;AAClD;;;;;;AAOA,SAAgB,wBAA4C;CAC1D,MAAM,UAAU,mBAAmB,UAAU;AAE7C,MAAK,QACH,OAAM,IAAI,MAAM;AAGlB,QAAO;AACT;;;;;;AAOA,SAAgB,qBAChB,QAC+B;AAC7B,QAAO,UAAU,QAAQ,IAAI,QAAQ,aAAa,KAAK;AACzD"}
1
+ {"version":3,"file":"EventWorkerContext-DxfS_0fJ.js","names":[],"sources":["../src/app/events/EventWorkerContext.ts"],"sourcesContent":["import { AsyncLocalStorage } from 'node:async_hooks';\nimport { ParsedEvent } from '../router';\nimport { CommandKit } from '../../commandkit';\n\n/**\n * Context object containing information about the currently executing event.\n */\nexport interface EventWorkerContext {\n event: string;\n namespace: string | null;\n data: ParsedEvent;\n commandkit: CommandKit;\n arguments: any[];\n variables: Map<string, any>;\n}\n\n/**\n * @private\n * @internal\n */\nconst kEventWorker = Symbol('commandkitEventWorker');\n\n/**\n * Async local storage for event worker context.\n */\nexport const eventWorkerContext = new AsyncLocalStorage<EventWorkerContext>();\n\n/**\n * Runs a callback within an event worker context.\n * @param context - The event worker context\n * @param callback - The callback to execute\n * @returns The result of the callback\n */\nexport function runInEventWorkerContext<T>(\n context: EventWorkerContext,\n callback: () => T,\n): T {\n Reflect.set(context, kEventWorker, true);\n\n return eventWorkerContext.run(context, callback);\n}\n\n/**\n * Gets the current event worker context.\n * @returns The current event worker context\n * @throws Error if no context is found\n */\nexport function getEventWorkerContext(): EventWorkerContext {\n const context = eventWorkerContext.getStore();\n\n if (!context) {\n throw new Error('Event worker context not found');\n }\n\n return context;\n}\n\n/**\n * Type guard to check if an object is an event worker context.\n * @param worker - The object to check\n * @returns True if the object is an event worker context\n */\nexport function isEventWorkerContext(\n worker: any,\n): worker is EventWorkerContext {\n return worker && Reflect.get(worker, kEventWorker) === true;\n}\n"],"mappings":";;;;;;;;AAoBA,MAAM,eAAe,OAAO,wBAAwB;;;;AAKpD,MAAa,qBAAqB,IAAI;;;;;;;AAQtC,SAAgB,wBAChB,SACA,UACI;AACF,SAAQ,IAAI,SAAS,cAAc,KAAK;AAExC,QAAO,mBAAmB,IAAI,SAAS,SAAS;AAClD;;;;;;AAOA,SAAgB,wBAA4C;CAC1D,MAAM,UAAU,mBAAmB,UAAU;AAE7C,MAAK,QACH,OAAM,IAAI,MAAM;AAGlB,QAAO;AACT;;;;;;AAOA,SAAgB,qBAChB,QAC+B;AAC7B,QAAO,UAAU,QAAQ,IAAI,QAAQ,aAAa,KAAK;AACzD"}
@@ -1,4 +1,4 @@
1
- import { AnalyticsEngine, FilterFunction } from "../CommandKit-Bt5GNyzq.js";
1
+ import { AnalyticsEngine, FilterFunction } from "../analytics-engine-CA_TBn6w.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -1,7 +1,7 @@
1
1
  require('../colors-Cd4Oz-r-.js');
2
2
  require('../ActionRow-CmTHbo2t.js');
3
3
  require('../error-codes-C-ViHyu-.js');
4
- const require_CommandKit = require('../CommandKit-BBC-yzRf.js');
4
+ const require_commandkit = require('../commandkit-DYYj5_OH.js');
5
5
  require('../common-CcfjYnPG.js');
6
6
  require('../common-vnMIelAE.js');
7
7
  require('../container-DCjIgp-B.js');
@@ -33,4 +33,4 @@ require('../common-DoZjgUs0.js');
33
33
  require('../CommandKitEventsChannel-BSdcgY3Q.js');
34
34
  require('../store-CyzliDXj.js');
35
35
 
36
- exports.AnalyticsEngine = require_CommandKit.AnalyticsEngine;
36
+ exports.AnalyticsEngine = require_commandkit.AnalyticsEngine;
@@ -1,4 +1,4 @@
1
- import { AnalyticsEvent, AnalyticsProvider, IdentifyEvent } from "../CommandKit-Bt5GNyzq.js";
1
+ import { AnalyticsEvent, AnalyticsProvider, IdentifyEvent } from "../analytics-engine-CA_TBn6w.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
@@ -1,7 +1,7 @@
1
1
  require('../colors-Cd4Oz-r-.js');
2
2
  require('../ActionRow-CmTHbo2t.js');
3
3
  require('../error-codes-C-ViHyu-.js');
4
- const require_CommandKit = require('../CommandKit-BBC-yzRf.js');
4
+ const require_commandkit = require('../commandkit-DYYj5_OH.js');
5
5
  require('../common-CcfjYnPG.js');
6
6
  require('../common-vnMIelAE.js');
7
7
  require('../container-DCjIgp-B.js');
@@ -33,5 +33,5 @@ require('../common-DoZjgUs0.js');
33
33
  require('../CommandKitEventsChannel-BSdcgY3Q.js');
34
34
  require('../store-CyzliDXj.js');
35
35
 
36
- exports.getDoNotTrack = require_CommandKit.getDoNotTrack;
37
- exports.noAnalytics = require_CommandKit.noAnalytics;
36
+ exports.getDoNotTrack = require_commandkit.getDoNotTrack;
37
+ exports.noAnalytics = require_commandkit.noAnalytics;
@@ -1757,101 +1757,6 @@ declare function flag<Returns = boolean, Entity = Record<any, any>>(options: Fea
1757
1757
  */
1758
1758
  declare class FlagStore extends Collection<string, FeatureFlag<any, any>> {}
1759
1759
  //#endregion
1760
- //#region src/analytics/analytics-provider.d.ts
1761
- /**
1762
- * AnalyticsEvent interface represents an event that can be tracked by an analytics provider.
1763
- * It includes the event name, an optional unique identifier, and a data object containing event-specific information.
1764
- */
1765
- interface AnalyticsEvent {
1766
- name: string;
1767
- id?: string;
1768
- data: Record<string, any>;
1769
- }
1770
- /**
1771
- * IdentifyEvent interface represents an event used to identify a user or entity in the analytics system.
1772
- */
1773
- type IdentifyEvent = Record<string, any>;
1774
- /**
1775
- * AnalyticsProvider interface defines the contract for analytics providers.
1776
- */
1777
- interface AnalyticsProvider {
1778
- /**
1779
- * The name of the analytics provider.
1780
- * This is used for logging and identification purposes.
1781
- */
1782
- readonly name: string;
1783
- /**
1784
- * Initializes the analytics provider.
1785
- * This method is called when the provider is registered.
1786
- */
1787
- track(engine: AnalyticsEngine, event: AnalyticsEvent): Promise<void>;
1788
- /**
1789
- * Identifies a user or entity with the analytics provider.
1790
- * This method is called to associate user data with events.
1791
- */
1792
- identify?(engine: AnalyticsEngine, event: IdentifyEvent): Promise<void>;
1793
- }
1794
- //#endregion
1795
- //#region src/analytics/analytics-engine.d.ts
1796
- /**
1797
- * Filter function type for analytics events.
1798
- * @param engine The analytics engine instance.
1799
- * @param event The analytics event to filter.
1800
- * @returns A boolean indicating whether the event should be tracked.
1801
- */
1802
- type FilterFunction = (engine: AnalyticsEngine, event: AnalyticsEvent) => boolean;
1803
- /**
1804
- * AnalyticsEngine class for managing analytics providers and tracking events.
1805
- * This class allows you to register a provider, set a filter for events, and track or identify events.
1806
- */
1807
- declare class AnalyticsEngine {
1808
- #private;
1809
- readonly commandkit: CommandKit;
1810
- /**
1811
- * Creates an instance of the AnalyticsEngine.
1812
- * @param commandkit The CommandKit instance.
1813
- */
1814
- constructor(commandkit: CommandKit);
1815
- /**
1816
- * Sets a filter function for analytics events.
1817
- * This function will be called before tracking an event to determine if it should be tracked.
1818
- * If the filter returns `false`, the event will not be tracked.
1819
- * If the filter is set to `null`, all events will be tracked unless `doNotTrack` is enabled.
1820
- * @param filter The filter function to set, or `null` to remove the filter.
1821
- */
1822
- setFilter(filter: FilterFunction | null): void;
1823
- /**
1824
- * Registers an analytics provider.
1825
- * This provider will be used to track and identify events.
1826
- * If a provider is already registered, it will be replaced with the new one.
1827
- * @param provider The analytics provider to register.
1828
- */
1829
- registerProvider(provider: AnalyticsProvider): void;
1830
- /**
1831
- * Removes the currently registered analytics provider.
1832
- * @param provider The analytics provider to remove.
1833
- */
1834
- removeProvider(provider: AnalyticsProvider): void;
1835
- /**
1836
- * Retrieves the currently registered analytics provider.
1837
- * @returns The currently registered analytics provider, or `null` if no provider is registered.
1838
- */
1839
- getProvider(): AnalyticsProvider | null;
1840
- /**
1841
- * Identifies a user with the analytics provider.
1842
- * This method sends an identify event to the provider, which can be used to associate user data with events.
1843
- * @param event The identify event containing user data to send to the provider.
1844
- */
1845
- identify(event: IdentifyEvent): Promise<void>;
1846
- /**
1847
- * Tracks an analytics event with the registered provider.
1848
- * This method sends the event to the provider, which can then process it as needed.
1849
- * If the `doNotTrack` setting is enabled or if the filter function returns `false`, the event will not be tracked.
1850
- * @param event The analytics event to track.
1851
- */
1852
- track(event: AnalyticsEvent): Promise<void>;
1853
- }
1854
- //#endregion
1855
1760
  //#region src/config/types.d.ts
1856
1761
  interface CommandKitConfig {
1857
1762
  /**
@@ -1945,7 +1850,7 @@ type DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]> };
1945
1850
  declare const mergeDeep: <T extends Record<string, any>>(target: T, source: T) => T;
1946
1851
  type ResolvedCommandKitConfig = DeepRequired<CommandKitConfig>;
1947
1852
  //#endregion
1948
- //#region src/CommandKit.d.ts
1853
+ //#region src/commandkit.d.ts
1949
1854
  /**
1950
1855
  * Configurations for the CommandKit instance.
1951
1856
  */
@@ -2136,5 +2041,100 @@ declare class CommandKit extends EventEmitter {
2136
2041
  */
2137
2042
  declare const commandkit: CommandKit;
2138
2043
  //#endregion
2044
+ //#region src/analytics/analytics-provider.d.ts
2045
+ /**
2046
+ * AnalyticsEvent interface represents an event that can be tracked by an analytics provider.
2047
+ * It includes the event name, an optional unique identifier, and a data object containing event-specific information.
2048
+ */
2049
+ interface AnalyticsEvent {
2050
+ name: string;
2051
+ id?: string;
2052
+ data: Record<string, any>;
2053
+ }
2054
+ /**
2055
+ * IdentifyEvent interface represents an event used to identify a user or entity in the analytics system.
2056
+ */
2057
+ type IdentifyEvent = Record<string, any>;
2058
+ /**
2059
+ * AnalyticsProvider interface defines the contract for analytics providers.
2060
+ */
2061
+ interface AnalyticsProvider {
2062
+ /**
2063
+ * The name of the analytics provider.
2064
+ * This is used for logging and identification purposes.
2065
+ */
2066
+ readonly name: string;
2067
+ /**
2068
+ * Initializes the analytics provider.
2069
+ * This method is called when the provider is registered.
2070
+ */
2071
+ track(engine: AnalyticsEngine, event: AnalyticsEvent): Promise<void>;
2072
+ /**
2073
+ * Identifies a user or entity with the analytics provider.
2074
+ * This method is called to associate user data with events.
2075
+ */
2076
+ identify?(engine: AnalyticsEngine, event: IdentifyEvent): Promise<void>;
2077
+ }
2078
+ //#endregion
2079
+ //#region src/analytics/analytics-engine.d.ts
2080
+ /**
2081
+ * Filter function type for analytics events.
2082
+ * @param engine The analytics engine instance.
2083
+ * @param event The analytics event to filter.
2084
+ * @returns A boolean indicating whether the event should be tracked.
2085
+ */
2086
+ type FilterFunction = (engine: AnalyticsEngine, event: AnalyticsEvent) => boolean;
2087
+ /**
2088
+ * AnalyticsEngine class for managing analytics providers and tracking events.
2089
+ * This class allows you to register a provider, set a filter for events, and track or identify events.
2090
+ */
2091
+ declare class AnalyticsEngine {
2092
+ #private;
2093
+ readonly commandkit: CommandKit;
2094
+ /**
2095
+ * Creates an instance of the AnalyticsEngine.
2096
+ * @param commandkit The CommandKit instance.
2097
+ */
2098
+ constructor(commandkit: CommandKit);
2099
+ /**
2100
+ * Sets a filter function for analytics events.
2101
+ * This function will be called before tracking an event to determine if it should be tracked.
2102
+ * If the filter returns `false`, the event will not be tracked.
2103
+ * If the filter is set to `null`, all events will be tracked unless `doNotTrack` is enabled.
2104
+ * @param filter The filter function to set, or `null` to remove the filter.
2105
+ */
2106
+ setFilter(filter: FilterFunction | null): void;
2107
+ /**
2108
+ * Registers an analytics provider.
2109
+ * This provider will be used to track and identify events.
2110
+ * If a provider is already registered, it will be replaced with the new one.
2111
+ * @param provider The analytics provider to register.
2112
+ */
2113
+ registerProvider(provider: AnalyticsProvider): void;
2114
+ /**
2115
+ * Removes the currently registered analytics provider.
2116
+ * @param provider The analytics provider to remove.
2117
+ */
2118
+ removeProvider(provider: AnalyticsProvider): void;
2119
+ /**
2120
+ * Retrieves the currently registered analytics provider.
2121
+ * @returns The currently registered analytics provider, or `null` if no provider is registered.
2122
+ */
2123
+ getProvider(): AnalyticsProvider | null;
2124
+ /**
2125
+ * Identifies a user with the analytics provider.
2126
+ * This method sends an identify event to the provider, which can be used to associate user data with events.
2127
+ * @param event The identify event containing user data to send to the provider.
2128
+ */
2129
+ identify(event: IdentifyEvent): Promise<void>;
2130
+ /**
2131
+ * Tracks an analytics event with the registered provider.
2132
+ * This method sends the event to the provider, which can then process it as needed.
2133
+ * If the `doNotTrack` setting is enabled or if the filter function returns `false`, the event will not be tracked.
2134
+ * @param event The analytics event to track.
2135
+ */
2136
+ track(event: AnalyticsEvent): Promise<void>;
2137
+ }
2138
+ //#endregion
2139
2139
  export { AnalyticsEngine, AnalyticsEvent, AnalyticsProvider, AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AppCommandRunner, AppEventsHandler, AppEventsHandlerLoadedData, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitConfig, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitEventsChannel, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, DeepPartial, DeepRequired, EvaluationContext, EventFlagContext, EventListener, FeatureFlag, FeatureFlagDefinition, FilterFunction, FlagConfiguration, FlagProvider, FlagRunner, FlagStore, GenericFunction, IdentifyEvent, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, IpcMessageCommand, JsonFlagProvider, ListenerFunction, LoadedCommand, LoadedEvent, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginCommon, PluginOptions, PluginTransformParameters, PluginType, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, ResolvedCommandKitConfig, RunCommand, RunCommandOptions, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isPlugin, isRuntimePlugin, makeContextAwareFunction, mergeDeep, onApplicationBootstrap, onBootstrap, provideContext, registerDevHooks, setFlagProvider, useEnvironment };
2140
- //# sourceMappingURL=CommandKit-Bt5GNyzq.d.ts.map
2140
+ //# sourceMappingURL=analytics-engine-CA_TBn6w.d.ts.map
@@ -1,4 +1,4 @@
1
- import { AppCommandRunner, RunCommandOptions } from "../../CommandKit-Bt5GNyzq.js";
1
+ import { AppCommandRunner, RunCommandOptions } from "../../analytics-engine-CA_TBn6w.js";
2
2
  import "../../EventInterceptor-x-R2qshQ.js";
3
3
  import "../../ButtonKit-C7r7RPNf.js";
4
4
  import "../../ModalKit-Btz58KYn.js";
@@ -1,7 +1,7 @@
1
1
  require('../../colors-Cd4Oz-r-.js');
2
2
  require('../../ActionRow-CmTHbo2t.js');
3
3
  require('../../error-codes-C-ViHyu-.js');
4
- const require_CommandKit = require('../../CommandKit-BBC-yzRf.js');
4
+ const require_commandkit = require('../../commandkit-DYYj5_OH.js');
5
5
  require('../../common-CcfjYnPG.js');
6
6
  require('../../common-vnMIelAE.js');
7
7
  require('../../container-DCjIgp-B.js');
@@ -33,4 +33,4 @@ require('../../common-DoZjgUs0.js');
33
33
  require('../../CommandKitEventsChannel-BSdcgY3Q.js');
34
34
  require('../../store-CyzliDXj.js');
35
35
 
36
- exports.AppCommandRunner = require_CommandKit.AppCommandRunner;
36
+ exports.AppCommandRunner = require_commandkit.AppCommandRunner;
@@ -1,4 +1,4 @@
1
- import { AnyCommandExecute, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandContextOptions, CommandExecutionMode, Context, ContextParameters, InteractionCommandContext, InteractionCommandMiddlewareContext, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../../CommandKit-Bt5GNyzq.js";
1
+ import { AnyCommandExecute, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandContextOptions, CommandExecutionMode, Context, ContextParameters, InteractionCommandContext, InteractionCommandMiddlewareContext, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../../analytics-engine-CA_TBn6w.js";
2
2
  import "../../EventInterceptor-x-R2qshQ.js";
3
3
  import "../../ButtonKit-C7r7RPNf.js";
4
4
  import "../../ModalKit-Btz58KYn.js";
@@ -1,7 +1,7 @@
1
1
  require('../../colors-Cd4Oz-r-.js');
2
2
  require('../../ActionRow-CmTHbo2t.js');
3
3
  require('../../error-codes-C-ViHyu-.js');
4
- const require_CommandKit = require('../../CommandKit-BBC-yzRf.js');
4
+ const require_commandkit = require('../../commandkit-DYYj5_OH.js');
5
5
  require('../../common-CcfjYnPG.js');
6
6
  require('../../common-vnMIelAE.js');
7
7
  require('../../container-DCjIgp-B.js');
@@ -33,6 +33,6 @@ require('../../common-DoZjgUs0.js');
33
33
  require('../../CommandKitEventsChannel-BSdcgY3Q.js');
34
34
  require('../../store-CyzliDXj.js');
35
35
 
36
- exports.CommandExecutionMode = require_CommandKit.CommandExecutionMode;
37
- exports.Context = require_CommandKit.Context;
38
- exports.MiddlewareContext = require_CommandKit.MiddlewareContext;
36
+ exports.CommandExecutionMode = require_commandkit.CommandExecutionMode;
37
+ exports.Context = require_commandkit.Context;
38
+ exports.MiddlewareContext = require_commandkit.MiddlewareContext;
@@ -1,4 +1,4 @@
1
- import "../../CommandKit-Bt5GNyzq.js";
1
+ import "../../analytics-engine-CA_TBn6w.js";
2
2
  import "../../EventInterceptor-x-R2qshQ.js";
3
3
  import "../../ButtonKit-C7r7RPNf.js";
4
4
  import "../../ModalKit-Btz58KYn.js";
@@ -29,5 +29,5 @@ import "../../CommandsRouter-CoOA7hkf.js";
29
29
  import "../../EventsRouter-BacqK6z3.js";
30
30
  import "../../index-CUPkUUOR.js";
31
31
  import "../../constants-MKu-Q1jh.js";
32
- import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "../../EventWorkerContext-BIed73bA.js";
32
+ import { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext } from "../../EventWorkerContext-CGIqPuh6.js";
33
33
  export { EventWorkerContext, eventWorkerContext, getEventWorkerContext, isEventWorkerContext, runInEventWorkerContext };
@@ -1,4 +1,4 @@
1
- import { AppCommand, AppCommandHandler, AppCommandNative, CommandBuilderLike, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandTypeData, CustomAppCommandProps, LoadedCommand, PreparedAppCommandExecution, ResolvableCommand, RunCommand } from "../../CommandKit-Bt5GNyzq.js";
1
+ import { AppCommand, AppCommandHandler, AppCommandNative, CommandBuilderLike, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandTypeData, CustomAppCommandProps, LoadedCommand, PreparedAppCommandExecution, ResolvableCommand, RunCommand } from "../../analytics-engine-CA_TBn6w.js";
2
2
  import "../../EventInterceptor-x-R2qshQ.js";
3
3
  import "../../ButtonKit-C7r7RPNf.js";
4
4
  import "../../ModalKit-Btz58KYn.js";
@@ -1,7 +1,7 @@
1
1
  require('../../colors-Cd4Oz-r-.js');
2
2
  require('../../ActionRow-CmTHbo2t.js');
3
3
  require('../../error-codes-C-ViHyu-.js');
4
- const require_CommandKit = require('../../CommandKit-BBC-yzRf.js');
4
+ const require_commandkit = require('../../commandkit-DYYj5_OH.js');
5
5
  require('../../common-CcfjYnPG.js');
6
6
  require('../../common-vnMIelAE.js');
7
7
  require('../../container-DCjIgp-B.js');
@@ -33,4 +33,4 @@ require('../../common-DoZjgUs0.js');
33
33
  require('../../CommandKitEventsChannel-BSdcgY3Q.js');
34
34
  require('../../store-CyzliDXj.js');
35
35
 
36
- exports.AppCommandHandler = require_CommandKit.AppCommandHandler;
36
+ exports.AppCommandHandler = require_commandkit.AppCommandHandler;
@@ -1,4 +1,4 @@
1
- import { AppEventsHandler, AppEventsHandlerLoadedData, EventListener, LoadedEvent } from "../../CommandKit-Bt5GNyzq.js";
1
+ import { AppEventsHandler, AppEventsHandlerLoadedData, EventListener, LoadedEvent } from "../../analytics-engine-CA_TBn6w.js";
2
2
  import "../../EventInterceptor-x-R2qshQ.js";
3
3
  import "../../ButtonKit-C7r7RPNf.js";
4
4
  import "../../ModalKit-Btz58KYn.js";
@@ -1,7 +1,7 @@
1
1
  require('../../colors-Cd4Oz-r-.js');
2
2
  require('../../ActionRow-CmTHbo2t.js');
3
3
  require('../../error-codes-C-ViHyu-.js');
4
- const require_CommandKit = require('../../CommandKit-BBC-yzRf.js');
4
+ const require_commandkit = require('../../commandkit-DYYj5_OH.js');
5
5
  require('../../common-CcfjYnPG.js');
6
6
  require('../../common-vnMIelAE.js');
7
7
  require('../../container-DCjIgp-B.js');
@@ -33,4 +33,4 @@ require('../../common-DoZjgUs0.js');
33
33
  require('../../CommandKitEventsChannel-BSdcgY3Q.js');
34
34
  require('../../store-CyzliDXj.js');
35
35
 
36
- exports.AppEventsHandler = require_CommandKit.AppEventsHandler;
36
+ exports.AppEventsHandler = require_commandkit.AppEventsHandler;
@@ -1,4 +1,4 @@
1
- import { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContextOptions, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandRegistrar, CommandTypeData, Context, ContextParameters, CustomAppCommandProps, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../CommandKit-Bt5GNyzq.js";
1
+ import { AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContextOptions, CommandDataSchema, CommandDataSchemaKey, CommandDataSchemaValue, CommandExecutionMode, CommandRegistrar, CommandTypeData, Context, ContextParameters, CustomAppCommandProps, InteractionCommandContext, InteractionCommandMiddlewareContext, LoadedCommand, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, SlashCommandMiddlewareContext, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext } from "../analytics-engine-CA_TBn6w.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
package/dist/app/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  require('../colors-Cd4Oz-r-.js');
2
2
  require('../ActionRow-CmTHbo2t.js');
3
3
  require('../error-codes-C-ViHyu-.js');
4
- const require_CommandKit = require('../CommandKit-BBC-yzRf.js');
4
+ const require_commandkit = require('../commandkit-DYYj5_OH.js');
5
5
  require('../common-CcfjYnPG.js');
6
6
  require('../common-vnMIelAE.js');
7
7
  require('../container-DCjIgp-B.js');
@@ -35,13 +35,13 @@ require('../store-CyzliDXj.js');
35
35
  const require_helpers = require('../helpers-DfV6HlgI.js');
36
36
  require('../app-gCenKq8k.js');
37
37
 
38
- exports.AppCommandHandler = require_CommandKit.AppCommandHandler;
39
- exports.CommandExecutionMode = require_CommandKit.CommandExecutionMode;
40
- exports.CommandRegistrar = require_CommandKit.CommandRegistrar;
41
- exports.Context = require_CommandKit.Context;
38
+ exports.AppCommandHandler = require_commandkit.AppCommandHandler;
39
+ exports.CommandExecutionMode = require_commandkit.CommandExecutionMode;
40
+ exports.CommandRegistrar = require_commandkit.CommandRegistrar;
41
+ exports.Context = require_commandkit.Context;
42
42
  exports.MessageCommandOptions = require_MessageCommandParser.MessageCommandOptions;
43
43
  exports.MessageCommandParser = require_MessageCommandParser.MessageCommandParser;
44
- exports.MiddlewareContext = require_CommandKit.MiddlewareContext;
44
+ exports.MiddlewareContext = require_commandkit.MiddlewareContext;
45
45
  exports.exitMiddleware = require_signals.exitMiddleware;
46
46
  exports.isInteractionSource = require_helpers.isInteractionSource;
47
47
  exports.isMessageSource = require_helpers.isMessageSource;
@@ -1,4 +1,4 @@
1
- import { CommandRegistrar, PreRegisterCommandsEvent } from "../../CommandKit-Bt5GNyzq.js";
1
+ import { CommandRegistrar, PreRegisterCommandsEvent } from "../../analytics-engine-CA_TBn6w.js";
2
2
  import "../../EventInterceptor-x-R2qshQ.js";
3
3
  import "../../ButtonKit-C7r7RPNf.js";
4
4
  import "../../ModalKit-Btz58KYn.js";
@@ -1,7 +1,7 @@
1
1
  require('../../colors-Cd4Oz-r-.js');
2
2
  require('../../ActionRow-CmTHbo2t.js');
3
3
  require('../../error-codes-C-ViHyu-.js');
4
- const require_CommandKit = require('../../CommandKit-BBC-yzRf.js');
4
+ const require_commandkit = require('../../commandkit-DYYj5_OH.js');
5
5
  require('../../common-CcfjYnPG.js');
6
6
  require('../../common-vnMIelAE.js');
7
7
  require('../../container-DCjIgp-B.js');
@@ -33,4 +33,4 @@ require('../../common-DoZjgUs0.js');
33
33
  require('../../CommandKitEventsChannel-BSdcgY3Q.js');
34
34
  require('../../store-CyzliDXj.js');
35
35
 
36
- exports.CommandRegistrar = require_CommandKit.CommandRegistrar;
36
+ exports.CommandRegistrar = require_commandkit.CommandRegistrar;
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-nOFOJqeH.js');
2
- const require_CommandKit = require('./CommandKit-BBC-yzRf.js');
2
+ const require_commandkit = require('./commandkit-DYYj5_OH.js');
3
3
  const require_constants = require('./constants-B5_Ta7PR.js');
4
4
  const require_common = require('./common-DoZjgUs0.js');
5
5
  const require_env = require('./env-DakvrBzy.js');
@@ -14,11 +14,22 @@ const tsdown = require_chunk.__toESM(require("tsdown"));
14
14
  * @private
15
15
  * @internal
16
16
  */
17
- function mergeDefinitionsIfNeeded(env) {
17
+ function mergeDefinitionsIfNeeded(env, isDev) {
18
18
  const values = Object.fromEntries(Object.entries(process.env).filter(([k]) => !(k in env) && k.startsWith("COMMANDKIT_PUBLIC_")));
19
19
  return {
20
20
  ...env,
21
- ...values
21
+ ...values,
22
+ ...isDev ? {
23
+ NODE_ENV: "development",
24
+ COMMANDKIT_BOOTSTRAP_MODE: "development",
25
+ COMMANDKIT_IS_DEV: "true",
26
+ COMMANDKIT_IS_TEST: "false"
27
+ } : {
28
+ NODE_ENV: "production",
29
+ COMMANDKIT_BOOTSTRAP_MODE: "production",
30
+ COMMANDKIT_IS_DEV: "false",
31
+ COMMANDKIT_IS_TEST: "false"
32
+ }
22
33
  };
23
34
  }
24
35
  /**
@@ -27,9 +38,9 @@ function mergeDefinitionsIfNeeded(env) {
27
38
  */
28
39
  async function buildApplication({ plugins, rolldownPlugins, isDev, configPath }) {
29
40
  var _config$typescript;
30
- const config = await require_CommandKit.loadConfigFile(configPath);
41
+ const config = await require_commandkit.loadConfigFile(configPath);
31
42
  if (!isDev && !(config === null || config === void 0 || (_config$typescript = config.typescript) === null || _config$typescript === void 0 ? void 0 : _config$typescript.ignoreBuildErrors)) await require_type_checker.performTypeCheck(configPath || require_constants.COMMANDKIT_CWD);
32
- const pluginRuntime = new require_CommandKit.CompilerPluginRuntime(plugins || []);
43
+ const pluginRuntime = new require_commandkit.CompilerPluginRuntime(plugins || []);
33
44
  rolldownPlugins ??= [];
34
45
  rolldownPlugins.push(pluginRuntime.toJSON());
35
46
  try {
@@ -70,7 +81,7 @@ async function buildApplication({ plugins, rolldownPlugins, isDev, configPath })
70
81
  sourcemap: true,
71
82
  target: "node16",
72
83
  outDir: dest,
73
- env: mergeDefinitionsIfNeeded(config.env || {}),
84
+ env: mergeDefinitionsIfNeeded(config.env || {}, !!isDev),
74
85
  entry: [
75
86
  "src",
76
87
  `!${config.distDir}`,
@@ -150,4 +161,4 @@ Object.defineProperty(exports, 'buildApplication', {
150
161
  return buildApplication;
151
162
  }
152
163
  });
153
- //# sourceMappingURL=build-DXo8U0Mv.js.map
164
+ //# sourceMappingURL=build-BylWoAy4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-BylWoAy4.js","names":[],"sources":["../src/cli/build.ts"],"sourcesContent":["import { build } from 'tsdown';\nimport { CompilerPlugin, CompilerPluginRuntime } from '../plugins';\nimport { loadConfigFile } from '../config/loader';\nimport { writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { DevEnv, devEnvFileArgs, ProdEnv, prodEnvFileArgs } from './env';\nimport { rimraf } from 'rimraf';\nimport { performTypeCheck } from './type-checker';\nimport { copyLocaleFiles } from './common';\nimport { MaybeArray } from '../components';\nimport { COMMANDKIT_CWD } from '../utils/constants';\n\n/**\n * @private\n * @internal\n */\nexport interface ApplicationBuildOptions {\n plugins?: MaybeArray<CompilerPlugin>[] | Array<CompilerPlugin>;\n rolldownPlugins?: any[];\n isDev?: boolean;\n configPath?: string;\n}\n\n// emit public env variables and given env variables\n/**\n * @private\n * @internal\n */\nfunction mergeDefinitionsIfNeeded(env: Record<string, string>, isDev: boolean) {\n const values = Object.fromEntries(\n Object.entries(process.env).filter(\n ([k]) => !(k in env) && k.startsWith('COMMANDKIT_PUBLIC_'),\n ),\n );\n\n return {\n ...env,\n ...values,\n ...(isDev\n ? {\n NODE_ENV: 'development',\n COMMANDKIT_BOOTSTRAP_MODE: 'development',\n COMMANDKIT_IS_DEV: 'true',\n COMMANDKIT_IS_TEST: 'false',\n }\n : {\n NODE_ENV: 'production',\n COMMANDKIT_BOOTSTRAP_MODE: 'production',\n COMMANDKIT_IS_DEV: 'false',\n COMMANDKIT_IS_TEST: 'false',\n }),\n };\n}\n\n/**\n * @private\n * @internal\n */\nexport async function buildApplication({\n plugins,\n rolldownPlugins,\n isDev,\n configPath,\n}: ApplicationBuildOptions) {\n const config = await loadConfigFile(configPath);\n\n if (!isDev && !config?.typescript?.ignoreBuildErrors) {\n await performTypeCheck(configPath || COMMANDKIT_CWD);\n }\n\n const pluginRuntime = new CompilerPluginRuntime(\n (plugins || []) as CompilerPlugin[],\n );\n\n rolldownPlugins ??= [];\n\n rolldownPlugins.push(pluginRuntime.toJSON());\n\n try {\n const dest = isDev ? '.commandkit' : config.distDir;\n\n // Clean the destination directory\n await rimraf(dest);\n\n await pluginRuntime.init();\n\n await build({\n watch: false,\n dts: false,\n clean: true,\n format: ['esm'],\n shims: true,\n minify: false,\n silent: !!isDev,\n inputOptions: {\n transform: {\n jsx: {\n runtime: 'automatic',\n importSource: 'commandkit',\n },\n },\n checks: {\n circularDependency: true,\n },\n onwarn: (warning, defaultWarn) => {\n if (warning?.message?.includes('compilerOptions.jsx')) return;\n\n return defaultWarn(warning);\n },\n onLog: (level, log, defaultLog) => {\n if (isDev) return;\n\n return defaultLog(level, log);\n },\n moduleTypes: {\n '.json': 'js',\n '.node': 'binary',\n },\n },\n plugins: rolldownPlugins,\n platform: 'node',\n skipNodeModulesBundle: true,\n sourcemap: true,\n target: 'node16',\n outDir: dest,\n env: mergeDefinitionsIfNeeded(config.env || {}, !!isDev),\n entry: [\n 'src',\n `!${config.distDir}`,\n '!.commandkit',\n '!**/*.test.*',\n '!**/*.spec.*',\n ],\n unbundle: !!isDev,\n });\n\n await copyLocaleFiles('src', dest);\n await injectEntryFile(\n configPath || COMMANDKIT_CWD,\n !!isDev,\n config.distDir,\n );\n } catch (error) {\n console.error('Build failed:', error);\n if (error instanceof Error) {\n console.error('Error details:', error.stack);\n }\n process.exit(1); // Force exit on error\n } finally {\n // Ensure plugins are cleaned up\n await pluginRuntime.destroy();\n }\n}\n\nconst envScript = (dev: boolean) => `// --- Environment Variables Loader ---\nconst $env = [${(dev ? devEnvFileArgs : prodEnvFileArgs).map((p) => `\"${p}\"`).join(', ')}];\nfor (const file of $env) {\n try {\n process.loadEnvFile(file);\n console.log('\\\\x1b[36m✔ Loaded \\\\x1b[0m\\\\x1b[33m%s\\\\x1b[0m', file);\n } catch {}\n}\n`;\n\nconst antiCrashScript = [\n '// --- CommandKit Anti-Crash Monitor ---',\n \" // 'uncaughtException' event is supposed to be used to perform synchronous cleanup before shutting down the process\",\n ' // instead of using it as a means to resume operation.',\n ' // But it exists here due to compatibility reasons with discord bot ecosystem.',\n \" const p = (t) => `\\\\x1b[31m${t}\\\\x1b[0m`, b = '[CommandKit Anti-Crash Monitor]', l = console.log, e1 = 'uncaughtException', e2 = 'unhandledRejection';\",\n ' if (!process.eventNames().includes(e1)) // skip if it is already handled',\n ' process.on(e1, (e) => {',\n ' l(p(`${b} Uncaught Exception`)); l(p(b), p(e.stack || e));',\n ' })',\n ' if (!process.eventNames().includes(e2)) // skip if it is already handled',\n ' process.on(e2, (r) => {',\n ' l(p(`${b} Unhandled promise rejection`)); l(p(`${b} ${r.stack || r}`));',\n ' });',\n '// --- CommandKit Anti-Crash Monitor ---',\n].join('\\n');\n\nconst wrapInAsyncIIFE = (code: string[]) =>\n `;await (async () => {\\n${code.join('\\n\\n')}\\n})();`;\n\nasync function injectEntryFile(\n configPath: string,\n isDev: boolean,\n distDir?: string,\n) {\n const code = `/* Entrypoint File Generated By CommandKit */\n${isDev ? `\\n\\n// Injected for development\\n${wrapInAsyncIIFE([envScript(isDev), antiCrashScript])}\\n\\n` : wrapInAsyncIIFE([envScript(isDev)])}\n\nimport { commandkit } from 'commandkit';\nimport { Client } from 'discord.js';\n\nasync function bootstrap() {\n const app = await import('./app.js').then((m) => m.default ?? m);\n\n if (!app || !(app instanceof Client)) {\n throw new Error('The app file must default export the discord.js client instance');\n }\n\n commandkit.setClient(app);\n\n await commandkit.start();\n}\n\nawait bootstrap().catch((e) => {\n console.error('Failed to bootstrap CommandKit application:\\\\n', e.stack);\n})\n`;\n\n const dist = isDev ? '.commandkit' : distDir || 'dist';\n\n await writeFile(join(configPath, dist, 'index.js'), code);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA4BA,SAAS,yBAAyB,KAA6B,OAAgB;CAC7E,MAAM,SAAS,OAAO,YACpB,OAAO,QAAQ,QAAQ,IAAI,CAAC,OAC1B,CAAC,CAAC,EAAE,OAAO,KAAK,QAAQ,EAAE,WAAW,qBAAqB,CAC3D,CACF;AAED,QAAO;EACL,GAAG;EACH,GAAG;EACH,GAAI,QACJ;GACE,UAAU;GACV,2BAA2B;GAC3B,mBAAmB;GACnB,oBAAoB;EACrB,IACD;GACE,UAAU;GACV,2BAA2B;GAC3B,mBAAmB;GACnB,oBAAoB;EACrB;CACF;AACH;;;;;AAMA,eAAsB,iBAAiB,EACrC,SACA,iBACA,OACA,YACwB,EAAE;;CAC1B,MAAM,SAAS,MAAM,kCAAe,WAAW;AAE/C,MAAK,yEAAU,OAAQ,oFAAY,mBACjC,OAAM,sCAAiB,cAAc,iCAAe;CAGtD,MAAM,gBAAgB,IAAI,yCACvB,WAAW,CAAE;AAGhB,qBAAoB,CAAE;AAEtB,iBAAgB,KAAK,cAAc,QAAQ,CAAC;AAE5C,KAAI;EACF,MAAM,OAAO,QAAQ,gBAAgB,OAAO;AAG5C,QAAM,mBAAO,KAAK;AAElB,QAAM,cAAc,MAAM;AAE1B,QAAM,kBAAM;GACV,OAAO;GACP,KAAK;GACL,OAAO;GACP,QAAQ,CAAC,KAAM;GACf,OAAO;GACP,QAAQ;GACR,UAAU;GACV,cAAc;IACZ,WAAW,EACT,KAAK;KACH,SAAS;KACT,cAAc;IACf,EACF;IACD,QAAQ,EACN,oBAAoB,KACrB;IACD,QAAQ,CAAC,SAAS,gBAAgB;;AAChC,uEAAI,QAAS,4DAAT,iBAAkB,SAAS,sBAAsB,CAAE;AAEvD,YAAO,YAAY,QAAQ;IAC5B;IACD,OAAO,CAAC,OAAO,KAAK,eAAe;AACjC,SAAI,MAAO;AAEX,YAAO,WAAW,OAAO,IAAI;IAC9B;IACD,aAAa;KACX,SAAS;KACT,SAAS;IACV;GACF;GACD,SAAS;GACT,UAAU;GACV,uBAAuB;GACvB,WAAW;GACX,QAAQ;GACR,QAAQ;GACR,KAAK,yBAAyB,OAAO,OAAO,CAAE,KAAI,MAAM;GACxD,OAAO;IACP;KACC,GAAG,OAAO;IACX;IACA;IACA;GAAe;GAEf,YAAY;EACb,EAAC;AAEF,QAAM,+BAAgB,OAAO,KAAK;AAClC,QAAM,gBACJ,cAAc,oCACZ,OACF,OAAO,QACR;CACF,SAAQ,OAAO;AACd,UAAQ,MAAM,iBAAiB,MAAM;AACrC,MAAI,iBAAiB,MACnB,SAAQ,MAAM,kBAAkB,MAAM,MAAM;AAE9C,UAAQ,KAAK,EAAE;CAChB,UAAS;AAER,QAAM,cAAc,SAAS;CAC/B;AACF;AAEA,MAAM,YAAY,CAAC,SAAkB;gBACrB,CAAC,MAAM,6BAAiB,6BAAiB,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,CAAC,KAAK,KAAK,CAAC;;;;;;;;AASzF,MAAM,kBAAkB;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAA2C,EAC3C,KAAK,KAAK;AAEV,MAAM,kBAAkB,CAAC,UACxB,yBAAyB,KAAK,KAAK,OAAO,CAAC;AAE5C,eAAe,gBACf,YACA,OACA,SACA;CACE,MAAM,QAAQ;EACd,SAAS,mCAAmC,gBAAgB,CAAC,UAAU,MAAM,EAAE,eAAgB,EAAC,CAAC,QAAQ,gBAAgB,CAAC,UAAU,MAAM,AAAC,EAAC,CAAA;;;;;;;;;;;;;;;;;;;;;CAsB5I,MAAM,OAAO,QAAQ,gBAAgB,WAAW;AAEhD,OAAM,gCAAU,oBAAK,YAAY,MAAM,WAAW,EAAE,KAAK;AAC3D"}
@@ -1,4 +1,4 @@
1
- import { CompilerPlugin } from "../CommandKit-Bt5GNyzq.js";
1
+ import { CompilerPlugin } from "../analytics-engine-CA_TBn6w.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";
package/dist/cli/build.js CHANGED
@@ -1,7 +1,7 @@
1
1
  require('../colors-Cd4Oz-r-.js');
2
2
  require('../ActionRow-CmTHbo2t.js');
3
3
  require('../error-codes-C-ViHyu-.js');
4
- require('../CommandKit-BBC-yzRf.js');
4
+ require('../commandkit-DYYj5_OH.js');
5
5
  require('../common-CcfjYnPG.js');
6
6
  require('../common-vnMIelAE.js');
7
7
  require('../container-DCjIgp-B.js');
@@ -34,6 +34,6 @@ require('../CommandKitEventsChannel-BSdcgY3Q.js');
34
34
  require('../store-CyzliDXj.js');
35
35
  require('../env-DakvrBzy.js');
36
36
  require('../type-checker-DDHZIEBi.js');
37
- const require_build = require('../build-DXo8U0Mv.js');
37
+ const require_build = require('../build-BylWoAy4.js');
38
38
 
39
39
  exports.buildApplication = require_build.buildApplication;
@@ -1,4 +1,4 @@
1
- import { ResolvedCommandKitConfig } from "../CommandKit-Bt5GNyzq.js";
1
+ import { ResolvedCommandKitConfig } from "../analytics-engine-CA_TBn6w.js";
2
2
  import "../EventInterceptor-x-R2qshQ.js";
3
3
  import "../ButtonKit-C7r7RPNf.js";
4
4
  import "../ModalKit-Btz58KYn.js";