commandkit 1.0.0-dev.20250511034609 → 1.0.0-dev.20250511052916

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.
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as discord_js from 'discord.js';
2
2
  import { RESTPostAPIApplicationCommandsJSONBody, Client, Interaction, CacheType, ClientEvents, Awaitable, ButtonBuilder, ButtonInteraction, Events, ModalBuilder, ModalSubmitInteraction, ActionRowBuilder, TextInputBuilder, ButtonStyle, ComponentEmojiResolvable, TextInputStyle, StringSelectMenuInteraction, StringSelectMenuBuilder, ChannelSelectMenuInteraction, ChannelSelectMenuBuilder, MentionableSelectMenuInteraction, MentionableSelectMenuBuilder, UserSelectMenuInteraction, UserSelectMenuBuilder, RoleSelectMenuInteraction, RoleSelectMenuBuilder, BaseSelectMenuComponentData, StringSelectMenuOptionBuilder, SelectMenuComponentOptionData, APISelectMenuOption, UserSelectMenuComponentData, RoleSelectMenuComponentData, MentionableSelectMenuComponentData, ChannelSelectMenuComponentData, ContainerComponentData, ComponentBuilder, ContainerBuilder, FileComponentData, FileBuilder, MediaGalleryItemBuilder, MediaGalleryBuilder, ThumbnailBuilder, TextDisplayBuilder, SectionBuilder, SeparatorComponentData, SeparatorBuilder, TextDisplayComponentData, Message as Message$1, ApplicationCommandOptionType, GuildMember, Attachment, User, Role, CommandInteractionOption, ChatInputCommandInteraction, MessageContextMenuCommandInteraction, UserContextMenuCommandInteraction, AutocompleteInteraction, Guild, TextBasedChannel, Locale, Collection, SlashCommandBuilder, ContextMenuCommandBuilder } from 'discord.js';
3
3
  import EventEmitter from 'node:events';
4
4
  import { Channel } from 'diagnostics_channel';
5
+ import { AsyncLocalStorage } from 'node:async_hooks';
5
6
  import * as commander from 'commander';
6
7
 
7
8
  interface CacheEntry<T = unknown> {
@@ -1795,6 +1796,7 @@ declare class CommandKit extends EventEmitter {
1795
1796
  static readonly createElement: typeof createElement;
1796
1797
  static readonly Fragment: typeof Fragment;
1797
1798
  readonly config: CommandKitConfiguration;
1799
+ readonly store: Map<string, any>;
1798
1800
  commandsRouter: CommandsRouter;
1799
1801
  eventsRouter: EventsRouter;
1800
1802
  readonly commandHandler: AppCommandHandler;
@@ -2045,6 +2047,16 @@ declare class StopEventPropagationError extends Error {
2045
2047
  */
2046
2048
  declare function stopEvents(): never;
2047
2049
 
2050
+ interface EventWorkerContext {
2051
+ event: string;
2052
+ namespace: string | null;
2053
+ data: ParsedEvent;
2054
+ commandkit: CommandKit;
2055
+ }
2056
+ declare const eventWorkerContext: AsyncLocalStorage<EventWorkerContext>;
2057
+ declare function runInEventWorkerContext<T>(context: EventWorkerContext, callback: () => T): T;
2058
+ declare function getEventWorkerContext(): EventWorkerContext;
2059
+
2048
2060
  /**
2049
2061
  * Creates a command line interface for CommandKit.
2050
2062
  * @param argv The arguments passed to the CLI.
@@ -2052,4 +2064,4 @@ declare function stopEvents(): never;
2052
2064
  */
2053
2065
  declare function bootstrapCommandkitCLI(argv: string[], options?: commander.ParseOptions | undefined): Promise<void>;
2054
2066
 
2055
- export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, type BootstrapFunction, Button, type ButtonChildrenLike, ButtonKit, type ButtonKitPredicate, type ButtonProps, COMMANDKIT_BOOTSTRAP_MODE, COMMANDKIT_CACHE_TAG, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, type CacheContext, type CacheEntry, type CacheMetadata, CacheProvider, ChannelSelectMenu, ChannelSelectMenuKit, type ChannelSelectMenuKitPredicate, type ChannelSelectMenuProps, type ChatInputCommand, type ChatInputCommandContext, type Command, type CommandBuilderLike, type CommandContext, type CommandContextOptions, type CommandData, CommandExecutionMode, CommandKit, type CommandKitButtonBuilderInteractionCollectorDispatch, type CommandKitButtonBuilderInteractionCollectorDispatchContextData, type CommandKitButtonBuilderOnEnd, type CommandKitConfiguration, type CommandKitElement, type CommandKitElementData, CommandKitEnvironment, type CommandKitEnvironmentInternalData, CommandKitEnvironmentType, type CommandKitHMREvent, type CommandKitLoggerOptions, type CommandKitModalBuilderInteractionCollectorDispatch, type CommandKitModalBuilderInteractionCollectorDispatchContextData, type CommandKitModalBuilderOnEnd, type CommandKitOptions, type CommandKitPlugin, CommandKitPluginRuntime, type CommandKitSelectMenuBuilderInteractionCollectorDispatch, type CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, type CommandKitSelectMenuBuilderOnEnd, CommandRegistrar, type CommandSource, type CommandTypeData, CommandsRouter, type CommandsRouterOptions, type CommonBuilderKit, type CommonPluginRuntime, type CommonSelectMenuProps, CompilerPlugin, CompilerPluginRuntime, Container, type ContainerProps, Context, type ContextParameters, DefaultLogger, ElementType, EventInterceptor, type EventInterceptorContextData, type EventInterceptorErrorHandler, EventsRouter, type EventsRouterOptions, type EventsTree, File, type FileProps, Fragment, type FragmentElementProps, type GenericFunction, HMREventType, type ILogger, type InteractionCommandContext, type InteractionCommandMiddlewareContext, type LoadedCommand, type Loader, type Location, Logger, type LoggerImpl, type MaybeArray, type MaybeFalsey, MediaGallery, MediaGalleryItem, type MediaGalleryItemProps, type MediaGalleryProps, MemoryCache, MentionableSelectMenu, MentionableSelectMenuKit, type MentionableSelectMenuKitPredicate, type MentionableSelectMenuProps, type Message, type MessageCommand, type MessageCommandContext, type MessageCommandMiddlewareContext, MessageCommandOptions, type MessageCommandOptionsSchema, MessageCommandParser, type MessageContextMenuCommand, type MessageContextMenuCommandContext, type MessageContextMenuCommandMiddlewareContext, type Middleware, MiddlewareContext, type MiddlewareContextArgs, Modal, ModalKit, type ModalKitPredicate, type ModalProps, type OnButtonKitClick, type OnButtonKitEnd, type OnChannelSelectMenuKitSubmit, type OnLoadArgs, type OnLoadOptions, type OnLoadResult, type OnMentionableSelectMenuKitSubmit, type OnModalKitEnd, type OnModalKitSubmit, type OnResolveArgs, type OnResolveOptions, type OnResolveResult, type OnRoleSelectMenuKitSubmit, type OnSelectMenuKitEnd, type OnSelectMenuKitSubmit, type OnStringSelectMenuKitSubmit, type OnUserSelectMenuKitSubmit, ParagraphInput, type ParsedCommandData, type ParsedEvent, type ParsedMessageCommand, type PluginTransformParameters, type PreRegisterCommandsEvent, type PreparedAppCommandExecution, type ResolvableCommand, type ResolveBuilderInteraction, type ResolveKind, type ResolveResult, RoleSelectMenu, RoleSelectMenuKit, type RoleSelectMenuKitPredicate, type RoleSelectMenuProps, type RunCommand, RuntimePlugin, Section, type SectionProps, type SelectMenuKitPredicate, type SelectMenuProps, Separator, type SeparatorProps, type Setup, ShortInput, type SlashCommandMiddlewareContext, StopEventPropagationError, StringSelectMenu, StringSelectMenuKit, type StringSelectMenuKitPredicate, StringSelectMenuOption, type StringSelectMenuOptionProps, type StringSelectMenuProps, TextDisplay, type TextDisplayProps, TextInput, type TextInputProps, Thumbnail, type ThumbnailProps, type TransformedResult, type UserContextMenuCommand, type UserContextMenuCommandContext, type UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, type UserSelectMenuKitPredicate, type UserSelectMenuProps, __SECRET_USE_CACHE_INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, after, bootstrapCommandkitCLI, cache, cacheLife, cacheTag, cancelAfter, commandkit, createElement, createLogger, debounce, CommandKit as default, defineConfig, devOnly, exitContext, exitMiddleware, fromEsbuildPlugin, getCommandKit, getConfig, getContext, getCurrentDirectory, getElement, getSourceDirectories, invalidate, isCachedFunction, isCommandKitElement, isCompilerPlugin, isInteractionSource, isMessageSource, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, redirect, rethrow, revalidate, stopEvents, useEnvironment, version };
2067
+ export { ActionRow, type ActionRowProps, type AnyCommandExecute, type AnyCommandKitElement, AppCommandHandler, type AsyncFunction, type AutocompleteCommand, type AutocompleteCommandContext, type AutocompleteCommandMiddlewareContext, type BootstrapFunction, Button, type ButtonChildrenLike, ButtonKit, type ButtonKitPredicate, type ButtonProps, COMMANDKIT_BOOTSTRAP_MODE, COMMANDKIT_CACHE_TAG, COMMANDKIT_IS_DEV, COMMANDKIT_IS_TEST, type CacheContext, type CacheEntry, type CacheMetadata, CacheProvider, ChannelSelectMenu, ChannelSelectMenuKit, type ChannelSelectMenuKitPredicate, type ChannelSelectMenuProps, type ChatInputCommand, type ChatInputCommandContext, type Command, type CommandBuilderLike, type CommandContext, type CommandContextOptions, type CommandData, CommandExecutionMode, CommandKit, type CommandKitButtonBuilderInteractionCollectorDispatch, type CommandKitButtonBuilderInteractionCollectorDispatchContextData, type CommandKitButtonBuilderOnEnd, type CommandKitConfiguration, type CommandKitElement, type CommandKitElementData, CommandKitEnvironment, type CommandKitEnvironmentInternalData, CommandKitEnvironmentType, type CommandKitHMREvent, type CommandKitLoggerOptions, type CommandKitModalBuilderInteractionCollectorDispatch, type CommandKitModalBuilderInteractionCollectorDispatchContextData, type CommandKitModalBuilderOnEnd, type CommandKitOptions, type CommandKitPlugin, CommandKitPluginRuntime, type CommandKitSelectMenuBuilderInteractionCollectorDispatch, type CommandKitSelectMenuBuilderInteractionCollectorDispatchContextData, type CommandKitSelectMenuBuilderOnEnd, CommandRegistrar, type CommandSource, type CommandTypeData, CommandsRouter, type CommandsRouterOptions, type CommonBuilderKit, type CommonPluginRuntime, type CommonSelectMenuProps, CompilerPlugin, CompilerPluginRuntime, Container, type ContainerProps, Context, type ContextParameters, DefaultLogger, ElementType, EventInterceptor, type EventInterceptorContextData, type EventInterceptorErrorHandler, type EventWorkerContext, EventsRouter, type EventsRouterOptions, type EventsTree, File, type FileProps, Fragment, type FragmentElementProps, type GenericFunction, HMREventType, type ILogger, type InteractionCommandContext, type InteractionCommandMiddlewareContext, type LoadedCommand, type Loader, type Location, Logger, type LoggerImpl, type MaybeArray, type MaybeFalsey, MediaGallery, MediaGalleryItem, type MediaGalleryItemProps, type MediaGalleryProps, MemoryCache, MentionableSelectMenu, MentionableSelectMenuKit, type MentionableSelectMenuKitPredicate, type MentionableSelectMenuProps, type Message, type MessageCommand, type MessageCommandContext, type MessageCommandMiddlewareContext, MessageCommandOptions, type MessageCommandOptionsSchema, MessageCommandParser, type MessageContextMenuCommand, type MessageContextMenuCommandContext, type MessageContextMenuCommandMiddlewareContext, type Middleware, MiddlewareContext, type MiddlewareContextArgs, Modal, ModalKit, type ModalKitPredicate, type ModalProps, type OnButtonKitClick, type OnButtonKitEnd, type OnChannelSelectMenuKitSubmit, type OnLoadArgs, type OnLoadOptions, type OnLoadResult, type OnMentionableSelectMenuKitSubmit, type OnModalKitEnd, type OnModalKitSubmit, type OnResolveArgs, type OnResolveOptions, type OnResolveResult, type OnRoleSelectMenuKitSubmit, type OnSelectMenuKitEnd, type OnSelectMenuKitSubmit, type OnStringSelectMenuKitSubmit, type OnUserSelectMenuKitSubmit, ParagraphInput, type ParsedCommandData, type ParsedEvent, type ParsedMessageCommand, type PluginTransformParameters, type PreRegisterCommandsEvent, type PreparedAppCommandExecution, type ResolvableCommand, type ResolveBuilderInteraction, type ResolveKind, type ResolveResult, RoleSelectMenu, RoleSelectMenuKit, type RoleSelectMenuKitPredicate, type RoleSelectMenuProps, type RunCommand, RuntimePlugin, Section, type SectionProps, type SelectMenuKitPredicate, type SelectMenuProps, Separator, type SeparatorProps, type Setup, ShortInput, type SlashCommandMiddlewareContext, StopEventPropagationError, StringSelectMenu, StringSelectMenuKit, type StringSelectMenuKitPredicate, StringSelectMenuOption, type StringSelectMenuOptionProps, type StringSelectMenuProps, TextDisplay, type TextDisplayProps, TextInput, type TextInputProps, Thumbnail, type ThumbnailProps, type TransformedResult, type UserContextMenuCommand, type UserContextMenuCommandContext, type UserContextMenuCommandMiddlewareContext, UserSelectMenu, UserSelectMenuKit, type UserSelectMenuKitPredicate, type UserSelectMenuProps, __SECRET_USE_CACHE_INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, after, bootstrapCommandkitCLI, cache, cacheLife, cacheTag, cancelAfter, commandkit, createElement, createLogger, debounce, CommandKit as default, defineConfig, devOnly, eventWorkerContext, exitContext, exitMiddleware, fromEsbuildPlugin, getCommandKit, getConfig, getContext, getCurrentDirectory, getElement, getEventWorkerContext, getSourceDirectories, invalidate, isCachedFunction, isCommandKitElement, isCompilerPlugin, isInteractionSource, isMessageSource, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, redirect, rethrow, revalidate, runInEventWorkerContext, stopEvents, useEnvironment, version };
package/dist/index.js CHANGED
@@ -2953,6 +2953,29 @@ var init_config = __esm({
2953
2953
  }
2954
2954
  });
2955
2955
 
2956
+ // src/app/events/EventWorkerContext.ts
2957
+ function runInEventWorkerContext(context2, callback) {
2958
+ return eventWorkerContext.run(context2, callback);
2959
+ }
2960
+ function getEventWorkerContext() {
2961
+ const context2 = eventWorkerContext.getStore();
2962
+ if (!context2) {
2963
+ throw new Error("Event worker context not found");
2964
+ }
2965
+ return context2;
2966
+ }
2967
+ var import_node_async_hooks2, eventWorkerContext;
2968
+ var init_EventWorkerContext = __esm({
2969
+ "src/app/events/EventWorkerContext.ts"() {
2970
+ "use strict";
2971
+ init_cjs_shims();
2972
+ import_node_async_hooks2 = require("async_hooks");
2973
+ eventWorkerContext = new import_node_async_hooks2.AsyncLocalStorage();
2974
+ __name(runInEventWorkerContext, "runInEventWorkerContext");
2975
+ __name(getEventWorkerContext, "getEventWorkerContext");
2976
+ }
2977
+ });
2978
+
2956
2979
  // src/utils/utilities.ts
2957
2980
  function getCurrentDirectory() {
2958
2981
  if (currentDir) return currentDir;
@@ -3017,6 +3040,9 @@ function devOnly(fn) {
3017
3040
  return f;
3018
3041
  }
3019
3042
  function stopEvents() {
3043
+ if (!eventWorkerContext.getStore()) {
3044
+ throw new Error("stopEvents() may only be called inside an event handler");
3045
+ }
3020
3046
  throw new StopEventPropagationError();
3021
3047
  }
3022
3048
  var import_node_fs, import_node_path, appDir, currentDir, _StopEventPropagationError, StopEventPropagationError;
@@ -3028,6 +3054,7 @@ var init_utilities = __esm({
3028
3054
  import_node_path = require("path");
3029
3055
  init_constants();
3030
3056
  init_config();
3057
+ init_EventWorkerContext();
3031
3058
  appDir = null;
3032
3059
  currentDir = null;
3033
3060
  __name(getCurrentDirectory, "getCurrentDirectory");
@@ -4887,6 +4914,7 @@ var init_AppEventsHandler = __esm({
4887
4914
  init_Logger();
4888
4915
  init_resolve_file_url();
4889
4916
  init_utilities();
4917
+ init_EventWorkerContext();
4890
4918
  _AppEventsHandler = class _AppEventsHandler {
4891
4919
  constructor(commandkit2) {
4892
4920
  this.commandkit = commandkit2;
@@ -4950,41 +4978,63 @@ var init_AppEventsHandler = __esm({
4950
4978
  const onListeners = listeners.filter((listener) => !listener.once);
4951
4979
  const executedOnceListeners = /* @__PURE__ */ new Set();
4952
4980
  const mainHandler = /* @__PURE__ */ __name(async (...args) => {
4953
- for (const listener of onListeners) {
4954
- try {
4955
- await listener.handler(...args);
4956
- } catch (e) {
4957
- if (e instanceof StopEventPropagationError) {
4958
- Logger.debug(
4959
- `Event propagation stopped for ${name}${namespace ? ` of namespace ${namespace}` : ""}`
4960
- );
4961
- break;
4981
+ await runInEventWorkerContext(
4982
+ {
4983
+ event: name,
4984
+ namespace: namespace ?? null,
4985
+ data: data.event,
4986
+ commandkit: this.commandkit
4987
+ },
4988
+ async () => {
4989
+ for (const listener of onListeners) {
4990
+ try {
4991
+ await listener.handler(...args);
4992
+ } catch (e) {
4993
+ if (e instanceof StopEventPropagationError) {
4994
+ Logger.debug(
4995
+ `Event propagation stopped for ${name}${namespace ? ` of namespace ${namespace}` : ""}`
4996
+ );
4997
+ break;
4998
+ }
4999
+ Logger.error(
5000
+ `Error handling event ${name}${namespace ? ` of namespace ${namespace}` : ""}`,
5001
+ e
5002
+ );
5003
+ }
4962
5004
  }
4963
- Logger.error(
4964
- `Error handling event ${name}${namespace ? ` of namespace ${namespace}` : ""}`,
4965
- e
4966
- );
4967
5005
  }
4968
- }
5006
+ );
4969
5007
  }, "mainHandler");
4970
5008
  const onceHandler = /* @__PURE__ */ __name(async (...args) => {
5009
+ let broken = false;
4971
5010
  for (const listener of onceListeners) {
4972
- try {
4973
- if (executedOnceListeners.has(listener.handler)) continue;
4974
- await listener.handler(...args);
4975
- executedOnceListeners.add(listener.handler);
4976
- } catch (e) {
4977
- if (e instanceof StopEventPropagationError) {
4978
- Logger.debug(
4979
- `Event propagation stopped for ${name}${namespace ? ` of namespace ${namespace}` : ""}`
4980
- );
4981
- break;
5011
+ if (broken) break;
5012
+ await runInEventWorkerContext(
5013
+ {
5014
+ event: name,
5015
+ namespace: namespace ?? null,
5016
+ data: data.event,
5017
+ commandkit: this.commandkit
5018
+ },
5019
+ async () => {
5020
+ try {
5021
+ if (executedOnceListeners.has(listener.handler)) return;
5022
+ await listener.handler(...args);
5023
+ executedOnceListeners.add(listener.handler);
5024
+ } catch (e) {
5025
+ if (e instanceof StopEventPropagationError) {
5026
+ Logger.debug(
5027
+ `Event propagation stopped for ${name}${namespace ? ` of namespace ${namespace}` : ""}`
5028
+ );
5029
+ broken = true;
5030
+ }
5031
+ Logger.error(
5032
+ `Error handling event ${name}${namespace ? ` of namespace ${namespace}` : ""}`,
5033
+ e
5034
+ );
5035
+ }
4982
5036
  }
4983
- Logger.error(
4984
- `Error handling event ${name}${namespace ? ` of namespace ${namespace}` : ""}`,
4985
- e
4986
- );
4987
- }
5037
+ );
4988
5038
  }
4989
5039
  if (executedOnceListeners.size === onceListeners.length && onListeners.length === 0) {
4990
5040
  this.loadedEvents.delete(key);
@@ -5409,6 +5459,7 @@ var init_CommandKit = __esm({
5409
5459
  defaultLocale: import_discord25.Locale.EnglishUS,
5410
5460
  getMessageCommandPrefix: /* @__PURE__ */ __name(() => "!", "getMessageCommandPrefix")
5411
5461
  });
5462
+ __publicField(this, "store", /* @__PURE__ */ new Map());
5412
5463
  __publicField(this, "commandsRouter");
5413
5464
  __publicField(this, "eventsRouter");
5414
5465
  __publicField(this, "commandHandler", new AppCommandHandler(this));
@@ -5664,7 +5715,7 @@ var init_version = __esm({
5664
5715
  "use strict";
5665
5716
  init_cjs_shims();
5666
5717
  version = /* @__MACRO__ $version */
5667
- "1.0.0-dev.20250511034609";
5718
+ "1.0.0-dev.20250511052916";
5668
5719
  }
5669
5720
  });
5670
5721
 
@@ -6605,6 +6656,7 @@ __export(index_exports, {
6605
6656
  default: () => index_default,
6606
6657
  defineConfig: () => defineConfig,
6607
6658
  devOnly: () => devOnly,
6659
+ eventWorkerContext: () => eventWorkerContext,
6608
6660
  exitContext: () => exitContext,
6609
6661
  exitMiddleware: () => exitMiddleware,
6610
6662
  fromEsbuildPlugin: () => fromEsbuildPlugin,
@@ -6613,6 +6665,7 @@ __export(index_exports, {
6613
6665
  getContext: () => getContext,
6614
6666
  getCurrentDirectory: () => getCurrentDirectory,
6615
6667
  getElement: () => getElement,
6668
+ getEventWorkerContext: () => getEventWorkerContext,
6616
6669
  getSourceDirectories: () => getSourceDirectories,
6617
6670
  invalidate: () => invalidate,
6618
6671
  isCachedFunction: () => isCachedFunction,
@@ -6628,6 +6681,7 @@ __export(index_exports, {
6628
6681
  redirect: () => redirect,
6629
6682
  rethrow: () => rethrow,
6630
6683
  revalidate: () => revalidate,
6684
+ runInEventWorkerContext: () => runInEventWorkerContext,
6631
6685
  stopEvents: () => stopEvents,
6632
6686
  useEnvironment: () => useEnvironment,
6633
6687
  version: () => version
@@ -6648,7 +6702,7 @@ init_MemoryCache();
6648
6702
 
6649
6703
  // src/cache/use-cache.ts
6650
6704
  init_cjs_shims();
6651
- var import_node_async_hooks2 = require("async_hooks");
6705
+ var import_node_async_hooks3 = require("async_hooks");
6652
6706
  init_async_context();
6653
6707
  var import_node_crypto3 = require("crypto");
6654
6708
  var import_ms = __toESM(require("ms"));
@@ -6700,7 +6754,7 @@ async function createObjectHash(...args) {
6700
6754
  __name(createObjectHash, "createObjectHash");
6701
6755
 
6702
6756
  // src/cache/use-cache.ts
6703
- var cacheContext = new import_node_async_hooks2.AsyncLocalStorage();
6757
+ var cacheContext = new import_node_async_hooks3.AsyncLocalStorage();
6704
6758
  var fnStore = /* @__PURE__ */ new Map();
6705
6759
  var DEFAULT_TTL = (0, import_ms.default)("15m");
6706
6760
  var CACHE_FN_ID = `__cache_fn_id_${Date.now()}__${Math.random()}__`;
@@ -6856,6 +6910,7 @@ init_version();
6856
6910
  init_plugins();
6857
6911
  init_utilities();
6858
6912
  init_constants();
6913
+ init_EventWorkerContext();
6859
6914
 
6860
6915
  // src/cli/init.ts
6861
6916
  init_cjs_shims();
@@ -6988,6 +7043,7 @@ var index_default = CommandKit;
6988
7043
  debounce,
6989
7044
  defineConfig,
6990
7045
  devOnly,
7046
+ eventWorkerContext,
6991
7047
  exitContext,
6992
7048
  exitMiddleware,
6993
7049
  fromEsbuildPlugin,
@@ -6996,6 +7052,7 @@ var index_default = CommandKit;
6996
7052
  getContext,
6997
7053
  getCurrentDirectory,
6998
7054
  getElement,
7055
+ getEventWorkerContext,
6999
7056
  getSourceDirectories,
7000
7057
  invalidate,
7001
7058
  isCachedFunction,
@@ -7011,6 +7068,7 @@ var index_default = CommandKit;
7011
7068
  redirect,
7012
7069
  rethrow,
7013
7070
  revalidate,
7071
+ runInEventWorkerContext,
7014
7072
  stopEvents,
7015
7073
  useEnvironment,
7016
7074
  version