@context-action/core 0.0.4 → 0.1.0
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.cjs +675 -492
- package/dist/index.d.cts +147 -589
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +147 -589
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +675 -493
- package/dist/index.js.map +1 -1
- package/package.json +1 -4
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["context: PipelineContext<T>","createController: (registration: HandlerRegistration<T>, index: number) => PipelineController<T>","logger: Logger","error: any","_typeof","o","_typeof","toPrimitive","toPropertyKey","_defineProperty","logger: Logger","actionKey: string","debounceMs: number","throttleMs: number","event: K","handler: EventHandler<T[K]>","data: T[K]","event?: keyof T","config: ActionRegisterConfig","action: K","payload?: T[K]","context: PipelineContext<T[K]>","metrics: ActionMetrics","error: any","handler: ActionHandler<T[K]>","config: HandlerConfig","registration: HandlerRegistration<T[K]>","_index: number","reason?: string","modifier: (payload: T[K]) => T[K]","priority: number","executedHandlers: HandlerRegistration<T[K]>[]","handler: EventHandler<ActionRegisterEvents<T>[K]>"],"sources":["../src/execution-modes.ts","../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/typeof.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.77.3/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js","../src/action-guard.ts","../src/ActionRegister.ts"],"sourcesContent":["/**\n * @fileoverview Execution mode implementations for ActionRegister\n * Provides different execution strategies for action pipelines\n */\n\nimport type { \n HandlerRegistration, \n PipelineContext, \n PipelineController\n} from './types.js';\nimport type { Logger } from '@context-action/logger';\n\n/**\n * Execute handlers in sequential mode (one after another)\n * @implements execution-modes\n * @implements sequential-execution\n * @memberof core-concepts\n * @internal\n * @since 1.0.0\n * \n * Executes action handlers sequentially in priority order, supporting flow control,\n * conditional execution, and priority jumping within the pipeline.\n * \n * @template T - The type of the payload being processed\n * @param context - Pipeline execution context with handlers and state\n * @param createController - Factory function for creating pipeline controllers\n * @param logger - Logger instance for tracing execution\n * @returns Promise that resolves when all handlers complete or pipeline aborts\n * \n * Features:\n * - Priority-based execution order (higher priority first)\n * - Support for priority jumping within execution\n * - Conditional handler execution (condition/validation checks)\n * - Blocking/non-blocking handler support\n * - Comprehensive error handling and recovery\n */\nexport async function executeSequential<T>(\n context: PipelineContext<T>,\n createController: (registration: HandlerRegistration<T>, index: number) => PipelineController<T>,\n logger: Logger\n): Promise<void> {\n logger.trace('Executing in sequential mode', {\n handlerCount: context.handlers.length\n });\n\n for (let i = 0; i < context.handlers.length; i++) {\n if (context.aborted) {\n logger.trace('Sequential execution aborted', { \n atIndex: i,\n reason: context.abortReason \n });\n break;\n }\n\n // Handle jump to priority\n if (context.jumpToPriority !== undefined) {\n const jumpIndex = context.handlers.findIndex(\n handler => handler.config.priority === context.jumpToPriority\n );\n if (jumpIndex !== -1 && jumpIndex !== i) {\n logger.trace('Jumping to priority', {\n fromIndex: i,\n toIndex: jumpIndex,\n priority: context.jumpToPriority\n });\n i = jumpIndex - 1; // -1 because loop will increment\n context.jumpToPriority = undefined;\n continue;\n }\n context.jumpToPriority = undefined;\n }\n\n const registration = context.handlers[i];\n context.currentIndex = i;\n\n // Check condition if provided\n if (registration.config.condition && !registration.config.condition()) {\n logger.debug(`Skipping handler '${registration.id}' - condition not met`);\n continue;\n }\n\n // Check validation if provided\n if (registration.config.validation && !registration.config.validation(context.payload)) {\n logger.debug(`Skipping handler '${registration.id}' - validation failed`);\n continue;\n }\n\n const controller = createController(registration, i);\n\n try {\n logger.trace(`Executing handler ${i + 1}/${context.handlers.length}`, {\n handlerId: registration.id,\n priority: registration.config.priority\n });\n\n const result = registration.handler(context.payload, controller);\n\n // Wait for async handlers if they're blocking\n if (registration.config.blocking && result instanceof Promise) {\n logger.trace(`Waiting for blocking handler '${registration.id}'`);\n await result;\n }\n\n logger.trace(`Handler '${registration.id}' completed`);\n\n } catch (error: any) {\n logger.error(`Handler '${registration.id}' threw an error`, error);\n \n if (registration.config.blocking) {\n throw error;\n }\n }\n }\n}\n\n/**\n * Execute handlers in parallel mode (all at once)\n * @internal\n */\nexport async function executeParallel<T>(\n context: PipelineContext<T>,\n createController: (registration: HandlerRegistration<T>, index: number) => PipelineController<T>,\n logger: Logger\n): Promise<void> {\n logger.trace('Executing in parallel mode', {\n handlerCount: context.handlers.length\n });\n\n // Filter handlers that should run\n const runnableHandlers = context.handlers.filter((registration, _index) => {\n // Check condition\n if (registration.config.condition && !registration.config.condition()) {\n logger.debug(`Skipping handler '${registration.id}' - condition not met`);\n return false;\n }\n\n // Check validation\n if (registration.config.validation && !registration.config.validation(context.payload)) {\n logger.debug(`Skipping handler '${registration.id}' - validation failed`);\n return false;\n }\n\n return true;\n });\n\n logger.trace(`Running ${runnableHandlers.length} handlers in parallel`);\n\n // Create promises for all handlers\n const handlerPromises = runnableHandlers.map(async (registration, _index) => {\n const controller = createController(registration, _index);\n \n try {\n logger.trace(`Starting parallel handler '${registration.id}'`);\n \n const result = registration.handler(context.payload, controller);\n \n if (result instanceof Promise) {\n await result;\n }\n \n logger.trace(`Parallel handler '${registration.id}' completed`);\n return { success: true, handlerId: registration.id };\n \n } catch (error: any) {\n logger.error(`Parallel handler '${registration.id}' failed`, error);\n \n if (registration.config.blocking) {\n throw error;\n }\n \n return { success: false, handlerId: registration.id, error };\n }\n });\n\n // Wait for all handlers to complete\n const results = await Promise.allSettled(handlerPromises);\n \n // Check for any rejected blocking handlers\n const failures = results.filter((result, index) => {\n if (result.status === 'rejected') {\n const registration = runnableHandlers[index];\n return registration.config.blocking;\n }\n return false;\n });\n\n if (failures.length > 0) {\n const firstFailure = failures[0] as PromiseRejectedResult;\n throw firstFailure.reason;\n }\n\n logger.trace('Parallel execution completed', {\n successful: results.filter(r => r.status === 'fulfilled').length,\n failed: results.filter(r => r.status === 'rejected').length\n });\n}\n\n/**\n * Execute handlers in race mode (first to complete wins)\n * @internal\n */\nexport async function executeRace<T>(\n context: PipelineContext<T>,\n createController: (registration: HandlerRegistration<T>, index: number) => PipelineController<T>,\n logger: Logger\n): Promise<void> {\n logger.trace('Executing in race mode', {\n handlerCount: context.handlers.length\n });\n\n // Filter handlers that should run\n const runnableHandlers = context.handlers.filter((registration, _index) => {\n // Check condition\n if (registration.config.condition && !registration.config.condition()) {\n logger.debug(`Skipping handler '${registration.id}' - condition not met`);\n return false;\n }\n\n // Check validation\n if (registration.config.validation && !registration.config.validation(context.payload)) {\n logger.debug(`Skipping handler '${registration.id}' - validation failed`);\n return false;\n }\n\n return true;\n });\n\n if (runnableHandlers.length === 0) {\n logger.trace('No runnable handlers for race mode');\n return;\n }\n\n logger.trace(`Racing ${runnableHandlers.length} handlers`);\n\n // Create promises for all handlers\n const handlerPromises = runnableHandlers.map(async (registration, _index) => {\n const controller = createController(registration, _index);\n \n try {\n logger.trace(`Starting race handler '${registration.id}'`);\n \n const result = registration.handler(context.payload, controller);\n \n if (result instanceof Promise) {\n await result;\n }\n \n logger.trace(`Race handler '${registration.id}' completed`);\n return { success: true, handlerId: registration.id, registration };\n \n } catch (error: any) {\n logger.error(`Race handler '${registration.id}' failed`, error);\n return { success: false, handlerId: registration.id, error, registration };\n }\n });\n\n try {\n // Race all handlers\n const winner = await Promise.race(handlerPromises);\n \n logger.debug('Race completed', {\n winner: winner.handlerId,\n success: winner.success\n });\n\n // If the winner failed and was blocking, throw the error\n if (!winner.success && winner.registration?.config.blocking) {\n throw winner.error;\n }\n\n } catch (error: any) {\n logger.error('Race execution failed', error);\n throw error;\n }\n}","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * @fileoverview Action Guard system for debouncing, throttling and blocking\n * Provides rate limiting and user experience optimization for actions\n */\n\nimport type { Logger } from '@context-action/logger';\n\n/**\n * Action guard state tracking\n * @internal\n */\ninterface GuardState {\n lastExecuted: number;\n debounceTimer?: NodeJS.Timeout;\n throttleTimer?: NodeJS.Timeout;\n isThrottled: boolean;\n}\n\n/**\n * Action Guard system for managing action execution timing\n * @implements action-guard\n * @implements performance-optimization \n * @implements user-experience-optimization\n * @memberof core-concepts\n * @internal\n * @since 1.0.0\n * \n * Provides debouncing, throttling, and blocking mechanisms for action execution\n * to optimize performance and enhance user experience. Manages timing state\n * per action to prevent unnecessary or excessive action invocations.\n * \n * Key Features:\n * - Debouncing: Delay execution until activity stops\n * - Throttling: Limit execution frequency to intervals\n * - Per-action state management with automatic cleanup\n * - Memory leak prevention through proper timer management\n * \n * @example\n * ```typescript\n * const guard = new ActionGuard(logger);\n * \n * // Debounce search input (wait 300ms after typing stops)\n * if (await guard.debounce('search', 300)) {\n * executeSearch(); \n * }\n * \n * // Throttle scroll handler (max once per 100ms)\n * if (guard.throttle('scroll', 100)) {\n * updateScrollPosition();\n * }\n * ```\n */\nexport class ActionGuard {\n private guards = new Map<string, GuardState>();\n private logger: Logger;\n\n constructor(logger: Logger) {\n this.logger = logger;\n }\n\n /**\n * Check if action should be debounced\n * @param actionKey - Unique key for the action\n * @param debounceMs - Debounce delay in milliseconds\n * @returns Promise that resolves when debounce period is complete\n */\n async debounce(actionKey: string, debounceMs: number): Promise<boolean> {\n this.logger.trace(`Checking debounce for '${actionKey}'`, { debounceMs });\n\n let state = this.guards.get(actionKey);\n if (!state) {\n state = {\n lastExecuted: 0,\n isThrottled: false\n };\n this.guards.set(actionKey, state);\n }\n\n // Clear existing debounce timer\n if (state.debounceTimer) {\n clearTimeout(state.debounceTimer);\n this.logger.trace(`Cleared existing debounce timer for '${actionKey}'`);\n }\n\n // Create new debounce promise\n return new Promise((resolve) => {\n state!.debounceTimer = setTimeout(() => {\n this.logger.trace(`Debounce completed for '${actionKey}'`);\n state!.debounceTimer = undefined;\n state!.lastExecuted = Date.now();\n resolve(true);\n }, debounceMs);\n \n this.logger.trace(`Set debounce timer for '${actionKey}'`, { delay: debounceMs });\n });\n }\n\n /**\n * Check if action should be throttled\n * @param actionKey - Unique key for the action\n * @param throttleMs - Throttle delay in milliseconds\n * @returns True if action should proceed, false if throttled\n */\n throttle(actionKey: string, throttleMs: number): boolean {\n this.logger.trace(`Checking throttle for '${actionKey}'`, { throttleMs });\n\n let state = this.guards.get(actionKey);\n if (!state) {\n state = {\n lastExecuted: 0,\n isThrottled: false\n };\n this.guards.set(actionKey, state);\n }\n\n const now = Date.now();\n const timeSinceLastExecution = now - state.lastExecuted;\n\n // If enough time has passed, allow execution\n if (timeSinceLastExecution >= throttleMs) {\n state.lastExecuted = now;\n state.isThrottled = false;\n \n this.logger.trace(`Throttle passed for '${actionKey}'`, {\n timeSinceLastExecution,\n throttleMs\n });\n \n return true;\n }\n\n // If already throttled, don't set another timer\n if (state.isThrottled) {\n this.logger.trace(`Action '${actionKey}' is already throttled`);\n return false;\n }\n\n // Set throttle timer for future execution\n state.isThrottled = true;\n const remainingTime = throttleMs - timeSinceLastExecution;\n \n state.throttleTimer = setTimeout(() => {\n state!.isThrottled = false;\n state!.throttleTimer = undefined;\n this.logger.trace(`Throttle period ended for '${actionKey}'`);\n }, remainingTime);\n\n this.logger.trace(`Action '${actionKey}' throttled`, {\n timeSinceLastExecution,\n remainingTime\n });\n\n return false;\n }\n\n /**\n * Clear all guards for an action\n * @param actionKey - Action key to clear\n */\n clearGuards(actionKey: string): void {\n this.logger.trace(`Clearing guards for '${actionKey}'`);\n \n const state = this.guards.get(actionKey);\n if (state) {\n if (state.debounceTimer) {\n clearTimeout(state.debounceTimer);\n }\n if (state.throttleTimer) {\n clearTimeout(state.throttleTimer);\n }\n this.guards.delete(actionKey);\n \n this.logger.debug(`Cleared guards for '${actionKey}'`);\n }\n }\n\n /**\n * Clear all guards\n */\n clearAll(): void {\n this.logger.trace('Clearing all action guards');\n \n for (const [, state] of this.guards) {\n if (state.debounceTimer) {\n clearTimeout(state.debounceTimer);\n }\n if (state.throttleTimer) {\n clearTimeout(state.throttleTimer);\n }\n }\n \n this.guards.clear();\n this.logger.debug('Cleared all action guards');\n }\n\n /**\n * Get current guard state for debugging\n * @param actionKey - Action key to inspect\n */\n getGuardState(actionKey: string): GuardState | undefined {\n return this.guards.get(actionKey);\n }\n\n /**\n * Get all active guards for debugging\n */\n getAllGuardStates(): Map<string, GuardState> {\n return new Map(this.guards);\n }\n}","/**\n * @fileoverview ActionRegister - Core action pipeline management system\n * Provides type-safe action dispatch with priority-based handler execution\n */\n\nimport {\n ActionPayloadMap,\n ActionHandler,\n HandlerConfig,\n HandlerRegistration,\n PipelineContext,\n PipelineController,\n ActionRegisterConfig,\n UnregisterFunction,\n ActionDispatcher,\n ActionMetrics,\n ActionRegisterEvents,\n EventEmitter,\n EventHandler,\n ExecutionMode,\n} from './types.js';\nimport { Logger, createLogger, getLoggerNameFromEnv, getDebugFromEnv } from '@context-action/logger';\nimport { executeSequential, executeParallel, executeRace } from './execution-modes.js';\nimport { ActionGuard } from './action-guard.js';\n\n/**\n * Simple event emitter implementation for ActionRegister events\n * @internal\n */\nclass SimpleEventEmitter<T extends Record<string, any>> implements EventEmitter<T> {\n private listeners = new Map<keyof T, Set<EventHandler<any>>>();\n\n on<K extends keyof T>(event: K, handler: EventHandler<T[K]>): UnregisterFunction {\n if (!this.listeners.has(event)) {\n this.listeners.set(event, new Set());\n }\n this.listeners.get(event)!.add(handler);\n\n return () => this.off(event, handler);\n }\n\n emit<K extends keyof T>(event: K, data: T[K]): void {\n const eventListeners = this.listeners.get(event);\n if (eventListeners) {\n eventListeners.forEach(handler => {\n try {\n handler(data);\n } catch (error) {\n console.error(`Error in event handler for ${String(event)}:`, error);\n }\n });\n }\n }\n\n off<K extends keyof T>(event: K, handler: EventHandler<T[K]>): void {\n const eventListeners = this.listeners.get(event);\n if (eventListeners) {\n eventListeners.delete(handler);\n if (eventListeners.size === 0) {\n this.listeners.delete(event);\n }\n }\n }\n\n removeAllListeners(event?: keyof T): void {\n if (event) {\n this.listeners.delete(event);\n } else {\n this.listeners.clear();\n }\n }\n}\n\n/**\n * Central action registration and dispatch system\n * @implements action-pipeline-system\n * @implements actionregister \n * @memberof core-concepts\n * \n * Core action pipeline management system with type-safe action dispatch\n * @template T - Action payload map defining available actions and their payload types\n * \n * @example\n * ```typescript\n * interface AppActions extends ActionPayloadMap {\n * increment: void;\n * setCount: number;\n * updateUser: { id: string; name: string };\n * }\n *\n * const actionRegister = new ActionRegister<AppActions>();\n *\n * // Register handlers with priority and configuration\n * actionRegister.register('increment', (_, controller) => {\n * console.log('Incremented');\n * controller.next();\n * }, { priority: 10 });\n *\n * actionRegister.register('setCount', (count, controller) => {\n * console.log(`Count: ${count}`);\n * controller.next();\n * });\n *\n * // Dispatch actions with type safety\n * await actionRegister.dispatch('increment');\n * await actionRegister.dispatch('setCount', 42);\n * ```\n */\nexport class ActionRegister<T extends ActionPayloadMap = ActionPayloadMap> {\n private pipelines = new Map<keyof T, HandlerRegistration<any>[]>();\n private handlerCounter = 0;\n private readonly logger: Logger;\n private readonly events = new SimpleEventEmitter<ActionRegisterEvents<T>>();\n private readonly config: Required<ActionRegisterConfig>;\n private readonly actionGuard: ActionGuard;\n private executionMode: ExecutionMode = 'sequential';\n private actionExecutionModes = new Map<keyof T, ExecutionMode>();\n\n constructor(config: ActionRegisterConfig = {}) {\n // Set defaults for configuration with .env support\n this.config = {\n logger: config.logger || createLogger(config.logLevel),\n logLevel: config.logLevel ?? 3, // ERROR level as default\n name: config.name || getLoggerNameFromEnv(),\n debug: config.debug ?? getDebugFromEnv(),\n defaultExecutionMode: config.defaultExecutionMode ?? 'sequential',\n } as Required<ActionRegisterConfig>;\n\n this.logger = this.config.logger;\n this.actionGuard = new ActionGuard(this.logger);\n this.executionMode = this.config.defaultExecutionMode;\n \n this.logger.trace(`${this.config.name} constructor called`, { config });\n\n if (this.config.debug) {\n this.logger.info(`${this.config.name} initialized`, {\n logLevel: this.config.logLevel,\n debug: this.config.debug,\n defaultExecutionMode: this.executionMode,\n });\n }\n \n this.logger.trace(`${this.config.name} constructor completed`);\n }\n\n /**\n * Register action handler with pipeline\n * @implements action-handler\n * \n * Register a handler for an action in the pipeline\n * @param action - The action name to handle\n * @param handler - The handler function to execute\n * @param config - Optional configuration for the handler\n * @returns Unregister function to remove the handler\n * \n * @example\n * ```typescript\n * const unregister = actionRegister.register('updateUser', \n * async (payload, controller) => {\n * // Validate payload\n * if (!payload.id) {\n * controller.abort('User ID is required');\n * return;\n * }\n * \n * // Process update\n * await updateUserInStore(payload);\n * controller.next();\n * }, \n * { priority: 10, blocking: true }\n * );\n * \n * // Later, remove the handler\n * unregister();\n * ```\n */\n register<K extends keyof T>(\n action: K,\n handler: ActionHandler<T[K]>,\n config: HandlerConfig = {}\n ): UnregisterFunction {\n this.logger.trace(`Registering handler for action '${String(action)}'`, { config });\n \n // Generate unique handler ID\n const handlerId = config.id || `handler_${++this.handlerCounter}`;\n \n this.logger.trace(`Generated handler ID: ${handlerId}`);\n \n // Create handler registration with defaults\n const registration: HandlerRegistration<T[K]> = {\n handler,\n config: {\n priority: config.priority ?? 0,\n id: handlerId,\n blocking: config.blocking ?? false,\n once: config.once ?? false,\n condition: config.condition || (() => true),\n debounce: config.debounce,\n throttle: config.throttle,\n validation: config.validation,\n middleware: config.middleware ?? false,\n } as Required<HandlerConfig>,\n id: handlerId,\n };\n \n this.logger.trace(`Created handler registration`, { registration: { id: handlerId, config: registration.config } });\n\n // Initialize pipeline if it doesn't exist\n if (!this.pipelines.has(action)) {\n this.logger.trace(`Creating new pipeline for action: ${String(action)}`);\n this.pipelines.set(action, []);\n this.logger.debug(`Created pipeline for action: ${String(action)}`);\n }\n\n const pipeline = this.pipelines.get(action)!;\n this.logger.trace(`Current pipeline for '${String(action)}' has ${pipeline.length} handlers`);\n \n // Check for duplicate handler IDs\n if (pipeline.some(reg => reg.id === handlerId)) {\n this.logger.warn(`Handler with ID '${handlerId}' already exists for action '${String(action)}'`);\n this.logger.trace(`Duplicate handler registration aborted`);\n return () => {}; // Return no-op unregister function\n }\n\n // Add handler to pipeline\n pipeline.push(registration);\n this.logger.trace(`Added handler to pipeline, current length: ${pipeline.length}`);\n \n // Sort pipeline by priority (highest first)\n pipeline.sort((a, b) => b.config.priority - a.config.priority);\n this.logger.trace(`Pipeline sorted by priority`, { \n priorities: pipeline.map(reg => ({ id: reg.id, priority: reg.config.priority })) \n });\n\n this.logger.debug(`Registered handler for action '${String(action)}'`, {\n handlerId,\n priority: registration.config.priority,\n blocking: registration.config.blocking,\n once: registration.config.once,\n });\n\n // Emit registration event\n this.events.emit('handler:register', {\n action,\n handlerId,\n config: registration.config,\n });\n\n // Return unregister function\n return () => {\n this.logger.trace(`Unregistering handler '${handlerId}' from action '${String(action)}'`);\n const index = pipeline.findIndex(reg => reg.id === handlerId);\n if (index !== -1) {\n pipeline.splice(index, 1);\n this.logger.debug(`Unregistered handler '${handlerId}' from action '${String(action)}'`);\n this.logger.trace(`Pipeline now has ${pipeline.length} handlers`);\n \n // Emit unregistration event\n this.events.emit('handler:unregister', {\n action,\n handlerId,\n });\n } else {\n this.logger.trace(`Handler '${handlerId}' not found in pipeline for unregistration`);\n }\n };\n }\n\n /**\n * Dispatch action through pipeline\n * @implements action-dispatcher\n * \n * Dispatch an action through the pipeline\n * Overloaded to provide type safety for actions with and without payloads\n */\n dispatch: ActionDispatcher<T> = async <K extends keyof T>(\n action: K,\n payload?: T[K]\n ): Promise<void> => {\n const startTime = Date.now();\n this.logger.trace(`Starting dispatch for action '${String(action)}'`, { \n action, \n payload, \n startTime \n });\n \n // Emit action start event\n this.events.emit('action:start', { action, payload });\n this.logger.trace(`Emitted 'action:start' event`);\n\n this.logger.debug(`Dispatching action '${String(action)}'`, { payload });\n\n const pipeline = this.pipelines.get(action);\n if (!pipeline || pipeline.length === 0) {\n this.logger.warn(`No handlers registered for action '${String(action)}'`);\n this.logger.trace(`Dispatch completed early - no handlers`);\n return;\n }\n \n this.logger.trace(`Found ${pipeline.length} handlers for action '${String(action)}'`, {\n handlerIds: pipeline.map(reg => reg.id)\n });\n\n // Determine execution mode for this action\n const currentExecutionMode = this.actionExecutionModes.get(action) || this.executionMode;\n\n // Create pipeline execution context\n const context: PipelineContext<T[K]> = {\n action: String(action),\n payload: payload as T[K],\n handlers: [...pipeline], // Copy handlers to avoid modification during execution\n aborted: false,\n abortReason: undefined,\n currentIndex: 0,\n jumpToPriority: undefined,\n executionMode: currentExecutionMode,\n };\n\n try {\n await this.executePipeline(context);\n \n // Create success metrics\n const metrics: ActionMetrics = {\n action: String(action),\n executionTime: Date.now() - startTime,\n handlerCount: context.handlers.length,\n success: !context.aborted,\n timestamp: Date.now(),\n };\n\n if (context.aborted) {\n metrics.error = context.abortReason;\n this.events.emit('action:abort', {\n action,\n payload,\n reason: context.abortReason,\n });\n } else {\n this.events.emit('action:complete', {\n action,\n payload,\n metrics,\n });\n }\n\n this.logger.debug(`Completed action '${String(action)}'`, metrics);\n\n } catch (error: any) {\n const metrics: ActionMetrics = {\n action: String(action),\n executionTime: Date.now() - startTime,\n handlerCount: context.handlers.length,\n success: false,\n error: error.message || 'Unknown error',\n timestamp: Date.now(),\n };\n\n this.logger.error(`Error executing action '${String(action)}'`, metrics);\n \n this.events.emit('action:error', {\n action,\n payload,\n error: error instanceof Error ? error : new Error(String(error)),\n });\n\n throw error;\n }\n };\n\n /**\n * Execute the pipeline with proper flow control\n * @internal\n */\n private async executePipeline<K extends keyof T>(context: PipelineContext<T[K]>): Promise<void> {\n this.logger.trace(`Starting pipeline execution`, {\n action: context.action,\n handlerCount: context.handlers.length,\n executionMode: context.executionMode,\n payload: context.payload\n });\n\n // Create controller factory for handlers\n const createController = (registration: HandlerRegistration<T[K]>, _index: number): PipelineController<T[K]> => {\n return {\n next: () => {\n // Next is called automatically after handler completion\n },\n abort: (reason?: string) => {\n this.logger.trace(`Handler '${registration.id}' is aborting pipeline`, { reason });\n context.aborted = true;\n context.abortReason = reason;\n this.logger.warn(`Pipeline aborted by handler '${registration.id}'`, { reason });\n },\n modifyPayload: (modifier: (payload: T[K]) => T[K]) => {\n this.logger.trace(`Handler '${registration.id}' is modifying payload`);\n const oldPayload = context.payload;\n context.payload = modifier(context.payload);\n this.logger.debug(`Payload modified by handler '${registration.id}'`);\n this.logger.trace(`Payload change`, { oldPayload, newPayload: context.payload });\n },\n getPayload: () => context.payload,\n jumpToPriority: (priority: number) => {\n this.logger.trace(`Handler '${registration.id}' jumping to priority ${priority}`);\n context.jumpToPriority = priority;\n },\n };\n };\n\n // Execute based on execution mode\n switch (context.executionMode) {\n case 'sequential':\n await executeSequential(context, createController, this.logger);\n break;\n case 'parallel':\n await executeParallel(context, createController, this.logger);\n break;\n case 'race':\n await executeRace(context, createController, this.logger);\n break;\n default:\n throw new Error(`Unknown execution mode: ${context.executionMode}`);\n }\n\n // Clean up one-time handlers after execution\n this.cleanupOneTimeHandlers(context.action as K, context.handlers);\n }\n\n /**\n * Clean up one-time handlers after pipeline execution\n * @internal\n */\n private cleanupOneTimeHandlers<K extends keyof T>(action: K, executedHandlers: HandlerRegistration<T[K]>[]): void {\n const pipeline = this.pipelines.get(action);\n if (!pipeline) return;\n\n const oneTimeHandlers = executedHandlers.filter(reg => reg.config.once);\n if (oneTimeHandlers.length === 0) return;\n\n this.logger.trace(`Cleaning up ${oneTimeHandlers.length} one-time handlers`);\n\n oneTimeHandlers.forEach(registration => {\n const index = pipeline.findIndex(reg => reg.id === registration.id);\n if (index !== -1) {\n pipeline.splice(index, 1);\n this.logger.debug(`Removed one-time handler '${registration.id}'`);\n }\n });\n\n this.logger.trace(`Pipeline now has ${pipeline.length} handlers`);\n }\n\n /**\n * Get the number of handlers registered for an action\n * @param action - The action to check\n * @returns Number of handlers registered\n */\n getHandlerCount<K extends keyof T>(action: K): number {\n const pipeline = this.pipelines.get(action);\n const count = pipeline ? pipeline.length : 0;\n this.logger.trace(`Handler count for '${String(action)}': ${count}`);\n return count;\n }\n\n /**\n * Check if any handlers are registered for an action\n * @param action - The action to check\n * @returns True if handlers are registered\n */\n hasHandlers<K extends keyof T>(action: K): boolean {\n const hasHandlers = this.getHandlerCount(action) > 0;\n this.logger.trace(`Has handlers for '${String(action)}': ${hasHandlers}`);\n return hasHandlers;\n }\n\n /**\n * Get all registered action names\n * @returns Array of action names\n */\n getRegisteredActions(): (keyof T)[] {\n const actions = Array.from(this.pipelines.keys());\n this.logger.trace(`Registered actions`, { actions, count: actions.length });\n return actions;\n }\n\n /**\n * Clear all handlers for a specific action\n * @param action - The action to clear\n */\n clearAction<K extends keyof T>(action: K): void {\n this.logger.trace(`Clearing handlers for action '${String(action)}'`);\n const pipeline = this.pipelines.get(action);\n if (pipeline) {\n const handlerCount = pipeline.length;\n this.pipelines.delete(action);\n this.logger.debug(`Cleared ${handlerCount} handlers for action '${String(action)}'`);\n this.logger.trace(`Action '${String(action)}' pipeline removed`);\n } else {\n this.logger.trace(`No pipeline found for action '${String(action)}' to clear`);\n }\n }\n\n /**\n * Clear all handlers for all actions\n */\n clearAll(): void {\n this.logger.trace(`Clearing all handlers and pipelines`);\n const actionCount = this.pipelines.size;\n const totalHandlers = Array.from(this.pipelines.values())\n .reduce((sum, pipeline) => sum + pipeline.length, 0);\n \n this.logger.trace(`Before clear`, { actionCount, totalHandlers });\n \n this.pipelines.clear();\n this.events.removeAllListeners();\n \n this.logger.info(`Cleared all handlers`, {\n actionCount,\n totalHandlers,\n });\n \n this.logger.trace(`All pipelines and event listeners cleared`);\n }\n\n /**\n * Add event listener for ActionRegister events\n * @param event - Event name to listen for\n * @param handler - Event handler function\n * @returns Unregister function to remove the listener\n */\n on<K extends keyof ActionRegisterEvents<T>>(\n event: K,\n handler: EventHandler<ActionRegisterEvents<T>[K]>\n ): UnregisterFunction {\n return this.events.on(event, handler);\n }\n\n /**\n * Remove event listener\n * @param event - Event name\n * @param handler - Event handler to remove\n */\n off<K extends keyof ActionRegisterEvents<T>>(\n event: K,\n handler: EventHandler<ActionRegisterEvents<T>[K]>\n ): void {\n this.events.off(event, handler);\n }\n\n /**\n * Get current configuration\n * @returns Current ActionRegister configuration\n */\n getConfig(): Readonly<Required<ActionRegisterConfig>> {\n return { ...this.config };\n }\n\n /**\n * Get logger instance\n * @returns Current logger instance\n */\n getLogger(): Logger {\n return this.logger;\n }\n}"],"x_google_ignoreList":[1,2,3,4],"mappings":";;;;;;;;;;;;;;;;;;;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MAAM,CAAC,QAAQ,EAAE,aAAa,sBAAsB,EAAE,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;GACpF,KAAK,OAAO,MAAM,CAAC,QAAQ,EAAE,OAAO,OAAO,CAAC,kBAAkB,CAAC,CAAC;EACjE,OACC,KAAK,OAAO,MAAM,CAAC,8BAA8B,EAAE,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC;CAEjF;;;;CAKD,WAAiB;EACf,KAAK,OAAO,MAAM,CAAC,mCAAmC,CAAC,CAAC;EACxD,MAAM,cAAc,KAAK,UAAU;EACnC,MAAM,gBAAgB,MAAM,KAAK,KAAK,UAAU,QAAQ,CAAC,CACtD,OAAO,CAAC,KAAK,aAAa,MAAM,SAAS,QAAQ,EAAE;EAEtD,KAAK,OAAO,MAAM,CAAC,YAAY,CAAC,EAAE;GAAE;GAAa;EAAe,EAAC;EAEjE,KAAK,UAAU,OAAO;EACtB,KAAK,OAAO,oBAAoB;EAEhC,KAAK,OAAO,KAAK,CAAC,oBAAoB,CAAC,EAAE;GACvC;GACA;EACD,EAAC;EAEF,KAAK,OAAO,MAAM,CAAC,yCAAyC,CAAC,CAAC;CAC/D;;;;;;;CAQD,GACEL,OACAkB,SACoB;AACpB,SAAO,KAAK,OAAO,GAAG,OAAO,QAAQ;CACtC;;;;;;CAOD,IACElB,OACAkB,SACM;EACN,KAAK,OAAO,IAAI,OAAO,QAAQ;CAChC;;;;;CAMD,YAAsD;AACpD,SAAO,EAAE,GAAG,KAAK,OAAQ;CAC1B;;;;;CAMD,YAAoB;AAClB,SAAO,KAAK;CACb;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["context: PipelineContext<T, R>","createController: (registration: HandlerRegistration<T, R>, index: number) => PipelineController<T, R>","error: any","handlerResult: R | undefined","_typeof","o","_typeof","toPrimitive","toPropertyKey","_defineProperty","actionKey: string","debounceMs: number","throttleMs: number","config: ActionRegisterConfig","action: K","handler: ActionHandler<T[K], R>","config: HandlerConfig","registration: HandlerRegistration<T[K], R>","payload?: T[K]","options?: import('./types.js').DispatchOptions","autoAbortController: AbortController | undefined","abortHandler","throttleMs: number | undefined","debounceMs: number | undefined","context: PipelineContext<T[K], any>","context: PipelineContext<T[K], R>","executionError: Error | undefined","handlerResults: Array<{\n id: string;\n executed: boolean;\n duration?: number;\n result?: R;\n error?: Error;\n metadata?: Record<string, any>;\n }>","errors: Array<{\n handlerId: string;\n error: Error;\n timestamp: number;\n }>","executionResult: ExecutionResult<R>","handlers: HandlerRegistration<T[K], any>[]","filterOptions?: import('./types.js').DispatchOptions['filter']","context: PipelineContext<any, R>","resultOptions?: import('./types.js').DispatchOptions['result']","autoAbortController?: AbortController","autoAbortOptions?: { allowHandlerAbort?: boolean }","_registration: HandlerRegistration<T[K], any>","_index: number","reason?: string","modifier: (payload: T[K]) => T[K]","priority: number","result: any","merger: (previousResults: any[], currentResult: any) => any","executedHandlers: HandlerRegistration<T[K], any>[]","success: boolean","duration: number","tag: string","category: string","mode: ExecutionMode"],"sources":["../src/execution-modes.ts","../../../node_modules/.pnpm/@oxc-project+runtime@0.81.0/node_modules/@oxc-project/runtime/src/helpers/typeof.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.81.0/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.81.0/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.81.0/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js","../src/action-guard.ts","../src/ActionRegister.ts"],"sourcesContent":["/**\n * @fileoverview Execution mode implementations for ActionRegister\n * Provides different execution strategies for action pipelines\n */\n\nimport type { \n HandlerRegistration, \n PipelineContext, \n PipelineController\n} from './types.js';\n\n/**\n * Execute handlers in sequential mode (one after another)\n */\nexport async function executeSequential<T, R = void>(\n context: PipelineContext<T, R>,\n createController: (registration: HandlerRegistration<T, R>, index: number) => PipelineController<T, R>\n): Promise<void> {\n\n let i = 0;\n \n while (i < context.handlers.length) {\n // Check for abort or termination\n if (context.aborted || context.terminated) {\n break;\n }\n\n const registration = context.handlers[i];\n context.currentIndex = i;\n\n /** Check condition if provided */\n if (registration.config.condition && !registration.config.condition()) {\n i++;\n continue;\n }\n\n /** Check validation if provided */\n if (registration.config.validation && !registration.config.validation(context.payload)) {\n i++;\n continue;\n }\n\n const controller = createController(registration, i);\n\n try {\n // Check for abort before executing handler\n if (context.aborted) {\n break;\n }\n \n const result = registration.handler(context.payload, controller);\n\n /** Wait for async handlers if they're blocking */\n if (registration.config.blocking && result instanceof Promise) {\n const handlerResult = await result;\n \n /** Collect result if handler returned something and wasn't terminated */\n if (handlerResult !== undefined && !context.terminated) {\n context.results.push(handlerResult);\n }\n } else if (result !== undefined && !context.terminated) {\n /** Collect synchronous result */\n if (result instanceof Promise) {\n // Non-blocking async handler - don't wait but collect result when resolved\n result.then(asyncResult => {\n if (asyncResult !== undefined && !context.terminated) {\n context.results.push(asyncResult);\n }\n }).catch(() => {\n // Ignore errors from non-blocking handlers\n });\n } else {\n context.results.push(result);\n }\n }\n\n /** Check if pipeline was terminated by controller.return() */\n if (context.terminated) {\n break;\n }\n\n /** Handle jump to priority AFTER handler execution */\n if (context.jumpToPriority !== undefined) {\n const jumpIndex = context.handlers.findIndex(\n handler => handler.config.priority === context.jumpToPriority\n );\n \n if (jumpIndex !== -1) {\n // Jump to the target index directly (position movement)\n i = jumpIndex;\n context.jumpToPriority = undefined;\n continue; // Continue to execute the handler at jump destination\n } else {\n // Invalid jump target, clear and continue normally\n context.jumpToPriority = undefined;\n i++;\n }\n } else {\n // Normal progression to next handler\n i++;\n }\n\n } catch (error: any) {\n if (registration.config.blocking) {\n throw error;\n }\n // For non-blocking handlers, continue to next handler\n i++;\n }\n }\n}\n\n/**\n * Execute handlers in parallel mode (all at once)\n */\nexport async function executeParallel<T, R = void>(\n context: PipelineContext<T, R>,\n createController: (registration: HandlerRegistration<T, R>, index: number) => PipelineController<T, R>\n): Promise<void> {\n\n /** Filter handlers that should run */\n const runnableHandlers = context.handlers.filter((registration, _index) => {\n /** Check condition */\n if (registration.config.condition && !registration.config.condition()) {\n return false;\n }\n\n /** Check validation */\n if (registration.config.validation && !registration.config.validation(context.payload)) {\n return false;\n }\n\n return true;\n });\n\n /** Create promises for all handlers */\n const handlerPromises = runnableHandlers.map(async (registration, _index) => {\n const controller = createController(registration, _index);\n \n try {\n const result = registration.handler(context.payload, controller);\n \n let handlerResult: R | undefined;\n if (result instanceof Promise) {\n handlerResult = await result;\n } else {\n handlerResult = result;\n }\n \n /** Collect result if handler returned something and pipeline wasn't terminated */\n if (handlerResult !== undefined && !context.terminated) {\n context.results.push(handlerResult);\n }\n \n return { \n success: true, \n handlerId: registration.id, \n result: handlerResult,\n terminated: context.terminated \n };\n \n } catch (error: any) {\n if (registration.config.blocking) {\n throw error;\n }\n \n return { success: false, handlerId: registration.id, error };\n }\n });\n\n /** Wait for all handlers to complete */\n const results = await Promise.allSettled(handlerPromises);\n \n /** Check for any rejected blocking handlers */\n const failures = results.filter((result, index) => {\n if (result.status === 'rejected') {\n const registration = runnableHandlers[index];\n return registration.config.blocking;\n }\n return false;\n });\n\n if (failures.length > 0) {\n const firstFailure = failures[0] as PromiseRejectedResult;\n throw firstFailure.reason;\n }\n\n /** Check if any handler terminated the pipeline */\n const terminatedResults = results.filter(result => \n result.status === 'fulfilled' && result.value.terminated\n );\n \n if (terminatedResults.length > 0) {\n context.terminated = true;\n // In parallel mode, we can't determine which handler's termination result to use,\n // so we use the first one that terminated\n const firstTerminated = terminatedResults[0] as PromiseFulfilledResult<any>;\n context.terminationResult = firstTerminated.value.result;\n }\n}\n\n/**\n * Execute handlers in race mode (first to complete wins)\n */\nexport async function executeRace<T, R = void>(\n context: PipelineContext<T, R>,\n createController: (registration: HandlerRegistration<T, R>, index: number) => PipelineController<T, R>\n): Promise<void> {\n\n /** Filter handlers that should run */\n const runnableHandlers = context.handlers.filter((registration, _index) => {\n /** Check condition */\n if (registration.config.condition && !registration.config.condition()) {\n return false;\n }\n\n /** Check validation */\n if (registration.config.validation && !registration.config.validation(context.payload)) {\n return false;\n }\n\n return true;\n });\n\n if (runnableHandlers.length === 0) {\n return;\n }\n\n /** Create promises for all handlers */\n const handlerPromises = runnableHandlers.map(async (registration, _index) => {\n const controller = createController(registration, _index);\n \n try {\n const result = registration.handler(context.payload, controller);\n \n let handlerResult: R | undefined;\n if (result instanceof Promise) {\n handlerResult = await result;\n } else {\n handlerResult = result;\n }\n \n return { \n success: true, \n handlerId: registration.id, \n registration,\n result: handlerResult,\n terminated: context.terminated\n };\n \n } catch (error: any) {\n return { success: false, handlerId: registration.id, error, registration };\n }\n });\n\n /** Race all handlers */\n const winner = await Promise.race(handlerPromises);\n\n /** If the winner failed and was blocking, throw the error */\n if (!winner.success && winner.registration?.config.blocking) {\n throw winner.error;\n }\n\n /** Collect result from the winning handler */\n if (winner.success && winner.result !== undefined) {\n context.results.push(winner.result);\n }\n\n /** Check if the winning handler terminated the pipeline */\n if (winner.success && winner.terminated) {\n context.terminated = true;\n context.terminationResult = winner.result;\n }\n}","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"./typeof.js\")[\"default\"];\nvar toPrimitive = require(\"./toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var toPropertyKey = require(\"./toPropertyKey.js\");\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","/**\n * @fileoverview Action Guard system for debouncing, throttling and blocking\n * Provides rate limiting and user experience optimization for actions\n */\n\n\n/**\n * Action guard state tracking for debouncing and throttling\n * @memberof core-concepts\n * @internal\n * @since 1.0.0\n * \n * Tracks timing and execution state for action execution control\n */\ninterface GuardState {\n /** Timestamp of last successful execution for throttling calculations */\n lastExecuted: number;\n \n /** Active debounce timer - cleared when new debounce requests arrive */\n debounceTimer?: NodeJS.Timeout;\n \n /** Active throttle timer - tracks when throttle period will end */\n throttleTimer?: NodeJS.Timeout;\n \n /** Flag indicating if action is currently in throttled state */\n isThrottled: boolean;\n}\n\n/**\n * Action Guard system for managing action execution timing\n * @implements action-guard\n * @implements performance-optimization \n * @implements user-experience-optimization\n * @implements class-naming\n * @memberof core-concepts\n * @internal\n * @since 1.0.0\n * \n * Manages action execution timing through debouncing and throttling\n * @implements performance-optimization\n * \n * @example\n * ```typescript\n * const guard = new ActionGuard(logger);\n * \n * // Debounce search input (wait 300ms after typing stops)\n * if (await guard.debounce('search', 300)) {\n * executeSearch(); \n * }\n * \n * // Throttle scroll handler (max once per 100ms)\n * if (guard.throttle('scroll', 100)) {\n * updateScrollPosition();\n * }\n * ```\n */\nexport class ActionGuard {\n private guards = new Map<string, GuardState>();\n\n constructor() {\n // ActionGuard without logger\n }\n\n /**\n * Check if action should be debounced\n * @param actionKey - Unique key for the action\n * @param debounceMs - Debounce delay in milliseconds\n * @returns Promise that resolves when debounce period is complete\n */\n async debounce(actionKey: string, debounceMs: number): Promise<boolean> {\n\n /** Get or create guard state for this action */\n let state = this.guards.get(actionKey);\n if (!state) {\n /** Initialize new guard state with default values */\n state = {\n lastExecuted: 0,\n isThrottled: false\n };\n this.guards.set(actionKey, state);\n }\n\n /** Clear any existing debounce timer to restart the delay period */\n /** This implements the \"debounce\" behavior where rapid calls reset the timer */\n if (state.debounceTimer) {\n clearTimeout(state.debounceTimer);\n }\n\n /** Create new debounce promise that resolves after the delay period */\n /** The promise will only resolve if no new debounce requests arrive */\n return new Promise((resolve) => {\n state!.debounceTimer = setTimeout(() => {\n /** Clean up timer reference to prevent memory leaks */\n state!.debounceTimer = undefined;\n /** Update last execution timestamp for throttling calculations */\n state!.lastExecuted = Date.now();\n resolve(true);\n }, debounceMs);\n \n });\n }\n\n /**\n * Check if action should be throttled\n * @param actionKey - Unique key for the action\n * @param throttleMs - Throttle delay in milliseconds\n * @returns True if action should proceed, false if throttled\n */\n throttle(actionKey: string, throttleMs: number): boolean {\n\n /** Get or create guard state for this action */\n let state = this.guards.get(actionKey);\n if (!state) {\n /** Initialize new guard state with default values */\n state = {\n lastExecuted: 0,\n isThrottled: false\n };\n this.guards.set(actionKey, state);\n }\n\n const now = Date.now();\n const timeSinceLastExecution = now - state.lastExecuted;\n\n /** Check if enough time has passed since last execution */\n /** If throttle period has elapsed, allow immediate execution */\n if (timeSinceLastExecution >= throttleMs) {\n /** Update execution timestamp and clear throttled state */\n state.lastExecuted = now;\n state.isThrottled = false;\n \n \n return true;\n }\n\n /** If already in throttled state, don't create duplicate timers */\n /** This prevents timer accumulation and unnecessary processing */\n if (state.isThrottled) {\n return false;\n }\n\n /** Set throttle timer to automatically clear the throttled state */\n /** Calculate remaining time until throttle period expires */\n state.isThrottled = true;\n const remainingTime = throttleMs - timeSinceLastExecution;\n \n /** Create timer to reset throttled state when period expires */\n state.throttleTimer = setTimeout(() => {\n /** Clear throttled state and timer reference */\n state!.isThrottled = false;\n state!.throttleTimer = undefined;\n }, remainingTime);\n\n\n return false;\n }\n\n /**\n * Clear all guards for an action\n * @param actionKey - Action key to clear\n */\n clearGuards(actionKey: string): void {\n \n const state = this.guards.get(actionKey);\n if (state) {\n /** Clear debounce timer if active to prevent memory leaks */\n if (state.debounceTimer) {\n clearTimeout(state.debounceTimer);\n }\n /** Clear throttle timer if active to prevent memory leaks */\n if (state.throttleTimer) {\n clearTimeout(state.throttleTimer);\n }\n /** Remove guard state from memory */\n this.guards.delete(actionKey);\n \n }\n }\n\n /**\n * Clear all guards\n */\n clearAll(): void {\n \n /** Iterate through all guard states and clear their timers */\n /** This prevents memory leaks when clearing the entire guard system */\n for (const [, state] of this.guards) {\n /** Clear any active debounce timers */\n if (state.debounceTimer) {\n clearTimeout(state.debounceTimer);\n }\n /** Clear any active throttle timers */\n if (state.throttleTimer) {\n clearTimeout(state.throttleTimer);\n }\n }\n \n /** Remove all guard states from memory */\n this.guards.clear();\n }\n\n /**\n * Get current guard state for debugging\n * @param actionKey - Action key to inspect\n */\n getGuardState(actionKey: string): GuardState | undefined {\n return this.guards.get(actionKey);\n }\n\n /**\n * Get all active guards for debugging\n */\n getAllGuardStates(): Map<string, GuardState> {\n return new Map(this.guards);\n }\n}","\nimport {\n ActionPayloadMap,\n ActionHandler,\n HandlerConfig,\n HandlerRegistration,\n PipelineContext,\n PipelineController,\n ActionRegisterConfig,\n UnregisterFunction,\n ExecutionMode,\n ExecutionResult,\n ActionRegistryInfo,\n ActionHandlerStats,\n} from './types.js';\nimport { executeSequential, executeParallel, executeRace } from './execution-modes.js';\nimport { ActionGuard } from './action-guard.js';\n\n/**\n * 중앙화된 액션 등록 및 디스패치 시스템으로, 타입 안전한 액션 파이프라인 관리를 제공하는 핵심 클래스입니다.\n * \n * @implements {ActionRegister}\n * @implements {Action Pipeline System}\n * @memberof core-concepts\n * \n * @example\n * ```typescript\n * interface AppActions extends ActionPayloadMap {\n * updateUser: { id: string; name: string };\n * calculateTotal: void;\n * }\n * \n * const register = new ActionRegister<AppActions>({\n * name: 'AppRegister',\n * logLevel: LogLevel.DEBUG\n * });\n * \n * // 핸들러 등록\n * register.register('updateUser', ({ id, name }, controller) => {\n * userStore.setValue({ id, name });\n * controller.next();\n * }, { priority: 10 });\n * \n * // 액션 디스패치\n * await register.dispatch('updateUser', { id: '1', name: 'John' });\n * ```\n */\nexport class ActionRegister<T extends ActionPayloadMap = ActionPayloadMap> {\n private pipelines = new Map<keyof T, HandlerRegistration<any, any>[]>();\n private handlerCounter = 0;\n private readonly actionGuard: ActionGuard;\n private executionMode: ExecutionMode = 'sequential';\n private actionExecutionModes = new Map<keyof T, ExecutionMode>();\n public readonly name: string;\n private readonly registryConfig: ActionRegisterConfig['registry'];\n private executionStats = new Map<keyof T, {\n totalExecutions: number;\n totalDuration: number;\n successCount: number;\n errorCount: number;\n }>();\n\n constructor(config: ActionRegisterConfig = {}) {\n this.name = config.name || 'ActionRegister';\n this.registryConfig = config.registry;\n this.actionGuard = new ActionGuard();\n \n if (this.registryConfig?.defaultExecutionMode) {\n this.executionMode = this.registryConfig.defaultExecutionMode;\n }\n \n if (this.registryConfig?.debug && process.env.NODE_ENV === 'development') {\n console.log(`🎯 ActionRegister created: ${this.name}`, {\n defaultExecutionMode: this.executionMode,\n maxHandlers: this.registryConfig.maxHandlers,\n autoCleanup: this.registryConfig.autoCleanup ?? true\n });\n }\n }\n\n register<K extends keyof T, R = void>(\n action: K,\n handler: ActionHandler<T[K], R>,\n config: HandlerConfig = {}\n ): UnregisterFunction {\n \n // Generate unique handler ID with security consideration\n // Use counter + random suffix to prevent ID prediction attacks\n const handlerId = config.id || `handler_${++this.handlerCounter}_${Math.random().toString(36).substr(2, 5)}`;\n \n // Create handler registration with defaults\n const registration: HandlerRegistration<T[K], R> = {\n handler,\n config: {\n // Existing fields\n priority: config.priority ?? 0,\n id: handlerId,\n blocking: config.blocking ?? false,\n once: config.once ?? false,\n condition: config.condition || (() => true),\n debounce: config.debounce ?? undefined,\n throttle: config.throttle ?? undefined,\n validation: config.validation ?? undefined,\n middleware: config.middleware ?? false,\n \n // New metadata fields\n tags: config.tags ?? [],\n category: config.category ?? undefined,\n description: config.description ?? undefined,\n version: config.version ?? undefined,\n returnType: config.returnType ?? 'value',\n timeout: config.timeout ?? undefined,\n retries: config.retries ?? 0,\n dependencies: config.dependencies ?? [],\n conflicts: config.conflicts ?? [],\n environment: config.environment ?? undefined,\n feature: config.feature ?? undefined,\n metrics: config.metrics ?? {\n collectTiming: false,\n collectErrors: false,\n customMetrics: {}\n },\n metadata: config.metadata ?? {},\n } as Required<HandlerConfig>,\n id: handlerId,\n };\n \n // Initialize pipeline if it doesn't exist\n if (!this.pipelines.has(action)) {\n this.pipelines.set(action, []);\n }\n\n const pipeline = this.pipelines.get(action)!;\n \n // Check for duplicate handler IDs and prevent duplicate registration\n const existingIndex = pipeline.findIndex(reg => reg.id === handlerId);\n if (existingIndex !== -1) {\n // Return a no-op unregister function for the duplicate\n return () => {};\n }\n \n // Check maximum handlers limit\n if (this.registryConfig?.maxHandlers && pipeline.length >= this.registryConfig.maxHandlers) {\n throw new Error(\n `Maximum number of handlers (${this.registryConfig.maxHandlers}) reached for action '${String(action)}' in registry '${this.name}'`\n );\n }\n\n // Add handler to pipeline\n pipeline.push(registration);\n \n // Sort pipeline by priority (highest first)\n pipeline.sort((a, b) => b.config.priority - a.config.priority);\n \n if (this.registryConfig?.debug && process.env.NODE_ENV === 'development') {\n console.log(`🎯 Handler registered: ${String(action)}`, {\n handlerId,\n priority: config.priority,\n tags: config.tags,\n category: config.category,\n totalHandlers: pipeline.length,\n registry: this.name\n });\n }\n\n // Return unregister function that removes this specific registration\n return () => {\n const index = pipeline.findIndex((reg) => reg.id === handlerId && reg === registration);\n if (index !== -1) {\n pipeline.splice(index, 1);\n \n if (this.registryConfig?.debug && process.env.NODE_ENV === 'development') {\n console.log(`🎯 Handler unregistered: ${String(action)}`, {\n handlerId,\n remainingHandlers: pipeline.length,\n registry: this.name\n });\n }\n }\n };\n }\n\n async dispatch<K extends keyof T>(\n action: K,\n payload?: T[K],\n options?: import('./types.js').DispatchOptions\n ): Promise<void> {\n // Auto-abort: Create AbortController if enabled\n let autoAbortController: AbortController | undefined;\n let effectiveSignal = options?.signal;\n \n if (options?.autoAbort?.enabled) {\n autoAbortController = new AbortController();\n effectiveSignal = autoAbortController.signal;\n \n // Provide access to the created controller\n if (options.autoAbort.onControllerCreated) {\n options.autoAbort.onControllerCreated(autoAbortController);\n }\n \n // If original signal exists, link them together\n if (options?.signal) {\n const originalSignal = options.signal;\n if (originalSignal.aborted) {\n autoAbortController.abort();\n } else {\n const abortHandler = () => autoAbortController!.abort();\n originalSignal.addEventListener('abort', abortHandler, { once: true });\n }\n }\n }\n \n // Check if dispatch is aborted before starting\n if (effectiveSignal?.aborted) {\n return;\n }\n \n const pipeline = this.pipelines.get(action);\n if (!pipeline || pipeline.length === 0) {\n return;\n }\n\n // Apply handler filtering first\n const filteredHandlers = this.filterHandlers([...pipeline], options?.filter);\n\n // Apply ActionGuard controls - check both dispatch options and handler configs\n const actionKey = String(action);\n \n // Get throttle/debounce settings from dispatch options or handler configs\n let throttleMs: number | undefined;\n let debounceMs: number | undefined;\n \n // Priority: dispatch options > handler config\n if (options?.throttle !== undefined) {\n throttleMs = options.throttle;\n } else if (filteredHandlers.length > 0) {\n // Use throttle from the first handler that has it (handlers are sorted by priority)\n for (const handler of filteredHandlers) {\n if (handler.config.throttle !== undefined) {\n throttleMs = handler.config.throttle;\n break;\n }\n }\n }\n \n if (options?.debounce !== undefined) {\n debounceMs = options.debounce;\n } else if (filteredHandlers.length > 0) {\n // Use debounce from the first handler that has it (handlers are sorted by priority)\n for (const handler of filteredHandlers) {\n if (handler.config.debounce !== undefined) {\n debounceMs = handler.config.debounce;\n break;\n }\n }\n }\n \n // Apply debounce if specified\n if (debounceMs !== undefined) {\n const shouldProceed = await this.actionGuard.debounce(actionKey, debounceMs);\n if (!shouldProceed) {\n return; // Debounced - don't execute\n }\n }\n \n // Apply throttle if specified\n if (throttleMs !== undefined) {\n const shouldProceed = this.actionGuard.throttle(actionKey, throttleMs);\n if (!shouldProceed) {\n return; // Throttled - don't execute\n }\n }\n\n // Determine execution mode for this action (with option override)\n const currentExecutionMode = options?.executionMode || \n this.actionExecutionModes.get(action) || \n this.executionMode;\n\n // Create pipeline execution context\n const context: PipelineContext<T[K], any> = {\n action: String(action),\n payload: payload as T[K],\n handlers: filteredHandlers, // Use filtered handlers\n aborted: false,\n abortReason: undefined,\n currentIndex: 0,\n jumpToPriority: undefined,\n executionMode: currentExecutionMode,\n \n // New result collection fields\n results: [],\n terminated: false,\n terminationResult: undefined,\n };\n\n const startTime = Date.now();\n let executionSuccess = true;\n \n // Add abort listener if signal provided (use effectiveSignal for auto-abort)\n const abortHandler = effectiveSignal ? () => {\n context.aborted = true;\n context.abortReason = 'Action dispatch aborted by signal';\n } : undefined;\n \n if (effectiveSignal && abortHandler) {\n effectiveSignal.addEventListener('abort', abortHandler);\n }\n \n try {\n await this.executePipeline(context, autoAbortController, options?.autoAbort);\n } catch (error) {\n executionSuccess = false;\n throw error;\n } finally {\n // Clean up abort listener\n if (effectiveSignal && abortHandler) {\n effectiveSignal.removeEventListener('abort', abortHandler);\n }\n // Track execution statistics\n const duration = Date.now() - startTime;\n this.updateExecutionStats(action, executionSuccess, duration);\n }\n }\n\n async dispatchWithResult<K extends keyof T, R = void>(\n action: K,\n payload?: T[K],\n options?: import('./types.js').DispatchOptions\n ): Promise<ExecutionResult<R>> {\n const startTime = Date.now();\n \n // Auto-abort: Create AbortController if enabled (same as dispatch)\n let autoAbortController: AbortController | undefined;\n let effectiveSignal = options?.signal;\n \n if (options?.autoAbort?.enabled) {\n autoAbortController = new AbortController();\n effectiveSignal = autoAbortController.signal;\n \n // Provide access to the created controller\n if (options.autoAbort.onControllerCreated) {\n options.autoAbort.onControllerCreated(autoAbortController);\n }\n \n // If original signal exists, link them together\n if (options?.signal) {\n const originalSignal = options.signal;\n if (originalSignal.aborted) {\n autoAbortController.abort();\n } else {\n const abortHandler = () => autoAbortController!.abort();\n originalSignal.addEventListener('abort', abortHandler, { once: true });\n }\n }\n }\n \n // Check if dispatch is aborted before starting\n if (effectiveSignal?.aborted) {\n return {\n success: false,\n aborted: true,\n abortReason: 'Action dispatch aborted by signal',\n terminated: false,\n result: undefined,\n results: [],\n execution: {\n duration: 0,\n handlersExecuted: 0,\n handlersSkipped: 0,\n handlersFailed: 0,\n startTime,\n endTime: startTime,\n },\n handlers: [],\n errors: [],\n };\n }\n \n const pipeline = this.pipelines.get(action);\n \n if (!pipeline || pipeline.length === 0) {\n return {\n success: true,\n aborted: false,\n terminated: false,\n result: undefined,\n results: [],\n execution: {\n duration: 0,\n handlersExecuted: 0,\n handlersSkipped: 0,\n handlersFailed: 0,\n startTime,\n endTime: startTime,\n },\n handlers: [],\n errors: [],\n };\n }\n\n // Apply handler filtering first\n const filteredHandlers = this.filterHandlers([...pipeline], options?.filter);\n\n // Apply ActionGuard controls - check both dispatch options and handler configs\n const actionKey = String(action);\n \n // Get throttle/debounce settings from dispatch options or handler configs\n let throttleMs: number | undefined;\n let debounceMs: number | undefined;\n \n // Priority: dispatch options > handler config\n if (options?.throttle !== undefined) {\n throttleMs = options.throttle;\n } else if (filteredHandlers.length > 0) {\n // Use throttle from the first handler that has it (handlers are sorted by priority)\n for (const handler of filteredHandlers) {\n if (handler.config.throttle !== undefined) {\n throttleMs = handler.config.throttle;\n break;\n }\n }\n }\n \n if (options?.debounce !== undefined) {\n debounceMs = options.debounce;\n } else if (filteredHandlers.length > 0) {\n // Use debounce from the first handler that has it (handlers are sorted by priority)\n for (const handler of filteredHandlers) {\n if (handler.config.debounce !== undefined) {\n debounceMs = handler.config.debounce;\n break;\n }\n }\n }\n \n // Apply debounce if specified\n if (debounceMs !== undefined) {\n const shouldProceed = await this.actionGuard.debounce(actionKey, debounceMs);\n if (!shouldProceed) {\n return {\n success: false,\n aborted: true,\n abortReason: 'Debounced execution',\n terminated: false,\n result: undefined,\n results: [],\n execution: {\n duration: Date.now() - startTime,\n handlersExecuted: 0,\n handlersSkipped: pipeline.length,\n handlersFailed: 0,\n startTime,\n endTime: Date.now(),\n },\n handlers: [],\n errors: [],\n };\n }\n }\n \n // Apply throttle if specified\n if (throttleMs !== undefined) {\n const shouldProceed = this.actionGuard.throttle(actionKey, throttleMs);\n if (!shouldProceed) {\n return {\n success: false,\n aborted: true,\n abortReason: 'Throttled execution',\n terminated: false,\n result: undefined,\n results: [],\n execution: {\n duration: Date.now() - startTime,\n handlersExecuted: 0,\n handlersSkipped: pipeline.length,\n handlersFailed: 0,\n startTime,\n endTime: Date.now(),\n },\n handlers: [],\n errors: [],\n };\n }\n }\n\n // Determine execution mode for this action (with option override)\n const currentExecutionMode = options?.executionMode || \n this.actionExecutionModes.get(action) || \n this.executionMode;\n\n // Create pipeline execution context\n const context: PipelineContext<T[K], R> = {\n action: String(action),\n payload: payload as T[K],\n handlers: filteredHandlers,\n aborted: false,\n abortReason: undefined,\n currentIndex: 0,\n jumpToPriority: undefined,\n executionMode: currentExecutionMode,\n \n // Result collection fields\n results: [],\n terminated: false,\n terminationResult: undefined,\n };\n\n let executionError: Error | undefined;\n const handlerResults: Array<{\n id: string;\n executed: boolean;\n duration?: number;\n result?: R;\n error?: Error;\n metadata?: Record<string, any>;\n }> = [];\n\n const errors: Array<{\n handlerId: string;\n error: Error;\n timestamp: number;\n }> = [];\n\n // Add abort listener if signal provided (use effectiveSignal for auto-abort)\n const abortHandler = effectiveSignal ? () => {\n context.aborted = true;\n context.abortReason = 'Action dispatch aborted by signal';\n } : undefined;\n \n if (effectiveSignal && abortHandler) {\n effectiveSignal.addEventListener('abort', abortHandler);\n }\n \n try {\n await this.executePipeline(context, autoAbortController, options?.autoAbort);\n } catch (error) {\n executionError = error instanceof Error ? error : new Error(String(error));\n errors.push({\n handlerId: 'pipeline',\n error: executionError,\n timestamp: Date.now(),\n });\n } finally {\n // Clean up abort listener\n if (effectiveSignal && abortHandler) {\n effectiveSignal.removeEventListener('abort', abortHandler);\n }\n }\n\n const endTime = Date.now();\n const executionSuccess = !executionError && !context.aborted;\n \n // Track execution statistics\n this.updateExecutionStats(action, executionSuccess, endTime - startTime);\n\n // Process results based on options\n const processedResult = this.processResults(context, options?.result);\n\n // Build execution result\n const executionResult: ExecutionResult<R> = {\n success: !executionError && !context.aborted,\n aborted: context.aborted,\n abortReason: context.abortReason,\n terminated: context.terminated,\n result: processedResult,\n results: context.results,\n execution: {\n duration: endTime - startTime,\n handlersExecuted: context.currentIndex + (context.aborted ? 0 : 1),\n handlersSkipped: Math.max(0, filteredHandlers.length - (context.currentIndex + 1)),\n handlersFailed: errors.length,\n startTime,\n endTime,\n },\n handlers: handlerResults,\n errors,\n };\n\n /** Clean up one-time handlers after execution */\n this.cleanupOneTimeHandlers(action, context.handlers);\n\n return executionResult;\n }\n\n private filterHandlers<K extends keyof T>(\n handlers: HandlerRegistration<T[K], any>[],\n filterOptions?: import('./types.js').DispatchOptions['filter']\n ): HandlerRegistration<T[K], any>[] {\n if (!filterOptions) {\n return handlers;\n }\n\n return handlers.filter(registration => {\n const config = registration.config;\n\n // Check include filters\n if (filterOptions.tags && filterOptions.tags.length > 0) {\n const hasMatchingTag = filterOptions.tags.some(tag => config.tags.includes(tag));\n if (!hasMatchingTag) return false;\n }\n\n if (filterOptions.category && config.category !== filterOptions.category) {\n return false;\n }\n\n if (filterOptions.handlerIds && filterOptions.handlerIds.length > 0) {\n if (!filterOptions.handlerIds.includes(config.id)) {\n return false;\n }\n }\n\n if (filterOptions.environment && config.environment !== filterOptions.environment) {\n return false;\n }\n\n if (filterOptions.feature && config.feature !== filterOptions.feature) {\n return false;\n }\n\n // Check exclude filters\n if (filterOptions.excludeTags && filterOptions.excludeTags.length > 0) {\n const hasExcludedTag = filterOptions.excludeTags.some(tag => config.tags.includes(tag));\n if (hasExcludedTag) return false;\n }\n\n if (filterOptions.excludeCategory && config.category === filterOptions.excludeCategory) {\n return false;\n }\n\n if (filterOptions.excludeHandlerIds && filterOptions.excludeHandlerIds.length > 0) {\n if (filterOptions.excludeHandlerIds.includes(config.id)) {\n return false;\n }\n }\n\n // Custom filter\n if (filterOptions.custom && !filterOptions.custom(config)) {\n return false;\n }\n\n return true;\n });\n }\n\n private processResults<R>(\n context: PipelineContext<any, R>,\n resultOptions?: import('./types.js').DispatchOptions['result']\n ): R | undefined {\n if (!resultOptions || !resultOptions.collect) {\n return undefined;\n }\n\n const results = context.results;\n \n // Handle termination result\n if (context.terminated && context.terminationResult !== undefined) {\n return context.terminationResult;\n }\n\n // Apply maxResults limit\n const limitedResults = resultOptions.maxResults \n ? results.slice(0, resultOptions.maxResults)\n : results;\n\n if (limitedResults.length === 0) {\n return undefined;\n }\n\n // Process results based on strategy\n switch (resultOptions.strategy) {\n case 'first':\n return limitedResults[0];\n case 'last':\n return limitedResults[limitedResults.length - 1];\n case 'all':\n return limitedResults as unknown as R;\n case 'merge':\n if (resultOptions.merger) {\n return resultOptions.merger(limitedResults);\n }\n // Default merge: return last result\n return limitedResults[limitedResults.length - 1];\n case 'custom':\n if (resultOptions.merger) {\n return resultOptions.merger(limitedResults);\n }\n throw new Error('Custom result strategy requires a merger function');\n default:\n // Default: return all results\n return limitedResults as unknown as R;\n }\n }\n\n private async executePipeline<K extends keyof T>(\n context: PipelineContext<T[K], any>, \n autoAbortController?: AbortController,\n autoAbortOptions?: { allowHandlerAbort?: boolean }\n ): Promise<void> {\n const createController = (_registration: HandlerRegistration<T[K], any>, _index: number): PipelineController<T[K], any> => {\n return {\n next: () => {},\n abort: (reason?: string) => {\n context.aborted = true;\n context.abortReason = reason;\n \n // Auto-abort: Handler can trigger pipeline abort if enabled\n if (autoAbortController && autoAbortOptions?.allowHandlerAbort) {\n autoAbortController.abort(reason);\n }\n },\n modifyPayload: (modifier: (payload: T[K]) => T[K]) => {\n context.payload = modifier(context.payload);\n },\n getPayload: () => context.payload,\n jumpToPriority: (priority: number) => {\n context.jumpToPriority = priority;\n },\n return: (result: any) => {\n context.terminated = true;\n context.terminationResult = result;\n },\n setResult: (result: any) => {\n context.results.push(result);\n },\n getResults: () => {\n return [...context.results];\n },\n mergeResult: (merger: (previousResults: any[], currentResult: any) => any) => {\n const currentResult = context.results[context.results.length - 1];\n const previousResults = context.results.slice(0, -1);\n const mergedResult = merger(previousResults, currentResult);\n context.results[context.results.length - 1] = mergedResult;\n },\n };\n };\n\n switch (context.executionMode) {\n case 'sequential':\n await executeSequential<T[K], any>(context, createController);\n break;\n case 'parallel':\n await executeParallel<T[K], any>(context, createController);\n break;\n case 'race':\n await executeRace<T[K], any>(context, createController);\n break;\n default:\n throw new Error(`Unknown execution mode: ${context.executionMode}`);\n }\n\n this.cleanupOneTimeHandlers(context.action as K, context.handlers);\n }\n\n private cleanupOneTimeHandlers<K extends keyof T>(action: K, executedHandlers: HandlerRegistration<T[K], any>[]): void {\n const pipeline = this.pipelines.get(action);\n if (!pipeline) return;\n\n const oneTimeHandlers = executedHandlers.filter(reg => reg.config.once);\n if (oneTimeHandlers.length === 0) return;\n\n oneTimeHandlers.forEach(registration => {\n const index = pipeline.findIndex(reg => reg.id === registration.id);\n if (index !== -1) {\n pipeline.splice(index, 1);\n \n if (this.registryConfig?.debug && process.env.NODE_ENV === 'development') {\n console.log(`🎯 One-time handler removed: ${String(action)}`, {\n handlerId: registration.id,\n remainingHandlers: pipeline.length,\n registry: this.name\n });\n }\n }\n });\n }\n\n /**\n * Update execution statistics for an action\n * \n * @param action Action name\n * @param success Whether execution was successful\n * @param duration Execution duration in milliseconds\n */\n private updateExecutionStats<K extends keyof T>(action: K, success: boolean, duration: number): void {\n if (!this.executionStats.has(action)) {\n this.executionStats.set(action, {\n totalExecutions: 0,\n totalDuration: 0,\n successCount: 0,\n errorCount: 0,\n });\n }\n\n const stats = this.executionStats.get(action)!;\n stats.totalExecutions++;\n stats.totalDuration += duration;\n \n if (success) {\n stats.successCount++;\n } else {\n stats.errorCount++;\n }\n }\n\n getHandlerCount<K extends keyof T>(action: K): number {\n const pipeline = this.pipelines.get(action);\n return pipeline ? pipeline.length : 0;\n }\n\n hasHandlers<K extends keyof T>(action: K): boolean {\n return this.getHandlerCount(action) > 0;\n }\n\n getRegisteredActions(): (keyof T)[] {\n return Array.from(this.pipelines.keys());\n }\n\n clearAction<K extends keyof T>(action: K): void {\n this.pipelines.delete(action);\n }\n\n clearAll(): void {\n this.pipelines.clear();\n }\n\n getName(): string {\n return this.name;\n }\n\n /**\n * Get comprehensive registry information (similar to DeclarativeStoreRegistry pattern)\n * \n * @returns Registry information including actions, handlers, and execution modes\n */\n getRegistryInfo(): ActionRegistryInfo<T> {\n const totalHandlers = Array.from(this.pipelines.values()).reduce(\n (total, pipeline) => total + pipeline.length, \n 0\n );\n \n return {\n name: this.name,\n totalActions: this.pipelines.size,\n totalHandlers,\n registeredActions: Array.from(this.pipelines.keys()),\n actionExecutionModes: new Map(this.actionExecutionModes),\n defaultExecutionMode: this.executionMode,\n };\n }\n\n /**\n * Get detailed statistics for a specific action\n * \n * @param action Action name to get statistics for\n * @returns Detailed handler statistics\n */\n getActionStats<K extends keyof T>(action: K): ActionHandlerStats<T> | null {\n const pipeline = this.pipelines.get(action);\n if (!pipeline) {\n return null;\n }\n\n // Group handlers by priority\n const priorityMap = new Map<number, typeof pipeline>();\n pipeline.forEach(handler => {\n if (!priorityMap.has(handler.config.priority)) {\n priorityMap.set(handler.config.priority, []);\n }\n priorityMap.get(handler.config.priority)!.push(handler);\n });\n\n const handlersByPriority = Array.from(priorityMap.entries())\n .sort(([a], [b]) => b - a) // Sort by priority (highest first)\n .map(([priority, handlers]) => ({\n priority,\n handlers: handlers.map(h => ({\n id: h.config.id,\n tags: h.config.tags,\n category: h.config.category,\n description: h.config.description,\n version: h.config.version,\n }))\n }));\n\n // Get execution statistics if available\n const stats = this.executionStats.get(action);\n const executionStats = stats ? {\n totalExecutions: stats.totalExecutions,\n averageDuration: stats.totalExecutions > 0 ? stats.totalDuration / stats.totalExecutions : 0,\n successRate: stats.totalExecutions > 0 ? (stats.successCount / stats.totalExecutions) * 100 : 0,\n errorCount: stats.errorCount,\n } : undefined;\n\n return {\n action,\n handlerCount: pipeline.length,\n handlersByPriority,\n executionStats,\n };\n }\n\n /**\n * Get statistics for all registered actions\n * \n * @returns Array of statistics for all actions\n */\n getAllActionStats(): Array<ActionHandlerStats<T>> {\n return Array.from(this.pipelines.keys())\n .map(action => this.getActionStats(action))\n .filter((stats): stats is ActionHandlerStats<T> => stats !== null);\n }\n\n /**\n * Get handlers by tag across all actions\n * \n * @param tag Tag to filter handlers by\n * @returns Map of actions to handlers with the specified tag\n */\n getHandlersByTag(tag: string): Map<keyof T, HandlerRegistration<any, any>[]> {\n const result = new Map<keyof T, HandlerRegistration<any, any>[]>();\n \n for (const [action, pipeline] of this.pipelines.entries()) {\n const matchingHandlers = pipeline.filter(handler => \n handler.config.tags.includes(tag)\n );\n \n if (matchingHandlers.length > 0) {\n result.set(action, matchingHandlers);\n }\n }\n \n return result;\n }\n\n /**\n * Get handlers by category across all actions\n * \n * @param category Category to filter handlers by\n * @returns Map of actions to handlers with the specified category\n */\n getHandlersByCategory(category: string): Map<keyof T, HandlerRegistration<any, any>[]> {\n const result = new Map<keyof T, HandlerRegistration<any, any>[]>();\n \n for (const [action, pipeline] of this.pipelines.entries()) {\n const matchingHandlers = pipeline.filter(handler => \n handler.config.category === category\n );\n \n if (matchingHandlers.length > 0) {\n result.set(action, matchingHandlers);\n }\n }\n \n return result;\n }\n\n /**\n * Set execution mode for a specific action\n * \n * @param action Action name\n * @param mode Execution mode to set\n */\n setActionExecutionMode<K extends keyof T>(action: K, mode: ExecutionMode): void {\n this.actionExecutionModes.set(action, mode);\n \n if (this.registryConfig?.debug && process.env.NODE_ENV === 'development') {\n console.log(`🎯 Execution mode set for action '${String(action)}': ${mode}`);\n }\n }\n\n /**\n * Get execution mode for a specific action\n * \n * @param action Action name\n * @returns Execution mode for the action, or default if not set\n */\n getActionExecutionMode<K extends keyof T>(action: K): ExecutionMode {\n return this.actionExecutionModes.get(action) || this.executionMode;\n }\n\n /**\n * Remove execution mode override for a specific action\n * \n * @param action Action name\n */\n removeActionExecutionMode<K extends keyof T>(action: K): void {\n this.actionExecutionModes.delete(action);\n \n if (this.registryConfig?.debug && process.env.NODE_ENV === 'development') {\n console.log(`🎯 Execution mode reset for action '${String(action)}' to default: ${this.executionMode}`);\n }\n }\n\n /**\n * Clear execution statistics for all actions\n */\n clearExecutionStats(): void {\n this.executionStats.clear();\n \n if (this.registryConfig?.debug && process.env.NODE_ENV === 'development') {\n console.log(`🎯 Execution statistics cleared for registry: ${this.name}`);\n }\n }\n\n /**\n * Clear execution statistics for a specific action\n * \n * @param action Action name\n */\n clearActionExecutionStats<K extends keyof T>(action: K): void {\n this.executionStats.delete(action);\n \n if (this.registryConfig?.debug && process.env.NODE_ENV === 'development') {\n console.log(`🎯 Execution statistics cleared for action: ${String(action)}`);\n }\n }\n\n /**\n * Get registry configuration (for debugging and inspection)\n * \n * @returns Current registry configuration\n */\n getRegistryConfig(): ActionRegisterConfig['registry'] {\n return this.registryConfig;\n }\n\n /**\n * Check if registry has debug mode enabled\n * \n * @returns Whether debug mode is enabled\n */\n isDebugEnabled(): boolean {\n return Boolean(this.registryConfig?.debug && process.env.NODE_ENV === 'development');\n }\n}"],"x_google_ignoreList":[1,2,3,4],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,eAAsB,kBACpBA,SACAC,kBACe;CAEf,IAAI,IAAI;AAER,QAAO,IAAI,QAAQ,SAAS,QAAQ;AAElC,MAAI,QAAQ,WAAW,QAAQ,WAC7B;EAGF,MAAM,eAAe,QAAQ,SAAS;EACtC,QAAQ,eAAe;;AAGvB,MAAI,aAAa,OAAO,aAAa,CAAC,aAAa,OAAO,WAAW,EAAE;GACrE;AACA;EACD;;AAGD,MAAI,aAAa,OAAO,cAAc,CAAC,aAAa,OAAO,WAAW,QA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GED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@context-action/core",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Type-safe action pipeline management library for JavaScript/TypeScript",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -54,9 +54,6 @@
|
|
|
54
54
|
"url": "https://github.com/mineclover/context-action/issues"
|
|
55
55
|
},
|
|
56
56
|
"homepage": "https://github.com/mineclover/context-action#readme",
|
|
57
|
-
"dependencies": {
|
|
58
|
-
"@context-action/logger": "workspace:*"
|
|
59
|
-
},
|
|
60
57
|
"devDependencies": {
|
|
61
58
|
"@types/jest": "^29.5.0",
|
|
62
59
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|