@graphrefly/graphrefly 0.32.0 → 0.33.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/dist/{cascading-D3sapjue.d.ts → cascading-Bg0a4VSf.d.ts} +2 -2
- package/dist/{cascading-BfQmSmjU.d.cts → cascading-DKIb6Pk8.d.cts} +2 -2
- package/dist/{chunk-4JBKKUCJ.js → chunk-2JO6LXFT.js} +1 -1
- package/dist/{chunk-FTA5TB2A.js → chunk-2LZ6DL45.js} +1 -1
- package/dist/{chunk-WQ7I7JVU.js → chunk-4F564IPP.js} +1 -1
- package/dist/{chunk-M2VFLRPJ.js → chunk-4NYSEUKV.js} +1 -1
- package/dist/{chunk-N2KKISCE.js → chunk-533RQFF6.js} +1 -1
- package/dist/{chunk-BU4SUZSA.js → chunk-55T3K37W.js} +1 -1
- package/dist/chunk-6HQ6HVTF.js +1 -0
- package/dist/{chunk-4VXL3UZK.js → chunk-7Q2WPFQ7.js} +1 -1
- package/dist/{chunk-5PBXUVHI.js → chunk-BY4WKPKM.js} +1 -1
- package/dist/{chunk-JYMNVEH6.js → chunk-C5DINHNP.js} +1 -1
- package/dist/{chunk-7QS77X6G.js → chunk-CJMFZXIZ.js} +1 -1
- package/dist/{chunk-W6FQIFVE.js → chunk-CLD3F4R5.js} +1 -1
- package/dist/chunk-DUK7LTJO.js +43 -0
- package/dist/{chunk-RWGJQQLT.js → chunk-FKRPIRE6.js} +1 -1
- package/dist/{chunk-UXEB35L4.js → chunk-GAOX6OPT.js} +1 -1
- package/dist/{chunk-TOCCHQI6.js → chunk-GCUYSIM4.js} +1 -1
- package/dist/chunk-HIJ2RKVP.js +1 -0
- package/dist/{chunk-XRSHMHEG.js → chunk-HTBOCKVD.js} +1 -1
- package/dist/{chunk-LJGPOJHS.js → chunk-IB64M7VP.js} +1 -1
- package/dist/{chunk-Q2SY7M7K.js → chunk-IJFSR4NU.js} +1 -1
- package/dist/{chunk-X4OOM6QU.js → chunk-INXDSJRC.js} +1 -1
- package/dist/{chunk-4YGJ7KZ6.js → chunk-IPNJDNE7.js} +1 -1
- package/dist/{chunk-4UUDNFYG.js → chunk-KGKJCHEK.js} +1 -1
- package/dist/{chunk-A4JT4SAD.js → chunk-KRH66M4O.js} +1 -1
- package/dist/{chunk-K54OKWNY.js → chunk-L3KUKDZC.js} +1 -1
- package/dist/{chunk-Y26UN6J5.js → chunk-LOF5HSD3.js} +1 -1
- package/dist/chunk-LYCLF26R.js +1 -0
- package/dist/{chunk-CZVYLXFK.js → chunk-M27MVZCP.js} +1 -1
- package/dist/{chunk-DWIAG62L.js → chunk-NNKJUORL.js} +1 -1
- package/dist/{chunk-PNTBXOQ6.js → chunk-O2WY22L7.js} +1 -1
- package/dist/{chunk-WF3V5X2L.js → chunk-PBN426RU.js} +1 -1
- package/dist/{chunk-MFNOZ5E6.js → chunk-Q46YJCQH.js} +1 -1
- package/dist/{chunk-KD3IYBTD.js → chunk-SFIM774L.js} +1 -1
- package/dist/{chunk-VXJX3ZZP.js → chunk-T2TB37TW.js} +1 -1
- package/dist/{chunk-UMH3HSP7.js → chunk-T7EQPKOP.js} +1 -1
- package/dist/{chunk-JAHAJU4G.js → chunk-TONEKQM3.js} +1 -1
- package/dist/{chunk-CNXUW2CU.js → chunk-TZLEMGAK.js} +1 -1
- package/dist/{chunk-LWGLBCMU.js → chunk-TZQPPQEQ.js} +1 -1
- package/dist/{chunk-7JZ3YORY.js → chunk-U2T2XWDA.js} +1 -1
- package/dist/{chunk-WE32AFFA.js → chunk-UF746BQ4.js} +1 -1
- package/dist/{chunk-7QMVU3IX.js → chunk-WBWBY6LI.js} +1 -1
- package/dist/{chunk-7EMUF2RY.js → chunk-Y63GWRHO.js} +1 -1
- package/dist/{chunk-PWKLZ2XU.js → chunk-YDWTVO4E.js} +1 -1
- package/dist/{chunk-EIFHFDFD.js → chunk-YUBV7EEE.js} +1 -1
- package/dist/chunk-Z4GXBOWO.js +61 -0
- package/dist/compat/index.cjs +5 -5
- package/dist/compat/index.d.cts +14 -14
- package/dist/compat/index.d.ts +14 -14
- package/dist/compat/index.js +1 -1
- package/dist/compat/jotai/index.cjs +1 -1
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/jotai/index.js +1 -1
- package/dist/compat/nanostores/index.cjs +1 -1
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nanostores/index.js +1 -1
- package/dist/compat/nestjs/index.cjs +5 -5
- package/dist/compat/nestjs/index.d.cts +6 -6
- package/dist/compat/nestjs/index.d.ts +6 -6
- package/dist/compat/nestjs/index.js +1 -1
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/zustand/index.cjs +3 -3
- package/dist/compat/zustand/index.d.cts +4 -4
- package/dist/compat/zustand/index.d.ts +4 -4
- package/dist/compat/zustand/index.js +1 -1
- package/dist/{composite-BY9hMxN7.d.ts → composite-BPDU_XV1.d.ts} +2 -2
- package/dist/{composite-CH0S8DFn.d.cts → composite-CmvdhTJe.d.cts} +2 -2
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +1 -1
- package/dist/extra/browser.cjs +1 -1
- package/dist/extra/browser.d.cts +1 -1
- package/dist/extra/browser.d.ts +1 -1
- package/dist/extra/browser.js +1 -1
- package/dist/extra/index.cjs +16 -16
- package/dist/extra/index.d.cts +9 -9
- package/dist/extra/index.d.ts +9 -9
- package/dist/extra/index.js +1 -1
- package/dist/extra/node.cjs +1 -1
- package/dist/extra/node.d.cts +1 -1
- package/dist/extra/node.d.ts +1 -1
- package/dist/extra/node.js +1 -1
- package/dist/extra/operators.cjs +1 -1
- package/dist/extra/operators.d.cts +1 -1
- package/dist/extra/operators.d.ts +1 -1
- package/dist/extra/operators.js +1 -1
- package/dist/extra/reactive.cjs +1 -1
- package/dist/extra/reactive.d.cts +3 -3
- package/dist/extra/reactive.d.ts +3 -3
- package/dist/extra/reactive.js +1 -1
- package/dist/extra/sources.cjs +1 -1
- package/dist/extra/sources.d.cts +1 -1
- package/dist/extra/sources.d.ts +1 -1
- package/dist/extra/sources.js +1 -1
- package/dist/extra/storage-browser.cjs +1 -1
- package/dist/extra/storage-browser.d.cts +1 -1
- package/dist/extra/storage-browser.d.ts +1 -1
- package/dist/extra/storage-browser.js +1 -1
- package/dist/{fallback-Cb3GH1O7.d.cts → fallback-9YznPvPP.d.cts} +1 -1
- package/dist/{fallback-DRjJ_ZM8.d.ts → fallback-mYSd8vQo.d.ts} +1 -1
- package/dist/graph/index.cjs +4 -4
- package/dist/graph/index.d.cts +5 -5
- package/dist/graph/index.d.ts +5 -5
- package/dist/graph/index.js +1 -1
- package/dist/{graph-BOhEGJ6E.d.ts → graph-BROUZPG9.d.ts} +2 -2
- package/dist/{graph-CdJeX7O7.d.cts → graph-DaoydJ_u.d.cts} +2 -2
- package/dist/{index-CNyiYQWF.d.ts → index--BTb6HUO.d.ts} +332 -108
- package/dist/{index-BmZb8fNF.d.cts → index-B-KCkW4M.d.cts} +4 -4
- package/dist/{index-CDK5RsV5.d.cts → index-B1hFhK1K.d.cts} +1 -1
- package/dist/{index-C7RqYbOZ.d.ts → index-B5eS17Bz.d.ts} +7 -7
- package/dist/{index-DSawGt8n.d.cts → index-BDEhWLF4.d.cts} +3 -3
- package/dist/{index-CZUzi6Dy.d.ts → index-BFHpNSsV.d.ts} +4 -4
- package/dist/{index-DDo-eqQ4.d.cts → index-BO6t0HjV.d.cts} +1 -1
- package/dist/{index-CrC7urhX.d.ts → index-BRisOxlx.d.ts} +1 -1
- package/dist/{index-CHfBm51k.d.ts → index-BUtCR0k6.d.ts} +4 -4
- package/dist/{index-BydMDMf7.d.cts → index-BVTjuKeP.d.cts} +1 -1
- package/dist/{index-BX22kvjh.d.ts → index-BWiX5foT.d.ts} +1 -1
- package/dist/{index-Dxk-pUQI.d.ts → index-Bd2AjMQY.d.ts} +2 -2
- package/dist/{index-Dbmj0iYR.d.ts → index-Bi4ZP6Hc.d.ts} +2 -2
- package/dist/{index-j33Lfb1G.d.cts → index-BkfL5MXh.d.cts} +3 -3
- package/dist/{index-CnjUhRbs.d.cts → index-BpjQanLs.d.cts} +2 -2
- package/dist/{index-LGzAYqdR.d.ts → index-BsxqmV6u.d.ts} +2 -2
- package/dist/{index-CCdg0JLX.d.cts → index-C2Dey3L-.d.cts} +12 -3
- package/dist/{index-gXTVbSax.d.ts → index-C5uMGVJw.d.ts} +4 -4
- package/dist/{index-C-Gsh-0a.d.cts → index-C8_bnDBZ.d.cts} +3 -3
- package/dist/{index-C9qCLIN4.d.ts → index-CD7qmvSf.d.ts} +3 -3
- package/dist/{index-wIx1Jisk.d.ts → index-CI5fULSz.d.ts} +1 -1
- package/dist/{index-BUZPTPSQ.d.ts → index-CNxdDb2e.d.ts} +3 -3
- package/dist/{index-FBqTfL_S.d.cts → index-CQ1gt4rn.d.cts} +1 -1
- package/dist/{index-C22aTC1X.d.cts → index-C_cXlbu0.d.cts} +332 -108
- package/dist/{index-BDLy6CQ9.d.cts → index-Ccv_61jG.d.cts} +2 -2
- package/dist/{index-MV2yGIAq.d.ts → index-Ced0dphF.d.ts} +9 -9
- package/dist/{index-BzxU4yhV.d.cts → index-ChZvMC4M.d.cts} +4 -4
- package/dist/{index-zMQIQuDu.d.ts → index-Chi9IiHJ.d.ts} +3 -3
- package/dist/{index-DUkuH3jP.d.cts → index-ClJUZAOr.d.cts} +18 -3
- package/dist/{index-D7XxY1Ff.d.cts → index-ClKm7CFB.d.cts} +1 -1
- package/dist/{index-D3HcdZ4d.d.cts → index-Cn3taOmp.d.cts} +2 -2
- package/dist/{index-C4QTaDli.d.cts → index-CoR-tOZA.d.cts} +4 -4
- package/dist/{index-BpFWP7Bq.d.cts → index-Cp91Sxbo.d.cts} +5 -4
- package/dist/{index-DD1czHj3.d.ts → index-Cq7Uqgu4.d.ts} +2 -2
- package/dist/{index-EGjF6iSY.d.cts → index-D23g00HE.d.cts} +4 -4
- package/dist/{index-Bnmttu35.d.ts → index-D80nGRb9.d.ts} +3 -3
- package/dist/{index-DhlAMlm9.d.ts → index-DDf8PoPO.d.ts} +149 -52
- package/dist/{index-DY2QbdoP.d.cts → index-DR3XqZlV.d.cts} +1 -1
- package/dist/{index-BANwzwBV.d.ts → index-Db21wuaD.d.ts} +5 -4
- package/dist/{index-BuN2wGJs.d.cts → index-Dgcd59CJ.d.cts} +149 -52
- package/dist/{index-CIXaiYDE.d.cts → index-DhWrMTI6.d.cts} +1 -1
- package/dist/{index-Dp_pS7Bw.d.ts → index-DheNs40A.d.ts} +2 -2
- package/dist/{index-CVevMZ0n.d.ts → index-Dia4yc2y.d.ts} +3 -3
- package/dist/{index-_BXz9K7b.d.cts → index-Ds3Rz9m9.d.cts} +3 -3
- package/dist/{index-Ckl03Q0s.d.ts → index-Dtpr2FIB.d.ts} +18 -3
- package/dist/{index-ByPnK85n.d.ts → index-DupIl9wI.d.ts} +1 -1
- package/dist/{index-CEoU-r-g.d.ts → index-DuvQAU02.d.ts} +2 -2
- package/dist/{index-D0C_USMR.d.ts → index-DxEcY7Om.d.ts} +1 -1
- package/dist/{index-eYHRkoK-.d.ts → index-HvJ90_tX.d.ts} +12 -3
- package/dist/{index-LzCJ0kMT.d.cts → index-Jgl7ev9I.d.cts} +9 -9
- package/dist/{index-DlGaEBW5.d.cts → index-RJX4snyi.d.cts} +2 -2
- package/dist/{index-DNhTQReY.d.cts → index-ZIQaKIdY.d.cts} +7 -7
- package/dist/{index-lpGUhTBn.d.ts → index-b4a6Sg0R.d.ts} +4 -4
- package/dist/{index-BiGeETJs.d.cts → index-iKsmdnq6.d.cts} +2 -2
- package/dist/{index-CmSjld-4.d.ts → index-nP13Qe6T.d.ts} +1 -1
- package/dist/{index-BJDXj9Wf.d.cts → index-p0bkNfby.d.cts} +3 -3
- package/dist/{index-aBqZUx3B.d.cts → index-wcfc7W-f.d.cts} +2 -2
- package/dist/{index-BwdPDWI4.d.cts → index-yJY9thRY.d.cts} +2 -2
- package/dist/{index-BbcSZCAG.d.ts → index-ygRFoyrN.d.ts} +2 -2
- package/dist/{index-Ip3q9T9x.d.ts → index-zA1uVtk0.d.ts} +1 -1
- package/dist/index.cjs +48 -48
- package/dist/index.d.cts +44 -44
- package/dist/index.d.ts +44 -44
- package/dist/index.js +1 -1
- package/dist/{meta-COtmHLwT.d.cts → meta-BdjSt8ky.d.cts} +1 -1
- package/dist/{meta-BMwx3ExI.d.ts → meta-CtDjj7cU.d.ts} +1 -1
- package/dist/{node-BVV7G1bq.d.cts → node-8qx0kgYt.d.cts} +49 -1
- package/dist/{node-BVV7G1bq.d.ts → node-8qx0kgYt.d.ts} +49 -1
- package/dist/{observable-BrUAPeH_.d.cts → observable-B6Ba-TTI.d.cts} +1 -1
- package/dist/{observable-ITikPXz3.d.ts → observable-DOniYM2B.d.ts} +1 -1
- package/dist/patterns/ai/browser.cjs +4 -4
- package/dist/patterns/ai/browser.d.cts +4 -4
- package/dist/patterns/ai/browser.d.ts +4 -4
- package/dist/patterns/ai/browser.js +1 -1
- package/dist/patterns/ai/index.cjs +19 -19
- package/dist/patterns/ai/index.d.cts +16 -16
- package/dist/patterns/ai/index.d.ts +16 -16
- package/dist/patterns/ai/index.js +1 -1
- package/dist/patterns/ai/node.cjs +2 -2
- package/dist/patterns/ai/node.d.cts +4 -4
- package/dist/patterns/ai/node.d.ts +4 -4
- package/dist/patterns/ai/node.js +1 -1
- package/dist/patterns/audit/index.cjs +7 -7
- package/dist/patterns/audit/index.d.cts +5 -5
- package/dist/patterns/audit/index.d.ts +5 -5
- package/dist/patterns/audit/index.js +1 -1
- package/dist/patterns/cqrs/index.cjs +3 -3
- package/dist/patterns/cqrs/index.d.cts +4 -4
- package/dist/patterns/cqrs/index.d.ts +4 -4
- package/dist/patterns/cqrs/index.js +1 -1
- package/dist/patterns/demo-shell/index.cjs +6 -6
- package/dist/patterns/demo-shell/index.d.cts +5 -5
- package/dist/patterns/demo-shell/index.d.ts +5 -5
- package/dist/patterns/demo-shell/index.js +1 -1
- package/dist/patterns/domain-templates/index.cjs +6 -6
- package/dist/patterns/domain-templates/index.d.cts +4 -4
- package/dist/patterns/domain-templates/index.d.ts +4 -4
- package/dist/patterns/domain-templates/index.js +1 -1
- package/dist/patterns/graphspec/index.cjs +8 -8
- package/dist/patterns/graphspec/index.d.cts +5 -5
- package/dist/patterns/graphspec/index.d.ts +5 -5
- package/dist/patterns/graphspec/index.js +1 -1
- package/dist/patterns/guarded-execution/index.cjs +7 -7
- package/dist/patterns/guarded-execution/index.d.cts +6 -6
- package/dist/patterns/guarded-execution/index.d.ts +6 -6
- package/dist/patterns/guarded-execution/index.js +1 -1
- package/dist/patterns/harness/index.cjs +12 -12
- package/dist/patterns/harness/index.d.cts +10 -9
- package/dist/patterns/harness/index.d.ts +10 -9
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/job-queue/index.cjs +7 -7
- package/dist/patterns/job-queue/index.d.cts +4 -4
- package/dist/patterns/job-queue/index.d.ts +4 -4
- package/dist/patterns/job-queue/index.js +1 -1
- package/dist/patterns/lens/index.cjs +5 -5
- package/dist/patterns/lens/index.d.cts +6 -6
- package/dist/patterns/lens/index.d.ts +6 -6
- package/dist/patterns/lens/index.js +1 -1
- package/dist/patterns/memory/index.cjs +4 -4
- package/dist/patterns/memory/index.d.cts +4 -4
- package/dist/patterns/memory/index.d.ts +4 -4
- package/dist/patterns/memory/index.js +1 -1
- package/dist/patterns/messaging/index.cjs +4 -4
- package/dist/patterns/messaging/index.d.cts +4 -4
- package/dist/patterns/messaging/index.d.ts +4 -4
- package/dist/patterns/messaging/index.js +1 -1
- package/dist/patterns/orchestration/index.cjs +4 -4
- package/dist/patterns/orchestration/index.d.cts +5 -5
- package/dist/patterns/orchestration/index.d.ts +5 -5
- package/dist/patterns/orchestration/index.js +1 -1
- package/dist/patterns/reactive-layout/index.cjs +1 -1
- package/dist/patterns/reactive-layout/index.d.cts +5 -5
- package/dist/patterns/reactive-layout/index.d.ts +5 -5
- package/dist/patterns/reactive-layout/index.js +1 -1
- package/dist/patterns/reduction/index.cjs +1 -1
- package/dist/patterns/reduction/index.d.cts +4 -4
- package/dist/patterns/reduction/index.d.ts +4 -4
- package/dist/patterns/reduction/index.js +1 -1
- package/dist/patterns/refine-loop/index.cjs +7 -7
- package/dist/patterns/refine-loop/index.d.cts +5 -5
- package/dist/patterns/refine-loop/index.d.ts +5 -5
- package/dist/patterns/refine-loop/index.js +1 -1
- package/dist/patterns/resilient-pipeline/index.cjs +1 -1
- package/dist/patterns/resilient-pipeline/index.d.cts +6 -6
- package/dist/patterns/resilient-pipeline/index.d.ts +6 -6
- package/dist/patterns/resilient-pipeline/index.js +1 -1
- package/dist/patterns/surface/index.cjs +7 -7
- package/dist/patterns/surface/index.d.cts +6 -6
- package/dist/patterns/surface/index.d.ts +6 -6
- package/dist/patterns/surface/index.js +1 -1
- package/dist/{reactive-layout-Bq0rA2Wb.d.ts → reactive-layout-DBJ3Vz-m.d.ts} +2 -2
- package/dist/{reactive-layout-Dhhe54Oj.d.cts → reactive-layout-Dk9AOQb_.d.cts} +2 -2
- package/dist/{reactive-log-5jFeNRmd.d.cts → reactive-log-CWC7jO4J.d.cts} +1 -1
- package/dist/{reactive-log-BOJDCI5x.d.ts → reactive-log-CqaBg8nf.d.ts} +1 -1
- package/dist/{reactive-map-IJIfZxoh.d.cts → reactive-map-Cm89Hk0c.d.cts} +1 -1
- package/dist/{reactive-map-CtRaCddO.d.ts → reactive-map-LjwjcFaW.d.ts} +1 -1
- package/dist/{resilience-IVNDYORD.js → resilience-7UZHSSGC.js} +1 -1
- package/dist/{resilience-Q6Bt_7y0.d.cts → resilience-N_VtLf7W.d.cts} +1 -1
- package/dist/{resilience-CludlzcP.d.ts → resilience-RjDIHZNZ.d.ts} +1 -1
- package/dist/{sugar-BHbAACDG.d.ts → sugar-CQkn_rxB.d.ts} +1 -1
- package/dist/{sugar-CqR6DJ7v.d.cts → sugar-DVEYhR7a.d.cts} +1 -1
- package/dist/{topology-tree-CpSjvIXp.d.cts → topology-tree-BB6oJxMz.d.cts} +1 -1
- package/dist/{topology-tree-DAbCV2Yw.d.ts → topology-tree-CAFOG5S5.d.ts} +1 -1
- package/dist/{types-CdfO2QTt.d.ts → types-B2LfBvNc.d.ts} +16 -2
- package/dist/{types-BgMqbc7N.d.cts → types-Cp_4coR_.d.cts} +16 -2
- package/package.json +1 -1
- package/dist/chunk-2JNT5NDF.js +0 -61
- package/dist/chunk-2RH4QNDQ.js +0 -1
- package/dist/chunk-7AJKUA36.js +0 -1
- package/dist/chunk-LG73TUF4.js +0 -43
- package/dist/chunk-ZWETYYQG.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LLMAdapter, C as ChatMessage, a as LLMInvokeOptions } from './types-
|
|
2
|
-
import { a as CircuitBreakerOptions, e as CircuitBreaker } from './resilience-
|
|
1
|
+
import { L as LLMAdapter, C as ChatMessage, a as LLMInvokeOptions } from './types-B2LfBvNc.js';
|
|
2
|
+
import { a as CircuitBreakerOptions, e as CircuitBreaker } from './resilience-RjDIHZNZ.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* OpenAICompatAdapter — default fetch-backed, optional SDK-backed.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LLMAdapter, C as ChatMessage, a as LLMInvokeOptions } from './types-
|
|
2
|
-
import { a as CircuitBreakerOptions, e as CircuitBreaker } from './resilience-
|
|
1
|
+
import { L as LLMAdapter, C as ChatMessage, a as LLMInvokeOptions } from './types-Cp_4coR_.cjs';
|
|
2
|
+
import { a as CircuitBreakerOptions, e as CircuitBreaker } from './resilience-N_VtLf7W.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* OpenAICompatAdapter — default fetch-backed, optional SDK-backed.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Se}from"./chunk-SGS4OJGS.js";import{a as Le}from"./chunk-ESMPEKEV.js";import{a as re,b as _e}from"./chunk-
|
|
1
|
+
import{a as Se}from"./chunk-SGS4OJGS.js";import{a as Le}from"./chunk-ESMPEKEV.js";import{a as re,b as _e}from"./chunk-533RQFF6.js";import{B as Ee}from"./chunk-T7EQPKOP.js";import{A as we,C as L,E as ne,F as Me,G as Oe,e as $e,f as Te,i as Y,k as Ne,l as xe,m as Ae,o as K,p as Pe,s as W}from"./chunk-LYCLF26R.js";import{b as Q,c as me,d as be,e as Z,f as ye,g as ve,h as z,i as ee,j as te}from"./chunk-CK2E7BTU.js";function Ie(e,t,r,n={}){let o=t in e.nodes,s=r in e.nodes;if(!o)return se(t,r,"no-such-from");if(!s)return se(t,r,"no-such-to");let i=n.maxDepth;if(i!=null&&(!Number.isInteger(i)||i<0))throw new Error("explainPath: maxDepth must be an integer >= 0");if(t===r){if(n.findCycle===!0){let u=lt(e,t,n);if(u!=null)return u}let l=oe(t,e.nodes[t],0,n);return ie(t,r,[l])}if(i===0)return se(t,r,"no-path");let a=je(e,t,r,i);return a.found?ie(t,r,Be(e,a.pathOrder,n)):se(t,r,a.truncated?"max-depth-exceeded":"no-path")}function je(e,t,r,n){let o=new Map,s=[{path:r,depth:0}],i=new Set([r]),a=0,l=!1;for(;a<s.length;){let h=s[a++];if(h.path===t)break;if(n!=null&&h.depth>=n){let g=e.nodes[h.path];g?.deps&&g.deps.length>0&&(l=!0);continue}let p=e.nodes[h.path];if(p==null)continue;let f=p.deps??[],c=new Map;for(let g=0;g<f.length;g++){let b=f[g];if(!b)continue;let v=c.get(b);v==null&&(v=[],c.set(b,v)),v.push(g)}for(let[g,b]of c)i.has(g)||(i.add(g),o.set(g,{from:h.path,depIndices:b}),s.push({path:g,depth:h.depth+1}))}if(!o.has(t))return{found:!1,pathOrder:[],truncated:l};let u=[{path:t}],d=t;for(;d!==r;){let h=o.get(d);if(h==null)return{found:!1,pathOrder:[],truncated:!1};u[u.length-1].depIndices=h.depIndices,u.push({path:h.from}),d=h.from}return{found:!0,pathOrder:u,truncated:!1}}function lt(e,t,r){let n=e.nodes[t];if(n==null)return null;let o=n.deps??[],s=[];for(let a=0;a<o.length;a++)o[a]===t&&s.push(a);if(s.length>0){let a=oe(t,n,0,r);a.dep_index=s[0];let l=oe(t,n,1,r);return ie(t,t,[a,l])}let i=null;for(let a=0;a<o.length;a++){let l=o[a];if(!l||l===t)continue;let u=je(e,l,t,r.maxDepth);u.found&&(i==null||u.pathOrder.length<i.pathOrder.length)&&(i=u,i={found:!0,pathOrder:[{path:t,depIndices:[a]},...u.pathOrder],truncated:!1})}return i==null?null:ie(t,t,Be(e,i.pathOrder,r))}function Be(e,t,r){return t.map((n,o)=>{let s=e.nodes[n.path],i=oe(n.path,s,o,r);return n.depIndices!=null&&n.depIndices.length>0&&(i.dep_index=n.depIndices[0],n.depIndices.length>1&&(i.dep_indices=[...n.depIndices])),i})}function oe(e,t,r,n){let o={path:e,type:t.type,hop:r};t.status!==void 0&&(o.status=t.status),"value"in t&&(o.value=t.value),t.v!=null&&(o.v=t.v);let s=n.annotations?.get(e)??t.annotation;s!=null&&(o.annotation=s);let i=n.lastMutations?.get(e)??t.lastMutation;return i!=null&&(o.lastMutation=i),o}function ie(e,t,r){return Fe(e,t,!0,"ok",r)}function se(e,t,r){return Fe(e,t,!1,r,[])}function Fe(e,t,r,n,o){let s=ct(e,t,r,n,o);return{from:e,to:t,found:r,reason:n,steps:o,text:s,toJSON(){return{from:e,to:t,found:r,reason:n,steps:o}}}}function ct(e,t,r,n,o){if(!r)switch(n){case"no-such-from":return`explainPath: no node named "${e}"`;case"no-such-to":return`explainPath: no node named "${t}"`;case"max-depth-exceeded":return`explainPath: no path from "${e}" to "${t}" within maxDepth`;default:return`explainPath: no path from "${e}" to "${t}"`}let s=[`Causal path: ${e} \u2192 ${t} (${o.length} step(s))`];for(let i of o){let l=` ${i.hop===0?"\xB7":"\u2193"} ${i.path} (${i.type}${i.status?`/${i.status}`:""})`;if(s.push(l),"value"in i&&s.push(` value: ${dt(i.value)}`),i.annotation!=null&&s.push(` annotation: ${i.annotation}`),i.lastMutation!=null){let u=i.lastMutation.actor;s.push(` actor: ${u.type}${u.id?`:${u.id}`:""}`)}}return s.join(`
|
|
2
2
|
`)}function dt(e){if(e===void 0)return"<sentinel>";if(e===null)return"null";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{let t=JSON.stringify(e);return t.length>80?`${t.slice(0,77)}...`:t}catch{return String(e)}}var A={object:56,array:64,string:40,number:8,boolean:4,null:0,undefined:0,symbol:40,bigint:16,function:120,map:72,set:72,mapEntry:40,setEntry:24,date:24,regexp:48,error:64,url:80,promise:48,weakmap:40,weakset:40},ft=Symbol.for("sizeof");function He(e){let t=new WeakSet,r=new WeakSet,n=[e],o=0;for(;n.length>0;){let s=n.pop();o+=pt(s,t,r,n)}return o}function pt(e,t,r,n){if(e==null)return 0;switch(typeof e){case"number":return A.number;case"boolean":return A.boolean;case"string":return A.string+e.length*2;case"bigint":return A.bigint+ht(e);case"symbol":return A.symbol;case"function":return t.has(e)?0:(t.add(e),A.function);case"undefined":return 0}let s=e;if(t.has(s))return 0;t.add(s);let i=s[ft];if(typeof i=="function")try{let u=i.call(s);if(typeof u=="number"&&Number.isFinite(u))return u}catch{}if(s instanceof Date)return A.date;if(s instanceof RegExp)return A.regexp+s.source.length*2;if(s instanceof Error){let u=s.message?s.message.length*2:0,d=s.stack?s.stack.length*2:0;return A.error+u+d}if(typeof URL<"u"&&s instanceof URL)return A.url+s.href.length*2;if(typeof Promise<"u"&&s instanceof Promise)return A.promise;if(s instanceof WeakMap)return A.weakmap;if(s instanceof WeakSet)return A.weakset;if(s instanceof Map){let u=A.map;for(let[d,h]of s)u+=A.mapEntry,n.push(d),n.push(h);return u}if(s instanceof Set){let u=A.set;for(let d of s)u+=A.setEntry,n.push(d);return u}if(Array.isArray(s)){let u=A.array+s.length*8;for(let d of s)n.push(d);return u}if(s instanceof ArrayBuffer)return r.has(s)?0:(r.add(s),s.byteLength);if(ArrayBuffer.isView(s)){let u=s;return r.has(u.buffer)?48:(r.add(u.buffer),u.buffer.byteLength+48)}let a=A.object,l=Object.keys(s);for(let u of l){a+=A.string+u.length*2;try{n.push(s[u])}catch{}}return a}function ht(e){let t=e<0n?-e:e;if(t===0n)return 0;let r=t.toString(2).length;return Math.ceil(r/32)*8}function Ve(e,t){let r=t?.topN??10,n=e.describe({detail:"standard"}),o=[],s=e._collectObserveTargets;typeof s=="function"&&s.call(e,"",o);let i=new Map;for(let[p,f]of o)i.set(p,f);let a=[];for(let[p,f]of Object.entries(n.nodes)){let c=i.get(p),g=c instanceof L?c:null,b=g?He(g.cache):0,v=g?g._sinkCount:0,w=f.deps?.length??0,m=f.type==="effect"&&v===0,y=v===0?f.type==="effect"?"orphan-effect":f.type==="derived"?"idle-derived":f.type==="producer"?"idle-producer":null:null;a.push({path:p,type:f.type,status:f.status??"unknown",valueSizeBytes:b,subscriberCount:v,depCount:w,isOrphanEffect:m,orphanKind:y})}let l=a.reduce((p,f)=>p+f.valueSizeBytes,0),u=(p,f)=>[...a].sort(f??((c,g)=>g[p]-c[p])).slice(0,r),d=a.filter(p=>p.orphanKind!=null),h=a.filter(p=>p.isOrphanEffect);return{nodeCount:a.length,edgeCount:n.edges.length,subgraphCount:n.subgraphs.length,nodes:a,totalValueSizeBytes:l,hotspots:{byValueSize:u("valueSizeBytes"),bySubscriberCount:u("subscriberCount"),byDepCount:u("depCount")},orphans:d,orphanEffects:h}}function Re(e){return e>=768&&e<=879||e>=1155&&e<=1161||e>=1425&&e<=1469||e>=1552&&e<=1562||e>=1611&&e<=1631||e>=1648&&e===1648||e>=1750&&e<=1756||e>=1759&&e<=1764||e>=1767&&e<=1768||e>=1770&&e<=1773||e>=1840&&e<=1866||e>=1958&&e<=1968||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2641||e>=2672&&e<=2673||e>=2677&&e===2677||e>=3633&&e===3633||e>=3636&&e<=3642||e>=3655&&e<=3662||e>=3761&&e===3761||e>=3764&&e<=3772||e>=3784&&e<=3790||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65024&&e<=65039||e>=65056&&e<=65071||e===8205?0:e>=4352&&e<=4447||e>=8986&&e<=8987||e>=9001&&e<=9002||e>=9193&&e<=9203||e>=9208&&e<=9210||e>=9725&&e<=9726||e>=9748&&e<=9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e>=9898&&e<=9899||e>=9917&&e<=9918||e>=9924&&e<=9925||e===9934||e===9940||e===9962||e>=9970&&e<=9971||e===9973||e===9978||e===9981||e===9986||e===9989||e>=9992&&e<=9997||e===9999||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e>=10548&&e<=10549||e>=11013&&e<=11015||e>=11035&&e<=11036||e===11088||e===11093||e>=11904&&e<=12350||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=40959||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510||e>=126980&&e===126980||e===127183||e>=127344&&e<=127345||e===127358||e===127359||e===127374||e>=127377&&e<=127386||e>=127456&&e<=127487||e>=127488&&e<=127490||e===127514||e===127535||e>=127538&&e<=127546||e>=127568&&e<=127569||e>=127744&&e<=129535||e>=129536&&e<=129791||e>=129792&&e<=130047||e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}function ae(e){let t=0;for(let r of e)t+=Re(r.codePointAt(0));return t}function ze(e,t){if(t<=0)return"";let r=0,n="";for(let o of e){let s=Re(o.codePointAt(0));if(r+s>t){if(t<=1)return"\u2026";for(;r+1>t&&n.length>0;){let i=[...n].pop();n=n.slice(0,-i.length),r-=Re(i.codePointAt(0))}return`${n}\u2026`}n+=o,r+=s}return n}var gt={horizontal:"\u2500",vertical:"\u2502",cornerTL:"\u250C",cornerTR:"\u2510",cornerBL:"\u2514",cornerBR:"\u2518",tDown:"\u252C",tUp:"\u2534",tRight:"\u251C",tLeft:"\u2524",cross:"\u253C",arrowRight:"\u25B6",arrowDown:"\u25BC",arrowLeft:"\u25C0",arrowUp:"\u25B2",boxTL:"\u250C",boxTR:"\u2510",boxBL:"\u2514",boxBR:"\u2518",boxH:"\u2500",boxV:"\u2502"},mt={horizontal:"-",vertical:"|",cornerTL:"+",cornerTR:"+",cornerBL:"+",cornerBR:"+",tDown:"+",tUp:"+",tRight:"+",tLeft:"+",cross:"+",arrowRight:">",arrowDown:"v",arrowLeft:"<",arrowUp:"^",boxTL:"+",boxTR:"+",boxBL:"+",boxBR:"+",boxH:"-",boxV:"|"};function Ue(e,t){let r=t.charset==="ascii"?mt:gt,n=e.width,o=e.height,s=Array.from({length:o},()=>Array.from({length:n},()=>" ")),i=Array.from({length:o},()=>Array.from({length:n},()=>"empty"));for(let a of e.edges)yt(s,i,r,a);for(let a of e.boxes)bt(s,i,r,a,t.labelOf(a.id));return s.map(a=>Ot(a.join(""))).join(`
|
|
3
3
|
`)}function bt(e,t,r,n,o){let{x:s,y:i,w:a,h:l}=n;if(a<2||l<2){l>0&&Ke(e,t,s,i,a,o);return}V(e,t,s,i,r.boxTL);for(let d=s+1;d<s+a-1;d+=1)V(e,t,d,i,r.boxH);V(e,t,s+a-1,i,r.boxTR);for(let d=i+1;d<i+l-1;d+=1){V(e,t,s,d,r.boxV);for(let h=s+1;h<s+a-1;h+=1)Je(e,t,h,d," ","empty");V(e,t,s+a-1,d,r.boxV)}V(e,t,s,i+l-1,r.boxBL);for(let d=s+1;d<s+a-1;d+=1)V(e,t,d,i+l-1,r.boxH);V(e,t,s+a-1,i+l-1,r.boxBR);let u=i+Math.floor(l/2);Ke(e,t,s+1,u,a-2,o)}function V(e,t,r,n,o){Je(e,t,r,n,o,o===" "?"empty":o==="\u2500"||o==="-"?"boxH":o==="\u2502"||o==="|"?"boxV":"boxCorner")}function Je(e,t,r,n,o,s){if(n<0||n>=e.length)return;let i=e[n];r<0||r>=i.length||(i[r]=o,t[n][r]=s)}function Ke(e,t,r,n,o,s){if(n<0||n>=e.length)return;let i=r,a=o;for(let l of s){let u=ae(l);if(u!==0){if(a<u)break;i>=0&&i<e[n].length&&(e[n][i]=l,t[n][i]="label",u===2&&i+1<e[n].length&&(e[n][i+1]="",t[n][i+1]="label")),i+=u,a-=u}}for(;a>0;)i>=0&&i<e[n].length&&(e[n][i]=" ",t[n][i]="empty"),i+=1,a-=1}function yt(e,t,r,n){let o=n.points;if(o.length<2)return;for(let l=0;l+1<o.length;l+=1)vt(e,t,r,o[l],o[l+1]);for(let l=1;l+1<o.length;l+=1){let u=o[l-1],d=o[l],h=o[l+1],p=xt(u,d,h,r);p&&qe(e,t,d.x,d.y,p,"edgeCorner")}let s=o[o.length-1],i=o[o.length-2],a=wt(i,s,r);a&&qe(e,t,s.x,s.y,a,"arrow")}function vt(e,t,r,n,o){if(!(n.x===o.x&&n.y===o.y)){if(n.y===o.y){let s=n.y,i=Math.min(n.x,o.x),a=Math.max(n.x,o.x);for(let l=i;l<=a;l+=1)We(e,t,l,s,r,"h")}else if(n.x===o.x){let s=n.x,i=Math.min(n.y,o.y),a=Math.max(n.y,o.y);for(let l=i;l<=a;l+=1)We(e,t,s,l,r,"v")}}}function We(e,t,r,n,o,s){if(n<0||n>=e.length)return;let i=e[n];if(r<0||r>=i.length)return;let a=t[n][r];if(!(a==="boxH"||a==="boxV"||a==="boxCorner"||a==="label")){if(a==="empty"){i[r]=s==="h"?o.horizontal:o.vertical,t[n][r]=s==="h"?"edgeH":"edgeV";return}if(a==="edgeH"&&s==="v"){i[r]=o.cross,t[n][r]="edgeCorner";return}if(a==="edgeV"&&s==="h"){i[r]=o.cross,t[n][r]="edgeCorner";return}}}function qe(e,t,r,n,o,s){if(n<0||n>=e.length)return;let i=e[n];if(r<0||r>=i.length)return;let a=t[n][r];a==="boxH"||a==="boxV"||a==="boxCorner"||a==="label"||(i[r]=o,t[n][r]=s)}function xt(e,t,r,n){let o=e.y===t.y,s=t.y===r.y;if(o===s)return;if(o){let l=e.x<t.x,u=r.y>t.y;return l&&u?n.cornerTR:l&&!u?n.cornerBR:!l&&u?n.cornerTL:n.cornerBL}let i=e.y<t.y,a=r.x>t.x;return i&&a?n.cornerBL:i&&!a?n.cornerBR:!i&&a?n.cornerTL:n.cornerTR}function wt(e,t,r){if(t.x>e.x)return r.arrowRight;if(t.x<e.x)return r.arrowLeft;if(t.y>e.y)return r.arrowDown;if(t.y<e.y)return r.arrowUp}function Ot(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===32;)t-=1;return e.slice(0,t)}function Qe(e){let t=Et(e);_t(t),St(t),Rt(t),Dt(t,e);let r=kt(t,e),{width:n,height:o}=Tt(t),s=[];for(let i of t.layers)for(let a of i)a.isVirtual||s.push({id:a.id,layer:a.layer,order:a.order,x:a.x,y:a.y,w:a.w,h:a.h});return{boxes:s,edges:r,width:n,height:o}}function Et(e){let t=new Map;for(let o of e.nodes)t.set(o,{id:o,isVirtual:!1,layer:-1,order:0,x:0,y:0,w:e.widthCells(o),h:e.heightCells(o),in:[],out:[]});let r=[],n=0;for(let o of e.edges){if(o.from===o.to)continue;let s=t.get(o.from),i=t.get(o.to);if(!s||!i)continue;let a={chainId:n++,chainFrom:o.from,chainTo:o.to,fromId:o.from,toId:o.to,hopIndex:0,chainLen:1};s.out.push(a),i.in.push(a),r.push(a)}return{nodes:t,layers:[],hops:r}}function _t(e){let t=new Map;for(let s of e.nodes.values())t.set(s.id,s.in.length);let r=[];for(let s of e.nodes.values())(t.get(s.id)??0)===0&&(s.layer=0,r.push(s));let n=new Set,o=0;for(;o<r.length;){let s=r[o++];if(!n.has(s.id)){n.add(s.id);for(let i of s.out){let a=e.nodes.get(i.toId);a.layer=Math.max(a.layer,s.layer+1);let l=(t.get(a.id)??0)-1;t.set(a.id,l),l<=0&&r.push(a)}}}for(let s of e.nodes.values())s.layer<0&&(s.layer=0)}function St(e){let t=Math.max(0,...Array.from(e.nodes.values(),s=>s.layer)),r=Array.from({length:t+1},()=>[]);for(let s of e.nodes.values())r[s.layer].push(s);let n=[],o=0;for(let s of e.hops){let i=e.nodes.get(s.fromId),a=e.nodes.get(s.toId),l=a.layer-i.layer;if(l<=0){i.out=i.out.filter(h=>h!==s),a.in=a.in.filter(h=>h!==s);continue}if(l===1){s.hopIndex=0,s.chainLen=1,n.push(s);continue}i.out=i.out.filter(h=>h!==s),a.in=a.in.filter(h=>h!==s);let u=i;for(let h=1;h<l;h+=1){let p=`__virt_${o++}__`,f={id:p,isVirtual:!0,layer:i.layer+h,order:0,x:0,y:0,w:0,h:1,in:[],out:[]};e.nodes.set(p,f),r[f.layer].push(f);let c={chainId:s.chainId,chainFrom:s.chainFrom,chainTo:s.chainTo,fromId:u.id,toId:p,hopIndex:h-1,chainLen:l};u.out.push(c),f.in.push(c),n.push(c),u=f}let d={chainId:s.chainId,chainFrom:s.chainFrom,chainTo:s.chainTo,fromId:u.id,toId:a.id,hopIndex:l-1,chainLen:l};u.out.push(d),a.in.push(d),n.push(d)}for(let s of r)for(let i=0;i<s.length;i+=1)s[i].order=i;e.layers=r,e.hops=n}function Rt(e){for(let r=0;r<4;r+=1){for(let n=1;n<e.layers.length;n+=1)Ye(e,e.layers[n],"in"),ue(e.layers[n]);for(let n=e.layers.length-2;n>=0;n-=1)Ye(e,e.layers[n],"out"),ue(e.layers[n])}for(let r=0;r<2;r+=1){let n=!1;for(let o=1;o<e.layers.length;o+=1){let s=e.layers[o];for(let i=0;i+1<s.length;i+=1){let a=Xe(e,s[i],s[i+1],"in");[s[i],s[i+1]]=[s[i+1],s[i]],ue(s),Xe(e,s[i],s[i+1],"in")<a?n=!0:([s[i],s[i+1]]=[s[i+1],s[i]],ue(s))}}if(!n)break}}function Ye(e,t,r){let n=new Map;for(let o of t){let s=r==="in"?o.in:o.out;if(s.length===0){n.set(o.id,o.order);continue}let i=0,a=0;for(let l of s){let u=e.nodes.get(r==="in"?l.fromId:l.toId);u&&(i+=u.order,a+=1)}n.set(o.id,a===0?o.order:i/a)}t.sort((o,s)=>{let i=n.get(o.id),a=n.get(s.id);return i!==a?i-a:o.order-s.order})}function ue(e){for(let t=0;t<e.length;t+=1)e[t].order=t}function Xe(e,t,r,n){let o=n==="in"?t.in:t.out,s=n==="in"?r.in:r.out,i=0;for(let a of o)for(let l of s){let u=e.nodes.get(n==="in"?a.fromId:a.toId)?.order??0,d=e.nodes.get(n==="in"?l.fromId:l.toId)?.order??0;(t.order<r.order&&u>d||t.order>r.order&&u<d)&&(i+=1)}return i}function Dt(e,t){t.direction==="LR"?Gt(e,t):Ct(e,t)}function Gt(e,t){let r=[],n=0;for(let o=0;o<e.layers.length;o+=1){r.push(n);let s=0;for(let i of e.layers[o])s=Math.max(s,i.w);n+=s+t.layerGap}for(let o=0;o<e.layers.length;o+=1)for(let s of e.layers[o])s.x=r[o];for(let o of e.layers){let s=0;for(let i of o)i.y=s,s+=i.h+t.nodeGap}Ze(e,t,"y")}function Ct(e,t){let r=[],n=0;for(let o=0;o<e.layers.length;o+=1){r.push(n);let s=0;for(let i of e.layers[o])s=Math.max(s,i.h);n+=s+t.layerGap}for(let o=0;o<e.layers.length;o+=1)for(let s of e.layers[o])s.y=r[o];for(let o of e.layers){let s=0;for(let i of o)i.x=s,s+=i.w+t.nodeGap}Ze(e,t,"x")}function Ze(e,t,r){let n=s=>r==="y"?s.h:s.w,o=t.nodeGap;for(let s=0;s<2;s+=1){let i=s===0?e.layers.slice(1):e.layers.slice(0,-1).reverse();for(let a of i){let l=new Map;for(let d of a){let h=s===0?d.in:d.out;if(h.length===0)continue;let p=[];for(let c of h){let g=e.nodes.get(s===0?c.fromId:c.toId);if(!g)continue;let b=r==="y"?g.y:g.x;p.push(b+Math.floor(n(g)/2))}if(p.length===0)continue;p.sort((c,g)=>c-g);let f=p[Math.floor(p.length/2)];l.set(d.id,f-Math.floor(n(d)/2))}let u=0;for(let d of a){let h=l.get(d.id),p=r==="y"?d.y:d.x,c=Math.max(h??p,u);r==="y"?d.y=c:d.x=c,u=c+n(d)+o}}}}function kt(e,t){let r=new Map;for(let u of e.hops){let d=r.get(u.chainId);d?d.push(u):r.set(u.chainId,[u])}for(let u of r.values())u.sort((d,h)=>d.hopIndex-h.hopIndex);let n=t.direction==="LR",o=u=>n?u.x:u.y,s=u=>n?u.w:u.h,i=u=>n?u.y+Math.floor(u.h/2):u.x+Math.floor(u.w/2),a=new Map;for(let u=0;u+1<e.layers.length;u+=1){let d=e.layers[u],h=e.layers[u+1],p=0;for(let _ of d)p=Math.max(p,o(_)+s(_));let f=Number.POSITIVE_INFINITY;for(let _ of h)f=Math.min(f,o(_));let c=Number.isFinite(f)?f-1:p,g=Math.max(1,c-p+1),b=[];for(let _ of d)for(let R of _.out)b.push(R);b.sort((_,R)=>{let k=i(e.nodes.get(_.fromId)),$=i(e.nodes.get(R.fromId));if(k!==$)return k-$;let G=i(e.nodes.get(_.toId)),D=i(e.nodes.get(R.toId));return G-D});let v=[],w=new Map;for(let _ of b){let R=i(e.nodes.get(_.fromId)),k=i(e.nodes.get(_.toId)),$=Math.min(R,k),G=Math.max(R,k),D=-1;for(let P=0;P<v.length;P+=1){let F=v[P],H=!0;for(let U of F)if(U.lo<=G&&$<=U.hi){H=!1;break}if(H){F.push({lo:$,hi:G}),D=P;break}}D<0&&(v.push([{lo:$,hi:G}]),D=v.length-1),w.set(_,D)}let m=v.length,y=g>=Math.max(3,m+2),S=y?p+1:p,x=y?c-1:c,O=Math.max(1,x-S+1);for(let _ of b){let R=w.get(_),k;if(m<=1)k=S+Math.floor(O/2);else{let $=(O-1)/(m-1);k=S+Math.floor(R*$)}a.set(_,Math.max(p,Math.min(c,k)))}}let l=[];for(let[,u]of r){let d=[];for(let p=0;p<u.length;p+=1){let f=u[p],c=e.nodes.get(f.fromId),g=e.nodes.get(f.toId),b=a.get(f),v=c.isVirtual?o(c):o(c)+s(c),w=g.isVirtual?o(g):o(g)-1,m=i(c),y=i(g);p===0&&le(d,n,v,m),m!==y&&(le(d,n,b,m),le(d,n,b,y)),le(d,n,w,y)}let h=u[0];l.push({from:h.chainFrom,to:h.chainTo,points:$t(d)})}return l}function le(e,t,r,n){e.push(t?{x:r,y:n}:{x:n,y:r})}function $t(e){let t=[];for(let r of e){let n=t[t.length-1];(!n||n.x!==r.x||n.y!==r.y)&&t.push(r)}return t}function Tt(e){let t=0,r=0;for(let n of e.layers)for(let o of n)t=Math.max(t,o.x+o.w),r=Math.max(r,o.y+o.h);return{width:t,height:r}}var Nt=24,At=4,Pt=1,Mt=3;function et(e,t){let r=Lt(t.direction),n=Math.max(3,t.maxLabelWidth??Nt),o=t.asciiCharset??"unicode",s=Object.keys(e.nodes).sort(),i=new Set(s),a=e.edges.filter(f=>i.has(f.from)&&i.has(f.to)),l=new Map,u=new Map;for(let f of s){let c=ze(f,n);l.set(f,c),u.set(f,ae(c)+4)}let d=Qe({nodes:s,edges:a,widthCells:f=>u.get(f)??3,heightCells:()=>Mt,layerGap:At,nodeGap:Pt,direction:r}),h=Ue(d,{charset:o,labelOf:f=>l.get(f)??f}),p=t.logger;return p&&p(h),h}function Lt(e){if(e===void 0||e==="LR")return"LR";if(e==="TD")return"TD";throw new Error(`ascii describe supports direction "LR" or "TD" only; got ${String(e)}`)}var N="::",B="__meta__",q=1;function tt(e,t){let r=Math.max(16,e.size*4),n=0;for(;e.size>0;){if(n++>=r){console.error(`[Graph "${t}".destroy] disposer drain exceeded cap (${r}); ${e.size} disposer(s) discarded`),e.clear();return}let o=e.values().next();if(o.done)return;let s=o.value;e.delete(s);try{s()}catch(i){console.error(`[Graph "${t}".destroy] disposer threw:`,i)}}}function It(e){let t=[];for(let r of Object.keys(e).sort()){let n=e[r].v;n!=null&&t.push(`${r} ${n.id} ${n.version}`)}return t.join(`
|
|
4
4
|
`)}function nt(e){if(e.version!==q)throw new Error(`unsupported snapshot version ${String(e.version)} (expected ${q})`);for(let t of["name","nodes","edges","subgraphs"])if(!(t in e))throw new Error(`snapshot missing required key "${t}"`);if(typeof e.name!="string")throw new TypeError("snapshot 'name' must be a string");if(typeof e.nodes!="object"||e.nodes===null||Array.isArray(e.nodes))throw new TypeError("snapshot 'nodes' must be an object");if(!Array.isArray(e.edges))throw new TypeError("snapshot 'edges' must be an array");if(!Array.isArray(e.subgraphs))throw new TypeError("snapshot 'subgraphs' must be an array")}function jt(e,t){let r=new WeakMap,n=(o,s)=>{if(Object.is(o,s))return!0;if(o==null||s==null||typeof o!="object"||typeof s!="object")return!1;let i=r.get(o);if(i==null&&(i=new WeakSet,r.set(o,i)),i.has(s))return!0;i.add(s);let a=o.constructor,l=s.constructor;if(a!==l)return!1;if(o instanceof Date)return o.getTime()===s.getTime();if(o instanceof RegExp)return o.source===s.source&&o.flags===s.flags;if(Array.isArray(o)){let p=s;if(o.length!==p.length)return!1;for(let f=0;f<o.length;f++)if(!n(o[f],p[f]))return!1;return!0}if(o instanceof Map){let p=s;if(o.size!==p.size)return!1;for(let[f,c]of o)if(!p.has(f)||!n(c,p.get(f)))return!1;return!0}if(o instanceof Set){let p=s;if(o.size!==p.size)return!1;for(let f of o){let c=!1;for(let g of p)if(n(f,g)){c=!0;break}if(!c)return!1}return!0}if(ArrayBuffer.isView(o)){let p=o,f=s;if(p.length!==f.length)return!1;for(let c=0;c<p.length;c++)if(p[c]!==f[c])return!1;return!0}let u=Object.keys(o),d=Object.keys(s);if(u.length!==d.length)return!1;let h=new Set(d);for(let p of u)if(!h.has(p)||!n(o[p],s[p]))return!1;return!0};return n(e,t)}function Ge(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Ge);let t=e,r=Object.keys(t).sort(),n={};for(let o of r)n[o]=Ge(t[o]);return n}function Bt(e){return e.replaceAll("\\","\\\\").replaceAll('"','\\"')}function Ft(e){return e.replaceAll("\\","\\\\").replaceAll('"','\\"')}function Ht(e){return e==="TD"?"down":e==="BT"?"up":e==="RL"?"left":"right"}function ot(e){let t=new Set,r=[];function n(o,s){let i=`${o}\0${s}`;t.has(i)||(t.add(i),r.push([o,s]))}for(let[o,s]of Object.entries(e.nodes)){let i=s.deps;if(i)for(let a of i)n(a,o)}for(let o of e.edges)n(o.from,o.to);return r}function it(e){if(e===void 0)return"LR";if(e==="TD"||e==="LR"||e==="BT"||e==="RL")return e;throw new Error(`invalid diagram direction ${String(e)}; expected one of: TD, LR, BT, RL`)}function Vt(e,t){let r=t.includeEdges??!0,n=t.includeSubgraphs??!0,{expand:o,...s}=e,i={...s,edges:r?e.edges:[],subgraphs:n?e.subgraphs:[]},a=JSON.stringify(Ge(i),null,t.indent??2);return t.logger?.(a),a}function zt(e,t){let r=t.includeEdges??!0,n=t.includeSubgraphs??!0,o=[];o.push(`Graph ${e.name}`),o.push("Nodes:");for(let i of Object.keys(e.nodes).sort()){let a=e.nodes[i];o.push(`- ${i} (${a.type}/${a.status}): ${de(a.value)}`)}if(r){o.push("Edges:");for(let i of e.edges)o.push(`- ${i.from} -> ${i.to}`)}if(n){o.push("Subgraphs:");for(let i of e.subgraphs)o.push(`- ${i}`)}let s=o.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as j,c as K,d as V,e as $}from"./chunk-
|
|
1
|
+
import{a as j,c as K,d as V,e as $}from"./chunk-7Q2WPFQ7.js";import{a as R}from"./chunk-ESMPEKEV.js";import{c as S}from"./chunk-I6VIH3VA.js";import{n as D}from"./chunk-4F564IPP.js";import{m as w,w as T}from"./chunk-T7EQPKOP.js";import{G as N,o as b,p as L}from"./chunk-LYCLF26R.js";import{j as O}from"./chunk-CK2E7BTU.js";function v(){let e=new Error("aborted");return e.name="AbortError",e}function W(e,r){return e<=0?Promise.resolve():r?.aborted?Promise.reject(v()):new Promise((t,a)=>{let p=new R,u,y=()=>{p.cancel(),r&&u&&r.removeEventListener("abort",u)};p.start(e,()=>{y(),t()}),r&&(u=()=>{y(),a(v())},r.addEventListener("abort",u,{once:!0}))})}function U(e={}){let r=e.provider??"dry-run",t=e.model??"dry-run-v1",a=e.latencyMs??0,p=Math.max(1,e.streamChunkSize??16),u=e.respond??(d=>{let o=[...d].reverse().find(n=>n.role==="user");return o?`echo: ${o.content}`:"dry-run: no user message"}),y=e.usage??((d,o)=>{let n=d.reduce((s,l)=>s+l.content.length,0);return{input:{regular:Math.ceil(n/4)},output:{regular:Math.ceil(o.length/4)}}});return{provider:r,model:t,async invoke(d,o){if(await W(a,o?.signal),o?.signal?.aborted)throw v();let n=u(d,o),s=y(d,n);return{content:n,usage:s,finishReason:"stop",model:o?.model??t,provider:r,tier:o?.tier,metadata:{dryRun:!0}}},async*stream(d,o){let n=u(d,o),s=y(d,n),l=Math.ceil(n.length/p)||1,i=a>0?a/l:0;for(let c=0;c<n.length;c+=p){if(o?.signal?.aborted)throw v();await W(i,o?.signal),yield{type:"token",delta:n.slice(c,c+p)}}yield{type:"usage",usage:s},yield{type:"finish",reason:"stop"}}}}function _(e){let{storage:r,mode:t="read-write",keyFn:a,keyPrefix:p="llm-replay"}=e,y=V({storage:r,keyPrefix:p,mode:t==="read-strict"?"read":t,keyContext:({messages:o,opts:n})=>{let{signal:s,keyContext:l,...i}=n??{};return{messages:o,opts:i}}});async function d(o,n){if(a){if(a.length<=1){let l={messages:o,opts:n,context:n?.keyContext},i=await a(l);return`${p}:${i}`}let s=await a(o,n);return`${p}:${s}`}return y.keyFor({messages:o,opts:n})}return{keyFor:d,async lookup(o,n){if(t!=="write"){if(a){let s=await d(o,n),l=await r.load(s);return l??void 0}return y.lookup({messages:o,opts:n})}},async store(o,n,s){if(t!=="read"){if(a){let l=await d(o,n);await r.save(l,s);return}await y.store({messages:o,opts:n},s)}},async forget(o,n){if(!(t==="read"||t==="write")&&r.clear){if(a){let s=await d(o,n);await r.clear(s);return}await y.forget({messages:o,opts:n})}}}}function z(e,r,t){return{provider:t?.provider??e.provider,model:t?.model??e.model,capabilities:t?.capabilities??e.capabilities?.bind(e),invoke:r.invoke,stream:r.stream}}function ce(e,r){let{onResp:t,onError:a,name:p}=r;if(e!=null&&typeof e.then=="function"){let n=e;return a?n.then(t).catch(s=>{throw a(s),s}):n.then(t)}if(e!=null&&typeof e=="object"&&"content"in e)return t(e);let u=w(e);if(a){let n=!1;u.subscribe(s=>{for(let l of s){if(n)return;l[0]===O&&(n=!0,a(l[1]))}})}let y,d=!1,o=D(u,n=>{y=t(n),d=!0});return N([o],([n])=>n==null?null:d?y:t(n),{name:p??"adapt/invokeTap"})}function pe(e){let r=e.endNs??b();return{timestamp:r,wallClock:e.startWallClockNs??L(),provider:e.provider,model:e.model,tier:e.tier,usage:e.usage,latencyMs:Math.max(0,(r-e.startNs)/1e6),method:e.method,...e.error?{error:e.error}:{}}}function ye(){return{input:{regular:0},output:{regular:0}}}var G=Symbol.for("graphrefly.adapter.middlewareLayers");function J(e,r,t){let p=[...t?Q(t):[],r];return Object.defineProperty(e,G,{value:Object.freeze(p),enumerable:!1,writable:!1,configurable:!1}),e}function Q(e){let r=e[G];return Array.isArray(r)?r:[]}var M=class extends Error{constructor(t,a){super(`withReplayCache: no cached response for ${a} (key=${t}, mode=read-strict)`);this.key=t;this.method=a}name="ReplayCacheMissError"};function q(e,r){let t=r.mode??"read-write",a=r.cacheStreaming??!1,p=r.captureStreamCadence??!1,u=r.replaySpeed??1,y=r.keyPrefix??"llm-replay",d=t==="read"||t==="read-strict",o=_({storage:r.storage,mode:t==="write-only"?"write":t,keyFn:r.keyFn,keyPrefix:y}),n=i=>i<=0?Promise.resolve():new Promise(c=>{new R().start(i,()=>c())}),s=$(async({messages:i,invokeOpts:c})=>await T(w(e.invoke(i,c))),{keyFn:({_precomputedKey:i})=>i}),l=z(e,{async invoke(i,c){let C=await o.keyFor(i,c),f=await o.lookup(i,c);if(f?.response){let k=f.response;return{...k,metadata:{...k.metadata??{},replayCache:"hit"}}}if(t==="read-strict")throw new M(C,"invoke");let h=await s({messages:i,invokeOpts:c,_precomputedKey:C});return d||await o.store(i,c,{response:h,storedAtNs:L()}),h},async*stream(i,c){if(!a){for await(let m of e.stream(i,c))yield m;return}let C=await o.keyFor(i,c),f=await o.lookup(i,c);if(f){let m=f.response;if(f.streamChunks&&f.streamCadenceMs)for(let g=0;g<f.streamChunks.length;g++){let A=f.streamCadenceMs[g]??0,E=u>0?A/u:0;E>0&&await n(E),yield{type:"token",delta:f.streamChunks[g]?.delta??""}}else m.content&&(yield{type:"token",delta:m.content});m.usage&&(yield{type:"usage",usage:m.usage}),yield{type:"finish",reason:m.finishReason??"stop"};return}if(t==="read-strict")throw new M(C,"stream");let h="",k,P,F=[],I=[],x;for await(let m of e.stream(i,c)){if(m.type==="token"&&(h+=m.delta,p)){let g=b(),A=x===void 0?0:(g-x)/1e6;I.push(A),x=g,F.push({delta:m.delta})}m.type==="usage"&&(k=m.usage),m.type==="finish"&&(P=m.reason),yield m}if((h||k)&&!d){let g={response:{content:h,usage:k??{input:{regular:0},output:{regular:0}},finishReason:P,model:e.model??c?.model??"",provider:e.provider},storedAtNs:L(),...p?{streamChunks:F,streamCadenceMs:I}:{}};await o.store(i,c,g)}}});return J(l,"withReplayCache",e),l}var B=K;var Ae=M;function H(e,r){return{content:"[fallback: no cached response available for this request]",usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:r,provider:e,metadata:{degraded:!0,reason:"no-fixture"}}}function Y(e,r,t){return typeof e=="string"?{content:e,usage:{input:{regular:0},output:{regular:0}},finishReason:"stop",model:t,provider:r,metadata:{degraded:!0,reason:"respond"}}:e}async function X(e,r){if("key"in e)return e.key;let t=B({messages:e.messages,opts:e.invokeOpts??{}}),a=await j(t);return`${r}:${a}`}function Z(e){let r={response:e.response,storedAtNs:L()};if("key"in e&&e.stream){let t=e.stream.chunks.filter(a=>a.type==="token");return{...r,streamChunks:t.map(a=>({delta:a.delta})),streamCadenceMs:e.stream.delaysMs??t.map(()=>0)}}return r}function ee(e,r){let t=[];if(e.fixtures!=null&&t.push("fixtures"),e.fixturesStorage!=null&&t.push("fixturesStorage"),t.length>1)throw new TypeError(`fallbackAdapter: \`fixtures\` and \`fixturesStorage\` are mutually exclusive; got both ${t.join(" and ")}. Pick one source. For filesystem directories use the node subpath's \`fallbackAdapter\`.`);if(e.fixtures){let a=S(),p=e.fixtures,u=(async()=>{for(let y of p){let d=await X(y,r);await a.save(d,Z(y))}})();return u.catch(()=>{}),{tier:a,seedReady:u}}return e.fixturesStorage?{tier:e.fixturesStorage,seedReady:Promise.resolve()}:{tier:void 0,seedReady:Promise.resolve()}}function Se(e={}){let r=e.provider??"fallback",t=e.model??"fallback",a=e.onMiss??"respond",p=e.keyPrefix??"fallback",u=e.record?e.record.adapter:a==="throw"?U({provider:r,model:t,respond:()=>"[unreachable: read-strict mode throws on miss]"}):{provider:r,model:t,async invoke(s,l){let i=e.respond?e.respond(s,l):H(r,t);return Y(i,r,t)},async*stream(s,l){let i=e.respond?e.respond(s,l):H(r,t),c=Y(i,r,t);yield{type:"token",delta:c.content},c.usage&&(yield{type:"usage",usage:c.usage}),yield{type:"finish",reason:c.finishReason??"stop"}}},y,d=Promise.resolve();if(e.record){if(!e.record.storage)throw new TypeError("fallbackAdapter: `record.storage` is required in record mode. For filesystem `record.dir` convenience, use the node subpath's `fallbackAdapter`.");y=e.record.storage}else{let s=ee(e,p);y=s.tier??S(),d=s.seedReady}let o=e.record?"read-write":a==="throw"?"read-strict":"read",n=q(u,{storage:y,mode:o,keyPrefix:p,cacheStreaming:!0,captureStreamCadence:!0,replaySpeed:e.replaySpeed,...e.keyFn?{keyFn:e.keyFn}:{}});return{provider:r,model:t,capabilities:n.capabilities?.bind(n),async invoke(s,l){return await d,n.invoke(s,l)},async*stream(s,l){await d;for await(let i of n.stream(s,l))yield i}}}export{U as a,z as b,ce as c,pe as d,ye as e,J as f,M as g,q as h,B as i,Ae as j,Se as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as P}from"./chunk-4VVTGLXJ.js";import{m as y}from"./chunk-UMH3HSP7.js";import{D as N,F as w,G as W,o as k}from"./chunk-7AJKUA36.js";import{a as C,b as p,c as A,d as m,i as a,j as b}from"./chunk-CK2E7BTU.js";function c(d){return{describeKind:"derived",...d}}function B(d){return{describeKind:"derived",partial:!0,...d}}function Q(d,i,u){return N([d],(t,e)=>{let n=t[0];if(n==null||n.length===0){e.down([[m]]);return}for(let o of n)e.emit(i(o))},c(u))}function S(d,i,u){return N([d],(t,e)=>{let n=t[0];if(n==null||n.length===0){e.down([[m]]);return}let o=!1;for(let r of n)i(r)&&(e.emit(r),o=!0);o||e.down([[m]])},c(u))}function X(d,i,u,t){return N([d],(e,n,o)=>{"acc"in o.store||(o.store.acc=u);let r=e[0];if(r==null||r.length===0){n.down([[m]]);return}for(let s of r)o.store.acc=i(o.store.acc,s),n.emit(o.store.acc)},{...c(t),initial:u,resetOnTeardown:!0})}function Z(d,i,u,t){return N([d],(e,n,o)=>{if("acc"in o.store||(o.store.acc=u),o.terminalDeps[0]===!0){n.emit(o.store.acc),n.down([[a]]);return}let r=e[0];if(r==null||r.length===0){n.down([[m]]);return}for(let s of r)o.store.acc=i(o.store.acc,s)},{...c(t),completeWhenDepsComplete:!1})}function M(d,i,u){return i<=0?N([d],(t,e,n)=>{n.store.completed||(n.store.completed=!0,e.down([[a]]))},{...c(u),completeWhenDepsComplete:!1}):N([d],(t,e,n)=>{if("taken"in n.store||(n.store.taken=0),n.store.done){e.down([[m]]);return}if(n.terminalDeps[0]===!0){n.store.done=!0,e.down([[a]]);return}let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}for(let r of o)if(n.store.taken++,e.emit(r),n.store.taken>=i){n.store.done=!0,e.down([[a]]);return}},{...c(u),completeWhenDepsComplete:!1})}function V(d,i,u){return N([d],(t,e,n)=>{"skipped"in n.store||(n.store.skipped=0);let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}let r=!1;for(let s of o)n.store.skipped++,n.store.skipped<=i||(e.emit(s),r=!0);r||e.down([[m]])},c(u))}function $(d,i,u){return N([d],(t,e,n)=>{if(n.store.done){e.down([[m]]);return}let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}for(let r of o){if(!i(r)){n.store.done=!0,e.down([[a]]);return}e.emit(r)}},{...c(u),completeWhenDepsComplete:!1})}function ee(d,i,u){let t=u?.predicate??(o=>o[0]===p),{predicate:e,...n}=u??{};return w(o=>{let r=!1,s=d.subscribe(l=>{if(!r)for(let T of l){if(r)return;T[0]===p?o.emit(T[1]):(T[0]===a||T[0]===b)&&(r=!0,o.down([T]))}}),f=i.subscribe(l=>{if(!r)for(let T of l){if(r)return;if(t(T)){r=!0,o.down([[a]]);return}}});return()=>{s(),f()}},c(n))}function ne(d,i){return M(d,1,i)}function te(d,i){let{defaultValue:u,...t}=i??{},e=i!=null&&Object.hasOwn(i,"defaultValue");return N([d],(n,o,r)=>{if(r.terminalDeps[0]===!0){r.store.has?o.emit(r.store.latest):e&&o.emit(u),o.down([[a]]);return}let s=n[0];if(s==null||s.length===0){o.down([[m]]);return}r.store.latest=s.at(-1),r.store.has=!0},{...c(t),completeWhenDepsComplete:!1})}function oe(d,i,u){return M(S(d,i,u),1,u)}function re(d,i,u){return M(V(d,i,u),1,u)}function se(d,i,u){if(typeof i=="function")return N([d],(e,n)=>{let o=e[0];if(o==null||o.length===0){n.down([[m]]);return}for(let r of o)i(r),n.emit(r)},c(u));let t=i;return N([d],(e,n,o)=>{if(o.terminalDeps[0]!==void 0){o.terminalDeps[0]===!0?(t.complete?.(),n.down([[a]])):(t.error?.(o.terminalDeps[0]),n.down([[b,o.terminalDeps[0]]]));return}let r=e[0];if(r==null||r.length===0){n.down([[m]]);return}for(let s of r)t.data?.(s),n.emit(s)},{...c(u),completeWhenDepsComplete:!1})}function K(d,i,u){let t=u?.where??(n=>n!=null),e=!1;return N([d],(n,o)=>{let r=n[0];if(r==null||r.length===0){o.down([[m]]);return}for(let s of r)!e&&t(s)&&(e=!0,i(s)),o.emit(s)},c(u))}var ie=K;function ue(d,i=Object.is,u){return N([d],(t,e,n)=>{let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}let r=!1;for(let s of o)n.store.hasPrev&&i(n.store.prev,s)||(n.store.prev=s,n.store.hasPrev=!0,e.emit(s),r=!0);r||e.down([[m]])},c(u))}function fe(d,i){return N([d],(u,t,e)=>{let n=u[0];if(n==null||n.length===0){t.down([[m]]);return}let o=!1;for(let r of n)if(!e.store.hasPrev)e.store.prev=r,e.store.hasPrev=!0;else{let s=[e.store.prev,r];e.store.prev=r,t.emit(s),o=!0}o||t.down([[m]])},c(i))}function q(...d){let i=[...d];return W(i,u=>u,{...c(),equals:(u,t)=>{if(u.length!==t.length)return!1;for(let e=0;e<u.length;e++)if(!Object.is(u[e],t[e]))return!1;return!0}})}function de(d,i,u){return N([d,i],(t,e,n)=>{let o=t[0],r=t[1],s=r!=null&&r.length>0?r.at(-1):n.prevData[1];if(o!=null&&o.length>0){if(!(r!=null&&r.length>0)&&n.prevData[1]===void 0){e.down([[m]]);return}for(let f of o)e.emit([f,s])}else e.down([[m]])},B(u))}function le(...d){return d.length===0?w(i=>{i.down([[a]])},c()):w(i=>{let u=d.length,t=0,e=[];for(let n of d){let o=n.subscribe(r=>{for(let s of r)s[0]===p?i.emit(s[1]):s[0]===a?(t+=1,t>=u&&i.down([[a]])):s[0]===b&&i.down([s])});e.push(o)}return()=>{for(let n of e)n()}},c())}function ae(...d){let i=d.length;return i===0?w(u=>{u.emit([]),u.down([[a]])},c()):w(u=>{let t=Array.from({length:i},()=>[]),e=i;function n(){for(;t.every(r=>r.length>0);){let r=t.map(s=>s.shift());u.emit(r)}}let o=[];for(let r=0;r<i;r++){let s=r,f=d[r].subscribe(l=>{for(let T of l)T[0]===p?(t[s].push(T[1]),n()):T[0]===a?(e-=1,(e===0||t[s].length===0)&&u.down([[a]])):T[0]===b&&u.down([T])});o.push(f)}return()=>{for(let r of o)r()}},c())}function ce(d,i,u){return w(t=>{let e=0,n=[],o,r;return r=i.subscribe(s=>{for(let f of s)e===0?f[0]===p?n.push(f[1]):f[0]===b&&t.down([f]):f[0]===p?t.emit(f[1]):(f[0]===a||f[0]===b)&&t.down([f])}),o=d.subscribe(s=>{for(let f of s)if(e===0)if(f[0]===p)t.emit(f[1]);else if(f[0]===a){e=1;for(let l of n)t.emit(l);n.length=0}else f[0]===b&&t.down([f])}),()=>{o?.(),r?.()}},c(u))}function Te(...d){return d.length===0?w(i=>{i.down([[a]])},c()):d.length===1?N([d[0]],(i,u)=>{let t=i[0];if(t==null||t.length===0){u.down([[m]]);return}for(let e of t)u.emit(e)},c()):w(i=>{let u=null,t=[];for(let e=0;e<d.length;e++){let n=e,o=d[e].subscribe(r=>{for(let s of r){if(u!==null&&n!==u)return;s[0]===p?(u===null&&(u=n),i.emit(s[1])):(s[0]===a||s[0]===b)&&(u===null||n===u)&&i.down([s])}});t.push(o)}return()=>{for(let e of t)e()}},c())}function I(d,i,u){let t,e=!1,n=()=>{e||(e=!0,u())};return t=d.subscribe(o=>{let r=!1,s=!1;for(let f of o)f[0]!==C&&(f[0]===p?i.emit(f[1]):f[0]===a?r=!0:f[0]===b?(s=!0,i.down([f])):(f[0]===A||f[0]===m)&&i.down([f]));s?(t?.(),t=void 0,n()):r&&n()}),()=>{t?.(),t=void 0}}function pe(d,i,u){let t,e=!1;function n(){t?.(),t=void 0}return N([d],(o,r,s)=>{if(s.terminalDeps[0]!=null&&s.terminalDeps[0]!==!0){n();return}if(s.terminalDeps[0]===!0){e=!0,t||r.down([[a]]);return}let f=o[0];if(!(f==null||f.length===0))return n(),t=I(y(i(f[f.length-1])),r,()=>{n(),e&&r.down([[a]])}),{deactivate:()=>{n(),e=!1}}},{...c(u),completeWhenDepsComplete:!1})}function me(d,i,u){let t,e=!1;function n(){t?.(),t=void 0}return N([d],(o,r,s)=>{if(s.terminalDeps[0]!=null&&s.terminalDeps[0]!==!0){n();return}if(s.terminalDeps[0]===!0){e=!0,t||r.down([[a]]);return}let f=o[0];if(!(f==null||f.length===0))return t===void 0?t=I(y(i(f[0])),r,()=>{n(),e&&r.down([[a]])}):r.down([[m]]),{deactivate:()=>{n(),e=!1}}},{...c(u),completeWhenDepsComplete:!1})}function be(d,i,u){let{maxBuffer:t,...e}=u??{},n=[],o,r=!1,s;function f(){o?.(),o=void 0}function l(){if(!s||o!==void 0)return;if(n.length===0){r&&s.down([[a]]);return}let h=n.shift();o=I(y(i(h)),s,()=>{f(),l()})}function T(h){t&&t>0&&n.length>=t&&n.shift(),n.push(h),l()}return N([d],(h,O,x)=>{if(s=O,x.terminalDeps[0]!=null&&x.terminalDeps[0]!==!0){f(),n.length=0;return}if(x.terminalDeps[0]===!0){r=!0,l();return}let E=h[0];if(!(E==null||E.length===0)){for(let v of E)T(v);return{deactivate:()=>{f(),n.length=0,r=!1}}}},{...c(e),completeWhenDepsComplete:!1})}function _(d,i,u){let{concurrent:t,...e}=u??{},n=t!=null&&t>0?t:Number.POSITIVE_INFINITY,o=0,r=!1,s=new Set,f=[],l;function T(){r&&o===0&&f.length===0&&l&&l.down([[a]])}function h(v){if(!l)return;o++;let g;g=I(y(i(v)),l,()=>{g&&s.delete(g),o--,O(),T()}),s.add(g)}function O(){for(;f.length>0&&o<n;)h(f.shift())}function x(v){o<n?h(v):f.push(v)}function E(){for(let v of s)v();s.clear(),o=0,f.length=0}return N([d],(v,g,D)=>{if(l=g,D.terminalDeps[0]!=null&&D.terminalDeps[0]!==!0){E();return}if(D.terminalDeps[0]===!0){r=!0,T();return}let R=v[0];if(!(R==null||R.length===0)){for(let U of R)x(U);return{deactivate:()=>{E(),r=!1}}}},{...c(e),completeWhenDepsComplete:!1})}var we=_;function Ne(d,i,u){return w(t=>{let e=new Set;function n(){for(let r of e)clearTimeout(r);e.clear()}let o=d.subscribe(r=>{for(let s of r)if(s[0]===p){let f=setTimeout(()=>{e.delete(f),t.emit(s[1])},i);e.add(f)}else if(s[0]===a){let f=setTimeout(()=>{e.delete(f),t.down([[a]])},i);e.add(f)}else s[0]===b&&(n(),t.down([s]))});return()=>{o(),n()}},c(u))}function j(d,i,u){return w(t=>{let e,n;function o(){e!==void 0&&(clearTimeout(e),e=void 0)}let r=d.subscribe(s=>{for(let f of s)f[0]===p?(o(),n=f[1],e=setTimeout(()=>{e=void 0,t.emit(n)},i)):f[0]===a?(e!==void 0&&(o(),t.emit(n)),t.down([[a]])):f[0]===b&&(o(),t.down([f]))});return()=>{r(),o()}},c(u))}function F(d,i,u){let{leading:t,trailing:e,...n}=u??{},o=t!==!1,r=e===!0,s=i*1e6;return w(f=>{let l,T=-1/0,h,O=!1;function x(){l!==void 0&&(clearTimeout(l),l=void 0)}let E=d.subscribe(v=>{for(let g of v)if(g[0]===p){let D=g[1],R=k();if(o&&R-T>=s)T=R,f.emit(D),x(),r&&(l=setTimeout(()=>{l=void 0,O&&(T=k(),f.emit(h),O=!1)},i));else if(r&&(h=D,O=!0,l===void 0)){let U=(R-T)/1e6;l=setTimeout(()=>{l=void 0,O&&(T=k(),f.emit(h),O=!1)},Math.max(0,i-U))}}else(g[0]===a||g[0]===b)&&(x(),f.down([g]))});return()=>{E(),x()}},c(n))}function he(d,i,u){return w(t=>{let e,n=!1,o=!1,r=d.subscribe(f=>{if(!n)for(let l of f){if(n)return;l[0]===p?e={v:l[1]}:l[0]===b?(n=!0,t.down([l])):l[0]===a&&(o=!0,e=void 0)}}),s=i.subscribe(f=>{if(!n)for(let l of f){if(n)return;l[0]===p?e!==void 0&&!o&&t.emit(e.v):l[0]===b?(n=!0,t.down([l])):l[0]===a&&(n=!0,t.down([[a]]))}});return()=>{r(),s()}},c(u))}function ve(d,i,u){return w(t=>{let e,n,o=!1;function r(){e!==void 0&&(clearTimeout(e),e=void 0)}let s=d.subscribe(f=>{for(let l of f)l[0]===p?(n=l[1],o=!0,r(),e=setTimeout(()=>{e=void 0,o&&(o=!1,t.emit(n))},i)):(l[0]===a||l[0]===b)&&(r(),t.down([l]))});return()=>{s(),r()}},c(u))}function ge(d,i,u){let{with:t,...e}=u??{},n=t??new Error("timeout");return w(o=>{let r;function s(){clearTimeout(r),r=setTimeout(()=>{r=void 0,o.down([[b,n]])},i)}s();let f=d.subscribe(l=>{for(let T of l)T[0]===p?(s(),o.emit(T[1])):(T[0]===a||T[0]===b)&&(clearTimeout(r),o.down([T]))});return()=>{f(),clearTimeout(r)}},c(e))}function Oe(d,i,u){return w(t=>{let e=[],n=d.subscribe(r=>{for(let s of r)s[0]===p?e.push(s[1]):s[0]===a?(e.length>0&&t.emit([...e]),e.length=0,t.down([[a]])):s[0]===b&&t.down([s])}),o=i.subscribe(r=>{for(let s of r)s[0]===p?e.length>0&&(t.emit([...e]),e.length=0):s[0]===a?t.down([[a]]):s[0]===b&&t.down([s])});return()=>{n(),o(),e.length=0}},c(u))}function xe(d,i,u){if(i<=0)throw new RangeError("bufferCount expects count > 0");return w(t=>{let e=[],n=d.subscribe(o=>{for(let r of o)r[0]===p?(e.push(r[1]),e.length>=i&&t.emit(e.splice(0,e.length))):r[0]===a?(e.length>0&&t.emit([...e]),e.length=0,t.down([[a]])):r[0]===b&&t.down([r])});return()=>{n(),e.length=0}},c(u))}function Ee(d,i,u){if(i<=0)throw new RangeError("windowCount expects count > 0");return w(t=>{let e,n=0;function o(){let s=w(f=>(e=f.down.bind(f),()=>{e=void 0}),c());n=0,t.emit(s)}let r=d.subscribe(s=>{for(let f of s)f[0]===p?(e||o(),e?.([[p,f[1]]]),n+=1,n>=i&&(e?.([[a]]),e=void 0)):f[0]===a?(e?.([[a]]),e=void 0,t.down([[a]])):f[0]===b&&(e?.([f]),e=void 0,t.down([f]))});return()=>{r(),e?.([[a]]),e=void 0}},c(u))}function Re(d,i,u){return w(t=>{let e=[],n=setInterval(()=>{e.length>0&&(t.emit([...e]),e.length=0)},i),o=d.subscribe(r=>{for(let s of r)s[0]===p?e.push(s[1]):s[0]===a?(clearInterval(n),e.length>0&&t.emit([...e]),e.length=0,t.down([[a]])):s[0]===b&&(clearInterval(n),t.down([s]))});return()=>{o(),clearInterval(n),e.length=0}},c(u))}function De(d,i,u){return w(t=>{let e;function n(){e?.([[a]]),e=void 0}function o(){let f=w(l=>(e=l.down.bind(l),()=>{e=void 0}),c());t.emit(f)}o();let r=setInterval(()=>{n(),o()},i),s=d.subscribe(f=>{for(let l of f)l[0]===p?e?.([[p,l[1]]]):l[0]===a?(clearInterval(r),n(),t.down([[a]])):l[0]===b&&(clearInterval(r),e?.([l]),n(),t.down([l]))});return()=>{s(),clearInterval(r),n()}},c(u))}function ye(d,i,u){return w(t=>{let e;function n(){e?.([[a]]),e=void 0}function o(){let f=w(l=>(e=l.down.bind(l),()=>{e=void 0}),c());t.emit(f)}let r=d.subscribe(f=>{for(let l of f)l[0]===p?(e||o(),e?.([[p,l[1]]])):l[0]===a?(n(),t.down([[a]])):l[0]===b&&(e?.([l]),e=void 0,t.down([l]))}),s=i.subscribe(f=>{for(let l of f)l[0]===p&&(n(),o())});return()=>{r(),s(),n()}},c(u))}function ke(d,i){return w((u,t)=>{"n"in t.store||(t.store.n=0);let e=setInterval(()=>{u.emit(t.store.n),t.store.n=t.store.n+1},d);return()=>clearInterval(e)},c(i))}function Ie(d,i,u){if(i<=0)throw new RangeError("repeat expects count > 0");return w(t=>{let e=i,n,o=()=>{n?.(),n=d.subscribe(r=>{let s=!1,f=[];for(let l of r)l[0]===a?s=!0:f.push(l);f.length>0&&t.down(f),s&&(n?.(),n=void 0,e-=1,e>0?o():t.down([[a]]))})};return o(),()=>{n?.()}},c(u))}function Ue(d,i){return N([d],(u,t)=>{let e=u[0];if(e==null||e.length===0){t.down([[m]]);return}for(let n of e)t.emit(n)},c(i))}function L(d,i,u){return w(t=>{let e=d.subscribe(n=>{for(let o of n)if(o[0]===p)t.emit(o[1]);else if(o[0]===b)try{t.emit(i(o[1]))}catch(r){t.down([[b,r]])}else o[0]===a&&t.down([[a]])});return()=>{e()}},c(u))}function Me(d,i,u){return N([d,i],(t,e,n)=>{let o=t[1];if(!(o!=null&&o.length>0?o.at(-1):n.prevData[1])){e.down([[m]]);return}let s=t[0];if(s!=null&&s.length>0){for(let f of s)e.emit(f);return}if(o!=null&&o.length>0&&n.prevData[0]!==void 0){e.emit(n.prevData[0]);return}e.down([[m]])},B(u))}var Ce=q,Ae=j,We=F,Pe=L;export{Q as a,S as b,X as c,Z as d,M as e,V as f,$ as g,ee as h,ne as i,te as j,oe as k,re as l,se as m,K as n,ie as o,ue as p,fe as q,q as r,de as s,le as t,ae as u,ce as v,Te as w,pe as x,me as y,be as z,_ as A,we as B,Ne as C,j as D,F as E,he as F,ve as G,ge as H,Oe as I,xe as J,Ee as K,Re as L,De as M,ye as N,ke as O,Ie as P,Ue as Q,L as R,Me as S,Ce as T,Ae as U,We as V,Pe as W};
|
|
1
|
+
import{a as P}from"./chunk-4VVTGLXJ.js";import{m as y}from"./chunk-T7EQPKOP.js";import{D as N,F as w,G as W,o as k}from"./chunk-LYCLF26R.js";import{a as C,b as p,c as A,d as m,i as a,j as b}from"./chunk-CK2E7BTU.js";function c(d){return{describeKind:"derived",...d}}function B(d){return{describeKind:"derived",partial:!0,...d}}function Q(d,i,u){return N([d],(t,e)=>{let n=t[0];if(n==null||n.length===0){e.down([[m]]);return}for(let o of n)e.emit(i(o))},c(u))}function S(d,i,u){return N([d],(t,e)=>{let n=t[0];if(n==null||n.length===0){e.down([[m]]);return}let o=!1;for(let r of n)i(r)&&(e.emit(r),o=!0);o||e.down([[m]])},c(u))}function X(d,i,u,t){return N([d],(e,n,o)=>{"acc"in o.store||(o.store.acc=u);let r=e[0];if(r==null||r.length===0){n.down([[m]]);return}for(let s of r)o.store.acc=i(o.store.acc,s),n.emit(o.store.acc)},{...c(t),initial:u,resetOnTeardown:!0})}function Z(d,i,u,t){return N([d],(e,n,o)=>{if("acc"in o.store||(o.store.acc=u),o.terminalDeps[0]===!0){n.emit(o.store.acc),n.down([[a]]);return}let r=e[0];if(r==null||r.length===0){n.down([[m]]);return}for(let s of r)o.store.acc=i(o.store.acc,s)},{...c(t),completeWhenDepsComplete:!1})}function M(d,i,u){return i<=0?N([d],(t,e,n)=>{n.store.completed||(n.store.completed=!0,e.down([[a]]))},{...c(u),completeWhenDepsComplete:!1}):N([d],(t,e,n)=>{if("taken"in n.store||(n.store.taken=0),n.store.done){e.down([[m]]);return}if(n.terminalDeps[0]===!0){n.store.done=!0,e.down([[a]]);return}let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}for(let r of o)if(n.store.taken++,e.emit(r),n.store.taken>=i){n.store.done=!0,e.down([[a]]);return}},{...c(u),completeWhenDepsComplete:!1})}function V(d,i,u){return N([d],(t,e,n)=>{"skipped"in n.store||(n.store.skipped=0);let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}let r=!1;for(let s of o)n.store.skipped++,n.store.skipped<=i||(e.emit(s),r=!0);r||e.down([[m]])},c(u))}function $(d,i,u){return N([d],(t,e,n)=>{if(n.store.done){e.down([[m]]);return}let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}for(let r of o){if(!i(r)){n.store.done=!0,e.down([[a]]);return}e.emit(r)}},{...c(u),completeWhenDepsComplete:!1})}function ee(d,i,u){let t=u?.predicate??(o=>o[0]===p),{predicate:e,...n}=u??{};return w(o=>{let r=!1,s=d.subscribe(l=>{if(!r)for(let T of l){if(r)return;T[0]===p?o.emit(T[1]):(T[0]===a||T[0]===b)&&(r=!0,o.down([T]))}}),f=i.subscribe(l=>{if(!r)for(let T of l){if(r)return;if(t(T)){r=!0,o.down([[a]]);return}}});return()=>{s(),f()}},c(n))}function ne(d,i){return M(d,1,i)}function te(d,i){let{defaultValue:u,...t}=i??{},e=i!=null&&Object.hasOwn(i,"defaultValue");return N([d],(n,o,r)=>{if(r.terminalDeps[0]===!0){r.store.has?o.emit(r.store.latest):e&&o.emit(u),o.down([[a]]);return}let s=n[0];if(s==null||s.length===0){o.down([[m]]);return}r.store.latest=s.at(-1),r.store.has=!0},{...c(t),completeWhenDepsComplete:!1})}function oe(d,i,u){return M(S(d,i,u),1,u)}function re(d,i,u){return M(V(d,i,u),1,u)}function se(d,i,u){if(typeof i=="function")return N([d],(e,n)=>{let o=e[0];if(o==null||o.length===0){n.down([[m]]);return}for(let r of o)i(r),n.emit(r)},c(u));let t=i;return N([d],(e,n,o)=>{if(o.terminalDeps[0]!==void 0){o.terminalDeps[0]===!0?(t.complete?.(),n.down([[a]])):(t.error?.(o.terminalDeps[0]),n.down([[b,o.terminalDeps[0]]]));return}let r=e[0];if(r==null||r.length===0){n.down([[m]]);return}for(let s of r)t.data?.(s),n.emit(s)},{...c(u),completeWhenDepsComplete:!1})}function K(d,i,u){let t=u?.where??(n=>n!=null),e=!1;return N([d],(n,o)=>{let r=n[0];if(r==null||r.length===0){o.down([[m]]);return}for(let s of r)!e&&t(s)&&(e=!0,i(s)),o.emit(s)},c(u))}var ie=K;function ue(d,i=Object.is,u){return N([d],(t,e,n)=>{let o=t[0];if(o==null||o.length===0){e.down([[m]]);return}let r=!1;for(let s of o)n.store.hasPrev&&i(n.store.prev,s)||(n.store.prev=s,n.store.hasPrev=!0,e.emit(s),r=!0);r||e.down([[m]])},c(u))}function fe(d,i){return N([d],(u,t,e)=>{let n=u[0];if(n==null||n.length===0){t.down([[m]]);return}let o=!1;for(let r of n)if(!e.store.hasPrev)e.store.prev=r,e.store.hasPrev=!0;else{let s=[e.store.prev,r];e.store.prev=r,t.emit(s),o=!0}o||t.down([[m]])},c(i))}function q(...d){let i=[...d];return W(i,u=>u,{...c(),equals:(u,t)=>{if(u.length!==t.length)return!1;for(let e=0;e<u.length;e++)if(!Object.is(u[e],t[e]))return!1;return!0}})}function de(d,i,u){return N([d,i],(t,e,n)=>{let o=t[0],r=t[1],s=r!=null&&r.length>0?r.at(-1):n.prevData[1];if(o!=null&&o.length>0){if(!(r!=null&&r.length>0)&&n.prevData[1]===void 0){e.down([[m]]);return}for(let f of o)e.emit([f,s])}else e.down([[m]])},B(u))}function le(...d){return d.length===0?w(i=>{i.down([[a]])},c()):w(i=>{let u=d.length,t=0,e=[];for(let n of d){let o=n.subscribe(r=>{for(let s of r)s[0]===p?i.emit(s[1]):s[0]===a?(t+=1,t>=u&&i.down([[a]])):s[0]===b&&i.down([s])});e.push(o)}return()=>{for(let n of e)n()}},c())}function ae(...d){let i=d.length;return i===0?w(u=>{u.emit([]),u.down([[a]])},c()):w(u=>{let t=Array.from({length:i},()=>[]),e=i;function n(){for(;t.every(r=>r.length>0);){let r=t.map(s=>s.shift());u.emit(r)}}let o=[];for(let r=0;r<i;r++){let s=r,f=d[r].subscribe(l=>{for(let T of l)T[0]===p?(t[s].push(T[1]),n()):T[0]===a?(e-=1,(e===0||t[s].length===0)&&u.down([[a]])):T[0]===b&&u.down([T])});o.push(f)}return()=>{for(let r of o)r()}},c())}function ce(d,i,u){return w(t=>{let e=0,n=[],o,r;return r=i.subscribe(s=>{for(let f of s)e===0?f[0]===p?n.push(f[1]):f[0]===b&&t.down([f]):f[0]===p?t.emit(f[1]):(f[0]===a||f[0]===b)&&t.down([f])}),o=d.subscribe(s=>{for(let f of s)if(e===0)if(f[0]===p)t.emit(f[1]);else if(f[0]===a){e=1;for(let l of n)t.emit(l);n.length=0}else f[0]===b&&t.down([f])}),()=>{o?.(),r?.()}},c(u))}function Te(...d){return d.length===0?w(i=>{i.down([[a]])},c()):d.length===1?N([d[0]],(i,u)=>{let t=i[0];if(t==null||t.length===0){u.down([[m]]);return}for(let e of t)u.emit(e)},c()):w(i=>{let u=null,t=[];for(let e=0;e<d.length;e++){let n=e,o=d[e].subscribe(r=>{for(let s of r){if(u!==null&&n!==u)return;s[0]===p?(u===null&&(u=n),i.emit(s[1])):(s[0]===a||s[0]===b)&&(u===null||n===u)&&i.down([s])}});t.push(o)}return()=>{for(let e of t)e()}},c())}function I(d,i,u){let t,e=!1,n=()=>{e||(e=!0,u())};return t=d.subscribe(o=>{let r=!1,s=!1;for(let f of o)f[0]!==C&&(f[0]===p?i.emit(f[1]):f[0]===a?r=!0:f[0]===b?(s=!0,i.down([f])):(f[0]===A||f[0]===m)&&i.down([f]));s?(t?.(),t=void 0,n()):r&&n()}),()=>{t?.(),t=void 0}}function pe(d,i,u){let t,e=!1;function n(){t?.(),t=void 0}return N([d],(o,r,s)=>{if(s.terminalDeps[0]!=null&&s.terminalDeps[0]!==!0){n();return}if(s.terminalDeps[0]===!0){e=!0,t||r.down([[a]]);return}let f=o[0];if(!(f==null||f.length===0))return n(),t=I(y(i(f[f.length-1])),r,()=>{n(),e&&r.down([[a]])}),{deactivate:()=>{n(),e=!1}}},{...c(u),completeWhenDepsComplete:!1})}function me(d,i,u){let t,e=!1;function n(){t?.(),t=void 0}return N([d],(o,r,s)=>{if(s.terminalDeps[0]!=null&&s.terminalDeps[0]!==!0){n();return}if(s.terminalDeps[0]===!0){e=!0,t||r.down([[a]]);return}let f=o[0];if(!(f==null||f.length===0))return t===void 0?t=I(y(i(f[0])),r,()=>{n(),e&&r.down([[a]])}):r.down([[m]]),{deactivate:()=>{n(),e=!1}}},{...c(u),completeWhenDepsComplete:!1})}function be(d,i,u){let{maxBuffer:t,...e}=u??{},n=[],o,r=!1,s;function f(){o?.(),o=void 0}function l(){if(!s||o!==void 0)return;if(n.length===0){r&&s.down([[a]]);return}let h=n.shift();o=I(y(i(h)),s,()=>{f(),l()})}function T(h){t&&t>0&&n.length>=t&&n.shift(),n.push(h),l()}return N([d],(h,O,x)=>{if(s=O,x.terminalDeps[0]!=null&&x.terminalDeps[0]!==!0){f(),n.length=0;return}if(x.terminalDeps[0]===!0){r=!0,l();return}let E=h[0];if(!(E==null||E.length===0)){for(let v of E)T(v);return{deactivate:()=>{f(),n.length=0,r=!1}}}},{...c(e),completeWhenDepsComplete:!1})}function _(d,i,u){let{concurrent:t,...e}=u??{},n=t!=null&&t>0?t:Number.POSITIVE_INFINITY,o=0,r=!1,s=new Set,f=[],l;function T(){r&&o===0&&f.length===0&&l&&l.down([[a]])}function h(v){if(!l)return;o++;let g;g=I(y(i(v)),l,()=>{g&&s.delete(g),o--,O(),T()}),s.add(g)}function O(){for(;f.length>0&&o<n;)h(f.shift())}function x(v){o<n?h(v):f.push(v)}function E(){for(let v of s)v();s.clear(),o=0,f.length=0}return N([d],(v,g,D)=>{if(l=g,D.terminalDeps[0]!=null&&D.terminalDeps[0]!==!0){E();return}if(D.terminalDeps[0]===!0){r=!0,T();return}let R=v[0];if(!(R==null||R.length===0)){for(let U of R)x(U);return{deactivate:()=>{E(),r=!1}}}},{...c(e),completeWhenDepsComplete:!1})}var we=_;function Ne(d,i,u){return w(t=>{let e=new Set;function n(){for(let r of e)clearTimeout(r);e.clear()}let o=d.subscribe(r=>{for(let s of r)if(s[0]===p){let f=setTimeout(()=>{e.delete(f),t.emit(s[1])},i);e.add(f)}else if(s[0]===a){let f=setTimeout(()=>{e.delete(f),t.down([[a]])},i);e.add(f)}else s[0]===b&&(n(),t.down([s]))});return()=>{o(),n()}},c(u))}function j(d,i,u){return w(t=>{let e,n;function o(){e!==void 0&&(clearTimeout(e),e=void 0)}let r=d.subscribe(s=>{for(let f of s)f[0]===p?(o(),n=f[1],e=setTimeout(()=>{e=void 0,t.emit(n)},i)):f[0]===a?(e!==void 0&&(o(),t.emit(n)),t.down([[a]])):f[0]===b&&(o(),t.down([f]))});return()=>{r(),o()}},c(u))}function F(d,i,u){let{leading:t,trailing:e,...n}=u??{},o=t!==!1,r=e===!0,s=i*1e6;return w(f=>{let l,T=-1/0,h,O=!1;function x(){l!==void 0&&(clearTimeout(l),l=void 0)}let E=d.subscribe(v=>{for(let g of v)if(g[0]===p){let D=g[1],R=k();if(o&&R-T>=s)T=R,f.emit(D),x(),r&&(l=setTimeout(()=>{l=void 0,O&&(T=k(),f.emit(h),O=!1)},i));else if(r&&(h=D,O=!0,l===void 0)){let U=(R-T)/1e6;l=setTimeout(()=>{l=void 0,O&&(T=k(),f.emit(h),O=!1)},Math.max(0,i-U))}}else(g[0]===a||g[0]===b)&&(x(),f.down([g]))});return()=>{E(),x()}},c(n))}function he(d,i,u){return w(t=>{let e,n=!1,o=!1,r=d.subscribe(f=>{if(!n)for(let l of f){if(n)return;l[0]===p?e={v:l[1]}:l[0]===b?(n=!0,t.down([l])):l[0]===a&&(o=!0,e=void 0)}}),s=i.subscribe(f=>{if(!n)for(let l of f){if(n)return;l[0]===p?e!==void 0&&!o&&t.emit(e.v):l[0]===b?(n=!0,t.down([l])):l[0]===a&&(n=!0,t.down([[a]]))}});return()=>{r(),s()}},c(u))}function ve(d,i,u){return w(t=>{let e,n,o=!1;function r(){e!==void 0&&(clearTimeout(e),e=void 0)}let s=d.subscribe(f=>{for(let l of f)l[0]===p?(n=l[1],o=!0,r(),e=setTimeout(()=>{e=void 0,o&&(o=!1,t.emit(n))},i)):(l[0]===a||l[0]===b)&&(r(),t.down([l]))});return()=>{s(),r()}},c(u))}function ge(d,i,u){let{with:t,...e}=u??{},n=t??new Error("timeout");return w(o=>{let r;function s(){clearTimeout(r),r=setTimeout(()=>{r=void 0,o.down([[b,n]])},i)}s();let f=d.subscribe(l=>{for(let T of l)T[0]===p?(s(),o.emit(T[1])):(T[0]===a||T[0]===b)&&(clearTimeout(r),o.down([T]))});return()=>{f(),clearTimeout(r)}},c(e))}function Oe(d,i,u){return w(t=>{let e=[],n=d.subscribe(r=>{for(let s of r)s[0]===p?e.push(s[1]):s[0]===a?(e.length>0&&t.emit([...e]),e.length=0,t.down([[a]])):s[0]===b&&t.down([s])}),o=i.subscribe(r=>{for(let s of r)s[0]===p?e.length>0&&(t.emit([...e]),e.length=0):s[0]===a?t.down([[a]]):s[0]===b&&t.down([s])});return()=>{n(),o(),e.length=0}},c(u))}function xe(d,i,u){if(i<=0)throw new RangeError("bufferCount expects count > 0");return w(t=>{let e=[],n=d.subscribe(o=>{for(let r of o)r[0]===p?(e.push(r[1]),e.length>=i&&t.emit(e.splice(0,e.length))):r[0]===a?(e.length>0&&t.emit([...e]),e.length=0,t.down([[a]])):r[0]===b&&t.down([r])});return()=>{n(),e.length=0}},c(u))}function Ee(d,i,u){if(i<=0)throw new RangeError("windowCount expects count > 0");return w(t=>{let e,n=0;function o(){let s=w(f=>(e=f.down.bind(f),()=>{e=void 0}),c());n=0,t.emit(s)}let r=d.subscribe(s=>{for(let f of s)f[0]===p?(e||o(),e?.([[p,f[1]]]),n+=1,n>=i&&(e?.([[a]]),e=void 0)):f[0]===a?(e?.([[a]]),e=void 0,t.down([[a]])):f[0]===b&&(e?.([f]),e=void 0,t.down([f]))});return()=>{r(),e?.([[a]]),e=void 0}},c(u))}function Re(d,i,u){return w(t=>{let e=[],n=setInterval(()=>{e.length>0&&(t.emit([...e]),e.length=0)},i),o=d.subscribe(r=>{for(let s of r)s[0]===p?e.push(s[1]):s[0]===a?(clearInterval(n),e.length>0&&t.emit([...e]),e.length=0,t.down([[a]])):s[0]===b&&(clearInterval(n),t.down([s]))});return()=>{o(),clearInterval(n),e.length=0}},c(u))}function De(d,i,u){return w(t=>{let e;function n(){e?.([[a]]),e=void 0}function o(){let f=w(l=>(e=l.down.bind(l),()=>{e=void 0}),c());t.emit(f)}o();let r=setInterval(()=>{n(),o()},i),s=d.subscribe(f=>{for(let l of f)l[0]===p?e?.([[p,l[1]]]):l[0]===a?(clearInterval(r),n(),t.down([[a]])):l[0]===b&&(clearInterval(r),e?.([l]),n(),t.down([l]))});return()=>{s(),clearInterval(r),n()}},c(u))}function ye(d,i,u){return w(t=>{let e;function n(){e?.([[a]]),e=void 0}function o(){let f=w(l=>(e=l.down.bind(l),()=>{e=void 0}),c());t.emit(f)}let r=d.subscribe(f=>{for(let l of f)l[0]===p?(e||o(),e?.([[p,l[1]]])):l[0]===a?(n(),t.down([[a]])):l[0]===b&&(e?.([l]),e=void 0,t.down([l]))}),s=i.subscribe(f=>{for(let l of f)l[0]===p&&(n(),o())});return()=>{r(),s(),n()}},c(u))}function ke(d,i){return w((u,t)=>{"n"in t.store||(t.store.n=0);let e=setInterval(()=>{u.emit(t.store.n),t.store.n=t.store.n+1},d);return()=>clearInterval(e)},c(i))}function Ie(d,i,u){if(i<=0)throw new RangeError("repeat expects count > 0");return w(t=>{let e=i,n,o=()=>{n?.(),n=d.subscribe(r=>{let s=!1,f=[];for(let l of r)l[0]===a?s=!0:f.push(l);f.length>0&&t.down(f),s&&(n?.(),n=void 0,e-=1,e>0?o():t.down([[a]]))})};return o(),()=>{n?.()}},c(u))}function Ue(d,i){return N([d],(u,t)=>{let e=u[0];if(e==null||e.length===0){t.down([[m]]);return}for(let n of e)t.emit(n)},c(i))}function L(d,i,u){return w(t=>{let e=d.subscribe(n=>{for(let o of n)if(o[0]===p)t.emit(o[1]);else if(o[0]===b)try{t.emit(i(o[1]))}catch(r){t.down([[b,r]])}else o[0]===a&&t.down([[a]])});return()=>{e()}},c(u))}function Me(d,i,u){return N([d,i],(t,e,n)=>{let o=t[1];if(!(o!=null&&o.length>0?o.at(-1):n.prevData[1])){e.down([[m]]);return}let s=t[0];if(s!=null&&s.length>0){for(let f of s)e.emit(f);return}if(o!=null&&o.length>0&&n.prevData[0]!==void 0){e.emit(n.prevData[0]);return}e.down([[m]])},B(u))}var Ce=q,Ae=j,We=F,Pe=L;export{Q as a,S as b,X as c,Z as d,M as e,V as f,$ as g,ee as h,ne as i,te as j,oe as k,re as l,se as m,K as n,ie as o,ue as p,fe as q,q as r,de as s,le as t,ae as u,ce as v,Te as w,pe as x,me as y,be as z,_ as A,we as B,Ne as C,j as D,F as E,he as F,ve as G,ge as H,Oe as I,xe as J,Ee as K,Re as L,De as M,ye as N,ke as O,Ie as P,Ue as Q,L as R,Me as S,Ce as T,Ae as U,We as V,Pe as W};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O,b as H,c as j,d as E,e as W,f as ne}from"./chunk-
|
|
1
|
+
import{a as O,b as H,c as j,d as E,e as W,f as ne}from"./chunk-INXDSJRC.js";import{a as N}from"./chunk-L3KUKDZC.js";import{a as X,j as T}from"./chunk-2JO6LXFT.js";import{D as I,E as y,G as L,o as S}from"./chunk-LYCLF26R.js";import{b as te}from"./chunk-QYADASLV.js";var ie={};te(ie,{CanvasMeasureAdapter:()=>$,CliMeasureAdapter:()=>D,ImageSizeAdapter:()=>J,NodeCanvasMeasureAdapter:()=>q,PrecomputedAdapter:()=>V,SvgBoundsAdapter:()=>z,analyzeAndMeasure:()=>O,carveTextLineSlots:()=>E,circleIntervalForBand:()=>Q,computeBlockFlow:()=>_,computeCharPositions:()=>W,computeFlowLines:()=>ee,computeLineBreaks:()=>H,computeTotalHeight:()=>U,layoutNextLine:()=>j,measureBlock:()=>Y,measureBlocks:()=>K,reactiveBlockLayout:()=>re,reactiveFlowLayout:()=>se,reactiveLayout:()=>ne,rectIntervalForBand:()=>Z});var D=class{cellPx;constructor(t){this.cellPx=t?.cellPx??8}measureSegment(t,n){return{width:X(t)*this.cellPx}}},G=class extends Error{name="KeyError"},V=class{metrics;fallback;constructor(t){this.metrics=t.metrics;let n=t.fallback??"per-char";if(n!=="per-char"&&n!=="error")throw new Error(`fallback must be 'per-char' or 'error', got ${JSON.stringify(t.fallback)}`);this.fallback=n}measureSegment(t,n){let i=this.metrics[n];if(i){let o=i[t];if(o!==void 0)return{width:o}}if(this.fallback==="error")throw new G(`PrecomputedAdapter: no metrics for segment ${JSON.stringify(t)} in font ${JSON.stringify(n)}`);let r=0;if(i)for(let o of t){let l=i[o];l!==void 0&&(r+=l)}return{width:r}}},$=class{ctx=null;currentFont="";emojiCorrection;constructor(t){this.emojiCorrection=t?.emojiCorrection??1}getContext(){if(!this.ctx){if(typeof OffscreenCanvas>"u")throw new Error("CanvasMeasureAdapter requires a browser environment with OffscreenCanvas support. Use CliMeasureAdapter or NodeCanvasMeasureAdapter for Node.js.");let n=new OffscreenCanvas(0,0).getContext("2d");if(!n)throw new Error("CanvasMeasureAdapter: failed to get 2d context");this.ctx=n}return this.ctx}measureSegment(t,n){let i=this.getContext();n!==this.currentFont&&(i.font=n,this.currentFont=n);let r=i.measureText(t).width;return this.emojiCorrection!==1&&new RegExp("\\p{Emoji_Presentation}","u").test(t)&&(r*=this.emojiCorrection),{width:r}}clearCache(){this.currentFont=""}},q=class{ctx=null;currentFont="";canvasModule;constructor(t){this.canvasModule=t}getContext(){if(!this.ctx){let n=this.canvasModule.createCanvas(0,0).getContext("2d");if(!n)throw new Error("NodeCanvasMeasureAdapter: failed to get 2d context");this.ctx=n}return this.ctx}measureSegment(t,n){let i=this.getContext();return n!==this.currentFont&&(i.font=n,this.currentFont=n),{width:i.measureText(t).width}}clearCache(){this.currentFont=""}},z=class{measureSvg(t){let n=t.match(/viewBox\s*=\s*["']([^"']+)["']/);if(n){let o=n[1].trim().split(/[\s,]+/);if(o.length>=4){let l=Number.parseFloat(o[2]),a=Number.parseFloat(o[3]);if(Number.isFinite(l)&&Number.isFinite(a)&&l>0&&a>0)return{width:l,height:a};throw new Error("SvgBoundsAdapter: viewBox width/height are missing, non-finite, or not positive")}}let i=t.match(/<svg[^>]*\bwidth\s*=\s*["']?([\d.]+)/),r=t.match(/<svg[^>]*\bheight\s*=\s*["']?([\d.]+)/);if(i&&r){let o=Number.parseFloat(i[1]),l=Number.parseFloat(r[1]);if(Number.isFinite(o)&&Number.isFinite(l)&&o>0&&l>0)return{width:o,height:l};throw new Error("SvgBoundsAdapter: svg width/height attributes are non-finite or not positive")}throw new Error("SvgBoundsAdapter: cannot determine dimensions \u2014 SVG has no viewBox or width/height attributes")}},J=class{sizes;constructor(t){this.sizes=new Map(Object.entries(t))}measureImage(t){let n=this.sizes.get(t);if(!n)throw new Error(`ImageSizeAdapter: no dimensions registered for ${JSON.stringify(t)}`);return{width:n.width,height:n.height}}};function Y(e,t,n,i,r,o,l){switch(e.type){case"text":{let a=e.font??r,m=e.lineHeight??o,d=O(e.text,a,n.text,i),w=H(d,t,n.text,a,i),v=W(w,d,m),B=w.lineCount*m,c=0;for(let x of w.lines)x.width>c&&(c=x.width);return{index:l,type:"text",width:Math.min(c,t),height:B,textSegments:d,textLineBreaks:w,textCharPositions:v}}case"image":{let a,m;if(e.naturalWidth!=null&&e.naturalHeight!=null)a=e.naturalWidth,m=e.naturalHeight;else if(n.image){let d=n.image.measureImage(e.src);a=d.width,m=d.height}else throw new Error(`Image block at index ${l} has no naturalWidth/naturalHeight and no ImageMeasurer adapter`);return a>t&&(m=m*t/a,a=t),{index:l,type:"image",width:a,height:m}}case"svg":{let a,m;if(e.viewBox)a=e.viewBox.width,m=e.viewBox.height;else if(n.svg){let d=n.svg.measureSvg(e.content);a=d.width,m=d.height}else throw new Error(`SVG block at index ${l} has no viewBox and no SvgMeasurer adapter`);return a>t&&(m=m*t/a,a=t),{index:l,type:"svg",width:a,height:m}}}}function K(e,t,n,i,r,o){return e.map((l,a)=>Y(l,t,n,i,r,o,a))}function _(e,t){let n=[],i=0;for(let r=0;r<e.length;r++){let o=e[r];n.push({...o,x:0,y:i}),i+=o.height+(r<e.length-1?t:0)}return n}function U(e){if(e.length===0)return 0;let t=e[e.length-1];return t.y+t.height}function re(e){let{adapters:t,name:n="reactive-block-layout",defaultFont:i="16px sans-serif",defaultLineHeight:r=20}=e,o=new T(n),l=new Map,a=y(e.blocks??[],{name:"blocks"}),m=y(Math.max(0,e.maxWidth??800),{name:"max-width"}),d=y(e.gap??0,{name:"gap"}),w=I([a,m],(c,x,s)=>{let p=c[0]!=null&&c[0].length>0?c[0].at(-1):s.prevData[0],h=c[1]!=null&&c[1].length>0?c[1].at(-1):s.prevData[1],g=S(),u=K(p,h,t,l,i,r),f=S()-g,b=w.meta;b&&(N(b["block-count"],u.length),N(b["layout-time-ns"],f)),x.emit(u);let C=()=>{l.clear(),t.text.clearCache?.()};return{deactivate:C,invalidate:C}},{name:"measured-blocks",describeKind:"derived",meta:{"block-count":0,"layout-time-ns":0},equals:(c,x)=>{let s=c,p=x;if(s==null||p==null)return s===p;if(s.length!==p.length)return!1;for(let h=0;h<s.length;h++){let g=s[h],u=p[h];if(g.type!==u.type||g.width!==u.width||g.height!==u.height||g.index!==u.index)return!1}return!0}}),v=L([w,d],([c,x])=>_(c,x),{name:"block-flow",equals:(c,x)=>{let s=c,p=x;if(s==null||p==null)return s===p;if(s.length!==p.length)return!1;for(let h=0;h<s.length;h++){let g=s[h],u=p[h];if(g.x!==u.x||g.y!==u.y||g.width!==u.width||g.height!==u.height)return!1}return!0}}),B=L([v],([c])=>U(c),{name:"total-height"});return o.add(a,{name:"blocks"}),o.add(m,{name:"max-width"}),o.add(d,{name:"gap"}),o.add(w,{name:"measured-blocks"}),o.add(v,{name:"block-flow"}),o.add(B,{name:"total-height"}),{graph:o,setBlocks:c=>o.set("blocks",c),setMaxWidth:c=>o.set("max-width",Math.max(0,c)),setGap:c=>o.set("gap",c),measuredBlocks:w,blockFlow:v,totalHeight:B}}function Q(e,t,n){let i=e.hPad??0,r=e.vPad??0,o=t-r,l=n+r;if(o>=e.cy+e.r||l<=e.cy-e.r)return null;let a=e.cy>=o&&e.cy<=l?0:e.cy<o?o-e.cy:e.cy-l;if(a>=e.r)return null;let m=Math.sqrt(e.r*e.r-a*a);return{left:e.cx-m-i,right:e.cx+m+i}}function Z(e,t,n){let i=e.hPad??0,r=e.vPad??0;return n<=e.y-r||t>=e.y+e.h+r?null:{left:e.x-i,right:e.x+e.w+i}}function oe(e,t,n){return e.kind==="circle"?Q(e,t,n):Z(e,t,n)}function ee(e,t,n,i,r,o,l){let a=l?.paragraphSpacing??r,m=[],d={segmentIndex:0,graphemeIndex:0};if(e.length===0||n.count<=0||r<=0)return{lines:m,cursor:d};let w=t.paddingX??0,v=t.paddingY??0,B=Math.max(0,t.width-w*2),c=Math.max(0,t.height-v*2),x=n.gap*Math.max(0,n.count-1),s=Math.max(0,(B-x)/n.count);if(s<=0)return{lines:m,cursor:d};e:for(let p=0;p<n.count;p++){let h=w+p*(s+n.gap),g=h+s,u=v;for(;u+r<=v+c;){let f=u+r,b=[];for(let k=0;k<i.length;k++){let M=oe(i[k],u,f);M!==null&&b.push(M)}let C=E({left:h,right:g},b,o);if(C.length===0){u+=r;continue}let P=!1;for(let k=0;k<C.length;k++){let M=C[k],R=M.right-M.left,F=j(e,d,R);if(F===null)return{lines:m,cursor:d};if(F.text.length===0&&F.width===0){d=F.end,P=!0;break}m.push({x:M.left,y:u,width:F.width,slotWidth:R,text:F.text,columnIndex:p,flushToRight:M.right<g-.5}),d=F.end}if(P){u+=a;continue}if(u+=r,d.segmentIndex>=e.length)break e}if(d.segmentIndex>=e.length)break}return{lines:m,cursor:d}}function se(e){let{adapter:t,name:n="reactive-flow-layout",minSlotWidth:i=20}=e,r=new T(n),o=new Map,l=y(e.text??"",{name:"text"}),a=y(e.font??"16px sans-serif",{name:"font"}),m=y(e.lineHeight??20,{name:"line-height"}),d=y(e.container??{width:800,height:600,paddingX:0,paddingY:0},{name:"container"}),w=y(e.columns??{count:1,gap:0},{name:"columns"}),v=y(e.obstacles??[],{name:"obstacles"}),B=y(e.paragraphSpacing??null,{name:"paragraph-spacing"}),c=I([l,a],(s,p,h)=>{let g=s[0],u=g!=null&&g.length>0?g.at(-1):h.prevData[0],f=s[1],b=f!=null&&f.length>0?f.at(-1):h.prevData[1],C=O(u,b,t,o);p.emit(C);let P=()=>{o.clear(),t.clearCache?.()};return{deactivate:P,invalidate:P}},{name:"segments",describeKind:"derived"}),x=L([c,d,w,v,m,B],([s,p,h,g,u,f])=>{let b=s,C=S(),P=f??u,{lines:k,cursor:M}=ee(b,p,h,g,u,i,{paragraphSpacing:P}),R=S()-C,F=Math.max(0,b.length-M.segmentIndex),A=x.meta;return A&&(N(A["line-count"],k.length),N(A["layout-time-ns"],R),N(A["overflow-segments"],F)),k},{name:"flow-lines",meta:{"line-count":0,"layout-time-ns":0,"overflow-segments":0},equals:(s,p)=>{let h=s,g=p;if(h.length!==g.length)return!1;for(let u=0;u<h.length;u++){let f=h[u],b=g[u];if(f.x!==b.x||f.y!==b.y||f.width!==b.width||f.slotWidth!==b.slotWidth||f.text!==b.text||f.columnIndex!==b.columnIndex||f.flushToRight!==b.flushToRight)return!1}return!0}});return r.add(l,{name:"text"}),r.add(a,{name:"font"}),r.add(m,{name:"line-height"}),r.add(d,{name:"container"}),r.add(w,{name:"columns"}),r.add(v,{name:"obstacles"}),r.add(B,{name:"paragraph-spacing"}),r.add(c,{name:"segments"}),r.add(x,{name:"flow-lines"}),{graph:r,setText:s=>r.set("text",s),setFont:s=>r.set("font",s),setLineHeight:s=>r.set("line-height",s),setContainer:s=>r.set("container",s),setColumns:s=>r.set("columns",s),setObstacles:s=>r.set("obstacles",s),setParagraphSpacing:s=>r.set("paragraph-spacing",s),segments:c,flowLines:x}}export{D as a,V as b,$ as c,q as d,z as e,J as f,Y as g,K as h,_ as i,U as j,re as k,Q as l,Z as m,ee as n,se as o,ie as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as l,v as o}from"./chunk-
|
|
1
|
+
import{C as l,v as o}from"./chunk-LYCLF26R.js";function h(t,e){if(e!=null&&e.length>0)return new Set(e);switch(t){case"standard":return new Set(["type","status","value","deps","meta","v"]);case"full":return null;default:return new Set(["type","deps"])}}function m(t){return t._describeKind!=null?t._describeKind:t._deps.length>0?"derived":t._fn!=null?"producer":"state"}function g(t){let e={};for(let[r,a]of Object.entries(t.meta))try{e[r]=a.cache}catch{}return e}function y(t,e){let r=e==null,a=!r&&e!=null?[...e].filter(n=>n.startsWith("meta.")).map(n=>n.slice(5)):null,d=r||e.has("meta")||a!=null&&a.length>0,c="state",p=[];t instanceof l&&(c=m(t),p=t._deps.map(n=>n.node.name??""));let s={type:c,deps:p};(r||e.has("status"))&&(s.status=t.status);let i=t instanceof l?t._guard:void 0;if(d){let n={...g(t)};if(i!=null&&n.access===void 0&&(n.access=o(i)),a!=null&&a.length>0&&!e.has("meta")){let f={};for(let u of a)u in n&&(f[u]=n[u]);s.meta=f}else s.meta=n}if(t.name!=null&&(s.name=t.name),r||e.has("value")){t.status==="sentinel"&&(s.sentinel=!0);try{s.value=t.cache}catch{}}if((r||e.has("v"))&&t.v!=null){let n={id:t.v.id,version:t.v.version};"cid"in t.v&&(n.cid=t.v.cid,n.prev=t.v.prev),s.v=n}return(r||e.has("guard"))&&i!=null&&(s.guard=o(i)),(r||e.has("lastMutation"))&&t.lastMutation!=null&&(s.lastMutation=t.lastMutation),s}export{h as a,y as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as f}from"./chunk-
|
|
1
|
+
import{c as f}from"./chunk-PBN426RU.js";import{a as l,d as o,e as d,h as s,i as m,k as b,l as c}from"./chunk-FKRPIRE6.js";import{a as r,b as u}from"./chunk-4VVTGLXJ.js";import{b as y}from"./chunk-QYADASLV.js";var R={};y(R,{NS_PER_MS:()=>r,NS_PER_SEC:()=>u,resilientPipeline:()=>O});function O(p,e={}){let t=p;e.rateLimit!=null&&(t=s(t,e.rateLimit)),e.budget!=null&&e.budget.length>0&&(t=f(t,e.budget));let n;if(e.breaker!=null){let k=o(e.breaker),S=e.breakerOnOpen??"skip",a=d(k,{onOpen:S})(t);t=a.node,n=a.breakerState}if(e.timeoutMs!=null){if(e.timeoutMs<=0)throw new RangeError("timeoutMs must be > 0");if(e.timeoutMs>9e6)throw new RangeError("timeoutMs must be <= 9_000_000 (\u22482.5h) to stay within safe ns arithmetic");t=c(t,e.timeoutMs*1e6)}e.retry!=null&&(t=l(t,e.retry)),e.fallback!==void 0&&(t=b(t,e.fallback));let i=m(t,{initialStatus:e.initialStatus??"pending"});return{node:i.node,status:i.status,error:i.error,breakerState:n}}export{O as a,R as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as q}from"./chunk-L3KUKDZC.js";import{b as v}from"./chunk-KGKJCHEK.js";import{b as T}from"./chunk-TZQPPQEQ.js";import{b as y}from"./chunk-HTBOCKVD.js";import{j as g}from"./chunk-2JO6LXFT.js";import{B as p}from"./chunk-T7EQPKOP.js";import{D as w,G as m}from"./chunk-LYCLF26R.js";import{b as x}from"./chunk-QYADASLV.js";var $={};x($,{JobFlowGraph:()=>h,JobQueueGraph:()=>u,jobFlow:()=>k,jobQueue:()=>E});var N=2147483647;function J(s,e){if(!Number.isFinite(s)||!Number.isInteger(s)||s<0)throw new Error(`${e} must be a non-negative integer`);return s}function c(s,e){return q("job_queue",s,e)}var u=class extends g{_pending;_jobs;_seq=0;pending;jobs;depth;constructor(e,t={}){super(e,t.graph),this._pending=v([],{name:"pending"}),this._jobs=T({name:"jobs"}),this.pending=this._pending.items,this.jobs=this._jobs.entries,this.add(this.pending,{name:"pending"}),this.add(this.jobs,{name:"jobs"}),this.depth=m([this.pending],([n])=>n.length,{name:"depth",describeKind:"derived",meta:c("queue_depth"),initial:0}),this.add(this.depth,{name:"depth"}),this.addDisposer(p(this.depth))}enqueue(e,t={}){let n=t.id??`${this.name}-${++this._seq}`;if(this._jobs.get(n)!==void 0)throw new Error(`jobQueue("${this.name}"): duplicate job id "${n}"`);let r={id:n,payload:e,attempts:0,metadata:Object.freeze({...t.metadata??{}}),state:"queued"};return this._jobs.set(n,r),this._pending.append(n),n}claim(e=1){let t=J(e,"job queue claim limit");if(t===0)return[];let n=[];for(;n.length<t&&this.pending.cache.length!==0;){let d=this._pending.pop(0),o=this._jobs.get(d);if(!o||o.state!=="queued")continue;let i={...o,state:"inflight",attempts:o.attempts+1};this._jobs.set(d,i),n.push(i)}return n}ack(e){let t=this._jobs.get(e);return!t||t.state!=="inflight"?!1:(this._jobs.delete(e),!0)}nack(e,t={}){let n=this._jobs.get(e);return!n||n.state!=="inflight"?!1:t.requeue??!0?(this._jobs.set(e,{...n,state:"queued"}),this._pending.append(e),!0):(this._jobs.delete(e),!0)}removeById(e){let t=this._jobs.get(e);if(!t)return!1;if(t.state==="queued"){let r=this.pending.cache.indexOf(e);r>=0&&this._pending.pop(r)}return this._jobs.delete(e),!0}},h=class extends g{_stageNames;_queues=new Map;_completed;completed;completedCount;constructor(e,t={}){super(e,t.graph);let n=(t.stages??["incoming","processing","done"]).map(o=>o.trim());if(n.length<2)throw new Error(`jobFlow("${e}"): requires at least 2 stages`);if(new Set(n).size!==n.length)throw new Error(`jobFlow("${e}"): stage names must be unique`);this._stageNames=Object.freeze([...n]);for(let o of this._stageNames){let i=E(`${e}-${o}`);this._queues.set(o,i),this.mount(o,i)}this._completed=y([],{name:"completed"}),this.completed=this._completed.entries,this.add(this.completed,{name:"completed"}),this.completedCount=m([this.completed],([o])=>o.length,{name:"completedCount",describeKind:"derived",meta:c("job_flow_completed_count"),initial:0}),this.add(this.completedCount,{name:"completedCount"}),this.addDisposer(p(this.completedCount));let d=Math.max(1,J(t.maxPerPump??N,"job flow maxPerPump"));for(let o=0;o<this._stageNames.length;o+=1){let i=this._stageNames[o],l=this.queue(i),b=o+1<this._stageNames.length?this.queue(this._stageNames[o+1]):null,_=w([l.pending],()=>{let f=0;for(;f<d;){let j=l.claim(1);if(j.length===0)break;let a=j[0];if(!a)break;b?b.enqueue(a.payload,{metadata:{...a.metadata,job_flow_from:i}}):this._completed.append(a),l.ack(a.id),f+=1}},{name:`pump_${i}`,describeKind:"effect",meta:c("job_flow_pump")});this.add(_,{name:`pump_${i}`}),this.addDisposer(p(_))}}stages(){return this._stageNames}queue(e){let t=this._queues.get(e);if(!t)throw new Error(`jobFlow("${this.name}"): unknown stage "${e}"`);return t}enqueue(e,t={}){return this.queue(this._stageNames[0]).enqueue(e,t)}retainedCompleted(){return this.completed.cache}};function E(s,e){return new u(s,e)}function k(s,e){return new h(s,e)}export{u as a,h as b,E as c,k as d,$ as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as x,w}from"./chunk-
|
|
1
|
+
import{m as x,w}from"./chunk-T7EQPKOP.js";import{i as g,j as p}from"./chunk-CK2E7BTU.js";async function k(o){let i=typeof o=="string"?new TextEncoder().encode(o):o,c=await globalThis.crypto.subtle.digest("SHA-256",i),t=new Uint8Array(c),n="";for(let r=0;r<t.length;r++)n+=b[t[r]];return n}var b=new Array(256);for(let o=0;o<256;o++)b[o]=o.toString(16).padStart(2,"0");var m=class extends Error{constructor(c,t){super(`content-addressed lookup miss in read-strict mode: ${c}`);this.key=c;this.context=t;this.name="ContentAddressedMissError"}};function T(o){let i=new Set,c=t=>{if(t===null||typeof t!="object")return t;let n=t;if(i.has(n))return{__cycle:!0};i.add(n);try{if(Array.isArray(t))return t.map(c);let r={};for(let d of Object.keys(t).sort())r[d]=c(t[d]);return r}finally{i.delete(n)}};return JSON.stringify(c(o))}function P(o){let{storage:i,keyContext:c,keyPrefix:t,mode:n="read-write"}=o,r=c??(e=>e);async function d(e){let s=T(r(e)),a=await k(s);return t?`${t}:${a}`:a}return{keyFor:d,async lookup(e){if(n==="write")return;let s=await d(e),a=await i.load(s);if(a==null){if(n==="read-strict")throw new m(s,e);return}return a},async store(e,s){if(n==="read")return;let a=await d(e);await i.save(a,s)},async forget(e){if(n==="read"||n==="write"||!i.clear)return;let s=await d(e);await i.clear(s)}}}function j(o,i={}){let c=i.keyFn??(n=>String(n)),t=new Map;return n=>{let r=c(n),d=t.get(r);if(d)return d;let e=o(n),s;e!=null&&typeof e.then=="function"?s=Promise.resolve(e):e!=null&&typeof e=="object"&&"subscribe"in e&&"cache"in e?s=w(e):e!=null&&typeof e=="object"&&Symbol.asyncIterator in e?s=(async()=>{let u=e[Symbol.asyncIterator]();try{let{value:l,done:f}=await u.next();if(f)throw new Error("singleFromAny: factory returned empty async iterable");return l}finally{await u.return?.()}})():e!=null&&typeof e=="object"&&Symbol.iterator in e?s=(async()=>{let u=e[Symbol.iterator]();try{let{value:l,done:f}=u.next();if(f)throw new Error("singleFromAny: factory returned empty iterable");return l}finally{u.return?.()}})():s=Promise.resolve(e);let a,y=()=>{t.get(r)===a&&t.delete(r)};return a=s.then(u=>(y(),u),u=>{throw y(),u}),t.set(r,a),a}}function K(o,i={}){let c=i.keyFn??(n=>String(n)),t=new Map;return n=>{let r=c(n),d=t.get(r);if(d)return d;let e=x(o(n));t.set(r,e);let s=e.subscribe(a=>{for(let y of a)if(y[0]===p||y[0]===g){t.get(r)===e&&t.delete(r),s();return}});return e}}export{k as a,m as b,T as c,P as d,j as e,K as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as _}from"./chunk-
|
|
1
|
+
import{j as _}from"./chunk-2JO6LXFT.js";import{D as g,E as k}from"./chunk-LYCLF26R.js";import{b as R,c as T,d,h as A,i as O,j as D}from"./chunk-CK2E7BTU.js";function L(c,y,l,a){let s=new _(c,a);s.add(y,{name:"source"});let n=k(l,{meta:{kind:"stratify_rules"}});s.add(n,{name:"rules"});for(let f of l)E(s,y,n,f);return s}function E(c,y,l,a){let s=`branch/${a.name}`,n=Symbol("noValue"),f=!1,m=!1,p=!1,N=n,r=!1,h=l.cache??[];function v(o){if(p){p=!1;let t=N;if(N=n,t!==n){let i=h.find(u=>u.name===a.name),e=!1;try{e=i?.classify(t)??!1}catch{e=!1}e?(r=!1,o.emit(t)):r&&(r=!1,o.down([[T],[d]]))}else r?(r=!1,o.down([[T],[d]])):o.down([[d]])}}let S=g([],(o,t)=>{let i=y.subscribe(u=>{for(let b of u)w(b,0,t)}),e=l.subscribe(u=>{for(let b of u)w(b,1,t)});return()=>{i(),e()}},{describeKind:"derived",meta:{kind:"stratify_branch",branch:a.name},completeWhenDepsComplete:!1});function w(o,t,i){let e=o[0];return e===T?(t===0?(f=!0,r=!0):m=!0,!0):e===R||e===d?(t===0?(f=!1,p=!0,N=e===R?o[1]:n):(e===R&&(h=o[1]),m=!1),f||m||v(i),!0):e===O||e===D||e===A?(f=!1,m=!1,p=!1,N=n,r=!1,t===0&&i.down([o]),!0):t===1}if(c.add(S,{name:s}),a.ops){let o=a.ops(S),t=`branch/${a.name}/out`;c.add(o,{name:t})}}export{L as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f}from"./chunk-
|
|
1
|
+
import{j as f}from"./chunk-2JO6LXFT.js";import{E as d}from"./chunk-LYCLF26R.js";import{b as S}from"./chunk-CK2E7BTU.js";import{b}from"./chunk-QYADASLV.js";var g={};b(g,{create:()=>v});var m=()=>!1;function v(l){let o=new f("zustand"),t=d(void 0,{name:"state",equals:m});o.add(t,{name:"state"});let r=()=>t.cache,n=(e,s)=>{let a=t.cache,i=typeof e=="function"?e(a):e;t.emit(s?i:{...a,...i})},c={getState:r,setState:n,getInitialState:()=>T,subscribe:e=>{let s=!0,a=t.cache;return t.subscribe(i=>{for(let[u,p]of i)if(u===S){if(s){s=!1;continue}e(p,a),a=p}})},destroy:o.destroy.bind(o)},T=l(n,r,c);return t.emit(T),Object.assign(o,c)}export{v as a,g as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as S}from"./chunk-VJLMUKOI.js";import{d as O}from"./chunk-VIMF6LGM.js";import{d as k}from"./chunk-6QZNQS5B.js";import{d as A}from"./chunk-GPW2V3RE.js";import{b as N}from"./chunk-
|
|
1
|
+
import{d as S}from"./chunk-VJLMUKOI.js";import{d as O}from"./chunk-VIMF6LGM.js";import{d as k}from"./chunk-6QZNQS5B.js";import{d as A}from"./chunk-GPW2V3RE.js";import{b as N}from"./chunk-C5DINHNP.js";import{b as v}from"./chunk-KRH66M4O.js";import{i as y}from"./chunk-CLD3F4R5.js";import{G as x}from"./chunk-TZLEMGAK.js";import{E as b,J as g,m as _}from"./chunk-LYCLF26R.js";import{b as a,c as p,i as h,j as m}from"./chunk-CK2E7BTU.js";import{b as f}from"./chunk-QYADASLV.js";var j={};f(j,{jotai:()=>v,nanostores:()=>y,nestjs:()=>x,react:()=>S,signals:()=>T,solid:()=>O,svelte:()=>k,vue:()=>A,zustand:()=>N});var T={};f(T,{Signal:()=>q});var s=[];function i(n){let e=n.cache;return n.subscribe(o=>{for(let[d,r]of o)d===a&&(e=r)})(),e}var u=class{_node;_equals;constructor(e,t){this._equals=t?.equals??Object.is,this._node=b(e,{...t,resubscribable:!0,resetOnTeardown:!0})}get(){let e=s[s.length-1];return e?(this._node.status==="sentinel"&&i(this._node),e(this._node)):this._node.status==="sentinel"?i(this._node):this._node.cache}set(e){this._equals(this.get(),e)||_(()=>{this._node.down([[p],[a,e]])})}},l=class{_node;constructor(e,t){this._node=g(o=>{s.push(o);try{return e()}finally{s.pop()}},{...t,describeKind:"derived",resubscribable:!0,resetOnTeardown:!0})}get(){let e=s[s.length-1];return e?(this._node.status==="sentinel"&&i(this._node),e(this._node)):this._node.status==="sentinel"?i(this._node):this._node.cache}},q={State:u,Computed:l,sub:(n,e)=>{let t=typeof e=="function"?{data:e,error:void 0,complete:void 0}:e,o=!0;return n._node.subscribe(d=>{for(let[r,c]of d){if(r===a){if(o){o=!1;continue}t.data?.(c)}r===m&&t.error?.(c),r===h&&t.complete?.()}})}};export{T as a,j as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as p,I as A,m as l}from"./chunk-
|
|
1
|
+
import{E as p,I as A,m as l}from"./chunk-LYCLF26R.js";import{b as c,j as N}from"./chunk-CK2E7BTU.js";import{b as x}from"./chunk-QYADASLV.js";var B={};x(B,{action:()=>M,atom:()=>S,computed:()=>k,getValue:()=>_,map:()=>R,onMount:()=>w,onStart:()=>v,onStop:()=>g});var T=new WeakMap,f=new WeakMap;function d(e,t){let o=t.get(e);if(o)for(let n of o)n()}function m(e,t={}){let o=0;return{...t,get:()=>b(e),subscribe:a=>{o===0&&d(e,T),o++;let r=e.subscribe(s=>{for(let[i,u]of s)i===c&&a(u)});return()=>{r(),o--,o===0&&d(e,f)}},listen:a=>{o===0&&d(e,T),o++;let r=!0,s=e.subscribe(i=>{for(let[u,C]of i)if(u===c){if(r){r=!1;continue}a(C)}});return()=>{s(),o--,o===0&&d(e,f)}},_node:e}}function y(e){let t=e.cache,o;if(e.subscribe(a=>{for(let[r,s]of a)r===c&&(t=s),r===N&&(o=s)})(),o)throw o;return t}function b(e){return e.status==="sentinel"?y(e):e.cache}function S(e){let t=p(e,{resubscribable:!0,resetOnTeardown:!0});return m(t,{set:o=>t.emit(o)})}function k(e,t){let o=Array.isArray(e)?e:[e],n=o.map(r=>r._node),a=A(n,r=>{let s=o.map(i=>{let u=i._node;return u.status==="sentinel"&&y(u),r(u)});return t(...s)},{resubscribable:!0,resetOnTeardown:!0,equals:Object.is});return m(a)}function R(e){let t=p(e,{resubscribable:!0,resetOnTeardown:!0,equals:()=>!1});return m(t,{set:o=>t.emit(o),setKey:(o,n)=>{let a=b(t);t.emit({...a,[o]:n})}})}function _(e){return e.get()}function v(e,t){let o=e._node,n=T.get(o);n||(n=new Set,T.set(o,n)),n.add(t)}function g(e,t){let o=e._node,n=f.get(o);n||(n=new Set,f.set(o,n)),n.add(t)}function w(e,t){v(e,()=>{let o=t();typeof o=="function"&&g(e,o)})}function M(e,t,o){return(...n)=>{let a;return l(()=>{a=o(...n)}),a}}export{S as a,k as b,R as c,_ as d,v as e,g as f,w as g,M as h,B as i};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import{a as we}from"./chunk-SFIM774L.js";import{c as Oe}from"./chunk-6HQ6HVTF.js";import{u as Y}from"./chunk-Z4GXBOWO.js";import{a as Ae}from"./chunk-GCUYSIM4.js";import{e as Se}from"./chunk-HIJ2RKVP.js";import{f as Ne,h as se}from"./chunk-T2TB37TW.js";import{b as oe,d as D}from"./chunk-L3KUKDZC.js";import{b as ke}from"./chunk-TZQPPQEQ.js";import{f as be,j as ne}from"./chunk-2JO6LXFT.js";import{b as P,s as H,t as Re,x as $}from"./chunk-4F564IPP.js";import{m as Ie}from"./chunk-T7EQPKOP.js";import{D as he,E as S,G as R,H as _,o as F}from"./chunk-LYCLF26R.js";import{b as Je}from"./chunk-QYADASLV.js";var yt={};Je(yt,{DEFAULT_DECAY_RATE:()=>L,DEFAULT_EXECUTE_PROMPT:()=>ie,DEFAULT_QUEUE_CONFIGS:()=>J,DEFAULT_SEVERITY_WEIGHTS:()=>M,DEFAULT_TRIAGE_PROMPT:()=>ae,DEFAULT_VERIFY_PROMPT:()=>ue,HarnessGraph:()=>W,QUEUE_NAMES:()=>b,affectedTaskFilter:()=>Ze,beforeAfterCompare:()=>Xe,codeChangeBridge:()=>et,createIntakeBridge:()=>Ke,defaultErrorClassifier:()=>K,defaultLlmExecutor:()=>Me,defaultLlmVerifier:()=>Le,evalIntakeBridge:()=>We,evalSource:()=>ze,evalVerifier:()=>Ce,harnessEvalPair:()=>it,harnessLoop:()=>ct,harnessProfile:()=>ft,harnessTrace:()=>mt,notifyEffect:()=>tt,priorityScore:()=>ut,refineExecutor:()=>le,resolvePromptFn:()=>Q,strategyKey:()=>V,strategyModel:()=>ce});function Ke(e,t,n,r){return _([e],([o])=>{if(o==null)return;let c=n(o);for(let a of c)t.publish(a)},{name:r?.name??"intake-bridge"})}function We(e,t,n){let r=n?.defaultSeverity??"medium";return _([e],([o])=>{if(o==null)return;let c=Array.isArray(o)?o:[o];for(let a of c)for(let i of a.tasks)if(!(i.valid&&i.judge_scores?.every(l=>l.pass))){if(!i.valid&&(!i.judge_scores||i.judge_scores.length===0)){t.publish({source:"eval",summary:`Task ${i.task_id} invalid (model: ${a.model})`,evidence:`Run ${a.run_id}: task produced invalid output`,affectsAreas:["graphspec"],affectsEvalTasks:[i.task_id],severity:r});continue}if(i.judge_scores)for(let l of i.judge_scores)l.pass||t.publish({source:"eval",summary:`${i.task_id}: ${l.claim} (model: ${a.model})`,evidence:l.reasoning,affectsAreas:["graphspec"],affectsEvalTasks:[i.task_id],severity:r})}},{name:n?.name??"eval-intake-bridge"})}function ze(e,t){return $(e,()=>Ie(t()))}function Xe(e,t){return R([e,t],([n,r])=>{let o=n,c=r,a=new Map(o.tasks.map(f=>[f.task_id,f])),i=new Map(c.tasks.map(f=>[f.task_id,f])),l=new Set([...a.keys(),...i.keys()]),d=[],m=[],p=[];for(let f of l){let g=a.get(f),T=i.get(f),k=g?.valid??!1,x=T?.valid??!1,I=g?.judge_scores?g.judge_scores.filter(w=>w.pass).length:void 0,N=T?.judge_scores?T.judge_scores.filter(w=>w.pass).length:void 0,A=I!==void 0&&N!==void 0?N-I:void 0;d.push({taskId:f,before:k,after:x,scoreDiff:A}),k&&!x&&m.push(f),!k&&x&&p.push(f)}return{newFailures:m,resolved:p,taskDeltas:d,overallImproved:p.length>m.length}},{name:"eval-delta"})}function Ze(e,t){let n=t==null?null:Array.isArray(t)?S(t):t,r=[e];return n&&r.push(n),R(r,o=>{let c=o[0],a=n?new Set(o[1]):null,i=new Set;for(let l of c)for(let d of l.affectsEvalTasks??[])(a==null||a.has(d))&&i.add(d);return[...i].sort()},{name:"affected-task-filter"})}function et(e,t,n,r){let o=r?.defaultSeverity??"high";function c(i){let l=[];for(let d of i.lintErrors??[])l.push({source:"code-change",summary:`Lint: ${d.rule} in ${d.file}:${d.line}`,evidence:d.message,affectsAreas:[d.file],severity:o});for(let d of i.testFailures??[])l.push({source:"test",summary:`Test failure: ${d.testId}`,evidence:d.message,affectsAreas:[d.file],affectsEvalTasks:[d.testId],severity:o});return l}let a=n??c;return _([e],([i])=>{if(i!=null)for(let l of a(i))t.publish(l)},{name:r?.name??"code-change-bridge"})}function tt(e,t,n){return _([e.latest],([r])=>{r!=null&&t(r)},{name:n?.name??"notify-effect"})}var b=["auto-fix","needs-decision","investigation","backlog"],J={"auto-fix":{gated:!1},"needs-decision":{gated:!0},investigation:{gated:!0},backlog:{gated:!1}},M={critical:100,high:70,medium:40,low:10},L=Math.LN2/(168*3600);function V(e,t){return`${e}\u2192${t}`}var rt=/\b(parse|json|config|validation|syntax)\b/i,K=e=>rt.test(e.detail)?"self-correctable":"structural",ae=`You are a triage classifier for a reactive collaboration harness.
|
|
2
|
+
|
|
3
|
+
Given an intake item, classify it and output JSON:
|
|
4
|
+
{
|
|
5
|
+
"rootCause": "composition" | "missing-fn" | "bad-docs" | "schema-gap" | "regression" | "unknown",
|
|
6
|
+
"intervention": "template" | "catalog-fn" | "docs" | "wrapper" | "schema-change" | "investigate",
|
|
7
|
+
"route": "auto-fix" | "needs-decision" | "investigation" | "backlog",
|
|
8
|
+
"priority": <number 0-100>,
|
|
9
|
+
"triageReasoning": "<one sentence>"
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
Strategy model (past effectiveness):
|
|
13
|
+
{{strategy}}
|
|
14
|
+
|
|
15
|
+
Intake item:
|
|
16
|
+
{{item}}`,ie=`You are an implementation agent.
|
|
17
|
+
|
|
18
|
+
Given a triaged issue with root cause and intervention type, produce a fix.
|
|
19
|
+
|
|
20
|
+
Issue:
|
|
21
|
+
{{item}}
|
|
22
|
+
|
|
23
|
+
Output JSON:
|
|
24
|
+
{
|
|
25
|
+
"outcome": "success" | "failure" | "partial",
|
|
26
|
+
"detail": "<description of what was done or what failed>"
|
|
27
|
+
}`,ue=`You are a QA reviewer.
|
|
28
|
+
|
|
29
|
+
Given an execution result, verify whether the fix is correct.
|
|
30
|
+
|
|
31
|
+
Execution:
|
|
32
|
+
{{execution}}
|
|
33
|
+
|
|
34
|
+
Original issue:
|
|
35
|
+
{{item}}
|
|
36
|
+
|
|
37
|
+
Output JSON:
|
|
38
|
+
{
|
|
39
|
+
"verified": true/false,
|
|
40
|
+
"findings": ["<finding1>", ...],
|
|
41
|
+
"errorClass": "self-correctable" | "structural" // only if verified=false
|
|
42
|
+
}`;function Q(e,t,n){if(typeof e=="function")return e;let r=e??t;return o=>n(r,o)}function nt(e){let{best:t,score:n,status:r}=e,o=Number.isFinite(n)?n.toFixed(3):String(n),c=t??void 0;return r==="converged"?{outcome:"success",detail:`refineLoop converged at score ${o}`,artifact:c}:r==="budget"?{outcome:"partial",detail:`refineLoop hit budget at score ${o}`,artifact:c}:{outcome:"failure",detail:`refineLoop errored (status=${r})`,artifact:c}}function le(e){let t=e.name??"refine-executor",n=e.toOutput??nt;return r=>{let o=P(r,a=>a!=null,{name:`${t}/gate-in`}),c=$(o,a=>{let i=we(e.seedFrom(a),e.evaluator,e.strategy,{...e.refine,dataset:e.datasetFor(a),name:`${t}/inner`});return R([i.status,i.best,i.score],([l,d,m])=>{let p=l;return p!=="converged"&&p!=="budget"&&p!=="errored"?null:n({best:d,score:m,status:p})},{name:`${t}/output`})},{name:t});return P(c,a=>a!=null,{name:`${t}/gate-out`})}}function ot(e){if(e.length===0)return Number.NEGATIVE_INFINITY;let t=0;for(let n of e)t+=n.score;return t/e.length}function st(e){let{passCount:t,total:n,meanScore:r,threshold:o,missingArtifact:c}=e,a=Number.isFinite(r)?r.toFixed(3):String(r),i=!c&&n>0&&r>=o,l=c?["EXECUTE stage did not emit an artifact; cannot verify reactively"]:i?[`${t}/${n} eval tasks passed; mean score ${a} \u2265 ${o}`]:n===0?["No eval tasks were selected for this item \u2014 cannot verify"]:[`${t}/${n} eval tasks passed; mean score ${a} < threshold ${o}`];return i?{verified:!0,findings:l}:{verified:!1,findings:l,errorClass:"structural"}}function at(e){return e.artifact??null}function Ce(e){let t=e.name??"eval-verifier",n=e.threshold??.5,r=e.toOutput??st,o=e.extractArtifact??at;return c=>{let a=P(c,l=>l!=null&&l[0]!=null&&l[1]!=null,{name:`${t}/gate-in`}),i=$(a,l=>{let[d,m]=l,p=o(d,m);if(p==null)return S(r({scores:[],meanScore:Number.NEGATIVE_INFINITY,passCount:0,total:0,threshold:n,missingArtifact:!0}));let f=S([p],{name:`${t}/candidates`}),g=S(e.datasetFor(m),{name:`${t}/dataset`}),T=e.evaluator(f,g);return R([T],([k])=>{let x=k;if(x==null)return null;let I=ot(x),N=x.filter(A=>A.score>=n).length;return r({scores:x,meanScore:I,passCount:N,total:x.length,threshold:n})},{name:`${t}/output`})},{name:t});return P(i,l=>l!=null,{name:`${t}/gate-out`})}}function it(e){let t=e.name??"harness-pair",n=le({name:`${t}-exec`,seedFrom:e.seedFrom,evaluator:e.evaluator,strategy:e.strategy,datasetFor:e.datasetFor,refine:e.refine}),r=Ce({name:`${t}-verify`,evaluator:e.evaluator,datasetFor:e.datasetFor,threshold:e.threshold});return{executor:n,verifier:r}}function ce(){let e=ke({name:"strategy-entries"}),t=R([e.entries],([a])=>{let i=a;return new Map(i)},{name:"strategy-model",equals:(a,i)=>{let l=a,d=i;if(l.size!==d.size)return!1;for(let[m,p]of l){let f=d.get(m);if(!f||p.attempts!==f.attempts||p.successes!==f.successes)return!1}return!0}});function n(a,i,l){let d=V(a,i),m=e.get(d),p=(m?.attempts??0)+1,f=(m?.successes??0)+(l?1:0);e.set(d,{rootCause:a,intervention:i,attempts:p,successes:f,successRate:f/p})}function r(a,i){return e.get(V(a,i))}let o=t.subscribe(()=>{});function c(){o()}return{node:t,record:n,lookup:r,dispose:c}}function ut(e,t,n,r,o){let c={...M,...o?.severityWeights},a=o?.decayRate??L,i=o?.effectivenessThreshold??.7,l=o?.effectivenessBoost??15,d=[e,t,n];return r&&d.push(r),R(d,m=>{let p=m[0],f=m[1],g=m[2],T=r?m[3]:0,k=c[p.severity??"medium"],x=(F()-g)/1e9,I=Ae(k,x,a,0),N=V(p.rootCause,p.intervention),A=f.get(N);return A&&A.successRate>=i&&(I+=l),I+=T*20,I},{name:"priority-score"})}var _e="intake",lt="triage-output",Fe="retry",Pe="verify-results",$e="__unrouted";function Me(e,t){let n=Q(t,ie,(r,o)=>r.replace("{{item}}",JSON.stringify(o)));return r=>Y(e,[r],n,{name:"execute",format:"json"})}function Le(e,t){let n=Q(t,ue,(r,o)=>{let[c,a]=o;return r.replace("{{execution}}",JSON.stringify(c)).replace("{{item}}",JSON.stringify(a))});return r=>Y(e,[r],o=>o==null?"":n(o),{name:"verify",format:"json"})}var W=class extends ne{queues;jobs;gates;strategy;totalRetries;totalReingestions;priorityScores;constructor(t,n,r,o,c,a,i,l){super(t),this.queues=n,this.jobs=r,this.gates=o,this.strategy=c,this.totalRetries=a,this.totalReingestions=i,this.priorityScores=l}get intake(){return this.queues.topic(_e)}get verifyResults(){return this.queues.topic(Pe)}get retry(){return this.queues.topic(Fe)}get unrouted(){return this.queues.topic($e)}stageNodes(){let t=this.queues,n=a=>t.has(a)?`queues::${a}::latest`:null,r=a=>a==null?[]:[a],o=b.flatMap(a=>r(n(a))),c=[];for(let[a]of this.gates)c.push(`gates::${a}/gate`);return[{label:"INTAKE",paths:r(n("intake"))},{label:"TRIAGE",paths:["triage"]},{label:"QUEUE",paths:o},{label:"GATE",paths:c},{label:"EXECUTE",paths:["execute"]},{label:"VERIFY",paths:r(n("verify-results"))},{label:"REFLECT",paths:["reflect"]},{label:"STRATEGY",paths:["strategy"]}]}};function ct(e,t){let n=t.adapter,r=t.maxRetries??2,o=t.retainedLimit??1e3,c=t.errorClassifier??K,a=new Map;for(let s of b)a.set(s,{...J[s],...t.queues?.[s]});let i=Ne(`${e}/queues`,{defaultTopicOptions:{retainedLimit:o}}),l=i.topic(_e),d=i.topic(lt),m=i.topic(Fe),p=i.topic(Pe),f=new Map;for(let s of b)f.set(s,i.topic(s));let g=i.topic($e),T=ce(),k=H(l.latest,T.node),x=Q(t.triagePrompt,ae,(s,u)=>{let[y,v]=u;return s.replace("{{strategy}}",JSON.stringify(Array.from(v.entries()))).replace("{{item}}",JSON.stringify(y))}),I=Y(n,[k],s=>{let u=s;return!u||!u[0]?"":x(u)},{name:"triage",format:"json"}),N=H(I,k),w=_([N],([s])=>{if(s==null)return;let[u,y]=s;if(!u?.route)return;let v=y?.[0],O={...u,...v};d.publish(O)}).subscribe(()=>{}),je=new Set(b);for(let s of b)se(`bridge/${s}`,d,f.get(s),{map:u=>u.route===s?u:void 0});se("bridge/__unrouted",d,g,{map:s=>je.has(s.route)?void 0:s});let j=new Map,z=new Map;for(let s of b)j.set(s,Oe(`jobs/${s}`));let de=[];for(let s of b){let u=f.get(s),y=j.get(s),v=new WeakSet,O=_([u.events],([re])=>{let G=re??[];for(let h of G){if(v.has(h))continue;v.add(h);let C=y.enqueue(h);z.set(D(h),{route:s,id:C})}},{name:`jobs/${s}-mirror`});de.push(O.subscribe(()=>{}))}function fe(s){let u=D(s),y=z.get(u);y&&(j.get(y.route)?.removeById(y.id),z.delete(u))}let X=new ne("gates"),U=new Map;for(let s of b){let u=a.get(s);if(!u.gated)continue;let y=f.get(s);X.add(y.latest,{name:`${s}/source`});let v=Se(X,`${s}/gate`,`${s}/source`,{maxPending:u.maxPending,startOpen:u.startOpen});U.set(s,v)}let q=[];for(let s of b)a.get(s).gated&&U.has(s)?q.push(U.get(s).node):q.push(f.get(s).latest);q.push(m.latest);let Z=Re(...q),pe=(t.executor??Me(n,t.executePrompt))(Z),ee=H(pe,Z),me=(t.verifier??Le(n,t.verifyPrompt))(ee),ge=H(me,ee),ye=t.maxReingestions??1,Ge=Math.min(t.maxTotalRetries??r*10,100),De=Math.min(t.maxTotalReingestions??ye*10,100),Te=S(0),Ee=S(0);function He(s,u,y){let v={item:y,outcome:u?.outcome??"failure",detail:u?.detail??"unknown",artifact:u?.artifact};return{item:y,execution:v,verified:s.verified,findings:s.findings??[],errorClass:s.errorClass}}function Qe(s,u){T.record(u.rootCause,u.intervention,!0),p.publish(s),fe(u)}function Ue(s,u){let y=D(u),v=u.$retries??0,O={...u,$retries:v+1,summary:`[RETRY ${v+1}/${r}] ${y} \u2014 Previous attempt failed: ${s.findings.join("; ")}`,relatedTo:[y]};m.publish(O)}function ve(s,u){T.record(u.rootCause,u.intervention,!1),p.publish(s),fe(u);let y=D(u),v=u.$reingestions??0;v<ye&&oe(Ee,De)&&l.publish({source:u.source,summary:`Verification failed for: ${y}`,evidence:s.findings.join(`
|
|
43
|
+
`),affectsAreas:u.affectsAreas,affectsEvalTasks:u.affectsEvalTasks,severity:u.severity??"high",relatedTo:[y],$reingestions:v+1})}let te=he([ge],(s,u)=>{let y=s[0];if(y==null||y.length===0)return;let v=y[y.length-1];if(v==null)return;let[O,re]=v,[G,h]=re??[null,null];if(!O||!h)return;if(G==null){ve({item:h,execution:{item:h,outcome:"failure",detail:"executor returned null"},verified:!1,findings:["executor returned null"],errorClass:"structural"},h);return}let C=He(O,G,h);if(C.verified){Qe(C,h);return}let Be=C.errorClass??c({item:h,outcome:G.outcome,detail:C.findings.join("; ")}),Ye=h.$retries??0;Be==="self-correctable"&&Ye<r&&oe(Te,Ge)?Ue(C,h):ve(C,h)}),qe=te.subscribe(()=>{}),xe=R([te],()=>null,{name:"reflect",equals:()=>!1}),B;t.priority&&(B=dt(f,T,t));let E=new W(e,i,j,U,T,Te,Ee,B);E.addDisposer(w),E.addDisposer(qe),E.addDisposer(T.dispose);for(let s of de)E.addDisposer(s);if(E.add(I,{name:"triage"}),E.add(Z,{name:"execute-input"}),E.add(pe,{name:"execute"}),E.add(ee,{name:"execute-context"}),E.add(me,{name:"verify"}),E.add(ge,{name:"verify-context"}),E.add(te,{name:"verify-dispatch"}),E.add(xe,{name:"reflect"}),E.add(T.node,{name:"strategy"}),E.addDisposer(xe.subscribe(()=>{})),B)for(let[s,u]of B)E.add(u,{name:`priority/${s}`}),E.addDisposer(u.subscribe(()=>{}));E.mount("queues",i),E.mount("gates",X);for(let[s,u]of j)E.mount(`jobs/${s}`,u);return E}function dt(e,t,n){if(!n.lastInteractionNs)throw new Error("harnessLoop: `opts.priority` requires `opts.lastInteractionNs` \u2014 pass a Node<number> (e.g. `fromTimer(60_000)` or a `state(monotonicNs())` you bump on human interaction). Priority scores only decay when this node settles; an internal default would freeze age at construction time.");let r=n.lastInteractionNs,o=n.priority??{},c={...M,...o.severityWeights},a=o.decayRate??L,i=o.effectivenessThreshold??.7,l=o.effectivenessBoost??15,d=new Map;for(let[m,p]of e){let f=R([p.latest,t.node,r],g=>{let T=g[0];if(T==null)return 0;let k=c[T.severity??"medium"]??40,x=(F()-g[2])/1e9,I=k*Math.exp(-a*Math.max(0,x)),N=`${T.rootCause}\u2192${T.intervention}`,w=g[1]?.get(N);return w&&w.successRate>=i&&(I+=l),I},{name:`priority/${m}`});d.set(m,f)}return d}function ft(e,t){let n=be(e,t),r={};for(let o of b){let c=e.queues.has(o)?e.queues.topic(o):null;r[o]=c?.retained().length??0}return{...n,queueDepths:r,strategyEntries:e.strategy.node.cache?.size??0,totalRetries:e.totalRetries.cache??0,totalReingestions:e.totalReingestions.cache??0}}function pt(e){let t={};for(let{label:n,paths:r}of e.stageNodes())for(let o of r)t[o]=n;return t}function mt(e,t){let n=t?.logger===null?null:t?.logger??console.log,r=t?.detail??"summary",o=F(),c=[],a=[],i=pt(e);function l(){return(F()-o)/1e9}function d(m,p,f){let g={elapsed:l(),stage:m,type:p};r!=="summary"&&(g.summary=gt(f)),r==="full"&&(g.data=f),a.push(g)}for(let[m,p]of Object.entries(i))try{let f=e.observe(m,{format:"stage-log",stageLabels:i,logger:n?g=>n(g):()=>{},includeTypes:["data","error","complete"]});f.onEvent(g=>{g.type==="data"?d(p,"data",g.data):g.type==="error"?d(p,"error",g.data):g.type==="complete"&&d(p,"complete",void 0)}),c.push(f)}catch(f){let g=f instanceof Error?f.message:String(f);d(p,"error",`observe-unavailable: ${m} \u2014 ${g}`),n&&n(`[${l().toFixed(3)}s] ${p.padEnd(9)} \u2717 observe-unavailable: ${g}`)}return{get events(){return a},dispose(){for(let m of c)m.dispose();c.length=0}}}function gt(e){if(e==null)return"null";if(typeof e=="string")return Ve(e,80);if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return String(e);try{let t=JSON.stringify(e);return Ve(t,120)}catch{return String(e)}}function Ve(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}export{Ke as a,We as b,ze as c,Xe as d,Ze as e,et as f,tt as g,b as h,J as i,M as j,L as k,V as l,K as m,ae as n,ie as o,ue as p,Q as q,le as r,Ce as s,it as t,ce as u,ut as v,Me as w,Le as x,W as y,ct as z,ft as A,mt as B,yt as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as E}from"./chunk-ESMPEKEV.js";import{a as B,b as R,i as _}from"./chunk-4VVTGLXJ.js";import{m as I}from"./chunk-
|
|
1
|
+
import{a as E}from"./chunk-ESMPEKEV.js";import{a as B,b as R,i as _}from"./chunk-4VVTGLXJ.js";import{m as I}from"./chunk-T7EQPKOP.js";import{D as P,F as g,m as L,o as O}from"./chunk-LYCLF26R.js";import{b,c as k,d as y,h as C,i as h,j as T}from"./chunk-CK2E7BTU.js";function S(e){return{describeKind:"derived",...e}}function V(e){return e<0?0:e}function M(e){return e[1]}function W(e){if(typeof e!="number"||!Number.isFinite(e))throw new TypeError("backoff strategy must return a finite number");return e<0?0:e}function Z(e,s){let r=s?.count,n=s?.backoff,l=r!==void 0?r:n===void 0?0:2147483647;if(l<0)throw new RangeError("retry count must be >= 0");let u=n===void 0?null:typeof n=="string"?_(n):n;return g(t=>{let o=0,c=!1,i=null,f,a=new E;function w(){f?.(),f=void 0}function N(p){if(c)return;if(o>=l){w(),t.down([[T,p]]);return}let m=u===null?0:u(o,p,i);if(m==null){w(),t.down([[T,p]]);return}let d;try{d=W(m)}catch{w(),t.down([[T,p]]);return}i=d,o+=1,w();let v=d>0?d/1e6:1;a.start(v,()=>{c||x()})}function x(){a.cancel(),w(),f=e.subscribe(p=>{if(!c)for(let m of p){let d=m[0];if(d===k)t.down([[k]]);else if(d===b)o=0,i=null,t.emit(m[1]);else if(d===y)t.down([[y]]);else if(d===h)w(),t.down([[h]]);else if(d===T){N(M(m));return}else t.down([m])}})}return x(),()=>{c=!0,a.cancel(),w()}},{...S(),initial:e.cache})}function ee(e,s){let r=s?.count,n=s?.backoff,l=r!==void 0?r:n===void 0?0:2147483647;if(l<0)throw new RangeError("retry count must be >= 0");let u=n===void 0?null:typeof n=="string"?_(n):n;return g(t=>{let o=0,c=!1,i=null,f,a=new E;function w(){f?.(),f=void 0}function N(p){if(c)return;if(o>=l){w(),t.down([[T,p]]);return}let m=u===null?0:u(o,p,i);if(m==null){w(),t.down([[T,p]]);return}let d;try{d=W(m)}catch{w(),t.down([[T,p]]);return}i=d,o+=1,w();let v=d>0?d/1e6:1;a.start(v,()=>{c||x()})}function x(){a.cancel(),w();let p;try{p=e()}catch(m){N(m);return}f=p.subscribe(m=>{if(!c)for(let d of m){let v=d[0];if(v===k)t.down([[k]]);else if(v===b)o=0,i=null,t.emit(d[1]);else if(v===y)t.down([[y]]);else if(v===h)w(),t.down([[h]]);else if(v===T){N(M(d));return}else t.down([d])}})}return x(),()=>{c=!0,a.cancel(),w()}},{...S(),initial:s?.initial})}var A=class extends Error{name="CircuitOpenError";constructor(){super("Circuit breaker is open")}};function te(e){let s=Math.max(1,e?.failureThreshold??5),r=V(e?.cooldownNs??30*1e9),n=e?.cooldown??null,l=Math.max(1,e?.halfOpenMax??1),u=e?.now??O,t="closed",o=0,c=0,i=0,f=r,a=0;function w(){if(!n)return r;let p=n(c);return p!==null?p:r}function N(){t="open",f=w(),i=u(),a=0}return{canExecute(){return t==="closed"?!0:t==="open"?u()-i>=f?(t="half-open",a=1,!0):!1:a<l?(a++,!0):!1},recordSuccess(){t==="half-open"?(t="closed",o=0,c=0):t==="closed"&&(o=0)},recordFailure(p){if(t==="half-open"){c++,N();return}t==="closed"&&(o++,o>=s&&N())},get state(){return t},get failureCount(){return o},reset(){t="closed",o=0,c=0,a=0}}}function ne(e,s){let r=s?.onOpen??"skip";return n=>{let l=P([],(u,t)=>{function o(){l.meta.breakerState.down([[b,e.state]])}let c=n.subscribe(i=>{for(let f of i){let a=f[0];a===k?t.down([[k]]):a===b?e.canExecute()?(o(),t.emit(f[1])):(o(),r==="error"?t.down([[T,new A]]):t.down([[y]])):a===y?t.down([[y]]):a===h?(e.recordSuccess(),o(),t.down([[h]])):a===T?(e.recordFailure(M(f)),o(),t.down([f])):t.down([f])}});return o(),c},{...S(),meta:{breakerState:e.state},completeWhenDepsComplete:!1,initial:n.cache});return{node:l,breakerState:l.meta.breakerState}}}function U(e,s){if(e<=0)throw new RangeError("capacity must be > 0");if(s<0)throw new RangeError("refillPerSecond must be >= 0");let r=e,n=O();function l(u){if(s>0){let t=u-n;r=Math.min(e,r+t/1e9*s)}n=u}return{available(){return l(O()),r},tryConsume(u=1){if(u<=0)return!0;let t=O();return l(t),r>=u?(r-=u,!0):!1},putBack(u=1){u<=0||(l(O()),r=Math.min(e,r+u))}}}var D=class extends Error{name="RateLimiterOverflowError";constructor(s){super(`rateLimiter buffer overflow (maxBuffer=${s})`)}};function re(e,s){let{maxEvents:r,windowNs:n}=s;if(r<=0)throw new RangeError("maxEvents must be > 0");if(n<=0)throw new RangeError("windowNs must be > 0");let l=s.maxBuffer;if(l!==void 0&&l<1)throw new RangeError("maxBuffer must be >= 1");let u=s.onOverflow??"drop-newest",t=r*1e9/n;return g(o=>{let c=U(r,t),i=[],f=new E,a=!1,w=1e9/t;function N(){for(;i.length>0;)if(c.tryConsume(1))o.emit(i.shift());else{f.start(Math.max(1,w/1e6),N);return}}let x=e.subscribe(p=>{for(let m of p){if(a)return;let d=m[0];if(d===k)o.down([[k]]);else if(d===b){if(l!==void 0&&i.length>=l){if(u!=="drop-newest")if(u==="drop-oldest")i.shift(),i.push(m[1]);else{a=!0,f.cancel(),i.length=0,o.down([[T,new D(l)]]);return}}else i.push(m[1]);N()}else if(d===y)o.down([[y]]);else if(d===h)a=!0,f.cancel(),i.length=0,o.down([[h]]);else if(d===T)a=!0,f.cancel(),i.length=0,o.down([m]);else if(d===C){a=!0,f.cancel(),i.length=0,o.down([m]);return}else o.down([m])}});return()=>{a=!0,f.cancel(),x()}},{...S(),initial:e.cache})}function oe(e,s){let r=s?.initialStatus??"pending",n=P([],(l,u)=>{let t=r;return n.meta.status.down([[b,r]]),n.meta.error.down([[b,null]]),e.subscribe(c=>{for(let i of c){let f=i[0];if(f===k)u.down([[k]]);else if(f===b)t==="errored"?L(()=>{n.meta.error.down([[b,null]]),n.meta.status.down([[b,"active"]])}):n.meta.status.down([[b,"active"]]),t="active",u.emit(i[1]);else if(f===y)u.down([[y]]);else if(f===h)n.meta.status.down([[b,"completed"]]),t="completed",u.down([[h]]);else if(f===T){let a=M(i);L(()=>{n.meta.error.down([[b,a]]),n.meta.status.down([[b,"errored"]])}),t="errored",u.down([i])}else u.down([i])}})},{...S(),meta:{status:r,error:null},completeWhenDepsComplete:!1,resubscribable:!0,initial:e.cache});return{node:n,status:n.meta.status,error:n.meta.error}}var F=class extends Error{name="TimeoutError";constructor(s){super(`Timed out after ${s/1e6}ms`)}};function j(e){return e!=null&&typeof e=="object"&&"cache"in e&&typeof e.subscribe=="function"}function K(e){return e!=null&&typeof e.then=="function"}function $(e){return e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function"}function ie(e,s){return g(r=>{let n,l;function u(){l?.(),l=void 0,j(s)||K(s)||$(s)?n=I(s).subscribe(o=>{r.down(o)}):(r.emit(s),r.down([[h]]))}return l=e.subscribe(t=>{for(let o of t){let c=o[0];if(c===k)r.down([[k]]);else if(c===b)r.emit(o[1]);else if(c===y)r.down([[y]]);else if(c===h)r.down([[h]]);else if(c===T){u();return}else if(c===C){n?.(),r.down([o]);return}else r.down([o])}}),()=>{l?.(),n?.()}},{...S(),initial:e.cache})}function se(e,s){if(s<=0)throw new RangeError("timeoutNs must be > 0");return g(r=>{let n=!1,l=new E;function u(){let o=s/1e6;l.start(o,()=>{n||(n=!0,t(),r.down([[T,new F(s)]]))})}let t=e.subscribe(o=>{for(let c of o){if(n)return;let i=c[0];if(i===k)r.down([[k]]);else if(i===b)u(),r.emit(c[1]);else if(i===y)r.down([[y]]);else if(i===h){l.cancel(),n=!0,r.down([[h]]);return}else if(i===T){l.cancel(),n=!0,r.down([c]);return}else if(i===C){l.cancel(),n=!0,r.down([c]);return}else r.down([c])}});return u(),()=>{n=!0,l.cancel(),t()}},{...S(),initial:e.cache})}export{Z as a,ee as b,A as c,te as d,ne as e,U as f,D as g,re as h,oe as i,F as j,ie as k,se as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as G,d as F}from"./chunk-
|
|
1
|
+
import{b as G,d as F}from"./chunk-PBN426RU.js";import{c as E}from"./chunk-L3KUKDZC.js";import{a as A}from"./chunk-BY4WKPKM.js";import{b as q}from"./chunk-HTBOCKVD.js";import{j as I}from"./chunk-2JO6LXFT.js";import{B as M}from"./chunk-T7EQPKOP.js";import{E as d,G as o,H as O,m as S}from"./chunk-LYCLF26R.js";import{b as V}from"./chunk-QYADASLV.js";var $={};V($,{contentModerationGraph:()=>Q,dataQualityGraph:()=>T,issueTrackerGraph:()=>B,observabilityGraph:()=>D});function s(u,a){return E("domain_template",u,a)}function D(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=[{name:"errors",classify:e=>C(e,"error")},{name:"traces",classify:e=>C(e,"trace")},{name:"metrics",classify:e=>C(e,"metric")}],m=a.branches??h,y=m.map(e=>({name:e.name,classify:e.classify})),c=A("stratify",a.source,y);n.mount("stratify",c);let k=m.map(e=>{try{let i=n.resolve(`stratify::branch/${e.name}`);return o([i],([x])=>x,{initial:null})}catch{return d(null)}}),l=a.correlate??(e=>e),_=o(k,e=>l(e),{meta:s("observability",{stage:"correlate"})});n.add(_,{name:"correlate"});let N=a.sloCheck??(()=>({pass:!0})),w=o([_],e=>e[0],{meta:s("observability",{stage:"slo_value"})}),f=o([w],e=>N(e[0]),{meta:s("observability",{stage:"slo_verified"})});n.add(w,{name:"slo_value"}),n.add(f,{name:"slo_verified"});let v=a.weights??m.map(()=>1),b=k.map(e=>o([e],i=>i[0]!=null?1:0)),p=v.map(e=>d(e));for(let e=0;e<b.length;e++)n.add(b[e],{name:`__signal_${e}`}),n.add(p[e],{name:`__weight_${e}`});let t=F(b,p);n.add(t,{name:"alerts"});let g=o([t,f],e=>({scored:e[0],slo:e[1]}),{meta:s("observability",{stage:"output"})});n.add(g,{name:"output"});let R=d(null,{meta:s("observability",{stage:"feedback_reentry"})});n.add(R,{name:"feedback_reentry"});let r=o([f],e=>{let i=e[0];return i&&i.pass===!1?i:null},{meta:s("observability",{stage:"feedback_condition"})});return n.add(r,{name:"feedback_condition"}),G(n,"feedback_condition","feedback_reentry",{maxIterations:a.maxFeedbackIterations??5}),n}function B(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=0,m=e=>({id:`issue-${++h}`,title:String(e),severity:1,source:"unknown",raw:e}),y=a.extract??m,c=o([a.source],e=>y(e[0]),{meta:s("issue_tracker",{stage:"extract"})});n.add(c,{name:"extract"});let k=a.verify??(()=>({valid:!0})),l=o([c],e=>{let i=e[0];return{issue:i,verification:k(i)}},{meta:s("issue_tracker",{stage:"verify"})});n.add(l,{name:"verify"});let _=d([],{meta:s("issue_tracker",{stage:"known_patterns"})});n.add(_,{name:"known_patterns"});let N=a.detectRegression??(()=>({regression:!1})),w=o([c,_],e=>{let i=e[0],x=e[1];return{issue:i,regression:N(i,x)}},{meta:s("issue_tracker",{stage:"regression"})});n.add(w,{name:"regression"});let f=o([c],e=>e[0]?.severity??0),v=o([w],e=>e[0]?.regression?2:0);n.add(f,{name:"__severity_signal"}),n.add(v,{name:"__regression_signal"});let b=d(1),p=d(1.5);n.add(b,{name:"__severity_weight"}),n.add(p,{name:"__regression_weight"});let t=F([f,v],[b,p]);n.add(t,{name:"priority"});let g=o([l,w,t],e=>({verified:e[0],regression:e[1],priority:e[2]}),{meta:s("issue_tracker",{stage:"output"})});n.add(g,{name:"output"});let R=d(null,{meta:s("issue_tracker",{stage:"feedback_reentry"})});n.add(R,{name:"feedback_reentry"});let r=o([l],e=>{let i=e[0];if(i){let x=i.verification;if(x&&x.valid===!1)return i}return null},{meta:s("issue_tracker",{stage:"feedback_condition"})});return n.add(r,{name:"feedback_condition"}),G(n,"feedback_condition","feedback_reentry",{maxIterations:a.maxFeedbackIterations??3}),n}function Q(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=r=>({label:"review",confidence:.5,original:r}),m=a.classify??h,y=o([a.source],r=>m(r[0]),{meta:s("content_moderation",{stage:"classify"})});n.add(y,{name:"classify"});let c=A("stratify",y,[{name:"safe",classify:r=>r.label==="safe"},{name:"review",classify:r=>r.label==="review"},{name:"block",classify:r=>r.label==="block"}]);n.mount("stratify",c);let k=q([],{name:"review_queue",maxSize:a.maxQueueSize});n.add(k.entries,{name:"review_queue"});let l;try{l=n.resolve("stratify::branch/review")}catch{l=d(null),n.add(l,{name:"__review_fallback"})}let _=O([l],r=>{let e=r[0];e&&k.append(e)});n.add(_,{name:"__review_accumulator"}),n.addDisposer(M(_));let N=d({},{meta:s("content_moderation",{stage:"policy",access:"both",description:"Moderation policy rules \u2014 updated via feedback"})});n.add(N,{name:"policy"});let w=a.weights??[.1,1,2],f=o([y],r=>r[0]?.confidence??0),v=o([y],r=>{let e=r[0];return e?e.label==="block"?w[2]:e.label==="review"?w[1]:w[0]:0});n.add(f,{name:"__confidence_signal"}),n.add(v,{name:"__severity_signal"});let b=d(1),p=d(1);n.add(b,{name:"__w_confidence"}),n.add(p,{name:"__w_severity"});let t=F([f,v],[b,p]);n.add(t,{name:"priority"});let g=o([y,t],r=>({classification:r[0],priority:r[1]}),{meta:s("content_moderation",{stage:"output"})});n.add(g,{name:"output"});let R=o([k.entries,N],r=>{let e=r[0];if(e&&e.length>0){let i=e[e.length-1];if(i&&i.falsePositive)return i}return null},{meta:s("content_moderation",{stage:"feedback_condition"})});return n.add(R,{name:"feedback_condition"}),G(n,"feedback_condition","policy",{maxIterations:a.maxFeedbackIterations??5}),n}function T(u,a){let n=new I(u,a);n.add(a.source,{name:"source"});let h=a.validate??(t=>({valid:!0,errors:[],record:t})),m=o([a.source],t=>t[0]!=null?h(t[0]):void 0,{meta:s("data_quality",{stage:"validate"})});n.add(m,{name:"validate"});let y=a.detectAnomaly??(t=>({anomaly:!1,score:0,record:t})),c=o([a.source],t=>t[0]!=null?y(t[0]):void 0,{meta:s("data_quality",{stage:"anomaly"})});n.add(c,{name:"anomaly"});let k=d(null,{meta:s("data_quality",{stage:"baseline",description:"Rolling baseline for drift detection"})});n.add(k,{name:"baseline"});let l=O([m],t=>{let g=t[0];g?.valid&&S(()=>{k.emit(g.record)})});n.add(l,{name:"__baseline_updater"}),M(l);let _=a.detectDrift??(()=>({drift:!1})),N=o([a.source,k],t=>_(t[0],t[1]),{meta:s("data_quality",{stage:"drift"})});n.add(N,{name:"drift"});let w=a.suggest??(()=>null),f=o([m,c],t=>w({validation:t[0],anomaly:t[1]}),{meta:s("data_quality",{stage:"remediate"})});n.add(f,{name:"remediate"});let v=o([m,c,N,f],t=>({validation:t[0],anomaly:t[1],drift:t[2],remediation:t[3]}),{meta:s("data_quality",{stage:"output"})});n.add(v,{name:"output"});let b=d([],{meta:s("data_quality",{stage:"validation_rules"})});n.add(b,{name:"validation_rules"});let p=o([c],t=>{let g=t[0];return g?.anomaly?g:null},{meta:s("data_quality",{stage:"feedback_condition"})});return n.add(p,{name:"feedback_condition"}),G(n,"feedback_condition","validation_rules",{maxIterations:a.maxFeedbackIterations??3}),n}function C(u,a){if(u==null||typeof u!="object")return!1;let n=u;return n.type===a||n.kind===a}export{D as a,B as b,Q as c,T as d,$ as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as C}from"./chunk-
|
|
1
|
+
import{j as C}from"./chunk-2JO6LXFT.js";import{E as w,G as E,o as x}from"./chunk-LYCLF26R.js";import{b as z}from"./chunk-QYADASLV.js";var F={};z(F,{collection:()=>G,decay:()=>K,knowledgeGraph:()=>O,lightCollection:()=>S,vectorIndex:()=>L});function K(s,a,l,r=0){if(!Number.isFinite(s))return r;if(!Number.isFinite(a)||a<=0||!Number.isFinite(l)||l<=0)return Math.max(r,s);let y=s*Math.exp(-l*a);return Math.max(r,y)}function V(s){if(s!==void 0&&s<1)throw new RangeError("maxSize must be >= 1")}function M(s){return new Map(s)}function T(s){return s.cache??new Map}function N(s){return s.cache??[]}function I(s,a){let l=Math.max(s.length,a.length),r=0,y=0,p=0;for(let o=0;o<l;o+=1){let n=s[o]??0,e=a[o]??0;r+=n*e,y+=n*n,p+=e*e}return y===0||p===0?0:r/Math.sqrt(y*p)}function S(s={}){let a=s.maxSize,l=s.policy??"fifo";V(a);let r=w(new Map,{name:s.name,describeKind:"state"});function y(o){if(a!==void 0)for(;o.size>a;){let n;for(let e of o.values()){if(!n){n=e;continue}let i=l==="lru"?e.lastAccessNs:e.createdAtNs,t=l==="lru"?n.lastAccessNs:n.createdAtNs;i<t&&(n=e)}if(!n)break;o.delete(n.id)}}function p(o){r.emit(o)}return{entries:r,upsert(o,n){let e=x(),i=T(r),t=i.get(o),m=M(i);m.set(o,{id:o,value:n,createdAtNs:t?.createdAtNs??e,lastAccessNs:e}),y(m),p(m)},remove(o){let n=M(T(r));n.delete(o)&&p(n)},clear(){T(r).size!==0&&p(new Map)},get(o){let n=T(r),e=n.get(o);if(e){if(l==="lru"){let i=x(),t=M(n);t.set(o,{...e,lastAccessNs:i}),p(t)}return e.value}},has(o){return T(r).has(o)}}}function G(s,a={}){let l=a.maxSize,r=a.policy??"lru",y=a.decayRate??0,p=a.minScore??0,o=a.score??(()=>1);V(l);let n=new C(s),e=w(new Map,{name:"items",describeKind:"state"}),i=E([e],([c])=>{let d=c??new Map,u=x(),h=[...d.values()].map(f=>{let b=(u-f.lastAccessNs)/1e9;return{...f,score:K(f.baseScore,b,y,p)}});return h.sort((f,b)=>b.score-f.score||b.lastAccessNs-f.lastAccessNs),h},{name:"ranked",describeKind:"derived"}),t=E([e],([c])=>(c??new Map).size,{name:"size",describeKind:"derived",initial:0});i.subscribe(()=>{}),t.subscribe(()=>{}),n.add(e,{name:"items"}),n.add(i,{name:"ranked"}),n.add(t,{name:"size"});function m(c,d){let u=(d-c.lastAccessNs)/1e9;return K(c.baseScore,u,y,p)}function v(c){if(l!==void 0)for(;c.size>l;){let d=x(),u,h=Number.POSITIVE_INFINITY;for(let f of c.values()){let b=m(f,d);if(b<h){u=f,h=b;continue}if(b===h&&u){let A=r==="lru"?f.lastAccessNs:f.createdAtNs,R=r==="lru"?u.lastAccessNs:u.createdAtNs;A<R&&(u=f)}}if(!u)break;c.delete(u.id)}}function g(c){e.emit(c)}return Object.assign(n,{upsert(c,d,u){let h=x(),f=T(e),b=f.get(c),A=u?.score??o(d),R=M(f);R.set(c,{id:c,value:d,baseScore:A,createdAtNs:b?.createdAtNs??h,lastAccessNs:h}),v(R),g(R)},remove(c){let d=M(T(e));d.delete(c)&&g(d)},clear(){T(e).size!==0&&g(new Map)},getItem(c){let d=T(e),u=d.get(c);if(u){if(r==="lru"){let h=M(d);h.set(c,{...u,lastAccessNs:x()}),g(h)}return u}}})}function L(s={}){let a=s.backend??"flat",l=s.dimension,r;if(a==="hnsw"&&(r=s.hnswFactory?.(),!r))throw new Error('vectorIndex backend "hnsw" requires an optional dependency adapter; install your HNSW package and provide `hnswFactory`.');let y=w(new Map,{describeKind:"state",name:"vector-index"});function p(n){if(l!==void 0&&n.length!==l)throw new RangeError(`vector dimension mismatch: expected ${l}, got ${n.length}`)}function o(n){y.emit(n)}return{backend:a,entries:y,upsert(n,e,i){p(e);let t=M(T(y));t.set(n,{id:n,vector:[...e],meta:i}),a==="hnsw"&&r.upsert(n,e,i),o(t)},remove(n){let e=M(T(y));e.delete(n)&&(a==="hnsw"&&r.remove(n),o(e))},clear(){T(y).size!==0&&(a==="hnsw"&&r.clear(),o(new Map))},search(n,e=5){return p(n),e<=0?[]:a==="hnsw"?r.search(n,e):[...T(y).values()].map(t=>({id:t.id,score:I(n,t.vector),meta:t.meta})).sort((t,m)=>m.score-t.score).slice(0,e)}}}function O(s){let a=new C(s),l=w(new Map,{name:"entities",describeKind:"state"}),r=w([],{name:"edges",describeKind:"state"}),y=E([r],([e])=>{let i=e??[],t=new Map;for(let m of i){let v=t.get(m.from)??[];t.set(m.from,Object.freeze([...v,m]))}return t},{name:"adjacency",describeKind:"derived",initial:new Map});y.subscribe(()=>{}),a.add(l,{name:"entities"}),a.add(r,{name:"edges"}),a.add(y,{name:"adjacency"});function p(e){l.emit(e)}function o(e){r.emit(e)}return Object.assign(a,{upsertEntity(e,i){let t=M(T(l));t.set(e,i),p(t)},removeEntity(e){let i=M(T(l)),t=i.delete(e),m=N(r),v=m.filter(g=>g.from!==e&&g.to!==e);!t&&v.length===m.length||(p(i),o(v))},link(e,i,t,m=1){let v=`${e}\0${i}\0${t}`,g=N(r),k=new Set(g.map(d=>`${d.from}\0${d.to}\0${d.relation}`)),c=[...g];if(k.has(v))for(let d=0;d<c.length;d+=1){let u=c[d];if(u.from===e&&u.to===i&&u.relation===t){c[d]={...u,weight:m};break}}else c.push({from:e,to:i,relation:t,weight:m});o(c)},unlink(e,i,t){let m=N(r),v=m.filter(g=>t===void 0?!(g.from===e&&g.to===i):!(g.from===e&&g.to===i&&g.relation===t));v.length!==m.length&&o(v)},related(e,i){return N(r).filter(t=>(t.from===e||t.to===e)&&(i===void 0||t.relation===i))}})}export{K as a,S as b,G as c,L as d,O as e,F as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as I}from"./chunk-L3KUKDZC.js";import{g as q,j as P}from"./chunk-2JO6LXFT.js";import{D as G,E as j,G as E,m as C}from"./chunk-LYCLF26R.js";import{b as _,d as D,i as A,j as M}from"./chunk-CK2E7BTU.js";import{b as $}from"./chunk-QYADASLV.js";var ne={};$(ne,{approval:()=>z,branch:()=>V,gate:()=>J,join:()=>Q,loop:()=>X,onFailure:()=>ee,pipeline:()=>L,sensor:()=>Z,subPipeline:()=>Y,task:()=>U});function v(e,n){if(typeof n=="string")return{node:e.resolve(n),path:n};let o=W(e,n);if(!o)throw new Error("orchestration dep node must already be registered in the graph so explicit edges can be recorded; pass a string path or register the node first");return{node:n,path:o}}function W(e,n){let o=e.describe(),r=`::${q}::`;for(let t of Object.keys(o.nodes).sort())if(!t.includes(r))try{if(e.resolve(t)===n)return t}catch{}}function k(e,n,o,r){e.add(o,{name:n})}function y(e,n){return I("orchestration",e,n)}function H(e){let n=r=>{let t=r.trim();return t.length===0?0:Number(t)},o;return typeof e=="string"?o=n(e):e===null?o=0:o=Number(e),Number.isFinite(o)?Math.max(0,Math.trunc(o)):1}function L(e,n){return new P(e,n)}function U(e,n,o,r){let i=(r?.deps??[]).map(a=>v(e,a)),{deps:s,...u}=r??{},h=(a,c,f)=>{let m=a.map((T,b)=>T!=null&&T.length>0?T.at(-1):f.prevData[b]);c.emit(o(m,f))},d=G(i.map(a=>a.node),h,{...u,name:n,describeKind:"derived",meta:y("task",r?.meta)});return k(e,n,d,i.flatMap(a=>a.path?[a.path]:[])),d}function V(e,n,o,r,t){let i=v(e,o),s=E([i.node],([u])=>({branch:r(u)?"then":"else",value:u}),{...t,name:n,meta:y("branch",t?.meta)});return k(e,n,s,i.path?[i.path]:[]),s}function z(e,n,o,r,t){let i=v(e,o),s=v(e,r),u=t?.isApproved??(d=>!!d),h=G([i.node,s.node],(d,a,c)=>{let f=d[0],m=d[1],T=m!=null&&m.length>0?m.at(-1):c.prevData[1];if(T===void 0||!u(T)){a.down([[D]]);return}if(f==null||f.length===0){m!=null&&m.length>0&&c.prevData[0]!==void 0?a.emit(c.prevData[0]):a.down([[D]]);return}for(let b of f)a.emit(b)},{...t,name:n,describeKind:"derived",meta:y("approval",t?.meta)});return k(e,n,h,[i.path,s.path].filter(d=>typeof d=="string")),h}function J(e,n,o,r){let t=r?.maxPending??1/0;if(t<1&&t!==1/0)throw new RangeError("gate: maxPending must be >= 1");let i=r?.startOpen??!1,s=v(e,o),u=j([],{name:"pending",equals:()=>!1}),h=j(i,{name:"isOpen"}),d=E([u],([p])=>p.length,{name:"count"}),a=j(null,{name:"lastRejected",equals:()=>!1}),c=[],f=!1,m=i,T=h.subscribe(p=>{for(let l of p)l[0]===_&&(m=l[1])});function b(){u.emit([...c])}function K(p){c.push(p),c.length>t&&c.shift(),b()}function R(p){let l=c.splice(0,p);return b(),l}function O(p){if(f)throw new Error(`gate: ${p}() called after gate was torn down`)}let S=G([s.node],(p,l,w)=>{let g=w.terminalDeps[0];if(g!==void 0){f=!0,c=[],b(),l.down(g===!0?[[A]]:[[M,g]]);return}let N=p[0];if(N==null||N.length===0){l.down([[D]]);return}for(let F of N)m?l.emit(F):(K(F),l.down([[D]]))},{name:n,describeKind:"derived",meta:y("gate",r?.meta)}),B={node:S,pending:u,count:d,isOpen:h,lastRejected:a,approve(p=1){O("approve");let l=R(p);for(let w of l){if(f)break;S.emit(w)}},reject(p=1){O("reject");let l=[...c],w=Math.min(p,l.length);if(w===0){R(p);return}C(()=>{for(let g=0;g<w;g++)a.emit(l[g]);R(p)})},modify(p,l=1){O("modify");let w=[...c],g=R(l);for(let N=0;N<g.length&&!f;N++)S.emit(p(g[N],N,w))},open(){O("open"),C(()=>{h.emit(!0);let p=R(c.length);for(let l of p){if(f)break;S.emit(l)}})},close(){O("close"),h.emit(!1)}};e.addDisposer(d.subscribe(()=>{})),e.addDisposer(T),k(e,n,S,s.path?[s.path]:[]);let x=new P(`${n}_state`);return x.add(u,{name:"pending"}),x.add(h,{name:"isOpen"}),x.add(d,{name:"count"}),x.add(a,{name:"lastRejected"}),e.mount(`${n}_state`,x),e.addDisposer(a.subscribe(()=>{})),B}function Q(e,n,o,r){let t=o.map(s=>v(e,s)),i=E(t.map(s=>s.node),s=>s,{...r,name:n,meta:y("join",r?.meta)});return k(e,n,i,t.flatMap(s=>s.path?[s.path]:[])),i}function X(e,n,o,r,t){let i=v(e,o),s=t?.iterations,u=typeof s=="number"||s===void 0?void 0:v(e,s),h=typeof s=="number"?s:void 0,d=G(u?[i.node,u.node]:[i.node],(a,c,f)=>{let m=a[0],T=m!=null&&m.length>0?m.at(-1):f.prevData[0],b=u?a[1]:void 0,K=h??(u?b!=null&&b.length>0?b.at(-1):f.prevData[1]:1),R=H(K);for(let O=0;O<R;O+=1)T=r(T,O,c);c.emit(T)},{...t,name:n,describeKind:"derived",meta:y("loop",t?.meta)});return k(e,n,d,[i.path,u?.path].filter(a=>typeof a=="string")),d}function Y(e,n,o,r){let t=o instanceof P?o:L(n,r);return typeof o=="function"&&o(t),e.mount(n,t),t}function Z(e,n,o,r){let t=G([],()=>{},{...r,name:n,initial:o,describeKind:"producer",meta:y("sensor",r?.meta)});return k(e,n,t,[]),{node:t,push(i){t.emit(i)},error(i){t.down([[M,i]])},complete(){t.down([[A]])}}}function ee(e,n,o,r,t){let i=v(e,o),s=!1,u=G([],(h,d)=>{let a=i.node.subscribe(c=>{for(let f of c){if(s)return;if(f[0]===M)try{d.emit(r(f[1],d))}catch(m){s=!0,d.down([[M,m]])}else d.down([f]),f[0]===A&&(s=!0)}});return()=>a()},{...t,name:n,describeKind:"derived",completeWhenDepsComplete:!1,errorWhenDepsError:!1,meta:y("onFailure",t?.meta)});return k(e,n,u,i.path?[i.path]:[]),u}export{L as a,U as b,V as c,z as d,J as e,Q as f,X as g,Y as h,Z as i,ee as j,ne as k};
|