@graphrefly/graphrefly 0.47.2 → 0.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base/composition/index.cjs +4 -3
- package/dist/base/composition/index.cjs.map +1 -1
- package/dist/base/composition/index.d.cts +14 -5
- package/dist/base/composition/index.d.ts +14 -5
- package/dist/base/composition/index.js +8 -8
- package/dist/base/index.cjs +152 -78
- package/dist/base/index.cjs.map +1 -1
- package/dist/base/index.d.cts +2 -2
- package/dist/base/index.d.ts +2 -2
- package/dist/base/index.js +75 -70
- package/dist/base/io/index.cjs +31 -17
- package/dist/base/io/index.cjs.map +1 -1
- package/dist/base/io/index.d.cts +32 -5
- package/dist/base/io/index.d.ts +32 -5
- package/dist/base/io/index.js +1 -1
- package/dist/base/mutation/index.cjs +21 -0
- package/dist/base/mutation/index.cjs.map +1 -1
- package/dist/base/mutation/index.d.cts +23 -1
- package/dist/base/mutation/index.d.ts +23 -1
- package/dist/base/mutation/index.js +3 -1
- package/dist/base/sources/browser/index.cjs +5 -3
- package/dist/base/sources/browser/index.cjs.map +1 -1
- package/dist/base/sources/browser/index.d.cts +20 -2
- package/dist/base/sources/browser/index.d.ts +20 -2
- package/dist/base/sources/browser/index.js +5 -3
- package/dist/base/sources/browser/index.js.map +1 -1
- package/dist/base/sources/event/index.cjs +28 -0
- package/dist/base/sources/event/index.cjs.map +1 -1
- package/dist/base/sources/event/index.d.cts +67 -3
- package/dist/base/sources/event/index.d.ts +67 -3
- package/dist/base/sources/event/index.js +4 -1
- package/dist/base/sources/index.cjs +75 -37
- package/dist/base/sources/index.cjs.map +1 -1
- package/dist/base/sources/index.d.cts +1 -1
- package/dist/base/sources/index.d.ts +1 -1
- package/dist/base/sources/index.js +5 -2
- package/dist/{chunk-R6ZCSXKX.js → chunk-23MAWVOJ.js} +3 -3
- package/dist/{chunk-MS3WPRJR.js → chunk-3REMCHSS.js} +6 -6
- package/dist/chunk-3REMCHSS.js.map +1 -0
- package/dist/{chunk-CEVNQ74M.js → chunk-3YGXPUHW.js} +2 -2
- package/dist/{chunk-CEVNQ74M.js.map → chunk-3YGXPUHW.js.map} +1 -1
- package/dist/{chunk-6ZLCPUXS.js → chunk-46X2EFQH.js} +15 -4
- package/dist/chunk-46X2EFQH.js.map +1 -0
- package/dist/{chunk-NY2PYHNC.js → chunk-5UY3PNFY.js} +12 -5
- package/dist/chunk-5UY3PNFY.js.map +1 -0
- package/dist/{chunk-FQSQONOU.js → chunk-65OM4XLQ.js} +49 -3
- package/dist/chunk-65OM4XLQ.js.map +1 -0
- package/dist/{chunk-3PSLNJDU.js → chunk-6DQYBIHW.js} +314 -49
- package/dist/chunk-6DQYBIHW.js.map +1 -0
- package/dist/{chunk-LDCSZ72P.js → chunk-6YBER5UP.js} +3 -3
- package/dist/{chunk-LDCSZ72P.js.map → chunk-6YBER5UP.js.map} +1 -1
- package/dist/{chunk-3O3NKZJW.js → chunk-7T7WLEPM.js} +24 -3
- package/dist/chunk-7T7WLEPM.js.map +1 -0
- package/dist/{chunk-PKPO3JTZ.js → chunk-AQAKDE7F.js} +29 -11
- package/dist/chunk-AQAKDE7F.js.map +1 -0
- package/dist/{chunk-6MRSX3YK.js → chunk-B5Y5GPD5.js} +2 -2
- package/dist/{chunk-BXGZFGZ4.js → chunk-C5QD5DQX.js} +22 -1
- package/dist/chunk-C5QD5DQX.js.map +1 -0
- package/dist/{chunk-4XCHZRUJ.js → chunk-D5YGR4TP.js} +58 -7
- package/dist/chunk-D5YGR4TP.js.map +1 -0
- package/dist/{chunk-NPRP3MCV.js → chunk-DHDCOOJU.js} +2 -2
- package/dist/chunk-DHDCOOJU.js.map +1 -0
- package/dist/{chunk-VP3TIUDF.js → chunk-DVTDF5OI.js} +2 -2
- package/dist/{chunk-OXD5LFQP.js → chunk-G7H6PN7P.js} +2 -2
- package/dist/{chunk-EL5VHUGK.js → chunk-GGKHHG5Y.js} +32 -18
- package/dist/chunk-GGKHHG5Y.js.map +1 -0
- package/dist/{chunk-446I4EGD.js → chunk-J5TBZFBD.js} +2 -2
- package/dist/{chunk-7AVQIGF6.js → chunk-K4ZYJ4EM.js} +554 -460
- package/dist/chunk-K4ZYJ4EM.js.map +1 -0
- package/dist/{chunk-QFE5BQH7.js → chunk-LTSI7ULC.js} +2 -2
- package/dist/{chunk-5GVURVIG.js → chunk-MMHGYX44.js} +12 -2
- package/dist/{chunk-5GVURVIG.js.map → chunk-MMHGYX44.js.map} +1 -1
- package/dist/{chunk-KRFGO5QH.js → chunk-MQMTRKY3.js} +118 -43
- package/dist/chunk-MQMTRKY3.js.map +1 -0
- package/dist/{chunk-42FQ27MQ.js → chunk-MTODGQBR.js} +44 -179
- package/dist/chunk-MTODGQBR.js.map +1 -0
- package/dist/{chunk-FVINAAKA.js → chunk-NBK6QQMG.js} +14 -13
- package/dist/{chunk-FVINAAKA.js.map → chunk-NBK6QQMG.js.map} +1 -1
- package/dist/{chunk-KNU73RZW.js → chunk-NSA5K5G2.js} +2 -2
- package/dist/{chunk-MLTPJMH6.js → chunk-QQYULEZL.js} +2 -2
- package/dist/chunk-QSW4DFKE.js +31 -0
- package/dist/chunk-QSW4DFKE.js.map +1 -0
- package/dist/{chunk-VAZXUK6G.js → chunk-SUNCHMML.js} +2 -2
- package/dist/{chunk-EP4WVQLX.js → chunk-T2U6N3FV.js} +6 -6
- package/dist/{chunk-T7SP3EYR.js → chunk-T5URUIIY.js} +33 -24
- package/dist/chunk-T5URUIIY.js.map +1 -0
- package/dist/{chunk-VNXAF2KE.js → chunk-TPTZZV25.js} +6 -6
- package/dist/chunk-TPTZZV25.js.map +1 -0
- package/dist/{chunk-IOJDYUA7.js → chunk-V46JWFGV.js} +6 -5
- package/dist/chunk-V46JWFGV.js.map +1 -0
- package/dist/{chunk-WGDEBIP4.js → chunk-X6ESZDR6.js} +5 -6
- package/dist/chunk-X6ESZDR6.js.map +1 -0
- package/dist/{chunk-N65E26UL.js → chunk-XEWV254I.js} +2 -2
- package/dist/{chunk-N65E26UL.js.map → chunk-XEWV254I.js.map} +1 -1
- package/dist/{chunk-PTWADEH3.js → chunk-YBJVKMTM.js} +34 -14
- package/dist/chunk-YBJVKMTM.js.map +1 -0
- package/dist/{chunk-DDTS7F5O.js → chunk-ZW32BPXV.js} +12 -3
- package/dist/chunk-ZW32BPXV.js.map +1 -0
- package/dist/compat/index.cjs +51 -4
- package/dist/compat/index.cjs.map +1 -1
- package/dist/compat/index.d.cts +1 -1
- package/dist/compat/index.d.ts +1 -1
- package/dist/compat/index.js +6 -6
- package/dist/compat/nestjs/index.cjs +51 -4
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +1 -1
- package/dist/compat/nestjs/index.d.ts +1 -1
- package/dist/compat/nestjs/index.js +3 -3
- package/dist/{fallback-Bx46zqky.d.cts → fallback-BROR6ZhO.d.cts} +1 -1
- package/dist/{fallback-pIWW8A2d.d.ts → fallback-DO80aM_3.d.ts} +1 -1
- package/dist/{index-B_p8tnvf.d.cts → index-D1z3XcF9.d.cts} +1 -0
- package/dist/{index-_HDSmPyp.d.ts → index-DZ6yua0Q.d.ts} +1 -0
- package/dist/index.cjs +2215 -1676
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +169 -146
- package/dist/index.js.map +1 -1
- package/dist/presets/ai/index.cjs +46 -0
- package/dist/presets/ai/index.cjs.map +1 -1
- package/dist/presets/ai/index.js +12 -12
- package/dist/presets/harness/index.cjs +130 -18
- package/dist/presets/harness/index.cjs.map +1 -1
- package/dist/presets/harness/index.d.cts +15 -5
- package/dist/presets/harness/index.d.ts +15 -5
- package/dist/presets/harness/index.js +22 -22
- package/dist/presets/index.cjs +222 -53
- package/dist/presets/index.cjs.map +1 -1
- package/dist/presets/index.d.cts +2 -2
- package/dist/presets/index.d.ts +2 -2
- package/dist/presets/index.js +45 -45
- package/dist/presets/inspect/index.cjs +63 -14
- package/dist/presets/inspect/index.cjs.map +1 -1
- package/dist/presets/inspect/index.d.cts +1 -1
- package/dist/presets/inspect/index.d.ts +1 -1
- package/dist/presets/inspect/index.js +6 -6
- package/dist/presets/resilience/index.cjs +29 -21
- package/dist/presets/resilience/index.cjs.map +1 -1
- package/dist/presets/resilience/index.d.cts +12 -8
- package/dist/presets/resilience/index.d.ts +12 -8
- package/dist/presets/resilience/index.js +3 -3
- package/dist/{rate-limiter-DpVbSYdH.d.cts → rate-limiter-DC26FM8J.d.cts} +10 -1
- package/dist/{rate-limiter-CEALq4N1.d.ts → rate-limiter-DyWpwpQP.d.ts} +10 -1
- package/dist/{reactive-layout-fswlBUvX.d.ts → reactive-layout-BBBWH0V_.d.cts} +85 -4
- package/dist/{reactive-layout-fswlBUvX.d.cts → reactive-layout-BBBWH0V_.d.ts} +85 -4
- package/dist/solutions/index.cjs +168 -47
- package/dist/solutions/index.cjs.map +1 -1
- package/dist/solutions/index.d.cts +2 -2
- package/dist/solutions/index.d.ts +2 -2
- package/dist/solutions/index.js +28 -28
- package/dist/{spawnable-5mDY501F.d.cts → spawnable-B2IlW60f.d.cts} +23 -2
- package/dist/{spawnable-D3lR0oQu.d.ts → spawnable-tttFz2Nh.d.ts} +23 -2
- package/dist/testing/index.cjs +94 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +59 -0
- package/dist/testing/index.d.ts +59 -0
- package/dist/testing/index.js +73 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/utils/ai/browser.cjs.map +1 -1
- package/dist/utils/ai/browser.d.cts +2 -2
- package/dist/utils/ai/browser.d.ts +2 -2
- package/dist/utils/ai/browser.js +6 -6
- package/dist/utils/ai/browser.js.map +1 -1
- package/dist/utils/ai/index.cjs +250 -166
- package/dist/utils/ai/index.cjs.map +1 -1
- package/dist/utils/ai/index.d.cts +108 -12
- package/dist/utils/ai/index.d.ts +108 -12
- package/dist/utils/ai/index.js +21 -19
- package/dist/utils/ai/node.cjs.map +1 -1
- package/dist/utils/ai/node.d.cts +5 -5
- package/dist/utils/ai/node.d.ts +5 -5
- package/dist/utils/ai/node.js +2 -2
- package/dist/utils/ai/node.js.map +1 -1
- package/dist/utils/cqrs/index.cjs +29 -3
- package/dist/utils/cqrs/index.cjs.map +1 -1
- package/dist/utils/cqrs/index.d.cts +12 -7
- package/dist/utils/cqrs/index.d.ts +12 -7
- package/dist/utils/cqrs/index.js +2 -2
- package/dist/utils/demo-shell/index.cjs +45 -19
- package/dist/utils/demo-shell/index.cjs.map +1 -1
- package/dist/utils/demo-shell/index.d.cts +1 -1
- package/dist/utils/demo-shell/index.d.ts +1 -1
- package/dist/utils/demo-shell/index.js +2 -2
- package/dist/utils/domain-templates/index.cjs.map +1 -1
- package/dist/utils/domain-templates/index.js +3 -3
- package/dist/utils/graphspec/index.cjs.map +1 -1
- package/dist/utils/graphspec/index.js +3 -3
- package/dist/utils/index.cjs +1642 -1225
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.cts +7 -7
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/index.js +72 -54
- package/dist/utils/inspect/index.cjs +52 -4
- package/dist/utils/inspect/index.cjs.map +1 -1
- package/dist/utils/inspect/index.d.cts +32 -3
- package/dist/utils/inspect/index.d.ts +32 -3
- package/dist/utils/inspect/index.js +4 -4
- package/dist/utils/job-queue/index.cjs +46 -9
- package/dist/utils/job-queue/index.cjs.map +1 -1
- package/dist/utils/job-queue/index.d.cts +33 -3
- package/dist/utils/job-queue/index.d.ts +33 -3
- package/dist/utils/job-queue/index.js +2 -2
- package/dist/utils/memory/index.cjs +556 -462
- package/dist/utils/memory/index.cjs.map +1 -1
- package/dist/utils/memory/index.d.cts +203 -24
- package/dist/utils/memory/index.d.ts +203 -24
- package/dist/utils/memory/index.js +10 -2
- package/dist/utils/messaging/index.cjs.map +1 -1
- package/dist/utils/messaging/index.d.cts +4 -3
- package/dist/utils/messaging/index.d.ts +4 -3
- package/dist/utils/messaging/index.js +2 -2
- package/dist/utils/orchestration/index.cjs +9 -0
- package/dist/utils/orchestration/index.cjs.map +1 -1
- package/dist/utils/orchestration/index.js +3 -3
- package/dist/utils/process/index.cjs +32 -2
- package/dist/utils/process/index.cjs.map +1 -1
- package/dist/utils/process/index.d.cts +4 -3
- package/dist/utils/process/index.d.ts +4 -3
- package/dist/utils/process/index.js +2 -2
- package/dist/utils/reactive-layout/index.cjs +184 -55
- package/dist/utils/reactive-layout/index.cjs.map +1 -1
- package/dist/utils/reactive-layout/index.d.cts +128 -3
- package/dist/utils/reactive-layout/index.d.ts +128 -3
- package/dist/utils/reactive-layout/index.js +16 -8
- package/dist/utils/reduction/index.cjs.map +1 -1
- package/dist/utils/reduction/index.js +2 -2
- package/dist/utils/resilience/index.cjs +29 -20
- package/dist/utils/resilience/index.cjs.map +1 -1
- package/dist/utils/resilience/index.d.cts +1 -1
- package/dist/utils/resilience/index.d.ts +1 -1
- package/dist/utils/resilience/index.js +2 -2
- package/dist/utils/surface/index.cjs.map +1 -1
- package/dist/utils/surface/index.js +4 -4
- package/package.json +15 -3
- package/dist/chunk-3O3NKZJW.js.map +0 -1
- package/dist/chunk-3PSLNJDU.js.map +0 -1
- package/dist/chunk-42FQ27MQ.js.map +0 -1
- package/dist/chunk-4XCHZRUJ.js.map +0 -1
- package/dist/chunk-6ZLCPUXS.js.map +0 -1
- package/dist/chunk-7AVQIGF6.js.map +0 -1
- package/dist/chunk-BXGZFGZ4.js.map +0 -1
- package/dist/chunk-DDTS7F5O.js.map +0 -1
- package/dist/chunk-EL5VHUGK.js.map +0 -1
- package/dist/chunk-FQSQONOU.js.map +0 -1
- package/dist/chunk-IOJDYUA7.js.map +0 -1
- package/dist/chunk-KRFGO5QH.js.map +0 -1
- package/dist/chunk-MS3WPRJR.js.map +0 -1
- package/dist/chunk-NPRP3MCV.js.map +0 -1
- package/dist/chunk-NY2PYHNC.js.map +0 -1
- package/dist/chunk-PKPO3JTZ.js.map +0 -1
- package/dist/chunk-PTWADEH3.js.map +0 -1
- package/dist/chunk-T7SP3EYR.js.map +0 -1
- package/dist/chunk-VNXAF2KE.js.map +0 -1
- package/dist/chunk-W2BOPXTI.js +0 -1
- package/dist/chunk-W2BOPXTI.js.map +0 -1
- package/dist/chunk-WGDEBIP4.js.map +0 -1
- /package/dist/{chunk-R6ZCSXKX.js.map → chunk-23MAWVOJ.js.map} +0 -0
- /package/dist/{chunk-6MRSX3YK.js.map → chunk-B5Y5GPD5.js.map} +0 -0
- /package/dist/{chunk-VP3TIUDF.js.map → chunk-DVTDF5OI.js.map} +0 -0
- /package/dist/{chunk-OXD5LFQP.js.map → chunk-G7H6PN7P.js.map} +0 -0
- /package/dist/{chunk-446I4EGD.js.map → chunk-J5TBZFBD.js.map} +0 -0
- /package/dist/{chunk-QFE5BQH7.js.map → chunk-LTSI7ULC.js.map} +0 -0
- /package/dist/{chunk-KNU73RZW.js.map → chunk-NSA5K5G2.js.map} +0 -0
- /package/dist/{chunk-MLTPJMH6.js.map → chunk-QQYULEZL.js.map} +0 -0
- /package/dist/{chunk-VAZXUK6G.js.map → chunk-SUNCHMML.js.map} +0 -0
- /package/dist/{chunk-EP4WVQLX.js.map → chunk-T2U6N3FV.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Node } from '@graphrefly/pure-ts/core';
|
|
2
2
|
import { ReactiveLogBundle, AppendLogStorageTier } from '@graphrefly/pure-ts/extra';
|
|
3
3
|
import { Graph, GraphOptions } from '@graphrefly/pure-ts/graph';
|
|
4
|
-
import { BaseAuditRecord } from '../../base/mutation/index.cjs';
|
|
4
|
+
import { BaseAuditRecord, ReadonlyAuditLog } from '../../base/mutation/index.cjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* CQRS patterns (roadmap §4.5).
|
|
@@ -93,16 +93,18 @@ declare const sagaInvocationKeyOf: <T>(i: SagaInvocation<T>) => string;
|
|
|
93
93
|
* `Node<unknown>` return that side-attached `_saga` via an unsafe cast.
|
|
94
94
|
*
|
|
95
95
|
* `node` is the saga's effect node (subscribe to observe processing
|
|
96
|
-
* activity). `invocations` is the per-event-type audit log; `audit`
|
|
97
|
-
* `invocations` (Audit 2 `.audit` duplication
|
|
98
|
-
*
|
|
96
|
+
* activity). `invocations` is the per-event-type audit log; `audit` is a
|
|
97
|
+
* **read-only view** of `invocations` (Audit 2 `.audit` duplication; M7 —
|
|
98
|
+
* the alias can no longer silently `append`/`clear` the canonical log).
|
|
99
|
+
* `cursors` exposes the per-event-type cursor state nodes for monitoring /
|
|
100
|
+
* testing.
|
|
99
101
|
*
|
|
100
102
|
* @category patterns
|
|
101
103
|
*/
|
|
102
104
|
interface SagaController<T = unknown> {
|
|
103
105
|
readonly node: Node<unknown>;
|
|
104
106
|
readonly invocations: ReactiveLogBundle<SagaInvocation<T>>;
|
|
105
|
-
readonly audit:
|
|
107
|
+
readonly audit: ReadonlyAuditLog<SagaInvocation<T>>;
|
|
106
108
|
readonly cursors: {
|
|
107
109
|
readonly [eventName: string]: Node<number>;
|
|
108
110
|
};
|
|
@@ -312,8 +314,11 @@ declare class CqrsGraph<_EM extends CqrsEventMap = Record<string, unknown>> exte
|
|
|
312
314
|
private readonly _dispatchSeqCursor;
|
|
313
315
|
/** Audit log of every command dispatch (Audit 2). */
|
|
314
316
|
readonly dispatches: ReactiveLogBundle<DispatchRecord>;
|
|
315
|
-
/**
|
|
316
|
-
|
|
317
|
+
/**
|
|
318
|
+
* Read-only view of {@link CqrsGraph.dispatches} (Audit 2 `.audit`
|
|
319
|
+
* duplication; M7 — cannot mutate the canonical log via the alias).
|
|
320
|
+
*/
|
|
321
|
+
readonly audit: ReadonlyAuditLog<DispatchRecord>;
|
|
317
322
|
/** Per-aggregate LRU eviction observability; secondary log to `dispatches`. */
|
|
318
323
|
readonly aggregateEvictions: ReactiveLogBundle<AggregateEvictionRecord>;
|
|
319
324
|
constructor(name: string, opts?: CqrsOptions);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Node } from '@graphrefly/pure-ts/core';
|
|
2
2
|
import { ReactiveLogBundle, AppendLogStorageTier } from '@graphrefly/pure-ts/extra';
|
|
3
3
|
import { Graph, GraphOptions } from '@graphrefly/pure-ts/graph';
|
|
4
|
-
import { BaseAuditRecord } from '../../base/mutation/index.js';
|
|
4
|
+
import { BaseAuditRecord, ReadonlyAuditLog } from '../../base/mutation/index.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* CQRS patterns (roadmap §4.5).
|
|
@@ -93,16 +93,18 @@ declare const sagaInvocationKeyOf: <T>(i: SagaInvocation<T>) => string;
|
|
|
93
93
|
* `Node<unknown>` return that side-attached `_saga` via an unsafe cast.
|
|
94
94
|
*
|
|
95
95
|
* `node` is the saga's effect node (subscribe to observe processing
|
|
96
|
-
* activity). `invocations` is the per-event-type audit log; `audit`
|
|
97
|
-
* `invocations` (Audit 2 `.audit` duplication
|
|
98
|
-
*
|
|
96
|
+
* activity). `invocations` is the per-event-type audit log; `audit` is a
|
|
97
|
+
* **read-only view** of `invocations` (Audit 2 `.audit` duplication; M7 —
|
|
98
|
+
* the alias can no longer silently `append`/`clear` the canonical log).
|
|
99
|
+
* `cursors` exposes the per-event-type cursor state nodes for monitoring /
|
|
100
|
+
* testing.
|
|
99
101
|
*
|
|
100
102
|
* @category patterns
|
|
101
103
|
*/
|
|
102
104
|
interface SagaController<T = unknown> {
|
|
103
105
|
readonly node: Node<unknown>;
|
|
104
106
|
readonly invocations: ReactiveLogBundle<SagaInvocation<T>>;
|
|
105
|
-
readonly audit:
|
|
107
|
+
readonly audit: ReadonlyAuditLog<SagaInvocation<T>>;
|
|
106
108
|
readonly cursors: {
|
|
107
109
|
readonly [eventName: string]: Node<number>;
|
|
108
110
|
};
|
|
@@ -312,8 +314,11 @@ declare class CqrsGraph<_EM extends CqrsEventMap = Record<string, unknown>> exte
|
|
|
312
314
|
private readonly _dispatchSeqCursor;
|
|
313
315
|
/** Audit log of every command dispatch (Audit 2). */
|
|
314
316
|
readonly dispatches: ReactiveLogBundle<DispatchRecord>;
|
|
315
|
-
/**
|
|
316
|
-
|
|
317
|
+
/**
|
|
318
|
+
* Read-only view of {@link CqrsGraph.dispatches} (Audit 2 `.audit`
|
|
319
|
+
* duplication; M7 — cannot mutate the canonical log via the alias).
|
|
320
|
+
*/
|
|
321
|
+
readonly audit: ReadonlyAuditLog<DispatchRecord>;
|
|
317
322
|
/** Per-aggregate LRU eviction observability; secondary log to `dispatches`. */
|
|
318
323
|
readonly aggregateEvictions: ReactiveLogBundle<AggregateEvictionRecord>;
|
|
319
324
|
constructor(name: string, opts?: CqrsOptions);
|
package/dist/utils/cqrs/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
cqrsEventKeyOf,
|
|
5
5
|
dispatchKeyOf,
|
|
6
6
|
sagaInvocationKeyOf
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-5UY3PNFY.js";
|
|
8
8
|
import "../../chunk-FMPF42Q4.js";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-C5QD5DQX.js";
|
|
10
10
|
import "../../chunk-AZDQPQ3V.js";
|
|
11
11
|
export {
|
|
12
12
|
CqrsGraph,
|
|
@@ -81,6 +81,40 @@ function graphSpecToMermaid(g, opts) {
|
|
|
81
81
|
// src/utils/reactive-layout/reactive-layout.ts
|
|
82
82
|
var import_core = require("@graphrefly/pure-ts/core");
|
|
83
83
|
var import_graph = require("@graphrefly/pure-ts/graph");
|
|
84
|
+
|
|
85
|
+
// src/utils/reactive-layout/measurement-adapters.ts
|
|
86
|
+
var IntlSegmentAdapter = class {
|
|
87
|
+
wordSeg = null;
|
|
88
|
+
graphemeSeg = null;
|
|
89
|
+
constructor() {
|
|
90
|
+
if (typeof Intl === "undefined" || typeof Intl.Segmenter !== "function") {
|
|
91
|
+
throw new TypeError(
|
|
92
|
+
"IntlSegmentAdapter: Intl.Segmenter is not available in this runtime (Hermes / older embedded JS engines). Pass a custom SegmentAdapter via `reactiveLayout({ segmentAdapter })` \u2014 see the SegmentAdapter JSDoc for the polyfill recipe (e.g. `intl-segmenter-polyfill` or `@formatjs/intl-segmenter`)."
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
segmentWords(text) {
|
|
97
|
+
if (this.wordSeg === null) {
|
|
98
|
+
this.wordSeg = new Intl.Segmenter(void 0, { granularity: "word" });
|
|
99
|
+
}
|
|
100
|
+
return this.wordSeg.segment(text);
|
|
101
|
+
}
|
|
102
|
+
segmentGraphemes(text) {
|
|
103
|
+
if (this.graphemeSeg === null) {
|
|
104
|
+
this.graphemeSeg = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
105
|
+
}
|
|
106
|
+
return this.graphemeSeg.segment(text);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var _defaultSegmentAdapter = null;
|
|
110
|
+
function getDefaultSegmentAdapter() {
|
|
111
|
+
if (_defaultSegmentAdapter === null) {
|
|
112
|
+
_defaultSegmentAdapter = new IntlSegmentAdapter();
|
|
113
|
+
}
|
|
114
|
+
return _defaultSegmentAdapter;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// src/utils/reactive-layout/reactive-layout.ts
|
|
84
118
|
function isCJK(s) {
|
|
85
119
|
for (const ch of s) {
|
|
86
120
|
const c = ch.codePointAt(0);
|
|
@@ -135,10 +169,9 @@ var leftStickyPunctuation = /* @__PURE__ */ new Set([
|
|
|
135
169
|
function normalizeWhitespace(text) {
|
|
136
170
|
return text.replace(/[\t\n\r\f ]+/g, " ").replace(/^ | $/g, "");
|
|
137
171
|
}
|
|
138
|
-
function segmentText(normalized) {
|
|
139
|
-
const wordSegmenter = new Intl.Segmenter(void 0, { granularity: "word" });
|
|
172
|
+
function segmentText(normalized, segmentAdapter) {
|
|
140
173
|
const pieces = [];
|
|
141
|
-
for (const s of
|
|
174
|
+
for (const s of segmentAdapter.segmentWords(normalized)) {
|
|
142
175
|
const text = s.segment;
|
|
143
176
|
const isWordLike = s.isWordLike ?? false;
|
|
144
177
|
const texts = [];
|
|
@@ -174,13 +207,11 @@ function segmentText(normalized) {
|
|
|
174
207
|
}
|
|
175
208
|
return pieces;
|
|
176
209
|
}
|
|
177
|
-
function analyzeAndMeasure(text, font, adapter, cache, stats) {
|
|
210
|
+
function analyzeAndMeasure(text, font, adapter, cache, stats, segmentAdapter) {
|
|
178
211
|
const normalized = normalizeWhitespace(text);
|
|
179
212
|
if (normalized.length === 0) return [];
|
|
180
|
-
const
|
|
181
|
-
const
|
|
182
|
-
granularity: "grapheme"
|
|
183
|
-
});
|
|
213
|
+
const segAdapter = segmentAdapter ?? getDefaultSegmentAdapter();
|
|
214
|
+
const pieces = segmentText(normalized, segAdapter);
|
|
184
215
|
const rawTexts = [];
|
|
185
216
|
const rawKinds = [];
|
|
186
217
|
const rawWordLike = [];
|
|
@@ -245,7 +276,7 @@ function analyzeAndMeasure(text, font, adapter, cache, stats) {
|
|
|
245
276
|
}
|
|
246
277
|
if (isCJK(t)) {
|
|
247
278
|
let unitText = "";
|
|
248
|
-
for (const gs of
|
|
279
|
+
for (const gs of segAdapter.segmentGraphemes(t)) {
|
|
249
280
|
const grapheme = gs.segment;
|
|
250
281
|
if (unitText.length > 0 && kinsokuStart.has(grapheme)) {
|
|
251
282
|
unitText += grapheme;
|
|
@@ -277,7 +308,7 @@ function analyzeAndMeasure(text, font, adapter, cache, stats) {
|
|
|
277
308
|
let graphemeWidths = null;
|
|
278
309
|
if (mergedWordLike[i] && t.length > 1) {
|
|
279
310
|
const gWidths = [];
|
|
280
|
-
for (const gs of
|
|
311
|
+
for (const gs of segAdapter.segmentGraphemes(t)) {
|
|
281
312
|
gWidths.push(measureCached(gs.segment));
|
|
282
313
|
}
|
|
283
314
|
if (gWidths.length > 1) {
|
|
@@ -288,10 +319,11 @@ function analyzeAndMeasure(text, font, adapter, cache, stats) {
|
|
|
288
319
|
}
|
|
289
320
|
return segments;
|
|
290
321
|
}
|
|
291
|
-
function computeLineBreaks(segments, maxWidth, adapter, font, cache) {
|
|
322
|
+
function computeLineBreaks(segments, maxWidth, adapter, font, cache, segmentAdapter) {
|
|
292
323
|
if (segments.length === 0) {
|
|
293
324
|
return { lines: [], lineCount: 0 };
|
|
294
325
|
}
|
|
326
|
+
const segAdapter = segmentAdapter ?? getDefaultSegmentAdapter();
|
|
295
327
|
const lines = [];
|
|
296
328
|
let lineW = 0;
|
|
297
329
|
let hasContent = false;
|
|
@@ -317,10 +349,7 @@ function computeLineBreaks(segments, maxWidth, adapter, font, cache) {
|
|
|
317
349
|
const seg = segments[i];
|
|
318
350
|
if (seg.kind === "soft-hyphen" || seg.kind === "hard-break") continue;
|
|
319
351
|
if (i === lineStartSeg && lineStartGrapheme > 0 && seg.graphemeWidths) {
|
|
320
|
-
const
|
|
321
|
-
granularity: "grapheme"
|
|
322
|
-
});
|
|
323
|
-
const graphemes = [...graphemeSegmenter.segment(seg.text)].map((g) => g.segment);
|
|
352
|
+
const graphemes = [...segAdapter.segmentGraphemes(seg.text)].map((g) => g.segment);
|
|
324
353
|
text += graphemes.slice(lineStartGrapheme).join("");
|
|
325
354
|
} else {
|
|
326
355
|
text += seg.text;
|
|
@@ -328,10 +357,7 @@ function computeLineBreaks(segments, maxWidth, adapter, font, cache) {
|
|
|
328
357
|
}
|
|
329
358
|
if (endGrapheme > 0 && endSeg < segments.length) {
|
|
330
359
|
const seg = segments[endSeg];
|
|
331
|
-
const
|
|
332
|
-
granularity: "grapheme"
|
|
333
|
-
});
|
|
334
|
-
const graphemes = [...graphemeSegmenter.segment(seg.text)].map((g) => g.segment);
|
|
360
|
+
const graphemes = [...segAdapter.segmentGraphemes(seg.text)].map((g) => g.segment);
|
|
335
361
|
const startG = lineStartSeg === endSeg ? lineStartGrapheme : 0;
|
|
336
362
|
text += graphemes.slice(startG, endGrapheme).join("");
|
|
337
363
|
}
|