@context-action/core 0.2.3 β 0.3.1
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 +31 -4
- package/dist/index.d.cts +15 -6
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +15 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -180,8 +180,10 @@ async function executeParallel(context, createController) {
|
|
|
180
180
|
try {
|
|
181
181
|
const result = registration.handler(context.payload, controller);
|
|
182
182
|
let handlerResult;
|
|
183
|
-
if (result instanceof Promise)
|
|
184
|
-
|
|
183
|
+
if (result instanceof Promise) {
|
|
184
|
+
const resolved = await result;
|
|
185
|
+
handlerResult = resolved;
|
|
186
|
+
} else handlerResult = result;
|
|
185
187
|
/** Collect result if handler returned something and pipeline wasn't terminated */
|
|
186
188
|
if (handlerResult !== void 0 && !context.terminated) context.results.push(handlerResult);
|
|
187
189
|
return {
|
|
@@ -290,8 +292,10 @@ async function executeRace(context, createController) {
|
|
|
290
292
|
try {
|
|
291
293
|
const result = registration.handler(context.payload, controller);
|
|
292
294
|
let handlerResult;
|
|
293
|
-
if (result instanceof Promise)
|
|
294
|
-
|
|
295
|
+
if (result instanceof Promise) {
|
|
296
|
+
const resolved = await result;
|
|
297
|
+
handlerResult = resolved;
|
|
298
|
+
} else handlerResult = result;
|
|
295
299
|
return {
|
|
296
300
|
success: true,
|
|
297
301
|
handlerId: registration.id,
|
|
@@ -1060,6 +1064,28 @@ var ActionRegister = class {
|
|
|
1060
1064
|
* π μ€μ λμ€ν¨μΉ μμ
μν (νμμ νΈμΆλ¨)
|
|
1061
1065
|
*/
|
|
1062
1066
|
async _performDispatch(action, payload, options) {
|
|
1067
|
+
if (payload && typeof payload === "object" && payload !== null && typeof process !== "undefined" && process.env?.NODE_ENV === "development") {
|
|
1068
|
+
payload instanceof Event;
|
|
1069
|
+
payload instanceof Element;
|
|
1070
|
+
payload.preventDefault;
|
|
1071
|
+
payload.stopPropagation;
|
|
1072
|
+
payload.currentTarget;
|
|
1073
|
+
const hasTarget = payload.target !== void 0;
|
|
1074
|
+
hasTarget && payload.target;
|
|
1075
|
+
hasTarget && payload.target instanceof Element;
|
|
1076
|
+
if (typeof process !== "undefined" && process.env?.DEBUG_CONTEXT_ACTION || typeof process !== "undefined" && process.env?.NODE_ENV === "development") {
|
|
1077
|
+
const nestedDOMProperties = [];
|
|
1078
|
+
Object.keys(payload).forEach((key) => {
|
|
1079
|
+
const prop = payload[key];
|
|
1080
|
+
if (prop instanceof Element || prop instanceof Event) nestedDOMProperties.push(`${key}: ${prop instanceof Element ? "Element" : "Event"}`);
|
|
1081
|
+
});
|
|
1082
|
+
if (nestedDOMProperties.length > 0) console.debug(`[Context-Action] π Nested DOM objects in action "${String(action)}":`, {
|
|
1083
|
+
registry: this.name,
|
|
1084
|
+
nestedDOMProperties,
|
|
1085
|
+
note: "This is informational - usually not a problem"
|
|
1086
|
+
});
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1063
1089
|
let autoAbortController;
|
|
1064
1090
|
let effectiveSignal = options?.signal;
|
|
1065
1091
|
if (options?.autoAbort?.enabled) {
|
|
@@ -1629,6 +1655,7 @@ var ActionRegister = class {
|
|
|
1629
1655
|
return {
|
|
1630
1656
|
action,
|
|
1631
1657
|
handlerCount: pipeline.length,
|
|
1658
|
+
totalHandlers: pipeline.length,
|
|
1632
1659
|
handlersByPriority,
|
|
1633
1660
|
executionStats
|
|
1634
1661
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -12,13 +12,13 @@ interface PipelineController<T = any, R = void> {
|
|
|
12
12
|
getResults(): R[];
|
|
13
13
|
mergeResult(merger: (previousResults: R[], currentResult: R) => R): void;
|
|
14
14
|
}
|
|
15
|
-
type ActionHandler<T = any, R = void> = (payload: T, controller: PipelineController<T, R>) => R | Promise<R>;
|
|
15
|
+
type ActionHandler<T = any, R = void> = (payload: T, controller: PipelineController<T, R>) => R | Promise<R> | void | Promise<void>;
|
|
16
16
|
interface HandlerConfig {
|
|
17
17
|
priority?: number;
|
|
18
18
|
id?: string;
|
|
19
19
|
blocking?: boolean;
|
|
20
20
|
once?: boolean;
|
|
21
|
-
condition?: () => boolean;
|
|
21
|
+
condition?: (payload?: any) => boolean;
|
|
22
22
|
debounce?: number;
|
|
23
23
|
throttle?: number;
|
|
24
24
|
validation?: (payload: any) => boolean;
|
|
@@ -66,6 +66,8 @@ interface ActionRegisterConfig {
|
|
|
66
66
|
debug?: boolean;
|
|
67
67
|
autoCleanup?: boolean;
|
|
68
68
|
maxHandlers?: number;
|
|
69
|
+
maxRetries?: number;
|
|
70
|
+
retryDelay?: number;
|
|
69
71
|
defaultExecutionMode?: ExecutionMode;
|
|
70
72
|
};
|
|
71
73
|
}
|
|
@@ -74,6 +76,8 @@ interface DispatchOptions {
|
|
|
74
76
|
throttle?: number;
|
|
75
77
|
executionMode?: ExecutionMode;
|
|
76
78
|
signal?: AbortSignal;
|
|
79
|
+
timeout?: number;
|
|
80
|
+
retries?: number;
|
|
77
81
|
autoAbort?: {
|
|
78
82
|
enabled: boolean;
|
|
79
83
|
onControllerCreated?: (controller: AbortController) => void;
|
|
@@ -92,7 +96,7 @@ interface DispatchOptions {
|
|
|
92
96
|
};
|
|
93
97
|
result?: {
|
|
94
98
|
strategy?: 'first' | 'last' | 'all' | 'merge' | 'custom';
|
|
95
|
-
merger?: <R>(results: R
|
|
99
|
+
merger?: <R>(results: Array<R | undefined>) => R;
|
|
96
100
|
collect?: boolean;
|
|
97
101
|
timeout?: number;
|
|
98
102
|
maxResults?: number;
|
|
@@ -104,7 +108,7 @@ interface ExecutionResult<R = void> {
|
|
|
104
108
|
abortReason?: string;
|
|
105
109
|
terminated: boolean;
|
|
106
110
|
result?: R;
|
|
107
|
-
results: R
|
|
111
|
+
results: Array<R | undefined>;
|
|
108
112
|
execution: {
|
|
109
113
|
duration: number;
|
|
110
114
|
handlersExecuted: number;
|
|
@@ -128,9 +132,12 @@ interface ExecutionResult<R = void> {
|
|
|
128
132
|
}>;
|
|
129
133
|
}
|
|
130
134
|
type UnregisterFunction = () => void;
|
|
135
|
+
type VoidActions<T extends ActionPayloadMap> = { [K in keyof T]: T[K] extends void | undefined ? K : never }[keyof T];
|
|
136
|
+
type PayloadActions<T extends ActionPayloadMap> = { [K in keyof T]: T[K] extends void | undefined ? never : K }[keyof T];
|
|
131
137
|
interface ActionDispatcher<T extends ActionPayloadMap> {
|
|
132
|
-
<K extends
|
|
133
|
-
<K extends
|
|
138
|
+
<K extends VoidActions<T>>(action: K, options?: DispatchOptions): Promise<void>;
|
|
139
|
+
<K extends VoidActions<T>>(action: K, payload?: undefined, options?: DispatchOptions): Promise<void>;
|
|
140
|
+
<K extends PayloadActions<T>>(action: K, payload: T[K], options?: DispatchOptions): Promise<void>;
|
|
134
141
|
}
|
|
135
142
|
interface ActionRegistryInfo<T extends ActionPayloadMap> {
|
|
136
143
|
name: string;
|
|
@@ -143,6 +150,8 @@ interface ActionRegistryInfo<T extends ActionPayloadMap> {
|
|
|
143
150
|
interface ActionHandlerStats<T extends ActionPayloadMap> {
|
|
144
151
|
action: keyof T;
|
|
145
152
|
handlerCount: number;
|
|
153
|
+
totalHandlers: number;
|
|
154
|
+
lastRegistered?: Date;
|
|
146
155
|
handlersByPriority: Array<{
|
|
147
156
|
priority: number;
|
|
148
157
|
handlers: Array<{
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/ActionRegister.ts","../src/action-guard.ts","../src/execution-modes.ts"],"sourcesContent":[],"mappings":";UAuCiB,gBAAA;EAAA,CAAA,UAAA,EAAA,MAAgB,CAAA,EAAA,OAAA;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/ActionRegister.ts","../src/action-guard.ts","../src/execution-modes.ts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IAAA,IAAA,CAAA,CAAA,OAAA,EG8ExB,eH9EwB,CG8ER,CH9EQ,EG8EL,CH9EK,CAAA,EAAA,gBAAA,EAAA,CAAA,YAAA,EG+EA,mBH/EA,CG+EoB,CH/EpB,EG+EuB,CH/EvB,CAAA,EAAA,KAAA,EAAA,MAAA,EAAA,GG+E6C,kBH/E7C,CG+EgE,CH/EhE,EG+EmE,CH/EnE,CAAA,CAAA,EGgFhC,OHhFgC,CAAA,IAAA,CAAA;AAAA,iBGyNb,WHzNa,CAAA,CAAA,EAAA,IAAA,IAAA,CAAA,CAAA,OAAA,EG0NxB,eH1NwB,CG0NR,CH1NQ,EG0NL,CH1NK,CAAA,EAAA,gBAAA,EAAA,CAAA,YAAA,EG2NA,mBH3NA,CG2NoB,CH3NpB,EG2NuB,CH3NvB,CAAA,EAAA,KAAA,EAAA,MAAA,EAAA,GG2N6C,kBH3N7C,CG2NgE,CH3NhE,EG2NmE,CH3NnE,CAAA,CAAA,EG4NhC,OH5NgC,CAAA,IAAA,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,13 +12,13 @@ interface PipelineController<T = any, R = void> {
|
|
|
12
12
|
getResults(): R[];
|
|
13
13
|
mergeResult(merger: (previousResults: R[], currentResult: R) => R): void;
|
|
14
14
|
}
|
|
15
|
-
type ActionHandler<T = any, R = void> = (payload: T, controller: PipelineController<T, R>) => R | Promise<R>;
|
|
15
|
+
type ActionHandler<T = any, R = void> = (payload: T, controller: PipelineController<T, R>) => R | Promise<R> | void | Promise<void>;
|
|
16
16
|
interface HandlerConfig {
|
|
17
17
|
priority?: number;
|
|
18
18
|
id?: string;
|
|
19
19
|
blocking?: boolean;
|
|
20
20
|
once?: boolean;
|
|
21
|
-
condition?: () => boolean;
|
|
21
|
+
condition?: (payload?: any) => boolean;
|
|
22
22
|
debounce?: number;
|
|
23
23
|
throttle?: number;
|
|
24
24
|
validation?: (payload: any) => boolean;
|
|
@@ -66,6 +66,8 @@ interface ActionRegisterConfig {
|
|
|
66
66
|
debug?: boolean;
|
|
67
67
|
autoCleanup?: boolean;
|
|
68
68
|
maxHandlers?: number;
|
|
69
|
+
maxRetries?: number;
|
|
70
|
+
retryDelay?: number;
|
|
69
71
|
defaultExecutionMode?: ExecutionMode;
|
|
70
72
|
};
|
|
71
73
|
}
|
|
@@ -74,6 +76,8 @@ interface DispatchOptions {
|
|
|
74
76
|
throttle?: number;
|
|
75
77
|
executionMode?: ExecutionMode;
|
|
76
78
|
signal?: AbortSignal;
|
|
79
|
+
timeout?: number;
|
|
80
|
+
retries?: number;
|
|
77
81
|
autoAbort?: {
|
|
78
82
|
enabled: boolean;
|
|
79
83
|
onControllerCreated?: (controller: AbortController) => void;
|
|
@@ -92,7 +96,7 @@ interface DispatchOptions {
|
|
|
92
96
|
};
|
|
93
97
|
result?: {
|
|
94
98
|
strategy?: 'first' | 'last' | 'all' | 'merge' | 'custom';
|
|
95
|
-
merger?: <R>(results: R
|
|
99
|
+
merger?: <R>(results: Array<R | undefined>) => R;
|
|
96
100
|
collect?: boolean;
|
|
97
101
|
timeout?: number;
|
|
98
102
|
maxResults?: number;
|
|
@@ -104,7 +108,7 @@ interface ExecutionResult<R = void> {
|
|
|
104
108
|
abortReason?: string;
|
|
105
109
|
terminated: boolean;
|
|
106
110
|
result?: R;
|
|
107
|
-
results: R
|
|
111
|
+
results: Array<R | undefined>;
|
|
108
112
|
execution: {
|
|
109
113
|
duration: number;
|
|
110
114
|
handlersExecuted: number;
|
|
@@ -128,9 +132,12 @@ interface ExecutionResult<R = void> {
|
|
|
128
132
|
}>;
|
|
129
133
|
}
|
|
130
134
|
type UnregisterFunction = () => void;
|
|
135
|
+
type VoidActions<T extends ActionPayloadMap> = { [K in keyof T]: T[K] extends void | undefined ? K : never }[keyof T];
|
|
136
|
+
type PayloadActions<T extends ActionPayloadMap> = { [K in keyof T]: T[K] extends void | undefined ? never : K }[keyof T];
|
|
131
137
|
interface ActionDispatcher<T extends ActionPayloadMap> {
|
|
132
|
-
<K extends
|
|
133
|
-
<K extends
|
|
138
|
+
<K extends VoidActions<T>>(action: K, options?: DispatchOptions): Promise<void>;
|
|
139
|
+
<K extends VoidActions<T>>(action: K, payload?: undefined, options?: DispatchOptions): Promise<void>;
|
|
140
|
+
<K extends PayloadActions<T>>(action: K, payload: T[K], options?: DispatchOptions): Promise<void>;
|
|
134
141
|
}
|
|
135
142
|
interface ActionRegistryInfo<T extends ActionPayloadMap> {
|
|
136
143
|
name: string;
|
|
@@ -143,6 +150,8 @@ interface ActionRegistryInfo<T extends ActionPayloadMap> {
|
|
|
143
150
|
interface ActionHandlerStats<T extends ActionPayloadMap> {
|
|
144
151
|
action: keyof T;
|
|
145
152
|
handlerCount: number;
|
|
153
|
+
totalHandlers: number;
|
|
154
|
+
lastRegistered?: Date;
|
|
146
155
|
handlersByPriority: Array<{
|
|
147
156
|
priority: number;
|
|
148
157
|
handlers: Array<{
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/ActionRegister.ts","../src/action-guard.ts","../src/execution-modes.ts"],"sourcesContent":[],"mappings":";UAuCiB,gBAAA;EAAA,CAAA,UAAA,EAAA,MAAgB,CAAA,EAAA,OAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/ActionRegister.ts","../src/action-guard.ts","../src/execution-modes.ts"],"sourcesContent":[],"mappings":";UAuCiB,gBAAA;EAAA,CAAA,UAAA,EAAA,MAAgB,CAAA,EAAA,OAAA;AAwFjC;AAK0C,UALzB,kBAKyB,CAAA,IAAA,GAAA,EAAA,IAAA,IAAA,CAAA,CAAA;OAG1B,CAAA,MAAA,CAAA,EAAA,MAAA,CAAA,EAAA,IAAA;eAOC,CAAA,QAAA,EAAA,CAAA,OAAA,EAVmB,CAUnB,EAAA,GAVyB,CAUzB,CAAA,EAAA,IAAA;YAGG,EAAA,EAVJ,CAUI;gBAGJ,CAAA,QA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AAA,CAAA,OAAA,EG0NxB,eH1NwB,CG0NR,CH1NQ,EG0NL,CH1NK,CAAA,EAAA,gBAAA,EAAA,CAAA,YAAA,EG2NA,mBH3NA,CG2NoB,CH3NpB,EG2NuB,CH3NvB,CAAA,EAAA,KAAA,EAAA,MAAA,EAAA,GG2N6C,kBH3N7C,CG2NgE,CH3NhE,EG2NmE,CH3NnE,CAAA,CAAA,EG4NhC,OH5NgC,CAAA,IAAA,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -179,8 +179,10 @@ async function executeParallel(context, createController) {
|
|
|
179
179
|
try {
|
|
180
180
|
const result = registration.handler(context.payload, controller);
|
|
181
181
|
let handlerResult;
|
|
182
|
-
if (result instanceof Promise)
|
|
183
|
-
|
|
182
|
+
if (result instanceof Promise) {
|
|
183
|
+
const resolved = await result;
|
|
184
|
+
handlerResult = resolved;
|
|
185
|
+
} else handlerResult = result;
|
|
184
186
|
/** Collect result if handler returned something and pipeline wasn't terminated */
|
|
185
187
|
if (handlerResult !== void 0 && !context.terminated) context.results.push(handlerResult);
|
|
186
188
|
return {
|
|
@@ -289,8 +291,10 @@ async function executeRace(context, createController) {
|
|
|
289
291
|
try {
|
|
290
292
|
const result = registration.handler(context.payload, controller);
|
|
291
293
|
let handlerResult;
|
|
292
|
-
if (result instanceof Promise)
|
|
293
|
-
|
|
294
|
+
if (result instanceof Promise) {
|
|
295
|
+
const resolved = await result;
|
|
296
|
+
handlerResult = resolved;
|
|
297
|
+
} else handlerResult = result;
|
|
294
298
|
return {
|
|
295
299
|
success: true,
|
|
296
300
|
handlerId: registration.id,
|
|
@@ -1059,6 +1063,28 @@ var ActionRegister = class {
|
|
|
1059
1063
|
* π μ€μ λμ€ν¨μΉ μμ
μν (νμμ νΈμΆλ¨)
|
|
1060
1064
|
*/
|
|
1061
1065
|
async _performDispatch(action, payload, options) {
|
|
1066
|
+
if (payload && typeof payload === "object" && payload !== null && typeof process !== "undefined" && process.env?.NODE_ENV === "development") {
|
|
1067
|
+
payload instanceof Event;
|
|
1068
|
+
payload instanceof Element;
|
|
1069
|
+
payload.preventDefault;
|
|
1070
|
+
payload.stopPropagation;
|
|
1071
|
+
payload.currentTarget;
|
|
1072
|
+
const hasTarget = payload.target !== void 0;
|
|
1073
|
+
hasTarget && payload.target;
|
|
1074
|
+
hasTarget && payload.target instanceof Element;
|
|
1075
|
+
if (typeof process !== "undefined" && process.env?.DEBUG_CONTEXT_ACTION || typeof process !== "undefined" && process.env?.NODE_ENV === "development") {
|
|
1076
|
+
const nestedDOMProperties = [];
|
|
1077
|
+
Object.keys(payload).forEach((key) => {
|
|
1078
|
+
const prop = payload[key];
|
|
1079
|
+
if (prop instanceof Element || prop instanceof Event) nestedDOMProperties.push(`${key}: ${prop instanceof Element ? "Element" : "Event"}`);
|
|
1080
|
+
});
|
|
1081
|
+
if (nestedDOMProperties.length > 0) console.debug(`[Context-Action] π Nested DOM objects in action "${String(action)}":`, {
|
|
1082
|
+
registry: this.name,
|
|
1083
|
+
nestedDOMProperties,
|
|
1084
|
+
note: "This is informational - usually not a problem"
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1062
1088
|
let autoAbortController;
|
|
1063
1089
|
let effectiveSignal = options?.signal;
|
|
1064
1090
|
if (options?.autoAbort?.enabled) {
|
|
@@ -1628,6 +1654,7 @@ var ActionRegister = class {
|
|
|
1628
1654
|
return {
|
|
1629
1655
|
action,
|
|
1630
1656
|
handlerCount: pipeline.length,
|
|
1657
|
+
totalHandlers: pipeline.length,
|
|
1631
1658
|
handlersByPriority,
|
|
1632
1659
|
executionStats
|
|
1633
1660
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["nonBlockingPromises: Promise<any>[]","error: any","handlerResult: R | undefined","_typeof","o","_typeof","toPrimitive","toPropertyKey","_defineProperty","name: string","queuedOperation: QueuedOperation<T>","registration: HandlerRegistration<T[K], R>","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>"],"sources":["../src/execution-modes.ts","../../../node_modules/.pnpm/@oxc-project+runtime@0.82.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.82.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.82.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.82.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js","../src/action-guard.ts","../src/concurrency/OperationQueue.ts","../src/ActionRegister.ts"],"sourcesContent":["/**\n * @fileoverview Execution mode implementations for ActionRegister\n * \n * Provides three different execution strategies for action handler pipelines:\n * - Sequential: Execute handlers one after another in priority order\n * - Parallel: Execute all handlers simultaneously\n * - Race: First handler to complete wins, others are cancelled\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 * \n * Executes action handlers one at a time in priority order (highest first).\n * Supports both blocking and non-blocking handlers, with proper abort and\n * termination handling. Handlers can modify payload for subsequent handlers\n * and jump to different priority levels.\n * \n * @template T - The payload type for the action\n * @template R - The result type for handlers\n * \n * @param context - Pipeline execution context containing handlers and state\n * @param createController - Factory function for creating pipeline controllers\n * \n * @throws {Error} When a blocking handler fails or validation errors occur\n * \n * @example\n * ```typescript\n * // This is called internally by ActionRegister.dispatch()\n * // when executionMode is 'sequential'\n * \n * // Handlers execute in this order (by priority):\n * // 1. Priority 100: Validation handler\n * // 2. Priority 50: Business logic handler \n * // 3. Priority 10: Logging handler\n * \n * await executeSequential(context, (registration, index) => ({\n * abort: (reason) => { context.aborted = true; context.abortReason = reason },\n * modifyPayload: (modifier) => { context.payload = modifier(context.payload) },\n * // ... other controller methods\n * }))\n * ```\n * \n * @public\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 const nonBlockingPromises: Promise<any>[] = [];\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 - track promise for error handling\n const promiseWithHandling = result.then(asyncResult => {\n if (asyncResult !== undefined && !context.terminated) {\n context.results.push(asyncResult);\n }\n return asyncResult;\n }).catch((error) => {\n // Re-throw the error so it can be caught when we await all promises\n throw error;\n });\n \n nonBlockingPromises.push(promiseWithHandling);\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 synchronous handlers, throw immediately\n throw error;\n }\n }\n \n // Wait for all non-blocking async handlers to complete and check for errors\n if (nonBlockingPromises.length > 0) {\n await Promise.all(nonBlockingPromises);\n }\n}\n\n/**\n * Execute handlers in parallel mode (all at once)\n * \n * Executes all qualifying action handlers simultaneously using Promise.allSettled.\n * Supports both blocking and non-blocking handlers. Blocking handlers can still\n * fail the entire pipeline if they throw errors.\n * \n * @template T - The payload type for the action\n * @template R - The result type for handlers\n * \n * @param context - Pipeline execution context containing handlers and state\n * @param createController - Factory function for creating pipeline controllers\n * \n * @throws {Error} When any blocking handler fails\n * \n * @example\n * ```typescript\n * // This is called internally by ActionRegister.dispatch()\n * // when executionMode is 'parallel'\n * \n * // All handlers execute simultaneously:\n * // - Analytics handler (non-blocking)\n * // - Validation handler (blocking)\n * // - Update handler (blocking)\n * // - Notification handler (non-blocking)\n * \n * await executeParallel(context, (registration, index) => ({\n * abort: (reason) => { context.aborted = true },\n * setResult: (result) => { context.results.push(result) },\n * // ... other controller methods\n * }))\n * ```\n * \n * @example Use Case\n * ```typescript\n * // Perfect for independent operations\n * register.setActionExecutionMode('logEvent', 'parallel')\n * \n * // These can all run simultaneously:\n * register.register('logEvent', analyticsHandler, { blocking: false })\n * register.register('logEvent', metricsHandler, { blocking: false })\n * register.register('logEvent', auditHandler, { blocking: true })\n * ```\n * \n * @public\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 * \n * Executes all qualifying handlers simultaneously using Promise.race, where\n * the first handler to complete determines the pipeline result. Other handlers\n * are effectively cancelled. Useful for scenarios where you want the fastest\n * response from multiple equivalent handlers.\n * \n * @template T - The payload type for the action\n * @template R - The result type for handlers\n * \n * @param context - Pipeline execution context containing handlers and state\n * @param createController - Factory function for creating pipeline controllers\n * \n * @throws {Error} When the winning handler fails and is blocking\n * \n * @example\n * ```typescript\n * // This is called internally by ActionRegister.dispatch()\n * // when executionMode is 'race'\n * \n * // Multiple data sources racing for fastest response:\n * // - Database handler (might be slow)\n * // - Cache handler (usually fast)\n * // - API handler (variable speed)\n * // \n * // Whichever completes first wins\n * \n * await executeRace(context, (registration, index) => ({\n * return: (result) => { \n * context.terminated = true\n * context.terminationResult = result \n * },\n * // ... other controller methods\n * }))\n * ```\n * \n * @example Use Case\n * ```typescript\n * // Race between multiple data sources\n * register.setActionExecutionMode('fetchUserData', 'race')\n * \n * // These handlers race for fastest response:\n * register.register('fetchUserData', cacheHandler) // Usually fastest\n * register.register('fetchUserData', databaseHandler) // Reliable fallback\n * register.register('fetchUserData', apiHandler) // External source\n * \n * // First to complete wins, others are ignored\n * const result = await register.dispatchWithResult('fetchUserData', { id: '123' })\n * ```\n * \n * @public\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 * \n * Provides rate limiting and user experience optimization for actions through\n * debouncing (wait for pause) and throttling (limit frequency) mechanisms.\n * Used internally by ActionRegister to control action execution timing.\n */\n\n\n/**\n * Action guard state tracking for debouncing and throttling\n * \n * Tracks timing and execution state for action execution control.\n * Maintains separate state for each action to enable independent\n * rate limiting per action type.\n * \n * @internal\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 /** Current debounce promise - reused for concurrent calls */\n debouncePromise?: Promise<boolean>;\n \n /** Resolve function for current debounce promise */\n debounceResolve?: (value: boolean) => void;\n}\n\n/**\n * Action Guard system for managing action execution timing\n * \n * Provides performance optimization and user experience enhancement through\n * debouncing and throttling mechanisms. Debouncing waits for a pause in calls\n * before executing, while throttling limits execution frequency.\n * \n * @example Debouncing Search Input\n * ```typescript\n * const guard = new ActionGuard()\n * \n * // Wait 300ms after user stops typing before searching\n * register.register('searchUsers', async (payload, controller) => {\n * const query = payload.query\n * if (query.length < 2) return\n * \n * const results = await userService.search(query)\n * controller.setResult(results)\n * }, {\n * debounce: 300, // Built into ActionRegister via ActionGuard\n * tags: ['search', 'user-input']\n * })\n * ```\n * \n * @example Throttling High-Frequency Events\n * ```typescript\n * // Limit scroll position updates to once per 100ms\n * register.register('updateScrollPosition', (payload, controller) => {\n * scrollState.setValue(payload.position)\n * }, {\n * throttle: 100, // Built into ActionRegister via ActionGuard\n * tags: ['scroll', 'performance']\n * })\n * ```\n * \n * @example Manual Usage (Advanced)\n * ```typescript\n * const guard = new ActionGuard()\n * \n * // Manual debouncing\n * if (await guard.debounce('search', 300)) {\n * performSearch() // Only executes after 300ms pause\n * }\n * \n * // Manual throttling\n * if (guard.throttle('scroll', 100)) {\n * updateUI() // Max once per 100ms\n * }\n * ```\n * \n * @internal\n */\nexport class ActionGuard {\n private guards = new Map<string, GuardState>();\n\n constructor() {\n // ActionGuard without logger\n }\n\n /**\n * Apply debouncing to an action\n * \n * Debouncing waits for a specified delay after the last call before allowing\n * execution. Each new call resets the timer. Useful for search inputs, resize\n * handlers, and other high-frequency user interactions.\n * \n * @param actionKey - Unique identifier for the action being debounced\n * @param debounceMs - Delay in milliseconds to wait after the last call\n * \n * @returns Promise resolving to true if execution should proceed, false if cancelled\n * \n * @example Search Input Debouncing\n * ```typescript\n * // Only search after user stops typing for 300ms\n * if (await guard.debounce('userSearch', 300)) {\n * performSearch(query)\n * }\n * ```\n * \n * @internal\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 if (state.debounceTimer) {\n clearTimeout(state.debounceTimer);\n // Resolve previous debounce with false if exists\n if (state.debounceResolve) {\n state.debounceResolve(false);\n state.debounceResolve = undefined;\n }\n }\n\n /** Create new debounce promise */\n return new Promise<boolean>((resolve) => {\n // Store new resolve function\n state!.debounceResolve = resolve;\n \n // Set new timer\n state!.debounceTimer = setTimeout(() => {\n /** Clean up timer and resolver references */\n state!.debounceTimer = undefined;\n state!.debounceResolve = undefined;\n /** Update last execution timestamp */\n state!.lastExecuted = Date.now();\n resolve(true);\n }, debounceMs);\n });\n }\n\n /**\n * Apply throttling to an action\n * \n * Throttling limits execution frequency by ensuring a minimum interval between\n * calls. Unlike debouncing, throttling executes immediately on the first call\n * and then blocks subsequent calls until the interval expires.\n * \n * @param actionKey - Unique identifier for the action being throttled\n * @param throttleMs - Minimum interval in milliseconds between executions\n * \n * @returns True if execution should proceed, false if currently throttled\n * \n * @example Scroll Handler Throttling\n * ```typescript\n * // Update scroll position max once per 100ms\n * if (guard.throttle('scrollUpdate', 100)) {\n * updateScrollPosition()\n * }\n * ```\n * \n * @internal\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 guard state for a specific action\n * \n * Removes debounce and throttle timers for the specified action,\n * preventing memory leaks and allowing immediate re-execution.\n * \n * @param actionKey - Action identifier to clear guards for\n * \n * @internal\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 // Cancel waiting debounce calls\n if (state.debounceResolve) {\n state.debounceResolve(false);\n }\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 guard states for all actions\n * \n * Removes all active debounce and throttle timers, useful for cleanup\n * when shutting down the action system or resetting state.\n * \n * @internal\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 // Cancel waiting debounce calls\n if (state.debounceResolve) {\n state.debounceResolve(false);\n }\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 purposes\n * \n * Returns the internal state for a specific action, including timer\n * information and execution timestamps.\n * \n * @param actionKey - Action identifier to inspect\n * @returns Guard state or undefined if no state exists\n * \n * @internal\n */\n getGuardState(actionKey: string): GuardState | undefined {\n return this.guards.get(actionKey);\n }\n\n /**\n * Get all active guard states for debugging purposes\n * \n * Returns a copy of all current guard states, useful for monitoring\n * and debugging rate limiting behavior across all actions.\n * \n * @returns Map of action keys to their guard states\n * \n * @internal\n */\n getAllGuardStates(): Map<string, GuardState> {\n return new Map(this.guards);\n }\n}","/**\n * λμμ± λ¬Έμ ν΄κ²°μ μν μμ
ν μμ€ν
\n * \n * λͺ¨λ μν λ³κ²½ μμ
μ μ§λ ¬ννμ¬ race conditionμ λ°©μ§ν©λλ€.\n */\n\nexport interface QueuedOperation<T = any> {\n id: string;\n operation: () => T | Promise<T>;\n resolve: (value: T) => void;\n reject: (error: any) => void;\n priority?: number;\n timestamp: number;\n}\n\n/**\n * μμ
ν κ΄λ¦¬μ\n * \n * ν΅μ¬ κΈ°λ₯:\n * 1. μμ
μ§λ ¬ν - λͺ¨λ μμ
μ μμλλ‘ μ€ν\n * 2. μ°μ μμ μ§μ - μ€μν μμ
μ°μ μ²λ¦¬\n * 3. μλ¬ μ²λ¦¬ - κ°λ³ μμ
μ€ν¨κ° μ 체μ μν₯ μ£Όμ§ μμ\n * 4. λ©λͺ¨λ¦¬ κ΄λ¦¬ - μλ£λ μμ
μλ μ 리\n */\nexport class OperationQueue {\n private queue: QueuedOperation[] = [];\n private isProcessing = false;\n private operationCounter = 0;\n \n constructor(private name: string = 'OperationQueue') {}\n\n /**\n * μμ
μ νμ μΆκ°νκ³ μ€ν κ²°κ³Όλ₯Ό λ°ν\n * \n * @param operation μ€νν μμ
\n * @param priority μ°μ μμ (λμμλ‘ λ¨Όμ μ€ν)\n * @returns Promiseλ‘ λνλ μμ
κ²°κ³Ό\n */\n enqueue<T>(operation: () => T | Promise<T>, priority: number = 0): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const queuedOperation: QueuedOperation<T> = {\n id: `${this.name}-${++this.operationCounter}`,\n operation,\n resolve,\n reject,\n priority,\n timestamp: Date.now()\n };\n\n // μ°μ μμμ λ°λΌ μ½μ
μμΉ κ²°μ \n let insertIndex = this.queue.length;\n for (let i = 0; i < this.queue.length; i++) {\n if ((this.queue[i].priority || 0) < priority) {\n insertIndex = i;\n break;\n }\n }\n\n this.queue.splice(insertIndex, 0, queuedOperation);\n \n // ν μ²λ¦¬ μμ (μ΄λ―Έ μ²λ¦¬ μ€μ΄λ©΄ 무μλ¨)\n this.processQueue();\n });\n }\n\n /**\n * ν μ²λ¦¬ λ©μΈ λ‘μ§\n * \n * ν λ²μ νλμ© μμλλ‘ μμ
μ μ€ννμ¬ λμμ± λ¬Έμ λ°©μ§\n */\n private async processQueue(): Promise<void> {\n // μ΄λ―Έ μ²λ¦¬ μ€μ΄κ±°λ νκ° λΉμ΄μμΌλ©΄ μ’
λ£\n if (this.isProcessing || this.queue.length === 0) {\n return;\n }\n\n this.isProcessing = true;\n\n try {\n while (this.queue.length > 0) {\n const operation = this.queue.shift()!;\n \n try {\n // μμ
μ€ν (λκΈ°/λΉλκΈ° λͺ¨λ μ§μ)\n const result = await Promise.resolve(operation.operation());\n operation.resolve(result);\n } catch (error) {\n // κ°λ³ μμ
μ€ν¨λ μ 체 νμ μν₯ μ£Όμ§ μμ\n operation.reject(error);\n }\n }\n } finally {\n this.isProcessing = false;\n }\n }\n\n /**\n * νμ¬ ν μν μ‘°ν (λλ²κΉ
μ©)\n */\n getQueueInfo() {\n return {\n name: this.name,\n queueLength: this.queue.length,\n isProcessing: this.isProcessing,\n operations: this.queue.map(op => ({\n id: op.id,\n priority: op.priority,\n timestamp: op.timestamp\n }))\n };\n }\n\n /**\n * ν λΉμ°κΈ° (ν
μ€νΈμ©)\n */\n clear(): void {\n // λκΈ° μ€μΈ μμ
λ€μκ² μ·¨μ μλ¦Ό\n this.queue.forEach(operation => {\n operation.reject(new Error('Queue cleared'));\n });\n \n this.queue = [];\n this.isProcessing = false;\n }\n\n /**\n * ν ν¬κΈ° μ‘°ν\n */\n get size(): number {\n return this.queue.length;\n }\n\n /**\n * μ²λ¦¬ μ€ μ¬λΆ μ‘°ν \n */\n get processing(): boolean {\n return this.isProcessing;\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';\nimport { OperationQueue } from './concurrency/OperationQueue.js';\n\n/**\n * Action Register for managing action handlers with priority-based execution\n * \n * Central action registration and dispatch system providing type-safe action pipeline management.\n * Supports sequential, parallel, and race execution modes with advanced handler filtering,\n * throttling, debouncing, and comprehensive result collection.\n * \n * @template TActionMap - Action payload mapping interface extending ActionPayloadMap\n * \n * @example Basic Usage\n * ```typescript\n * interface AppActions extends ActionPayloadMap {\n * updateUser: { id: string; name: string; email: string }\n * deleteUser: { id: string }\n * resetUser: void\n * }\n * \n * const register = new ActionRegister<AppActions>({\n * name: 'AppRegister',\n * registry: { debug: true, maxHandlers: 10 }\n * })\n * \n * // Register handler with priority\n * register.register('updateUser', async (payload, controller) => {\n * await userService.update(payload.id, payload)\n * controller.setResult({ success: true, userId: payload.id })\n * }, { priority: 10, tags: ['user', 'crud'] })\n * \n * // Dispatch action\n * await register.dispatch('updateUser', { \n * id: '123', \n * name: 'John Doe', \n * email: 'john@example.com' \n * })\n * ```\n * \n * @example With Multiple Handlers\n * ```typescript\n * // High priority validation handler\n * register.register('updateUser', async (payload, controller) => {\n * if (!payload.email.includes('@')) {\n * controller.abort('Invalid email format')\n * return\n * }\n * }, { priority: 100, category: 'validation' })\n * \n * // Lower priority update handler\n * register.register('updateUser', async (payload, controller) => {\n * const user = await userService.update(payload.id, payload)\n * controller.setResult(user)\n * }, { priority: 50, category: 'business-logic' })\n * ```\n * \n * @example Advanced Configuration\n * ```typescript\n * const register = new ActionRegister<AppActions>({\n * name: 'AdvancedRegister',\n * registry: {\n * debug: true,\n * maxHandlers: 20,\n * defaultExecutionMode: 'parallel',\n * autoCleanup: true\n * }\n * })\n * \n * // Handler with debouncing and tags\n * register.register('searchUsers', async (payload, controller) => {\n * const results = await userService.search(payload.query)\n * controller.setResult(results)\n * }, {\n * priority: 10,\n * debounce: 300,\n * tags: ['search', 'user'],\n * category: 'query',\n * once: false\n * })\n * ```\n * \n * @public\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 // π λμμ± λ¬Έμ ν΄κ²°μ μν ν μμ€ν
\n private registrationQueue: OperationQueue;\n private dispatchQueue: OperationQueue;\n\n constructor(config: ActionRegisterConfig = {}) {\n this.name = config.name || 'ActionRegister';\n this.registryConfig = config.registry;\n this.actionGuard = new ActionGuard();\n \n // π ν μμ€ν
μ΄κΈ°ν\n this.registrationQueue = new OperationQueue(`${this.name}-Registration`);\n this.dispatchQueue = new OperationQueue(`${this.name}-Dispatch`);\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 concurrencyProtection: true // π λμμ± λ³΄νΈ νμ±ν\n });\n }\n }\n\n /**\n * Register an action handler with optional configuration\n * \n * @param action - The action type to register handler for\n * @param handler - The handler function to execute\n * @param config - Optional handler configuration including priority, tags, etc.\n * \n * @returns Unregister function to remove this handler\n * \n * @throws {Error} When maximum handlers limit is reached\n * \n * @example Basic Registration\n * ```typescript\n * const unregister = register.register('updateUser', async (payload, controller) => {\n * await userService.update(payload.id, payload)\n * })\n * \n * // Later remove the handler\n * unregister()\n * ```\n * \n * @example With Priority and Configuration\n * ```typescript\n * register.register('validateUser', async (payload, controller) => {\n * if (!payload.email) {\n * controller.abort('Email is required')\n * }\n * }, {\n * priority: 100,\n * tags: ['validation'],\n * category: 'security',\n * once: false\n * })\n * ```\n * \n * @public\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 // λκΈ°μ APIλ₯Ό μ μ§νλ©΄μ λ΄λΆμ μΌλ‘λ§ λμμ± λ³΄νΈ\n \n // Generate unique handler ID with security consideration\n const handlerId = config.id || `handler_${++this.handlerCounter}_${Math.random().toString(36).substr(2, 5)}`;\n \n // π μ¦μ λ±λ‘ μννλ μ λ ¬κΉμ§ ν λ²μ μ²λ¦¬\n const unregisterFn = this._performRegistrationSync(action, handler, config, handlerId);\n \n return unregisterFn;\n }\n\n /**\n * π λκΈ°μ λ±λ‘ μν (κ°μ λ λ²μ )\n */\n private _performRegistrationSync<K extends keyof T, R = void>(\n action: K,\n handler: ActionHandler<T[K], R>,\n config: HandlerConfig,\n handlerId: string\n ): UnregisterFunction {\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 // π μ¦μ μ λ ¬ (λμμ± λ³΄νΈ)\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 /**\n * π μ€μ λ±λ‘ μμ
μν (νμμ νΈμΆλ¨)\n * @deprecated Currently unused - reserved for future queue-based registration\n */\n private _performRegistration<K extends keyof T, R = void>(\n action: K,\n handler: ActionHandler<T[K], R>,\n config: HandlerConfig,\n handlerId: string\n ): UnregisterFunction {\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 /**\n * Dispatch an action with optional execution options\n * \n * @param action - The action type to dispatch\n * @param payload - The action payload data\n * @param options - Optional dispatch options (execution mode, filters, etc.)\n * \n * @returns Promise that resolves when all handlers complete\n * \n * @throws {Error} When action dispatching fails\n * \n * @example Basic Dispatch\n * ```typescript\n * await register.dispatch('updateUser', {\n * id: '123',\n * name: 'John Doe',\n * email: 'john@example.com'\n * })\n * ```\n * \n * @example With Options\n * ```typescript\n * await register.dispatch('updateUser', payload, {\n * executionMode: 'parallel',\n * timeout: 5000,\n * filter: {\n * tags: ['validation', 'business-logic'],\n * excludeCategory: 'analytics'\n * }\n * })\n * ```\n * \n * @example With Throttling\n * ```typescript\n * await register.dispatch('searchUsers', { query: 'john' }, {\n * throttle: 300,\n * debounce: 100\n * })\n * ```\n * \n * @public\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 // π λμ€ν¨μΉλ₯Ό νμ μΆκ°νμ¬ λμμ± λ³΄νΈ\n // λͺ¨λ λμ€ν¨μΉκ° μμ°¨μ μΌλ‘ μ€νλμ΄ race condition λ°©μ§\n return this.dispatchQueue.enqueue(async () => {\n return this._performDispatch(action, payload, options);\n });\n }\n\n /**\n * π μ€μ λμ€ν¨μΉ μμ
μν (νμμ νΈμΆλ¨)\n */\n private async _performDispatch<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 console.log(`[ActionRegister] Pipeline execution succeeded for ${String(action)}`);\n } catch (error) {\n console.log(`[ActionRegister] Pipeline execution failed for ${String(action)}:`, 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 /**\n * Dispatch an action and return detailed execution results\n * \n * @param action - The action type to dispatch\n * @param payload - The action payload data\n * @param options - Optional dispatch options including result collection strategy\n * \n * @returns Promise resolving to comprehensive execution results\n * \n * @example Basic Result Collection\n * ```typescript\n * const result = await register.dispatchWithResult('updateUser', payload)\n * \n * if (result.success) {\n * console.log(`Executed ${result.execution.handlersExecuted} handlers`)\n * console.log(`Duration: ${result.execution.duration}ms`)\n * }\n * ```\n * \n * @example Advanced Result Processing\n * ```typescript\n * const result = await register.dispatchWithResult('processOrder', order, {\n * result: {\n * collect: true,\n * strategy: 'merge',\n * maxResults: 5,\n * merger: (results) => results.reduce((acc, curr) => ({ ...acc, ...curr }), {})\n * }\n * })\n * \n * if (result.terminated) {\n * console.log('Handler returned early:', result.result)\n * }\n * ```\n * \n * @public\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 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 /**\n * Get the number of registered handlers for an action\n * \n * @param action - The action type to count handlers for\n * \n * @returns Number of registered handlers\n * \n * @example\n * ```typescript\n * register.register('updateUser', handler1)\n * register.register('updateUser', handler2)\n * \n * console.log(register.getHandlerCount('updateUser')) // 2\n * ```\n * \n * @public\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 /**\n * Check if an action has any registered handlers\n * \n * @param action - The action type to check\n * \n * @returns True if action has handlers, false otherwise\n * \n * @example\n * ```typescript\n * if (register.hasHandlers('updateUser')) {\n * await register.dispatch('updateUser', userData)\n * }\n * ```\n * \n * @public\n */\n hasHandlers<K extends keyof T>(action: K): boolean {\n return this.getHandlerCount(action) > 0;\n }\n\n /**\n * Get all registered action types\n * \n * @returns Array of all registered action types\n * \n * @example\n * ```typescript\n * const actions = register.getRegisteredActions()\n * console.log('Registered actions:', actions) // ['updateUser', 'deleteUser', 'resetUser']\n * ```\n * \n * @public\n */\n getRegisteredActions(): (keyof T)[] {\n return Array.from(this.pipelines.keys());\n }\n\n /**\n * Remove all handlers for a specific action\n * \n * @param action - The action type to clear handlers for\n * \n * @example\n * ```typescript\n * register.clearAction('updateUser')\n * console.log(register.hasHandlers('updateUser')) // false\n * ```\n * \n * @public\n */\n clearAction<K extends keyof T>(action: K): void {\n this.pipelines.delete(action);\n }\n\n /**\n * Remove all handlers for all actions\n * \n * @example\n * ```typescript\n * register.clearAll()\n * console.log(register.getRegisteredActions().length) // 0\n * ```\n * \n * @public\n */\n clearAll(): void {\n this.pipelines.clear();\n }\n\n /**\n * Get the name of this action register\n * \n * @returns The register name\n * \n * @example\n * ```typescript\n * const register = new ActionRegister({ name: 'UserRegister' })\n * console.log(register.getName()) // 'UserRegister'\n * ```\n * \n * @public\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkD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AAS,QAAQ,IAAI,aAAa,cACzD,SAAQ,IAAI,uCAAuC,OAAO,QAAQ,gBAAgB,KAAK;CAE1F;;;;CAKD,sBAA4B;AAC1B,OAAK,eAAe;AAEpB,MAAI,KAAK,gBAAgB,SAAS,QAAQ,IAAI,aAAa,cACzD,SAAQ,IAAI,iDAAiD,KAAK;CAErE;;;;;;CAOD,0BAA6C,QAAiB;AAC5D,OAAK,eAAe,OAAO;AAE3B,MAAI,KAAK,gBAAgB,SAAS,QAAQ,IAAI,aAAa,cACzD,SAAQ,IAAI,+CAA+C,OAAO;CAErE;;;;;;CAOD,oBAAsD;AACpD,SAAO,KAAK;CACb;;;;;;CAOD,iBAA0B;AACxB,SAAO,QAAQ,KAAK,gBAAgB,SAAS,QAAQ,IAAI,aAAa;CACvE;AACF"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["nonBlockingPromises: Promise<any>[]","error: any","handlerResult: R | undefined","_typeof","o","_typeof","toPrimitive","toPropertyKey","_defineProperty","name: string","queuedOperation: QueuedOperation<T>","registration: HandlerRegistration<T[K], R>","nestedDOMProperties: string[]","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>"],"sources":["../src/execution-modes.ts","../../../node_modules/.pnpm/@oxc-project+runtime@0.82.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.82.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.82.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js","../../../node_modules/.pnpm/@oxc-project+runtime@0.82.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js","../src/action-guard.ts","../src/concurrency/OperationQueue.ts","../src/ActionRegister.ts"],"sourcesContent":["/**\n * @fileoverview Execution mode implementations for ActionRegister\n * \n * Provides three different execution strategies for action handler pipelines:\n * - Sequential: Execute handlers one after another in priority order\n * - Parallel: Execute all handlers simultaneously\n * - Race: First handler to complete wins, others are cancelled\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 * \n * Executes action handlers one at a time in priority order (highest first).\n * Supports both blocking and non-blocking handlers, with proper abort and\n * termination handling. Handlers can modify payload for subsequent handlers\n * and jump to different priority levels.\n * \n * @template T - The payload type for the action\n * @template R - The result type for handlers\n * \n * @param context - Pipeline execution context containing handlers and state\n * @param createController - Factory function for creating pipeline controllers\n * \n * @throws {Error} When a blocking handler fails or validation errors occur\n * \n * @example\n * ```typescript\n * // This is called internally by ActionRegister.dispatch()\n * // when executionMode is 'sequential'\n * \n * // Handlers execute in this order (by priority):\n * // 1. Priority 100: Validation handler\n * // 2. Priority 50: Business logic handler \n * // 3. Priority 10: Logging handler\n * \n * await executeSequential(context, (registration, index) => ({\n * abort: (reason) => { context.aborted = true; context.abortReason = reason },\n * modifyPayload: (modifier) => { context.payload = modifier(context.payload) },\n * // ... other controller methods\n * }))\n * ```\n * \n * @public\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 const nonBlockingPromises: Promise<any>[] = [];\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 - track promise for error handling\n const promiseWithHandling = result.then(asyncResult => {\n if (asyncResult !== undefined && !context.terminated) {\n context.results.push(asyncResult);\n }\n return asyncResult;\n }).catch((error) => {\n // Re-throw the error so it can be caught when we await all promises\n throw error;\n });\n \n nonBlockingPromises.push(promiseWithHandling);\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 synchronous handlers, throw immediately\n throw error;\n }\n }\n \n // Wait for all non-blocking async handlers to complete and check for errors\n if (nonBlockingPromises.length > 0) {\n await Promise.all(nonBlockingPromises);\n }\n}\n\n/**\n * Execute handlers in parallel mode (all at once)\n * \n * Executes all qualifying action handlers simultaneously using Promise.allSettled.\n * Supports both blocking and non-blocking handlers. Blocking handlers can still\n * fail the entire pipeline if they throw errors.\n * \n * @template T - The payload type for the action\n * @template R - The result type for handlers\n * \n * @param context - Pipeline execution context containing handlers and state\n * @param createController - Factory function for creating pipeline controllers\n * \n * @throws {Error} When any blocking handler fails\n * \n * @example\n * ```typescript\n * // This is called internally by ActionRegister.dispatch()\n * // when executionMode is 'parallel'\n * \n * // All handlers execute simultaneously:\n * // - Analytics handler (non-blocking)\n * // - Validation handler (blocking)\n * // - Update handler (blocking)\n * // - Notification handler (non-blocking)\n * \n * await executeParallel(context, (registration, index) => ({\n * abort: (reason) => { context.aborted = true },\n * setResult: (result) => { context.results.push(result) },\n * // ... other controller methods\n * }))\n * ```\n * \n * @example Use Case\n * ```typescript\n * // Perfect for independent operations\n * register.setActionExecutionMode('logEvent', 'parallel')\n * \n * // These can all run simultaneously:\n * register.register('logEvent', analyticsHandler, { blocking: false })\n * register.register('logEvent', metricsHandler, { blocking: false })\n * register.register('logEvent', auditHandler, { blocking: true })\n * ```\n * \n * @public\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 const resolved = await result;\n handlerResult = resolved as R | undefined;\n } else {\n handlerResult = result as R | undefined;\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 * \n * Executes all qualifying handlers simultaneously using Promise.race, where\n * the first handler to complete determines the pipeline result. Other handlers\n * are effectively cancelled. Useful for scenarios where you want the fastest\n * response from multiple equivalent handlers.\n * \n * @template T - The payload type for the action\n * @template R - The result type for handlers\n * \n * @param context - Pipeline execution context containing handlers and state\n * @param createController - Factory function for creating pipeline controllers\n * \n * @throws {Error} When the winning handler fails and is blocking\n * \n * @example\n * ```typescript\n * // This is called internally by ActionRegister.dispatch()\n * // when executionMode is 'race'\n * \n * // Multiple data sources racing for fastest response:\n * // - Database handler (might be slow)\n * // - Cache handler (usually fast)\n * // - API handler (variable speed)\n * // \n * // Whichever completes first wins\n * \n * await executeRace(context, (registration, index) => ({\n * return: (result) => { \n * context.terminated = true\n * context.terminationResult = result \n * },\n * // ... other controller methods\n * }))\n * ```\n * \n * @example Use Case\n * ```typescript\n * // Race between multiple data sources\n * register.setActionExecutionMode('fetchUserData', 'race')\n * \n * // These handlers race for fastest response:\n * register.register('fetchUserData', cacheHandler) // Usually fastest\n * register.register('fetchUserData', databaseHandler) // Reliable fallback\n * register.register('fetchUserData', apiHandler) // External source\n * \n * // First to complete wins, others are ignored\n * const result = await register.dispatchWithResult('fetchUserData', { id: '123' })\n * ```\n * \n * @public\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 const resolved = await result;\n handlerResult = resolved as R | undefined;\n } else {\n handlerResult = result as R | undefined;\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 * \n * Provides rate limiting and user experience optimization for actions through\n * debouncing (wait for pause) and throttling (limit frequency) mechanisms.\n * Used internally by ActionRegister to control action execution timing.\n */\n\n\n/**\n * Action guard state tracking for debouncing and throttling\n * \n * Tracks timing and execution state for action execution control.\n * Maintains separate state for each action to enable independent\n * rate limiting per action type.\n * \n * @internal\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 /** Current debounce promise - reused for concurrent calls */\n debouncePromise?: Promise<boolean>;\n \n /** Resolve function for current debounce promise */\n debounceResolve?: (value: boolean) => void;\n}\n\n/**\n * Action Guard system for managing action execution timing\n * \n * Provides performance optimization and user experience enhancement through\n * debouncing and throttling mechanisms. Debouncing waits for a pause in calls\n * before executing, while throttling limits execution frequency.\n * \n * @example Debouncing Search Input\n * ```typescript\n * const guard = new ActionGuard()\n * \n * // Wait 300ms after user stops typing before searching\n * register.register('searchUsers', async (payload, controller) => {\n * const query = payload.query\n * if (query.length < 2) return\n * \n * const results = await userService.search(query)\n * controller.setResult(results)\n * }, {\n * debounce: 300, // Built into ActionRegister via ActionGuard\n * tags: ['search', 'user-input']\n * })\n * ```\n * \n * @example Throttling High-Frequency Events\n * ```typescript\n * // Limit scroll position updates to once per 100ms\n * register.register('updateScrollPosition', (payload, controller) => {\n * scrollState.setValue(payload.position)\n * }, {\n * throttle: 100, // Built into ActionRegister via ActionGuard\n * tags: ['scroll', 'performance']\n * })\n * ```\n * \n * @example Manual Usage (Advanced)\n * ```typescript\n * const guard = new ActionGuard()\n * \n * // Manual debouncing\n * if (await guard.debounce('search', 300)) {\n * performSearch() // Only executes after 300ms pause\n * }\n * \n * // Manual throttling\n * if (guard.throttle('scroll', 100)) {\n * updateUI() // Max once per 100ms\n * }\n * ```\n * \n * @internal\n */\nexport class ActionGuard {\n private guards = new Map<string, GuardState>();\n\n constructor() {\n // ActionGuard without logger\n }\n\n /**\n * Apply debouncing to an action\n * \n * Debouncing waits for a specified delay after the last call before allowing\n * execution. Each new call resets the timer. Useful for search inputs, resize\n * handlers, and other high-frequency user interactions.\n * \n * @param actionKey - Unique identifier for the action being debounced\n * @param debounceMs - Delay in milliseconds to wait after the last call\n * \n * @returns Promise resolving to true if execution should proceed, false if cancelled\n * \n * @example Search Input Debouncing\n * ```typescript\n * // Only search after user stops typing for 300ms\n * if (await guard.debounce('userSearch', 300)) {\n * performSearch(query)\n * }\n * ```\n * \n * @internal\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 if (state.debounceTimer) {\n clearTimeout(state.debounceTimer);\n // Resolve previous debounce with false if exists\n if (state.debounceResolve) {\n state.debounceResolve(false);\n state.debounceResolve = undefined;\n }\n }\n\n /** Create new debounce promise */\n return new Promise<boolean>((resolve) => {\n // Store new resolve function\n state!.debounceResolve = resolve;\n \n // Set new timer\n state!.debounceTimer = setTimeout(() => {\n /** Clean up timer and resolver references */\n state!.debounceTimer = undefined;\n state!.debounceResolve = undefined;\n /** Update last execution timestamp */\n state!.lastExecuted = Date.now();\n resolve(true);\n }, debounceMs);\n });\n }\n\n /**\n * Apply throttling to an action\n * \n * Throttling limits execution frequency by ensuring a minimum interval between\n * calls. Unlike debouncing, throttling executes immediately on the first call\n * and then blocks subsequent calls until the interval expires.\n * \n * @param actionKey - Unique identifier for the action being throttled\n * @param throttleMs - Minimum interval in milliseconds between executions\n * \n * @returns True if execution should proceed, false if currently throttled\n * \n * @example Scroll Handler Throttling\n * ```typescript\n * // Update scroll position max once per 100ms\n * if (guard.throttle('scrollUpdate', 100)) {\n * updateScrollPosition()\n * }\n * ```\n * \n * @internal\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 guard state for a specific action\n * \n * Removes debounce and throttle timers for the specified action,\n * preventing memory leaks and allowing immediate re-execution.\n * \n * @param actionKey - Action identifier to clear guards for\n * \n * @internal\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 // Cancel waiting debounce calls\n if (state.debounceResolve) {\n state.debounceResolve(false);\n }\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 guard states for all actions\n * \n * Removes all active debounce and throttle timers, useful for cleanup\n * when shutting down the action system or resetting state.\n * \n * @internal\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 // Cancel waiting debounce calls\n if (state.debounceResolve) {\n state.debounceResolve(false);\n }\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 purposes\n * \n * Returns the internal state for a specific action, including timer\n * information and execution timestamps.\n * \n * @param actionKey - Action identifier to inspect\n * @returns Guard state or undefined if no state exists\n * \n * @internal\n */\n getGuardState(actionKey: string): GuardState | undefined {\n return this.guards.get(actionKey);\n }\n\n /**\n * Get all active guard states for debugging purposes\n * \n * Returns a copy of all current guard states, useful for monitoring\n * and debugging rate limiting behavior across all actions.\n * \n * @returns Map of action keys to their guard states\n * \n * @internal\n */\n getAllGuardStates(): Map<string, GuardState> {\n return new Map(this.guards);\n }\n}","/**\n * λμμ± λ¬Έμ ν΄κ²°μ μν μμ
ν μμ€ν
\n * \n * λͺ¨λ μν λ³κ²½ μμ
μ μ§λ ¬ννμ¬ race conditionμ λ°©μ§ν©λλ€.\n */\n\nexport interface QueuedOperation<T = any> {\n id: string;\n operation: () => T | Promise<T>;\n resolve: (value: T) => void;\n reject: (error: any) => void;\n priority?: number;\n timestamp: number;\n}\n\n/**\n * μμ
ν κ΄λ¦¬μ\n * \n * ν΅μ¬ κΈ°λ₯:\n * 1. μμ
μ§λ ¬ν - λͺ¨λ μμ
μ μμλλ‘ μ€ν\n * 2. μ°μ μμ μ§μ - μ€μν μμ
μ°μ μ²λ¦¬\n * 3. μλ¬ μ²λ¦¬ - κ°λ³ μμ
μ€ν¨κ° μ 체μ μν₯ μ£Όμ§ μμ\n * 4. λ©λͺ¨λ¦¬ κ΄λ¦¬ - μλ£λ μμ
μλ μ 리\n */\nexport class OperationQueue {\n private queue: QueuedOperation[] = [];\n private isProcessing = false;\n private operationCounter = 0;\n \n constructor(private name: string = 'OperationQueue') {}\n\n /**\n * μμ
μ νμ μΆκ°νκ³ μ€ν κ²°κ³Όλ₯Ό λ°ν\n * \n * @param operation μ€νν μμ
\n * @param priority μ°μ μμ (λμμλ‘ λ¨Όμ μ€ν)\n * @returns Promiseλ‘ λνλ μμ
κ²°κ³Ό\n */\n enqueue<T>(operation: () => T | Promise<T>, priority: number = 0): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n const queuedOperation: QueuedOperation<T> = {\n id: `${this.name}-${++this.operationCounter}`,\n operation,\n resolve,\n reject,\n priority,\n timestamp: Date.now()\n };\n\n // μ°μ μμμ λ°λΌ μ½μ
μμΉ κ²°μ \n let insertIndex = this.queue.length;\n for (let i = 0; i < this.queue.length; i++) {\n if ((this.queue[i].priority || 0) < priority) {\n insertIndex = i;\n break;\n }\n }\n\n this.queue.splice(insertIndex, 0, queuedOperation);\n \n // ν μ²λ¦¬ μμ (μ΄λ―Έ μ²λ¦¬ μ€μ΄λ©΄ 무μλ¨)\n this.processQueue();\n });\n }\n\n /**\n * ν μ²λ¦¬ λ©μΈ λ‘μ§\n * \n * ν λ²μ νλμ© μμλλ‘ μμ
μ μ€ννμ¬ λμμ± λ¬Έμ λ°©μ§\n */\n private async processQueue(): Promise<void> {\n // μ΄λ―Έ μ²λ¦¬ μ€μ΄κ±°λ νκ° λΉμ΄μμΌλ©΄ μ’
λ£\n if (this.isProcessing || this.queue.length === 0) {\n return;\n }\n\n this.isProcessing = true;\n\n try {\n while (this.queue.length > 0) {\n const operation = this.queue.shift()!;\n \n try {\n // μμ
μ€ν (λκΈ°/λΉλκΈ° λͺ¨λ μ§μ)\n const result = await Promise.resolve(operation.operation());\n operation.resolve(result);\n } catch (error) {\n // κ°λ³ μμ
μ€ν¨λ μ 체 νμ μν₯ μ£Όμ§ μμ\n operation.reject(error);\n }\n }\n } finally {\n this.isProcessing = false;\n }\n }\n\n /**\n * νμ¬ ν μν μ‘°ν (λλ²κΉ
μ©)\n */\n getQueueInfo() {\n return {\n name: this.name,\n queueLength: this.queue.length,\n isProcessing: this.isProcessing,\n operations: this.queue.map(op => ({\n id: op.id,\n priority: op.priority,\n timestamp: op.timestamp\n }))\n };\n }\n\n /**\n * ν λΉμ°κΈ° (ν
μ€νΈμ©)\n */\n clear(): void {\n // λκΈ° μ€μΈ μμ
λ€μκ² μ·¨μ μλ¦Ό\n this.queue.forEach(operation => {\n operation.reject(new Error('Queue cleared'));\n });\n \n this.queue = [];\n this.isProcessing = false;\n }\n\n /**\n * ν ν¬κΈ° μ‘°ν\n */\n get size(): number {\n return this.queue.length;\n }\n\n /**\n * μ²λ¦¬ μ€ μ¬λΆ μ‘°ν \n */\n get processing(): boolean {\n return this.isProcessing;\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';\nimport { OperationQueue } from './concurrency/OperationQueue.js';\n\n/**\n * Action Register for managing action handlers with priority-based execution\n * \n * Central action registration and dispatch system providing type-safe action pipeline management.\n * Supports sequential, parallel, and race execution modes with advanced handler filtering,\n * throttling, debouncing, and comprehensive result collection.\n * \n * @template TActionMap - Action payload mapping interface extending ActionPayloadMap\n * \n * @example Basic Usage\n * ```typescript\n * interface AppActions extends ActionPayloadMap {\n * updateUser: { id: string; name: string; email: string }\n * deleteUser: { id: string }\n * resetUser: void\n * }\n * \n * const register = new ActionRegister<AppActions>({\n * name: 'AppRegister',\n * registry: { debug: true, maxHandlers: 10 }\n * })\n * \n * // Register handler with priority\n * register.register('updateUser', async (payload, controller) => {\n * await userService.update(payload.id, payload)\n * controller.setResult({ success: true, userId: payload.id })\n * }, { priority: 10, tags: ['user', 'crud'] })\n * \n * // Dispatch action\n * await register.dispatch('updateUser', { \n * id: '123', \n * name: 'John Doe', \n * email: 'john@example.com' \n * })\n * ```\n * \n * @example With Multiple Handlers\n * ```typescript\n * // High priority validation handler\n * register.register('updateUser', async (payload, controller) => {\n * if (!payload.email.includes('@')) {\n * controller.abort('Invalid email format')\n * return\n * }\n * }, { priority: 100, category: 'validation' })\n * \n * // Lower priority update handler\n * register.register('updateUser', async (payload, controller) => {\n * const user = await userService.update(payload.id, payload)\n * controller.setResult(user)\n * }, { priority: 50, category: 'business-logic' })\n * ```\n * \n * @example Advanced Configuration\n * ```typescript\n * const register = new ActionRegister<AppActions>({\n * name: 'AdvancedRegister',\n * registry: {\n * debug: true,\n * maxHandlers: 20,\n * defaultExecutionMode: 'parallel',\n * autoCleanup: true\n * }\n * })\n * \n * // Handler with debouncing and tags\n * register.register('searchUsers', async (payload, controller) => {\n * const results = await userService.search(payload.query)\n * controller.setResult(results)\n * }, {\n * priority: 10,\n * debounce: 300,\n * tags: ['search', 'user'],\n * category: 'query',\n * once: false\n * })\n * ```\n * \n * @public\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 // π λμμ± λ¬Έμ ν΄κ²°μ μν ν μμ€ν
\n private registrationQueue: OperationQueue;\n private dispatchQueue: OperationQueue;\n\n constructor(config: ActionRegisterConfig = {}) {\n this.name = config.name || 'ActionRegister';\n this.registryConfig = config.registry;\n this.actionGuard = new ActionGuard();\n \n // π ν μμ€ν
μ΄κΈ°ν\n this.registrationQueue = new OperationQueue(`${this.name}-Registration`);\n this.dispatchQueue = new OperationQueue(`${this.name}-Dispatch`);\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 concurrencyProtection: true // π λμμ± λ³΄νΈ νμ±ν\n });\n }\n }\n\n /**\n * Register an action handler with optional configuration\n * \n * @param action - The action type to register handler for\n * @param handler - The handler function to execute\n * @param config - Optional handler configuration including priority, tags, etc.\n * \n * @returns Unregister function to remove this handler\n * \n * @throws {Error} When maximum handlers limit is reached\n * \n * @example Basic Registration\n * ```typescript\n * const unregister = register.register('updateUser', async (payload, controller) => {\n * await userService.update(payload.id, payload)\n * })\n * \n * // Later remove the handler\n * unregister()\n * ```\n * \n * @example With Priority and Configuration\n * ```typescript\n * register.register('validateUser', async (payload, controller) => {\n * if (!payload.email) {\n * controller.abort('Email is required')\n * }\n * }, {\n * priority: 100,\n * tags: ['validation'],\n * category: 'security',\n * once: false\n * })\n * ```\n * \n * @public\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 // λκΈ°μ APIλ₯Ό μ μ§νλ©΄μ λ΄λΆμ μΌλ‘λ§ λμμ± λ³΄νΈ\n \n // Generate unique handler ID with security consideration\n const handlerId = config.id || `handler_${++this.handlerCounter}_${Math.random().toString(36).substr(2, 5)}`;\n \n // π μ¦μ λ±λ‘ μννλ μ λ ¬κΉμ§ ν λ²μ μ²λ¦¬\n const unregisterFn = this._performRegistrationSync(action, handler, config, handlerId);\n \n return unregisterFn;\n }\n\n /**\n * π λκΈ°μ λ±λ‘ μν (κ°μ λ λ²μ )\n */\n private _performRegistrationSync<K extends keyof T, R = void>(\n action: K,\n handler: ActionHandler<T[K], R>,\n config: HandlerConfig,\n handlerId: string\n ): UnregisterFunction {\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 // π μ¦μ μ λ ¬ (λμμ± λ³΄νΈ)\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 /**\n * π μ€μ λ±λ‘ μμ
μν (νμμ νΈμΆλ¨)\n * @deprecated Currently unused - reserved for future queue-based registration\n */\n private _performRegistration<K extends keyof T, R = void>(\n action: K,\n handler: ActionHandler<T[K], R>,\n config: HandlerConfig,\n handlerId: string\n ): UnregisterFunction {\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 /**\n * Dispatch an action with optional execution options\n * \n * @param action - The action type to dispatch\n * @param payload - The action payload data\n * @param options - Optional dispatch options (execution mode, filters, etc.)\n * \n * @returns Promise that resolves when all handlers complete\n * \n * @throws {Error} When action dispatching fails\n * \n * @example Basic Dispatch\n * ```typescript\n * await register.dispatch('updateUser', {\n * id: '123',\n * name: 'John Doe',\n * email: 'john@example.com'\n * })\n * ```\n * \n * @example With Options\n * ```typescript\n * await register.dispatch('updateUser', payload, {\n * executionMode: 'parallel',\n * timeout: 5000,\n * filter: {\n * tags: ['validation', 'business-logic'],\n * excludeCategory: 'analytics'\n * }\n * })\n * ```\n * \n * @example With Throttling\n * ```typescript\n * await register.dispatch('searchUsers', { query: 'john' }, {\n * throttle: 300,\n * debounce: 100\n * })\n * ```\n * \n * @public\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 // π λμ€ν¨μΉλ₯Ό νμ μΆκ°νμ¬ λμμ± λ³΄νΈ\n // λͺ¨λ λμ€ν¨μΉκ° μμ°¨μ μΌλ‘ μ€νλμ΄ race condition λ°©μ§\n return this.dispatchQueue.enqueue(async () => {\n return this._performDispatch(action, payload, options);\n });\n }\n\n /**\n * π μ€μ λμ€ν¨μΉ μμ
μν (νμμ νΈμΆλ¨)\n */\n private async _performDispatch<K extends keyof T>(\n action: K,\n payload?: T[K],\n options?: import('./types.js').DispatchOptions\n ): Promise<void> {\n // Enhanced debugging for object analysis\n if (payload && typeof payload === 'object' && payload !== null && \n (typeof process !== 'undefined' && process.env?.NODE_ENV === 'development')) {\n const isEvent = payload instanceof Event;\n const isElement = payload instanceof Element;\n const hasPreventDefault = typeof (payload as any).preventDefault === 'function';\n const hasStopPropagation = typeof (payload as any).stopPropagation === 'function';\n const hasCurrentTarget = (payload as any).currentTarget !== undefined;\n const hasTarget = (payload as any).target !== undefined;\n const targetType = hasTarget ? typeof (payload as any).target : 'undefined';\n const targetIsElement = hasTarget ? (payload as any).target instanceof Element : false;\n \n // Only log for debugging purposes when explicitly needed\n // Most cases (Event objects, regular data) are perfectly fine\n const hasUnexpectedStructure = false; // Currently no cases warrant warnings\n \n if (hasUnexpectedStructure) {\n console.warn(\n `[Context-Action] π Object analysis for action \"${String(action)}\" in registry \"${this.name}\":`,\n {\n isEvent,\n isElement, \n hasPreventDefault,\n hasStopPropagation,\n hasCurrentTarget,\n hasTarget,\n targetType,\n targetIsElement,\n payloadType: typeof payload,\n constructor: payload?.constructor?.name,\n keys: Object.keys(payload),\n payload: payload\n }\n );\n }\n \n // Optional: Deep analysis for nested objects containing DOM elements\n // This is informational only - nested DOM objects might cause cloning issues in specific contexts\n if ((typeof process !== 'undefined' && process.env?.DEBUG_CONTEXT_ACTION) || \n (typeof process !== 'undefined' && process.env?.NODE_ENV === 'development')) {\n const nestedDOMProperties: string[] = [];\n Object.keys(payload).forEach(key => {\n const prop = (payload as any)[key];\n if (prop instanceof Element || prop instanceof Event) {\n nestedDOMProperties.push(`${key}: ${prop instanceof Element ? 'Element' : 'Event'}`);\n }\n });\n \n if (nestedDOMProperties.length > 0) {\n console.debug(\n `[Context-Action] π Nested DOM objects in action \"${String(action)}\":`,\n {\n registry: this.name,\n nestedDOMProperties,\n note: 'This is informational - usually not a problem'\n }\n );\n }\n }\n }\n \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 console.log(`[ActionRegister] Pipeline execution succeeded for ${String(action)}`);\n } catch (error) {\n console.log(`[ActionRegister] Pipeline execution failed for ${String(action)}:`, 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 /**\n * Dispatch an action and return detailed execution results\n * \n * @param action - The action type to dispatch\n * @param payload - The action payload data\n * @param options - Optional dispatch options including result collection strategy\n * \n * @returns Promise resolving to comprehensive execution results\n * \n * @example Basic Result Collection\n * ```typescript\n * const result = await register.dispatchWithResult('updateUser', payload)\n * \n * if (result.success) {\n * console.log(`Executed ${result.execution.handlersExecuted} handlers`)\n * console.log(`Duration: ${result.execution.duration}ms`)\n * }\n * ```\n * \n * @example Advanced Result Processing\n * ```typescript\n * const result = await register.dispatchWithResult('processOrder', order, {\n * result: {\n * collect: true,\n * strategy: 'merge',\n * maxResults: 5,\n * merger: (results) => results.reduce((acc, curr) => ({ ...acc, ...curr }), {})\n * }\n * })\n * \n * if (result.terminated) {\n * console.log('Handler returned early:', result.result)\n * }\n * ```\n * \n * @public\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 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 /**\n * Get the number of registered handlers for an action\n * \n * @param action - The action type to count handlers for\n * \n * @returns Number of registered handlers\n * \n * @example\n * ```typescript\n * register.register('updateUser', handler1)\n * register.register('updateUser', handler2)\n * \n * console.log(register.getHandlerCount('updateUser')) // 2\n * ```\n * \n * @public\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 /**\n * Check if an action has any registered handlers\n * \n * @param action - The action type to check\n * \n * @returns True if action has handlers, false otherwise\n * \n * @example\n * ```typescript\n * if (register.hasHandlers('updateUser')) {\n * await register.dispatch('updateUser', userData)\n * }\n * ```\n * \n * @public\n */\n hasHandlers<K extends keyof T>(action: K): boolean {\n return this.getHandlerCount(action) > 0;\n }\n\n /**\n * Get all registered action types\n * \n * @returns Array of all registered action types\n * \n * @example\n * ```typescript\n * const actions = register.getRegisteredActions()\n * console.log('Registered actions:', actions) // ['updateUser', 'deleteUser', 'resetUser']\n * ```\n * \n * @public\n */\n getRegisteredActions(): (keyof T)[] {\n return Array.from(this.pipelines.keys());\n }\n\n /**\n * Remove all handlers for a specific action\n * \n * @param action - The action type to clear handlers for\n * \n * @example\n * ```typescript\n * register.clearAction('updateUser')\n * console.log(register.hasHandlers('updateUser')) // false\n * ```\n * \n * @public\n */\n clearAction<K extends keyof T>(action: K): void {\n this.pipelines.delete(action);\n }\n\n /**\n * Remove all handlers for all actions\n * \n * @example\n * ```typescript\n * register.clearAll()\n * console.log(register.getRegisteredActions().length) // 0\n * ```\n * \n * @public\n */\n clearAll(): void {\n this.pipelines.clear();\n }\n\n /**\n * Get the name of this action register\n * \n * @returns The register name\n * \n * @example\n * ```typescript\n * const register = new ActionRegister({ name: 'UserRegister' })\n * console.log(register.getName()) // 'UserRegister'\n * ```\n * \n * @public\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 totalHandlers: 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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,eAAsB,kBACpB,SACA,kBACe;CAEf,IAAI,IAAI;CACR,MAAMA,sBAAsC,EAAE;AAE9C,QAAO,IAAI,QAAQ,SAAS,QAAQ;AAElC,MAAI,QAAQ,WAAW,QAAQ,WAC7B;EAGF,MAAM,eAAe,QAAQ,SAAS;AACtC,UAAQ,eAAe;;AAGvB,MAAI,aAAa,OAAO,aAAa,CAAC,aAAa,OAAO,aAAa;AACrE;AACA;EACD;;AAGD,MAAI,aAAa,OAAO,cAAc,CAAC,aAAa,OAAO,WAAW,QAAQ,UAAU;AACtF;AACA;EACD;EAED,MAAM,aAAa,iBAAiB,cAAc;AAElD,MAAI;AAEF,OAAI,QAAQ,QACV;GAGF,MAAM,SAAS,aAAa,QAAQ,QAAQ,SAAS;;AAGrD,OAAI,aAAa,OAAO,YAAY,kBAAkB,SAAS;IAC7D,MAAM,gBAAgB,MAAM;;AAG5B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Q,IAAI,qCAAqC,OAAO,QAAQ,KAAK;CAExE;;;;;;;CAQD,uBAA0C,QAA0B;AAClE,SAAO,KAAK,qBAAqB,IAAI,WAAW,KAAK;CACtD;;;;;;CAOD,0BAA6C,QAAiB;AAC5D,OAAK,qBAAqB,OAAO;AAEjC,MAAI,KAAK,gBAAgB,SAAS,QAAQ,IAAI,aAAa,cACzD,SAAQ,IAAI,uCAAuC,OAAO,QAAQ,gBAAgB,KAAK;CAE1F;;;;CAKD,sBAA4B;AAC1B,OAAK,eAAe;AAEpB,MAAI,KAAK,gBAAgB,SAAS,QAAQ,IAAI,aAAa,cACzD,SAAQ,IAAI,iDAAiD,KAAK;CAErE;;;;;;CAOD,0BAA6C,QAAiB;AAC5D,OAAK,eAAe,OAAO;AAE3B,MAAI,KAAK,gBAAgB,SAAS,QAAQ,IAAI,aAAa,cACzD,SAAQ,IAAI,+CAA+C,OAAO;CAErE;;;;;;CAOD,oBAAsD;AACpD,SAAO,KAAK;CACb;;;;;;CAOD,iBAA0B;AACxB,SAAO,QAAQ,KAAK,gBAAgB,SAAS,QAAQ,IAAI,aAAa;CACvE;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@context-action/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Type-safe action pipeline management library for JavaScript/TypeScript",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"engines": {
|
|
76
76
|
"node": ">=18.0.0"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "a1d9c26ca7d1a7957f94b7b15af6946b91c686a6"
|
|
79
79
|
}
|