@rotorsoft/act 1.32.29 → 1.33.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 +0 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts +41 -233
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/adapters/in-memory-store.d.ts.map +1 -1
- package/dist/@types/builders/act-builder.d.ts +2 -115
- package/dist/@types/builders/act-builder.d.ts.map +1 -1
- package/dist/@types/builders/builder-utils.d.ts +1 -1
- package/dist/@types/builders/builder-utils.d.ts.map +1 -1
- package/dist/@types/builders/event-builder.d.ts +5 -5
- package/dist/@types/builders/event-builder.d.ts.map +1 -1
- package/dist/@types/builders/merge.d.ts +1 -1
- package/dist/@types/builders/merge.d.ts.map +1 -1
- package/dist/@types/builders/projection-builder.d.ts +2 -144
- package/dist/@types/builders/projection-builder.d.ts.map +1 -1
- package/dist/@types/builders/slice-builder.d.ts +2 -71
- package/dist/@types/builders/slice-builder.d.ts.map +1 -1
- package/dist/@types/builders/state-builder.d.ts +2 -376
- package/dist/@types/builders/state-builder.d.ts.map +1 -1
- package/dist/@types/config.d.ts +6 -43
- package/dist/@types/config.d.ts.map +1 -1
- package/dist/@types/csv.d.ts +1 -15
- package/dist/@types/csv.d.ts.map +1 -1
- package/dist/@types/index.d.ts +0 -1
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/@types/internal/autoclose-policy.d.ts +9 -108
- package/dist/@types/internal/autoclose-policy.d.ts.map +1 -1
- package/dist/@types/internal/autoclose-reaction.d.ts +1 -9
- package/dist/@types/internal/autoclose-reaction.d.ts.map +1 -1
- package/dist/@types/internal/autoclose-window.d.ts +2 -15
- package/dist/@types/internal/autoclose-window.d.ts.map +1 -1
- package/dist/@types/internal/backoff.d.ts +1 -6
- package/dist/@types/internal/backoff.d.ts.map +1 -1
- package/dist/@types/internal/circuit-breaker.d.ts +1 -4
- package/dist/@types/internal/circuit-breaker.d.ts.map +1 -1
- package/dist/@types/{builders/build-classify.d.ts → internal/classify.d.ts} +2 -15
- package/dist/@types/internal/classify.d.ts.map +1 -0
- package/dist/@types/internal/close-cycle.d.ts +0 -13
- package/dist/@types/internal/close-cycle.d.ts.map +1 -1
- package/dist/@types/internal/config.d.ts +9 -81
- package/dist/@types/internal/config.d.ts.map +1 -1
- package/dist/@types/internal/correlate-cycle.d.ts +1 -1
- package/dist/@types/internal/correlate-cycle.d.ts.map +1 -1
- package/dist/@types/internal/{correlator.d.ts → correlation-id.d.ts} +1 -8
- package/dist/@types/internal/correlation-id.d.ts.map +1 -0
- package/dist/@types/internal/date-reviver.d.ts +0 -5
- package/dist/@types/internal/date-reviver.d.ts.map +1 -1
- package/dist/@types/internal/defer-config.d.ts +0 -13
- package/dist/@types/internal/defer-config.d.ts.map +1 -1
- package/dist/@types/internal/defer-timer.d.ts +1 -5
- package/dist/@types/internal/defer-timer.d.ts.map +1 -1
- package/dist/@types/internal/drain-cycle.d.ts +1 -1
- package/dist/@types/internal/drain-cycle.d.ts.map +1 -1
- package/dist/@types/internal/{drain.d.ts → drain-ops.d.ts} +1 -7
- package/dist/@types/internal/drain-ops.d.ts.map +1 -0
- package/dist/@types/internal/drain-ratio.d.ts +0 -5
- package/dist/@types/internal/drain-ratio.d.ts.map +1 -1
- package/dist/@types/internal/event-sourcing.d.ts +1 -8
- package/dist/@types/internal/event-sourcing.d.ts.map +1 -1
- package/dist/@types/internal/event-versions.d.ts +0 -9
- package/dist/@types/internal/event-versions.d.ts.map +1 -1
- package/dist/@types/internal/lru-map.d.ts +0 -9
- package/dist/@types/internal/lru-map.d.ts.map +1 -1
- package/dist/@types/internal/pii.d.ts +78 -0
- package/dist/@types/internal/pii.d.ts.map +1 -0
- package/dist/@types/internal/projection-fold.d.ts +1 -5
- package/dist/@types/internal/projection-fold.d.ts.map +1 -1
- package/dist/@types/internal/{close-signal.d.ts → reaction-dispatch.d.ts} +46 -6
- package/dist/@types/internal/reaction-dispatch.d.ts.map +1 -0
- package/dist/@types/internal/report-once.d.ts +1 -8
- package/dist/@types/internal/report-once.d.ts.map +1 -1
- package/dist/@types/internal/settle.d.ts +21 -21
- package/dist/@types/internal/settle.d.ts.map +1 -1
- package/dist/@types/internal/tracing.d.ts +3 -14
- package/dist/@types/internal/tracing.d.ts.map +1 -1
- package/dist/@types/internal/walk-streams.d.ts +0 -2
- package/dist/@types/internal/walk-streams.d.ts.map +1 -1
- package/dist/@types/ports.d.ts +3 -43
- package/dist/@types/ports.d.ts.map +1 -1
- package/dist/@types/scoped.d.ts +1 -6
- package/dist/@types/scoped.d.ts.map +1 -1
- package/dist/@types/sensitive.d.ts +56 -0
- package/dist/@types/sensitive.d.ts.map +1 -0
- package/dist/@types/test/index.d.ts +1 -0
- package/dist/@types/test/index.d.ts.map +1 -1
- package/dist/@types/test/sandbox.d.ts +2 -26
- package/dist/@types/test/sandbox.d.ts.map +1 -1
- package/dist/@types/types/act.d.ts +216 -0
- package/dist/@types/types/act.d.ts.map +1 -0
- package/dist/@types/types/action.d.ts +67 -0
- package/dist/@types/types/action.d.ts.map +1 -1
- package/dist/@types/types/builders.d.ts +722 -0
- package/dist/@types/types/builders.d.ts.map +1 -0
- package/dist/@types/types/errors.d.ts +31 -1
- package/dist/@types/types/errors.d.ts.map +1 -1
- package/dist/@types/types/index.d.ts +38 -0
- package/dist/@types/types/index.d.ts.map +1 -1
- package/dist/@types/types/ports.d.ts +16 -10
- package/dist/@types/types/ports.d.ts.map +1 -1
- package/dist/@types/types/reaction.d.ts +11 -1
- package/dist/@types/types/reaction.d.ts.map +1 -1
- package/dist/@types/types/sandbox.d.ts +31 -0
- package/dist/@types/types/sandbox.d.ts.map +1 -0
- package/dist/@types/types/schemas.d.ts +12 -17
- package/dist/@types/types/schemas.d.ts.map +1 -1
- package/dist/{chunk-F7K7SIG6.js → chunk-2PMUONGF.js} +38 -57
- package/dist/chunk-2PMUONGF.js.map +1 -0
- package/dist/chunk-HF433MAF.cjs +264 -0
- package/dist/chunk-HF433MAF.cjs.map +1 -0
- package/dist/{chunk-5FXT63KF.js → chunk-JABYJGT7.js} +184 -24
- package/dist/chunk-JABYJGT7.js.map +1 -0
- package/dist/chunk-VE3MTY4A.cjs +1233 -0
- package/dist/chunk-VE3MTY4A.cjs.map +1 -0
- package/dist/index.cjs +1615 -3003
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +751 -813
- package/dist/index.js.map +1 -1
- package/dist/test/index.cjs +16 -1105
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.js +2 -2
- package/dist/test/index.js.map +1 -1
- package/dist/types/index.cjs +58 -276
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js +15 -1
- package/package.json +1 -1
- package/dist/@types/builders/build-classify.d.ts.map +0 -1
- package/dist/@types/builders/builder-base.d.ts +0 -70
- package/dist/@types/builders/builder-base.d.ts.map +0 -1
- package/dist/@types/builders/reaction-builder.d.ts +0 -55
- package/dist/@types/builders/reaction-builder.d.ts.map +0 -1
- package/dist/@types/internal/close-signal.d.ts.map +0 -1
- package/dist/@types/internal/correlator.d.ts.map +0 -1
- package/dist/@types/internal/defer-signal.d.ts +0 -35
- package/dist/@types/internal/defer-signal.d.ts.map +0 -1
- package/dist/@types/internal/drain.d.ts.map +0 -1
- package/dist/@types/internal/index.d.ts +0 -43
- package/dist/@types/internal/index.d.ts.map +0 -1
- package/dist/@types/internal/sensitive.d.ts +0 -177
- package/dist/@types/internal/sensitive.d.ts.map +0 -1
- package/dist/chunk-5FXT63KF.js.map +0 -1
- package/dist/chunk-F7K7SIG6.js.map +0 -1
package/dist/@types/act.d.ts
CHANGED
|
@@ -1,205 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
import { type Scoped } from "./ports.js";
|
|
4
|
-
import type { Actor, AsOf, AuditCategory, AuditFinding, AuditOptions, BatchHandler, BlockedLease, CloseResult, CloseTarget, Committed, Correlator, DoOptions, Drain, DrainOptions, EventSink, EventSource, IAct, LaneConfig, Lease, LoadTarget, Query, Registry, ScanOptions, ScanResult, Schema, SchemaRegister, Schemas, SettleOptions, ShutdownOptions, Snapshot, State, StoreNotification, StreamFilter, StreamPosition, Target } from "./types/index.js";
|
|
5
|
-
export { type AutocloseConfig, type AutoclosePolicy, DEFAULT_AUTOCLOSE_CYCLE_MINUTES, DEFAULT_CLOSE_BATCH_SIZE, DEFAULT_CLOSE_YIELD_MS, DEFAULT_MAX_SUBSCRIBED_STREAMS, DEFAULT_SETTLE_DEBOUNCE_MS, resolveAutocloseConfig, } from "./internal/index.js";
|
|
6
|
-
/**
|
|
7
|
-
* Lifecycle events emitted by {@link Act}, mapped to their payload type.
|
|
8
|
-
* Drives the typing of `emit` / `on` / `off` — the event-name argument
|
|
9
|
-
* narrows its payload at the call site.
|
|
10
|
-
*
|
|
11
|
-
* The first parameter is kept (unused) for arity compatibility: `committed`
|
|
12
|
-
* carries snapshots of whichever state each action targeted, so its honest
|
|
13
|
-
* element type is `Snapshot<Schema, TEvents>` — the register map itself was
|
|
14
|
-
* never the shape of any snapshot's state.
|
|
15
|
-
*/
|
|
16
|
-
export type ActLifecycleEvents<_TSchemaReg extends SchemaRegister<TActions>, TEvents extends Schemas, TActions extends Schemas> = {
|
|
17
|
-
committed: Snapshot<Schema, TEvents>[];
|
|
18
|
-
acked: Lease[];
|
|
19
|
-
blocked: BlockedLease[];
|
|
20
|
-
settled: Drain<TEvents>;
|
|
21
|
-
closed: CloseResult;
|
|
22
|
-
/**
|
|
23
|
-
* A **different process** committed an event to the same backing store.
|
|
24
|
-
*
|
|
25
|
-
* Fires only when the configured store implements
|
|
26
|
-
* {@link Store.notify} and there is at least one registered reaction.
|
|
27
|
-
* The orchestrator uses the same signal internally to wake `settle()`
|
|
28
|
-
* — listeners get the raw payload for SSE fan-out, dashboards, and
|
|
29
|
-
* audit logs.
|
|
30
|
-
*
|
|
31
|
-
* Local commits do *not* fire `notified` (use `committed` for those):
|
|
32
|
-
* stores self-filter their own writes so this channel has a clean
|
|
33
|
-
* cross-process semantic.
|
|
34
|
-
*/
|
|
35
|
-
notified: StoreNotification;
|
|
36
|
-
/**
|
|
37
|
-
* A stream's sensitive-data payload was wiped via {@link Act.forget}.
|
|
38
|
-
* Fires exactly once per successful `forget(stream)` call — idempotent
|
|
39
|
-
* second calls (no PII left on the stream) return `eventCount: 0` and
|
|
40
|
-
* do NOT re-emit. Apps that never call `forget()` never see this event.
|
|
41
|
-
*
|
|
42
|
-
* Listeners use it for the compliance side of GDPR / CCPA: audit log,
|
|
43
|
-
* downstream cache busts, projection-side wipes that the framework
|
|
44
|
-
* doesn't reach (e.g., search indexes, ETL caches). The framework's own
|
|
45
|
-
* cache is invalidated by `forget()` itself before the event fires.
|
|
46
|
-
*/
|
|
47
|
-
forgotten: {
|
|
48
|
-
stream: string;
|
|
49
|
-
at: Date;
|
|
50
|
-
eventCount: number;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* A store operation failed during the drain loop. Fires on
|
|
54
|
-
* every failed drain cycle — typically a {@link StoreError} from a
|
|
55
|
-
* degraded backend — carrying the orchestrator circuit breaker's state
|
|
56
|
-
* after the failure (`open` means the drain loop has backed off and will
|
|
57
|
-
* retry after the cooldown). Listen to alert on a degraded store; the
|
|
58
|
-
* framework logs the same error regardless. Emitted only when a listener
|
|
59
|
-
* is registered (Node's `EventEmitter` throws on an unhandled `"error"`).
|
|
60
|
-
*/
|
|
61
|
-
error: {
|
|
62
|
-
error: unknown;
|
|
63
|
-
circuit: CircuitState;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Options for {@link Act} construction (passed via {@link ActBuilder.build}).
|
|
68
|
-
*
|
|
69
|
-
* @property maxSubscribedStreams - Cap for the LRU tracking what each
|
|
70
|
-
* dynamically resolved reaction target was last subscribed at. Statically
|
|
71
|
-
* declared targets are held outside it and never evicted, so their lane
|
|
72
|
-
* and priority stay owned by the build-time subscribe.
|
|
73
|
-
* Default: {@link DEFAULT_MAX_SUBSCRIBED_STREAMS}.
|
|
74
|
-
* @property settleDebounceMs - Debounce window (ms) used by `settle()` when
|
|
75
|
-
* the caller doesn't pass `SettleOptions.debounceMs`. Tune this once per
|
|
76
|
-
* Act instance instead of threading the value through every call site.
|
|
77
|
-
* Default: {@link DEFAULT_SETTLE_DEBOUNCE_MS}.
|
|
78
|
-
*/
|
|
79
|
-
export type ActOptions<TLanes extends string = string> = {
|
|
80
|
-
readonly maxSubscribedStreams?: number;
|
|
81
|
-
readonly settleDebounceMs?: number;
|
|
82
|
-
/**
|
|
83
|
-
* Per-Act ports. When set, this Act runs against the
|
|
84
|
-
* provided store + cache instead of the singletons — threaded via
|
|
85
|
-
* AsyncLocalStorage so internals are unchanged. Both are required
|
|
86
|
-
* together (a shared cache across distinct stores would collide on
|
|
87
|
-
* stream keys). Omit for the singleton path.
|
|
88
|
-
*/
|
|
89
|
-
readonly scoped?: Scoped;
|
|
90
|
-
/**
|
|
91
|
-
* Correlation-id generator for originating actions. When
|
|
92
|
-
* omitted, Act uses {@link default_correlator}, which produces a
|
|
93
|
-
* readable, time-monotonic-within-window, lowercase id of the form
|
|
94
|
-
* `{state[:4]}-{action[:4]}-{ts}{rnd}` (18 chars).
|
|
95
|
-
*
|
|
96
|
-
* Reactions inherit `reactingTo.meta.correlation` so the chain stays
|
|
97
|
-
* intact — the delegate is only consulted on originating commits and
|
|
98
|
-
* for the close-the-books transaction.
|
|
99
|
-
*/
|
|
100
|
-
readonly correlator?: Correlator;
|
|
101
|
-
/** Restrict this process to a subset of declared lanes. */
|
|
102
|
-
readonly onlyLanes?: ReadonlyArray<TLanes>;
|
|
103
|
-
/**
|
|
104
|
-
* Subscribe to {@link Store.notify} on this instance. Defaults
|
|
105
|
-
* to `true`. Set `false` on instances that only commit and never
|
|
106
|
-
* react — the subscriber-connection budget is the practical scaling
|
|
107
|
-
* ceiling for the notify/listen pattern, and writer-only fleets
|
|
108
|
-
* spend it for nothing when they subscribe to a channel they never
|
|
109
|
-
* read. Commits still emit notifications (that's part of the
|
|
110
|
-
* store's commit protocol); only the subscriber side is gated.
|
|
111
|
-
*/
|
|
112
|
-
readonly listen?: boolean;
|
|
113
|
-
/**
|
|
114
|
-
* Run the local reaction pipeline on this instance. Defaults
|
|
115
|
-
* to `true`. Set `false` on writer-only or sidecar instances: drain
|
|
116
|
-
* controllers' auto-cycle workers don't start, `correlate()` /
|
|
117
|
-
* `drain()` / `settle()` become no-ops, and the notify handler
|
|
118
|
-
* skips its drain-wakeup arm (but still emits the `notified`
|
|
119
|
-
* lifecycle event so observability sidecars work).
|
|
120
|
-
*/
|
|
121
|
-
readonly drain?: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Orchestrator circuit breaker for the drain loop. After
|
|
124
|
-
* `failureThreshold` consecutive store failures the breaker opens and
|
|
125
|
-
* the drain loop skips `claim()` for `cooldownMs` instead of hammering a
|
|
126
|
-
* down backend, then allows a half-open trial. Out-of-range values throw
|
|
127
|
-
* a `ZodError` at `act().build()`. Defaults: threshold 5, cooldown 30s.
|
|
128
|
-
*/
|
|
129
|
-
readonly circuitBreaker?: CircuitBreakerOptions;
|
|
130
|
-
/**
|
|
131
|
-
* @deprecated Accepted, validated, and ignored. It paced the off-hours
|
|
132
|
-
* re-check of the old autoclose sweep; the synthesized autoclose reaction now derives its re-check
|
|
133
|
-
* directly from `autocloseWindow` — a tick landing outside the window
|
|
134
|
-
* parks until the exact instant the window opens, so there is no
|
|
135
|
-
* polling cadence to configure (and nothing minute-denominated on the
|
|
136
|
-
* close surface). Still validated as an integer `[1, 1440]` so typos
|
|
137
|
-
* keep failing loudly at `act().build()`. Will be removed in the next
|
|
138
|
-
* major.
|
|
139
|
-
*/
|
|
140
|
-
readonly autocloseCycleMinutes?: number;
|
|
141
|
-
/**
|
|
142
|
-
* @deprecated Unused since the autoclose sweep was replaced by a
|
|
143
|
-
* synthesized per-aggregate reaction — nothing pages the store in
|
|
144
|
-
* batches anymore, so nothing reads this. Accepted and validated
|
|
145
|
-
* (`[1, 1024]`) for compatibility; will be removed in the next major.
|
|
146
|
-
*/
|
|
147
|
-
readonly closeBatchSize?: number;
|
|
148
|
-
/**
|
|
149
|
-
* @deprecated Unused: the sweep that yielded between
|
|
150
|
-
* successive `Store.truncate` calls no longer exists; closes are
|
|
151
|
-
* staged per stream by the autoclose reaction. Accepted and validated
|
|
152
|
-
* (`[0, 1000]`) for compatibility; will be removed in the next major.
|
|
153
|
-
*/
|
|
154
|
-
readonly closeYieldMs?: number;
|
|
155
|
-
/**
|
|
156
|
-
* @deprecated Unused: the sweep-side predicate try/catch
|
|
157
|
-
* this flag steered no longer exists; a throwing policy predicate now
|
|
158
|
-
* follows the reaction retry path (`blockOnError: false`, three
|
|
159
|
-
* retries). Accepted for compatibility; will be removed in the next
|
|
160
|
-
* major.
|
|
161
|
-
*/
|
|
162
|
-
readonly closeOnError?: boolean;
|
|
163
|
-
/**
|
|
164
|
-
* Optional off-hours window restricting when autoclose evaluates. A
|
|
165
|
-
* synthesized autoclose reaction that triggers outside the window
|
|
166
|
-
* defers to the next instant the window opens — derived from the
|
|
167
|
-
* window itself, no polling cadence. Hours are `[0, 23]` integers in
|
|
168
|
-
* `timeZone` (IANA, default `"UTC"`, DST-correct); `start > end` is
|
|
169
|
-
* an overnight window (e.g. `{ start: 22, end: 6 }`). Omit to
|
|
170
|
-
* evaluate regardless of clock time.
|
|
171
|
-
*/
|
|
172
|
-
readonly autocloseWindow?: {
|
|
173
|
-
readonly start: number;
|
|
174
|
-
readonly end: number;
|
|
175
|
-
readonly timeZone?: string;
|
|
176
|
-
};
|
|
177
|
-
/**
|
|
178
|
-
* Validate folded state against its declared Zod schema after every
|
|
179
|
-
* reduction. Off by default.
|
|
180
|
-
*
|
|
181
|
-
* When `true`, each time an event is folded into state — on the
|
|
182
|
-
* command path (`do`), on `load`/replay, and inside projection-fold
|
|
183
|
-
* projections — the merged full state is parsed against the owning
|
|
184
|
-
* state's `state({ Name: schema })` schema. A reducer that produces
|
|
185
|
-
* schema-violating state (the calculator divide-by-zero NaN
|
|
186
|
-
* class) throws a {@link ValidationError} at the triggering event,
|
|
187
|
-
* whose `target` names the state and the event (`<state>.<event>#<id>`)
|
|
188
|
-
* — instead of the bad value propagating and surfacing hops later as a
|
|
189
|
-
* confusing downstream error.
|
|
190
|
-
*
|
|
191
|
-
* This is a **debugging / CI aid, not a production guard**. Turn it on
|
|
192
|
-
* in development and CI to catch total-reducer bugs at the source; the
|
|
193
|
-
* framework already validates action inputs and emitted events, so the
|
|
194
|
-
* reduced state is the one shape it otherwise trusts. The per-event
|
|
195
|
-
* patch step is selected **once at `build()`** (the same way the
|
|
196
|
-
* orchestrator picks bare vs trace-decorated store ops from the log
|
|
197
|
-
* level): when `false` (the default) the fold loop is byte-identical to
|
|
198
|
-
* a bare reduction — the validating patch step is never selected, so
|
|
199
|
-
* there is no per-event cost, not even a branch.
|
|
200
|
-
*/
|
|
201
|
-
readonly validateFoldedState?: boolean;
|
|
202
|
-
};
|
|
1
|
+
import { type ActLifecycleEvents, type ActOptions } from "./types/act.js";
|
|
2
|
+
import type { Actor, AsOf, AuditCategory, AuditFinding, AuditOptions, BatchHandler, CloseResult, CloseTarget, Committed, DoOptions, Drain, DrainOptions, EventSink, EventSource, IAct, LaneConfig, LoadTarget, PatchFn, Query, Registry, ScanOptions, ScanResult, Schema, SchemaRegister, Schemas, SettleOptions, ShutdownOptions, Snapshot, State, StreamFilter, StreamPosition, Target } from "./types/index.js";
|
|
203
3
|
/**
|
|
204
4
|
* @category Orchestrator
|
|
205
5
|
* @see Store
|
|
@@ -231,14 +31,15 @@ export declare class Act<TSchemaReg extends SchemaRegister<TActions>, TEvents ex
|
|
|
231
31
|
private readonly _breaker;
|
|
232
32
|
private readonly _listen;
|
|
233
33
|
private readonly _drain;
|
|
34
|
+
private readonly _auto_settle;
|
|
234
35
|
/** Whether any event has a reaction; nothing arms without one. */
|
|
235
36
|
private readonly _reactive;
|
|
236
37
|
private readonly _drain_controllers;
|
|
237
38
|
private readonly _correlate;
|
|
238
39
|
private readonly _settle;
|
|
239
40
|
private _poll;
|
|
240
|
-
/** The
|
|
241
|
-
private
|
|
41
|
+
/** The poll's correlate `limit`, used by every settle pass while it runs. */
|
|
42
|
+
private _poll_limit;
|
|
242
43
|
/**
|
|
243
44
|
* Wired at construction against the store current then, so a store
|
|
244
45
|
* injected after `build()` is never notified.
|
|
@@ -522,6 +323,14 @@ export declare class Act<TSchemaReg extends SchemaRegister<TActions>, TEvents ex
|
|
|
522
323
|
*/
|
|
523
324
|
drain(options?: DrainOptions): Promise<Drain<TEvents>>;
|
|
524
325
|
private _arm_all;
|
|
326
|
+
/**
|
|
327
|
+
* Settles what a change armed (a commit, a reset, an unblock, a restore,
|
|
328
|
+
* a notification from another process), unless the app walks the
|
|
329
|
+
* pipeline itself (`autoSettle: false`).
|
|
330
|
+
*/
|
|
331
|
+
private _settle_armed;
|
|
332
|
+
/** Schedules a settle pass; writer-only instances (`drain: false`) skip it. */
|
|
333
|
+
private _schedule;
|
|
525
334
|
/** Arms only the lanes these events react on; true when any was armed. */
|
|
526
335
|
private _arm_for_event_names;
|
|
527
336
|
/** In parallel, so a slow lane never holds up a fast one. */
|
|
@@ -576,9 +385,6 @@ export declare class Act<TSchemaReg extends SchemaRegister<TActions>, TEvents ex
|
|
|
576
385
|
* reads (default 100). The scan always starts at the correlation
|
|
577
386
|
* checkpoint, so `after` is ignored.
|
|
578
387
|
* @param frequency - Milliseconds between ticks (default: 10000)
|
|
579
|
-
* @param callback - Called with the number of newly subscribed streams
|
|
580
|
-
* after each correlate pass that found some.
|
|
581
|
-
* @deprecated Listen to the `"settled"` lifecycle event instead.
|
|
582
388
|
* @returns `true` if the poll started, `false` if one is already running
|
|
583
389
|
*
|
|
584
390
|
* @example
|
|
@@ -591,7 +397,7 @@ export declare class Act<TSchemaReg extends SchemaRegister<TActions>, TEvents ex
|
|
|
591
397
|
* @see {@link settle} for what each tick runs
|
|
592
398
|
* @see {@link stop_correlations} to stop the poll
|
|
593
399
|
*/
|
|
594
|
-
start_correlations(query?: Query, frequency?: number
|
|
400
|
+
start_correlations(query?: Query, frequency?: number): boolean;
|
|
595
401
|
/**
|
|
596
402
|
* Stops the poll started by {@link start_correlations}. Idempotent, and
|
|
597
403
|
* called by `shutdown()`.
|
|
@@ -600,14 +406,15 @@ export declare class Act<TSchemaReg extends SchemaRegister<TActions>, TEvents ex
|
|
|
600
406
|
*/
|
|
601
407
|
stop_correlations(): void;
|
|
602
408
|
/**
|
|
603
|
-
*
|
|
409
|
+
* Drops the settle pass scheduled but not yet started. A cycle already
|
|
410
|
+
* running finishes; later changes schedule new passes.
|
|
604
411
|
*
|
|
605
412
|
* @see {@link settle}
|
|
606
413
|
*/
|
|
607
414
|
stop_settling(): void;
|
|
608
415
|
/**
|
|
609
|
-
* Reset reaction stream watermarks and
|
|
610
|
-
*
|
|
416
|
+
* Reset reaction stream watermarks and settle them, replaying their
|
|
417
|
+
* events through their reactions.
|
|
611
418
|
*
|
|
612
419
|
* Use this to replay events through projections (or other reaction targets)
|
|
613
420
|
* after changing handler logic. Equivalent to calling `store().reset(streams)`
|
|
@@ -615,10 +422,10 @@ export declare class Act<TSchemaReg extends SchemaRegister<TActions>, TEvents ex
|
|
|
615
422
|
* `store().reset(...)` alone leaves the flag untouched, so a settled app
|
|
616
423
|
* would short-circuit and skip the replay.
|
|
617
424
|
*
|
|
618
|
-
*
|
|
619
|
-
*
|
|
620
|
-
*
|
|
621
|
-
*
|
|
425
|
+
* The reset schedules a settle on its own, which loops correlate→drain
|
|
426
|
+
* until the replay catches up. Call `app.settle(options)` right after to
|
|
427
|
+
* give that pass batch options, or
|
|
428
|
+
* `correlate()` / `drain()` to drive the replay by hand.
|
|
622
429
|
*
|
|
623
430
|
* @param input - Reaction target streams (e.g., projection names) to reset, or a {@link StreamFilter} for bulk operations
|
|
624
431
|
* @returns Count of streams that were actually reset
|
|
@@ -626,7 +433,7 @@ export declare class Act<TSchemaReg extends SchemaRegister<TActions>, TEvents ex
|
|
|
626
433
|
* @example Rebuild a projection (production)
|
|
627
434
|
* ```typescript
|
|
628
435
|
* await app.reset(["my-projection"]);
|
|
629
|
-
* app.settle({ eventLimit: 1000 });
|
|
436
|
+
* app.settle({ eventLimit: 1000 }); // optional: bigger batches; emits "settled"
|
|
630
437
|
* ```
|
|
631
438
|
*
|
|
632
439
|
* @see {@link Store.reset} for the underlying store primitive
|
|
@@ -642,11 +449,9 @@ export declare class Act<TSchemaReg extends SchemaRegister<TActions>, TEvents ex
|
|
|
642
449
|
* {@link reset}, which rebuilds from event 0 (suitable for projection
|
|
643
450
|
* rebuilds, wrong for "I fixed the bug, please retry").
|
|
644
451
|
*
|
|
645
|
-
* Wraps `store().unblock(streams)` and
|
|
646
|
-
*
|
|
647
|
-
*
|
|
648
|
-
* directly, but `store().unblock(...)` alone leaves the flag
|
|
649
|
-
* untouched.
|
|
452
|
+
* Wraps `store().unblock(streams)` and settles the now-free streams on
|
|
453
|
+
* its own. `store().unblock(...)` alone leaves them waiting for the next
|
|
454
|
+
* commit.
|
|
650
455
|
*
|
|
651
456
|
* @param input - Stream names to unblock, or a {@link StreamFilter} for bulk recovery
|
|
652
457
|
* @returns Count of streams that were actually flipped (were blocked)
|
|
@@ -836,25 +641,28 @@ export declare class Act<TSchemaReg extends SchemaRegister<TActions>, TEvents ex
|
|
|
836
641
|
/**
|
|
837
642
|
* Debounced, non-blocking correlate→drain cycle.
|
|
838
643
|
*
|
|
839
|
-
*
|
|
840
|
-
*
|
|
841
|
-
*
|
|
842
|
-
*
|
|
843
|
-
*
|
|
844
|
-
*
|
|
845
|
-
*
|
|
846
|
-
*
|
|
644
|
+
* A local change that frees reaction work (a commit, `reset()`,
|
|
645
|
+
* `unblock()`, `restore()`) schedules this on its own unless the app
|
|
646
|
+
* sets `autoSettle: false`. Call it at startup, to run what was pending
|
|
647
|
+
* before a restart, or with options for the next pass. A pass already
|
|
648
|
+
* scheduled is never put off: calls before it runs join it (a shorter
|
|
649
|
+
* `debounceMs` brings it forward), and a call during a running cycle
|
|
650
|
+
* queues one more pass after it. Runs correlate→drain in a loop until a pass makes no
|
|
651
|
+
* progress — no new subscriptions, no events read, no streams leased —
|
|
652
|
+
* then emits the `"settled"` lifecycle event, so one call fully catches
|
|
653
|
+
* up paginated streams without forcing callers to loop.
|
|
847
654
|
*
|
|
848
655
|
* @param options - Settle configuration — see {@link SettleOptions} for fields:
|
|
849
|
-
* `debounceMs` (default 10), `correlate` (default
|
|
656
|
+
* `debounceMs` (default 10), `correlate.limit` (default 100, or the
|
|
657
|
+
* poll's limit while `start_correlations` runs; `after` is always the
|
|
658
|
+
* checkpoint),
|
|
850
659
|
* `maxPasses` (default `Infinity` — kill-switch for runaway loops),
|
|
851
660
|
* `streamLimit` (default 10), `eventLimit` (default 10),
|
|
852
661
|
* `leaseMillis` (default 10000).
|
|
853
662
|
*
|
|
854
|
-
* @example
|
|
663
|
+
* @example Startup
|
|
855
664
|
* ```typescript
|
|
856
|
-
*
|
|
857
|
-
* app.settle(); // non-blocking, returns immediately
|
|
665
|
+
* app.settle(); // run what was pending before the restart
|
|
858
666
|
*
|
|
859
667
|
* app.on("settled", (drain) => {
|
|
860
668
|
* // notify SSE clients, invalidate caches, etc.
|
package/dist/@types/act.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"act.d.ts","sourceRoot":"","sources":["../../src/act.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"act.d.ts","sourceRoot":"","sources":["../../src/act.ts"],"names":[],"mappings":"AAoDA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,UAAU,EAKhB,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EACV,KAAK,EACL,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EAEZ,WAAW,EACX,WAAW,EACX,SAAS,EAET,SAAS,EACT,KAAK,EACL,YAAY,EACZ,SAAS,EACT,WAAW,EACX,IAAI,EACJ,UAAU,EAEV,UAAU,EAE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AAW,EACnB,IAAI,GAAE,WAAgB,EACtB,IAAI,CAAC,EAAE,SAAS,GACf,OAAO,CAAC,UAAU,CAAC,CAkCrB;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,eAAe,CAAC,OAAO,CAAC,EAAE;QAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAW5B;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACI,KAAK,CACV,UAAU,CAAC,EAAE,aAAa,EAAE,EAC5B,OAAO,CAAC,EAAE,YAAY,GACrB,aAAa,CAAC,YAAY,CAAC,CAW7B;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAExE;IAED,yDAAyD;YAC3C,UAAU;IAuBxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACG,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAIxD;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAKpC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-memory-store.d.ts","sourceRoot":"","sources":["../../../src/adapters/in-memory-store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"in-memory-store.d.ts","sourceRoot":"","sources":["../../../src/adapters/in-memory-store.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,SAAS,EACT,KAAK,EACL,OAAO,EACP,KAAK,EACL,iBAAiB,EACjB,YAA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ClB,IAAI,CAAC,EAAE,SAAS,CAAC;QACjB,MAAM,CAAC,EAAE,IAAI,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;iBAMW,MAAM;mBACJ,SAAS,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;iBACnC,IAAI;QA2DlB;IAED,+EAA+E;IACzE,OAAO,CACX,MAAM,EAAE,CACN,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,KACpE,OAAO,CAAC,IAAI,CAAC,GACjB,OAAO,CAAC,IAAI,CAAC,CAyCf;CACF"}
|
|
@@ -1,118 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @category Builders
|
|
4
|
-
*
|
|
5
|
-
* Fluent builder for composing event-sourced applications.
|
|
6
|
-
*/
|
|
7
|
-
import { Act, type ActOptions } from "../act.js";
|
|
8
|
-
import { type DEFAULT_LANE } from "../ports.js";
|
|
9
|
-
import type { Actor, LaneConfig, Schema, SchemaRegister, Schemas, State } from "../types/index.js";
|
|
10
|
-
import type { BuilderBase } from "./builder-base.js";
|
|
11
|
-
import type { Slice } from "./slice-builder.js";
|
|
12
|
-
/**
|
|
13
|
-
* Fluent builder interface for composing event-sourced applications.
|
|
14
|
-
*
|
|
15
|
-
* Provides a chainable API for:
|
|
16
|
-
* - Registering states via `.withState()`
|
|
17
|
-
* - Registering slices via `.withSlice()`
|
|
18
|
-
* - Registering projections via `.withProjection()`
|
|
19
|
-
* - Locking a custom actor type via `.withActor<TActor>()`
|
|
20
|
-
* - Declaring drain lanes via `.withLane({name, ...})`
|
|
21
|
-
* - Defining event reactions via `.on()` → `.do()` → `.to()`
|
|
22
|
-
* - Building the orchestrator via `.build()`
|
|
23
|
-
*
|
|
24
|
-
* @template TSchemaReg - Schema register for states (maps action names to state schemas)
|
|
25
|
-
* @template TEvents - Event schemas (maps event names to event data schemas)
|
|
26
|
-
* @template TActions - Action schemas (maps action names to action payload schemas)
|
|
27
|
-
* @template TStateMap - Map of state names to state schemas
|
|
28
|
-
* @template TActor - Actor type extending base Actor
|
|
29
|
-
* @template TLanes - Union of declared lane names. Narrowed by
|
|
30
|
-
* `.withLane({name})` calls so `.to({lane})` and `ActOptions.onlyLanes`
|
|
31
|
-
* reject typos at compile time. Starts at `"default"`.
|
|
32
|
-
*
|
|
33
|
-
* @see {@link act} for usage examples
|
|
34
|
-
* @see {@link Act} for the built orchestrator API
|
|
35
|
-
*/
|
|
36
|
-
export interface ActBuilder<TSchemaReg extends SchemaRegister<TActions>, TEvents extends Schemas, TActions extends Schemas, TStateMap extends Record<string, Schema> = {}, TActor extends Actor = Actor, TLanes extends string = typeof DEFAULT_LANE> extends BuilderBase<ActBuilder<TSchemaReg, TEvents, TActions, TStateMap, TActor, TLanes>, TEvents, TActions, TActor, TLanes> {
|
|
37
|
-
/**
|
|
38
|
-
* Registers a state definition with the builder.
|
|
39
|
-
*
|
|
40
|
-
* State names, action names, and event names must be unique across the
|
|
41
|
-
* application (partial states with the same name are merged automatically).
|
|
42
|
-
*
|
|
43
|
-
* @throws {Error} If duplicate action or event names are detected
|
|
44
|
-
*/
|
|
45
|
-
withState: <TNewState extends Schema, TNewEvents extends Schemas, TNewActions extends Schemas, TNewName extends string = string>(state: State<TNewState, TNewEvents, TNewActions, TNewName>) => ActBuilder<TSchemaReg & {
|
|
46
|
-
[K in keyof TNewActions]: TNewState;
|
|
47
|
-
}, TEvents & TNewEvents, TActions & TNewActions, TStateMap & {
|
|
48
|
-
[K in TNewName]: TNewState;
|
|
49
|
-
}, TActor, TLanes>;
|
|
50
|
-
/**
|
|
51
|
-
* Registers a slice with the builder.
|
|
52
|
-
*
|
|
53
|
-
* Merges all the slice's states and reactions into the application.
|
|
54
|
-
* State names, action names, and event names must be unique across the
|
|
55
|
-
* application (partial states with the same name are merged automatically).
|
|
56
|
-
*
|
|
57
|
-
* @throws {Error} If duplicate action or event names are detected
|
|
58
|
-
*/
|
|
59
|
-
withSlice: <TNewSchemaReg extends SchemaRegister<TNewActions>, TNewEvents extends Schemas, TNewActions extends Schemas, TNewMap extends Record<string, Schema>, TNewLanes extends string>(slice: Slice<TNewSchemaReg, TNewEvents, TNewActions, TNewMap, Actor, TNewLanes>) => ActBuilder<TSchemaReg & TNewSchemaReg, TEvents & TNewEvents, TActions & TNewActions, TStateMap & TNewMap, TActor, TLanes | TNewLanes>;
|
|
60
|
-
/**
|
|
61
|
-
* Locks a custom actor type for this application.
|
|
62
|
-
*
|
|
63
|
-
* This is a pure type-level method — it returns the same builder at
|
|
64
|
-
* runtime but narrows the `TActor` generic so that `app.do()` and
|
|
65
|
-
* reaction dispatchers require the richer actor shape.
|
|
66
|
-
*
|
|
67
|
-
* @template TNewActor - Custom actor type extending base Actor
|
|
68
|
-
* @returns The same builder with `TActor` locked to `TNewActor`
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* type MyActor = { id: string; name: string; role: string; tenantId: string };
|
|
73
|
-
*
|
|
74
|
-
* const app = act()
|
|
75
|
-
* .withActor<MyActor>()
|
|
76
|
-
* .withState(Counter)
|
|
77
|
-
* .build();
|
|
78
|
-
*
|
|
79
|
-
* // Now app.do() requires MyActor in the target
|
|
80
|
-
* await app.do("increment", {
|
|
81
|
-
* stream: "counter-1",
|
|
82
|
-
* actor: { id: "1", name: "Alice", role: "admin", tenantId: "t1" }
|
|
83
|
-
* }, { by: 5 });
|
|
84
|
-
* ```
|
|
85
|
-
*/
|
|
86
|
-
withActor: <TNewActor extends Actor>() => ActBuilder<TSchemaReg, TEvents, TActions, TStateMap, TNewActor, TLanes>;
|
|
87
|
-
/**
|
|
88
|
-
* Declares a drain lane. Lane name narrows `TLanes` so
|
|
89
|
-
* `.to({lane})` and `ActOptions.onlyLanes` type-check against it.
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* ```typescript
|
|
93
|
-
* const app = act()
|
|
94
|
-
* .withState(Counter)
|
|
95
|
-
* .withLane({ name: "slow", leaseMillis: 60_000, streamLimit: 5 })
|
|
96
|
-
* .on("OrderConfirmed")
|
|
97
|
-
* .do(deliverWebhook)
|
|
98
|
-
* .to({ target: "webhooks-out", lane: "slow" })
|
|
99
|
-
* .build();
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
withLane: <const TConfig extends LaneConfig>(config: TConfig) => ActBuilder<TSchemaReg, TEvents, TActions, TStateMap, TActor, TLanes | TConfig["name"]>;
|
|
103
|
-
/**
|
|
104
|
-
* Builds and returns the Act orchestrator instance.
|
|
105
|
-
*
|
|
106
|
-
* @param options - Optional runtime overrides (see {@link ActOptions}).
|
|
107
|
-
* `options.onlyLanes` is narrowed to the declared `TLanes` union, so
|
|
108
|
-
* `onlyLanes: ["typo"]` is a compile error when the lane wasn't
|
|
109
|
-
* declared via `.withLane(...)`.
|
|
110
|
-
* @returns The Act orchestrator instance
|
|
111
|
-
*
|
|
112
|
-
* @see {@link Act} for available orchestrator methods
|
|
113
|
-
*/
|
|
114
|
-
build: (options?: ActOptions<TLanes>) => Act<TSchemaReg, TEvents, TActions, TStateMap, TActor>;
|
|
115
|
-
}
|
|
1
|
+
import type { ActBuilder } from "../types/builders.js";
|
|
2
|
+
import type { Actor, Schema, SchemaRegister, Schemas } from "../types/index.js";
|
|
116
3
|
/**
|
|
117
4
|
* Creates a new Act orchestrator builder for composing event-sourced applications.
|
|
118
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"act-builder.d.ts","sourceRoot":"","sources":["../../../src/builders/act-builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"act-builder.d.ts","sourceRoot":"","sources":["../../../src/builders/act-builder.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAEV,KAAK,EAKL,MAAM,EACN,cAAc,EACd,OAAO,EAER,MAAM,mBAAmB,CAAC;AA8B3B;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,GAAG,CAEjB,UAAU,SAAS,cAAc,CAAC,QAAQ,CAAC,GAAG,EAAE,EAChD,OAAO,SAAS,OAAO,GAAG,EAAE,EAC5B,QAAQ,SAAS,OAAO,GAAG,EAAE,EAC7B,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,EAC7C,MAAM,SAAS,KAAK,GAAG,KAAK,KACzB,UAAU,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAyWhE"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
|
-
import { type DeferSchedule } from "../internal/
|
|
14
|
+
import { type DeferSchedule } from "../internal/defer-config.js";
|
|
15
15
|
import type { Committed, EventRegister, LaneConfig, ReactionHandler, ReactionOptions, ReactionResolver, Schemas } from "../types/index.js";
|
|
16
16
|
/**
|
|
17
17
|
* Validate and register a drain lane: the `"default"` name is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder-utils.d.ts","sourceRoot":"","sources":["../../../src/builders/builder-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"builder-utils.d.ts","sourceRoot":"","sources":["../../../src/builders/builder-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,UAAU,EAEV,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,OAAO,EACR,MAAM,mBAAmB,CAAC;AAI3B;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,IAAI,CAM3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACzB,OAAO,SAAS,OAAO,EACvB,IAAI,SAAS,MAAM,OAAO,EAC1B,QAAQ,EACR,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,QAAQ;IA2C5D,EAAE,YACS,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,YAC7B,OAAO,CAAC,eAAe,CAAC;qBAVrB,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,MAAM;;IAYvD,KAAK,aAAa,aAAa,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACvD,EAAE,YACS,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,YAC7B,OAAO,CAAC,eAAe,CAAC;;;;EAIzC"}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Everything `act().build()` derives from the registered events.
|
|
6
6
|
*
|
|
7
|
-
* This is the build-time half of the event lifecycle.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* composed from. Nothing here runs per event at runtime; everything here runs
|
|
7
|
+
* This is the build-time half of the event lifecycle. The other two halves
|
|
8
|
+
* are the `sensitive(...)` marker (`sensitive.ts`) and the runtime
|
|
9
|
+
* transforms (`pii_gate`, `pii_strip`, `pii_split`, in `internal/pii.ts`)
|
|
10
|
+
* that a reader is composed from. Nothing here runs per event at runtime; everything here runs
|
|
11
11
|
* once, at build, and hands the orchestrator a prebuilt function.
|
|
12
12
|
*
|
|
13
13
|
* Three things are derived, all in ONE walk over the registered events:
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* @internal
|
|
32
32
|
*/
|
|
33
33
|
import { z } from "zod";
|
|
34
|
-
import { type EventGate } from "../internal/
|
|
34
|
+
import { type EventGate } from "../internal/pii.js";
|
|
35
35
|
import type { LaneConfig, Registry } from "../types/index.js";
|
|
36
36
|
/** What one pass over an event's schema resolves. @internal */
|
|
37
37
|
export type EventTags = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-builder.d.ts","sourceRoot":"","sources":["../../../src/builders/event-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"event-builder.d.ts","sourceRoot":"","sources":["../../../src/builders/event-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,KAAK,SAAS,EAKf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAS,UAAU,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGrE,+DAA+D;AAC/D,MAAM,MAAM,SAAS,GAAG;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,SAAS,CAAC;IAChE;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,SAAS,CAAC;CACpE,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,CA2BvD;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAqD5C;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IACnD,kEAAkE;IAClE,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC/C,oEAAoE;IACpE,QAAQ,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAClD,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3C,kFAAkF;IAClF,QAAQ,CAAC,oBAAoB,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACrD,CAAC;AAOF;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACjC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,EAChC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,EAChC,MAAM,EAAE,YAAY,GACnB,WAAW,CAkHb"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { Projection } from "../types/builders.js";
|
|
1
2
|
import type { State } from "../types/index.js";
|
|
2
|
-
import type { Projection } from "./projection-builder.js";
|
|
3
3
|
/**
|
|
4
4
|
* Registers a state into a states map and action/event registries,
|
|
5
5
|
* merging with existing same-name states (partial state support).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/builders/merge.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/builders/merge.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAU,KAAK,EAAE,MAAM,mBAAmB,CAAC;AA0EvD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAC3B,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EACzC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC1B,IAAI,CAON;AAuMD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,EAC3D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,GAC1D,IAAI,CAcN;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC1B,IAAI,CA+BN;AAGD,eAAO,MAAM,MAAM,eAAgB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;IACnD,MAAM;IACN,MAAM;CACN,CAAC"}
|