@rotorsoft/act 1.32.28 → 1.32.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +10 -8
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/@types/config.d.ts.map +1 -1
  4. package/dist/@types/internal/autoclose-policy.d.ts +8 -49
  5. package/dist/@types/internal/autoclose-policy.d.ts.map +1 -1
  6. package/dist/@types/internal/autoclose-reaction.d.ts +0 -7
  7. package/dist/@types/internal/autoclose-reaction.d.ts.map +1 -1
  8. package/dist/@types/internal/autoclose-window.d.ts +1 -14
  9. package/dist/@types/internal/autoclose-window.d.ts.map +1 -1
  10. package/dist/@types/internal/backoff.d.ts +1 -6
  11. package/dist/@types/internal/backoff.d.ts.map +1 -1
  12. package/dist/@types/internal/circuit-breaker.d.ts +6 -7
  13. package/dist/@types/internal/circuit-breaker.d.ts.map +1 -1
  14. package/dist/@types/internal/close-cycle.d.ts +0 -13
  15. package/dist/@types/internal/close-cycle.d.ts.map +1 -1
  16. package/dist/@types/internal/close-signal.d.ts +0 -5
  17. package/dist/@types/internal/close-signal.d.ts.map +1 -1
  18. package/dist/@types/internal/config.d.ts +7 -39
  19. package/dist/@types/internal/config.d.ts.map +1 -1
  20. package/dist/@types/internal/correlator.d.ts +0 -7
  21. package/dist/@types/internal/correlator.d.ts.map +1 -1
  22. package/dist/@types/internal/date-reviver.d.ts +0 -5
  23. package/dist/@types/internal/date-reviver.d.ts.map +1 -1
  24. package/dist/@types/internal/defer-config.d.ts +0 -13
  25. package/dist/@types/internal/defer-config.d.ts.map +1 -1
  26. package/dist/@types/internal/defer-signal.d.ts +0 -3
  27. package/dist/@types/internal/defer-signal.d.ts.map +1 -1
  28. package/dist/@types/internal/defer-timer.d.ts +1 -5
  29. package/dist/@types/internal/defer-timer.d.ts.map +1 -1
  30. package/dist/@types/internal/drain-cycle.d.ts +2 -2
  31. package/dist/@types/internal/drain-ratio.d.ts +0 -5
  32. package/dist/@types/internal/drain-ratio.d.ts.map +1 -1
  33. package/dist/@types/internal/drain.d.ts +0 -6
  34. package/dist/@types/internal/drain.d.ts.map +1 -1
  35. package/dist/@types/internal/event-versions.d.ts +0 -9
  36. package/dist/@types/internal/event-versions.d.ts.map +1 -1
  37. package/dist/@types/internal/index.d.ts +0 -5
  38. package/dist/@types/internal/index.d.ts.map +1 -1
  39. package/dist/@types/internal/lru-map.d.ts +0 -9
  40. package/dist/@types/internal/lru-map.d.ts.map +1 -1
  41. package/dist/@types/internal/projection-fold.d.ts +0 -3
  42. package/dist/@types/internal/projection-fold.d.ts.map +1 -1
  43. package/dist/@types/internal/report-once.d.ts +0 -7
  44. package/dist/@types/internal/report-once.d.ts.map +1 -1
  45. package/dist/@types/internal/sensitive.d.ts +6 -38
  46. package/dist/@types/internal/sensitive.d.ts.map +1 -1
  47. package/dist/@types/internal/settle.d.ts +0 -9
  48. package/dist/@types/internal/settle.d.ts.map +1 -1
  49. package/dist/@types/internal/tracing.d.ts +0 -11
  50. package/dist/@types/internal/tracing.d.ts.map +1 -1
  51. package/dist/@types/internal/walk-streams.d.ts +0 -2
  52. package/dist/@types/internal/walk-streams.d.ts.map +1 -1
  53. package/dist/@types/types/ports.d.ts +1 -1
  54. package/dist/{chunk-F7K7SIG6.js → chunk-HHKLVRR4.js} +1 -1
  55. package/dist/chunk-HHKLVRR4.js.map +1 -0
  56. package/dist/{chunk-5FXT63KF.js → chunk-X3MMQIIP.js} +12 -4
  57. package/dist/chunk-X3MMQIIP.js.map +1 -0
  58. package/dist/index.cjs +17 -8
  59. package/dist/index.cjs.map +1 -1
  60. package/dist/index.js +9 -8
  61. package/dist/index.js.map +1 -1
  62. package/dist/test/index.cjs +10 -2
  63. package/dist/test/index.cjs.map +1 -1
  64. package/dist/test/index.js +2 -2
  65. package/dist/types/index.cjs.map +1 -1
  66. package/dist/types/index.js +1 -1
  67. package/package.json +1 -1
  68. package/dist/chunk-5FXT63KF.js.map +0 -1
  69. package/dist/chunk-F7K7SIG6.js.map +0 -1
@@ -1,7 +1,4 @@
1
1
  /**
2
- * @module event-versions
3
- * @category Internal
4
- *
5
2
  * Auto-deprecation of legacy event versions via the `_v<digits>` naming
6
3
  * convention.
7
4
  *
@@ -14,8 +11,6 @@
14
11
  * Convention pin: only `_v<digits>` with digits ≥ 2 counts as a version
15
12
  * suffix. `Foo_v1` is just a literal event name (the base `Foo` is
16
13
  * implicitly v1). Pinning here keeps the contract surface small.
17
- *
18
- * @internal
19
14
  */
20
15
  /**
21
16
  * Returns the set of event names that are deprecated by virtue of having
@@ -26,8 +21,6 @@
26
21
  * current. The framework picks the max regardless of contiguity.
27
22
  *
28
23
  * Single-version groups (no siblings) yield no deprecations.
29
- *
30
- * @internal
31
24
  */
32
25
  export declare function deprecated_event_names(names: Iterable<string>): Set<string>;
33
26
  /**
@@ -37,8 +30,6 @@ export declare function deprecated_event_names(names: Iterable<string>): Set<str
37
30
  *
38
31
  * Returns `undefined` if the event has no higher-versioned sibling (which
39
32
  * means the caller's classification is stale or wrong).
40
- *
41
- * @internal
42
33
  */
43
34
  export declare function current_version_of(deprecated_name: string, all_names: Iterable<string>): string | undefined;
44
35
  //# sourceMappingURL=event-versions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-versions.d.ts","sourceRoot":"","sources":["../../../src/internal/event-versions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAmBH;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAiC3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,GAC1B,MAAM,GAAG,SAAS,CASpB"}
1
+ {"version":3,"file":"event-versions.d.ts","sourceRoot":"","sources":["../../../src/internal/event-versions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAmBH;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAiC3E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,GAC1B,MAAM,GAAG,SAAS,CASpB"}
@@ -1,7 +1,4 @@
1
1
  /**
2
- * @module internal
3
- * @category Internal
4
- *
5
2
  * Barrel for framework-internal modules. These exports are not part of the
6
3
  * public package API and may change between minors. Anything reachable from
7
4
  * `@rotorsoft/act`'s top-level barrel (`src/index.ts`) is the public surface;
@@ -13,8 +10,6 @@
13
10
  * directly by file path; production code in `adapters/` and tests that
14
11
  * need bare ops (e.g., `action`, `load`, `LruMap`) likewise import from
15
12
  * the specific source file.
16
- *
17
- * @internal
18
13
  */
19
14
  export { type AuditDeps, audit } from "./audit.js";
20
15
  export { type AutoclosePolicy, compile_autoclose_policy, policy_keep_days, policy_min_after_days, } from "./autoclose-policy.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,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,eAAe,GAChB,MAAM,kBAAk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EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,KAAK,aAAa,EAClB,aAAa,EACb,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EACL,eAAe,EACf,QAAQ,EACR,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,SAAS,EACd,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
@@ -1,7 +1,4 @@
1
1
  /**
2
- * @module lru-map
3
- * @category Internal
4
- *
5
2
  * Tiny bounded LRU map / set built on insertion-ordered `Map`. Used to cap
6
3
  * memory in long-running orchestrators that mint large numbers of keys —
7
4
  * notably:
@@ -11,14 +8,10 @@
11
8
  *
12
9
  * Apps with millions of dynamic streams (one target per aggregate) can't
13
10
  * afford an unbounded `Set<string>` — eviction is required.
14
- *
15
- * @internal
16
11
  */
17
12
  /**
18
13
  * Bounded LRU map. `get()` promotes; `has()` does not. `set()` always
19
14
  * promotes and evicts the oldest entry when at capacity.
20
- *
21
- * @internal
22
15
  */
23
16
  export declare class LruMap<K, V> {
24
17
  private readonly _entries;
@@ -35,8 +28,6 @@ export declare class LruMap<K, V> {
35
28
  * Bounded LRU set built on top of {@link LruMap}. `has()` does not promote;
36
29
  * `add()` does (re-inserting if already present, evicting the oldest at
37
30
  * capacity).
38
- *
39
- * @internal
40
31
  */
41
32
  export declare class LruSet<T> {
42
33
  private readonly _map;
@@ -1 +1 @@
1
- {"version":3,"file":"lru-map.d.ts","sourceRoot":"","sources":["../../../src/internal/lru-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;GAKG;AACH,qBAAa,MAAM,CAAC,CAAC,EAAE,CAAC;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAOzB;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAEnB;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAS1B;IAED,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAEtB;IAED,KAAK,IAAI,IAAI,CAEZ;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF;AAED;;;;;;GAMG;AACH,qBAAa,MAAM,CAAC,CAAC;IACnB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkB;IAEvC,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAErB;IAED,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAElB;IAED,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAExB;IAED,KAAK,IAAI,IAAI,CAEZ;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
1
+ {"version":3,"file":"lru-map.d.ts","sourceRoot":"","sources":["../../../src/internal/lru-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;GAGG;AACH,qBAAa,MAAM,CAAC,CAAC,EAAE,CAAC;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAOzB;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAEnB;IAED,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAS1B;IAED,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAEtB;IAED,KAAK,IAAI,IAAI,CAEZ;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF;AAED;;;;GAIG;AACH,qBAAa,MAAM,CAAC,CAAC;IACnB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAkB;IAEvC,YAAY,OAAO,EAAE,MAAM,EAE1B;IAED,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAErB;IAED,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAElB;IAED,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAExB;IAED,KAAK,IAAI,IAAI,CAEZ;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
@@ -1,7 +1,4 @@
1
1
  /**
2
- * @module projection-fold
3
- * @category Internal
4
- *
5
2
  * Fold engine behind `projection(name).of(state)` — maintains per-stream
6
3
  * folded states in a bounded in-memory cache and flushes one row per dirty
7
4
  * stream per round, so write amplification tracks the distinct-key count
@@ -1 +1 @@
1
- {"version":3,"file":"projection-fold.d.ts","sourceRoot":"","sources":["../../../src/internal/projection-fold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,MAAM,EACN,OAAO,EACP,KAAK,EACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAmBrE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,eAA2B,CAAC;AAEnD,qEAAqE;AACrE,MAAM,MAAM,sBAAsB,CAAC,OAAO,SAAS,OAAO,IACxD,YAAY,CAAC,OAAO,CAAC,GAAG;IACtB,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC;CACpC,CAAC;AAEJ;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,SAAS,MAAM,EACrB,OAAO,SAAS,OAAO,EACvB,QAAQ,SAAS,OAAO,EAExB,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EACpC,KAAK,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EACjE,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,OAAO,YAAa,EAC9B,gBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,GAC1D,YAAY,CAAC,OAAO,CAAC,CAyIvB"}
1
+ {"version":3,"file":"projection-fold.d.ts","sourceRoot":"","sources":["../../../src/internal/projection-fold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,MAAM,EACN,OAAO,EACP,KAAK,EACN,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAerE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU,eAA2B,CAAC;AAEnD,qEAAqE;AACrE,MAAM,MAAM,sBAAsB,CAAC,OAAO,SAAS,OAAO,IACxD,YAAY,CAAC,OAAO,CAAC,GAAG;IACtB,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC;CACpC,CAAC;AAEJ;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,SAAS,MAAM,EACrB,OAAO,SAAS,OAAO,EACvB,QAAQ,SAAS,OAAO,EAExB,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EACpC,KAAK,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EACjE,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,OAAO,YAAa,EAC9B,gBAAgB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,GAC1D,YAAY,CAAC,OAAO,CAAC,CAyIvB"}
@@ -1,7 +1,4 @@
1
1
  /**
2
- * @module report-once
3
- * @category Internal
4
- *
5
2
  * One-shot reporting for a misdeclaration that a build-time guard could not
6
3
  * catch.
7
4
  *
@@ -29,8 +26,6 @@
29
26
  * Never throws. A throw inside correlate pins the checkpoint for the whole app;
30
27
  * inside drain it reaches the circuit breaker as a store failure and
31
28
  * stalls every stream.
32
- *
33
- * @internal
34
29
  */
35
30
  /**
36
31
  * Report `message` the first time `key` is seen, and never again.
@@ -43,8 +38,6 @@
43
38
  * @param key - Identifies the offending declaration, not the occurrence —
44
39
  * declared identifiers only, never a runtime-resolved target.
45
40
  * @param message - Wrapped in an `Error` so the logger renders a stack.
46
- *
47
- * @internal
48
41
  */
49
42
  export declare function report_once(seen: Set<string>, key: string, message: string): void;
50
43
  //# sourceMappingURL=report-once.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"report-once.d.ts","sourceRoot":"","sources":["../../../src/internal/report-once.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAIH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EACjB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,IAAI,CAIN"}
1
+ {"version":3,"file":"report-once.d.ts","sourceRoot":"","sources":["../../../src/internal/report-once.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EACjB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,GACd,IAAI,CAIN"}
@@ -1,24 +1,8 @@
1
1
  /**
2
- * @module sensitive
3
- * @category Internal
4
- *
5
- * Internal mechanics for the sensitive-data foundation.
6
- * The public surface (`sensitive(zodType)`) lives at `libs/act/src/sensitive.ts`
7
- * and re-exports `REDACTED` / `SHREDDED` from here; this module holds the
8
- * registry plus the helpers the orchestrator calls during commit, load, and
9
- * handler dispatch.
10
- *
11
- * - `_registry` — process-global `z.registry<{ sensitive: true }>()`. Public
12
- * `sensitive()` adds to it; the helpers in this module read it.
13
- * - `pii_fields(schema)` — walk a Zod schema's top-level shape, return the
14
- * keys marked via `sensitive(...)`.
15
- * - `pii_gate(event, fields, predicate, actor)` — produce the external
16
- * view: plaintext when authorized, `[REDACTED]` when not, `[SHREDDED]`
17
- * when the underlying pii column is null.
18
- * - `pii_strip(event, fields)` — remove sensitive keys entirely
19
- * before invoking projection / reaction handlers.
20
- *
21
- * @internal
2
+ * Internal mechanics for sensitive data: the registry the public
3
+ * `sensitive(zodType)` (in `types/schemas.ts`) marks, and the helpers the
4
+ * orchestrator calls during commit, load and handler dispatch to gate,
5
+ * redact, shred or strip those fields.
22
6
  */
23
7
  import { z } from "zod";
24
8
  import type { Actor, Committed, Schemas } from "../types/index.js";
@@ -28,7 +12,7 @@ import type { Actor, Committed, Schemas } from "../types/index.js";
28
12
  * or no predicate was declared (framework default-deny). Recoverable: a
29
13
  * properly-authorized read returns the plaintext.
30
14
  *
31
- * Re-exported from `libs/act/src/sensitive.ts` as part of the public surface.
15
+ * Re-exported from `types/schemas.ts` as part of the public surface.
32
16
  */
33
17
  export declare const REDACTED: "[REDACTED]";
34
18
  /**
@@ -36,7 +20,7 @@ export declare const REDACTED: "[REDACTED]";
36
20
  * been wiped via `Store.forget_pii(stream)` — the row's pii column is `NULL`
37
21
  * and the original plaintext is gone forever. Irrecoverable.
38
22
  *
39
- * Re-exported from `libs/act/src/sensitive.ts` as part of the public surface.
23
+ * Re-exported from `types/schemas.ts` as part of the public surface.
40
24
  */
41
25
  export declare const SHREDDED: "[SHREDDED]";
42
26
  /**
@@ -47,8 +31,6 @@ export declare const SHREDDED: "[SHREDDED]";
47
31
  *
48
32
  * Exported so the public `sensitive(zodType)` wrapper can call `_registry.add`.
49
33
  * Underscore prefix marks "framework-private, don't touch from user code."
50
- *
51
- * @internal
52
34
  */
53
35
  export declare const _registry: z.core.$ZodRegistry<{
54
36
  sensitive: true;
@@ -56,8 +38,6 @@ export declare const _registry: z.core.$ZodRegistry<{
56
38
  /**
57
39
  * Stamp the def-level marker. Called by the public `sensitive()` alongside
58
40
  * `_registry.add`.
59
- *
60
- * @internal
61
41
  */
62
42
  export declare function _mark_sensitive(schema: z.ZodType): void;
63
43
  /**
@@ -81,8 +61,6 @@ export declare function _mark_sensitive(schema: z.ZodType): void;
81
61
  * Returning the schemas rather than just the names is what lets a caller do
82
62
  * something per field — the event builder asks each one whether it holds a
83
63
  * date, so the `pii` sidecar's dates can be revived like any other.
84
- *
85
- * @internal
86
64
  */
87
65
  export declare function pii_schemas(schema: z.ZodType): Record<string, z.ZodType>;
88
66
  /**
@@ -102,8 +80,6 @@ export declare function pii_fields(schema: z.ZodType): readonly string[];
102
80
  * spread-and-delete-free implementation in slice 3, just hoisted out of the
103
81
  * orchestrator hot path so it's only invoked when the State actually has a
104
82
  * sensitive event.
105
- *
106
- * @internal
107
83
  */
108
84
  export declare function pii_split<TName, TData extends Record<string, unknown>>(emitted: {
109
85
  name: TName;
@@ -125,8 +101,6 @@ export declare function pii_split<TName, TData extends Record<string, unknown>>(
125
101
  * lookup nor allocates per event.
126
102
  *
127
103
  * The `actor` is optional so the actor-less surfaces can call `gate(event)`.
128
- *
129
- * @internal
130
104
  */
131
105
  export type EventGate = <TEvents extends Schemas, TKey extends keyof TEvents>(event: Committed<TEvents, TKey>, actor?: Actor) => Committed<TEvents, TKey>;
132
106
  /**
@@ -134,8 +108,6 @@ export type EventGate = <TEvents extends Schemas, TKey extends keyof TEvents>(ev
134
108
  * single frozen reference the builder hands back for non-sensitive events, so
135
109
  * the common path is one `Map` miss and an identity call, no allocation. This
136
110
  * is the "by default, return the event" half of the prebuilt per-event gate.
137
- *
138
- * @internal
139
111
  */
140
112
  export declare const IDENTITY_GATE: EventGate;
141
113
  /**
@@ -151,8 +123,6 @@ export declare const IDENTITY_GATE: EventGate;
151
123
  * Either way the isolated `pii` sidecar is dropped. The builder stores one gate
152
124
  * per sensitive event (per state for the load path; predicate-less for the
153
125
  * query path); non-sensitive events fall back to {@link IDENTITY_GATE}.
154
- *
155
- * @internal
156
126
  */
157
127
  export declare function make_gate(fields: readonly string[], predicate: ((event: any, actor: Actor) => boolean) | null): EventGate;
158
128
  /**
@@ -170,8 +140,6 @@ export declare function make_gate(fields: readonly string[], predicate: ((event:
170
140
  * `email`) opt back in by explicitly calling `app.load(stream, { actor:
171
141
  * system_actor })` inside the handler — pulling PII through the gate at the
172
142
  * call site makes the security-relevant path visible in code review.
173
- *
174
- * @internal
175
143
  */
176
144
  export declare function pii_strip<TEvents extends Schemas, TKey extends keyof TEvents & string>(event: Committed<TEvents, TKey>, fields: readonly string[]): Committed<TEvents, TKey>;
177
145
  //# sourceMappingURL=sensitive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sensitive.d.ts","sourceRoot":"","sources":["../../../src/internal/sensitive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEnE;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAG,YAAqB,CAAC;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,EAAG,YAAqB,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS;eAA2B,IAAI;iFAAK,CAAC;AAiB3D;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,IAAI,CAOvD;AA+BD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAmBxE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,SAAS,MAAM,EAAE,CAE/D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpE,OAAO,EAAE;IAAE,IAAI,EAAE,K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AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,GAAG,IAAI,GACxD,SAAS,CAEX;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CACvB,OAAO,SAAS,OAAO,EACvB,IAAI,SAAS,MAAM,OAAO,GAAG,MAAM,EAEnC,KAAK,EAAE,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,EAC/B,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAe1B"}
@@ -1,7 +1,4 @@
1
1
  /**
2
- * @module settle
3
- * @category Internal
4
- *
5
2
  * Debounced correlate→drain loop. Sits one level above both correlation
6
3
  * and drain: schedule() coalesces rapid callers into a single cycle, then
7
4
  * runs correlate+drain in a loop until a pass produces no progress.
@@ -9,8 +6,6 @@
9
6
  * Owns the debounce timer and the reentrancy flag. Everything else is
10
7
  * supplied via the `SettleDeps` callbacks so this module stays free of
11
8
  * orchestrator state.
12
- *
13
- * @internal
14
9
  */
15
10
  import type { Drain, DrainOptions, Query, Schemas, SettleOptions } from "../types/index.js";
16
11
  import type { CircuitBreaker } from "./circuit-breaker.js";
@@ -18,8 +13,6 @@ import type { CircuitBreaker } from "./circuit-breaker.js";
18
13
  * Callbacks the settle loop needs from the orchestrator. Modeled as an
19
14
  * input bag so this file doesn't import `Act` (avoids a cycle) and stays
20
15
  * independently testable.
21
- *
22
- * @internal
23
16
  */
24
17
  export type SettleDeps<TEvents extends Schemas> = {
25
18
  readonly init: () => Promise<void>;
@@ -43,8 +36,6 @@ export type SettleDeps<TEvents extends Schemas> = {
43
36
  /**
44
37
  * Drives the debounced correlate→drain catch-up cycle. One instance per
45
38
  * Act orchestrator.
46
- *
47
- * @internal
48
39
  */
49
40
  export declare class SettleLoop<TEvents extends Schemas> {
50
41
  private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,CAAC,OAAO,SAAS,OAAO;IAC7C,OAAO,CAAC,MAAM,CAAwD;IACtE,OAAO,CAAC,QAAQ,CAAS;IACzB;;;OAGG;IACH,OAAO,CAAC,SAAS,CAA4B;IAC7C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAwC;IACxD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAsB;IAC5C,+FAA+F;IAC/F,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAE9C,YAAY,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,mBAAmB,EAAE,MAAM,EAGjE;IAED;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,GAAE,aAAkB,GAAG,IAAI,CAuF1C;IAED;;;;OAIG;IACH,IAAI,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAExC;IAED,6DAA6D;IAC7D,IAAI,IAAI,IAAI,CAQX;CACF"}
@@ -1,7 +1,4 @@
1
1
  /**
2
- * @module tracing
3
- * @category Internal
4
- *
5
2
  * Centralized observability for the framework's internal pipelines.
6
3
  *
7
4
  * Trace decorators wrap a bare implementation with `logger.trace(...)` calls
@@ -22,8 +19,6 @@
22
19
  * orchestrator choose bare or traced variants once at `.build()` time based
23
20
  * on the configured log level. Outside this module, no other source file
24
21
  * imports tracing primitives.
25
- *
26
- * @internal
27
22
  */
28
23
  import type { Correlator, Logger, Schemas } from "../types/index.js";
29
24
  import type { DrainOps } from "./drain.js";
@@ -31,15 +26,11 @@ import type { EsOps, PatchFn } from "./event-sourcing.js";
31
26
  /**
32
27
  * Selects bare or traced event-sourcing handlers. Called once by the
33
28
  * orchestrator constructor.
34
- *
35
- * @internal
36
29
  */
37
30
  export declare function build_es(logger: Logger, correlator?: Correlator, patch_fn?: PatchFn): EsOps;
38
31
  /**
39
32
  * Selects bare or traced drain-pipeline ops. Called once by the orchestrator
40
33
  * constructor.
41
- *
42
- * @internal
43
34
  */
44
35
  export declare function build_drain<TEvents extends Schemas>(logger: Logger): DrainOps<TEvents>;
45
36
  /**
@@ -64,8 +55,6 @@ export declare function build_drain<TEvents extends Schemas>(logger: Logger): Dr
64
55
  * marker and its adjacent post-state share the marker's color so the
65
56
  * eye reads "outcome + where it landed" as one unit. Per-stream
66
57
  * `[events]` and `(error)` stay dim — secondary context.
67
- *
68
- * @internal
69
58
  */
70
59
  export declare function trace_cycle<TEvents extends Schemas>(logger: Logger, leased: ReadonlyArray<{
71
60
  readonly stream: string;
@@ -1 +1 @@
1
- {"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../../src/internal/tracing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,EAAQ,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAiI1D;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,UAA+B,EAC3C,QAAQ,GAAE,OAAuB,GAChC,KAAK,CA4FP;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,SAAS,OAAO,EACjD,MAAM,EAAE,MAAM,GACb,QAAQ,CAAC,OAAO,CAAC,CAoCnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,WAAW,CAAC,OAAO,SAAS,OAAO,EACjD,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC,EACF,OAAO,EAA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AQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAC1E,IAAI,CAwDN"}
@@ -15,8 +15,6 @@ import type { QueryStreams, Store, StreamPosition } from "../types/index.js";
15
15
  * @param query - Optional filter. A caller-supplied `limit` sets the page
16
16
  * size (the walk still visits every match); `after` seeds the cursor.
17
17
  * @returns The total number of positions emitted.
18
- *
19
- * @internal
20
18
  */
21
19
  export declare function walk_streams(store: Store, callback: (position: StreamPosition) => void, query?: Omit<QueryStreams, "after" | "limit"> & {
22
20
  after?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"walk-streams.d.ts","sourceRoot":"","sources":["../../../src/internal/walk-streams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAK7E;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAC5C,KAAK,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACA,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
1
+ {"version":3,"file":"walk-streams.d.ts","sourceRoot":"","sources":["../../../src/internal/walk-streams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAK7E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAC5C,KAAK,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACA,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
@@ -892,7 +892,7 @@ export interface Store extends Disposable, EventSource {
892
892
  reset: (input: string[] | StreamFilter) => Promise<number>;
893
893
  /**
894
894
  * Clears the blocked flag on streams without replaying their history.
895
- * Sets `blocked = false`, `retry_count = 0`, `error = null`, and
895
+ * Sets `blocked = false`, `retry = -1` (no attempt yet), `error = null`, and
896
896
  * clears any lease bookkeeping. The `at` watermark stays where it
897
897
  * was — the stream resumes from the next event after the last
898
898
  * successful ack, not from zero.
@@ -280,4 +280,4 @@ export {
280
280
  Environments,
281
281
  LogLevels
282
282
  };
283
- //# sourceMappingURL=chunk-F7K7SIG6.js.map
283
+ //# sourceMappingURL=chunk-HHKLVRR4.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 * @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 * @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 * @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 an\n * `error` lifecycle event instead of silently spinning on a down\n * database.\n *\n * @example\n * ```typescript\n * app.on(\"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 function notifyPartner(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 */\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 { _mark_sensitive, _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 * Sensitive-data foundation re-exports.\n *\n * - `REDACTED` / `SHREDDED` — sentinels placed in `event.data[field]`\n * when the caller isn't authorized to see a sensitive field\n * (`.discloses(predicate)` returned `false` or none was declared —\n * recoverable) or the underlying PII was wiped (`Store.forget_pii` —\n * irrecoverable).\n * top-level field names marked via {@link sensitive}. A pure,\n * read-only helper that inspects the out-of-band sensitive registry (a\n * process-global `WeakMap`) `sensitive()` populates, otherwise\n * unreachable from outside the package. Surfaced for adapters and\n * tooling that must reflect input sensitivity on their own wire\n * surface — e.g. the `@rotorsoft/act-http/openapi` emitter marks these\n * fields `writeOnly` + `format: password` so generated clients and\n * Swagger UI don't echo PII freely. Returns `[]` for non-object\n * schemas or objects with no sensitive fields; top-level shape only.\n */\nexport { pii_fields, 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.\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 // Also stamp the def, so the marker survives the clone Zod produces for\n // any refinement chained AFTER this call — `sensitive(z.string()).min(1)`\n // used to lose it silently and write plaintext into `events.data`.\n _mark_sensitive(schema);\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 with_pii: z.boolean().optional(),\n stream_exact: z.boolean().optional(),\n })\n .readonly();\n","/**\n * Internal mechanics for sensitive data: the registry the public\n * `sensitive(zodType)` (in `types/schemas.ts`) marks, and the helpers the\n * orchestrator calls during commit, load and handler dispatch to gate,\n * redact, shred or strip those fields.\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 `types/schemas.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 `types/schemas.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 */\nexport const _registry = z.registry<{ sensitive: true }>();\n\n/**\n * Marker key stamped onto a schema's own `def`. Zod clones a schema on every\n * refinement (`.min()`, `.email()`, `.trim()`, `.describe()`, `.refine()`,\n * `.transform()`, …) via `{...def}`, which copies own symbol keys — so a\n * marker on the def survives the whole chain, while the `_registry` WeakMap\n * (keyed on the *instance*) does not.\n *\n * The registry is still populated and still consulted: it covers schemas\n * marked before this key existed, and it is the mechanism the public\n * `sensitive()` doc-comment describes.\n */\nconst _SENSITIVE = Symbol.for(\"act.sensitive\");\n\n/**\n * Stamp the def-level marker. Called by the public `sensitive()` alongside\n * `_registry.add`.\n */\nexport function _mark_sensitive(schema: z.ZodType): void {\n const def = (\n schema as unknown as {\n _zod?: { def?: Record<PropertyKey, unknown> };\n }\n )._zod?.def;\n if (def) def[_SENSITIVE] = true;\n}\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 */\nfunction is_pii(schema: z.ZodType): boolean {\n let cur: z.ZodType = schema;\n while (true) {\n if (_registry.has(cur)) return true;\n // Def-level marker: survives the clone a refinement produces, which the\n // instance-keyed registry above cannot.\n const def = (\n cur as unknown as {\n _zod?: { def?: Record<PropertyKey, unknown> };\n }\n )._zod?.def;\n if (def?.[_SENSITIVE] === true) 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 an event's sensitive fields, as the declared schema of each.\n *\n * Walks the top-level shape of a `z.object({...})` and keeps the keys whose\n * schema (after unwrapping optional/nullable/default wrappers) was marked via\n * `sensitive(...)`. Returns an empty object 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 * A union event has no top-level shape, so the options are walked and merged:\n * a key sensitive in any variant must be split, because the stored payload\n * could be that variant.\n * The first variant to declare a key wins, which only matters to a caller that\n * wants the schema rather than the name.\n *\n * Returning the schemas rather than just the names is what lets a caller do\n * something per field — the event builder asks each one whether it holds a\n * date, so the `pii` sidecar's dates can be revived like any other.\n */\nexport function pii_schemas(schema: z.ZodType): Record<string, z.ZodType> {\n const shape = (schema as { shape?: Record<string, z.ZodType> }).shape;\n if (shape && typeof shape === \"object\") {\n const fields: Record<string, z.ZodType> = {};\n for (const key of Object.keys(shape))\n if (is_pii(shape[key])) fields[key] = shape[key];\n return fields;\n }\n const options = (schema as { options?: unknown }).options;\n if (Array.isArray(options)) {\n const fields: Record<string, z.ZodType> = {};\n for (const option of options)\n for (const [key, field] of Object.entries(\n pii_schemas(option as z.ZodType)\n ))\n fields[key] ??= field;\n return fields;\n }\n return {};\n}\n\n/**\n * The names of an event's sensitive fields — {@link pii_schemas} keyed.\n *\n * @internal — consumed by the registry's `sensitive_fields(event_name)` lookup,\n * and public through `types/schemas.ts`, where act-http's OpenAPI emitter uses\n * it to mark request-body properties `writeOnly`.\n */\nexport function pii_fields(schema: z.ZodType): readonly string[] {\n return Object.keys(pii_schemas(schema));\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 */\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 * Only ever reached for events that declare sensitive fields — the sole caller\n * is {@link make_gate}, which the builder invokes exclusively for sensitive\n * events; non-sensitive events short-circuit to {@link IDENTITY_GATE} before\n * they get here. `fields` is therefore guaranteed non-empty (same contract as\n * {@link pii_strip}).\n *\n * - Event whose `pii` payload is null/undefined → substitute {@link SHREDDED}\n * for each declared field. Irrecoverable, 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 */\nfunction 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 const data = event.data as Record<string, unknown>;\n // The external view NEVER carries the isolated `pii` sidecar — dropping it\n // is the whole point of the gate. Keeping it (an earlier `...event` spread)\n // leaked plaintext PII on every gated read surface (`load`, `query`,\n // `query_array`) even while `data` was correctly redacted. Strip it\n // once here; the plaintext lives in `data` only on the authorized path.\n const { pii, ...rest } = event as Committed<TEvents, TKey> & {\n pii?: Record<string, unknown> | null;\n };\n if (pii == null) {\n const shredded: Record<string, unknown> = { ...data };\n for (const f of fields) shredded[f] = SHREDDED;\n return { ...rest, data: shredded as Committed<TEvents, TKey>[\"data\"] };\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 ...rest,\n data: { ...data, ...pii } 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 { ...rest, data: redacted as Committed<TEvents, TKey>[\"data\"] };\n}\n\n/**\n * A prebuilt per-event read gate: given a committed event and the reading\n * actor, return the caller-visible form. This is the single gating primitive\n * the builder prebuilds for **every** read surface — both the actor-less\n * `query` / `query_array` (which pass no actor → default-deny) and the\n * actor-aware `load` / `do`-return view (which pass the reader). Non-sensitive\n * events use the shared {@link IDENTITY_GATE}; sensitive events use a redactor\n * built by {@link make_gate} that closes over the field list and the state's\n * disclosure predicate, so the read path never recomputes the sensitive-field\n * lookup nor allocates per event.\n *\n * The `actor` is optional so the actor-less surfaces can call `gate(event)`.\n */\nexport type EventGate = <TEvents extends Schemas, TKey extends keyof TEvents>(\n event: Committed<TEvents, TKey>,\n actor?: Actor\n) => Committed<TEvents, TKey>;\n\n/**\n * Shared zero-cost gate for every event with no `sensitive(...)` fields — a\n * single frozen reference the builder hands back for non-sensitive events, so\n * the common path is one `Map` miss and an identity call, no allocation. This\n * is the \"by default, return the event\" half of the prebuilt per-event gate.\n */\nexport const IDENTITY_GATE: EventGate = (event) => event;\n\n/**\n * Prebuild a read gate for a sensitive event, capturing its field list and the\n * disclosure predicate once at build time. The returned closure defers to\n * {@link pii_gate} with the reading actor supplied per call:\n *\n * - `predicate = null` (the actor-less `query` surfaces, or a state that never\n * declared `.discloses`) → default-deny: declared fields come back\n * {@link REDACTED} (or {@link SHREDDED} once the pii column is forgotten).\n * - `predicate` set + an authorized actor → plaintext merged into `data`.\n *\n * Either way the isolated `pii` sidecar is dropped. The builder stores one gate\n * per sensitive event (per state for the load path; predicate-less for the\n * query path); non-sensitive events fall back to {@link IDENTITY_GATE}.\n */\nexport function make_gate(\n fields: readonly string[],\n predicate: ((event: any, actor: Actor) => boolean) | null\n): EventGate {\n return (event, actor) => pii_gate(event, fields, predicate, actor);\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 */\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;AA8BO,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;AAqCO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AE,OAAO,EAAE,SAAS;AAAA,EAC5B,OAAOA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,OAAOA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC3B,gBAAgBA,GAAE,KAAK,EAAE,SAAS;AAAA,EAClC,eAAeA,GAAE,KAAK,EAAE,SAAS;AAAA,EACjC,UAAUA,GAAE,QAAQ,EAAE,SAAS;AAAA,EAC/B,aAAaA,GAAE,OAAO,EAAE,SAAS;AAAA,EACjC,YAAYA,GAAE,QAAQ,EAAE,SAAS;AAAA,EACjC,UAAUA,GAAE,QAAQ,EAAE,SAAS;AAAA,EAC/B,cAAcA,GAAE,QAAQ,EAAE,SAAS;AACrC,CAAC,EACA,SAAS;;;AExIL,IAAM,eAAe;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAWO,IAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["z","z"]}
@@ -3,7 +3,7 @@ import {
3
3
  Environments,
4
4
  LogLevels,
5
5
  ValidationError
6
- } from "./chunk-F7K7SIG6.js";
6
+ } from "./chunk-HHKLVRR4.js";
7
7
 
8
8
  // src/adapters/console-logger.ts
9
9
  var LEVEL_VALUES = {
@@ -1003,8 +1003,16 @@ var FALLBACK_PACKAGE = {
1003
1003
  };
1004
1004
  var get_package = () => {
1005
1005
  try {
1006
- const raw = fs.readFileSync("package.json");
1007
- return JSON.parse(raw.toString());
1006
+ const raw = JSON.parse(fs.readFileSync("package.json").toString());
1007
+ const pkg2 = {
1008
+ name: FALLBACK_PACKAGE.name,
1009
+ version: FALLBACK_PACKAGE.version
1010
+ };
1011
+ for (const [key, schema] of Object.entries(PackageSchema.shape)) {
1012
+ const field = schema.safeParse(raw?.[key]);
1013
+ if (field.success && field.data !== void 0) pkg2[key] = field.data;
1014
+ }
1015
+ return pkg2;
1008
1016
  } catch (err) {
1009
1017
  pkg_load_error = err;
1010
1018
  return FALLBACK_PACKAGE;
@@ -1070,4 +1078,4 @@ export {
1070
1078
  TOMBSTONE_EVENT,
1071
1079
  DEFAULT_LANE
1072
1080
  };
1073
- //# sourceMappingURL=chunk-5FXT63KF.js.map
1081
+ //# sourceMappingURL=chunk-X3MMQIIP.js.map