@rotorsoft/act 2.3.0 → 2.3.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.
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkXJZ2PKJHcjs = require('./chunk-XJZ2PKJH.cjs');
6
+ var _chunkXSLQYVIGcjs = require('./chunk-XSLQYVIG.cjs');
7
7
 
8
8
 
9
9
 
@@ -12,7 +12,7 @@ var _chunkXJZ2PKJHcjs = require('./chunk-XJZ2PKJH.cjs');
12
12
 
13
13
 
14
14
 
15
- var _chunk4GA3CHQWcjs = require('./chunk-4GA3CHQW.cjs');
15
+ var _chunk253TSECAcjs = require('./chunk-253TSECA.cjs');
16
16
 
17
17
  // src/adapters/console-logger.ts
18
18
  var LEVEL_VALUES = {
@@ -38,11 +38,11 @@ var LEVEL_COLORS = {
38
38
  // gray
39
39
  };
40
40
  var RESET = "\x1B[0m";
41
- var noop = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, () => {
41
+ var noop = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, () => {
42
42
  }, "noop");
43
43
  var ConsoleLogger = class _ConsoleLogger {
44
44
  static {
45
- _chunk4GA3CHQWcjs.__name.call(void 0, this, "ConsoleLogger");
45
+ _chunk253TSECAcjs.__name.call(void 0, this, "ConsoleLogger");
46
46
  }
47
47
 
48
48
 
@@ -144,7 +144,7 @@ var ConsoleLogger = class _ConsoleLogger {
144
144
  // src/internal/lru-map.ts
145
145
  var LruMap = (_class = class {
146
146
  static {
147
- _chunk4GA3CHQWcjs.__name.call(void 0, this, "LruMap");
147
+ _chunk253TSECAcjs.__name.call(void 0, this, "LruMap");
148
148
  }
149
149
  __init() {this._entries = /* @__PURE__ */ new Map()}
150
150
 
@@ -183,7 +183,7 @@ var LruMap = (_class = class {
183
183
  // src/adapters/in-memory-cache.ts
184
184
  var InMemoryCache = class {
185
185
  static {
186
- _chunk4GA3CHQWcjs.__name.call(void 0, this, "InMemoryCache");
186
+ _chunk253TSECAcjs.__name.call(void 0, this, "InMemoryCache");
187
187
  }
188
188
  // CacheEntry<any> lets `get<TState>` and `set<TState>` flow without casts:
189
189
  // any is bidirectionally compatible with the per-call TState binding, while
@@ -224,25 +224,25 @@ var _zod = require('zod');
224
224
 
225
225
  // src/utils.ts
226
226
 
227
- var validate = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, (target, payload, schema) => {
227
+ var validate = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, (target, payload, schema) => {
228
228
  try {
229
229
  return schema ? schema.parse(payload) : payload;
230
230
  } catch (error) {
231
231
  if (error instanceof _zod.ZodError) {
232
- throw new (0, _chunk4GA3CHQWcjs.ValidationError)(target, payload, _zod.prettifyError.call(void 0, error));
232
+ throw new (0, _chunk253TSECAcjs.ValidationError)(target, payload, _zod.prettifyError.call(void 0, error));
233
233
  }
234
- throw new (0, _chunk4GA3CHQWcjs.ValidationError)(target, payload, error);
234
+ throw new (0, _chunk253TSECAcjs.ValidationError)(target, payload, error);
235
235
  }
236
236
  }, "validate");
237
237
  async function sleep(ms) {
238
238
  return new Promise((resolve) => setTimeout(resolve, _nullishCoalesce(ms, () => ( config().sleepMs))));
239
239
  }
240
- _chunk4GA3CHQWcjs.__name.call(void 0, sleep, "sleep");
240
+ _chunk253TSECAcjs.__name.call(void 0, sleep, "sleep");
241
241
 
242
242
  // src/adapters/in-memory-store.ts
243
243
  var InMemoryStream = (_class2 = class {
244
244
  static {
245
- _chunk4GA3CHQWcjs.__name.call(void 0, this, "InMemoryStream");
245
+ _chunk253TSECAcjs.__name.call(void 0, this, "InMemoryStream");
246
246
  }
247
247
 
248
248
 
@@ -258,7 +258,7 @@ var InMemoryStream = (_class2 = class {
258
258
  __init8() {this._deferred_at = void 0}
259
259
  // Work mark; `undefined` = never correlated, so `claim` skips it.
260
260
  __init9() {this._correlated_at = void 0}
261
- constructor(stream, source, priority = 0, lane = _chunk4GA3CHQWcjs.DEFAULT_LANE) {;_class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);
261
+ constructor(stream, source, priority = 0, lane = _chunk253TSECAcjs.DEFAULT_LANE) {;_class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);_class2.prototype.__init6.call(this);_class2.prototype.__init7.call(this);_class2.prototype.__init8.call(this);_class2.prototype.__init9.call(this);
262
262
  this.stream = stream;
263
263
  this.source = source;
264
264
  this._priority = priority;
@@ -385,14 +385,14 @@ var InMemoryStream = (_class2 = class {
385
385
  return true;
386
386
  }
387
387
  }, _class2);
388
- var name_test = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, (pattern, exact) => {
388
+ var name_test = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, (pattern, exact) => {
389
389
  if (exact) return (name) => name === pattern;
390
390
  const re = new RegExp(pattern);
391
391
  return (name) => re.test(name);
392
392
  }, "name_test");
393
393
  var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10.call(this);_class3.prototype.__init11.call(this);_class3.prototype.__init12.call(this);_class3.prototype.__init13.call(this);_class3.prototype.__init14.call(this);_class3.prototype.__init15.call(this);_class3.prototype.__init16.call(this); }
394
394
  static {
395
- _chunk4GA3CHQWcjs.__name.call(void 0, this, "InMemoryStore");
395
+ _chunk253TSECAcjs.__name.call(void 0, this, "InMemoryStore");
396
396
  }
397
397
  __init10() {this._events = []}
398
398
  // Never reused. Deletions punch holes, so ids are not array indexes.
@@ -458,7 +458,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
458
458
  if (query.names && !query.names.includes(e.name)) return false;
459
459
  if (query.correlation && _optionalChain([e, 'access', _7 => _7.meta, 'optionalAccess', _8 => _8.correlation]) !== query.correlation)
460
460
  return false;
461
- if (e.name === _chunk4GA3CHQWcjs.SNAP_EVENT && !query.with_snaps) return false;
461
+ if (e.name === _chunk253TSECAcjs.SNAP_EVENT && !query.with_snaps) return false;
462
462
  if (query.created_after && e.created <= query.created_after) return false;
463
463
  if (query.created_before && e.created >= query.created_before)
464
464
  return false;
@@ -471,7 +471,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
471
471
  return -1;
472
472
  for (let j = this._events.length - 1; j >= 0; j--) {
473
473
  const e = this._events[j];
474
- if (e.stream === query.stream && e.name === _chunk4GA3CHQWcjs.SNAP_EVENT) return j;
474
+ if (e.stream === query.stream && e.name === _chunk253TSECAcjs.SNAP_EVENT) return j;
475
475
  }
476
476
  return -1;
477
477
  }
@@ -496,9 +496,9 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
496
496
  }
497
497
  async commit(appends, meta) {
498
498
  await sleep();
499
- _chunkXJZ2PKJHcjs.checkAppends.call(void 0, appends);
499
+ _chunkXSLQYVIGcjs.checkAppends.call(void 0, appends);
500
500
  for (const append of appends)
501
- _chunkXJZ2PKJHcjs.checkVersion.call(void 0, append, _nullishCoalesce(this._stream_versions.get(append.stream), () => ( -1)));
501
+ _chunkXSLQYVIGcjs.checkVersion.call(void 0, append, _nullishCoalesce(this._stream_versions.get(append.stream), () => ( -1)));
502
502
  const created = /* @__PURE__ */ new Date();
503
503
  return appends.flatMap(({ stream, msgs }) => {
504
504
  let version = _nullishCoalesce(this._stream_versions.get(stream), () => ( -1));
@@ -522,11 +522,11 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
522
522
  }
523
523
  async claim(lagging, leading, by, millis, lane) {
524
524
  await sleep();
525
- const has_work = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, (s) => s.correlated_at !== void 0 && s.at < s.correlated_at, "has_work");
525
+ const has_work = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, (s) => s.correlated_at !== void 0 && s.at < s.correlated_at, "has_work");
526
526
  const available = [...this._streams.values()].filter(
527
527
  (s) => s.is_available && has_work(s) && (lane === void 0 || s.lane === lane)
528
528
  );
529
- const fair = _chunkXJZ2PKJHcjs.fairSlots.call(void 0, lagging);
529
+ const fair = _chunkXSLQYVIGcjs.fairSlots.call(void 0, lagging);
530
530
  const by_priority = [...available].sort(
531
531
  (a, b) => b.priority - a.priority || a.at - b.at
532
532
  );
@@ -585,7 +585,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
585
585
  stream,
586
586
  source,
587
587
  priority = 0,
588
- lane = _chunk4GA3CHQWcjs.DEFAULT_LANE,
588
+ lane = _chunk253TSECAcjs.DEFAULT_LANE,
589
589
  correlated_at: correlated_at2
590
590
  } of streams) {
591
591
  const existing = this._streams.get(stream);
@@ -670,11 +670,11 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
670
670
  }
671
671
  async query_streams(callback, query) {
672
672
  await sleep();
673
- const limit = _nullishCoalesce(_optionalChain([query, 'optionalAccess', _35 => _35.limit]), () => ( _chunk4GA3CHQWcjs.DEFAULT_QUERY_STREAMS_LIMIT));
673
+ const limit = _nullishCoalesce(_optionalChain([query, 'optionalAccess', _35 => _35.limit]), () => ( _chunk253TSECAcjs.DEFAULT_QUERY_STREAMS_LIMIT));
674
674
  const after = _optionalChain([query, 'optionalAccess', _36 => _36.after]);
675
675
  const source_matches = _optionalChain([query, 'optionalAccess', _37 => _37.source_matches]);
676
676
  const matches = this._filter_predicate(_nullishCoalesce(query, () => ( {})));
677
- const reverse_match = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, (source) => {
677
+ const reverse_match = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, (source) => {
678
678
  const re = new RegExp(source);
679
679
  return source_matches.some((name) => re.test(name));
680
680
  }, "reverse_match");
@@ -717,7 +717,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
717
717
  const array_targets = Array.isArray(input) ? new Set(input) : null;
718
718
  const stream_ok = !Array.isArray(input) && input.stream !== void 0 ? name_test(input.stream, input.stream_exact) : void 0;
719
719
  const scope_cache = /* @__PURE__ */ new Map();
720
- const in_scope = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, (stream) => {
720
+ const in_scope = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, (stream) => {
721
721
  const cached = scope_cache.get(stream);
722
722
  if (cached !== void 0) return cached;
723
723
  const ok = array_targets ? array_targets.has(stream) : _nullishCoalesce(_optionalChain([stream_ok, 'optionalCall', _49 => _49(stream)]), () => ( true));
@@ -764,7 +764,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
764
764
  for (const { stream, before, max_id } of windowed) {
765
765
  let boundary;
766
766
  for (const e of this._events) {
767
- if (e.stream === stream && e.name === _chunk4GA3CHQWcjs.SNAP_EVENT && e.created < before && (max_id === void 0 || e.id <= max_id) && (!boundary || e.id > boundary.id))
767
+ if (e.stream === stream && e.name === _chunk253TSECAcjs.SNAP_EVENT && e.created < before && (max_id === void 0 || e.id <= max_id) && (!boundary || e.id > boundary.id))
768
768
  boundary = e;
769
769
  }
770
770
  if (!boundary) continue;
@@ -793,7 +793,7 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
793
793
  stream,
794
794
  version: 0,
795
795
  created: /* @__PURE__ */ new Date(),
796
- ..._chunkXJZ2PKJHcjs.seedEvent.call(void 0, snapshot, meta)
796
+ ..._chunkXSLQYVIGcjs.seedEvent.call(void 0, snapshot, meta)
797
797
  };
798
798
  this._events.push(event);
799
799
  this._stream_versions.set(stream, 0);
@@ -852,24 +852,24 @@ var InMemoryStore = (_class3 = class {constructor() { _class3.prototype.__init10
852
852
 
853
853
  // src/disposers.ts
854
854
  var entries = [];
855
- var prune = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, () => {
855
+ var prune = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, () => {
856
856
  for (let i = entries.length - 1; i >= 0; i--) {
857
857
  const { ref } = entries[i];
858
858
  if (ref && !ref.deref()) entries.splice(i, 1);
859
859
  }
860
860
  }, "prune");
861
- var register_disposer = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, (run) => {
861
+ var register_disposer = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, (run) => {
862
862
  prune();
863
863
  entries.push({ run });
864
864
  }, "register_disposer");
865
- var register_weak_disposer = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, (ref, run) => {
865
+ var register_weak_disposer = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, (ref, run) => {
866
866
  prune();
867
867
  entries.push({
868
868
  run,
869
869
  ref
870
870
  });
871
871
  }, "register_weak_disposer");
872
- var run_disposers = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, async () => {
872
+ var run_disposers = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, async () => {
873
873
  const failures = [];
874
874
  for (const { run, ref } of [...entries].reverse()) {
875
875
  const target = _optionalChain([ref, 'optionalAccess', _55 => _55.deref, 'call', _56 => _56()]);
@@ -890,7 +890,7 @@ var run_disposers = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, async
890
890
  var MAX_TIMER_DELAY_MS = 2147483647;
891
891
  var DeferTimer = (_class4 = class {
892
892
  static {
893
- _chunk4GA3CHQWcjs.__name.call(void 0, this, "DeferTimer");
893
+ _chunk253TSECAcjs.__name.call(void 0, this, "DeferTimer");
894
894
  }
895
895
  __init17() {this._due = /* @__PURE__ */ new Map()}
896
896
 
@@ -1051,8 +1051,8 @@ function is_time_zone(tz) {
1051
1051
  return false;
1052
1052
  }
1053
1053
  }
1054
- _chunk4GA3CHQWcjs.__name.call(void 0, is_time_zone, "is_time_zone");
1055
- var hour = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, (field) => _zod.z.number().int().min(0).max(23, {
1054
+ _chunk253TSECAcjs.__name.call(void 0, is_time_zone, "is_time_zone");
1055
+ var hour = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, (field) => _zod.z.number().int().min(0).max(23, {
1056
1056
  message: `autocloseWindow.${field} must be an hour in [0, 23]`
1057
1057
  }), "hour");
1058
1058
  var AutocloseOptionsSchema = _zod.z.object({
@@ -1086,7 +1086,7 @@ var DeferWhenSchema = _zod.z.object({
1086
1086
  }).strict().refine((w) => w.after === void 0 !== (w.at === void 0), {
1087
1087
  message: "defer: specify exactly one of `after` or `at`"
1088
1088
  });
1089
- var window_schema = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, (field, min_days, floor) => _zod.z.object({
1089
+ var window_schema = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, (field, min_days, floor) => _zod.z.object({
1090
1090
  days: _zod.z.number({ message: `autocloses: ${field}.days must be a number` }).positive(`autocloses: ${field}.days must be > 0`)
1091
1091
  }).refine((o) => o.days >= min_days, {
1092
1092
  message: `autocloses: ${field} resolves to < ${floor}, which is too short to be a meaningful retention window`
@@ -1152,7 +1152,7 @@ var SCHEMAS = {
1152
1152
  function check(kind, options) {
1153
1153
  return SCHEMAS[kind].parse(options);
1154
1154
  }
1155
- _chunk4GA3CHQWcjs.__name.call(void 0, check, "check");
1155
+ _chunk253TSECAcjs.__name.call(void 0, check, "check");
1156
1156
 
1157
1157
  // src/scoped.ts
1158
1158
  var _async_hooks = require('async_hooks');
@@ -1161,15 +1161,15 @@ var reacting = new (0, _async_hooks.AsyncLocalStorage)();
1161
1161
  function make_run_scoped(bag) {
1162
1162
  return (fn) => scoped.run(bag, fn);
1163
1163
  }
1164
- _chunk4GA3CHQWcjs.__name.call(void 0, make_run_scoped, "make_run_scoped");
1164
+ _chunk253TSECAcjs.__name.call(void 0, make_run_scoped, "make_run_scoped");
1165
1165
  function current_autoclose_window() {
1166
1166
  return _optionalChain([scoped, 'access', _57 => _57.getStore, 'call', _58 => _58(), 'optionalAccess', _59 => _59.autoclose_window]);
1167
1167
  }
1168
- _chunk4GA3CHQWcjs.__name.call(void 0, current_autoclose_window, "current_autoclose_window");
1168
+ _chunk253TSECAcjs.__name.call(void 0, current_autoclose_window, "current_autoclose_window");
1169
1169
  function current_ports() {
1170
1170
  return scoped.getStore();
1171
1171
  }
1172
- _chunk4GA3CHQWcjs.__name.call(void 0, current_ports, "current_ports");
1172
+ _chunk253TSECAcjs.__name.call(void 0, current_ports, "current_ports");
1173
1173
  function run_reacting(event, fn) {
1174
1174
  const box = { event };
1175
1175
  return reacting.run(box, async () => {
@@ -1180,15 +1180,15 @@ function run_reacting(event, fn) {
1180
1180
  }
1181
1181
  });
1182
1182
  }
1183
- _chunk4GA3CHQWcjs.__name.call(void 0, run_reacting, "run_reacting");
1183
+ _chunk253TSECAcjs.__name.call(void 0, run_reacting, "run_reacting");
1184
1184
  function current_reacting() {
1185
1185
  return _optionalChain([reacting, 'access', _60 => _60.getStore, 'call', _61 => _61(), 'optionalAccess', _62 => _62.event]);
1186
1186
  }
1187
- _chunk4GA3CHQWcjs.__name.call(void 0, current_reacting, "current_reacting");
1187
+ _chunk253TSECAcjs.__name.call(void 0, current_reacting, "current_reacting");
1188
1188
  function make_reaction_scope(app) {
1189
1189
  return { app, run: run_reacting };
1190
1190
  }
1191
- _chunk4GA3CHQWcjs.__name.call(void 0, make_reaction_scope, "make_reaction_scope");
1191
+ _chunk253TSECAcjs.__name.call(void 0, make_reaction_scope, "make_reaction_scope");
1192
1192
 
1193
1193
  // src/ports.ts
1194
1194
  var adapters = /* @__PURE__ */ new Map();
@@ -1202,28 +1202,28 @@ function port(injector) {
1202
1202
  return adapters.get(injector.name);
1203
1203
  };
1204
1204
  }
1205
- _chunk4GA3CHQWcjs.__name.call(void 0, port, "port");
1206
- var log = port(/* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, function log2(adapter) {
1205
+ _chunk253TSECAcjs.__name.call(void 0, port, "port");
1206
+ var log = port(/* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, function log2(adapter) {
1207
1207
  const cfg = config();
1208
1208
  return adapter || new ConsoleLogger({
1209
1209
  level: cfg.logLevel,
1210
1210
  pretty: cfg.env !== "production"
1211
1211
  });
1212
1212
  }, "log"));
1213
- var _store = port(/* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, function store(adapter) {
1213
+ var _store = port(/* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, function store(adapter) {
1214
1214
  if (adapter) check("store", adapter);
1215
1215
  return _nullishCoalesce(adapter, () => ( new InMemoryStore()));
1216
1216
  }, "store"));
1217
- var store2 = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, ((adapter) => {
1217
+ var store2 = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, ((adapter) => {
1218
1218
  return _nullishCoalesce(_optionalChain([current_ports, 'call', _63 => _63(), 'optionalAccess', _64 => _64.store]), () => ( _store(adapter)));
1219
1219
  }), "store");
1220
- var _cache = port(/* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, function cache(adapter) {
1220
+ var _cache = port(/* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, function cache(adapter) {
1221
1221
  return _nullishCoalesce(adapter, () => ( new InMemoryCache()));
1222
1222
  }, "cache"));
1223
- var cache2 = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, ((adapter) => {
1223
+ var cache2 = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, ((adapter) => {
1224
1224
  return _nullishCoalesce(_optionalChain([current_ports, 'call', _65 => _65(), 'optionalAccess', _66 => _66.cache]), () => ( _cache(adapter)));
1225
1225
  }), "cache");
1226
- var unscoped_ports = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, () => DEFAULT_SCOPE, "unscoped_ports");
1226
+ var unscoped_ports = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, () => DEFAULT_SCOPE, "unscoped_ports");
1227
1227
  var DEFAULT_SCOPE = {
1228
1228
  get store() {
1229
1229
  return _store();
@@ -1253,12 +1253,12 @@ async function disposeAndExit(code = "EXIT") {
1253
1253
  const failed = code === "ERROR" || failures.length > 0;
1254
1254
  config().env !== "test" && process.exit(failed ? 1 : 0);
1255
1255
  }
1256
- _chunk4GA3CHQWcjs.__name.call(void 0, disposeAndExit, "disposeAndExit");
1256
+ _chunk253TSECAcjs.__name.call(void 0, disposeAndExit, "disposeAndExit");
1257
1257
  function dispose(disposer) {
1258
1258
  disposer && register_disposer(disposer);
1259
1259
  return disposeAndExit;
1260
1260
  }
1261
- _chunk4GA3CHQWcjs.__name.call(void 0, dispose, "dispose");
1261
+ _chunk253TSECAcjs.__name.call(void 0, dispose, "dispose");
1262
1262
 
1263
1263
  // src/config.ts
1264
1264
  var package_schema = _zod.z.object({
@@ -1274,7 +1274,7 @@ var FALLBACK_PACKAGE = {
1274
1274
  version: "0.0.0-fallback",
1275
1275
  description: "Synthetic fallback \u2014 package.json could not be loaded"
1276
1276
  };
1277
- var get_package = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, () => {
1277
+ var get_package = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, () => {
1278
1278
  try {
1279
1279
  const raw = JSON.parse(fs.readFileSync("package.json").toString());
1280
1280
  const pkg2 = {
@@ -1293,8 +1293,8 @@ var get_package = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, () => {
1293
1293
  }, "get_package");
1294
1294
  var pkg_load_error;
1295
1295
  var BaseSchema = package_schema.extend({
1296
- env: _zod.z.enum(_chunk4GA3CHQWcjs.Environments),
1297
- logLevel: _zod.z.enum(_chunk4GA3CHQWcjs.LogLevels),
1296
+ env: _zod.z.enum(_chunk253TSECAcjs.Environments),
1297
+ logLevel: _zod.z.enum(_chunk253TSECAcjs.LogLevels),
1298
1298
  logSingleLine: _zod.z.boolean(),
1299
1299
  sleepMs: _zod.z.number().int().min(0).max(5e3)
1300
1300
  });
@@ -1305,7 +1305,7 @@ var logSingleLine = (LOG_SINGLE_LINE || "true") === "true";
1305
1305
  var sleepMs = parseInt(NODE_ENV === "test" ? "0" : _nullishCoalesce(SLEEP_MS, () => ( "100")), 10);
1306
1306
  var pkg = get_package();
1307
1307
  var _validated;
1308
- var config = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, () => {
1308
+ var config = /* @__PURE__ */ _chunk253TSECAcjs.__name.call(void 0, () => {
1309
1309
  if (!_validated) {
1310
1310
  _validated = validate(
1311
1311
  "config",
@@ -1354,4 +1354,4 @@ var config = /* @__PURE__ */ _chunk4GA3CHQWcjs.__name.call(void 0, () => {
1354
1354
 
1355
1355
 
1356
1356
  exports.ConsoleLogger = ConsoleLogger; exports.LruMap = LruMap; exports.InMemoryCache = InMemoryCache; exports.package_schema = package_schema; exports.config = config; exports.validate = validate; exports.sleep = sleep; exports.InMemoryStore = InMemoryStore; exports.register_weak_disposer = register_weak_disposer; exports.DeferTimer = DeferTimer; exports.DEFAULT_BACKOFF = DEFAULT_BACKOFF; exports.DEFAULT_MAX_RETRIES = DEFAULT_MAX_RETRIES; exports.DEFAULT_BLOCK_ON_ERROR = DEFAULT_BLOCK_ON_ERROR; exports.DEFAULT_STREAM_LIMIT = DEFAULT_STREAM_LIMIT; exports.DEFAULT_EVENT_LIMIT = DEFAULT_EVENT_LIMIT; exports.DEFAULT_LEASE_MILLIS = DEFAULT_LEASE_MILLIS; exports.MAX_SHUTDOWN_GRACE_MS = MAX_SHUTDOWN_GRACE_MS; exports.check = check; exports.make_run_scoped = make_run_scoped; exports.current_autoclose_window = current_autoclose_window; exports.current_reacting = current_reacting; exports.make_reaction_scope = make_reaction_scope; exports.port = port; exports.log = log; exports.store = store2; exports.cache = cache2; exports.unscoped_ports = unscoped_ports; exports.disposeAndExit = disposeAndExit; exports.dispose = dispose;
1357
- //# sourceMappingURL=chunk-UYNNDDE7.cjs.map
1357
+ //# sourceMappingURL=chunk-EXXHQ7CS.cjs.map