@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,1087 @@
|
|
|
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/presets/inspect/index.ts
|
|
21
|
+
var inspect_exports = {};
|
|
22
|
+
__export(inspect_exports, {
|
|
23
|
+
GuardedExecutionGraph: () => GuardedExecutionGraph,
|
|
24
|
+
InspectGraph: () => InspectGraph,
|
|
25
|
+
guardedExecution: () => guardedExecution,
|
|
26
|
+
inspect: () => inspect
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(inspect_exports);
|
|
29
|
+
|
|
30
|
+
// src/presets/inspect/composite.ts
|
|
31
|
+
var import_core5 = require("@graphrefly/pure-ts/core");
|
|
32
|
+
var import_graph6 = require("@graphrefly/pure-ts/graph");
|
|
33
|
+
|
|
34
|
+
// src/utils/inspect/audit.ts
|
|
35
|
+
var import_core3 = require("@graphrefly/pure-ts/core");
|
|
36
|
+
var import_extra3 = require("@graphrefly/pure-ts/extra");
|
|
37
|
+
var import_graph3 = require("@graphrefly/pure-ts/graph");
|
|
38
|
+
|
|
39
|
+
// src/base/meta/domain-meta.ts
|
|
40
|
+
function domainMeta(domain, kind, extra) {
|
|
41
|
+
return {
|
|
42
|
+
[domain]: true,
|
|
43
|
+
[`${domain}_type`]: kind,
|
|
44
|
+
...extra ?? {}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// src/utils/messaging/index.ts
|
|
49
|
+
var import_core2 = require("@graphrefly/pure-ts/core");
|
|
50
|
+
var import_extra2 = require("@graphrefly/pure-ts/extra");
|
|
51
|
+
var import_graph2 = require("@graphrefly/pure-ts/graph");
|
|
52
|
+
|
|
53
|
+
// src/base/mutation/index.ts
|
|
54
|
+
var import_core = require("@graphrefly/pure-ts/core");
|
|
55
|
+
var import_extra = require("@graphrefly/pure-ts/extra");
|
|
56
|
+
var import_graph = require("@graphrefly/pure-ts/graph");
|
|
57
|
+
var DEFAULT_AUDIT_GUARD = (0, import_core.policy)((allow, deny) => {
|
|
58
|
+
allow("observe");
|
|
59
|
+
allow("signal");
|
|
60
|
+
deny("write");
|
|
61
|
+
});
|
|
62
|
+
function deepFreeze(value) {
|
|
63
|
+
if (value === null || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
64
|
+
for (const k of Object.keys(value)) {
|
|
65
|
+
deepFreeze(value[k]);
|
|
66
|
+
}
|
|
67
|
+
return Object.freeze(value);
|
|
68
|
+
}
|
|
69
|
+
function mutate(act, opts) {
|
|
70
|
+
const { up, down } = typeof act === "function" ? { up: act, down: void 0 } : act;
|
|
71
|
+
const freeze = opts.freeze ?? true;
|
|
72
|
+
if (opts.frame === "inline") {
|
|
73
|
+
return function wrapped(...args) {
|
|
74
|
+
const sealed = freeze ? args.map(deepFreeze) : args;
|
|
75
|
+
const t_ns = (0, import_core.wallClockNs)();
|
|
76
|
+
const seq = opts.seq ? bumpCursor(opts.seq) : void 0;
|
|
77
|
+
try {
|
|
78
|
+
const result = up(...sealed);
|
|
79
|
+
if (opts.log && opts.onSuccessRecord) {
|
|
80
|
+
appendAudit(
|
|
81
|
+
opts.log,
|
|
82
|
+
opts.onSuccessRecord,
|
|
83
|
+
sealed,
|
|
84
|
+
result,
|
|
85
|
+
{ t_ns, seq },
|
|
86
|
+
opts.handlerVersion
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
} catch (err) {
|
|
91
|
+
if (opts.log && opts.onFailureRecord) {
|
|
92
|
+
const errorType = err instanceof Error ? err.name : typeof err;
|
|
93
|
+
appendAudit(
|
|
94
|
+
opts.log,
|
|
95
|
+
opts.onFailureRecord,
|
|
96
|
+
sealed,
|
|
97
|
+
err,
|
|
98
|
+
{ t_ns, seq, errorType },
|
|
99
|
+
opts.handlerVersion
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
throw err;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return function wrapped(...args) {
|
|
107
|
+
const sealed = freeze ? args.map(deepFreeze) : args;
|
|
108
|
+
const t_ns = (0, import_core.wallClockNs)();
|
|
109
|
+
let result;
|
|
110
|
+
let captured;
|
|
111
|
+
let captureSet = false;
|
|
112
|
+
let seq;
|
|
113
|
+
try {
|
|
114
|
+
(0, import_core.batch)(() => {
|
|
115
|
+
if (opts.seq) seq = bumpCursor(opts.seq);
|
|
116
|
+
try {
|
|
117
|
+
result = up(...sealed);
|
|
118
|
+
if (opts.log && opts.onSuccessRecord) {
|
|
119
|
+
appendAudit(
|
|
120
|
+
opts.log,
|
|
121
|
+
opts.onSuccessRecord,
|
|
122
|
+
sealed,
|
|
123
|
+
result,
|
|
124
|
+
{ t_ns, seq },
|
|
125
|
+
opts.handlerVersion
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
} catch (err) {
|
|
129
|
+
captured = err;
|
|
130
|
+
captureSet = true;
|
|
131
|
+
throw err;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
} catch (outerErr) {
|
|
135
|
+
if (captureSet && down) {
|
|
136
|
+
try {
|
|
137
|
+
down(...sealed);
|
|
138
|
+
} catch (downErr) {
|
|
139
|
+
console.error(
|
|
140
|
+
`mutate: down hook threw \u2014 original action error preserved (${captured instanceof Error ? captured.name : typeof captured}). Down error:`,
|
|
141
|
+
downErr
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (captureSet && opts.log && opts.onFailureRecord) {
|
|
146
|
+
const errorType = captured instanceof Error ? captured.name : typeof captured;
|
|
147
|
+
appendAudit(
|
|
148
|
+
opts.log,
|
|
149
|
+
opts.onFailureRecord,
|
|
150
|
+
sealed,
|
|
151
|
+
captured,
|
|
152
|
+
{ t_ns, seq, errorType },
|
|
153
|
+
opts.handlerVersion
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
throw captureSet ? captured : outerErr;
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
var _bumpCursorWarned = /* @__PURE__ */ new WeakSet();
|
|
162
|
+
function bumpCursor(seq) {
|
|
163
|
+
const raw = seq.cache;
|
|
164
|
+
const valid = typeof raw === "number" && Number.isFinite(raw);
|
|
165
|
+
if (!valid && raw !== void 0 && !_bumpCursorWarned.has(seq)) {
|
|
166
|
+
_bumpCursorWarned.add(seq);
|
|
167
|
+
console.warn(
|
|
168
|
+
`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.`
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
const cur = valid ? raw : 0;
|
|
172
|
+
const next = cur + 1;
|
|
173
|
+
seq.down([[import_core.DIRTY], [import_core.DATA, next]]);
|
|
174
|
+
return next;
|
|
175
|
+
}
|
|
176
|
+
function appendAudit(audit, builder, args, value, meta, handlerVersion) {
|
|
177
|
+
const record = builder(args, value, meta);
|
|
178
|
+
if (record === void 0) return;
|
|
179
|
+
const stamped = handlerVersion != null ? { ...record, handlerVersion } : record;
|
|
180
|
+
audit.append(stamped);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// src/utils/messaging/index.ts
|
|
184
|
+
function messagingMeta(kind, extra) {
|
|
185
|
+
return domainMeta("messaging", kind, extra);
|
|
186
|
+
}
|
|
187
|
+
var DEFAULT_TOPIC_RETAINED_LIMIT = 1024;
|
|
188
|
+
var TopicGraph = class extends import_graph2.Graph {
|
|
189
|
+
_log;
|
|
190
|
+
_publishImpl;
|
|
191
|
+
events;
|
|
192
|
+
/**
|
|
193
|
+
* Most recently published value. Stays in the protocol SENTINEL state
|
|
194
|
+
* (`cache === undefined`, no DATA emitted) until the first publish, then
|
|
195
|
+
* tracks the latest entry. Spec §5.12 reserves `undefined` as the
|
|
196
|
+
* "never sent DATA" sentinel — and `TopicGraph.publish(undefined)` is
|
|
197
|
+
* rejected — so `cache === undefined` unambiguously signals "empty topic"
|
|
198
|
+
* even when `T` itself includes `null` (i.e., `topic<number | null>`).
|
|
199
|
+
*
|
|
200
|
+
* **Within a reactive fn:** detect the empty-topic case via
|
|
201
|
+
* `ctx.prevData[i] === undefined` for the dep slot holding `topic.latest`,
|
|
202
|
+
* or check `latest.cache === undefined` outside reactive code. No
|
|
203
|
+
* separate `hasLatest` companion needed — the SENTINEL is the answer.
|
|
204
|
+
*/
|
|
205
|
+
latest;
|
|
206
|
+
constructor(name, opts = {}) {
|
|
207
|
+
super(name, opts.graph);
|
|
208
|
+
this._log = (0, import_extra2.reactiveLog)([], {
|
|
209
|
+
name: "events",
|
|
210
|
+
maxSize: opts.retainedLimit ?? DEFAULT_TOPIC_RETAINED_LIMIT
|
|
211
|
+
});
|
|
212
|
+
this.events = this._log.entries;
|
|
213
|
+
this.add(this.events, { name: "events" });
|
|
214
|
+
this.latest = this.derived(
|
|
215
|
+
"latest",
|
|
216
|
+
["events"],
|
|
217
|
+
(batchData, ctx) => {
|
|
218
|
+
const data = batchData.map(
|
|
219
|
+
(batch4, i) => batch4 != null && batch4.length > 0 ? batch4.at(-1) : ctx.prevData[i]
|
|
220
|
+
);
|
|
221
|
+
const entries = data[0];
|
|
222
|
+
return entries.length === 0 ? [] : [entries[entries.length - 1]];
|
|
223
|
+
},
|
|
224
|
+
{ meta: messagingMeta("topic_latest") }
|
|
225
|
+
);
|
|
226
|
+
this.addDisposer((0, import_extra2.keepalive)(this.latest));
|
|
227
|
+
this.addDisposer(() => {
|
|
228
|
+
this.events.down([[import_core2.COMPLETE]]);
|
|
229
|
+
});
|
|
230
|
+
this.addDisposer(() => this._log.disposeAllViews());
|
|
231
|
+
this._publishImpl = mutate(
|
|
232
|
+
(value) => {
|
|
233
|
+
this._log.append(value);
|
|
234
|
+
},
|
|
235
|
+
{ frame: "inline", freeze: false }
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
publish(value) {
|
|
239
|
+
if (value === void 0) {
|
|
240
|
+
throw new TypeError(
|
|
241
|
+
`TopicGraph "${this.name}": publish(undefined) is not allowed (spec \xA75.12 SENTINEL).`
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
this._publishImpl(value);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Wire one or more append-log storage tiers (Audit 4). Each tier receives
|
|
248
|
+
* appended events per wave; rollback honors the wave-as-transaction model.
|
|
249
|
+
*
|
|
250
|
+
* Named `attachEventStorage` (not `attachStorage`) to avoid colliding with
|
|
251
|
+
* the inherited {@link Graph.attachSnapshotStorage} which takes the
|
|
252
|
+
* paired `AttachSnapshotTierPair[]` shape (Phase 14.6) — distinct
|
|
253
|
+
* concerns, distinct surfaces.
|
|
254
|
+
*
|
|
255
|
+
* @returns Disposer.
|
|
256
|
+
*/
|
|
257
|
+
attachEventStorage(tiers) {
|
|
258
|
+
return this._log.attachStorage(tiers);
|
|
259
|
+
}
|
|
260
|
+
retained() {
|
|
261
|
+
return this.events.cache;
|
|
262
|
+
}
|
|
263
|
+
/** Internal log bundle — used by TopicBridgeGraph for `attach`. */
|
|
264
|
+
get _logBundle() {
|
|
265
|
+
return this._log;
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
// src/utils/inspect/audit.ts
|
|
270
|
+
function auditMeta(kind, extra) {
|
|
271
|
+
return domainMeta("audit", kind, extra);
|
|
272
|
+
}
|
|
273
|
+
var DEFAULT_INCLUDE_TYPES = /* @__PURE__ */ new Set([
|
|
274
|
+
"data",
|
|
275
|
+
"error",
|
|
276
|
+
"complete",
|
|
277
|
+
"teardown"
|
|
278
|
+
]);
|
|
279
|
+
var AuditTrailGraph = class extends import_graph3.Graph {
|
|
280
|
+
entries;
|
|
281
|
+
count;
|
|
282
|
+
/**
|
|
283
|
+
* Effective set of event types this trail records (EH-18). Reflects
|
|
284
|
+
* either the caller-supplied `opts.includeTypes` or the default set
|
|
285
|
+
* (`["data", "error", "complete", "teardown"]`). Captured at construction
|
|
286
|
+
* — each instance owns its own clone, so a default-using trail can never
|
|
287
|
+
* leak mutations into the module-level default set.
|
|
288
|
+
*
|
|
289
|
+
* **Mutation contract.** Type-system read-only via `ReadonlySet`. Runtime
|
|
290
|
+
* mutation through an unsafe cast (`(audit.includeTypes as Set<...>)
|
|
291
|
+
* .add(...)`) is unsupported — it would desync the field from the
|
|
292
|
+
* recording closure, which captured the original `Set` reference at
|
|
293
|
+
* construction. The runtime does NOT enforce immutability beyond the
|
|
294
|
+
* type contract; consumers must respect it.
|
|
295
|
+
*
|
|
296
|
+
* Use this to validate that a `complianceSnapshot.fingerprint` was
|
|
297
|
+
* computed against the same recording surface — fingerprints are stable
|
|
298
|
+
* only when the recording set is identical across snapshots.
|
|
299
|
+
*/
|
|
300
|
+
includeTypes;
|
|
301
|
+
_log;
|
|
302
|
+
_target;
|
|
303
|
+
constructor(target, opts) {
|
|
304
|
+
super(opts.name ?? `${target.name}_audit`, opts.graph);
|
|
305
|
+
this._target = target;
|
|
306
|
+
this._log = (0, import_extra3.reactiveLog)([], {
|
|
307
|
+
name: "entries",
|
|
308
|
+
...opts.maxSize != null ? { maxSize: opts.maxSize } : {}
|
|
309
|
+
});
|
|
310
|
+
this.entries = this._log.entries;
|
|
311
|
+
this.add(this.entries, { name: "entries" });
|
|
312
|
+
this.count = this.derived(
|
|
313
|
+
"count",
|
|
314
|
+
["entries"],
|
|
315
|
+
(batchData, ctx) => {
|
|
316
|
+
const data = batchData.map(
|
|
317
|
+
(batch4, i) => batch4 != null && batch4.length > 0 ? batch4.at(-1) : ctx.prevData[i]
|
|
318
|
+
);
|
|
319
|
+
return [data[0].length];
|
|
320
|
+
},
|
|
321
|
+
{ meta: auditMeta("count") }
|
|
322
|
+
);
|
|
323
|
+
this.addDisposer((0, import_extra3.keepalive)(this.count));
|
|
324
|
+
const includeTypes = opts.includeTypes != null ? new Set(opts.includeTypes) : new Set(DEFAULT_INCLUDE_TYPES);
|
|
325
|
+
this.includeTypes = includeTypes;
|
|
326
|
+
const filter = opts.filter;
|
|
327
|
+
let seq = 0;
|
|
328
|
+
const handle = target.observe({ timeline: true, structured: true });
|
|
329
|
+
const offEvent = handle.onEvent((event) => {
|
|
330
|
+
if (event.type === "derived") return;
|
|
331
|
+
const type = event.type;
|
|
332
|
+
if (!includeTypes.has(type)) return;
|
|
333
|
+
const path = event.path ?? "";
|
|
334
|
+
const entry = {
|
|
335
|
+
seq: seq++,
|
|
336
|
+
timestamp_ns: event.timestamp_ns ?? (0, import_core3.monotonicNs)(),
|
|
337
|
+
wall_clock_ns: (0, import_core3.wallClockNs)(),
|
|
338
|
+
path,
|
|
339
|
+
type
|
|
340
|
+
};
|
|
341
|
+
const node6 = path ? safeNode(target, path) : void 0;
|
|
342
|
+
const lastMutation = node6?.lastMutation;
|
|
343
|
+
if (lastMutation != null) entry.actor = lastMutation.actor;
|
|
344
|
+
if (type === "data") entry.value = event.data;
|
|
345
|
+
if (type === "error") entry.error = event.data;
|
|
346
|
+
const annotation = path ? safeAnnotation(target, path) : void 0;
|
|
347
|
+
if (annotation != null) entry.annotation = annotation;
|
|
348
|
+
if (filter != null && !filter(entry)) return;
|
|
349
|
+
this._log.append(entry);
|
|
350
|
+
});
|
|
351
|
+
this.addDisposer(() => {
|
|
352
|
+
offEvent();
|
|
353
|
+
handle.dispose();
|
|
354
|
+
});
|
|
355
|
+
this.addDisposer(() => this._log.disposeAllViews());
|
|
356
|
+
}
|
|
357
|
+
/** All entries currently in the ring (snapshot). */
|
|
358
|
+
all() {
|
|
359
|
+
return this.entries.cache ?? [];
|
|
360
|
+
}
|
|
361
|
+
/** Entries matching `path`. Order preserved. */
|
|
362
|
+
byNode(path) {
|
|
363
|
+
return this.all().filter((e) => e.path === path);
|
|
364
|
+
}
|
|
365
|
+
/** Entries whose `actor.id` matches. Use `byActorType` for type filtering. */
|
|
366
|
+
byActor(actorId) {
|
|
367
|
+
return this.all().filter((e) => e.actor?.id === actorId);
|
|
368
|
+
}
|
|
369
|
+
/** Entries whose `actor.type` matches (e.g. `"llm"`, `"human"`). */
|
|
370
|
+
byActorType(type) {
|
|
371
|
+
return this.all().filter((e) => e.actor?.type === type);
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Entries with `timestamp_ns` in `[start_ns, end_ns)` (end exclusive).
|
|
375
|
+
* Omit `end_ns` to query open-ended.
|
|
376
|
+
*/
|
|
377
|
+
byTimeRange(start_ns, end_ns) {
|
|
378
|
+
return this.all().filter((e) => {
|
|
379
|
+
if (e.timestamp_ns < start_ns) return false;
|
|
380
|
+
if (end_ns != null && e.timestamp_ns >= end_ns) return false;
|
|
381
|
+
return true;
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
/** Reference to the audited graph (escape hatch for tooling). */
|
|
385
|
+
get target() {
|
|
386
|
+
return this._target;
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
function auditTrail(target, opts = {}) {
|
|
390
|
+
return new AuditTrailGraph(target, opts);
|
|
391
|
+
}
|
|
392
|
+
var PolicyGateGraph = class extends import_graph3.Graph {
|
|
393
|
+
policies;
|
|
394
|
+
violations;
|
|
395
|
+
violationCount;
|
|
396
|
+
_target;
|
|
397
|
+
_mode;
|
|
398
|
+
_currentGuard;
|
|
399
|
+
constructor(target, policies, opts) {
|
|
400
|
+
super(opts.name ?? `${target.name}_policy`, opts.graph);
|
|
401
|
+
this._target = target;
|
|
402
|
+
this._mode = opts.mode ?? "audit";
|
|
403
|
+
const policiesNode = isNode(policies) ? policies : (0, import_core3.node)([], { name: "policies", initial: policies });
|
|
404
|
+
this.policies = policiesNode;
|
|
405
|
+
this.add(this.policies, { name: "policies" });
|
|
406
|
+
this.violations = new TopicGraph("violations", {
|
|
407
|
+
retainedLimit: opts.violationsLimit ?? 1e3
|
|
408
|
+
});
|
|
409
|
+
this.mount("violations", this.violations);
|
|
410
|
+
this.violationCount = this.derived(
|
|
411
|
+
"violationCount",
|
|
412
|
+
["violations::events"],
|
|
413
|
+
(batchData, ctx) => {
|
|
414
|
+
const data = batchData.map(
|
|
415
|
+
(batch4, i) => batch4 != null && batch4.length > 0 ? batch4.at(-1) : ctx.prevData[i]
|
|
416
|
+
);
|
|
417
|
+
return [data[0].length];
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
meta: auditMeta("policy_violation_count")
|
|
421
|
+
}
|
|
422
|
+
);
|
|
423
|
+
this.addDisposer((0, import_extra3.keepalive)(this.violationCount));
|
|
424
|
+
const initialRules = policiesNode.cache ?? [];
|
|
425
|
+
let latestRules = initialRules;
|
|
426
|
+
this._currentGuard = (0, import_core3.policyFromRules)(latestRules);
|
|
427
|
+
const offPolicies = policiesNode.subscribe((msgs) => {
|
|
428
|
+
for (const m of msgs) {
|
|
429
|
+
if (m[0] === import_core3.DATA) {
|
|
430
|
+
latestRules = m[1] ?? [];
|
|
431
|
+
this._currentGuard = (0, import_core3.policyFromRules)(latestRules);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
this.addDisposer(offPolicies);
|
|
436
|
+
const pathsOpt = opts.paths;
|
|
437
|
+
const pathsNode = isNode(pathsOpt) ? pathsOpt : void 0;
|
|
438
|
+
const pathsExplicit = pathsOpt != null;
|
|
439
|
+
const initialPaths = pathsNode != null ? pathsNode.cache ?? [] : pathsExplicit ? [...pathsOpt] : void 0;
|
|
440
|
+
let latestPaths = initialPaths;
|
|
441
|
+
const paths = latestPaths ?? collectPaths(target);
|
|
442
|
+
if (this._mode !== "enforce" && pathsNode != null) {
|
|
443
|
+
const offAuditPaths = pathsNode.subscribe((msgs) => {
|
|
444
|
+
for (const m of msgs) {
|
|
445
|
+
if (m[0] !== import_core3.DATA) continue;
|
|
446
|
+
latestPaths = m[1] ?? [];
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
this.addDisposer(offAuditPaths);
|
|
450
|
+
}
|
|
451
|
+
if (this._mode === "enforce") {
|
|
452
|
+
const restorers = /* @__PURE__ */ new Map();
|
|
453
|
+
const wrapAndPush = (path) => {
|
|
454
|
+
if (restorers.has(path)) return;
|
|
455
|
+
const node6 = safeNode(target, path);
|
|
456
|
+
if (!(node6 instanceof import_core3.NodeImpl)) return;
|
|
457
|
+
const pathGuard = (actor, action) => {
|
|
458
|
+
const ok = this._currentGuard(actor, action);
|
|
459
|
+
if (!ok) {
|
|
460
|
+
this._publishViolation(actor, action, path, "blocked");
|
|
461
|
+
}
|
|
462
|
+
return ok;
|
|
463
|
+
};
|
|
464
|
+
restorers.set(path, node6._pushGuard(pathGuard));
|
|
465
|
+
};
|
|
466
|
+
for (const path of paths) wrapAndPush(path);
|
|
467
|
+
if (pathsNode != null) {
|
|
468
|
+
const offReactivePaths = pathsNode.subscribe((msgs) => {
|
|
469
|
+
for (const m of msgs) {
|
|
470
|
+
if (m[0] !== import_core3.DATA) continue;
|
|
471
|
+
const next = m[1] ?? [];
|
|
472
|
+
const nextSet = new Set(next);
|
|
473
|
+
const prevSet = new Set(latestPaths ?? []);
|
|
474
|
+
(0, import_core3.batch)(() => {
|
|
475
|
+
for (const p of prevSet) {
|
|
476
|
+
if (nextSet.has(p)) continue;
|
|
477
|
+
const r = restorers.get(p);
|
|
478
|
+
if (r != null) {
|
|
479
|
+
r();
|
|
480
|
+
restorers.delete(p);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
for (const p of nextSet) {
|
|
484
|
+
if (prevSet.has(p)) continue;
|
|
485
|
+
wrapAndPush(p);
|
|
486
|
+
}
|
|
487
|
+
latestPaths = next;
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
});
|
|
491
|
+
this.addDisposer(offReactivePaths);
|
|
492
|
+
}
|
|
493
|
+
if (!pathsExplicit) {
|
|
494
|
+
const offTopology = (0, import_graph3.watchTopologyTree)(target, (event, emitter, prefix) => {
|
|
495
|
+
if (event.kind === "added") {
|
|
496
|
+
if (event.nodeKind === "node") {
|
|
497
|
+
wrapAndPush(`${prefix}${event.name}`);
|
|
498
|
+
} else {
|
|
499
|
+
const child = emitter._mounts.get(event.name);
|
|
500
|
+
if (!(child instanceof import_graph3.Graph)) return;
|
|
501
|
+
const mountPrefix = `${prefix}${event.name}::`;
|
|
502
|
+
const localPaths = collectPaths(child);
|
|
503
|
+
for (const localPath of localPaths) {
|
|
504
|
+
wrapAndPush(
|
|
505
|
+
localPath === "" ? `${prefix}${event.name}` : `${mountPrefix}${localPath}`
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
} else if (event.kind === "removed") {
|
|
510
|
+
if (event.nodeKind === "node") {
|
|
511
|
+
const qp = `${prefix}${event.name}`;
|
|
512
|
+
const r = restorers.get(qp);
|
|
513
|
+
if (r != null) {
|
|
514
|
+
r();
|
|
515
|
+
restorers.delete(qp);
|
|
516
|
+
}
|
|
517
|
+
} else {
|
|
518
|
+
const mountQp = `${prefix}${event.name}`;
|
|
519
|
+
const mountPrefix = `${mountQp}::`;
|
|
520
|
+
for (const [p, r] of restorers) {
|
|
521
|
+
if (p === mountQp || p.startsWith(mountPrefix)) {
|
|
522
|
+
r();
|
|
523
|
+
restorers.delete(p);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
this.addDisposer(offTopology);
|
|
530
|
+
} else {
|
|
531
|
+
const offCleanup = target.topology.subscribe((msgs) => {
|
|
532
|
+
for (const m of msgs) {
|
|
533
|
+
if (m[0] !== import_core3.DATA) continue;
|
|
534
|
+
const event = m[1];
|
|
535
|
+
if (event.kind !== "removed" || event.nodeKind !== "node") continue;
|
|
536
|
+
const r = restorers.get(event.name);
|
|
537
|
+
if (r != null) {
|
|
538
|
+
r();
|
|
539
|
+
restorers.delete(event.name);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
this.addDisposer(offCleanup);
|
|
544
|
+
}
|
|
545
|
+
this.addDisposer(() => {
|
|
546
|
+
for (const r of restorers.values()) r();
|
|
547
|
+
restorers.clear();
|
|
548
|
+
});
|
|
549
|
+
} else {
|
|
550
|
+
const handle = target.observe({ timeline: true, structured: true });
|
|
551
|
+
const off = handle.onEvent((event) => {
|
|
552
|
+
if (event.type !== "data" && event.type !== "error") return;
|
|
553
|
+
const path = event.path ?? "";
|
|
554
|
+
if (!path) return;
|
|
555
|
+
if (latestPaths != null && !latestPaths.includes(path)) return;
|
|
556
|
+
const actor = event.actor ?? safeNode(target, path)?.lastMutation?.actor;
|
|
557
|
+
if (actor == null) return;
|
|
558
|
+
const action = "write";
|
|
559
|
+
if (this._currentGuard(actor, action)) return;
|
|
560
|
+
this._publishViolation(actor, action, path, "observed");
|
|
561
|
+
});
|
|
562
|
+
this.addDisposer(() => {
|
|
563
|
+
off();
|
|
564
|
+
handle.dispose();
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
_publishViolation(actor, action, path, result) {
|
|
569
|
+
this.violations.publish({
|
|
570
|
+
timestamp_ns: (0, import_core3.monotonicNs)(),
|
|
571
|
+
wall_clock_ns: (0, import_core3.wallClockNs)(),
|
|
572
|
+
path,
|
|
573
|
+
actor,
|
|
574
|
+
action,
|
|
575
|
+
mode: this._mode,
|
|
576
|
+
result
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
/** Snapshot of recorded violations. */
|
|
580
|
+
all() {
|
|
581
|
+
return this.violations.retained();
|
|
582
|
+
}
|
|
583
|
+
get mode() {
|
|
584
|
+
return this._mode;
|
|
585
|
+
}
|
|
586
|
+
get target() {
|
|
587
|
+
return this._target;
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
function policyGate(target, policies, opts = {}) {
|
|
591
|
+
const g = new PolicyGateGraph(target, policies, opts);
|
|
592
|
+
g.tagFactory("policyGate", (0, import_core3.placeholderArgs)(opts));
|
|
593
|
+
return g;
|
|
594
|
+
}
|
|
595
|
+
function complianceSnapshot(target, opts = {}) {
|
|
596
|
+
const result = {
|
|
597
|
+
format_version: 1,
|
|
598
|
+
timestamp_ns: (0, import_core3.monotonicNs)(),
|
|
599
|
+
wall_clock_ns: (0, import_core3.wallClockNs)(),
|
|
600
|
+
graph: target.snapshot()
|
|
601
|
+
};
|
|
602
|
+
if (opts.actor != null) result.actor = opts.actor;
|
|
603
|
+
if (opts.audit != null) {
|
|
604
|
+
const entries = [...opts.audit.all()];
|
|
605
|
+
result.audit = { count: entries.length, entries };
|
|
606
|
+
}
|
|
607
|
+
if (opts.policies != null) {
|
|
608
|
+
const rules = opts.policies.policies.cache ?? [];
|
|
609
|
+
result.policies = {
|
|
610
|
+
mode: opts.policies.mode,
|
|
611
|
+
rules,
|
|
612
|
+
violations: [...opts.policies.all()]
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
const fingerprint = computeFingerprint(result);
|
|
616
|
+
return { ...result, fingerprint };
|
|
617
|
+
}
|
|
618
|
+
function isNode(x) {
|
|
619
|
+
return typeof x === "object" && x !== null && "subscribe" in x;
|
|
620
|
+
}
|
|
621
|
+
function safeNode(target, path) {
|
|
622
|
+
try {
|
|
623
|
+
return target.node(path);
|
|
624
|
+
} catch {
|
|
625
|
+
return void 0;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
function safeAnnotation(target, path) {
|
|
629
|
+
try {
|
|
630
|
+
return target.annotation(path);
|
|
631
|
+
} catch {
|
|
632
|
+
return void 0;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
function collectPaths(target) {
|
|
636
|
+
const described = target.describe({ detail: "minimal" });
|
|
637
|
+
return Object.keys(described.nodes);
|
|
638
|
+
}
|
|
639
|
+
function computeFingerprint(value) {
|
|
640
|
+
return (0, import_core3.defaultHash)(JSON.stringify(canonicalize(value)));
|
|
641
|
+
}
|
|
642
|
+
function canonicalize(value) {
|
|
643
|
+
const stack = /* @__PURE__ */ new Set();
|
|
644
|
+
const walk = (v) => {
|
|
645
|
+
if (v === void 0) return { __undefined: true };
|
|
646
|
+
if (v === null) return null;
|
|
647
|
+
const t = typeof v;
|
|
648
|
+
if (t === "bigint") return { __bigint: v.toString() };
|
|
649
|
+
if (t !== "object") return v;
|
|
650
|
+
const obj = v;
|
|
651
|
+
if (stack.has(obj)) return { __circular: true };
|
|
652
|
+
stack.add(obj);
|
|
653
|
+
try {
|
|
654
|
+
if (Array.isArray(obj)) {
|
|
655
|
+
return obj.map(walk);
|
|
656
|
+
}
|
|
657
|
+
if (obj instanceof Date) {
|
|
658
|
+
return { __date: obj.toISOString() };
|
|
659
|
+
}
|
|
660
|
+
if (obj instanceof RegExp) {
|
|
661
|
+
return { __regexp: { source: obj.source, flags: obj.flags } };
|
|
662
|
+
}
|
|
663
|
+
if (obj instanceof Map) {
|
|
664
|
+
const entries = [...obj.entries()].map(([k, mv]) => [
|
|
665
|
+
walk(k),
|
|
666
|
+
walk(mv)
|
|
667
|
+
]);
|
|
668
|
+
return { __map: entries };
|
|
669
|
+
}
|
|
670
|
+
if (obj instanceof Set) {
|
|
671
|
+
const items = [...obj].map(walk);
|
|
672
|
+
return { __set: items };
|
|
673
|
+
}
|
|
674
|
+
if (ArrayBuffer.isView(obj)) {
|
|
675
|
+
const ta = obj;
|
|
676
|
+
const arr = new Array(ta.length);
|
|
677
|
+
for (let i = 0; i < ta.length; i++) arr[i] = ta[i] ?? 0;
|
|
678
|
+
return { __typed_array: { ctor: obj.constructor.name, data: arr } };
|
|
679
|
+
}
|
|
680
|
+
const out = {};
|
|
681
|
+
for (const k of Object.keys(obj).sort()) {
|
|
682
|
+
out[k] = walk(obj[k]);
|
|
683
|
+
}
|
|
684
|
+
return out;
|
|
685
|
+
} finally {
|
|
686
|
+
stack.delete(obj);
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
return walk(value);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
// src/utils/inspect/lens.ts
|
|
693
|
+
var import_core4 = require("@graphrefly/pure-ts/core");
|
|
694
|
+
var import_extra4 = require("@graphrefly/pure-ts/extra");
|
|
695
|
+
var import_graph4 = require("@graphrefly/pure-ts/graph");
|
|
696
|
+
var import_graph5 = require("@graphrefly/pure-ts/graph");
|
|
697
|
+
function computeHealthReport(described) {
|
|
698
|
+
const problems = [];
|
|
699
|
+
for (const [path, desc] of Object.entries(described.nodes)) {
|
|
700
|
+
if (desc.status !== "errored") continue;
|
|
701
|
+
const entry = { path, status: "errored" };
|
|
702
|
+
const upstream = (0, import_graph4.reachable)(described, path, "upstream", {});
|
|
703
|
+
for (const p of upstream) {
|
|
704
|
+
if (p === path) continue;
|
|
705
|
+
if (described.nodes[p]?.status === "errored") {
|
|
706
|
+
entry.upstreamCause = p;
|
|
707
|
+
break;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
problems.push(entry);
|
|
711
|
+
}
|
|
712
|
+
problems.sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0);
|
|
713
|
+
return { ok: problems.length === 0, problems };
|
|
714
|
+
}
|
|
715
|
+
function healthReportEqual(a, b) {
|
|
716
|
+
if (a.ok !== b.ok) return false;
|
|
717
|
+
if (a.problems.length !== b.problems.length) return false;
|
|
718
|
+
for (let i = 0; i < a.problems.length; i++) {
|
|
719
|
+
const x = a.problems[i];
|
|
720
|
+
const y = b.problems[i];
|
|
721
|
+
if (x.path !== y.path) return false;
|
|
722
|
+
if (x.status !== y.status) return false;
|
|
723
|
+
if (x.upstreamCause !== y.upstreamCause) return false;
|
|
724
|
+
}
|
|
725
|
+
return true;
|
|
726
|
+
}
|
|
727
|
+
function graphLens(target) {
|
|
728
|
+
const topologyHandle = target.describe({
|
|
729
|
+
reactive: true,
|
|
730
|
+
detail: "standard",
|
|
731
|
+
reactiveName: "graphLens.topology"
|
|
732
|
+
});
|
|
733
|
+
const topology = topologyHandle.node;
|
|
734
|
+
const health = (0, import_core4.node)(
|
|
735
|
+
[topology],
|
|
736
|
+
(batchData, actions, ctx) => {
|
|
737
|
+
const data = batchData.map(
|
|
738
|
+
(batch4, i) => batch4 != null && batch4.length > 0 ? batch4.at(-1) : ctx.prevData[i]
|
|
739
|
+
);
|
|
740
|
+
actions.emit(computeHealthReport(data[0]));
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
name: "graphLens.health",
|
|
744
|
+
describeKind: "derived",
|
|
745
|
+
equals: healthReportEqual,
|
|
746
|
+
meta: domainMeta("lens", "health")
|
|
747
|
+
}
|
|
748
|
+
);
|
|
749
|
+
const stopHealthKeep = (0, import_extra4.keepalive)(health);
|
|
750
|
+
const flowMap = /* @__PURE__ */ new Map();
|
|
751
|
+
let lastAppliedFlush_ns = -1;
|
|
752
|
+
const dataFlow = target.observe({ reactive: true, tiers: ["data"] });
|
|
753
|
+
const flow = (0, import_core4.node)(
|
|
754
|
+
[dataFlow, topology],
|
|
755
|
+
(batchData, actions, ctx) => {
|
|
756
|
+
const data = batchData.map(
|
|
757
|
+
(batch4, i) => batch4 != null && batch4.length > 0 ? batch4.at(-1) : ctx.prevData[i]
|
|
758
|
+
);
|
|
759
|
+
const changeset = data[0];
|
|
760
|
+
const described = data[1];
|
|
761
|
+
const c = changeset;
|
|
762
|
+
const desc = described;
|
|
763
|
+
if (c != null && c.flushedAt_ns > lastAppliedFlush_ns) {
|
|
764
|
+
lastAppliedFlush_ns = c.flushedAt_ns;
|
|
765
|
+
for (const event of c.events) {
|
|
766
|
+
if (event.type !== "data") continue;
|
|
767
|
+
const path = event.path;
|
|
768
|
+
if (path == null || path === "") continue;
|
|
769
|
+
const prior = flowMap.get(path);
|
|
770
|
+
flowMap.set(path, {
|
|
771
|
+
path,
|
|
772
|
+
count: (prior?.count ?? 0) + 1,
|
|
773
|
+
lastUpdate_ns: c.flushedAt_ns
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
if (desc != null && flowMap.size > 0) {
|
|
778
|
+
const valid = new Set(Object.keys(desc.nodes));
|
|
779
|
+
for (const k of [...flowMap.keys()]) {
|
|
780
|
+
if (!valid.has(k)) flowMap.delete(k);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
actions.emit(new Map(flowMap));
|
|
784
|
+
},
|
|
785
|
+
{
|
|
786
|
+
name: "graphLens.flow",
|
|
787
|
+
describeKind: "derived",
|
|
788
|
+
meta: domainMeta("lens", "flow")
|
|
789
|
+
}
|
|
790
|
+
);
|
|
791
|
+
const stopFlowKeep = (0, import_extra4.keepalive)(flow);
|
|
792
|
+
let disposed = false;
|
|
793
|
+
return {
|
|
794
|
+
topology,
|
|
795
|
+
health,
|
|
796
|
+
flow,
|
|
797
|
+
dispose() {
|
|
798
|
+
if (disposed) return;
|
|
799
|
+
disposed = true;
|
|
800
|
+
stopFlowKeep();
|
|
801
|
+
stopHealthKeep();
|
|
802
|
+
topologyHandle.dispose();
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
// src/presets/inspect/composite.ts
|
|
808
|
+
var LensSubgraph = class extends import_graph6.Graph {
|
|
809
|
+
view;
|
|
810
|
+
constructor(target) {
|
|
811
|
+
super("lens");
|
|
812
|
+
this.view = graphLens(target);
|
|
813
|
+
this.add(this.view.topology, { name: "topology" });
|
|
814
|
+
this.add(this.view.health, { name: "health" });
|
|
815
|
+
this.add(this.view.flow, { name: "flow" });
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
var InspectGraph = class extends import_graph6.Graph {
|
|
819
|
+
target;
|
|
820
|
+
/**
|
|
821
|
+
* Underlying lens view — reach individual Nodes via
|
|
822
|
+
* `inspect.lens.topology` / `inspect.lens.health` / `inspect.lens.flow`.
|
|
823
|
+
*
|
|
824
|
+
* Direct `inspect.topology` / `inspect.health` / `inspect.flow`
|
|
825
|
+
* accessors are NOT shipped because `Graph.topology` is already an
|
|
826
|
+
* accessor on the base class with a different shape (`Node<TopologyEvent>`
|
|
827
|
+
* — the mount/unmount stream of THIS graph, not the wrapped target's
|
|
828
|
+
* describe snapshot). Going through `.lens.*` keeps the two concepts
|
|
829
|
+
* cleanly separated.
|
|
830
|
+
*/
|
|
831
|
+
lens;
|
|
832
|
+
/** Mounted audit trail subgraph. */
|
|
833
|
+
audit;
|
|
834
|
+
_defaultActor;
|
|
835
|
+
_lensSubgraph;
|
|
836
|
+
constructor(target, opts = {}) {
|
|
837
|
+
super(opts.name ?? `inspect(${target.name})`);
|
|
838
|
+
this.target = target;
|
|
839
|
+
this._defaultActor = opts.actor;
|
|
840
|
+
this._lensSubgraph = new LensSubgraph(target);
|
|
841
|
+
this.lens = this._lensSubgraph.view;
|
|
842
|
+
this.mount("lens", this._lensSubgraph);
|
|
843
|
+
this.audit = auditTrail(target, opts.audit ?? {});
|
|
844
|
+
this.mount("audit", this.audit);
|
|
845
|
+
this.addDisposer(() => this.lens.dispose());
|
|
846
|
+
}
|
|
847
|
+
explainTarget(from, to, opts) {
|
|
848
|
+
const explainArg = { from, to };
|
|
849
|
+
if (opts?.maxDepth !== void 0) explainArg.maxDepth = opts.maxDepth;
|
|
850
|
+
if (opts?.findCycle !== void 0) explainArg.findCycle = opts.findCycle;
|
|
851
|
+
const describeOpts = { explain: explainArg };
|
|
852
|
+
if (opts?.reactive === true) describeOpts.reactive = true;
|
|
853
|
+
if (opts?.name !== void 0) describeOpts.name = opts.name;
|
|
854
|
+
return this.target.describe(describeOpts);
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* One-shot tamper-evident snapshot pairing the target's persisted state
|
|
858
|
+
* with the audit log + (optional) policy-gate violations.
|
|
859
|
+
*
|
|
860
|
+
* Uses the inspect's mounted `audit` by default; pair with a separate
|
|
861
|
+
* `policyGate` (mounted elsewhere) by passing `policies` explicitly.
|
|
862
|
+
*
|
|
863
|
+
* **Cryptographic strength caveat (echoed from {@link complianceSnapshot}):**
|
|
864
|
+
* the returned `fingerprint` is a truncated SHA-256 (16 hex chars / ~64
|
|
865
|
+
* bits) optimized for compact archival. Sufficient for casual integrity
|
|
866
|
+
* checks and content-addressed dedup; for adversarial tamper-evidence,
|
|
867
|
+
* pair with a full SHA-256 over the canonical JSON externally.
|
|
868
|
+
*/
|
|
869
|
+
complianceSnapshot(opts) {
|
|
870
|
+
const actor = opts?.actor ?? this._defaultActor;
|
|
871
|
+
return complianceSnapshot(this.target, {
|
|
872
|
+
audit: this.audit,
|
|
873
|
+
...actor != null ? { actor } : {},
|
|
874
|
+
...opts?.policies != null ? { policies: opts.policies } : {}
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
};
|
|
878
|
+
function inspect(target, opts = {}) {
|
|
879
|
+
const g = new InspectGraph(target, opts);
|
|
880
|
+
g.tagFactory("inspect", (0, import_core5.placeholderArgs)(opts));
|
|
881
|
+
return g;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
// src/presets/inspect/guarded-execution.ts
|
|
885
|
+
var import_core6 = require("@graphrefly/pure-ts/core");
|
|
886
|
+
var import_extra5 = require("@graphrefly/pure-ts/extra");
|
|
887
|
+
var import_graph7 = require("@graphrefly/pure-ts/graph");
|
|
888
|
+
function isNode2(x) {
|
|
889
|
+
return typeof x === "object" && x !== null && "subscribe" in x && "down" in x;
|
|
890
|
+
}
|
|
891
|
+
function guardedMeta(kind) {
|
|
892
|
+
return domainMeta("guarded", kind);
|
|
893
|
+
}
|
|
894
|
+
var GuardedExecutionGraph = class extends import_graph7.Graph {
|
|
895
|
+
enforcer;
|
|
896
|
+
violations;
|
|
897
|
+
lints;
|
|
898
|
+
scope;
|
|
899
|
+
/**
|
|
900
|
+
* Canonical reactive describe scoped to the wrapper's configured `actor`.
|
|
901
|
+
* Subscribes ONCE at construction; lifecycle owned by the wrapper (disposed
|
|
902
|
+
* on `wrapper.destroy()`). Use this property for the common case
|
|
903
|
+
* (long-lived consumer wanting "describe scoped to my actor"); use
|
|
904
|
+
* {@link scopedDescribeNode} only when a per-call actor override or
|
|
905
|
+
* different `detail`/`fields` is required.
|
|
906
|
+
*
|
|
907
|
+
* Re-derives on every settle of the target graph: structural changes,
|
|
908
|
+
* status transitions (errors flip nodes into `"errored"`), and actor
|
|
909
|
+
* emissions (when a `Node<Actor>` is bound, including the SENTINEL bridge
|
|
910
|
+
* applied internally — see qa G1B).
|
|
911
|
+
*/
|
|
912
|
+
scopedDescribe;
|
|
913
|
+
_target;
|
|
914
|
+
_actorNode;
|
|
915
|
+
_mode;
|
|
916
|
+
_firedLintKinds = /* @__PURE__ */ new Set();
|
|
917
|
+
constructor(target, opts) {
|
|
918
|
+
super(opts.name ?? `${target.name}_guarded`, opts.graph);
|
|
919
|
+
this._target = target;
|
|
920
|
+
this._mode = opts.mode ?? "enforce";
|
|
921
|
+
const policiesOpt = opts.policies;
|
|
922
|
+
const policiesIsNode = isNode2(policiesOpt);
|
|
923
|
+
if (!policiesIsNode && this._mode === "enforce" && policiesOpt.length === 0) {
|
|
924
|
+
throw new RangeError(
|
|
925
|
+
'guardedExecution: empty `policies` in `mode: "enforce"` denies every action. Pass at least `{ effect: "allow", action: "*" }` and layer deny rules on top.'
|
|
926
|
+
);
|
|
927
|
+
}
|
|
928
|
+
this.lints = new TopicGraph("lints", {
|
|
929
|
+
retainedLimit: opts.lintsLimit ?? 64
|
|
930
|
+
});
|
|
931
|
+
this.mount("lints", this.lints);
|
|
932
|
+
const actorOpt = opts.actor;
|
|
933
|
+
if (actorOpt == null) {
|
|
934
|
+
this._actorNode = (0, import_core6.node)([], { name: "actor", initial: null });
|
|
935
|
+
} else if (isNode2(actorOpt)) {
|
|
936
|
+
this._actorNode = (0, import_core6.node)(
|
|
937
|
+
[actorOpt],
|
|
938
|
+
(batchData, actions, ctx) => {
|
|
939
|
+
const data = batchData.map(
|
|
940
|
+
(batch4, i) => batch4 != null && batch4.length > 0 ? batch4.at(-1) : ctx.prevData[i]
|
|
941
|
+
);
|
|
942
|
+
actions.emit(data[0] ?? null);
|
|
943
|
+
},
|
|
944
|
+
{ describeKind: "derived", name: "actor", initial: null }
|
|
945
|
+
);
|
|
946
|
+
} else {
|
|
947
|
+
this._actorNode = (0, import_core6.node)([], { name: "actor", initial: actorOpt });
|
|
948
|
+
}
|
|
949
|
+
const enforcerOpts = {
|
|
950
|
+
mode: this._mode,
|
|
951
|
+
name: "enforcer"
|
|
952
|
+
};
|
|
953
|
+
if (opts.violationsLimit != null) enforcerOpts.violationsLimit = opts.violationsLimit;
|
|
954
|
+
this.enforcer = policyGate(target, opts.policies, enforcerOpts);
|
|
955
|
+
this.violations = this.enforcer.violations;
|
|
956
|
+
this.mount("enforcer", this.enforcer);
|
|
957
|
+
if (policiesIsNode && this._mode === "enforce") {
|
|
958
|
+
const policiesNode = policiesOpt;
|
|
959
|
+
const cached = policiesNode.cache;
|
|
960
|
+
if (cached != null && cached.length === 0) {
|
|
961
|
+
this._fireLint(
|
|
962
|
+
"empty-policies",
|
|
963
|
+
'`policies` Node cached an empty array in `mode: "enforce"` \u2014 every action will be denied. Add at least one allow rule.'
|
|
964
|
+
);
|
|
965
|
+
}
|
|
966
|
+
const offEmpty = policiesNode.subscribe((msgs) => {
|
|
967
|
+
for (const m of msgs) {
|
|
968
|
+
if (m[0] !== import_core6.DATA) continue;
|
|
969
|
+
const v = m[1];
|
|
970
|
+
if (v == null || v.length === 0) {
|
|
971
|
+
this._fireLint(
|
|
972
|
+
"empty-policies",
|
|
973
|
+
'`policies` Node emitted an empty array in `mode: "enforce"` \u2014 every action will be denied. Add at least one allow rule.'
|
|
974
|
+
);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
this.addDisposer(offEmpty);
|
|
979
|
+
}
|
|
980
|
+
if (this._mode === "audit") {
|
|
981
|
+
const described = target.describe({ detail: "full" });
|
|
982
|
+
const anyGuard = Object.values(described.nodes).some((n) => n.guard != null);
|
|
983
|
+
if (!anyGuard) {
|
|
984
|
+
this._fireLint(
|
|
985
|
+
"audit-no-effect",
|
|
986
|
+
'`mode: "audit"` + target has no per-node guards \u2014 `scopedDescribeNode` filters by per-node guards only, so policy rules will not affect describe() visibility. Policies still populate the `violations` topic on writes.'
|
|
987
|
+
);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
if (actorOpt == null) {
|
|
991
|
+
this._fireLint(
|
|
992
|
+
"no-actor",
|
|
993
|
+
"no actor configured \u2014 `wrapper.scopedDescribe` and `scopedDescribeNode()` will return an unscoped describe (full visibility) unless a per-call actor is supplied."
|
|
994
|
+
);
|
|
995
|
+
}
|
|
996
|
+
this.scope = (0, import_core6.node)(
|
|
997
|
+
[this._actorNode, this.enforcer.policies],
|
|
998
|
+
(batchData, actions, ctx) => {
|
|
999
|
+
const data = batchData.map(
|
|
1000
|
+
(batch4, i) => batch4 != null && batch4.length > 0 ? batch4.at(-1) : ctx.prevData[i]
|
|
1001
|
+
);
|
|
1002
|
+
actions.emit({
|
|
1003
|
+
actor: data[0] ?? null,
|
|
1004
|
+
mode: this._mode,
|
|
1005
|
+
policiesCount: data[1].length
|
|
1006
|
+
});
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
name: "scope",
|
|
1010
|
+
describeKind: "derived",
|
|
1011
|
+
meta: guardedMeta("scope")
|
|
1012
|
+
}
|
|
1013
|
+
);
|
|
1014
|
+
this.add(this.scope, { name: "scope" });
|
|
1015
|
+
this.addDisposer((0, import_extra5.keepalive)(this.scope));
|
|
1016
|
+
const scopedHandle = target.describe({
|
|
1017
|
+
reactive: true,
|
|
1018
|
+
// F8 (Tier 5.2): `_actorNode` is `Node<Actor | null>`. The cast is
|
|
1019
|
+
// safe at runtime per the `resolveActorOption` null-tolerance
|
|
1020
|
+
// contract — `null` / `undefined` cache is treated as "no scoping"
|
|
1021
|
+
// (full visibility). See `scopedDescribeNode` for the matching
|
|
1022
|
+
// per-call site and graph.ts § "Cache-undefined semantics".
|
|
1023
|
+
actor: this._actorNode,
|
|
1024
|
+
reactiveName: "scopedDescribe"
|
|
1025
|
+
});
|
|
1026
|
+
this.scopedDescribe = scopedHandle.node;
|
|
1027
|
+
this.add(this.scopedDescribe, { name: "scopedDescribe" });
|
|
1028
|
+
this.addDisposer(scopedHandle.dispose);
|
|
1029
|
+
}
|
|
1030
|
+
_fireLint(kind, message) {
|
|
1031
|
+
if (this._firedLintKinds.has(kind)) return;
|
|
1032
|
+
this._firedLintKinds.add(kind);
|
|
1033
|
+
this.lints.publish({ kind, message, timestamp_ns: (0, import_core6.monotonicNs)() });
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* **Per-call escape hatch.** Prefer {@link scopedDescribe} (the mounted
|
|
1037
|
+
* property) for the common case of "describe scoped to my actor." Use
|
|
1038
|
+
* this method ONLY when you need a per-call actor override or different
|
|
1039
|
+
* `detail`/`fields`/`filter`.
|
|
1040
|
+
*
|
|
1041
|
+
* Returns a live `Node<GraphDescribeOutput>` scoped to the supplied (or
|
|
1042
|
+
* configured) actor, plus an explicit `dispose` for caller-controlled
|
|
1043
|
+
* lifecycle. Re-derives on every settle of the target graph: structural
|
|
1044
|
+
* changes, status transitions, and actor emissions (when a `Node<Actor>`
|
|
1045
|
+
* is bound).
|
|
1046
|
+
*
|
|
1047
|
+
* **Lifecycle (qa G1A — EC1 fix).** Each call instantiates a fresh
|
|
1048
|
+
* `target.describe({reactive: true})` handle (with its own version state,
|
|
1049
|
+
* observe handle, transitive topology subscriptions, derived + keepalive).
|
|
1050
|
+
* The caller MUST invoke the returned `dispose()` when finished to release
|
|
1051
|
+
* these resources. Disposers ARE also tracked on the wrapper graph so
|
|
1052
|
+
* `wrapper.destroy()` cleans up any handles the caller forgot — but a
|
|
1053
|
+
* long-lived wrapper with heavy per-call usage will leak until destroy
|
|
1054
|
+
* unless `dispose()` is called explicitly.
|
|
1055
|
+
*
|
|
1056
|
+
* @param actorOverride - Optional per-call override. Static {@link Actor}
|
|
1057
|
+
* or `Node<Actor>`. Omit to use the wrapper-configured default.
|
|
1058
|
+
* @param opts - Standard {@link GraphDescribeOptions} fields (`detail`,
|
|
1059
|
+
* `fields`, `filter`). `actor` / `reactive` / `reactiveName` are
|
|
1060
|
+
* controlled by the wrapper.
|
|
1061
|
+
* @returns `{node, dispose}` — `node` is the live describe Node; `dispose`
|
|
1062
|
+
* tears down the underlying reactive describe subscription idempotently.
|
|
1063
|
+
*/
|
|
1064
|
+
scopedDescribeNode(actorOverride, opts) {
|
|
1065
|
+
const actorNode = actorOverride == null ? this._actorNode : isNode2(actorOverride) ? actorOverride : (0, import_core6.node)([], { name: "actor_override", initial: actorOverride });
|
|
1066
|
+
const handle = this._target.describe({
|
|
1067
|
+
reactive: true,
|
|
1068
|
+
// `_actorNode` is `Node<Actor | null>`. The `as Node<Actor>` cast is
|
|
1069
|
+
// safe at runtime: `_describeReactive` resolves the actor via
|
|
1070
|
+
// `resolveActorOption`, which treats `null`/`undefined` cache as
|
|
1071
|
+
// "no scoping" (full visibility). Documented in graph.ts §
|
|
1072
|
+
// "Cache-undefined semantics."
|
|
1073
|
+
actor: actorNode,
|
|
1074
|
+
...opts ?? {}
|
|
1075
|
+
});
|
|
1076
|
+
this.addDisposer(handle.dispose);
|
|
1077
|
+
return { node: handle.node, dispose: handle.dispose };
|
|
1078
|
+
}
|
|
1079
|
+
/** The wrapped graph (escape hatch for tooling). */
|
|
1080
|
+
get target() {
|
|
1081
|
+
return this._target;
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1084
|
+
function guardedExecution(target, opts) {
|
|
1085
|
+
return new GuardedExecutionGraph(target, opts);
|
|
1086
|
+
}
|
|
1087
|
+
//# sourceMappingURL=index.cjs.map
|