@directive-run/core 1.20.2 → 1.22.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.
Files changed (82) hide show
  1. package/README.md +33 -0
  2. package/dist/adapter-utils.cjs +1 -1
  3. package/dist/adapter-utils.d.cts +2 -2
  4. package/dist/adapter-utils.d.ts +2 -2
  5. package/dist/adapter-utils.js +1 -1
  6. package/dist/chunk-6NCC6RBC.js +3 -0
  7. package/dist/chunk-6NCC6RBC.js.map +1 -0
  8. package/dist/chunk-6PF2FRBG.js +7 -0
  9. package/dist/chunk-6PF2FRBG.js.map +1 -0
  10. package/dist/{chunk-RWFKUNF7.cjs → chunk-GACC2DMS.cjs} +2 -2
  11. package/dist/{chunk-RWFKUNF7.cjs.map → chunk-GACC2DMS.cjs.map} +1 -1
  12. package/dist/{chunk-4MNQDXH7.cjs → chunk-GBCWXTXW.cjs} +3 -3
  13. package/dist/chunk-GBCWXTXW.cjs.map +1 -0
  14. package/dist/chunk-GKMJ7NMP.cjs +7 -0
  15. package/dist/chunk-GKMJ7NMP.cjs.map +1 -0
  16. package/dist/{chunk-WKCMOU2F.js → chunk-KGTBTGOY.js} +2 -2
  17. package/dist/{chunk-WKCMOU2F.js.map → chunk-KGTBTGOY.js.map} +1 -1
  18. package/dist/{chunk-4QCKAJCX.cjs → chunk-MARZI3EY.cjs} +2 -2
  19. package/dist/{chunk-4QCKAJCX.cjs.map → chunk-MARZI3EY.cjs.map} +1 -1
  20. package/dist/chunk-OAPD3HIG.cjs +16 -0
  21. package/dist/chunk-OAPD3HIG.cjs.map +1 -0
  22. package/dist/chunk-QTY2FXZY.cjs +3 -0
  23. package/dist/chunk-QTY2FXZY.cjs.map +1 -0
  24. package/dist/{chunk-O4GQEV4G.js → chunk-RBF653NR.js} +2 -2
  25. package/dist/{chunk-O4GQEV4G.js.map → chunk-RBF653NR.js.map} +1 -1
  26. package/dist/{chunk-PXRV64PA.js → chunk-SFUVPP4L.js} +3 -3
  27. package/dist/chunk-SFUVPP4L.js.map +1 -0
  28. package/dist/chunk-YJEDX2JX.js +16 -0
  29. package/dist/chunk-YJEDX2JX.js.map +1 -0
  30. package/dist/{index-D_K7eEOF.d.ts → index-BgKC_ZT_.d.ts} +1 -1
  31. package/dist/{index-DApsqJ0h.d.cts → index-DRPkZ8HE.d.cts} +1 -1
  32. package/dist/index.cjs +2 -2
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +47 -43
  35. package/dist/index.d.ts +47 -43
  36. package/dist/index.js +2 -2
  37. package/dist/index.js.map +1 -1
  38. package/dist/internals.cjs +1 -1
  39. package/dist/internals.d.cts +60 -28
  40. package/dist/internals.d.ts +60 -28
  41. package/dist/internals.js +1 -1
  42. package/dist/plugins/index.cjs +2 -2
  43. package/dist/plugins/index.cjs.map +1 -1
  44. package/dist/plugins/index.d.cts +159 -3
  45. package/dist/plugins/index.d.ts +159 -3
  46. package/dist/plugins/index.js +2 -2
  47. package/dist/plugins/index.js.map +1 -1
  48. package/dist/{plugins-C6MxOvot.d.cts → plugins-5Supk7it.d.cts} +174 -43
  49. package/dist/{plugins-C6MxOvot.d.ts → plugins-5Supk7it.d.ts} +174 -43
  50. package/dist/{predicate-C92yT5IR.d.ts → predicate-C9oMO_ny.d.ts} +1 -1
  51. package/dist/{predicate-CV3YJDup.d.cts → predicate-DYb-3Mvl.d.cts} +1 -1
  52. package/dist/system-5FKUBLLV.cjs +2 -0
  53. package/dist/{system-BXCEQBBS.cjs.map → system-5FKUBLLV.cjs.map} +1 -1
  54. package/dist/system-6YWCXQOQ.js +2 -0
  55. package/dist/{system-AWEKWMNI.js.map → system-6YWCXQOQ.js.map} +1 -1
  56. package/dist/testing.cjs +1 -1
  57. package/dist/testing.d.cts +1 -1
  58. package/dist/testing.d.ts +1 -1
  59. package/dist/testing.js +1 -1
  60. package/dist/{utils-BZBBwS5A.d.cts → utils-DY8KTiD6.d.cts} +20 -7
  61. package/dist/{utils-BZBBwS5A.d.ts → utils-DY8KTiD6.d.ts} +20 -7
  62. package/dist/worker.cjs +1 -1
  63. package/dist/worker.d.cts +1 -1
  64. package/dist/worker.d.ts +1 -1
  65. package/dist/worker.js +1 -1
  66. package/package.json +1 -1
  67. package/dist/chunk-3ETCZLAY.js +0 -7
  68. package/dist/chunk-3ETCZLAY.js.map +0 -1
  69. package/dist/chunk-4MNQDXH7.cjs.map +0 -1
  70. package/dist/chunk-CLJMEU2A.js +0 -3
  71. package/dist/chunk-CLJMEU2A.js.map +0 -1
  72. package/dist/chunk-JGPPJV5P.cjs +0 -7
  73. package/dist/chunk-JGPPJV5P.cjs.map +0 -1
  74. package/dist/chunk-MDMMMZUZ.cjs +0 -3
  75. package/dist/chunk-MDMMMZUZ.cjs.map +0 -1
  76. package/dist/chunk-PNB73G3E.cjs +0 -16
  77. package/dist/chunk-PNB73G3E.cjs.map +0 -1
  78. package/dist/chunk-PXRV64PA.js.map +0 -1
  79. package/dist/chunk-QQEXRNAI.js +0 -16
  80. package/dist/chunk-QQEXRNAI.js.map +0 -1
  81. package/dist/system-AWEKWMNI.js +0 -2
  82. package/dist/system-BXCEQBBS.cjs +0 -2
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkMDMMMZUZ_cjs=require('./chunk-MDMMMZUZ.cjs'),chunkRWFKUNF7_cjs=require('./chunk-RWFKUNF7.cjs'),chunkJGPPJV5P_cjs=require('./chunk-JGPPJV5P.cjs'),chunk4MNQDXH7_cjs=require('./chunk-4MNQDXH7.cjs');Object.defineProperty(exports,"createConstraintFactory",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.c}});Object.defineProperty(exports,"createConstraintsManager",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.p}});Object.defineProperty(exports,"createDerivationsManager",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.q}});Object.defineProperty(exports,"createDisabledHistory",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.j}});Object.defineProperty(exports,"createEffectsManager",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.r}});Object.defineProperty(exports,"createEngine",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.A}});Object.defineProperty(exports,"createErrorBoundaryManager",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.t}});Object.defineProperty(exports,"createFacts",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.w}});Object.defineProperty(exports,"createFactsProxy",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.v}});Object.defineProperty(exports,"createFactsStore",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.u}});Object.defineProperty(exports,"createHistoryManager",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.i}});Object.defineProperty(exports,"createPluginManager",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.x}});Object.defineProperty(exports,"createResolverFactory",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.d}});Object.defineProperty(exports,"createResolversManager",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.y}});Object.defineProperty(exports,"createRetryLaterManager",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.s}});Object.defineProperty(exports,"createSourcesManager",{enumerable:true,get:function(){return chunkMDMMMZUZ_cjs.z}});Object.defineProperty(exports,"dangerousRegex",{enumerable:true,get:function(){return chunkRWFKUNF7_cjs.m}});Object.defineProperty(exports,"getCurrentDeps",{enumerable:true,get:function(){return chunkJGPPJV5P_cjs.f}});Object.defineProperty(exports,"isTracking",{enumerable:true,get:function(){return chunkJGPPJV5P_cjs.g}});Object.defineProperty(exports,"trackAccess",{enumerable:true,get:function(){return chunkJGPPJV5P_cjs.j}});Object.defineProperty(exports,"withTracking",{enumerable:true,get:function(){return chunkJGPPJV5P_cjs.h}});Object.defineProperty(exports,"withoutTracking",{enumerable:true,get:function(){return chunkJGPPJV5P_cjs.i}});Object.defineProperty(exports,"hashObject",{enumerable:true,get:function(){return chunk4MNQDXH7_cjs.h}});Object.defineProperty(exports,"isPrototypeSafe",{enumerable:true,get:function(){return chunk4MNQDXH7_cjs.f}});Object.defineProperty(exports,"safeStringify",{enumerable:true,get:function(){return chunk4MNQDXH7_cjs.o}});Object.defineProperty(exports,"stableStringify",{enumerable:true,get:function(){return chunk4MNQDXH7_cjs.e}});//# sourceMappingURL=internals.cjs.map
1
+ 'use strict';var chunkQTY2FXZY_cjs=require('./chunk-QTY2FXZY.cjs'),chunkGACC2DMS_cjs=require('./chunk-GACC2DMS.cjs'),chunkGKMJ7NMP_cjs=require('./chunk-GKMJ7NMP.cjs'),chunkGBCWXTXW_cjs=require('./chunk-GBCWXTXW.cjs');Object.defineProperty(exports,"createConstraintFactory",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.c}});Object.defineProperty(exports,"createConstraintsManager",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.p}});Object.defineProperty(exports,"createDerivationsManager",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.q}});Object.defineProperty(exports,"createDisabledHistory",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.j}});Object.defineProperty(exports,"createEffectsManager",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.r}});Object.defineProperty(exports,"createEngine",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.A}});Object.defineProperty(exports,"createErrorBoundaryManager",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.t}});Object.defineProperty(exports,"createFacts",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.w}});Object.defineProperty(exports,"createFactsProxy",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.v}});Object.defineProperty(exports,"createFactsStore",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.u}});Object.defineProperty(exports,"createHistoryManager",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.i}});Object.defineProperty(exports,"createPluginManager",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.x}});Object.defineProperty(exports,"createResolverFactory",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.d}});Object.defineProperty(exports,"createResolversManager",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.y}});Object.defineProperty(exports,"createRetryLaterManager",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.s}});Object.defineProperty(exports,"createSourcesManager",{enumerable:true,get:function(){return chunkQTY2FXZY_cjs.z}});Object.defineProperty(exports,"dangerousRegex",{enumerable:true,get:function(){return chunkGACC2DMS_cjs.m}});Object.defineProperty(exports,"getCurrentDeps",{enumerable:true,get:function(){return chunkGKMJ7NMP_cjs.f}});Object.defineProperty(exports,"isTracking",{enumerable:true,get:function(){return chunkGKMJ7NMP_cjs.g}});Object.defineProperty(exports,"trackAccess",{enumerable:true,get:function(){return chunkGKMJ7NMP_cjs.j}});Object.defineProperty(exports,"withTracking",{enumerable:true,get:function(){return chunkGKMJ7NMP_cjs.h}});Object.defineProperty(exports,"withoutTracking",{enumerable:true,get:function(){return chunkGKMJ7NMP_cjs.i}});Object.defineProperty(exports,"hashObject",{enumerable:true,get:function(){return chunkGBCWXTXW_cjs.h}});Object.defineProperty(exports,"isPrototypeSafe",{enumerable:true,get:function(){return chunkGBCWXTXW_cjs.f}});Object.defineProperty(exports,"safeStringify",{enumerable:true,get:function(){return chunkGBCWXTXW_cjs.o}});Object.defineProperty(exports,"stableStringify",{enumerable:true,get:function(){return chunkGBCWXTXW_cjs.e}});//# sourceMappingURL=internals.cjs.map
2
2
  //# sourceMappingURL=internals.cjs.map
@@ -1,8 +1,8 @@
1
- import { ah as Schema, aA as FactsStore, a as Facts, D as DefinitionMeta, E as EffectsDef, u as ConstraintsDef, s as RequirementKeyFn, R as RequirementWithId, aB as ConstraintState, F as FactPredicate, C as ClauseResult, af as ResolversDef, aC as ResolverStatus, r as Requirement, ak as SourceDef, P as Plugin, ao as System, aD as FactChange, O as FactsSnapshot, aE as ReconcileResult, aj as Snapshot, x as DirectiveError, aF as RecoveryStrategy, av as TraceEntry, aG as ErrorSource, q as ErrorBoundaryConfig, aH as RetryLaterConfig, Q as HistoryAPI, U as HistoryOption, ap as SystemConfig } from './plugins-C6MxOvot.cjs';
2
- export { aI as BatchItemResult, aJ as BatchResolveResults, aK as ConstraintsControl, v as CrossModuleConstraintDef, j as CrossModuleConstraintsDef, aL as CrossModuleDerivationFn, h as CrossModuleDerivationsDef, w as CrossModuleEffectDef, i as CrossModuleEffectsDef, aM as CrossModuleFactsWithSelf, aN as DerivationKeys, aO as DerivationReturnType, aP as DerivationsControl, aQ as DerivationsSchema, aR as DeriveAccessor, aS as DispatchEventsFromSchema, y as DistributableSnapshot, z as DistributableSnapshotOptions, aT as EffectCleanup, aU as EffectsControl, aV as EventPayloadSchema, aW as EventsAccessor, aX as EventsAccessorFromSchema, K as EventsDef, aY as EventsSchema, aZ as FactKeys, a_ as FactReturnType, a$ as FlexibleEventHandler, b0 as HistoryConfig, b1 as InferEventPayloadFromSchema, b2 as InferRequirementPayloadFromSchema, b3 as InferSchema, b4 as MutableNamespacedFacts, b5 as NamespacedDerivations, b6 as NamespacedEventsAccessor, b7 as NamespacedFacts, b8 as ObservableKeys, b9 as RequirementExplanation, ba as RequirementOutput, bb as RequirementPayloadSchema, bc as RequirementsSchema, bd as ResolverContext, be as ResolversControl, bf as SnapshotMeta, bg as SystemEvent, bh as TraceConfig, aw as TypedConstraintDef, d as TypedConstraintsDef, T as TypedDerivationsDef, b as TypedEventsDef, bi as TypedResolverContext, ax as TypedResolverDef, e as TypedResolversDef, bj as UnionEvents } from './plugins-C6MxOvot.cjs';
3
- import { b as DerivationsDef, y as DerivedValues } from './predicate-CV3YJDup.cjs';
4
- export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-CV3YJDup.cjs';
5
- export { h as hashObject, g as isPrototypeSafe, j as safeStringify, k as stableStringify } from './utils-BZBBwS5A.cjs';
1
+ import { ah as Schema, aB as FactsStore, a as Facts, D as DefinitionMeta, E as EffectsDef, u as ConstraintsDef, s as RequirementKeyFn, R as RequirementWithId, aC as ConstraintState, F as FactPredicate, C as ClauseResult, af as ResolversDef, aD as ResolverStatus, r as Requirement, al as SourceDropReason, ak as SourceDef, P as Plugin, ap as System, aE as FactChange, O as FactsSnapshot, aF as ReconcileResult, aj as Snapshot, x as DirectiveError, aG as RecoveryStrategy, aw as TraceEntry, aH as ErrorSource, q as ErrorBoundaryConfig, aI as RetryLaterConfig, Q as HistoryAPI, U as HistoryOption, aq as SystemConfig } from './plugins-5Supk7it.cjs';
2
+ export { aJ as BatchItemResult, aK as BatchResolveResults, aL as ConstraintsControl, v as CrossModuleConstraintDef, j as CrossModuleConstraintsDef, aM as CrossModuleDerivationFn, h as CrossModuleDerivationsDef, w as CrossModuleEffectDef, i as CrossModuleEffectsDef, aN as CrossModuleFactsWithSelf, aO as DerivationKeys, aP as DerivationReturnType, aQ as DerivationsControl, aR as DerivationsSchema, aS as DeriveAccessor, aT as DispatchEventsFromSchema, y as DistributableSnapshot, z as DistributableSnapshotOptions, aU as EffectCleanup, aV as EffectsControl, aW as EventPayloadSchema, aX as EventsAccessor, aY as EventsAccessorFromSchema, K as EventsDef, aZ as EventsSchema, a_ as FactKeys, a$ as FactReturnType, b0 as FlexibleEventHandler, b1 as HistoryConfig, b2 as InferEventPayloadFromSchema, b3 as InferRequirementPayloadFromSchema, b4 as InferSchema, b5 as MutableNamespacedFacts, b6 as NamespacedDerivations, b7 as NamespacedEventsAccessor, b8 as NamespacedFacts, b9 as ObservableKeys, ba as RequirementExplanation, bb as RequirementOutput, bc as RequirementPayloadSchema, bd as RequirementsSchema, be as ResolverContext, bf as ResolversControl, bg as SnapshotMeta, bh as SystemEvent, bi as TraceConfig, ax as TypedConstraintDef, d as TypedConstraintsDef, T as TypedDerivationsDef, b as TypedEventsDef, bj as TypedResolverContext, ay as TypedResolverDef, e as TypedResolversDef, bk as UnionEvents } from './plugins-5Supk7it.cjs';
3
+ import { b as DerivationsDef, y as DerivedValues } from './predicate-DYb-3Mvl.cjs';
4
+ export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-DYb-3Mvl.cjs';
5
+ export { h as hashObject, g as isPrototypeSafe, j as safeStringify, k as stableStringify } from './utils-DY8KTiD6.cjs';
6
6
 
7
7
  /**
8
8
  * Facts Store - Proxy-based reactive state with auto-tracking
@@ -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-1 constraint-binding to seed each resolver's `expected` map
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
- * Cancel an in-flight or batch-queued resolver by requirement ID.
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 cancel.
635
+ * @param requirementId - The unique requirement ID to abort.
634
636
  */
635
- cancel(requirementId: string): void;
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 owned facts) but it no longer occupies the `inflight` slot, so the
644
- * same requirement re-dispatches cleanly if it returns. A no-op if the
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
- * Cancel every in-flight resolver and flush all pending batch queues.
653
+ * Abort every in-flight resolver and flush all pending batch queues.
652
654
  */
653
- cancelAll(): void;
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-1 (resolver constraint-binding).
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 `owns` field knows which facts it
738
- * *owns* writes to those are clobber-checked (see {@link createBoundFacts}).
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
- * `owns` field — in which case binding is a no-op and the resolver behaves
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 the triggering resolver owns; writes to these are clobber-checked. */
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-1).
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 owned fact keys. Return `undefined` if the
767
- * constraint is unknown or has no `owns` field.
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 canceled via {@link ResolversManager.cancel | cancel}. */
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 / cancel) against
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
@@ -866,7 +868,7 @@ type SourceDispatchResult = {
866
868
  accepted: true;
867
869
  } | {
868
870
  accepted: false;
869
- reason: "post-destroy" | "post-stop" | "blocked-event-name" | "invalid-event-name" | "coalesced";
871
+ reason: SourceDropReason;
870
872
  };
871
873
  /**
872
874
  * Per-source lifecycle callbacks the engine wires into the plugin manager.
@@ -888,6 +890,17 @@ type SourceDispatchResult = {
888
890
  interface SourcesManagerCallbacks {
889
891
  readonly onAttach?: (id: string, moduleId: string) => void;
890
892
  readonly onPublish?: (id: string, moduleId: string, eventName: string) => void;
893
+ /**
894
+ * Fires when the engine OR the manager rejects a publish. Mirrors
895
+ * `onPublish` so plugin observers can pair every accepted publish
896
+ * with the drop side without polling `inspect().sources[i].dropCount`.
897
+ *
898
+ * `reason` matches the value the manager writes to `lastDropReason`
899
+ * on the inspect row. Use this hook to drive alerting (a source whose
900
+ * `lastDropReason: "blocked-event-name"` is a misconfiguration; a
901
+ * source whose `lastDropReason: "coalesced"` is publishing too fast).
902
+ */
903
+ readonly onDrop?: (id: string, moduleId: string, eventName: string, reason: SourceDropReason) => void;
891
904
  readonly onDetach?: (id: string, moduleId: string) => void;
892
905
  readonly onError?: (id: string, moduleId: string, phase: "attach" | "cleanup" | "runtime", error: Error) => void;
893
906
  }
@@ -979,7 +992,7 @@ interface SourceInspectionRow {
979
992
  * ahead of the microtask flush (only when `SourceDef.coalesce`
980
993
  * is `"lastWriteWins"`)
981
994
  */
982
- lastDropReason: "post-destroy" | "post-stop" | "blocked-event-name" | "invalid-event-name" | "coalesced" | null;
995
+ lastDropReason: SourceDropReason | null;
983
996
  /** Wall-clock ms of the most recent rejected publish, or `null`. */
984
997
  lastDropAt: number | null;
985
998
  errorCount: number;
@@ -1054,6 +1067,18 @@ interface PluginManager<_S extends Schema = any> {
1054
1067
  emitReconcileEnd(result: ReconcileResult): void;
1055
1068
  emitConstraintEvaluate(id: string, active: boolean, whenExplain?: ClauseResult[]): void;
1056
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;
1057
1082
  emitRequirementCreated(req: RequirementWithId): void;
1058
1083
  emitRequirementMet(req: RequirementWithId, byResolver: string): void;
1059
1084
  emitRequirementCanceled(req: RequirementWithId): void;
@@ -1081,6 +1106,13 @@ interface PluginManager<_S extends Schema = any> {
1081
1106
  emitEffectError(id: string, error: unknown): void;
1082
1107
  emitSourceAttach(id: string, moduleId: string): void;
1083
1108
  emitSourcePublish(id: string, moduleId: string, eventName: string): void;
1109
+ /**
1110
+ * Engine- or manager-rejected publish. Mirrors `emitSourcePublish`
1111
+ * so observers can pair every accepted publish with the drop side
1112
+ * without polling `inspect().sources[i].dropCount`. `reason` matches
1113
+ * the value the inspect row records.
1114
+ */
1115
+ emitSourceDrop(id: string, moduleId: string, eventName: string, reason: SourceDropReason): void;
1084
1116
  emitSourceDetach(id: string, moduleId: string): void;
1085
1117
  emitSourceError(id: string, moduleId: string, phase: "attach" | "cleanup" | "runtime", error: unknown): void;
1086
1118
  emitGuardrailBlocked(plugin: string, key: string, kind: "redact" | "alert" | "detect", count: number, category?: string): void;
@@ -1,8 +1,8 @@
1
- import { ah as Schema, aA as FactsStore, a as Facts, D as DefinitionMeta, E as EffectsDef, u as ConstraintsDef, s as RequirementKeyFn, R as RequirementWithId, aB as ConstraintState, F as FactPredicate, C as ClauseResult, af as ResolversDef, aC as ResolverStatus, r as Requirement, ak as SourceDef, P as Plugin, ao as System, aD as FactChange, O as FactsSnapshot, aE as ReconcileResult, aj as Snapshot, x as DirectiveError, aF as RecoveryStrategy, av as TraceEntry, aG as ErrorSource, q as ErrorBoundaryConfig, aH as RetryLaterConfig, Q as HistoryAPI, U as HistoryOption, ap as SystemConfig } from './plugins-C6MxOvot.js';
2
- export { aI as BatchItemResult, aJ as BatchResolveResults, aK as ConstraintsControl, v as CrossModuleConstraintDef, j as CrossModuleConstraintsDef, aL as CrossModuleDerivationFn, h as CrossModuleDerivationsDef, w as CrossModuleEffectDef, i as CrossModuleEffectsDef, aM as CrossModuleFactsWithSelf, aN as DerivationKeys, aO as DerivationReturnType, aP as DerivationsControl, aQ as DerivationsSchema, aR as DeriveAccessor, aS as DispatchEventsFromSchema, y as DistributableSnapshot, z as DistributableSnapshotOptions, aT as EffectCleanup, aU as EffectsControl, aV as EventPayloadSchema, aW as EventsAccessor, aX as EventsAccessorFromSchema, K as EventsDef, aY as EventsSchema, aZ as FactKeys, a_ as FactReturnType, a$ as FlexibleEventHandler, b0 as HistoryConfig, b1 as InferEventPayloadFromSchema, b2 as InferRequirementPayloadFromSchema, b3 as InferSchema, b4 as MutableNamespacedFacts, b5 as NamespacedDerivations, b6 as NamespacedEventsAccessor, b7 as NamespacedFacts, b8 as ObservableKeys, b9 as RequirementExplanation, ba as RequirementOutput, bb as RequirementPayloadSchema, bc as RequirementsSchema, bd as ResolverContext, be as ResolversControl, bf as SnapshotMeta, bg as SystemEvent, bh as TraceConfig, aw as TypedConstraintDef, d as TypedConstraintsDef, T as TypedDerivationsDef, b as TypedEventsDef, bi as TypedResolverContext, ax as TypedResolverDef, e as TypedResolversDef, bj as UnionEvents } from './plugins-C6MxOvot.js';
3
- import { b as DerivationsDef, y as DerivedValues } from './predicate-C92yT5IR.js';
4
- export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-C92yT5IR.js';
5
- export { h as hashObject, g as isPrototypeSafe, j as safeStringify, k as stableStringify } from './utils-BZBBwS5A.js';
1
+ import { ah as Schema, aB as FactsStore, a as Facts, D as DefinitionMeta, E as EffectsDef, u as ConstraintsDef, s as RequirementKeyFn, R as RequirementWithId, aC as ConstraintState, F as FactPredicate, C as ClauseResult, af as ResolversDef, aD as ResolverStatus, r as Requirement, al as SourceDropReason, ak as SourceDef, P as Plugin, ap as System, aE as FactChange, O as FactsSnapshot, aF as ReconcileResult, aj as Snapshot, x as DirectiveError, aG as RecoveryStrategy, aw as TraceEntry, aH as ErrorSource, q as ErrorBoundaryConfig, aI as RetryLaterConfig, Q as HistoryAPI, U as HistoryOption, aq as SystemConfig } from './plugins-5Supk7it.js';
2
+ export { aJ as BatchItemResult, aK as BatchResolveResults, aL as ConstraintsControl, v as CrossModuleConstraintDef, j as CrossModuleConstraintsDef, aM as CrossModuleDerivationFn, h as CrossModuleDerivationsDef, w as CrossModuleEffectDef, i as CrossModuleEffectsDef, aN as CrossModuleFactsWithSelf, aO as DerivationKeys, aP as DerivationReturnType, aQ as DerivationsControl, aR as DerivationsSchema, aS as DeriveAccessor, aT as DispatchEventsFromSchema, y as DistributableSnapshot, z as DistributableSnapshotOptions, aU as EffectCleanup, aV as EffectsControl, aW as EventPayloadSchema, aX as EventsAccessor, aY as EventsAccessorFromSchema, K as EventsDef, aZ as EventsSchema, a_ as FactKeys, a$ as FactReturnType, b0 as FlexibleEventHandler, b1 as HistoryConfig, b2 as InferEventPayloadFromSchema, b3 as InferRequirementPayloadFromSchema, b4 as InferSchema, b5 as MutableNamespacedFacts, b6 as NamespacedDerivations, b7 as NamespacedEventsAccessor, b8 as NamespacedFacts, b9 as ObservableKeys, ba as RequirementExplanation, bb as RequirementOutput, bc as RequirementPayloadSchema, bd as RequirementsSchema, be as ResolverContext, bf as ResolversControl, bg as SnapshotMeta, bh as SystemEvent, bi as TraceConfig, ax as TypedConstraintDef, d as TypedConstraintsDef, T as TypedDerivationsDef, b as TypedEventsDef, bj as TypedResolverContext, ay as TypedResolverDef, e as TypedResolversDef, bk as UnionEvents } from './plugins-5Supk7it.js';
3
+ import { b as DerivationsDef, y as DerivedValues } from './predicate-C9oMO_ny.js';
4
+ export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-C9oMO_ny.js';
5
+ export { h as hashObject, g as isPrototypeSafe, j as safeStringify, k as stableStringify } from './utils-DY8KTiD6.js';
6
6
 
7
7
  /**
8
8
  * Facts Store - Proxy-based reactive state with auto-tracking
@@ -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-1 constraint-binding to seed each resolver's `expected` map
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
- * Cancel an in-flight or batch-queued resolver by requirement ID.
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 cancel.
635
+ * @param requirementId - The unique requirement ID to abort.
634
636
  */
635
- cancel(requirementId: string): void;
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 owned facts) but it no longer occupies the `inflight` slot, so the
644
- * same requirement re-dispatches cleanly if it returns. A no-op if the
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
- * Cancel every in-flight resolver and flush all pending batch queues.
653
+ * Abort every in-flight resolver and flush all pending batch queues.
652
654
  */
653
- cancelAll(): void;
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-1 (resolver constraint-binding).
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 `owns` field knows which facts it
738
- * *owns* writes to those are clobber-checked (see {@link createBoundFacts}).
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
- * `owns` field — in which case binding is a no-op and the resolver behaves
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 the triggering resolver owns; writes to these are clobber-checked. */
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-1).
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 owned fact keys. Return `undefined` if the
767
- * constraint is unknown or has no `owns` field.
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 canceled via {@link ResolversManager.cancel | cancel}. */
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 / cancel) against
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
@@ -866,7 +868,7 @@ type SourceDispatchResult = {
866
868
  accepted: true;
867
869
  } | {
868
870
  accepted: false;
869
- reason: "post-destroy" | "post-stop" | "blocked-event-name" | "invalid-event-name" | "coalesced";
871
+ reason: SourceDropReason;
870
872
  };
871
873
  /**
872
874
  * Per-source lifecycle callbacks the engine wires into the plugin manager.
@@ -888,6 +890,17 @@ type SourceDispatchResult = {
888
890
  interface SourcesManagerCallbacks {
889
891
  readonly onAttach?: (id: string, moduleId: string) => void;
890
892
  readonly onPublish?: (id: string, moduleId: string, eventName: string) => void;
893
+ /**
894
+ * Fires when the engine OR the manager rejects a publish. Mirrors
895
+ * `onPublish` so plugin observers can pair every accepted publish
896
+ * with the drop side without polling `inspect().sources[i].dropCount`.
897
+ *
898
+ * `reason` matches the value the manager writes to `lastDropReason`
899
+ * on the inspect row. Use this hook to drive alerting (a source whose
900
+ * `lastDropReason: "blocked-event-name"` is a misconfiguration; a
901
+ * source whose `lastDropReason: "coalesced"` is publishing too fast).
902
+ */
903
+ readonly onDrop?: (id: string, moduleId: string, eventName: string, reason: SourceDropReason) => void;
891
904
  readonly onDetach?: (id: string, moduleId: string) => void;
892
905
  readonly onError?: (id: string, moduleId: string, phase: "attach" | "cleanup" | "runtime", error: Error) => void;
893
906
  }
@@ -979,7 +992,7 @@ interface SourceInspectionRow {
979
992
  * ahead of the microtask flush (only when `SourceDef.coalesce`
980
993
  * is `"lastWriteWins"`)
981
994
  */
982
- lastDropReason: "post-destroy" | "post-stop" | "blocked-event-name" | "invalid-event-name" | "coalesced" | null;
995
+ lastDropReason: SourceDropReason | null;
983
996
  /** Wall-clock ms of the most recent rejected publish, or `null`. */
984
997
  lastDropAt: number | null;
985
998
  errorCount: number;
@@ -1054,6 +1067,18 @@ interface PluginManager<_S extends Schema = any> {
1054
1067
  emitReconcileEnd(result: ReconcileResult): void;
1055
1068
  emitConstraintEvaluate(id: string, active: boolean, whenExplain?: ClauseResult[]): void;
1056
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;
1057
1082
  emitRequirementCreated(req: RequirementWithId): void;
1058
1083
  emitRequirementMet(req: RequirementWithId, byResolver: string): void;
1059
1084
  emitRequirementCanceled(req: RequirementWithId): void;
@@ -1081,6 +1106,13 @@ interface PluginManager<_S extends Schema = any> {
1081
1106
  emitEffectError(id: string, error: unknown): void;
1082
1107
  emitSourceAttach(id: string, moduleId: string): void;
1083
1108
  emitSourcePublish(id: string, moduleId: string, eventName: string): void;
1109
+ /**
1110
+ * Engine- or manager-rejected publish. Mirrors `emitSourcePublish`
1111
+ * so observers can pair every accepted publish with the drop side
1112
+ * without polling `inspect().sources[i].dropCount`. `reason` matches
1113
+ * the value the inspect row records.
1114
+ */
1115
+ emitSourceDrop(id: string, moduleId: string, eventName: string, reason: SourceDropReason): void;
1084
1116
  emitSourceDetach(id: string, moduleId: string): void;
1085
1117
  emitSourceError(id: string, moduleId: string, phase: "attach" | "cleanup" | "runtime", error: unknown): void;
1086
1118
  emitGuardrailBlocked(plugin: string, key: string, kind: "redact" | "alert" | "detect", count: number, category?: string): 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-CLJMEU2A.js';export{m as dangerousRegex}from'./chunk-O4GQEV4G.js';export{f as getCurrentDeps,g as isTracking,j as trackAccess,h as withTracking,i as withoutTracking}from'./chunk-3ETCZLAY.js';export{h as hashObject,f as isPrototypeSafe,o as safeStringify,e as stableStringify}from'./chunk-PXRV64PA.js';//# sourceMappingURL=internals.js.map
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-6NCC6RBC.js';export{m as dangerousRegex}from'./chunk-RBF653NR.js';export{f as getCurrentDeps,g as isTracking,j as trackAccess,h as withTracking,i as withoutTracking}from'./chunk-6PF2FRBG.js';export{h as hashObject,f as isPrototypeSafe,o as safeStringify,e as stableStringify}from'./chunk-SFUVPP4L.js';//# sourceMappingURL=internals.js.map
2
2
  //# sourceMappingURL=internals.js.map