@callbag-recharge/callbag-recharge 0.3.0 → 0.4.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/adapters/http.cjs +0 -1
- package/dist/adapters/http.js +1 -2
- package/dist/adapters/index.cjs +0 -1
- package/dist/adapters/index.js +1 -2
- package/dist/adapters/llm.cjs +0 -1
- package/dist/adapters/llm.d.cts +1 -1
- package/dist/adapters/llm.d.ts +1 -1
- package/dist/adapters/llm.js +1 -2
- package/dist/adapters/mcp.cjs +0 -1
- package/dist/adapters/mcp.js +1 -2
- package/dist/adapters/sse.cjs +0 -1
- package/dist/adapters/sse.js +1 -2
- package/dist/adapters/webhook.cjs +0 -1
- package/dist/adapters/webhook.js +1 -2
- package/dist/adapters/websocket.cjs +0 -1
- package/dist/adapters/websocket.js +1 -2
- package/dist/chunk-22CAZLO3.js +1 -0
- package/dist/{chunk-AQRT3R2D.js → chunk-246NHV2C.js} +1 -2
- package/dist/{chunk-46YIQYHW.js → chunk-2DSZBUDC.js} +1 -2
- package/dist/{chunk-762GKUF3.js → chunk-2IPYZVLQ.js} +1 -2
- package/dist/chunk-2OD7DSKQ.js +1 -0
- package/dist/{chunk-GGQ6VZXI.js → chunk-2SUJFXLJ.js} +1 -2
- package/dist/{chunk-G4N2ECBB.js → chunk-4QMLJ5NF.js} +1 -2
- package/dist/{chunk-Y2CUDZYL.js → chunk-57POOBOS.js} +1 -2
- package/dist/chunk-6HF3HFK2.js +1 -0
- package/dist/chunk-6QYIOJBL.js +1 -0
- package/dist/chunk-7OBLM7WJ.js +1 -0
- package/dist/{chunk-NROYOJLV.js → chunk-AHPGP6IY.js} +1 -2
- package/dist/chunk-AWNDBSWN.js +1 -0
- package/dist/chunk-BXJY72NZ.js +1 -0
- package/dist/{chunk-VEUKIPOG.js → chunk-CWP55MPE.js} +0 -1
- package/dist/{chunk-VGEPGH2I.js → chunk-CZ7UWY4Z.js} +1 -2
- package/dist/{chunk-7PI7NYIQ.js → chunk-DKV5ERLQ.js} +1 -2
- package/dist/{chunk-T3CQQXAA.js → chunk-E4AFG53N.js} +1 -2
- package/dist/{chunk-7WDW6RKD.js → chunk-EJWPOQ3M.js} +1 -2
- package/dist/{chunk-6JWNWPML.js → chunk-GIXPYYX7.js} +1 -2
- package/dist/{chunk-QBXQ24GU.js → chunk-H2YDDQLL.js} +1 -2
- package/dist/{chunk-EUOO45WG.js → chunk-HGQF7SDJ.js} +1 -2
- package/dist/{chunk-PYRVYHZG.js → chunk-HK7DRUNM.js} +0 -1
- package/dist/{chunk-WXORGCCQ.js → chunk-HMTVETW3.js} +1 -2
- package/dist/{chunk-VAUKVVR7.js → chunk-HP3Y5P4H.js} +1 -2
- package/dist/{chunk-J5J6R6ZF.js → chunk-HZW5L62J.js} +1 -2
- package/dist/{chunk-2YXXFGBV.js → chunk-I7AUKTXE.js} +0 -1
- package/dist/{chunk-VDADHGCV.js → chunk-IVMTQFPB.js} +1 -2
- package/dist/{chunk-3WX3YGUQ.js → chunk-J3QF6BR6.js} +1 -2
- package/dist/{chunk-DOPCSXSB.js → chunk-J7QHPLDC.js} +1 -2
- package/dist/{chunk-XFHK2LZX.js → chunk-JESACHQB.js} +1 -2
- package/dist/{chunk-T42CTYKI.js → chunk-JR7AWDIG.js} +1 -2
- package/dist/{chunk-HKDBOVSA.js → chunk-JXOY2IAO.js} +0 -1
- package/dist/{chunk-OI57LAV5.js → chunk-JZEPFPK5.js} +1 -2
- package/dist/{chunk-ADMHHBQU.js → chunk-K3CTYYBO.js} +1 -2
- package/dist/{chunk-BU6SQ77Q.js → chunk-KNWJHTOJ.js} +1 -2
- package/dist/{chunk-6MZXVCKQ.js → chunk-LDYBNZRJ.js} +1 -2
- package/dist/chunk-LEK3WMVM.js +1 -0
- package/dist/{chunk-DXMXVWT3.js → chunk-LLLQTXBH.js} +1 -2
- package/dist/{chunk-RHJPQKAU.js → chunk-LMOUWL76.js} +1 -2
- package/dist/{chunk-D2KH2EWY.js → chunk-M76W372U.js} +1 -2
- package/dist/{chunk-WXT2CH7W.js → chunk-MBX4JFR2.js} +1 -2
- package/dist/{chunk-Y6GMRPY3.js → chunk-N67ZXLEF.js} +1 -2
- package/dist/{chunk-TB4W3IN7.js → chunk-P5MXN4AF.js} +1 -2
- package/dist/{chunk-Y3OGNYTG.js → chunk-PHO4NMDP.js} +1 -2
- package/dist/{chunk-R5D6HGPS.js → chunk-POETNQZ3.js} +1 -2
- package/dist/{chunk-SLBFZGHA.js → chunk-Q6BCSEZ2.js} +1 -2
- package/dist/{chunk-5M7WI7KF.js → chunk-QVJVAMYW.js} +1 -2
- package/dist/{chunk-4AMLHZMF.js → chunk-R7KF4ZVM.js} +1 -2
- package/dist/chunk-SAJ7SY4Z.js +1 -0
- package/dist/{chunk-3SILFDVU.js → chunk-SMRLX65A.js} +1 -2
- package/dist/{chunk-KDJ4ZPKT.js → chunk-T2XJDIOR.js} +1 -2
- package/dist/{chunk-YGMRQLIK.js → chunk-T54CUR7D.js} +1 -2
- package/dist/{chunk-2ZXJVHWM.js → chunk-TATS3PIH.js} +1 -2
- package/dist/{chunk-CET3WKKN.js → chunk-TTLPYOAV.js} +1 -2
- package/dist/{chunk-YCZCHJTO.js → chunk-UGLHK25A.js} +1 -2
- package/dist/chunk-UMEIL4ZR.js +1 -0
- package/dist/{chunk-UJ4U6S2M.js → chunk-UNEFE3LZ.js} +1 -2
- package/dist/{chunk-PJSFHM5R.js → chunk-UVLBN37H.js} +1 -2
- package/dist/{chunk-GRRMPXQS.js → chunk-V347V3CS.js} +1 -2
- package/dist/{chunk-LLXZ2FXK.js → chunk-V7QCYGUL.js} +1 -2
- package/dist/{chunk-ZVDNZ7SP.js → chunk-VK3KSIWC.js} +1 -2
- package/dist/{chunk-Q32PU4Z5.js → chunk-WJ324SEE.js} +1 -2
- package/dist/{chunk-ZD4WZ6DJ.js → chunk-X6RLUCXO.js} +1 -2
- package/dist/chunk-XFA2D6KP.js +0 -0
- package/dist/{chunk-WUCCQYCL.js → chunk-XN3EB2HD.js} +1 -2
- package/dist/{chunk-O7HXDEKM.js → chunk-XZV5OCPF.js} +1 -2
- package/dist/{chunk-XLEMMZJC.js → chunk-Y2KUFRFK.js} +1 -2
- package/dist/{chunk-MR6IZER5.js → chunk-YJXCVG35.js} +1 -2
- package/dist/{chunk-OFXJBV4P.js → chunk-YN4VWXAF.js} +1 -2
- package/dist/{chunk-MUSMOBMX.js → chunk-YOAFIOPU.js} +1 -2
- package/dist/{chunk-MSLFTTYC.js → chunk-ZNFMGI2B.js} +1 -2
- package/dist/compat/jotai/index.cjs +0 -1
- package/dist/compat/jotai/index.js +1 -2
- package/dist/compat/nanostores/index.cjs +0 -1
- package/dist/compat/nanostores/index.js +1 -2
- package/dist/compat/signals/index.cjs +0 -1
- package/dist/compat/signals/index.js +1 -2
- package/dist/compat/zustand/index.cjs +0 -1
- package/dist/compat/zustand/index.js +1 -2
- package/dist/data/index.cjs +0 -1
- package/dist/data/index.js +1 -2
- package/dist/extra/buffer.cjs +0 -1
- package/dist/extra/buffer.js +1 -2
- package/dist/extra/bufferTime.cjs +0 -1
- package/dist/extra/bufferTime.js +1 -2
- package/dist/extra/combine.cjs +0 -1
- package/dist/extra/combine.js +1 -2
- package/dist/extra/concat.cjs +0 -1
- package/dist/extra/concat.js +1 -2
- package/dist/extra/concatMap.cjs +0 -1
- package/dist/extra/concatMap.js +1 -2
- package/dist/extra/debounce.cjs +0 -1
- package/dist/extra/debounce.js +1 -2
- package/dist/extra/delay.cjs +0 -1
- package/dist/extra/delay.js +1 -2
- package/dist/extra/distinctUntilChanged.cjs +0 -1
- package/dist/extra/distinctUntilChanged.js +1 -2
- package/dist/extra/elementAt.cjs +0 -1
- package/dist/extra/elementAt.js +1 -2
- package/dist/extra/empty.cjs +0 -1
- package/dist/extra/empty.js +1 -2
- package/dist/extra/exhaustMap.cjs +0 -1
- package/dist/extra/exhaustMap.js +1 -2
- package/dist/extra/filter.cjs +0 -1
- package/dist/extra/filter.js +1 -2
- package/dist/extra/find.cjs +0 -1
- package/dist/extra/find.js +1 -2
- package/dist/extra/first.cjs +0 -1
- package/dist/extra/first.js +1 -2
- package/dist/extra/flat.cjs +0 -1
- package/dist/extra/flat.js +1 -2
- package/dist/extra/forEach.cjs +0 -1
- package/dist/extra/forEach.js +1 -2
- package/dist/extra/fromEvent.cjs +0 -1
- package/dist/extra/fromEvent.js +1 -2
- package/dist/extra/fromIter.cjs +0 -1
- package/dist/extra/fromIter.js +1 -2
- package/dist/extra/fromObs.cjs +0 -1
- package/dist/extra/fromObs.js +1 -2
- package/dist/extra/fromPromise.cjs +0 -1
- package/dist/extra/fromPromise.js +1 -2
- package/dist/extra/index.cjs +0 -1
- package/dist/extra/index.js +1 -2
- package/dist/extra/interval.cjs +0 -1
- package/dist/extra/interval.js +1 -2
- package/dist/extra/last.cjs +0 -1
- package/dist/extra/last.js +1 -2
- package/dist/extra/map.cjs +0 -1
- package/dist/extra/map.js +1 -2
- package/dist/extra/merge.cjs +0 -1
- package/dist/extra/merge.js +1 -2
- package/dist/extra/never.cjs +0 -1
- package/dist/extra/never.js +1 -2
- package/dist/extra/of.cjs +0 -1
- package/dist/extra/of.js +1 -2
- package/dist/extra/pairwise.cjs +0 -1
- package/dist/extra/pairwise.js +1 -2
- package/dist/extra/partition.cjs +0 -1
- package/dist/extra/partition.js +1 -2
- package/dist/extra/pipeRaw.cjs +0 -1
- package/dist/extra/pipeRaw.js +1 -2
- package/dist/extra/remember.cjs +0 -1
- package/dist/extra/remember.js +1 -2
- package/dist/extra/repeat.cjs +0 -1
- package/dist/extra/repeat.js +1 -2
- package/dist/extra/rescue.cjs +0 -1
- package/dist/extra/rescue.js +1 -2
- package/dist/extra/retry.cjs +0 -1
- package/dist/extra/retry.js +1 -2
- package/dist/extra/sample.cjs +0 -1
- package/dist/extra/sample.js +1 -2
- package/dist/extra/scan.cjs +0 -1
- package/dist/extra/scan.js +1 -2
- package/dist/extra/share.cjs +0 -1
- package/dist/extra/share.js +1 -2
- package/dist/extra/skip.cjs +0 -1
- package/dist/extra/skip.js +1 -2
- package/dist/extra/startWith.cjs +0 -1
- package/dist/extra/startWith.js +1 -2
- package/dist/extra/streamParse.cjs +0 -1
- package/dist/extra/streamParse.js +1 -2
- package/dist/extra/subject.cjs +0 -1
- package/dist/extra/subject.js +1 -2
- package/dist/extra/subscribe.cjs +0 -1
- package/dist/extra/subscribe.js +1 -2
- package/dist/extra/switchMap.cjs +0 -1
- package/dist/extra/switchMap.js +1 -2
- package/dist/extra/take.cjs +0 -1
- package/dist/extra/take.js +1 -2
- package/dist/extra/takeUntil.cjs +0 -1
- package/dist/extra/takeUntil.js +1 -2
- package/dist/extra/takeWhile.cjs +0 -1
- package/dist/extra/takeWhile.js +1 -2
- package/dist/extra/tap.cjs +0 -1
- package/dist/extra/tap.js +1 -2
- package/dist/extra/throttle.cjs +0 -1
- package/dist/extra/throttle.js +1 -2
- package/dist/extra/throwError.cjs +0 -1
- package/dist/extra/throwError.js +1 -2
- package/dist/extra/timeout.cjs +0 -1
- package/dist/extra/timeout.js +1 -2
- package/dist/index.cjs +0 -1
- package/dist/index.js +1 -2
- package/dist/memory/index.cjs +0 -1
- package/dist/memory/index.js +1 -2
- package/dist/orchestrate/index.cjs +2 -3
- package/dist/orchestrate/index.d.cts +6 -3
- package/dist/orchestrate/index.d.ts +6 -3
- package/dist/orchestrate/index.js +1 -2
- package/dist/patterns/agentLoop/index.cjs +0 -1
- package/dist/patterns/agentLoop/index.js +1 -2
- package/dist/patterns/chatStream/index.cjs +0 -1
- package/dist/patterns/chatStream/index.js +1 -2
- package/dist/patterns/createStore/index.cjs +0 -1
- package/dist/patterns/createStore/index.js +1 -2
- package/dist/patterns/formField/index.cjs +0 -1
- package/dist/patterns/formField/index.js +1 -2
- package/dist/patterns/hybridRoute/index.cjs +0 -1
- package/dist/patterns/hybridRoute/index.js +1 -2
- package/dist/patterns/memoryStore/index.cjs +0 -1
- package/dist/patterns/memoryStore/index.js +1 -2
- package/dist/patterns/pagination/index.cjs +0 -1
- package/dist/patterns/pagination/index.js +1 -2
- package/dist/patterns/rateLimiter/index.cjs +0 -1
- package/dist/patterns/rateLimiter/index.js +1 -2
- package/dist/patterns/toolCallState/index.cjs +0 -1
- package/dist/patterns/toolCallState/index.js +1 -2
- package/dist/patterns/undoRedo/index.cjs +0 -1
- package/dist/patterns/undoRedo/index.js +1 -2
- package/dist/utils/index.cjs +4 -5
- package/dist/utils/index.d.cts +175 -2
- package/dist/utils/index.d.ts +175 -2
- package/dist/utils/index.js +1 -2
- package/package.json +1 -1
- package/dist/adapters/http.cjs.map +0 -1
- package/dist/adapters/http.js.map +0 -1
- package/dist/adapters/index.cjs.map +0 -1
- package/dist/adapters/index.js.map +0 -1
- package/dist/adapters/llm.cjs.map +0 -1
- package/dist/adapters/llm.js.map +0 -1
- package/dist/adapters/mcp.cjs.map +0 -1
- package/dist/adapters/mcp.js.map +0 -1
- package/dist/adapters/sse.cjs.map +0 -1
- package/dist/adapters/sse.js.map +0 -1
- package/dist/adapters/webhook.cjs.map +0 -1
- package/dist/adapters/webhook.js.map +0 -1
- package/dist/adapters/websocket.cjs.map +0 -1
- package/dist/adapters/websocket.js.map +0 -1
- package/dist/chunk-2YXXFGBV.js.map +0 -1
- package/dist/chunk-2ZXJVHWM.js.map +0 -1
- package/dist/chunk-3GTX37MO.js +0 -2
- package/dist/chunk-3GTX37MO.js.map +0 -1
- package/dist/chunk-3SILFDVU.js.map +0 -1
- package/dist/chunk-3WX3YGUQ.js.map +0 -1
- package/dist/chunk-46YIQYHW.js.map +0 -1
- package/dist/chunk-4AMLHZMF.js.map +0 -1
- package/dist/chunk-5M7WI7KF.js.map +0 -1
- package/dist/chunk-5VH2UXGW.js +0 -2
- package/dist/chunk-5VH2UXGW.js.map +0 -1
- package/dist/chunk-6BPWSZW2.js +0 -2
- package/dist/chunk-6BPWSZW2.js.map +0 -1
- package/dist/chunk-6H2GF6AW.js +0 -2
- package/dist/chunk-6H2GF6AW.js.map +0 -1
- package/dist/chunk-6JWNWPML.js.map +0 -1
- package/dist/chunk-6MZXVCKQ.js.map +0 -1
- package/dist/chunk-762GKUF3.js.map +0 -1
- package/dist/chunk-7PI7NYIQ.js.map +0 -1
- package/dist/chunk-7WDW6RKD.js.map +0 -1
- package/dist/chunk-ADMHHBQU.js.map +0 -1
- package/dist/chunk-AQRT3R2D.js.map +0 -1
- package/dist/chunk-AWRPUOJD.js +0 -2
- package/dist/chunk-AWRPUOJD.js.map +0 -1
- package/dist/chunk-AZL4CFGF.js +0 -2
- package/dist/chunk-AZL4CFGF.js.map +0 -1
- package/dist/chunk-BU6SQ77Q.js.map +0 -1
- package/dist/chunk-CET3WKKN.js.map +0 -1
- package/dist/chunk-D2KH2EWY.js.map +0 -1
- package/dist/chunk-DOPCSXSB.js.map +0 -1
- package/dist/chunk-DXMXVWT3.js.map +0 -1
- package/dist/chunk-E63D25PW.js +0 -1
- package/dist/chunk-E63D25PW.js.map +0 -1
- package/dist/chunk-EUOO45WG.js.map +0 -1
- package/dist/chunk-G4N2ECBB.js.map +0 -1
- package/dist/chunk-GGQ6VZXI.js.map +0 -1
- package/dist/chunk-GRRMPXQS.js.map +0 -1
- package/dist/chunk-HKDBOVSA.js.map +0 -1
- package/dist/chunk-J5J6R6ZF.js.map +0 -1
- package/dist/chunk-KDJ4ZPKT.js.map +0 -1
- package/dist/chunk-LLXZ2FXK.js.map +0 -1
- package/dist/chunk-MR6IZER5.js.map +0 -1
- package/dist/chunk-MSLFTTYC.js.map +0 -1
- package/dist/chunk-MUSMOBMX.js.map +0 -1
- package/dist/chunk-NROYOJLV.js.map +0 -1
- package/dist/chunk-O7HXDEKM.js.map +0 -1
- package/dist/chunk-OFXJBV4P.js.map +0 -1
- package/dist/chunk-OI57LAV5.js.map +0 -1
- package/dist/chunk-PJSFHM5R.js.map +0 -1
- package/dist/chunk-PYRVYHZG.js.map +0 -1
- package/dist/chunk-Q32PU4Z5.js.map +0 -1
- package/dist/chunk-QBXQ24GU.js.map +0 -1
- package/dist/chunk-R5D6HGPS.js.map +0 -1
- package/dist/chunk-RHJPQKAU.js.map +0 -1
- package/dist/chunk-SLBFZGHA.js.map +0 -1
- package/dist/chunk-T3CQQXAA.js.map +0 -1
- package/dist/chunk-T42CTYKI.js.map +0 -1
- package/dist/chunk-TB4W3IN7.js.map +0 -1
- package/dist/chunk-TPE7J5UW.js +0 -2
- package/dist/chunk-TPE7J5UW.js.map +0 -1
- package/dist/chunk-UJ4U6S2M.js.map +0 -1
- package/dist/chunk-VAUKVVR7.js.map +0 -1
- package/dist/chunk-VDADHGCV.js.map +0 -1
- package/dist/chunk-VETE6O4B.js +0 -2
- package/dist/chunk-VETE6O4B.js.map +0 -1
- package/dist/chunk-VEUKIPOG.js.map +0 -1
- package/dist/chunk-VGEPGH2I.js.map +0 -1
- package/dist/chunk-WUCCQYCL.js.map +0 -1
- package/dist/chunk-WXORGCCQ.js.map +0 -1
- package/dist/chunk-WXT2CH7W.js.map +0 -1
- package/dist/chunk-XFHK2LZX.js.map +0 -1
- package/dist/chunk-XLEMMZJC.js.map +0 -1
- package/dist/chunk-Y2CUDZYL.js.map +0 -1
- package/dist/chunk-Y3OGNYTG.js.map +0 -1
- package/dist/chunk-Y6GMRPY3.js.map +0 -1
- package/dist/chunk-YCZCHJTO.js.map +0 -1
- package/dist/chunk-YGMRQLIK.js.map +0 -1
- package/dist/chunk-YYHBD43N.js +0 -2
- package/dist/chunk-YYHBD43N.js.map +0 -1
- package/dist/chunk-ZASSFKJV.js +0 -2
- package/dist/chunk-ZASSFKJV.js.map +0 -1
- package/dist/chunk-ZD4WZ6DJ.js.map +0 -1
- package/dist/chunk-ZVDNZ7SP.js.map +0 -1
- package/dist/compat/jotai/index.cjs.map +0 -1
- package/dist/compat/jotai/index.js.map +0 -1
- package/dist/compat/nanostores/index.cjs.map +0 -1
- package/dist/compat/nanostores/index.js.map +0 -1
- package/dist/compat/signals/index.cjs.map +0 -1
- package/dist/compat/signals/index.js.map +0 -1
- package/dist/compat/zustand/index.cjs.map +0 -1
- package/dist/compat/zustand/index.js.map +0 -1
- package/dist/data/index.cjs.map +0 -1
- package/dist/data/index.js.map +0 -1
- package/dist/extra/buffer.cjs.map +0 -1
- package/dist/extra/buffer.js.map +0 -1
- package/dist/extra/bufferTime.cjs.map +0 -1
- package/dist/extra/bufferTime.js.map +0 -1
- package/dist/extra/combine.cjs.map +0 -1
- package/dist/extra/combine.js.map +0 -1
- package/dist/extra/concat.cjs.map +0 -1
- package/dist/extra/concat.js.map +0 -1
- package/dist/extra/concatMap.cjs.map +0 -1
- package/dist/extra/concatMap.js.map +0 -1
- package/dist/extra/debounce.cjs.map +0 -1
- package/dist/extra/debounce.js.map +0 -1
- package/dist/extra/delay.cjs.map +0 -1
- package/dist/extra/delay.js.map +0 -1
- package/dist/extra/distinctUntilChanged.cjs.map +0 -1
- package/dist/extra/distinctUntilChanged.js.map +0 -1
- package/dist/extra/elementAt.cjs.map +0 -1
- package/dist/extra/elementAt.js.map +0 -1
- package/dist/extra/empty.cjs.map +0 -1
- package/dist/extra/empty.js.map +0 -1
- package/dist/extra/exhaustMap.cjs.map +0 -1
- package/dist/extra/exhaustMap.js.map +0 -1
- package/dist/extra/filter.cjs.map +0 -1
- package/dist/extra/filter.js.map +0 -1
- package/dist/extra/find.cjs.map +0 -1
- package/dist/extra/find.js.map +0 -1
- package/dist/extra/first.cjs.map +0 -1
- package/dist/extra/first.js.map +0 -1
- package/dist/extra/flat.cjs.map +0 -1
- package/dist/extra/flat.js.map +0 -1
- package/dist/extra/forEach.cjs.map +0 -1
- package/dist/extra/forEach.js.map +0 -1
- package/dist/extra/fromEvent.cjs.map +0 -1
- package/dist/extra/fromEvent.js.map +0 -1
- package/dist/extra/fromIter.cjs.map +0 -1
- package/dist/extra/fromIter.js.map +0 -1
- package/dist/extra/fromObs.cjs.map +0 -1
- package/dist/extra/fromObs.js.map +0 -1
- package/dist/extra/fromPromise.cjs.map +0 -1
- package/dist/extra/fromPromise.js.map +0 -1
- package/dist/extra/index.cjs.map +0 -1
- package/dist/extra/index.js.map +0 -1
- package/dist/extra/interval.cjs.map +0 -1
- package/dist/extra/interval.js.map +0 -1
- package/dist/extra/last.cjs.map +0 -1
- package/dist/extra/last.js.map +0 -1
- package/dist/extra/map.cjs.map +0 -1
- package/dist/extra/map.js.map +0 -1
- package/dist/extra/merge.cjs.map +0 -1
- package/dist/extra/merge.js.map +0 -1
- package/dist/extra/never.cjs.map +0 -1
- package/dist/extra/never.js.map +0 -1
- package/dist/extra/of.cjs.map +0 -1
- package/dist/extra/of.js.map +0 -1
- package/dist/extra/pairwise.cjs.map +0 -1
- package/dist/extra/pairwise.js.map +0 -1
- package/dist/extra/partition.cjs.map +0 -1
- package/dist/extra/partition.js.map +0 -1
- package/dist/extra/pipeRaw.cjs.map +0 -1
- package/dist/extra/pipeRaw.js.map +0 -1
- package/dist/extra/remember.cjs.map +0 -1
- package/dist/extra/remember.js.map +0 -1
- package/dist/extra/repeat.cjs.map +0 -1
- package/dist/extra/repeat.js.map +0 -1
- package/dist/extra/rescue.cjs.map +0 -1
- package/dist/extra/rescue.js.map +0 -1
- package/dist/extra/retry.cjs.map +0 -1
- package/dist/extra/retry.js.map +0 -1
- package/dist/extra/sample.cjs.map +0 -1
- package/dist/extra/sample.js.map +0 -1
- package/dist/extra/scan.cjs.map +0 -1
- package/dist/extra/scan.js.map +0 -1
- package/dist/extra/share.cjs.map +0 -1
- package/dist/extra/share.js.map +0 -1
- package/dist/extra/skip.cjs.map +0 -1
- package/dist/extra/skip.js.map +0 -1
- package/dist/extra/startWith.cjs.map +0 -1
- package/dist/extra/startWith.js.map +0 -1
- package/dist/extra/streamParse.cjs.map +0 -1
- package/dist/extra/streamParse.js.map +0 -1
- package/dist/extra/subject.cjs.map +0 -1
- package/dist/extra/subject.js.map +0 -1
- package/dist/extra/subscribe.cjs.map +0 -1
- package/dist/extra/subscribe.js.map +0 -1
- package/dist/extra/switchMap.cjs.map +0 -1
- package/dist/extra/switchMap.js.map +0 -1
- package/dist/extra/take.cjs.map +0 -1
- package/dist/extra/take.js.map +0 -1
- package/dist/extra/takeUntil.cjs.map +0 -1
- package/dist/extra/takeUntil.js.map +0 -1
- package/dist/extra/takeWhile.cjs.map +0 -1
- package/dist/extra/takeWhile.js.map +0 -1
- package/dist/extra/tap.cjs.map +0 -1
- package/dist/extra/tap.js.map +0 -1
- package/dist/extra/throttle.cjs.map +0 -1
- package/dist/extra/throttle.js.map +0 -1
- package/dist/extra/throwError.cjs.map +0 -1
- package/dist/extra/throwError.js.map +0 -1
- package/dist/extra/timeout.cjs.map +0 -1
- package/dist/extra/timeout.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/memory/index.cjs.map +0 -1
- package/dist/memory/index.js.map +0 -1
- package/dist/orchestrate/index.cjs.map +0 -1
- package/dist/orchestrate/index.js.map +0 -1
- package/dist/patterns/agentLoop/index.cjs.map +0 -1
- package/dist/patterns/agentLoop/index.js.map +0 -1
- package/dist/patterns/chatStream/index.cjs.map +0 -1
- package/dist/patterns/chatStream/index.js.map +0 -1
- package/dist/patterns/createStore/index.cjs.map +0 -1
- package/dist/patterns/createStore/index.js.map +0 -1
- package/dist/patterns/formField/index.cjs.map +0 -1
- package/dist/patterns/formField/index.js.map +0 -1
- package/dist/patterns/hybridRoute/index.cjs.map +0 -1
- package/dist/patterns/hybridRoute/index.js.map +0 -1
- package/dist/patterns/memoryStore/index.cjs.map +0 -1
- package/dist/patterns/memoryStore/index.js.map +0 -1
- package/dist/patterns/pagination/index.cjs.map +0 -1
- package/dist/patterns/pagination/index.js.map +0 -1
- package/dist/patterns/rateLimiter/index.cjs.map +0 -1
- package/dist/patterns/rateLimiter/index.js.map +0 -1
- package/dist/patterns/toolCallState/index.cjs.map +0 -1
- package/dist/patterns/toolCallState/index.js.map +0 -1
- package/dist/patterns/undoRedo/index.cjs.map +0 -1
- package/dist/patterns/undoRedo/index.js.map +0 -1
- package/dist/utils/index.cjs.map +0 -1
- package/dist/utils/index.js.map +0 -1
package/dist/adapters/http.cjs
CHANGED
|
@@ -2,4 +2,3 @@
|
|
|
2
2
|
`)}static _observe(e,i,n){let s=null,r=i??t.getName(e),o={values:[],signals:[],events:[],ended:!1,endError:void 0,dirtyCount:0,resolvedCount:0,name:r,dispose:()=>s?.(h)};return e.source(x,(a,u)=>{if(a===x){s=u;return}a===m?(o.values.push(u),o.events.push({type:"data",data:u}),n&&n(`[${r}] DATA:`,u)):a===y?(o.signals.push(u),o.events.push({type:"signal",data:u}),u===D?o.dirtyCount++:u===M&&o.resolvedCount++,n&&n(`[${r}] STATE:`,u)):a===h&&(o.ended=!0,o.endError=u,o.events.push({type:"end",data:u}),n&&n(`[${r}] END`,u!==void 0?u:""),s=null)}),o}static observe(e){return t._observe(e)}static tap(e,i){let n=i??`tap(${t.getName(e)??"anon"})`,s={get:()=>e.get(),source:e.source};return t.register(s,{name:n,kind:"tap"}),t.registerEdge(e,s),s}static spy(e,i){let n=i?.name??t.getName(e)??"spy",s=i?.log??console.log;return t._observe(e,n,s)}static snapshot(){let e=t.graph(),i=t.getEdges(),n=new Map;for(let o of t._stores){let a=o.deref();if(!a)continue;let u=t._annotations.get(a);u!==void 0&&n.set(t._resolveKey(a),u)}let s=[];for(let[o,a]of e){let u={name:o,kind:a.kind,value:a.value,status:a.status},f=n.get(o);f!==void 0&&(u.annotation=f),s.push(u)}let r=[];for(let[o,a]of i)for(let u of a)r.push({from:o,to:u});return{nodes:s,edges:r,trace:t.traceLog()}}static toMermaid(e){let i=e?.direction??"TD",n=t.snapshot(),s=[`graph ${i}`],r={SETTLED:":::settled",DIRTY:":::dirty",ERRORED:":::errored",COMPLETED:":::completed"},o=new Map;function a(l){let c=l.replace(/[^a-zA-Z0-9_]/g,"_"),d=o.get(c);return d===void 0?(o.set(c,1),c):(o.set(c,d+1),`${c}__${d}`)}let u=new Map;function f(l){let c=JSON.stringify(l);return c&&c.length>30?`${c.slice(0,27)}...`:c??"undefined"}for(let l of n.nodes){let c=a(l.name);u.set(l.name,c);let d=`${l.name} (${l.kind}) = ${f(l.value)}`,p=r[l.status??""]??"";s.push(` ${c}["${d}"]${p}`)}for(let l of n.edges){let c=u.get(l.from)??a(l.from),d=u.get(l.to)??a(l.to);s.push(` ${c} --> ${d}`)}return s.push(""),s.push(" classDef settled fill:#d4edda,stroke:#28a745"),s.push(" classDef dirty fill:#fff3cd,stroke:#ffc107"),s.push(" classDef errored fill:#f8d7da,stroke:#dc3545"),s.push(" classDef completed fill:#cce5ff,stroke:#007bff"),s.join(`
|
|
3
3
|
`)}static toD2(e){let i=e?.direction??"down",n=t.snapshot(),s=[`direction: ${i}`,""],r={state:"rectangle",derived:"hexagon",effect:"oval",producer:"rectangle",operator:"parallelogram","pipeline-step":"rectangle","pipeline-status":"diamond",checkpoint:"cylinder"},o=new Map;function a(l){let c=l.replace(/[^a-zA-Z0-9_]/g,"_"),d=o.get(c);return d===void 0?(o.set(c,1),c):(o.set(c,d+1),`${c}__${d}`)}let u=new Map;function f(l){let c=JSON.stringify(l);return c&&c.length>30?`${c.slice(0,27)}...`:c??"undefined"}for(let l of n.nodes){let c=a(l.name);u.set(l.name,c);let d=r[l.kind]??"rectangle",p=`${l.name} (${l.kind}) = ${f(l.value)}`,E=l.status?` [${l.status}]`:"";s.push(`${c}: "${p}${E}" { shape: ${d} }`)}n.edges.length>0&&s.push("");for(let l of n.edges){let c=u.get(l.from)??a(l.from),d=u.get(l.to)??a(l.to);s.push(`${c} -> ${d}`)}return s.join(`
|
|
4
4
|
`)}static annotate(e,i){if(!t.enabled)return;t._annotations.set(e,i);let n={node:t._resolveKey(e),reason:i,timestamp:Date.now()},s=t.maxTraceEntries;s<=0||(t._traceLog.length<s?t._traceLog.push(n):(t._traceLog[t._traceHead]=n,t._traceFull=!0),t._traceHead=(t._traceHead+1)%s)}static getAnnotation(e){return t._annotations.get(e)}static traceLog(){return t._traceFull?[...t._traceLog.slice(t._traceHead),...t._traceLog.slice(0,t._traceHead)]:t._traceLog.slice(0,t._traceHead||t._traceLog.length)}static clearTrace(){t._traceLog=[],t._traceHead=0,t._traceFull=!1}static _reset(){t._names=new WeakMap,t._kinds=new WeakMap,t._keys=new WeakMap,t._stores=new Set,t._edges=new Map,t._usedKeys=new Set,t._nextId=0,t._explicitEnabled=null,t._cachedDefault=null,t._annotations=new WeakMap,t._traceLog=[],t._traceHead=0,t._traceFull=!1,t.maxTraceEntries=1e3}};var K=1,_=64,T=2,I=4,it=8,rt=16,R=32,v=1024,g=q,P=Z<<k,A=Q<<k,H=J<<k,yt=tt<<k,vt=et<<k,Et=X<<k,L=class{_value;_output=null;_flags;get _status(){return nt(this._flags)}_cleanup;_fn;_eqFn;_getterFn;_initial;_singleDepCount=0;constructor(e,i){this._value=i?.initial,this._fn=e,this._eqFn=i?.equals,this._getterFn=i?.getter,this._initial=i?.initial;let n=0;i?.autoDirty!==!1&&(n|=I),i?.resetOnTeardown&&(n|=it),i?.resubscribable&&(n|=rt),this._flags=n,this.source=this.source.bind(this),this.emit=this.emit.bind(this),i?._skipInspect||$.register(this,{kind:"producer",...i})}get(){return this._getterFn?this._getterFn(this._value):this._value}_dispatch(e,i){let n=this._output;if(n)if(this._flags&_)for(let s of n)s(e,i);else n(e,i)}emit(e){this._flags&T||this._eqFn&&this._value!==void 0&&this._eqFn(this._value,e)||(this._value=e,this._output&&(j()?this._flags&R||(this._flags|=R,this._flags&I&&(this._flags=this._flags&~g|P,this._dispatch(y,D)),F(()=>{this._flags&=~R,this._flags=this._flags&~g|A,this._dispatch(m,this._value)})):(this._flags&I&&!(this._flags&v)&&(this._flags=this._flags&~g|P,this._dispatch(y,D)),this._flags=this._flags&~g|A,this._dispatch(m,this._value))))}signal(e){this._flags&T||!this._output||(e===D?this._flags=this._flags&~g|P:e===M&&(this._flags=this._flags&~g|Et),this._dispatch(y,e))}complete(){if(this._flags&T)return;this._flags=(this._flags|T)&~g|yt;let e=this._output,i=this._flags&_;if(this._output=null,this._flags&=~(_|v),this._singleDepCount=0,this._stop(),e)if(i)for(let n of e)n(h);else e(h)}error(e){if(this._flags&T)return;this._flags=(this._flags|T)&~g|vt;let i=this._output,n=this._flags&_;if(this._output=null,this._flags&=~(_|v),this._singleDepCount=0,this._stop(),i)if(n)for(let s of i)s(h,e);else i(h,e)}_start(){if(this._flags&K||!this._fn)return;this._flags|=K;let e=this._fn({emit:this.emit,signal:i=>this.signal(i),complete:()=>this.complete(),error:i=>this.error(i)});this._cleanup=typeof e=="function"?e:void 0}_stop(){this._flags&K&&(this._flags&=~K,this._cleanup&&this._cleanup(),this._cleanup=void 0,this._flags&it&&(this._value=this._initial),this._flags&T||(this._flags=this._flags&~g|H))}source(e,i){if(e===x){let n=i;if(this._flags&T)if(this._flags&rt&&this._output===null)this._flags=this._flags&~(T|g)|H;else{n(x,r=>{}),n(h);return}if(this._output===null)this._output=n;else if(this._flags&_)this._output.add(n);else{let r=new Set;r.add(this._output),r.add(n),this._output=r,this._flags=(this._flags|_)&~v}let s=!1;n(x,(r,o)=>{if(r===m&&n(m,this._value),r===y&&o===B&&!s&&(s=!0,this._singleDepCount++,this._flags&_||(this._flags|=v)),r===h){if(s&&(s=!1,this._singleDepCount--),this._output===null)return;if(this._flags&_){let a=this._output;a.delete(n),a.size===1?(this._output=a.values().next().value,this._flags&=~_,this._singleDepCount>0&&(this._flags|=v)):a.size===0&&(this._output=null,this._flags&=~(_|v),this._singleDepCount=0,this._flags=this._flags&~g|H,this._stop())}else this._output===n&&(this._output=null,this._flags&=~v,this._singleDepCount=0,this._flags=this._flags&~g|H,this._stop())}}),st(()=>this._start())}}};function ot(t,e){return new L(t,e)}var U=class extends L{constructor(e,i){super(void 0,{initial:e,autoDirty:!0,equals:i?.equals??Object.is,_skipInspect:!0}),this.set=this.set.bind(this),$.register(this,{kind:"state",...i})}get(){return this._value}set(e){this._flags&T||this._value!==void 0&&this._eqFn(this._value,e)||(this._value=e,this._output&&(j()?this._flags&R||(this._flags|=R,this._flags&I&&(this._flags=this._flags&~g|P,this._dispatch(y,D)),F(()=>{this._flags&=~R,this._flags=this._flags&~g|A,this._dispatch(m,this._value)})):(this._flags&I&&!(this._flags&v)&&(this._flags=this._flags&~g|P,this._dispatch(y,D)),this._flags=this._flags&~g|A,this._dispatch(m,this._value))))}update(e){this.set(e(this._value))}};function G(t,e){return new U(t,e)}function bt(t,e){let i=e?.name??"http",n=e?.method??"GET",s=e?.headers,r=e?.body,o=e?.poll??0,a=e?.transform??(w=>w.json()),u=e?.timeout??3e4,f=G("idle",{name:`${i}:status`,equals:()=>!1}),l=G(0,{name:`${i}:fetchCount`}),c=null,d=null,p=null,E=null,S=!1;async function Y(){if(!S||!c)return;E=new AbortController;let w=[E.signal];e?.signal&&w.push(e.signal);let O=new AbortController;for(let b of w){if(b.aborted){O.abort(b.reason);break}b.addEventListener("abort",()=>O.abort(b.reason),{once:!0})}let C=setTimeout(()=>O.abort(new Error("Request timeout")),u);try{f.set("fetching");let b=r!==void 0?typeof r=="string"?r:JSON.stringify(r):void 0,N=await fetch(t,{method:n,headers:s,body:b,signal:O.signal});if(!S)return;if(!N.ok)throw new Error(`HTTP ${N.status}: ${N.statusText}`);let at=await a(N);if(!S)return;l.update(ut=>ut+1),f.set("success"),c(at)}catch(b){if(!S||b?.name==="AbortError")return;f.set("error"),d?.(b)}finally{clearTimeout(C),E=null}}function z(){!S||o<=0||(p=setTimeout(()=>{p=null,Y().then(()=>{S&&z()}).catch(()=>{})},o))}let V=null;return{store:ot(({emit:w,error:O})=>(c=w,d=O,S=!0,V=()=>{Y()},Y().then(()=>{S&&z()}),()=>{S=!1,c=null,d=null,V=null,E?.abort(),E=null,p!==null&&(clearTimeout(p),p=null);let C=f.get();C!=="error"&&C!=="success"&&f.set("idle")}),{name:i,kind:"http"}),status:f,fetchCount:l,refetch(){V?.()},stop(){S=!1,E?.abort(),E=null,p!==null&&(clearTimeout(p),p=null),f.get()==="fetching"&&f.set("idle")}}}0&&(module.exports={fromHTTP});
|
|
5
|
-
//# sourceMappingURL=http.cjs.map
|
package/dist/adapters/http.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
2
|
-
//# sourceMappingURL=http.js.map
|
|
1
|
+
import{a}from"../chunk-XN3EB2HD.js";import"../chunk-P5MXN4AF.js";import"../chunk-YN4VWXAF.js";import"../chunk-M76W372U.js";import"../chunk-CWP55MPE.js";import"../chunk-I7AUKTXE.js";export{a as fromHTTP};
|
package/dist/adapters/index.cjs
CHANGED
|
@@ -14,4 +14,3 @@ data: ${E}
|
|
|
14
14
|
`)}}catch{}if(s>0){let b=setInterval(()=>{try{T.write(`:ping
|
|
15
15
|
|
|
16
16
|
`)}catch{p(T)}},s);a.set(T,b)}d.on("close",()=>p(T)),m()}let g=null;async function v(){if(!t?.port)throw new Error("toSSE: port is required for listen()");if(g)throw new Error("toSSE: already listening. Call close() first.");let d=await import("http");return new Promise((T,_)=>{g=d.createServer(h),g.once("listening",()=>T()),g.once("error",y=>{g=null,_(y)}),g.listen(t.port,o)})}function S(){for(let d of c)try{d.end()}catch{}c.clear();for(let d of a.values())clearInterval(d);a.clear(),u.set(0),f?.(),f=null,g?.close(),g=null}return R.register(u,{kind:"sse"}),{connectionCount:u,handler:h,listen:v,close:S}}function we(e){let t=e?.path??"/",n=e?.parse??JSON.parse,r=e?.name??"webhook",o=e?.hostname??"0.0.0.0",l=e?.maxBodySize??1024*1024,i=k(0,{name:`${r}:count`}),s=null,u=B(({emit:p})=>(s=p,()=>{s=null}),{name:r,kind:"webhook"});R.register(u,{kind:"webhook"});let c=null;function a(p,h){let g=p.method?.toUpperCase(),S=(p.url??"/").split("?")[0];if(g!=="POST"||S!==t){h.writeHead(404,{"Content-Type":"application/json"}),h.end(JSON.stringify({error:"Not found"}));return}let d=[],T=0,_=!1;p.on("error",()=>{_=!0,h.headersSent||(h.writeHead(400,{"Content-Type":"application/json"}),h.end(JSON.stringify({error:"Request aborted"})))}),p.on("data",y=>{if(!_){if(T+=y.length,T>l){_=!0,h.writeHead(413,{"Content-Type":"application/json"}),h.end(JSON.stringify({error:"Payload too large"})),p.destroy?.();return}d.push(y)}}),p.on("end",()=>{if(!_)try{let y=Buffer.concat(d).toString("utf-8"),x=y.length>0?n(y):void 0;i.update(b=>b+1),s?.(x),h.writeHead(200,{"Content-Type":"application/json"}),h.end(JSON.stringify({ok:!0}))}catch(y){h.writeHead(400,{"Content-Type":"application/json"}),h.end(JSON.stringify({error:y?.message??"Parse error"}))}})}function f(){return e?.port?c?Promise.reject(new Error("fromWebhook: already listening. Call close() first.")):new Promise((p,h)=>{try{c=require("http").createServer(a),c.once("listening",()=>p()),c.once("error",v=>{c=null,h(v)}),c.listen(e.port,o)}catch(g){h(g)}}):Promise.reject(new Error("fromWebhook: port is required for listen()"))}function m(){c?.close(),c=null}return{store:u,requestCount:i,handler:a,listen:f,close:m}}function xe(e,t){let n=t?.name??"websocket",r=t?.parse??(S=>S),o=t?.reconnect??!1,l=t?.onParseError??"warn",i=k("connecting",{name:`${n}:status`,equals:()=>!1}),s=null,u=null,c=null,a=null,f=null,m=!1,p=[];function h(){for(;p.length>0&&s?.readyState===WebSocket.OPEN;)s.send(p.shift())}function g(){m=!1,i.set("connecting");try{s=new WebSocket(e,t?.protocols)}catch(S){i.set("closed"),c?.(S);return}s.onopen=()=>{i.set("open"),h()},s.onmessage=S=>{try{let d=r(S.data);u?.(d)}catch(d){l==="error"?c?.(d):l==="warn"&&console.warn(`[${n}] parse error:`,d)}},s.onerror=()=>{},s.onclose=()=>{i.set("closed"),s=null,!m&&o!==!1?f=setTimeout(()=>{f=null,u&&g()},o):a?.()}}let v=B(({emit:S,error:d,complete:T})=>(u=S,c=d,a=T,g(),()=>{u=null,c=null,a=null,m=!0,p.length=0,f!==null&&(clearTimeout(f),f=null),s&&(s.onopen=null,s.onmessage=null,s.onerror=null,s.onclose=null,s.close(),s=null),i.set("closed")}),{name:n,kind:"websocket"});return R.register(v,{kind:"websocket"}),{messages:v,status:i,send(S){s?.readyState===WebSocket.OPEN?s.send(S):p.push(S)},close(S,d){m=!0,p.length=0,f!==null&&(clearTimeout(f),f=null),s?.close(S,d)}}}function Pe(e,t,n){let r=i=>typeof i=="string"?i:JSON.stringify(i),o=n?.serialize??r,l="send"in e&&typeof e.send=="function"?e.send.bind(e):null;if(!l)throw new Error("toWebSocket: invalid WebSocket target");return ee(t,i=>{try{let s=o(i);l(s)}catch{}})}0&&(module.exports={fromHTTP,fromLLM,fromMCP,fromWebSocket,fromWebhook,toSSE,toWebSocket});
|
|
17
|
-
//# sourceMappingURL=index.cjs.map
|
package/dist/adapters/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as o}from"../chunk-
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{a as o}from"../chunk-XN3EB2HD.js";import{a as e}from"../chunk-T54CUR7D.js";import{a as t}from"../chunk-MBX4JFR2.js";import{a as r}from"../chunk-X6RLUCXO.js";import{a as p}from"../chunk-KNWJHTOJ.js";import{a as m,b as S}from"../chunk-TATS3PIH.js";import"../chunk-YJXCVG35.js";import"../chunk-P5MXN4AF.js";import"../chunk-YN4VWXAF.js";import"../chunk-M76W372U.js";import"../chunk-CWP55MPE.js";import"../chunk-I7AUKTXE.js";export{o as fromHTTP,e as fromLLM,t as fromMCP,m as fromWebSocket,p as fromWebhook,r as toSSE,S as toWebSocket};
|
package/dist/adapters/llm.cjs
CHANGED
|
@@ -3,4 +3,3 @@
|
|
|
3
3
|
`)}static toD2(e){let n=e?.direction??"down",s=t.snapshot(),i=[`direction: ${n}`,""],o={state:"rectangle",derived:"hexagon",effect:"oval",producer:"rectangle",operator:"parallelogram","pipeline-step":"rectangle","pipeline-status":"diamond",checkpoint:"cylinder"},r=new Map;function u(a){let l=a.replace(/[^a-zA-Z0-9_]/g,"_"),f=r.get(l);return f===void 0?(r.set(l,1),l):(r.set(l,f+1),`${l}__${f}`)}let c=new Map;function d(a){let l=JSON.stringify(a);return l&&l.length>30?`${l.slice(0,27)}...`:l??"undefined"}for(let a of s.nodes){let l=u(a.name);c.set(a.name,l);let f=o[a.kind]??"rectangle",w=`${a.name} (${a.kind}) = ${d(a.value)}`,$=a.status?` [${a.status}]`:"";i.push(`${l}: "${w}${$}" { shape: ${f} }`)}s.edges.length>0&&i.push("");for(let a of s.edges){let l=c.get(a.from)??u(a.from),f=c.get(a.to)??u(a.to);i.push(`${l} -> ${f}`)}return i.join(`
|
|
4
4
|
`)}static annotate(e,n){if(!t.enabled)return;t._annotations.set(e,n);let s={node:t._resolveKey(e),reason:n,timestamp:Date.now()},i=t.maxTraceEntries;i<=0||(t._traceLog.length<i?t._traceLog.push(s):(t._traceLog[t._traceHead]=s,t._traceFull=!0),t._traceHead=(t._traceHead+1)%i)}static getAnnotation(e){return t._annotations.get(e)}static traceLog(){return t._traceFull?[...t._traceLog.slice(t._traceHead),...t._traceLog.slice(0,t._traceHead)]:t._traceLog.slice(0,t._traceHead||t._traceLog.length)}static clearTrace(){t._traceLog=[],t._traceHead=0,t._traceFull=!1}static _reset(){t._names=new WeakMap,t._kinds=new WeakMap,t._keys=new WeakMap,t._stores=new Set,t._edges=new Map,t._usedKeys=new Set,t._nextId=0,t._explicitEnabled=null,t._cachedDefault=null,t._annotations=new WeakMap,t._traceLog=[],t._traceHead=0,t._traceFull=!1,t.maxTraceEntries=1e3}};var K=1,h=64,_=2,L=4,lt=8,dt=16,D=32,S=1024,g=H,R=st<<b,I=it<<b,F=nt<<b,Dt=ot<<b,xt=at<<b,Lt=rt<<b,U=class{_value;_output=null;_flags;get _status(){return ct(this._flags)}_cleanup;_fn;_eqFn;_getterFn;_initial;_singleDepCount=0;constructor(e,n){this._value=n?.initial,this._fn=e,this._eqFn=n?.equals,this._getterFn=n?.getter,this._initial=n?.initial;let s=0;n?.autoDirty!==!1&&(s|=L),n?.resetOnTeardown&&(s|=lt),n?.resubscribable&&(s|=dt),this._flags=s,this.source=this.source.bind(this),this.emit=this.emit.bind(this),n?._skipInspect||x.register(this,{kind:"producer",...n})}get(){return this._getterFn?this._getterFn(this._value):this._value}_dispatch(e,n){let s=this._output;if(s)if(this._flags&h)for(let i of s)i(e,n);else s(e,n)}emit(e){this._flags&_||this._eqFn&&this._value!==void 0&&this._eqFn(this._value,e)||(this._value=e,this._output&&(C()?this._flags&D||(this._flags|=D,this._flags&L&&(this._flags=this._flags&~g|R,this._dispatch(m,v)),j(()=>{this._flags&=~D,this._flags=this._flags&~g|I,this._dispatch(T,this._value)})):(this._flags&L&&!(this._flags&S)&&(this._flags=this._flags&~g|R,this._dispatch(m,v)),this._flags=this._flags&~g|I,this._dispatch(T,this._value))))}signal(e){this._flags&_||!this._output||(e===v?this._flags=this._flags&~g|R:e===N&&(this._flags=this._flags&~g|Lt),this._dispatch(m,e))}complete(){if(this._flags&_)return;this._flags=(this._flags|_)&~g|Dt;let e=this._output,n=this._flags&h;if(this._output=null,this._flags&=~(h|S),this._singleDepCount=0,this._stop(),e)if(n)for(let s of e)s(p);else e(p)}error(e){if(this._flags&_)return;this._flags=(this._flags|_)&~g|xt;let n=this._output,s=this._flags&h;if(this._output=null,this._flags&=~(h|S),this._singleDepCount=0,this._stop(),n)if(s)for(let i of n)i(p,e);else n(p,e)}_start(){if(this._flags&K||!this._fn)return;this._flags|=K;let e=this._fn({emit:this.emit,signal:n=>this.signal(n),complete:()=>this.complete(),error:n=>this.error(n)});this._cleanup=typeof e=="function"?e:void 0}_stop(){this._flags&K&&(this._flags&=~K,this._cleanup&&this._cleanup(),this._cleanup=void 0,this._flags<&&(this._value=this._initial),this._flags&_||(this._flags=this._flags&~g|F))}source(e,n){if(e===y){let s=n;if(this._flags&_)if(this._flags&dt&&this._output===null)this._flags=this._flags&~(_|g)|F;else{s(y,o=>{}),s(p);return}if(this._output===null)this._output=s;else if(this._flags&h)this._output.add(s);else{let o=new Set;o.add(this._output),o.add(s),this._output=o,this._flags=(this._flags|h)&~S}let i=!1;s(y,(o,r)=>{if(o===T&&s(T,this._value),o===m&&r===et&&!i&&(i=!0,this._singleDepCount++,this._flags&h||(this._flags|=S)),o===p){if(i&&(i=!1,this._singleDepCount--),this._output===null)return;if(this._flags&h){let u=this._output;u.delete(s),u.size===1?(this._output=u.values().next().value,this._flags&=~h,this._singleDepCount>0&&(this._flags|=S)):u.size===0&&(this._output=null,this._flags&=~(h|S),this._singleDepCount=0,this._flags=this._flags&~g|F,this._stop())}else this._output===s&&(this._output=null,this._flags&=~S,this._singleDepCount=0,this._flags=this._flags&~g|F,this._stop())}}),ut(()=>this._start())}}};var q=class extends U{constructor(e,n){super(void 0,{initial:e,autoDirty:!0,equals:n?.equals??Object.is,_skipInspect:!0}),this.set=this.set.bind(this),x.register(this,{kind:"state",...n})}get(){return this._value}set(e){this._flags&_||this._value!==void 0&&this._eqFn(this._value,e)||(this._value=e,this._output&&(C()?this._flags&D||(this._flags|=D,this._flags&L&&(this._flags=this._flags&~g|R,this._dispatch(m,v)),j(()=>{this._flags&=~D,this._flags=this._flags&~g|I,this._dispatch(T,this._value)})):(this._flags&L&&!(this._flags&S)&&(this._flags=this._flags&~g|R,this._dispatch(m,v)),this._flags=this._flags&~g|I,this._dispatch(T,this._value))))}update(e){this.set(e(this._value))}};function O(t,e){return new q(t,e)}function Rt(t){switch(t){case"openai":return"https://api.openai.com/v1";case"ollama":return"http://localhost:11434";default:return""}}function wt(t,e){switch(t){case"openai":case"custom":return`${e}/chat/completions`;case"ollama":return`${e}/api/chat`;default:return`${e}/chat/completions`}}function $t(t,e,n,s){let i={model:e,messages:n,stream:!0};return s?.temperature!==void 0&&(i.temperature=s.temperature),s?.maxTokens!==void 0&&(t==="ollama"?i.options={num_predict:s.maxTokens}:i.max_tokens=s.maxTokens),s?.stop&&(i.stop=s.stop),i}function Mt(t,e){let n={"Content-Type":"application/json"};return e&&(n.Authorization=`Bearer ${e}`),n}function It(t){let e=t.name??"llm",n=t.provider,s=t.baseURL??Rt(n),i=t.model??"",o=t.fetch??globalThis.fetch,r=O("",{name:`${e}.store`}),u=O({},{name:`${e}.tokens`}),c=O(!1,{name:`${e}.streaming`}),d=O(void 0,{name:`${e}.error`}),a=null;function l(){a&&(a.abort(),a=null),c.set(!1)}function f($,M){l(),a=new AbortController;let Y=M?.signal?Pt(a.signal,M.signal):a.signal;r.set(""),u.set({}),d.set(void 0),c.set(!0);let k=wt(n,s),E=$t(n,i,$,M),A=Mt(n,t.apiKey);w(k,A,E,Y).catch(()=>{})}async function w($,M,Y,k){try{let E=await o($,{method:"POST",headers:M,body:JSON.stringify(Y),signal:k});if(!E.ok){let V=await E.text().catch(()=>"");throw new Error(`LLM API error ${E.status}: ${V}`)}let A=E.body?.getReader();if(!A)throw new Error("No response body");let z=new TextDecoder,B="",W="";for(;;){if(k.aborted)return;let{done:V,value:ft}=await A.read();if(V)break;W+=z.decode(ft,{stream:!0});let J=W.split(`
|
|
5
5
|
`);W=J.pop()??"";for(let gt of J){if(k.aborted)return;let P=gt.trim();if(!P||P.startsWith(":")||!P.startsWith("data: "))continue;let Z=P.slice(6);if(Z!=="[DONE]")try{let Q=JSON.parse(Z),X=Ot(n,Q);X&&(B+=X,r.set(B));let tt=At(n,Q);tt&&u.set(tt)}catch{}}}if(z.decode(),k.aborted)return;c.set(!1),a=null}catch(E){if(k.aborted)return;d.set(E),c.set(!1),a=null}}return{store:r,tokens:u,streaming:c,error:d,generate:f,abort:l}}function Ot(t,e){return t==="ollama"?e?.message?.content:e?.choices?.[0]?.delta?.content}function At(t,e){let n=t==="ollama"?e:e?.usage;if(n){if(t==="ollama")return e.eval_count!==void 0||e.prompt_eval_count!==void 0?{promptTokens:e.prompt_eval_count,completionTokens:e.eval_count,totalTokens:(e.prompt_eval_count??0)+(e.eval_count??0)}:void 0;if(n.prompt_tokens!==void 0||n.completion_tokens!==void 0)return{promptTokens:n.prompt_tokens,completionTokens:n.completion_tokens,totalTokens:n.total_tokens}}}function Pt(t,e){let n=new AbortController,s=()=>{t.removeEventListener("abort",i),e.removeEventListener("abort",i)},i=()=>{n.abort(),s()};return t.addEventListener("abort",i,{once:!0}),e.addEventListener("abort",i,{once:!0}),n._cleanup=s,n.signal}0&&(module.exports={fromLLM});
|
|
6
|
-
//# sourceMappingURL=llm.cjs.map
|
package/dist/adapters/llm.d.cts
CHANGED
|
@@ -65,7 +65,7 @@ interface LLMStore {
|
|
|
65
65
|
* import { fromLLM } from 'callbag-recharge/adapters/llm';
|
|
66
66
|
* import { effect } from 'callbag-recharge';
|
|
67
67
|
*
|
|
68
|
-
* const llm = fromLLM({ provider: 'ollama', model: '
|
|
68
|
+
* const llm = fromLLM({ provider: 'ollama', model: 'llama4' });
|
|
69
69
|
*
|
|
70
70
|
* effect([llm.store], () => {
|
|
71
71
|
* console.log(llm.store.get()); // accumulating response...
|
package/dist/adapters/llm.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ interface LLMStore {
|
|
|
65
65
|
* import { fromLLM } from 'callbag-recharge/adapters/llm';
|
|
66
66
|
* import { effect } from 'callbag-recharge';
|
|
67
67
|
*
|
|
68
|
-
* const llm = fromLLM({ provider: 'ollama', model: '
|
|
68
|
+
* const llm = fromLLM({ provider: 'ollama', model: 'llama4' });
|
|
69
69
|
*
|
|
70
70
|
* effect([llm.store], () => {
|
|
71
71
|
* console.log(llm.store.get()); // accumulating response...
|
package/dist/adapters/llm.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
2
|
-
//# sourceMappingURL=llm.js.map
|
|
1
|
+
import{a}from"../chunk-T54CUR7D.js";import"../chunk-P5MXN4AF.js";import"../chunk-YN4VWXAF.js";import"../chunk-M76W372U.js";import"../chunk-CWP55MPE.js";import"../chunk-I7AUKTXE.js";export{a as fromLLM};
|
package/dist/adapters/mcp.cjs
CHANGED
|
@@ -3,4 +3,3 @@
|
|
|
3
3
|
`)}static toD2(t){let r=t?.direction??"down",n=e.snapshot(),s=[`direction: ${r}`,""],i={state:"rectangle",derived:"hexagon",effect:"oval",producer:"rectangle",operator:"parallelogram","pipeline-step":"rectangle","pipeline-status":"diamond",checkpoint:"cylinder"},o=new Map;function u(a){let l=a.replace(/[^a-zA-Z0-9_]/g,"_"),f=o.get(l);return f===void 0?(o.set(l,1),l):(o.set(l,f+1),`${l}__${f}`)}let c=new Map;function d(a){let l=JSON.stringify(a);return l&&l.length>30?`${l.slice(0,27)}...`:l??"undefined"}for(let a of n.nodes){let l=u(a.name);c.set(a.name,l);let f=i[a.kind]??"rectangle",k=`${a.name} (${a.kind}) = ${d(a.value)}`,I=a.status?` [${a.status}]`:"";s.push(`${l}: "${k}${I}" { shape: ${f} }`)}n.edges.length>0&&s.push("");for(let a of n.edges){let l=c.get(a.from)??u(a.from),f=c.get(a.to)??u(a.to);s.push(`${l} -> ${f}`)}return s.join(`
|
|
4
4
|
`)}static annotate(t,r){if(!e.enabled)return;e._annotations.set(t,r);let n={node:e._resolveKey(t),reason:r,timestamp:Date.now()},s=e.maxTraceEntries;s<=0||(e._traceLog.length<s?e._traceLog.push(n):(e._traceLog[e._traceHead]=n,e._traceFull=!0),e._traceHead=(e._traceHead+1)%s)}static getAnnotation(t){return e._annotations.get(t)}static traceLog(){return e._traceFull?[...e._traceLog.slice(e._traceHead),...e._traceLog.slice(0,e._traceHead)]:e._traceLog.slice(0,e._traceHead||e._traceLog.length)}static clearTrace(){e._traceLog=[],e._traceHead=0,e._traceFull=!1}static _reset(){e._names=new WeakMap,e._kinds=new WeakMap,e._keys=new WeakMap,e._stores=new Set,e._edges=new Map,e._usedKeys=new Set,e._nextId=0,e._explicitEnabled=null,e._cachedDefault=null,e._annotations=new WeakMap,e._traceLog=[],e._traceHead=0,e._traceFull=!1,e.maxTraceEntries=1e3}};var j=1,h=64,_=2,P=4,ie=8,oe=16,x=32,m=1024,g=q,$=Q<<v,M=X<<v,K=Z<<v,ye=te<<v,Ee=ne<<v,ve=ee<<v,F=class{_value;_output=null;_flags;get _status(){return se(this._flags)}_cleanup;_fn;_eqFn;_getterFn;_initial;_singleDepCount=0;constructor(t,r){this._value=r?.initial,this._fn=t,this._eqFn=r?.equals,this._getterFn=r?.getter,this._initial=r?.initial;let n=0;r?.autoDirty!==!1&&(n|=P),r?.resetOnTeardown&&(n|=ie),r?.resubscribable&&(n|=oe),this._flags=n,this.source=this.source.bind(this),this.emit=this.emit.bind(this),r?._skipInspect||w.register(this,{kind:"producer",...r})}get(){return this._getterFn?this._getterFn(this._value):this._value}_dispatch(t,r){let n=this._output;if(n)if(this._flags&h)for(let s of n)s(t,r);else n(t,r)}emit(t){this._flags&_||this._eqFn&&this._value!==void 0&&this._eqFn(this._value,t)||(this._value=t,this._output&&(L()?this._flags&x||(this._flags|=x,this._flags&P&&(this._flags=this._flags&~g|$,this._dispatch(S,E)),N(()=>{this._flags&=~x,this._flags=this._flags&~g|M,this._dispatch(T,this._value)})):(this._flags&P&&!(this._flags&m)&&(this._flags=this._flags&~g|$,this._dispatch(S,E)),this._flags=this._flags&~g|M,this._dispatch(T,this._value))))}signal(t){this._flags&_||!this._output||(t===E?this._flags=this._flags&~g|$:t===C&&(this._flags=this._flags&~g|ve),this._dispatch(S,t))}complete(){if(this._flags&_)return;this._flags=(this._flags|_)&~g|ye;let t=this._output,r=this._flags&h;if(this._output=null,this._flags&=~(h|m),this._singleDepCount=0,this._stop(),t)if(r)for(let n of t)n(p);else t(p)}error(t){if(this._flags&_)return;this._flags=(this._flags|_)&~g|Ee;let r=this._output,n=this._flags&h;if(this._output=null,this._flags&=~(h|m),this._singleDepCount=0,this._stop(),r)if(n)for(let s of r)s(p,t);else r(p,t)}_start(){if(this._flags&j||!this._fn)return;this._flags|=j;let t=this._fn({emit:this.emit,signal:r=>this.signal(r),complete:()=>this.complete(),error:r=>this.error(r)});this._cleanup=typeof t=="function"?t:void 0}_stop(){this._flags&j&&(this._flags&=~j,this._cleanup&&this._cleanup(),this._cleanup=void 0,this._flags&ie&&(this._value=this._initial),this._flags&_||(this._flags=this._flags&~g|K))}source(t,r){if(t===D){let n=r;if(this._flags&_)if(this._flags&oe&&this._output===null)this._flags=this._flags&~(_|g)|K;else{n(D,i=>{}),n(p);return}if(this._output===null)this._output=n;else if(this._flags&h)this._output.add(n);else{let i=new Set;i.add(this._output),i.add(n),this._output=i,this._flags=(this._flags|h)&~m}let s=!1;n(D,(i,o)=>{if(i===T&&n(T,this._value),i===S&&o===J&&!s&&(s=!0,this._singleDepCount++,this._flags&h||(this._flags|=m)),i===p){if(s&&(s=!1,this._singleDepCount--),this._output===null)return;if(this._flags&h){let u=this._output;u.delete(n),u.size===1?(this._output=u.values().next().value,this._flags&=~h,this._singleDepCount>0&&(this._flags|=m)):u.size===0&&(this._output=null,this._flags&=~(h|m),this._singleDepCount=0,this._flags=this._flags&~g|K,this._stop())}else this._output===n&&(this._output=null,this._flags&=~m,this._singleDepCount=0,this._flags=this._flags&~g|K,this._stop())}}),re(()=>this._start())}}};var G=class extends F{constructor(t,r){super(void 0,{initial:t,autoDirty:!0,equals:r?.equals??Object.is,_skipInspect:!0}),this.set=this.set.bind(this),w.register(this,{kind:"state",...r})}get(){return this._value}set(t){this._flags&_||this._value!==void 0&&this._eqFn(this._value,t)||(this._value=t,this._output&&(L()?this._flags&x||(this._flags|=x,this._flags&P&&(this._flags=this._flags&~g|$,this._dispatch(S,E)),N(()=>{this._flags&=~x,this._flags=this._flags&~g|M,this._dispatch(T,this._value)})):(this._flags&P&&!(this._flags&m)&&(this._flags=this._flags&~g|$,this._dispatch(S,E)),this._flags=this._flags&~g|M,this._dispatch(T,this._value))))}update(t){this.set(t(this._value))}};function b(e,t){return new G(e,t)}function De(e){let t=e.name??"mcp",r=e.client,n=b([],{name:`${t}.tools`}),s=b([],{name:`${t}.resources`}),i=b(void 0,{name:`${t}.refreshError`});function o(d){i.set(d);let a=e.onRefreshError;if(a==="warn")console.warn(`[${t}] refresh error:`,d);else{if(a==="error")throw d;typeof a=="function"&&a(d)}}async function u(){if(i.set(void 0),r.listTools)try{let d=await r.listTools();n.set(d.tools)}catch(d){o(d)}if(r.listResources)try{let d=await r.listResources();s.set(d.resources)}catch(d){o(d)}}function c(d){let a=`${t}:${d}`,l=b(void 0,{name:`${a}.result`}),f=b("idle",{name:`${a}.status`}),k=b(void 0,{name:`${a}.error`}),I=b(void 0,{name:`${a}.lastArgs`}),Y=b(void 0,{name:`${a}.duration`}),V=!1;async function ae(z){if(V)return;V=!0,I.set(z),k.set(void 0),f.set("calling");let B=Date.now();try{let R=await r.callTool({name:d,arguments:z}),W=Date.now()-B;if(Y.set(W),R.isError){let y=R.content.filter(H=>H.type==="text").map(H=>H.text??"").join(`
|
|
5
5
|
`),ue=new Error(y||"MCP tool returned error");k.set(ue),f.set("errored");return}let O=R.content.filter(y=>y.type==="text"),A;if(O.length===1){let y=O[0].text;if(y!==void 0)try{A=JSON.parse(y)}catch{A=y}}else O.length>1?A=O.map(y=>y.text??""):A=R.content;l.set(A),f.set("completed")}catch(R){let W=Date.now()-B;Y.set(W),k.set(R),f.set("errored")}finally{V=!1}}return{store:l,status:f,error:k,call:ae,lastArgs:I,duration:Y}}return{tool:c,tools:n,resources:s,refresh:u,refreshError:i}}0&&(module.exports={fromMCP});
|
|
6
|
-
//# sourceMappingURL=mcp.cjs.map
|
package/dist/adapters/mcp.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
2
|
-
//# sourceMappingURL=mcp.js.map
|
|
1
|
+
import{a}from"../chunk-MBX4JFR2.js";import"../chunk-P5MXN4AF.js";import"../chunk-YN4VWXAF.js";import"../chunk-M76W372U.js";import"../chunk-CWP55MPE.js";import"../chunk-I7AUKTXE.js";export{a as fromMCP};
|
package/dist/adapters/sse.cjs
CHANGED
|
@@ -12,4 +12,3 @@ data: ${de}
|
|
|
12
12
|
`)}}catch{}if(c>0){let N=setInterval(()=>{try{f.write(`:ping
|
|
13
13
|
|
|
14
14
|
`)}catch{w(f)}},c);l.set(f,N)}h.on("close",()=>w(f)),p()}let k=null;async function le(){if(!t?.port)throw new Error("toSSE: port is required for listen()");if(k)throw new Error("toSSE: already listening. Call close() first.");let h=await import("http");return new Promise((f,I)=>{k=h.createServer(P),k.once("listening",()=>f()),k.once("error",A=>{k=null,I(A)}),k.listen(t.port,s)})}function ue(){for(let h of d)try{h.end()}catch{}d.clear();for(let h of l.values())clearInterval(h);l.clear(),a.set(0),u?.(),u=null,k?.close(),k=null}return x.register(a,{kind:"sse"}),{connectionCount:a,handler:P,listen:le,close:ue}}0&&(module.exports={toSSE});
|
|
15
|
-
//# sourceMappingURL=sse.cjs.map
|
package/dist/adapters/sse.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
2
|
-
//# sourceMappingURL=sse.js.map
|
|
1
|
+
import{a}from"../chunk-X6RLUCXO.js";import"../chunk-YJXCVG35.js";import"../chunk-P5MXN4AF.js";import"../chunk-YN4VWXAF.js";import"../chunk-M76W372U.js";import"../chunk-CWP55MPE.js";import"../chunk-I7AUKTXE.js";export{a as toSSE};
|
|
@@ -2,4 +2,3 @@
|
|
|
2
2
|
`)}static _observe(t,i,n){let s=null,o=i??e.getName(t),r={values:[],signals:[],events:[],ended:!1,endError:void 0,dirtyCount:0,resolvedCount:0,name:o,dispose:()=>s?.(_)};return t.source(D,(a,u)=>{if(a===D){s=u;return}a===m?(r.values.push(u),r.events.push({type:"data",data:u}),n&&n(`[${o}] DATA:`,u)):a===y?(r.signals.push(u),r.events.push({type:"signal",data:u}),u===E?r.dirtyCount++:u===A&&r.resolvedCount++,n&&n(`[${o}] STATE:`,u)):a===_&&(r.ended=!0,r.endError=u,r.events.push({type:"end",data:u}),n&&n(`[${o}] END`,u!==void 0?u:""),s=null)}),r}static observe(t){return e._observe(t)}static tap(t,i){let n=i??`tap(${e.getName(t)??"anon"})`,s={get:()=>t.get(),source:t.source};return e.register(s,{name:n,kind:"tap"}),e.registerEdge(t,s),s}static spy(t,i){let n=i?.name??e.getName(t)??"spy",s=i?.log??console.log;return e._observe(t,n,s)}static snapshot(){let t=e.graph(),i=e.getEdges(),n=new Map;for(let r of e._stores){let a=r.deref();if(!a)continue;let u=e._annotations.get(a);u!==void 0&&n.set(e._resolveKey(a),u)}let s=[];for(let[r,a]of t){let u={name:r,kind:a.kind,value:a.value,status:a.status},d=n.get(r);d!==void 0&&(u.annotation=d),s.push(u)}let o=[];for(let[r,a]of i)for(let u of a)o.push({from:r,to:u});return{nodes:s,edges:o,trace:e.traceLog()}}static toMermaid(t){let i=t?.direction??"TD",n=e.snapshot(),s=[`graph ${i}`],o={SETTLED:":::settled",DIRTY:":::dirty",ERRORED:":::errored",COMPLETED:":::completed"},r=new Map;function a(c){let l=c.replace(/[^a-zA-Z0-9_]/g,"_"),f=r.get(l);return f===void 0?(r.set(l,1),l):(r.set(l,f+1),`${l}__${f}`)}let u=new Map;function d(c){let l=JSON.stringify(c);return l&&l.length>30?`${l.slice(0,27)}...`:l??"undefined"}for(let c of n.nodes){let l=a(c.name);u.set(c.name,l);let f=`${c.name} (${c.kind}) = ${d(c.value)}`,h=o[c.status??""]??"";s.push(` ${l}["${f}"]${h}`)}for(let c of n.edges){let l=u.get(c.from)??a(c.from),f=u.get(c.to)??a(c.to);s.push(` ${l} --> ${f}`)}return s.push(""),s.push(" classDef settled fill:#d4edda,stroke:#28a745"),s.push(" classDef dirty fill:#fff3cd,stroke:#ffc107"),s.push(" classDef errored fill:#f8d7da,stroke:#dc3545"),s.push(" classDef completed fill:#cce5ff,stroke:#007bff"),s.join(`
|
|
3
3
|
`)}static toD2(t){let i=t?.direction??"down",n=e.snapshot(),s=[`direction: ${i}`,""],o={state:"rectangle",derived:"hexagon",effect:"oval",producer:"rectangle",operator:"parallelogram","pipeline-step":"rectangle","pipeline-status":"diamond",checkpoint:"cylinder"},r=new Map;function a(c){let l=c.replace(/[^a-zA-Z0-9_]/g,"_"),f=r.get(l);return f===void 0?(r.set(l,1),l):(r.set(l,f+1),`${l}__${f}`)}let u=new Map;function d(c){let l=JSON.stringify(c);return l&&l.length>30?`${l.slice(0,27)}...`:l??"undefined"}for(let c of n.nodes){let l=a(c.name);u.set(c.name,l);let f=o[c.kind]??"rectangle",h=`${c.name} (${c.kind}) = ${d(c.value)}`,g=c.status?` [${c.status}]`:"";s.push(`${l}: "${h}${g}" { shape: ${f} }`)}n.edges.length>0&&s.push("");for(let c of n.edges){let l=u.get(c.from)??a(c.from),f=u.get(c.to)??a(c.to);s.push(`${l} -> ${f}`)}return s.join(`
|
|
4
4
|
`)}static annotate(t,i){if(!e.enabled)return;e._annotations.set(t,i);let n={node:e._resolveKey(t),reason:i,timestamp:Date.now()},s=e.maxTraceEntries;s<=0||(e._traceLog.length<s?e._traceLog.push(n):(e._traceLog[e._traceHead]=n,e._traceFull=!0),e._traceHead=(e._traceHead+1)%s)}static getAnnotation(t){return e._annotations.get(t)}static traceLog(){return e._traceFull?[...e._traceLog.slice(e._traceHead),...e._traceLog.slice(0,e._traceHead)]:e._traceLog.slice(0,e._traceHead||e._traceLog.length)}static clearTrace(){e._traceLog=[],e._traceHead=0,e._traceFull=!1}static _reset(){e._names=new WeakMap,e._kinds=new WeakMap,e._keys=new WeakMap,e._stores=new Set,e._edges=new Map,e._usedKeys=new Set,e._nextId=0,e._explicitEnabled=null,e._cachedDefault=null,e._annotations=new WeakMap,e._traceLog=[],e._traceHead=0,e._traceFull=!1,e.maxTraceEntries=1e3}};var M=1,T=64,S=2,w=4,ee=8,te=16,R=32,v=1024,p=F,O=z<<b,I=B<<b,j=q<<b,Se=G<<b,me=Z<<b,ye=J<<b,$=class{_value;_output=null;_flags;get _status(){return Q(this._flags)}_cleanup;_fn;_eqFn;_getterFn;_initial;_singleDepCount=0;constructor(t,i){this._value=i?.initial,this._fn=t,this._eqFn=i?.equals,this._getterFn=i?.getter,this._initial=i?.initial;let n=0;i?.autoDirty!==!1&&(n|=w),i?.resetOnTeardown&&(n|=ee),i?.resubscribable&&(n|=te),this._flags=n,this.source=this.source.bind(this),this.emit=this.emit.bind(this),i?._skipInspect||k.register(this,{kind:"producer",...i})}get(){return this._getterFn?this._getterFn(this._value):this._value}_dispatch(t,i){let n=this._output;if(n)if(this._flags&T)for(let s of n)s(t,i);else n(t,i)}emit(t){this._flags&S||this._eqFn&&this._value!==void 0&&this._eqFn(this._value,t)||(this._value=t,this._output&&(L()?this._flags&R||(this._flags|=R,this._flags&w&&(this._flags=this._flags&~p|O,this._dispatch(y,E)),C(()=>{this._flags&=~R,this._flags=this._flags&~p|I,this._dispatch(m,this._value)})):(this._flags&w&&!(this._flags&v)&&(this._flags=this._flags&~p|O,this._dispatch(y,E)),this._flags=this._flags&~p|I,this._dispatch(m,this._value))))}signal(t){this._flags&S||!this._output||(t===E?this._flags=this._flags&~p|O:t===A&&(this._flags=this._flags&~p|ye),this._dispatch(y,t))}complete(){if(this._flags&S)return;this._flags=(this._flags|S)&~p|Se;let t=this._output,i=this._flags&T;if(this._output=null,this._flags&=~(T|v),this._singleDepCount=0,this._stop(),t)if(i)for(let n of t)n(_);else t(_)}error(t){if(this._flags&S)return;this._flags=(this._flags|S)&~p|me;let i=this._output,n=this._flags&T;if(this._output=null,this._flags&=~(T|v),this._singleDepCount=0,this._stop(),i)if(n)for(let s of i)s(_,t);else i(_,t)}_start(){if(this._flags&M||!this._fn)return;this._flags|=M;let t=this._fn({emit:this.emit,signal:i=>this.signal(i),complete:()=>this.complete(),error:i=>this.error(i)});this._cleanup=typeof t=="function"?t:void 0}_stop(){this._flags&M&&(this._flags&=~M,this._cleanup&&this._cleanup(),this._cleanup=void 0,this._flags&ee&&(this._value=this._initial),this._flags&S||(this._flags=this._flags&~p|j))}source(t,i){if(t===D){let n=i;if(this._flags&S)if(this._flags&te&&this._output===null)this._flags=this._flags&~(S|p)|j;else{n(D,o=>{}),n(_);return}if(this._output===null)this._output=n;else if(this._flags&T)this._output.add(n);else{let o=new Set;o.add(this._output),o.add(n),this._output=o,this._flags=(this._flags|T)&~v}let s=!1;n(D,(o,r)=>{if(o===m&&n(m,this._value),o===y&&r===U&&!s&&(s=!0,this._singleDepCount++,this._flags&T||(this._flags|=v)),o===_){if(s&&(s=!1,this._singleDepCount--),this._output===null)return;if(this._flags&T){let a=this._output;a.delete(n),a.size===1?(this._output=a.values().next().value,this._flags&=~T,this._singleDepCount>0&&(this._flags|=v)):a.size===0&&(this._output=null,this._flags&=~(T|v),this._singleDepCount=0,this._flags=this._flags&~p|j,this._stop())}else this._output===n&&(this._output=null,this._flags&=~v,this._singleDepCount=0,this._flags=this._flags&~p|j,this._stop())}}),X(()=>this._start())}}};function ne(e,t){return new $(e,t)}var W=class extends ${constructor(t,i){super(void 0,{initial:t,autoDirty:!0,equals:i?.equals??Object.is,_skipInspect:!0}),this.set=this.set.bind(this),k.register(this,{kind:"state",...i})}get(){return this._value}set(t){this._flags&S||this._value!==void 0&&this._eqFn(this._value,t)||(this._value=t,this._output&&(L()?this._flags&R||(this._flags|=R,this._flags&w&&(this._flags=this._flags&~p|O,this._dispatch(y,E)),C(()=>{this._flags&=~R,this._flags=this._flags&~p|I,this._dispatch(m,this._value)})):(this._flags&w&&!(this._flags&v)&&(this._flags=this._flags&~p|O,this._dispatch(y,E)),this._flags=this._flags&~p|I,this._dispatch(m,this._value))))}update(t){this.set(t(this._value))}};function se(e,t){return new W(e,t)}function ve(e){let t=e?.path??"/",i=e?.parse??JSON.parse,n=e?.name??"webhook",s=e?.hostname??"0.0.0.0",o=e?.maxBodySize??1024*1024,r=se(0,{name:`${n}:count`}),a=null,u=ne(({emit:h})=>(a=h,()=>{a=null}),{name:n,kind:"webhook"});k.register(u,{kind:"webhook"});let d=null;function c(h,g){let P=h.method?.toUpperCase(),ie=(h.url??"/").split("?")[0];if(P!=="POST"||ie!==t){g.writeHead(404,{"Content-Type":"application/json"}),g.end(JSON.stringify({error:"Not found"}));return}let H=[],V=0,N=!1;h.on("error",()=>{N=!0,g.headersSent||(g.writeHead(400,{"Content-Type":"application/json"}),g.end(JSON.stringify({error:"Request aborted"})))}),h.on("data",x=>{if(!N){if(V+=x.length,V>o){N=!0,g.writeHead(413,{"Content-Type":"application/json"}),g.end(JSON.stringify({error:"Payload too large"})),h.destroy?.();return}H.push(x)}}),h.on("end",()=>{if(!N)try{let x=Buffer.concat(H).toString("utf-8"),re=x.length>0?i(x):void 0;r.update(oe=>oe+1),a?.(re),g.writeHead(200,{"Content-Type":"application/json"}),g.end(JSON.stringify({ok:!0}))}catch(x){g.writeHead(400,{"Content-Type":"application/json"}),g.end(JSON.stringify({error:x?.message??"Parse error"}))}})}function l(){return e?.port?d?Promise.reject(new Error("fromWebhook: already listening. Call close() first.")):new Promise((h,g)=>{try{d=require("http").createServer(c),d.once("listening",()=>h()),d.once("error",Y=>{d=null,g(Y)}),d.listen(e.port,s)}catch(P){g(P)}}):Promise.reject(new Error("fromWebhook: port is required for listen()"))}function f(){d?.close(),d=null}return{store:u,requestCount:r,handler:c,listen:l,close:f}}0&&(module.exports={fromWebhook});
|
|
5
|
-
//# sourceMappingURL=webhook.cjs.map
|
package/dist/adapters/webhook.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
2
|
-
//# sourceMappingURL=webhook.js.map
|
|
1
|
+
import{a}from"../chunk-KNWJHTOJ.js";import"../chunk-P5MXN4AF.js";import"../chunk-YN4VWXAF.js";import"../chunk-M76W372U.js";import"../chunk-CWP55MPE.js";import"../chunk-I7AUKTXE.js";export{a as fromWebhook};
|
|
@@ -2,4 +2,3 @@
|
|
|
2
2
|
`)}static _observe(t,i,s){let n=null,a=i??e.getName(t),o={values:[],signals:[],events:[],ended:!1,endError:void 0,dirtyCount:0,resolvedCount:0,name:a,dispose:()=>n?.(p)};return t.source(_,(r,l)=>{if(r===_){n=l;return}r===m?(o.values.push(l),o.events.push({type:"data",data:l}),s&&s(`[${a}] DATA:`,l)):r===y?(o.signals.push(l),o.events.push({type:"signal",data:l}),l===E?o.dirtyCount++:l===P&&o.resolvedCount++,s&&s(`[${a}] STATE:`,l)):r===p&&(o.ended=!0,o.endError=l,o.events.push({type:"end",data:l}),s&&s(`[${a}] END`,l!==void 0?l:""),n=null)}),o}static observe(t){return e._observe(t)}static tap(t,i){let s=i??`tap(${e.getName(t)??"anon"})`,n={get:()=>t.get(),source:t.source};return e.register(n,{name:s,kind:"tap"}),e.registerEdge(t,n),n}static spy(t,i){let s=i?.name??e.getName(t)??"spy",n=i?.log??console.log;return e._observe(t,s,n)}static snapshot(){let t=e.graph(),i=e.getEdges(),s=new Map;for(let o of e._stores){let r=o.deref();if(!r)continue;let l=e._annotations.get(r);l!==void 0&&s.set(e._resolveKey(r),l)}let n=[];for(let[o,r]of t){let l={name:o,kind:r.kind,value:r.value,status:r.status},d=s.get(o);d!==void 0&&(l.annotation=d),n.push(l)}let a=[];for(let[o,r]of i)for(let l of r)a.push({from:o,to:l});return{nodes:n,edges:a,trace:e.traceLog()}}static toMermaid(t){let i=t?.direction??"TD",s=e.snapshot(),n=[`graph ${i}`],a={SETTLED:":::settled",DIRTY:":::dirty",ERRORED:":::errored",COMPLETED:":::completed"},o=new Map;function r(u){let c=u.replace(/[^a-zA-Z0-9_]/g,"_"),f=o.get(c);return f===void 0?(o.set(c,1),c):(o.set(c,f+1),`${c}__${f}`)}let l=new Map;function d(u){let c=JSON.stringify(u);return c&&c.length>30?`${c.slice(0,27)}...`:c??"undefined"}for(let u of s.nodes){let c=r(u.name);l.set(u.name,c);let f=`${u.name} (${u.kind}) = ${d(u.value)}`,v=a[u.status??""]??"";n.push(` ${c}["${f}"]${v}`)}for(let u of s.edges){let c=l.get(u.from)??r(u.from),f=l.get(u.to)??r(u.to);n.push(` ${c} --> ${f}`)}return n.push(""),n.push(" classDef settled fill:#d4edda,stroke:#28a745"),n.push(" classDef dirty fill:#fff3cd,stroke:#ffc107"),n.push(" classDef errored fill:#f8d7da,stroke:#dc3545"),n.push(" classDef completed fill:#cce5ff,stroke:#007bff"),n.join(`
|
|
3
3
|
`)}static toD2(t){let i=t?.direction??"down",s=e.snapshot(),n=[`direction: ${i}`,""],a={state:"rectangle",derived:"hexagon",effect:"oval",producer:"rectangle",operator:"parallelogram","pipeline-step":"rectangle","pipeline-status":"diamond",checkpoint:"cylinder"},o=new Map;function r(u){let c=u.replace(/[^a-zA-Z0-9_]/g,"_"),f=o.get(c);return f===void 0?(o.set(c,1),c):(o.set(c,f+1),`${c}__${f}`)}let l=new Map;function d(u){let c=JSON.stringify(u);return c&&c.length>30?`${c.slice(0,27)}...`:c??"undefined"}for(let u of s.nodes){let c=r(u.name);l.set(u.name,c);let f=a[u.kind]??"rectangle",v=`${u.name} (${u.kind}) = ${d(u.value)}`,j=u.status?` [${u.status}]`:"";n.push(`${c}: "${v}${j}" { shape: ${f} }`)}s.edges.length>0&&n.push("");for(let u of s.edges){let c=l.get(u.from)??r(u.from),f=l.get(u.to)??r(u.to);n.push(`${c} -> ${f}`)}return n.join(`
|
|
4
4
|
`)}static annotate(t,i){if(!e.enabled)return;e._annotations.set(t,i);let s={node:e._resolveKey(t),reason:i,timestamp:Date.now()},n=e.maxTraceEntries;n<=0||(e._traceLog.length<n?e._traceLog.push(s):(e._traceLog[e._traceHead]=s,e._traceFull=!0),e._traceHead=(e._traceHead+1)%n)}static getAnnotation(t){return e._annotations.get(t)}static traceLog(){return e._traceFull?[...e._traceLog.slice(e._traceHead),...e._traceLog.slice(0,e._traceHead)]:e._traceLog.slice(0,e._traceHead||e._traceLog.length)}static clearTrace(){e._traceLog=[],e._traceHead=0,e._traceFull=!1}static _reset(){e._names=new WeakMap,e._kinds=new WeakMap,e._keys=new WeakMap,e._stores=new Set,e._edges=new Map,e._usedKeys=new Set,e._nextId=0,e._explicitEnabled=null,e._cachedDefault=null,e._annotations=new WeakMap,e._traceLog=[],e._traceHead=0,e._traceFull=!1,e.maxTraceEntries=1e3}};var W=1,T=64,S=2,R=4,ne=8,se=16,w=32,b=1024,g=K,O=U<<k,I=q<<k,C=H<<k,Te=J<<k,Se=Q<<k,me=G<<k,$=class{_value;_output=null;_flags;get _status(){return Z(this._flags)}_cleanup;_fn;_eqFn;_getterFn;_initial;_singleDepCount=0;constructor(t,i){this._value=i?.initial,this._fn=t,this._eqFn=i?.equals,this._getterFn=i?.getter,this._initial=i?.initial;let s=0;i?.autoDirty!==!1&&(s|=R),i?.resetOnTeardown&&(s|=ne),i?.resubscribable&&(s|=se),this._flags=s,this.source=this.source.bind(this),this.emit=this.emit.bind(this),i?._skipInspect||x.register(this,{kind:"producer",...i})}get(){return this._getterFn?this._getterFn(this._value):this._value}_dispatch(t,i){let s=this._output;if(s)if(this._flags&T)for(let n of s)n(t,i);else s(t,i)}emit(t){this._flags&S||this._eqFn&&this._value!==void 0&&this._eqFn(this._value,t)||(this._value=t,this._output&&(N()?this._flags&w||(this._flags|=w,this._flags&R&&(this._flags=this._flags&~g|O,this._dispatch(y,E)),M(()=>{this._flags&=~w,this._flags=this._flags&~g|I,this._dispatch(m,this._value)})):(this._flags&R&&!(this._flags&b)&&(this._flags=this._flags&~g|O,this._dispatch(y,E)),this._flags=this._flags&~g|I,this._dispatch(m,this._value))))}signal(t){this._flags&S||!this._output||(t===E?this._flags=this._flags&~g|O:t===P&&(this._flags=this._flags&~g|me),this._dispatch(y,t))}complete(){if(this._flags&S)return;this._flags=(this._flags|S)&~g|Te;let t=this._output,i=this._flags&T;if(this._output=null,this._flags&=~(T|b),this._singleDepCount=0,this._stop(),t)if(i)for(let s of t)s(p);else t(p)}error(t){if(this._flags&S)return;this._flags=(this._flags|S)&~g|Se;let i=this._output,s=this._flags&T;if(this._output=null,this._flags&=~(T|b),this._singleDepCount=0,this._stop(),i)if(s)for(let n of i)n(p,t);else i(p,t)}_start(){if(this._flags&W||!this._fn)return;this._flags|=W;let t=this._fn({emit:this.emit,signal:i=>this.signal(i),complete:()=>this.complete(),error:i=>this.error(i)});this._cleanup=typeof t=="function"?t:void 0}_stop(){this._flags&W&&(this._flags&=~W,this._cleanup&&this._cleanup(),this._cleanup=void 0,this._flags&ne&&(this._value=this._initial),this._flags&S||(this._flags=this._flags&~g|C))}source(t,i){if(t===_){let s=i;if(this._flags&S)if(this._flags&se&&this._output===null)this._flags=this._flags&~(S|g)|C;else{s(_,a=>{}),s(p);return}if(this._output===null)this._output=s;else if(this._flags&T)this._output.add(s);else{let a=new Set;a.add(this._output),a.add(s),this._output=a,this._flags=(this._flags|T)&~b}let n=!1;s(_,(a,o)=>{if(a===m&&s(m,this._value),a===y&&o===z&&!n&&(n=!0,this._singleDepCount++,this._flags&T||(this._flags|=b)),a===p){if(n&&(n=!1,this._singleDepCount--),this._output===null)return;if(this._flags&T){let r=this._output;r.delete(s),r.size===1?(this._output=r.values().next().value,this._flags&=~T,this._singleDepCount>0&&(this._flags|=b)):r.size===0&&(this._output=null,this._flags&=~(T|b),this._singleDepCount=0,this._flags=this._flags&~g|C,this._stop())}else this._output===s&&(this._output=null,this._flags&=~b,this._singleDepCount=0,this._flags=this._flags&~g|C,this._stop())}}),te(()=>this._start())}}};function ie(e,t){return new $(e,t)}var B=class extends ${constructor(t,i){super(void 0,{initial:t,autoDirty:!0,equals:i?.equals??Object.is,_skipInspect:!0}),this.set=this.set.bind(this),x.register(this,{kind:"state",...i})}get(){return this._value}set(t){this._flags&S||this._value!==void 0&&this._eqFn(this._value,t)||(this._value=t,this._output&&(N()?this._flags&w||(this._flags|=w,this._flags&R&&(this._flags=this._flags&~g|O,this._dispatch(y,E)),M(()=>{this._flags&=~w,this._flags=this._flags&~g|I,this._dispatch(m,this._value)})):(this._flags&R&&!(this._flags&b)&&(this._flags=this._flags&~g|O,this._dispatch(y,E)),this._flags=this._flags&~g|I,this._dispatch(m,this._value))))}update(t){this.set(t(this._value))}};function re(e,t){return new B(e,t)}function oe(e,t,i){let s=null;X(),e.source(_,(a,o)=>{if(a===_&&(s=o),a===p){s=null,i?.onEnd?.(o);return}if(a===1){let r=o,l=n;n=r,t(r,l)}});let n;try{n=e.get()}catch{}return ee(),()=>s?.(p)}function ye(e,t){let i=t?.name??"websocket",s=t?.parse??(h=>h),n=t?.reconnect??!1,a=t?.onParseError??"warn",o=re("connecting",{name:`${i}:status`,equals:()=>!1}),r=null,l=null,d=null,u=null,c=null,f=!1,v=[];function j(){for(;v.length>0&&r?.readyState===WebSocket.OPEN;)r.send(v.shift())}function V(){f=!1,o.set("connecting");try{r=new WebSocket(e,t?.protocols)}catch(h){o.set("closed"),d?.(h);return}r.onopen=()=>{o.set("open"),j()},r.onmessage=h=>{try{let D=s(h.data);l?.(D)}catch(D){a==="error"?d?.(D):a==="warn"&&console.warn(`[${i}] parse error:`,D)}},r.onerror=()=>{},r.onclose=()=>{o.set("closed"),r=null,!f&&n!==!1?c=setTimeout(()=>{c=null,l&&V()},n):u?.()}}let Y=ie(({emit:h,error:D,complete:ae})=>(l=h,d=D,u=ae,V(),()=>{l=null,d=null,u=null,f=!0,v.length=0,c!==null&&(clearTimeout(c),c=null),r&&(r.onopen=null,r.onmessage=null,r.onerror=null,r.onclose=null,r.close(),r=null),o.set("closed")}),{name:i,kind:"websocket"});return x.register(Y,{kind:"websocket"}),{messages:Y,status:o,send(h){r?.readyState===WebSocket.OPEN?r.send(h):v.push(h)},close(h,D){f=!0,v.length=0,c!==null&&(clearTimeout(c),c=null),r?.close(h,D)}}}function be(e,t,i){let s=o=>typeof o=="string"?o:JSON.stringify(o),n=i?.serialize??s,a="send"in e&&typeof e.send=="function"?e.send.bind(e):null;if(!a)throw new Error("toWebSocket: invalid WebSocket target");return oe(t,o=>{try{let r=n(o);a(r)}catch{}})}0&&(module.exports={fromWebSocket,toWebSocket});
|
|
5
|
-
//# sourceMappingURL=websocket.cjs.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
2
|
-
//# sourceMappingURL=websocket.js.map
|
|
1
|
+
import{a,b}from"../chunk-TATS3PIH.js";import"../chunk-YJXCVG35.js";import"../chunk-P5MXN4AF.js";import"../chunk-YN4VWXAF.js";import"../chunk-M76W372U.js";import"../chunk-CWP55MPE.js";import"../chunk-I7AUKTXE.js";export{a as fromWebSocket,b as toWebSocket};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(){return r=>r}export{e as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as A}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-AQRT3R2D.js.map
|
|
1
|
+
import{a as A}from"./chunk-YJXCVG35.js";import{i as b}from"./chunk-YN4VWXAF.js";import{a as d}from"./chunk-M76W372U.js";import{m as f,o}from"./chunk-CWP55MPE.js";function T(h){return k=>{let i=b(({emit:l,complete:S,error:a})=>{let r=[],t=!1;function s(){if(!t){if(t=!0,r.length>0){let e=r;Object.freeze(e),r=[],l(e)}S()}}function c(e){t||(t=!0,r=[],a(e))}let p=A(k,e=>{t||r.push(e)},{onEnd:e=>{e!==void 0?c(e):s(),n&&(n(o),n=null)}}),n=null;return h.source(f,(e,u)=>{if(e===f&&(n=u),e===1&&!t&&r.length>0){let m=r;Object.freeze(m),r=[],l(m)}e===o&&(n=null,u!==void 0?c(u):s(),p())}),()=>{t=!0,n&&n(o),n=null,r=[],p()}},{initial:[]});return d.register(i,{kind:"buffer"}),i}}export{T as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-46YIQYHW.js.map
|
|
1
|
+
import{a as f}from"./chunk-YJXCVG35.js";import{i}from"./chunk-YN4VWXAF.js";import{a as l}from"./chunk-M76W372U.js";function b(s){return m=>{let o=i(({emit:u,error:p,complete:a})=>{let e=null,n,r=!1,c=f(m,t=>{e!==null&&clearTimeout(e),n=t,r=!0,e=setTimeout(()=>{e=null,r=!1,u(n)},s)},{onEnd:t=>{t!==void 0?(e!==null&&clearTimeout(e),e=null,p(t)):(e!==null&&(clearTimeout(e),e=null),r&&(r=!1,u(n)),a())}});return()=>{e!==null&&clearTimeout(e),c()}});return l.register(o,{kind:"debounce"}),o}}export{b as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-762GKUF3.js.map
|
|
1
|
+
import{a as r}from"./chunk-P5MXN4AF.js";function C(m,t){let i=t?.name??"cancellableAction",p=t?.keepPreviousData??!1,a=r(t?.initial,{name:`${i}.data`}),n=r(!1,{name:`${i}.loading`}),l=r(void 0,{name:`${i}.error`}),d=r(0,{name:`${i}.runCount`}),e=null,o=0;function f(){e&&(e.abort(),e=null,n.set(!1))}async function T(b){f();let s=++o;e=new AbortController;let c=e.signal;n.set(!0),l.set(void 0),p||a.set(void 0);try{if(t?.rateLimiter&&(await t.rateLimiter.acquire(),c.aborted||s!==o))return;let u=await m(b,c);return s!==o?void 0:(a.set(u),n.set(!1),d.update(R=>R+1),e=null,u)}catch(u){if(s!==o)return;if(c.aborted){n.set(!1);return}l.set(u),n.set(!1),e=null;return}}return{execute:T,cancel:f,data:a,loading:n,error:l,runCount:d}}export{C as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as r}from"./chunk-YN4VWXAF.js";function n(e){return r(({emit:o,complete:t})=>{for(let u of e)o(u);t()})}export{n as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-GGQ6VZXI.js.map
|
|
1
|
+
import{a as m}from"./chunk-T2XJDIOR.js";import{n,o as u,p as A}from"./chunk-CWP55MPE.js";function D(r){return p=>m([p],({emit:S,signal:k,complete:f,error:d,disconnect:t})=>{let e=0;return r<=0&&(t(),f()),(a,i,o)=>{i===A&&e<r&&k(o),i===n&&e<r&&(e++,S(o),e>=r&&(t(),f())),i===u&&(o!==void 0?d(o):f())}},{kind:"take",name:"take"})}export{D as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-G4N2ECBB.js.map
|
|
1
|
+
import{a as o}from"./chunk-YJXCVG35.js";import{i as u}from"./chunk-YN4VWXAF.js";import{a as p}from"./chunk-M76W372U.js";function S(f){return r=>{let t=r.get(),n=u(({emit:m,error:i,complete:s})=>{t=r.get();let d=o(r,e=>{t=e},{onEnd:e=>{e!==void 0?i(e):s()}}),c=o(f,()=>{m(t)},{onEnd:e=>{e!==void 0?i(e):s()}});return()=>{d(),c()}},{initial:t,getter:()=>t});return p.register(n,{kind:"sample"}),n}}export{S as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-Y2CUDZYL.js.map
|
|
1
|
+
import{a as o}from"./chunk-YJXCVG35.js";import{i as T}from"./chunk-YN4VWXAF.js";import{a}from"./chunk-M76W372U.js";function x(t){return p=>{let f=T(({emit:r,error:u,complete:d})=>{let e=null,l=!1;function c(n){e&&(e(),e=null),r(n.get());let s=!1;e=o(n,i=>r(i),{onEnd:i=>{e=null,s=!0,i!==void 0?u(i):l&&d()}}),s&&(e=null)}let S=o(p,n=>{n===void 0?(e&&(e(),e=null),r(void 0)):c(n)},{onEnd:n=>{n!==void 0?u(n):(l=!0,e||d())}});return()=>{e&&e(),S()}},t&&"initial"in t?{initial:t.initial}:void 0);return a.register(f,{kind:"flat"}),f}}export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as o}from"./chunk-TTLPYOAV.js";function n(t,e){return r=>o([r],()=>t(r.get()),{kind:"map",name:e?.name??"map",equals:e?.equals})}export{n as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as r}from"./chunk-YN4VWXAF.js";function n(...o){return r(({emit:e,complete:t})=>{for(let u of o)e(u);t()})}export{n as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-YJXCVG35.js";function p(o){return e=>r(e,t=>o(t))}export{p as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as A}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-NROYOJLV.js.map
|
|
1
|
+
import{a as A}from"./chunk-T2XJDIOR.js";import{n as f,o as i,p as u}from"./chunk-CWP55MPE.js";function E(m){return p=>A([p],({emit:S,signal:d,complete:t,error:s,disconnect:l})=>{let n=0,e=!1;return(T,o,r)=>{o===u&&(e||d(r)),o===f&&(e||(n===m&&(e=!0,S(r),l(),t()),n++)),o===i&&(e||(e=!0,r!==void 0?s(r):t()))}})}export{E as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as r}from"./chunk-YN4VWXAF.js";function o(){return r(()=>{})}export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as r}from"./chunk-YN4VWXAF.js";function n(e){return r(({error:o})=>{o(e)})}export{n as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
1
|
var s=Symbol("DIRTY"),D=Symbol("RESOLVED"),T=Symbol("SINGLE_DEP"),d=0,f=1,a=2,l=3,x=4,u=5,i=7,p=7<<i,c=["DISCONNECTED","DIRTY","SETTLED","RESOLVED","COMPLETED","ERRORED"];function R(t){return c[(t&p)>>>i]}var y=0,O=1,L=2,h=3,o=0,n=[],S=!1;function I(t){o++;try{return t()}finally{if(o--,o===0&&!S){S=!0;for(let e=0;e<n.length;e++)n[e]();n.length=0,S=!1}}}function N(){return o>0}function _(t){n.push(t)}var E=0,r=[];function b(){E++}function v(){if(E--,E===0){for(let t=0;t<r.length;t++)r[t]();r.length=0}}function A(t){E>0?r.push(t):t()}function g(t){let e=t;typeof e.complete=="function"?e.complete():typeof e._handleEnd=="function"&&e._handleEnd(void 0)}export{s as a,D as b,T as c,d,f as e,a as f,l as g,x as h,u as i,i as j,p as k,R as l,y as m,O as n,L as o,h as p,I as q,N as r,_ as s,b as t,v as u,A as v,g as w};
|
|
2
|
-
//# sourceMappingURL=chunk-VEUKIPOG.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-VGEPGH2I.js.map
|
|
1
|
+
import{a as s}from"./chunk-T2XJDIOR.js";import{a as t,b as f,n as i,o as u,p as A}from"./chunk-CWP55MPE.js";function O(){return l=>s([l],({emit:p,signal:S,complete:m,error:d})=>{let o,n=!1;return(D,r,e)=>{r===A&&e!==t&&e!==f&&S(e),r===i&&(o=e,n=!0),r===u&&(e!==void 0?d(e):(n&&p(o),m()))}})}export{O as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-7PI7NYIQ.js.map
|
|
1
|
+
import{a as S}from"./chunk-T2XJDIOR.js";import{a as l}from"./chunk-HK7DRUNM.js";import{a as f,b as m,n as s,o as c,p as u}from"./chunk-CWP55MPE.js";function A(...i){return S(i,({emit:p,signal:n,complete:D,error:E})=>{let e=new l(i.length),T=i.length;return(t,o,r)=>{if(o===u)if(r===f){let g=e.empty();e.set(t),g&&n(f)}else r===m?e.test(t)&&(e.clear(t),e.empty()&&n(m)):n(r);o===s&&(e.clear(t),p(r)),o===c&&(e.clear(t),r!==void 0?E(r):(T--,T===0&&D()))}},{kind:"merge",name:"merge"})}export{A as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-T3CQQXAA.js.map
|
|
1
|
+
import{a as f}from"./chunk-T2XJDIOR.js";import{n,o as t,p as m}from"./chunk-CWP55MPE.js";function b(){return o=>f([o],({emit:i,seed:A,signal:u,complete:p,error:d})=>(A(o.get()),(S,r,e)=>{r===m&&u(e),r===n&&i(e),r===t&&(e!==void 0?d(e):p())}),{kind:"remember",name:"remember",resetOnTeardown:!0})}export{b as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-7WDW6RKD.js.map
|
|
1
|
+
import{a as S}from"./chunk-YJXCVG35.js";import{i as b}from"./chunk-YN4VWXAF.js";import{a as d}from"./chunk-M76W372U.js";import{m as f,o as a}from"./chunk-CWP55MPE.js";function I(s,r){return x=>{let l=b(({emit:c,error:p,complete:B})=>{let t=null,i=!1,m=!1,n=[],h=r?.maxBuffer??1/0;function g(){if(n.length===0){i=!1,m&&B();return}A(s(n.shift()))}function A(e){i=!0,c(e.get()),e.source(f,(u,o)=>{u===f&&(t=o),u===1&&c(o),u===a&&(t=null,o!==void 0?p(o):g())})}let v=S(x,e=>{i?(n.length>=h&&n.shift(),n.push(e)):A(s(e))},{onEnd:e=>{e!==void 0?p(e):(m=!0,i||B())}});return()=>{t&&t(a),v(),n.length=0}},r&&"initial"in r?{initial:r.initial}:void 0);return d.register(l,{kind:"concatMap"}),l}}export{I as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-6JWNWPML.js.map
|
|
1
|
+
import{a as m}from"./chunk-J3QF6BR6.js";function b(h,d=o=>o){let o=[],c=new Map,i=new Map;function u(e,n){let t=o[e],r=o[n];o[e]=r,o[n]=t,t.index=n,r.index=e}function p(e){for(;e>0;){let n=e-1>>>1;if(o[n].score<=o[e].score)break;u(e,n),e=n}}function f(e){let n=o.length;for(;;){let t=e,r=2*e+1,s=r+1;if(r<n&&o[r].score<o[t].score&&(t=r),s<n&&o[s].score<o[t].score&&(t=s),t===e)break;u(e,t),e=t}}function l(e){let n=o.length-1;if(e===n){o.pop();return}u(e,n),o.pop(),p(e),f(e)}return{touch(){},insert(e){if(c.has(e))return;let n=h(e),t={key:e,score:d(n.get()),index:o.length};o.push(t),c.set(e,t),p(t.index);let r=m([n],()=>{let s=c.get(e);if(!s)return;let a=s.score;s.score=d(n.get()),s.score<a?p(s.index):s.score>a&&f(s.index)});i.set(e,r)},delete(e){let n=c.get(e);if(!n)return;let t=i.get(e);t&&(t(),i.delete(e)),l(n.index),c.delete(e)},evict(e=1){let n=[];for(;n.length<e&&o.length>0;){let{key:t}=o[0];n.push(t);let r=i.get(t);r&&(r(),i.delete(t)),l(0),c.delete(t)}return n},size:()=>c.size,clear(){for(let e of i.values())e();i.clear(),c.clear(),o.length=0}}}export{b as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-QBXQ24GU.js.map
|
|
1
|
+
import{a as c}from"./chunk-TTLPYOAV.js";function f(s){let n=[],r=!1,o=!1;for(let e=0;e<s.length;e++){let t=s[e];if(o){o=!1;continue}if(t==="\\"){o=!0;continue}if(t==='"'){r=!r;continue}r||(t==="{"?n.push("}"):t==="["?n.push("]"):(t==="}"||t==="]")&&n.pop())}let a=s;r&&(a+='"');for(let e=n.length-1;e>=0;e--)a+=n[e];return a}function u(s){try{return JSON.parse(s)}catch{}let n=s.trim();if(n.length===0)return;let r=[],o=!1,a=!1;for(let t=0;t<n.length;t++){let i=n[t];if(a){a=!1;continue}if(i==="\\"){a=!0;continue}if(i==='"'){o=!o;continue}o||(i==="{"?r.push("}"):i==="["?r.push("]"):(i==="}"||i==="]")&&r.pop())}let e=n;o&&(e+='"'),e=e.replace(/,\s*$/,"");for(let t=r.length-1;t>=0;t--)e+=r[t];try{return JSON.parse(e)}catch{let t=e.replace(/,\s*"[^"]*"?\s*:?\s*[^,}\]]*$/,"");if(t!==e)try{return JSON.parse(f(t))}catch{return}return}}function p(s){let n=s?.mode??"partial",r=s?.extract,o=s?.name;return a=>{let e;return c([a],()=>{let t=a.get();if(!t||t.trim().length===0)return e;let i;if(n==="complete")try{i=JSON.parse(t)}catch{return e}else i=u(t);if(i===void 0)return e;if(r)try{return e=r(i),e}catch{return e}return e=i,e},{name:o??"streamParse"})}}export{p as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as O}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-EUOO45WG.js.map
|
|
1
|
+
import{a as O}from"./chunk-T2XJDIOR.js";import{b as p,n as S,o as m,p as A}from"./chunk-CWP55MPE.js";function k(f,n,s){return a=>{let B=s?.equals,e=n,c,o=!1;return O([a],({emit:t,signal:u,complete:E,error:T})=>(e=n,o=!1,(d,i,r)=>{if(i===A&&u(r),i===S){let l=f(e,r);if(B?.(e,l)){u(p);return}e=l,t(e)}i===m&&(r!==void 0?T(r):E())}),{kind:"scan",name:s?.name??"scan",initial:n,resetOnTeardown:!0,getter:()=>{let t=a.get();return(!o||!Object.is(t,c))&&(e=f(e,t),c=t,o=!0),e}})}}export{k as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
1
|
var i=class{_v;_w;constructor(t){this._v=0,this._w=t>32?new Uint32Array((t-1>>>5)+1):null}set(t){let n=this._w;if(n===null)this._v|=1<<t;else{let s=t>>>5,e=1<<(t&31);n[s]&e||(n[s]|=e,this._v++)}}clear(t){let n=this._w;if(n===null)this._v&=~(1<<t);else{let s=t>>>5,e=1<<(t&31);n[s]&e&&(n[s]&=~e,this._v--)}}test(t){let n=this._w;return n===null?(this._v&1<<t)!==0:(n[t>>>5]&1<<(t&31))!==0}empty(){return this._v===0}reset(){this._v=0,this._w?.fill(0)}};export{i as a};
|
|
2
|
-
//# sourceMappingURL=chunk-PYRVYHZG.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as w}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-WXORGCCQ.js.map
|
|
1
|
+
import{a as w}from"./chunk-TTLPYOAV.js";import{a as x}from"./chunk-P5MXN4AF.js";import{q as l,w as m}from"./chunk-CWP55MPE.js";var R=0;_.from=function(S){let i=_({id:S.id});for(let[n,s]of Object.entries(S.index))for(let d of s)i.add(d,[n]);return i};function _(I){let S=++R,i=I?.id??`ridx-${S}`,n=new Map,s=new Map,d=new Map,v=new Map,a=x(0,{name:`${i}:ver`}),z=w([a],()=>Array.from(n.keys()),{name:`${i}:keys`}),k=w([a],()=>n.size,{name:`${i}:size`}),g=!1,$=Object.freeze(new Set);function C(e){let t=d.get(e);return t||(t=x(n.get(e)??new Set,{name:`${i}:${e}`,equals:()=>!1}),d.set(e,t)),t}function p(e){let t=d.get(e);if(t){let r=n.get(e);t.set(r?new Set(r):new Set)}}function b(e,t){let r=n.get(t),o=!r;return r||(r=new Set,n.set(t,r)),r.add(e),o}function h(e,t){let r=n.get(t);return r?(r.delete(e),r.size===0?(n.delete(t),!0):!1):!1}return{get id(){return i},get version(){return a.get()},get(e){let t=n.get(e);return t?Object.freeze(new Set(t)):$},has(e){let t=n.get(e);return t!==void 0&&t.size>0},keys(){return Array.from(n.keys())},get size(){return n.size},select(e){let t=v.get(e);if(t)return t;let r=C(e);return t=w([r],()=>r.get(),{name:`${i}:${e}:select`}),v.set(e,t),t},keysStore:z,sizeStore:k,add(e,t){if(g||t.length===0)return;let r=s.get(e);r||(r=new Set,s.set(e,r)),l(()=>{let o=!1;for(let c of t)r.add(c),b(e,c)&&(o=!0),p(c);o&&a.update(c=>c+1)})},remove(e){if(g)return;let t=s.get(e);t&&l(()=>{let r=!1;for(let o of t)h(e,o)&&(r=!0),p(o);s.delete(e),r&&a.update(o=>o+1)})},update(e,t){if(g)return;let r=s.get(e),o=new Set(t);l(()=>{let c=!1;if(r)for(let f of r)o.has(f)||(h(e,f)&&(c=!0),p(f));let u=s.get(e);u||(u=new Set,s.set(e,u)),u.clear();for(let f of t)u.add(f),b(e,f)&&(c=!0),p(f);c&&a.update(f=>f+1)})},clear(){n.size!==0&&l(()=>{n.clear(),s.clear();for(let e of d.values())e.set(new Set);a.update(e=>e+1)})},snapshot(){let e={};for(let[t,r]of n)e[t]=Array.from(r);return{type:"reactiveIndex",id:i,version:a.get(),index:e}},destroy(){if(!g){g=!0,n.clear(),s.clear();for(let e of d.values())m(e);d.clear();for(let e of v.values())m(e);v.clear(),m(a)}}}}export{_ as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-VAUKVVR7.js.map
|
|
1
|
+
import{a as u}from"./chunk-T2XJDIOR.js";import{n as t,o as i,p as n}from"./chunk-CWP55MPE.js";function D(){return A=>u([A],({emit:p,signal:s,complete:f,error:S,disconnect:d})=>{let r=!1;return(m,o,e)=>{o===n&&(r||s(e)),o===t&&(r||(r=!0,p(e),d(),f())),o===i&&(r||(r=!0,e!==void 0?S(e):f()))}})}export{D as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-J5J6R6ZF.js.map
|
|
1
|
+
import{a as p}from"./chunk-T2XJDIOR.js";import{b as i,n as t,o as u,p as A}from"./chunk-CWP55MPE.js";function T(S){return s=>p([s],({emit:d,signal:f,complete:n,error:m,disconnect:l})=>{let e=!1;return(E,o,r)=>{o===A&&(e||f(r)),o===t&&(e||(S(r)?(e=!0,d(r),l(),n()):f(i))),o===u&&(e||(e=!0,r!==void 0?m(r):n()))}})}export{T as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
1
|
var d=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});export{d as a};
|
|
2
|
-
//# sourceMappingURL=chunk-2YXXFGBV.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-VDADHGCV.js.map
|
|
1
|
+
import{a as p}from"./chunk-TTLPYOAV.js";import{a as E}from"./chunk-P5MXN4AF.js";import{q as V,w as S}from"./chunk-CWP55MPE.js";var A=0;O.from=function(f,a){let u=O({...a,id:f.id});for(let o of f.entries)u.append(o.value);return u};function O(h){let f=++A,a=h?.id??`rlog-${f}`,u=h?.maxSize??0,o=u>0,t=[],g=0,r=0,d=0,i=1,c=E(0,{name:`${a}:ver`}),l=E(void 0,{name:`${a}:events`,equals:()=>!1}),b=new Map,m=!1;function L(){if(!o)return t.slice();if(r===0)return[];let e=new Array(r);for(let n=0;n<r;n++)e[n]=t[(g+n)%u];return e}function w(e){if(!o)return t[e];if(!(e<0||e>=r))return t[(g+e)%u]}let q={get id(){return a},get version(){return c.get()},append(e){if(m)return-1;let n=++d,s={seq:n,value:e};return o?(r<u?(t[(g+r)%u]=s,r++):(t[g]=s,g=(g+1)%u),i=d-r+1):(t.push(s),i=t.length>0?t[0].seq:1),c.update(y=>y+1),l.set({type:"append",seq:n,value:e}),n},appendMany(e){if(m||e.length===0)return[];let n=[];return V(()=>{for(let s of e)n.push(q.append(s))}),n},get(e){if(o)return e<i||e>d||r===0?void 0:w(e-i);let n=e-i;if(!(n<0||n>=t.length))return t[n]},slice(e,n){let s=e??i,y=n??d;if((o?r:t.length)===0)return[];let _=Math.max(s,i),R=Math.min(y,d);if(_>R)return[];let $=_-i,x=R-i;if(!o)return t.slice($,x+1);let M=[];for(let v=$;v<=x;v++)M.push(t[(g+v)%u]);return M},toArray(){return L()},get length(){return o?r:t.length},get headSeq(){return(o?r:t.length)>0?i:0},get tailSeq(){return d},clear(){(o?r:t.length)!==0&&V(()=>{o?(r=0,g=0):t.length=0,i=d+1,c.update(n=>n+1),l.set({type:"clear"})})},lengthStore:p([c],()=>o?r:t.length,{name:`${a}:length`}),latest:p([c],()=>{if((o?r:t.length)!==0)return o?t[(g+r-1)%u]:t[t.length-1]},{name:`${a}:latest`}),tail(e){let n=b.get(e);return n||(n=p([c],()=>{let s=L();return e===void 0||e>=s.length?s:s.slice(-e)},{name:`${a}:tail${e??""}`}),b.set(e,n),n)},events:l,snapshot(){return{type:"reactiveLog",id:a,version:c.get(),entries:L().map(e=>({seq:e.seq,value:e.value})),headSeq:(o?r:t.length)>0?i:0,tailSeq:d}},destroy(){m||(m=!0,t.length=0,r=0,S(c),S(l))}};return q}export{O as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as D}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-3WX3YGUQ.js.map
|
|
1
|
+
import{a as D}from"./chunk-HK7DRUNM.js";import{a as g}from"./chunk-M76W372U.js";import{a as y,b as S,c as b,m as a,n as E,o as d,p,t as h,u as k}from"./chunk-CWP55MPE.js";function x(f,v,T){let e,o=[],i=!1,t=new D(f.length),s=!1;function u(){i||(e&&e(),e=v())}h(),u();for(let r=0;r<f.length&&!i;r++){let n=r;f[n].source(a,(l,c)=>{if(l===a){o.push(c),f.length===1&&c(p,b);return}if(!i&&(l===p&&(c===y?(t.empty()&&(s=!1),t.set(n)):c===S&&t.test(n)&&(t.clear(n),t.empty()&&s&&u())),l===E&&(t.test(n)?(t.clear(n),s=!0,t.empty()&&u()):t.empty()?u():s=!0),l===d)){i=!0,e&&e(),e=void 0;for(let A of o)A(d);o.length=0}})}k();let m=()=>{if(!i){i=!0,e&&e(),e=void 0;for(let r of o)r(d);o.length=0}};g.register(m,{kind:"effect",...T,deps:f});for(let r of f)g.registerEdge(r,m);return m}export{x as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-DOPCSXSB.js.map
|
|
1
|
+
import{a as r}from"./chunk-YJXCVG35.js";import{i as p}from"./chunk-YN4VWXAF.js";import{a as d}from"./chunk-M76W372U.js";function v(c,i){return B=>{let o=p(({emit:u,error:f,complete:l})=>{let e=null,s=!1;function A(n){e&&(e(),e=null),u(n.get());let a=!1;e=r(n,t=>u(t),{onEnd:t=>{e=null,a=!0,t!==void 0?f(t):s&&l()}}),a&&(e=null)}let S=r(B,n=>A(c(n)),{onEnd:n=>{n!==void 0?f(n):(s=!0,e||l())}});return()=>{e&&e(),S()}},i&&"initial"in i?{initial:i.initial}:void 0);return d.register(o,{kind:"switchMap"}),o}}export{v as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-XFHK2LZX.js.map
|
|
1
|
+
import{a as u}from"./chunk-T2XJDIOR.js";import{a as A,b as f,n as s,o as p,p as t}from"./chunk-CWP55MPE.js";function O(){return m=>u([m],({emit:S,signal:n,complete:l,error:w})=>{let r,i=!1;return(E,o,e)=>{if(o===t&&(e===A||e===f?i&&n(e):n(e)),o===s)if(i){let D=[r,e];r=e,S(D)}else r=e,i=!0;o===p&&(e!==void 0?w(e):l())}},{kind:"pairwise",name:"pairwise"})}export{O as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-T42CTYKI.js.map
|
|
1
|
+
import{a as n}from"./chunk-TTLPYOAV.js";function a(o,e){return t=>n([t],()=>{let r=t.get();return r!==void 0?r:o},{kind:"startWith",name:e?.name??"startWith",equals:e?.equals})}export{a};
|
|
@@ -1,2 +1 @@
|
|
|
1
1
|
function d(){let n=[],r=new Set,i=0;return{touch(){},insert(s){r.has(s)||(n.push(s),r.add(s))},delete(s){r.delete(s)},evict(s=1){let c=[];for(;c.length<s&&i<n.length;){let u=n[i++];r.delete(u)&&c.push(u)}return i>1e3&&i>n.length/2&&(n.splice(0,i),i=0),c},size:()=>r.size,clear(){n.length=0,r.clear(),i=0}}}function K(){let n=new Map,r={key:null,prev:null,next:null},i={key:null,prev:null,next:null};r.next=i,i.prev=r;function s(e){e.prev.next=e.next,e.next.prev=e.prev}function c(e){e.next=r.next,e.prev=r,r.next.prev=e,r.next=e}function u(e){s(e),c(e)}return{touch(e){let t=n.get(e);t&&u(t)},insert(e){let t=n.get(e);if(t){u(t);return}t={key:e,prev:null,next:null},n.set(e,t),c(t)},delete(e){let t=n.get(e);t&&(s(t),n.delete(e))},evict(e=1){let t=[];for(;t.length<e&&i.prev!==r;){let o=i.prev;t.push(o.key),s(o),n.delete(o.key)}return t},size:()=>n.size,clear(){n.clear(),r.next=i,i.prev=r}}}function f(){let n=new Map,r={},i={};r.next=i,i.prev=r;function s(e,t){t.prev=e,t.next=e.next,e.next.prev=t,e.next=t}function c(e){e.prev.next=e.next,e.next.prev=e.prev}function u(e,t){if(e.next!==i&&e.next.freq===t)return e.next;let o={freq:t,keys:new Set};return s(e,o),o}return{touch(e){let t=n.get(e);if(!t)return;let o=u(t,t.freq+1);t.keys.delete(e),o.keys.add(e),n.set(e,o),t.keys.size===0&&c(t)},insert(e){if(n.has(e)){this.touch(e);return}let t=u(r,1);t.keys.add(e),n.set(e,t)},delete(e){let t=n.get(e);t&&(t.keys.delete(e),n.delete(e),t.keys.size===0&&c(t))},evict(e=1){let t=[];for(;t.length<e&&r.next!==i;){let o=r.next,l=o.keys.values().next().value;t.push(l),o.keys.delete(l),n.delete(l),o.keys.size===0&&c(o)}return t},size:()=>n.size,clear(){n.clear(),r.next=i,i.prev=r}}}function v(n){let r=new Set;function i(s){try{return n(s)}catch{return-1/0}}return{touch(){},insert(s){r.add(s)},delete(s){r.delete(s)},evict(s=1){if(r.size===0)return[];if(s===1){let e,t=1/0;for(let o of r){let l=i(o);l<t&&(t=l,e=o)}return e!==void 0?(r.delete(e),[e]):[]}let c=Array.from(r).map(e=>({key:e,score:i(e)}));c.sort((e,t)=>e.score-t.score);let u=c.slice(0,s).map(e=>e.key);for(let e of u)r.delete(e);return u},size:()=>r.size,clear(){r.clear()}}}function a(){let n=[],r=new Map;return{touch(){},insert(i){r.has(i)||(r.set(i,n.length),n.push(i))},delete(i){let s=r.get(i);if(s===void 0)return;let c=n[n.length-1];n[s]=c,r.set(c,s),n.pop(),r.delete(i)},evict(i=1){let s=[];for(;s.length<i&&n.length>0;){let c=Math.floor(Math.random()*n.length),u=n[c];s.push(u);let e=n[n.length-1];n[c]=e,r.set(e,c),n.pop(),r.delete(u)}return s},size:()=>n.length,clear(){n.length=0,r.clear()}}}export{d as a,K as b,f as c,v as d,a as e};
|
|
2
|
-
//# sourceMappingURL=chunk-HKDBOVSA.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-OI57LAV5.js.map
|
|
1
|
+
import{a as u}from"./chunk-YJXCVG35.js";import{i as d}from"./chunk-YN4VWXAF.js";import{a as s}from"./chunk-M76W372U.js";function y(o){return c=>{let n=d(({emit:f,error:m,complete:i})=>{let e=new Set,p=u(c,r=>{let t=setTimeout(()=>{e.delete(t),f(r)},o);e.add(t)},{onEnd:r=>{if(r!==void 0){for(let t of e)clearTimeout(t);e.clear(),m(r)}else if(e.size===0)i();else{let t=setTimeout(()=>{e.delete(t),i()},o);e.add(t)}}});return()=>{for(let r of e)clearTimeout(r);e.clear(),p()}},{resetOnTeardown:!0});return s.register(n,{kind:"delay"}),n}}export{y as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{i as T}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-ADMHHBQU.js.map
|
|
1
|
+
import{i as T}from"./chunk-YN4VWXAF.js";import{m as t,n as c,o as u,p as b,t as d,u as m}from"./chunk-CWP55MPE.js";function w(p,f){return T(({emit:a,signal:S,complete:k,error:D})=>{let l=0,r=null,i=!1,o=!1;function s(){if(i){o=!0;return}for(i=!0;;){if(o=!1,f!==void 0&&l>=f){k();break}l++;let g=p();if(d(),g.source(t,(n,e)=>{if(n===t){r=e;return}n===b&&S(e),n===c&&a(e),n===u&&(r=null,e!==void 0?D(e):s())}),m(),!o)break}i=!1}return s(),()=>{r&&r(u)}},{autoDirty:!1})}export{w as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-BU6SQ77Q.js.map
|
|
1
|
+
import{a as S}from"./chunk-P5MXN4AF.js";import{i as y}from"./chunk-YN4VWXAF.js";import{a as h}from"./chunk-M76W372U.js";import{a as N}from"./chunk-I7AUKTXE.js";function B(o){let b=o?.path??"/",g=o?.parse??JSON.parse,u=o?.name??"webhook",k=o?.hostname??"0.0.0.0",w=o?.maxBodySize??1024*1024,l=S(0,{name:`${u}:count`}),s=null,c=y(({emit:n})=>(s=n,()=>{s=null}),{name:u,kind:"webhook"});h.register(c,{kind:"webhook"});let t=null;function d(n,e){let i=n.method?.toUpperCase(),O=(n.url??"/").split("?")[0];if(i!=="POST"||O!==b){e.writeHead(404,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Not found"}));return}let f=[],m=0,a=!1;n.on("error",()=>{a=!0,e.headersSent||(e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Request aborted"})))}),n.on("data",r=>{if(!a){if(m+=r.length,m>w){a=!0,e.writeHead(413,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Payload too large"})),n.destroy?.();return}f.push(r)}}),n.on("end",()=>{if(!a)try{let r=Buffer.concat(f).toString("utf-8"),P=r.length>0?g(r):void 0;l.update(v=>v+1),s?.(P),e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify({ok:!0}))}catch(r){e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:r?.message??"Parse error"}))}})}function T(){return o?.port?t?Promise.reject(new Error("fromWebhook: already listening. Call close() first.")):new Promise((n,e)=>{try{t=N("http").createServer(d),t.once("listening",()=>n()),t.once("error",p=>{t=null,e(p)}),t.listen(o.port,k)}catch(i){e(i)}}):Promise.reject(new Error("fromWebhook: port is required for listen()"))}function C(){t?.close(),t=null}return{store:c,requestCount:l,handler:d,listen:T,close:C}}export{B as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-6MZXVCKQ.js.map
|
|
1
|
+
import{a as s}from"./chunk-T2XJDIOR.js";import{a as f,b as t,n as p,o as u,p as m}from"./chunk-CWP55MPE.js";function c(i){return A=>s([A],({emit:S,signal:n,complete:k,error:D})=>{let r=0;return(E,o,e)=>{o===m&&(e===f||e===t?r>=i&&n(e):n(e)),o===p&&(r++,r>i&&S(e)),o===u&&(e!==void 0?D(e):k())}},{kind:"skip",name:"skip"})}export{c as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as r}from"./chunk-YN4VWXAF.js";function t(){return r(({complete:e})=>{e()})}export{t as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-DXMXVWT3.js.map
|
|
1
|
+
import{a as l}from"./chunk-T2XJDIOR.js";import{n as f,o as u,p as A}from"./chunk-CWP55MPE.js";function T(p){return m=>l([m],({emit:a,signal:s,complete:o,error:i,disconnect:n})=>{let r=!1;return(k,t,e)=>{if(!r){if(t===A&&s(e),t===f)try{p(e)?a(e):(r=!0,n(),o())}catch(S){r=!0,n(),i(S)}t===u&&(e!==void 0?i(e):o())}}},{kind:"takeWhile",name:"takeWhile"})}export{T as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-RHJPQKAU.js.map
|
|
1
|
+
import{a as d}from"./chunk-T2XJDIOR.js";import{b as u,n as m,o as S,p as a}from"./chunk-CWP55MPE.js";function T(t,A){return i=>{let p=A?.equals,e,l=i.get();return t(l)&&(e=l),d([i],({emit:r,signal:f,complete:O,error:c})=>(v,s,n)=>{if(s===a&&f(n),s===m){let o=n;if(t(o)){if(p?.(e,o)){f(u);return}e=o,r(o)}else f(u)}s===S&&(n!==void 0?c(n):O())},{kind:"filter",name:A?.name??"filter",initial:e,getter:()=>{let r=i.get();return t(r)&&(e=r),e}})}}export{T as a};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import{a as h,b as v,m as f,n as y,o as p,p as b}from"./chunk-
|
|
1
|
+
import{a as h,b as v,m as f,n as y,o as p,p as b}from"./chunk-CWP55MPE.js";var k=class e{static _names=new WeakMap;static _kinds=new WeakMap;static _keys=new WeakMap;static _stores=new Set;static _edges=new Map;static _nextId=0;static _usedKeys=new Set;static _explicitEnabled=null;static _cachedDefault=null;static _annotations=new WeakMap;static _traceLog=[];static _traceHead=0;static _traceFull=!1;static maxTraceEntries=1e3;static get enabled(){if(e._explicitEnabled!==null)return e._explicitEnabled;if(e._cachedDefault!==null)return e._cachedDefault;try{e._cachedDefault=globalThis.process?.env?.NODE_ENV!=="production"}catch{e._cachedDefault=!0}return e._cachedDefault}static set enabled(n){e._explicitEnabled=n}static _depSuffix(n){if(!n?.length)return;let s=n.map(t=>e._names.get(t)??"?").join(",");return s.length>40?`${s.slice(0,37)}...`:s}static _resolveKey(n){let i=e._keys.get(n)??e._names.get(n);if(i)return i;let s=`anonymous_${e._nextId++}`;return e._keys.set(n,s),s}static register(n,i){if(!e.enabled)return;i?.name&&e._names.set(n,i.name),i?.kind&&e._kinds.set(n,i.kind);let s=e._nextId++,t=i?.name;if(!(t&&!e._usedKeys.has(t)))if(t){let c=e._depSuffix(i?.deps);t=c?`${t}(${c})`:`${t}_${s}`,e._usedKeys.has(t)&&(t=`${t}_${s}`)}else{let c=i?.kind??"store",r=e._depSuffix(i?.deps);t=r?`${c}(${r})`:`${c}_${s}`,e._usedKeys.has(t)&&(t=`${t}_${s}`)}e._usedKeys.add(t),e._keys.set(n,t),e._stores.add(new WeakRef(n))}static registerEdge(n,i){if(!e.enabled)return;let s=e._resolveKey(n),t=e._resolveKey(i),c=e._edges.get(s);c?c.includes(t)||c.push(t):e._edges.set(s,[t])}static getEdges(){return new Map(e._edges)}static getName(n){if(e.enabled)return e._names.get(n)}static getKind(n){return e._kinds.get(n)}static inspect(n){return{name:e._names.get(n),kind:e._kinds.get(n)??"unknown",value:typeof n.get=="function"?n.get():void 0,status:n._status}}static graph(){let n=new Map,i=new Set;for(let s of e._stores){let t=s.deref();if(!t){e._stores.delete(s);continue}let c=e._resolveKey(t);i.add(c),n.set(c,e.inspect(t))}for(let[s,t]of e._edges){if(!i.has(s)){e._edges.delete(s),e._usedKeys.delete(s);continue}let c=t.filter(r=>i.has(r));c.length===0?e._edges.delete(s):c.length!==t.length&&e._edges.set(s,c)}return n}static trace(n,i){let s=null,t=n.get();return n.source(f,(c,r)=>{if(c===f&&(s=r),c===p){s=null;return}if(c===1){let u=r;if(!Object.is(u,t)){let a=t;t=u,i(u,a)}}}),()=>s?.(p)}static dumpGraph(){let n=e.graph(),i=e.getEdges(),s=new Map;for(let[r,u]of i)for(let a of u){let g=s.get(a);g?g.includes(r)||g.push(r):s.set(a,[r])}let t=[];for(let[r,u]of n){let a=s.get(r),g=i.get(r),o=a?.length?` \u2190 [${a.join(", ")}]`:"",d=g?.length?` \u2192 [${g.join(", ")}]`:"";t.push(` ${r} (${u.kind}) = ${JSON.stringify(u.value)} [${u.status??"?"}]${o}${d}`)}return[`Store Graph (${n.size} nodes):`,...t].join(`
|
|
2
2
|
`)}static _observe(n,i,s){let t=null,c=i??e.getName(n),r={values:[],signals:[],events:[],ended:!1,endError:void 0,dirtyCount:0,resolvedCount:0,name:c,dispose:()=>t?.(p)};return n.source(f,(u,a)=>{if(u===f){t=a;return}u===y?(r.values.push(a),r.events.push({type:"data",data:a}),s&&s(`[${c}] DATA:`,a)):u===b?(r.signals.push(a),r.events.push({type:"signal",data:a}),a===h?r.dirtyCount++:a===v&&r.resolvedCount++,s&&s(`[${c}] STATE:`,a)):u===p&&(r.ended=!0,r.endError=a,r.events.push({type:"end",data:a}),s&&s(`[${c}] END`,a!==void 0?a:""),t=null)}),r}static observe(n){return e._observe(n)}static tap(n,i){let s=i??`tap(${e.getName(n)??"anon"})`,t={get:()=>n.get(),source:n.source};return e.register(t,{name:s,kind:"tap"}),e.registerEdge(n,t),t}static spy(n,i){let s=i?.name??e.getName(n)??"spy",t=i?.log??console.log;return e._observe(n,s,t)}static snapshot(){let n=e.graph(),i=e.getEdges(),s=new Map;for(let r of e._stores){let u=r.deref();if(!u)continue;let a=e._annotations.get(u);a!==void 0&&s.set(e._resolveKey(u),a)}let t=[];for(let[r,u]of n){let a={name:r,kind:u.kind,value:u.value,status:u.status},g=s.get(r);g!==void 0&&(a.annotation=g),t.push(a)}let c=[];for(let[r,u]of i)for(let a of u)c.push({from:r,to:a});return{nodes:t,edges:c,trace:e.traceLog()}}static toMermaid(n){let i=n?.direction??"TD",s=e.snapshot(),t=[`graph ${i}`],c={SETTLED:":::settled",DIRTY:":::dirty",ERRORED:":::errored",COMPLETED:":::completed"},r=new Map;function u(o){let d=o.replace(/[^a-zA-Z0-9_]/g,"_"),l=r.get(d);return l===void 0?(r.set(d,1),d):(r.set(d,l+1),`${d}__${l}`)}let a=new Map;function g(o){let d=JSON.stringify(o);return d&&d.length>30?`${d.slice(0,27)}...`:d??"undefined"}for(let o of s.nodes){let d=u(o.name);a.set(o.name,d);let l=`${o.name} (${o.kind}) = ${g(o.value)}`,m=c[o.status??""]??"";t.push(` ${d}["${l}"]${m}`)}for(let o of s.edges){let d=a.get(o.from)??u(o.from),l=a.get(o.to)??u(o.to);t.push(` ${d} --> ${l}`)}return t.push(""),t.push(" classDef settled fill:#d4edda,stroke:#28a745"),t.push(" classDef dirty fill:#fff3cd,stroke:#ffc107"),t.push(" classDef errored fill:#f8d7da,stroke:#dc3545"),t.push(" classDef completed fill:#cce5ff,stroke:#007bff"),t.join(`
|
|
3
3
|
`)}static toD2(n){let i=n?.direction??"down",s=e.snapshot(),t=[`direction: ${i}`,""],c={state:"rectangle",derived:"hexagon",effect:"oval",producer:"rectangle",operator:"parallelogram","pipeline-step":"rectangle","pipeline-status":"diamond",checkpoint:"cylinder"},r=new Map;function u(o){let d=o.replace(/[^a-zA-Z0-9_]/g,"_"),l=r.get(d);return l===void 0?(r.set(d,1),d):(r.set(d,l+1),`${d}__${l}`)}let a=new Map;function g(o){let d=JSON.stringify(o);return d&&d.length>30?`${d.slice(0,27)}...`:d??"undefined"}for(let o of s.nodes){let d=u(o.name);a.set(o.name,d);let l=c[o.kind]??"rectangle",m=`${o.name} (${o.kind}) = ${g(o.value)}`,T=o.status?` [${o.status}]`:"";t.push(`${d}: "${m}${T}" { shape: ${l} }`)}s.edges.length>0&&t.push("");for(let o of s.edges){let d=a.get(o.from)??u(o.from),l=a.get(o.to)??u(o.to);t.push(`${d} -> ${l}`)}return t.join(`
|
|
4
4
|
`)}static annotate(n,i){if(!e.enabled)return;e._annotations.set(n,i);let s={node:e._resolveKey(n),reason:i,timestamp:Date.now()},t=e.maxTraceEntries;t<=0||(e._traceLog.length<t?e._traceLog.push(s):(e._traceLog[e._traceHead]=s,e._traceFull=!0),e._traceHead=(e._traceHead+1)%t)}static getAnnotation(n){return e._annotations.get(n)}static traceLog(){return e._traceFull?[...e._traceLog.slice(e._traceHead),...e._traceLog.slice(0,e._traceHead)]:e._traceLog.slice(0,e._traceHead||e._traceLog.length)}static clearTrace(){e._traceLog=[],e._traceHead=0,e._traceFull=!1}static _reset(){e._names=new WeakMap,e._kinds=new WeakMap,e._keys=new WeakMap,e._stores=new Set,e._edges=new Map,e._usedKeys=new Set,e._nextId=0,e._explicitEnabled=null,e._cachedDefault=null,e._annotations=new WeakMap,e._traceLog=[],e._traceHead=0,e._traceFull=!1,e.maxTraceEntries=1e3}};export{k as a};
|
|
5
|
-
//# sourceMappingURL=chunk-D2KH2EWY.js.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-P5MXN4AF.js";function E(d){let s=d.name??"mcp",i=d.client,w=n([],{name:`${s}.tools`}),P=n([],{name:`${s}.resources`}),f=n(void 0,{name:`${s}.refreshError`});function S(e){f.set(e);let r=d.onRefreshError;if(r==="warn")console.warn(`[${s}] refresh error:`,e);else{if(r==="error")throw e;typeof r=="function"&&r(e)}}async function y(){if(f.set(void 0),i.listTools)try{let e=await i.listTools();w.set(e.tools)}catch(e){S(e)}if(i.listResources)try{let e=await i.listResources();P.set(e.resources)}catch(e){S(e)}}function M(e){let r=`${s}:${e}`,R=n(void 0,{name:`${r}.result`}),u=n("idle",{name:`${r}.status`}),a=n(void 0,{name:`${r}.error`}),C=n(void 0,{name:`${r}.lastArgs`}),m=n(void 0,{name:`${r}.duration`}),g=!1;async function x(h){if(g)return;g=!0,C.set(h),a.set(void 0),u.set("calling");let k=Date.now();try{let o=await i.callTool({name:e,arguments:h}),T=Date.now()-k;if(m.set(T),o.isError){let t=o.content.filter(p=>p.type==="text").map(p=>p.text??"").join(`
|
|
2
2
|
`),A=new Error(t||"MCP tool returned error");a.set(A),u.set("errored");return}let c=o.content.filter(t=>t.type==="text"),l;if(c.length===1){let t=c[0].text;if(t!==void 0)try{l=JSON.parse(t)}catch{l=t}}else c.length>1?l=c.map(t=>t.text??""):l=o.content;R.set(l),u.set("completed")}catch(o){let T=Date.now()-k;m.set(T),a.set(o),u.set("errored")}finally{g=!1}}return{store:R,status:u,error:a,call:x,lastArgs:C,duration:m}}return{tool:M,tools:w,resources:P,refresh:y,refreshError:f}}export{E as a};
|
|
3
|
-
//# sourceMappingURL=chunk-WXT2CH7W.js.map
|