@graphrefly/graphrefly 0.44.0 → 0.46.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/README.md +22 -19
- package/dist/_internal-B23BagFd.d.cts +33 -0
- package/dist/_internal-B23BagFd.d.ts +33 -0
- package/dist/adaptive-rate-limiter-Dch_xYIi.d.cts +111 -0
- package/dist/adaptive-rate-limiter-Dch_xYIi.d.ts +111 -0
- package/dist/agents-C0Ji9ldU.d.cts +629 -0
- package/dist/agents-C9zexT7I.d.ts +629 -0
- package/dist/audit-BAXb3VOg.d.ts +246 -0
- package/dist/audit-C_bPfkqS.d.cts +246 -0
- package/dist/backoff-7KIK3WQW.js +24 -0
- package/dist/backoff-7KIK3WQW.js.map +1 -0
- package/dist/backoff-Bnb9OoPh.d.cts +6 -0
- package/dist/backoff-Bnb9OoPh.d.ts +6 -0
- package/dist/base/composition/index.cjs +811 -0
- package/dist/base/composition/index.cjs.map +1 -0
- package/dist/base/composition/index.d.cts +469 -0
- package/dist/base/composition/index.d.ts +469 -0
- package/dist/base/composition/index.js +40 -0
- package/dist/base/composition/index.js.map +1 -0
- package/dist/base/index.cjs +6336 -0
- package/dist/base/index.cjs.map +1 -0
- package/dist/base/index.d.cts +22 -0
- package/dist/base/index.d.ts +22 -0
- package/dist/base/index.js +259 -0
- package/dist/base/index.js.map +1 -0
- package/dist/base/io/index.cjs +3270 -0
- package/dist/base/io/index.cjs.map +1 -0
- package/dist/base/io/index.d.cts +2245 -0
- package/dist/base/io/index.d.ts +2245 -0
- package/dist/base/io/index.js +117 -0
- package/dist/base/io/index.js.map +1 -0
- package/dist/base/meta/index.cjs +43 -0
- package/dist/base/meta/index.cjs.map +1 -0
- package/dist/base/meta/index.d.cts +45 -0
- package/dist/base/meta/index.d.ts +45 -0
- package/dist/base/meta/index.js +13 -0
- package/dist/base/meta/index.js.map +1 -0
- package/dist/base/mutation/index.cjs +200 -0
- package/dist/base/mutation/index.cjs.map +1 -0
- package/dist/base/mutation/index.d.cts +177 -0
- package/dist/base/mutation/index.d.ts +177 -0
- package/dist/base/mutation/index.js +22 -0
- package/dist/base/mutation/index.js.map +1 -0
- package/dist/base/render/index.cjs +1120 -0
- package/dist/base/render/index.cjs.map +1 -0
- package/dist/{extra/render/index.d.ts → base/render/index.d.cts} +75 -31
- package/dist/{extra/render/index.d.cts → base/render/index.d.ts} +75 -31
- package/dist/base/render/index.js +24 -0
- package/dist/base/render/index.js.map +1 -0
- package/dist/base/sources/browser/index.cjs +172 -0
- package/dist/base/sources/browser/index.cjs.map +1 -0
- package/dist/base/sources/browser/index.d.cts +84 -0
- package/dist/base/sources/browser/index.d.ts +84 -0
- package/dist/base/sources/browser/index.js +151 -0
- package/dist/base/sources/browser/index.js.map +1 -0
- package/dist/base/sources/event/index.cjs +98 -0
- package/dist/base/sources/event/index.cjs.map +1 -0
- package/dist/base/sources/event/index.d.cts +91 -0
- package/dist/base/sources/event/index.d.ts +91 -0
- package/dist/base/sources/event/index.js +13 -0
- package/dist/base/sources/event/index.js.map +1 -0
- package/dist/base/sources/index.cjs +755 -0
- package/dist/base/sources/index.cjs.map +1 -0
- package/dist/{extra/sources.d.ts → base/sources/index.d.cts} +74 -301
- package/dist/{extra/sources.d.cts → base/sources/index.d.ts} +74 -301
- package/dist/base/sources/index.js +42 -0
- package/dist/base/sources/index.js.map +1 -0
- package/dist/base/sources/node/index.cjs +320 -0
- package/dist/base/sources/node/index.cjs.map +1 -0
- package/dist/{extra/node.d.ts → base/sources/node/index.d.cts} +35 -37
- package/dist/{extra/node.d.cts → base/sources/node/index.d.ts} +35 -37
- package/dist/base/sources/node/index.js +306 -0
- package/dist/base/sources/node/index.js.map +1 -0
- package/dist/base/utils/index.cjs +37 -0
- package/dist/base/utils/index.cjs.map +1 -0
- package/dist/base/utils/index.d.cts +37 -0
- package/dist/base/utils/index.d.ts +37 -0
- package/dist/base/utils/index.js +11 -0
- package/dist/base/utils/index.js.map +1 -0
- package/dist/base/worker/index.cjs +548 -0
- package/dist/base/worker/index.cjs.map +1 -0
- package/dist/base/worker/index.d.cts +207 -0
- package/dist/base/worker/index.d.ts +207 -0
- package/dist/base/worker/index.js +20 -0
- package/dist/base/worker/index.js.map +1 -0
- package/dist/breaker-C9skL3d8.d.ts +175 -0
- package/dist/breaker-ugSdq54q.d.cts +175 -0
- package/dist/{cascading-BglDkMdX.d.cts → cascading-CSSbKGrJ.d.ts} +3 -3
- package/dist/{cascading-MFgxu7Yo.d.ts → cascading-baGkiihI.d.cts} +3 -3
- package/dist/chunk-255UCBG4.js +58 -0
- package/dist/chunk-255UCBG4.js.map +1 -0
- package/dist/chunk-2LO3EL4W.js +1 -0
- package/dist/chunk-2LO3EL4W.js.map +1 -0
- package/dist/chunk-2OB3CEJS.js +1065 -0
- package/dist/chunk-2OB3CEJS.js.map +1 -0
- package/dist/chunk-36NMM65U.js +144 -0
- package/dist/chunk-36NMM65U.js.map +1 -0
- package/dist/chunk-3CEXCBN6.js +1 -0
- package/dist/chunk-3CEXCBN6.js.map +1 -0
- package/dist/chunk-3MUSLI6E.js +105 -0
- package/dist/chunk-3MUSLI6E.js.map +1 -0
- package/dist/chunk-3PSLNJDU.js +884 -0
- package/dist/chunk-3PSLNJDU.js.map +1 -0
- package/dist/chunk-3QZY5BI7.js +92 -0
- package/dist/chunk-3QZY5BI7.js.map +1 -0
- package/dist/chunk-42FQ27MQ.js +594 -0
- package/dist/chunk-42FQ27MQ.js.map +1 -0
- package/dist/chunk-4GYMCUDZ.js +1085 -0
- package/dist/chunk-4GYMCUDZ.js.map +1 -0
- package/dist/chunk-4S53H2KR.js +382 -0
- package/dist/chunk-4S53H2KR.js.map +1 -0
- package/dist/chunk-4XCHZRUJ.js +128 -0
- package/dist/chunk-4XCHZRUJ.js.map +1 -0
- package/dist/chunk-5THCXDWY.js +725 -0
- package/dist/chunk-5THCXDWY.js.map +1 -0
- package/dist/chunk-6XZYT4SW.js +256 -0
- package/dist/chunk-6XZYT4SW.js.map +1 -0
- package/dist/chunk-7EGRP2VX.js +76 -0
- package/dist/chunk-7EGRP2VX.js.map +1 -0
- package/dist/chunk-A7KV5UK4.js +150 -0
- package/dist/chunk-A7KV5UK4.js.map +1 -0
- package/dist/chunk-APY2SS5X.js +156 -0
- package/dist/chunk-APY2SS5X.js.map +1 -0
- package/dist/chunk-AZDQPQ3V.js +66 -0
- package/dist/chunk-AZDQPQ3V.js.map +1 -0
- package/dist/chunk-BU3SEFA5.js +90 -0
- package/dist/chunk-BU3SEFA5.js.map +1 -0
- package/dist/chunk-BXGZFGZ4.js +189 -0
- package/dist/chunk-BXGZFGZ4.js.map +1 -0
- package/dist/chunk-CGHORL6G.js +579 -0
- package/dist/chunk-CGHORL6G.js.map +1 -0
- package/dist/chunk-CXANAIZU.js +530 -0
- package/dist/chunk-CXANAIZU.js.map +1 -0
- package/dist/chunk-CZQHCKKG.js +1 -0
- package/dist/chunk-CZQHCKKG.js.map +1 -0
- package/dist/chunk-DKNHAICT.js +133 -0
- package/dist/chunk-DKNHAICT.js.map +1 -0
- package/dist/chunk-DM4OMPWK.js +584 -0
- package/dist/chunk-DM4OMPWK.js.map +1 -0
- package/dist/chunk-DMSNO6ZB.js +452 -0
- package/dist/chunk-DMSNO6ZB.js.map +1 -0
- package/dist/chunk-E5OZPDIW.js +229 -0
- package/dist/chunk-E5OZPDIW.js.map +1 -0
- package/dist/chunk-EVYY4X5A.js +509 -0
- package/dist/chunk-EVYY4X5A.js.map +1 -0
- package/dist/chunk-FDFD67UO.js +1 -0
- package/dist/chunk-FDFD67UO.js.map +1 -0
- package/dist/chunk-FMPF42Q4.js +13 -0
- package/dist/chunk-FMPF42Q4.js.map +1 -0
- package/dist/chunk-FR6RGA3B.js +1277 -0
- package/dist/chunk-FR6RGA3B.js.map +1 -0
- package/dist/chunk-FW23JYNQ.js +454 -0
- package/dist/chunk-FW23JYNQ.js.map +1 -0
- package/dist/chunk-GBCENOLN.js +1575 -0
- package/dist/chunk-GBCENOLN.js.map +1 -0
- package/dist/chunk-HL7HUJIX.js +1 -0
- package/dist/chunk-HL7HUJIX.js.map +1 -0
- package/dist/chunk-HULCUY35.js +2508 -0
- package/dist/chunk-HULCUY35.js.map +1 -0
- package/dist/chunk-IHTWQEDR.js +169 -0
- package/dist/chunk-IHTWQEDR.js.map +1 -0
- package/dist/chunk-IJRR6YAI.js +128 -0
- package/dist/chunk-IJRR6YAI.js.map +1 -0
- package/dist/chunk-JGFRAFDL.js +221 -0
- package/dist/chunk-JGFRAFDL.js.map +1 -0
- package/dist/chunk-KIIXR252.js +211 -0
- package/dist/chunk-KIIXR252.js.map +1 -0
- package/dist/chunk-KN3H5CNT.js +11 -0
- package/dist/chunk-KN3H5CNT.js.map +1 -0
- package/dist/chunk-KPG3DGLA.js +1 -0
- package/dist/chunk-KPG3DGLA.js.map +1 -0
- package/dist/chunk-KRNQ6RGQ.js +1 -0
- package/dist/chunk-KRNQ6RGQ.js.map +1 -0
- package/dist/chunk-LBAJK24K.js +1071 -0
- package/dist/chunk-LBAJK24K.js.map +1 -0
- package/dist/chunk-MLTPJMH6.js +417 -0
- package/dist/chunk-MLTPJMH6.js.map +1 -0
- package/dist/chunk-N3SZ7BMH.js +95 -0
- package/dist/chunk-N3SZ7BMH.js.map +1 -0
- package/dist/chunk-NDUD3IMO.js +540 -0
- package/dist/chunk-NDUD3IMO.js.map +1 -0
- package/dist/chunk-NY2PYHNC.js +873 -0
- package/dist/chunk-NY2PYHNC.js.map +1 -0
- package/dist/chunk-O3MT7DYI.js +225 -0
- package/dist/chunk-O3MT7DYI.js.map +1 -0
- package/dist/chunk-OCUDSN63.js +2386 -0
- package/dist/chunk-OCUDSN63.js.map +1 -0
- package/dist/chunk-OIWU3NYV.js +199 -0
- package/dist/chunk-OIWU3NYV.js.map +1 -0
- package/dist/chunk-OO5BM6CJ.js +1153 -0
- package/dist/chunk-OO5BM6CJ.js.map +1 -0
- package/dist/chunk-OQUIJT7A.js +1 -0
- package/dist/chunk-OQUIJT7A.js.map +1 -0
- package/dist/chunk-P5LBT622.js +105 -0
- package/dist/chunk-P5LBT622.js.map +1 -0
- package/dist/chunk-PKGQG5QQ.js +519 -0
- package/dist/chunk-PKGQG5QQ.js.map +1 -0
- package/dist/chunk-PKPO3JTZ.js +561 -0
- package/dist/chunk-PKPO3JTZ.js.map +1 -0
- package/dist/chunk-PL5UDIQ5.js +118 -0
- package/dist/chunk-PL5UDIQ5.js.map +1 -0
- package/dist/chunk-PZWISPIQ.js +432 -0
- package/dist/chunk-PZWISPIQ.js.map +1 -0
- package/dist/chunk-Q3EYOCZB.js +510 -0
- package/dist/chunk-Q3EYOCZB.js.map +1 -0
- package/dist/chunk-QMBYUVRL.js +15 -0
- package/dist/chunk-QMBYUVRL.js.map +1 -0
- package/dist/chunk-RAGGHLCV.js +200 -0
- package/dist/chunk-RAGGHLCV.js.map +1 -0
- package/dist/chunk-RGL53X5G.js +574 -0
- package/dist/chunk-RGL53X5G.js.map +1 -0
- package/dist/chunk-RJOG4IJU.js +1039 -0
- package/dist/chunk-RJOG4IJU.js.map +1 -0
- package/dist/chunk-SOOKUYVM.js +403 -0
- package/dist/chunk-SOOKUYVM.js.map +1 -0
- package/dist/chunk-T5BN5KG7.js +1 -0
- package/dist/chunk-T5BN5KG7.js.map +1 -0
- package/dist/chunk-TP7244Y6.js +207 -0
- package/dist/chunk-TP7244Y6.js.map +1 -0
- package/dist/chunk-TSBFTJKM.js +57 -0
- package/dist/chunk-TSBFTJKM.js.map +1 -0
- package/dist/chunk-URQ2CBBF.js +143 -0
- package/dist/chunk-URQ2CBBF.js.map +1 -0
- package/dist/chunk-W2BOPXTI.js +1 -0
- package/dist/chunk-W2BOPXTI.js.map +1 -0
- package/dist/chunk-WKSWLSCX.js +207 -0
- package/dist/chunk-WKSWLSCX.js.map +1 -0
- package/dist/chunk-Y52CS6YA.js +88 -0
- package/dist/chunk-Y52CS6YA.js.map +1 -0
- package/dist/chunk-YCBUWK77.js +92 -0
- package/dist/chunk-YCBUWK77.js.map +1 -0
- package/dist/chunk-YJ4U2D2C.js +314 -0
- package/dist/chunk-YJ4U2D2C.js.map +1 -0
- package/dist/chunk-Z4YXAUDN.js +239 -0
- package/dist/chunk-Z4YXAUDN.js.map +1 -0
- package/dist/chunk-Z6EGP5D7.js +92 -0
- package/dist/chunk-Z6EGP5D7.js.map +1 -0
- package/dist/compat/index.cjs +3100 -9
- package/dist/compat/index.cjs.map +1 -0
- package/dist/compat/index.d.cts +112 -18
- package/dist/compat/index.d.ts +112 -18
- package/dist/compat/index.js +176 -1
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/jotai/index.cjs +149 -1
- package/dist/compat/jotai/index.cjs.map +1 -0
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/jotai/index.js +8 -1
- package/dist/compat/jotai/index.js.map +1 -0
- package/dist/compat/nanostores/index.cjs +205 -1
- package/dist/compat/nanostores/index.cjs.map +1 -0
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nanostores/index.js +22 -1
- package/dist/compat/nanostores/index.js.map +1 -0
- package/dist/compat/nestjs/index.cjs +2241 -9
- package/dist/compat/nestjs/index.cjs.map +1 -0
- package/dist/compat/nestjs/index.d.cts +7 -10
- package/dist/compat/nestjs/index.d.ts +7 -10
- package/dist/compat/nestjs/index.js +78 -1
- package/dist/compat/nestjs/index.js.map +1 -0
- package/dist/compat/react/index.cjs +114 -1
- package/dist/compat/react/index.cjs.map +1 -0
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/react/index.js +12 -1
- package/dist/compat/react/index.js.map +1 -0
- package/dist/compat/solid/index.cjs +101 -1
- package/dist/compat/solid/index.cjs.map +1 -0
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/solid/index.js +12 -1
- package/dist/compat/solid/index.js.map +1 -0
- package/dist/compat/svelte/index.cjs +104 -1
- package/dist/compat/svelte/index.cjs.map +1 -0
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/svelte/index.js +12 -1
- package/dist/compat/svelte/index.js.map +1 -0
- package/dist/compat/vue/index.cjs +119 -1
- package/dist/compat/vue/index.cjs.map +1 -0
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/vue/index.js +12 -1
- package/dist/compat/vue/index.js.map +1 -0
- package/dist/compat/zustand/index.cjs +69 -3
- package/dist/compat/zustand/index.cjs.map +1 -0
- package/dist/compat/zustand/index.d.cts +2 -6
- package/dist/compat/zustand/index.d.ts +2 -6
- package/dist/compat/zustand/index.js +8 -1
- package/dist/compat/zustand/index.js.map +1 -0
- package/dist/distill-De6Rnn15.d.cts +48 -0
- package/dist/distill-De6Rnn15.d.ts +48 -0
- package/dist/external-register-CWyroXb_.d.cts +138 -0
- package/dist/external-register-CWyroXb_.d.ts +138 -0
- package/dist/{fallback-74oxi34l.d.cts → fallback-Bx46zqky.d.cts} +3 -10
- package/dist/{fallback-DUyyBTBK.d.ts → fallback-pIWW8A2d.d.ts} +3 -10
- package/dist/guarded-execution-BcdtxeBk.d.ts +207 -0
- package/dist/guarded-execution-C-3hnP6A.d.cts +207 -0
- package/dist/{index-CBGUK09R.d.ts → index-5SU_O78r.d.cts} +5 -5
- package/dist/{index-BmZXHqkE.d.ts → index-B6pxYJzO.d.cts} +1 -1
- package/dist/{index-hcDJ8PSI.d.cts → index-B6pxYJzO.d.ts} +1 -1
- package/dist/{index-C5stwKcw.d.cts → index-BFsng6v1.d.cts} +1 -1
- package/dist/{index-CdAlHFEt.d.ts → index-BFsng6v1.d.ts} +1 -1
- package/dist/{index-_6ODbuOu.d.cts → index-Bg-LwEt-.d.cts} +1 -1
- package/dist/{index-CviRnE4K.d.ts → index-Bg-LwEt-.d.ts} +1 -1
- package/dist/{index-CBBLl_rc.d.ts → index-Brp888t0.d.cts} +1 -1
- package/dist/{index-BQSKmbuG.d.cts → index-Brp888t0.d.ts} +1 -1
- package/dist/{index-sqkqlb1p.d.ts → index-CDfk6jHN.d.cts} +1 -1
- package/dist/{index-ZVQhLa2i.d.cts → index-CDfk6jHN.d.ts} +1 -1
- package/dist/{index-Climxqsu.d.cts → index-CEXCtYYJ.d.ts} +5 -5
- package/dist/index-DLAxYaN5.d.cts +169 -0
- package/dist/index-DLAxYaN5.d.ts +169 -0
- package/dist/{index-CK29LV56.d.cts → index-DeWbQzMe.d.cts} +1 -1
- package/dist/{index-CPQlGA29.d.ts → index-DeWbQzMe.d.ts} +1 -1
- package/dist/{index-BrPrLl4e.d.cts → index-dX9IzPqj.d.cts} +1 -1
- package/dist/{index-Dgl1HpPn.d.ts → index-dX9IzPqj.d.ts} +1 -1
- package/dist/index.cjs +25934 -191
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +58 -94
- package/dist/index.d.ts +58 -94
- package/dist/index.js +852 -1
- package/dist/index.js.map +1 -0
- package/dist/layout-types-B5aiHYgk.d.cts +72 -0
- package/dist/layout-types-B5aiHYgk.d.ts +72 -0
- package/dist/memory-composers-BryDrRBX.d.cts +529 -0
- package/dist/memory-composers-CVQqPYEV.d.ts +529 -0
- package/dist/{observable-DWjNfLvC.d.ts → observable-BXQoW1P-.d.cts} +1 -1
- package/dist/{observable-e3eiPPFy.d.cts → observable-BXQoW1P-.d.ts} +1 -1
- package/dist/{pipeline-graph-Sgj0gCwn.d.ts → pipeline-graph-Ce47CB6Y.d.cts} +13 -10
- package/dist/{pipeline-graph-CIKhynsF.d.cts → pipeline-graph-DXCwY9vG.d.ts} +13 -10
- package/dist/presets/ai/index.cjs +4377 -0
- package/dist/presets/ai/index.cjs.map +1 -0
- package/dist/presets/ai/index.d.cts +98 -0
- package/dist/presets/ai/index.d.ts +98 -0
- package/dist/presets/ai/index.js +54 -0
- package/dist/presets/ai/index.js.map +1 -0
- package/dist/presets/harness/index.cjs +5929 -0
- package/dist/presets/harness/index.cjs.map +1 -0
- package/dist/presets/harness/index.d.cts +566 -0
- package/dist/presets/harness/index.d.ts +566 -0
- package/dist/presets/harness/index.js +71 -0
- package/dist/presets/harness/index.js.map +1 -0
- package/dist/presets/index.cjs +9782 -0
- package/dist/presets/index.cjs.map +1 -0
- package/dist/presets/index.d.cts +28 -0
- package/dist/presets/index.d.ts +28 -0
- package/dist/presets/index.js +129 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/presets/inspect/index.cjs +1087 -0
- package/dist/presets/inspect/index.cjs.map +1 -0
- package/dist/presets/inspect/index.d.cts +172 -0
- package/dist/presets/inspect/index.d.ts +172 -0
- package/dist/presets/inspect/index.js +21 -0
- package/dist/presets/inspect/index.js.map +1 -0
- package/dist/presets/resilience/index.cjs +1593 -0
- package/dist/presets/resilience/index.cjs.map +1 -0
- package/dist/presets/resilience/index.d.cts +205 -0
- package/dist/presets/resilience/index.d.ts +205 -0
- package/dist/presets/resilience/index.js +18 -0
- package/dist/presets/resilience/index.js.map +1 -0
- package/dist/rate-limiter-CEALq4N1.d.ts +559 -0
- package/dist/rate-limiter-DpVbSYdH.d.cts +559 -0
- package/dist/{reactive-layout-DOTs9P3X.d.ts → reactive-layout-fswlBUvX.d.cts} +19 -7
- package/dist/{reactive-layout-DgctbqZo.d.cts → reactive-layout-fswlBUvX.d.ts} +19 -7
- package/dist/retry-BDbRZ_gx.d.ts +125 -0
- package/dist/retry-DWuhjvsA.d.cts +125 -0
- package/dist/solutions/index.cjs +8200 -0
- package/dist/solutions/index.cjs.map +1 -0
- package/dist/solutions/index.d.cts +23 -0
- package/dist/solutions/index.d.ts +23 -0
- package/dist/solutions/index.js +55 -0
- package/dist/solutions/index.js.map +1 -0
- package/dist/spawnable-5mDY501F.d.cts +746 -0
- package/dist/spawnable-D3lR0oQu.d.ts +746 -0
- package/dist/status-U-rUI79b.d.cts +84 -0
- package/dist/status-U-rUI79b.d.ts +84 -0
- package/dist/timeout-U5O4ESK3.js +12 -0
- package/dist/timeout-U5O4ESK3.js.map +1 -0
- package/dist/{types-CWFysE9E.d.ts → types-BB5Lw-pB.d.cts} +3 -3
- package/dist/{types-C0_yquda.d.cts → types-BB5Lw-pB.d.ts} +3 -3
- package/dist/types-CJWIMJiZ.d.ts +548 -0
- package/dist/types-vCq7ShIm.d.cts +548 -0
- package/dist/utils/ai/browser.cjs +2169 -0
- package/dist/utils/ai/browser.cjs.map +1 -0
- package/dist/{patterns → utils}/ai/browser.d.cts +7 -5
- package/dist/{patterns → utils}/ai/browser.d.ts +7 -5
- package/dist/utils/ai/browser.js +255 -0
- package/dist/utils/ai/browser.js.map +1 -0
- package/dist/utils/ai/index.cjs +8468 -0
- package/dist/utils/ai/index.cjs.map +1 -0
- package/dist/{index-CR8QpwX8.d.ts → utils/ai/index.d.cts} +73 -976
- package/dist/{index-UPSiS-X7.d.cts → utils/ai/index.d.ts} +73 -976
- package/dist/utils/ai/index.js +173 -0
- package/dist/utils/ai/index.js.map +1 -0
- package/dist/utils/ai/node.cjs +648 -0
- package/dist/utils/ai/node.cjs.map +1 -0
- package/dist/{patterns → utils}/ai/node.d.cts +5 -7
- package/dist/{patterns → utils}/ai/node.d.ts +5 -7
- package/dist/utils/ai/node.js +84 -0
- package/dist/utils/ai/node.js.map +1 -0
- package/dist/utils/cqrs/index.cjs +1036 -0
- package/dist/utils/cqrs/index.cjs.map +1 -0
- package/dist/{index-CeFiHtAg.d.ts → utils/cqrs/index.d.cts} +7 -37
- package/dist/{index-B-_tFaqV.d.cts → utils/cqrs/index.d.ts} +7 -37
- package/dist/utils/cqrs/index.js +18 -0
- package/dist/utils/cqrs/index.js.map +1 -0
- package/dist/utils/demo-shell/index.cjs +865 -0
- package/dist/utils/demo-shell/index.cjs.map +1 -0
- package/dist/{index-B8YnZpIR.d.ts → utils/demo-shell/index.d.cts} +4 -16
- package/dist/{index-Cwv0KWcU.d.cts → utils/demo-shell/index.d.ts} +4 -16
- package/dist/utils/demo-shell/index.js +13 -0
- package/dist/utils/demo-shell/index.js.map +1 -0
- package/dist/utils/domain-templates/index.cjs +732 -0
- package/dist/utils/domain-templates/index.cjs.map +1 -0
- package/dist/{index-CzLVrjxn.d.ts → utils/domain-templates/index.d.cts} +3 -20
- package/dist/{index-BaQaY_IQ.d.cts → utils/domain-templates/index.d.ts} +3 -20
- package/dist/utils/domain-templates/index.js +17 -0
- package/dist/utils/domain-templates/index.js.map +1 -0
- package/dist/utils/graphspec/index.cjs +1174 -0
- package/dist/utils/graphspec/index.cjs.map +1 -0
- package/dist/{index-CMh5Rz1y.d.ts → utils/graphspec/index.d.cts} +106 -42
- package/dist/{index-CS0LTlB8.d.cts → utils/graphspec/index.d.ts} +106 -42
- package/dist/utils/graphspec/index.js +35 -0
- package/dist/utils/graphspec/index.js.map +1 -0
- package/dist/utils/harness/index.cjs +656 -0
- package/dist/utils/harness/index.cjs.map +1 -0
- package/dist/utils/harness/index.d.cts +542 -0
- package/dist/utils/harness/index.d.ts +542 -0
- package/dist/utils/harness/index.js +56 -0
- package/dist/utils/harness/index.js.map +1 -0
- package/dist/utils/index.cjs +17609 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +96 -0
- package/dist/utils/index.d.ts +96 -0
- package/dist/utils/index.js +514 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/inspect/index.cjs +807 -0
- package/dist/utils/inspect/index.cjs.map +1 -0
- package/dist/utils/inspect/index.d.cts +123 -0
- package/dist/utils/inspect/index.d.ts +123 -0
- package/dist/utils/inspect/index.js +30 -0
- package/dist/utils/inspect/index.js.map +1 -0
- package/dist/utils/job-queue/index.cjs +717 -0
- package/dist/utils/job-queue/index.cjs.map +1 -0
- package/dist/{index-DisjX8a-.d.ts → utils/job-queue/index.d.cts} +5 -26
- package/dist/{index-DV_1YuVk.d.cts → utils/job-queue/index.d.ts} +5 -26
- package/dist/utils/job-queue/index.js +18 -0
- package/dist/utils/job-queue/index.js.map +1 -0
- package/dist/utils/memory/index.cjs +1451 -0
- package/dist/utils/memory/index.cjs.map +1 -0
- package/dist/{index-CZ3r5Rxp.d.ts → utils/memory/index.d.cts} +242 -34
- package/dist/{index-B17QddL1.d.cts → utils/memory/index.d.ts} +242 -34
- package/dist/utils/memory/index.js +19 -0
- package/dist/utils/memory/index.js.map +1 -0
- package/dist/utils/messaging/index.cjs +666 -0
- package/dist/utils/messaging/index.cjs.map +1 -0
- package/dist/utils/messaging/index.d.cts +562 -0
- package/dist/utils/messaging/index.d.ts +562 -0
- package/dist/utils/messaging/index.js +50 -0
- package/dist/utils/messaging/index.js.map +1 -0
- package/dist/utils/orchestration/index.cjs +876 -0
- package/dist/utils/orchestration/index.cjs.map +1 -0
- package/dist/utils/orchestration/index.d.cts +233 -0
- package/dist/utils/orchestration/index.d.ts +233 -0
- package/dist/utils/orchestration/index.js +19 -0
- package/dist/utils/orchestration/index.js.map +1 -0
- package/dist/utils/process/index.cjs +743 -0
- package/dist/utils/process/index.cjs.map +1 -0
- package/dist/{index-p09KSrTN.d.ts → utils/process/index.d.cts} +97 -44
- package/dist/{index-CasX6Pfq.d.cts → utils/process/index.d.ts} +97 -44
- package/dist/utils/process/index.js +14 -0
- package/dist/utils/process/index.js.map +1 -0
- package/dist/utils/reactive-layout/index.cjs +1607 -0
- package/dist/utils/reactive-layout/index.cjs.map +1 -0
- package/dist/{index-B5S8ULbU.d.ts → utils/reactive-layout/index.d.cts} +58 -81
- package/dist/{index-Dc4AYqrJ.d.cts → utils/reactive-layout/index.d.ts} +58 -81
- package/dist/utils/reactive-layout/index.js +52 -0
- package/dist/utils/reactive-layout/index.js.map +1 -0
- package/dist/utils/reduction/index.cjs +203 -0
- package/dist/utils/reduction/index.cjs.map +1 -0
- package/dist/{index-Byu-OpX_.d.ts → utils/reduction/index.d.cts} +6 -17
- package/dist/{index-tRCxuAXF.d.cts → utils/reduction/index.d.ts} +6 -17
- package/dist/utils/reduction/index.js +14 -0
- package/dist/utils/reduction/index.js.map +1 -0
- package/dist/utils/resilience/index.cjs +1617 -0
- package/dist/utils/resilience/index.cjs.map +1 -0
- package/dist/utils/resilience/index.d.cts +9 -0
- package/dist/utils/resilience/index.d.ts +9 -0
- package/dist/utils/resilience/index.js +44 -0
- package/dist/utils/resilience/index.js.map +1 -0
- package/dist/utils/surface/index.cjs +1070 -0
- package/dist/utils/surface/index.cjs.map +1 -0
- package/dist/{index-CYq8vAyV.d.ts → utils/surface/index.d.cts} +7 -58
- package/dist/{index-CSOmP7xT.d.cts → utils/surface/index.d.ts} +7 -58
- package/dist/utils/surface/index.js +30 -0
- package/dist/utils/surface/index.js.map +1 -0
- package/dist/utils/topology-view/index.cjs +620 -0
- package/dist/utils/topology-view/index.cjs.map +1 -0
- package/dist/utils/topology-view/index.d.cts +68 -0
- package/dist/utils/topology-view/index.d.ts +68 -0
- package/dist/utils/topology-view/index.js +11 -0
- package/dist/utils/topology-view/index.js.map +1 -0
- package/package.json +664 -584
- package/dist/backoff-HPZMEZNF.js +0 -1
- package/dist/chunk-2T7U5EU6.js +0 -1
- package/dist/chunk-3G5U5QNE.js +0 -5
- package/dist/chunk-4VVTGLXJ.js +0 -1
- package/dist/chunk-5M4CCMMD.js +0 -45
- package/dist/chunk-5QDBSZBV.js +0 -1
- package/dist/chunk-5XJ6B66J.js +0 -1
- package/dist/chunk-6QZNQS5B.js +0 -1
- package/dist/chunk-6X7AFUJV.js +0 -9
- package/dist/chunk-7K6PWTDQ.js +0 -1
- package/dist/chunk-7LIAPXJB.js +0 -1
- package/dist/chunk-7WPU3UHQ.js +0 -1
- package/dist/chunk-A5WCQ5NO.js +0 -1
- package/dist/chunk-APPIWSGD.js +0 -84
- package/dist/chunk-BEZWM2SY.js +0 -1
- package/dist/chunk-C72GO4IZ.js +0 -1
- package/dist/chunk-CB676TKJ.js +0 -1
- package/dist/chunk-CE6TI2TL.js +0 -1
- package/dist/chunk-CE72X3WO.js +0 -1
- package/dist/chunk-CK2E7BTU.js +0 -1
- package/dist/chunk-CLVB32RD.js +0 -1
- package/dist/chunk-CRVT7D2P.js +0 -1
- package/dist/chunk-D5RFJOZ2.js +0 -1
- package/dist/chunk-D7GPHKFH.js +0 -1
- package/dist/chunk-DHRX7JX4.js +0 -2
- package/dist/chunk-ESMPEKEV.js +0 -1
- package/dist/chunk-F672GV32.js +0 -1
- package/dist/chunk-FZMYDOWV.js +0 -1
- package/dist/chunk-GHBWHMRZ.js +0 -1
- package/dist/chunk-GLERH466.js +0 -1
- package/dist/chunk-GPW2V3RE.js +0 -1
- package/dist/chunk-HIDYF36O.js +0 -1
- package/dist/chunk-HITNVN6B.js +0 -3
- package/dist/chunk-HY4DJBA7.js +0 -5
- package/dist/chunk-KZIEYVXN.js +0 -1
- package/dist/chunk-L6NSJVJZ.js +0 -1
- package/dist/chunk-N4MQX6JU.js +0 -18
- package/dist/chunk-N7FHEL4D.js +0 -1
- package/dist/chunk-NTEURFZH.js +0 -1
- package/dist/chunk-OIVP6KFV.js +0 -1
- package/dist/chunk-OPHBU3LG.js +0 -1
- package/dist/chunk-OYQOZP2F.js +0 -5
- package/dist/chunk-PTZK576G.js +0 -1
- package/dist/chunk-QYADASLV.js +0 -1
- package/dist/chunk-ST7UXLWR.js +0 -1
- package/dist/chunk-SVY7VUYU.js +0 -1
- package/dist/chunk-TK3NWWD4.js +0 -1
- package/dist/chunk-TSOYJ743.js +0 -1
- package/dist/chunk-UNGSTR4X.js +0 -61
- package/dist/chunk-VIMF6LGM.js +0 -1
- package/dist/chunk-VJLMUKOI.js +0 -1
- package/dist/chunk-VN6RDSK2.js +0 -1
- package/dist/chunk-VV4N5P64.js +0 -1
- package/dist/chunk-W3I423PS.js +0 -1
- package/dist/chunk-WJR24TAG.js +0 -1
- package/dist/chunk-XTGKMHSW.js +0 -1
- package/dist/chunk-YBB7ZGTY.js +0 -1
- package/dist/chunk-Z4NPUARF.js +0 -1
- package/dist/chunk-ZGNQRPDT.js +0 -1
- package/dist/chunk-ZKPSFFKU.js +0 -1
- package/dist/chunk-ZLV5SQSX.js +0 -1
- package/dist/content-addressed-storage-4-ST1tYk.d.cts +0 -124
- package/dist/content-addressed-storage-DuYMjV7o.d.ts +0 -124
- package/dist/core/index.cjs +0 -1
- package/dist/core/index.d.cts +0 -3
- package/dist/core/index.d.ts +0 -3
- package/dist/core/index.js +0 -1
- package/dist/decay-BvOWTZ00.d.ts +0 -112
- package/dist/decay-CFlLvXUT.d.cts +0 -112
- package/dist/extra/browser.cjs +0 -1
- package/dist/extra/browser.d.cts +0 -4
- package/dist/extra/browser.d.ts +0 -4
- package/dist/extra/browser.js +0 -1
- package/dist/extra/index.cjs +0 -20
- package/dist/extra/index.d.cts +0 -17
- package/dist/extra/index.d.ts +0 -17
- package/dist/extra/index.js +0 -1
- package/dist/extra/node.cjs +0 -2
- package/dist/extra/node.js +0 -2
- package/dist/extra/operators.cjs +0 -1
- package/dist/extra/operators.d.cts +0 -958
- package/dist/extra/operators.d.ts +0 -958
- package/dist/extra/operators.js +0 -1
- package/dist/extra/reactive.cjs +0 -1
- package/dist/extra/reactive.d.cts +0 -353
- package/dist/extra/reactive.d.ts +0 -353
- package/dist/extra/reactive.js +0 -1
- package/dist/extra/render/index.cjs +0 -5
- package/dist/extra/render/index.js +0 -1
- package/dist/extra/sources.cjs +0 -3
- package/dist/extra/sources.js +0 -1
- package/dist/extra/storage-browser.cjs +0 -1
- package/dist/extra/storage-browser.d.cts +0 -37
- package/dist/extra/storage-browser.d.ts +0 -37
- package/dist/extra/storage-browser.js +0 -1
- package/dist/extra/storage-core.cjs +0 -1
- package/dist/extra/storage-core.d.cts +0 -28
- package/dist/extra/storage-core.d.ts +0 -28
- package/dist/extra/storage-core.js +0 -1
- package/dist/extra/storage-node.cjs +0 -1
- package/dist/extra/storage-node.d.cts +0 -2
- package/dist/extra/storage-node.d.ts +0 -2
- package/dist/extra/storage-node.js +0 -0
- package/dist/extra/storage-tiers-browser.cjs +0 -1
- package/dist/extra/storage-tiers-browser.d.cts +0 -120
- package/dist/extra/storage-tiers-browser.d.ts +0 -120
- package/dist/extra/storage-tiers-browser.js +0 -1
- package/dist/extra/storage-tiers-node.cjs +0 -1
- package/dist/extra/storage-tiers-node.d.cts +0 -210
- package/dist/extra/storage-tiers-node.d.ts +0 -210
- package/dist/extra/storage-tiers-node.js +0 -1
- package/dist/extra/storage-tiers.cjs +0 -1
- package/dist/extra/storage-tiers.d.cts +0 -412
- package/dist/extra/storage-tiers.d.ts +0 -412
- package/dist/extra/storage-tiers.js +0 -1
- package/dist/graph/index.cjs +0 -7
- package/dist/graph/index.d.cts +0 -7
- package/dist/graph/index.d.ts +0 -7
- package/dist/graph/index.js +0 -1
- package/dist/graph-CWvEUQAq.d.cts +0 -1861
- package/dist/graph-D9LFnda9.d.ts +0 -1861
- package/dist/index-5k1T6jl0.d.cts +0 -121
- package/dist/index-9770hRuQ.d.cts +0 -779
- package/dist/index-B1F8Enjf.d.ts +0 -704
- package/dist/index-BHskSB8v.d.ts +0 -3413
- package/dist/index-BIYAkbAi.d.cts +0 -26
- package/dist/index-BoJ5JHxI.d.ts +0 -557
- package/dist/index-BocU7pqs.d.ts +0 -779
- package/dist/index-BxNs2HB9.d.cts +0 -1858
- package/dist/index-C1T3d7V-.d.cts +0 -704
- package/dist/index-C5ri2Axc.d.cts +0 -301
- package/dist/index-C9l6OEBL.d.ts +0 -26
- package/dist/index-CC-AvFTy.d.cts +0 -557
- package/dist/index-CJF1URuX.d.ts +0 -121
- package/dist/index-CdTelp1M.d.ts +0 -202
- package/dist/index-Cj3WohTd.d.cts +0 -202
- package/dist/index-Co7uli2l.d.cts +0 -3413
- package/dist/index-D0aciIex.d.cts +0 -209
- package/dist/index-DHen9Klo.d.ts +0 -1858
- package/dist/index-Yq60JP3s.d.ts +0 -209
- package/dist/index-nozs3fFC.d.ts +0 -301
- package/dist/node-kK3CvTrR.d.cts +0 -1347
- package/dist/node-kK3CvTrR.d.ts +0 -1347
- package/dist/patterns/ai/browser.cjs +0 -8
- package/dist/patterns/ai/browser.js +0 -3
- package/dist/patterns/ai/index.cjs +0 -74
- package/dist/patterns/ai/index.d.cts +0 -20
- package/dist/patterns/ai/index.d.ts +0 -20
- package/dist/patterns/ai/index.js +0 -1
- package/dist/patterns/ai/node.cjs +0 -1
- package/dist/patterns/ai/node.js +0 -1
- package/dist/patterns/cqrs/index.cjs +0 -3
- package/dist/patterns/cqrs/index.d.cts +0 -8
- package/dist/patterns/cqrs/index.d.ts +0 -8
- package/dist/patterns/cqrs/index.js +0 -1
- package/dist/patterns/demo-shell/index.cjs +0 -5
- package/dist/patterns/demo-shell/index.d.cts +0 -7
- package/dist/patterns/demo-shell/index.d.ts +0 -7
- package/dist/patterns/demo-shell/index.js +0 -1
- package/dist/patterns/domain-templates/index.cjs +0 -3
- package/dist/patterns/domain-templates/index.d.cts +0 -6
- package/dist/patterns/domain-templates/index.d.ts +0 -6
- package/dist/patterns/domain-templates/index.js +0 -1
- package/dist/patterns/graphspec/index.cjs +0 -86
- package/dist/patterns/graphspec/index.d.cts +0 -8
- package/dist/patterns/graphspec/index.d.ts +0 -8
- package/dist/patterns/graphspec/index.js +0 -1
- package/dist/patterns/harness/index.cjs +0 -48
- package/dist/patterns/harness/index.d.cts +0 -13
- package/dist/patterns/harness/index.d.ts +0 -13
- package/dist/patterns/harness/index.js +0 -1
- package/dist/patterns/inspect/index.cjs +0 -3
- package/dist/patterns/inspect/index.d.cts +0 -9
- package/dist/patterns/inspect/index.d.ts +0 -9
- package/dist/patterns/inspect/index.js +0 -1
- package/dist/patterns/job-queue/index.cjs +0 -3
- package/dist/patterns/job-queue/index.d.cts +0 -9
- package/dist/patterns/job-queue/index.d.ts +0 -9
- package/dist/patterns/job-queue/index.js +0 -1
- package/dist/patterns/memory/index.cjs +0 -3
- package/dist/patterns/memory/index.d.cts +0 -8
- package/dist/patterns/memory/index.d.ts +0 -8
- package/dist/patterns/memory/index.js +0 -1
- package/dist/patterns/messaging/index.cjs +0 -3
- package/dist/patterns/messaging/index.d.cts +0 -7
- package/dist/patterns/messaging/index.d.ts +0 -7
- package/dist/patterns/messaging/index.js +0 -1
- package/dist/patterns/orchestration/index.cjs +0 -3
- package/dist/patterns/orchestration/index.d.cts +0 -8
- package/dist/patterns/orchestration/index.d.ts +0 -8
- package/dist/patterns/orchestration/index.js +0 -1
- package/dist/patterns/process/index.cjs +0 -3
- package/dist/patterns/process/index.d.cts +0 -10
- package/dist/patterns/process/index.d.ts +0 -10
- package/dist/patterns/process/index.js +0 -1
- package/dist/patterns/reactive-layout/index.cjs +0 -4
- package/dist/patterns/reactive-layout/index.d.cts +0 -7
- package/dist/patterns/reactive-layout/index.d.ts +0 -7
- package/dist/patterns/reactive-layout/index.js +0 -1
- package/dist/patterns/reduction/index.cjs +0 -3
- package/dist/patterns/reduction/index.d.cts +0 -6
- package/dist/patterns/reduction/index.d.ts +0 -6
- package/dist/patterns/reduction/index.js +0 -1
- package/dist/patterns/surface/index.cjs +0 -13
- package/dist/patterns/surface/index.d.cts +0 -9
- package/dist/patterns/surface/index.d.ts +0 -9
- package/dist/patterns/surface/index.js +0 -1
- package/dist/reactive-log-BKALbfal.d.ts +0 -223
- package/dist/reactive-log-DIGdYqQ6.d.cts +0 -223
- package/dist/reactive-map-CEFGp8TK.d.cts +0 -296
- package/dist/reactive-map-DS_SIAxv.d.ts +0 -296
- package/dist/resilience-6LYQJAC5.js +0 -1
- package/dist/sugar-DQjFmVqb.d.cts +0 -399
- package/dist/sugar-fhLIE7TT.d.ts +0 -399
- package/dist/topology-tree-Bcz27hpF.d.cts +0 -25
- package/dist/topology-tree-xvaD0fOX.d.ts +0 -25
|
@@ -0,0 +1,717 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/job-queue/index.ts
|
|
21
|
+
var job_queue_exports = {};
|
|
22
|
+
__export(job_queue_exports, {
|
|
23
|
+
JobFlowGraph: () => JobFlowGraph,
|
|
24
|
+
JobQueueGraph: () => JobQueueGraph,
|
|
25
|
+
jobEventKeyOf: () => jobEventKeyOf,
|
|
26
|
+
jobFlow: () => jobFlow,
|
|
27
|
+
jobQueue: () => jobQueue
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(job_queue_exports);
|
|
30
|
+
var import_core2 = require("@graphrefly/pure-ts/core");
|
|
31
|
+
var import_extra2 = require("@graphrefly/pure-ts/extra");
|
|
32
|
+
var import_graph2 = require("@graphrefly/pure-ts/graph");
|
|
33
|
+
|
|
34
|
+
// src/base/meta/domain-meta.ts
|
|
35
|
+
function domainMeta(domain, kind, extra) {
|
|
36
|
+
return {
|
|
37
|
+
[domain]: true,
|
|
38
|
+
[`${domain}_type`]: kind,
|
|
39
|
+
...extra ?? {}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/base/mutation/index.ts
|
|
44
|
+
var import_core = require("@graphrefly/pure-ts/core");
|
|
45
|
+
var import_extra = require("@graphrefly/pure-ts/extra");
|
|
46
|
+
var import_graph = require("@graphrefly/pure-ts/graph");
|
|
47
|
+
var DEFAULT_AUDIT_GUARD = (0, import_core.policy)((allow, deny) => {
|
|
48
|
+
allow("observe");
|
|
49
|
+
allow("signal");
|
|
50
|
+
deny("write");
|
|
51
|
+
});
|
|
52
|
+
function createAuditLog(opts) {
|
|
53
|
+
const log = (0, import_extra.reactiveLog)([], {
|
|
54
|
+
name: opts.name,
|
|
55
|
+
maxSize: opts.retainedLimit ?? 1024,
|
|
56
|
+
guard: opts.guard ?? DEFAULT_AUDIT_GUARD,
|
|
57
|
+
...opts.versioning != null ? { versioning: opts.versioning } : {}
|
|
58
|
+
});
|
|
59
|
+
log.withLatest();
|
|
60
|
+
if (opts.graph) {
|
|
61
|
+
opts.graph.add(log.entries, { name: opts.name });
|
|
62
|
+
}
|
|
63
|
+
return log;
|
|
64
|
+
}
|
|
65
|
+
function deepFreeze(value) {
|
|
66
|
+
if (value === null || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
67
|
+
for (const k of Object.keys(value)) {
|
|
68
|
+
deepFreeze(value[k]);
|
|
69
|
+
}
|
|
70
|
+
return Object.freeze(value);
|
|
71
|
+
}
|
|
72
|
+
function mutate(act, opts) {
|
|
73
|
+
const { up, down } = typeof act === "function" ? { up: act, down: void 0 } : act;
|
|
74
|
+
const freeze = opts.freeze ?? true;
|
|
75
|
+
if (opts.frame === "inline") {
|
|
76
|
+
return function wrapped(...args) {
|
|
77
|
+
const sealed = freeze ? args.map(deepFreeze) : args;
|
|
78
|
+
const t_ns = (0, import_core.wallClockNs)();
|
|
79
|
+
const seq = opts.seq ? bumpCursor(opts.seq) : void 0;
|
|
80
|
+
try {
|
|
81
|
+
const result = up(...sealed);
|
|
82
|
+
if (opts.log && opts.onSuccessRecord) {
|
|
83
|
+
appendAudit(
|
|
84
|
+
opts.log,
|
|
85
|
+
opts.onSuccessRecord,
|
|
86
|
+
sealed,
|
|
87
|
+
result,
|
|
88
|
+
{ t_ns, seq },
|
|
89
|
+
opts.handlerVersion
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
} catch (err) {
|
|
94
|
+
if (opts.log && opts.onFailureRecord) {
|
|
95
|
+
const errorType = err instanceof Error ? err.name : typeof err;
|
|
96
|
+
appendAudit(
|
|
97
|
+
opts.log,
|
|
98
|
+
opts.onFailureRecord,
|
|
99
|
+
sealed,
|
|
100
|
+
err,
|
|
101
|
+
{ t_ns, seq, errorType },
|
|
102
|
+
opts.handlerVersion
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
throw err;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
return function wrapped(...args) {
|
|
110
|
+
const sealed = freeze ? args.map(deepFreeze) : args;
|
|
111
|
+
const t_ns = (0, import_core.wallClockNs)();
|
|
112
|
+
let result;
|
|
113
|
+
let captured;
|
|
114
|
+
let captureSet = false;
|
|
115
|
+
let seq;
|
|
116
|
+
try {
|
|
117
|
+
(0, import_core.batch)(() => {
|
|
118
|
+
if (opts.seq) seq = bumpCursor(opts.seq);
|
|
119
|
+
try {
|
|
120
|
+
result = up(...sealed);
|
|
121
|
+
if (opts.log && opts.onSuccessRecord) {
|
|
122
|
+
appendAudit(
|
|
123
|
+
opts.log,
|
|
124
|
+
opts.onSuccessRecord,
|
|
125
|
+
sealed,
|
|
126
|
+
result,
|
|
127
|
+
{ t_ns, seq },
|
|
128
|
+
opts.handlerVersion
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
} catch (err) {
|
|
132
|
+
captured = err;
|
|
133
|
+
captureSet = true;
|
|
134
|
+
throw err;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
} catch (outerErr) {
|
|
138
|
+
if (captureSet && down) {
|
|
139
|
+
try {
|
|
140
|
+
down(...sealed);
|
|
141
|
+
} catch (downErr) {
|
|
142
|
+
console.error(
|
|
143
|
+
`mutate: down hook threw \u2014 original action error preserved (${captured instanceof Error ? captured.name : typeof captured}). Down error:`,
|
|
144
|
+
downErr
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (captureSet && opts.log && opts.onFailureRecord) {
|
|
149
|
+
const errorType = captured instanceof Error ? captured.name : typeof captured;
|
|
150
|
+
appendAudit(
|
|
151
|
+
opts.log,
|
|
152
|
+
opts.onFailureRecord,
|
|
153
|
+
sealed,
|
|
154
|
+
captured,
|
|
155
|
+
{ t_ns, seq, errorType },
|
|
156
|
+
opts.handlerVersion
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
throw captureSet ? captured : outerErr;
|
|
160
|
+
}
|
|
161
|
+
return result;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
var _bumpCursorWarned = /* @__PURE__ */ new WeakSet();
|
|
165
|
+
function bumpCursor(seq) {
|
|
166
|
+
const raw = seq.cache;
|
|
167
|
+
const valid = typeof raw === "number" && Number.isFinite(raw);
|
|
168
|
+
if (!valid && raw !== void 0 && !_bumpCursorWarned.has(seq)) {
|
|
169
|
+
_bumpCursorWarned.add(seq);
|
|
170
|
+
console.warn(
|
|
171
|
+
`bumpCursor: cursor cache held a non-numeric value (${String(raw)}); resetting to 0. Causes include: a snapshot codec round-tripping the cursor as a string / null / NaN, OR a malformed initial seed (e.g. state<number>(NaN)). Audit consumers may see colliding seq values after this point.`
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
const cur = valid ? raw : 0;
|
|
175
|
+
const next = cur + 1;
|
|
176
|
+
seq.down([[import_core.DIRTY], [import_core.DATA, next]]);
|
|
177
|
+
return next;
|
|
178
|
+
}
|
|
179
|
+
function appendAudit(audit, builder, args, value, meta, handlerVersion) {
|
|
180
|
+
const record = builder(args, value, meta);
|
|
181
|
+
if (record === void 0) return;
|
|
182
|
+
const stamped = handlerVersion != null ? { ...record, handlerVersion } : record;
|
|
183
|
+
audit.append(stamped);
|
|
184
|
+
}
|
|
185
|
+
function registerCursor(graph, name, initial = 0) {
|
|
186
|
+
const cursor = (0, import_core.node)([], { initial, name, describeKind: "state" });
|
|
187
|
+
graph.add(cursor, { name });
|
|
188
|
+
return cursor;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// src/utils/job-queue/index.ts
|
|
192
|
+
var DEFAULT_MAX_PER_PUMP = 256;
|
|
193
|
+
var DEFAULT_COMPLETED_RETAINED_LIMIT = 1024;
|
|
194
|
+
function requireNonNegativeInt(value, label) {
|
|
195
|
+
if (!Number.isFinite(value) || !Number.isInteger(value) || value < 0) {
|
|
196
|
+
throw new Error(`${label} must be a non-negative integer`);
|
|
197
|
+
}
|
|
198
|
+
return value;
|
|
199
|
+
}
|
|
200
|
+
function jobQueueMeta(kind, extra) {
|
|
201
|
+
return domainMeta("job_queue", kind, extra);
|
|
202
|
+
}
|
|
203
|
+
var jobEventKeyOf = (e) => e.action;
|
|
204
|
+
var JobQueueGraph = class extends import_graph2.Graph {
|
|
205
|
+
_pending;
|
|
206
|
+
_jobs;
|
|
207
|
+
_seqCursor;
|
|
208
|
+
pending;
|
|
209
|
+
jobs;
|
|
210
|
+
depth;
|
|
211
|
+
/** Audit log of every queue mutation (Audit 2). */
|
|
212
|
+
events;
|
|
213
|
+
/** Alias for {@link JobQueueGraph.events} — Audit 2 `.audit` duplication. */
|
|
214
|
+
audit;
|
|
215
|
+
// Tier 8 / COMPOSITION-GUIDE §35: mutate wrappers for the four
|
|
216
|
+
// single-record mutation methods. Assigned in the constructor (NOT via
|
|
217
|
+
// class-field initializers) because field initializers run before the
|
|
218
|
+
// constructor body — `this.events` and `this._seqCursor` aren't ready yet.
|
|
219
|
+
// `claim` stays inline because it emits one record per claimed job.
|
|
220
|
+
_enqueueImpl;
|
|
221
|
+
_ackImpl;
|
|
222
|
+
_nackImpl;
|
|
223
|
+
_removeByIdImpl;
|
|
224
|
+
constructor(name, opts = {}) {
|
|
225
|
+
super(name, opts.graph);
|
|
226
|
+
this._pending = (0, import_extra2.reactiveList)([], { name: "pending" });
|
|
227
|
+
this._jobs = (0, import_extra2.reactiveMap)({ name: "jobs" });
|
|
228
|
+
this.pending = this._pending.items;
|
|
229
|
+
this.jobs = this._jobs.entries;
|
|
230
|
+
this.add(this.pending, { name: "pending" });
|
|
231
|
+
this.add(this.jobs, { name: "jobs" });
|
|
232
|
+
this.depth = (0, import_core2.node)(
|
|
233
|
+
[this.pending],
|
|
234
|
+
(batchData, actions, ctx) => {
|
|
235
|
+
const data = batchData.map(
|
|
236
|
+
(batch3, i) => batch3 != null && batch3.length > 0 ? batch3.at(-1) : ctx.prevData[i]
|
|
237
|
+
);
|
|
238
|
+
actions.emit(data[0].length);
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
name: "depth",
|
|
242
|
+
describeKind: "derived",
|
|
243
|
+
meta: jobQueueMeta("queue_depth"),
|
|
244
|
+
initial: 0
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
this.add(this.depth, { name: "depth" });
|
|
248
|
+
this.addDisposer((0, import_extra2.keepalive)(this.depth));
|
|
249
|
+
this.events = createAuditLog({
|
|
250
|
+
name: "events",
|
|
251
|
+
retainedLimit: 1024,
|
|
252
|
+
graph: this
|
|
253
|
+
});
|
|
254
|
+
this.audit = this.events;
|
|
255
|
+
this._seqCursor = registerCursor(this, "seq", 0);
|
|
256
|
+
this._enqueueImpl = mutate(
|
|
257
|
+
(payload, enqueueOpts) => {
|
|
258
|
+
const seq = this._seqCursor.cache;
|
|
259
|
+
const id = enqueueOpts.id ?? `${this.name}-${seq}`;
|
|
260
|
+
if (this._jobs.get(id) !== void 0) {
|
|
261
|
+
throw new Error(`jobQueue("${this.name}"): duplicate job id "${id}"`);
|
|
262
|
+
}
|
|
263
|
+
const job = {
|
|
264
|
+
id,
|
|
265
|
+
payload,
|
|
266
|
+
attempts: 0,
|
|
267
|
+
metadata: Object.freeze({ ...enqueueOpts.metadata ?? {} }),
|
|
268
|
+
state: "queued"
|
|
269
|
+
};
|
|
270
|
+
this._jobs.set(id, job);
|
|
271
|
+
this._pending.append(id);
|
|
272
|
+
return id;
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
frame: "inline",
|
|
276
|
+
log: this.events,
|
|
277
|
+
seq: this._seqCursor,
|
|
278
|
+
freeze: false,
|
|
279
|
+
onSuccessRecord: ([payload], id, { t_ns, seq }) => ({
|
|
280
|
+
action: "enqueue",
|
|
281
|
+
id,
|
|
282
|
+
payload,
|
|
283
|
+
t_ns,
|
|
284
|
+
seq: seq ?? 0
|
|
285
|
+
})
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
this._ackImpl = mutate(
|
|
289
|
+
(id, _job) => {
|
|
290
|
+
this._jobs.delete(id);
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
frame: "inline",
|
|
294
|
+
log: this.events,
|
|
295
|
+
seq: this._seqCursor,
|
|
296
|
+
freeze: false,
|
|
297
|
+
onSuccessRecord: ([id, job], _r, { t_ns, seq }) => ({
|
|
298
|
+
action: "ack",
|
|
299
|
+
id,
|
|
300
|
+
attempts: job.attempts,
|
|
301
|
+
t_ns,
|
|
302
|
+
seq: seq ?? 0
|
|
303
|
+
})
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
this._nackImpl = mutate(
|
|
307
|
+
(id, job, requeue) => {
|
|
308
|
+
if (requeue) {
|
|
309
|
+
this._jobs.set(id, { ...job, state: "queued" });
|
|
310
|
+
this._pending.append(id);
|
|
311
|
+
} else {
|
|
312
|
+
this._jobs.delete(id);
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
frame: "inline",
|
|
317
|
+
log: this.events,
|
|
318
|
+
seq: this._seqCursor,
|
|
319
|
+
freeze: false,
|
|
320
|
+
onSuccessRecord: ([id, job], _r, { t_ns, seq }) => ({
|
|
321
|
+
action: "nack",
|
|
322
|
+
id,
|
|
323
|
+
attempts: job.attempts,
|
|
324
|
+
t_ns,
|
|
325
|
+
seq: seq ?? 0
|
|
326
|
+
})
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
this._removeByIdImpl = mutate(
|
|
330
|
+
(id, job) => {
|
|
331
|
+
if (job.state === "queued") {
|
|
332
|
+
const pending = this.pending.cache;
|
|
333
|
+
const idx = pending.indexOf(id);
|
|
334
|
+
if (idx >= 0) this._pending.pop(idx);
|
|
335
|
+
}
|
|
336
|
+
this._jobs.delete(id);
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
frame: "inline",
|
|
340
|
+
log: this.events,
|
|
341
|
+
seq: this._seqCursor,
|
|
342
|
+
freeze: false,
|
|
343
|
+
onSuccessRecord: ([id, job], _r, { t_ns, seq }) => ({
|
|
344
|
+
action: "remove",
|
|
345
|
+
id,
|
|
346
|
+
attempts: job.attempts,
|
|
347
|
+
t_ns,
|
|
348
|
+
seq: seq ?? 0
|
|
349
|
+
})
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Wire append-log storage tiers (Audit 4). Returns a disposer.
|
|
355
|
+
*
|
|
356
|
+
* Named `attachEventStorage` to avoid colliding with {@link Graph.attachSnapshotStorage}.
|
|
357
|
+
*/
|
|
358
|
+
attachEventStorage(tiers) {
|
|
359
|
+
return this.events.attachStorage(tiers);
|
|
360
|
+
}
|
|
361
|
+
enqueue(payload, opts = {}) {
|
|
362
|
+
return this._enqueueImpl(payload, opts);
|
|
363
|
+
}
|
|
364
|
+
claim(limit = 1) {
|
|
365
|
+
const max = requireNonNegativeInt(limit, "job queue claim limit");
|
|
366
|
+
if (max === 0) return [];
|
|
367
|
+
const out = [];
|
|
368
|
+
while (out.length < max) {
|
|
369
|
+
const ids = this.pending.cache;
|
|
370
|
+
if (ids.length === 0) break;
|
|
371
|
+
const id = this._pending.pop(0);
|
|
372
|
+
const job = this._jobs.get(id);
|
|
373
|
+
if (!job || job.state !== "queued") continue;
|
|
374
|
+
const inflight = {
|
|
375
|
+
...job,
|
|
376
|
+
state: "inflight",
|
|
377
|
+
attempts: job.attempts + 1
|
|
378
|
+
};
|
|
379
|
+
this._jobs.set(id, inflight);
|
|
380
|
+
out.push(inflight);
|
|
381
|
+
this.events.append({
|
|
382
|
+
action: "claim",
|
|
383
|
+
id,
|
|
384
|
+
attempts: inflight.attempts,
|
|
385
|
+
t_ns: (0, import_core2.wallClockNs)(),
|
|
386
|
+
seq: bumpCursor(this._seqCursor)
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
return out;
|
|
390
|
+
}
|
|
391
|
+
ack(id) {
|
|
392
|
+
const job = this._jobs.get(id);
|
|
393
|
+
if (!job || job.state !== "inflight") return false;
|
|
394
|
+
this._ackImpl(id, job);
|
|
395
|
+
return true;
|
|
396
|
+
}
|
|
397
|
+
nack(id, opts = {}) {
|
|
398
|
+
const job = this._jobs.get(id);
|
|
399
|
+
if (!job || job.state !== "inflight") return false;
|
|
400
|
+
this._nackImpl(id, job, opts.requeue ?? true);
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Remove a job by id regardless of its current state. Returns `true` if
|
|
405
|
+
* the job existed and was removed, `false` if no job has this id.
|
|
406
|
+
*
|
|
407
|
+
* `ack` only works on inflight; `nack` only works on inflight.
|
|
408
|
+
* `removeById` is the state-agnostic escape hatch — useful for
|
|
409
|
+
* audit/observability layers that enqueue but never claim, and need to
|
|
410
|
+
* finalize a job when an external decision (e.g. harness verify
|
|
411
|
+
* outcome) resolves it. Distinct name from the inherited
|
|
412
|
+
* {@link Graph.remove}, which removes a mounted child subgraph by path.
|
|
413
|
+
*
|
|
414
|
+
* When the job is in `queued` state, its id is also pulled from the
|
|
415
|
+
* `pending` list — depth + pending snapshot stay consistent.
|
|
416
|
+
*/
|
|
417
|
+
removeById(id) {
|
|
418
|
+
const job = this._jobs.get(id);
|
|
419
|
+
if (!job) return false;
|
|
420
|
+
this._removeByIdImpl(id, job);
|
|
421
|
+
return true;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Subscribe to a Node and enqueue each DATA payload into this queue.
|
|
425
|
+
* Returns a disposer that stops consuming when called.
|
|
426
|
+
*
|
|
427
|
+
* Used internally by {@link JobFlowGraph} for stage-to-stage wiring but
|
|
428
|
+
* also useful for users wiring an external source into a job queue.
|
|
429
|
+
*
|
|
430
|
+
* @param source - Node whose DATA values are enqueued.
|
|
431
|
+
* @param opts - Optional enqueue options (id generator, metadata prefix).
|
|
432
|
+
*/
|
|
433
|
+
consumeFrom(source, opts) {
|
|
434
|
+
return source.subscribe((msgs) => {
|
|
435
|
+
for (const m of msgs) {
|
|
436
|
+
if (m[0] !== import_core2.DATA) continue;
|
|
437
|
+
const payload = m[1];
|
|
438
|
+
this.enqueue(payload, opts ? { metadata: opts.metadata } : void 0);
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
var JobFlowGraph = class extends import_graph2.Graph {
|
|
444
|
+
_stageNames;
|
|
445
|
+
_stageWorkFns;
|
|
446
|
+
_queues = /* @__PURE__ */ new Map();
|
|
447
|
+
_completed;
|
|
448
|
+
completed;
|
|
449
|
+
completedCount;
|
|
450
|
+
constructor(name, opts = {}) {
|
|
451
|
+
super(name, opts.graph);
|
|
452
|
+
const rawStages = opts.stages ?? ["incoming", "processing", "done"];
|
|
453
|
+
const stageNames = [];
|
|
454
|
+
const stageWorkFns = /* @__PURE__ */ new Map();
|
|
455
|
+
const stageMaxPerPump = /* @__PURE__ */ new Map();
|
|
456
|
+
const stageMaxInflight = /* @__PURE__ */ new Map();
|
|
457
|
+
for (const raw of rawStages) {
|
|
458
|
+
const stageName = typeof raw === "string" ? raw.trim() : raw.name.trim();
|
|
459
|
+
if (typeof raw !== "string" && raw.work) {
|
|
460
|
+
stageWorkFns.set(stageName, raw.work);
|
|
461
|
+
}
|
|
462
|
+
if (typeof raw !== "string" && raw.maxPerPump != null) {
|
|
463
|
+
stageMaxPerPump.set(
|
|
464
|
+
stageName,
|
|
465
|
+
Math.max(
|
|
466
|
+
1,
|
|
467
|
+
requireNonNegativeInt(raw.maxPerPump, `job flow stage "${stageName}" maxPerPump`)
|
|
468
|
+
)
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
if (typeof raw !== "string" && raw.maxInflight != null) {
|
|
472
|
+
stageMaxInflight.set(
|
|
473
|
+
stageName,
|
|
474
|
+
Math.max(
|
|
475
|
+
1,
|
|
476
|
+
requireNonNegativeInt(raw.maxInflight, `job flow stage "${stageName}" maxInflight`)
|
|
477
|
+
)
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
stageNames.push(stageName);
|
|
481
|
+
}
|
|
482
|
+
if (stageNames.length < 2) {
|
|
483
|
+
throw new Error(`jobFlow("${name}"): requires at least 2 stages`);
|
|
484
|
+
}
|
|
485
|
+
const unique = new Set(stageNames);
|
|
486
|
+
if (unique.size !== stageNames.length) {
|
|
487
|
+
throw new Error(`jobFlow("${name}"): stage names must be unique`);
|
|
488
|
+
}
|
|
489
|
+
this._stageNames = Object.freeze([...stageNames]);
|
|
490
|
+
this._stageWorkFns = stageWorkFns;
|
|
491
|
+
for (const stage of this._stageNames) {
|
|
492
|
+
const q = jobQueue(`${name}-${stage}`);
|
|
493
|
+
this._queues.set(stage, q);
|
|
494
|
+
this.mount(stage, q);
|
|
495
|
+
}
|
|
496
|
+
this._completed = (0, import_extra2.reactiveLog)([], {
|
|
497
|
+
name: "completed",
|
|
498
|
+
maxSize: DEFAULT_COMPLETED_RETAINED_LIMIT
|
|
499
|
+
});
|
|
500
|
+
this.completed = this._completed.entries;
|
|
501
|
+
this.add(this.completed, { name: "completed" });
|
|
502
|
+
this.completedCount = (0, import_core2.node)(
|
|
503
|
+
[this.completed],
|
|
504
|
+
(batchData, actions, ctx) => {
|
|
505
|
+
const data = batchData.map(
|
|
506
|
+
(batch3, i) => batch3 != null && batch3.length > 0 ? batch3.at(-1) : ctx.prevData[i]
|
|
507
|
+
);
|
|
508
|
+
actions.emit(data[0].length);
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
name: "completedCount",
|
|
512
|
+
describeKind: "derived",
|
|
513
|
+
meta: jobQueueMeta("job_flow_completed_count"),
|
|
514
|
+
initial: 0
|
|
515
|
+
}
|
|
516
|
+
);
|
|
517
|
+
this.add(this.completedCount, { name: "completedCount" });
|
|
518
|
+
this.addDisposer((0, import_extra2.keepalive)(this.completedCount));
|
|
519
|
+
const defaultMaxPerPump = Math.max(
|
|
520
|
+
1,
|
|
521
|
+
requireNonNegativeInt(opts.maxPerPump ?? DEFAULT_MAX_PER_PUMP, "job flow maxPerPump")
|
|
522
|
+
);
|
|
523
|
+
for (let i = 0; i < this._stageNames.length; i += 1) {
|
|
524
|
+
const stage = this._stageNames[i];
|
|
525
|
+
const current = this.queue(stage);
|
|
526
|
+
const next = i + 1 < this._stageNames.length ? this.queue(this._stageNames[i + 1]) : null;
|
|
527
|
+
const workFn = this._stageWorkFns.get(stage);
|
|
528
|
+
const stagePerPump = stageMaxPerPump.get(stage) ?? defaultMaxPerPump;
|
|
529
|
+
const stageMaxInflightCap = stageMaxInflight.get(stage);
|
|
530
|
+
const inflightCounter = stageMaxInflightCap !== void 0 ? (0, import_core2.node)([], { name: `__inflight__/${stage}`, initial: 0 }) : null;
|
|
531
|
+
if (inflightCounter) {
|
|
532
|
+
this.add(inflightCounter, { name: `__inflight__/${stage}` });
|
|
533
|
+
}
|
|
534
|
+
const isTerminal = next === null;
|
|
535
|
+
if (workFn) {
|
|
536
|
+
const pumpDeps = inflightCounter != null ? [current.pending, inflightCounter] : [current.pending];
|
|
537
|
+
const pump = (0, import_core2.node)(
|
|
538
|
+
pumpDeps,
|
|
539
|
+
(_data, _actions, ctx) => {
|
|
540
|
+
if (!("inflight" in ctx.store)) {
|
|
541
|
+
ctx.store.inflight = {
|
|
542
|
+
entries: /* @__PURE__ */ new Set(),
|
|
543
|
+
terminated: false
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
const inflightStore = ctx.store.inflight;
|
|
547
|
+
const inflight = inflightStore.entries;
|
|
548
|
+
let processed = 0;
|
|
549
|
+
while (processed < stagePerPump) {
|
|
550
|
+
if (stageMaxInflightCap !== void 0 && inflight.size >= stageMaxInflightCap) {
|
|
551
|
+
break;
|
|
552
|
+
}
|
|
553
|
+
const claims = current.claim(1);
|
|
554
|
+
if (claims.length === 0) break;
|
|
555
|
+
const job = claims[0];
|
|
556
|
+
if (!job) break;
|
|
557
|
+
const prevPath = job.metadata.job_flow_path ?? [];
|
|
558
|
+
const newPath = [...prevPath, stage];
|
|
559
|
+
const ac = new AbortController();
|
|
560
|
+
const entry = { unsub: () => void 0, ac };
|
|
561
|
+
inflight.add(entry);
|
|
562
|
+
inflightCounter?.emit(inflight.size);
|
|
563
|
+
let result;
|
|
564
|
+
try {
|
|
565
|
+
result = workFn(job, { signal: ac.signal });
|
|
566
|
+
} catch {
|
|
567
|
+
inflight.delete(entry);
|
|
568
|
+
inflightCounter?.emit(inflight.size);
|
|
569
|
+
current.nack(job.id, { requeue: false });
|
|
570
|
+
processed += 1;
|
|
571
|
+
continue;
|
|
572
|
+
}
|
|
573
|
+
const resultNode = (0, import_extra2.fromAny)(result);
|
|
574
|
+
let settled = false;
|
|
575
|
+
let unsub;
|
|
576
|
+
const cleanupSub = () => {
|
|
577
|
+
if (unsub) {
|
|
578
|
+
unsub();
|
|
579
|
+
} else {
|
|
580
|
+
Promise.resolve().then(() => unsub?.());
|
|
581
|
+
}
|
|
582
|
+
inflight.delete(entry);
|
|
583
|
+
if (!inflightStore.terminated) {
|
|
584
|
+
inflightCounter?.emit(inflight.size);
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
unsub = resultNode.subscribe((msgs) => {
|
|
588
|
+
if (settled) return;
|
|
589
|
+
for (const m of msgs) {
|
|
590
|
+
if (m[0] === import_core2.DATA) {
|
|
591
|
+
settled = true;
|
|
592
|
+
cleanupSub();
|
|
593
|
+
const newPayload = m[1];
|
|
594
|
+
const newMetadata = {
|
|
595
|
+
...job.metadata,
|
|
596
|
+
job_flow_path: newPath
|
|
597
|
+
};
|
|
598
|
+
if (isTerminal) {
|
|
599
|
+
const completedJob = {
|
|
600
|
+
...job,
|
|
601
|
+
payload: newPayload,
|
|
602
|
+
metadata: Object.freeze(newMetadata)
|
|
603
|
+
};
|
|
604
|
+
(0, import_core2.batch)(() => {
|
|
605
|
+
current.ack(job.id);
|
|
606
|
+
this._completed.append(completedJob);
|
|
607
|
+
});
|
|
608
|
+
} else {
|
|
609
|
+
(0, import_core2.batch)(() => {
|
|
610
|
+
current.ack(job.id);
|
|
611
|
+
next.enqueue(newPayload, {
|
|
612
|
+
metadata: newMetadata
|
|
613
|
+
});
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
return;
|
|
617
|
+
} else if (m[0] === import_core2.ERROR) {
|
|
618
|
+
settled = true;
|
|
619
|
+
cleanupSub();
|
|
620
|
+
current.nack(job.id, { requeue: false });
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
entry.unsub = () => unsub?.();
|
|
626
|
+
processed += 1;
|
|
627
|
+
}
|
|
628
|
+
return {
|
|
629
|
+
onDeactivation: () => {
|
|
630
|
+
inflightStore.terminated = true;
|
|
631
|
+
for (const e of inflight) {
|
|
632
|
+
try {
|
|
633
|
+
e.ac.abort();
|
|
634
|
+
} catch {
|
|
635
|
+
}
|
|
636
|
+
try {
|
|
637
|
+
e.unsub();
|
|
638
|
+
} catch {
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
inflight.clear();
|
|
642
|
+
delete ctx.store.inflight;
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
meta: jobQueueMeta("job_flow_pump", { stage, has_work: true })
|
|
648
|
+
}
|
|
649
|
+
);
|
|
650
|
+
this.addDisposer((0, import_extra2.keepalive)(pump));
|
|
651
|
+
} else {
|
|
652
|
+
const pump = this.effect(
|
|
653
|
+
`pump_${stage}`,
|
|
654
|
+
[`${stage}::pending`],
|
|
655
|
+
() => {
|
|
656
|
+
let moved = 0;
|
|
657
|
+
while (moved < stagePerPump) {
|
|
658
|
+
const claim = current.claim(1);
|
|
659
|
+
if (claim.length === 0) break;
|
|
660
|
+
const job = claim[0];
|
|
661
|
+
if (!job) break;
|
|
662
|
+
const prevPath = job.metadata.job_flow_path ?? [];
|
|
663
|
+
const newPath = [...prevPath, stage];
|
|
664
|
+
const newMetadata = { ...job.metadata, job_flow_path: newPath };
|
|
665
|
+
if (isTerminal) {
|
|
666
|
+
const completedJob = {
|
|
667
|
+
...job,
|
|
668
|
+
metadata: Object.freeze(newMetadata)
|
|
669
|
+
};
|
|
670
|
+
(0, import_core2.batch)(() => {
|
|
671
|
+
current.ack(job.id);
|
|
672
|
+
this._completed.append(completedJob);
|
|
673
|
+
});
|
|
674
|
+
} else {
|
|
675
|
+
(0, import_core2.batch)(() => {
|
|
676
|
+
current.ack(job.id);
|
|
677
|
+
next.enqueue(job.payload, {
|
|
678
|
+
metadata: newMetadata
|
|
679
|
+
});
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
moved += 1;
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
meta: jobQueueMeta("job_flow_pump", { stage, has_work: false })
|
|
687
|
+
}
|
|
688
|
+
);
|
|
689
|
+
this.addDisposer((0, import_extra2.keepalive)(pump));
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
stages() {
|
|
694
|
+
return this._stageNames;
|
|
695
|
+
}
|
|
696
|
+
queue(stage) {
|
|
697
|
+
const q = this._queues.get(stage);
|
|
698
|
+
if (!q) throw new Error(`jobFlow("${this.name}"): unknown stage "${stage}"`);
|
|
699
|
+
return q;
|
|
700
|
+
}
|
|
701
|
+
enqueue(payload, opts = {}) {
|
|
702
|
+
return this.queue(this._stageNames[0]).enqueue(payload, opts);
|
|
703
|
+
}
|
|
704
|
+
retainedCompleted() {
|
|
705
|
+
return this.completed.cache;
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
function jobQueue(name, opts) {
|
|
709
|
+
return new JobQueueGraph(name, opts);
|
|
710
|
+
}
|
|
711
|
+
function jobFlow(name, opts) {
|
|
712
|
+
const g = new JobFlowGraph(name, opts);
|
|
713
|
+
const { factory: _f, factoryArgs: _fa, ...tagArgs } = opts ?? {};
|
|
714
|
+
g.tagFactory("jobFlow", (0, import_core2.placeholderArgs)(tagArgs));
|
|
715
|
+
return g;
|
|
716
|
+
}
|
|
717
|
+
//# sourceMappingURL=index.cjs.map
|