@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,207 @@
|
|
|
1
|
+
import { Node, Actor, PolicyRuleData } from '@graphrefly/pure-ts/core';
|
|
2
|
+
import { Graph, GraphDescribeOutput, GraphOptions, GraphDescribeOptions } from '@graphrefly/pure-ts/graph';
|
|
3
|
+
import { P as PolicyGateGraph, e as PolicyViolation } from './audit-C_bPfkqS.cjs';
|
|
4
|
+
import { TopicGraph } from './utils/messaging/index.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Composable safety layer (roadmap §9.0b — Tier 5.1 Wave-B rebuild).
|
|
8
|
+
*
|
|
9
|
+
* {@link guardedExecution} wraps any {@link Graph} with:
|
|
10
|
+
*
|
|
11
|
+
* - {@link policyGate} — reactive ABAC (Tier 2.3 rename of `policyEnforcer`),
|
|
12
|
+
* policies stored as a `Node` so LLMs / humans can update them at runtime.
|
|
13
|
+
* Full transitive dynamic coverage via `watchTopologyTree`.
|
|
14
|
+
* - Reactive {@link GuardedExecutionGraph.scopedDescribeNode} — a thin
|
|
15
|
+
* delegate over `target.describe({ reactive: true, actor })` that re-derives
|
|
16
|
+
* on every settle (topology change, error transition, actor swap).
|
|
17
|
+
* - The enforcer's `violations` topic is republished as `violations` on
|
|
18
|
+
* the wrapper, composable with {@link graphLens}'s `health`.
|
|
19
|
+
* - The wrapper-level `lints` topic surfaces non-policy diagnostic warnings
|
|
20
|
+
* (`empty-policies` / `audit-no-effect` / `no-actor`) so misconfigurations
|
|
21
|
+
* are caught reactively rather than via thrown errors at scattered call sites.
|
|
22
|
+
* - The `scope` derived publishes the current configuration tuple
|
|
23
|
+
* (`{actor, mode, policiesCount}`) for dashboards.
|
|
24
|
+
*
|
|
25
|
+
* V1 scope: policies + actor + reactive scoped describe + lints + scope.
|
|
26
|
+
* Budget-as-option is NOT in V1 — it requires a cost-tracking design that
|
|
27
|
+
* hasn't landed yet. Callers who need a budget limit today append a
|
|
28
|
+
* budget-aware {@link PolicyRuleData} to the policies list (check current
|
|
29
|
+
* cost and `deny` when exhausted).
|
|
30
|
+
*
|
|
31
|
+
* @module
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/** Diagnostic warning published on {@link GuardedExecutionGraph.lints}. */
|
|
35
|
+
interface GuardedExecutionLint {
|
|
36
|
+
/**
|
|
37
|
+
* - `"empty-policies"` — `policies` Node emitted an empty array in
|
|
38
|
+
* `mode: "enforce"`. Static empty arrays throw at construction; this
|
|
39
|
+
* covers the reactive case.
|
|
40
|
+
* - `"audit-no-effect"` — `mode: "audit"` plus the target has no per-node
|
|
41
|
+
* guards, so `scopedDescribeNode` filters by per-node guards only and
|
|
42
|
+
* policies will never gate visibility (they still populate `violations`
|
|
43
|
+
* on writes).
|
|
44
|
+
* - `"no-actor"` — neither a wrapper-configured nor per-call actor was
|
|
45
|
+
* supplied. `scopedDescribeNode` falls back to "describe everything"
|
|
46
|
+
* for the corresponding subscription.
|
|
47
|
+
*/
|
|
48
|
+
kind: "empty-policies" | "audit-no-effect" | "no-actor";
|
|
49
|
+
message: string;
|
|
50
|
+
timestamp_ns: number;
|
|
51
|
+
}
|
|
52
|
+
/** Configuration tuple published on {@link GuardedExecutionGraph.scope}. */
|
|
53
|
+
interface GuardedScope {
|
|
54
|
+
/** The wrapper-configured default actor, or `null` when none configured. */
|
|
55
|
+
actor: Actor | null;
|
|
56
|
+
mode: "audit" | "enforce";
|
|
57
|
+
/** Current policy count (reactive — re-emits on `policies` Node updates). */
|
|
58
|
+
policiesCount: number;
|
|
59
|
+
}
|
|
60
|
+
/** Options for {@link guardedExecution}. */
|
|
61
|
+
interface GuardedExecutionOptions {
|
|
62
|
+
/**
|
|
63
|
+
* Policies enforced against every guarded write. Static list or a live
|
|
64
|
+
* `Node<readonly PolicyRuleData[]>` (LLM-updatable).
|
|
65
|
+
*
|
|
66
|
+
* **Empty-policies handling:**
|
|
67
|
+
* - Static empty array + `mode: "enforce"` throws `RangeError` at
|
|
68
|
+
* construction (deny-by-default is almost certainly a misconfiguration).
|
|
69
|
+
* - Node-supplied empty array + `mode: "enforce"` emits a one-time
|
|
70
|
+
* `"empty-policies"` lint on first such emission (the wrapper can't
|
|
71
|
+
* throw mid-run — surface the warning reactively).
|
|
72
|
+
* - `mode: "audit"` tolerates empty policies (no guards stacked; policies
|
|
73
|
+
* only feed the `violations` channel on writes).
|
|
74
|
+
*/
|
|
75
|
+
policies: readonly PolicyRuleData[] | Node<readonly PolicyRuleData[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Default actor used when the caller invokes
|
|
78
|
+
* {@link GuardedExecutionGraph.scopedDescribeNode} without an override.
|
|
79
|
+
* Accepts a static {@link Actor} or a `Node<Actor>` — when a Node is
|
|
80
|
+
* supplied, the reactive describe re-derives on every actor emission so
|
|
81
|
+
* harnesses binding a per-turn actor get a single live describe Node
|
|
82
|
+
* instead of re-creating one per turn.
|
|
83
|
+
*
|
|
84
|
+
* Omit to scope per-call only. A `"no-actor"` lint fires once per instance
|
|
85
|
+
* if neither a configured nor per-call actor is ever supplied (the
|
|
86
|
+
* resulting describe is unscoped — full visibility).
|
|
87
|
+
*/
|
|
88
|
+
actor?: Actor | Node<Actor>;
|
|
89
|
+
/**
|
|
90
|
+
* `"enforce"` (default) — push guards onto target nodes so disallowed
|
|
91
|
+
* writes throw {@link GuardDenied}.
|
|
92
|
+
* `"audit"` — record would-be denials to the `violations` topic without
|
|
93
|
+
* blocking writes.
|
|
94
|
+
*/
|
|
95
|
+
mode?: "audit" | "enforce";
|
|
96
|
+
/** Ring-buffer cap for the `violations` topic. Default 1000 (inherited from policyGate). */
|
|
97
|
+
violationsLimit?: number;
|
|
98
|
+
/** Ring-buffer cap for the `lints` topic. Default 64 — each lint kind fires at most once per instance. */
|
|
99
|
+
lintsLimit?: number;
|
|
100
|
+
/** Wrapper graph name. Default `${target.name}_guarded`. */
|
|
101
|
+
name?: string;
|
|
102
|
+
/** Wrapper graph options. */
|
|
103
|
+
graph?: GraphOptions;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Wrapper over a target {@link Graph} providing reactive ABAC + reactive
|
|
107
|
+
* scoped describe + diagnostic lints. Mounts a {@link PolicyGateGraph} under
|
|
108
|
+
* `enforcer`, a {@link TopicGraph} of {@link GuardedExecutionLint} under
|
|
109
|
+
* `lints`, and a `scope` derived publishing `{actor, mode, policiesCount}`.
|
|
110
|
+
*
|
|
111
|
+
* @category patterns
|
|
112
|
+
*/
|
|
113
|
+
declare class GuardedExecutionGraph extends Graph {
|
|
114
|
+
readonly enforcer: PolicyGateGraph;
|
|
115
|
+
readonly violations: TopicGraph<PolicyViolation>;
|
|
116
|
+
readonly lints: TopicGraph<GuardedExecutionLint>;
|
|
117
|
+
readonly scope: Node<GuardedScope>;
|
|
118
|
+
/**
|
|
119
|
+
* Canonical reactive describe scoped to the wrapper's configured `actor`.
|
|
120
|
+
* Subscribes ONCE at construction; lifecycle owned by the wrapper (disposed
|
|
121
|
+
* on `wrapper.destroy()`). Use this property for the common case
|
|
122
|
+
* (long-lived consumer wanting "describe scoped to my actor"); use
|
|
123
|
+
* {@link scopedDescribeNode} only when a per-call actor override or
|
|
124
|
+
* different `detail`/`fields` is required.
|
|
125
|
+
*
|
|
126
|
+
* Re-derives on every settle of the target graph: structural changes,
|
|
127
|
+
* status transitions (errors flip nodes into `"errored"`), and actor
|
|
128
|
+
* emissions (when a `Node<Actor>` is bound, including the SENTINEL bridge
|
|
129
|
+
* applied internally — see qa G1B).
|
|
130
|
+
*/
|
|
131
|
+
readonly scopedDescribe: Node<GraphDescribeOutput>;
|
|
132
|
+
private readonly _target;
|
|
133
|
+
private readonly _actorNode;
|
|
134
|
+
private readonly _mode;
|
|
135
|
+
private readonly _firedLintKinds;
|
|
136
|
+
constructor(target: Graph, opts: GuardedExecutionOptions);
|
|
137
|
+
private _fireLint;
|
|
138
|
+
/**
|
|
139
|
+
* **Per-call escape hatch.** Prefer {@link scopedDescribe} (the mounted
|
|
140
|
+
* property) for the common case of "describe scoped to my actor." Use
|
|
141
|
+
* this method ONLY when you need a per-call actor override or different
|
|
142
|
+
* `detail`/`fields`/`filter`.
|
|
143
|
+
*
|
|
144
|
+
* Returns a live `Node<GraphDescribeOutput>` scoped to the supplied (or
|
|
145
|
+
* configured) actor, plus an explicit `dispose` for caller-controlled
|
|
146
|
+
* lifecycle. Re-derives on every settle of the target graph: structural
|
|
147
|
+
* changes, status transitions, and actor emissions (when a `Node<Actor>`
|
|
148
|
+
* is bound).
|
|
149
|
+
*
|
|
150
|
+
* **Lifecycle (qa G1A — EC1 fix).** Each call instantiates a fresh
|
|
151
|
+
* `target.describe({reactive: true})` handle (with its own version state,
|
|
152
|
+
* observe handle, transitive topology subscriptions, derived + keepalive).
|
|
153
|
+
* The caller MUST invoke the returned `dispose()` when finished to release
|
|
154
|
+
* these resources. Disposers ARE also tracked on the wrapper graph so
|
|
155
|
+
* `wrapper.destroy()` cleans up any handles the caller forgot — but a
|
|
156
|
+
* long-lived wrapper with heavy per-call usage will leak until destroy
|
|
157
|
+
* unless `dispose()` is called explicitly.
|
|
158
|
+
*
|
|
159
|
+
* @param actorOverride - Optional per-call override. Static {@link Actor}
|
|
160
|
+
* or `Node<Actor>`. Omit to use the wrapper-configured default.
|
|
161
|
+
* @param opts - Standard {@link GraphDescribeOptions} fields (`detail`,
|
|
162
|
+
* `fields`, `filter`). `actor` / `reactive` / `reactiveName` are
|
|
163
|
+
* controlled by the wrapper.
|
|
164
|
+
* @returns `{node, dispose}` — `node` is the live describe Node; `dispose`
|
|
165
|
+
* tears down the underlying reactive describe subscription idempotently.
|
|
166
|
+
*/
|
|
167
|
+
scopedDescribeNode(actorOverride?: Actor | Node<Actor>, opts?: Omit<GraphDescribeOptions, "actor" | "reactive" | "reactiveName">): {
|
|
168
|
+
node: Node<GraphDescribeOutput>;
|
|
169
|
+
dispose: () => void;
|
|
170
|
+
};
|
|
171
|
+
/** The wrapped graph (escape hatch for tooling). */
|
|
172
|
+
get target(): Graph;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Wrap a {@link Graph} with {@link policyGate} plus a reactive scoped describe
|
|
176
|
+
* lens. Returns a {@link GuardedExecutionGraph} that can be mounted, diffed,
|
|
177
|
+
* or composed with {@link graphLens}.
|
|
178
|
+
*
|
|
179
|
+
* @param target - The graph to guard.
|
|
180
|
+
* @param opts - See {@link GuardedExecutionOptions}.
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```ts
|
|
184
|
+
* const guarded = guardedExecution(app, {
|
|
185
|
+
* actor: node<Actor>([], { initial: { type: "human", id: "alice" } }), // reactive — re-derive on swap
|
|
186
|
+
* policies: [
|
|
187
|
+
* { effect: "allow", action: "read", actorType: "human" },
|
|
188
|
+
* { effect: "deny", action: "write", pathPattern: "system::*" },
|
|
189
|
+
* ],
|
|
190
|
+
* mode: "enforce",
|
|
191
|
+
* });
|
|
192
|
+
*
|
|
193
|
+
* // Canonical: subscribe to the mounted reactive describe (no per-call leak).
|
|
194
|
+
* guarded.scopedDescribe.subscribe((msgs) => { /* live describe per actor / topology change *\/ });
|
|
195
|
+
* // Per-call escape hatch (different actor / detail) — caller manages dispose.
|
|
196
|
+
* const detailed = guarded.scopedDescribeNode(undefined, { detail: "standard" });
|
|
197
|
+
* try { detailed.node.subscribe(/* … *\/); } finally { detailed.dispose(); }
|
|
198
|
+
* guarded.violations.events.subscribe(msgs => console.log("violations:", msgs));
|
|
199
|
+
* guarded.lints.events.subscribe(msgs => console.warn("lints:", msgs));
|
|
200
|
+
* guarded.scope.subscribe(msgs => console.log("scope:", msgs));
|
|
201
|
+
* ```
|
|
202
|
+
*
|
|
203
|
+
* @category patterns
|
|
204
|
+
*/
|
|
205
|
+
declare function guardedExecution(target: Graph, opts: GuardedExecutionOptions): GuardedExecutionGraph;
|
|
206
|
+
|
|
207
|
+
export { GuardedExecutionGraph as G, type GuardedExecutionLint as a, type GuardedExecutionOptions as b, type GuardedScope as c, guardedExecution as g };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { T as ToObservableOptions, t as toObservable } from './observable-
|
|
1
|
+
import { T as ToObservableOptions, t as toObservable } from './observable-BXQoW1P-.cjs';
|
|
2
|
+
import { Graph, GraphPersistSnapshot } from '@graphrefly/pure-ts/graph';
|
|
2
3
|
import { OnModuleInit, OnModuleDestroy, ExecutionContext, CanActivate, DynamicModule } from '@nestjs/common';
|
|
3
4
|
import { ModuleRef } from '@nestjs/core';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { AppendLogStorageTier } from './extra/storage-tiers.js';
|
|
5
|
+
import { Actor } from '@graphrefly/pure-ts/core';
|
|
6
|
+
import { CqrsOptions, CqrsGraph, CqrsEvent } from './utils/cqrs/index.cjs';
|
|
7
|
+
import { AppendLogStorageTier } from '@graphrefly/pure-ts/extra';
|
|
8
8
|
|
|
9
9
|
/** Class constructor key for decorator registries and Nest `ModuleRef.get()`. */
|
|
10
10
|
type DecoratorHostConstructor = abstract new (...args: unknown[]) => unknown;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { T as ToObservableOptions, t as toObservable } from './observable-
|
|
1
|
+
import { T as ToObservableOptions, t as toObservable } from './observable-BXQoW1P-.js';
|
|
2
|
+
import { Graph, GraphPersistSnapshot } from '@graphrefly/pure-ts/graph';
|
|
2
3
|
import { OnModuleInit, OnModuleDestroy, ExecutionContext, CanActivate, DynamicModule } from '@nestjs/common';
|
|
3
4
|
import { ModuleRef } from '@nestjs/core';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { AppendLogStorageTier } from './extra/storage-tiers.cjs';
|
|
5
|
+
import { Actor } from '@graphrefly/pure-ts/core';
|
|
6
|
+
import { CqrsOptions, CqrsGraph, CqrsEvent } from './utils/cqrs/index.js';
|
|
7
|
+
import { AppendLogStorageTier } from '@graphrefly/pure-ts/extra';
|
|
8
8
|
|
|
9
9
|
/** Class constructor key for decorator registries and Nest `ModuleRef.get()`. */
|
|
10
10
|
type DecoratorHostConstructor = abstract new (...args: unknown[]) => unknown;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Node } from '@graphrefly/pure-ts/core';
|
|
2
|
+
import { Graph } from '@graphrefly/pure-ts/graph';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* DS-14.6.A U-A — tagged context substrate (Phase 14.5).
|
|
6
|
+
*
|
|
7
|
+
* Per-view tagged context (SESSION-DS-14.6-A L3–L6 + SESSION-DS-14.6-A-9Q
|
|
8
|
+
* implementation walk). Pool stores immutable tier-0 originals on an
|
|
9
|
+
* **append-only `reactiveLog`** (D-A4 — structural tier-0 immutability, free
|
|
10
|
+
* `LogChange` mutations, side-steps the DS14R1 TTL/LRU prune-fidelity bug).
|
|
11
|
+
* Each consumer holds a `ContextView` that materialises its own filtered +
|
|
12
|
+
* compressed slice (`Node<readonly RenderedEntry[]>`). Routing is mechanical
|
|
13
|
+
* tag comparison (zero LLM); only `llm-summary` rules cross to an injected
|
|
14
|
+
* `llmCompress` (D-A3). Compression cache is one shared `(id, tier)` map in
|
|
15
|
+
* the pool bundle, bounded LRU (D-A5). Schema is pure data, presentation
|
|
16
|
+
* layer (D-A1) — no `@graphrefly/pure-ts` consumer.
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
type Tag = string;
|
|
22
|
+
/** Compression tier. 0 = original; higher = more compressed. */
|
|
23
|
+
type Tier = 0 | 1 | 2 | 3;
|
|
24
|
+
interface ContextEntry<T> {
|
|
25
|
+
/** Stable id — cache key component `(id, tier)`. Auto-assigned if omitted. */
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly payload: T;
|
|
28
|
+
readonly tags: readonly Tag[];
|
|
29
|
+
/** 0..1. Budget/GC ordering. */
|
|
30
|
+
readonly importance: number;
|
|
31
|
+
readonly compressible: boolean;
|
|
32
|
+
readonly topic: string;
|
|
33
|
+
/** Wall-clock at add (ns) — used by `poolGC({ olderThanNs })`. */
|
|
34
|
+
readonly t_ns: number;
|
|
35
|
+
}
|
|
36
|
+
interface RuleMatch {
|
|
37
|
+
readonly topic?: string | RegExp;
|
|
38
|
+
readonly tagsAny?: readonly Tag[];
|
|
39
|
+
readonly importanceMin?: number;
|
|
40
|
+
readonly importanceMax?: number;
|
|
41
|
+
readonly compressible?: boolean;
|
|
42
|
+
}
|
|
43
|
+
type CompressionRule = {
|
|
44
|
+
readonly match: RuleMatch;
|
|
45
|
+
readonly action: "evict";
|
|
46
|
+
} | {
|
|
47
|
+
readonly match: RuleMatch;
|
|
48
|
+
readonly action: "truncate";
|
|
49
|
+
readonly maxChars: number;
|
|
50
|
+
} | {
|
|
51
|
+
readonly match: RuleMatch;
|
|
52
|
+
readonly action: "reference";
|
|
53
|
+
} | {
|
|
54
|
+
readonly match: RuleMatch;
|
|
55
|
+
readonly action: "llm-summary";
|
|
56
|
+
readonly toTier: Tier;
|
|
57
|
+
};
|
|
58
|
+
interface RenderedEntry<T> {
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly topic: string;
|
|
61
|
+
readonly tags: readonly Tag[];
|
|
62
|
+
readonly tier: Tier;
|
|
63
|
+
/** Original payload at tier 0; compressed `string` otherwise. */
|
|
64
|
+
readonly payload: T | string;
|
|
65
|
+
readonly compressed: boolean;
|
|
66
|
+
}
|
|
67
|
+
interface ContextView<T> {
|
|
68
|
+
readonly filter: (e: ContextEntry<T>) => boolean;
|
|
69
|
+
/** 0..1. A rule fires when `pressure > 0` and the entry matches. */
|
|
70
|
+
readonly pressure: Node<number>;
|
|
71
|
+
readonly budgetTokens: number;
|
|
72
|
+
readonly rules: readonly CompressionRule[];
|
|
73
|
+
/** Default `s => Math.ceil(s.length / 4)`. */
|
|
74
|
+
readonly tokenizer?: (s: string) => number;
|
|
75
|
+
}
|
|
76
|
+
interface PoolGCPolicy {
|
|
77
|
+
/** Drop entries with `t_ns < (now - olderThanNs)`. */
|
|
78
|
+
readonly olderThanNs?: number;
|
|
79
|
+
/** Drop entries with `importance < importanceBelow`. */
|
|
80
|
+
readonly importanceBelow?: number;
|
|
81
|
+
/**
|
|
82
|
+
* **Scope**, not a match-to-evict rule: when set, GC only considers
|
|
83
|
+
* entries whose `topic === this`; entries of other topics always survive.
|
|
84
|
+
* `olderThanNs` / `importanceBelow` are ANDed *within* this scope.
|
|
85
|
+
*/
|
|
86
|
+
readonly topic?: string;
|
|
87
|
+
/** Keep at most this many most-recent entries. */
|
|
88
|
+
readonly max?: number;
|
|
89
|
+
}
|
|
90
|
+
/** `(entry, toTier) => compressedText`. Injected; required iff a view uses `llm-summary`. */
|
|
91
|
+
type LlmCompress<T> = (entry: ContextEntry<T>, toTier: Tier) => string;
|
|
92
|
+
interface TaggedContextPoolOptions<T> {
|
|
93
|
+
readonly topic: string;
|
|
94
|
+
/** Forwarded to the backing append-only `reactiveLog` (poolGC ceiling). */
|
|
95
|
+
readonly maxEntries?: number;
|
|
96
|
+
/** Required iff any rendered view uses an `llm-summary` rule (D-A3). */
|
|
97
|
+
readonly llmCompress?: LlmCompress<T>;
|
|
98
|
+
/** Shared `(id, tier)` compression cache cap (D-A5). Default 512. */
|
|
99
|
+
readonly cacheMax?: number;
|
|
100
|
+
readonly name?: string;
|
|
101
|
+
}
|
|
102
|
+
interface TaggedContextPoolBundle<T> {
|
|
103
|
+
/**
|
|
104
|
+
* Append an entry (immutable tier-0). Returns its id (auto-assigned
|
|
105
|
+
* `ctx-N` per-pool if omitted).
|
|
106
|
+
*
|
|
107
|
+
* **Caller-supplied ids must be unique within the pool.** The log is
|
|
108
|
+
* append-only and does NOT dedupe; the compression cache is keyed by
|
|
109
|
+
* `(id, tier)`, so appending two different entries with the same explicit
|
|
110
|
+
* `id` makes the second render the first's cached summary (QA P11).
|
|
111
|
+
*/
|
|
112
|
+
add(entry: Omit<ContextEntry<T>, "id" | "t_ns"> & {
|
|
113
|
+
id?: string;
|
|
114
|
+
}): string;
|
|
115
|
+
/** All live tier-0 entries. */
|
|
116
|
+
readonly entries: Node<readonly ContextEntry<T>[]>;
|
|
117
|
+
/** Entries carrying `tag`. */
|
|
118
|
+
byTag(tag: Tag): Node<readonly ContextEntry<T>[]>;
|
|
119
|
+
/** Pool-global retention (L6 — distinct from per-view filtering). Returns removed count. */
|
|
120
|
+
poolGC(policy: PoolGCPolicy): number;
|
|
121
|
+
readonly graph: Graph;
|
|
122
|
+
/** Internal — shared compression cache (one per pool, D-A5). */
|
|
123
|
+
readonly _cache: CompressionCache;
|
|
124
|
+
readonly _opts: TaggedContextPoolOptions<T>;
|
|
125
|
+
dispose(): void;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Bounded LRU cache keyed by `(id, tier)`. Uses a nested `Map<id, Map<tier,
|
|
129
|
+
* value>>` (NOT a `${id}::${tier}` string key) so a caller-supplied `id`
|
|
130
|
+
* containing the separator cannot collide (QA P5). LRU is tracked at the
|
|
131
|
+
* (id,tier) leaf via a flat insertion-order key list.
|
|
132
|
+
*/
|
|
133
|
+
declare class CompressionCache {
|
|
134
|
+
private readonly _max;
|
|
135
|
+
private readonly _m;
|
|
136
|
+
/** Insertion-order list of `id` keys for LRU eviction at the id granularity. */
|
|
137
|
+
private readonly _order;
|
|
138
|
+
constructor(_max: number);
|
|
139
|
+
get(id: string, tier: Tier): string | undefined;
|
|
140
|
+
set(id: string, tier: Tier, value: string): void;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Append-only tagged context pool (D-A4). The pool is a `reactiveLog` of
|
|
144
|
+
* immutable tier-0 entries plus a derived `entries` node; `byTag` derives a
|
|
145
|
+
* filtered view; `poolGC` is the explicit pool-global retention (L6).
|
|
146
|
+
*/
|
|
147
|
+
declare function taggedContextPool<T>(parent: Graph, opts: TaggedContextPoolOptions<T>): TaggedContextPoolBundle<T>;
|
|
148
|
+
/**
|
|
149
|
+
* Apply the first matching rule to one entry under `pressure`. Non-LLM
|
|
150
|
+
* strategies (truncate / evict / reference) are pure data; `llm-summary`
|
|
151
|
+
* calls the injected `llmCompress`, caching by `(id, toTier)` (D-A5).
|
|
152
|
+
* Returns `undefined` for evicted / pressure-filtered entries.
|
|
153
|
+
*/
|
|
154
|
+
declare function tierCompress<T>(e: ContextEntry<T>, rules: readonly CompressionRule[], pressure: number, cache: CompressionCache, llmCompress?: LlmCompress<T>): RenderedEntry<T> | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Per-consumer reactive rendering (D-A2). Materialises a
|
|
157
|
+
* `Node<readonly RenderedEntry[]>` over the pool: filter → per-entry rule
|
|
158
|
+
* application under `pressure` → token-budget trim (lowest-importance first).
|
|
159
|
+
*
|
|
160
|
+
* Recomputes the slice per `(entries | pressure)` wave (O(n) — behaviourally
|
|
161
|
+
* identical to the incremental closure-mirror; incremental is a perf
|
|
162
|
+
* follow-up, not a correctness gap).
|
|
163
|
+
*
|
|
164
|
+
* @throws if any rule is `llm-summary` and the pool has no `llmCompress`
|
|
165
|
+
* (D-A3 construction guard).
|
|
166
|
+
*/
|
|
167
|
+
declare function renderContextView<T>(pool: TaggedContextPoolBundle<T>, view: ContextView<T>): Node<readonly RenderedEntry<T>[]>;
|
|
168
|
+
|
|
169
|
+
export { CompressionCache as C, type LlmCompress as L, type PoolGCPolicy as P, type RenderedEntry as R, type Tag as T, type CompressionRule as a, type ContextEntry as b, type ContextView as c, type RuleMatch as d, type TaggedContextPoolBundle as e, type TaggedContextPoolOptions as f, type Tier as g, tierCompress as h, renderContextView as r, taggedContextPool as t };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Node } from '@graphrefly/pure-ts/core';
|
|
2
|
+
import { Graph } from '@graphrefly/pure-ts/graph';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* DS-14.6.A U-A — tagged context substrate (Phase 14.5).
|
|
6
|
+
*
|
|
7
|
+
* Per-view tagged context (SESSION-DS-14.6-A L3–L6 + SESSION-DS-14.6-A-9Q
|
|
8
|
+
* implementation walk). Pool stores immutable tier-0 originals on an
|
|
9
|
+
* **append-only `reactiveLog`** (D-A4 — structural tier-0 immutability, free
|
|
10
|
+
* `LogChange` mutations, side-steps the DS14R1 TTL/LRU prune-fidelity bug).
|
|
11
|
+
* Each consumer holds a `ContextView` that materialises its own filtered +
|
|
12
|
+
* compressed slice (`Node<readonly RenderedEntry[]>`). Routing is mechanical
|
|
13
|
+
* tag comparison (zero LLM); only `llm-summary` rules cross to an injected
|
|
14
|
+
* `llmCompress` (D-A3). Compression cache is one shared `(id, tier)` map in
|
|
15
|
+
* the pool bundle, bounded LRU (D-A5). Schema is pure data, presentation
|
|
16
|
+
* layer (D-A1) — no `@graphrefly/pure-ts` consumer.
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
type Tag = string;
|
|
22
|
+
/** Compression tier. 0 = original; higher = more compressed. */
|
|
23
|
+
type Tier = 0 | 1 | 2 | 3;
|
|
24
|
+
interface ContextEntry<T> {
|
|
25
|
+
/** Stable id — cache key component `(id, tier)`. Auto-assigned if omitted. */
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly payload: T;
|
|
28
|
+
readonly tags: readonly Tag[];
|
|
29
|
+
/** 0..1. Budget/GC ordering. */
|
|
30
|
+
readonly importance: number;
|
|
31
|
+
readonly compressible: boolean;
|
|
32
|
+
readonly topic: string;
|
|
33
|
+
/** Wall-clock at add (ns) — used by `poolGC({ olderThanNs })`. */
|
|
34
|
+
readonly t_ns: number;
|
|
35
|
+
}
|
|
36
|
+
interface RuleMatch {
|
|
37
|
+
readonly topic?: string | RegExp;
|
|
38
|
+
readonly tagsAny?: readonly Tag[];
|
|
39
|
+
readonly importanceMin?: number;
|
|
40
|
+
readonly importanceMax?: number;
|
|
41
|
+
readonly compressible?: boolean;
|
|
42
|
+
}
|
|
43
|
+
type CompressionRule = {
|
|
44
|
+
readonly match: RuleMatch;
|
|
45
|
+
readonly action: "evict";
|
|
46
|
+
} | {
|
|
47
|
+
readonly match: RuleMatch;
|
|
48
|
+
readonly action: "truncate";
|
|
49
|
+
readonly maxChars: number;
|
|
50
|
+
} | {
|
|
51
|
+
readonly match: RuleMatch;
|
|
52
|
+
readonly action: "reference";
|
|
53
|
+
} | {
|
|
54
|
+
readonly match: RuleMatch;
|
|
55
|
+
readonly action: "llm-summary";
|
|
56
|
+
readonly toTier: Tier;
|
|
57
|
+
};
|
|
58
|
+
interface RenderedEntry<T> {
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly topic: string;
|
|
61
|
+
readonly tags: readonly Tag[];
|
|
62
|
+
readonly tier: Tier;
|
|
63
|
+
/** Original payload at tier 0; compressed `string` otherwise. */
|
|
64
|
+
readonly payload: T | string;
|
|
65
|
+
readonly compressed: boolean;
|
|
66
|
+
}
|
|
67
|
+
interface ContextView<T> {
|
|
68
|
+
readonly filter: (e: ContextEntry<T>) => boolean;
|
|
69
|
+
/** 0..1. A rule fires when `pressure > 0` and the entry matches. */
|
|
70
|
+
readonly pressure: Node<number>;
|
|
71
|
+
readonly budgetTokens: number;
|
|
72
|
+
readonly rules: readonly CompressionRule[];
|
|
73
|
+
/** Default `s => Math.ceil(s.length / 4)`. */
|
|
74
|
+
readonly tokenizer?: (s: string) => number;
|
|
75
|
+
}
|
|
76
|
+
interface PoolGCPolicy {
|
|
77
|
+
/** Drop entries with `t_ns < (now - olderThanNs)`. */
|
|
78
|
+
readonly olderThanNs?: number;
|
|
79
|
+
/** Drop entries with `importance < importanceBelow`. */
|
|
80
|
+
readonly importanceBelow?: number;
|
|
81
|
+
/**
|
|
82
|
+
* **Scope**, not a match-to-evict rule: when set, GC only considers
|
|
83
|
+
* entries whose `topic === this`; entries of other topics always survive.
|
|
84
|
+
* `olderThanNs` / `importanceBelow` are ANDed *within* this scope.
|
|
85
|
+
*/
|
|
86
|
+
readonly topic?: string;
|
|
87
|
+
/** Keep at most this many most-recent entries. */
|
|
88
|
+
readonly max?: number;
|
|
89
|
+
}
|
|
90
|
+
/** `(entry, toTier) => compressedText`. Injected; required iff a view uses `llm-summary`. */
|
|
91
|
+
type LlmCompress<T> = (entry: ContextEntry<T>, toTier: Tier) => string;
|
|
92
|
+
interface TaggedContextPoolOptions<T> {
|
|
93
|
+
readonly topic: string;
|
|
94
|
+
/** Forwarded to the backing append-only `reactiveLog` (poolGC ceiling). */
|
|
95
|
+
readonly maxEntries?: number;
|
|
96
|
+
/** Required iff any rendered view uses an `llm-summary` rule (D-A3). */
|
|
97
|
+
readonly llmCompress?: LlmCompress<T>;
|
|
98
|
+
/** Shared `(id, tier)` compression cache cap (D-A5). Default 512. */
|
|
99
|
+
readonly cacheMax?: number;
|
|
100
|
+
readonly name?: string;
|
|
101
|
+
}
|
|
102
|
+
interface TaggedContextPoolBundle<T> {
|
|
103
|
+
/**
|
|
104
|
+
* Append an entry (immutable tier-0). Returns its id (auto-assigned
|
|
105
|
+
* `ctx-N` per-pool if omitted).
|
|
106
|
+
*
|
|
107
|
+
* **Caller-supplied ids must be unique within the pool.** The log is
|
|
108
|
+
* append-only and does NOT dedupe; the compression cache is keyed by
|
|
109
|
+
* `(id, tier)`, so appending two different entries with the same explicit
|
|
110
|
+
* `id` makes the second render the first's cached summary (QA P11).
|
|
111
|
+
*/
|
|
112
|
+
add(entry: Omit<ContextEntry<T>, "id" | "t_ns"> & {
|
|
113
|
+
id?: string;
|
|
114
|
+
}): string;
|
|
115
|
+
/** All live tier-0 entries. */
|
|
116
|
+
readonly entries: Node<readonly ContextEntry<T>[]>;
|
|
117
|
+
/** Entries carrying `tag`. */
|
|
118
|
+
byTag(tag: Tag): Node<readonly ContextEntry<T>[]>;
|
|
119
|
+
/** Pool-global retention (L6 — distinct from per-view filtering). Returns removed count. */
|
|
120
|
+
poolGC(policy: PoolGCPolicy): number;
|
|
121
|
+
readonly graph: Graph;
|
|
122
|
+
/** Internal — shared compression cache (one per pool, D-A5). */
|
|
123
|
+
readonly _cache: CompressionCache;
|
|
124
|
+
readonly _opts: TaggedContextPoolOptions<T>;
|
|
125
|
+
dispose(): void;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Bounded LRU cache keyed by `(id, tier)`. Uses a nested `Map<id, Map<tier,
|
|
129
|
+
* value>>` (NOT a `${id}::${tier}` string key) so a caller-supplied `id`
|
|
130
|
+
* containing the separator cannot collide (QA P5). LRU is tracked at the
|
|
131
|
+
* (id,tier) leaf via a flat insertion-order key list.
|
|
132
|
+
*/
|
|
133
|
+
declare class CompressionCache {
|
|
134
|
+
private readonly _max;
|
|
135
|
+
private readonly _m;
|
|
136
|
+
/** Insertion-order list of `id` keys for LRU eviction at the id granularity. */
|
|
137
|
+
private readonly _order;
|
|
138
|
+
constructor(_max: number);
|
|
139
|
+
get(id: string, tier: Tier): string | undefined;
|
|
140
|
+
set(id: string, tier: Tier, value: string): void;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Append-only tagged context pool (D-A4). The pool is a `reactiveLog` of
|
|
144
|
+
* immutable tier-0 entries plus a derived `entries` node; `byTag` derives a
|
|
145
|
+
* filtered view; `poolGC` is the explicit pool-global retention (L6).
|
|
146
|
+
*/
|
|
147
|
+
declare function taggedContextPool<T>(parent: Graph, opts: TaggedContextPoolOptions<T>): TaggedContextPoolBundle<T>;
|
|
148
|
+
/**
|
|
149
|
+
* Apply the first matching rule to one entry under `pressure`. Non-LLM
|
|
150
|
+
* strategies (truncate / evict / reference) are pure data; `llm-summary`
|
|
151
|
+
* calls the injected `llmCompress`, caching by `(id, toTier)` (D-A5).
|
|
152
|
+
* Returns `undefined` for evicted / pressure-filtered entries.
|
|
153
|
+
*/
|
|
154
|
+
declare function tierCompress<T>(e: ContextEntry<T>, rules: readonly CompressionRule[], pressure: number, cache: CompressionCache, llmCompress?: LlmCompress<T>): RenderedEntry<T> | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Per-consumer reactive rendering (D-A2). Materialises a
|
|
157
|
+
* `Node<readonly RenderedEntry[]>` over the pool: filter → per-entry rule
|
|
158
|
+
* application under `pressure` → token-budget trim (lowest-importance first).
|
|
159
|
+
*
|
|
160
|
+
* Recomputes the slice per `(entries | pressure)` wave (O(n) — behaviourally
|
|
161
|
+
* identical to the incremental closure-mirror; incremental is a perf
|
|
162
|
+
* follow-up, not a correctness gap).
|
|
163
|
+
*
|
|
164
|
+
* @throws if any rule is `llm-summary` and the pool has no `llmCompress`
|
|
165
|
+
* (D-A3 construction guard).
|
|
166
|
+
*/
|
|
167
|
+
declare function renderContextView<T>(pool: TaggedContextPoolBundle<T>, view: ContextView<T>): Node<readonly RenderedEntry<T>[]>;
|
|
168
|
+
|
|
169
|
+
export { CompressionCache as C, type LlmCompress as L, type PoolGCPolicy as P, type RenderedEntry as R, type Tag as T, type CompressionRule as a, type ContextEntry as b, type ContextView as c, type RuleMatch as d, type TaggedContextPoolBundle as e, type TaggedContextPoolOptions as f, type Tier as g, tierCompress as h, renderContextView as r, taggedContextPool as t };
|