@sdux-vault/shared 0.6.0 → 0.7.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/fesm2022/sdux-vault-shared.mjs +248 -232
- package/fesm2022/sdux-vault-shared.mjs.map +1 -1
- package/package.json +26 -2
- package/types/sdux-vault-shared.d.ts +1116 -122
|
@@ -5,6 +5,7 @@ import { Observable, Subject } from 'rxjs';
|
|
|
5
5
|
* This declaration defines the global attachment points used to expose runtime singletons.
|
|
6
6
|
*/
|
|
7
7
|
declare global {
|
|
8
|
+
/** Augments the global Window with an optional SDuX runtime attachment point. */
|
|
8
9
|
interface Window {
|
|
9
10
|
/**
|
|
10
11
|
* Optional container for globally exposed SDuX runtime instances.
|
|
@@ -22,17 +23,21 @@ declare global {
|
|
|
22
23
|
* in Vault license validation (behaviors and controllers).
|
|
23
24
|
*/
|
|
24
25
|
interface LicensableClassContext {
|
|
26
|
+
/** Key identifying the FeatureCell subject to license validation. */
|
|
25
27
|
readonly featureCellKey: string;
|
|
28
|
+
/** Optional license payload provided during FeatureCell registration. */
|
|
26
29
|
readonly licensePayload?: unknown;
|
|
27
30
|
}
|
|
28
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Context provided to behavior class constructors during instantiation.
|
|
34
|
+
*/
|
|
29
35
|
interface BehaviorClassContext extends LicensableClassContext {
|
|
30
|
-
/**
|
|
31
|
-
* The unique key of the FeatureCell that this behavior instance is
|
|
32
|
-
* operating within. Used to scope behavior execution to a specific cell.
|
|
33
|
-
*/
|
|
36
|
+
/** Key of the FeatureCell this behavior instance operates within. */
|
|
34
37
|
readonly featureCellKey: string;
|
|
38
|
+
/** Optional consumer-supplied configuration for this behavior. */
|
|
35
39
|
readonly behaviorConfig?: unknown;
|
|
40
|
+
/** Optional license payload for behaviors requiring license validation. */
|
|
36
41
|
readonly licensePayload?: unknown;
|
|
37
42
|
}
|
|
38
43
|
|
|
@@ -80,9 +85,6 @@ interface VaultErrorShape {
|
|
|
80
85
|
* Defines the immutable snapshot shape representing FeatureCell state at a specific moment.
|
|
81
86
|
* This interface exposes loading, value, and error indicators used by consumers to reason about current state.
|
|
82
87
|
*
|
|
83
|
-
* --RelatedStart--
|
|
84
|
-
* VaultErrorShape
|
|
85
|
-
* --RelatedEnd--
|
|
86
88
|
*/
|
|
87
89
|
interface StateSnapshotShape<T> {
|
|
88
90
|
/**
|
|
@@ -119,6 +121,7 @@ interface StateSnapshotShape<T> {
|
|
|
119
121
|
*/
|
|
120
122
|
type VaultErrorCallback<T> = (error: VaultErrorShape, state: Readonly<StateSnapshotShape<T>>) => void;
|
|
121
123
|
|
|
124
|
+
/** Enumeration of state emission event classifications. */
|
|
122
125
|
declare const StateEmitTypes: {
|
|
123
126
|
readonly IncomingPipeline: "Incoming Pipeline";
|
|
124
127
|
readonly FinalizePipeline: "Finalize Pipeline";
|
|
@@ -129,19 +132,26 @@ declare const StateEmitTypes: {
|
|
|
129
132
|
readonly DenyController: "Deny Controller";
|
|
130
133
|
readonly TabSync: "Tab Sync";
|
|
131
134
|
};
|
|
135
|
+
/** Union type derived from StateEmitTypes values. */
|
|
132
136
|
type StateEmitType = (typeof StateEmitTypes)[keyof typeof StateEmitTypes];
|
|
133
137
|
|
|
138
|
+
/** Shape wrapping a state snapshot with its emission type and options. */
|
|
134
139
|
interface StateEmitSnapshotShape<T> {
|
|
140
|
+
/** The state snapshot at the time of emission. */
|
|
135
141
|
snapshot: StateSnapshotShape<T>;
|
|
142
|
+
/** Optional configuration passed with the emission. */
|
|
136
143
|
options: unknown | undefined;
|
|
144
|
+
/** Classification of the state emission event. */
|
|
137
145
|
type: StateEmitType;
|
|
138
146
|
}
|
|
139
147
|
|
|
148
|
+
/** Enumeration of pipeline operation modes. */
|
|
140
149
|
declare const OperationTypes: {
|
|
141
150
|
readonly Merge: "merge";
|
|
142
151
|
readonly Replace: "replace";
|
|
143
152
|
readonly Initialize: "initialize";
|
|
144
153
|
};
|
|
154
|
+
/** Union type derived from OperationTypes values. */
|
|
145
155
|
type OperationType = (typeof OperationTypes)[keyof typeof OperationTypes];
|
|
146
156
|
|
|
147
157
|
/**
|
|
@@ -217,6 +227,7 @@ interface HttpResourceRefShape<T> {
|
|
|
217
227
|
hasValue(): boolean;
|
|
218
228
|
}
|
|
219
229
|
|
|
230
|
+
/** Factory function type that lazily produces a state value or a Promise of one. */
|
|
220
231
|
type DeferredType<T> = () => T | undefined | null | Promise<T | undefined | null>;
|
|
221
232
|
|
|
222
233
|
/**
|
|
@@ -239,12 +250,14 @@ interface StateInputShape<T> {
|
|
|
239
250
|
error?: unknown;
|
|
240
251
|
}
|
|
241
252
|
|
|
253
|
+
/** Shape wrapping a deferred value factory with optional loading and error state. */
|
|
242
254
|
type DeferredFactory<T> = Partial<{
|
|
243
255
|
loading: boolean;
|
|
244
256
|
value: DeferredType<T>;
|
|
245
257
|
error: unknown;
|
|
246
258
|
}>;
|
|
247
259
|
|
|
260
|
+
/** Union of all accepted state input forms for pipeline ingestion. */
|
|
248
261
|
type StateInputType<T> = T | StateInputShape<T> | DeferredFactory<T> | DeferredType<T> | HttpResourceRefShape<T> | Observable<T> | undefined | null;
|
|
249
262
|
|
|
250
263
|
/**
|
|
@@ -333,20 +346,34 @@ interface InsightConfig {
|
|
|
333
346
|
wantsErrors?: boolean;
|
|
334
347
|
}
|
|
335
348
|
|
|
349
|
+
/** Enumeration of conductor decision outcomes after controller voting. */
|
|
336
350
|
declare const DecisionOutcomeTypes: {
|
|
337
351
|
readonly Abort: "abort";
|
|
338
352
|
readonly Abstain: "abstain";
|
|
339
353
|
readonly Deny: "deny";
|
|
340
354
|
};
|
|
355
|
+
/** Union type derived from DecisionOutcomeTypes values. */
|
|
341
356
|
type DecisionOutcomeType = (typeof DecisionOutcomeTypes)[keyof typeof DecisionOutcomeTypes];
|
|
342
357
|
|
|
358
|
+
/** Shape representing the outcome of a controller voting round. */
|
|
343
359
|
interface ControllerDecisionShape {
|
|
360
|
+
/** Trace identifier for the pipeline operation under evaluation. */
|
|
344
361
|
traceId: string;
|
|
362
|
+
/** Normalized decision outcome used by the conductor. */
|
|
345
363
|
outcome: DecisionOutcomeType;
|
|
346
364
|
}
|
|
347
365
|
|
|
366
|
+
/**
|
|
367
|
+
* Context supplied to a controller during pipeline admission voting.
|
|
368
|
+
*/
|
|
348
369
|
interface ControllerContext<T> {
|
|
370
|
+
/**
|
|
371
|
+
* Trace identifier for the current pipeline operation.
|
|
372
|
+
*/
|
|
349
373
|
traceId: string;
|
|
374
|
+
/**
|
|
375
|
+
* Key identifying the FeatureCell associated with this operation.
|
|
376
|
+
*/
|
|
350
377
|
featureCellKey: string;
|
|
351
378
|
/** Immutable snapshot of the current cell state. */
|
|
352
379
|
snapshot: Readonly<StateSnapshotShape<T>>;
|
|
@@ -356,100 +383,656 @@ interface ControllerContext<T> {
|
|
|
356
383
|
operation: OperationType;
|
|
357
384
|
}
|
|
358
385
|
|
|
386
|
+
/** Union of context types accepted by VaultMonitor lifecycle methods. */
|
|
359
387
|
type VaultMonitorContext<T> = BehaviorContext<T> | ControllerContext<T> | FeatureCellExtensionContext<T>;
|
|
360
388
|
|
|
361
389
|
/**
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
* This interface defines the full DevTools-visible monitoring API
|
|
365
|
-
* without exposing implementation details.
|
|
390
|
+
* Contract for the VaultMonitor singleton exposing the full DevTools-visible
|
|
391
|
+
* monitoring API without implementation details.
|
|
366
392
|
*/
|
|
367
393
|
interface VaultMonitorContract {
|
|
394
|
+
/**
|
|
395
|
+
* Activates global insight tracking with the supplied configuration.
|
|
396
|
+
*
|
|
397
|
+
* @param definition - The insight configuration to activate.
|
|
398
|
+
*/
|
|
368
399
|
activateGlobalInsights(definition: InsightConfig): void;
|
|
400
|
+
/**
|
|
401
|
+
* Signals the start of an after-tap lifecycle event.
|
|
402
|
+
*
|
|
403
|
+
* @param cell - The FeatureCell key.
|
|
404
|
+
* @param behaviorKey - The behavior key.
|
|
405
|
+
* @param ctx - The monitor context for this operation.
|
|
406
|
+
*/
|
|
369
407
|
startAfterTap<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
408
|
+
/**
|
|
409
|
+
* Signals the end of an after-tap lifecycle event.
|
|
410
|
+
*
|
|
411
|
+
* @param cell - The FeatureCell key.
|
|
412
|
+
* @param behaviorKey - The behavior key.
|
|
413
|
+
* @param ctx - The monitor context for this operation.
|
|
414
|
+
* @param payload - Optional result payload.
|
|
415
|
+
*/
|
|
370
416
|
endAfterTap<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
417
|
+
/**
|
|
418
|
+
* Signals the start of a before-tap lifecycle event.
|
|
419
|
+
*
|
|
420
|
+
* @param cell - The FeatureCell key.
|
|
421
|
+
* @param behaviorKey - The behavior key.
|
|
422
|
+
* @param ctx - The monitor context for this operation.
|
|
423
|
+
*/
|
|
371
424
|
startBeforeTap<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
425
|
+
/**
|
|
426
|
+
* Signals the end of a before-tap lifecycle event.
|
|
427
|
+
*
|
|
428
|
+
* @param cell - The FeatureCell key.
|
|
429
|
+
* @param behaviorKey - The behavior key.
|
|
430
|
+
* @param ctx - The monitor context for this operation.
|
|
431
|
+
* @param payload - Optional result payload.
|
|
432
|
+
*/
|
|
372
433
|
endBeforeTap<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
434
|
+
/**
|
|
435
|
+
* Signals the start of a compute-merge lifecycle event.
|
|
436
|
+
*
|
|
437
|
+
* @param cell - The FeatureCell key.
|
|
438
|
+
* @param behaviorKey - The behavior key.
|
|
439
|
+
* @param ctx - The monitor context for this operation.
|
|
440
|
+
*/
|
|
373
441
|
startComputeMerge<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
442
|
+
/**
|
|
443
|
+
* Signals the end of a compute-merge lifecycle event.
|
|
444
|
+
*
|
|
445
|
+
* @param cell - The FeatureCell key.
|
|
446
|
+
* @param behaviorKey - The behavior key.
|
|
447
|
+
* @param ctx - The monitor context for this operation.
|
|
448
|
+
*/
|
|
374
449
|
endComputeMerge<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
450
|
+
/**
|
|
451
|
+
* Signals the start of a clear-persist lifecycle event.
|
|
452
|
+
*
|
|
453
|
+
* @param cell - The FeatureCell key.
|
|
454
|
+
* @param behaviorKey - The behavior key.
|
|
455
|
+
* @param ctx - The monitor context for this operation.
|
|
456
|
+
*/
|
|
375
457
|
startClearPersist<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
458
|
+
/**
|
|
459
|
+
* Signals the end of a clear-persist lifecycle event.
|
|
460
|
+
*
|
|
461
|
+
* @param cell - The FeatureCell key.
|
|
462
|
+
* @param behaviorKey - The behavior key.
|
|
463
|
+
* @param ctx - The monitor context for this operation.
|
|
464
|
+
*/
|
|
376
465
|
endClearPersist<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
466
|
+
/**
|
|
467
|
+
* Signals the start of a core callback-error lifecycle event.
|
|
468
|
+
*
|
|
469
|
+
* @param cell - The FeatureCell key.
|
|
470
|
+
* @param behaviorKey - The behavior key.
|
|
471
|
+
* @param ctx - The monitor context for this operation.
|
|
472
|
+
*/
|
|
377
473
|
startCoreCallbackError<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
474
|
+
/**
|
|
475
|
+
* Signals the end of a core callback-error lifecycle event.
|
|
476
|
+
*
|
|
477
|
+
* @param cell - The FeatureCell key.
|
|
478
|
+
* @param behaviorKey - The behavior key.
|
|
479
|
+
* @param ctx - The monitor context for this operation.
|
|
480
|
+
*/
|
|
378
481
|
endCoreCallbackError<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
482
|
+
/**
|
|
483
|
+
* Signals the start of a core emit-state lifecycle event.
|
|
484
|
+
*
|
|
485
|
+
* @param cell - The FeatureCell key.
|
|
486
|
+
* @param behaviorKey - The behavior key.
|
|
487
|
+
* @param ctx - The monitor context for this operation.
|
|
488
|
+
*/
|
|
379
489
|
startCoreEmitState<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
490
|
+
/**
|
|
491
|
+
* Signals the end of a core emit-state lifecycle event.
|
|
492
|
+
*
|
|
493
|
+
* @param cell - The FeatureCell key.
|
|
494
|
+
* @param behaviorKey - The behavior key.
|
|
495
|
+
* @param ctx - The monitor context for this operation.
|
|
496
|
+
*/
|
|
380
497
|
endCoreEmitState<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
498
|
+
/**
|
|
499
|
+
* Signals the start of a core error lifecycle event.
|
|
500
|
+
*
|
|
501
|
+
* @param cell - The FeatureCell key.
|
|
502
|
+
* @param behaviorKey - The behavior key.
|
|
503
|
+
* @param ctx - The monitor context for this operation.
|
|
504
|
+
*/
|
|
381
505
|
startCoreError<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
506
|
+
/**
|
|
507
|
+
* Signals the end of a core error lifecycle event.
|
|
508
|
+
*
|
|
509
|
+
* @param cell - The FeatureCell key.
|
|
510
|
+
* @param behaviorKey - The behavior key.
|
|
511
|
+
* @param ctx - The monitor context for this operation.
|
|
512
|
+
*/
|
|
382
513
|
endCoreError<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
514
|
+
/**
|
|
515
|
+
* Signals the start of a core state lifecycle event.
|
|
516
|
+
*
|
|
517
|
+
* @param cell - The FeatureCell key.
|
|
518
|
+
* @param behaviorKey - The behavior key.
|
|
519
|
+
* @param ctx - The monitor context for this operation.
|
|
520
|
+
*/
|
|
383
521
|
startCoreState<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
522
|
+
/**
|
|
523
|
+
* Signals the end of a core state lifecycle event.
|
|
524
|
+
*
|
|
525
|
+
* @param cell - The FeatureCell key.
|
|
526
|
+
* @param behaviorKey - The behavior key.
|
|
527
|
+
* @param ctx - The monitor context for this operation.
|
|
528
|
+
*/
|
|
384
529
|
endCoreState<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
530
|
+
/**
|
|
531
|
+
* Signals the start of a destroy lifecycle event.
|
|
532
|
+
*
|
|
533
|
+
* @param cell - The FeatureCell key.
|
|
534
|
+
* @param behaviorKey - The behavior key.
|
|
535
|
+
* @param ctx - The monitor context for this operation.
|
|
536
|
+
*/
|
|
385
537
|
startDestroy<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
538
|
+
/**
|
|
539
|
+
* Signals the end of a destroy lifecycle event.
|
|
540
|
+
*
|
|
541
|
+
* @param cell - The FeatureCell key.
|
|
542
|
+
* @param behaviorKey - The behavior key.
|
|
543
|
+
* @param ctx - The monitor context for this operation.
|
|
544
|
+
* @param payload - Optional result payload.
|
|
545
|
+
*/
|
|
386
546
|
endDestroy<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
547
|
+
/**
|
|
548
|
+
* Signals the start of a decrypt lifecycle event.
|
|
549
|
+
*
|
|
550
|
+
* @param cell - The FeatureCell key.
|
|
551
|
+
* @param behaviorKey - The behavior key.
|
|
552
|
+
* @param ctx - The monitor context for this operation.
|
|
553
|
+
*/
|
|
387
554
|
startDecrypt<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
555
|
+
/**
|
|
556
|
+
* Signals the end of a decrypt lifecycle event.
|
|
557
|
+
*
|
|
558
|
+
* @param cell - The FeatureCell key.
|
|
559
|
+
* @param behaviorKey - The behavior key.
|
|
560
|
+
* @param ctx - The monitor context for this operation.
|
|
561
|
+
* @param payload - Optional result payload.
|
|
562
|
+
*/
|
|
388
563
|
endDecrypt<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
564
|
+
/**
|
|
565
|
+
* Signals the start of an encrypt lifecycle event.
|
|
566
|
+
*
|
|
567
|
+
* @param cell - The FeatureCell key.
|
|
568
|
+
* @param behaviorKey - The behavior key.
|
|
569
|
+
* @param ctx - The monitor context for this operation.
|
|
570
|
+
*/
|
|
389
571
|
startEncrypt<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
572
|
+
/**
|
|
573
|
+
* Signals the end of an encrypt lifecycle event.
|
|
574
|
+
*
|
|
575
|
+
* @param cell - The FeatureCell key.
|
|
576
|
+
* @param behaviorKey - The behavior key.
|
|
577
|
+
* @param ctx - The monitor context for this operation.
|
|
578
|
+
*/
|
|
390
579
|
endEncrypt<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
580
|
+
/**
|
|
581
|
+
* Signals the start of a filter lifecycle event.
|
|
582
|
+
*
|
|
583
|
+
* @param cell - The FeatureCell key.
|
|
584
|
+
* @param behaviorKey - The behavior key.
|
|
585
|
+
* @param ctx - The monitor context for this operation.
|
|
586
|
+
*/
|
|
391
587
|
startFilter<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
588
|
+
/**
|
|
589
|
+
* Signals the end of a filter lifecycle event.
|
|
590
|
+
*
|
|
591
|
+
* @param cell - The FeatureCell key.
|
|
592
|
+
* @param behaviorKey - The behavior key.
|
|
593
|
+
* @param ctx - The monitor context for this operation.
|
|
594
|
+
*/
|
|
392
595
|
endFilter<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
596
|
+
/**
|
|
597
|
+
* Signals the start of a global error lifecycle event.
|
|
598
|
+
*
|
|
599
|
+
* @param cell - The FeatureCell key.
|
|
600
|
+
* @param behaviorKey - The behavior key.
|
|
601
|
+
* @param ctx - The monitor context for this operation.
|
|
602
|
+
*/
|
|
393
603
|
startGlobalError<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
604
|
+
/**
|
|
605
|
+
* Signals the end of a global error lifecycle event.
|
|
606
|
+
*
|
|
607
|
+
* @param cell - The FeatureCell key.
|
|
608
|
+
* @param behaviorKey - The behavior key.
|
|
609
|
+
* @param ctx - The monitor context for this operation.
|
|
610
|
+
*/
|
|
394
611
|
endGlobalError<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
612
|
+
/**
|
|
613
|
+
* Records that an ingress source has been subscribed.
|
|
614
|
+
*
|
|
615
|
+
* @param cell - The FeatureCell key.
|
|
616
|
+
* @param behaviorKey - The behavior key.
|
|
617
|
+
* @param ctx - The monitor context for this operation.
|
|
618
|
+
* @param source - The ingress source identifier.
|
|
619
|
+
*/
|
|
395
620
|
ingressSubscribed<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, source: string): void;
|
|
621
|
+
/**
|
|
622
|
+
* Records that an ingress source has completed.
|
|
623
|
+
*
|
|
624
|
+
* @param cell - The FeatureCell key.
|
|
625
|
+
* @param behaviorKey - The behavior key.
|
|
626
|
+
* @param ctx - The monitor context for this operation.
|
|
627
|
+
* @param source - The ingress source identifier.
|
|
628
|
+
*/
|
|
396
629
|
ingressCompleted<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, source: string): void;
|
|
630
|
+
/**
|
|
631
|
+
* Signals the start of an interceptor lifecycle event.
|
|
632
|
+
*
|
|
633
|
+
* @param cell - The FeatureCell key.
|
|
634
|
+
* @param behaviorKey - The behavior key.
|
|
635
|
+
* @param ctx - The monitor context for this operation.
|
|
636
|
+
*/
|
|
397
637
|
startInterceptor<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
638
|
+
/**
|
|
639
|
+
* Signals the end of an interceptor lifecycle event.
|
|
640
|
+
*
|
|
641
|
+
* @param cell - The FeatureCell key.
|
|
642
|
+
* @param behaviorKey - The behavior key.
|
|
643
|
+
* @param ctx - The monitor context for this operation.
|
|
644
|
+
* @param payload - Optional result payload.
|
|
645
|
+
*/
|
|
398
646
|
endInterceptor<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
647
|
+
/**
|
|
648
|
+
* Signals the start of an initialized lifecycle event.
|
|
649
|
+
*
|
|
650
|
+
* @param cell - The FeatureCell key.
|
|
651
|
+
* @param behaviorKey - The behavior key.
|
|
652
|
+
* @param ctx - The monitor context for this operation.
|
|
653
|
+
*/
|
|
399
654
|
startInitialized<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
655
|
+
/**
|
|
656
|
+
* Signals the end of an initialized lifecycle event.
|
|
657
|
+
*
|
|
658
|
+
* @param cell - The FeatureCell key.
|
|
659
|
+
* @param behaviorKey - The behavior key.
|
|
660
|
+
* @param ctx - The monitor context for this operation.
|
|
661
|
+
* @param payload - Optional result payload.
|
|
662
|
+
*/
|
|
400
663
|
endInitialized<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
664
|
+
/**
|
|
665
|
+
* Signals the start of a load-persist lifecycle event.
|
|
666
|
+
*
|
|
667
|
+
* @param cell - The FeatureCell key.
|
|
668
|
+
* @param behaviorKey - The behavior key.
|
|
669
|
+
* @param ctx - The monitor context for this operation.
|
|
670
|
+
*/
|
|
401
671
|
startLoadPersist<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
672
|
+
/**
|
|
673
|
+
* Signals the end of a load-persist lifecycle event.
|
|
674
|
+
*
|
|
675
|
+
* @param cell - The FeatureCell key.
|
|
676
|
+
* @param behaviorKey - The behavior key.
|
|
677
|
+
* @param ctx - The monitor context for this operation.
|
|
678
|
+
* @param payload - Optional result payload.
|
|
679
|
+
*/
|
|
402
680
|
endLoadPersist<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
681
|
+
/**
|
|
682
|
+
* Signals the start of a merge lifecycle event.
|
|
683
|
+
*
|
|
684
|
+
* @param cell - The FeatureCell key.
|
|
685
|
+
* @param behaviorKey - The behavior key.
|
|
686
|
+
* @param ctx - The monitor context for this operation.
|
|
687
|
+
*/
|
|
403
688
|
startMerge<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
689
|
+
/**
|
|
690
|
+
* Signals the end of a merge lifecycle event.
|
|
691
|
+
*
|
|
692
|
+
* @param cell - The FeatureCell key.
|
|
693
|
+
* @param behaviorKey - The behavior key.
|
|
694
|
+
* @param ctx - The monitor context for this operation.
|
|
695
|
+
* @param payload - Optional result payload.
|
|
696
|
+
*/
|
|
404
697
|
endMerge<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
698
|
+
/**
|
|
699
|
+
* Signals the start of a persist lifecycle event.
|
|
700
|
+
*
|
|
701
|
+
* @param cell - The FeatureCell key.
|
|
702
|
+
* @param behaviorKey - The behavior key.
|
|
703
|
+
* @param ctx - The monitor context for this operation.
|
|
704
|
+
*/
|
|
405
705
|
startPersist<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
706
|
+
/**
|
|
707
|
+
* Signals the end of a persist lifecycle event.
|
|
708
|
+
*
|
|
709
|
+
* @param cell - The FeatureCell key.
|
|
710
|
+
* @param behaviorKey - The behavior key.
|
|
711
|
+
* @param ctx - The monitor context for this operation.
|
|
712
|
+
*/
|
|
406
713
|
endPersist<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
714
|
+
/**
|
|
715
|
+
* Signals the start of an operator lifecycle event.
|
|
716
|
+
*
|
|
717
|
+
* @param cell - The FeatureCell key.
|
|
718
|
+
* @param behaviorKey - The behavior key.
|
|
719
|
+
* @param ctx - The monitor context for this operation.
|
|
720
|
+
*/
|
|
407
721
|
startOperator<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
722
|
+
/**
|
|
723
|
+
* Signals the end of an operator lifecycle event.
|
|
724
|
+
*
|
|
725
|
+
* @param cell - The FeatureCell key.
|
|
726
|
+
* @param behaviorKey - The behavior key.
|
|
727
|
+
* @param ctx - The monitor context for this operation.
|
|
728
|
+
* @param payload - Optional result payload.
|
|
729
|
+
*/
|
|
408
730
|
endOperator<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
731
|
+
/**
|
|
732
|
+
* Signals the start of a persist lifecycle event.
|
|
733
|
+
*
|
|
734
|
+
* @param cell - The FeatureCell key.
|
|
735
|
+
* @param behaviorKey - The behavior key.
|
|
736
|
+
* @param ctx - The monitor context for this operation.
|
|
737
|
+
*/
|
|
409
738
|
startPersist<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
739
|
+
/**
|
|
740
|
+
* Signals the end of a persist lifecycle event.
|
|
741
|
+
*
|
|
742
|
+
* @param cell - The FeatureCell key.
|
|
743
|
+
* @param behaviorKey - The behavior key.
|
|
744
|
+
* @param ctx - The monitor context for this operation.
|
|
745
|
+
*/
|
|
410
746
|
endPersist<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
747
|
+
/**
|
|
748
|
+
* Signals the start of a reducer lifecycle event.
|
|
749
|
+
*
|
|
750
|
+
* @param cell - The FeatureCell key.
|
|
751
|
+
* @param behaviorKey - The behavior key.
|
|
752
|
+
* @param ctx - The monitor context for this operation.
|
|
753
|
+
*/
|
|
411
754
|
startReducer<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
755
|
+
/**
|
|
756
|
+
* Signals the end of a reducer lifecycle event.
|
|
757
|
+
*
|
|
758
|
+
* @param cell - The FeatureCell key.
|
|
759
|
+
* @param behaviorKey - The behavior key.
|
|
760
|
+
* @param ctx - The monitor context for this operation.
|
|
761
|
+
*/
|
|
412
762
|
endReducer<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
763
|
+
/**
|
|
764
|
+
* Registers a FeatureCell for monitoring.
|
|
765
|
+
*
|
|
766
|
+
* @param cellKey - The FeatureCell key to register.
|
|
767
|
+
* @param insight - Optional insight configuration for the cell.
|
|
768
|
+
*/
|
|
413
769
|
registerCell(cellKey: string, insight?: InsightConfig): void;
|
|
770
|
+
/**
|
|
771
|
+
* Signals the start of a replace lifecycle event.
|
|
772
|
+
*
|
|
773
|
+
* @param cell - The FeatureCell key.
|
|
774
|
+
* @param behaviorKey - The behavior key.
|
|
775
|
+
* @param ctx - The monitor context for this operation.
|
|
776
|
+
*/
|
|
414
777
|
startReplace<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
778
|
+
/**
|
|
779
|
+
* Signals the end of a replace lifecycle event.
|
|
780
|
+
*
|
|
781
|
+
* @param cell - The FeatureCell key.
|
|
782
|
+
* @param behaviorKey - The behavior key.
|
|
783
|
+
* @param ctx - The monitor context for this operation.
|
|
784
|
+
* @param payload - Optional result payload.
|
|
785
|
+
*/
|
|
415
786
|
endReplace<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
787
|
+
/**
|
|
788
|
+
* Signals the start of a reset lifecycle event.
|
|
789
|
+
*
|
|
790
|
+
* @param cell - The FeatureCell key.
|
|
791
|
+
* @param behaviorKey - The behavior key.
|
|
792
|
+
* @param ctx - The monitor context for this operation.
|
|
793
|
+
*/
|
|
416
794
|
startReset<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
795
|
+
/**
|
|
796
|
+
* Signals the end of a reset lifecycle event.
|
|
797
|
+
*
|
|
798
|
+
* @param cell - The FeatureCell key.
|
|
799
|
+
* @param behaviorKey - The behavior key.
|
|
800
|
+
* @param ctx - The monitor context for this operation.
|
|
801
|
+
* @param payload - Optional result payload.
|
|
802
|
+
*/
|
|
417
803
|
endReset<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
804
|
+
/**
|
|
805
|
+
* Signals the start of a resolve lifecycle event.
|
|
806
|
+
*
|
|
807
|
+
* @param cell - The FeatureCell key.
|
|
808
|
+
* @param behaviorKey - The behavior key.
|
|
809
|
+
* @param ctx - The monitor context for this operation.
|
|
810
|
+
*/
|
|
418
811
|
startResolve<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
812
|
+
/**
|
|
813
|
+
* Signals the end of a resolve lifecycle event.
|
|
814
|
+
*
|
|
815
|
+
* @param cell - The FeatureCell key.
|
|
816
|
+
* @param behaviorKey - The behavior key.
|
|
817
|
+
* @param ctx - The monitor context for this operation.
|
|
818
|
+
*/
|
|
419
819
|
endResolve<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
820
|
+
/**
|
|
821
|
+
* Signals the start of a set-initial-value lifecycle event.
|
|
822
|
+
*
|
|
823
|
+
* @param cell - The FeatureCell key.
|
|
824
|
+
* @param behaviorKey - The behavior key.
|
|
825
|
+
* @param ctx - The monitor context for this operation.
|
|
826
|
+
*/
|
|
420
827
|
startSetInitialValue<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
828
|
+
/**
|
|
829
|
+
* Signals the end of a set-initial-value lifecycle event.
|
|
830
|
+
*
|
|
831
|
+
* @param cell - The FeatureCell key.
|
|
832
|
+
* @param behaviorKey - The behavior key.
|
|
833
|
+
* @param ctx - The monitor context for this operation.
|
|
834
|
+
*/
|
|
421
835
|
endSetInitialValue<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
836
|
+
/**
|
|
837
|
+
* Signals the start of a stepwise lifecycle event.
|
|
838
|
+
*
|
|
839
|
+
* @param cell - The FeatureCell key.
|
|
840
|
+
* @param behaviorKey - The behavior key.
|
|
841
|
+
* @param ctx - The monitor context for this operation.
|
|
842
|
+
*/
|
|
422
843
|
startStepwise<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
844
|
+
/**
|
|
845
|
+
* Signals the end of a stepwise lifecycle event.
|
|
846
|
+
*
|
|
847
|
+
* @param cell - The FeatureCell key.
|
|
848
|
+
* @param behaviorKey - The behavior key.
|
|
849
|
+
* @param ctx - The monitor context for this operation.
|
|
850
|
+
* @param payload - Optional result payload.
|
|
851
|
+
*/
|
|
423
852
|
endStepwise<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload?: unknown): void;
|
|
853
|
+
/**
|
|
854
|
+
* Records that the conductor denied a pipeline operation.
|
|
855
|
+
*
|
|
856
|
+
* @param cell - The FeatureCell key.
|
|
857
|
+
* @param behaviorKey - The behavior key.
|
|
858
|
+
* @param ctx - The monitor context for this operation.
|
|
859
|
+
*/
|
|
424
860
|
notifyConductorDeny<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
861
|
+
/**
|
|
862
|
+
* Records that the conductor triggered a revote.
|
|
863
|
+
*
|
|
864
|
+
* @param cell - The FeatureCell key.
|
|
865
|
+
* @param behaviorKey - The behavior key.
|
|
866
|
+
* @param ctx - The monitor context for this operation.
|
|
867
|
+
*/
|
|
425
868
|
conductorRevote<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
869
|
+
/**
|
|
870
|
+
* Records that the conductor aborted a pipeline operation.
|
|
871
|
+
*
|
|
872
|
+
* @param cell - The FeatureCell key.
|
|
873
|
+
* @param behaviorKey - The behavior key.
|
|
874
|
+
* @param ctx - The monitor context for this operation.
|
|
875
|
+
*/
|
|
426
876
|
conductorAbort<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
877
|
+
/**
|
|
878
|
+
* Records a license validation attempt for a FeatureCell.
|
|
879
|
+
*
|
|
880
|
+
* @param cell - The FeatureCell key.
|
|
881
|
+
* @param featureCellKey - The target cell key under validation.
|
|
882
|
+
*/
|
|
427
883
|
conductorLicenseAttempt(cell: string, featureCellKey: string): void;
|
|
884
|
+
/**
|
|
885
|
+
* Records that a license validation was approved.
|
|
886
|
+
*
|
|
887
|
+
* @param cell - The FeatureCell key.
|
|
888
|
+
* @param featureCellKey - The target cell key that was approved.
|
|
889
|
+
*/
|
|
428
890
|
conductorLicenseApproved(cell: string, featureCellKey: string): void;
|
|
891
|
+
/**
|
|
892
|
+
* Records that a license validation was denied.
|
|
893
|
+
*
|
|
894
|
+
* @param cell - The FeatureCell key.
|
|
895
|
+
* @param featureCellKey - The target cell key that was denied.
|
|
896
|
+
*/
|
|
429
897
|
conductorLicenseDenied(cell: string, featureCellKey: string): void;
|
|
898
|
+
/**
|
|
899
|
+
* Signals the start of a controller attempt lifecycle event.
|
|
900
|
+
*
|
|
901
|
+
* @param cell - The FeatureCell key.
|
|
902
|
+
* @param behaviorKey - The behavior key.
|
|
903
|
+
* @param ctx - The monitor context for this operation.
|
|
904
|
+
*/
|
|
430
905
|
startControllerAttempt<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
906
|
+
/**
|
|
907
|
+
* Signals the end of a controller attempt lifecycle event.
|
|
908
|
+
*
|
|
909
|
+
* @param cell - The FeatureCell key.
|
|
910
|
+
* @param behaviorKey - The behavior key.
|
|
911
|
+
* @param ctx - The monitor context for this operation.
|
|
912
|
+
* @param payload - The attempt result payload.
|
|
913
|
+
*/
|
|
431
914
|
endControllerAttempt<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload: unknown): void;
|
|
915
|
+
/**
|
|
916
|
+
* Records that a controller attempt was restarted.
|
|
917
|
+
*
|
|
918
|
+
* @param cell - The FeatureCell key.
|
|
919
|
+
* @param behaviorKey - The behavior key.
|
|
920
|
+
* @param ctx - The monitor context for this operation.
|
|
921
|
+
* @param payload - The restart reason.
|
|
922
|
+
*/
|
|
432
923
|
restartControllerAttempt<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload: string): void;
|
|
924
|
+
/**
|
|
925
|
+
* Records a controller failure event.
|
|
926
|
+
*
|
|
927
|
+
* @param behaviorKey - The behavior key.
|
|
928
|
+
* @param ctx - The monitor context for this operation.
|
|
929
|
+
* @param error - The error that caused the failure.
|
|
930
|
+
*/
|
|
433
931
|
controllerFailure<T>(behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, error: unknown): void;
|
|
932
|
+
/**
|
|
933
|
+
* Records a controller finalize event.
|
|
934
|
+
*
|
|
935
|
+
* @param behaviorKey - The behavior key.
|
|
936
|
+
* @param ctx - The monitor context for this operation.
|
|
937
|
+
*/
|
|
434
938
|
controllerFinalize<T>(behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
939
|
+
/**
|
|
940
|
+
* Records a controller success event.
|
|
941
|
+
*
|
|
942
|
+
* @param behaviorKey - The behavior key.
|
|
943
|
+
* @param ctx - The monitor context for this operation.
|
|
944
|
+
*/
|
|
435
945
|
controllerSuccess<T>(behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
946
|
+
/**
|
|
947
|
+
* Signals the start of a controller vote lifecycle event.
|
|
948
|
+
*
|
|
949
|
+
* @param cell - The FeatureCell key.
|
|
950
|
+
* @param behaviorKey - The behavior key.
|
|
951
|
+
* @param ctx - The monitor context for this operation.
|
|
952
|
+
*/
|
|
436
953
|
startControllerVote<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
954
|
+
/**
|
|
955
|
+
* Signals the end of a controller vote lifecycle event.
|
|
956
|
+
*
|
|
957
|
+
* @param cell - The FeatureCell key.
|
|
958
|
+
* @param behaviorKey - The behavior key.
|
|
959
|
+
* @param ctx - The monitor context for this operation.
|
|
960
|
+
* @param payload - The controller decision result.
|
|
961
|
+
*/
|
|
437
962
|
endControllerVote<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload: ControllerDecisionShape): void;
|
|
963
|
+
/**
|
|
964
|
+
* Records that the conductor crashed during execution.
|
|
965
|
+
*
|
|
966
|
+
* @param cell - The FeatureCell key.
|
|
967
|
+
* @param behaviorKey - The behavior key.
|
|
968
|
+
* @param ctx - The monitor context for this operation.
|
|
969
|
+
* @param error - The error that caused the crash.
|
|
970
|
+
*/
|
|
438
971
|
conductorCrashed<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, error: unknown): void;
|
|
972
|
+
/**
|
|
973
|
+
* Records a runtime error encountered during pipeline execution.
|
|
974
|
+
*
|
|
975
|
+
* @param cell - The FeatureCell key.
|
|
976
|
+
* @param behaviorKey - The behavior key.
|
|
977
|
+
* @param ctx - The monitor context for this operation.
|
|
978
|
+
* @param error - The runtime error.
|
|
979
|
+
*/
|
|
439
980
|
runtimeError<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, error: unknown): void;
|
|
981
|
+
/**
|
|
982
|
+
* Records a warning message during pipeline execution.
|
|
983
|
+
*
|
|
984
|
+
* @param cell - The FeatureCell key.
|
|
985
|
+
* @param behaviorKey - The behavior key.
|
|
986
|
+
* @param ctx - The monitor context for this operation.
|
|
987
|
+
* @param message - The warning message.
|
|
988
|
+
*/
|
|
440
989
|
warn<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, message: string): void;
|
|
990
|
+
/**
|
|
991
|
+
* Signals the start of an error-transform lifecycle event.
|
|
992
|
+
*
|
|
993
|
+
* @param cell - The FeatureCell key.
|
|
994
|
+
* @param behaviorKey - The behavior key.
|
|
995
|
+
* @param ctx - The monitor context for this operation.
|
|
996
|
+
*/
|
|
441
997
|
startErrorTransform<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>): void;
|
|
998
|
+
/**
|
|
999
|
+
* Signals the end of an error-transform lifecycle event.
|
|
1000
|
+
*
|
|
1001
|
+
* @param cell - The FeatureCell key.
|
|
1002
|
+
* @param behaviorKey - The behavior key.
|
|
1003
|
+
* @param ctx - The monitor context for this operation.
|
|
1004
|
+
* @param payload - The transformed error shape.
|
|
1005
|
+
*/
|
|
442
1006
|
endErrorTransform<T>(cell: string, behaviorKey: string, ctx: Readonly<VaultMonitorContext<T>>, payload: VaultErrorShape): void;
|
|
443
1007
|
}
|
|
444
1008
|
|
|
1009
|
+
/** Runtime context provided to behavior extensions for interacting with a FeatureCell. */
|
|
445
1010
|
interface FeatureCellExtensionContext<T> {
|
|
1011
|
+
/** Observable that emits when the FeatureCell is destroyed. */
|
|
446
1012
|
destroyed$: Observable<void>;
|
|
1013
|
+
/** Unique key identifying the FeatureCell. */
|
|
447
1014
|
featureCellKey: string;
|
|
1015
|
+
/**
|
|
1016
|
+
* Merges incoming state into the current FeatureCell state.
|
|
1017
|
+
*
|
|
1018
|
+
* @param incoming - The state input to merge.
|
|
1019
|
+
* @param options - Optional merge configuration.
|
|
1020
|
+
*/
|
|
448
1021
|
mergeState(incoming: StateInputType<T>, options?: unknown): Promise<void>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Replaces the current FeatureCell state with the provided input.
|
|
1024
|
+
*
|
|
1025
|
+
* @param input - The state input to set.
|
|
1026
|
+
* @param options - Optional replacement configuration.
|
|
1027
|
+
*/
|
|
449
1028
|
replaceState(input: StateInputType<T>, options?: unknown): Promise<void>;
|
|
1029
|
+
/** Observable that emits when the FeatureCell is reset. */
|
|
450
1030
|
reset$: Observable<void>;
|
|
1031
|
+
/** Observable stream of state-emit snapshots from the FeatureCell. */
|
|
451
1032
|
state$: Observable<StateEmitSnapshotShape<T>>;
|
|
1033
|
+
/** Reference to the Vault monitor for diagnostics and tracing. */
|
|
452
1034
|
vaultMonitor: VaultMonitorContract;
|
|
1035
|
+
/** Optional configuration options for the extension context. */
|
|
453
1036
|
options?: unknown;
|
|
454
1037
|
}
|
|
455
1038
|
|
|
@@ -461,6 +1044,7 @@ interface FeatureCellExtensionContext<T> {
|
|
|
461
1044
|
interface FeatureCellExtension<TEntity> {
|
|
462
1045
|
}
|
|
463
1046
|
|
|
1047
|
+
/** Extensible interface for FeatureCell fluent API methods added by behaviors. */
|
|
464
1048
|
interface FeatureCellFluentApi<TEntity> {
|
|
465
1049
|
}
|
|
466
1050
|
|
|
@@ -509,45 +1093,51 @@ declare const BehaviorTypes: {
|
|
|
509
1093
|
* This type should not be manually extended—add new values to `BehaviorTypes`
|
|
510
1094
|
* instead.
|
|
511
1095
|
*
|
|
512
|
-
* --RelatedStart--
|
|
513
|
-
* BehaviorTypes
|
|
514
|
-
* --RelatedEnd--
|
|
515
1096
|
*/
|
|
516
1097
|
type BehaviorType = (typeof BehaviorTypes)[keyof typeof BehaviorTypes];
|
|
517
1098
|
|
|
1099
|
+
/**
|
|
1100
|
+
* Static-side contract for behavior classes used by the behavior factory.
|
|
1101
|
+
*/
|
|
518
1102
|
interface BehaviorClassContract<T = any> {
|
|
519
1103
|
/**
|
|
520
1104
|
* Creates a new behavior instance.
|
|
521
1105
|
*
|
|
522
1106
|
* @param behaviorKey - Unique key assigned by the behavior factory.
|
|
523
|
-
* @param behaviorCtx -
|
|
1107
|
+
* @param behaviorCtx - Class-level context for dependency resolution.
|
|
524
1108
|
*/
|
|
525
1109
|
new (behaviorKey: string, behaviorCtx: BehaviorClassContext): BehaviorContract<T>;
|
|
1110
|
+
/** Pipeline stage in which this behavior participates. */
|
|
526
1111
|
readonly type: BehaviorType;
|
|
527
|
-
/**
|
|
528
|
-
* Unique identifier assigned to this behavior instance. Used by the
|
|
529
|
-
* orchestrator, diagnostics, and devtools for behavior correlation.
|
|
530
|
-
*/
|
|
1112
|
+
/** Unique identifier assigned to this behavior class. */
|
|
531
1113
|
readonly key: string;
|
|
1114
|
+
/** Whether errors from this behavior halt the pipeline. */
|
|
1115
|
+
readonly critical: boolean;
|
|
532
1116
|
/**
|
|
533
|
-
*
|
|
534
|
-
*
|
|
535
|
-
*
|
|
1117
|
+
* Optional hook that installs a fluent API onto the FeatureCell.
|
|
1118
|
+
*
|
|
1119
|
+
* @param cell - The FeatureCell shape to extend.
|
|
1120
|
+
* @param behaviorConfigs - Map of behavior configuration entries.
|
|
536
1121
|
*/
|
|
537
|
-
readonly critical: boolean;
|
|
538
1122
|
installFluentApi?: <T>(cell: FeatureCellBaseShape<T>, behaviorConfigs: Map<string, unknown>) => void;
|
|
1123
|
+
/** Whether this behavior requires consumer-supplied configuration. */
|
|
539
1124
|
readonly wantsConfig?: boolean;
|
|
1125
|
+
/** Configuration key used to locate behavior options in the config registry. */
|
|
540
1126
|
readonly configKey?: string;
|
|
541
1127
|
}
|
|
542
1128
|
|
|
1129
|
+
/** Static-side contract for interceptor behavior classes. */
|
|
543
1130
|
interface InterceptorBehaviorClassContract<T> extends BehaviorClassContract<T> {
|
|
544
1131
|
}
|
|
545
1132
|
|
|
1133
|
+
/** Static-side contract for operator behavior classes. */
|
|
546
1134
|
interface OperatorsBehaviorClassContract<T> extends BehaviorClassContract<T> {
|
|
547
1135
|
}
|
|
548
1136
|
|
|
1137
|
+
/** Callback type invoked when the core emits a state snapshot. */
|
|
549
1138
|
type CoreEmitStateCallback<T, E = void> = (snapshot: StateSnapshotShape<T>) => E;
|
|
550
1139
|
|
|
1140
|
+
/** Callback type invoked with the current value during a tap lifecycle event. */
|
|
551
1141
|
type TapCallback<T> = (current: T) => void;
|
|
552
1142
|
|
|
553
1143
|
/**
|
|
@@ -580,18 +1170,6 @@ type ReducerFunction<T> = (current: T) => T;
|
|
|
580
1170
|
/**
|
|
581
1171
|
* Defines the builder contract used to configure and initialize a FeatureCell.
|
|
582
1172
|
* This interface exposes the fluent configuration surface for registering behaviors, callbacks, and operators prior to activation.
|
|
583
|
-
*
|
|
584
|
-
* --RelatedStart--
|
|
585
|
-
* FeatureCellExtension
|
|
586
|
-
* FeatureCellFluentApi
|
|
587
|
-
* CoreEmitStateCallback
|
|
588
|
-
* TapCallback
|
|
589
|
-
* VaultErrorCallback
|
|
590
|
-
* FilterFunction
|
|
591
|
-
* InterceptorBehaviorClassContract
|
|
592
|
-
* OperatorsBehaviorClassContract
|
|
593
|
-
* ReducerFunction
|
|
594
|
-
* --RelatedEnd--
|
|
595
1173
|
*/
|
|
596
1174
|
interface CellBuilderContract<T> extends FeatureCellExtension<T>, FeatureCellFluentApi<T> {
|
|
597
1175
|
/**
|
|
@@ -621,7 +1199,7 @@ interface CellBuilderContract<T> extends FeatureCellExtension<T>, FeatureCellFlu
|
|
|
621
1199
|
emitStates(emitStates: CoreEmitStateCallback<T>[]): CellBuilderContract<T>;
|
|
622
1200
|
/**
|
|
623
1201
|
* Registers error functions to run during the error stage.
|
|
624
|
-
*
|
|
1202
|
+
*
|
|
625
1203
|
* @param errors - Error functions that may block or transform values.
|
|
626
1204
|
* @returns The same builder instance for fluent chaining.
|
|
627
1205
|
*/
|
|
@@ -633,13 +1211,15 @@ interface CellBuilderContract<T> extends FeatureCellExtension<T>, FeatureCellFlu
|
|
|
633
1211
|
* @returns The same builder instance for fluent chaining.
|
|
634
1212
|
*/
|
|
635
1213
|
filters(filters: FilterFunction<T>[]): CellBuilderContract<T>;
|
|
1214
|
+
/**
|
|
1215
|
+
* Registers a deferred hydration source for the FeatureCell.
|
|
1216
|
+
*
|
|
1217
|
+
* @param incoming - Deferred value used to hydrate the cell state.
|
|
1218
|
+
* @returns The builder instance for fluent chaining.
|
|
1219
|
+
*/
|
|
636
1220
|
hydrate(incoming: DeferredType<T>): CellBuilderContract<T>;
|
|
637
1221
|
/**
|
|
638
1222
|
* Finalizes the builder configuration and activates the FeatureCell.
|
|
639
|
-
*
|
|
640
|
-
* Implementations may perform synchronous or asynchronous setup.
|
|
641
|
-
*
|
|
642
|
-
* @returns The builder instance, or a Promise resolving when initialization completes.
|
|
643
1223
|
*/
|
|
644
1224
|
initialize(): void;
|
|
645
1225
|
/**
|
|
@@ -667,7 +1247,9 @@ interface CellBuilderContract<T> extends FeatureCellExtension<T>, FeatureCellFlu
|
|
|
667
1247
|
|
|
668
1248
|
/**
|
|
669
1249
|
* Defines the public base contract for a FeatureCell instance.
|
|
670
|
-
*
|
|
1250
|
+
*
|
|
1251
|
+
* FeatureCellBaseShape describes the builder, lifecycle, and state update
|
|
1252
|
+
* surface required to configure, initialize, and interact with a FeatureCell.
|
|
671
1253
|
*/
|
|
672
1254
|
interface FeatureCellBaseShape<T> extends FeatureCellExtension<T>, FeatureCellFluentApi<T> {
|
|
673
1255
|
/**
|
|
@@ -714,6 +1296,12 @@ interface FeatureCellBaseShape<T> extends FeatureCellExtension<T>, FeatureCellFl
|
|
|
714
1296
|
* @returns The builder instance for fluent chaining.
|
|
715
1297
|
*/
|
|
716
1298
|
filters(filters: FilterFunction<T>[]): CellBuilderContract<T>;
|
|
1299
|
+
/**
|
|
1300
|
+
* Registers a deferred hydration source for the FeatureCell.
|
|
1301
|
+
*
|
|
1302
|
+
* @param incoming - Deferred value used to hydrate the cell state.
|
|
1303
|
+
* @returns The builder instance for fluent chaining.
|
|
1304
|
+
*/
|
|
717
1305
|
hydrate(incoming: DeferredType<T>): CellBuilderContract<T>;
|
|
718
1306
|
/**
|
|
719
1307
|
* Finalizes builder configuration and activates the FeatureCell.
|
|
@@ -735,8 +1323,8 @@ interface FeatureCellBaseShape<T> extends FeatureCellExtension<T>, FeatureCellFl
|
|
|
735
1323
|
/**
|
|
736
1324
|
* Performs a merge-style state update using the configured merge behavior.
|
|
737
1325
|
*
|
|
738
|
-
* @param incoming Structured state input to be merged.
|
|
739
|
-
* @param options Optional merge behavior configuration.
|
|
1326
|
+
* @param incoming - Structured state input to be merged.
|
|
1327
|
+
* @param options - Optional merge behavior configuration.
|
|
740
1328
|
*/
|
|
741
1329
|
mergeState(incoming: StateInputType<T>, options?: unknown): void;
|
|
742
1330
|
/**
|
|
@@ -756,8 +1344,8 @@ interface FeatureCellBaseShape<T> extends FeatureCellExtension<T>, FeatureCellFl
|
|
|
756
1344
|
/**
|
|
757
1345
|
* Performs a replace-style state update that fully replaces the current state.
|
|
758
1346
|
*
|
|
759
|
-
* @param incoming Structured state input to replace the current state.
|
|
760
|
-
* @param options Optional merge behavior configuration.
|
|
1347
|
+
* @param incoming - Structured state input to replace the current state.
|
|
1348
|
+
* @param options - Optional merge behavior configuration.
|
|
761
1349
|
*/
|
|
762
1350
|
replaceState(incoming: StateInputType<T>, options?: unknown): void;
|
|
763
1351
|
/**
|
|
@@ -769,17 +1357,16 @@ interface FeatureCellBaseShape<T> extends FeatureCellExtension<T>, FeatureCellFl
|
|
|
769
1357
|
*/
|
|
770
1358
|
reset$?: Observable<void>;
|
|
771
1359
|
/**
|
|
772
|
-
* Observable that emits
|
|
1360
|
+
* Observable that emits state snapshots whenever the FeatureCell state changes.
|
|
773
1361
|
*/
|
|
774
1362
|
state$: Observable<StateEmitSnapshotShape<T>>;
|
|
775
1363
|
/**
|
|
776
|
-
* Dev-mode testing hook.
|
|
777
|
-
* Only defined when DevMode.active === true.
|
|
778
|
-
* Non-enumerable and not part of runtime API.
|
|
1364
|
+
* Dev-mode testing hook that resolves once all pending pipeline activity has settled.
|
|
779
1365
|
*/
|
|
780
1366
|
vaultSettled?: () => Promise<void>;
|
|
781
1367
|
}
|
|
782
1368
|
|
|
1369
|
+
/** Function signature for behavior extension methods added to the FeatureCell. */
|
|
783
1370
|
type BehaviorExtFunction = (...args: any[]) => unknown;
|
|
784
1371
|
/**
|
|
785
1372
|
* A map of extension function names to their implementation functions.
|
|
@@ -789,50 +1376,75 @@ type BehaviorExtFunction = (...args: any[]) => unknown;
|
|
|
789
1376
|
*/
|
|
790
1377
|
type BehaviorExtension = Partial<Record<string, BehaviorExtFunction>>;
|
|
791
1378
|
/**
|
|
792
|
-
* Base interface implemented by all behavior types in the
|
|
793
|
-
* pipeline. Behaviors participate in specific pipeline stages based on
|
|
794
|
-
* their declared BehaviorType, and may optionally expose additional
|
|
795
|
-
* FeatureCell APIs through the `extendCellAPI()` hook.
|
|
1379
|
+
* Base interface implemented by all behavior types in the Vault pipeline.
|
|
796
1380
|
*
|
|
797
|
-
*
|
|
798
|
-
*
|
|
1381
|
+
* Behaviors participate in specific pipeline stages based on their declared
|
|
1382
|
+
* BehaviorType, and may optionally expose additional FeatureCell APIs through
|
|
1383
|
+
* the extendCellAPI hook.
|
|
799
1384
|
*/
|
|
800
1385
|
interface BehaviorContract<T = unknown, E extends BehaviorExtension = BehaviorExtension> {
|
|
801
1386
|
/**
|
|
802
|
-
*
|
|
803
|
-
* uses this to determine the execution order in the upstream and persist
|
|
804
|
-
* stages.
|
|
1387
|
+
* Pipeline classification for this behavior used to determine execution order.
|
|
805
1388
|
*/
|
|
806
1389
|
readonly type: BehaviorType;
|
|
807
1390
|
/**
|
|
808
|
-
* Unique identifier assigned to this behavior instance.
|
|
809
|
-
* orchestrator, diagnostics, and devtools for behavior correlation.
|
|
1391
|
+
* Unique identifier assigned to this behavior instance.
|
|
810
1392
|
*/
|
|
811
1393
|
readonly key: string;
|
|
812
1394
|
/**
|
|
813
|
-
*
|
|
814
|
-
* True means the pipeline should VAULT_NOOP and stop the pipeline flow on any errors
|
|
815
|
-
* False means that pipeline should log any error and continue
|
|
1395
|
+
* Whether this behavior is critical for pipeline error handling.
|
|
816
1396
|
*/
|
|
817
1397
|
readonly critical: boolean;
|
|
818
1398
|
/**
|
|
819
|
-
*
|
|
820
|
-
* to override when multiple behaviors contribute conflicting API keys.
|
|
821
|
-
* Behaviors without explicit override permission may not replace an
|
|
822
|
-
* existing API entry.
|
|
1399
|
+
* Extension function names this behavior is permitted to override.
|
|
823
1400
|
*/
|
|
824
1401
|
allowOverride?: string[];
|
|
1402
|
+
/**
|
|
1403
|
+
* Extends the FeatureCell with additional APIs backed by this behavior.
|
|
1404
|
+
*
|
|
1405
|
+
* @param ctx - Extension context used to observe state and merge updates.
|
|
1406
|
+
* @returns The extension API surface, or void if no extensions are provided.
|
|
1407
|
+
*/
|
|
825
1408
|
extendCellAPI?(ctx: FeatureCellExtensionContext<T>): E | void;
|
|
1409
|
+
/**
|
|
1410
|
+
* Teardown hook invoked when the behavior instance is destroyed.
|
|
1411
|
+
*
|
|
1412
|
+
* @param ctx - Pipeline behavior context.
|
|
1413
|
+
*/
|
|
826
1414
|
destroy(ctx?: BehaviorContext<T>): void;
|
|
1415
|
+
/**
|
|
1416
|
+
* Resets the behavior to its initial state.
|
|
1417
|
+
*
|
|
1418
|
+
* @param ctx - Pipeline behavior context.
|
|
1419
|
+
*/
|
|
827
1420
|
reset(ctx?: BehaviorContext<T>): void;
|
|
1421
|
+
/**
|
|
1422
|
+
* Installs fluent configuration APIs onto a FeatureCell instance.
|
|
1423
|
+
*
|
|
1424
|
+
* @param cell - FeatureCell instance to augment.
|
|
1425
|
+
* @param behaviorConfigs - Registry used to store behavior configuration.
|
|
1426
|
+
*/
|
|
828
1427
|
installFluentApi?: <T>(cell: FeatureCellBaseShape<T>, behaviorConfigs: Map<string, unknown>) => void;
|
|
829
1428
|
}
|
|
830
1429
|
|
|
1430
|
+
/** Contract for behaviors that invoke consumer error callbacks on pipeline errors. */
|
|
831
1431
|
interface ErrorCallbackBehaviorContract<T> extends BehaviorContract<T> {
|
|
1432
|
+
/** Identifies this behavior as a core error callback behavior. */
|
|
832
1433
|
type: 'coreErrorCallback';
|
|
1434
|
+
/**
|
|
1435
|
+
* Invokes the consumer error callback with the current error and state.
|
|
1436
|
+
*
|
|
1437
|
+
* @param current - The current Vault error shape.
|
|
1438
|
+
* @param state - The state snapshot at the time of error.
|
|
1439
|
+
* @param oldschoolCallback - The consumer-supplied error callback.
|
|
1440
|
+
*/
|
|
833
1441
|
callbackError(current: VaultErrorShape, state: StateSnapshotShape<T>, oldschoolCallback: VaultErrorCallback<T>): Promise<void>;
|
|
834
1442
|
}
|
|
835
1443
|
|
|
1444
|
+
/**
|
|
1445
|
+
* Abstract base class for error callback behaviors that execute consumer-supplied
|
|
1446
|
+
* error handlers during the error stage of the Vault pipeline.
|
|
1447
|
+
*/
|
|
836
1448
|
declare abstract class AbstractErrorCallbackBehavior<T> implements ErrorCallbackBehaviorContract<T> {
|
|
837
1449
|
readonly behaviorCtx: BehaviorClassContext;
|
|
838
1450
|
/** Indicates that this error behavior is critical and always executed. */
|
|
@@ -848,27 +1460,40 @@ declare abstract class AbstractErrorCallbackBehavior<T> implements ErrorCallback
|
|
|
848
1460
|
* @param behaviorCtx - Behavior class context providing injector access and extensibility hooks.
|
|
849
1461
|
*/
|
|
850
1462
|
constructor(key: string, behaviorCtx: BehaviorClassContext);
|
|
851
|
-
abstract callbackError(current: VaultErrorShape, state: StateSnapshotShape<T>, oldschoolCallback: VaultErrorCallback<T>): Promise<void>;
|
|
852
1463
|
/**
|
|
853
|
-
*
|
|
1464
|
+
* Executes the consumer-supplied error callback against the current error and state.
|
|
854
1465
|
*
|
|
855
|
-
*
|
|
856
|
-
*
|
|
1466
|
+
* @param current - The error shape describing the pipeline failure.
|
|
1467
|
+
* @param state - The state snapshot at the time of the error.
|
|
1468
|
+
* @param oldschoolCallback - Consumer-supplied error callback to invoke.
|
|
1469
|
+
* @returns A promise that resolves when the callback completes.
|
|
1470
|
+
*/
|
|
1471
|
+
abstract callbackError(current: VaultErrorShape, state: StateSnapshotShape<T>, oldschoolCallback: VaultErrorCallback<T>): Promise<void>;
|
|
1472
|
+
/**
|
|
1473
|
+
* Teardown hook invoked when the behavior instance is destroyed.
|
|
857
1474
|
*/
|
|
858
1475
|
destroy(): void;
|
|
859
1476
|
/**
|
|
860
|
-
*
|
|
861
|
-
*
|
|
862
|
-
* Error behaviors hold no internal state, making this a no-operation.
|
|
863
|
-
* The hook ensures lifecycle uniformity across all behaviors.
|
|
1477
|
+
* Resets the error behavior to its initial state.
|
|
864
1478
|
*/
|
|
865
1479
|
reset(): void;
|
|
866
1480
|
}
|
|
867
1481
|
|
|
1482
|
+
/** Sentinel symbol that signals the pipeline to skip the current operation. */
|
|
868
1483
|
declare const VAULT_NOOP: unique symbol;
|
|
869
1484
|
|
|
1485
|
+
/** Contract for behaviors that transform pipeline errors before propagation. */
|
|
870
1486
|
interface ErrorTransformBehaviorContract<T> extends BehaviorContract<T> {
|
|
1487
|
+
/** Identifies this behavior as an error transform behavior. */
|
|
871
1488
|
type: 'errorTransform';
|
|
1489
|
+
/**
|
|
1490
|
+
* Transforms a raw error into a normalized shape or signals a NOOP.
|
|
1491
|
+
*
|
|
1492
|
+
* @param error - The raw error thrown during pipeline execution.
|
|
1493
|
+
* @param current - The current Vault error shape.
|
|
1494
|
+
* @param previousStateSnapshot - The state snapshot before the error occurred.
|
|
1495
|
+
* @returns The transformed error value, or VAULT_NOOP to skip.
|
|
1496
|
+
*/
|
|
872
1497
|
transformError(error: unknown, current: VaultErrorShape, previousStateSnapshot: StateSnapshotShape<T>): Promise<unknown | typeof VAULT_NOOP>;
|
|
873
1498
|
}
|
|
874
1499
|
|
|
@@ -876,12 +1501,6 @@ interface ErrorTransformBehaviorContract<T> extends BehaviorContract<T> {
|
|
|
876
1501
|
* Abstract base behavior for transforming errors during pipeline execution.
|
|
877
1502
|
* This class defines the contract and lifecycle hooks required for error transformation behaviors.
|
|
878
1503
|
*
|
|
879
|
-
* --RelatedStart--
|
|
880
|
-
* ErrorTransformBehaviorContract
|
|
881
|
-
* BehaviorClassContext
|
|
882
|
-
* StateSnapshotShape
|
|
883
|
-
* VaultErrorShape
|
|
884
|
-
* --RelatedEnd--
|
|
885
1504
|
*/
|
|
886
1505
|
declare abstract class AbstractErrorTransformBehavior<T> implements ErrorTransformBehaviorContract<T> {
|
|
887
1506
|
readonly behaviorCtx: BehaviorClassContext;
|
|
@@ -923,16 +1542,25 @@ declare abstract class AbstractErrorTransformBehavior<T> implements ErrorTransfo
|
|
|
923
1542
|
reset(): void;
|
|
924
1543
|
}
|
|
925
1544
|
|
|
1545
|
+
/** Runtime context supplied to controller class instances during pipeline execution. */
|
|
926
1546
|
interface ControllerClassContext extends LicensableClassContext {
|
|
1547
|
+
/** Unique key of the FeatureCell this controller is attached to. */
|
|
927
1548
|
featureCellKey: string;
|
|
1549
|
+
/** Requests a revote for the pipeline identified by the trace ID. */
|
|
928
1550
|
requestRevote: (traceId: string) => void;
|
|
1551
|
+
/** Requests an abort for the pipeline identified by the trace ID. */
|
|
929
1552
|
requestAbort: (traceId: string) => void;
|
|
1553
|
+
/** Signals that the license was denied for the given trace. */
|
|
930
1554
|
licenseDenied?: (traceId: string) => void;
|
|
1555
|
+
/** Signals that the license was approved for the given trace. */
|
|
931
1556
|
licenseApproved?: (traceId: string) => void;
|
|
1557
|
+
/** Optional configuration object for this controller. */
|
|
932
1558
|
readonly controllerConfig?: unknown;
|
|
1559
|
+
/** Optional license payload associated with this controller. */
|
|
933
1560
|
readonly licensePayload?: unknown;
|
|
934
1561
|
}
|
|
935
1562
|
|
|
1563
|
+
/** Enumeration of message types dispatched to controllers during pipeline orchestration. */
|
|
936
1564
|
declare const ControllerMessageTypes: {
|
|
937
1565
|
readonly Attempt: "attempt";
|
|
938
1566
|
readonly Failure: "failure";
|
|
@@ -940,42 +1568,62 @@ declare const ControllerMessageTypes: {
|
|
|
940
1568
|
readonly Success: "success";
|
|
941
1569
|
readonly Vote: "vote";
|
|
942
1570
|
};
|
|
1571
|
+
/** Union type derived from ControllerMessageTypes values. */
|
|
943
1572
|
type ControllerMessageType = (typeof ControllerMessageTypes)[keyof typeof ControllerMessageTypes];
|
|
944
1573
|
|
|
1574
|
+
/** Base shape shared by all controller message variants. */
|
|
945
1575
|
interface ControllerMessageBaseShape {
|
|
1576
|
+
/** Discriminant identifying the message type. */
|
|
946
1577
|
type: ControllerMessageType;
|
|
1578
|
+
/** Trace identifier linking this message to a pipeline operation. */
|
|
947
1579
|
traceId: string;
|
|
948
1580
|
}
|
|
949
1581
|
|
|
1582
|
+
/** Message shape dispatched to controllers during a pipeline attempt. */
|
|
950
1583
|
interface ControllerAttemptMessageShape<T> extends ControllerMessageBaseShape {
|
|
1584
|
+
/** Discriminant identifying this as an attempt message. */
|
|
951
1585
|
type: typeof ControllerMessageTypes.Attempt;
|
|
1586
|
+
/** Controller context for the current pipeline operation. */
|
|
952
1587
|
ctx: ControllerContext<T>;
|
|
953
1588
|
}
|
|
954
1589
|
|
|
1590
|
+
/** Message shape dispatched to controllers when a pipeline operation fails. */
|
|
955
1591
|
interface ControllerFailMessageShape<T> extends ControllerMessageBaseShape {
|
|
1592
|
+
/** Discriminant identifying this as a failure message. */
|
|
956
1593
|
type: typeof ControllerMessageTypes.Failure;
|
|
1594
|
+
/** Controller context for the current pipeline operation. */
|
|
957
1595
|
ctx: ControllerContext<T>;
|
|
1596
|
+
/** Error that caused the pipeline failure. */
|
|
958
1597
|
error: VaultErrorShape | unknown;
|
|
959
1598
|
}
|
|
960
1599
|
|
|
1600
|
+
/** Message shape dispatched to controllers when a pipeline operation finalizes. */
|
|
961
1601
|
interface ControllerFinalizeMessageShape extends ControllerMessageBaseShape {
|
|
1602
|
+
/** Discriminant identifying this as a finalize message. */
|
|
962
1603
|
type: typeof ControllerMessageTypes.Finalize;
|
|
963
1604
|
}
|
|
964
1605
|
|
|
1606
|
+
/** Message shape dispatched to controllers when a pipeline operation succeeds. */
|
|
965
1607
|
interface ControllerSuccessMessageShape<T> extends ControllerMessageBaseShape {
|
|
1608
|
+
/** Discriminant identifying this as a success message. */
|
|
966
1609
|
type: typeof ControllerMessageTypes.Success;
|
|
1610
|
+
/** Controller context for the current pipeline operation. */
|
|
967
1611
|
ctx: ControllerContext<T>;
|
|
968
1612
|
}
|
|
969
1613
|
|
|
1614
|
+
/** Discriminated union of all controller message shapes. */
|
|
970
1615
|
type ControllerMessageShape<T> = ControllerAttemptMessageShape<T> | ControllerSuccessMessageShape<T> | ControllerFailMessageShape<T> | ControllerFinalizeMessageShape;
|
|
971
1616
|
|
|
1617
|
+
/** Enumeration of votes a controller may cast during pipeline admission. */
|
|
972
1618
|
declare const ControllerVotes: {
|
|
973
1619
|
readonly Abstain: "abstain";
|
|
974
1620
|
readonly Abort: "abort";
|
|
975
1621
|
readonly Deny: "deny";
|
|
976
1622
|
};
|
|
1623
|
+
/** Union type derived from ControllerVotes values. */
|
|
977
1624
|
type ControllerVote = (typeof ControllerVotes)[keyof typeof ControllerVotes];
|
|
978
1625
|
|
|
1626
|
+
/** Enumeration of controller category classifications. */
|
|
979
1627
|
declare const ControllerTypes: {
|
|
980
1628
|
readonly CoreAbstain: "coreAbstain";
|
|
981
1629
|
readonly Error: "error";
|
|
@@ -985,32 +1633,77 @@ declare const ControllerTypes: {
|
|
|
985
1633
|
readonly Stepwise: "stepwise";
|
|
986
1634
|
readonly TabSync: "tabSync";
|
|
987
1635
|
};
|
|
1636
|
+
/** Union type derived from ControllerTypes values. */
|
|
988
1637
|
type ControllerType = (typeof ControllerTypes)[keyof typeof ControllerTypes];
|
|
989
1638
|
|
|
1639
|
+
/** Instance-side contract that all controllers must implement. */
|
|
990
1640
|
interface ControllerContract<T = unknown> {
|
|
1641
|
+
/** Controller category classification. */
|
|
991
1642
|
readonly type: ControllerType;
|
|
1643
|
+
/** Unique identifier for this controller instance. */
|
|
992
1644
|
readonly key: string;
|
|
1645
|
+
/** Whether errors from this controller halt the pipeline. */
|
|
993
1646
|
readonly critical: boolean;
|
|
1647
|
+
/**
|
|
1648
|
+
* Processes an incoming controller message and returns a vote.
|
|
1649
|
+
*
|
|
1650
|
+
* @param msg - The controller message to evaluate.
|
|
1651
|
+
* @returns An observable emitting the controller vote or void.
|
|
1652
|
+
*/
|
|
994
1653
|
handleMessage(msg: ControllerMessageShape<T>): Observable<ControllerVote | void>;
|
|
1654
|
+
/** Tears down the controller and releases resources. */
|
|
995
1655
|
destroy(): void;
|
|
1656
|
+
/** Resets the controller to its initial state. */
|
|
996
1657
|
reset(): void;
|
|
1658
|
+
/**
|
|
1659
|
+
* Optional hook that installs a fluent API onto the FeatureCell.
|
|
1660
|
+
*
|
|
1661
|
+
* @param cell - The FeatureCell shape to extend.
|
|
1662
|
+
* @param behaviorConfigs - Map of behavior configuration entries.
|
|
1663
|
+
*/
|
|
997
1664
|
installFluentApi?: <T>(cell: FeatureCellBaseShape<T>, behaviorConfigs: Map<string, unknown>) => void;
|
|
998
1665
|
}
|
|
999
1666
|
|
|
1667
|
+
/**
|
|
1668
|
+
* Abstract base class for active controllers that react to external error
|
|
1669
|
+
* state changes and participate in pipeline admission voting.
|
|
1670
|
+
*/
|
|
1000
1671
|
declare abstract class AbstractActiveController<T> implements ControllerContract<T> {
|
|
1001
1672
|
#private;
|
|
1002
1673
|
protected readonly ctx: ControllerClassContext;
|
|
1674
|
+
/** Unique identifier for this controller instance. */
|
|
1003
1675
|
readonly key: string;
|
|
1676
|
+
/** Controller type classification determined by the subclass. */
|
|
1004
1677
|
abstract readonly type: ControllerType;
|
|
1678
|
+
/** Whether errors from this controller halt the pipeline. */
|
|
1005
1679
|
readonly critical = false;
|
|
1680
|
+
/** Tracks whether the global error service currently holds an error. */
|
|
1006
1681
|
protected hasError: boolean;
|
|
1682
|
+
/** Trace identifier from the most recent pipeline operation. */
|
|
1007
1683
|
protected traceId: string | null;
|
|
1684
|
+
/**
|
|
1685
|
+
* Creates an active controller and subscribes to the global error stream.
|
|
1686
|
+
*
|
|
1687
|
+
* @param key - Unique controller identifier supplied by the factory.
|
|
1688
|
+
* @param ctx - Class-level context providing revote and lifecycle access.
|
|
1689
|
+
*/
|
|
1008
1690
|
constructor(key: string, ctx: ControllerClassContext);
|
|
1009
|
-
/**
|
|
1691
|
+
/**
|
|
1692
|
+
* Hook invoked when the external error state changes.
|
|
1693
|
+
*
|
|
1694
|
+
* @param _newErrorState - The updated error state flag.
|
|
1695
|
+
*/
|
|
1010
1696
|
protected onExternalTrigger(_newErrorState: boolean): void;
|
|
1011
|
-
/**
|
|
1697
|
+
/**
|
|
1698
|
+
* Processes an incoming controller message and returns a vote.
|
|
1699
|
+
*
|
|
1700
|
+
* @param msg - The controller message to evaluate.
|
|
1701
|
+
* @returns An observable emitting the controller vote or void.
|
|
1702
|
+
*/
|
|
1012
1703
|
abstract handleMessage(msg: ControllerMessageShape<T>): Observable<ControllerVote | void>;
|
|
1704
|
+
/** Tears down the controller and unsubscribes from the error stream. */
|
|
1013
1705
|
destroy(): void;
|
|
1706
|
+
/** Resets the controller to its initial state. */
|
|
1014
1707
|
reset(): void;
|
|
1015
1708
|
}
|
|
1016
1709
|
|
|
@@ -1052,8 +1745,11 @@ interface ObjectDeepMergeConfig {
|
|
|
1052
1745
|
stripNulls?: boolean;
|
|
1053
1746
|
}
|
|
1054
1747
|
|
|
1748
|
+
/** Shape representing a license entry registered with the Vault. */
|
|
1055
1749
|
interface VaultLicensingShape {
|
|
1750
|
+
/** Unique identifier for the license. */
|
|
1056
1751
|
licenseId: string;
|
|
1752
|
+
/** Opaque license payload supplied by the consumer. */
|
|
1057
1753
|
payload: unknown;
|
|
1058
1754
|
}
|
|
1059
1755
|
|
|
@@ -1070,6 +1766,7 @@ interface VaultLicensingShape {
|
|
|
1070
1766
|
* - `'log'` — standard log events, warnings, and errors are logged
|
|
1071
1767
|
* - `'debug'` — all debug-level information is emitted
|
|
1072
1768
|
*/
|
|
1769
|
+
/** Enumeration of Vault log verbosity levels. */
|
|
1073
1770
|
declare const LogLevelTypes: {
|
|
1074
1771
|
readonly Off: "off";
|
|
1075
1772
|
readonly Error: "error";
|
|
@@ -1077,8 +1774,12 @@ declare const LogLevelTypes: {
|
|
|
1077
1774
|
readonly Log: "log";
|
|
1078
1775
|
readonly Debug: "debug";
|
|
1079
1776
|
};
|
|
1777
|
+
/** Union type derived from LogLevelTypes values. */
|
|
1080
1778
|
type LogLevelType = (typeof LogLevelTypes)[keyof typeof LogLevelTypes];
|
|
1081
1779
|
|
|
1780
|
+
/**
|
|
1781
|
+
* Configuration options supplied to Vault at initialization.
|
|
1782
|
+
*/
|
|
1082
1783
|
interface VaultConfig {
|
|
1083
1784
|
/**
|
|
1084
1785
|
* Enables development-mode diagnostics and additional internal checks.
|
|
@@ -1124,8 +1825,10 @@ interface VaultConfig {
|
|
|
1124
1825
|
bypassLicensing?: boolean;
|
|
1125
1826
|
}
|
|
1126
1827
|
|
|
1828
|
+
/** Symbol key used to attach behavior metadata to a behavior class. */
|
|
1127
1829
|
declare const BEHAVIOR_META: unique symbol;
|
|
1128
1830
|
|
|
1831
|
+
/** Symbol key used to attach controller metadata to a controller class. */
|
|
1129
1832
|
declare const CONTROLLER_META: unique symbol;
|
|
1130
1833
|
|
|
1131
1834
|
/**
|
|
@@ -1152,51 +1855,64 @@ declare const DEVTOOLS_AGGREGATE_KEY_CONSTANT = "vault::devtools::aggregate:feat
|
|
|
1152
1855
|
*/
|
|
1153
1856
|
declare const DEVTOOLS_LOGGING_KEY_CONSTANT = "vault::devtools::logging::feature::cell";
|
|
1154
1857
|
|
|
1858
|
+
/** Sentinel symbol that signals the pipeline to clear the current state. */
|
|
1155
1859
|
declare const VAULT_CLEAR_STATE: unique symbol;
|
|
1156
1860
|
|
|
1861
|
+
/** Sentinel symbol that signals the pipeline to continue processing. */
|
|
1157
1862
|
declare const VAULT_CONTINUE: unique symbol;
|
|
1158
1863
|
|
|
1864
|
+
/** Sentinel symbol that signals the pipeline to halt execution. */
|
|
1159
1865
|
declare const VAULT_STOP: unique symbol;
|
|
1160
1866
|
|
|
1867
|
+
/**
|
|
1868
|
+
* Extended behavior class context providing direct state access for tab-sync behaviors.
|
|
1869
|
+
*/
|
|
1161
1870
|
interface TabSyncBehaviorClassContext extends BehaviorClassContext {
|
|
1162
1871
|
/**
|
|
1163
1872
|
* Live reference to the FeatureCell's mutable state snapshot.
|
|
1164
|
-
* Provided so the tab-sync behavior can commit state outside the
|
|
1165
|
-
* pipeline call stack without waiting for preparePipelineIncoming.
|
|
1166
1873
|
*/
|
|
1167
1874
|
readonly lastSnapshot: StateSnapshotShape<unknown>;
|
|
1168
1875
|
/**
|
|
1169
1876
|
* Subject used to emit state snapshots to the FeatureCell.
|
|
1170
|
-
* Same lifetime as the FeatureCell itself.
|
|
1171
1877
|
*/
|
|
1172
1878
|
readonly state$: Subject<StateEmitSnapshotShape<unknown>>;
|
|
1173
1879
|
}
|
|
1174
1880
|
|
|
1881
|
+
/**
|
|
1882
|
+
* Metadata shape describing a registered behavior's static configuration.
|
|
1883
|
+
*/
|
|
1175
1884
|
interface BehaviorMetaShape {
|
|
1176
1885
|
/**
|
|
1177
|
-
*
|
|
1178
|
-
* Determines when the orchestrator invokes the behavior.
|
|
1886
|
+
* Pipeline stage in which this behavior participates.
|
|
1179
1887
|
*/
|
|
1180
1888
|
type: BehaviorType;
|
|
1181
1889
|
/**
|
|
1182
|
-
* Unique identifier for this behavior.
|
|
1183
|
-
* devtools visualization, and orchestrator classification.
|
|
1890
|
+
* Unique identifier for this behavior.
|
|
1184
1891
|
*/
|
|
1185
1892
|
key: string;
|
|
1186
1893
|
/**
|
|
1187
|
-
*
|
|
1188
|
-
* are mandatory and must always run when present in the pipeline.
|
|
1894
|
+
* Whether this behavior is critical to pipeline execution.
|
|
1189
1895
|
*/
|
|
1190
1896
|
critical: boolean;
|
|
1191
1897
|
/**
|
|
1192
1898
|
* Optional resolve strategy associated with this behavior.
|
|
1193
|
-
* Only set for resolution behaviors that determine how state
|
|
1194
|
-
* is initially derived (e.g., value, http, observable).
|
|
1195
1899
|
*/
|
|
1196
1900
|
resolveType?: ResolveType;
|
|
1901
|
+
/**
|
|
1902
|
+
* Whether this behavior requires consumer-supplied configuration.
|
|
1903
|
+
*/
|
|
1197
1904
|
wantsConfig?: boolean;
|
|
1905
|
+
/**
|
|
1906
|
+
* Configuration key used to locate behavior options in the config registry.
|
|
1907
|
+
*/
|
|
1198
1908
|
configKey?: string;
|
|
1909
|
+
/**
|
|
1910
|
+
* Whether this behavior requires a valid license to operate.
|
|
1911
|
+
*/
|
|
1199
1912
|
needsLicense?: boolean;
|
|
1913
|
+
/**
|
|
1914
|
+
* License identifier used for license validation.
|
|
1915
|
+
*/
|
|
1200
1916
|
licenseId?: string;
|
|
1201
1917
|
}
|
|
1202
1918
|
|
|
@@ -1219,18 +1935,33 @@ interface BehaviorMetaShape {
|
|
|
1219
1935
|
*/
|
|
1220
1936
|
declare function VaultBehavior(meta: BehaviorMetaShape): (target: any) => void;
|
|
1221
1937
|
|
|
1938
|
+
/** Metadata shape describing a registered controller's static configuration. */
|
|
1222
1939
|
interface ControllerMetaShape {
|
|
1940
|
+
/** Controller category classification. */
|
|
1223
1941
|
type: ControllerType;
|
|
1942
|
+
/** Unique identifier for this controller. */
|
|
1224
1943
|
key: string;
|
|
1944
|
+
/** Whether this controller is critical to pipeline execution. */
|
|
1225
1945
|
critical?: boolean;
|
|
1946
|
+
/** Whether this controller requires consumer-supplied configuration. */
|
|
1226
1947
|
wantsConfig?: boolean;
|
|
1948
|
+
/** Configuration key used to locate controller options in the config registry. */
|
|
1227
1949
|
configKey?: string;
|
|
1950
|
+
/** Whether this controller requires a valid license to operate. */
|
|
1228
1951
|
needsLicense?: boolean;
|
|
1952
|
+
/** License identifier used for license validation. */
|
|
1229
1953
|
licenseId?: string;
|
|
1230
1954
|
}
|
|
1231
1955
|
|
|
1956
|
+
/**
|
|
1957
|
+
* Class decorator that attaches controller metadata to the target class.
|
|
1958
|
+
*
|
|
1959
|
+
* @param meta - The controller metadata shape to apply.
|
|
1960
|
+
* @returns A class decorator function.
|
|
1961
|
+
*/
|
|
1232
1962
|
declare function VaultController(meta: ControllerMetaShape): (target: any) => void;
|
|
1233
1963
|
|
|
1964
|
+
/** Enumeration of usage-specific Vault error sub-kind classifications. */
|
|
1234
1965
|
declare const VaultErrorUsageKindTypes: {
|
|
1235
1966
|
readonly Encryption: "VaultErrorEncryption";
|
|
1236
1967
|
readonly License: "VaultErrorLicense";
|
|
@@ -1238,58 +1969,94 @@ declare const VaultErrorUsageKindTypes: {
|
|
|
1238
1969
|
readonly PromiseFactoryRequired: "VaultErrorUsagePromiseFactoryRequired";
|
|
1239
1970
|
readonly Usage: "VaultErrorUsage";
|
|
1240
1971
|
};
|
|
1972
|
+
/** Union type derived from VaultErrorUsageKindTypes values. */
|
|
1241
1973
|
type VaultErrorUsageKindType = (typeof VaultErrorUsageKindTypes)[keyof typeof VaultErrorUsageKindTypes];
|
|
1242
1974
|
|
|
1975
|
+
/** Enumeration of top-level Vault error kind classifications. */
|
|
1243
1976
|
declare const VaultErrorKindTypes: {
|
|
1244
1977
|
readonly Usage: "VaultErrorUsage";
|
|
1245
1978
|
readonly VaultError: "VaultError";
|
|
1246
1979
|
};
|
|
1980
|
+
/** Union type of all Vault error kind values including usage sub-kinds. */
|
|
1247
1981
|
type VaultErrorKindType = (typeof VaultErrorKindTypes)[keyof typeof VaultErrorKindTypes] | (typeof VaultErrorUsageKindTypes)[keyof typeof VaultErrorUsageKindTypes];
|
|
1248
1982
|
|
|
1983
|
+
/** Enumeration of Vault error name identifiers. */
|
|
1249
1984
|
declare const VaultErrorNameTypes: {
|
|
1250
1985
|
readonly EncryptionIntegrity: "VaultErrorEncryptionIntegrity";
|
|
1251
1986
|
readonly License: "VaultErrorLicense";
|
|
1252
1987
|
readonly Usage: "VaultErrorUsage";
|
|
1253
1988
|
readonly VaultError: "VaultError";
|
|
1254
1989
|
};
|
|
1990
|
+
/** Union type derived from VaultErrorNameTypes values. */
|
|
1255
1991
|
type VaultErrorNameType = (typeof VaultErrorNameTypes)[keyof typeof VaultErrorNameTypes];
|
|
1256
1992
|
|
|
1993
|
+
/**
|
|
1994
|
+
* Base error class for all Vault-specific errors. Extends the native Error
|
|
1995
|
+
* with a typed name and kind for structured error classification.
|
|
1996
|
+
*/
|
|
1257
1997
|
declare class VaultError extends Error {
|
|
1998
|
+
/** Classification kind used to categorize this error in diagnostics. */
|
|
1258
1999
|
readonly kind: VaultErrorKindType;
|
|
2000
|
+
/**
|
|
2001
|
+
* Creates a new VaultError instance with prototype chain correction.
|
|
2002
|
+
*
|
|
2003
|
+
* @param message - Human-readable description of the error.
|
|
2004
|
+
* @param name - Typed error name used for identification.
|
|
2005
|
+
* @param kind - Error kind used for diagnostic classification.
|
|
2006
|
+
*/
|
|
1259
2007
|
constructor(message: string, name?: VaultErrorNameType, kind?: VaultErrorKindType);
|
|
1260
2008
|
}
|
|
1261
2009
|
|
|
1262
2010
|
/**
|
|
1263
|
-
* Thrown when encrypted payload integrity verification
|
|
1264
|
-
*
|
|
1265
|
-
* This occurs when AES-GCM authentication fails during decryption.
|
|
1266
|
-
* Causes may include:
|
|
1267
|
-
*
|
|
1268
|
-
* - Tampered ciphertext
|
|
1269
|
-
* - Modified IV
|
|
1270
|
-
* - Incorrect encryption key
|
|
1271
|
-
* - Corrupted storage payload
|
|
1272
|
-
*
|
|
1273
|
-
* AES-GCM provides authenticated encryption, so any modification to the
|
|
1274
|
-
* encrypted envelope will cause the WebCrypto decrypt operation to throw.
|
|
2011
|
+
* Thrown when an encrypted payload fails AES-GCM integrity verification
|
|
2012
|
+
* during decryption, indicating tampered, corrupted, or mismatched key data.
|
|
1275
2013
|
*/
|
|
1276
2014
|
declare class VaultEncryptionIntegrityError extends VaultError {
|
|
2015
|
+
/** Creates the error with a descriptive integrity-failure message. */
|
|
1277
2016
|
constructor();
|
|
1278
2017
|
}
|
|
1279
2018
|
|
|
2019
|
+
/**
|
|
2020
|
+
* Thrown when a behavior or controller fails license validation.
|
|
2021
|
+
*/
|
|
1280
2022
|
declare class VaultLicenseError extends VaultError {
|
|
2023
|
+
/**
|
|
2024
|
+
* Creates a license validation error.
|
|
2025
|
+
*
|
|
2026
|
+
* @param message - Description of the license violation.
|
|
2027
|
+
* @param kind - Usage-kind classification for diagnostics.
|
|
2028
|
+
*/
|
|
1281
2029
|
constructor(message: string, kind?: VaultErrorUsageKindType);
|
|
1282
2030
|
}
|
|
1283
2031
|
|
|
2032
|
+
/**
|
|
2033
|
+
* Base error for Vault API usage violations detected at runtime.
|
|
2034
|
+
*/
|
|
1284
2035
|
declare class VaultUsageError extends VaultError {
|
|
2036
|
+
/**
|
|
2037
|
+
* Creates a usage error with the specified message and kind.
|
|
2038
|
+
*
|
|
2039
|
+
* @param message - Description of the usage violation.
|
|
2040
|
+
* @param kind - Usage-kind classification for diagnostics.
|
|
2041
|
+
*/
|
|
1285
2042
|
constructor(message: string, kind?: VaultErrorUsageKindType);
|
|
1286
2043
|
}
|
|
1287
2044
|
|
|
2045
|
+
/**
|
|
2046
|
+
* Thrown when an eager Promise is passed directly to the state pipeline
|
|
2047
|
+
* instead of a deferred factory function.
|
|
2048
|
+
*/
|
|
1288
2049
|
declare class VaultUsagePromiseError extends VaultUsageError {
|
|
2050
|
+
/** Creates the error with a descriptive usage-violation message. */
|
|
1289
2051
|
constructor();
|
|
1290
2052
|
}
|
|
1291
2053
|
|
|
2054
|
+
/**
|
|
2055
|
+
* Thrown when a Promise-based state method receives a raw value instead
|
|
2056
|
+
* of a factory function that returns a Promise.
|
|
2057
|
+
*/
|
|
1292
2058
|
declare class VaultUsagePromiseFactoryRequiredError extends VaultUsageError {
|
|
2059
|
+
/** Creates the error with a descriptive usage-violation message. */
|
|
1293
2060
|
constructor();
|
|
1294
2061
|
}
|
|
1295
2062
|
|
|
@@ -1297,9 +2064,6 @@ declare class VaultUsagePromiseFactoryRequiredError extends VaultUsageError {
|
|
|
1297
2064
|
* Represents the possible result of a core emit operation.
|
|
1298
2065
|
* This type indicates either an intentional no-op signal or the absence of an emitted state.
|
|
1299
2066
|
*
|
|
1300
|
-
* --RelatedStart--
|
|
1301
|
-
* VAULT_NOOP
|
|
1302
|
-
* --RelatedEnd--
|
|
1303
2067
|
*/
|
|
1304
2068
|
type CoreEmitStateResult = typeof VAULT_NOOP | undefined;
|
|
1305
2069
|
|
|
@@ -1317,14 +2081,17 @@ interface CoreEmitStateBehaviorContract<T> extends BehaviorContract<T> {
|
|
|
1317
2081
|
emitState(snapshot: StateSnapshotShape<T>, callback: CoreEmitStateCallback<T>): CoreEmitStateResult;
|
|
1318
2082
|
}
|
|
1319
2083
|
|
|
2084
|
+
/** Enumeration of event boundary positions within a lifecycle span. */
|
|
1320
2085
|
declare const EventBoundaryTypes: {
|
|
1321
2086
|
readonly End: "end";
|
|
1322
2087
|
readonly Notification: "notification";
|
|
1323
2088
|
readonly Start: "start";
|
|
1324
2089
|
readonly Unknown: "unknown";
|
|
1325
2090
|
};
|
|
2091
|
+
/** Union type derived from EventBoundaryTypes values. */
|
|
1326
2092
|
type EventBoundaryType = (typeof EventBoundaryTypes)[keyof typeof EventBoundaryTypes];
|
|
1327
2093
|
|
|
2094
|
+
/** Enumeration of monitor event category classifications. */
|
|
1328
2095
|
declare const EventTypes: {
|
|
1329
2096
|
readonly Conductor: "conductor";
|
|
1330
2097
|
readonly Controller: "controller";
|
|
@@ -1332,15 +2099,12 @@ declare const EventTypes: {
|
|
|
1332
2099
|
readonly Stage: "stage";
|
|
1333
2100
|
readonly Unknown: "unknown";
|
|
1334
2101
|
};
|
|
2102
|
+
/** Union type derived from EventTypes values. */
|
|
1335
2103
|
type EventType = (typeof EventTypes)[keyof typeof EventTypes];
|
|
1336
2104
|
|
|
1337
2105
|
/**
|
|
1338
2106
|
* Describes the shape of a pipeline event emitted during FeatureCell execution.
|
|
1339
2107
|
* This interface defines the core event contract used for diagnostics, Devtools inspection, and lifecycle tracking.
|
|
1340
|
-
*
|
|
1341
|
-
* --RelatedStart--
|
|
1342
|
-
* StateSnapshotShape
|
|
1343
|
-
* --RelatedEnd--
|
|
1344
2108
|
*/
|
|
1345
2109
|
interface EventShape<T = any> {
|
|
1346
2110
|
/**
|
|
@@ -1375,6 +2139,9 @@ interface EventShape<T = any> {
|
|
|
1375
2139
|
* The event name describing the lifecycle transition or action.
|
|
1376
2140
|
*/
|
|
1377
2141
|
name: string;
|
|
2142
|
+
/**
|
|
2143
|
+
* Classification of the event within the pipeline lifecycle.
|
|
2144
|
+
*/
|
|
1378
2145
|
type: EventType;
|
|
1379
2146
|
/**
|
|
1380
2147
|
* The event boundary type.
|
|
@@ -1394,10 +2161,6 @@ interface EventShape<T = any> {
|
|
|
1394
2161
|
* Defines the contract for an event bus responsible for emitting and observing pipeline and queue events.
|
|
1395
2162
|
* This interface provides methods for publishing events and subscribing to their corresponding event streams.
|
|
1396
2163
|
*
|
|
1397
|
-
* --RelatedStart--
|
|
1398
|
-
* EventShape
|
|
1399
|
-
* EventQueueShape
|
|
1400
|
-
* --RelatedEnd--
|
|
1401
2164
|
*/
|
|
1402
2165
|
interface EventBusContract {
|
|
1403
2166
|
/**
|
|
@@ -1414,6 +2177,7 @@ interface EventBusContract {
|
|
|
1414
2177
|
pipeline$(): Observable<EventShape>;
|
|
1415
2178
|
}
|
|
1416
2179
|
|
|
2180
|
+
/** Enumeration of license validation statuses for FeatureCell registration. */
|
|
1417
2181
|
declare const VaultRegistrationLicenseStatusTypes: {
|
|
1418
2182
|
readonly NotRequired: "not-required";
|
|
1419
2183
|
readonly Pending: "pending";
|
|
@@ -1421,36 +2185,62 @@ declare const VaultRegistrationLicenseStatusTypes: {
|
|
|
1421
2185
|
readonly Timeout: "timeout";
|
|
1422
2186
|
readonly Valid: "valid";
|
|
1423
2187
|
};
|
|
2188
|
+
/** Union type derived from VaultRegistrationLicenseStatusTypes values. */
|
|
1424
2189
|
type VaultRegistrationLicenseStatusType = (typeof VaultRegistrationLicenseStatusTypes)[keyof typeof VaultRegistrationLicenseStatusTypes];
|
|
1425
2190
|
|
|
2191
|
+
/** Shape describing a registered behavior or controller entity within a FeatureCell. */
|
|
1426
2192
|
interface VaultRegistrationEntityShape {
|
|
2193
|
+
/** Unique identifier for this entity. */
|
|
1427
2194
|
key: string;
|
|
2195
|
+
/** Entity type classification string. */
|
|
1428
2196
|
type: string;
|
|
2197
|
+
/** Whether this entity is critical to pipeline execution. */
|
|
1429
2198
|
critical?: boolean;
|
|
2199
|
+
/** Whether this entity requires a valid license. */
|
|
1430
2200
|
needsLicense?: boolean;
|
|
2201
|
+
/** Current license validation status for this entity. */
|
|
1431
2202
|
validLicense?: VaultRegistrationLicenseStatusType;
|
|
2203
|
+
/** License identifier associated with this entity. */
|
|
1432
2204
|
licenseId?: string;
|
|
1433
2205
|
}
|
|
1434
2206
|
|
|
2207
|
+
/** Shape tracking the count of fluent API registrations on a FeatureCell. */
|
|
1435
2208
|
interface VaultRegistrationFluentApiShape {
|
|
2209
|
+
/** Number of registered filter functions. */
|
|
1436
2210
|
filters: number;
|
|
2211
|
+
/** Number of registered reducer functions. */
|
|
1437
2212
|
reducers: number;
|
|
2213
|
+
/** Number of registered before-tap callbacks. */
|
|
1438
2214
|
beforeTaps: number;
|
|
2215
|
+
/** Number of registered after-tap callbacks. */
|
|
1439
2216
|
afterTaps: number;
|
|
2217
|
+
/** Number of registered emit-state callbacks. */
|
|
1440
2218
|
emitStateCallbacks: number;
|
|
2219
|
+
/** Number of registered error callbacks. */
|
|
1441
2220
|
errorCallbacks: number;
|
|
1442
2221
|
}
|
|
1443
2222
|
|
|
2223
|
+
/** Shape representing the full registration record of a FeatureCell in the Vault. */
|
|
1444
2224
|
interface VaultRegistrationShape {
|
|
2225
|
+
/** Unique key identifying the registered FeatureCell. */
|
|
1445
2226
|
key: string;
|
|
2227
|
+
/** Factory returning a promise that resolves when the vault has settled. */
|
|
1446
2228
|
vaultSettled?: () => Promise<void>;
|
|
2229
|
+
/** Map of registered behavior entities keyed by behavior key. */
|
|
1447
2230
|
behaviors?: Map<string, VaultRegistrationEntityShape>;
|
|
2231
|
+
/** Map of registered controller entities keyed by controller key. */
|
|
1448
2232
|
controllers?: Map<string, VaultRegistrationEntityShape>;
|
|
2233
|
+
/** Read-only snapshot of fluent API registration counts. */
|
|
1449
2234
|
fluentApis?: Readonly<VaultRegistrationFluentApiShape>;
|
|
2235
|
+
/** Whether all behaviors have completed registration. */
|
|
1450
2236
|
behaviorsRegistered?: boolean;
|
|
2237
|
+
/** Whether all controllers have completed registration. */
|
|
1451
2238
|
controllersRegistered?: boolean;
|
|
1452
2239
|
}
|
|
1453
2240
|
|
|
2241
|
+
/**
|
|
2242
|
+
* Shape of the global SDuX runtime namespace attached to the window object.
|
|
2243
|
+
*/
|
|
1454
2244
|
interface SDuXShape {
|
|
1455
2245
|
/**
|
|
1456
2246
|
* Global Vault monitor instance.
|
|
@@ -1460,6 +2250,9 @@ interface SDuXShape {
|
|
|
1460
2250
|
* Global Vault event bus instance.
|
|
1461
2251
|
*/
|
|
1462
2252
|
vaultEventBus?: EventBusContract;
|
|
2253
|
+
/**
|
|
2254
|
+
* Optional debug widget configuration for devtools integration.
|
|
2255
|
+
*/
|
|
1463
2256
|
debugWidget?: {
|
|
1464
2257
|
versions?: Record<string, string>;
|
|
1465
2258
|
injected?: boolean;
|
|
@@ -1526,6 +2319,7 @@ type InterceptorStateType<T> = StateInputType<T> | typeof VAULT_STOP;
|
|
|
1526
2319
|
*/
|
|
1527
2320
|
type PipelinePersistValue<T> = T | undefined;
|
|
1528
2321
|
|
|
2322
|
+
/** Union of all valid upstream values that a pipeline stage may produce. */
|
|
1529
2323
|
type PipelineUpstreamValue<T> = T | undefined | typeof VAULT_NOOP | typeof VAULT_CLEAR_STATE | typeof VAULT_CONTINUE;
|
|
1530
2324
|
|
|
1531
2325
|
/**
|
|
@@ -1540,6 +2334,7 @@ type PipelineUpstreamValue<T> = T | undefined | typeof VAULT_NOOP | typeof VAULT
|
|
|
1540
2334
|
*/
|
|
1541
2335
|
type PipelineValue<T> = T | undefined;
|
|
1542
2336
|
|
|
2337
|
+
/** Union of all terminal pipeline values including the stop sentinel. */
|
|
1543
2338
|
type FinalState<T> = PipelineUpstreamValue<T> | typeof VAULT_STOP;
|
|
1544
2339
|
|
|
1545
2340
|
/**
|
|
@@ -1614,6 +2409,9 @@ interface DevPipelineObserverBehaviorContract extends BehaviorContract {
|
|
|
1614
2409
|
emitError(cellKey: string, error: VaultErrorShape): void;
|
|
1615
2410
|
}
|
|
1616
2411
|
|
|
2412
|
+
/**
|
|
2413
|
+
* Contract for encryption behaviors that protect persisted state values.
|
|
2414
|
+
*/
|
|
1617
2415
|
interface EncryptBehaviorContract<T> extends BehaviorContract<T> {
|
|
1618
2416
|
/**
|
|
1619
2417
|
* Encrypts a plain or already-processed state value before persistence.
|
|
@@ -1634,41 +2432,84 @@ interface EncryptBehaviorContract<T> extends BehaviorContract<T> {
|
|
|
1634
2432
|
decryptState(ctx: BehaviorContext<T>, encrypted: PipelinePersistValue<T>): Promise<PipelinePersistValue<T>> | PipelinePersistValue<T>;
|
|
1635
2433
|
}
|
|
1636
2434
|
|
|
2435
|
+
/**
|
|
2436
|
+
* Contract for filter behaviors that selectively pass or reject state updates.
|
|
2437
|
+
*/
|
|
1637
2438
|
interface FilterBehaviorContract<T> extends BehaviorContract<T> {
|
|
1638
2439
|
/** Identifies this behavior as a filter behavior. */
|
|
1639
2440
|
type: 'filter';
|
|
2441
|
+
/**
|
|
2442
|
+
* Applies the filter function against the current pipeline value.
|
|
2443
|
+
*
|
|
2444
|
+
* @param current - The upstream pipeline value to evaluate.
|
|
2445
|
+
* @param filter - The filter function that determines acceptance.
|
|
2446
|
+
* @returns The filtered pipeline value.
|
|
2447
|
+
*/
|
|
1640
2448
|
applyFilter(current: PipelineUpstreamValue<T>, filter: FilterFunction<T>): PipelineUpstreamValue<T>;
|
|
1641
2449
|
}
|
|
1642
2450
|
|
|
2451
|
+
/**
|
|
2452
|
+
* Contract for interceptor behaviors that preprocess incoming state before resolve.
|
|
2453
|
+
*/
|
|
1643
2454
|
interface InterceptorBehaviorContract<T> extends BehaviorContract<T> {
|
|
1644
2455
|
/**
|
|
1645
2456
|
* Applies the interceptor logic for the incoming state packet.
|
|
1646
2457
|
*
|
|
1647
|
-
* @param ctx - The behavior execution context
|
|
1648
|
-
* state
|
|
1649
|
-
* @returns A promise that resolves to a transformed or replacement
|
|
1650
|
-
* {@link StateInputType} value, or `undefined` when no modification is
|
|
1651
|
-
* necessary.
|
|
2458
|
+
* @param ctx - The behavior execution context for the current pipeline operation.
|
|
2459
|
+
* @returns A transformed state value, or undefined when no modification is necessary.
|
|
1652
2460
|
*/
|
|
1653
2461
|
applyInterceptor(ctx: BehaviorContext<T>): Promise<InterceptorStateType<T>>;
|
|
1654
2462
|
}
|
|
1655
2463
|
|
|
2464
|
+
/** Contract for merge behaviors that combine current and incoming state. */
|
|
1656
2465
|
interface MergeBehaviorContract<T> extends BehaviorContract<T> {
|
|
2466
|
+
/**
|
|
2467
|
+
* Computes the merged result of the current and next pipeline values.
|
|
2468
|
+
*
|
|
2469
|
+
* @param currentValue - The existing state value.
|
|
2470
|
+
* @param nextValue - The incoming candidate value.
|
|
2471
|
+
* @param options - Optional merge configuration.
|
|
2472
|
+
* @returns The merged pipeline value.
|
|
2473
|
+
*/
|
|
1657
2474
|
computeMerge(currentValue: PipelineUpstreamValue<T> | undefined, nextValue: PipelineUpstreamValue<T> | undefined, options?: MergeConfig): PipelineUpstreamValue<T> | undefined;
|
|
1658
2475
|
}
|
|
1659
2476
|
|
|
2477
|
+
/** Contract for operator behaviors that transform pipeline values. */
|
|
1660
2478
|
interface OperatorBehaviorContract<T> extends BehaviorContract<T> {
|
|
2479
|
+
/**
|
|
2480
|
+
* Applies the operator transformation to the current pipeline value.
|
|
2481
|
+
*
|
|
2482
|
+
* @param value - The upstream pipeline value to transform.
|
|
2483
|
+
* @returns A promise resolving to the transformed pipeline value.
|
|
2484
|
+
*/
|
|
1661
2485
|
applyOperator(value: PipelineUpstreamValue<T>): Promise<PipelineUpstreamValue<T>>;
|
|
1662
2486
|
}
|
|
1663
2487
|
|
|
2488
|
+
/**
|
|
2489
|
+
* Contract for persistence behaviors that save and restore FeatureCell state.
|
|
2490
|
+
*/
|
|
1664
2491
|
interface PersistBehaviorContract<T> extends BehaviorContract<T> {
|
|
1665
2492
|
/** Identifies this behavior as a persistence behavior. */
|
|
1666
2493
|
type: 'persist';
|
|
2494
|
+
/**
|
|
2495
|
+
* Persists the current state snapshot to the configured storage.
|
|
2496
|
+
*
|
|
2497
|
+
* @param current - The pipeline persist value to store.
|
|
2498
|
+
*/
|
|
1667
2499
|
persistState(current: PipelinePersistValue<T>): Promise<void> | void;
|
|
2500
|
+
/** Clears the persisted state from storage. */
|
|
1668
2501
|
clearState(): void;
|
|
2502
|
+
/**
|
|
2503
|
+
* Loads the previously persisted state from storage.
|
|
2504
|
+
*
|
|
2505
|
+
* @returns The restored persist value.
|
|
2506
|
+
*/
|
|
1669
2507
|
loadState(): PipelinePersistValue<T>;
|
|
1670
2508
|
}
|
|
1671
2509
|
|
|
2510
|
+
/**
|
|
2511
|
+
* Contract for reducer-stage behaviors that transform pipeline state.
|
|
2512
|
+
*/
|
|
1672
2513
|
interface ReduceBehaviorContract<T> extends BehaviorContract<T> {
|
|
1673
2514
|
/** Pipeline behavior type identifier for reducer-stage execution. */
|
|
1674
2515
|
type: 'reduce';
|
|
@@ -1682,46 +2523,120 @@ interface ReduceBehaviorContract<T> extends BehaviorContract<T> {
|
|
|
1682
2523
|
applyReducer(current: PipelineUpstreamValue<T>, reducer: ReducerFunction<T>): T;
|
|
1683
2524
|
}
|
|
1684
2525
|
|
|
2526
|
+
/**
|
|
2527
|
+
* Contract for resolve behaviors that derive initial state from an external source.
|
|
2528
|
+
*/
|
|
1685
2529
|
interface ResolveBehaviorContract<T> extends BehaviorContract<T> {
|
|
1686
2530
|
/** Resolve strategy used by this behavior (value, HTTP resource, observable, etc.). */
|
|
1687
2531
|
resolveType: 'http-resource' | 'observable' | 'promise' | 'value';
|
|
2532
|
+
/**
|
|
2533
|
+
* Computes the resolved state value for the current pipeline operation.
|
|
2534
|
+
*
|
|
2535
|
+
* @param ctx - The behavior execution context for the current pipeline run.
|
|
2536
|
+
* @returns The resolved state value, synchronously or as a promise.
|
|
2537
|
+
*/
|
|
1688
2538
|
computeResolve(ctx: BehaviorContext<T>): Promise<PipelineUpstreamValue<T>> | PipelineUpstreamValue<T>;
|
|
1689
2539
|
}
|
|
1690
2540
|
|
|
2541
|
+
/** Contract for stepwise behaviors that compare current and candidate state. */
|
|
1691
2542
|
interface StepwiseBehaviorContract<T> extends BehaviorContract<T> {
|
|
2543
|
+
/**
|
|
2544
|
+
* Evaluates whether the candidate value should replace the current state.
|
|
2545
|
+
*
|
|
2546
|
+
* @param current - The current state value.
|
|
2547
|
+
* @param candidate - The candidate pipeline value.
|
|
2548
|
+
* @param pipelineId - Trace identifier for the current pipeline run.
|
|
2549
|
+
* @returns A promise resolving to the accepted pipeline value.
|
|
2550
|
+
*/
|
|
1692
2551
|
evaluateStepwise(current: T | undefined, candidate: PipelineUpstreamValue<T>, pipelineId: string): Promise<PipelineUpstreamValue<T>>;
|
|
1693
2552
|
}
|
|
1694
2553
|
|
|
2554
|
+
/** Contract for after-tap behaviors that observe state after pipeline resolution. */
|
|
1695
2555
|
interface AfterTapBehaviorContract<T> extends BehaviorContract<T> {
|
|
2556
|
+
/**
|
|
2557
|
+
* Invokes the tap callback with the current pipeline value after resolution.
|
|
2558
|
+
*
|
|
2559
|
+
* @param current - The upstream pipeline value.
|
|
2560
|
+
* @param tap - The tap callback to invoke.
|
|
2561
|
+
*/
|
|
1696
2562
|
applyAfterTap(current: PipelineUpstreamValue<T>, tap: TapCallback<T>): void;
|
|
1697
2563
|
}
|
|
1698
2564
|
|
|
2565
|
+
/** Contract for before-tap behaviors that observe state before pipeline resolution. */
|
|
1699
2566
|
interface BeforeTapBehaviorContract<T> extends BehaviorContract<T> {
|
|
2567
|
+
/**
|
|
2568
|
+
* Invokes the tap callback with the current pipeline value before resolution.
|
|
2569
|
+
*
|
|
2570
|
+
* @param current - The upstream pipeline value.
|
|
2571
|
+
* @param tap - The tap callback to invoke.
|
|
2572
|
+
*/
|
|
1700
2573
|
applyBeforeTap(current: PipelineUpstreamValue<T>, tap: TapCallback<T>): void;
|
|
1701
2574
|
}
|
|
1702
2575
|
|
|
2576
|
+
/** Static-side contract for controller classes used by the controller factory. */
|
|
1703
2577
|
interface ControllerClassContract<T = any> {
|
|
2578
|
+
/**
|
|
2579
|
+
* Creates a new controller instance.
|
|
2580
|
+
*
|
|
2581
|
+
* @param controllerKey - Unique key assigned by the controller factory.
|
|
2582
|
+
* @param controllerCtx - Class-level context for dependency resolution.
|
|
2583
|
+
*/
|
|
1704
2584
|
new (controllerKey: string, controllerCtx: ControllerClassContext): ControllerContract<T>;
|
|
2585
|
+
/** Pipeline stage in which this controller participates. */
|
|
1705
2586
|
readonly type: ControllerType;
|
|
2587
|
+
/** Unique identifier assigned to this controller class. */
|
|
1706
2588
|
readonly key: string;
|
|
2589
|
+
/** Whether errors from this controller halt the pipeline. */
|
|
1707
2590
|
readonly critical: boolean;
|
|
2591
|
+
/**
|
|
2592
|
+
* Optional hook that installs a fluent API onto the FeatureCell.
|
|
2593
|
+
*
|
|
2594
|
+
* @param cell - The FeatureCell shape to extend.
|
|
2595
|
+
* @param behaviorConfigs - Map of behavior configuration entries.
|
|
2596
|
+
*/
|
|
1708
2597
|
installFluentApi?: <T>(cell: FeatureCellBaseShape<T>, behaviorConfigs: Map<string, unknown>) => void;
|
|
1709
2598
|
}
|
|
1710
2599
|
|
|
2600
|
+
/** Contract for the public-facing Vault error service. */
|
|
1711
2601
|
interface VaultErrorServiceContract {
|
|
2602
|
+
/** Observable stream of the current error state. */
|
|
1712
2603
|
readonly error$: Observable<VaultErrorShape | null>;
|
|
2604
|
+
/** Clears the current error state. */
|
|
1713
2605
|
clear(): void;
|
|
2606
|
+
/** Whether an active error is currently present. */
|
|
1714
2607
|
get hasError(): boolean;
|
|
1715
2608
|
}
|
|
1716
2609
|
|
|
2610
|
+
/** Contract for the internal private error service used by VaultErrorService. */
|
|
1717
2611
|
interface VaultPrivateErrorServiceContract {
|
|
2612
|
+
/**
|
|
2613
|
+
* Publishes a new error or clears the current error.
|
|
2614
|
+
*
|
|
2615
|
+
* @param error - The error shape to publish, or null to clear.
|
|
2616
|
+
*/
|
|
1718
2617
|
setError(error: VaultErrorShape | null): void;
|
|
2618
|
+
/**
|
|
2619
|
+
* Returns an observable of the current error state.
|
|
2620
|
+
*
|
|
2621
|
+
* @returns Observable emitting the current error or null.
|
|
2622
|
+
*/
|
|
1719
2623
|
getError(): Observable<VaultErrorShape | null>;
|
|
2624
|
+
/** Resets the error state to null. */
|
|
1720
2625
|
clear(): void;
|
|
1721
2626
|
}
|
|
1722
2627
|
|
|
2628
|
+
/**
|
|
2629
|
+
* Returns the singleton VaultErrorService instance, creating it on first call.
|
|
2630
|
+
*
|
|
2631
|
+
* @returns The shared VaultErrorService instance.
|
|
2632
|
+
*/
|
|
1723
2633
|
declare function VaultErrorService(): VaultErrorServiceContract;
|
|
1724
2634
|
|
|
2635
|
+
/**
|
|
2636
|
+
* Returns the singleton VaultPrivateErrorService instance, creating it on first call.
|
|
2637
|
+
*
|
|
2638
|
+
* @returns The shared private error service instance.
|
|
2639
|
+
*/
|
|
1725
2640
|
declare function VaultPrivateErrorService(): VaultPrivateErrorServiceContract;
|
|
1726
2641
|
|
|
1727
2642
|
/**
|
|
@@ -1759,16 +2674,37 @@ declare function defineBehaviorKey(domain: string, name: string): string;
|
|
|
1759
2674
|
*/
|
|
1760
2675
|
declare function validateBehaviorKey(key: string): boolean;
|
|
1761
2676
|
|
|
2677
|
+
/**
|
|
2678
|
+
* Creates a normalized controller key following the Vault key format.
|
|
2679
|
+
*
|
|
2680
|
+
* @param domain - The logical domain or category of the controller.
|
|
2681
|
+
* @param name - The specific controller name within the domain.
|
|
2682
|
+
* @returns A normalized controller key string.
|
|
2683
|
+
*/
|
|
1762
2684
|
declare function defineControllerKey(domain: string, name: string): string;
|
|
2685
|
+
/**
|
|
2686
|
+
* Validates whether a string conforms to the Vault controller key format.
|
|
2687
|
+
*
|
|
2688
|
+
* @param key - The controller key string to validate.
|
|
2689
|
+
* @returns `true` if the key matches the required pattern.
|
|
2690
|
+
*/
|
|
1763
2691
|
declare function validateControllerKey(key: string): boolean;
|
|
1764
2692
|
|
|
2693
|
+
/**
|
|
2694
|
+
* Determines whether a value conforms to the DeferredFactory contract.
|
|
2695
|
+
*
|
|
2696
|
+
* @param value - The value to inspect.
|
|
2697
|
+
* @returns `true` if the value is an object with a callable `value` property.
|
|
2698
|
+
*/
|
|
1765
2699
|
declare function isDeferredFactory<T = unknown>(value: unknown): value is DeferredFactory<T>;
|
|
1766
2700
|
|
|
2701
|
+
/** Singleton accessor for Vault development mode state. */
|
|
1767
2702
|
declare const DevMode: {
|
|
1768
2703
|
readonly active: boolean;
|
|
1769
2704
|
setDevMode(isDevMode: boolean): void;
|
|
1770
2705
|
};
|
|
1771
2706
|
|
|
2707
|
+
/** Singleton accessor that detects whether code is running in a test environment. */
|
|
1772
2708
|
declare const isTestEnv: {
|
|
1773
2709
|
readonly active: boolean;
|
|
1774
2710
|
};
|
|
@@ -1785,6 +2721,12 @@ declare const isTestEnv: {
|
|
|
1785
2721
|
*/
|
|
1786
2722
|
declare function createVaultError(err: unknown, featureCellKey: string): VaultErrorShape;
|
|
1787
2723
|
|
|
2724
|
+
/**
|
|
2725
|
+
* Creates an immutable copy of a value using structuredClone with a deepFreeze fallback.
|
|
2726
|
+
*
|
|
2727
|
+
* @param value - The value to isolate.
|
|
2728
|
+
* @returns An immutable copy of the value.
|
|
2729
|
+
*/
|
|
1788
2730
|
declare const isolateValue: <T>(value: T) => T;
|
|
1789
2731
|
|
|
1790
2732
|
/**
|
|
@@ -1811,7 +2753,17 @@ declare const vaultLog: (...args: any[]) => void;
|
|
|
1811
2753
|
* @param args - Console arguments to log.
|
|
1812
2754
|
*/
|
|
1813
2755
|
declare const vaultDebug: (...args: any[]) => void;
|
|
2756
|
+
/**
|
|
2757
|
+
* Sets the global Vault log level threshold.
|
|
2758
|
+
*
|
|
2759
|
+
* @param level - The log level to apply.
|
|
2760
|
+
*/
|
|
1814
2761
|
declare function setVaultLogLevel(level: LogLevelType): void;
|
|
2762
|
+
/**
|
|
2763
|
+
* Returns the current global Vault log level.
|
|
2764
|
+
*
|
|
2765
|
+
* @returns The active log level threshold.
|
|
2766
|
+
*/
|
|
1815
2767
|
declare function getVaultLogLevel(): LogLevelType;
|
|
1816
2768
|
|
|
1817
2769
|
/**
|
|
@@ -1821,7 +2773,19 @@ declare function getVaultLogLevel(): LogLevelType;
|
|
|
1821
2773
|
* @returns `true` if the value is the `VAULT_NOOP` sentinel.
|
|
1822
2774
|
*/
|
|
1823
2775
|
declare const isVaultNoop: <T>(current: FinalState<T>) => boolean;
|
|
2776
|
+
/**
|
|
2777
|
+
* Indicates whether a final pipeline value represents the clear-state sentinel.
|
|
2778
|
+
*
|
|
2779
|
+
* @param current - The computed pipeline result.
|
|
2780
|
+
* @returns `true` if the value is the `VAULT_CLEAR_STATE` sentinel.
|
|
2781
|
+
*/
|
|
1824
2782
|
declare const isVaultClearState: <T>(current: FinalState<T>) => boolean;
|
|
2783
|
+
/**
|
|
2784
|
+
* Indicates whether a final pipeline value represents the continue sentinel.
|
|
2785
|
+
*
|
|
2786
|
+
* @param current - The computed pipeline result.
|
|
2787
|
+
* @returns `true` if the value is the `VAULT_CONTINUE` sentinel.
|
|
2788
|
+
*/
|
|
1825
2789
|
declare const isVaultContinue: <T>(current: FinalState<T>) => boolean;
|
|
1826
2790
|
/**
|
|
1827
2791
|
* Checks whether a value is exactly `null`.
|
|
@@ -1852,10 +2816,34 @@ declare const isDefined: (current: unknown) => boolean;
|
|
|
1852
2816
|
* @returns `true` for `null` or `undefined`, otherwise `false`.
|
|
1853
2817
|
*/
|
|
1854
2818
|
declare const isNullish: (current: unknown) => current is null | undefined;
|
|
2819
|
+
/**
|
|
2820
|
+
* Determines whether a value is a function.
|
|
2821
|
+
*
|
|
2822
|
+
* @param value - The value to check.
|
|
2823
|
+
* @returns `true` if the value is a function.
|
|
2824
|
+
*/
|
|
1855
2825
|
declare const isFunction: (value: unknown) => value is (...args: any[]) => unknown;
|
|
2826
|
+
/**
|
|
2827
|
+
* Determines whether a value is a non-null object.
|
|
2828
|
+
*
|
|
2829
|
+
* @param value - The value to check.
|
|
2830
|
+
* @returns `true` if the value is an object and not null.
|
|
2831
|
+
*/
|
|
1856
2832
|
declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
2833
|
+
/**
|
|
2834
|
+
* Determines whether a value conforms to the StateInputShape contract.
|
|
2835
|
+
*
|
|
2836
|
+
* @param value - The value to inspect.
|
|
2837
|
+
* @returns `true` if the value is a plain object with recognized state keys or is empty.
|
|
2838
|
+
*/
|
|
1857
2839
|
declare const isStateInputShape: <T>(value: unknown) => value is StateInputShape<T>;
|
|
1858
2840
|
|
|
2841
|
+
/**
|
|
2842
|
+
* Determines whether a value is a thenable Promise-like object.
|
|
2843
|
+
*
|
|
2844
|
+
* @param value - The value to inspect.
|
|
2845
|
+
* @returns `true` if the value has a callable `then` property.
|
|
2846
|
+
*/
|
|
1859
2847
|
declare function isPromise<T = unknown>(value: unknown): value is Promise<T>;
|
|
1860
2848
|
|
|
1861
2849
|
/**
|
|
@@ -1896,6 +2884,12 @@ declare function isHttpResourceRef<T>(obj: any): obj is HttpResourceRefShape<T>;
|
|
|
1896
2884
|
*/
|
|
1897
2885
|
declare function safeStringify(value: unknown): string;
|
|
1898
2886
|
|
|
2887
|
+
/**
|
|
2888
|
+
* Registers a package version on the global SDuX debug widget when dev mode is active.
|
|
2889
|
+
*
|
|
2890
|
+
* @param packageName - The npm package name to register.
|
|
2891
|
+
* @param version - The semver version string.
|
|
2892
|
+
*/
|
|
1899
2893
|
declare const registerVersion: (packageName: string, version: string) => void;
|
|
1900
2894
|
|
|
1901
2895
|
export { AbstractActiveController, AbstractErrorCallbackBehavior, AbstractErrorTransformBehavior, BEHAVIOR_META, BehaviorTypes, CONTROLLER_META, ControllerMessageTypes, ControllerTypes, ControllerVotes, DEVTOOLS_AGGREGATE_KEY_CONSTANT, DEVTOOLS_LOGGING_KEY_CONSTANT, DecisionOutcomeTypes, DevMode, EventBoundaryTypes, EventTypes, LogLevelTypes, OperationTypes, ResolveTypes, StateEmitTypes, VAULT_CLEAR_STATE, VAULT_CONTINUE, VAULT_NOOP, VAULT_STOP, VaultBehavior, VaultController, VaultEncryptionIntegrityError, VaultError, VaultErrorKindTypes, VaultErrorNameTypes, VaultErrorService, VaultErrorUsageKindTypes, VaultLicenseError, VaultPrivateErrorService, VaultUsageError, VaultUsagePromiseError, VaultUsagePromiseFactoryRequiredError, createVaultError, defineBehaviorKey, defineControllerKey, getVaultLogLevel, isDeferredFactory, isDefined, isFunction, isHttpResourceRef, isNull, isNullish, isObject, isPromise, isStateInputShape, isTestEnv, isUndefined, isVaultClearState, isVaultContinue, isVaultNoop, isolateValue, registerVersion, safeStringify, setVaultLogLevel, validateBehaviorKey, validateControllerKey, vaultDebug, vaultError, vaultLog, vaultWarn };
|