@cadenza.io/core 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +20 -12
- package/dist/index.d.ts +20 -12
- package/dist/index.js +351 -141
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +351 -141
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -163,6 +163,7 @@ declare abstract class GraphLayer extends ExecutionChain implements Graph {
|
|
|
163
163
|
get hasPreceding(): boolean;
|
|
164
164
|
getNumberOfNodes(): number;
|
|
165
165
|
getNodesByRoutineExecId(routineExecId: string): GraphNode[];
|
|
166
|
+
getIdenticalNodes(node: GraphNode): GraphNode[];
|
|
166
167
|
isProcessed(): boolean;
|
|
167
168
|
graphDone(): boolean;
|
|
168
169
|
setNext(next: GraphLayer): void;
|
|
@@ -411,11 +412,14 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
411
412
|
concurrency: number;
|
|
412
413
|
timeout: number;
|
|
413
414
|
readonly isMeta: boolean;
|
|
415
|
+
readonly isSubMeta: boolean;
|
|
416
|
+
readonly isHidden: boolean;
|
|
414
417
|
readonly isUnique: boolean;
|
|
415
418
|
readonly throttled: boolean;
|
|
416
419
|
readonly isSignal: boolean;
|
|
417
420
|
readonly isDeputy: boolean;
|
|
418
421
|
readonly isEphemeral: boolean;
|
|
422
|
+
readonly isDebounce: boolean;
|
|
419
423
|
protected inputContextSchema: SchemaDefinition | undefined;
|
|
420
424
|
protected validateInputContext: boolean;
|
|
421
425
|
protected outputContextSchema: SchemaDefinition | undefined;
|
|
@@ -441,6 +445,8 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
441
445
|
* @param register Register via signal (default true).
|
|
442
446
|
* @param isUnique
|
|
443
447
|
* @param isMeta
|
|
448
|
+
* @param isSubMeta
|
|
449
|
+
* @param isHidden
|
|
444
450
|
* @param getTagCallback
|
|
445
451
|
* @param inputSchema
|
|
446
452
|
* @param validateInputContext
|
|
@@ -452,7 +458,7 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
452
458
|
* @param retryDelayFactor
|
|
453
459
|
* @edge Emits 'meta.task.created' with { __task: this } for seed.
|
|
454
460
|
*/
|
|
455
|
-
constructor(name: string, task: TaskFunction, description?: string, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, getTagCallback?: ThrottleTagGetter | undefined, inputSchema?: SchemaDefinition | undefined, validateInputContext?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputContext?: boolean, retryCount?: number, retryDelay?: number, retryDelayMax?: number, retryDelayFactor?: number);
|
|
461
|
+
constructor(name: string, task: TaskFunction, description?: string, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, isSubMeta?: boolean, isHidden?: boolean, getTagCallback?: ThrottleTagGetter | undefined, inputSchema?: SchemaDefinition | undefined, validateInputContext?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputContext?: boolean, retryCount?: number, retryDelay?: number, retryDelayMax?: number, retryDelayFactor?: number);
|
|
456
462
|
getTag(context?: AnyObject): string;
|
|
457
463
|
setGlobalId(id: string): void;
|
|
458
464
|
setTimeout(timeout: number): void;
|
|
@@ -729,17 +735,21 @@ declare class DebounceTask extends Task {
|
|
|
729
735
|
private lastTimeout;
|
|
730
736
|
private lastProgressCallback;
|
|
731
737
|
private lastEmitFunction;
|
|
732
|
-
constructor(name: string, task: TaskFunction, description?: string, debounceTime?: number, leading?: boolean, trailing?: boolean, maxWait?: number, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, inputSchema?: SchemaDefinition | undefined, validateInputSchema?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputSchema?: boolean);
|
|
738
|
+
constructor(name: string, task: TaskFunction, description?: string, debounceTime?: number, leading?: boolean, trailing?: boolean, maxWait?: number, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, isSubMeta?: boolean, isHidden?: boolean, inputSchema?: SchemaDefinition | undefined, validateInputSchema?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputSchema?: boolean);
|
|
733
739
|
private executeFunction;
|
|
734
740
|
private debouncedTrigger;
|
|
735
741
|
execute(context: GraphContext, emit: (signal: string, context: any) => void, progressCallback: (progress: number) => void): TaskResult;
|
|
736
742
|
}
|
|
737
743
|
|
|
744
|
+
type EphemeralTaskOptions = {
|
|
745
|
+
once?: boolean;
|
|
746
|
+
destroyCondition?: (context: any) => boolean;
|
|
747
|
+
};
|
|
738
748
|
declare class EphemeralTask extends Task {
|
|
739
749
|
private readonly once;
|
|
740
750
|
private readonly condition;
|
|
741
751
|
readonly isEphemeral: boolean;
|
|
742
|
-
constructor(name: string, task: TaskFunction, description?: string, once?: boolean, condition?: (context: any) => boolean, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, getTagCallback?: ThrottleTagGetter | undefined, inputSchema?: SchemaDefinition | undefined, validateInputContext?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputContext?: boolean, retryCount?: number, retryDelay?: number, retryDelayMax?: number, retryDelayFactor?: number);
|
|
752
|
+
constructor(name: string, task: TaskFunction, description?: string, once?: boolean, condition?: (context: any) => boolean, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, isSubMeta?: boolean, isHidden?: boolean, getTagCallback?: ThrottleTagGetter | undefined, inputSchema?: SchemaDefinition | undefined, validateInputContext?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputContext?: boolean, retryCount?: number, retryDelay?: number, retryDelayMax?: number, retryDelayFactor?: number);
|
|
743
753
|
execute(context: any, emit: (signal: string, context: AnyObject) => void, progressCallback: (progress: number) => void): TaskResult;
|
|
744
754
|
}
|
|
745
755
|
|
|
@@ -761,6 +771,8 @@ interface TaskOptions {
|
|
|
761
771
|
register?: boolean;
|
|
762
772
|
isUnique?: boolean;
|
|
763
773
|
isMeta?: boolean;
|
|
774
|
+
isSubMeta?: boolean;
|
|
775
|
+
isHidden?: boolean;
|
|
764
776
|
getTagCallback?: ThrottleTagGetter;
|
|
765
777
|
inputSchema?: SchemaDefinition;
|
|
766
778
|
validateInputContext?: boolean;
|
|
@@ -880,24 +892,20 @@ declare class Cadenza {
|
|
|
880
892
|
* @param name Identifier (may not be unique if not registered).
|
|
881
893
|
* @param func Function.
|
|
882
894
|
* @param description Optional.
|
|
883
|
-
* @param
|
|
884
|
-
* @param destroyCondition Predicate for destruction (default always true).
|
|
885
|
-
* @param options Optional task options.
|
|
895
|
+
* @param options Optional task options plus optional "once" (true) and "destroyCondition" (ctx => boolean).
|
|
886
896
|
* @returns The created EphemeralTask.
|
|
887
897
|
* @edge Destruction triggered post-exec via Node/Builder; emits meta-signal for cleanup.
|
|
888
898
|
*/
|
|
889
|
-
static createEphemeralTask(name: string, func: TaskFunction, description?: string,
|
|
899
|
+
static createEphemeralTask(name: string, func: TaskFunction, description?: string, options?: TaskOptions & EphemeralTaskOptions): EphemeralTask;
|
|
890
900
|
/**
|
|
891
901
|
* Creates an EphemeralMetaTask for meta-layer transients.
|
|
892
902
|
* @param name Identifier.
|
|
893
903
|
* @param func Function.
|
|
894
904
|
* @param description Optional.
|
|
895
|
-
* @param once
|
|
896
|
-
* @param destroyCondition Destruction predicate.
|
|
897
|
-
* @param options Optional task options.
|
|
905
|
+
* @param options Optional task options plus optional "once" (true) and "destroyCondition" (ctx => boolean).
|
|
898
906
|
* @returns The created EphemeralMetaTask.
|
|
899
907
|
*/
|
|
900
|
-
static createEphemeralMetaTask(name: string, func: TaskFunction, description?: string,
|
|
908
|
+
static createEphemeralMetaTask(name: string, func: TaskFunction, description?: string, options?: TaskOptions & EphemeralTaskOptions): EphemeralTask;
|
|
901
909
|
/**
|
|
902
910
|
* Creates a GraphRoutine (named entry to starting tasks) and registers it.
|
|
903
911
|
* @param name Unique identifier.
|
|
@@ -922,4 +930,4 @@ declare class SignalTask extends Task {
|
|
|
922
930
|
constructor(signal: string, description?: string);
|
|
923
931
|
}
|
|
924
932
|
|
|
925
|
-
export { type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, EphemeralTask, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type SchemaConstraints, type SchemaDefinition, type SchemaType, SignalBroker, SignalEmitter, SignalParticipant, SignalTask, Task, type TaskFunction, type TaskOptions, type TaskResult, type ThrottleTagGetter, Cadenza as default };
|
|
933
|
+
export { type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, EphemeralTask, type EphemeralTaskOptions, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type SchemaConstraints, type SchemaDefinition, type SchemaType, SignalBroker, SignalEmitter, SignalParticipant, SignalTask, Task, type TaskFunction, type TaskOptions, type TaskResult, type ThrottleTagGetter, Cadenza as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -163,6 +163,7 @@ declare abstract class GraphLayer extends ExecutionChain implements Graph {
|
|
|
163
163
|
get hasPreceding(): boolean;
|
|
164
164
|
getNumberOfNodes(): number;
|
|
165
165
|
getNodesByRoutineExecId(routineExecId: string): GraphNode[];
|
|
166
|
+
getIdenticalNodes(node: GraphNode): GraphNode[];
|
|
166
167
|
isProcessed(): boolean;
|
|
167
168
|
graphDone(): boolean;
|
|
168
169
|
setNext(next: GraphLayer): void;
|
|
@@ -411,11 +412,14 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
411
412
|
concurrency: number;
|
|
412
413
|
timeout: number;
|
|
413
414
|
readonly isMeta: boolean;
|
|
415
|
+
readonly isSubMeta: boolean;
|
|
416
|
+
readonly isHidden: boolean;
|
|
414
417
|
readonly isUnique: boolean;
|
|
415
418
|
readonly throttled: boolean;
|
|
416
419
|
readonly isSignal: boolean;
|
|
417
420
|
readonly isDeputy: boolean;
|
|
418
421
|
readonly isEphemeral: boolean;
|
|
422
|
+
readonly isDebounce: boolean;
|
|
419
423
|
protected inputContextSchema: SchemaDefinition | undefined;
|
|
420
424
|
protected validateInputContext: boolean;
|
|
421
425
|
protected outputContextSchema: SchemaDefinition | undefined;
|
|
@@ -441,6 +445,8 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
441
445
|
* @param register Register via signal (default true).
|
|
442
446
|
* @param isUnique
|
|
443
447
|
* @param isMeta
|
|
448
|
+
* @param isSubMeta
|
|
449
|
+
* @param isHidden
|
|
444
450
|
* @param getTagCallback
|
|
445
451
|
* @param inputSchema
|
|
446
452
|
* @param validateInputContext
|
|
@@ -452,7 +458,7 @@ declare class Task extends SignalParticipant implements Graph {
|
|
|
452
458
|
* @param retryDelayFactor
|
|
453
459
|
* @edge Emits 'meta.task.created' with { __task: this } for seed.
|
|
454
460
|
*/
|
|
455
|
-
constructor(name: string, task: TaskFunction, description?: string, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, getTagCallback?: ThrottleTagGetter | undefined, inputSchema?: SchemaDefinition | undefined, validateInputContext?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputContext?: boolean, retryCount?: number, retryDelay?: number, retryDelayMax?: number, retryDelayFactor?: number);
|
|
461
|
+
constructor(name: string, task: TaskFunction, description?: string, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, isSubMeta?: boolean, isHidden?: boolean, getTagCallback?: ThrottleTagGetter | undefined, inputSchema?: SchemaDefinition | undefined, validateInputContext?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputContext?: boolean, retryCount?: number, retryDelay?: number, retryDelayMax?: number, retryDelayFactor?: number);
|
|
456
462
|
getTag(context?: AnyObject): string;
|
|
457
463
|
setGlobalId(id: string): void;
|
|
458
464
|
setTimeout(timeout: number): void;
|
|
@@ -729,17 +735,21 @@ declare class DebounceTask extends Task {
|
|
|
729
735
|
private lastTimeout;
|
|
730
736
|
private lastProgressCallback;
|
|
731
737
|
private lastEmitFunction;
|
|
732
|
-
constructor(name: string, task: TaskFunction, description?: string, debounceTime?: number, leading?: boolean, trailing?: boolean, maxWait?: number, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, inputSchema?: SchemaDefinition | undefined, validateInputSchema?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputSchema?: boolean);
|
|
738
|
+
constructor(name: string, task: TaskFunction, description?: string, debounceTime?: number, leading?: boolean, trailing?: boolean, maxWait?: number, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, isSubMeta?: boolean, isHidden?: boolean, inputSchema?: SchemaDefinition | undefined, validateInputSchema?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputSchema?: boolean);
|
|
733
739
|
private executeFunction;
|
|
734
740
|
private debouncedTrigger;
|
|
735
741
|
execute(context: GraphContext, emit: (signal: string, context: any) => void, progressCallback: (progress: number) => void): TaskResult;
|
|
736
742
|
}
|
|
737
743
|
|
|
744
|
+
type EphemeralTaskOptions = {
|
|
745
|
+
once?: boolean;
|
|
746
|
+
destroyCondition?: (context: any) => boolean;
|
|
747
|
+
};
|
|
738
748
|
declare class EphemeralTask extends Task {
|
|
739
749
|
private readonly once;
|
|
740
750
|
private readonly condition;
|
|
741
751
|
readonly isEphemeral: boolean;
|
|
742
|
-
constructor(name: string, task: TaskFunction, description?: string, once?: boolean, condition?: (context: any) => boolean, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, getTagCallback?: ThrottleTagGetter | undefined, inputSchema?: SchemaDefinition | undefined, validateInputContext?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputContext?: boolean, retryCount?: number, retryDelay?: number, retryDelayMax?: number, retryDelayFactor?: number);
|
|
752
|
+
constructor(name: string, task: TaskFunction, description?: string, once?: boolean, condition?: (context: any) => boolean, concurrency?: number, timeout?: number, register?: boolean, isUnique?: boolean, isMeta?: boolean, isSubMeta?: boolean, isHidden?: boolean, getTagCallback?: ThrottleTagGetter | undefined, inputSchema?: SchemaDefinition | undefined, validateInputContext?: boolean, outputSchema?: SchemaDefinition | undefined, validateOutputContext?: boolean, retryCount?: number, retryDelay?: number, retryDelayMax?: number, retryDelayFactor?: number);
|
|
743
753
|
execute(context: any, emit: (signal: string, context: AnyObject) => void, progressCallback: (progress: number) => void): TaskResult;
|
|
744
754
|
}
|
|
745
755
|
|
|
@@ -761,6 +771,8 @@ interface TaskOptions {
|
|
|
761
771
|
register?: boolean;
|
|
762
772
|
isUnique?: boolean;
|
|
763
773
|
isMeta?: boolean;
|
|
774
|
+
isSubMeta?: boolean;
|
|
775
|
+
isHidden?: boolean;
|
|
764
776
|
getTagCallback?: ThrottleTagGetter;
|
|
765
777
|
inputSchema?: SchemaDefinition;
|
|
766
778
|
validateInputContext?: boolean;
|
|
@@ -880,24 +892,20 @@ declare class Cadenza {
|
|
|
880
892
|
* @param name Identifier (may not be unique if not registered).
|
|
881
893
|
* @param func Function.
|
|
882
894
|
* @param description Optional.
|
|
883
|
-
* @param
|
|
884
|
-
* @param destroyCondition Predicate for destruction (default always true).
|
|
885
|
-
* @param options Optional task options.
|
|
895
|
+
* @param options Optional task options plus optional "once" (true) and "destroyCondition" (ctx => boolean).
|
|
886
896
|
* @returns The created EphemeralTask.
|
|
887
897
|
* @edge Destruction triggered post-exec via Node/Builder; emits meta-signal for cleanup.
|
|
888
898
|
*/
|
|
889
|
-
static createEphemeralTask(name: string, func: TaskFunction, description?: string,
|
|
899
|
+
static createEphemeralTask(name: string, func: TaskFunction, description?: string, options?: TaskOptions & EphemeralTaskOptions): EphemeralTask;
|
|
890
900
|
/**
|
|
891
901
|
* Creates an EphemeralMetaTask for meta-layer transients.
|
|
892
902
|
* @param name Identifier.
|
|
893
903
|
* @param func Function.
|
|
894
904
|
* @param description Optional.
|
|
895
|
-
* @param once
|
|
896
|
-
* @param destroyCondition Destruction predicate.
|
|
897
|
-
* @param options Optional task options.
|
|
905
|
+
* @param options Optional task options plus optional "once" (true) and "destroyCondition" (ctx => boolean).
|
|
898
906
|
* @returns The created EphemeralMetaTask.
|
|
899
907
|
*/
|
|
900
|
-
static createEphemeralMetaTask(name: string, func: TaskFunction, description?: string,
|
|
908
|
+
static createEphemeralMetaTask(name: string, func: TaskFunction, description?: string, options?: TaskOptions & EphemeralTaskOptions): EphemeralTask;
|
|
901
909
|
/**
|
|
902
910
|
* Creates a GraphRoutine (named entry to starting tasks) and registers it.
|
|
903
911
|
* @param name Unique identifier.
|
|
@@ -922,4 +930,4 @@ declare class SignalTask extends Task {
|
|
|
922
930
|
constructor(signal: string, description?: string);
|
|
923
931
|
}
|
|
924
932
|
|
|
925
|
-
export { type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, EphemeralTask, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type SchemaConstraints, type SchemaDefinition, type SchemaType, SignalBroker, SignalEmitter, SignalParticipant, SignalTask, Task, type TaskFunction, type TaskOptions, type TaskResult, type ThrottleTagGetter, Cadenza as default };
|
|
933
|
+
export { type AnyObject, type CadenzaMode, type DebounceOptions, DebounceTask, EphemeralTask, type EphemeralTaskOptions, GraphContext, GraphRegistry, GraphRoutine, GraphRun, GraphRunner, type SchemaConstraints, type SchemaDefinition, type SchemaType, SignalBroker, SignalEmitter, SignalParticipant, SignalTask, Task, type TaskFunction, type TaskOptions, type TaskResult, type ThrottleTagGetter, Cadenza as default };
|