@sdux-vault/engine 0.0.9
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/LICENSE +212 -0
- package/README.md +239 -0
- package/fesm2022/sdux-vault-engine.mjs +4069 -0
- package/fesm2022/sdux-vault-engine.mjs.map +1 -0
- package/package.json +48 -0
- package/types/sdux-vault-engine.d.ts +440 -0
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sdux-vault/engine",
|
|
3
|
+
"version": "0.0.9",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/sdux-vault/vault-engine.git"
|
|
8
|
+
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://www.sdux-vault.com",
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@sdux-vault/devtools": ">=0.0.6 <0.1.0",
|
|
15
|
+
"tslib": "^2.3.0"
|
|
16
|
+
},
|
|
17
|
+
"peerDependencies": {
|
|
18
|
+
"@sdux-vault/shared": ">=0.0.6 <0.1.0",
|
|
19
|
+
"rxjs": "^7.0.0"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"fesm2022/",
|
|
23
|
+
"types/",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"package.json"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
},
|
|
31
|
+
"types": "./types/sdux-vault-engine.d.ts",
|
|
32
|
+
"main": "./fesm2022/sdux-vault-engine.mjs",
|
|
33
|
+
"sideEffects": [
|
|
34
|
+
"./fesm2022/*.mjs",
|
|
35
|
+
"src/version/version.register.ts"
|
|
36
|
+
],
|
|
37
|
+
"module": "fesm2022/sdux-vault-engine.mjs",
|
|
38
|
+
"typings": "types/sdux-vault-engine.d.ts",
|
|
39
|
+
"exports": {
|
|
40
|
+
"./package.json": {
|
|
41
|
+
"default": "./package.json"
|
|
42
|
+
},
|
|
43
|
+
".": {
|
|
44
|
+
"types": "./types/sdux-vault-engine.d.ts",
|
|
45
|
+
"default": "./fesm2022/sdux-vault-engine.mjs"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import * as _sdux_vault_shared from '@sdux-vault/shared';
|
|
2
|
+
import { TapCallback, BehaviorClassContract, FeatureCellBaseShape, CoreEmitStateCallback, VaultErrorCallback, FilterFunction, DeferredType, ReducerFunction, InterceptorBehaviorClassContract, OperatorsBehaviorClassContract, ControllerClassContract, ControllerContract, ControllerContext, VaultErrorShape, BehaviorContext, VaultPrivateErrorServiceContract, StateInputType, VAULT_NOOP, DecisionOutcomeType, OperationType, InsightConfig, PipelineValue, StateEmitSnapshotShape, CellBuilderContract, VaultConfig, VaultRegistrationShape, BehaviorContract, FinalState, BehaviorClassContext } from '@sdux-vault/shared';
|
|
3
|
+
import * as rxjs from 'rxjs';
|
|
4
|
+
import { Subject } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Core configuration contract for the pipeline orchestrator.
|
|
8
|
+
*
|
|
9
|
+
* This interface defines all inputs required to construct and
|
|
10
|
+
* execute the FeatureCell pipeline, including behaviors, callbacks,
|
|
11
|
+
* error handling services, and monitoring facilities.
|
|
12
|
+
*
|
|
13
|
+
* @typeParam T - The FeatureCell state value type.
|
|
14
|
+
*/
|
|
15
|
+
interface OrchestratorConfig<T> {
|
|
16
|
+
/**
|
|
17
|
+
* Tap callbacks invoked after state resolution.
|
|
18
|
+
*/
|
|
19
|
+
afterTapCallbacks: TapCallback<T>[];
|
|
20
|
+
/**
|
|
21
|
+
* Tap callbacks invoked before state resolution.
|
|
22
|
+
*/
|
|
23
|
+
beforeTapCallbacks: TapCallback<T>[];
|
|
24
|
+
/**
|
|
25
|
+
* Factories defining the behavior classes applied to the pipeline.
|
|
26
|
+
*/
|
|
27
|
+
behaviors: BehaviorClassContract<T>[];
|
|
28
|
+
/**
|
|
29
|
+
* Optional set of behavior class factories applied when no explicit behaviors are provided.
|
|
30
|
+
*/
|
|
31
|
+
defaultBehaviors?: BehaviorClassContract<T>[];
|
|
32
|
+
/**
|
|
33
|
+
* Behavior configuration values indexed by behavior config key.
|
|
34
|
+
*/
|
|
35
|
+
behaviorConfigs: Map<string, unknown>;
|
|
36
|
+
/**
|
|
37
|
+
* The FeatureCell instance whose pipeline is being orchestrated.
|
|
38
|
+
*/
|
|
39
|
+
cell: FeatureCellBaseShape<T>;
|
|
40
|
+
/**
|
|
41
|
+
* emitState callbacks invoked after state resolution.
|
|
42
|
+
*/
|
|
43
|
+
emitStateCallbacks: CoreEmitStateCallback<T>[];
|
|
44
|
+
/**
|
|
45
|
+
* Error callbacks invoked before state resolution.
|
|
46
|
+
*/
|
|
47
|
+
errorCallbacks: VaultErrorCallback<T>[];
|
|
48
|
+
/**
|
|
49
|
+
* Filter callbacks applied during the filter stage.
|
|
50
|
+
*/
|
|
51
|
+
filterCallbacks: FilterFunction<T>[];
|
|
52
|
+
/**
|
|
53
|
+
* Initial state value that seeds the FeatureCell.
|
|
54
|
+
*/
|
|
55
|
+
initialState: T | DeferredType<T>;
|
|
56
|
+
/**
|
|
57
|
+
* Reducer callbacks responsible for state transformation.
|
|
58
|
+
*/
|
|
59
|
+
reducerCallbacks: ReducerFunction<T>[];
|
|
60
|
+
/**
|
|
61
|
+
* Interceptor behavior classes applied before pipeline execution.
|
|
62
|
+
*/
|
|
63
|
+
interceptors: InterceptorBehaviorClassContract<T>[];
|
|
64
|
+
/**
|
|
65
|
+
* Operator behavior classes applied during pipeline execution.
|
|
66
|
+
*/
|
|
67
|
+
operators: OperatorsBehaviorClassContract<T>[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Configuration contract for the Conductor layer.
|
|
72
|
+
*
|
|
73
|
+
* This interface extends the base orchestrator configuration by
|
|
74
|
+
* declaring the controller classes that participate in pipeline
|
|
75
|
+
* decision-making for a FeatureCell.
|
|
76
|
+
*
|
|
77
|
+
* @typeParam T - The FeatureCell state value type.
|
|
78
|
+
*/
|
|
79
|
+
interface ConductorConfig<T> extends OrchestratorConfig<T> {
|
|
80
|
+
/**
|
|
81
|
+
* Factories defining the controller classes applied to the pipeline.
|
|
82
|
+
*/
|
|
83
|
+
controllers: ControllerClassContract<T>[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Defines the set of supported controller event type identifiers.
|
|
88
|
+
* This constant provides the canonical string values used to classify controller event outcomes.
|
|
89
|
+
*/
|
|
90
|
+
declare const ControllerEventTypes: {
|
|
91
|
+
/**
|
|
92
|
+
* Indicates that the controller requested an abort to terminate now.
|
|
93
|
+
*/
|
|
94
|
+
readonly Abort: "abort";
|
|
95
|
+
/**
|
|
96
|
+
* Indicates that the controller execution resulted in a failure.
|
|
97
|
+
*/
|
|
98
|
+
readonly Failure: "failure";
|
|
99
|
+
/**
|
|
100
|
+
* Indicates that the license controller approved the FeatureCell for operation.
|
|
101
|
+
*/
|
|
102
|
+
readonly LicenseApproved: "licenseApproved";
|
|
103
|
+
/**
|
|
104
|
+
* Indicates that the license controller denied the FeatureCell for operation.
|
|
105
|
+
*/
|
|
106
|
+
readonly LicenseDenied: "licenseDenied";
|
|
107
|
+
/**
|
|
108
|
+
* Indicates that the controller requested a revote.
|
|
109
|
+
*/
|
|
110
|
+
readonly Revote: "revote";
|
|
111
|
+
/**
|
|
112
|
+
* Indicates that the controller execution completed successfully.
|
|
113
|
+
*/
|
|
114
|
+
readonly Success: "success";
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Represents the union of all valid controller event type values.
|
|
118
|
+
* This type constrains controller events to the supported identifiers defined by the event type registry.
|
|
119
|
+
*
|
|
120
|
+
* --RelatedStart--
|
|
121
|
+
* ControllerEventTypes
|
|
122
|
+
* --RelatedEnd--
|
|
123
|
+
*/
|
|
124
|
+
type ControllerEventType = (typeof ControllerEventTypes)[keyof typeof ControllerEventTypes];
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Describes the shape of an event emitted by a controller during execution.
|
|
128
|
+
* This interface defines the minimal contract required to identify the event type, associate it with a trace, and optionally carry error information.
|
|
129
|
+
*
|
|
130
|
+
* --RelatedStart--
|
|
131
|
+
* ControllerEventType
|
|
132
|
+
* --RelatedEnd--
|
|
133
|
+
*/
|
|
134
|
+
interface ControllerEventShape {
|
|
135
|
+
/**
|
|
136
|
+
* Identifies the type of controller event that occurred.
|
|
137
|
+
*/
|
|
138
|
+
type: ControllerEventType;
|
|
139
|
+
/**
|
|
140
|
+
* Correlation identifier used to associate the event with a specific execution trace.
|
|
141
|
+
*/
|
|
142
|
+
traceId: string;
|
|
143
|
+
/**
|
|
144
|
+
* Optional error value associated with the controller event.
|
|
145
|
+
*/
|
|
146
|
+
error?: unknown;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Coordinates controller arbitration and lifecycle notifications.
|
|
151
|
+
*
|
|
152
|
+
* This class mediates between pipeline execution and registered controllers
|
|
153
|
+
* by delegating vote aggregation to the Arbitrator and emitting controller
|
|
154
|
+
* lifecycle events for monitoring and diagnostics.
|
|
155
|
+
*/
|
|
156
|
+
declare class DecisionEngine<T> {
|
|
157
|
+
#private;
|
|
158
|
+
private readonly controllers;
|
|
159
|
+
private readonly events$;
|
|
160
|
+
/**
|
|
161
|
+
* Creates a new decision engine instance.
|
|
162
|
+
*
|
|
163
|
+
* @param controllers - The controllers participating in pipeline decisions.
|
|
164
|
+
* @param events$ - Subject used to emit controller lifecycle events.
|
|
165
|
+
*/
|
|
166
|
+
constructor(controllers: ControllerContract<T>[], events$: Subject<ControllerEventShape>);
|
|
167
|
+
/**
|
|
168
|
+
* Evaluates whether a pipeline execution attempt is permitted.
|
|
169
|
+
*
|
|
170
|
+
* @param ctx - The controller context for the current pipeline attempt.
|
|
171
|
+
* @returns An observable emitting the aggregated controller decision.
|
|
172
|
+
*/
|
|
173
|
+
evaluateAttempt(ctx: ControllerContext<T>): rxjs.Observable<_sdux_vault_shared.ControllerDecisionShape>;
|
|
174
|
+
/**
|
|
175
|
+
* Notifies controllers that a pipeline execution completed successfully.
|
|
176
|
+
*
|
|
177
|
+
* @param ctx - The controller context associated with the successful run.
|
|
178
|
+
*/
|
|
179
|
+
notifySuccess(ctx: ControllerContext<T>): void;
|
|
180
|
+
/**
|
|
181
|
+
* Notifies controllers that a pipeline execution failed.
|
|
182
|
+
*
|
|
183
|
+
* @param ctx - The controller context associated with the failure.
|
|
184
|
+
* @param error - The error that caused the pipeline to fail.
|
|
185
|
+
*/
|
|
186
|
+
notifyFailure(ctx: ControllerContext<T>, error: VaultErrorShape | unknown): void;
|
|
187
|
+
/**
|
|
188
|
+
* Notifies controllers that a pipeline trace has finalized.
|
|
189
|
+
*
|
|
190
|
+
* @param ctx - The context associated with the finalized pipeline trace.
|
|
191
|
+
*/
|
|
192
|
+
notifyFinalize(ctx: ControllerContext<T> | BehaviorContext<T>): void;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare abstract class Orchestrator<T> {
|
|
196
|
+
#private;
|
|
197
|
+
protected cellKey: string;
|
|
198
|
+
protected decisionEngine: DecisionEngine<T>;
|
|
199
|
+
protected privateErrorService: VaultPrivateErrorServiceContract;
|
|
200
|
+
protected vaultMonitor: _sdux_vault_shared.VaultMonitorContract;
|
|
201
|
+
constructor(config: OrchestratorConfig<T>);
|
|
202
|
+
protected initializeOrchestrator(config: OrchestratorConfig<T>): void;
|
|
203
|
+
protected initializeFeatureCell(ctx: BehaviorContext<T>): Promise<void>;
|
|
204
|
+
protected destroyBehaviors(ctx: BehaviorContext<T>): void;
|
|
205
|
+
protected resetBehaviors(ctx: BehaviorContext<T>): void;
|
|
206
|
+
protected preparingIncoming(ctx: BehaviorContext<T>): StateInputType<T> | typeof VAULT_NOOP;
|
|
207
|
+
protected orchestrate(ctx: BehaviorContext<T>, options?: unknown): Promise<void>;
|
|
208
|
+
protected buildControllerCtx(ctx: BehaviorContext<T>): ControllerContext<T>;
|
|
209
|
+
protected normalizeIncoming<T>(incoming: StateInputType<T>): StateInputType<T>;
|
|
210
|
+
protected controllerOutcomeNotification(type: DecisionOutcomeType, ctx: BehaviorContext<T>): void;
|
|
211
|
+
protected prepIncomingForOrchestration(ctx: BehaviorContext<T>, incoming: StateInputType<T>, operation: OperationType): BehaviorContext<T>;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
declare class Conductor<T> extends Orchestrator<T> {
|
|
215
|
+
#private;
|
|
216
|
+
constructor(config: ConductorConfig<T>);
|
|
217
|
+
initialize(ctx: BehaviorContext<T>): void;
|
|
218
|
+
conduct(ctx: BehaviorContext<T>, incoming: StateInputType<T>, operation: OperationType, options?: unknown): void;
|
|
219
|
+
/**
|
|
220
|
+
* Resets pipeline + controller state for this FeatureCell.
|
|
221
|
+
*
|
|
222
|
+
* FeatureCell should call this from its own reset() method.
|
|
223
|
+
*/
|
|
224
|
+
reset(ctx: BehaviorContext<T>): void;
|
|
225
|
+
/**
|
|
226
|
+
* Destroys pipeline + controller state for this FeatureCell.
|
|
227
|
+
*
|
|
228
|
+
* FeatureCell should call this from its own destroy() method.
|
|
229
|
+
*/
|
|
230
|
+
destroy(ctx: BehaviorContext<T>): void;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Declarative configuration for constructing a FeatureCell.
|
|
235
|
+
*
|
|
236
|
+
* This interface defines the minimum information required to
|
|
237
|
+
* identify, initialize, and optionally observe a FeatureCell
|
|
238
|
+
* instance within the Vault system.
|
|
239
|
+
*
|
|
240
|
+
* @typeParam T - The FeatureCell state value type.
|
|
241
|
+
*/
|
|
242
|
+
interface FeatureCellConfig<T> {
|
|
243
|
+
/**
|
|
244
|
+
* Unique identifier assigned to the FeatureCell instance.
|
|
245
|
+
*/
|
|
246
|
+
key: string;
|
|
247
|
+
/**
|
|
248
|
+
* Initial state value that seeds the FeatureCell.
|
|
249
|
+
*/
|
|
250
|
+
initialState: T;
|
|
251
|
+
/**
|
|
252
|
+
* Optional insight configuration used for enabling diagnostics
|
|
253
|
+
* or devtools-related observations.
|
|
254
|
+
*/
|
|
255
|
+
insights?: InsightConfig;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Represents a reference view of Vault-managed state, including loading, value, and error signals.
|
|
260
|
+
*/
|
|
261
|
+
interface VaultStateRef<T> {
|
|
262
|
+
/**
|
|
263
|
+
* Indicates whether the state is currently loading.
|
|
264
|
+
*/
|
|
265
|
+
isLoading: boolean;
|
|
266
|
+
/**
|
|
267
|
+
* Holds the current pipeline value for the state.
|
|
268
|
+
*/
|
|
269
|
+
value: PipelineValue<T>;
|
|
270
|
+
/**
|
|
271
|
+
* Holds the current error state, if any.
|
|
272
|
+
*/
|
|
273
|
+
error: VaultErrorShape | null;
|
|
274
|
+
/**
|
|
275
|
+
* Indicates whether a value is currently available.
|
|
276
|
+
*/
|
|
277
|
+
hasValue: boolean;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Defines the public shape of a Feature Cell with an exposed resolved state reference.
|
|
282
|
+
* This interface extends the base Feature Cell contract by adding access to the reactive state produced by resolution.
|
|
283
|
+
*
|
|
284
|
+
* --RelatedStart--
|
|
285
|
+
* FeatureCellBaseShape
|
|
286
|
+
* VaultStateRef
|
|
287
|
+
* --RelatedEnd--
|
|
288
|
+
*/
|
|
289
|
+
interface FeatureCellShape<T> extends FeatureCellBaseShape<T> {
|
|
290
|
+
/**
|
|
291
|
+
* Reactive reference to the Feature Cell resolved state.
|
|
292
|
+
*/
|
|
293
|
+
state: VaultStateRef<T>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
declare abstract class FeatureCellBuilder<T> {
|
|
297
|
+
#private;
|
|
298
|
+
protected readonly featureCellConfiguration: FeatureCellConfig<T>;
|
|
299
|
+
private readonly defaultBehaviors;
|
|
300
|
+
protected readonly behaviors: BehaviorClassContract<T>[];
|
|
301
|
+
protected readonly controllers: ControllerClassContract<T>[];
|
|
302
|
+
protected cell: FeatureCellBaseShape<T>;
|
|
303
|
+
protected readonly cellKey: string;
|
|
304
|
+
protected readonly ctx: BehaviorContext<T>;
|
|
305
|
+
protected readonly destroyed$: Subject<void>;
|
|
306
|
+
protected readonly reset$: Subject<void>;
|
|
307
|
+
protected readonly state$: Subject<StateEmitSnapshotShape<T>>;
|
|
308
|
+
constructor(featureCellConfiguration: FeatureCellConfig<T>, defaultBehaviors: BehaviorClassContract<T>[], behaviors: BehaviorClassContract<T>[], controllers: ControllerClassContract<T>[]);
|
|
309
|
+
protected reset(): void;
|
|
310
|
+
protected destroy(): void;
|
|
311
|
+
protected setup(): CellBuilderContract<T>;
|
|
312
|
+
protected mergeState(incoming: StateInputType<T>, options?: unknown): void;
|
|
313
|
+
protected replaceState(incoming: StateInputType<T>, options?: unknown): void;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
declare class FeatureCellClass<T> extends FeatureCellBuilder<T> {
|
|
317
|
+
constructor(descriptor: FeatureCellConfig<T>, defaultBehaviors: BehaviorClassContract<T>[], behaviors: BehaviorClassContract<T>[], controllers: ControllerClassContract<T>[]);
|
|
318
|
+
build(): FeatureCellShape<T>;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
interface RegisteredFeatureCellShape {
|
|
322
|
+
key: string;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
declare function VaultCore(config?: VaultConfig): void;
|
|
326
|
+
declare function registerFeatureCell(entry: RegisteredFeatureCellShape): void;
|
|
327
|
+
declare function getLicensePayload(licenseId: string): unknown;
|
|
328
|
+
declare function vaultAllSettled(): Promise<void>;
|
|
329
|
+
declare function vaultSettled(key: string): Promise<void>;
|
|
330
|
+
declare function registerVaultSettled(key: string, vaultSettled?: () => Promise<void>): void;
|
|
331
|
+
/**
|
|
332
|
+
* Resets the global Vault configuration for isolated tests.
|
|
333
|
+
*
|
|
334
|
+
* This function should **never** be called in production builds.
|
|
335
|
+
*/
|
|
336
|
+
declare function resetVaultForTests(): void;
|
|
337
|
+
declare function resetFeatureCellRegistry(): void;
|
|
338
|
+
declare function getVaultRegistryForTests(): ReadonlyMap<string, VaultRegistrationShape> | undefined;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Contract for behaviors that normalize raw errors into structured vault errors.
|
|
342
|
+
*/
|
|
343
|
+
interface CoreErrorBehaviorContract<T> extends BehaviorContract<T> {
|
|
344
|
+
/**
|
|
345
|
+
* Converts an unknown error value into a normalized vault error shape.
|
|
346
|
+
*
|
|
347
|
+
* @param error - The raw error value captured during execution.
|
|
348
|
+
* @param featureCellKey - The FeatureCell key where the error originated.
|
|
349
|
+
* @returns A normalized vault error representation.
|
|
350
|
+
*/
|
|
351
|
+
handleError(error: unknown, featureCellKey: string): VaultErrorShape;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Contract for the core behavior responsible for committing pipeline state.
|
|
356
|
+
*/
|
|
357
|
+
interface CoreStateBehaviorContract<T> extends BehaviorContract<T> {
|
|
358
|
+
/**
|
|
359
|
+
* Finalizes an error state for the current pipeline execution.
|
|
360
|
+
*
|
|
361
|
+
* @param error - The error to commit or null to clear error state.
|
|
362
|
+
* @param ctx - The active behavior context.
|
|
363
|
+
*/
|
|
364
|
+
finalizePipelineError(error: VaultErrorShape | null, ctx: BehaviorContext<T>): void;
|
|
365
|
+
/**
|
|
366
|
+
* Finalizes a resolved pipeline value.
|
|
367
|
+
*
|
|
368
|
+
* @param value - The computed pipeline result.
|
|
369
|
+
* @param ctx - The active behavior context.
|
|
370
|
+
*/
|
|
371
|
+
finalizePipelineState(value: FinalState<T>, ctx: BehaviorContext<T>): void;
|
|
372
|
+
/**
|
|
373
|
+
* Finalizes a pipeline stop condition without applying state.
|
|
374
|
+
*
|
|
375
|
+
* @param ctx - The active behavior context.
|
|
376
|
+
*/
|
|
377
|
+
finalizePipelineVaultStop(ctx: BehaviorContext<T>): void;
|
|
378
|
+
/**
|
|
379
|
+
* Prepares an incoming value for pipeline processing.
|
|
380
|
+
*
|
|
381
|
+
* @param ctx - The active behavior context.
|
|
382
|
+
* @returns The prepared input or a no-op sentinel.
|
|
383
|
+
*/
|
|
384
|
+
preparePipelineIncoming(ctx: BehaviorContext<T>): StateInputType<T> | typeof VAULT_NOOP;
|
|
385
|
+
/**
|
|
386
|
+
* Finalizes a controller abort condition without applying state.
|
|
387
|
+
*
|
|
388
|
+
* @param ctx - The active behavior context.
|
|
389
|
+
*/
|
|
390
|
+
finalizeControllerAbort(ctx: BehaviorContext<T>): void;
|
|
391
|
+
/**
|
|
392
|
+
* Finalizes a controller deny condition without applying state.
|
|
393
|
+
*
|
|
394
|
+
* @param ctx - The active behavior context.
|
|
395
|
+
*/
|
|
396
|
+
finalizeControllerDeny(ctx: BehaviorContext<T>): void;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
declare abstract class LicensingAbstract<T> {
|
|
400
|
+
#private;
|
|
401
|
+
static readonly needsLicense: boolean;
|
|
402
|
+
static readonly key: string;
|
|
403
|
+
constructor(ctx: BehaviorClassContext);
|
|
404
|
+
validateLicense(valid: boolean): void;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Defines the shape of a Feature Cell registration token.
|
|
409
|
+
* This type represents the minimal identifier required to reference a Feature Cell.
|
|
410
|
+
*/
|
|
411
|
+
type FeatureCellToken = {
|
|
412
|
+
/**
|
|
413
|
+
* Unique key associated with the Feature Cell.
|
|
414
|
+
*/
|
|
415
|
+
key: string;
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Creates a FeatureCell token for the specified key.
|
|
420
|
+
*/
|
|
421
|
+
declare function createFeatureCellToken(key: string): FeatureCellToken;
|
|
422
|
+
/**
|
|
423
|
+
* Retrieves the FeatureCell token associated with a key.
|
|
424
|
+
*/
|
|
425
|
+
declare function getFeatureCellToken(key: string): FeatureCellToken;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Determines whether a pipeline result is terminal.
|
|
429
|
+
*
|
|
430
|
+
* Terminal values indicate that the pipeline must halt without applying
|
|
431
|
+
* a new state snapshot. This includes both no-op and stop signals.
|
|
432
|
+
*
|
|
433
|
+
* @typeParam T - The FeatureCell state value type.
|
|
434
|
+
* @param current - The final pipeline result value.
|
|
435
|
+
* @returns `true` when the pipeline should not apply state.
|
|
436
|
+
*/
|
|
437
|
+
declare const isPipelineTerminal: <T>(current: FinalState<T>) => boolean;
|
|
438
|
+
|
|
439
|
+
export { Conductor, FeatureCellClass, LicensingAbstract, VaultCore, createFeatureCellToken, getFeatureCellToken, getLicensePayload, getVaultRegistryForTests, isPipelineTerminal, registerFeatureCell, registerVaultSettled, resetFeatureCellRegistry, resetVaultForTests, vaultAllSettled, vaultSettled };
|
|
440
|
+
export type { ConductorConfig, CoreErrorBehaviorContract, CoreStateBehaviorContract, FeatureCellConfig, FeatureCellShape, VaultStateRef };
|