@graphrefly/graphrefly 0.47.1 → 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 +28 -19
- 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 +9 -9
- package/dist/base/index.cjs +294 -164
- 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 +77 -72
- package/dist/base/io/index.cjs +145 -85
- 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 +5 -5
- 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 +18 -12
- 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 +18 -12
- package/dist/base/sources/browser/index.js.map +1 -1
- package/dist/base/sources/event/index.cjs +29 -1
- 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 +5 -2
- package/dist/base/sources/index.cjs +96 -50
- 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 +7 -4
- package/dist/base/sources/node/index.cjs +43 -37
- package/dist/base/sources/node/index.cjs.map +1 -1
- package/dist/base/sources/node/index.js +43 -37
- package/dist/base/sources/node/index.js.map +1 -1
- package/dist/{chunk-J5WFUEO4.js → chunk-23MAWVOJ.js} +3 -3
- package/dist/{chunk-YXCPV26R.js → chunk-3REMCHSS.js} +39 -27
- 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-EVYY4X5A.js → chunk-46X2EFQH.js} +16 -5
- 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-RGMTUZCL.js → chunk-65OM4XLQ.js} +50 -4
- 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-7EGRP2VX.js → chunk-7BULJTL6.js} +2 -2
- package/dist/{chunk-7EGRP2VX.js.map → chunk-7BULJTL6.js.map} +1 -1
- package/dist/{chunk-VLAGJZSL.js → chunk-7T7WLEPM.js} +25 -4
- 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-2OB3CEJS.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-MTTRCEJT.js → chunk-DVTDF5OI.js} +2 -2
- package/dist/{chunk-SOOKUYVM.js → chunk-F7EKHR32.js} +13 -9
- package/dist/chunk-F7EKHR32.js.map +1 -0
- package/dist/{chunk-A7KV5UK4.js → chunk-G7H6PN7P.js} +2 -2
- package/dist/{chunk-OCUDSN63.js → chunk-GGKHHG5Y.js} +110 -64
- package/dist/chunk-GGKHHG5Y.js.map +1 -0
- package/dist/{chunk-RAGGHLCV.js → chunk-GUNIRPEJ.js} +8 -6
- package/dist/{chunk-RAGGHLCV.js.map → chunk-GUNIRPEJ.js.map} +1 -1
- package/dist/{chunk-YJ4U2D2C.js → chunk-J5TBZFBD.js} +9 -7
- package/dist/chunk-J5TBZFBD.js.map +1 -0
- package/dist/{chunk-Y52CS6YA.js → chunk-JA67ZQG2.js} +2 -2
- package/dist/{chunk-Y52CS6YA.js.map → chunk-JA67ZQG2.js.map} +1 -1
- package/dist/{chunk-U225SKB4.js → chunk-K4ZYJ4EM.js} +569 -424
- package/dist/chunk-K4ZYJ4EM.js.map +1 -0
- package/dist/{chunk-Z4YXAUDN.js → chunk-KUFXLAEY.js} +11 -7
- package/dist/{chunk-Z4YXAUDN.js.map → chunk-KUFXLAEY.js.map} +1 -1
- package/dist/{chunk-IHTWQEDR.js → chunk-LTSI7ULC.js} +3 -3
- package/dist/{chunk-IHTWQEDR.js.map → chunk-LTSI7ULC.js.map} +1 -1
- package/dist/{chunk-DKNHAICT.js → chunk-MMHGYX44.js} +25 -9
- package/dist/chunk-MMHGYX44.js.map +1 -0
- package/dist/{chunk-K7PDZYQE.js → chunk-MQMTRKY3.js} +129 -50
- 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-O3MT7DYI.js → chunk-N6MNJNHB.js} +2 -2
- 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-DM4OMPWK.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-PZWISPIQ.js → chunk-S7HN5FHL.js} +17 -11
- package/dist/chunk-S7HN5FHL.js.map +1 -0
- package/dist/{chunk-4S53H2KR.js → chunk-SUNCHMML.js} +2 -2
- package/dist/{chunk-4GYMCUDZ.js → chunk-T2U6N3FV.js} +7 -7
- package/dist/{chunk-RJOG4IJU.js → chunk-T5URUIIY.js} +50 -35
- package/dist/chunk-T5URUIIY.js.map +1 -0
- package/dist/{chunk-B4AKFXGE.js → chunk-TPTZZV25.js} +6 -6
- package/dist/chunk-TPTZZV25.js.map +1 -0
- package/dist/{chunk-BU3SEFA5.js → chunk-V46JWFGV.js} +7 -6
- package/dist/chunk-V46JWFGV.js.map +1 -0
- package/dist/{chunk-IJRR6YAI.js → chunk-VLDRAMP7.js} +18 -12
- package/dist/chunk-VLDRAMP7.js.map +1 -0
- package/dist/{chunk-6XZYT4SW.js → chunk-X6ESZDR6.js} +8 -9
- package/dist/chunk-X6ESZDR6.js.map +1 -0
- package/dist/{chunk-E5OZPDIW.js → chunk-X7BA5PWG.js} +7 -5
- package/dist/chunk-X7BA5PWG.js.map +1 -0
- package/dist/{chunk-CXANAIZU.js → chunk-XEWV254I.js} +3 -3
- package/dist/{chunk-CXANAIZU.js.map → chunk-XEWV254I.js.map} +1 -1
- package/dist/{chunk-V4Y3TM7U.js → chunk-YBJVKMTM.js} +38 -16
- package/dist/chunk-YBJVKMTM.js.map +1 -0
- package/dist/{chunk-7ADWWI2T.js → chunk-ZW32BPXV.js} +17 -6
- package/dist/chunk-ZW32BPXV.js.map +1 -0
- package/dist/compat/index.cjs +52 -5
- 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 +7 -7
- package/dist/compat/nestjs/index.cjs +52 -5
- 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 +4 -4
- 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 +2387 -1707
- 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 +173 -150
- package/dist/index.js.map +1 -1
- package/dist/presets/ai/index.cjs +88 -26
- package/dist/presets/ai/index.cjs.map +1 -1
- package/dist/presets/ai/index.js +14 -14
- package/dist/presets/harness/index.cjs +183 -51
- 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 +26 -26
- package/dist/presets/index.cjs +298 -101
- 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 +49 -49
- 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 +64 -44
- 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 +6 -6
- 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 +239 -92
- 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 +32 -32
- 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/{timeout-U5O4ESK3.js → timeout-BEABACRP.js} +2 -2
- 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 +10 -10
- package/dist/utils/ai/browser.js.map +1 -1
- package/dist/utils/ai/index.cjs +291 -191
- 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 +23 -21
- 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 +3 -3
- 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 +1 -1
- 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 +1 -1
- package/dist/utils/graphspec/index.cjs.map +1 -1
- package/dist/utils/graphspec/index.js +3 -3
- package/dist/utils/harness/index.cjs +16 -10
- package/dist/utils/harness/index.cjs.map +1 -1
- package/dist/utils/harness/index.js +1 -1
- package/dist/utils/index.cjs +1692 -1192
- 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 +77 -59
- 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 +570 -425
- package/dist/utils/memory/index.cjs.map +1 -1
- package/dist/utils/memory/index.d.cts +261 -33
- package/dist/utils/memory/index.d.ts +261 -33
- 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 +14 -3
- 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 +3 -3
- 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 +1 -1
- package/dist/utils/reduction/index.cjs.map +1 -1
- package/dist/utils/reduction/index.js +2 -2
- package/dist/utils/resilience/index.cjs +64 -43
- 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 +5 -5
- package/dist/utils/surface/index.cjs +1 -1
- 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-3PSLNJDU.js.map +0 -1
- package/dist/chunk-42FQ27MQ.js.map +0 -1
- package/dist/chunk-4XCHZRUJ.js.map +0 -1
- package/dist/chunk-6XZYT4SW.js.map +0 -1
- package/dist/chunk-7ADWWI2T.js.map +0 -1
- package/dist/chunk-B4AKFXGE.js.map +0 -1
- package/dist/chunk-BU3SEFA5.js.map +0 -1
- package/dist/chunk-BXGZFGZ4.js.map +0 -1
- package/dist/chunk-DKNHAICT.js.map +0 -1
- package/dist/chunk-E5OZPDIW.js.map +0 -1
- package/dist/chunk-EVYY4X5A.js.map +0 -1
- package/dist/chunk-IJRR6YAI.js.map +0 -1
- package/dist/chunk-K7PDZYQE.js.map +0 -1
- package/dist/chunk-NPRP3MCV.js.map +0 -1
- package/dist/chunk-NY2PYHNC.js.map +0 -1
- package/dist/chunk-OCUDSN63.js.map +0 -1
- package/dist/chunk-PKPO3JTZ.js.map +0 -1
- package/dist/chunk-PZWISPIQ.js.map +0 -1
- package/dist/chunk-RGMTUZCL.js.map +0 -1
- package/dist/chunk-RJOG4IJU.js.map +0 -1
- package/dist/chunk-SOOKUYVM.js.map +0 -1
- package/dist/chunk-U225SKB4.js.map +0 -1
- package/dist/chunk-V4Y3TM7U.js.map +0 -1
- package/dist/chunk-VLAGJZSL.js.map +0 -1
- package/dist/chunk-W2BOPXTI.js +0 -1
- package/dist/chunk-YJ4U2D2C.js.map +0 -1
- package/dist/chunk-YXCPV26R.js.map +0 -1
- package/dist/timeout-U5O4ESK3.js.map +0 -1
- /package/dist/{chunk-J5WFUEO4.js.map → chunk-23MAWVOJ.js.map} +0 -0
- /package/dist/{chunk-2OB3CEJS.js.map → chunk-B5Y5GPD5.js.map} +0 -0
- /package/dist/{chunk-MTTRCEJT.js.map → chunk-DVTDF5OI.js.map} +0 -0
- /package/dist/{chunk-A7KV5UK4.js.map → chunk-G7H6PN7P.js.map} +0 -0
- /package/dist/{chunk-O3MT7DYI.js.map → chunk-N6MNJNHB.js.map} +0 -0
- /package/dist/{chunk-DM4OMPWK.js.map → chunk-NSA5K5G2.js.map} +0 -0
- /package/dist/{chunk-MLTPJMH6.js.map → chunk-QQYULEZL.js.map} +0 -0
- /package/dist/{chunk-4S53H2KR.js.map → chunk-SUNCHMML.js.map} +0 -0
- /package/dist/{chunk-4GYMCUDZ.js.map → chunk-T2U6N3FV.js.map} +0 -0
- /package/dist/{chunk-W2BOPXTI.js.map → timeout-BEABACRP.js.map} +0 -0
package/dist/base/index.cjs
CHANGED
|
@@ -313,11 +313,13 @@ function withTimeout(source, opts, extraOpts) {
|
|
|
313
313
|
if (latestOpts != null) {
|
|
314
314
|
attachSource();
|
|
315
315
|
}
|
|
316
|
-
return
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
316
|
+
return {
|
|
317
|
+
onDeactivation: () => {
|
|
318
|
+
stopped = true;
|
|
319
|
+
timer.cancel();
|
|
320
|
+
if (srcUnsub) srcUnsub();
|
|
321
|
+
if (optsUnsub) optsUnsub();
|
|
322
|
+
}
|
|
321
323
|
};
|
|
322
324
|
},
|
|
323
325
|
{
|
|
@@ -387,6 +389,7 @@ __export(base_exports, {
|
|
|
387
389
|
fromPrisma: () => fromPrisma,
|
|
388
390
|
fromPrometheus: () => fromPrometheus,
|
|
389
391
|
fromPulsar: () => fromPulsar,
|
|
392
|
+
fromPushNotification: () => fromPushNotification,
|
|
390
393
|
fromRabbitMQ: () => fromRabbitMQ,
|
|
391
394
|
fromRedisStream: () => fromRedisStream,
|
|
392
395
|
fromSSE: () => fromSSE,
|
|
@@ -418,6 +421,7 @@ __export(base_exports, {
|
|
|
418
421
|
parseSyslog: () => parseSyslog,
|
|
419
422
|
pubsub: () => pubsub,
|
|
420
423
|
reactiveCounter: () => reactiveCounter,
|
|
424
|
+
readonlyAuditLog: () => readonlyAuditLog,
|
|
421
425
|
registerCursor: () => registerCursor,
|
|
422
426
|
registerCursorMap: () => registerCursorMap,
|
|
423
427
|
replay: () => replay,
|
|
@@ -543,9 +547,11 @@ function defer(thunk, opts) {
|
|
|
543
547
|
const safe = err === void 0 ? new Error("defer: thunk threw undefined") : err;
|
|
544
548
|
a.down([[import_core2.ERROR, safe]]);
|
|
545
549
|
}
|
|
546
|
-
return
|
|
547
|
-
|
|
548
|
-
|
|
550
|
+
return {
|
|
551
|
+
onDeactivation: () => {
|
|
552
|
+
stopped = true;
|
|
553
|
+
unsub?.();
|
|
554
|
+
}
|
|
549
555
|
};
|
|
550
556
|
}, merged);
|
|
551
557
|
}
|
|
@@ -594,15 +600,27 @@ function toArray(source, opts) {
|
|
|
594
600
|
},
|
|
595
601
|
{
|
|
596
602
|
describeKind: "derived",
|
|
603
|
+
...opts,
|
|
604
|
+
// Operator-required flags spread AFTER user `opts` so a caller
|
|
605
|
+
// cannot accidentally override them (QA F2 spread-order fix,
|
|
606
|
+
// DS-2.7.A `/qa` 2026-05-20 — matches the
|
|
607
|
+
// `reduce`/`scan`/`take`/`last` substrate pattern). Spec §2.7
|
|
608
|
+
// R2.7.1 (DS-2.7.A): Reduce-class shape — fn must fire on
|
|
609
|
+
// upstream COMPLETE to emit the accumulated array (or `[]` for an
|
|
610
|
+
// empty source) followed by its own `[[COMPLETE]]`. Required
|
|
611
|
+
// because `completeWhenDepsComplete: false` means auto-COMPLETE
|
|
612
|
+
// is OFF; without the opt-in `toArray(empty())` never completes.
|
|
597
613
|
completeWhenDepsComplete: false,
|
|
598
|
-
|
|
614
|
+
terminalAsRealInput: true
|
|
599
615
|
}
|
|
600
616
|
);
|
|
601
617
|
}
|
|
602
618
|
function share(source, opts) {
|
|
603
619
|
return (0, import_core2.node)(
|
|
604
|
-
(_data, a) =>
|
|
605
|
-
|
|
620
|
+
(_data, a) => ({
|
|
621
|
+
onDeactivation: source.subscribe((msgs) => {
|
|
622
|
+
a.down(msgs);
|
|
623
|
+
})
|
|
606
624
|
}),
|
|
607
625
|
{ ...(0, import_extra.sourceOpts)(opts), initial: source.cache }
|
|
608
626
|
);
|
|
@@ -610,8 +628,10 @@ function share(source, opts) {
|
|
|
610
628
|
function replay(source, bufferSize, opts) {
|
|
611
629
|
if (bufferSize < 1) throw new RangeError("replay expects bufferSize >= 1");
|
|
612
630
|
return (0, import_core2.node)(
|
|
613
|
-
(_data, a) =>
|
|
614
|
-
|
|
631
|
+
(_data, a) => ({
|
|
632
|
+
onDeactivation: source.subscribe((msgs) => {
|
|
633
|
+
a.down(msgs);
|
|
634
|
+
})
|
|
615
635
|
}),
|
|
616
636
|
{ ...(0, import_extra.sourceOpts)(opts), initial: source.cache, replayBuffer: bufferSize }
|
|
617
637
|
);
|
|
@@ -625,8 +645,8 @@ var shareReplay = replay;
|
|
|
625
645
|
function isNodeLike(value) {
|
|
626
646
|
return typeof value === "object" && value !== null && "cache" in value && typeof value.subscribe === "function";
|
|
627
647
|
}
|
|
628
|
-
function keepalive(
|
|
629
|
-
|
|
648
|
+
function keepalive(node33) {
|
|
649
|
+
node33.subscribe(() => void 0);
|
|
630
650
|
}
|
|
631
651
|
function mapFromSnapshot(snapshot) {
|
|
632
652
|
if (snapshot instanceof Map) return snapshot;
|
|
@@ -786,15 +806,19 @@ function externalProducer(register, opts) {
|
|
|
786
806
|
cleanup = typeof ret === "function" ? ret : void 0;
|
|
787
807
|
} catch (err) {
|
|
788
808
|
triad.error(err);
|
|
789
|
-
return
|
|
790
|
-
|
|
809
|
+
return {
|
|
810
|
+
onDeactivation: () => {
|
|
811
|
+
active = false;
|
|
812
|
+
}
|
|
791
813
|
};
|
|
792
814
|
}
|
|
793
|
-
return
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
815
|
+
return {
|
|
816
|
+
onDeactivation: () => {
|
|
817
|
+
active = false;
|
|
818
|
+
try {
|
|
819
|
+
cleanup?.();
|
|
820
|
+
} catch {
|
|
821
|
+
}
|
|
798
822
|
}
|
|
799
823
|
};
|
|
800
824
|
}, sourceOpts2(opts));
|
|
@@ -820,10 +844,12 @@ function externalBundle(register, channels, opts) {
|
|
|
820
844
|
const n = (0, import_core4.node)(
|
|
821
845
|
(_data, _a) => {
|
|
822
846
|
activatedCount++;
|
|
823
|
-
return
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
847
|
+
return {
|
|
848
|
+
onDeactivation: () => {
|
|
849
|
+
teardownCount++;
|
|
850
|
+
if (activatedCount > 0 && teardownCount >= activatedCount && teardownCount >= channels.length) {
|
|
851
|
+
finishCleanup();
|
|
852
|
+
}
|
|
827
853
|
}
|
|
828
854
|
};
|
|
829
855
|
},
|
|
@@ -989,11 +1015,13 @@ function materialize(key, factories, parent, opts) {
|
|
|
989
1015
|
}
|
|
990
1016
|
}
|
|
991
1017
|
});
|
|
992
|
-
return
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1018
|
+
return {
|
|
1019
|
+
onDeactivation: () => {
|
|
1020
|
+
terminated = true;
|
|
1021
|
+
keyUnsub();
|
|
1022
|
+
facUnsub();
|
|
1023
|
+
unmountCurrent();
|
|
1024
|
+
}
|
|
997
1025
|
};
|
|
998
1026
|
},
|
|
999
1027
|
{
|
|
@@ -1062,10 +1090,10 @@ function makeInterop(onSubscribe) {
|
|
|
1062
1090
|
};
|
|
1063
1091
|
return obs;
|
|
1064
1092
|
}
|
|
1065
|
-
function toObservable(
|
|
1093
|
+
function toObservable(node33, options) {
|
|
1066
1094
|
if (options?.raw) {
|
|
1067
1095
|
return makeInterop((observer) => {
|
|
1068
|
-
return
|
|
1096
|
+
return node33.subscribe((msgs) => {
|
|
1069
1097
|
if (observer.closed) return;
|
|
1070
1098
|
observer.next?.(msgs);
|
|
1071
1099
|
for (const m of msgs) {
|
|
@@ -1082,7 +1110,7 @@ function toObservable(node32, options) {
|
|
|
1082
1110
|
});
|
|
1083
1111
|
}
|
|
1084
1112
|
return makeInterop((observer) => {
|
|
1085
|
-
return
|
|
1113
|
+
return node33.subscribe((msgs) => {
|
|
1086
1114
|
for (const m of msgs) {
|
|
1087
1115
|
if (observer.closed) return;
|
|
1088
1116
|
if (m[0] === import_core6.DATA) {
|
|
@@ -1486,18 +1514,19 @@ function singleNodeFromAny(factory, opts = {}) {
|
|
|
1486
1514
|
const k = keyFn(key);
|
|
1487
1515
|
const existing = inFlight.get(k);
|
|
1488
1516
|
if (existing) return existing;
|
|
1489
|
-
const
|
|
1490
|
-
inFlight.set(k,
|
|
1491
|
-
|
|
1517
|
+
const node33 = (0, import_extra5.fromAny)(factory(key));
|
|
1518
|
+
inFlight.set(k, node33);
|
|
1519
|
+
let unsub;
|
|
1520
|
+
unsub = node33.subscribe((msgs) => {
|
|
1492
1521
|
for (const m of msgs) {
|
|
1493
|
-
if (m[0] === import_core11.ERROR || m[0] === import_core11.COMPLETE) {
|
|
1494
|
-
if (inFlight.get(k) ===
|
|
1495
|
-
unsub();
|
|
1522
|
+
if (m[0] === import_core11.ERROR || m[0] === import_core11.COMPLETE || m[0] === import_core11.TEARDOWN) {
|
|
1523
|
+
if (inFlight.get(k) === node33) inFlight.delete(k);
|
|
1524
|
+
unsub?.();
|
|
1496
1525
|
return;
|
|
1497
1526
|
}
|
|
1498
1527
|
}
|
|
1499
1528
|
});
|
|
1500
|
-
return
|
|
1529
|
+
return node33;
|
|
1501
1530
|
};
|
|
1502
1531
|
}
|
|
1503
1532
|
|
|
@@ -1549,7 +1578,12 @@ function verifiable(source, verifyFn, opts) {
|
|
|
1549
1578
|
// src/base/io/checkpoint.ts
|
|
1550
1579
|
var import_core13 = require("@graphrefly/pure-ts/core");
|
|
1551
1580
|
function checkpointToS3(graph, client, bucket, opts) {
|
|
1552
|
-
const {
|
|
1581
|
+
const {
|
|
1582
|
+
prefix = "checkpoints/",
|
|
1583
|
+
debounceMs = 500,
|
|
1584
|
+
compactEvery = 10,
|
|
1585
|
+
onError = (err) => console.error(`checkpointToS3(${bucket}): checkpoint persistence failed`, err)
|
|
1586
|
+
} = opts ?? {};
|
|
1553
1587
|
const tier = {
|
|
1554
1588
|
name: `s3:${bucket}`,
|
|
1555
1589
|
debounceMs,
|
|
@@ -1561,7 +1595,7 @@ function checkpointToS3(graph, client, bucket, opts) {
|
|
|
1561
1595
|
try {
|
|
1562
1596
|
body = JSON.stringify(record);
|
|
1563
1597
|
} catch (err) {
|
|
1564
|
-
onError
|
|
1598
|
+
onError(err);
|
|
1565
1599
|
return;
|
|
1566
1600
|
}
|
|
1567
1601
|
void client.putObject({
|
|
@@ -1569,13 +1603,13 @@ function checkpointToS3(graph, client, bucket, opts) {
|
|
|
1569
1603
|
Key: s3Key,
|
|
1570
1604
|
Body: body,
|
|
1571
1605
|
ContentType: "application/json"
|
|
1572
|
-
}).catch((err) => onError
|
|
1606
|
+
}).catch((err) => onError(err));
|
|
1573
1607
|
}
|
|
1574
1608
|
// S3 tier is write-only here — one object per checkpoint timestamp,
|
|
1575
1609
|
// no canonical "latest" key for load.
|
|
1576
1610
|
};
|
|
1577
1611
|
return graph.attachSnapshotStorage([{ snapshot: tier }], {
|
|
1578
|
-
onError: (err) => onError
|
|
1612
|
+
onError: (err) => onError(err)
|
|
1579
1613
|
});
|
|
1580
1614
|
}
|
|
1581
1615
|
function checkpointToRedis(graph, client, opts) {
|
|
@@ -1583,7 +1617,7 @@ function checkpointToRedis(graph, client, opts) {
|
|
|
1583
1617
|
prefix = "graphrefly:checkpoint:",
|
|
1584
1618
|
debounceMs = 500,
|
|
1585
1619
|
compactEvery = 10,
|
|
1586
|
-
onError
|
|
1620
|
+
onError = (err) => console.error(`checkpointToRedis(${graph.name}): checkpoint persistence failed`, err)
|
|
1587
1621
|
} = opts ?? {};
|
|
1588
1622
|
const redisKey = `${prefix}${graph.name}`;
|
|
1589
1623
|
const tier = {
|
|
@@ -1595,23 +1629,24 @@ function checkpointToRedis(graph, client, opts) {
|
|
|
1595
1629
|
try {
|
|
1596
1630
|
body = JSON.stringify(record);
|
|
1597
1631
|
} catch (err) {
|
|
1598
|
-
onError
|
|
1632
|
+
onError(err);
|
|
1599
1633
|
return;
|
|
1600
1634
|
}
|
|
1601
|
-
void client.set(redisKey, body).catch((err) => onError
|
|
1635
|
+
void client.set(redisKey, body).catch((err) => onError(err));
|
|
1602
1636
|
},
|
|
1603
1637
|
async load() {
|
|
1604
1638
|
const raw = await client.get(redisKey);
|
|
1605
1639
|
if (raw == null) return void 0;
|
|
1606
1640
|
try {
|
|
1607
1641
|
return JSON.parse(raw);
|
|
1608
|
-
} catch {
|
|
1642
|
+
} catch (err) {
|
|
1643
|
+
onError(err);
|
|
1609
1644
|
return void 0;
|
|
1610
1645
|
}
|
|
1611
1646
|
}
|
|
1612
1647
|
};
|
|
1613
1648
|
return graph.attachSnapshotStorage([{ snapshot: tier }], {
|
|
1614
|
-
onError: (err) => onError
|
|
1649
|
+
onError: (err) => onError(err)
|
|
1615
1650
|
});
|
|
1616
1651
|
}
|
|
1617
1652
|
|
|
@@ -1650,8 +1685,10 @@ function fromClickHouseWatch(client, query, opts) {
|
|
|
1650
1685
|
}
|
|
1651
1686
|
};
|
|
1652
1687
|
void run();
|
|
1653
|
-
return
|
|
1654
|
-
|
|
1688
|
+
return {
|
|
1689
|
+
onDeactivation: () => {
|
|
1690
|
+
active = false;
|
|
1691
|
+
}
|
|
1655
1692
|
};
|
|
1656
1693
|
})
|
|
1657
1694
|
);
|
|
@@ -1722,8 +1759,10 @@ function fromCSV(source, opts) {
|
|
|
1722
1759
|
}
|
|
1723
1760
|
};
|
|
1724
1761
|
void run();
|
|
1725
|
-
return
|
|
1726
|
-
|
|
1762
|
+
return {
|
|
1763
|
+
onDeactivation: () => {
|
|
1764
|
+
cancelled = true;
|
|
1765
|
+
}
|
|
1727
1766
|
};
|
|
1728
1767
|
},
|
|
1729
1768
|
sourceOpts3(rest)
|
|
@@ -1827,8 +1866,10 @@ function fromDrizzle(query, opts) {
|
|
|
1827
1866
|
} catch {
|
|
1828
1867
|
}
|
|
1829
1868
|
});
|
|
1830
|
-
return
|
|
1831
|
-
|
|
1869
|
+
return {
|
|
1870
|
+
onDeactivation: () => {
|
|
1871
|
+
active = false;
|
|
1872
|
+
}
|
|
1832
1873
|
};
|
|
1833
1874
|
},
|
|
1834
1875
|
{ ...rest, describeKind: "producer", completeWhenDepsComplete: false }
|
|
@@ -1889,7 +1930,7 @@ function withStatus(src, options) {
|
|
|
1889
1930
|
} else a.down([m]);
|
|
1890
1931
|
}
|
|
1891
1932
|
});
|
|
1892
|
-
return unsub;
|
|
1933
|
+
return { onDeactivation: unsub };
|
|
1893
1934
|
},
|
|
1894
1935
|
{
|
|
1895
1936
|
...operatorOpts2(),
|
|
@@ -2071,7 +2112,21 @@ function reactiveSink(source, config) {
|
|
|
2071
2112
|
}
|
|
2072
2113
|
return run();
|
|
2073
2114
|
};
|
|
2074
|
-
|
|
2115
|
+
let maxBuf = Number.POSITIVE_INFINITY;
|
|
2116
|
+
if (backpressure) {
|
|
2117
|
+
const mb = backpressure.maxBuffer;
|
|
2118
|
+
if (mb === void 0) {
|
|
2119
|
+
throw new RangeError(
|
|
2120
|
+
"reactiveSink: backpressure requires explicit maxBuffer (use Infinity to opt in to unbounded)"
|
|
2121
|
+
);
|
|
2122
|
+
}
|
|
2123
|
+
if (mb !== Number.POSITIVE_INFINITY && (!Number.isInteger(mb) || mb < 1)) {
|
|
2124
|
+
throw new RangeError(
|
|
2125
|
+
"reactiveSink: backpressure.maxBuffer must be a positive integer (or Infinity for unbounded)"
|
|
2126
|
+
);
|
|
2127
|
+
}
|
|
2128
|
+
maxBuf = mb;
|
|
2129
|
+
}
|
|
2075
2130
|
const buffer = new BackpressureBuffer(maxBuf);
|
|
2076
2131
|
let flushTimer;
|
|
2077
2132
|
let disposed = false;
|
|
@@ -2391,9 +2446,11 @@ function fromHTTP(url, opts) {
|
|
|
2391
2446
|
};
|
|
2392
2447
|
const sourceNode = (0, import_core19.node)(
|
|
2393
2448
|
[],
|
|
2394
|
-
(_data, a) =>
|
|
2395
|
-
|
|
2396
|
-
|
|
2449
|
+
(_data, a) => ({
|
|
2450
|
+
onDeactivation: runFetch({
|
|
2451
|
+
emit: (v) => a.emit(v),
|
|
2452
|
+
down: (msgs) => a.down(msgs)
|
|
2453
|
+
})
|
|
2397
2454
|
}),
|
|
2398
2455
|
{
|
|
2399
2456
|
...sourceOpts3(rest),
|
|
@@ -2494,8 +2551,8 @@ function fromHTTPStream(url, opts) {
|
|
|
2494
2551
|
const abort = new AbortController();
|
|
2495
2552
|
if (externalSignal?.aborted) {
|
|
2496
2553
|
a.down([[import_core19.ERROR, externalSignal.reason ?? new Error("Aborted")]]);
|
|
2497
|
-
return () => {
|
|
2498
|
-
};
|
|
2554
|
+
return { onDeactivation: () => {
|
|
2555
|
+
} };
|
|
2499
2556
|
}
|
|
2500
2557
|
externalSignal?.addEventListener("abort", () => abort.abort(externalSignal.reason), {
|
|
2501
2558
|
once: true
|
|
@@ -2521,9 +2578,11 @@ function fromHTTPStream(url, opts) {
|
|
|
2521
2578
|
}
|
|
2522
2579
|
};
|
|
2523
2580
|
void run();
|
|
2524
|
-
return
|
|
2525
|
-
|
|
2526
|
-
|
|
2581
|
+
return {
|
|
2582
|
+
onDeactivation: () => {
|
|
2583
|
+
active = false;
|
|
2584
|
+
abort.abort();
|
|
2585
|
+
}
|
|
2527
2586
|
};
|
|
2528
2587
|
},
|
|
2529
2588
|
sourceOpts3(rest)
|
|
@@ -2585,8 +2644,10 @@ function fromKafka(consumer, topic, opts) {
|
|
|
2585
2644
|
}
|
|
2586
2645
|
};
|
|
2587
2646
|
void start();
|
|
2588
|
-
return
|
|
2589
|
-
|
|
2647
|
+
return {
|
|
2648
|
+
onDeactivation: () => {
|
|
2649
|
+
active = false;
|
|
2650
|
+
}
|
|
2590
2651
|
};
|
|
2591
2652
|
},
|
|
2592
2653
|
sourceOpts3(rest)
|
|
@@ -2626,8 +2687,10 @@ function fromKysely(query, opts) {
|
|
|
2626
2687
|
} catch {
|
|
2627
2688
|
}
|
|
2628
2689
|
});
|
|
2629
|
-
return
|
|
2630
|
-
|
|
2690
|
+
return {
|
|
2691
|
+
onDeactivation: () => {
|
|
2692
|
+
active = false;
|
|
2693
|
+
}
|
|
2631
2694
|
};
|
|
2632
2695
|
},
|
|
2633
2696
|
{ ...rest, describeKind: "producer", completeWhenDepsComplete: false }
|
|
@@ -2691,8 +2754,10 @@ function fromNATS(client, subject, opts) {
|
|
|
2691
2754
|
}
|
|
2692
2755
|
};
|
|
2693
2756
|
void loop();
|
|
2694
|
-
return
|
|
2695
|
-
|
|
2757
|
+
return {
|
|
2758
|
+
onDeactivation: () => {
|
|
2759
|
+
active = false;
|
|
2760
|
+
}
|
|
2696
2761
|
};
|
|
2697
2762
|
},
|
|
2698
2763
|
sourceOpts3(rest)
|
|
@@ -2776,8 +2841,10 @@ function fromNDJSON(source, opts) {
|
|
|
2776
2841
|
}
|
|
2777
2842
|
};
|
|
2778
2843
|
void run();
|
|
2779
|
-
return
|
|
2780
|
-
|
|
2844
|
+
return {
|
|
2845
|
+
onDeactivation: () => {
|
|
2846
|
+
cancelled = true;
|
|
2847
|
+
}
|
|
2781
2848
|
};
|
|
2782
2849
|
},
|
|
2783
2850
|
sourceOpts3(opts)
|
|
@@ -2833,8 +2900,10 @@ function fromPrisma(model, opts) {
|
|
|
2833
2900
|
} catch {
|
|
2834
2901
|
}
|
|
2835
2902
|
});
|
|
2836
|
-
return
|
|
2837
|
-
|
|
2903
|
+
return {
|
|
2904
|
+
onDeactivation: () => {
|
|
2905
|
+
active = false;
|
|
2906
|
+
}
|
|
2838
2907
|
};
|
|
2839
2908
|
},
|
|
2840
2909
|
{ ...rest, describeKind: "producer", completeWhenDepsComplete: false }
|
|
@@ -2890,10 +2959,12 @@ function fromPrometheus(endpoint, opts) {
|
|
|
2890
2959
|
}
|
|
2891
2960
|
};
|
|
2892
2961
|
void run();
|
|
2893
|
-
return
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2962
|
+
return {
|
|
2963
|
+
onDeactivation: () => {
|
|
2964
|
+
active = false;
|
|
2965
|
+
clearTimeout(timeoutId);
|
|
2966
|
+
abort.abort();
|
|
2967
|
+
}
|
|
2897
2968
|
};
|
|
2898
2969
|
})
|
|
2899
2970
|
);
|
|
@@ -3043,8 +3114,10 @@ function fromPulsar(consumer, opts) {
|
|
|
3043
3114
|
}
|
|
3044
3115
|
};
|
|
3045
3116
|
void loop();
|
|
3046
|
-
return
|
|
3047
|
-
|
|
3117
|
+
return {
|
|
3118
|
+
onDeactivation: () => {
|
|
3119
|
+
active = false;
|
|
3120
|
+
}
|
|
3048
3121
|
};
|
|
3049
3122
|
},
|
|
3050
3123
|
sourceOpts3(rest)
|
|
@@ -3165,10 +3238,12 @@ function fromRabbitMQ(channel, queue, opts) {
|
|
|
3165
3238
|
}
|
|
3166
3239
|
};
|
|
3167
3240
|
void start();
|
|
3168
|
-
return
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3241
|
+
return {
|
|
3242
|
+
onDeactivation: () => {
|
|
3243
|
+
active = false;
|
|
3244
|
+
if (consumerTag !== void 0) {
|
|
3245
|
+
void channel.cancel(consumerTag);
|
|
3246
|
+
}
|
|
3172
3247
|
}
|
|
3173
3248
|
};
|
|
3174
3249
|
},
|
|
@@ -3246,8 +3321,10 @@ function fromRedisStream(client, key, opts) {
|
|
|
3246
3321
|
}
|
|
3247
3322
|
};
|
|
3248
3323
|
void poll();
|
|
3249
|
-
return
|
|
3250
|
-
|
|
3324
|
+
return {
|
|
3325
|
+
onDeactivation: () => {
|
|
3326
|
+
active = false;
|
|
3327
|
+
}
|
|
3251
3328
|
};
|
|
3252
3329
|
},
|
|
3253
3330
|
sourceOpts3(rest)
|
|
@@ -3664,11 +3741,13 @@ function toSSEBytes(source, opts) {
|
|
|
3664
3741
|
}
|
|
3665
3742
|
if (signal?.aborted) onAbort();
|
|
3666
3743
|
else signal?.addEventListener("abort", onAbort, { once: true });
|
|
3667
|
-
return
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3744
|
+
return {
|
|
3745
|
+
onDeactivation: () => {
|
|
3746
|
+
active = false;
|
|
3747
|
+
if (keepAlive !== void 0) clearInterval(keepAlive);
|
|
3748
|
+
signal?.removeEventListener("abort", onAbort);
|
|
3749
|
+
unsub();
|
|
3750
|
+
}
|
|
3672
3751
|
};
|
|
3673
3752
|
});
|
|
3674
3753
|
}
|
|
@@ -3855,9 +3934,11 @@ function fromSSE(source, opts) {
|
|
|
3855
3934
|
}
|
|
3856
3935
|
};
|
|
3857
3936
|
void run();
|
|
3858
|
-
return
|
|
3859
|
-
|
|
3860
|
-
|
|
3937
|
+
return {
|
|
3938
|
+
onDeactivation: () => {
|
|
3939
|
+
active = false;
|
|
3940
|
+
ctrl.abort();
|
|
3941
|
+
}
|
|
3861
3942
|
};
|
|
3862
3943
|
},
|
|
3863
3944
|
sourceOpts3(rest)
|
|
@@ -4312,9 +4393,11 @@ function _retrySource(source, opts, emitState) {
|
|
|
4312
4393
|
const merged = makeMergedOptsMirror(opts);
|
|
4313
4394
|
const getCfg = () => resolveRetryConfig(merged.current());
|
|
4314
4395
|
const inner = _runRetryStateMachine(getCfg, () => source, a, emitState);
|
|
4315
|
-
return
|
|
4316
|
-
|
|
4317
|
-
|
|
4396
|
+
return {
|
|
4397
|
+
onDeactivation: () => {
|
|
4398
|
+
inner();
|
|
4399
|
+
merged.unsub();
|
|
4400
|
+
}
|
|
4318
4401
|
};
|
|
4319
4402
|
},
|
|
4320
4403
|
{
|
|
@@ -4338,9 +4421,11 @@ function _retryFactory(factory, opts, emitState) {
|
|
|
4338
4421
|
const merged = makeMergedOptsMirror(opts);
|
|
4339
4422
|
const getCfg = () => resolveRetryConfig(merged.current());
|
|
4340
4423
|
const inner = _runRetryStateMachine(getCfg, factory, a, emitState);
|
|
4341
|
-
return
|
|
4342
|
-
|
|
4343
|
-
|
|
4424
|
+
return {
|
|
4425
|
+
onDeactivation: () => {
|
|
4426
|
+
inner();
|
|
4427
|
+
merged.unsub();
|
|
4428
|
+
}
|
|
4344
4429
|
};
|
|
4345
4430
|
},
|
|
4346
4431
|
{
|
|
@@ -4403,9 +4488,11 @@ function fromWebSocket(socketOrRegister, opts) {
|
|
|
4403
4488
|
} catch (err) {
|
|
4404
4489
|
terminate([import_core37.ERROR, err]);
|
|
4405
4490
|
}
|
|
4406
|
-
return
|
|
4407
|
-
|
|
4408
|
-
|
|
4491
|
+
return {
|
|
4492
|
+
onDeactivation: () => {
|
|
4493
|
+
active = false;
|
|
4494
|
+
runCleanup();
|
|
4495
|
+
}
|
|
4409
4496
|
};
|
|
4410
4497
|
}
|
|
4411
4498
|
const ws = socketOrRegister;
|
|
@@ -4421,9 +4508,11 @@ function fromWebSocket(socketOrRegister, opts) {
|
|
|
4421
4508
|
ws.removeEventListener("close", onClose);
|
|
4422
4509
|
if (closeOnTeardown) ws.close();
|
|
4423
4510
|
};
|
|
4424
|
-
return
|
|
4425
|
-
|
|
4426
|
-
|
|
4511
|
+
return {
|
|
4512
|
+
onDeactivation: () => {
|
|
4513
|
+
active = false;
|
|
4514
|
+
runCleanup();
|
|
4515
|
+
}
|
|
4427
4516
|
};
|
|
4428
4517
|
},
|
|
4429
4518
|
sourceOpts3(rest)
|
|
@@ -4503,13 +4592,7 @@ function toWebSocket(source, socket, opts) {
|
|
|
4503
4592
|
return handle;
|
|
4504
4593
|
}
|
|
4505
4594
|
function fromWebSocketReconnect(factory, opts) {
|
|
4506
|
-
const {
|
|
4507
|
-
parse,
|
|
4508
|
-
maxRetries,
|
|
4509
|
-
backoff = "exponential",
|
|
4510
|
-
closeOnTeardown = true,
|
|
4511
|
-
...rest
|
|
4512
|
-
} = opts ?? {};
|
|
4595
|
+
const { parse, maxRetries, backoff = "exponential", closeOnTeardown = true, ...rest } = opts;
|
|
4513
4596
|
return retry(
|
|
4514
4597
|
() => fromWebSocket(factory(), {
|
|
4515
4598
|
parse,
|
|
@@ -4564,6 +4647,26 @@ function createAuditLog(opts) {
|
|
|
4564
4647
|
}
|
|
4565
4648
|
return log;
|
|
4566
4649
|
}
|
|
4650
|
+
function readonlyAuditLog(log) {
|
|
4651
|
+
return Object.freeze({
|
|
4652
|
+
get entries() {
|
|
4653
|
+
return log.entries;
|
|
4654
|
+
},
|
|
4655
|
+
get size() {
|
|
4656
|
+
return log.size;
|
|
4657
|
+
},
|
|
4658
|
+
get lastValue() {
|
|
4659
|
+
return log.lastValue;
|
|
4660
|
+
},
|
|
4661
|
+
get mutationLog() {
|
|
4662
|
+
return log.mutationLog;
|
|
4663
|
+
},
|
|
4664
|
+
at: log.at.bind(log),
|
|
4665
|
+
withLatest: log.withLatest.bind(log),
|
|
4666
|
+
view: log.view.bind(log),
|
|
4667
|
+
scan: log.scan.bind(log)
|
|
4668
|
+
});
|
|
4669
|
+
}
|
|
4567
4670
|
function deepFreeze(value) {
|
|
4568
4671
|
if (value === null || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
4569
4672
|
for (const k of Object.keys(value)) {
|
|
@@ -5856,12 +5959,39 @@ function fromCron(expr, opts) {
|
|
|
5856
5959
|
};
|
|
5857
5960
|
check();
|
|
5858
5961
|
const id = setInterval(check, tickMs);
|
|
5859
|
-
return () => clearInterval(id);
|
|
5962
|
+
return { onDeactivation: () => clearInterval(id) };
|
|
5860
5963
|
},
|
|
5861
5964
|
{ ...sourceOpts4(rest), name: rest.name ?? `cron:${expr}` }
|
|
5862
5965
|
);
|
|
5863
5966
|
}
|
|
5864
5967
|
|
|
5968
|
+
// src/base/sources/event/push.ts
|
|
5969
|
+
var import_core41 = require("@graphrefly/pure-ts/core");
|
|
5970
|
+
function sourceOpts5(opts) {
|
|
5971
|
+
return { describeKind: "producer", ...opts };
|
|
5972
|
+
}
|
|
5973
|
+
function fromPushNotification(register, opts) {
|
|
5974
|
+
if (typeof register !== "function") {
|
|
5975
|
+
throw new TypeError(
|
|
5976
|
+
"fromPushNotification: a (deliver) => unsubscribe registration function is required"
|
|
5977
|
+
);
|
|
5978
|
+
}
|
|
5979
|
+
return (0, import_core41.node)((_data, a) => {
|
|
5980
|
+
let done = false;
|
|
5981
|
+
const deliver = (payload) => {
|
|
5982
|
+
if (done) return;
|
|
5983
|
+
a.emit(payload);
|
|
5984
|
+
};
|
|
5985
|
+
const unsubscribe = register(deliver);
|
|
5986
|
+
return {
|
|
5987
|
+
onDeactivation: () => {
|
|
5988
|
+
done = true;
|
|
5989
|
+
if (typeof unsubscribe === "function") unsubscribe();
|
|
5990
|
+
}
|
|
5991
|
+
};
|
|
5992
|
+
}, sourceOpts5(opts));
|
|
5993
|
+
}
|
|
5994
|
+
|
|
5865
5995
|
// src/base/utils/decay.ts
|
|
5866
5996
|
var DEFAULT_DECAY_RATE = Math.LN2 / (7 * 86400);
|
|
5867
5997
|
function decay(baseScore, ageSeconds, ratePerSecond, minScore = 0) {
|
|
@@ -5873,26 +6003,26 @@ function decay(baseScore, ageSeconds, ratePerSecond, minScore = 0) {
|
|
|
5873
6003
|
}
|
|
5874
6004
|
|
|
5875
6005
|
// src/base/worker/bridge.ts
|
|
5876
|
-
var
|
|
6006
|
+
var import_core43 = require("@graphrefly/pure-ts/core");
|
|
5877
6007
|
var import_extra11 = require("@graphrefly/pure-ts/extra");
|
|
5878
6008
|
|
|
5879
6009
|
// src/base/worker/protocol.ts
|
|
5880
|
-
var
|
|
6010
|
+
var import_core42 = require("@graphrefly/pure-ts/core");
|
|
5881
6011
|
var signalToNameMap = /* @__PURE__ */ new Map([
|
|
5882
|
-
[
|
|
5883
|
-
[
|
|
5884
|
-
[
|
|
5885
|
-
[
|
|
5886
|
-
[
|
|
5887
|
-
[
|
|
6012
|
+
[import_core42.INVALIDATE, "INVALIDATE"],
|
|
6013
|
+
[import_core42.PAUSE, "PAUSE"],
|
|
6014
|
+
[import_core42.RESUME, "RESUME"],
|
|
6015
|
+
[import_core42.TEARDOWN, "TEARDOWN"],
|
|
6016
|
+
[import_core42.COMPLETE, "COMPLETE"],
|
|
6017
|
+
[import_core42.ERROR, "ERROR"]
|
|
5888
6018
|
]);
|
|
5889
6019
|
var nameToSignalMap = /* @__PURE__ */ new Map([
|
|
5890
|
-
["INVALIDATE",
|
|
5891
|
-
["PAUSE",
|
|
5892
|
-
["RESUME",
|
|
5893
|
-
["TEARDOWN",
|
|
5894
|
-
["COMPLETE",
|
|
5895
|
-
["ERROR",
|
|
6020
|
+
["INVALIDATE", import_core42.INVALIDATE],
|
|
6021
|
+
["PAUSE", import_core42.PAUSE],
|
|
6022
|
+
["RESUME", import_core42.RESUME],
|
|
6023
|
+
["TEARDOWN", import_core42.TEARDOWN],
|
|
6024
|
+
["COMPLETE", import_core42.COMPLETE],
|
|
6025
|
+
["ERROR", import_core42.ERROR]
|
|
5896
6026
|
]);
|
|
5897
6027
|
function signalToName(s) {
|
|
5898
6028
|
const known = signalToNameMap.get(s);
|
|
@@ -6004,24 +6134,24 @@ function workerBridge(target, opts) {
|
|
|
6004
6134
|
const exposeEntries = Object.entries(opts.expose ?? {});
|
|
6005
6135
|
const importNames = opts.import ?? [];
|
|
6006
6136
|
const transferFns = opts.transfer ?? {};
|
|
6007
|
-
const statusNode = (0,
|
|
6137
|
+
const statusNode = (0, import_core43.node)([], {
|
|
6008
6138
|
initial: "connecting",
|
|
6009
6139
|
name: `${bridgeName}::meta::status`
|
|
6010
6140
|
});
|
|
6011
|
-
const errorNode = (0,
|
|
6141
|
+
const errorNode = (0, import_core43.node)([], {
|
|
6012
6142
|
initial: null,
|
|
6013
6143
|
name: `${bridgeName}::meta::error`
|
|
6014
6144
|
});
|
|
6015
6145
|
const proxyNodes = /* @__PURE__ */ new Map();
|
|
6016
6146
|
const lastSeenImportVersions = /* @__PURE__ */ new Map();
|
|
6017
6147
|
for (const name of importNames) {
|
|
6018
|
-
const proxy = (0,
|
|
6148
|
+
const proxy = (0, import_core43.node)([], { initial: void 0, name: `${bridgeName}::${name}` });
|
|
6019
6149
|
proxyNodes.set(name, proxy);
|
|
6020
6150
|
}
|
|
6021
6151
|
let effectUnsub;
|
|
6022
6152
|
if (exposeEntries.length > 0) {
|
|
6023
6153
|
const exposedNodes = exposeEntries.map(([, n]) => n);
|
|
6024
|
-
const aggregated = (0,
|
|
6154
|
+
const aggregated = (0, import_core43.node)(
|
|
6025
6155
|
exposedNodes,
|
|
6026
6156
|
(data, a) => {
|
|
6027
6157
|
const updates = {};
|
|
@@ -6043,7 +6173,7 @@ function workerBridge(target, opts) {
|
|
|
6043
6173
|
// the same time).
|
|
6044
6174
|
{ name: `${bridgeName}::aggregated`, partial: true }
|
|
6045
6175
|
);
|
|
6046
|
-
const effectNode = (0,
|
|
6176
|
+
const effectNode = (0, import_core43.node)(
|
|
6047
6177
|
[aggregated],
|
|
6048
6178
|
(batchData, _actions, ctx) => {
|
|
6049
6179
|
const batch0 = batchData[0];
|
|
@@ -6066,7 +6196,7 @@ function workerBridge(target, opts) {
|
|
|
6066
6196
|
try {
|
|
6067
6197
|
transport.post(msg, transferList.length > 0 ? transferList : void 0);
|
|
6068
6198
|
} catch (err) {
|
|
6069
|
-
errorNode.down([[
|
|
6199
|
+
errorNode.down([[import_core43.DATA, err instanceof Error ? err : new Error(String(err))]]);
|
|
6070
6200
|
}
|
|
6071
6201
|
return void 0;
|
|
6072
6202
|
},
|
|
@@ -6084,13 +6214,13 @@ function workerBridge(target, opts) {
|
|
|
6084
6214
|
// The handshake deadline auto-cancels via the reactive race
|
|
6085
6215
|
// (`statusNode → "connected"` wins) — no explicit clearTimeout.
|
|
6086
6216
|
case "r": {
|
|
6087
|
-
(0,
|
|
6217
|
+
(0, import_core43.batch)(() => {
|
|
6088
6218
|
for (const [name, value] of Object.entries(msg.stores)) {
|
|
6089
6219
|
const proxy = proxyNodes.get(name);
|
|
6090
|
-
if (proxy) proxy.down([[
|
|
6220
|
+
if (proxy) proxy.down([[import_core43.DATA, value]]);
|
|
6091
6221
|
}
|
|
6092
6222
|
});
|
|
6093
|
-
statusNode.down([[
|
|
6223
|
+
statusNode.down([[import_core43.DATA, "connected"]]);
|
|
6094
6224
|
const initValues = {};
|
|
6095
6225
|
for (const [name, n] of exposeEntries) {
|
|
6096
6226
|
initValues[name] = n.cache;
|
|
@@ -6101,12 +6231,12 @@ function workerBridge(target, opts) {
|
|
|
6101
6231
|
// Single value update from worker
|
|
6102
6232
|
case "v": {
|
|
6103
6233
|
const proxy = proxyNodes.get(msg.s);
|
|
6104
|
-
if (proxy) proxy.down([[
|
|
6234
|
+
if (proxy) proxy.down([[import_core43.DATA, msg.d]]);
|
|
6105
6235
|
break;
|
|
6106
6236
|
}
|
|
6107
6237
|
// Batch value update from worker
|
|
6108
6238
|
case "b": {
|
|
6109
|
-
(0,
|
|
6239
|
+
(0, import_core43.batch)(() => {
|
|
6110
6240
|
for (const [name, value] of Object.entries(msg.u)) {
|
|
6111
6241
|
const incomingVersion = msg.v?.[name];
|
|
6112
6242
|
if (incomingVersion != null) {
|
|
@@ -6115,7 +6245,7 @@ function workerBridge(target, opts) {
|
|
|
6115
6245
|
lastSeenImportVersions.set(name, incomingVersion);
|
|
6116
6246
|
}
|
|
6117
6247
|
const proxy = proxyNodes.get(name);
|
|
6118
|
-
if (proxy) proxy.down([[
|
|
6248
|
+
if (proxy) proxy.down([[import_core43.DATA, value]]);
|
|
6119
6249
|
}
|
|
6120
6250
|
});
|
|
6121
6251
|
break;
|
|
@@ -6123,7 +6253,7 @@ function workerBridge(target, opts) {
|
|
|
6123
6253
|
// Error from worker node
|
|
6124
6254
|
case "e": {
|
|
6125
6255
|
const proxy = proxyNodes.get(msg.s);
|
|
6126
|
-
if (proxy) proxy.down([[
|
|
6256
|
+
if (proxy) proxy.down([[import_core43.ERROR, deserializeError(msg.err)]]);
|
|
6127
6257
|
break;
|
|
6128
6258
|
}
|
|
6129
6259
|
// Lifecycle signal from worker
|
|
@@ -6144,9 +6274,9 @@ function workerBridge(target, opts) {
|
|
|
6144
6274
|
if (destroyed) return;
|
|
6145
6275
|
for (const m of msgs) {
|
|
6146
6276
|
const type = m[0];
|
|
6147
|
-
if (type ===
|
|
6148
|
-
if (
|
|
6149
|
-
if (type ===
|
|
6277
|
+
if (type === import_core43.DATA) continue;
|
|
6278
|
+
if (import_core43.defaultConfig.isLocalOnly(type)) continue;
|
|
6279
|
+
if (type === import_core43.ERROR) {
|
|
6150
6280
|
transport.post({
|
|
6151
6281
|
t: "e",
|
|
6152
6282
|
s: name,
|
|
@@ -6176,8 +6306,8 @@ function workerBridge(target, opts) {
|
|
|
6176
6306
|
);
|
|
6177
6307
|
handshakeUnsub = race$.subscribe((msgs) => {
|
|
6178
6308
|
for (const m of msgs) {
|
|
6179
|
-
if (m[0] ===
|
|
6180
|
-
errorNode.down([[
|
|
6309
|
+
if (m[0] === import_core43.DATA && m[1] === "timeout") {
|
|
6310
|
+
errorNode.down([[import_core43.DATA, new Error("Worker bridge handshake timeout")]]);
|
|
6181
6311
|
destroy();
|
|
6182
6312
|
}
|
|
6183
6313
|
}
|
|
@@ -6190,13 +6320,13 @@ function workerBridge(target, opts) {
|
|
|
6190
6320
|
transport.post({
|
|
6191
6321
|
t: "s",
|
|
6192
6322
|
s: "*",
|
|
6193
|
-
sig: signalToName(
|
|
6323
|
+
sig: signalToName(import_core43.TEARDOWN)
|
|
6194
6324
|
});
|
|
6195
6325
|
if (effectUnsub) effectUnsub();
|
|
6196
6326
|
for (const unsub of exposeUnsubs) unsub();
|
|
6197
6327
|
exposeUnsubs.length = 0;
|
|
6198
6328
|
unlisten();
|
|
6199
|
-
statusNode.down([[
|
|
6329
|
+
statusNode.down([[import_core43.DATA, "closed"]]);
|
|
6200
6330
|
lastSeenImportVersions.clear();
|
|
6201
6331
|
proxyNodes.clear();
|
|
6202
6332
|
}
|
|
@@ -6211,7 +6341,7 @@ function workerBridge(target, opts) {
|
|
|
6211
6341
|
}
|
|
6212
6342
|
|
|
6213
6343
|
// src/base/worker/self.ts
|
|
6214
|
-
var
|
|
6344
|
+
var import_core44 = require("@graphrefly/pure-ts/core");
|
|
6215
6345
|
function isTransport2(t) {
|
|
6216
6346
|
return typeof t === "object" && t !== null && typeof t.post === "function" && typeof t.listen === "function";
|
|
6217
6347
|
}
|
|
@@ -6223,7 +6353,7 @@ function workerSelf(target, opts) {
|
|
|
6223
6353
|
const lastSeenImportVersions = /* @__PURE__ */ new Map();
|
|
6224
6354
|
const importedObj = {};
|
|
6225
6355
|
for (const name of importNames) {
|
|
6226
|
-
const s = (0,
|
|
6356
|
+
const s = (0, import_core44.node)([], { initial: void 0, name: `worker::${name}` });
|
|
6227
6357
|
proxyNodes.set(name, s);
|
|
6228
6358
|
importedObj[name] = s;
|
|
6229
6359
|
}
|
|
@@ -6233,7 +6363,7 @@ function workerSelf(target, opts) {
|
|
|
6233
6363
|
let destroyed = false;
|
|
6234
6364
|
if (exposeEntries.length > 0) {
|
|
6235
6365
|
const nodes = exposeEntries.map(([, n]) => n);
|
|
6236
|
-
const aggregated = (0,
|
|
6366
|
+
const aggregated = (0, import_core44.node)(
|
|
6237
6367
|
nodes,
|
|
6238
6368
|
(data, a) => {
|
|
6239
6369
|
const updates = {};
|
|
@@ -6253,7 +6383,7 @@ function workerSelf(target, opts) {
|
|
|
6253
6383
|
// any-dep-settles waves (deps deliver asynchronously).
|
|
6254
6384
|
{ name: "workerSelf::aggregated", partial: true }
|
|
6255
6385
|
);
|
|
6256
|
-
const effectNode = (0,
|
|
6386
|
+
const effectNode = (0, import_core44.node)(
|
|
6257
6387
|
[aggregated],
|
|
6258
6388
|
(batchData, _actions, ctx) => {
|
|
6259
6389
|
const batch0 = batchData[0];
|
|
@@ -6291,9 +6421,9 @@ function workerSelf(target, opts) {
|
|
|
6291
6421
|
if (destroyed) return;
|
|
6292
6422
|
for (const m of msgs) {
|
|
6293
6423
|
const type = m[0];
|
|
6294
|
-
if (type ===
|
|
6295
|
-
if (
|
|
6296
|
-
if (type ===
|
|
6424
|
+
if (type === import_core44.DATA) continue;
|
|
6425
|
+
if (import_core44.defaultConfig.isLocalOnly(type)) continue;
|
|
6426
|
+
if (type === import_core44.ERROR) {
|
|
6297
6427
|
transport.post({
|
|
6298
6428
|
t: "e",
|
|
6299
6429
|
s: name,
|
|
@@ -6317,10 +6447,10 @@ function workerSelf(target, opts) {
|
|
|
6317
6447
|
switch (msg.t) {
|
|
6318
6448
|
// Init from main — set proxy node values
|
|
6319
6449
|
case "i": {
|
|
6320
|
-
(0,
|
|
6450
|
+
(0, import_core44.batch)(() => {
|
|
6321
6451
|
for (const [name, value] of Object.entries(msg.stores)) {
|
|
6322
6452
|
const proxy = proxyNodes.get(name);
|
|
6323
|
-
if (proxy) proxy.down([[
|
|
6453
|
+
if (proxy) proxy.down([[import_core44.DATA, value]]);
|
|
6324
6454
|
}
|
|
6325
6455
|
});
|
|
6326
6456
|
break;
|
|
@@ -6328,12 +6458,12 @@ function workerSelf(target, opts) {
|
|
|
6328
6458
|
// Single value update from main
|
|
6329
6459
|
case "v": {
|
|
6330
6460
|
const proxy = proxyNodes.get(msg.s);
|
|
6331
|
-
if (proxy) proxy.down([[
|
|
6461
|
+
if (proxy) proxy.down([[import_core44.DATA, msg.d]]);
|
|
6332
6462
|
break;
|
|
6333
6463
|
}
|
|
6334
6464
|
// Batch value update from main
|
|
6335
6465
|
case "b": {
|
|
6336
|
-
(0,
|
|
6466
|
+
(0, import_core44.batch)(() => {
|
|
6337
6467
|
for (const [name, value] of Object.entries(msg.u)) {
|
|
6338
6468
|
const incomingVersion = msg.v?.[name];
|
|
6339
6469
|
if (incomingVersion != null) {
|
|
@@ -6342,7 +6472,7 @@ function workerSelf(target, opts) {
|
|
|
6342
6472
|
lastSeenImportVersions.set(name, incomingVersion);
|
|
6343
6473
|
}
|
|
6344
6474
|
const proxy = proxyNodes.get(name);
|
|
6345
|
-
if (proxy) proxy.down([[
|
|
6475
|
+
if (proxy) proxy.down([[import_core44.DATA, value]]);
|
|
6346
6476
|
}
|
|
6347
6477
|
});
|
|
6348
6478
|
break;
|
|
@@ -6350,14 +6480,14 @@ function workerSelf(target, opts) {
|
|
|
6350
6480
|
// Error from main node
|
|
6351
6481
|
case "e": {
|
|
6352
6482
|
const proxy = proxyNodes.get(msg.s);
|
|
6353
|
-
if (proxy) proxy.down([[
|
|
6483
|
+
if (proxy) proxy.down([[import_core44.ERROR, deserializeError(msg.err)]]);
|
|
6354
6484
|
break;
|
|
6355
6485
|
}
|
|
6356
6486
|
// Lifecycle signal from main
|
|
6357
6487
|
case "s": {
|
|
6358
6488
|
const sig = nameToSignal(msg.sig);
|
|
6359
6489
|
if (!sig) break;
|
|
6360
|
-
if (sig ===
|
|
6490
|
+
if (sig === import_core44.TEARDOWN && msg.s === "*") {
|
|
6361
6491
|
destroy();
|
|
6362
6492
|
return;
|
|
6363
6493
|
}
|