@graphrefly/ts 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -0
- package/dist/adapters/index.cjs +105 -66
- package/dist/adapters/index.cjs.map +1 -1
- package/dist/adapters/index.d.cts +11 -136
- package/dist/adapters/index.d.ts +11 -136
- package/dist/adapters/index.js +27 -225
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/observe-storage.d.cts +4 -4
- package/dist/adapters/observe-storage.d.ts +4 -4
- package/dist/adapters/observe-storage.js +1 -0
- package/dist/adapters/observe-storage.js.map +1 -1
- package/dist/adapters/react.cjs +166 -0
- package/dist/adapters/react.cjs.map +1 -0
- package/dist/adapters/react.d.cts +31 -0
- package/dist/adapters/react.d.ts +31 -0
- package/dist/adapters/react.js +51 -0
- package/dist/adapters/react.js.map +1 -0
- package/dist/adapters/solid.cjs +157 -0
- package/dist/adapters/solid.cjs.map +1 -0
- package/dist/adapters/solid.d.cts +26 -0
- package/dist/adapters/solid.d.ts +26 -0
- package/dist/adapters/solid.js +48 -0
- package/dist/adapters/solid.js.map +1 -0
- package/dist/adapters/svelte.cjs +148 -0
- package/dist/adapters/svelte.cjs.map +1 -0
- package/dist/adapters/svelte.d.cts +31 -0
- package/dist/adapters/svelte.d.ts +31 -0
- package/dist/adapters/svelte.js +46 -0
- package/dist/adapters/svelte.js.map +1 -0
- package/dist/adapters/vue.cjs +155 -0
- package/dist/adapters/vue.cjs.map +1 -0
- package/dist/adapters/vue.d.cts +26 -0
- package/dist/adapters/vue.d.ts +26 -0
- package/dist/adapters/vue.js +46 -0
- package/dist/adapters/vue.js.map +1 -0
- package/dist/agent-runtime-BesGDZcB.d.ts +555 -0
- package/dist/agent-runtime-DZTJ3C-p.d.cts +555 -0
- package/dist/agentic-memory-BmRCvh0d.d.ts +517 -0
- package/dist/agentic-memory-DfuVZ-lY.d.cts +517 -0
- package/dist/capability-admission-B0BzqAm5.d.cts +102 -0
- package/dist/capability-admission-g0mn9hpq.d.ts +102 -0
- package/dist/{chunk-JR4IKCR2.js → chunk-2747WN4Y.js} +5 -5
- package/dist/{chunk-2ILL7HQI.js → chunk-3JR3EDB2.js} +17 -17
- package/dist/{chunk-2ILL7HQI.js.map → chunk-3JR3EDB2.js.map} +1 -1
- package/dist/{chunk-GDL26N2T.js → chunk-3KN7NJDR.js} +2 -2
- package/dist/{chunk-DJC4CHLQ.js → chunk-43BKLFZU.js} +9 -9
- package/dist/chunk-6XAIOL3X.js +2407 -0
- package/dist/chunk-6XAIOL3X.js.map +1 -0
- package/dist/{chunk-SCRFRCGR.js → chunk-BSQGE5PS.js} +1 -1
- package/dist/{chunk-Y3ZLRGHC.js → chunk-CZNV3VXM.js} +16 -16
- package/dist/chunk-DGUM43GV.js +11 -0
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/{chunk-JIMUDQN3.js → chunk-FBUU43PM.js} +2 -2
- package/dist/chunk-H75VXTGT.js +219 -0
- package/dist/chunk-H75VXTGT.js.map +1 -0
- package/dist/{chunk-RIIOUTGM.js → chunk-HKK2JD7Z.js} +12 -9
- package/dist/chunk-HKK2JD7Z.js.map +1 -0
- package/dist/{chunk-D6BG7U6A.js → chunk-IXZBUWSP.js} +3 -3
- package/dist/chunk-PC3BTTBE.js +3217 -0
- package/dist/chunk-PC3BTTBE.js.map +1 -0
- package/dist/chunk-QFY4AFY4.js +879 -0
- package/dist/chunk-QFY4AFY4.js.map +1 -0
- package/dist/{chunk-DK554R7P.js → chunk-S6HXABGL.js} +2 -1
- package/dist/chunk-S6HXABGL.js.map +1 -0
- package/dist/{chunk-PKVBHGBM.js → chunk-SS2A464I.js} +7 -7
- package/dist/chunk-UT3MHJCW.js +49 -0
- package/dist/chunk-UT3MHJCW.js.map +1 -0
- package/dist/{chunk-G4M3NHRJ.js → chunk-V7CIJE4B.js} +3 -3
- package/dist/{chunk-TEW47IVR.js → chunk-VPEFSDME.js} +2 -2
- package/dist/chunk-VTHLCFN4.js +368 -0
- package/dist/chunk-VTHLCFN4.js.map +1 -0
- package/dist/{chunk-SWTLEQL6.js → chunk-WQIA3GFB.js} +2 -2
- package/dist/chunk-WQIA3GFB.js.map +1 -0
- package/dist/{chunk-I3IHOHCJ.js → chunk-XKXWK2KP.js} +108 -64
- package/dist/chunk-XKXWK2KP.js.map +1 -0
- package/dist/{chunk-COHO25CZ.js → chunk-YDSIVHRR.js} +553 -7
- package/dist/chunk-YDSIVHRR.js.map +1 -0
- package/dist/chunk-YXMZ2N6J.js +1884 -0
- package/dist/chunk-YXMZ2N6J.js.map +1 -0
- package/dist/composition/index.cjs +102 -57
- package/dist/composition/index.cjs.map +1 -1
- package/dist/composition/index.d.cts +4 -4
- package/dist/composition/index.d.ts +4 -4
- package/dist/composition/index.js +6 -5
- package/dist/core/index.cjs +102 -57
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +5 -4
- package/dist/cqrs/index.cjs.map +1 -1
- package/dist/cqrs/index.d.cts +4 -4
- package/dist/cqrs/index.d.ts +4 -4
- package/dist/cqrs/index.js +3 -2
- package/dist/cqrs/index.js.map +1 -1
- package/dist/cqrs/messaging.cjs +312 -0
- package/dist/cqrs/messaging.cjs.map +1 -0
- package/dist/cqrs/messaging.d.cts +57 -0
- package/dist/cqrs/messaging.d.ts +57 -0
- package/dist/cqrs/messaging.js +274 -0
- package/dist/cqrs/messaging.js.map +1 -0
- package/dist/cqrs/work-queue.cjs +329 -0
- package/dist/cqrs/work-queue.cjs.map +1 -0
- package/dist/cqrs/work-queue.d.cts +90 -0
- package/dist/cqrs/work-queue.d.ts +90 -0
- package/dist/cqrs/work-queue.js +292 -0
- package/dist/cqrs/work-queue.js.map +1 -0
- package/dist/data/index.cjs +19 -0
- package/dist/data/index.cjs.map +1 -0
- package/dist/data/index.d.cts +36 -0
- package/dist/data/index.d.ts +36 -0
- package/dist/data/index.js +1 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data-structures/index.cjs +105 -57
- package/dist/data-structures/index.cjs.map +1 -1
- package/dist/data-structures/index.d.cts +8 -8
- package/dist/data-structures/index.d.ts +8 -8
- package/dist/data-structures/index.js +7 -6
- package/dist/{describe-BZb7AS2y.d.ts → describe-BpyJuWkw.d.ts} +1 -1
- package/dist/{describe-Ciu8SUnN.d.cts → describe-DYMw_l1C.d.cts} +1 -1
- package/dist/executors/work-queue.cjs +342 -0
- package/dist/executors/work-queue.cjs.map +1 -0
- package/dist/executors/work-queue.d.cts +90 -0
- package/dist/executors/work-queue.d.ts +90 -0
- package/dist/executors/work-queue.js +306 -0
- package/dist/executors/work-queue.js.map +1 -0
- package/dist/graph/index.cjs +112 -58
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +9 -9
- package/dist/graph/index.d.ts +9 -9
- package/dist/graph/index.js +18 -17
- package/dist/{graph-DfdF9zy4.d.ts → graph-D-1-SQeC.d.ts} +3 -3
- package/dist/{graph-s23RbbFO.d.cts → graph-DCEWh4T2.d.cts} +3 -3
- package/dist/{index-CAEmLCYF.d.cts → index-72VZC0-E.d.cts} +2 -2
- package/dist/{index-SnzZu3x7.d.ts → index-Bmxeu0nK.d.ts} +2 -2
- package/dist/index.cjs +112 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -10
- package/dist/index.d.ts +11 -10
- package/dist/index.js +118 -113
- package/dist/inspection/boundary.cjs +98 -0
- package/dist/inspection/boundary.cjs.map +1 -0
- package/dist/inspection/boundary.d.cts +61 -0
- package/dist/inspection/boundary.d.ts +61 -0
- package/dist/inspection/boundary.js +75 -0
- package/dist/inspection/boundary.js.map +1 -0
- package/dist/{messages-BZqrGGm1.d.ts → messages-CAzUPPJM.d.cts} +10 -5
- package/dist/{messages-BZqrGGm1.d.cts → messages-CAzUPPJM.d.ts} +10 -5
- package/dist/messaging/index.cjs +744 -613
- package/dist/messaging/index.cjs.map +1 -1
- package/dist/messaging/index.d.cts +216 -160
- package/dist/messaging/index.d.ts +216 -160
- package/dist/messaging/index.js +19 -749
- package/dist/messaging/index.js.map +1 -1
- package/dist/operators/index.cjs +102 -57
- package/dist/operators/index.cjs.map +1 -1
- package/dist/operators/index.d.cts +6 -6
- package/dist/operators/index.d.ts +6 -6
- package/dist/operators/index.js +8 -7
- package/dist/orchestration/index.cjs +3333 -59
- package/dist/orchestration/index.cjs.map +1 -1
- package/dist/orchestration/index.d.cts +7 -4
- package/dist/orchestration/index.d.ts +7 -4
- package/dist/orchestration/index.js +49 -8
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/messaging.cjs +314 -0
- package/dist/orchestration/messaging.cjs.map +1 -0
- package/dist/orchestration/messaging.d.cts +59 -0
- package/dist/orchestration/messaging.d.ts +59 -0
- package/dist/orchestration/messaging.js +276 -0
- package/dist/orchestration/messaging.js.map +1 -0
- package/dist/orchestration/work-queue.cjs +262 -0
- package/dist/orchestration/work-queue.cjs.map +1 -0
- package/dist/orchestration/work-queue.d.cts +85 -0
- package/dist/orchestration/work-queue.d.ts +85 -0
- package/dist/orchestration/work-queue.js +226 -0
- package/dist/orchestration/work-queue.js.map +1 -0
- package/dist/patterns/event-flow.cjs +447 -0
- package/dist/patterns/event-flow.cjs.map +1 -0
- package/dist/patterns/event-flow.d.cts +115 -0
- package/dist/patterns/event-flow.d.ts +115 -0
- package/dist/patterns/event-flow.js +14 -0
- package/dist/patterns/event-flow.js.map +1 -0
- package/dist/patterns/index.cjs +423 -18
- package/dist/patterns/index.cjs.map +1 -1
- package/dist/patterns/index.d.cts +8 -5
- package/dist/patterns/index.d.ts +8 -5
- package/dist/patterns/index.js +13 -4
- package/dist/{reactive-collection-Cb1II1Fi.d.ts → reactive-collection-BAmfrGjd.d.ts} +9 -9
- package/dist/{reactive-collection-BxBqtIOE.d.cts → reactive-collection-DNV0-gFi.d.cts} +9 -9
- package/dist/{reactive-collection-storage-D-KmjE0J.d.cts → reactive-collection-storage-BNEldDyi.d.cts} +5 -5
- package/dist/{reactive-collection-storage-BNiEc-Gd.d.ts → reactive-collection-storage-YZsAQsWK.d.ts} +5 -5
- package/dist/{reactive-map-D-g3dv8I.d.cts → reactive-map-DRD1LJ2H.d.cts} +6 -6
- package/dist/{reactive-map-BcB4KsQR.d.ts → reactive-map-EsDiCmJk.d.ts} +6 -6
- package/dist/render/index.d.cts +3 -3
- package/dist/render/index.d.ts +3 -3
- package/dist/render/index.js +1 -0
- package/dist/{semantic-memory-graph-BYoIlP35.d.cts → semantic-memory-graph-DKuNzuWw.d.cts} +2 -2
- package/dist/{semantic-memory-graph-CxyXLms3.d.ts → semantic-memory-graph-uwbwJdhe.d.ts} +2 -2
- package/dist/solutions/index.cjs +4478 -2
- package/dist/solutions/index.cjs.map +1 -1
- package/dist/solutions/index.d.cts +13 -519
- package/dist/solutions/index.d.ts +13 -519
- package/dist/solutions/index.js +90 -6
- package/dist/solutions/reactive-layout/browser/index.cjs +449 -0
- package/dist/solutions/reactive-layout/browser/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/browser/index.d.cts +44 -0
- package/dist/solutions/reactive-layout/browser/index.d.ts +44 -0
- package/dist/solutions/reactive-layout/browser/index.js +69 -0
- package/dist/solutions/reactive-layout/browser/index.js.map +1 -0
- package/dist/solutions/reactive-layout/index.cjs +4266 -0
- package/dist/solutions/reactive-layout/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/index.d.cts +581 -0
- package/dist/solutions/reactive-layout/index.d.ts +581 -0
- package/dist/solutions/reactive-layout/index.js +86 -0
- package/dist/solutions/reactive-layout/index.js.map +1 -0
- package/dist/solutions/reactive-layout/node-canvas/index.cjs +545 -0
- package/dist/solutions/reactive-layout/node-canvas/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/node-canvas/index.d.cts +54 -0
- package/dist/solutions/reactive-layout/node-canvas/index.d.ts +54 -0
- package/dist/solutions/reactive-layout/node-canvas/index.js +131 -0
- package/dist/solutions/reactive-layout/node-canvas/index.js.map +1 -0
- package/dist/solutions/reactive-layout/react-native/index.cjs +494 -0
- package/dist/solutions/reactive-layout/react-native/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/react-native/index.d.cts +51 -0
- package/dist/solutions/reactive-layout/react-native/index.d.ts +51 -0
- package/dist/solutions/reactive-layout/react-native/index.js +77 -0
- package/dist/solutions/reactive-layout/react-native/index.js.map +1 -0
- package/dist/solutions/reactive-layout/skia/index.cjs +547 -0
- package/dist/solutions/reactive-layout/skia/index.cjs.map +1 -0
- package/dist/solutions/reactive-layout/skia/index.d.cts +64 -0
- package/dist/solutions/reactive-layout/skia/index.d.ts +64 -0
- package/dist/solutions/reactive-layout/skia/index.js +70 -0
- package/dist/solutions/reactive-layout/skia/index.js.map +1 -0
- package/dist/solutions/work-item/actions.cjs +2164 -0
- package/dist/solutions/work-item/actions.cjs.map +1 -0
- package/dist/solutions/work-item/actions.d.cts +201 -0
- package/dist/solutions/work-item/actions.d.ts +201 -0
- package/dist/solutions/work-item/actions.js +1454 -0
- package/dist/solutions/work-item/actions.js.map +1 -0
- package/dist/solutions/work-item/scheduling.cjs +2454 -0
- package/dist/solutions/work-item/scheduling.cjs.map +1 -0
- package/dist/solutions/work-item/scheduling.d.cts +433 -0
- package/dist/solutions/work-item/scheduling.d.ts +433 -0
- package/dist/solutions/work-item/scheduling.js +32 -0
- package/dist/solutions/work-item/scheduling.js.map +1 -0
- package/dist/solutions/work-item/work-queue.cjs +306 -0
- package/dist/solutions/work-item/work-queue.cjs.map +1 -0
- package/dist/solutions/work-item/work-queue.d.cts +71 -0
- package/dist/solutions/work-item/work-queue.d.ts +71 -0
- package/dist/solutions/work-item/work-queue.js +270 -0
- package/dist/solutions/work-item/work-queue.js.map +1 -0
- package/dist/sources/browser.cjs +169 -57
- package/dist/sources/browser.cjs.map +1 -1
- package/dist/sources/browser.d.cts +33 -6
- package/dist/sources/browser.d.ts +33 -6
- package/dist/sources/browser.js +73 -6
- package/dist/sources/browser.js.map +1 -1
- package/dist/sources/index.cjs +102 -57
- package/dist/sources/index.cjs.map +1 -1
- package/dist/sources/index.d.cts +5 -5
- package/dist/sources/index.d.ts +5 -5
- package/dist/sources/index.js +6 -5
- package/dist/sources/node.cjs.map +1 -1
- package/dist/sources/node.d.cts +4 -4
- package/dist/sources/node.d.ts +4 -4
- package/dist/sources/node.js +2 -1
- package/dist/sources/node.js.map +1 -1
- package/dist/storage/browser.js +1 -0
- package/dist/storage/browser.js.map +1 -1
- package/dist/storage/index.d.cts +5 -5
- package/dist/storage/index.d.ts +5 -5
- package/dist/storage/index.js +5 -4
- package/dist/storage/node.js +1 -0
- package/dist/storage/node.js.map +1 -1
- package/dist/store-C-joM4gh.d.ts +123 -0
- package/dist/store-CNJwmT-h.d.cts +123 -0
- package/dist/testing/index.cjs +1 -0
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +3 -2
- package/dist/{types-h12mNYbq.d.ts → types-BsJvElYZ.d.ts} +31 -31
- package/dist/{types-bNMSWKqF.d.cts → types-CcPIn7sy.d.cts} +31 -31
- package/dist/work-item-runtime-C3M79vE9.d.ts +228 -0
- package/dist/work-item-runtime-qaVgsL0T.d.cts +228 -0
- package/dist/work-queue/index.cjs +1132 -0
- package/dist/work-queue/index.cjs.map +1 -0
- package/dist/work-queue/index.d.cts +369 -0
- package/dist/work-queue/index.d.ts +369 -0
- package/dist/work-queue/index.js +1078 -0
- package/dist/work-queue/index.js.map +1 -0
- package/package.json +266 -2
- package/dist/chunk-COHO25CZ.js.map +0 -1
- package/dist/chunk-DK554R7P.js.map +0 -1
- package/dist/chunk-I3IHOHCJ.js.map +0 -1
- package/dist/chunk-RIIOUTGM.js.map +0 -1
- package/dist/chunk-SWTLEQL6.js.map +0 -1
- /package/dist/{chunk-JR4IKCR2.js.map → chunk-2747WN4Y.js.map} +0 -0
- /package/dist/{chunk-GDL26N2T.js.map → chunk-3KN7NJDR.js.map} +0 -0
- /package/dist/{chunk-DJC4CHLQ.js.map → chunk-43BKLFZU.js.map} +0 -0
- /package/dist/{chunk-SCRFRCGR.js.map → chunk-BSQGE5PS.js.map} +0 -0
- /package/dist/{chunk-Y3ZLRGHC.js.map → chunk-CZNV3VXM.js.map} +0 -0
- /package/dist/{chunk-JIMUDQN3.js.map → chunk-FBUU43PM.js.map} +0 -0
- /package/dist/{chunk-D6BG7U6A.js.map → chunk-IXZBUWSP.js.map} +0 -0
- /package/dist/{chunk-PKVBHGBM.js.map → chunk-SS2A464I.js.map} +0 -0
- /package/dist/{chunk-G4M3NHRJ.js.map → chunk-V7CIJE4B.js.map} +0 -0
- /package/dist/{chunk-TEW47IVR.js.map → chunk-VPEFSDME.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { L as Operator } from '../graph-
|
|
2
|
-
export { c as DriverResult, g as HttpRequest, h as HttpResponse, y as SseDriverEvent, z as SseEvent, A as SseRequest, I as WebSocketDriverEvent, J as WebSocketEvent, M as WebSocketRequest, V as WebhookDriverEvent, X as WebhookEvent, Y as WebhookRegistration } from '../types-
|
|
3
|
-
export { A as AsyncSourceOpts, C as CronSchedule, E as EventListenerOptionsLike, a as EventTargetLike, F as FromCronOptions, b as FromEventOptions, N as NodeInput, P as PushRegister, c as PushUnsubscribe, S as SingleFromAnyOptions, T as TimerSourceOpts, e as empty, f as firstValueFrom, d as fromAny, g as fromAsyncIter, h as fromCron, i as fromEvent, j as fromHttp, k as fromHttpWithOptions, l as fromIter, n as fromPromise, o as fromPushNotification, p as fromSSE, q as fromSSEWithOptions, r as fromTimer, s as fromWebSocket, t as fromWebSocketWithOptions, u as fromWebhook, v as fromWebhookWithOptions, w as interval, x as matchesCron, y as never, z as of, B as parseCron, H as singleFromAny, I as throwError, J as timer } from '../index-
|
|
1
|
+
import { L as Operator } from '../graph-DCEWh4T2.cjs';
|
|
2
|
+
export { c as DriverResult, g as HttpRequest, h as HttpResponse, y as SseDriverEvent, z as SseEvent, A as SseRequest, I as WebSocketDriverEvent, J as WebSocketEvent, M as WebSocketRequest, V as WebhookDriverEvent, X as WebhookEvent, Y as WebhookRegistration } from '../types-CcPIn7sy.cjs';
|
|
3
|
+
export { A as AsyncSourceOpts, C as CronSchedule, E as EventListenerOptionsLike, a as EventTargetLike, F as FromCronOptions, b as FromEventOptions, N as NodeInput, P as PushRegister, c as PushUnsubscribe, S as SingleFromAnyOptions, T as TimerSourceOpts, e as empty, f as firstValueFrom, d as fromAny, g as fromAsyncIter, h as fromCron, i as fromEvent, j as fromHttp, k as fromHttpWithOptions, l as fromIter, n as fromPromise, o as fromPushNotification, p as fromSSE, q as fromSSEWithOptions, r as fromTimer, s as fromWebSocket, t as fromWebSocketWithOptions, u as fromWebhook, v as fromWebhookWithOptions, w as interval, x as matchesCron, y as never, z as of, B as parseCron, H as singleFromAny, I as throwError, J as timer } from '../index-72VZC0-E.cjs';
|
|
4
4
|
import '../core/index.cjs';
|
|
5
|
-
import '../messages-
|
|
5
|
+
import '../messages-CAzUPPJM.cjs';
|
|
6
6
|
import '../codec-BB7p8fJc.cjs';
|
|
7
|
-
import '../describe-
|
|
7
|
+
import '../describe-DYMw_l1C.cjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Browser-safe source factories. This subpath intentionally excludes
|
|
@@ -26,6 +26,33 @@ interface IDBTransactionLike {
|
|
|
26
26
|
onerror: null | IDBEventHandler<IDBTransactionLike>;
|
|
27
27
|
onabort: null | IDBEventHandler<IDBTransactionLike>;
|
|
28
28
|
}
|
|
29
|
+
type AnimationFrameHandle = number | ReturnType<typeof setTimeout>;
|
|
30
|
+
interface AnimationFrameScheduler {
|
|
31
|
+
requestAnimationFrame(callback: (time: number) => void): AnimationFrameHandle;
|
|
32
|
+
cancelAnimationFrame(handle: AnimationFrameHandle): void;
|
|
33
|
+
}
|
|
34
|
+
interface VisibilityDocumentLike {
|
|
35
|
+
readonly visibilityState?: "hidden" | "visible" | "prerender" | string;
|
|
36
|
+
addEventListener?(type: "visibilitychange", listener: () => void): void;
|
|
37
|
+
removeEventListener?(type: "visibilitychange", listener: () => void): void;
|
|
38
|
+
}
|
|
39
|
+
interface FromRafOptions {
|
|
40
|
+
/** Custom scheduler for tests or host wrappers. Defaults to browser rAF, then a timer fallback. */
|
|
41
|
+
readonly scheduler?: AnimationFrameScheduler;
|
|
42
|
+
/** Timer fallback cadence when requestAnimationFrame is unavailable. Default: 16ms. */
|
|
43
|
+
readonly fallbackMs?: number;
|
|
44
|
+
/** Fully park while the provided/browser document is hidden. Default: false. */
|
|
45
|
+
readonly pauseWhenHidden?: boolean;
|
|
46
|
+
/** Document-like visibility source for tests or embedded browser hosts. */
|
|
47
|
+
readonly document?: VisibilityDocumentLike;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Browser animation-frame source.
|
|
51
|
+
*
|
|
52
|
+
* This is a browser/source boundary, not reactive-layout ownership (D181): every frame timestamp
|
|
53
|
+
* enters the graph as DATA through `ctx.down`, and teardown cancels the pending host callback.
|
|
54
|
+
*/
|
|
55
|
+
declare function fromRaf(opts?: FromRafOptions): Operator<never, number>;
|
|
29
56
|
/** Wrap an IndexedDB request as a one-shot source. */
|
|
30
57
|
declare function fromIDBRequest<T>(request: IDBRequestLike<T>): Operator<never, T>;
|
|
31
58
|
/**
|
|
@@ -36,4 +63,4 @@ declare function fromIDBRequest<T>(request: IDBRequestLike<T>): Operator<never,
|
|
|
36
63
|
*/
|
|
37
64
|
declare function fromIDBTransaction(transaction: IDBTransactionLike): Operator<never, never>;
|
|
38
65
|
|
|
39
|
-
export { type IDBRequestLike, type IDBTransactionLike, fromIDBRequest, fromIDBTransaction };
|
|
66
|
+
export { type AnimationFrameHandle, type AnimationFrameScheduler, type FromRafOptions, type IDBRequestLike, type IDBTransactionLike, type VisibilityDocumentLike, fromIDBRequest, fromIDBTransaction, fromRaf };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { L as Operator } from '../graph-
|
|
2
|
-
export { c as DriverResult, g as HttpRequest, h as HttpResponse, y as SseDriverEvent, z as SseEvent, A as SseRequest, I as WebSocketDriverEvent, J as WebSocketEvent, M as WebSocketRequest, V as WebhookDriverEvent, X as WebhookEvent, Y as WebhookRegistration } from '../types-
|
|
3
|
-
export { A as AsyncSourceOpts, C as CronSchedule, E as EventListenerOptionsLike, a as EventTargetLike, F as FromCronOptions, b as FromEventOptions, N as NodeInput, P as PushRegister, c as PushUnsubscribe, S as SingleFromAnyOptions, T as TimerSourceOpts, e as empty, f as firstValueFrom, d as fromAny, g as fromAsyncIter, h as fromCron, i as fromEvent, j as fromHttp, k as fromHttpWithOptions, l as fromIter, n as fromPromise, o as fromPushNotification, p as fromSSE, q as fromSSEWithOptions, r as fromTimer, s as fromWebSocket, t as fromWebSocketWithOptions, u as fromWebhook, v as fromWebhookWithOptions, w as interval, x as matchesCron, y as never, z as of, B as parseCron, H as singleFromAny, I as throwError, J as timer } from '../index-
|
|
1
|
+
import { L as Operator } from '../graph-D-1-SQeC.js';
|
|
2
|
+
export { c as DriverResult, g as HttpRequest, h as HttpResponse, y as SseDriverEvent, z as SseEvent, A as SseRequest, I as WebSocketDriverEvent, J as WebSocketEvent, M as WebSocketRequest, V as WebhookDriverEvent, X as WebhookEvent, Y as WebhookRegistration } from '../types-BsJvElYZ.js';
|
|
3
|
+
export { A as AsyncSourceOpts, C as CronSchedule, E as EventListenerOptionsLike, a as EventTargetLike, F as FromCronOptions, b as FromEventOptions, N as NodeInput, P as PushRegister, c as PushUnsubscribe, S as SingleFromAnyOptions, T as TimerSourceOpts, e as empty, f as firstValueFrom, d as fromAny, g as fromAsyncIter, h as fromCron, i as fromEvent, j as fromHttp, k as fromHttpWithOptions, l as fromIter, n as fromPromise, o as fromPushNotification, p as fromSSE, q as fromSSEWithOptions, r as fromTimer, s as fromWebSocket, t as fromWebSocketWithOptions, u as fromWebhook, v as fromWebhookWithOptions, w as interval, x as matchesCron, y as never, z as of, B as parseCron, H as singleFromAny, I as throwError, J as timer } from '../index-Bmxeu0nK.js';
|
|
4
4
|
import '../core/index.js';
|
|
5
|
-
import '../messages-
|
|
5
|
+
import '../messages-CAzUPPJM.js';
|
|
6
6
|
import '../codec-BB7p8fJc.js';
|
|
7
|
-
import '../describe-
|
|
7
|
+
import '../describe-BpyJuWkw.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Browser-safe source factories. This subpath intentionally excludes
|
|
@@ -26,6 +26,33 @@ interface IDBTransactionLike {
|
|
|
26
26
|
onerror: null | IDBEventHandler<IDBTransactionLike>;
|
|
27
27
|
onabort: null | IDBEventHandler<IDBTransactionLike>;
|
|
28
28
|
}
|
|
29
|
+
type AnimationFrameHandle = number | ReturnType<typeof setTimeout>;
|
|
30
|
+
interface AnimationFrameScheduler {
|
|
31
|
+
requestAnimationFrame(callback: (time: number) => void): AnimationFrameHandle;
|
|
32
|
+
cancelAnimationFrame(handle: AnimationFrameHandle): void;
|
|
33
|
+
}
|
|
34
|
+
interface VisibilityDocumentLike {
|
|
35
|
+
readonly visibilityState?: "hidden" | "visible" | "prerender" | string;
|
|
36
|
+
addEventListener?(type: "visibilitychange", listener: () => void): void;
|
|
37
|
+
removeEventListener?(type: "visibilitychange", listener: () => void): void;
|
|
38
|
+
}
|
|
39
|
+
interface FromRafOptions {
|
|
40
|
+
/** Custom scheduler for tests or host wrappers. Defaults to browser rAF, then a timer fallback. */
|
|
41
|
+
readonly scheduler?: AnimationFrameScheduler;
|
|
42
|
+
/** Timer fallback cadence when requestAnimationFrame is unavailable. Default: 16ms. */
|
|
43
|
+
readonly fallbackMs?: number;
|
|
44
|
+
/** Fully park while the provided/browser document is hidden. Default: false. */
|
|
45
|
+
readonly pauseWhenHidden?: boolean;
|
|
46
|
+
/** Document-like visibility source for tests or embedded browser hosts. */
|
|
47
|
+
readonly document?: VisibilityDocumentLike;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Browser animation-frame source.
|
|
51
|
+
*
|
|
52
|
+
* This is a browser/source boundary, not reactive-layout ownership (D181): every frame timestamp
|
|
53
|
+
* enters the graph as DATA through `ctx.down`, and teardown cancels the pending host callback.
|
|
54
|
+
*/
|
|
55
|
+
declare function fromRaf(opts?: FromRafOptions): Operator<never, number>;
|
|
29
56
|
/** Wrap an IndexedDB request as a one-shot source. */
|
|
30
57
|
declare function fromIDBRequest<T>(request: IDBRequestLike<T>): Operator<never, T>;
|
|
31
58
|
/**
|
|
@@ -36,4 +63,4 @@ declare function fromIDBRequest<T>(request: IDBRequestLike<T>): Operator<never,
|
|
|
36
63
|
*/
|
|
37
64
|
declare function fromIDBTransaction(transaction: IDBTransactionLike): Operator<never, never>;
|
|
38
65
|
|
|
39
|
-
export { type IDBRequestLike, type IDBTransactionLike, fromIDBRequest, fromIDBTransaction };
|
|
66
|
+
export { type AnimationFrameHandle, type AnimationFrameScheduler, type FromRafOptions, type IDBRequestLike, type IDBTransactionLike, type VisibilityDocumentLike, fromIDBRequest, fromIDBTransaction, fromRaf };
|
package/dist/sources/browser.js
CHANGED
|
@@ -26,14 +26,15 @@ import {
|
|
|
26
26
|
singleFromAny,
|
|
27
27
|
throwError,
|
|
28
28
|
timer
|
|
29
|
-
} from "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-SWTLEQL6.js";
|
|
29
|
+
} from "../chunk-V7CIJE4B.js";
|
|
30
|
+
import "../chunk-SS2A464I.js";
|
|
31
|
+
import "../chunk-XKXWK2KP.js";
|
|
32
|
+
import "../chunk-WQIA3GFB.js";
|
|
34
33
|
import {
|
|
35
34
|
errorPayload
|
|
36
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-S6HXABGL.js";
|
|
36
|
+
import "../chunk-4VLAQHZI.js";
|
|
37
|
+
import "../chunk-DGUM43GV.js";
|
|
37
38
|
|
|
38
39
|
// src/sources/browser.ts
|
|
39
40
|
function source(factory, setup) {
|
|
@@ -45,6 +46,71 @@ function source(factory, setup) {
|
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
}
|
|
49
|
+
function defaultAnimationFrameScheduler(fallbackMs) {
|
|
50
|
+
const host = globalThis;
|
|
51
|
+
if (typeof host.requestAnimationFrame === "function" && typeof host.cancelAnimationFrame === "function") {
|
|
52
|
+
return {
|
|
53
|
+
requestAnimationFrame: (callback) => host.requestAnimationFrame?.(callback) ?? 0,
|
|
54
|
+
cancelAnimationFrame: (handle) => {
|
|
55
|
+
if (typeof handle === "number") host.cancelAnimationFrame?.(handle);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
requestAnimationFrame(callback) {
|
|
61
|
+
return setTimeout(() => callback(Date.now()), fallbackMs);
|
|
62
|
+
},
|
|
63
|
+
cancelAnimationFrame(handle) {
|
|
64
|
+
clearTimeout(handle);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function defaultVisibilityDocument() {
|
|
69
|
+
return globalThis.document;
|
|
70
|
+
}
|
|
71
|
+
function fromRaf(opts = {}) {
|
|
72
|
+
const fallbackMsOpt = opts.fallbackMs;
|
|
73
|
+
const fallbackMs = Number.isFinite(fallbackMsOpt) && fallbackMsOpt !== void 0 && fallbackMsOpt > 0 ? fallbackMsOpt : 16;
|
|
74
|
+
const scheduler = opts.scheduler ?? defaultAnimationFrameScheduler(fallbackMs);
|
|
75
|
+
const visibilityDocument = opts.document ?? defaultVisibilityDocument();
|
|
76
|
+
return {
|
|
77
|
+
factory: "fromRaf",
|
|
78
|
+
opts: { pool: "sync", pausable: false },
|
|
79
|
+
body: (ctx) => {
|
|
80
|
+
let active = true;
|
|
81
|
+
let frame;
|
|
82
|
+
const cancelPending = () => {
|
|
83
|
+
if (frame === void 0) return;
|
|
84
|
+
scheduler.cancelAnimationFrame(frame);
|
|
85
|
+
frame = void 0;
|
|
86
|
+
};
|
|
87
|
+
const isHidden = () => opts.pauseWhenHidden === true && visibilityDocument?.visibilityState === "hidden";
|
|
88
|
+
const schedule = () => {
|
|
89
|
+
if (!active || frame !== void 0 || isHidden()) return;
|
|
90
|
+
frame = scheduler.requestAnimationFrame((time) => {
|
|
91
|
+
frame = void 0;
|
|
92
|
+
if (!active || isHidden()) return;
|
|
93
|
+
ctx.down([["DATA", Number.isFinite(time) ? time : Date.now()]]);
|
|
94
|
+
schedule();
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
const onVisibilityChange = () => {
|
|
98
|
+
if (!active) return;
|
|
99
|
+
if (isHidden()) cancelPending();
|
|
100
|
+
else schedule();
|
|
101
|
+
};
|
|
102
|
+
if (opts.pauseWhenHidden === true && visibilityDocument?.addEventListener && visibilityDocument.removeEventListener) {
|
|
103
|
+
visibilityDocument.addEventListener("visibilitychange", onVisibilityChange);
|
|
104
|
+
}
|
|
105
|
+
ctx.onDeactivation(() => {
|
|
106
|
+
active = false;
|
|
107
|
+
cancelPending();
|
|
108
|
+
visibilityDocument?.removeEventListener?.("visibilitychange", onVisibilityChange);
|
|
109
|
+
});
|
|
110
|
+
schedule();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
48
114
|
function fromIDBRequest(request) {
|
|
49
115
|
return source("fromIDBRequest", (ctx) => {
|
|
50
116
|
let done = false;
|
|
@@ -118,6 +184,7 @@ export {
|
|
|
118
184
|
fromIter,
|
|
119
185
|
fromPromise,
|
|
120
186
|
fromPushNotification,
|
|
187
|
+
fromRaf,
|
|
121
188
|
fromSSE,
|
|
122
189
|
fromSSEWithOptions,
|
|
123
190
|
fromTimer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/sources/browser.ts"],"sourcesContent":["/**\n * Browser-safe source factories. This subpath intentionally excludes\n * Node-only adapters such as fromFSWatch.\n */\n\nimport type { Ctx } from \"../ctx/types.js\";\nimport type { Operator } from \"../graph/operators.js\";\nimport { errorPayload } from \"../protocol/messages.js\";\n\nexport * from \"./index.js\";\n\ntype IDBEventHandler<TThis> = {\n\tbivarianceHack(this: TThis, event: unknown): unknown;\n}[\"bivarianceHack\"];\n\nexport interface IDBRequestLike<T> {\n\tresult: T;\n\terror?: unknown;\n\tonsuccess: null | IDBEventHandler<IDBRequestLike<T>>;\n\tonerror: null | IDBEventHandler<IDBRequestLike<T>>;\n}\n\nexport interface IDBTransactionLike {\n\terror?: unknown;\n\toncomplete: null | IDBEventHandler<IDBTransactionLike>;\n\tonerror: null | IDBEventHandler<IDBTransactionLike>;\n\tonabort: null | IDBEventHandler<IDBTransactionLike>;\n}\n\nfunction source<T>(\n\tfactory: string,\n\tsetup: (ctx: Ctx) => undefined | (() => void),\n): Operator<never, T> {\n\treturn {\n\t\tfactory,\n\t\tbody: (ctx) => {\n\t\t\tconst cleanup = setup(ctx);\n\t\t\tif (typeof cleanup === \"function\") ctx.onDeactivation(cleanup);\n\t\t},\n\t};\n}\n\n/** Wrap an IndexedDB request as a one-shot source. */\nexport function fromIDBRequest<T>(request: IDBRequestLike<T>): Operator<never, T> {\n\treturn source<T>(\"fromIDBRequest\", (ctx) => {\n\t\tlet done = false;\n\t\tconst clear = () => {\n\t\t\trequest.onsuccess = null;\n\t\t\trequest.onerror = null;\n\t\t};\n\t\trequest.onsuccess = () => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tif (request.result === undefined) {\n\t\t\t\tctx.down([\n\t\t\t\t\t[\"ERROR\", new TypeError(\"fromIDBRequest: request.result is the substrate SENTINEL\")],\n\t\t\t\t]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tctx.down([[\"DATA\", request.result], [\"COMPLETE\"]]);\n\t\t};\n\t\trequest.onerror = () => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tctx.down([[\"ERROR\", errorPayload(request.error ?? new Error(\"IndexedDB request failed\"))]]);\n\t\t};\n\t\treturn () => {\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t};\n\t});\n}\n\n/**\n * Wrap an IndexedDB transaction lifecycle as a terminal-only source.\n *\n * Success emits COMPLETE without DATA: undefined is the TypeScript SENTINEL and cannot be a DATA\n * payload under R-data-payload.\n */\nexport function fromIDBTransaction(transaction: IDBTransactionLike): Operator<never, never> {\n\treturn source<never>(\"fromIDBTransaction\", (ctx) => {\n\t\tlet done = false;\n\t\tconst clear = () => {\n\t\t\ttransaction.oncomplete = null;\n\t\t\ttransaction.onerror = null;\n\t\t\ttransaction.onabort = null;\n\t\t};\n\t\tconst fail = (fallback: string) => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tctx.down([[\"ERROR\", errorPayload(transaction.error ?? new Error(fallback))]]);\n\t\t};\n\t\ttransaction.oncomplete = () => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tctx.down([[\"COMPLETE\"]]);\n\t\t};\n\t\ttransaction.onerror = () => fail(\"IndexedDB transaction failed\");\n\t\ttransaction.onabort = () => fail(\"IndexedDB transaction aborted\");\n\t\treturn () => {\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t};\n\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAS,OACR,SACA,OACqB;AACrB,SAAO;AAAA,IACN;AAAA,IACA,MAAM,CAAC,QAAQ;AACd,YAAM,UAAU,MAAM,GAAG;AACzB,UAAI,OAAO,YAAY,WAAY,KAAI,eAAe,OAAO;AAAA,IAC9D;AAAA,EACD;AACD;AAGO,SAAS,eAAkB,SAAgD;AACjF,SAAO,OAAU,kBAAkB,CAAC,QAAQ;AAC3C,QAAI,OAAO;AACX,UAAM,QAAQ,MAAM;AACnB,cAAQ,YAAY;AACpB,cAAQ,UAAU;AAAA,IACnB;AACA,YAAQ,YAAY,MAAM;AACzB,UAAI,KAAM;AACV,aAAO;AACP,YAAM;AACN,UAAI,QAAQ,WAAW,QAAW;AACjC,YAAI,KAAK;AAAA,UACR,CAAC,SAAS,IAAI,UAAU,0DAA0D,CAAC;AAAA,QACpF,CAAC;AACD;AAAA,MACD;AACA,UAAI,KAAK,CAAC,CAAC,QAAQ,QAAQ,MAAM,GAAG,CAAC,UAAU,CAAC,CAAC;AAAA,IAClD;AACA,YAAQ,UAAU,MAAM;AACvB,UAAI,KAAM;AACV,aAAO;AACP,YAAM;AACN,UAAI,KAAK,CAAC,CAAC,SAAS,aAAa,QAAQ,SAAS,IAAI,MAAM,0BAA0B,CAAC,CAAC,CAAC,CAAC;AAAA,IAC3F;AACA,WAAO,MAAM;AACZ,aAAO;AACP,YAAM;AAAA,IACP;AAAA,EACD,CAAC;AACF;AAQO,SAAS,mBAAmB,aAAyD;AAC3F,SAAO,OAAc,sBAAsB,CAAC,QAAQ;AACnD,QAAI,OAAO;AACX,UAAM,QAAQ,MAAM;AACnB,kBAAY,aAAa;AACzB,kBAAY,UAAU;AACtB,kBAAY,UAAU;AAAA,IACvB;AACA,UAAM,OAAO,CAAC,aAAqB;AAClC,UAAI,KAAM;AACV,aAAO;AACP,YAAM;AACN,UAAI,KAAK,CAAC,CAAC,SAAS,aAAa,YAAY,SAAS,IAAI,MAAM,QAAQ,CAAC,CAAC,CAAC,CAAC;AAAA,IAC7E;AACA,gBAAY,aAAa,MAAM;AAC9B,UAAI,KAAM;AACV,aAAO;AACP,YAAM;AACN,UAAI,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC;AAAA,IACxB;AACA,gBAAY,UAAU,MAAM,KAAK,8BAA8B;AAC/D,gBAAY,UAAU,MAAM,KAAK,+BAA+B;AAChE,WAAO,MAAM;AACZ,aAAO;AACP,YAAM;AAAA,IACP;AAAA,EACD,CAAC;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/sources/browser.ts"],"sourcesContent":["/**\n * Browser-safe source factories. This subpath intentionally excludes\n * Node-only adapters such as fromFSWatch.\n */\n\nimport type { Ctx } from \"../ctx/types.js\";\nimport type { Operator } from \"../graph/operators.js\";\nimport { errorPayload } from \"../protocol/messages.js\";\n\nexport * from \"./index.js\";\n\ntype IDBEventHandler<TThis> = {\n\tbivarianceHack(this: TThis, event: unknown): unknown;\n}[\"bivarianceHack\"];\n\nexport interface IDBRequestLike<T> {\n\tresult: T;\n\terror?: unknown;\n\tonsuccess: null | IDBEventHandler<IDBRequestLike<T>>;\n\tonerror: null | IDBEventHandler<IDBRequestLike<T>>;\n}\n\nexport interface IDBTransactionLike {\n\terror?: unknown;\n\toncomplete: null | IDBEventHandler<IDBTransactionLike>;\n\tonerror: null | IDBEventHandler<IDBTransactionLike>;\n\tonabort: null | IDBEventHandler<IDBTransactionLike>;\n}\n\nexport type AnimationFrameHandle = number | ReturnType<typeof setTimeout>;\n\nexport interface AnimationFrameScheduler {\n\trequestAnimationFrame(callback: (time: number) => void): AnimationFrameHandle;\n\tcancelAnimationFrame(handle: AnimationFrameHandle): void;\n}\n\nexport interface VisibilityDocumentLike {\n\treadonly visibilityState?: \"hidden\" | \"visible\" | \"prerender\" | string;\n\taddEventListener?(type: \"visibilitychange\", listener: () => void): void;\n\tremoveEventListener?(type: \"visibilitychange\", listener: () => void): void;\n}\n\nexport interface FromRafOptions {\n\t/** Custom scheduler for tests or host wrappers. Defaults to browser rAF, then a timer fallback. */\n\treadonly scheduler?: AnimationFrameScheduler;\n\t/** Timer fallback cadence when requestAnimationFrame is unavailable. Default: 16ms. */\n\treadonly fallbackMs?: number;\n\t/** Fully park while the provided/browser document is hidden. Default: false. */\n\treadonly pauseWhenHidden?: boolean;\n\t/** Document-like visibility source for tests or embedded browser hosts. */\n\treadonly document?: VisibilityDocumentLike;\n}\n\nfunction source<T>(\n\tfactory: string,\n\tsetup: (ctx: Ctx) => undefined | (() => void),\n): Operator<never, T> {\n\treturn {\n\t\tfactory,\n\t\tbody: (ctx) => {\n\t\t\tconst cleanup = setup(ctx);\n\t\t\tif (typeof cleanup === \"function\") ctx.onDeactivation(cleanup);\n\t\t},\n\t};\n}\n\nfunction defaultAnimationFrameScheduler(fallbackMs: number): AnimationFrameScheduler {\n\tconst host = globalThis as {\n\t\trequestAnimationFrame?: (callback: (time: number) => void) => number;\n\t\tcancelAnimationFrame?: (handle: number) => void;\n\t};\n\tif (\n\t\ttypeof host.requestAnimationFrame === \"function\" &&\n\t\ttypeof host.cancelAnimationFrame === \"function\"\n\t) {\n\t\treturn {\n\t\t\trequestAnimationFrame: (callback) => host.requestAnimationFrame?.(callback) ?? 0,\n\t\t\tcancelAnimationFrame: (handle) => {\n\t\t\t\tif (typeof handle === \"number\") host.cancelAnimationFrame?.(handle);\n\t\t\t},\n\t\t};\n\t}\n\treturn {\n\t\trequestAnimationFrame(callback) {\n\t\t\treturn setTimeout(() => callback(Date.now()), fallbackMs);\n\t\t},\n\t\tcancelAnimationFrame(handle) {\n\t\t\tclearTimeout(handle);\n\t\t},\n\t};\n}\n\nfunction defaultVisibilityDocument(): VisibilityDocumentLike | undefined {\n\treturn (globalThis as { document?: VisibilityDocumentLike }).document;\n}\n\n/**\n * Browser animation-frame source.\n *\n * This is a browser/source boundary, not reactive-layout ownership (D181): every frame timestamp\n * enters the graph as DATA through `ctx.down`, and teardown cancels the pending host callback.\n */\nexport function fromRaf(opts: FromRafOptions = {}): Operator<never, number> {\n\tconst fallbackMsOpt = opts.fallbackMs;\n\tconst fallbackMs =\n\t\tNumber.isFinite(fallbackMsOpt) && fallbackMsOpt !== undefined && fallbackMsOpt > 0\n\t\t\t? fallbackMsOpt\n\t\t\t: 16;\n\tconst scheduler = opts.scheduler ?? defaultAnimationFrameScheduler(fallbackMs);\n\tconst visibilityDocument = opts.document ?? defaultVisibilityDocument();\n\treturn {\n\t\tfactory: \"fromRaf\",\n\t\topts: { pool: \"sync\", pausable: false },\n\t\tbody: (ctx) => {\n\t\t\tlet active = true;\n\t\t\tlet frame: AnimationFrameHandle | undefined;\n\t\t\tconst cancelPending = () => {\n\t\t\t\tif (frame === undefined) return;\n\t\t\t\tscheduler.cancelAnimationFrame(frame);\n\t\t\t\tframe = undefined;\n\t\t\t};\n\t\t\tconst isHidden = () =>\n\t\t\t\topts.pauseWhenHidden === true && visibilityDocument?.visibilityState === \"hidden\";\n\t\t\tconst schedule = () => {\n\t\t\t\tif (!active || frame !== undefined || isHidden()) return;\n\t\t\t\tframe = scheduler.requestAnimationFrame((time) => {\n\t\t\t\t\tframe = undefined;\n\t\t\t\t\tif (!active || isHidden()) return;\n\t\t\t\t\tctx.down([[\"DATA\", Number.isFinite(time) ? time : Date.now()]]);\n\t\t\t\t\tschedule();\n\t\t\t\t});\n\t\t\t};\n\t\t\tconst onVisibilityChange = () => {\n\t\t\t\tif (!active) return;\n\t\t\t\tif (isHidden()) cancelPending();\n\t\t\t\telse schedule();\n\t\t\t};\n\t\t\tif (\n\t\t\t\topts.pauseWhenHidden === true &&\n\t\t\t\tvisibilityDocument?.addEventListener &&\n\t\t\t\tvisibilityDocument.removeEventListener\n\t\t\t) {\n\t\t\t\tvisibilityDocument.addEventListener(\"visibilitychange\", onVisibilityChange);\n\t\t\t}\n\t\t\tctx.onDeactivation(() => {\n\t\t\t\tactive = false;\n\t\t\t\tcancelPending();\n\t\t\t\tvisibilityDocument?.removeEventListener?.(\"visibilitychange\", onVisibilityChange);\n\t\t\t});\n\t\t\tschedule();\n\t\t},\n\t};\n}\n\n/** Wrap an IndexedDB request as a one-shot source. */\nexport function fromIDBRequest<T>(request: IDBRequestLike<T>): Operator<never, T> {\n\treturn source<T>(\"fromIDBRequest\", (ctx) => {\n\t\tlet done = false;\n\t\tconst clear = () => {\n\t\t\trequest.onsuccess = null;\n\t\t\trequest.onerror = null;\n\t\t};\n\t\trequest.onsuccess = () => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tif (request.result === undefined) {\n\t\t\t\tctx.down([\n\t\t\t\t\t[\"ERROR\", new TypeError(\"fromIDBRequest: request.result is the substrate SENTINEL\")],\n\t\t\t\t]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tctx.down([[\"DATA\", request.result], [\"COMPLETE\"]]);\n\t\t};\n\t\trequest.onerror = () => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tctx.down([[\"ERROR\", errorPayload(request.error ?? new Error(\"IndexedDB request failed\"))]]);\n\t\t};\n\t\treturn () => {\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t};\n\t});\n}\n\n/**\n * Wrap an IndexedDB transaction lifecycle as a terminal-only source.\n *\n * Success emits COMPLETE without DATA: undefined is the TypeScript SENTINEL and cannot be a DATA\n * payload under R-data-payload.\n */\nexport function fromIDBTransaction(transaction: IDBTransactionLike): Operator<never, never> {\n\treturn source<never>(\"fromIDBTransaction\", (ctx) => {\n\t\tlet done = false;\n\t\tconst clear = () => {\n\t\t\ttransaction.oncomplete = null;\n\t\t\ttransaction.onerror = null;\n\t\t\ttransaction.onabort = null;\n\t\t};\n\t\tconst fail = (fallback: string) => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tctx.down([[\"ERROR\", errorPayload(transaction.error ?? new Error(fallback))]]);\n\t\t};\n\t\ttransaction.oncomplete = () => {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t\tctx.down([[\"COMPLETE\"]]);\n\t\t};\n\t\ttransaction.onerror = () => fail(\"IndexedDB transaction failed\");\n\t\ttransaction.onabort = () => fail(\"IndexedDB transaction aborted\");\n\t\treturn () => {\n\t\t\tdone = true;\n\t\t\tclear();\n\t\t};\n\t});\n}\n"],"mappings":"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","names":[]}
|
package/dist/sources/index.cjs
CHANGED
|
@@ -68,6 +68,7 @@ var TIER = {
|
|
|
68
68
|
START: TIER_START,
|
|
69
69
|
PAUSE: TIER_CONTROL,
|
|
70
70
|
RESUME: TIER_CONTROL,
|
|
71
|
+
PULL: TIER_CONTROL,
|
|
71
72
|
DIRTY: TIER_NOTIFICATION,
|
|
72
73
|
DATA: TIER_VALUE,
|
|
73
74
|
RESOLVED: TIER_VALUE,
|
|
@@ -910,6 +911,17 @@ function notifyTopologyDepsChanged(node, prevDeps, deps) {
|
|
|
910
911
|
function terminalView(t) {
|
|
911
912
|
return t === void 0 ? false : t;
|
|
912
913
|
}
|
|
914
|
+
function normalizePullDemand(demand) {
|
|
915
|
+
if (typeof demand !== "object" || demand === null || Array.isArray(demand)) {
|
|
916
|
+
throw new Error("ctx.up: PULL requires { pullId, params? } demand payload (D269)");
|
|
917
|
+
}
|
|
918
|
+
const pullId = demand.pullId;
|
|
919
|
+
if (typeof pullId !== "string" && typeof pullId !== "symbol") {
|
|
920
|
+
throw new Error("ctx.up: PULL demand requires a string or symbol pullId (D269)");
|
|
921
|
+
}
|
|
922
|
+
const params = demand.params;
|
|
923
|
+
return params === void 0 ? { pullId } : { pullId, params };
|
|
924
|
+
}
|
|
913
925
|
function validateDownPayloads(msgs) {
|
|
914
926
|
for (const m of msgs) {
|
|
915
927
|
if (m[0] === "DATA" && m[1] === void 0) {
|
|
@@ -953,7 +965,7 @@ var Node = class {
|
|
|
953
965
|
const pull = opts.pullId !== void 0;
|
|
954
966
|
if (pull && pausable === false)
|
|
955
967
|
throw new Error(
|
|
956
|
-
"node: pullId is incompatible with pausable:false \u2014 a pull node
|
|
968
|
+
"node: pullId is incompatible with pausable:false \u2014 a pull node uses the pausable delivery-content axis (R-pull / R-pause-modes / D55,D269)"
|
|
957
969
|
);
|
|
958
970
|
let handle;
|
|
959
971
|
if (handleOrFn === null) handle = null;
|
|
@@ -976,7 +988,6 @@ var Node = class {
|
|
|
976
988
|
value.status = "settled";
|
|
977
989
|
}
|
|
978
990
|
const pauseLockset = /* @__PURE__ */ new Set();
|
|
979
|
-
if (pull) pauseLockset.add(pullLock);
|
|
980
991
|
this._core = core ?? new NodeCore();
|
|
981
992
|
const created = this._core.createSlot(
|
|
982
993
|
{
|
|
@@ -1017,7 +1028,9 @@ var Node = class {
|
|
|
1017
1028
|
pauseLockset,
|
|
1018
1029
|
pausedDepWaveOccurred: false,
|
|
1019
1030
|
pauseBuffer: [],
|
|
1020
|
-
demandOwed:
|
|
1031
|
+
demandOwed: void 0,
|
|
1032
|
+
activePull: void 0,
|
|
1033
|
+
pullDirtyOwed: false,
|
|
1021
1034
|
inDeliverDemand: false
|
|
1022
1035
|
},
|
|
1023
1036
|
privateState: { value: SENTINEL, persist: false },
|
|
@@ -1074,10 +1087,11 @@ var Node = class {
|
|
|
1074
1087
|
this._wave.batchDirtyOwed = false;
|
|
1075
1088
|
this._control.pauseBuffer = [];
|
|
1076
1089
|
this._control.pausedDepWaveOccurred = false;
|
|
1077
|
-
this._control.demandOwed =
|
|
1090
|
+
this._control.demandOwed = void 0;
|
|
1091
|
+
this._control.activePull = void 0;
|
|
1092
|
+
this._control.pullDirtyOwed = false;
|
|
1078
1093
|
this._control.inDeliverDemand = false;
|
|
1079
1094
|
this._control.pauseLockset.clear();
|
|
1080
|
-
if (this._slot.pull) this._control.pauseLockset.add(this._slot.pullLock);
|
|
1081
1095
|
this._privateState.value = state.ctxState.value;
|
|
1082
1096
|
this._privateState.persist = state.ctxState.persist;
|
|
1083
1097
|
if (state.version === false) {
|
|
@@ -1116,17 +1130,16 @@ var Node = class {
|
|
|
1116
1130
|
subscriberCountReaders.set(this, () => this._subscriberCount());
|
|
1117
1131
|
activationReaders.set(this, () => this._lifecycle.activated);
|
|
1118
1132
|
}
|
|
1119
|
-
/** R-pull (D55): true while a pull node is
|
|
1133
|
+
/** R-pull (D55/D272): true while a pull node is not serving a PULL demand pulse. */
|
|
1120
1134
|
_isPullQuiet() {
|
|
1121
|
-
return this._slot.pull && this._control.
|
|
1135
|
+
return this._slot.pull && this._control.activePull === void 0;
|
|
1122
1136
|
}
|
|
1123
1137
|
/**
|
|
1124
|
-
* R-pull (
|
|
1125
|
-
* triggers computation). A consumer demands one delivery by cone-routing
|
|
1126
|
-
* reference): `ctx.up([["
|
|
1127
|
-
* `ctx.upNext([["
|
|
1128
|
-
*
|
|
1129
|
-
* for inspection/describe; routing matches by the pullId value carried in the RESUME, by identity.
|
|
1138
|
+
* R-pull (D269/D272): this pull node's pullId (pure data, like {@link cache}/{@link handle} —
|
|
1139
|
+
* never triggers computation). A consumer demands one delivery by cone-routing PULL of it (no
|
|
1140
|
+
* node reference): `ctx.up([["PULL", { pullId }]])` (immediate; loops back → D37 for a self-read
|
|
1141
|
+
* dep) or `ctx.upNext([["PULL", { pullId }]])` (boundary-deferred self-demand). Undefined for a
|
|
1142
|
+
* non-pull node. The author writes the pullId verbatim; routing matches by identity.
|
|
1130
1143
|
*/
|
|
1131
1144
|
get pullId() {
|
|
1132
1145
|
return this._slot.pullLock;
|
|
@@ -1233,10 +1246,10 @@ var Node = class {
|
|
|
1233
1246
|
});
|
|
1234
1247
|
}
|
|
1235
1248
|
/**
|
|
1236
|
-
* Enqueue a deferred up-going control wave (R-up-routing / R-pull /
|
|
1249
|
+
* Enqueue a deferred up-going control/demand wave (R-up-routing / R-pull / D269): at the committed wave
|
|
1237
1250
|
* boundary, route `msgs` up from THIS node (broadcast, or up the single `towardDep` edge). The
|
|
1238
|
-
* deferred form of `ctx.up` — the SELF-demand path: a consumer issues `ctx.upNext([[
|
|
1239
|
-
* pullId]])` to demand a dep it ALSO reads; the demand applies at the boundary (not mid-fn), so
|
|
1251
|
+
* deferred form of `ctx.up` — the SELF-demand path: a consumer issues `ctx.upNext([[PULL,
|
|
1252
|
+
* { pullId }]])` to demand a dep it ALSO reads; the demand applies at the boundary (not mid-fn), so
|
|
1240
1253
|
* the pull node's delivery loops back as a FRESH wave rather than re-entering the consumer (D37 /
|
|
1241
1254
|
* R-reentrancy). Rides the same R-rewire-deferred (D47) drain as ctx.rewireNext.
|
|
1242
1255
|
*/
|
|
@@ -1451,7 +1464,6 @@ var Node = class {
|
|
|
1451
1464
|
this._lifecycle.activated = true;
|
|
1452
1465
|
const seedRestoredDeps = this._restoredActivationPending;
|
|
1453
1466
|
this._restoredActivationPending = false;
|
|
1454
|
-
if (this._slot.pull) this._control.pauseLockset.add(this._slot.pullLock);
|
|
1455
1467
|
this._dep.unsubs = new Array(this._slot.deps.length);
|
|
1456
1468
|
this._dep.idxBoxes = new Array(this._slot.deps.length);
|
|
1457
1469
|
for (const dep of this._slot.deps)
|
|
@@ -1523,7 +1535,9 @@ var Node = class {
|
|
|
1523
1535
|
this._control.pauseLockset.clear();
|
|
1524
1536
|
this._control.pauseBuffer = [];
|
|
1525
1537
|
this._control.pausedDepWaveOccurred = false;
|
|
1526
|
-
this._control.demandOwed =
|
|
1538
|
+
this._control.demandOwed = void 0;
|
|
1539
|
+
this._control.activePull = void 0;
|
|
1540
|
+
this._control.pullDirtyOwed = false;
|
|
1527
1541
|
this._value.replayRing = [];
|
|
1528
1542
|
if (!this._privateState.persist) this._privateState.value = SENTINEL;
|
|
1529
1543
|
}
|
|
@@ -1535,8 +1549,7 @@ var Node = class {
|
|
|
1535
1549
|
return this._lifecycle.subscribers.size;
|
|
1536
1550
|
}
|
|
1537
1551
|
_isRuntimeQuiescentForRelease() {
|
|
1538
|
-
|
|
1539
|
-
return !this._released && this._value.status !== "dirty" && this._value.status !== "pending" && this._wave.pending === 0 && !this._wave.insideRunWave && !this._wave.inDepMutation && !this._wave.rewireRunPending && !this._wave.batchDirtyOwed && this._dep.dirty.every((dirty) => !dirty) && this._control.pauseBuffer.length === 0 && !this._control.pausedDepWaveOccurred && !this._control.demandOwed && !this._control.inDeliverDemand && (this._control.pauseLockset.size === 0 || allowedPullQuietLock);
|
|
1552
|
+
return !this._released && this._value.status !== "dirty" && this._value.status !== "pending" && this._wave.pending === 0 && !this._wave.insideRunWave && !this._wave.inDepMutation && !this._wave.rewireRunPending && !this._wave.batchDirtyOwed && this._dep.dirty.every((dirty) => !dirty) && this._control.pauseBuffer.length === 0 && !this._control.pausedDepWaveOccurred && this._control.demandOwed === void 0 && this._control.activePull === void 0 && !this._control.inDeliverDemand && this._control.pauseLockset.size === 0;
|
|
1540
1553
|
}
|
|
1541
1554
|
_releaseRuntime() {
|
|
1542
1555
|
if (this._released) return;
|
|
@@ -1592,7 +1605,9 @@ var Node = class {
|
|
|
1592
1605
|
this._control.pauseLockset.clear();
|
|
1593
1606
|
this._control.pauseBuffer = [];
|
|
1594
1607
|
this._control.pausedDepWaveOccurred = false;
|
|
1595
|
-
this._control.demandOwed =
|
|
1608
|
+
this._control.demandOwed = void 0;
|
|
1609
|
+
this._control.activePull = void 0;
|
|
1610
|
+
this._control.pullDirtyOwed = false;
|
|
1596
1611
|
this._restoredActivationPending = false;
|
|
1597
1612
|
checkpointReaders.delete(this);
|
|
1598
1613
|
restoreWriters.delete(this);
|
|
@@ -1774,7 +1789,7 @@ var Node = class {
|
|
|
1774
1789
|
this._wave.rewireRunPending = true;
|
|
1775
1790
|
return;
|
|
1776
1791
|
}
|
|
1777
|
-
if (this._slot.pausable === true && this._isPaused()) {
|
|
1792
|
+
if (this._slot.pausable === true && (this._isPaused() || this._isPullQuiet())) {
|
|
1778
1793
|
this._control.pausedDepWaveOccurred = true;
|
|
1779
1794
|
return;
|
|
1780
1795
|
}
|
|
@@ -1914,10 +1929,11 @@ var Node = class {
|
|
|
1914
1929
|
unsubscribeDep: (dep, fn) => this._requestRewireNext({ kind: "remove", dep, fn }),
|
|
1915
1930
|
replaceDeps: (deps, fn) => this._requestRewireNext({ kind: "set", deps, fn })
|
|
1916
1931
|
},
|
|
1917
|
-
// R-up-routing / R-pull (
|
|
1918
|
-
//
|
|
1932
|
+
// R-up-routing / R-pull (D269): deferred up — route a control/demand wave (e.g. PULL)
|
|
1933
|
+
// up the declared cone at the committed boundary. The SELF-demand path: an
|
|
1919
1934
|
// immediate ctx.up whose delivery loops back re-enters this fn (D37 / R-reentrancy).
|
|
1920
1935
|
upNext: (msgs, towardDep) => this._requestUpNext(msgs, towardDep),
|
|
1936
|
+
...this._control.activePull === void 0 ? {} : { pull: this._control.activePull },
|
|
1921
1937
|
[CTX_DEP_CACHE]: { latest: snapshot?.latest ?? this._dep.prev },
|
|
1922
1938
|
[CTX_NODE_BINDING]: {
|
|
1923
1939
|
dispatcher: this._slot.dispatcher,
|
|
@@ -1932,6 +1948,11 @@ var Node = class {
|
|
|
1932
1948
|
_refreshCtx(ctx) {
|
|
1933
1949
|
ctx.waveData = this._dep.waveData;
|
|
1934
1950
|
ctx.terminal = this._dep.terminalInput.map(terminalView);
|
|
1951
|
+
if (this._control.activePull === void 0) {
|
|
1952
|
+
delete ctx.pull;
|
|
1953
|
+
} else {
|
|
1954
|
+
ctx.pull = this._control.activePull;
|
|
1955
|
+
}
|
|
1935
1956
|
ctx[CTX_DEP_CACHE] = { latest: this._dep.prev };
|
|
1936
1957
|
}
|
|
1937
1958
|
_makeState() {
|
|
@@ -2024,7 +2045,7 @@ var Node = class {
|
|
|
2024
2045
|
plannedVersions[i] = plannedVersion;
|
|
2025
2046
|
}
|
|
2026
2047
|
}
|
|
2027
|
-
if (hasTier3 && !this._wave.insideRunWave && !this._wave.emittedDirtyThisWave) {
|
|
2048
|
+
if (hasTier3 && (!this._wave.insideRunWave || this._control.pullDirtyOwed) && !this._wave.emittedDirtyThisWave) {
|
|
2028
2049
|
this._wave.emittedDirtyThisWave = true;
|
|
2029
2050
|
this._value.status = "dirty";
|
|
2030
2051
|
this._emitToSubs(["DIRTY"], { wave: deliveryWave, last: false });
|
|
@@ -2104,13 +2125,18 @@ var Node = class {
|
|
|
2104
2125
|
if (m[0] === "PAUSE") {
|
|
2105
2126
|
this._pauseAcquire(m[1]);
|
|
2106
2127
|
} else if (m[0] === "RESUME") {
|
|
2107
|
-
if (this.
|
|
2108
|
-
if (!this._markDemandRouted(m[1], routeState)) this._onDemand();
|
|
2109
|
-
} else if (this._control.pauseLockset.has(m[1])) {
|
|
2128
|
+
if (this._control.pauseLockset.has(m[1])) {
|
|
2110
2129
|
this._pauseRelease(m[1]);
|
|
2111
2130
|
} else {
|
|
2112
2131
|
this._forwardUp(m, towardDep, routeState);
|
|
2113
2132
|
}
|
|
2133
|
+
} else if (m[0] === "PULL") {
|
|
2134
|
+
const demand = normalizePullDemand(m[1]);
|
|
2135
|
+
if (this._slot.pull && demand.pullId === this._slot.pullLock) {
|
|
2136
|
+
if (!this._markDemandRouted(demand.pullId, routeState)) this._onDemand(demand);
|
|
2137
|
+
} else {
|
|
2138
|
+
this._forwardUp(["PULL", demand], towardDep, routeState);
|
|
2139
|
+
}
|
|
2114
2140
|
} else if (this._slot.deps.length === 0) {
|
|
2115
2141
|
if (m[0] === "INVALIDATE") this._down([["INVALIDATE"]]);
|
|
2116
2142
|
} else {
|
|
@@ -2132,7 +2158,7 @@ var Node = class {
|
|
|
2132
2158
|
* Forward one up-going control message toward deps (R-up-routing): up the single declared edge
|
|
2133
2159
|
* `towardDep` (directed — prunes other branches; only meaningful on the issuer's FIRST hop) or
|
|
2134
2160
|
* broadcast up ALL deps. A depless source has no deps → the message DROPS here (the terminus —
|
|
2135
|
-
* e.g. a cone-routed
|
|
2161
|
+
* e.g. a cone-routed PULL whose pullId no node up this cone holds, R-up-at-source). Recursive
|
|
2136
2162
|
* forwarding carries the same per-wave route state and no `towardDep` → broadcast beyond the
|
|
2137
2163
|
* first hop.
|
|
2138
2164
|
*/
|
|
@@ -2151,9 +2177,7 @@ var Node = class {
|
|
|
2151
2177
|
}
|
|
2152
2178
|
_hasBoundaryPauseLock() {
|
|
2153
2179
|
if (this._slot.pausable === false) return false;
|
|
2154
|
-
|
|
2155
|
-
if (this._slot.pull && this._control.pauseLockset.has(this._slot.pullLock)) locks--;
|
|
2156
|
-
return locks > 0;
|
|
2180
|
+
return this._control.pauseLockset.size > 0;
|
|
2157
2181
|
}
|
|
2158
2182
|
_isAsyncPool() {
|
|
2159
2183
|
return this._slot.handle !== null && this._slot.dispatcher.poolKind(this._slot.handle.poolId) === "async";
|
|
@@ -2164,17 +2188,19 @@ var Node = class {
|
|
|
2164
2188
|
_pauseRelease(lockId) {
|
|
2165
2189
|
if (!this._control.pauseLockset.has(lockId)) return;
|
|
2166
2190
|
this._control.pauseLockset.delete(lockId);
|
|
2167
|
-
if (this._slot.pull && this._control.demandOwed) this._fireOwedDemandIfReady();
|
|
2191
|
+
if (this._slot.pull && this._control.demandOwed !== void 0) this._fireOwedDemandIfReady();
|
|
2168
2192
|
if (this._hasBoundaryPauseLock()) return;
|
|
2169
2193
|
scheduleBoundaryDrain(this._core);
|
|
2170
|
-
if (this.
|
|
2194
|
+
if (this._slot.pull) return;
|
|
2171
2195
|
this._onResume();
|
|
2172
2196
|
}
|
|
2173
2197
|
_onResume() {
|
|
2174
2198
|
if (this._value.terminal !== void 0) {
|
|
2175
2199
|
this._control.pauseBuffer = [];
|
|
2176
2200
|
this._control.pausedDepWaveOccurred = false;
|
|
2177
|
-
this._control.demandOwed =
|
|
2201
|
+
this._control.demandOwed = void 0;
|
|
2202
|
+
this._control.activePull = void 0;
|
|
2203
|
+
this._control.pullDirtyOwed = false;
|
|
2178
2204
|
return;
|
|
2179
2205
|
}
|
|
2180
2206
|
if (this._control.pauseBuffer.length > 0) {
|
|
@@ -2188,41 +2214,38 @@ var Node = class {
|
|
|
2188
2214
|
}
|
|
2189
2215
|
}
|
|
2190
2216
|
/**
|
|
2191
|
-
* R-pull (
|
|
2217
|
+
* R-pull (D269): can this pull node fire a demand NOW? — not terminal, settle-ready (_pending===0),
|
|
2192
2218
|
* and no OTHER (non-pullId) lock holds it paused. The gate that decides fire-now vs OWE.
|
|
2193
2219
|
*/
|
|
2194
2220
|
_canFireDemand() {
|
|
2195
2221
|
if (this._value.terminal !== void 0 || this._wave.pending > 0) return false;
|
|
2196
|
-
|
|
2197
|
-
return this._control.pauseLockset.size <= own;
|
|
2222
|
+
return this._control.pauseLockset.size === 0;
|
|
2198
2223
|
}
|
|
2199
2224
|
/**
|
|
2200
|
-
* R-pull (
|
|
2201
|
-
*
|
|
2202
|
-
* `finally` so a throwing pull fn (graph-less node, no D30 catch) cannot leave the node
|
|
2203
|
-
* permanently non-quiet (the wedge-fix silently disabled) — QA-found robustness fix.
|
|
2225
|
+
* R-pull (D269/D272): deliver ONE demand pulse — install activePull so the demand wave may
|
|
2226
|
+
* emit, fire it, then clear activePull so the node is quiet again (1:1).
|
|
2204
2227
|
*/
|
|
2205
|
-
_deliverPullDemand() {
|
|
2206
|
-
this._control.demandOwed =
|
|
2228
|
+
_deliverPullDemand(demand) {
|
|
2229
|
+
this._control.demandOwed = void 0;
|
|
2230
|
+
this._control.activePull = demand;
|
|
2207
2231
|
this._control.inDeliverDemand = true;
|
|
2208
|
-
this._control.pauseLockset.delete(this._slot.pullLock);
|
|
2209
2232
|
try {
|
|
2210
2233
|
this._firePullDemand();
|
|
2211
2234
|
} finally {
|
|
2212
|
-
this._control.
|
|
2235
|
+
this._control.activePull = void 0;
|
|
2213
2236
|
this._control.inDeliverDemand = false;
|
|
2214
2237
|
}
|
|
2215
2238
|
}
|
|
2216
2239
|
/**
|
|
2217
|
-
* R-pull (
|
|
2240
|
+
* R-pull (D269): a cone-routed PULL of THIS node's pullId arrived (R-up-routing) = a DEMAND.
|
|
2218
2241
|
* Fire immediately if able; else OWE it — pin-5 (a dep DIRTY in flight, _pending>0) or F4/F5 (an
|
|
2219
2242
|
* external PAUSE lock co-holds the node) — and fire when the node next becomes able. A demand
|
|
2220
2243
|
* arriving WHILE a delivery is in flight (synchronous re-entry) is DROPPED (1:1, QA guard).
|
|
2221
2244
|
*/
|
|
2222
|
-
_onDemand() {
|
|
2245
|
+
_onDemand(demand) {
|
|
2223
2246
|
if (this._control.inDeliverDemand) return;
|
|
2224
|
-
if (this._canFireDemand()) this._deliverPullDemand();
|
|
2225
|
-
else this._control.demandOwed =
|
|
2247
|
+
if (this._canFireDemand()) this._deliverPullDemand(demand);
|
|
2248
|
+
else this._control.demandOwed = demand;
|
|
2226
2249
|
}
|
|
2227
2250
|
/**
|
|
2228
2251
|
* R-pull (D55): service ONE demand. Delivery content = the orthogonal pausable mode:
|
|
@@ -2235,33 +2258,53 @@ var Node = class {
|
|
|
2235
2258
|
* `_markDirty` relays the leading DIRTY (not absorbed).
|
|
2236
2259
|
*/
|
|
2237
2260
|
_firePullDemand() {
|
|
2261
|
+
let drainedBuffer = false;
|
|
2238
2262
|
if (this._control.pauseBuffer.length > 0) {
|
|
2239
2263
|
const buf = this._control.pauseBuffer;
|
|
2240
2264
|
this._control.pauseBuffer = [];
|
|
2241
2265
|
for (const wave of buf) this._down(wave);
|
|
2266
|
+
drainedBuffer = true;
|
|
2242
2267
|
}
|
|
2268
|
+
if (drainedBuffer) return;
|
|
2243
2269
|
if (this._control.pausedDepWaveOccurred) {
|
|
2244
2270
|
const gated = this._slot.handle !== null && !this._wave.hasCalledFnOnce && !(this._slot.partial || this._allDepsSettled());
|
|
2245
2271
|
if (this._wave.pending > 0 || gated) return;
|
|
2246
2272
|
this._control.pausedDepWaveOccurred = false;
|
|
2247
|
-
this.
|
|
2248
|
-
this.
|
|
2273
|
+
this._wave.emittedDirtyThisWave = false;
|
|
2274
|
+
this._control.pullDirtyOwed = true;
|
|
2275
|
+
try {
|
|
2276
|
+
this._tryRun();
|
|
2277
|
+
} finally {
|
|
2278
|
+
this._control.pullDirtyOwed = false;
|
|
2279
|
+
}
|
|
2280
|
+
return;
|
|
2281
|
+
}
|
|
2282
|
+
if (this._slot.handle !== null) {
|
|
2283
|
+
if (!this._wave.hasCalledFnOnce && !(this._slot.partial || this._allDepsSettled())) return;
|
|
2284
|
+
this._wave.emittedDirtyThisWave = false;
|
|
2285
|
+
this._control.pullDirtyOwed = true;
|
|
2286
|
+
try {
|
|
2287
|
+
this._runWave();
|
|
2288
|
+
} finally {
|
|
2289
|
+
this._control.pullDirtyOwed = false;
|
|
2290
|
+
}
|
|
2249
2291
|
}
|
|
2250
2292
|
}
|
|
2251
2293
|
/**
|
|
2252
|
-
* R-pull (
|
|
2294
|
+
* R-pull (D269): fire a demand that was OWED (deferred at demand time) once the node becomes
|
|
2253
2295
|
* able — called from the dep-settle arms (DATA/RESOLVED/INVALIDATE/terminal drain _pending, pin-5
|
|
2254
2296
|
* + B1/F6) and from `_pauseRelease` (an external PAUSE lock releases, F4/F5).
|
|
2255
2297
|
*/
|
|
2256
2298
|
_fireOwedDemandIfReady() {
|
|
2257
2299
|
if (this._control.inDeliverDemand) return;
|
|
2258
|
-
if (this._slot.pull && this._control.demandOwed && this._canFireDemand())
|
|
2259
|
-
this._deliverPullDemand();
|
|
2300
|
+
if (this._slot.pull && this._control.demandOwed !== void 0 && this._canFireDemand()) {
|
|
2301
|
+
this._deliverPullDemand(this._control.demandOwed);
|
|
2302
|
+
}
|
|
2260
2303
|
}
|
|
2261
2304
|
/** Should an outgoing settle slice be deferred into the pause buffer? */
|
|
2262
2305
|
_shouldBufferOnPause() {
|
|
2263
2306
|
if (this._slot.pausable === false) return false;
|
|
2264
|
-
if (!this._isPaused()) return false;
|
|
2307
|
+
if (!this._isPaused() && !this._isPullQuiet()) return false;
|
|
2265
2308
|
if (this._slot.pausable === "resumeAll") return true;
|
|
2266
2309
|
if (!this._wave.insideRunWave && this._isAsyncPool() && this._slot.deps.length > 0) return true;
|
|
2267
2310
|
return false;
|
|
@@ -2301,7 +2344,9 @@ var Node = class {
|
|
|
2301
2344
|
this._control.pauseLockset.clear();
|
|
2302
2345
|
this._control.pauseBuffer = [];
|
|
2303
2346
|
this._control.pausedDepWaveOccurred = false;
|
|
2304
|
-
this._control.demandOwed =
|
|
2347
|
+
this._control.demandOwed = void 0;
|
|
2348
|
+
this._control.activePull = void 0;
|
|
2349
|
+
this._control.pullDirtyOwed = false;
|
|
2305
2350
|
this._value.replayRing = [];
|
|
2306
2351
|
const isCompute = this._slot.handle !== null || this._slot.deps.length > 0;
|
|
2307
2352
|
if (isCompute) {
|