@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
|
@@ -27,11 +27,11 @@ function operatorOpts(opts) {
|
|
|
27
27
|
function isNode(x) {
|
|
28
28
|
return x != null && typeof x === "object" && "cache" in x && typeof x.subscribe === "function";
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var import_core4;
|
|
31
31
|
var init_internal = __esm({
|
|
32
32
|
"src/base/resilience/_internal.ts"() {
|
|
33
33
|
"use strict";
|
|
34
|
-
|
|
34
|
+
import_core4 = require("@graphrefly/pure-ts/core");
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
|
|
@@ -180,21 +180,21 @@ function withTimeout(source, opts, extraOpts) {
|
|
|
180
180
|
}
|
|
181
181
|
const callerMeta = extraOpts?.meta;
|
|
182
182
|
const factoryArgs = isReactive ? { ns: "Node<Partial<TimeoutOptions>>" } : { ns: latestOpts.ns };
|
|
183
|
-
const timeoutState = (0,
|
|
183
|
+
const timeoutState = (0, import_core5.node)([], {
|
|
184
184
|
name: "timeoutState",
|
|
185
185
|
describeKind: "state",
|
|
186
186
|
initial: { status: "pending" },
|
|
187
187
|
equals: (a, b) => a === b || a != null && b != null && typeof a === "object" && typeof b === "object" && a.status === b.status && JSON.stringify(a) === JSON.stringify(b)
|
|
188
188
|
});
|
|
189
|
-
const out = (0,
|
|
189
|
+
const out = (0, import_core5.node)(
|
|
190
190
|
(_data, a) => {
|
|
191
191
|
let stopped = false;
|
|
192
192
|
let lastDeadlineNs = 0;
|
|
193
|
-
const timer = new
|
|
193
|
+
const timer = new import_core5.ResettableTimer();
|
|
194
194
|
let optsUnsub = null;
|
|
195
195
|
let srcUnsub = null;
|
|
196
196
|
function emitState(next) {
|
|
197
|
-
timeoutState.down([[
|
|
197
|
+
timeoutState.down([[import_core5.DIRTY], [import_core5.DATA, next]]);
|
|
198
198
|
}
|
|
199
199
|
function startTimer() {
|
|
200
200
|
if (stopped) return;
|
|
@@ -203,7 +203,7 @@ function withTimeout(source, opts, extraOpts) {
|
|
|
203
203
|
}
|
|
204
204
|
const ns = latestOpts.ns;
|
|
205
205
|
lastDeadlineNs = ns;
|
|
206
|
-
const startedAt = (0,
|
|
206
|
+
const startedAt = (0, import_core5.monotonicNs)();
|
|
207
207
|
const delayMs = ns / NS_PER_MS;
|
|
208
208
|
emitState({
|
|
209
209
|
status: "running",
|
|
@@ -216,10 +216,10 @@ function withTimeout(source, opts, extraOpts) {
|
|
|
216
216
|
srcUnsub?.();
|
|
217
217
|
emitState({
|
|
218
218
|
status: "errored",
|
|
219
|
-
firedAt_ns: (0,
|
|
219
|
+
firedAt_ns: (0, import_core5.monotonicNs)(),
|
|
220
220
|
deadline_ns: ns
|
|
221
221
|
});
|
|
222
|
-
a.down([[
|
|
222
|
+
a.down([[import_core5.ERROR, new TimeoutError(ns)]]);
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
225
|
function attachSource() {
|
|
@@ -228,31 +228,31 @@ function withTimeout(source, opts, extraOpts) {
|
|
|
228
228
|
for (const m of msgs) {
|
|
229
229
|
if (stopped) return;
|
|
230
230
|
const t = m[0];
|
|
231
|
-
if (t ===
|
|
232
|
-
else if (t ===
|
|
231
|
+
if (t === import_core5.DIRTY) a.down([[import_core5.DIRTY]]);
|
|
232
|
+
else if (t === import_core5.DATA) {
|
|
233
233
|
startTimer();
|
|
234
234
|
a.emit(m[1]);
|
|
235
|
-
} else if (t ===
|
|
236
|
-
else if (t ===
|
|
235
|
+
} else if (t === import_core5.RESOLVED) a.down([[import_core5.RESOLVED]]);
|
|
236
|
+
else if (t === import_core5.COMPLETE) {
|
|
237
237
|
timer.cancel();
|
|
238
238
|
stopped = true;
|
|
239
239
|
emitState({
|
|
240
240
|
status: "completed",
|
|
241
|
-
settledAt_ns: (0,
|
|
241
|
+
settledAt_ns: (0, import_core5.monotonicNs)()
|
|
242
242
|
});
|
|
243
|
-
a.down([[
|
|
243
|
+
a.down([[import_core5.COMPLETE]]);
|
|
244
244
|
return;
|
|
245
|
-
} else if (t ===
|
|
245
|
+
} else if (t === import_core5.ERROR) {
|
|
246
246
|
timer.cancel();
|
|
247
247
|
stopped = true;
|
|
248
248
|
emitState({
|
|
249
249
|
status: "errored",
|
|
250
|
-
firedAt_ns: (0,
|
|
250
|
+
firedAt_ns: (0, import_core5.monotonicNs)(),
|
|
251
251
|
deadline_ns: lastDeadlineNs
|
|
252
252
|
});
|
|
253
253
|
a.down([m]);
|
|
254
254
|
return;
|
|
255
|
-
} else if (t ===
|
|
255
|
+
} else if (t === import_core5.TEARDOWN) {
|
|
256
256
|
timer.cancel();
|
|
257
257
|
stopped = true;
|
|
258
258
|
a.down([m]);
|
|
@@ -268,7 +268,7 @@ function withTimeout(source, opts, extraOpts) {
|
|
|
268
268
|
const optsNode = opts;
|
|
269
269
|
optsUnsub = optsNode.subscribe((msgs) => {
|
|
270
270
|
for (const m of msgs) {
|
|
271
|
-
if (m[0] !==
|
|
271
|
+
if (m[0] !== import_core5.DATA) continue;
|
|
272
272
|
const next = m[1];
|
|
273
273
|
if (next == null || typeof next !== "object") continue;
|
|
274
274
|
const keys = Object.keys(next);
|
|
@@ -279,7 +279,7 @@ function withTimeout(source, opts, extraOpts) {
|
|
|
279
279
|
stopped = true;
|
|
280
280
|
a.down([
|
|
281
281
|
[
|
|
282
|
-
|
|
282
|
+
import_core5.ERROR,
|
|
283
283
|
new RangeError(
|
|
284
284
|
"withTimeout: opts.ns must be a positive finite number on first settle"
|
|
285
285
|
)
|
|
@@ -304,26 +304,28 @@ function withTimeout(source, opts, extraOpts) {
|
|
|
304
304
|
if (latestOpts != null) {
|
|
305
305
|
attachSource();
|
|
306
306
|
}
|
|
307
|
-
return
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
307
|
+
return {
|
|
308
|
+
onDeactivation: () => {
|
|
309
|
+
stopped = true;
|
|
310
|
+
timer.cancel();
|
|
311
|
+
if (srcUnsub) srcUnsub();
|
|
312
|
+
if (optsUnsub) optsUnsub();
|
|
313
|
+
}
|
|
312
314
|
};
|
|
313
315
|
},
|
|
314
316
|
{
|
|
315
317
|
...operatorOpts(),
|
|
316
318
|
initial: source.cache,
|
|
317
|
-
meta: { ...callerMeta ?? {}, ...(0,
|
|
319
|
+
meta: { ...callerMeta ?? {}, ...(0, import_core5.factoryTag)("withTimeout", factoryArgs) }
|
|
318
320
|
}
|
|
319
321
|
);
|
|
320
322
|
return { node: out, timeoutState };
|
|
321
323
|
}
|
|
322
|
-
var
|
|
324
|
+
var import_core5, TimeoutError;
|
|
323
325
|
var init_timeout = __esm({
|
|
324
326
|
"src/base/resilience/timeout.ts"() {
|
|
325
327
|
"use strict";
|
|
326
|
-
|
|
328
|
+
import_core5 = require("@graphrefly/pure-ts/core");
|
|
327
329
|
init_internal();
|
|
328
330
|
init_backoff();
|
|
329
331
|
TimeoutError = class extends Error {
|
|
@@ -345,6 +347,7 @@ __export(sources_exports, {
|
|
|
345
347
|
firstWhere: () => firstWhere,
|
|
346
348
|
forEach: () => forEach,
|
|
347
349
|
fromCron: () => fromCron,
|
|
350
|
+
fromPushNotification: () => fromPushNotification,
|
|
348
351
|
matchesCron: () => matchesCron,
|
|
349
352
|
nodeSignal: () => nodeSignal,
|
|
350
353
|
parseCron: () => parseCron,
|
|
@@ -394,9 +397,11 @@ function defer(thunk, opts) {
|
|
|
394
397
|
const safe = err === void 0 ? new Error("defer: thunk threw undefined") : err;
|
|
395
398
|
a.down([[import_core.ERROR, safe]]);
|
|
396
399
|
}
|
|
397
|
-
return
|
|
398
|
-
|
|
399
|
-
|
|
400
|
+
return {
|
|
401
|
+
onDeactivation: () => {
|
|
402
|
+
stopped = true;
|
|
403
|
+
unsub?.();
|
|
404
|
+
}
|
|
400
405
|
};
|
|
401
406
|
}, merged);
|
|
402
407
|
}
|
|
@@ -445,15 +450,27 @@ function toArray(source, opts) {
|
|
|
445
450
|
},
|
|
446
451
|
{
|
|
447
452
|
describeKind: "derived",
|
|
453
|
+
...opts,
|
|
454
|
+
// Operator-required flags spread AFTER user `opts` so a caller
|
|
455
|
+
// cannot accidentally override them (QA F2 spread-order fix,
|
|
456
|
+
// DS-2.7.A `/qa` 2026-05-20 — matches the
|
|
457
|
+
// `reduce`/`scan`/`take`/`last` substrate pattern). Spec §2.7
|
|
458
|
+
// R2.7.1 (DS-2.7.A): Reduce-class shape — fn must fire on
|
|
459
|
+
// upstream COMPLETE to emit the accumulated array (or `[]` for an
|
|
460
|
+
// empty source) followed by its own `[[COMPLETE]]`. Required
|
|
461
|
+
// because `completeWhenDepsComplete: false` means auto-COMPLETE
|
|
462
|
+
// is OFF; without the opt-in `toArray(empty())` never completes.
|
|
448
463
|
completeWhenDepsComplete: false,
|
|
449
|
-
|
|
464
|
+
terminalAsRealInput: true
|
|
450
465
|
}
|
|
451
466
|
);
|
|
452
467
|
}
|
|
453
468
|
function share(source, opts) {
|
|
454
469
|
return (0, import_core.node)(
|
|
455
|
-
(_data, a) =>
|
|
456
|
-
|
|
470
|
+
(_data, a) => ({
|
|
471
|
+
onDeactivation: source.subscribe((msgs) => {
|
|
472
|
+
a.down(msgs);
|
|
473
|
+
})
|
|
457
474
|
}),
|
|
458
475
|
{ ...(0, import_extra.sourceOpts)(opts), initial: source.cache }
|
|
459
476
|
);
|
|
@@ -461,8 +478,10 @@ function share(source, opts) {
|
|
|
461
478
|
function replay(source, bufferSize, opts) {
|
|
462
479
|
if (bufferSize < 1) throw new RangeError("replay expects bufferSize >= 1");
|
|
463
480
|
return (0, import_core.node)(
|
|
464
|
-
(_data, a) =>
|
|
465
|
-
|
|
481
|
+
(_data, a) => ({
|
|
482
|
+
onDeactivation: source.subscribe((msgs) => {
|
|
483
|
+
a.down(msgs);
|
|
484
|
+
})
|
|
466
485
|
}),
|
|
467
486
|
{ ...(0, import_extra.sourceOpts)(opts), initial: source.cache, replayBuffer: bufferSize }
|
|
468
487
|
);
|
|
@@ -536,14 +555,41 @@ function fromCron(expr, opts) {
|
|
|
536
555
|
};
|
|
537
556
|
check();
|
|
538
557
|
const id = setInterval(check, tickMs);
|
|
539
|
-
return () => clearInterval(id);
|
|
558
|
+
return { onDeactivation: () => clearInterval(id) };
|
|
540
559
|
},
|
|
541
560
|
{ ...sourceOpts2(rest), name: rest.name ?? `cron:${expr}` }
|
|
542
561
|
);
|
|
543
562
|
}
|
|
544
563
|
|
|
564
|
+
// src/base/sources/event/push.ts
|
|
565
|
+
var import_core3 = require("@graphrefly/pure-ts/core");
|
|
566
|
+
function sourceOpts3(opts) {
|
|
567
|
+
return { describeKind: "producer", ...opts };
|
|
568
|
+
}
|
|
569
|
+
function fromPushNotification(register, opts) {
|
|
570
|
+
if (typeof register !== "function") {
|
|
571
|
+
throw new TypeError(
|
|
572
|
+
"fromPushNotification: a (deliver) => unsubscribe registration function is required"
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
return (0, import_core3.node)((_data, a) => {
|
|
576
|
+
let done = false;
|
|
577
|
+
const deliver = (payload) => {
|
|
578
|
+
if (done) return;
|
|
579
|
+
a.emit(payload);
|
|
580
|
+
};
|
|
581
|
+
const unsubscribe = register(deliver);
|
|
582
|
+
return {
|
|
583
|
+
onDeactivation: () => {
|
|
584
|
+
done = true;
|
|
585
|
+
if (typeof unsubscribe === "function") unsubscribe();
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
}, sourceOpts3(opts));
|
|
589
|
+
}
|
|
590
|
+
|
|
545
591
|
// src/base/sources/settled.ts
|
|
546
|
-
var
|
|
592
|
+
var import_core6 = require("@graphrefly/pure-ts/core");
|
|
547
593
|
function firstValueFrom(source) {
|
|
548
594
|
return new Promise((resolve, reject) => {
|
|
549
595
|
let settled = false;
|
|
@@ -552,7 +598,7 @@ function firstValueFrom(source) {
|
|
|
552
598
|
unsub = source.subscribe((msgs) => {
|
|
553
599
|
for (const m of msgs) {
|
|
554
600
|
if (settled) return;
|
|
555
|
-
if (m[0] ===
|
|
601
|
+
if (m[0] === import_core6.DATA) {
|
|
556
602
|
settled = true;
|
|
557
603
|
resolve(m[1]);
|
|
558
604
|
if (unsub) {
|
|
@@ -561,7 +607,7 @@ function firstValueFrom(source) {
|
|
|
561
607
|
} else shouldUnsub = true;
|
|
562
608
|
return;
|
|
563
609
|
}
|
|
564
|
-
if (m[0] ===
|
|
610
|
+
if (m[0] === import_core6.ERROR) {
|
|
565
611
|
settled = true;
|
|
566
612
|
reject(m[1]);
|
|
567
613
|
if (unsub) {
|
|
@@ -570,7 +616,7 @@ function firstValueFrom(source) {
|
|
|
570
616
|
} else shouldUnsub = true;
|
|
571
617
|
return;
|
|
572
618
|
}
|
|
573
|
-
if (m[0] ===
|
|
619
|
+
if (m[0] === import_core6.COMPLETE) {
|
|
574
620
|
settled = true;
|
|
575
621
|
reject(new Error("completed without DATA"));
|
|
576
622
|
if (unsub) {
|
|
@@ -624,8 +670,8 @@ function firstWhere(source, predicate, opts) {
|
|
|
624
670
|
if (settled) return;
|
|
625
671
|
for (const m of msgs) {
|
|
626
672
|
if (settled) return;
|
|
627
|
-
if (inInitialSyncPhase && m[0] ===
|
|
628
|
-
if (m[0] ===
|
|
673
|
+
if (inInitialSyncPhase && m[0] === import_core6.DATA) continue;
|
|
674
|
+
if (m[0] === import_core6.DATA) {
|
|
629
675
|
const v = m[1];
|
|
630
676
|
if (predicate(v)) {
|
|
631
677
|
settleData(v);
|
|
@@ -633,12 +679,12 @@ function firstWhere(source, predicate, opts) {
|
|
|
633
679
|
return;
|
|
634
680
|
}
|
|
635
681
|
}
|
|
636
|
-
if (m[0] ===
|
|
682
|
+
if (m[0] === import_core6.ERROR) {
|
|
637
683
|
settleError(m[1]);
|
|
638
684
|
detach();
|
|
639
685
|
return;
|
|
640
686
|
}
|
|
641
|
-
if (m[0] ===
|
|
687
|
+
if (m[0] === import_core6.COMPLETE) {
|
|
642
688
|
settleComplete();
|
|
643
689
|
detach();
|
|
644
690
|
return;
|
|
@@ -704,17 +750,17 @@ function nodeSignal(source, opts) {
|
|
|
704
750
|
unsub = source.subscribe((msgs) => {
|
|
705
751
|
if (ctrl.signal.aborted) return;
|
|
706
752
|
for (const m of msgs) {
|
|
707
|
-
if (m[0] ===
|
|
753
|
+
if (m[0] === import_core6.DATA && m[1] === true) {
|
|
708
754
|
ctrl.abort(reason);
|
|
709
755
|
done();
|
|
710
756
|
return;
|
|
711
757
|
}
|
|
712
|
-
if (m[0] ===
|
|
758
|
+
if (m[0] === import_core6.ERROR) {
|
|
713
759
|
ctrl.abort(m[1]);
|
|
714
760
|
done();
|
|
715
761
|
return;
|
|
716
762
|
}
|
|
717
|
-
if (m[0] ===
|
|
763
|
+
if (m[0] === import_core6.COMPLETE) {
|
|
718
764
|
done();
|
|
719
765
|
return;
|
|
720
766
|
}
|
|
@@ -735,13 +781,13 @@ function nodeSignal(source, opts) {
|
|
|
735
781
|
};
|
|
736
782
|
}
|
|
737
783
|
function reactiveCounter(cap) {
|
|
738
|
-
const counter = (0,
|
|
784
|
+
const counter = (0, import_core6.node)([], { initial: 0 });
|
|
739
785
|
return {
|
|
740
786
|
node: counter,
|
|
741
787
|
increment() {
|
|
742
788
|
const current = counter.cache ?? 0;
|
|
743
789
|
if (current >= cap) return false;
|
|
744
|
-
counter.down([[
|
|
790
|
+
counter.down([[import_core6.DIRTY], [import_core6.DATA, current + 1]]);
|
|
745
791
|
return true;
|
|
746
792
|
},
|
|
747
793
|
get() {
|