@rotorsoft/act 1.13.0 → 1.14.1
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/dist/.tsbuildinfo +1 -1
- package/dist/@types/act.d.ts +37 -0
- package/dist/@types/act.d.ts.map +1 -1
- package/dist/@types/internal/autoclose-cycle.d.ts +9 -0
- package/dist/@types/internal/autoclose-cycle.d.ts.map +1 -1
- package/dist/@types/internal/circuit-breaker.d.ts +90 -0
- package/dist/@types/internal/circuit-breaker.d.ts.map +1 -0
- package/dist/@types/internal/drain-cycle.d.ts +9 -0
- package/dist/@types/internal/drain-cycle.d.ts.map +1 -1
- package/dist/@types/internal/index.d.ts +1 -0
- package/dist/@types/internal/index.d.ts.map +1 -1
- package/dist/@types/internal/settle.d.ts +10 -2
- package/dist/@types/internal/settle.d.ts.map +1 -1
- package/dist/@types/types/errors.d.ts +31 -0
- package/dist/@types/types/errors.d.ts.map +1 -1
- package/dist/{chunk-NGVWJXEF.js → chunk-4TJN4G7L.js} +13 -2
- package/dist/chunk-4TJN4G7L.js.map +1 -0
- package/dist/{chunk-QCSXT5MB.js → chunk-QKVY5QAQ.js} +2 -2
- package/dist/{chunk-5WRI5ZAA.js → chunk-YLJ4XMA6.js} +6 -2
- package/dist/{dist-INXH4GUE.js → dist-EOG547W7.js} +2 -2
- package/dist/index.cjs +169 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +159 -13
- package/dist/index.js.map +1 -1
- package/dist/{magic-string.es-ZGO77SPS.js → magic-string.es-5F2IVYTG.js} +2 -2
- package/dist/test/index.cjs +9 -4
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.js +5 -5
- package/dist/test/index.js.map +1 -1
- package/dist/types/index.cjs +13 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js +4 -2
- package/package.json +2 -2
- package/dist/chunk-NGVWJXEF.js.map +0 -1
- /package/dist/{chunk-QCSXT5MB.js.map → chunk-QKVY5QAQ.js.map} +0 -0
- /package/dist/{chunk-5WRI5ZAA.js.map → chunk-YLJ4XMA6.js.map} +0 -0
- /package/dist/{dist-INXH4GUE.js.map → dist-EOG547W7.js.map} +0 -0
- /package/dist/{magic-string.es-ZGO77SPS.js.map → magic-string.es-5F2IVYTG.js.map} +0 -0
package/dist/@types/act.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type CircuitBreakerOptions, type CircuitState } from "./internal/index.js";
|
|
2
|
+
export type { CircuitBreakerOptions, CircuitState } from "./internal/index.js";
|
|
1
3
|
import { type Scoped } from "./ports.js";
|
|
2
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, Snapshot, State, StoreNotification, StreamFilter, StreamPosition, Target } from "./types/index.js";
|
|
3
5
|
/**
|
|
@@ -81,6 +83,19 @@ export type ActLifecycleEvents<TSchemaReg extends SchemaRegister<TActions>, TEve
|
|
|
81
83
|
at: Date;
|
|
82
84
|
eventCount: number;
|
|
83
85
|
};
|
|
86
|
+
/**
|
|
87
|
+
* A store operation failed during the drain loop (ACT-984). Fires on
|
|
88
|
+
* every failed drain cycle — typically a {@link StoreError} from a
|
|
89
|
+
* degraded backend — carrying the orchestrator circuit breaker's state
|
|
90
|
+
* after the failure (`open` means the drain loop has backed off and will
|
|
91
|
+
* retry after the cooldown). Listen to alert on a degraded store; the
|
|
92
|
+
* framework logs the same error regardless. Emitted only when a listener
|
|
93
|
+
* is registered (Node's `EventEmitter` throws on an unhandled `"error"`).
|
|
94
|
+
*/
|
|
95
|
+
error: {
|
|
96
|
+
error: unknown;
|
|
97
|
+
circuit: CircuitState;
|
|
98
|
+
};
|
|
84
99
|
};
|
|
85
100
|
/**
|
|
86
101
|
* Options for {@link Act} construction (passed via {@link ActBuilder.build}).
|
|
@@ -135,6 +150,14 @@ export type ActOptions<TLanes extends string = string> = {
|
|
|
135
150
|
* lifecycle event so observability sidecars work).
|
|
136
151
|
*/
|
|
137
152
|
readonly drain?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Orchestrator circuit breaker for the drain loop (ACT-984). After
|
|
155
|
+
* `failureThreshold` consecutive store failures the breaker opens and
|
|
156
|
+
* the drain loop skips `claim()` for `cooldownMs` instead of hammering a
|
|
157
|
+
* down backend, then allows a half-open trial. Out-of-range values throw
|
|
158
|
+
* a `ZodError` at `act().build()`. Defaults: threshold 5, cooldown 30s.
|
|
159
|
+
*/
|
|
160
|
+
readonly circuitBreaker?: CircuitBreakerOptions;
|
|
138
161
|
/**
|
|
139
162
|
* Online close cycle cadence in ms (#837 / epic #802). The
|
|
140
163
|
* app-level autoclose controller ticks at this interval, iterates
|
|
@@ -180,6 +203,8 @@ export type ActOptions<TLanes extends string = string> = {
|
|
|
180
203
|
};
|
|
181
204
|
export declare class Act<TSchemaReg extends SchemaRegister<TActions>, TEvents extends Schemas, TActions extends Schemas, TStateMap extends Record<string, Schema> = Record<string, never>, TActor extends Actor = Actor> implements IAct<TEvents, TActions, TActor> {
|
|
182
205
|
private _emitter;
|
|
206
|
+
/** ACT-984: orchestrator-owned circuit breaker shared by all drain lanes. */
|
|
207
|
+
private readonly _breaker;
|
|
183
208
|
/** #803: gate the `Store.notify` subscription side. */
|
|
184
209
|
private readonly _listen;
|
|
185
210
|
/** #803: gate the local reaction pipeline (drain controllers, settle, correlate). */
|
|
@@ -231,6 +256,18 @@ export declare class Act<TSchemaReg extends SchemaRegister<TActions>, TEvents ex
|
|
|
231
256
|
* via {@link ActLifecycleEvents}.
|
|
232
257
|
*/
|
|
233
258
|
emit<E extends keyof ActLifecycleEvents<TSchemaReg, TEvents, TActions>>(event: E, args: ActLifecycleEvents<TSchemaReg, TEvents, TActions>[E]): boolean;
|
|
259
|
+
/**
|
|
260
|
+
* The single store-failure handler: log it, then emit the `error`
|
|
261
|
+
* lifecycle event. Wired into the circuit breaker's `on_error`, so it
|
|
262
|
+
* runs on every `failed()` — drain / settle / autoclose just call
|
|
263
|
+
* `breaker.failed(now, error)` and never log or emit themselves.
|
|
264
|
+
*
|
|
265
|
+
* The emit is guarded against Node's `EventEmitter` contract that an
|
|
266
|
+
* unhandled `"error"` emission is rethrown (which would crash the process
|
|
267
|
+
* from inside the drain catch); logging is unconditional so failures are
|
|
268
|
+
* never silent.
|
|
269
|
+
*/
|
|
270
|
+
private _emit_error;
|
|
234
271
|
/**
|
|
235
272
|
* Register a listener for a lifecycle event. The listener receives the
|
|
236
273
|
* event-specific payload.
|
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":"AACA,OAAO,EAWL,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EAgBlB,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAE/E,OAAO,EAAuB,KAAK,MAAM,EAAiB,MAAM,YAAY,CAAC;AAC7E,OAAO,KAAK,EACV,KAAK,EACL,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,SAAS,EACT,UAAU,EACV,SAAS,EACT,KAAK,EACL,YAAY,EACZ,SAAS,EACT,WAAW,EACX,IAAI,EACJ,UAAU,EACV,KAAK,EACL,UAAU,EAEV,KAAK,EACL,QAAQ,EACR,WAAW,EACX,UAAU,EACV,MAAM,EACN,cAAc,EACd,OAAO,EACP,aAAa,EACb,QAAQ,EACR,KAAK,EAEL,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,MAAM,EACP,M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;;;;;;;;;;;;;;;;;;OA0BG;IACG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ9D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACG,OAAO,CACX,MAAM,EAAE,WAAW,EACnB,IAAI,GAAE,WAAgB,EACtB,IAAI,CAAC,EAAE,SAAS,GACf,OAAO,CAAC,UAAU,CAAC;IAiCtB;;;;;;;;;;;;;;;;;;;;;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;IAa7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,KAAK,CACH,UAAU,CAAC,EAAE,aAAa,EAAE,EAC5B,OAAO,CAAC,EAAE,YAAY,GACrB,aAAa,CAAC,YAAY,CAAC;IAI9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACG,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAyBzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,IAAI;CAO1C"}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import type { AutocloseConfig } from "../act.js";
|
|
23
23
|
import type { Actor, CloseResult, Correlator, Logger, State } from "../types/index.js";
|
|
24
|
+
import type { CircuitBreaker } from "./circuit-breaker.js";
|
|
24
25
|
import type { EsOps } from "./event-sourcing.js";
|
|
25
26
|
/**
|
|
26
27
|
* Dependencies the autoclose cycle needs. Decoupled from `Act` so
|
|
@@ -121,6 +122,14 @@ export type AutocloseControllerDeps = Omit<AutocloseCycleDeps, "correlation"> &
|
|
|
121
122
|
* `emit("closed", result)`.
|
|
122
123
|
*/
|
|
123
124
|
readonly on_closed: (result: CloseResult) => void;
|
|
125
|
+
/**
|
|
126
|
+
* Shared orchestrator circuit breaker (ACT-984). The autoclose ticker is
|
|
127
|
+
* a periodic store poller like the drain loop, so it consults the same
|
|
128
|
+
* breaker: it skips a tick while the breaker is open and records the
|
|
129
|
+
* outcome of each tick it runs (`failed(now, err)` also surfaces the
|
|
130
|
+
* failure to the orchestrator's `error` lifecycle event).
|
|
131
|
+
*/
|
|
132
|
+
readonly breaker: CircuitBreaker;
|
|
124
133
|
};
|
|
125
134
|
/**
|
|
126
135
|
* App-level autoclose controller. Owns the ticker (`setInterval`),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoclose-cycle.d.ts","sourceRoot":"","sources":["../../../src/internal/autoclose-cycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EAEX,UAAU,EACV,MAAM,EACN,KAAK,EAEN,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"autoclose-cycle.d.ts","sourceRoot":"","sources":["../../../src/internal/autoclose-cycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EAEX,UAAU,EACV,MAAM,EACN,KAAK,EAEN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3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oE;IACpE,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAC;CACpC,CAAC;AAgBF;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,oBAAoB,CAAC,CAkF/B;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,kBAAkB,EAClB,aAAa,CACd,GAAG;IACF;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,KAAK,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAClD;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC,CAAC;AAEF;;;;;;;;;GASG;AACH,qBAAa,mBAAmB;IAC9B,SAAgB,IAAI,EAAE,uBAAuB,CAAC;IAC9C,OAAO,CAAC,MAAM,CAA6C;IAC3D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAS;gBAEb,IAAI,EAAE,uBAAuB;IAIzC;;;;OAIG;IACH,KAAK,IAAI,OAAO;IAgBhB;;OAEG;IACH,IAAI,IAAI,IAAI;IAOZ;;OAEG;IACH,IAAI,UAAU,IAAI,OAAO,CAExB;IAED;;;;;;;;;OASG;IACG,QAAQ,IAAI,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;CAsCvD"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module internal/circuit-breaker
|
|
3
|
+
*
|
|
4
|
+
* Orchestrator-level circuit breaker for store operations. The drain loop
|
|
5
|
+
* polls `claim()` continuously; when the backing store goes down every poll
|
|
6
|
+
* throws a {@link StoreError}, and without a breaker the orchestrator would
|
|
7
|
+
* spin at the cycle cadence hammering a dead database and flooding the logs.
|
|
8
|
+
*
|
|
9
|
+
* The breaker collapses that into three states:
|
|
10
|
+
*
|
|
11
|
+
* - **closed** — normal operation; failures are counted.
|
|
12
|
+
* - **open** — `failureThreshold` consecutive failures tripped it; attempts
|
|
13
|
+
* are skipped for `cooldownMs` so the store gets room to recover.
|
|
14
|
+
* - **half-open** — the cooldown elapsed; a single trial attempt is allowed.
|
|
15
|
+
* Success closes the breaker; failure re-opens it and restarts the clock.
|
|
16
|
+
*
|
|
17
|
+
* Time is passed in (`now`) rather than read from the clock so the state
|
|
18
|
+
* machine is deterministic under test.
|
|
19
|
+
*/
|
|
20
|
+
import { z } from "zod";
|
|
21
|
+
/** Circuit breaker state. */
|
|
22
|
+
export type CircuitState = "closed" | "open" | "half-open";
|
|
23
|
+
/** Resolved circuit-breaker configuration. */
|
|
24
|
+
export type CircuitBreakerConfig = {
|
|
25
|
+
/** Consecutive store failures that trip the breaker open. */
|
|
26
|
+
readonly failureThreshold: number;
|
|
27
|
+
/** Milliseconds the breaker stays open before allowing a half-open trial. */
|
|
28
|
+
readonly cooldownMs: number;
|
|
29
|
+
};
|
|
30
|
+
export declare const DEFAULT_CIRCUIT_FAILURE_THRESHOLD = 5;
|
|
31
|
+
export declare const DEFAULT_CIRCUIT_COOLDOWN_MS = 30000;
|
|
32
|
+
declare const CircuitBreakerOptionsSchema: z.ZodObject<{
|
|
33
|
+
failureThreshold: z.ZodDefault<z.ZodNumber>;
|
|
34
|
+
cooldownMs: z.ZodDefault<z.ZodNumber>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
/** Public, all-optional circuit-breaker options bag for `act().build()`. */
|
|
37
|
+
export type CircuitBreakerOptions = z.input<typeof CircuitBreakerOptionsSchema>;
|
|
38
|
+
/** Parse + apply defaults. Throws `ZodError` on out-of-range values. */
|
|
39
|
+
export declare const resolveCircuitBreakerConfig: (options?: CircuitBreakerOptions) => CircuitBreakerConfig;
|
|
40
|
+
/**
|
|
41
|
+
* Side-effect hooks the orchestrator wires into the breaker so consumers
|
|
42
|
+
* (drain / settle / autoclose) don't each thread their own callbacks.
|
|
43
|
+
*/
|
|
44
|
+
export type CircuitBreakerHooks = {
|
|
45
|
+
/** Invoked on every {@link CircuitBreaker.failed} with the error and state. */
|
|
46
|
+
readonly on_error?: (error: unknown, circuit: CircuitState) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Invoked once, `cooldownMs` after the breaker opens (and again on each
|
|
49
|
+
* re-open). The orchestrator wires it to re-attempt a drain — so recovery
|
|
50
|
+
* is automatic even on the default lane, which has no periodic poller.
|
|
51
|
+
*/
|
|
52
|
+
readonly on_retry?: () => void;
|
|
53
|
+
};
|
|
54
|
+
export declare class CircuitBreaker {
|
|
55
|
+
private _failures;
|
|
56
|
+
private _opened_at;
|
|
57
|
+
private _wake;
|
|
58
|
+
private readonly _threshold;
|
|
59
|
+
private readonly _cooldown_ms;
|
|
60
|
+
private readonly _hooks;
|
|
61
|
+
constructor(config: CircuitBreakerConfig, hooks?: CircuitBreakerHooks);
|
|
62
|
+
/** Current state given the wall-clock `now`. */
|
|
63
|
+
state(now: number): CircuitState;
|
|
64
|
+
/** A store op passed — reset to closed and cancel any pending retry. */
|
|
65
|
+
passed(): void;
|
|
66
|
+
/**
|
|
67
|
+
* A store op failed. Opens the breaker when the consecutive-failure
|
|
68
|
+
* threshold is reached, or immediately re-opens (restarting the cooldown)
|
|
69
|
+
* if a half-open trial just failed. Returns the resulting state.
|
|
70
|
+
*
|
|
71
|
+
* Callers gate on the state directly — `state(now) === "open"` means skip.
|
|
72
|
+
* On opening, schedules the `on_retry` wake so recovery is automatic;
|
|
73
|
+
* always surfaces the failure via `on_error`.
|
|
74
|
+
*/
|
|
75
|
+
failed(now: number, error?: unknown): CircuitState;
|
|
76
|
+
/** Cancel the pending retry timer. Idempotent; call on shutdown. */
|
|
77
|
+
stop(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Schedule the `on_retry` wake `cooldownMs` out so the breaker re-trials
|
|
80
|
+
* the store on its own. No-op when no `on_retry` hook is wired (e.g. unit
|
|
81
|
+
* tests of the pure state machine). The timer is `unref`'d so it never
|
|
82
|
+
* keeps the process alive.
|
|
83
|
+
*/
|
|
84
|
+
private _schedule_wake;
|
|
85
|
+
private _clear_wake;
|
|
86
|
+
/** Pure state transition for a failure — no side effects. */
|
|
87
|
+
private _advance;
|
|
88
|
+
}
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=circuit-breaker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circuit-breaker.d.ts","sourceRoot":"","sources":["../../../src/internal/circuit-breaker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6BAA6B;AAC7B,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAE3D,8CAA8C;AAC9C,MAAM,MAAM,oBAAoB,GAAG;IACjC,6DAA6D;IAC7D,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,iCAAiC,IAAI,CAAC;AACnD,eAAO,MAAM,2BAA2B,QAAS,CAAC;AAElD,QAAA,MAAM,2BAA2B;;;iBAY/B,CAAC;AAEH,4EAA4E;AAC5E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,wEAAwE;AACxE,eAAO,MAAM,2BAA2B,GACtC,UAAU,qBAAqB,KAC9B,oBAAwE,CAAC;AAE5E;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IACpE;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC,CAAC;AAEF,qBAAa,cAAc;IACzB,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,KAAK,CAA4C;IACzD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;gBAEjC,MAAM,EAAE,oBAAoB,EAAE,KAAK,GAAE,mBAAwB;IAMzE,gDAAgD;IAChD,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY;IAKhC,wEAAwE;IACxE,MAAM,IAAI,IAAI;IAMd;;;;;;;;OAQG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,YAAY;IAOlD,oEAAoE;IACpE,IAAI,IAAI,IAAI;IAIZ;;;;;OAKG;IACH,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,WAAW;IAOnB,6DAA6D;IAC7D,OAAO,CAAC,QAAQ;CAcjB"}
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
17
|
import type { BatchHandler, BlockedLease, Drain, DrainOptions, Fetch, Lease, Logger, ReactionPayload, Registry, SchemaRegister, Schemas } from "../types/index.js";
|
|
18
|
+
import type { CircuitBreaker } from "./circuit-breaker.js";
|
|
18
19
|
import type { DrainOps } from "./drain.js";
|
|
19
20
|
/**
|
|
20
21
|
* Outcome of processing a single leased stream — produced by Act's `handle`
|
|
@@ -109,6 +110,14 @@ export type DrainControllerDeps<TEvents extends Schemas, TActions extends Schema
|
|
|
109
110
|
readonly handle_batch: HandleBatch<TEvents>;
|
|
110
111
|
readonly on_acked: (acked: Lease[]) => void;
|
|
111
112
|
readonly on_blocked: (blocked: BlockedLease[]) => void;
|
|
113
|
+
/**
|
|
114
|
+
* Shared, orchestrator-owned circuit breaker (ACT-984). Trips after
|
|
115
|
+
* repeated store failures so the drain loop stops hammering a down
|
|
116
|
+
* backend; closed/half-open let attempts through. It also surfaces each
|
|
117
|
+
* failure (via its own `on_error`, wired by the orchestrator to the
|
|
118
|
+
* `error` lifecycle event), so callers just `failed(now, error)`.
|
|
119
|
+
*/
|
|
120
|
+
readonly breaker: CircuitBreaker;
|
|
112
121
|
/** Lane this controller drains. Undefined = spans all lanes (legacy single-controller). */
|
|
113
122
|
readonly lane?: string;
|
|
114
123
|
/** Per-lane defaults applied when caller doesn't override via DrainOptions. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drain-cycle.d.ts","sourceRoot":"","sources":["../../../src/internal/drain-cycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,KAAK,EACL,KAAK,EACL,MAAM,EACN,eAAe,EACf,QAAQ,EACR,cAAc,EACd,OAAO,EACR,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,MAAM,CAAC,OAAO,SAAS,OAAO,IAAI,CAC5C,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,KACj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,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;CA2FjE"}
|
|
@@ -22,6 +22,7 @@ export { AutocloseController, type AutocloseControllerDeps, type AutocloseCycleD
|
|
|
22
22
|
export { type AutoclosePolicy, compile_autoclose_policy, } from "./autoclose-policy.js";
|
|
23
23
|
export type { EventLaneSet } from "./build-classify.js";
|
|
24
24
|
export { ALL_LANES, classify_registry } from "./build-classify.js";
|
|
25
|
+
export { CircuitBreaker, type CircuitBreakerConfig, type CircuitBreakerOptions, type CircuitState, resolveCircuitBreakerConfig, } from "./circuit-breaker.js";
|
|
25
26
|
export { run_close_cycle } from "./close-cycle.js";
|
|
26
27
|
export { CorrelateCycle } from "./correlate-cycle.js";
|
|
27
28
|
export { close_correlation, default_correlator } from "./correlator.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/internal/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EACL,KAAK,eAAe,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,eAAe,EACpB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAA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
|
*/
|
|
15
|
-
import type { Drain, DrainOptions,
|
|
15
|
+
import type { Drain, DrainOptions, Query, Schemas, SettleOptions } from "../types/index.js";
|
|
16
|
+
import type { CircuitBreaker } from "./circuit-breaker.js";
|
|
16
17
|
/**
|
|
17
18
|
* Callbacks the settle loop needs from the orchestrator. Modeled as an
|
|
18
19
|
* input bag so this file doesn't import `Act` (avoids a cycle) and stays
|
|
@@ -21,7 +22,6 @@ import type { Drain, DrainOptions, Logger, Query, Schemas, SettleOptions } from
|
|
|
21
22
|
* @internal
|
|
22
23
|
*/
|
|
23
24
|
export type SettleDeps<TEvents extends Schemas> = {
|
|
24
|
-
readonly logger: Logger;
|
|
25
25
|
readonly init: () => Promise<void>;
|
|
26
26
|
readonly checkpoint: () => number;
|
|
27
27
|
readonly correlate: (query: Query) => Promise<{
|
|
@@ -30,6 +30,14 @@ export type SettleDeps<TEvents extends Schemas> = {
|
|
|
30
30
|
}>;
|
|
31
31
|
readonly drain: (options: DrainOptions) => Promise<Drain<TEvents>>;
|
|
32
32
|
readonly on_settled: (drain: Drain<TEvents>) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Shared orchestrator circuit breaker (ACT-984). The settle loop's
|
|
35
|
+
* `correlate` (subscribe + query) is a store consumer too: a successful
|
|
36
|
+
* pass records `passed()`, a failed one `failed(now, err)` — feeding the
|
|
37
|
+
* same breaker that paces the drain loop, which also surfaces the failure
|
|
38
|
+
* to the `error` lifecycle event.
|
|
39
|
+
*/
|
|
40
|
+
readonly breaker: CircuitBreaker;
|
|
33
41
|
};
|
|
34
42
|
/**
|
|
35
43
|
* Drives the debounced correlate→drain catch-up cycle. One instance per
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settle.d.ts","sourceRoot":"","sources":["../../../src/internal/settle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"settle.d.ts","s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,IAAI,IAAI,IAAI;CAMb"}
|
|
@@ -15,6 +15,7 @@ export declare const Errors: {
|
|
|
15
15
|
readonly ConcurrencyError: "ERR_CONCURRENCY";
|
|
16
16
|
readonly StreamClosedError: "ERR_STREAM_CLOSED";
|
|
17
17
|
readonly NonRetryableError: "ERR_NON_RETRYABLE";
|
|
18
|
+
readonly StoreError: "ERR_STORE";
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
20
21
|
* Thrown when an action or event payload fails Zod schema validation.
|
|
@@ -256,6 +257,36 @@ export declare class StreamClosedError extends Error {
|
|
|
256
257
|
readonly stream: string;
|
|
257
258
|
constructor(stream: string);
|
|
258
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* Thrown by a {@link Store} adapter when an infrastructure operation fails
|
|
262
|
+
* for a reason that is *not* a domain condition — a dropped connection, a
|
|
263
|
+
* transaction rollback, a query timeout. It is the typed boundary between
|
|
264
|
+
* "the store is unavailable/degraded" and the domain errors above
|
|
265
|
+
* ({@link ConcurrencyError}, {@link StreamClosedError}), which describe
|
|
266
|
+
* legitimate outcomes the caller should branch on.
|
|
267
|
+
*
|
|
268
|
+
* Adapters wrap their driver errors in `StoreError` (preserving the
|
|
269
|
+
* original via `cause`) so the orchestrator can distinguish a degraded
|
|
270
|
+
* backend from "no work" and react accordingly — see the drain circuit
|
|
271
|
+
* breaker, which trips on repeated `StoreError`s and surfaces a
|
|
272
|
+
* `drain_error` lifecycle event instead of silently spinning on a down
|
|
273
|
+
* database.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```typescript
|
|
277
|
+
* app.on("drain_error", ({ error, circuit }) => {
|
|
278
|
+
* if (error instanceof StoreError)
|
|
279
|
+
* alert(`store ${error.operation} failing; circuit=${circuit}`);
|
|
280
|
+
* });
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
export declare class StoreError extends Error {
|
|
284
|
+
/** The store operation that failed (e.g. `"claim"`, `"ack"`, `"commit"`). */
|
|
285
|
+
readonly operation: string;
|
|
286
|
+
constructor(operation: string, options?: {
|
|
287
|
+
cause?: unknown;
|
|
288
|
+
});
|
|
289
|
+
}
|
|
259
290
|
/**
|
|
260
291
|
* Thrown by a reaction handler to signal that the failure is permanent
|
|
261
292
|
* and the drain pipeline should block the stream immediately, without
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/types/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACP,MAAM,aAAa,CAAC;AAErB;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/types/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,OAAO,EACP,MAAM,EACN,OAAO,EACP,QAAQ,EACR,MAAM,EACP,MAAM,aAAa,CAAC;AAErB;;;;;;;;;GASG;AACH,eAAO,MAAM,MAAM;;;;;;;CAOT,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,mEAAmE;IACnE,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,iDAAiD;IACjD,SAAgB,OAAO,EAAE,GAAG,CAAC;IAC7B,mCAAmC;IACnC,SAAgB,OAAO,EAAE,GAAG,CAAC;gBAEjB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;CAOvD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AACH,qBAAa,cAAc,CACzB,MAAM,SAAS,MAAM,EACrB,OAAO,SAAS,OAAO,EACvB,QAAQ,SAAS,OAAO,EACxB,IAAI,SAAS,MAAM,QAAQ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,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,gCAAgC;IAChC,SAAgB,MAAM,EAAE,MAAM,CAAC;gBAEnB,MAAM,EAAE,MAAM;CAK3B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACnC,6EAA6E;IAC7E,SAAgB,SAAS,EAAE,MAAM,CAAC;gBAEtB,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAK7D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,8EAA8E;IAC9E,SAAyB,KAAK,CAAC,EAAE,OAAO,CAAC;gBAE7B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAK3D"}
|
|
@@ -4,7 +4,8 @@ var Errors = {
|
|
|
4
4
|
InvariantError: "ERR_INVARIANT",
|
|
5
5
|
ConcurrencyError: "ERR_CONCURRENCY",
|
|
6
6
|
StreamClosedError: "ERR_STREAM_CLOSED",
|
|
7
|
-
NonRetryableError: "ERR_NON_RETRYABLE"
|
|
7
|
+
NonRetryableError: "ERR_NON_RETRYABLE",
|
|
8
|
+
StoreError: "ERR_STORE"
|
|
8
9
|
};
|
|
9
10
|
var ValidationError = class extends Error {
|
|
10
11
|
/** The type of target being validated (e.g., "action", "event") */
|
|
@@ -73,6 +74,15 @@ var StreamClosedError = class extends Error {
|
|
|
73
74
|
this.stream = stream;
|
|
74
75
|
}
|
|
75
76
|
};
|
|
77
|
+
var StoreError = class extends Error {
|
|
78
|
+
/** The store operation that failed (e.g. `"claim"`, `"ack"`, `"commit"`). */
|
|
79
|
+
operation;
|
|
80
|
+
constructor(operation, options) {
|
|
81
|
+
super(`Store operation "${operation}" failed`, options);
|
|
82
|
+
this.name = Errors.StoreError;
|
|
83
|
+
this.operation = operation;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
76
86
|
var NonRetryableError = class extends Error {
|
|
77
87
|
/** The original failure, if any. Mirrors the standard `Error.cause` shape. */
|
|
78
88
|
cause;
|
|
@@ -231,6 +241,7 @@ export {
|
|
|
231
241
|
InvariantError,
|
|
232
242
|
ConcurrencyError,
|
|
233
243
|
StreamClosedError,
|
|
244
|
+
StoreError,
|
|
234
245
|
NonRetryableError,
|
|
235
246
|
REDACTED,
|
|
236
247
|
SHREDDED,
|
|
@@ -249,4 +260,4 @@ export {
|
|
|
249
260
|
Environments,
|
|
250
261
|
LogLevels
|
|
251
262
|
};
|
|
252
|
-
//# sourceMappingURL=chunk-
|
|
263
|
+
//# sourceMappingURL=chunk-4TJN4G7L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types/errors.ts","../src/types/schemas.ts","../src/internal/sensitive.ts","../src/types/index.ts"],"sourcesContent":["import type {\n Actor,\n Message,\n Schema,\n Schemas,\n Snapshot,\n Target,\n} from \"./action.js\";\n\n/**\n * @packageDocumentation\n * @module act/types\n * @category Types\n * Application error type constants and error classes for the Act Framework.\n *\n * - `ERR_VALIDATION`: Schema validation error\n * - `ERR_INVARIANT`: Invariant validation error\n * - `ERR_CONCURRENCY`: Optimistic concurrency validation error on commits\n */\nexport const Errors = {\n ValidationError: \"ERR_VALIDATION\",\n InvariantError: \"ERR_INVARIANT\",\n ConcurrencyError: \"ERR_CONCURRENCY\",\n StreamClosedError: \"ERR_STREAM_CLOSED\",\n NonRetryableError: \"ERR_NON_RETRYABLE\",\n StoreError: \"ERR_STORE\",\n} as const;\n\n/**\n * Thrown when an action or event payload fails Zod schema validation.\n *\n * This error indicates that data doesn't match the expected schema defined\n * for an action or event. The `details` property contains the Zod validation\n * error with specific information about what failed.\n *\n * @example Catching validation errors\n * ```typescript\n * import { ValidationError } from \"@rotorsoft/act\";\n *\n * try {\n * await app.do(\"createUser\", target, {\n * email: \"invalid-email\", // Missing @ symbol\n * age: -5 // Negative age\n * });\n * } catch (error) {\n * if (error instanceof ValidationError) {\n * console.error(\"Validation failed for:\", error.target);\n * console.error(\"Invalid payload:\", error.payload);\n * console.error(\"Validation details:\", error.details);\n * // details contains Zod error with field-level info\n * }\n * }\n * ```\n *\n * @example Logging validation details\n * ```typescript\n * try {\n * await app.do(\"updateProfile\", target, payload);\n * } catch (error) {\n * if (error instanceof ValidationError) {\n * error.details.errors.forEach((err) => {\n * console.error(`Field ${err.path.join(\".\")}: ${err.message}`);\n * });\n * }\n * }\n * ```\n *\n * @see {@link https://zod.dev | Zod documentation} for validation details\n */\nexport class ValidationError extends Error {\n /** The type of target being validated (e.g., \"action\", \"event\") */\n public readonly target: string;\n /** The invalid payload that failed validation */\n public readonly payload: any;\n /** Zod validation error details */\n public readonly details: any;\n\n constructor(target: string, payload: any, details: any) {\n super(`Invalid ${target} payload`);\n this.name = Errors.ValidationError;\n this.target = target;\n this.payload = payload;\n this.details = details;\n }\n}\n\n/**\n * Thrown when a business rule (invariant) is violated during action execution.\n *\n * Invariants are conditions that must hold true for an action to succeed.\n * They're checked after loading the current state but before emitting events.\n * This error provides complete context about what action was attempted and\n * why it was rejected.\n *\n * @template TState - State schema type\n * @template TEvents - Event schemas type\n * @template TActions - Action schemas type\n * @template TKey - Action name\n * @template TActor - Actor type extending base Actor\n *\n * @example Catching invariant violations\n * ```typescript\n * import { InvariantError } from \"@rotorsoft/act\";\n *\n * try {\n * await app.do(\"withdraw\",\n * { stream: \"account-123\", actor: { id: \"user1\", name: \"Alice\" } },\n * { amount: 1000 }\n * );\n * } catch (error) {\n * if (error instanceof InvariantError) {\n * console.error(\"Action:\", error.action);\n * console.error(\"Reason:\", error.description);\n * console.error(\"Current state:\", error.snapshot.state);\n * console.error(\"Attempted payload:\", error.payload);\n * }\n * }\n * ```\n *\n * @example User-friendly error messages\n * ```typescript\n * try {\n * await app.do(\"closeTicket\", target, payload);\n * } catch (error) {\n * if (error instanceof InvariantError) {\n * // Present friendly message to user\n * if (error.description === \"Ticket must be open\") {\n * return { error: \"This ticket is already closed\" };\n * } else if (error.description === \"Not authorized\") {\n * return { error: \"You don't have permission to close this ticket\" };\n * }\n * }\n * }\n * ```\n *\n * @example Logging with context\n * ```typescript\n * try {\n * await app.do(\"transfer\", target, { to: \"account2\", amount: 500 });\n * } catch (error) {\n * if (error instanceof InvariantError) {\n * logger.error({\n * action: error.action,\n * stream: error.target.stream,\n * actor: error.target.actor,\n * reason: error.description,\n * balance: error.snapshot.state.balance,\n * attempted: error.payload.amount\n * }, \"Invariant violation\");\n * }\n * }\n * ```\n *\n * @see {@link Invariant} for defining business rules\n */\nexport class InvariantError<\n TState extends Schema,\n TEvents extends Schemas,\n TActions extends Schemas,\n TKey extends keyof TActions,\n TActor extends Actor = Actor,\n> extends Error {\n /** The action that was attempted */\n readonly action: TKey;\n /** The action payload that was provided */\n readonly payload: Readonly<TActions[TKey]>;\n /** The target stream and actor context */\n readonly target: Target<TActor>;\n /** The current state snapshot when invariant was checked */\n readonly snapshot: Snapshot<TState, TEvents>;\n /** Human-readable description of why the invariant failed */\n readonly description: string;\n\n constructor(\n action: TKey,\n payload: Readonly<TActions[TKey]>,\n target: Target<TActor>,\n snapshot: Snapshot<TState, TEvents>,\n description: string\n ) {\n super(`${action as string} failed invariant: ${description}`);\n this.name = Errors.InvariantError;\n this.action = action;\n this.payload = payload;\n this.target = target;\n this.snapshot = snapshot;\n this.description = description;\n }\n}\n\n/**\n * Thrown when optimistic concurrency control detects a conflict.\n *\n * This error occurs when trying to commit events to a stream that has been\n * modified by another process since it was last loaded. The version number\n * doesn't match expectations, indicating a concurrent modification.\n *\n * This is a normal occurrence in distributed systems and should be handled\n * by reloading the current state and retrying the action.\n *\n * @example Handling concurrency conflicts with retry\n * ```typescript\n * import { ConcurrencyError } from \"@rotorsoft/act\";\n *\n * async function transferWithRetry(from, to, amount, maxRetries = 3) {\n * for (let attempt = 0; attempt < maxRetries; attempt++) {\n * try {\n * await app.do(\"transfer\",\n * { stream: from, actor: currentUser },\n * { to, amount }\n * );\n * return { success: true };\n * } catch (error) {\n * if (error instanceof ConcurrencyError) {\n * if (attempt < maxRetries - 1) {\n * console.log(`Concurrent modification detected, retrying... (${attempt + 1}/${maxRetries})`);\n * await sleep(100 * Math.pow(2, attempt)); // Exponential backoff\n * continue;\n * }\n * }\n * throw error;\n * }\n * }\n * return { success: false, reason: \"Too many concurrent modifications\" };\n * }\n * ```\n *\n * @example Logging concurrency conflicts\n * ```typescript\n * try {\n * await app.do(\"updateInventory\", target, payload);\n * } catch (error) {\n * if (error instanceof ConcurrencyError) {\n * logger.warn({\n * stream: error.stream,\n * expectedVersion: error.expectedVersion,\n * actualVersion: error.lastVersion,\n * events: error.events.map(e => e.name)\n * }, \"Concurrent modification detected\");\n * }\n * }\n * ```\n *\n * @example User feedback for conflicts\n * ```typescript\n * try {\n * await app.do(\"editDocument\", target, { content: newContent });\n * } catch (error) {\n * if (error instanceof ConcurrencyError) {\n * return {\n * error: \"This document was modified by another user. Please refresh and try again.\",\n * code: \"CONCURRENT_MODIFICATION\"\n * };\n * }\n * }\n * ```\n *\n * @see {@link Store.commit} for version checking details\n */\nexport class ConcurrencyError extends Error {\n /** The stream that had the concurrent modification */\n public readonly stream: string;\n /** The actual current version in the store */\n public readonly lastVersion: number;\n /** The events that were being committed */\n public readonly events: Message<Schemas, keyof Schemas>[];\n /** The version number that was expected */\n public readonly expectedVersion: number;\n\n constructor(\n stream: string,\n lastVersion: number,\n events: Message<Schemas, keyof Schemas>[],\n expectedVersion: number\n ) {\n // Message lists stream + event names only. Payloads remain accessible\n // via `error.events` for callers who need them — keeping them out of\n // the message avoids MB-scale strings on contended writes and keeps\n // potentially-sensitive data out of log streams.\n super(\n `Concurrency error committing \"${events\n .map((e) => `${stream}.${e.name}`)\n .join(\n \", \"\n )}\". Expected version ${expectedVersion} but found version ${lastVersion}.`\n );\n this.name = Errors.ConcurrencyError;\n this.stream = stream;\n this.lastVersion = lastVersion;\n this.events = events;\n this.expectedVersion = expectedVersion;\n }\n}\n\n/**\n * Thrown when attempting to write to a stream that has been closed\n * with a tombstone event.\n *\n * A tombstoned stream is permanently closed — no further actions can\n * be executed against it. The only way to reopen a tombstoned stream\n * is through `Act.close()` with a `restart` callback.\n *\n * @example\n * ```typescript\n * import { StreamClosedError } from \"@rotorsoft/act\";\n *\n * try {\n * await app.do(\"updateTicket\", target, payload);\n * } catch (error) {\n * if (error instanceof StreamClosedError) {\n * console.error(`Stream ${error.stream} is closed`);\n * }\n * }\n * ```\n *\n * @see {@link Act.close} for closing streams\n */\nexport class StreamClosedError extends Error {\n /** The stream that is closed */\n public readonly stream: string;\n\n constructor(stream: string) {\n super(`Stream \"${stream}\" is closed (tombstoned)`);\n this.name = Errors.StreamClosedError;\n this.stream = stream;\n }\n}\n\n/**\n * Thrown by a {@link Store} adapter when an infrastructure operation fails\n * for a reason that is *not* a domain condition — a dropped connection, a\n * transaction rollback, a query timeout. It is the typed boundary between\n * \"the store is unavailable/degraded\" and the domain errors above\n * ({@link ConcurrencyError}, {@link StreamClosedError}), which describe\n * legitimate outcomes the caller should branch on.\n *\n * Adapters wrap their driver errors in `StoreError` (preserving the\n * original via `cause`) so the orchestrator can distinguish a degraded\n * backend from \"no work\" and react accordingly — see the drain circuit\n * breaker, which trips on repeated `StoreError`s and surfaces a\n * `drain_error` lifecycle event instead of silently spinning on a down\n * database.\n *\n * @example\n * ```typescript\n * app.on(\"drain_error\", ({ error, circuit }) => {\n * if (error instanceof StoreError)\n * alert(`store ${error.operation} failing; circuit=${circuit}`);\n * });\n * ```\n */\nexport class StoreError extends Error {\n /** The store operation that failed (e.g. `\"claim\"`, `\"ack\"`, `\"commit\"`). */\n public readonly operation: string;\n\n constructor(operation: string, options?: { cause?: unknown }) {\n super(`Store operation \"${operation}\" failed`, options);\n this.name = Errors.StoreError;\n this.operation = operation;\n }\n}\n\n/**\n * Thrown by a reaction handler to signal that the failure is permanent\n * and the drain pipeline should block the stream immediately, without\n * consuming the rest of the `maxRetries` budget.\n *\n * The drain finalizer detects `instanceof NonRetryableError` and forces\n * `block = options.blockOnError` regardless of `lease.retry`. When\n * `blockOnError` is `false`, behavior is unchanged (drain keeps retrying\n * forever) — the class never overrides the operator's explicit \"never\n * block\" choice.\n *\n * Use this for failures the handler *knows* won't get better on retry:\n * a 4xx from a webhook, a `ZodError` on malformed input, a \"user\n * deleted\" 404 from a downstream API. Use regular `Error` (or a\n * subclass) for transient failures so the existing retry-with-backoff\n * loop applies.\n *\n * @example Wrapping a permanent downstream error\n * ```typescript\n * import { NonRetryableError } from \"@rotorsoft/act\";\n *\n * .on(\"OrderConfirmed\")\n * .do(async (event) => {\n * const res = await fetch(url, ...);\n * if (res.status >= 400 && res.status < 500) {\n * throw new NonRetryableError(\n * `webhook ${url} responded ${res.status}`,\n * { cause: await res.text() }\n * );\n * }\n * if (!res.ok) throw new Error(`webhook ${url} responded ${res.status}`);\n * })\n * ```\n *\n * @example Marking validation failures as non-retryable\n * ```typescript\n * .on(\"PaymentReceived\")\n * .do(async (event) => {\n * const parsed = Schema.safeParse(event.data);\n * if (!parsed.success) {\n * throw new NonRetryableError(\"payment payload failed validation\", {\n * cause: parsed.error,\n * });\n * }\n * // ... handle parsed payload\n * })\n * ```\n */\nexport class NonRetryableError extends Error {\n /** The original failure, if any. Mirrors the standard `Error.cause` shape. */\n public override readonly cause?: unknown;\n\n constructor(message: string, options?: { cause?: unknown }) {\n super(message);\n this.name = Errors.NonRetryableError;\n this.cause = options?.cause;\n }\n}\n","import { type ZodObject, type ZodRawShape, z } from \"zod\";\n// Deep-path import (vs `../internal/index.js`) is deliberate — `_registry` is\n// a side-effect-free leaf, and going through the internal barrel would pull\n// tracing.ts → config.ts in at type-schema load time and crash on TDZ when a\n// test imports a public schema before config is initialized.\nimport { _registry } from \"../internal/sensitive.js\";\n\n/**\n * @packageDocumentation\n * @module act/types\n * @category Types\n * Zod schemas and helpers for the Act Framework.\n */\n\n/**\n * An empty Zod schema (no properties).\n */\nexport const ZodEmpty = z.record(z.string(), z.never());\n\n/**\n * Sentinel placed in `event.data[field]` when the caller isn't authorized to\n * see the sensitive field — either `.discloses(predicate)` returned `false`,\n * or no predicate was declared (framework default-deny). Recoverable: a\n * properly-authorized read returns the plaintext.\n *\n * Part of the sensitive-data foundation (#855 / epic #566).\n */\nexport { REDACTED, SHREDDED } from \"../internal/sensitive.js\";\n\n/**\n * Mark a Zod schema as sensitive. Returns the same schema instance — the\n * marker is registered out-of-band so the static type is preserved and the\n * call site reads as a pure annotation.\n *\n * Idempotent: re-wrapping an already-sensitive schema is a no-op.\n *\n * The marker is what the orchestrator inspects to split event payloads into\n * `data` + `pii` on commit, gate reads via `.discloses`, and strip handler\n * payloads. Part of the sensitive-data foundation (#855 / epic #566).\n *\n * @example\n * ```ts\n * import { z } from \"zod\";\n * import { state, sensitive } from \"@rotorsoft/act\";\n *\n * const UserRegistered = z.object({\n * email: sensitive(z.string()),\n * name: sensitive(z.string()),\n * plan: z.enum([\"free\", \"pro\"]), // not sensitive — stays in events.data\n * });\n * ```\n *\n * @param schema - The Zod schema to mark sensitive.\n * @returns The same schema instance, unmodified at the type level.\n */\nexport function sensitive<T extends z.ZodType>(schema: T): T {\n _registry.add(schema, { sensitive: true });\n return schema;\n}\n\n/**\n * Zod schema for an actor (user, system, etc.).\n */\nexport const ActorSchema = z\n .object({\n id: z.string(),\n name: z.string(),\n })\n .loose()\n .readonly();\n\n/**\n * Zod schema for a target (stream and actor info).\n */\nexport const TargetSchema = z\n .object({\n stream: z.string(),\n actor: ActorSchema,\n expectedVersion: z.number().optional(),\n })\n .loose()\n .readonly();\n\n/**\n * Zod schema for causation event metadata.\n */\nexport const CausationEventSchema = z.object({\n id: z.number(),\n name: z.string(),\n stream: z.string(),\n});\n\n/**\n * Zod schema for event metadata (correlation and causation).\n */\nexport const EventMetaSchema = z\n .object({\n correlation: z.string(),\n causation: z.object({\n action: TargetSchema.and(z.object({ name: z.string() })).optional(),\n event: CausationEventSchema.optional(),\n }),\n })\n .readonly();\n\n/**\n * Zod schema for committed event metadata (id, stream, version, created, meta).\n */\nexport const CommittedMetaSchema = z\n .object({\n id: z.number(),\n stream: z.string(),\n version: z.number(),\n created: z.date(),\n meta: EventMetaSchema,\n })\n .readonly();\n\n/**\n * Type representing the full state schema for a domain.\n * @property events - Map of event names to Zod schemas.\n * @property actions - Map of action names to Zod schemas.\n * @property state - Zod schema for the state object.\n */\nexport type StateSchema = Readonly<{\n events: Record<string, ZodObject<ZodRawShape> | typeof ZodEmpty>;\n actions: Record<string, ZodObject<ZodRawShape> | typeof ZodEmpty>;\n state: ZodObject<ZodRawShape>;\n}>;\n\n/**\n * Query options for event store queries.\n */\nexport const QuerySchema = z\n .object({\n stream: z.string().optional(),\n names: z.string().array().optional(),\n before: z.number().optional(),\n after: z.number().optional(),\n limit: z.number().optional(),\n created_before: z.date().optional(),\n created_after: z.date().optional(),\n backward: z.boolean().optional(),\n correlation: z.string().optional(),\n with_snaps: z.boolean().optional(),\n stream_exact: z.boolean().optional(),\n })\n .readonly();\n","/**\n * @module sensitive\n * @category Internal\n *\n * Internal mechanics for the sensitive-data foundation (#855 / epic #566).\n * The public surface (`sensitive(zodType)`) lives at `libs/act/src/sensitive.ts`\n * and re-exports `REDACTED` / `SHREDDED` from here; this module holds the\n * registry plus the helpers the orchestrator calls during commit, load, and\n * handler dispatch.\n *\n * - `_registry` — process-global `z.registry<{ sensitive: true }>()`. Public\n * `sensitive()` adds to it; the helpers in this module read it.\n * - `pii_fields(schema)` — walk a Zod schema's top-level shape, return the\n * keys marked via `sensitive(...)`.\n * - `pii_merge(event, fields)` — produce the reducer view (pii merged\n * into data; `[SHREDDED]` if pii column is null).\n * - `pii_gate(event, fields, predicate, actor)` — produce the external\n * view: plaintext when authorized, `[REDACTED]` when not, `[SHREDDED]`\n * when the underlying pii column is null.\n * - `pii_strip(event, fields)` — remove sensitive keys entirely\n * before invoking projection / reaction handlers.\n *\n * @internal\n */\n\nimport { z } from \"zod\";\nimport type { Actor, Committed, Schemas } from \"../types/index.js\";\n\n/**\n * Sentinel placed in `event.data[field]` when the caller isn't authorized to\n * see the sensitive field — either `.discloses(predicate)` returned `false`,\n * or no predicate was declared (framework default-deny). Recoverable: a\n * properly-authorized read returns the plaintext.\n *\n * Re-exported from `libs/act/src/sensitive.ts` as part of the public surface.\n */\nexport const REDACTED = \"[REDACTED]\" as const;\n\n/**\n * Sentinel placed in `event.data[field]` when the underlying PII payload has\n * been wiped via `Store.forget_pii(stream)` — the row's pii column is `NULL`\n * and the original plaintext is gone forever. Irrecoverable.\n *\n * Re-exported from `libs/act/src/sensitive.ts` as part of the public surface.\n */\nexport const SHREDDED = \"[SHREDDED]\" as const;\n\n/**\n * Process-global registry holding every Zod schema marked sensitive. Backed\n * by a `WeakMap`, so wrapper-created instances (`.optional()`, `.nullable()`,\n * `.default()`) that chain off a marked schema produce *new* schema instances\n * the registry doesn't track; the field walker handles those via unwrap.\n *\n * Exported so the public `sensitive(zodType)` wrapper can call `_registry.add`.\n * Underscore prefix marks \"framework-private, don't touch from user code.\"\n *\n * @internal\n */\nexport const _registry = z.registry<{ sensitive: true }>();\n\n/**\n * True when the given schema was marked via `sensitive(...)`.\n *\n * Walks through Zod wrapper layers (`.optional()`, `.nullable()`,\n * `.default()`, `.readonly()`) by following `_def.innerType` until it reaches\n * a non-wrapper schema, then checks the registry. Wrappers create new schema\n * instances; the marker lives on the *inner* schema the user wrapped, so we\n * test that one.\n *\n * @internal\n */\nfunction is_pii(schema: z.ZodType): boolean {\n let cur: z.ZodType = schema;\n while (true) {\n if (_registry.has(cur)) return true;\n const inner = (cur as { _def?: { innerType?: z.ZodType } })._def?.innerType;\n if (!inner || inner === cur) return false;\n cur = inner;\n }\n}\n\n/**\n * Derive the list of sensitive field names from an event's Zod schema.\n *\n * Walks the top-level shape of a `z.object({...})` and returns the keys whose\n * schema (after unwrapping optional/nullable/default wrappers) was marked via\n * `sensitive(...)`. Returns an empty array for non-object schemas or events\n * with no sensitive fields — the common-case zero-cost path.\n *\n * Only the top-level shape is walked. Sensitive fields nested inside a\n * `z.object` declared inside the event payload would require recursive\n * descent; that's deferred until a real callsite needs it.\n *\n * @internal — consumed by the registry's `sensitive_fields(event_name)` lookup.\n */\nexport function pii_fields(schema: z.ZodType): readonly string[] {\n const shape = (schema as { shape?: Record<string, z.ZodType> }).shape;\n if (!shape || typeof shape !== \"object\") return [];\n const fields: string[] = [];\n for (const key of Object.keys(shape)) {\n if (is_pii(shape[key])) fields.push(key);\n }\n return fields;\n}\n\n/**\n * Split an emitted event's `data` into `data` (non-sensitive) + `pii`\n * (sensitive) using the field list precomputed at build time. Used by the\n * State's `_pii_split` decorator just before `Store.commit`.\n *\n * Single forward pass over `Object.keys(validated)` — same shape as the\n * spread-and-delete-free implementation in slice 3, just hoisted out of the\n * orchestrator hot path so it's only invoked when the State actually has a\n * sensitive event.\n *\n * @internal\n */\nexport function pii_split<TName, TData extends Record<string, unknown>>(\n emitted: { name: TName; data: TData },\n fields: readonly string[]\n): { name: TName; data: TData; pii: Record<string, unknown> } {\n const data = { ...emitted.data };\n const pii: Record<string, unknown> = {};\n for (const f of fields) {\n if (f in data) {\n pii[f] = data[f];\n delete data[f];\n }\n }\n return { name: emitted.name, data, pii };\n}\n\n/**\n * Build the **external view** of a committed event — the form returned by\n * `load()`, `query()`, `query_array()`, and the snapshot in `do()`'s reply.\n *\n * - Event with no schema-declared sensitive fields → returned unchanged\n * (zero-cost path).\n * - Event whose `pii` payload is null/undefined AND schema declares sensitive\n * fields → substitute {@link SHREDDED} for each declared field. Irrecoverable,\n * so no predicate check.\n * - Event with a `pii` payload, predicate returns `true` → merge `pii` into\n * `data` (plaintext).\n * - Event with a `pii` payload, predicate returns `false` OR no predicate\n * declared (framework default-deny) → substitute {@link REDACTED} for each\n * declared field.\n *\n * @internal\n */\nexport function pii_gate<TEvents extends Schemas, TKey extends keyof TEvents>(\n event: Committed<TEvents, TKey>,\n fields: readonly string[],\n predicate: ((event: any, actor: Actor) => boolean) | null,\n actor: Actor | undefined\n): Committed<TEvents, TKey> {\n if (fields.length === 0) return event;\n const data = event.data as Record<string, unknown>;\n if (event.pii == null) {\n const shredded: Record<string, unknown> = { ...data };\n for (const f of fields) shredded[f] = SHREDDED;\n return {\n ...event,\n data: shredded as Committed<TEvents, TKey>[\"data\"],\n };\n }\n // Plaintext path requires both an actor AND a predicate that allows. Missing\n // either → default-deny → REDACTED.\n const allowed = !!actor && !!predicate && predicate(event, actor);\n if (allowed) {\n return {\n ...event,\n data: {\n ...data,\n ...(event.pii as Record<string, unknown>),\n } as Committed<TEvents, TKey>[\"data\"],\n };\n }\n const redacted: Record<string, unknown> = { ...data };\n for (const f of fields) redacted[f] = REDACTED;\n return {\n ...event,\n data: redacted as Committed<TEvents, TKey>[\"data\"],\n };\n}\n\n/**\n * Build the **handler view** — sensitive keys removed entirely from `data`\n * and the `pii` field dropped from the event. Used before invoking projection\n * handlers and reaction handlers, which never see PII by framework rule.\n *\n * Different from {@link pii_gate} (which substitutes {@link REDACTED} or\n * {@link SHREDDED}) — projection tables and reaction sinks shouldn't even\n * structurally observe the keys, so a handler that mistakenly writes\n * `event.data.email` into a column would get `undefined`, not a sentinel\n * string that looks like real data. The strictness is deliberate.\n *\n * Reactions that genuinely need PII (e.g. a welcome-email reaction reading\n * `email`) opt back in by explicitly calling `app.load(stream, { actor:\n * system_actor })` inside the handler — pulling PII through the gate at the\n * call site makes the security-relevant path visible in code review.\n *\n * @internal\n */\nexport function pii_strip<\n TEvents extends Schemas,\n TKey extends keyof TEvents & string,\n>(\n event: Committed<TEvents, TKey>,\n fields: readonly string[]\n): Committed<TEvents, TKey> {\n // Contract: `fields` is non-empty. `build_handle` / `build_handle_batch`\n // filter on `fields.length > 0` before invocation.\n const data = event.data as Record<string, unknown>;\n const stripped: Record<string, unknown> = {};\n for (const k of Object.keys(data)) {\n if (!fields.includes(k)) stripped[k] = data[k];\n }\n const { pii: _drop_pii, ...rest } = event as Committed<TEvents, TKey> & {\n pii?: unknown;\n };\n return {\n ...rest,\n data: stripped as Committed<TEvents, TKey>[\"data\"],\n } as Committed<TEvents, TKey>;\n}\n","/**\n * @packageDocumentation\n * @module act/types\n * Barrel file for Act Framework core types.\n *\n * Re-exports all major type definitions for actions, errors, ports, reactions, registries, and schemas.\n * Also defines common environment and log level types/constants for configuration and logging.\n *\n * @remarks\n * Import from this module to access all core framework types in one place.\n */\nexport type * from \"./action.js\";\nexport type * from \"./audit.js\";\nexport * from \"./errors.js\";\nexport type * from \"./ports.js\";\nexport type * from \"./reaction.js\";\nexport type * from \"./registry.js\";\nexport * from \"./schemas.js\";\n\n/**\n * Supported runtime environments for the framework.\n * - `development`: Local development\n * - `test`: Automated testing\n * - `staging`: Pre-production\n * - `production`: Live/production\n */\nexport const Environments = [\n \"development\",\n \"test\",\n \"staging\",\n \"production\",\n] as const;\n\n/**\n * Type representing a valid environment string.\n */\nexport type Environment = (typeof Environments)[number];\n\n/**\n * Supported log levels for framework logging.\n * - `fatal`, `error`, `warn`, `info`, `debug`, `trace`\n */\nexport const LogLevels = [\n \"fatal\",\n \"error\",\n \"warn\",\n \"info\",\n \"debug\",\n \"trace\",\n] as const;\n\n/**\n * Type representing a valid log level string.\n */\nexport type LogLevel = (typeof LogLevels)[number];\n"],"mappings":";AAmBO,IAAM,SAAS;AAAA,EACpB,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,YAAY;AACd;AA2CO,IAAM,kBAAN,cAA8B,MAAM;AAAA;AAAA,EAEzB;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EAEhB,YAAY,QAAgB,SAAc,SAAc;AACtD,UAAM,WAAW,MAAM,UAAU;AACjC,SAAK,OAAO,OAAO;AACnB,SAAK,SAAS;AACd,SAAK,UAAU;AACf,SAAK,UAAU;AAAA,EACjB;AACF;AAuEO,IAAM,iBAAN,cAMG,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|
5
5
|
ValidationError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4TJN4G7L.js";
|
|
7
7
|
|
|
8
8
|
// src/adapters/console-logger.ts
|
|
9
9
|
var LEVEL_VALUES = {
|
|
@@ -1134,4 +1134,4 @@ export {
|
|
|
1134
1134
|
TOMBSTONE_EVENT,
|
|
1135
1135
|
DEFAULT_LANE
|
|
1136
1136
|
};
|
|
1137
|
-
//# sourceMappingURL=chunk-
|
|
1137
|
+
//# sourceMappingURL=chunk-QKVY5QAQ.js.map
|
|
@@ -5,7 +5,11 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
|
|
8
|
+
try {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
throw mod = 0, e;
|
|
12
|
+
}
|
|
9
13
|
};
|
|
10
14
|
var __copyProps = (to, from, except, desc) => {
|
|
11
15
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -28,4 +32,4 @@ export {
|
|
|
28
32
|
__commonJS,
|
|
29
33
|
__toESM
|
|
30
34
|
};
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-YLJ4XMA6.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-YLJ4XMA6.js";
|
|
2
2
|
|
|
3
3
|
// ../../node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.js
|
|
4
4
|
var $ = Object.defineProperty;
|
|
@@ -543,4 +543,4 @@ export {
|
|
|
543
543
|
U as hrtimeNow,
|
|
544
544
|
B as now
|
|
545
545
|
};
|
|
546
|
-
//# sourceMappingURL=dist-
|
|
546
|
+
//# sourceMappingURL=dist-EOG547W7.js.map
|