@graphrefly/graphrefly 0.45.0 → 0.47.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 +1 -2
- 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 +865 -0
- package/dist/base/composition/index.cjs.map +1 -0
- package/dist/base/composition/index.d.cts +468 -0
- package/dist/base/composition/index.d.ts +468 -0
- package/dist/base/composition/index.js +40 -0
- package/dist/base/composition/index.js.map +1 -0
- package/dist/base/index.cjs +6390 -0
- package/dist/base/index.cjs.map +1 -0
- package/dist/base/index.d.cts +21 -0
- package/dist/base/index.d.ts +21 -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/base/render/index.d.cts +227 -0
- package/dist/base/render/index.d.ts +227 -0
- 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/base/sources/index.d.cts +357 -0
- package/dist/base/sources/index.d.ts +357 -0
- 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/base/sources/node/index.d.cts +185 -0
- package/dist/base/sources/node/index.d.ts +185 -0
- 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-CSSbKGrJ.d.ts +199 -0
- package/dist/cascading-baGkiihI.d.cts +199 -0
- package/dist/chunk-22SG74BD.js +207 -0
- package/dist/chunk-22SG74BD.js.map +1 -0
- 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-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-5IMMNARC.js +1153 -0
- package/dist/chunk-5IMMNARC.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-EHRRQ4IC.js +211 -0
- package/dist/chunk-EHRRQ4IC.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-FW23JYNQ.js +454 -0
- package/dist/chunk-FW23JYNQ.js.map +1 -0
- package/dist/chunk-GWRNLJNW.js +2508 -0
- package/dist/chunk-GWRNLJNW.js.map +1 -0
- package/dist/chunk-HL7HUJIX.js +1 -0
- package/dist/chunk-HL7HUJIX.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-JKTC747G.js +725 -0
- package/dist/chunk-JKTC747G.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-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-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-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-TNX5ZGDJ.js +574 -0
- package/dist/chunk-TNX5ZGDJ.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-VLAGJZSL.js +1079 -0
- package/dist/chunk-VLAGJZSL.js.map +1 -0
- package/dist/chunk-W2BOPXTI.js +1 -0
- package/dist/chunk-W2BOPXTI.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-Z65DVDEQ.js +146 -0
- package/dist/chunk-Z65DVDEQ.js.map +1 -0
- package/dist/chunk-Z6EGP5D7.js +92 -0
- package/dist/chunk-Z6EGP5D7.js.map +1 -0
- package/dist/chunk-ZT4WMQW4.js +1575 -0
- package/dist/chunk-ZT4WMQW4.js.map +1 -0
- package/dist/chunk-ZVXXDWIB.js +1282 -0
- package/dist/chunk-ZVXXDWIB.js.map +1 -0
- package/dist/compat/index.cjs +3150 -6
- package/dist/compat/index.cjs.map +1 -1
- package/dist/compat/index.d.cts +116 -1
- package/dist/compat/index.d.ts +116 -1
- package/dist/compat/index.js +175 -2
- package/dist/compat/index.js.map +1 -1
- package/dist/compat/jotai/index.cjs +130 -2
- package/dist/compat/jotai/index.cjs.map +1 -1
- package/dist/compat/jotai/index.d.cts +2 -1
- package/dist/compat/jotai/index.d.ts +2 -1
- package/dist/compat/jotai/index.js +7 -2
- package/dist/compat/jotai/index.js.map +1 -1
- package/dist/compat/nanostores/index.cjs +186 -2
- package/dist/compat/nanostores/index.cjs.map +1 -1
- package/dist/compat/nanostores/index.d.cts +2 -1
- package/dist/compat/nanostores/index.d.ts +2 -1
- package/dist/compat/nanostores/index.js +21 -2
- package/dist/compat/nanostores/index.js.map +1 -1
- package/dist/compat/nestjs/index.cjs +2291 -6
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +10 -1
- package/dist/compat/nestjs/index.d.ts +10 -1
- package/dist/compat/nestjs/index.js +76 -2
- package/dist/compat/nestjs/index.js.map +1 -1
- package/dist/compat/react/index.cjs +95 -2
- package/dist/compat/react/index.cjs.map +1 -1
- package/dist/compat/react/index.d.cts +2 -1
- package/dist/compat/react/index.d.ts +2 -1
- package/dist/compat/react/index.js +11 -2
- package/dist/compat/react/index.js.map +1 -1
- package/dist/compat/solid/index.cjs +82 -2
- package/dist/compat/solid/index.cjs.map +1 -1
- package/dist/compat/solid/index.d.cts +2 -1
- package/dist/compat/solid/index.d.ts +2 -1
- package/dist/compat/solid/index.js +11 -2
- package/dist/compat/solid/index.js.map +1 -1
- package/dist/compat/svelte/index.cjs +85 -2
- package/dist/compat/svelte/index.cjs.map +1 -1
- package/dist/compat/svelte/index.d.cts +2 -1
- package/dist/compat/svelte/index.d.ts +2 -1
- package/dist/compat/svelte/index.js +11 -2
- package/dist/compat/svelte/index.js.map +1 -1
- package/dist/compat/vue/index.cjs +100 -2
- package/dist/compat/vue/index.cjs.map +1 -1
- package/dist/compat/vue/index.d.cts +3 -1
- package/dist/compat/vue/index.d.ts +3 -1
- package/dist/compat/vue/index.js +11 -2
- package/dist/compat/vue/index.js.map +1 -1
- package/dist/compat/zustand/index.cjs +50 -2
- package/dist/compat/zustand/index.cjs.map +1 -1
- package/dist/compat/zustand/index.d.cts +2 -1
- package/dist/compat/zustand/index.d.ts +2 -1
- package/dist/compat/zustand/index.js +7 -2
- package/dist/compat/zustand/index.js.map +1 -1
- 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-Bx46zqky.d.cts +243 -0
- package/dist/fallback-pIWW8A2d.d.ts +243 -0
- package/dist/guarded-execution-BcdtxeBk.d.ts +207 -0
- package/dist/guarded-execution-C-3hnP6A.d.cts +207 -0
- package/dist/index-B6pxYJzO.d.cts +36 -0
- package/dist/index-B6pxYJzO.d.ts +36 -0
- package/dist/index-BFsng6v1.d.cts +44 -0
- package/dist/index-BFsng6v1.d.ts +44 -0
- package/dist/index-B_p8tnvf.d.cts +770 -0
- package/dist/index-Bg-LwEt-.d.cts +45 -0
- package/dist/index-Bg-LwEt-.d.ts +45 -0
- package/dist/index-Brp888t0.d.cts +127 -0
- package/dist/index-Brp888t0.d.ts +127 -0
- package/dist/index-CDfk6jHN.d.cts +37 -0
- package/dist/index-CDfk6jHN.d.ts +37 -0
- package/dist/index-DLAxYaN5.d.cts +169 -0
- package/dist/index-DLAxYaN5.d.ts +169 -0
- package/dist/index-DeWbQzMe.d.cts +34 -0
- package/dist/index-DeWbQzMe.d.ts +34 -0
- package/dist/index-_HDSmPyp.d.ts +770 -0
- package/dist/index-dX9IzPqj.d.cts +86 -0
- package/dist/index-dX9IzPqj.d.ts +86 -0
- package/dist/index.cjs +26009 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -42
- package/dist/index.d.ts +55 -42
- package/dist/index.js +849 -0
- package/dist/index.js.map +1 -1
- 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-B25XqCbZ.d.cts +59 -0
- package/dist/observable-B25XqCbZ.d.ts +59 -0
- package/dist/pipeline-graph-Ce47CB6Y.d.cts +145 -0
- package/dist/pipeline-graph-DXCwY9vG.d.ts +145 -0
- 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-fswlBUvX.d.cts +195 -0
- package/dist/reactive-layout-fswlBUvX.d.ts +195 -0
- 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-BB5Lw-pB.d.cts +442 -0
- package/dist/types-BB5Lw-pB.d.ts +442 -0
- 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/utils/ai/browser.d.cts +129 -0
- package/dist/utils/ai/browser.d.ts +129 -0
- 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/utils/ai/index.d.cts +1777 -0
- package/dist/utils/ai/index.d.ts +1777 -0
- 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/utils/ai/node.d.cts +57 -0
- package/dist/utils/ai/node.d.ts +57 -0
- 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/utils/cqrs/index.d.cts +438 -0
- package/dist/utils/cqrs/index.d.ts +438 -0
- 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/utils/demo-shell/index.d.cts +90 -0
- package/dist/utils/demo-shell/index.d.ts +90 -0
- 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/utils/domain-templates/index.d.cts +214 -0
- package/dist/utils/domain-templates/index.d.ts +214 -0
- 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/utils/graphspec/index.d.cts +449 -0
- package/dist/utils/graphspec/index.d.ts +449 -0
- 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 +17614 -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/utils/job-queue/index.d.cts +200 -0
- package/dist/utils/job-queue/index.d.ts +200 -0
- 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 +1456 -0
- package/dist/utils/memory/index.cjs.map +1 -0
- package/dist/utils/memory/index.d.cts +660 -0
- package/dist/utils/memory/index.d.ts +660 -0
- 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/utils/process/index.d.cts +411 -0
- package/dist/utils/process/index.d.ts +411 -0
- 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/utils/reactive-layout/index.d.cts +492 -0
- package/dist/utils/reactive-layout/index.d.ts +492 -0
- 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/utils/reduction/index.d.cts +102 -0
- package/dist/utils/reduction/index.d.ts +102 -0
- 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/utils/surface/index.d.cts +240 -0
- package/dist/utils/surface/index.d.ts +240 -0
- 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 +293 -241
- package/dist/core/index.cjs +0 -21
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.d.cts +0 -1
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.js +0 -3
- package/dist/core/index.js.map +0 -1
- package/dist/extra/browser.cjs +0 -21
- package/dist/extra/browser.cjs.map +0 -1
- package/dist/extra/browser.d.cts +0 -1
- package/dist/extra/browser.d.ts +0 -1
- package/dist/extra/browser.js +0 -3
- package/dist/extra/browser.js.map +0 -1
- package/dist/extra/index.cjs +0 -21
- package/dist/extra/index.cjs.map +0 -1
- package/dist/extra/index.d.cts +0 -1
- package/dist/extra/index.d.ts +0 -1
- package/dist/extra/index.js +0 -3
- package/dist/extra/index.js.map +0 -1
- package/dist/extra/node.cjs +0 -21
- package/dist/extra/node.cjs.map +0 -1
- package/dist/extra/node.d.cts +0 -1
- package/dist/extra/node.d.ts +0 -1
- package/dist/extra/node.js +0 -3
- package/dist/extra/node.js.map +0 -1
- package/dist/extra/operators.cjs +0 -21
- package/dist/extra/operators.cjs.map +0 -1
- package/dist/extra/operators.d.cts +0 -1
- package/dist/extra/operators.d.ts +0 -1
- package/dist/extra/operators.js +0 -3
- package/dist/extra/operators.js.map +0 -1
- package/dist/extra/reactive.cjs +0 -21
- package/dist/extra/reactive.cjs.map +0 -1
- package/dist/extra/reactive.d.cts +0 -1
- package/dist/extra/reactive.d.ts +0 -1
- package/dist/extra/reactive.js +0 -3
- package/dist/extra/reactive.js.map +0 -1
- package/dist/extra/render/index.cjs +0 -21
- package/dist/extra/render/index.cjs.map +0 -1
- package/dist/extra/render/index.d.cts +0 -1
- package/dist/extra/render/index.d.ts +0 -1
- package/dist/extra/render/index.js +0 -3
- package/dist/extra/render/index.js.map +0 -1
- package/dist/extra/sources.cjs +0 -21
- package/dist/extra/sources.cjs.map +0 -1
- package/dist/extra/sources.d.cts +0 -1
- package/dist/extra/sources.d.ts +0 -1
- package/dist/extra/sources.js +0 -3
- package/dist/extra/sources.js.map +0 -1
- package/dist/extra/storage-browser.cjs +0 -21
- package/dist/extra/storage-browser.cjs.map +0 -1
- package/dist/extra/storage-browser.d.cts +0 -1
- package/dist/extra/storage-browser.d.ts +0 -1
- package/dist/extra/storage-browser.js +0 -3
- package/dist/extra/storage-browser.js.map +0 -1
- package/dist/extra/storage-core.cjs +0 -21
- package/dist/extra/storage-core.cjs.map +0 -1
- package/dist/extra/storage-core.d.cts +0 -1
- package/dist/extra/storage-core.d.ts +0 -1
- package/dist/extra/storage-core.js +0 -3
- package/dist/extra/storage-core.js.map +0 -1
- package/dist/extra/storage-node.cjs +0 -21
- package/dist/extra/storage-node.cjs.map +0 -1
- package/dist/extra/storage-node.d.cts +0 -1
- package/dist/extra/storage-node.d.ts +0 -1
- package/dist/extra/storage-node.js +0 -3
- package/dist/extra/storage-node.js.map +0 -1
- package/dist/extra/storage-tiers-browser.cjs +0 -21
- package/dist/extra/storage-tiers-browser.cjs.map +0 -1
- package/dist/extra/storage-tiers-browser.d.cts +0 -1
- package/dist/extra/storage-tiers-browser.d.ts +0 -1
- package/dist/extra/storage-tiers-browser.js +0 -3
- package/dist/extra/storage-tiers-browser.js.map +0 -1
- package/dist/extra/storage-tiers-node.cjs +0 -21
- package/dist/extra/storage-tiers-node.cjs.map +0 -1
- package/dist/extra/storage-tiers-node.d.cts +0 -1
- package/dist/extra/storage-tiers-node.d.ts +0 -1
- package/dist/extra/storage-tiers-node.js +0 -3
- package/dist/extra/storage-tiers-node.js.map +0 -1
- package/dist/extra/storage-tiers.cjs +0 -21
- package/dist/extra/storage-tiers.cjs.map +0 -1
- package/dist/extra/storage-tiers.d.cts +0 -1
- package/dist/extra/storage-tiers.d.ts +0 -1
- package/dist/extra/storage-tiers.js +0 -3
- package/dist/extra/storage-tiers.js.map +0 -1
- package/dist/extra/storage-wal.cjs +0 -21
- package/dist/extra/storage-wal.cjs.map +0 -1
- package/dist/extra/storage-wal.d.cts +0 -1
- package/dist/extra/storage-wal.d.ts +0 -1
- package/dist/extra/storage-wal.js +0 -3
- package/dist/extra/storage-wal.js.map +0 -1
- package/dist/graph/index.cjs +0 -21
- package/dist/graph/index.cjs.map +0 -1
- package/dist/graph/index.d.cts +0 -1
- package/dist/graph/index.d.ts +0 -1
- package/dist/graph/index.js +0 -3
- package/dist/graph/index.js.map +0 -1
- package/dist/patterns/ai/browser.cjs +0 -21
- package/dist/patterns/ai/browser.cjs.map +0 -1
- package/dist/patterns/ai/browser.d.cts +0 -1
- package/dist/patterns/ai/browser.d.ts +0 -1
- package/dist/patterns/ai/browser.js +0 -3
- package/dist/patterns/ai/browser.js.map +0 -1
- package/dist/patterns/ai/index.cjs +0 -21
- package/dist/patterns/ai/index.cjs.map +0 -1
- package/dist/patterns/ai/index.d.cts +0 -1
- package/dist/patterns/ai/index.d.ts +0 -1
- package/dist/patterns/ai/index.js +0 -3
- package/dist/patterns/ai/index.js.map +0 -1
- package/dist/patterns/ai/node.cjs +0 -21
- package/dist/patterns/ai/node.cjs.map +0 -1
- package/dist/patterns/ai/node.d.cts +0 -1
- package/dist/patterns/ai/node.d.ts +0 -1
- package/dist/patterns/ai/node.js +0 -3
- package/dist/patterns/ai/node.js.map +0 -1
- package/dist/patterns/cqrs/index.cjs +0 -21
- package/dist/patterns/cqrs/index.cjs.map +0 -1
- package/dist/patterns/cqrs/index.d.cts +0 -1
- package/dist/patterns/cqrs/index.d.ts +0 -1
- package/dist/patterns/cqrs/index.js +0 -3
- package/dist/patterns/cqrs/index.js.map +0 -1
- package/dist/patterns/demo-shell/index.cjs +0 -21
- package/dist/patterns/demo-shell/index.cjs.map +0 -1
- package/dist/patterns/demo-shell/index.d.cts +0 -1
- package/dist/patterns/demo-shell/index.d.ts +0 -1
- package/dist/patterns/demo-shell/index.js +0 -3
- package/dist/patterns/demo-shell/index.js.map +0 -1
- package/dist/patterns/domain-templates/index.cjs +0 -21
- package/dist/patterns/domain-templates/index.cjs.map +0 -1
- package/dist/patterns/domain-templates/index.d.cts +0 -1
- package/dist/patterns/domain-templates/index.d.ts +0 -1
- package/dist/patterns/domain-templates/index.js +0 -3
- package/dist/patterns/domain-templates/index.js.map +0 -1
- package/dist/patterns/graphspec/index.cjs +0 -21
- package/dist/patterns/graphspec/index.cjs.map +0 -1
- package/dist/patterns/graphspec/index.d.cts +0 -1
- package/dist/patterns/graphspec/index.d.ts +0 -1
- package/dist/patterns/graphspec/index.js +0 -3
- package/dist/patterns/graphspec/index.js.map +0 -1
- package/dist/patterns/harness/index.cjs +0 -21
- package/dist/patterns/harness/index.cjs.map +0 -1
- package/dist/patterns/harness/index.d.cts +0 -1
- package/dist/patterns/harness/index.d.ts +0 -1
- package/dist/patterns/harness/index.js +0 -3
- package/dist/patterns/harness/index.js.map +0 -1
- package/dist/patterns/inspect/index.cjs +0 -21
- package/dist/patterns/inspect/index.cjs.map +0 -1
- package/dist/patterns/inspect/index.d.cts +0 -1
- package/dist/patterns/inspect/index.d.ts +0 -1
- package/dist/patterns/inspect/index.js +0 -3
- package/dist/patterns/inspect/index.js.map +0 -1
- package/dist/patterns/job-queue/index.cjs +0 -21
- package/dist/patterns/job-queue/index.cjs.map +0 -1
- package/dist/patterns/job-queue/index.d.cts +0 -1
- package/dist/patterns/job-queue/index.d.ts +0 -1
- package/dist/patterns/job-queue/index.js +0 -3
- package/dist/patterns/job-queue/index.js.map +0 -1
- package/dist/patterns/memory/index.cjs +0 -21
- package/dist/patterns/memory/index.cjs.map +0 -1
- package/dist/patterns/memory/index.d.cts +0 -1
- package/dist/patterns/memory/index.d.ts +0 -1
- package/dist/patterns/memory/index.js +0 -3
- package/dist/patterns/memory/index.js.map +0 -1
- package/dist/patterns/messaging/index.cjs +0 -21
- package/dist/patterns/messaging/index.cjs.map +0 -1
- package/dist/patterns/messaging/index.d.cts +0 -1
- package/dist/patterns/messaging/index.d.ts +0 -1
- package/dist/patterns/messaging/index.js +0 -3
- package/dist/patterns/messaging/index.js.map +0 -1
- package/dist/patterns/orchestration/index.cjs +0 -21
- package/dist/patterns/orchestration/index.cjs.map +0 -1
- package/dist/patterns/orchestration/index.d.cts +0 -1
- package/dist/patterns/orchestration/index.d.ts +0 -1
- package/dist/patterns/orchestration/index.js +0 -3
- package/dist/patterns/orchestration/index.js.map +0 -1
- package/dist/patterns/process/index.cjs +0 -21
- package/dist/patterns/process/index.cjs.map +0 -1
- package/dist/patterns/process/index.d.cts +0 -1
- package/dist/patterns/process/index.d.ts +0 -1
- package/dist/patterns/process/index.js +0 -3
- package/dist/patterns/process/index.js.map +0 -1
- package/dist/patterns/reactive-layout/index.cjs +0 -21
- package/dist/patterns/reactive-layout/index.cjs.map +0 -1
- package/dist/patterns/reactive-layout/index.d.cts +0 -1
- package/dist/patterns/reactive-layout/index.d.ts +0 -1
- package/dist/patterns/reactive-layout/index.js +0 -3
- package/dist/patterns/reactive-layout/index.js.map +0 -1
- package/dist/patterns/reduction/index.cjs +0 -21
- package/dist/patterns/reduction/index.cjs.map +0 -1
- package/dist/patterns/reduction/index.d.cts +0 -1
- package/dist/patterns/reduction/index.d.ts +0 -1
- package/dist/patterns/reduction/index.js +0 -3
- package/dist/patterns/reduction/index.js.map +0 -1
- package/dist/patterns/surface/index.cjs +0 -21
- package/dist/patterns/surface/index.cjs.map +0 -1
- package/dist/patterns/surface/index.d.cts +0 -1
- package/dist/patterns/surface/index.d.ts +0 -1
- package/dist/patterns/surface/index.js +0 -3
- package/dist/patterns/surface/index.js.map +0 -1
- package/dist/patterns/topology-view/index.cjs +0 -21
- package/dist/patterns/topology-view/index.cjs.map +0 -1
- package/dist/patterns/topology-view/index.d.cts +0 -1
- package/dist/patterns/topology-view/index.d.ts +0 -1
- package/dist/patterns/topology-view/index.js +0 -3
- package/dist/patterns/topology-view/index.js.map +0 -1
- package/dist/testing/index.cjs +0 -21
- package/dist/testing/index.cjs.map +0 -1
- package/dist/testing/index.d.cts +0 -1
- package/dist/testing/index.d.ts +0 -1
- package/dist/testing/index.js +0 -3
- package/dist/testing/index.js.map +0 -1
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import { Node } from '@graphrefly/pure-ts/core';
|
|
2
|
+
import { NodeInput } from '@graphrefly/pure-ts/extra';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A rate per 1M tokens. Supports threshold-based tiering (Anthropic
|
|
6
|
+
* long-context >200K, Gemini >200K) via optional `thresholdTokens` +
|
|
7
|
+
* `pricePerMillionAbove`.
|
|
8
|
+
*
|
|
9
|
+
* `total input tokens` (sum of every input class) is the axis the threshold
|
|
10
|
+
* applies to — matches how Anthropic and Gemini measure it.
|
|
11
|
+
*/
|
|
12
|
+
interface TieredRate {
|
|
13
|
+
pricePerMillion: number;
|
|
14
|
+
thresholdTokens?: number;
|
|
15
|
+
pricePerMillionAbove?: number;
|
|
16
|
+
}
|
|
17
|
+
/** Shorthand: a plain `number` stands for `{pricePerMillion: n}`. */
|
|
18
|
+
type Rate = TieredRate | number;
|
|
19
|
+
/** USD-per-1M rates per token class. All fields optional. */
|
|
20
|
+
interface ModelPricing {
|
|
21
|
+
input?: {
|
|
22
|
+
regular?: Rate;
|
|
23
|
+
cacheRead?: Rate;
|
|
24
|
+
cacheWrite5m?: Rate;
|
|
25
|
+
cacheWrite1h?: Rate;
|
|
26
|
+
cacheWriteOther?: Rate;
|
|
27
|
+
audio?: Rate;
|
|
28
|
+
image?: Rate;
|
|
29
|
+
video?: Rate;
|
|
30
|
+
toolUse?: Rate;
|
|
31
|
+
extensions?: Record<string, Rate>;
|
|
32
|
+
};
|
|
33
|
+
output?: {
|
|
34
|
+
regular?: Rate;
|
|
35
|
+
reasoning?: Rate;
|
|
36
|
+
audio?: Rate;
|
|
37
|
+
predictionAccepted?: Rate;
|
|
38
|
+
predictionRejected?: Rate;
|
|
39
|
+
extensions?: Record<string, Rate>;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Per-unit costs for non-token axes. Values are USD per unit; units
|
|
43
|
+
* match `TokenUsage.auxiliary` keys (e.g. `webSearchRequests`, `cacheStorageHours`).
|
|
44
|
+
*/
|
|
45
|
+
auxiliary?: Record<string, number>;
|
|
46
|
+
/**
|
|
47
|
+
* Service-tier multipliers. Applied to the summed per-class price.
|
|
48
|
+
* E.g. `{ batch: 0.5, flex: 0.5, priority: 1.25 }`. Default (no tier or
|
|
49
|
+
* tier not present in the map): multiplier = 1.
|
|
50
|
+
*/
|
|
51
|
+
tierMultipliers?: Record<string, number>;
|
|
52
|
+
/** Currency code (ISO 4217). Defaults to "USD" when constructed via helpers. */
|
|
53
|
+
currency: string;
|
|
54
|
+
}
|
|
55
|
+
/** Result of computing a price from usage + pricing. */
|
|
56
|
+
interface PriceBreakdown {
|
|
57
|
+
/** Total charge in `currency`. */
|
|
58
|
+
total: number;
|
|
59
|
+
currency: string;
|
|
60
|
+
/**
|
|
61
|
+
* Optional per-class subtotals. Keys are dot-separated paths like
|
|
62
|
+
* `"input.regular"`, `"output.reasoning"`, `"auxiliary.webSearchRequests"`.
|
|
63
|
+
*/
|
|
64
|
+
breakdown?: Record<string, number>;
|
|
65
|
+
}
|
|
66
|
+
/** Zero-charge breakdown — returned when no pricing is available for a model. */
|
|
67
|
+
declare function zeroPrice(currency?: string): PriceBreakdown;
|
|
68
|
+
/**
|
|
69
|
+
* Compute price from a usage object + model pricing.
|
|
70
|
+
*
|
|
71
|
+
* - Tier-threshold math uses `sumInputTokens(usage)` as the axis.
|
|
72
|
+
* - Service tier (`opts.tier`) multiplies the final total via `tierMultipliers`.
|
|
73
|
+
* - Each token class is priced independently using the matching `Rate` lookup.
|
|
74
|
+
* - `breakdown` is populated when `opts.withBreakdown = true` (default false
|
|
75
|
+
* to keep hot-path allocations low).
|
|
76
|
+
*/
|
|
77
|
+
declare function computePrice(usage: TokenUsage, pricing: ModelPricing, opts?: {
|
|
78
|
+
tier?: string;
|
|
79
|
+
withBreakdown?: boolean;
|
|
80
|
+
}): PriceBreakdown;
|
|
81
|
+
/** Pure function: given usage + call context, produce a price. */
|
|
82
|
+
type PricingFn = (usage: TokenUsage, ctx: {
|
|
83
|
+
model: string;
|
|
84
|
+
provider: string;
|
|
85
|
+
tier?: string;
|
|
86
|
+
withBreakdown?: boolean;
|
|
87
|
+
}) => PriceBreakdown;
|
|
88
|
+
/**
|
|
89
|
+
* A keyed store of `ModelPricing`. Users populate it at app startup.
|
|
90
|
+
* The library ships the factory and zero data.
|
|
91
|
+
*
|
|
92
|
+
* Keys are `(provider, model)` pairs. Lookup attempts exact match first,
|
|
93
|
+
* then longest-prefix match on model (e.g. `"claude-sonnet-4-6"` matches a
|
|
94
|
+
* stored `"claude-sonnet-4-6"` entry when looking up
|
|
95
|
+
* `"claude-sonnet-4-6-20260401"`).
|
|
96
|
+
*
|
|
97
|
+
* **Prefix-match footgun:** a registered `"gemini-1"` will also match a
|
|
98
|
+
* lookup for `"gemini-1.5-pro"` (since `"gemini-1.5-pro".startsWith("gemini-1")`
|
|
99
|
+
* is true). Longest-match tie-breaking mitigates most cases, but when
|
|
100
|
+
* registering a short family-prefix alongside versioned descendants, make sure
|
|
101
|
+
* the versioned entry is present — otherwise the family prefix wins. Best
|
|
102
|
+
* practice: register exact versioned model ids; use short family aliases
|
|
103
|
+
* sparingly and only when all version variants share one pricing schedule.
|
|
104
|
+
*/
|
|
105
|
+
interface PricingRegistry {
|
|
106
|
+
lookup(provider: string, model: string): ModelPricing | undefined;
|
|
107
|
+
register(provider: string, model: string, pricing: ModelPricing): void;
|
|
108
|
+
/** Remove a model's entry; returns `true` if it existed. */
|
|
109
|
+
remove(provider: string, model: string): boolean;
|
|
110
|
+
/** Enumerate all entries (for debugging / dump). */
|
|
111
|
+
entries(): IterableIterator<[string, string, ModelPricing]>;
|
|
112
|
+
}
|
|
113
|
+
/** Create a fresh `PricingRegistry`. Optionally seed with entries. */
|
|
114
|
+
declare function createPricingRegistry(initial?: ReadonlyArray<readonly [provider: string, model: string, pricing: ModelPricing]>): PricingRegistry;
|
|
115
|
+
/**
|
|
116
|
+
* Build a `PricingFn` from a `PricingRegistry`. If no entry matches, returns
|
|
117
|
+
* `{ total: 0, currency: "USD" }` (never throws). Callers who need "unknown
|
|
118
|
+
* model" failures can compose their own `PricingFn`.
|
|
119
|
+
*/
|
|
120
|
+
declare function registryPricing(registry: PricingRegistry, defaultCurrency?: string): PricingFn;
|
|
121
|
+
/** Compose multiple `PricingFn`s — first non-zero wins. Useful for registry layering. */
|
|
122
|
+
declare function composePricing(...fns: readonly PricingFn[]): PricingFn;
|
|
123
|
+
/**
|
|
124
|
+
* Convenience: compute a {@link PriceBreakdown} directly from a
|
|
125
|
+
* {@link import("./capabilities.js").ModelCapabilities} object + usage.
|
|
126
|
+
*
|
|
127
|
+
* When callers look up capabilities themselves (via
|
|
128
|
+
* `capabilitiesRegistry.lookup(...)` or `adapter.capabilities?.(model)`),
|
|
129
|
+
* this helper skips the pricing-registry round-trip and computes the price
|
|
130
|
+
* from `capabilities.pricing` directly.
|
|
131
|
+
*
|
|
132
|
+
* Returns `zeroPrice()` when `capabilities.pricing` is undefined — never throws.
|
|
133
|
+
*
|
|
134
|
+
* @param capabilities - Model capabilities object (`capabilities.pricing` may be absent).
|
|
135
|
+
* @param usage - Per-call usage to price.
|
|
136
|
+
* @param opts - Pass-through to {@link computePrice}.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* const cap = registry.lookup("anthropic", "claude-sonnet-4-6");
|
|
141
|
+
* const price = pricingFor(cap, resp.usage, { tier: "batch", withBreakdown: true });
|
|
142
|
+
* ```
|
|
143
|
+
*
|
|
144
|
+
* @category ai
|
|
145
|
+
*/
|
|
146
|
+
declare function pricingFor(capabilities: ModelCapabilities | undefined, usage: TokenUsage, opts?: {
|
|
147
|
+
tier?: string;
|
|
148
|
+
withBreakdown?: boolean;
|
|
149
|
+
}): PriceBreakdown;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Pluggable model capabilities (roadmap §9.3d).
|
|
153
|
+
*
|
|
154
|
+
* The library defines the **shape** of what's knowable about a model
|
|
155
|
+
* (context window, rate limits, features, pricing reference) and provides
|
|
156
|
+
* a registry factory. Capability **data** is user-supplied — no baked-in
|
|
157
|
+
* tables, no drift-prone catalog.
|
|
158
|
+
*/
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Rate and size limits for a single model at the user's service tier.
|
|
162
|
+
*
|
|
163
|
+
* Where providers expose distinct standard / batch / flex limits, register
|
|
164
|
+
* each as a separate model id with its own `ModelLimits`.
|
|
165
|
+
*/
|
|
166
|
+
interface ModelLimits {
|
|
167
|
+
/** Total tokens the model can process per request (input + output). */
|
|
168
|
+
contextWindow?: number;
|
|
169
|
+
/** Max input tokens if distinct from contextWindow. */
|
|
170
|
+
maxInputTokens?: number;
|
|
171
|
+
/** Max generated output tokens (excludes reasoning unless provider folds them). */
|
|
172
|
+
maxOutputTokens?: number;
|
|
173
|
+
/** Max reasoning/thinking tokens budget. */
|
|
174
|
+
maxReasoningTokens?: number;
|
|
175
|
+
/** Minimum prompt size for prompt caching to activate. */
|
|
176
|
+
minCacheTokens?: number;
|
|
177
|
+
/** Requests-per-minute rate limit. */
|
|
178
|
+
rpm?: number;
|
|
179
|
+
/** Requests-per-day rate limit. */
|
|
180
|
+
rpd?: number;
|
|
181
|
+
/** Tokens-per-minute rate limit (input + output, per provider convention). */
|
|
182
|
+
tpm?: number;
|
|
183
|
+
/** Tokens-per-day rate limit. */
|
|
184
|
+
tpd?: number;
|
|
185
|
+
/** Max concurrent in-flight requests. */
|
|
186
|
+
concurrentRequests?: number;
|
|
187
|
+
/** Provider-specific limits not covered above. */
|
|
188
|
+
extensions?: Record<string, number>;
|
|
189
|
+
}
|
|
190
|
+
interface ModelFeatures {
|
|
191
|
+
toolUse?: boolean;
|
|
192
|
+
vision?: boolean;
|
|
193
|
+
audioInput?: boolean;
|
|
194
|
+
audioOutput?: boolean;
|
|
195
|
+
reasoning?: boolean;
|
|
196
|
+
streaming?: boolean;
|
|
197
|
+
promptCache?: boolean;
|
|
198
|
+
batchApi?: boolean;
|
|
199
|
+
/** Provider-specific feature flags. */
|
|
200
|
+
extensions?: Record<string, boolean>;
|
|
201
|
+
}
|
|
202
|
+
/** Static facts about a model. Pricing is optional; keep a separate registry if preferred. */
|
|
203
|
+
interface ModelCapabilities {
|
|
204
|
+
id: string;
|
|
205
|
+
provider: string;
|
|
206
|
+
pricing?: ModelPricing;
|
|
207
|
+
limits?: ModelLimits;
|
|
208
|
+
features?: ModelFeatures;
|
|
209
|
+
/** Free-form metadata (release date, deprecation flag, provider notes). */
|
|
210
|
+
metadata?: Record<string, unknown>;
|
|
211
|
+
}
|
|
212
|
+
interface CapabilitiesRegistry {
|
|
213
|
+
lookup(provider: string, model: string): ModelCapabilities | undefined;
|
|
214
|
+
register(cap: ModelCapabilities): void;
|
|
215
|
+
remove(provider: string, model: string): boolean;
|
|
216
|
+
entries(): IterableIterator<ModelCapabilities>;
|
|
217
|
+
/**
|
|
218
|
+
* Reactive view of `(provider, model)` → `ModelCapabilities`. Re-emits
|
|
219
|
+
* whenever any `register()` / `remove()` touches the underlying store, so
|
|
220
|
+
* UIs and gated middleware (capability-aware retry, feature flags) can
|
|
221
|
+
* subscribe instead of polling. Prefix fallback mirrors the imperative
|
|
222
|
+
* `lookup()`: exact match first, then longest-prefix within provider.
|
|
223
|
+
*/
|
|
224
|
+
lookupNode(provider: string, model: string): Node<ModelCapabilities | undefined>;
|
|
225
|
+
/** Reactive view of every registered entry. */
|
|
226
|
+
readonly entriesNode: Node<readonly ModelCapabilities[]>;
|
|
227
|
+
/** Reactive slice of entries for a single provider. */
|
|
228
|
+
byProvider(provider: string): Node<readonly ModelCapabilities[]>;
|
|
229
|
+
}
|
|
230
|
+
/** Create a fresh `CapabilitiesRegistry`. Optionally seed with entries. */
|
|
231
|
+
declare function createCapabilitiesRegistry(initial?: readonly ModelCapabilities[]): CapabilitiesRegistry;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Input token classes.
|
|
235
|
+
*
|
|
236
|
+
* Every provider's native usage object maps into this shape without loss.
|
|
237
|
+
* All fields except `regular` are optional — providers that don't expose
|
|
238
|
+
* the class simply leave it undefined.
|
|
239
|
+
*/
|
|
240
|
+
interface InputTokens {
|
|
241
|
+
/** Uncached regular input tokens (cache miss or never-cached). */
|
|
242
|
+
regular: number;
|
|
243
|
+
/** Read from prompt cache (all TTLs — providers don't split reads by TTL today). */
|
|
244
|
+
cacheRead?: number;
|
|
245
|
+
/** Written to cache with 5-min TTL (Anthropic `ephemeral_5m_input_tokens`). */
|
|
246
|
+
cacheWrite5m?: number;
|
|
247
|
+
/** Written to cache with 1-hour TTL (Anthropic `ephemeral_1h_input_tokens`). */
|
|
248
|
+
cacheWrite1h?: number;
|
|
249
|
+
/** Written to cache with other/unspecified TTL (Gemini explicit caches). */
|
|
250
|
+
cacheWriteOther?: number;
|
|
251
|
+
/** Audio input tokens (OpenAI realtime, Gemini audio). */
|
|
252
|
+
audio?: number;
|
|
253
|
+
/** Image input tokens (Gemini per-modality). */
|
|
254
|
+
image?: number;
|
|
255
|
+
/** Video input tokens (Gemini per-modality). */
|
|
256
|
+
video?: number;
|
|
257
|
+
/** Tool-use result tokens fed back to the model (Gemini `toolUsePromptTokenCount`). */
|
|
258
|
+
toolUse?: number;
|
|
259
|
+
/** Provider-specific classes not covered above. Open-ended by design. */
|
|
260
|
+
extensions?: Record<string, number>;
|
|
261
|
+
}
|
|
262
|
+
/** Output token classes. */
|
|
263
|
+
interface OutputTokens {
|
|
264
|
+
/** Regular generated output (non-reasoning, non-audio). */
|
|
265
|
+
regular: number;
|
|
266
|
+
/** Reasoning / thinking tokens (OpenAI o-series, Gemini thoughts, Grok reasoning). */
|
|
267
|
+
reasoning?: number;
|
|
268
|
+
/** Audio output tokens. */
|
|
269
|
+
audio?: number;
|
|
270
|
+
/** Predicted-output tokens accepted (OpenAI predictions API). */
|
|
271
|
+
predictionAccepted?: number;
|
|
272
|
+
/** Predicted-output tokens rejected (still billed at output rate). */
|
|
273
|
+
predictionRejected?: number;
|
|
274
|
+
extensions?: Record<string, number>;
|
|
275
|
+
}
|
|
276
|
+
/** Per-call token usage in canonical shape. No pricing, no interpretation. */
|
|
277
|
+
interface TokenUsage {
|
|
278
|
+
input: InputTokens;
|
|
279
|
+
output: OutputTokens;
|
|
280
|
+
/**
|
|
281
|
+
* Per-call non-token costs (web-search requests, tool invocations, cache
|
|
282
|
+
* storage-hours, etc.). Units are domain-specific — pricing functions
|
|
283
|
+
* interpret them via `ModelPricing.auxiliary`.
|
|
284
|
+
*/
|
|
285
|
+
auxiliary?: Record<string, number>;
|
|
286
|
+
/**
|
|
287
|
+
* Raw provider usage object, unmodified. Escape hatch for anything the
|
|
288
|
+
* canonical shape doesn't model.
|
|
289
|
+
*/
|
|
290
|
+
raw?: unknown;
|
|
291
|
+
}
|
|
292
|
+
/** A single chat message in a conversation. */
|
|
293
|
+
type ChatMessage = {
|
|
294
|
+
readonly role: "system" | "user" | "assistant" | "tool";
|
|
295
|
+
readonly content: string;
|
|
296
|
+
readonly name?: string;
|
|
297
|
+
readonly toolCallId?: string;
|
|
298
|
+
readonly toolCalls?: readonly ToolCall[];
|
|
299
|
+
readonly metadata?: Record<string, unknown>;
|
|
300
|
+
};
|
|
301
|
+
/** A tool invocation request from an LLM. */
|
|
302
|
+
type ToolCall = {
|
|
303
|
+
readonly id: string;
|
|
304
|
+
readonly name: string;
|
|
305
|
+
readonly arguments: Record<string, unknown>;
|
|
306
|
+
};
|
|
307
|
+
/** A tool definition for LLM consumption. */
|
|
308
|
+
type ToolDefinition = {
|
|
309
|
+
readonly name: string;
|
|
310
|
+
readonly description: string;
|
|
311
|
+
readonly parameters: Record<string, unknown>;
|
|
312
|
+
/**
|
|
313
|
+
* Handler invoked when the LLM requests this tool.
|
|
314
|
+
*
|
|
315
|
+
* The optional `opts.signal` fires when the reactive surface that owns
|
|
316
|
+
* this invocation is torn down (e.g. the agent's `switchMap` over
|
|
317
|
+
* `toolCalls` superseded with a fresh batch, the agent was aborted, or
|
|
318
|
+
* the parent graph destroyed). Signal-aware handlers should thread it
|
|
319
|
+
* into `fetch(url, {signal})`, child-process kill, DB cancel, etc., so
|
|
320
|
+
* in-flight side effects actually stop. Handlers that ignore the
|
|
321
|
+
* signal still work — but their work continues to completion regardless
|
|
322
|
+
* of supersede.
|
|
323
|
+
*/
|
|
324
|
+
readonly handler: (args: Record<string, unknown>, opts?: {
|
|
325
|
+
signal?: AbortSignal;
|
|
326
|
+
}) => NodeInput<unknown>;
|
|
327
|
+
/**
|
|
328
|
+
* V0 version of the backing node at tool-definition-creation time.
|
|
329
|
+
* Snapshot — re-create the tool definition to refresh.
|
|
330
|
+
*/
|
|
331
|
+
readonly version?: {
|
|
332
|
+
id: string;
|
|
333
|
+
version: number;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
/** The response from an LLM invocation. */
|
|
337
|
+
interface LLMResponse {
|
|
338
|
+
readonly content: string;
|
|
339
|
+
readonly toolCalls?: readonly ToolCall[];
|
|
340
|
+
/**
|
|
341
|
+
* Token usage. Optional — provider adapters should always populate it, but
|
|
342
|
+
* test mocks and adapter middlewares that synthesize responses can omit it.
|
|
343
|
+
* Downstream consumers that compute cost should default to {@link emptyUsage}.
|
|
344
|
+
*/
|
|
345
|
+
readonly usage?: TokenUsage;
|
|
346
|
+
readonly finishReason?: string;
|
|
347
|
+
readonly latencyMs?: number;
|
|
348
|
+
readonly model?: string;
|
|
349
|
+
readonly provider?: string;
|
|
350
|
+
/** Service tier the call was served with (standard / batch / flex / priority). */
|
|
351
|
+
readonly tier?: string;
|
|
352
|
+
readonly metadata?: Record<string, unknown>;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Adapter-facing incremental stream event.
|
|
356
|
+
*
|
|
357
|
+
* Provider adapters emit these; higher-level surfaces (`streamingPromptNode`,
|
|
358
|
+
* `agentLoop`) assemble them into consumer-facing `StreamChunk` with their own
|
|
359
|
+
* `source`/`accumulated`/`index` context.
|
|
360
|
+
*
|
|
361
|
+
* **Shape rationale — why object tagged-union vs. the framework `[TYPE, data]`
|
|
362
|
+
* tuple?** `StreamDelta` is an *application-layer event payload* that flows
|
|
363
|
+
* inside a single framework `DATA` message, one abstraction level above the
|
|
364
|
+
* reactive protocol. The framework's `[Type, Data?]` tuple (DIRTY / DATA /
|
|
365
|
+
* RESOLVED / COMPLETE / ERROR) is the protocol message form delivered through
|
|
366
|
+
* `subscribe`. Using the protocol form here would force us to invent new
|
|
367
|
+
* framework-level symbols (`TOKEN`, `USAGE`, etc.) that leak into user code,
|
|
368
|
+
* and TypeScript discriminated-union exhaustiveness works much better with
|
|
369
|
+
* objects than tuples. Object-tagged unions match the idiomatic JS/TS
|
|
370
|
+
* convention for discriminated events (Redux actions, DOM events).
|
|
371
|
+
*/
|
|
372
|
+
type StreamDelta = {
|
|
373
|
+
readonly type: "token";
|
|
374
|
+
readonly delta: string;
|
|
375
|
+
} | {
|
|
376
|
+
readonly type: "tool-call-delta";
|
|
377
|
+
readonly delta: {
|
|
378
|
+
readonly id?: string;
|
|
379
|
+
readonly name?: string;
|
|
380
|
+
readonly argumentsDelta?: string;
|
|
381
|
+
};
|
|
382
|
+
} | {
|
|
383
|
+
readonly type: "thinking";
|
|
384
|
+
readonly delta: string;
|
|
385
|
+
} | {
|
|
386
|
+
readonly type: "usage";
|
|
387
|
+
readonly usage: TokenUsage;
|
|
388
|
+
} | {
|
|
389
|
+
readonly type: "finish";
|
|
390
|
+
readonly reason: string;
|
|
391
|
+
};
|
|
392
|
+
/** Options passed to `invoke()` / `stream()`. */
|
|
393
|
+
interface LLMInvokeOptions {
|
|
394
|
+
model?: string;
|
|
395
|
+
temperature?: number;
|
|
396
|
+
maxTokens?: number;
|
|
397
|
+
/** Budget for reasoning/thinking tokens, if the model supports it. */
|
|
398
|
+
maxReasoningTokens?: number;
|
|
399
|
+
tools?: readonly ToolDefinition[];
|
|
400
|
+
systemPrompt?: string;
|
|
401
|
+
/** Hint the adapter to cache the prompt. TTL values depend on provider. */
|
|
402
|
+
cacheHint?: {
|
|
403
|
+
ttl?: "5m" | "1h" | string;
|
|
404
|
+
minTokens?: number;
|
|
405
|
+
};
|
|
406
|
+
/** Service tier: "standard" | "batch" | "flex" | "priority" | provider-custom. */
|
|
407
|
+
tier?: string;
|
|
408
|
+
signal?: AbortSignal;
|
|
409
|
+
/**
|
|
410
|
+
* Provider-specific passthrough — merged into the native request body.
|
|
411
|
+
* Escape hatch for features not yet in the canonical options.
|
|
412
|
+
*/
|
|
413
|
+
providerExtras?: Record<string, unknown>;
|
|
414
|
+
/**
|
|
415
|
+
* Open-ended per-call context threaded to cache / fallback key functions.
|
|
416
|
+
* Callers who want to shard caches by tenant, session, feature flag, or
|
|
417
|
+
* any other dimension populate this and supply a custom `keyFn` that
|
|
418
|
+
* incorporates it. Not sent to providers — stripped from canonical key
|
|
419
|
+
* hashing when no custom `keyFn` is supplied. Type is `unknown` to avoid
|
|
420
|
+
* prescribing a shape; callers pick their own.
|
|
421
|
+
*/
|
|
422
|
+
keyContext?: unknown;
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Provider-agnostic LLM adapter (spec §5.10 compliant).
|
|
426
|
+
*
|
|
427
|
+
* - `invoke()` returns a `NodeInput<LLMResponse>` — the caller bridges to
|
|
428
|
+
* reactive via `fromAny(...)`. Adapter implementations may return a
|
|
429
|
+
* Promise (simplest), a Node (reactive), or a plain value (testing).
|
|
430
|
+
* - `stream()` returns `AsyncIterable<StreamDelta>` — the terminal delta of
|
|
431
|
+
* type `"usage"` carries the final `TokenUsage` for the streamed call.
|
|
432
|
+
*/
|
|
433
|
+
interface LLMAdapter {
|
|
434
|
+
readonly provider: string;
|
|
435
|
+
readonly model?: string;
|
|
436
|
+
invoke(messages: readonly ChatMessage[], opts?: LLMInvokeOptions): NodeInput<LLMResponse>;
|
|
437
|
+
stream(messages: readonly ChatMessage[], opts?: LLMInvokeOptions): AsyncIterable<StreamDelta>;
|
|
438
|
+
/** Optional capability lookup; typically delegates to a `CapabilitiesRegistry`. */
|
|
439
|
+
capabilities?(model?: string): ModelCapabilities | undefined;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export { type CapabilitiesRegistry as C, type LLMAdapter as L, type ModelCapabilities as M, type PriceBreakdown as P, type Rate as R, type StreamDelta as S, type TieredRate as T, type ChatMessage as a, type LLMInvokeOptions as b, type LLMResponse as c, type ModelFeatures as d, type ModelLimits as e, type ModelPricing as f, type PricingFn as g, type PricingRegistry as h, type TokenUsage as i, type ToolCall as j, type ToolDefinition as k, composePricing as l, computePrice as m, createCapabilitiesRegistry as n, createPricingRegistry as o, pricingFor as p, registryPricing as r, zeroPrice as z };
|