@directive-run/core 1.21.0 → 1.23.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/README.md +2 -2
- package/dist/adapter-utils.cjs +1 -1
- package/dist/adapter-utils.d.cts +1 -1
- package/dist/adapter-utils.d.ts +1 -1
- package/dist/adapter-utils.js +1 -1
- package/dist/chunk-AFPLATPV.js +16 -0
- package/dist/chunk-AFPLATPV.js.map +1 -0
- package/dist/{chunk-4OXCKDKS.cjs → chunk-FCCJUQB2.cjs} +3 -3
- package/dist/chunk-FCCJUQB2.cjs.map +1 -0
- package/dist/chunk-IZNOPHPL.js +3 -0
- package/dist/chunk-IZNOPHPL.js.map +1 -0
- package/dist/chunk-LN5H74CU.js +2 -0
- package/dist/{chunk-RBF653NR.js.map → chunk-LN5H74CU.js.map} +1 -1
- package/dist/chunk-PJIIBQTK.js +2 -0
- package/dist/chunk-PJIIBQTK.js.map +1 -0
- package/dist/chunk-PTT4MWNL.cjs +3 -0
- package/dist/chunk-PTT4MWNL.cjs.map +1 -0
- package/dist/{chunk-GKMJ7NMP.cjs → chunk-RD2HO5NZ.cjs} +2 -2
- package/dist/{chunk-GKMJ7NMP.cjs.map → chunk-RD2HO5NZ.cjs.map} +1 -1
- package/dist/{chunk-GACC2DMS.cjs → chunk-S6W6Y44G.cjs} +2 -2
- package/dist/{chunk-GACC2DMS.cjs.map → chunk-S6W6Y44G.cjs.map} +1 -1
- package/dist/{chunk-6PF2FRBG.js → chunk-WD47DB52.js} +2 -2
- package/dist/{chunk-6PF2FRBG.js.map → chunk-WD47DB52.js.map} +1 -1
- package/dist/chunk-WKGNK4QK.cjs +2 -0
- package/dist/chunk-WKGNK4QK.cjs.map +1 -0
- package/dist/chunk-WVP3GOY2.js +3 -0
- package/dist/chunk-WVP3GOY2.js.map +1 -0
- package/dist/chunk-XKXTRVJF.cjs +3 -0
- package/dist/chunk-XKXTRVJF.cjs.map +1 -0
- package/dist/{index-CvQuu0tu.d.cts → index-DpvgHVHR.d.cts} +29 -2
- package/dist/{index-DUbpbGw8.d.ts → index-n8oQmdOZ.d.ts} +29 -2
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -164
- package/dist/index.d.ts +46 -164
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +1 -1
- package/dist/internals.d.cts +45 -25
- package/dist/internals.d.ts +45 -25
- package/dist/internals.js +1 -1
- package/dist/plugins/index.cjs +2 -2
- package/dist/plugins/index.cjs.map +1 -1
- package/dist/plugins/index.d.cts +358 -3
- package/dist/plugins/index.d.ts +358 -3
- package/dist/plugins/index.js +2 -2
- package/dist/plugins/index.js.map +1 -1
- package/dist/{plugins-4IfhJV32.d.cts → plugins-CaPMTICa.d.cts} +400 -31
- package/dist/{plugins-4IfhJV32.d.ts → plugins-CaPMTICa.d.ts} +400 -31
- package/dist/{predicate-DBTPnlg6.d.cts → predicate-CU0YC1i6.d.cts} +1 -1
- package/dist/{predicate-BW05x5el.d.ts → predicate-CgpwJqf4.d.ts} +1 -1
- package/dist/system-HOP37Z4V.js +2 -0
- package/dist/{system-SJBP4TO5.js.map → system-HOP37Z4V.js.map} +1 -1
- package/dist/system-VZUHL56W.cjs +2 -0
- package/dist/{system-SB7JYMRB.cjs.map → system-VZUHL56W.cjs.map} +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.cjs.map +1 -1
- package/dist/worker.d.cts +1 -1
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +1 -1
- package/dist/worker.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-4OXCKDKS.cjs.map +0 -1
- package/dist/chunk-6QAUJFQH.js +0 -3
- package/dist/chunk-6QAUJFQH.js.map +0 -1
- package/dist/chunk-E53A4NHM.js +0 -16
- package/dist/chunk-E53A4NHM.js.map +0 -1
- package/dist/chunk-GBCWXTXW.cjs +0 -3
- package/dist/chunk-GBCWXTXW.cjs.map +0 -1
- package/dist/chunk-KGTBTGOY.js +0 -2
- package/dist/chunk-KGTBTGOY.js.map +0 -1
- package/dist/chunk-M5PEB553.cjs +0 -3
- package/dist/chunk-M5PEB553.cjs.map +0 -1
- package/dist/chunk-MARZI3EY.cjs +0 -2
- package/dist/chunk-MARZI3EY.cjs.map +0 -1
- package/dist/chunk-RBF653NR.js +0 -2
- package/dist/chunk-SFUVPP4L.js +0 -3
- package/dist/chunk-SFUVPP4L.js.map +0 -1
- package/dist/system-SB7JYMRB.cjs +0 -2
- package/dist/system-SJBP4TO5.js +0 -2
package/dist/internals.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkXKXTRVJF_cjs=require('./chunk-XKXTRVJF.cjs'),chunkS6W6Y44G_cjs=require('./chunk-S6W6Y44G.cjs'),chunkRD2HO5NZ_cjs=require('./chunk-RD2HO5NZ.cjs'),chunkPTT4MWNL_cjs=require('./chunk-PTT4MWNL.cjs');Object.defineProperty(exports,"createConstraintFactory",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.c}});Object.defineProperty(exports,"createConstraintsManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.p}});Object.defineProperty(exports,"createDerivationsManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.q}});Object.defineProperty(exports,"createDisabledHistory",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.j}});Object.defineProperty(exports,"createEffectsManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.r}});Object.defineProperty(exports,"createEngine",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.A}});Object.defineProperty(exports,"createErrorBoundaryManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.t}});Object.defineProperty(exports,"createFacts",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.w}});Object.defineProperty(exports,"createFactsProxy",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.v}});Object.defineProperty(exports,"createFactsStore",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.u}});Object.defineProperty(exports,"createHistoryManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.i}});Object.defineProperty(exports,"createPluginManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.x}});Object.defineProperty(exports,"createResolverFactory",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.d}});Object.defineProperty(exports,"createResolversManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.y}});Object.defineProperty(exports,"createRetryLaterManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.s}});Object.defineProperty(exports,"createSourcesManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.z}});Object.defineProperty(exports,"dangerousRegex",{enumerable:true,get:function(){return chunkS6W6Y44G_cjs.m}});Object.defineProperty(exports,"getCurrentDeps",{enumerable:true,get:function(){return chunkRD2HO5NZ_cjs.f}});Object.defineProperty(exports,"isTracking",{enumerable:true,get:function(){return chunkRD2HO5NZ_cjs.g}});Object.defineProperty(exports,"trackAccess",{enumerable:true,get:function(){return chunkRD2HO5NZ_cjs.j}});Object.defineProperty(exports,"withTracking",{enumerable:true,get:function(){return chunkRD2HO5NZ_cjs.h}});Object.defineProperty(exports,"withoutTracking",{enumerable:true,get:function(){return chunkRD2HO5NZ_cjs.i}});Object.defineProperty(exports,"hashObject",{enumerable:true,get:function(){return chunkPTT4MWNL_cjs.i}});Object.defineProperty(exports,"isPrototypeSafe",{enumerable:true,get:function(){return chunkPTT4MWNL_cjs.g}});Object.defineProperty(exports,"safeStringify",{enumerable:true,get:function(){return chunkPTT4MWNL_cjs.p}});Object.defineProperty(exports,"stableStringify",{enumerable:true,get:function(){return chunkPTT4MWNL_cjs.f}});//# sourceMappingURL=internals.cjs.map
|
|
2
2
|
//# sourceMappingURL=internals.cjs.map
|
package/dist/internals.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { b as DerivationsDef, y as DerivedValues } from './predicate-
|
|
4
|
-
export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-
|
|
1
|
+
import { ar as Schema, aQ as FactsStore, a as Facts, D as DefinitionMeta, E as EffectsDef, y as ConstraintsDef, s as RequirementKeyFn, R as RequirementWithId, aR as ConstraintState, F as FactPredicate, C as ClauseResult, an as ResolversDef, aS as ResolverStatus, r as Requirement, aw as SourceDropReason, av as SourceDef, P as Plugin, aA as System, aT as FactChange, X as FactsSnapshot, aU as ReconcileResult, aa as ObservationEvent, au as Snapshot, I as DirectiveError, aV as RecoveryStrategy, aH as TraceEntry, aW as ErrorSource, q as ErrorBoundaryConfig, aX as RetryLaterConfig, Y as HistoryAPI, Z as HistoryOption, aB as SystemConfig } from './plugins-CaPMTICa.cjs';
|
|
2
|
+
export { aY as BatchItemResult, aZ as BatchResolveResults, a_ as ConstraintsControl, z as CrossModuleConstraintDef, j as CrossModuleConstraintsDef, a$ as CrossModuleDerivationFn, h as CrossModuleDerivationsDef, G as CrossModuleEffectDef, i as CrossModuleEffectsDef, b0 as CrossModuleFactsWithSelf, b1 as DerivationKeys, b2 as DerivationReturnType, b3 as DerivationsControl, b4 as DerivationsSchema, b5 as DeriveAccessor, b6 as DispatchEventsFromSchema, J as DistributableSnapshot, K as DistributableSnapshotOptions, b7 as EffectCleanup, b8 as EffectsControl, b9 as EventPayloadSchema, ba as EventsAccessor, bb as EventsAccessorFromSchema, V as EventsDef, bc as EventsSchema, bd as FactKeys, be as FactReturnType, bf as FlexibleEventHandler, bg as HistoryConfig, bh as InferEventPayloadFromSchema, bi as InferRequirementPayloadFromSchema, bj as InferSchema, bk as MutableNamespacedFacts, bl as NamespacedDerivations, bm as NamespacedEventsAccessor, bn as NamespacedFacts, bo as ObservableKeys, bp as RequirementExplanation, bq as RequirementOutput, br as RequirementPayloadSchema, bs as RequirementsSchema, bt as ResolverContext, bu as ResolversControl, bv as SnapshotMeta, bw as SystemEvent, bx as TraceConfig, aI as TypedConstraintDef, d as TypedConstraintsDef, T as TypedDerivationsDef, b as TypedEventsDef, by as TypedResolverContext, aJ as TypedResolverDef, e as TypedResolversDef, bz as UnionEvents } from './plugins-CaPMTICa.cjs';
|
|
3
|
+
import { b as DerivationsDef, y as DerivedValues } from './predicate-CU0YC1i6.cjs';
|
|
4
|
+
export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-CU0YC1i6.cjs';
|
|
5
5
|
export { h as hashObject, g as isPrototypeSafe, j as safeStringify, k as stableStringify } from './utils-DY8KTiD6.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -615,7 +615,7 @@ interface ResolversManager<_S extends Schema> {
|
|
|
615
615
|
* @param req - The requirement (with a stable identity ID) to resolve.
|
|
616
616
|
* @param options.factsBaseline - Optional pre-dispatch facts snapshot
|
|
617
617
|
* shared by every resolver dispatched in the same reconcile tick. Used
|
|
618
|
-
* by RFC-
|
|
618
|
+
* by RFC-0003 constraint-binding to seed each resolver's `expected` map
|
|
619
619
|
* from a value that pre-dates any sibling resolver's writes, preventing
|
|
620
620
|
* the sibling-clobber gap where resolver 2 silently overwrites
|
|
621
621
|
* resolver 1's owned write.
|
|
@@ -624,15 +624,17 @@ interface ResolversManager<_S extends Schema> {
|
|
|
624
624
|
factsBaseline?: Readonly<Record<string, unknown>>;
|
|
625
625
|
}): void;
|
|
626
626
|
/**
|
|
627
|
-
*
|
|
627
|
+
* Abort an in-flight or batch-queued resolver by requirement ID.
|
|
628
628
|
*
|
|
629
629
|
* @remarks
|
|
630
630
|
* Aborts the `AbortController` for in-flight resolvers. For batch-queued
|
|
631
|
-
* requirements, removes the requirement from the pending batch.
|
|
631
|
+
* requirements, removes the requirement from the pending batch. Named to
|
|
632
|
+
* match `AbortController.abort()` and the declarative `abortOn:` key on
|
|
633
|
+
* constraints — three surfaces, one verb, one signal.
|
|
632
634
|
*
|
|
633
|
-
* @param requirementId - The unique requirement ID to
|
|
635
|
+
* @param requirementId - The unique requirement ID to abort.
|
|
634
636
|
*/
|
|
635
|
-
|
|
637
|
+
abort(requirementId: string): void;
|
|
636
638
|
/**
|
|
637
639
|
* Untrack an in-flight resolver by requirement ID **without** aborting it
|
|
638
640
|
* (RFC-0003 resolver constraint-binding).
|
|
@@ -640,17 +642,17 @@ interface ResolversManager<_S extends Schema> {
|
|
|
640
642
|
* @remarks
|
|
641
643
|
* Used for bound resolvers whose triggering requirement was removed: the
|
|
642
644
|
* resolver runs to completion (its data writes land; the binding still
|
|
643
|
-
* guards
|
|
644
|
-
* same requirement re-dispatches cleanly if it returns. A
|
|
645
|
-
* requirement is not in-flight.
|
|
645
|
+
* guards abort-bound facts) but it no longer occupies the `inflight`
|
|
646
|
+
* slot, so the same requirement re-dispatches cleanly if it returns. A
|
|
647
|
+
* no-op if the requirement is not in-flight.
|
|
646
648
|
*
|
|
647
649
|
* @param requirementId - The unique requirement ID to detach.
|
|
648
650
|
*/
|
|
649
651
|
detach(requirementId: string): void;
|
|
650
652
|
/**
|
|
651
|
-
*
|
|
653
|
+
* Abort every in-flight resolver and flush all pending batch queues.
|
|
652
654
|
*/
|
|
653
|
-
|
|
655
|
+
abortAll(): void;
|
|
654
656
|
/**
|
|
655
657
|
* Get the current status of a resolver by requirement ID.
|
|
656
658
|
*
|
|
@@ -731,20 +733,20 @@ interface ResolversManager<_S extends Schema> {
|
|
|
731
733
|
destroy(): void;
|
|
732
734
|
}
|
|
733
735
|
/**
|
|
734
|
-
* Per-constraint binding info, used by RFC-
|
|
736
|
+
* Per-constraint binding info, used by RFC-0003 (resolver constraint-binding).
|
|
735
737
|
*
|
|
736
738
|
* The engine wires this lookup into the resolvers manager so that a resolver
|
|
737
|
-
* dispatched from a constraint with an `
|
|
738
|
-
*
|
|
739
|
+
* dispatched from a constraint with an `abortOn` field knows which facts it
|
|
740
|
+
* compare-and-swaps on dispatch (see {@link createBoundFacts}).
|
|
739
741
|
*
|
|
740
742
|
* Returns `undefined`/`null` when the source constraint is unknown or has no
|
|
741
|
-
* `
|
|
742
|
-
* exactly as before.
|
|
743
|
+
* `abortOn` field — in which case binding is a no-op and the resolver
|
|
744
|
+
* behaves exactly as before.
|
|
743
745
|
*
|
|
744
746
|
* @internal
|
|
745
747
|
*/
|
|
746
748
|
interface ConstraintBindingInfo {
|
|
747
|
-
/** Fact keys
|
|
749
|
+
/** Fact keys this resolver aborts on when changed mid-flight; writes to these are clobber-checked. */
|
|
748
750
|
readonly fields: readonly string[];
|
|
749
751
|
}
|
|
750
752
|
/**
|
|
@@ -760,11 +762,11 @@ interface CreateResolversOptions<S extends Schema> {
|
|
|
760
762
|
/** Underlying fact store used for `batch()` coalescing of mutations. */
|
|
761
763
|
store: FactsStore<S>;
|
|
762
764
|
/**
|
|
763
|
-
* Look up binding info for a source constraint id (RFC-
|
|
765
|
+
* Look up binding info for a source constraint id (RFC-0003).
|
|
764
766
|
*
|
|
765
767
|
* Wired by the engine — given the `fromConstraint` of a `RequirementWithId`,
|
|
766
|
-
* returns the constraint's
|
|
767
|
-
* constraint is unknown or has no `
|
|
768
|
+
* returns the constraint's abort-binding fact keys. Return `undefined` if
|
|
769
|
+
* the constraint is unknown or has no `abortOn` field.
|
|
768
770
|
*/
|
|
769
771
|
getConstraintBinding?: (constraintId: string) => ConstraintBindingInfo | undefined;
|
|
770
772
|
/** Called when a resolver begins execution. */
|
|
@@ -775,7 +777,7 @@ interface CreateResolversOptions<S extends Schema> {
|
|
|
775
777
|
onError?: (resolver: string, req: RequirementWithId, error: unknown) => void;
|
|
776
778
|
/** Called before each retry attempt with the upcoming attempt number. */
|
|
777
779
|
onRetry?: (resolver: string, req: RequirementWithId, attempt: number) => void;
|
|
778
|
-
/** Called when a resolver is
|
|
780
|
+
/** Called when a resolver is aborted via {@link ResolversManager.abort | abort}. */
|
|
779
781
|
onCancel?: (resolver: string, req: RequirementWithId) => void;
|
|
780
782
|
/**
|
|
781
783
|
* Called when a bound resolver's owned-fact write is dropped because the
|
|
@@ -802,7 +804,7 @@ interface CreateResolversOptions<S extends Schema> {
|
|
|
802
804
|
}
|
|
803
805
|
/**
|
|
804
806
|
* Creates a resolver manager that tracks active resolver instances and
|
|
805
|
-
* coordinates their lifecycle (start / complete / error /
|
|
807
|
+
* coordinates their lifecycle (start / complete / error / abort) against
|
|
806
808
|
* the engine's requirement graph.
|
|
807
809
|
*
|
|
808
810
|
* @param options - resolver definitions, facts reference, and event hooks
|
|
@@ -1065,6 +1067,18 @@ interface PluginManager<_S extends Schema = any> {
|
|
|
1065
1067
|
emitReconcileEnd(result: ReconcileResult): void;
|
|
1066
1068
|
emitConstraintEvaluate(id: string, active: boolean, whenExplain?: ClauseResult[]): void;
|
|
1067
1069
|
emitConstraintError(id: string, error: unknown): void;
|
|
1070
|
+
/**
|
|
1071
|
+
* Fired once per lookup when the engine silently disables a
|
|
1072
|
+
* constraint's `abortOn:` binding because the constraint is async.
|
|
1073
|
+
* Pairs with the dev-mode `console.warn` for SIEM visibility — without
|
|
1074
|
+
* this signal, a production constraint loses its clobber-protection
|
|
1075
|
+
* with no plugin trail.
|
|
1076
|
+
*
|
|
1077
|
+
* `"async-declared"` means the def has `async: true` (author opted in);
|
|
1078
|
+
* `"async-promoted"` means `when()` returned a Promise at runtime
|
|
1079
|
+
* (author probably did not realize).
|
|
1080
|
+
*/
|
|
1081
|
+
emitConstraintBindingDisabled(id: string, reason: "async-declared" | "async-promoted"): void;
|
|
1068
1082
|
emitRequirementCreated(req: RequirementWithId): void;
|
|
1069
1083
|
emitRequirementMet(req: RequirementWithId, byResolver: string): void;
|
|
1070
1084
|
emitRequirementCanceled(req: RequirementWithId): void;
|
|
@@ -1102,6 +1116,12 @@ interface PluginManager<_S extends Schema = any> {
|
|
|
1102
1116
|
emitSourceDetach(id: string, moduleId: string): void;
|
|
1103
1117
|
emitSourceError(id: string, moduleId: string, phase: "attach" | "cleanup" | "runtime", error: unknown): void;
|
|
1104
1118
|
emitGuardrailBlocked(plugin: string, key: string, kind: "redact" | "alert" | "detect", count: number, category?: string): void;
|
|
1119
|
+
emitClobberLoopDetected(event: ObservationEvent & {
|
|
1120
|
+
type: "resolver.clobber.loop.detected";
|
|
1121
|
+
}): void;
|
|
1122
|
+
emitClobberLoopResolved(event: ObservationEvent & {
|
|
1123
|
+
type: "resolver.clobber.loop.resolved";
|
|
1124
|
+
}): void;
|
|
1105
1125
|
emitSnapshot(snapshot: Snapshot): void;
|
|
1106
1126
|
emitHistoryNavigate(from: number, to: number): void;
|
|
1107
1127
|
emitError(error: DirectiveError): void;
|
package/dist/internals.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { b as DerivationsDef, y as DerivedValues } from './predicate-
|
|
4
|
-
export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-
|
|
1
|
+
import { ar as Schema, aQ as FactsStore, a as Facts, D as DefinitionMeta, E as EffectsDef, y as ConstraintsDef, s as RequirementKeyFn, R as RequirementWithId, aR as ConstraintState, F as FactPredicate, C as ClauseResult, an as ResolversDef, aS as ResolverStatus, r as Requirement, aw as SourceDropReason, av as SourceDef, P as Plugin, aA as System, aT as FactChange, X as FactsSnapshot, aU as ReconcileResult, aa as ObservationEvent, au as Snapshot, I as DirectiveError, aV as RecoveryStrategy, aH as TraceEntry, aW as ErrorSource, q as ErrorBoundaryConfig, aX as RetryLaterConfig, Y as HistoryAPI, Z as HistoryOption, aB as SystemConfig } from './plugins-CaPMTICa.js';
|
|
2
|
+
export { aY as BatchItemResult, aZ as BatchResolveResults, a_ as ConstraintsControl, z as CrossModuleConstraintDef, j as CrossModuleConstraintsDef, a$ as CrossModuleDerivationFn, h as CrossModuleDerivationsDef, G as CrossModuleEffectDef, i as CrossModuleEffectsDef, b0 as CrossModuleFactsWithSelf, b1 as DerivationKeys, b2 as DerivationReturnType, b3 as DerivationsControl, b4 as DerivationsSchema, b5 as DeriveAccessor, b6 as DispatchEventsFromSchema, J as DistributableSnapshot, K as DistributableSnapshotOptions, b7 as EffectCleanup, b8 as EffectsControl, b9 as EventPayloadSchema, ba as EventsAccessor, bb as EventsAccessorFromSchema, V as EventsDef, bc as EventsSchema, bd as FactKeys, be as FactReturnType, bf as FlexibleEventHandler, bg as HistoryConfig, bh as InferEventPayloadFromSchema, bi as InferRequirementPayloadFromSchema, bj as InferSchema, bk as MutableNamespacedFacts, bl as NamespacedDerivations, bm as NamespacedEventsAccessor, bn as NamespacedFacts, bo as ObservableKeys, bp as RequirementExplanation, bq as RequirementOutput, br as RequirementPayloadSchema, bs as RequirementsSchema, bt as ResolverContext, bu as ResolversControl, bv as SnapshotMeta, bw as SystemEvent, bx as TraceConfig, aI as TypedConstraintDef, d as TypedConstraintsDef, T as TypedDerivationsDef, b as TypedEventsDef, by as TypedResolverContext, aJ as TypedResolverDef, e as TypedResolversDef, bz as UnionEvents } from './plugins-CaPMTICa.js';
|
|
3
|
+
import { b as DerivationsDef, y as DerivedValues } from './predicate-CgpwJqf4.js';
|
|
4
|
+
export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-CgpwJqf4.js';
|
|
5
5
|
export { h as hashObject, g as isPrototypeSafe, j as safeStringify, k as stableStringify } from './utils-DY8KTiD6.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -615,7 +615,7 @@ interface ResolversManager<_S extends Schema> {
|
|
|
615
615
|
* @param req - The requirement (with a stable identity ID) to resolve.
|
|
616
616
|
* @param options.factsBaseline - Optional pre-dispatch facts snapshot
|
|
617
617
|
* shared by every resolver dispatched in the same reconcile tick. Used
|
|
618
|
-
* by RFC-
|
|
618
|
+
* by RFC-0003 constraint-binding to seed each resolver's `expected` map
|
|
619
619
|
* from a value that pre-dates any sibling resolver's writes, preventing
|
|
620
620
|
* the sibling-clobber gap where resolver 2 silently overwrites
|
|
621
621
|
* resolver 1's owned write.
|
|
@@ -624,15 +624,17 @@ interface ResolversManager<_S extends Schema> {
|
|
|
624
624
|
factsBaseline?: Readonly<Record<string, unknown>>;
|
|
625
625
|
}): void;
|
|
626
626
|
/**
|
|
627
|
-
*
|
|
627
|
+
* Abort an in-flight or batch-queued resolver by requirement ID.
|
|
628
628
|
*
|
|
629
629
|
* @remarks
|
|
630
630
|
* Aborts the `AbortController` for in-flight resolvers. For batch-queued
|
|
631
|
-
* requirements, removes the requirement from the pending batch.
|
|
631
|
+
* requirements, removes the requirement from the pending batch. Named to
|
|
632
|
+
* match `AbortController.abort()` and the declarative `abortOn:` key on
|
|
633
|
+
* constraints — three surfaces, one verb, one signal.
|
|
632
634
|
*
|
|
633
|
-
* @param requirementId - The unique requirement ID to
|
|
635
|
+
* @param requirementId - The unique requirement ID to abort.
|
|
634
636
|
*/
|
|
635
|
-
|
|
637
|
+
abort(requirementId: string): void;
|
|
636
638
|
/**
|
|
637
639
|
* Untrack an in-flight resolver by requirement ID **without** aborting it
|
|
638
640
|
* (RFC-0003 resolver constraint-binding).
|
|
@@ -640,17 +642,17 @@ interface ResolversManager<_S extends Schema> {
|
|
|
640
642
|
* @remarks
|
|
641
643
|
* Used for bound resolvers whose triggering requirement was removed: the
|
|
642
644
|
* resolver runs to completion (its data writes land; the binding still
|
|
643
|
-
* guards
|
|
644
|
-
* same requirement re-dispatches cleanly if it returns. A
|
|
645
|
-
* requirement is not in-flight.
|
|
645
|
+
* guards abort-bound facts) but it no longer occupies the `inflight`
|
|
646
|
+
* slot, so the same requirement re-dispatches cleanly if it returns. A
|
|
647
|
+
* no-op if the requirement is not in-flight.
|
|
646
648
|
*
|
|
647
649
|
* @param requirementId - The unique requirement ID to detach.
|
|
648
650
|
*/
|
|
649
651
|
detach(requirementId: string): void;
|
|
650
652
|
/**
|
|
651
|
-
*
|
|
653
|
+
* Abort every in-flight resolver and flush all pending batch queues.
|
|
652
654
|
*/
|
|
653
|
-
|
|
655
|
+
abortAll(): void;
|
|
654
656
|
/**
|
|
655
657
|
* Get the current status of a resolver by requirement ID.
|
|
656
658
|
*
|
|
@@ -731,20 +733,20 @@ interface ResolversManager<_S extends Schema> {
|
|
|
731
733
|
destroy(): void;
|
|
732
734
|
}
|
|
733
735
|
/**
|
|
734
|
-
* Per-constraint binding info, used by RFC-
|
|
736
|
+
* Per-constraint binding info, used by RFC-0003 (resolver constraint-binding).
|
|
735
737
|
*
|
|
736
738
|
* The engine wires this lookup into the resolvers manager so that a resolver
|
|
737
|
-
* dispatched from a constraint with an `
|
|
738
|
-
*
|
|
739
|
+
* dispatched from a constraint with an `abortOn` field knows which facts it
|
|
740
|
+
* compare-and-swaps on dispatch (see {@link createBoundFacts}).
|
|
739
741
|
*
|
|
740
742
|
* Returns `undefined`/`null` when the source constraint is unknown or has no
|
|
741
|
-
* `
|
|
742
|
-
* exactly as before.
|
|
743
|
+
* `abortOn` field — in which case binding is a no-op and the resolver
|
|
744
|
+
* behaves exactly as before.
|
|
743
745
|
*
|
|
744
746
|
* @internal
|
|
745
747
|
*/
|
|
746
748
|
interface ConstraintBindingInfo {
|
|
747
|
-
/** Fact keys
|
|
749
|
+
/** Fact keys this resolver aborts on when changed mid-flight; writes to these are clobber-checked. */
|
|
748
750
|
readonly fields: readonly string[];
|
|
749
751
|
}
|
|
750
752
|
/**
|
|
@@ -760,11 +762,11 @@ interface CreateResolversOptions<S extends Schema> {
|
|
|
760
762
|
/** Underlying fact store used for `batch()` coalescing of mutations. */
|
|
761
763
|
store: FactsStore<S>;
|
|
762
764
|
/**
|
|
763
|
-
* Look up binding info for a source constraint id (RFC-
|
|
765
|
+
* Look up binding info for a source constraint id (RFC-0003).
|
|
764
766
|
*
|
|
765
767
|
* Wired by the engine — given the `fromConstraint` of a `RequirementWithId`,
|
|
766
|
-
* returns the constraint's
|
|
767
|
-
* constraint is unknown or has no `
|
|
768
|
+
* returns the constraint's abort-binding fact keys. Return `undefined` if
|
|
769
|
+
* the constraint is unknown or has no `abortOn` field.
|
|
768
770
|
*/
|
|
769
771
|
getConstraintBinding?: (constraintId: string) => ConstraintBindingInfo | undefined;
|
|
770
772
|
/** Called when a resolver begins execution. */
|
|
@@ -775,7 +777,7 @@ interface CreateResolversOptions<S extends Schema> {
|
|
|
775
777
|
onError?: (resolver: string, req: RequirementWithId, error: unknown) => void;
|
|
776
778
|
/** Called before each retry attempt with the upcoming attempt number. */
|
|
777
779
|
onRetry?: (resolver: string, req: RequirementWithId, attempt: number) => void;
|
|
778
|
-
/** Called when a resolver is
|
|
780
|
+
/** Called when a resolver is aborted via {@link ResolversManager.abort | abort}. */
|
|
779
781
|
onCancel?: (resolver: string, req: RequirementWithId) => void;
|
|
780
782
|
/**
|
|
781
783
|
* Called when a bound resolver's owned-fact write is dropped because the
|
|
@@ -802,7 +804,7 @@ interface CreateResolversOptions<S extends Schema> {
|
|
|
802
804
|
}
|
|
803
805
|
/**
|
|
804
806
|
* Creates a resolver manager that tracks active resolver instances and
|
|
805
|
-
* coordinates their lifecycle (start / complete / error /
|
|
807
|
+
* coordinates their lifecycle (start / complete / error / abort) against
|
|
806
808
|
* the engine's requirement graph.
|
|
807
809
|
*
|
|
808
810
|
* @param options - resolver definitions, facts reference, and event hooks
|
|
@@ -1065,6 +1067,18 @@ interface PluginManager<_S extends Schema = any> {
|
|
|
1065
1067
|
emitReconcileEnd(result: ReconcileResult): void;
|
|
1066
1068
|
emitConstraintEvaluate(id: string, active: boolean, whenExplain?: ClauseResult[]): void;
|
|
1067
1069
|
emitConstraintError(id: string, error: unknown): void;
|
|
1070
|
+
/**
|
|
1071
|
+
* Fired once per lookup when the engine silently disables a
|
|
1072
|
+
* constraint's `abortOn:` binding because the constraint is async.
|
|
1073
|
+
* Pairs with the dev-mode `console.warn` for SIEM visibility — without
|
|
1074
|
+
* this signal, a production constraint loses its clobber-protection
|
|
1075
|
+
* with no plugin trail.
|
|
1076
|
+
*
|
|
1077
|
+
* `"async-declared"` means the def has `async: true` (author opted in);
|
|
1078
|
+
* `"async-promoted"` means `when()` returned a Promise at runtime
|
|
1079
|
+
* (author probably did not realize).
|
|
1080
|
+
*/
|
|
1081
|
+
emitConstraintBindingDisabled(id: string, reason: "async-declared" | "async-promoted"): void;
|
|
1068
1082
|
emitRequirementCreated(req: RequirementWithId): void;
|
|
1069
1083
|
emitRequirementMet(req: RequirementWithId, byResolver: string): void;
|
|
1070
1084
|
emitRequirementCanceled(req: RequirementWithId): void;
|
|
@@ -1102,6 +1116,12 @@ interface PluginManager<_S extends Schema = any> {
|
|
|
1102
1116
|
emitSourceDetach(id: string, moduleId: string): void;
|
|
1103
1117
|
emitSourceError(id: string, moduleId: string, phase: "attach" | "cleanup" | "runtime", error: unknown): void;
|
|
1104
1118
|
emitGuardrailBlocked(plugin: string, key: string, kind: "redact" | "alert" | "detect", count: number, category?: string): void;
|
|
1119
|
+
emitClobberLoopDetected(event: ObservationEvent & {
|
|
1120
|
+
type: "resolver.clobber.loop.detected";
|
|
1121
|
+
}): void;
|
|
1122
|
+
emitClobberLoopResolved(event: ObservationEvent & {
|
|
1123
|
+
type: "resolver.clobber.loop.resolved";
|
|
1124
|
+
}): void;
|
|
1105
1125
|
emitSnapshot(snapshot: Snapshot): void;
|
|
1106
1126
|
emitHistoryNavigate(from: number, to: number): void;
|
|
1107
1127
|
emitError(error: DirectiveError): void;
|
package/dist/internals.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{c as createConstraintFactory,p as createConstraintsManager,q as createDerivationsManager,j as createDisabledHistory,r as createEffectsManager,A as createEngine,t as createErrorBoundaryManager,w as createFacts,v as createFactsProxy,u as createFactsStore,i as createHistoryManager,x as createPluginManager,d as createResolverFactory,y as createResolversManager,s as createRetryLaterManager,z as createSourcesManager}from'./chunk-
|
|
1
|
+
export{c as createConstraintFactory,p as createConstraintsManager,q as createDerivationsManager,j as createDisabledHistory,r as createEffectsManager,A as createEngine,t as createErrorBoundaryManager,w as createFacts,v as createFactsProxy,u as createFactsStore,i as createHistoryManager,x as createPluginManager,d as createResolverFactory,y as createResolversManager,s as createRetryLaterManager,z as createSourcesManager}from'./chunk-WVP3GOY2.js';export{m as dangerousRegex}from'./chunk-LN5H74CU.js';export{f as getCurrentDeps,g as isTracking,j as trackAccess,h as withTracking,i as withoutTracking}from'./chunk-WD47DB52.js';export{i as hashObject,g as isPrototypeSafe,p as safeStringify,f as stableStringify}from'./chunk-IZNOPHPL.js';//# sourceMappingURL=internals.js.map
|
|
2
2
|
//# sourceMappingURL=internals.js.map
|