@rotorsoft/act 1.33.14 → 1.33.15
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/internal/lru-map.d.ts +5 -19
- package/dist/@types/internal/lru-map.d.ts.map +1 -1
- package/dist/{chunk-MSD67APM.js → chunk-E5H3NRCT.js} +1 -1
- package/dist/chunk-E5H3NRCT.js.map +1 -0
- package/dist/{chunk-U54EW4DX.cjs → chunk-EN2KFJ7W.cjs} +1 -1
- package/dist/chunk-EN2KFJ7W.cjs.map +1 -0
- package/dist/index.cjs +96 -96
- package/dist/index.js +1 -1
- package/dist/test/index.cjs +3 -3
- package/dist/test/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-MSD67APM.js.map +0 -1
- package/dist/chunk-U54EW4DX.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkEN2KFJ7Wcjs = require('./chunk-EN2KFJ7W.cjs');
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
@@ -74,20 +74,20 @@ var _chunkPMS6BMIUcjs = require('./chunk-PMS6BMIU.cjs');
|
|
|
74
74
|
|
|
75
75
|
// src/signals.ts
|
|
76
76
|
process.once("SIGINT", async (arg) => {
|
|
77
|
-
|
|
78
|
-
await
|
|
77
|
+
_chunkEN2KFJ7Wcjs.log.call(void 0, ).info(arg, "SIGINT");
|
|
78
|
+
await _chunkEN2KFJ7Wcjs.disposeAndExit.call(void 0, "EXIT");
|
|
79
79
|
});
|
|
80
80
|
process.once("SIGTERM", async (arg) => {
|
|
81
|
-
|
|
82
|
-
await
|
|
81
|
+
_chunkEN2KFJ7Wcjs.log.call(void 0, ).info(arg, "SIGTERM");
|
|
82
|
+
await _chunkEN2KFJ7Wcjs.disposeAndExit.call(void 0, "EXIT");
|
|
83
83
|
});
|
|
84
84
|
process.once("uncaughtException", async (arg) => {
|
|
85
|
-
|
|
86
|
-
await
|
|
85
|
+
_chunkEN2KFJ7Wcjs.log.call(void 0, ).error(arg, "Uncaught Exception");
|
|
86
|
+
await _chunkEN2KFJ7Wcjs.disposeAndExit.call(void 0, "ERROR");
|
|
87
87
|
});
|
|
88
88
|
process.once("unhandledRejection", async (arg) => {
|
|
89
|
-
|
|
90
|
-
await
|
|
89
|
+
_chunkEN2KFJ7Wcjs.log.call(void 0, ).error(arg, "Unhandled Rejection");
|
|
90
|
+
await _chunkEN2KFJ7Wcjs.disposeAndExit.call(void 0, "ERROR");
|
|
91
91
|
});
|
|
92
92
|
|
|
93
93
|
// src/act.ts
|
|
@@ -922,7 +922,7 @@ async function run_windowed_closes(windowed, deps, skipped) {
|
|
|
922
922
|
if (!await windowed_prune_pending(t.stream, t.before, max_id))
|
|
923
923
|
return void 0;
|
|
924
924
|
if (t.archive) await t.archive();
|
|
925
|
-
const result = await
|
|
925
|
+
const result = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).truncate([
|
|
926
926
|
{ stream: t.stream, before: t.before, max_id }
|
|
927
927
|
]);
|
|
928
928
|
return result.get(t.stream);
|
|
@@ -935,7 +935,7 @@ async function run_windowed_closes(windowed, deps, skipped) {
|
|
|
935
935
|
async function windowed_prune_pending(stream, before, max_id) {
|
|
936
936
|
let boundary_id;
|
|
937
937
|
let min_id;
|
|
938
|
-
await
|
|
938
|
+
await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query(
|
|
939
939
|
(event) => {
|
|
940
940
|
if (min_id === void 0 || event.id < min_id) min_id = event.id;
|
|
941
941
|
if (event.name === _chunkPMS6BMIUcjs.SNAP_EVENT && event.created < before && (max_id === void 0 || event.id <= max_id) && (boundary_id === void 0 || event.id > boundary_id))
|
|
@@ -949,7 +949,7 @@ async function probe_min_watermarks(streams, page_size, checkpoint) {
|
|
|
949
949
|
const min_at = /* @__PURE__ */ new Map();
|
|
950
950
|
const matches = source_matcher();
|
|
951
951
|
await walk_streams(
|
|
952
|
-
|
|
952
|
+
_chunkEN2KFJ7Wcjs.store.call(void 0, ),
|
|
953
953
|
(position) => {
|
|
954
954
|
const pending = position.correlated_at === void 0 || position.at < position.correlated_at;
|
|
955
955
|
const cap = pending ? position.at : Math.max(position.at, checkpoint);
|
|
@@ -977,13 +977,13 @@ function source_matcher() {
|
|
|
977
977
|
};
|
|
978
978
|
}
|
|
979
979
|
async function scan_stream_heads(streams) {
|
|
980
|
-
const stats = await
|
|
980
|
+
const stats = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query_stats(streams, {
|
|
981
981
|
exclude: [_chunkPMS6BMIUcjs.SNAP_EVENT]
|
|
982
982
|
});
|
|
983
|
-
const domain_heads = await
|
|
983
|
+
const domain_heads = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query_stats(streams, {
|
|
984
984
|
exclude: [_chunkPMS6BMIUcjs.SNAP_EVENT, _chunkPMS6BMIUcjs.TOMBSTONE_EVENT]
|
|
985
985
|
});
|
|
986
|
-
const true_heads = await
|
|
986
|
+
const true_heads = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query_stats(streams, {});
|
|
987
987
|
const out = /* @__PURE__ */ new Map();
|
|
988
988
|
for (const [stream, { head }] of domain_heads) {
|
|
989
989
|
const marker_head = _optionalChain([stats, 'access', _45 => _45.get, 'call', _46 => _46(stream), 'optionalAccess', _47 => _47.head]);
|
|
@@ -1011,7 +1011,7 @@ async function partition_by_safety(stream_info, reactive, skipped, page_size, ca
|
|
|
1011
1011
|
const matches = source_matcher();
|
|
1012
1012
|
const targets = [...stream_info.keys()];
|
|
1013
1013
|
await walk_streams(
|
|
1014
|
-
|
|
1014
|
+
_chunkEN2KFJ7Wcjs.store.call(void 0, ),
|
|
1015
1015
|
(position) => {
|
|
1016
1016
|
const has_work = position.correlated_at !== void 0 && position.at < position.correlated_at;
|
|
1017
1017
|
if (!has_work) return;
|
|
@@ -1077,7 +1077,7 @@ async function run_archive_callbacks(guarded, target_map) {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
}
|
|
1079
1079
|
async function heads_still_guarded(guarded, guard_events, skipped) {
|
|
1080
|
-
const heads = await
|
|
1080
|
+
const heads = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query_stats(guarded, {});
|
|
1081
1081
|
return guarded.filter((stream) => {
|
|
1082
1082
|
if (_optionalChain([heads, 'access', _55 => _55.get, 'call', _56 => _56(stream), 'optionalAccess', _57 => _57.head, 'access', _58 => _58.id]) === guard_events.get(stream).id)
|
|
1083
1083
|
return true;
|
|
@@ -1100,13 +1100,13 @@ async function truncate_and_warm_cache(guarded, seed_states, guard_events, corre
|
|
|
1100
1100
|
}
|
|
1101
1101
|
};
|
|
1102
1102
|
});
|
|
1103
|
-
const truncated = await
|
|
1103
|
+
const truncated = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).truncate(trunc_targets);
|
|
1104
1104
|
await Promise.all(
|
|
1105
1105
|
guarded.map(async (stream) => {
|
|
1106
1106
|
const entry = truncated.get(stream);
|
|
1107
1107
|
const state2 = seed_states.get(stream);
|
|
1108
1108
|
if (state2 && entry) {
|
|
1109
|
-
await
|
|
1109
|
+
await _chunkEN2KFJ7Wcjs.cache.call(void 0, ).set(stream, {
|
|
1110
1110
|
stream,
|
|
1111
1111
|
state: state2,
|
|
1112
1112
|
version: entry.committed.version,
|
|
@@ -1115,7 +1115,7 @@ async function truncate_and_warm_cache(guarded, seed_states, guard_events, corre
|
|
|
1115
1115
|
snaps: 1
|
|
1116
1116
|
});
|
|
1117
1117
|
} else {
|
|
1118
|
-
await
|
|
1118
|
+
await _chunkEN2KFJ7Wcjs.cache.call(void 0, ).invalidate(stream);
|
|
1119
1119
|
}
|
|
1120
1120
|
})
|
|
1121
1121
|
);
|
|
@@ -1129,7 +1129,7 @@ var _crypto = require('crypto');
|
|
|
1129
1129
|
function report_once(seen, key, message) {
|
|
1130
1130
|
if (seen.has(key)) return;
|
|
1131
1131
|
seen.add(key);
|
|
1132
|
-
|
|
1132
|
+
_chunkEN2KFJ7Wcjs.log.call(void 0, ).error(new Error(message));
|
|
1133
1133
|
}
|
|
1134
1134
|
|
|
1135
1135
|
// src/internal/correlate-cycle.ts
|
|
@@ -1177,7 +1177,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1177
1177
|
// never drops their +Infinity floor.
|
|
1178
1178
|
|
|
1179
1179
|
__init9() {this._static_subscriptions = /* @__PURE__ */ new Map()}
|
|
1180
|
-
__init10() {this._patterns = new (0,
|
|
1180
|
+
__init10() {this._patterns = new (0, _chunkEN2KFJ7Wcjs.LruMap)(PATTERN_CACHE_SIZE)}
|
|
1181
1181
|
|
|
1182
1182
|
|
|
1183
1183
|
|
|
@@ -1195,7 +1195,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1195
1195
|
on_init
|
|
1196
1196
|
}) {;_class3.prototype.__init3.call(this);_class3.prototype.__init4.call(this);_class3.prototype.__init5.call(this);_class3.prototype.__init6.call(this);_class3.prototype.__init7.call(this);_class3.prototype.__init8.call(this);_class3.prototype.__init9.call(this);_class3.prototype.__init10.call(this);_class3.prototype.__init11.call(this);
|
|
1197
1197
|
this._key = shard ? `${registry_key(registry.events)}:${[...shard].sort().join(",")}` : registry_key(registry.events);
|
|
1198
|
-
this._dynamic_subscriptions = new (0,
|
|
1198
|
+
this._dynamic_subscriptions = new (0, _chunkEN2KFJ7Wcjs.LruMap)(max_subscribed_streams);
|
|
1199
1199
|
this._registry = registry;
|
|
1200
1200
|
this._declared_lanes = declared_lanes;
|
|
1201
1201
|
this._static_targets = static_targets;
|
|
@@ -1246,7 +1246,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1246
1246
|
/** Would the target's own `fetch` (filtered by `source`) return this event? */
|
|
1247
1247
|
_in_fetch_window(source, stream) {
|
|
1248
1248
|
if (source === void 0 || source === stream) return true;
|
|
1249
|
-
if (
|
|
1249
|
+
if (_chunkEN2KFJ7Wcjs.is_literal_source.call(void 0, source)) return false;
|
|
1250
1250
|
let pattern = this._patterns.get(source);
|
|
1251
1251
|
if (!pattern) {
|
|
1252
1252
|
pattern = new RegExp(source);
|
|
@@ -1279,7 +1279,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1279
1279
|
const correlated = /* @__PURE__ */ new Map();
|
|
1280
1280
|
let last_id = after;
|
|
1281
1281
|
let stopped = false;
|
|
1282
|
-
const found = await
|
|
1282
|
+
const found = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query(
|
|
1283
1283
|
(event) => {
|
|
1284
1284
|
if (stopped) return;
|
|
1285
1285
|
const register = this._registry.events[event.name];
|
|
@@ -1402,7 +1402,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1402
1402
|
await Promise.all(
|
|
1403
1403
|
missed.map(async ([stream, entry]) => {
|
|
1404
1404
|
let row;
|
|
1405
|
-
await
|
|
1405
|
+
await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query_streams(
|
|
1406
1406
|
(position) => {
|
|
1407
1407
|
row = position;
|
|
1408
1408
|
},
|
|
@@ -1442,7 +1442,7 @@ var CorrelateCycle = (_class3 = class {
|
|
|
1442
1442
|
millis: 0
|
|
1443
1443
|
});
|
|
1444
1444
|
} catch (error) {
|
|
1445
|
-
|
|
1445
|
+
_chunkEN2KFJ7Wcjs.log.call(void 0, ).warn(
|
|
1446
1446
|
`Could not hand back the correlation lease during shutdown; it expires on its own within ${CORRELATION_LEASE_MS}ms and correlation resumes normally after that. On a single-writer store this usually means another connection holds the database. Cause: ${String(error)}`
|
|
1447
1447
|
);
|
|
1448
1448
|
}
|
|
@@ -1595,14 +1595,14 @@ function compute_lag_lead_ratio(handled, lagging, leading) {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
|
|
1597
1597
|
// src/internal/drain-ops.ts
|
|
1598
|
-
var claim = (lagging, leading, by, millis, lane) =>
|
|
1598
|
+
var claim = (lagging, leading, by, millis, lane) => _chunkEN2KFJ7Wcjs.store.call(void 0, ).claim(lagging, leading, by, millis, lane);
|
|
1599
1599
|
async function fetch(leased, eventLimit) {
|
|
1600
1600
|
return Promise.all(
|
|
1601
1601
|
leased.map(async ({ stream, source, at, lagging }) => {
|
|
1602
1602
|
const events = [];
|
|
1603
|
-
const stream_exact = source !== void 0 &&
|
|
1603
|
+
const stream_exact = source !== void 0 && _chunkEN2KFJ7Wcjs.is_literal_source.call(void 0, source) ? true : void 0;
|
|
1604
1604
|
try {
|
|
1605
|
-
await
|
|
1605
|
+
await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query((e) => events.push(e), {
|
|
1606
1606
|
stream: source,
|
|
1607
1607
|
stream_exact,
|
|
1608
1608
|
after: at,
|
|
@@ -1622,30 +1622,30 @@ async function fetch(leased, eventLimit) {
|
|
|
1622
1622
|
})
|
|
1623
1623
|
);
|
|
1624
1624
|
}
|
|
1625
|
-
var ack = (leases) =>
|
|
1626
|
-
var block = (leases) =>
|
|
1627
|
-
var subscribe = (streams, correlated_at, correlator) =>
|
|
1625
|
+
var ack = (leases) => _chunkEN2KFJ7Wcjs.store.call(void 0, ).ack(leases);
|
|
1626
|
+
var block = (leases) => _chunkEN2KFJ7Wcjs.store.call(void 0, ).block(leases);
|
|
1627
|
+
var subscribe = (streams, correlated_at, correlator) => _chunkEN2KFJ7Wcjs.store.call(void 0, ).subscribe(streams, correlated_at, correlator);
|
|
1628
1628
|
|
|
1629
1629
|
// src/internal/event-sourcing.ts
|
|
1630
1630
|
var _actpatch = require('@rotorsoft/act-patch');
|
|
1631
1631
|
var bare_patch = (_me, state2, partial) => _actpatch.patch.call(void 0, state2, partial);
|
|
1632
1632
|
var validating_patch = (me, state2, partial, event) => {
|
|
1633
1633
|
const next = _actpatch.patch.call(void 0, state2, partial);
|
|
1634
|
-
return
|
|
1634
|
+
return _chunkEN2KFJ7Wcjs.validate.call(void 0,
|
|
1635
1635
|
`${me.name}.${String(event.name)}#${event.id}`,
|
|
1636
1636
|
next,
|
|
1637
1637
|
me.state
|
|
1638
1638
|
);
|
|
1639
1639
|
};
|
|
1640
1640
|
var DEFAULT_BATCH = 500;
|
|
1641
|
-
var cache_put = (stream, entry) =>
|
|
1642
|
-
(err) =>
|
|
1641
|
+
var cache_put = (stream, entry) => _chunkEN2KFJ7Wcjs.cache.call(void 0, ).set(stream, entry).catch(
|
|
1642
|
+
(err) => _chunkEN2KFJ7Wcjs.log.call(void 0, ).warn(
|
|
1643
1643
|
err,
|
|
1644
1644
|
"cache set skipped; the next load re-folds from the store"
|
|
1645
1645
|
)
|
|
1646
1646
|
);
|
|
1647
|
-
var cache_drop = (stream) =>
|
|
1648
|
-
(err) =>
|
|
1647
|
+
var cache_drop = (stream) => _chunkEN2KFJ7Wcjs.cache.call(void 0, ).invalidate(stream).catch(
|
|
1648
|
+
(err) => _chunkEN2KFJ7Wcjs.log.call(void 0, ).warn(
|
|
1649
1649
|
err,
|
|
1650
1650
|
"cache invalidate skipped; a stale checkpoint re-folds from its event_id"
|
|
1651
1651
|
)
|
|
@@ -1653,7 +1653,7 @@ var cache_drop = (stream) => _chunkU54EW4DXcjs.cache.call(void 0, ).invalidate(s
|
|
|
1653
1653
|
async function snap(snapshot) {
|
|
1654
1654
|
const { id, stream, name, meta, version } = snapshot.event;
|
|
1655
1655
|
try {
|
|
1656
|
-
const [committed] = await
|
|
1656
|
+
const [committed] = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).commit(
|
|
1657
1657
|
stream,
|
|
1658
1658
|
[{ name: _chunkPMS6BMIUcjs.SNAP_EVENT, data: snapshot.state }],
|
|
1659
1659
|
{
|
|
@@ -1666,14 +1666,14 @@ async function snap(snapshot) {
|
|
|
1666
1666
|
return committed;
|
|
1667
1667
|
} catch (error) {
|
|
1668
1668
|
const reason = error instanceof Error ? error.message : String(error);
|
|
1669
|
-
|
|
1669
|
+
_chunkEN2KFJ7Wcjs.log.call(void 0, ).warn(
|
|
1670
1670
|
`Snapshot write failed on stream "${stream}": ${reason} \u2014 cold starts will replay full history until snapshots succeed.`
|
|
1671
1671
|
);
|
|
1672
1672
|
}
|
|
1673
1673
|
}
|
|
1674
1674
|
async function tombstone(stream, expectedVersion, correlation) {
|
|
1675
1675
|
try {
|
|
1676
|
-
const [committed] = await
|
|
1676
|
+
const [committed] = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).commit(
|
|
1677
1677
|
stream,
|
|
1678
1678
|
[{ name: _chunkPMS6BMIUcjs.TOMBSTONE_EVENT, data: {} }],
|
|
1679
1679
|
{ correlation, causation: {} },
|
|
@@ -1806,14 +1806,14 @@ async function scan(source, opts = {}, callback) {
|
|
|
1806
1806
|
async function load(me, target, callback, patch_fn = bare_patch) {
|
|
1807
1807
|
const { stream, actor, asOf } = target;
|
|
1808
1808
|
const time_travel = !!asOf && Object.values(asOf).some((v) => v !== void 0);
|
|
1809
|
-
const cached = time_travel ? void 0 : await
|
|
1809
|
+
const cached = time_travel ? void 0 : await _chunkEN2KFJ7Wcjs.cache.call(void 0, ).get(stream);
|
|
1810
1810
|
const cache_hit = !!cached;
|
|
1811
1811
|
let state2 = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _72 => _72.state]), () => ( (me.init ? me.init() : {})));
|
|
1812
1812
|
let patches = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _73 => _73.patches]), () => ( 0));
|
|
1813
1813
|
let snaps = _nullishCoalesce(_optionalChain([cached, 'optionalAccess', _74 => _74.snaps]), () => ( 0));
|
|
1814
1814
|
let replayed = 0;
|
|
1815
1815
|
let event;
|
|
1816
|
-
await
|
|
1816
|
+
await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query(
|
|
1817
1817
|
(raw) => {
|
|
1818
1818
|
event = me.view(raw, actor);
|
|
1819
1819
|
if (event.name === _chunkPMS6BMIUcjs.SNAP_EVENT) {
|
|
@@ -1826,7 +1826,7 @@ async function load(me, target, callback, patch_fn = bare_patch) {
|
|
|
1826
1826
|
patches++;
|
|
1827
1827
|
replayed++;
|
|
1828
1828
|
} else if (event.name !== _chunkPMS6BMIUcjs.TOMBSTONE_EVENT) {
|
|
1829
|
-
|
|
1829
|
+
_chunkEN2KFJ7Wcjs.log.call(void 0, ).warn(
|
|
1830
1830
|
`Skipping unknown event "${String(event.name)}" on stream "${stream}" (id=${event.id}) \u2014 no reducer in state "${me.name}"`
|
|
1831
1831
|
);
|
|
1832
1832
|
}
|
|
@@ -1878,7 +1878,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1878
1878
|
if (!stream) throw new Error("Missing target stream");
|
|
1879
1879
|
const reactingTo = _optionalChain([options, 'optionalAccess', _81 => _81.reactingTo]);
|
|
1880
1880
|
const correlator = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _82 => _82.correlator]), () => ( default_correlator));
|
|
1881
|
-
const validated =
|
|
1881
|
+
const validated = _chunkEN2KFJ7Wcjs.validate.call(void 0, action2, payload, me.actions[action2]);
|
|
1882
1882
|
const opts = _optionalChain([me, 'access', _83 => _83.options, 'optionalAccess', _84 => _84[action2]]);
|
|
1883
1883
|
const max_retries = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _85 => _85.maxRetries]), () => ( 0));
|
|
1884
1884
|
for (let attempt = 0; ; attempt++) {
|
|
@@ -1913,7 +1913,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1913
1913
|
const tuples = Array.isArray(result[0]) ? result : [result];
|
|
1914
1914
|
const valid = tuples.map(([name, data]) => ({
|
|
1915
1915
|
name,
|
|
1916
|
-
data:
|
|
1916
|
+
data: _chunkEN2KFJ7Wcjs.validate.call(void 0, name, data, me.events[name])
|
|
1917
1917
|
}));
|
|
1918
1918
|
const emitted = valid.map((e) => me.message(e));
|
|
1919
1919
|
const meta = {
|
|
@@ -1938,7 +1938,7 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1938
1938
|
};
|
|
1939
1939
|
let committed;
|
|
1940
1940
|
try {
|
|
1941
|
-
committed = await
|
|
1941
|
+
committed = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).commit(
|
|
1942
1942
|
stream,
|
|
1943
1943
|
emitted,
|
|
1944
1944
|
meta,
|
|
@@ -1991,14 +1991,14 @@ async function action(me, action2, target, payload, options, patch_fn = bare_pat
|
|
|
1991
1991
|
if (attempt >= max_retries) throw error;
|
|
1992
1992
|
if (_optionalChain([opts, 'optionalAccess', _94 => _94.backoff])) {
|
|
1993
1993
|
const delay_ms = compute_backoff_delay(attempt, opts.backoff);
|
|
1994
|
-
if (delay_ms > 0) await
|
|
1994
|
+
if (delay_ms > 0) await _chunkEN2KFJ7Wcjs.sleep.call(void 0, delay_ms);
|
|
1995
1995
|
}
|
|
1996
1996
|
}
|
|
1997
1997
|
}
|
|
1998
1998
|
}
|
|
1999
1999
|
|
|
2000
2000
|
// src/internal/tracing.ts
|
|
2001
|
-
var PRETTY =
|
|
2001
|
+
var PRETTY = _chunkEN2KFJ7Wcjs.config.call(void 0, ).env !== "production";
|
|
2002
2002
|
var C_BLUE = "\x1B[38;5;39m";
|
|
2003
2003
|
var C_ORANGE = "\x1B[38;5;208m";
|
|
2004
2004
|
var C_GREEN = "\x1B[38;5;42m";
|
|
@@ -2184,7 +2184,7 @@ function budget_exhausted(lease, options, store_failing) {
|
|
|
2184
2184
|
if (store_failing || !_optionalChain([options, 'optionalAccess', _104 => _104.blockOnError]) || lease.retry <= options.maxRetries)
|
|
2185
2185
|
return void 0;
|
|
2186
2186
|
const error = `Blocking ${lease.stream} after ${lease.retry} claims with no acknowledged progress \u2014 the retry budget (${options.maxRetries}) was spent without the handler ever reporting an error. That means every attempt lost its lease before it could ack: move the reaction to a lane whose leaseMillis covers the handler, then unblock the stream.`;
|
|
2187
|
-
|
|
2187
|
+
_chunkEN2KFJ7Wcjs.log.call(void 0, ).error(error);
|
|
2188
2188
|
return { lease, handled: 0, acked_at: lease.at, error, block: true };
|
|
2189
2189
|
}
|
|
2190
2190
|
function fetch_failure_policy(registry) {
|
|
@@ -2206,7 +2206,7 @@ function finalize(lease, handled, at, error, options, logger, failed_at) {
|
|
|
2206
2206
|
logger.error(
|
|
2207
2207
|
non_retryable ? `Blocking ${lease.stream} on non-retryable error.` : `Blocking ${lease.stream} after ${lease.retry} retries.`
|
|
2208
2208
|
);
|
|
2209
|
-
const next_attempt_at = block2 ? void 0 : Date.now() + compute_backoff_delay(lease.retry, _nullishCoalesce(options.backoff, () => (
|
|
2209
|
+
const next_attempt_at = block2 ? void 0 : Date.now() + compute_backoff_delay(lease.retry, _nullishCoalesce(options.backoff, () => ( _chunkEN2KFJ7Wcjs.DEFAULT_BACKOFF)));
|
|
2210
2210
|
return {
|
|
2211
2211
|
lease,
|
|
2212
2212
|
handled,
|
|
@@ -2335,7 +2335,7 @@ async function run_drain_cycle(deps, cycle) {
|
|
|
2335
2335
|
const acked = await ops.ack(submitted);
|
|
2336
2336
|
const expected = submitted.filter((l) => l.due === void 0).length;
|
|
2337
2337
|
if (acked.length < expected)
|
|
2338
|
-
|
|
2338
|
+
_chunkEN2KFJ7Wcjs.log.call(void 0, ).warn(
|
|
2339
2339
|
`drain: ${expected - acked.length} of ${expected} acks were dropped \u2014 the lease was taken by another worker mid-handler. That work will be redelivered (at-least-once), but persistent drops mean leaseMillis is too short for this handler.`
|
|
2340
2340
|
);
|
|
2341
2341
|
const closeable = handled.filter((h) => h.close !== void 0).map((h) => h.close);
|
|
@@ -2433,9 +2433,9 @@ var DrainController = (_class5 = class {
|
|
|
2433
2433
|
if (!this.armed || this._stopped || this._inflight)
|
|
2434
2434
|
return EMPTY_DRAIN;
|
|
2435
2435
|
const d = _nullishCoalesce(this._deps.defaults, () => ( {}));
|
|
2436
|
-
const streamLimit = _nullishCoalesce(_nullishCoalesce(d.streamLimit, () => ( options.streamLimit)), () => (
|
|
2437
|
-
const eventLimit = _nullishCoalesce(options.eventLimit, () => (
|
|
2438
|
-
const leaseMillis = _nullishCoalesce(_nullishCoalesce(d.leaseMillis, () => ( options.leaseMillis)), () => (
|
|
2436
|
+
const streamLimit = _nullishCoalesce(_nullishCoalesce(d.streamLimit, () => ( options.streamLimit)), () => ( _chunkEN2KFJ7Wcjs.DEFAULT_STREAM_LIMIT));
|
|
2437
|
+
const eventLimit = _nullishCoalesce(options.eventLimit, () => ( _chunkEN2KFJ7Wcjs.DEFAULT_EVENT_LIMIT));
|
|
2438
|
+
const leaseMillis = _nullishCoalesce(_nullishCoalesce(d.leaseMillis, () => ( options.leaseMillis)), () => ( _chunkEN2KFJ7Wcjs.DEFAULT_LEASE_MILLIS));
|
|
2439
2439
|
if (this._deps.breaker.state(Date.now()) === "open")
|
|
2440
2440
|
return EMPTY_DRAIN;
|
|
2441
2441
|
const pass = this._pass(streamLimit, eventLimit, leaseMillis).finally(
|
|
@@ -2995,7 +2995,7 @@ var Act = (_class7 = class {
|
|
|
2995
2995
|
/** Lanes to arm per event; `"all"` when a dynamic resolver hides the lane. */
|
|
2996
2996
|
|
|
2997
2997
|
|
|
2998
|
-
__init25() {this._logger =
|
|
2998
|
+
__init25() {this._logger = _chunkEN2KFJ7Wcjs.log.call(void 0, )}
|
|
2999
2999
|
/** This Act's ports: its own bag, or the singleton adapters. */
|
|
3000
3000
|
|
|
3001
3001
|
/** Runs a body so internal `store()`/`cache()` calls resolve to `_ports`. */
|
|
@@ -3017,9 +3017,9 @@ var Act = (_class7 = class {
|
|
|
3017
3017
|
this._lanes = lanes;
|
|
3018
3018
|
this._declared_lanes = ["default", ...lanes.map((l) => l.name)];
|
|
3019
3019
|
validate_only_lanes(options, lanes);
|
|
3020
|
-
this._ports = _nullishCoalesce(options.scoped, () => (
|
|
3020
|
+
this._ports = _nullishCoalesce(options.scoped, () => ( _chunkEN2KFJ7Wcjs.default_scope.call(void 0, )));
|
|
3021
3021
|
const ports = this._ports;
|
|
3022
|
-
this._scoped =
|
|
3022
|
+
this._scoped = _chunkEN2KFJ7Wcjs.make_run_scoped.call(void 0, {
|
|
3023
3023
|
// Getters, not a spread: the singletons resolve lazily, so a later
|
|
3024
3024
|
// `store(...)` / `cache(...)` still takes effect.
|
|
3025
3025
|
get store() {
|
|
@@ -3029,14 +3029,14 @@ var Act = (_class7 = class {
|
|
|
3029
3029
|
return ports.cache;
|
|
3030
3030
|
},
|
|
3031
3031
|
// Parsed per build, so a bad window throws on every build.
|
|
3032
|
-
autoclose_window:
|
|
3032
|
+
autoclose_window: _chunkEN2KFJ7Wcjs.resolveAutocloseConfig.call(void 0, options).autocloseWindow
|
|
3033
3033
|
});
|
|
3034
3034
|
this._correlator = _nullishCoalesce(options.correlator, () => ( default_correlator));
|
|
3035
3035
|
this._es = build_es(this._logger, this._correlator, patch_fn);
|
|
3036
3036
|
this._cd = build_drain(this._logger);
|
|
3037
3037
|
const handle = build_handle({
|
|
3038
3038
|
logger: this._logger,
|
|
3039
|
-
reaction_scope:
|
|
3039
|
+
reaction_scope: _chunkEN2KFJ7Wcjs.make_reaction_scope.call(void 0, {
|
|
3040
3040
|
do: this.do.bind(this),
|
|
3041
3041
|
load: this.load.bind(this),
|
|
3042
3042
|
query: this.query.bind(this),
|
|
@@ -3066,12 +3066,12 @@ var Act = (_class7 = class {
|
|
|
3066
3066
|
this._ports.store,
|
|
3067
3067
|
options.listen !== false
|
|
3068
3068
|
);
|
|
3069
|
-
|
|
3069
|
+
_chunkEN2KFJ7Wcjs.register_weak_disposer.call(void 0, new WeakRef(this), (self) => self.shutdown());
|
|
3070
3070
|
}
|
|
3071
3071
|
/** Shared by drain, settle and autoclose; bad knobs throw at build. */
|
|
3072
3072
|
_build_breaker(options) {
|
|
3073
3073
|
return new CircuitBreaker(
|
|
3074
|
-
|
|
3074
|
+
_chunkEN2KFJ7Wcjs.resolveCircuitBreakerConfig.call(void 0, options.circuitBreaker),
|
|
3075
3075
|
{
|
|
3076
3076
|
on_error: (error, circuit) => this._emit_error(error, circuit),
|
|
3077
3077
|
// When the cooldown elapses, settle once: its scan or claim is the
|
|
@@ -3140,7 +3140,7 @@ var Act = (_class7 = class {
|
|
|
3140
3140
|
/** Audit deps, built after the controllers so the lane set is final. */
|
|
3141
3141
|
_build_audit_deps() {
|
|
3142
3142
|
return {
|
|
3143
|
-
store:
|
|
3143
|
+
store: _chunkEN2KFJ7Wcjs.store,
|
|
3144
3144
|
event_to_state: this._event_to_state,
|
|
3145
3145
|
// Declared lanes, not this process's controllers: a lane another
|
|
3146
3146
|
// worker drains is not `unknown-lane`.
|
|
@@ -3169,7 +3169,7 @@ var Act = (_class7 = class {
|
|
|
3169
3169
|
/** Cold start: an idle deferred stream still fires on time after a restart. */
|
|
3170
3170
|
async _seed_persisted_defers() {
|
|
3171
3171
|
const now = Date.now();
|
|
3172
|
-
await walk_streams(
|
|
3172
|
+
await walk_streams(_chunkEN2KFJ7Wcjs.store.call(void 0, ), (pos) => {
|
|
3173
3173
|
if (pos.deferred_at === void 0 || pos.deferred_at <= now) return;
|
|
3174
3174
|
const controller = this._drain_controllers.get(_nullishCoalesce(pos.lane, () => ( "default")));
|
|
3175
3175
|
_optionalChain([controller, 'optionalAccess', _124 => _124.seed_defer, 'call', _125 => _125(pos.stream, pos.deferred_at)]);
|
|
@@ -3208,7 +3208,7 @@ var Act = (_class7 = class {
|
|
|
3208
3208
|
*/
|
|
3209
3209
|
shutdown(options) {
|
|
3210
3210
|
if (!this._shutdown_promise) {
|
|
3211
|
-
|
|
3211
|
+
_chunkEN2KFJ7Wcjs.resolveShutdownConfig.call(void 0, options);
|
|
3212
3212
|
this._shutdown_promise = (async () => {
|
|
3213
3213
|
this.stop_correlations();
|
|
3214
3214
|
this._settle.stop(true);
|
|
@@ -3228,10 +3228,10 @@ var Act = (_class7 = class {
|
|
|
3228
3228
|
* default for none or 0, and for a running settle), capped.
|
|
3229
3229
|
*/
|
|
3230
3230
|
_derive_grace_ms(running, settling) {
|
|
3231
|
-
let max = settling ?
|
|
3231
|
+
let max = settling ? _chunkEN2KFJ7Wcjs.DEFAULT_LEASE_MILLIS : 0;
|
|
3232
3232
|
for (const c of running)
|
|
3233
|
-
max = Math.max(max, c.lease_millis ||
|
|
3234
|
-
return Math.min(max,
|
|
3233
|
+
max = Math.max(max, c.lease_millis || _chunkEN2KFJ7Wcjs.DEFAULT_LEASE_MILLIS);
|
|
3234
|
+
return Math.min(max, _chunkEN2KFJ7Wcjs.MAX_SHUTDOWN_GRACE_MS);
|
|
3235
3235
|
}
|
|
3236
3236
|
async _await_inflight(grace_ms) {
|
|
3237
3237
|
const running = [...this._drain_controllers.values()].filter(
|
|
@@ -3312,7 +3312,7 @@ var Act = (_class7 = class {
|
|
|
3312
3312
|
* @see {@link ValidationError}, {@link InvariantError}, {@link ConcurrencyError}
|
|
3313
3313
|
*/
|
|
3314
3314
|
async do(action2, target, payload, options) {
|
|
3315
|
-
const reacting_to = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _127 => _127.reactingTo]), () => (
|
|
3315
|
+
const reacting_to = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _127 => _127.reactingTo]), () => ( _chunkEN2KFJ7Wcjs.current_reacting.call(void 0, )));
|
|
3316
3316
|
const do_options = reacting_to === _optionalChain([options, 'optionalAccess', _128 => _128.reactingTo]) ? options : { ...options, reactingTo: reacting_to };
|
|
3317
3317
|
return this._scoped(async () => {
|
|
3318
3318
|
const snapshots = await this._es.action(
|
|
@@ -3373,7 +3373,7 @@ var Act = (_class7 = class {
|
|
|
3373
3373
|
return this._scoped(async () => {
|
|
3374
3374
|
let first;
|
|
3375
3375
|
let last;
|
|
3376
|
-
const count = await
|
|
3376
|
+
const count = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query((e) => {
|
|
3377
3377
|
const gated = this.registry.query_gate(e.name)(e);
|
|
3378
3378
|
if (!first) first = gated;
|
|
3379
3379
|
last = gated;
|
|
@@ -3403,7 +3403,7 @@ var Act = (_class7 = class {
|
|
|
3403
3403
|
async query_array(query) {
|
|
3404
3404
|
return this._scoped(async () => {
|
|
3405
3405
|
const events = [];
|
|
3406
|
-
await
|
|
3406
|
+
await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query((e) => {
|
|
3407
3407
|
events.push(this.registry.query_gate(e.name)(e));
|
|
3408
3408
|
}, query);
|
|
3409
3409
|
return events;
|
|
@@ -3423,14 +3423,14 @@ var Act = (_class7 = class {
|
|
|
3423
3423
|
*/
|
|
3424
3424
|
async forget(stream) {
|
|
3425
3425
|
return this._scoped(async () => {
|
|
3426
|
-
const s =
|
|
3426
|
+
const s = _chunkEN2KFJ7Wcjs.store.call(void 0, );
|
|
3427
3427
|
if (!s.forget_pii) {
|
|
3428
3428
|
throw new Error(
|
|
3429
3429
|
`Store does not implement forget_pii \u2014 adapter cannot comply with sensitive-data erasure. Use an adapter that declares pii_isolation: true (e.g. @rotorsoft/act on the in-memory store).`
|
|
3430
3430
|
);
|
|
3431
3431
|
}
|
|
3432
3432
|
const eventCount = await s.forget_pii(stream);
|
|
3433
|
-
await
|
|
3433
|
+
await _chunkEN2KFJ7Wcjs.cache.call(void 0, ).invalidate(stream);
|
|
3434
3434
|
if (eventCount > 0) {
|
|
3435
3435
|
this.emit("forgotten", { stream, at: /* @__PURE__ */ new Date(), eventCount });
|
|
3436
3436
|
}
|
|
@@ -3464,7 +3464,7 @@ var Act = (_class7 = class {
|
|
|
3464
3464
|
* @see {@link correlate} for dynamic stream discovery
|
|
3465
3465
|
*/
|
|
3466
3466
|
async drain(options = {}) {
|
|
3467
|
-
|
|
3467
|
+
_chunkEN2KFJ7Wcjs.resolveDrainConfig.call(void 0, options);
|
|
3468
3468
|
if (!this._drain)
|
|
3469
3469
|
return { fetched: [], leased: [], acked: [], blocked: [] };
|
|
3470
3470
|
return this._scoped(() => this._drain_all(options));
|
|
@@ -3644,7 +3644,7 @@ var Act = (_class7 = class {
|
|
|
3644
3644
|
*/
|
|
3645
3645
|
async reset(input) {
|
|
3646
3646
|
return this._scoped(async () => {
|
|
3647
|
-
const count = await
|
|
3647
|
+
const count = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).reset(input);
|
|
3648
3648
|
for (const handler of this._batch_handlers.values())
|
|
3649
3649
|
_optionalChain([handler, 'access', _135 => _135[FOLD_RESET], 'optionalCall', _136 => _136()]);
|
|
3650
3650
|
if (count > 0) {
|
|
@@ -3680,7 +3680,7 @@ var Act = (_class7 = class {
|
|
|
3680
3680
|
*/
|
|
3681
3681
|
async unblock(input) {
|
|
3682
3682
|
return this._scoped(async () => {
|
|
3683
|
-
const count = await
|
|
3683
|
+
const count = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).unblock(input);
|
|
3684
3684
|
if (count > 0) {
|
|
3685
3685
|
this._wake();
|
|
3686
3686
|
}
|
|
@@ -3729,7 +3729,7 @@ var Act = (_class7 = class {
|
|
|
3729
3729
|
return { ...partial, duration_ms: Date.now() - started };
|
|
3730
3730
|
}
|
|
3731
3731
|
const target = _nullishCoalesce(sink, () => ( (() => {
|
|
3732
|
-
const s =
|
|
3732
|
+
const s = _chunkEN2KFJ7Wcjs.store.call(void 0, );
|
|
3733
3733
|
if (!s.restore) throw new Error("adapter has no restore capability");
|
|
3734
3734
|
return s;
|
|
3735
3735
|
})()));
|
|
@@ -3774,7 +3774,7 @@ var Act = (_class7 = class {
|
|
|
3774
3774
|
async blocked_streams(options) {
|
|
3775
3775
|
return this._scoped(async () => {
|
|
3776
3776
|
const positions = [];
|
|
3777
|
-
await
|
|
3777
|
+
await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query_streams(
|
|
3778
3778
|
(p) => {
|
|
3779
3779
|
positions.push(p);
|
|
3780
3780
|
},
|
|
@@ -3826,7 +3826,7 @@ var Act = (_class7 = class {
|
|
|
3826
3826
|
* @see {@link Store.prioritize} for the underlying primitive
|
|
3827
3827
|
*/
|
|
3828
3828
|
async prioritize(filter, priority) {
|
|
3829
|
-
return this._scoped(() =>
|
|
3829
|
+
return this._scoped(() => _chunkEN2KFJ7Wcjs.store.call(void 0, ).prioritize(filter, priority));
|
|
3830
3830
|
}
|
|
3831
3831
|
/** Shared by `close()` and reaction-requested closes. */
|
|
3832
3832
|
async _run_close(targets) {
|
|
@@ -3906,7 +3906,7 @@ var Act = (_class7 = class {
|
|
|
3906
3906
|
* @see {@link correlate} for manual correlation
|
|
3907
3907
|
*/
|
|
3908
3908
|
settle(options) {
|
|
3909
|
-
|
|
3909
|
+
_chunkEN2KFJ7Wcjs.resolveSettleConfig.call(void 0, _nullishCoalesce(options, () => ( {})));
|
|
3910
3910
|
this._schedule(options);
|
|
3911
3911
|
}
|
|
3912
3912
|
}, _class7);
|
|
@@ -4062,13 +4062,13 @@ function synthesize_autoclose_reactions(registry, states, read_window) {
|
|
|
4062
4062
|
}),
|
|
4063
4063
|
// Never block on autoclose: a transient query/store error should retry,
|
|
4064
4064
|
// not quarantine the synthetic stream.
|
|
4065
|
-
options: { blockOnError: false, maxRetries:
|
|
4065
|
+
options: { blockOnError: false, maxRetries: _chunkEN2KFJ7Wcjs.DEFAULT_MAX_RETRIES },
|
|
4066
4066
|
handler: async (event) => {
|
|
4067
4067
|
const aggregate = event.stream;
|
|
4068
4068
|
const window = read_window();
|
|
4069
4069
|
if (!in_autoclose_window(window, /* @__PURE__ */ new Date()))
|
|
4070
4070
|
throw new (0, _chunkPMS6BMIUcjs.DeferSignal)({ at: next_window_open(window, /* @__PURE__ */ new Date()) });
|
|
4071
|
-
const stats = await
|
|
4071
|
+
const stats = await _chunkEN2KFJ7Wcjs.store.call(void 0, ).query_stats([aggregate], {
|
|
4072
4072
|
count: true,
|
|
4073
4073
|
tail: keep_days !== void 0 ? true : void 0,
|
|
4074
4074
|
exclude: [_chunkPMS6BMIUcjs.TOMBSTONE_EVENT, _chunkPMS6BMIUcjs.SNAP_EVENT]
|
|
@@ -4306,7 +4306,7 @@ var _this_ = ({ stream }) => ({
|
|
|
4306
4306
|
|
|
4307
4307
|
// src/builders/builder-utils.ts
|
|
4308
4308
|
function register_lane(config2, lanes) {
|
|
4309
|
-
|
|
4309
|
+
_chunkEN2KFJ7Wcjs.resolveLaneConfig.call(void 0, config2);
|
|
4310
4310
|
if (config2.name === _chunkPMS6BMIUcjs.DEFAULT_LANE)
|
|
4311
4311
|
throw new Error(`Lane "${_chunkPMS6BMIUcjs.DEFAULT_LANE}" is reserved`);
|
|
4312
4312
|
const existing = lanes.find((l) => l.name === config2.name);
|
|
@@ -4350,9 +4350,9 @@ function reaction_on(event, events, builder) {
|
|
|
4350
4350
|
// Validate the whole bag at the declaration site so a bad
|
|
4351
4351
|
// `maxRetries`/`backoff`/`blockOnError` throws ZodError at build,
|
|
4352
4352
|
// not a NaN gate on the first retry.
|
|
4353
|
-
options:
|
|
4354
|
-
blockOnError: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _151 => _151.blockOnError]), () => (
|
|
4355
|
-
maxRetries: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _152 => _152.maxRetries]), () => (
|
|
4353
|
+
options: _chunkEN2KFJ7Wcjs.resolveReactionConfig.call(void 0, {
|
|
4354
|
+
blockOnError: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _151 => _151.blockOnError]), () => ( _chunkEN2KFJ7Wcjs.DEFAULT_BLOCK_ON_ERROR)),
|
|
4355
|
+
maxRetries: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _152 => _152.maxRetries]), () => ( _chunkEN2KFJ7Wcjs.DEFAULT_MAX_RETRIES)),
|
|
4356
4356
|
backoff: _optionalChain([options, 'optionalAccess', _153 => _153.backoff])
|
|
4357
4357
|
})
|
|
4358
4358
|
};
|
|
@@ -4654,7 +4654,7 @@ function act() {
|
|
|
4654
4654
|
const list = deprecation_summary.map(
|
|
4655
4655
|
(d) => `"${d.deprecated}" (current: "${d.current}", state: "${d.state_name}")`
|
|
4656
4656
|
).join(", ");
|
|
4657
|
-
|
|
4657
|
+
_chunkEN2KFJ7Wcjs.log.call(void 0, ).info(
|
|
4658
4658
|
`Act registered ${deprecation_summary.length} deprecated event(s): ${list}. These are legacy versions kept for the read path. Consider truncating closed streams via app.close() when feasible to reduce historical event load. See docs/docs/architecture/event-schema-evolution.md.`
|
|
4659
4659
|
);
|
|
4660
4660
|
}
|
|
@@ -4696,7 +4696,7 @@ function act() {
|
|
|
4696
4696
|
return reaction_on(event, registry.events, builder);
|
|
4697
4697
|
},
|
|
4698
4698
|
build: (options) => {
|
|
4699
|
-
|
|
4699
|
+
_chunkEN2KFJ7Wcjs.resolveActConfig.call(void 0, options);
|
|
4700
4700
|
const patch_fn = _optionalChain([options, 'optionalAccess', _165 => _165.validateFoldedState]) === true ? validating_patch : bare_patch;
|
|
4701
4701
|
if (!_built) {
|
|
4702
4702
|
for (const proj of pending_projections) add_projection(proj);
|
|
@@ -4748,7 +4748,7 @@ function act() {
|
|
|
4748
4748
|
synthesize_autoclose_reactions(
|
|
4749
4749
|
registry,
|
|
4750
4750
|
states,
|
|
4751
|
-
|
|
4751
|
+
_chunkEN2KFJ7Wcjs.current_autoclose_window
|
|
4752
4752
|
);
|
|
4753
4753
|
Object.freeze(registry.actions);
|
|
4754
4754
|
Object.freeze(registry.events);
|
|
@@ -4797,8 +4797,8 @@ function _projection(target) {
|
|
|
4797
4797
|
handler,
|
|
4798
4798
|
resolver: _nullishCoalesce(default_resolver, () => ( _this_)),
|
|
4799
4799
|
options: {
|
|
4800
|
-
blockOnError:
|
|
4801
|
-
maxRetries:
|
|
4800
|
+
blockOnError: _chunkEN2KFJ7Wcjs.DEFAULT_BLOCK_ON_ERROR,
|
|
4801
|
+
maxRetries: _chunkEN2KFJ7Wcjs.DEFAULT_MAX_RETRIES
|
|
4802
4802
|
}
|
|
4803
4803
|
}),
|
|
4804
4804
|
widened
|
|
@@ -4839,7 +4839,7 @@ function _projection(target) {
|
|
|
4839
4839
|
throw new Error(
|
|
4840
4840
|
`Projection "${target}" .of() partials must share one state name \u2014 got "${name}" and "${partial.name}"`
|
|
4841
4841
|
);
|
|
4842
|
-
const config2 =
|
|
4842
|
+
const config2 = _chunkEN2KFJ7Wcjs.resolveFoldConfig.call(void 0, options);
|
|
4843
4843
|
const fold_events = {};
|
|
4844
4844
|
for (const partial of partials)
|
|
4845
4845
|
for (const [event_name, schema] of Object.entries(partial.events)) {
|
|
@@ -4857,8 +4857,8 @@ function _projection(target) {
|
|
|
4857
4857
|
handler: noop,
|
|
4858
4858
|
resolver: { target },
|
|
4859
4859
|
options: {
|
|
4860
|
-
blockOnError:
|
|
4861
|
-
maxRetries:
|
|
4860
|
+
blockOnError: _chunkEN2KFJ7Wcjs.DEFAULT_BLOCK_ON_ERROR,
|
|
4861
|
+
maxRetries: _chunkEN2KFJ7Wcjs.DEFAULT_MAX_RETRIES
|
|
4862
4862
|
}
|
|
4863
4863
|
}
|
|
4864
4864
|
]
|
|
@@ -4974,7 +4974,7 @@ function action_builder(state2) {
|
|
|
4974
4974
|
throw new Error(`Duplicate action "${action2}"`);
|
|
4975
4975
|
internal.actions[action2] = schema;
|
|
4976
4976
|
if (options) {
|
|
4977
|
-
|
|
4977
|
+
_chunkEN2KFJ7Wcjs.resolveActionConfig.call(void 0, options);
|
|
4978
4978
|
internal.options ??= {};
|
|
4979
4979
|
internal.options[action2] = options;
|
|
4980
4980
|
}
|
|
@@ -5263,5 +5263,5 @@ function write_line(writer, line) {
|
|
|
5263
5263
|
|
|
5264
5264
|
|
|
5265
5265
|
|
|
5266
|
-
exports.Act = Act; exports.ActorSchema = _chunkPMS6BMIUcjs.ActorSchema; exports.CausationEventSchema = _chunkPMS6BMIUcjs.CausationEventSchema; exports.CommittedMetaSchema = _chunkPMS6BMIUcjs.CommittedMetaSchema; exports.ConcurrencyError = _chunkPMS6BMIUcjs.ConcurrencyError; exports.ConsoleLogger =
|
|
5266
|
+
exports.Act = Act; exports.ActorSchema = _chunkPMS6BMIUcjs.ActorSchema; exports.CausationEventSchema = _chunkPMS6BMIUcjs.CausationEventSchema; exports.CommittedMetaSchema = _chunkPMS6BMIUcjs.CommittedMetaSchema; exports.ConcurrencyError = _chunkPMS6BMIUcjs.ConcurrencyError; exports.ConsoleLogger = _chunkEN2KFJ7Wcjs.ConsoleLogger; exports.CsvFile = CsvFile; exports.DEFAULT_LANE = _chunkPMS6BMIUcjs.DEFAULT_LANE; exports.DEFAULT_MAX_SUBSCRIBED_STREAMS = _chunkPMS6BMIUcjs.DEFAULT_MAX_SUBSCRIBED_STREAMS; exports.DEFAULT_SETTLE_DEBOUNCE_MS = _chunkPMS6BMIUcjs.DEFAULT_SETTLE_DEBOUNCE_MS; exports.DeferSignal = _chunkPMS6BMIUcjs.DeferSignal; exports.Environments = _chunkPMS6BMIUcjs.Environments; exports.Errors = _chunkPMS6BMIUcjs.Errors; exports.EventMetaSchema = _chunkPMS6BMIUcjs.EventMetaSchema; exports.ExitCodes = _chunkPMS6BMIUcjs.ExitCodes; exports.InMemoryCache = _chunkEN2KFJ7Wcjs.InMemoryCache; exports.InMemoryStore = _chunkEN2KFJ7Wcjs.InMemoryStore; exports.InvariantError = _chunkPMS6BMIUcjs.InvariantError; exports.LogLevels = _chunkPMS6BMIUcjs.LogLevels; exports.NonRetryableError = _chunkPMS6BMIUcjs.NonRetryableError; exports.PackageSchema = _chunkEN2KFJ7Wcjs.PackageSchema; exports.QuerySchema = _chunkPMS6BMIUcjs.QuerySchema; exports.REDACTED = _chunkPMS6BMIUcjs.REDACTED; exports.SHREDDED = _chunkPMS6BMIUcjs.SHREDDED; exports.SNAP_EVENT = _chunkPMS6BMIUcjs.SNAP_EVENT; exports.StoreError = _chunkPMS6BMIUcjs.StoreError; exports.StreamClosedError = _chunkPMS6BMIUcjs.StreamClosedError; exports.TOMBSTONE_EVENT = _chunkPMS6BMIUcjs.TOMBSTONE_EVENT; exports.TargetSchema = _chunkPMS6BMIUcjs.TargetSchema; exports.ValidationError = _chunkPMS6BMIUcjs.ValidationError; exports.ZodEmpty = _chunkPMS6BMIUcjs.ZodEmpty; exports.act = act; exports.cache = _chunkEN2KFJ7Wcjs.cache; exports.config = _chunkEN2KFJ7Wcjs.config; exports.dateReviver = _chunkEN2KFJ7Wcjs.dateReviver; exports.default_scope = _chunkEN2KFJ7Wcjs.default_scope; exports.dispose = _chunkEN2KFJ7Wcjs.dispose; exports.disposeAndExit = _chunkEN2KFJ7Wcjs.disposeAndExit; exports.extend = _chunkEN2KFJ7Wcjs.extend; exports.is_literal_source = _chunkEN2KFJ7Wcjs.is_literal_source; exports.log = _chunkEN2KFJ7Wcjs.log; exports.pii_fields = _chunkPMS6BMIUcjs.pii_fields; exports.port = _chunkEN2KFJ7Wcjs.port; exports.projection = projection; exports.resolveAutocloseConfig = _chunkEN2KFJ7Wcjs.resolveAutocloseConfig2; exports.sensitive = _chunkPMS6BMIUcjs.sensitive; exports.sleep = _chunkEN2KFJ7Wcjs.sleep; exports.slice = slice; exports.state = state; exports.store = _chunkEN2KFJ7Wcjs.store; exports.validate = _chunkEN2KFJ7Wcjs.validate;
|
|
5267
5267
|
//# sourceMappingURL=index.cjs.map
|