@intent-hq/web 2.312.0 → 2.313.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/package.json +1 -1
- package/web/app/immutable/chunks/{B2aHvKzW.js → -URcs0EB.js} +2 -2
- package/web/app/immutable/chunks/{BVEbTxE_.js → 04XFWhBd.js} +1 -1
- package/web/app/immutable/chunks/{C46TnD1H.js → 19F8thw1.js} +1 -1
- package/web/app/immutable/chunks/{bcv2TMVC.js → 28aV1Wzl.js} +1 -1
- package/web/app/immutable/chunks/{C6_fF-vn.js → 2O2vJlPl.js} +1 -1
- package/web/app/immutable/chunks/{lGuvxH0P.js → 2bp47GFs.js} +1 -1
- package/web/app/immutable/chunks/{DiN36N-2.js → 2g3BKwo_.js} +2 -2
- package/web/app/immutable/chunks/2zKcFAvZ.js +1 -0
- package/web/app/immutable/chunks/3V4Tx4nH.js +1 -0
- package/web/app/immutable/chunks/{DMiVWfnj.js → 4CMzT_BI.js} +1 -1
- package/web/app/immutable/chunks/{DFo_icpD.js → 6uLD17LP.js} +1 -1
- package/web/app/immutable/chunks/{onlOqkEU.js → 77JHYRqp.js} +22 -22
- package/web/app/immutable/chunks/{Ddfj4iOJ.js → 7IyNIHph.js} +1 -1
- package/web/app/immutable/chunks/{CiN55CeC.js → 7ZJvg7ev.js} +1 -1
- package/web/app/immutable/chunks/{B63GdhMJ.js → 992RyGqf.js} +1 -1
- package/web/app/immutable/chunks/{ChqSx7V8.js → 9sI_nbHm.js} +1 -1
- package/web/app/immutable/chunks/{BDPd3Gxs.js → AGSVFpXc.js} +1 -1
- package/web/app/immutable/chunks/{B1Yylqx8.js → B-agcRbG.js} +1 -1
- package/web/app/immutable/chunks/{Dwxm4mRs.js → B-rSL5ZP.js} +2 -2
- package/web/app/immutable/chunks/{D25S3m8c.js → B-xGvc_0.js} +1 -1
- package/web/app/immutable/chunks/{DB5R3D7Y.js → B0qtRhuw.js} +1 -1
- package/web/app/immutable/chunks/{BnAX9yTi.js → B1Rrvp0b.js} +1 -1
- package/web/app/immutable/chunks/{LnbsKux_.js → B2RRuLl5.js} +1 -1
- package/web/app/immutable/chunks/{8ZUxx0Co.js → B3nB6DWs.js} +1 -1
- package/web/app/immutable/chunks/{CWKTWYM7.js → B6mHy78M.js} +1 -1
- package/web/app/immutable/chunks/{Yu0gam1U.js → B6oQfzis.js} +1 -1
- package/web/app/immutable/chunks/{CLevwIvK.js → B7-651e2.js} +1 -1
- package/web/app/immutable/chunks/{Co6qQZL7.js → B721JIop.js} +2 -2
- package/web/app/immutable/chunks/{BXmFIcIP.js → B8VhjfbW.js} +1 -1
- package/web/app/immutable/chunks/{Z5fbCd-X.js → B9F8nd-t.js} +4 -4
- package/web/app/immutable/chunks/{CddrLe5o.js → B9pAuhbK.js} +1 -1
- package/web/app/immutable/chunks/{BqddjWz6.js → BAQDI3wv.js} +1 -1
- package/web/app/immutable/chunks/BAqR9jtB.js +1 -0
- package/web/app/immutable/chunks/{ZjB_ER6s.js → BBRz8JFJ.js} +1 -1
- package/web/app/immutable/chunks/{li27w4Od.js → BCDWZbwh.js} +1 -1
- package/web/app/immutable/chunks/{B195Jf7v.js → BCoW5DN6.js} +3 -3
- package/web/app/immutable/chunks/{CVVkCR3K.js → BDGDJyji.js} +1 -1
- package/web/app/immutable/chunks/{C6AEaqMK.js → BDICjj7k.js} +1 -1
- package/web/app/immutable/chunks/{DGjSXQQ8.js → BDXCy3lH.js} +1 -1
- package/web/app/immutable/chunks/{htWd8PdL.js → BE-b7v7R.js} +1 -1
- package/web/app/immutable/chunks/{BlvwJgNV.js → BEVpCf6b.js} +1 -1
- package/web/app/immutable/chunks/{DaUwNiAB.js → BFETMHTz.js} +3 -3
- package/web/app/immutable/chunks/{uxsR8mHg.js → BFpzDysH.js} +1 -1
- package/web/app/immutable/chunks/{-g2yD8nW.js → BGGxKX5q.js} +1 -1
- package/web/app/immutable/chunks/{CcoNUQ4q.js → BGYaMCAp.js} +1 -1
- package/web/app/immutable/chunks/{B1fMeJph.js → BHqHNrOT.js} +1 -1
- package/web/app/immutable/chunks/{CpLMWsmF.js → BKTydVIY.js} +1 -1
- package/web/app/immutable/chunks/{BJ9Pk-Qc.js → BLDT4lze.js} +1 -1
- package/web/app/immutable/chunks/{BlzuC8vd.js → BM7ZHc1t.js} +2 -2
- package/web/app/immutable/chunks/{Cu9hF6Lj.js → BMkc6ng0.js} +1 -1
- package/web/app/immutable/chunks/{66T_vlm_.js → BN6Sv1MY.js} +1 -1
- package/web/app/immutable/chunks/{C8M-Eryf.js → BNHRvqeQ.js} +1 -1
- package/web/app/immutable/chunks/{BY5CEwGM.js → BNasdn-P.js} +1 -1
- package/web/app/immutable/chunks/{DU64vtBR.js → BPk16bSc.js} +1 -1
- package/web/app/immutable/chunks/{Dm_KenRX.js → BQFqw3YD.js} +1 -1
- package/web/app/immutable/chunks/{Bk-q0J3W.js → BR8jrnEs.js} +1 -1
- package/web/app/immutable/chunks/{CcnOA9dj.js → BRNfUSNR.js} +1 -1
- package/web/app/immutable/chunks/{DaA44xVk.js → BSwWMzab.js} +5 -5
- package/web/app/immutable/chunks/{B1LFg8Ni.js → BUjtm23k.js} +1 -1
- package/web/app/immutable/chunks/{K1Aj4aiz.js → BVkJyN1U.js} +2 -2
- package/web/app/immutable/chunks/{DEA2ISnw.js → BXMFG8vW.js} +1 -1
- package/web/app/immutable/chunks/{CmZ4R63v.js → BZ90Gl9e.js} +1 -1
- package/web/app/immutable/chunks/{qCTbBtmS.js → B_CpN824.js} +1 -1
- package/web/app/immutable/chunks/{D6Tu0KcL.js → B_ifqSee.js} +6 -6
- package/web/app/immutable/chunks/{3xBR6H3M.js → BaWcyleE.js} +1 -1
- package/web/app/immutable/chunks/{DNPjjQTW.js → Bc-8qHYh.js} +1 -1
- package/web/app/immutable/chunks/{Bg-wwj8e.js → Bc2zOKbx.js} +1 -1
- package/web/app/immutable/chunks/{wFaVm_je.js → BcVu_y1Z.js} +1 -1
- package/web/app/immutable/chunks/{Db_s6atq.js → BdetxH0g.js} +1 -1
- package/web/app/immutable/chunks/{Bgo6QmNg.js → Bf1tCDQg.js} +1 -1
- package/web/app/immutable/chunks/{Cts5KPIk.js → BfxxnTgV.js} +1 -1
- package/web/app/immutable/chunks/{0BDej8J9.js → BgUzpkp7.js} +1 -1
- package/web/app/immutable/chunks/{D728aNnl.js → BgyuoEGq.js} +1 -1
- package/web/app/immutable/chunks/{BUhKOoKe.js → BiMGZT5w.js} +2 -2
- package/web/app/immutable/chunks/BkKnMUvE.js +1 -0
- package/web/app/immutable/chunks/{Brz_LsyP.js → Bl_iEh1f.js} +1 -1
- package/web/app/immutable/chunks/{CFKI_75v.js → BlfjnWuH.js} +3 -3
- package/web/app/immutable/chunks/{B4eSJ_b5.js → Bops7MsY.js} +29 -29
- package/web/app/immutable/chunks/{RGxIilBQ.js → Bpy6Muvw.js} +4 -4
- package/web/app/immutable/chunks/Br5d6l04.js +1 -0
- package/web/app/immutable/chunks/{DHQetc-m.js → BtAYzBSd.js} +1 -1
- package/web/app/immutable/chunks/{Bj1XwsOw.js → Bvq2wF7r.js} +7 -7
- package/web/app/immutable/chunks/{cLppJexf.js → BwK5Bace.js} +1 -1
- package/web/app/immutable/chunks/{CwAr2bfc.js → BxiJOwnz.js} +1 -1
- package/web/app/immutable/chunks/{Civ86Ers.js → C0VJEx2v.js} +1 -1
- package/web/app/immutable/chunks/{BUJT8nbP.js → C11wqToa.js} +1 -1
- package/web/app/immutable/chunks/{D8Iqos3S.js → C1XicA-w.js} +1 -1
- package/web/app/immutable/chunks/{B95izTqM.js → C2L4VLjE.js} +1 -1
- package/web/app/immutable/chunks/C3X16aYc.js +1 -0
- package/web/app/immutable/chunks/{YdCQJnUj.js → C48G3Oh4.js} +1 -1
- package/web/app/immutable/chunks/{DwCiT34L.js → C4XQStEU.js} +1 -1
- package/web/app/immutable/chunks/{Q3Bjy5v7.js → C58wlt4Q.js} +2 -2
- package/web/app/immutable/chunks/{B6tJ7e7m.js → C5EEwI0-.js} +2 -2
- package/web/app/immutable/chunks/{CKcLU7Ix.js → C5Nz-crT.js} +1 -1
- package/web/app/immutable/chunks/{CHk37LgR.js → C5c-LdLT.js} +1 -1
- package/web/app/immutable/chunks/{C8G4GKsE.js → C6L7wkhi.js} +1 -1
- package/web/app/immutable/chunks/{QiI6ZCof.js → C8_w7W1W.js} +4 -4
- package/web/app/immutable/chunks/{BP22EbgY.js → C8reKsm7.js} +1 -1
- package/web/app/immutable/chunks/{D7b_n5fi.js → C9gP-gRX.js} +3 -3
- package/web/app/immutable/chunks/{DhmDkL56.js → CAK2j9T_.js} +1 -1
- package/web/app/immutable/chunks/{0KiNbR5l.js → CBwn70Pq.js} +1 -1
- package/web/app/immutable/chunks/{5jwgbfJ7.js → CBzaXebB.js} +1 -1
- package/web/app/immutable/chunks/{BIsm3Ahi.js → CCIxcA5l.js} +1 -1
- package/web/app/immutable/chunks/{3U-mPo_x.js → CCxcLQdk.js} +1 -1
- package/web/app/immutable/chunks/{DUIaBcOd.js → CDE88Tgk.js} +2 -2
- package/web/app/immutable/chunks/{GiRbWuMt.js → CEWfqweJ.js} +1 -1
- package/web/app/immutable/chunks/{Bqekhi5h.js → CHtSQ3Rg.js} +1 -1
- package/web/app/immutable/chunks/{BNn2h7IG.js → CJCZCJxO.js} +1 -1
- package/web/app/immutable/chunks/{19JeQ6BX.js → CKJYXvLT.js} +1 -1
- package/web/app/immutable/chunks/{M4M675TN.js → CM7ZaQP_.js} +1 -1
- package/web/app/immutable/chunks/{DsKjRYyi.js → CNMS2KOf.js} +1 -1
- package/web/app/immutable/chunks/CPfTSiRI.js +1 -0
- package/web/app/immutable/chunks/{BG1ODLUu.js → CPzgXxXu.js} +1 -1
- package/web/app/immutable/chunks/{T-DUA-1O.js → CRgLy9Dv.js} +1 -1
- package/web/app/immutable/chunks/{CFyiOaFx.js → CVvtz86e.js} +3 -3
- package/web/app/immutable/chunks/{Bh9tHAiY.js → CYlqp1HL.js} +49 -49
- package/web/app/immutable/chunks/{U838LLRH.js → CYtxGPAf.js} +1 -1
- package/web/app/immutable/chunks/CZI4_vlI.js +1 -0
- package/web/app/immutable/chunks/{CXqStKXr.js → C_73TJPq.js} +1 -1
- package/web/app/immutable/chunks/{D08RO1VG.js → CatH1hIe.js} +1 -1
- package/web/app/immutable/chunks/{BFbKEECb.js → Cb7SCycF.js} +1 -1
- package/web/app/immutable/chunks/{B6RmASgD.js → Ccf4dYFA.js} +1 -1
- package/web/app/immutable/chunks/{CWlg1b-s.js → CeQYwwry.js} +1 -1
- package/web/app/immutable/chunks/CgAzfuNr.js +1 -0
- package/web/app/immutable/chunks/{DPHQ6GUU.js → CnfYogWn.js} +1 -1
- package/web/app/immutable/chunks/{Z7mWElPD.js → Cnihm-Nc.js} +1 -1
- package/web/app/immutable/chunks/{BYLg_iMr.js → CoKEteoj.js} +1 -1
- package/web/app/immutable/chunks/{BsLhCljI.js → Cop9b2dY.js} +1 -1
- package/web/app/immutable/chunks/{OeYTP1p9.js → Cpw4G06I.js} +1 -1
- package/web/app/immutable/chunks/{BNVixDQg.js → Cpwl5RRn.js} +1 -1
- package/web/app/immutable/chunks/{BawsvKy-.js → CqzZhYYx.js} +1 -1
- package/web/app/immutable/chunks/{CPy8SeUf.js → Cw6SlTJ6.js} +2 -2
- package/web/app/immutable/chunks/{CIx9_tZJ.js → CxPdVa60.js} +1 -1
- package/web/app/immutable/chunks/{DRwfCI3n.js → CzRl1R1n.js} +1 -1
- package/web/app/immutable/chunks/{C1SG0POo.js → D-XHjwsv.js} +1 -1
- package/web/app/immutable/chunks/{CwwcEFDp.js → D-rJNj43.js} +1 -1
- package/web/app/immutable/chunks/{CgIYxUJQ.js → D0Dsw2tV.js} +1 -1
- package/web/app/immutable/chunks/{BPvrn9n_.js → D0NG9Gzz.js} +2 -2
- package/web/app/immutable/chunks/{DQpR_z9x.js → D0tEEJ7X.js} +1 -1
- package/web/app/immutable/chunks/{C3ePiQWu.js → D6DsI_Sr.js} +1 -1
- package/web/app/immutable/chunks/{ffaoYO6L.js → D9SqGY86.js} +1 -1
- package/web/app/immutable/chunks/{vOfkzWZD.js → DBfJXlLJ.js} +1 -1
- package/web/app/immutable/chunks/{Ba7aiW_M.js → DCcgbj-g.js} +1 -1
- package/web/app/immutable/chunks/{xXCdIyF3.js → DD-f8Y3V.js} +1 -1
- package/web/app/immutable/chunks/{D4dn9g8x.js → DE32xZOO.js} +1 -1
- package/web/app/immutable/chunks/{BtTToJTU.js → DEfnfMIS.js} +3 -3
- package/web/app/immutable/chunks/{CJ4_4cNv.js → DFq6CFhq.js} +1 -1
- package/web/app/immutable/chunks/{EyZ0nhwB.js → DFzMoFQx.js} +4 -4
- package/web/app/immutable/chunks/{BRYVEoAL.js → DGAww3vc.js} +1 -1
- package/web/app/immutable/chunks/{B_mg6-Vc.js → DH9gMPGd.js} +1 -1
- package/web/app/immutable/chunks/{wV3lKTnH.js → DJCJ21BX.js} +1 -1
- package/web/app/immutable/chunks/{C44r02pn.js → DKPwGUzq.js} +1 -1
- package/web/app/immutable/chunks/{vV7Eo_ua.js → DKXEy5Lq.js} +1 -1
- package/web/app/immutable/chunks/{DlM5T-ri.js → DKhv0I45.js} +1 -1
- package/web/app/immutable/chunks/{Bl-s542_.js → DNo4fphO.js} +1 -1
- package/web/app/immutable/chunks/{BVNJnx5b.js → DO2cS8JO.js} +1 -1
- package/web/app/immutable/chunks/{Bd8zPJ0R.js → DOzphY7c.js} +1 -1
- package/web/app/immutable/chunks/{QfXYPrZH.js → DPcbMgdd.js} +2 -2
- package/web/app/immutable/chunks/{CR_HWuhj.js → DPiGMYKs.js} +1 -1
- package/web/app/immutable/chunks/{rpm2NzpE.js → DQRxUuCh.js} +1 -1
- package/web/app/immutable/chunks/{Pow4u-14.js → DSRwOSd4.js} +1 -1
- package/web/app/immutable/chunks/{CIL9eyec.js → DTMKqgRU.js} +1 -1
- package/web/app/immutable/chunks/{CwBMLcFF.js → DW9ZR5Up.js} +1 -1
- package/web/app/immutable/chunks/{BMoOyvL9.js → DY6JypjK.js} +1 -1
- package/web/app/immutable/chunks/{BlZonKZY.js → DZ64qqlL.js} +1 -1
- package/web/app/immutable/chunks/{BIwSEl2U.js → DZuInc-o.js} +1 -1
- package/web/app/immutable/chunks/{Cee62BOx.js → D_uOXHFE.js} +1 -1
- package/web/app/immutable/chunks/{dzprHFyK.js → DaWdrOD0.js} +1 -1
- package/web/app/immutable/chunks/{CsQu3MKC.js → DcYvv2Iw.js} +1 -1
- package/web/app/immutable/chunks/{ZaVuh6Ie.js → DeBw56y4.js} +1 -1
- package/web/app/immutable/chunks/{BGpTsVFh.js → DfTvRpFp.js} +1 -1
- package/web/app/immutable/chunks/{BBg1ABUj.js → DgJXm20t.js} +1 -1
- package/web/app/immutable/chunks/{xQjZTcxq.js → DhAv1XMF.js} +1 -1
- package/web/app/immutable/chunks/{BPso9ZTU.js → DhXr1ZqD.js} +1 -1
- package/web/app/immutable/chunks/{C9Ba8Wsx.js → DiCMHWTR.js} +1 -1
- package/web/app/immutable/chunks/{tA5hPyrR.js → DiVHUgRZ.js} +2 -2
- package/web/app/immutable/chunks/{CMmlAySy.js → DijSalri.js} +1 -1
- package/web/app/immutable/chunks/{C1-APN-K.js → DkrnUdRW.js} +1 -1
- package/web/app/immutable/chunks/{CHKw7UrD.js → DmsGklpx.js} +1 -1
- package/web/app/immutable/chunks/{DCYjhyno.js → DoCNcHnE.js} +3 -3
- package/web/app/immutable/chunks/{CQolNqfo.js → DqLOhjhM.js} +8 -8
- package/web/app/immutable/chunks/{ZS63KZzT.js → DqTygHNa.js} +4 -4
- package/web/app/immutable/chunks/{X868iZaW.js → DsU6W5Yf.js} +1 -1
- package/web/app/immutable/chunks/{i6q5e9Bi.js → Dt9TrzFG.js} +1 -1
- package/web/app/immutable/chunks/{CMNPJIlE.js → DuRHazc8.js} +1 -1
- package/web/app/immutable/chunks/{CtZpQlR0.js → DuVelotc.js} +2 -2
- package/web/app/immutable/chunks/{sbHX8DXH.js → DvC622kv.js} +1 -1
- package/web/app/immutable/chunks/{aHlukoGt.js → DvExZ34Y.js} +1 -1
- package/web/app/immutable/chunks/{CUhYwYxv.js → DwbQaKgL.js} +1 -1
- package/web/app/immutable/chunks/{Co9bnw2t.js → DwdStl3H.js} +11 -11
- package/web/app/immutable/chunks/{B1XZ9Wy8.js → Dxpr5NqS.js} +1 -1
- package/web/app/immutable/chunks/{BwN9PPwq.js → DzfdD6YD.js} +1 -1
- package/web/app/immutable/chunks/EEJgvLyS.js +1 -0
- package/web/app/immutable/chunks/{BqAelQe2.js → IB-HmS7d.js} +1 -1
- package/web/app/immutable/chunks/{-dq3wJnW.js → Io79CQwx.js} +1 -1
- package/web/app/immutable/chunks/{CjJ2aG8c.js → KFwqetYG.js} +1 -1
- package/web/app/immutable/chunks/{BqK5afB2.js → LoSFphII.js} +1 -1
- package/web/app/immutable/chunks/{CXsLrVJH.js → OS5fDMId.js} +1 -1
- package/web/app/immutable/chunks/{OAsZcRpW.js → P4NanOkc.js} +1 -1
- package/web/app/immutable/chunks/{Frujgmwq.js → PTzYQcOR.js} +1 -1
- package/web/app/immutable/chunks/{DYe4BNIz.js → QCq950da.js} +1 -1
- package/web/app/immutable/chunks/{8rrBGDgQ.js → UuiGcpAE.js} +1 -1
- package/web/app/immutable/chunks/{SU_Zxid7.js → V553m0MO.js} +1 -1
- package/web/app/immutable/chunks/{CWlxHxOH.js → X-W6j8OD.js} +1 -1
- package/web/app/immutable/chunks/{CpbXsTys.js → XzWc0fs1.js} +1 -1
- package/web/app/immutable/chunks/{rWFIPcdV.js → Y6LratEc.js} +1 -1
- package/web/app/immutable/chunks/{DFV_t0gv.js → YH3VI7O_.js} +1 -1
- package/web/app/immutable/chunks/{ICkI56ZY.js → _4p7wl12.js} +1 -1
- package/web/app/immutable/chunks/{CDGEKoBr.js → aegF9YRH.js} +1 -1
- package/web/app/immutable/chunks/{URtDzPe4.js → cUCU_6OD.js} +1 -1
- package/web/app/immutable/chunks/{BDF6V5e0.js → dKjrvSqn.js} +1 -1
- package/web/app/immutable/chunks/{17TgXovQ.js → gqVNwlAV.js} +1 -1
- package/web/app/immutable/chunks/{BEBrFxQu.js → h4HcKsDl.js} +1 -1
- package/web/app/immutable/chunks/{C6JSYFyu.js → hacdNVQl.js} +1 -1
- package/web/app/immutable/chunks/{DjeoEINQ.js → hcpthRFf.js} +1 -1
- package/web/app/immutable/chunks/{SAR1HpYu.js → i92hRJko.js} +3 -3
- package/web/app/immutable/chunks/{DyLPqvAi.js → jvw1Fn3k.js} +1 -1
- package/web/app/immutable/chunks/{BP56q1O2.js → kRmfkT9J.js} +2 -2
- package/web/app/immutable/chunks/{BwRcoxdV.js → ldCNaZ5F.js} +1 -1
- package/web/app/immutable/chunks/{daIBqHmL.js → n2a_8s79.js} +1 -1
- package/web/app/immutable/chunks/{DexjcGy5.js → nt8jKVrH.js} +1 -1
- package/web/app/immutable/chunks/{HHVVLLOo.js → okmbexJZ.js} +1 -1
- package/web/app/immutable/chunks/{DdRYjUTh.js → qHcHiO2c.js} +1 -1
- package/web/app/immutable/chunks/{BioErF0E.js → sLnx1Tu5.js} +1 -1
- package/web/app/immutable/chunks/{I6iBDGZz.js → tuNJ429u.js} +1 -1
- package/web/app/immutable/chunks/{BeJPCJYr.js → um4u3A9l.js} +6 -6
- package/web/app/immutable/chunks/{DPQGeIyJ.js → xlntbOPQ.js} +2 -2
- package/web/app/immutable/chunks/{BjPJabzV.js → yNufUFm8.js} +1 -1
- package/web/app/immutable/entry/{app.zU9yYpXi.js → app.Co8E4L03.js} +3 -3
- package/web/app/immutable/entry/start.CBL0QUZV.js +1 -0
- package/web/app/immutable/nodes/{0.CpVAzuif.js → 0.BucKx3Zo.js} +1 -1
- package/web/app/immutable/nodes/{1.DRuW-6VC.js → 1.-v_Vj9ip.js} +1 -1
- package/web/app/immutable/nodes/{10.DKrkS2Ck.js → 10.BnlxMSMI.js} +4 -4
- package/web/app/immutable/nodes/{11.C3gubzv3.js → 11.BtNxR4dm.js} +1 -1
- package/web/app/immutable/nodes/{12.DwCDRGkT.js → 12.DQmthXqN.js} +1 -1
- package/web/app/immutable/nodes/{13.CUd5S4Yi.js → 13.pfWPVnQT.js} +3 -3
- package/web/app/immutable/nodes/{14.u0qAwLFY.js → 14.Ca9GXwJ0.js} +2 -2
- package/web/app/immutable/nodes/{15.D5mdZsCG.js → 15.CkuJDDnR.js} +1 -1
- package/web/app/immutable/nodes/{16.Di9o_NeI.js → 16.Dk1EKS3B.js} +2 -2
- package/web/app/immutable/nodes/2.Bazc0fR2.js +9 -0
- package/web/app/immutable/nodes/{3.BdPudEJY.js → 3.CCsh91Fv.js} +1 -1
- package/web/app/immutable/nodes/4.C_FHoeDU.js +1 -0
- package/web/app/immutable/nodes/5.DegIKxsI.js +5 -0
- package/web/app/immutable/nodes/{6.TDtUMw8i.js → 6.F6OlLFwi.js} +1 -1
- package/web/app/immutable/nodes/{7.heLExSUY.js → 7.quuP6x8b.js} +1 -1
- package/web/app/immutable/nodes/{8.iXetk1_-.js → 8.xtRgDwRj.js} +4 -4
- package/web/app/immutable/nodes/{9.Bq9HwFsC.js → 9.DFsNNJdd.js} +5 -5
- package/web/app/version.json +1 -1
- package/web/generated/paraglide.js +49 -49
- package/web/index.html +18 -18
- package/web/app/immutable/chunks/7FhPODJU.js +0 -1
- package/web/app/immutable/chunks/B-EQoMaE.js +0 -1
- package/web/app/immutable/chunks/BV49_RX-.js +0 -1
- package/web/app/immutable/chunks/BzwgImum.js +0 -1
- package/web/app/immutable/chunks/C-BI-o7z.js +0 -1
- package/web/app/immutable/chunks/CGtpSJYQ.js +0 -1
- package/web/app/immutable/chunks/CHmKgzDw.js +0 -1
- package/web/app/immutable/chunks/CfR8DHmm.js +0 -1
- package/web/app/immutable/chunks/CqtVr5NT.js +0 -1
- package/web/app/immutable/chunks/D1jYkFlI.js +0 -1
- package/web/app/immutable/entry/start.DtsLJnWx.js +0 -1
- package/web/app/immutable/nodes/2.CjuG4Yin.js +0 -9
- package/web/app/immutable/nodes/4.DvwRKOcg.js +0 -1
- package/web/app/immutable/nodes/5.gCklR-Wk.js +0 -5
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{bo as x}from"./BV49_RX-.js";function m(e){const n=e.replace(/^#/,"");let r,o,a;if(n.length===3||n.length===4)r=parseInt(n[0]+n[0],16)/255,o=parseInt(n[1]+n[1],16)/255,a=parseInt(n[2]+n[2],16)/255;else if(n.length===6||n.length===8)r=parseInt(n.slice(0,2),16)/255,o=parseInt(n.slice(2,4),16)/255,a=parseInt(n.slice(4,6),16)/255;else return"0 0% 0%";const t=Math.max(r,o,a),s=Math.min(r,o,a),c=(t+s)/2;let u=0,g=0;if(t!==s){const p=t-s;switch(g=c>.5?p/(2-t-s):p/(t+s),t){case r:u=((o-a)/p+(o<a?6:0))/6;break;case o:u=((a-r)/p+2)/6;break;case a:u=((r-o)/p+4)/6;break}}const f=Math.round(u*360),d=Math.round(g*100),l=Math.round(c*100);return`${f} ${d}% ${l}%`}function N(e){const n=e.replace(/^#/,"");let r,o,a;if(n.length>=6)r=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16);else if(n.length>=3)r=parseInt(n[0]+n[0],16),o=parseInt(n[1]+n[1],16),a=parseInt(n[2]+n[2],16);else return!0;return(.299*r+.587*o+.114*a)/255<.5}const X=[["editor.background","--background"],["editor.foreground","--foreground"],["sideBar.background","--sidebar"],["sideBar.foreground","--sidebar-foreground"],["sideBar.border","--sidebar-border"],["editorWidget.background","--card"],["editorWidget.foreground","--card-foreground"],["dropdown.background","--popover"],["dropdown.foreground","--popover-foreground"],["focusBorder","--ring"],["input.background","--input"],["panel.border","--border"],["editorGroup.border","--border"],["button.background","--primary"],["button.foreground","--primary-foreground"],["list.activeSelectionBackground","--secondary"],["list.activeSelectionForeground","--secondary-foreground"],["errorForeground","--danger"],["inputValidation.errorBackground","--danger-background"]];function B(e){const n=e.replace(/^#/,"");return n.length>=6?[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]:n.length>=3?[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16)]:[0,0,0]}function M(e,n,r){const o=a=>Math.max(0,Math.min(255,Math.round(a)));return`#${o(e).toString(16).padStart(2,"0")}${o(n).toString(16).padStart(2,"0")}${o(r).toString(16).padStart(2,"0")}`}function G(e,n,r){const[o,a,t]=[e,n,r].map(s=>{const c=s/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)});return .2126*o+.7152*a+.0722*t}function k(e,n){const r=G(...e),o=G(...n),a=Math.max(r,o),t=Math.min(r,o);return(a+.05)/(t+.05)}function F(e){const n=e.match(/^([\d.]+)\s+([\d.]+)%\s+([\d.]+)%$/);if(!n)return[0,0,0];const r=Number(n[1]),o=Number(n[2])/100,a=Number(n[3])/100,t=(1-Math.abs(2*a-1))*o,s=t*(1-Math.abs(r/60%2-1)),c=a-t/2;return(r<60?[t,s,0]:r<120?[s,t,0]:r<180?[0,t,s]:r<240?[0,s,t]:r<300?[s,0,t]:[t,0,s]).map(g=>Math.round((g+c)*255))}function V(e,n,r){const o=F(e),t=F(n).map((s,c)=>s*(1-r)+o[c]*r);return m(M(...t))}function H(e,n){const r=F(e),o=F(n);if(k(r,o)>=4.55)return e;const a=[0,0,0],t=[255,255,255],s=k(a,o)>k(t,o)?a:t;for(let c=1;c<=20;c++){const u=c/20,g=r.map((f,d)=>f*(1-u)+s[d]*u);if(k(g,o)>=4.55)return m(M(...g))}return m(M(...s))}function _(e,n){const r=F(e),o=n.map(F),a=f=>Math.min(...o.map(d=>k(f,d))),t=4.55;if(a(r)>=t)return e;const s=e.match(/^([\d.]+)\s+([\d.]+)%\s+([\d.]+)%$/);if(!s)return e;const c=Number(s[1]);let u,g={value:e,ratio:a(r),distance:0};for(let f=0;f<=100;f++)for(let d=0;d<=100;d++){const l=`${c} ${f}% ${d}%`,p=F(l),b=a(p),i=p.reduce((R,I,A)=>R+(I-r[A])**2,0);b>=t?(!u||i<u.distance)&&(u={value:l,distance:i}):(b>g.ratio||b===g.ratio&&i<g.distance)&&(g={value:l,ratio:b,distance:i})}return u?.value??g.value}function K({fgHex:e,bgHexes:n,descriptionHex:r}){const o=B(e),a=n.map(B);let t;if(r)t=B(r);else{const[f,d,l]=a[0];t=[o[0]*.6+f*.4,o[1]*.6+d*.4,o[2]*.6+l*.4]}const s=4.5,c=20,u=f=>a.every(d=>k(f,d)>=s),g=[...t];for(let f=0;f<c&&!u(t);f++){const d=(f+1)/c;t=[g[0]*(1-d)+o[0]*d,g[1]*(1-d)+o[1]*d,g[2]*(1-d)+o[2]*d]}return m(M(...t))}function Y(e,n,r){const o=B(e),a=B(n),t=G(...o),s=G(...a),c=1.12;if((Math.max(t,s)+.05)/(Math.min(t,s)+.05)>=c)return m(e);const f=t>s||t===s&&!r?[255,255,255]:[0,0,0],d=20;let l=[...o];for(let p=1;p<=d;p++){const b=p/d;l=[o[0]*(1-b)+f[0]*b,o[1]*(1-b)+f[1]*b,o[2]*(1-b)+f[2]*b];const i=G(...l);if((Math.max(i,s)+.05)/(Math.min(i,s)+.05)>=c)break}return m(M(...l))}function O(e){const n=B(e),r=N(e)?[255,255,255]:[0,0,0],o=1.2,a=20;let t=[...n];for(let s=1;s<=a;s++){const c=s/a;if(t=[n[0]*(1-c)+r[0]*c,n[1]*(1-c)+r[1]*c,n[2]*(1-c)+r[2]*c],k(t,n)>=o)break}return m(M(...t))}function $(e,n,r){const o=B(e),a=n.map(B),t=3.1,s=d=>Math.min(...a.map(l=>k(d,l)));if(s(o)>=t)return m(e);const u=r?[255,255,255]:[0,0,0],g=20;let f=[...o];for(let d=1;d<=g;d++){const l=d/g;if(f=[o[0]*(1-l)+u[0]*l,o[1]*(1-l)+u[1]*l,o[2]*(1-l)+u[2]*l],s(f)>=t)break}return m(M(...f))}function j(e){const n=e["editor.background"];if(!n)return null;const r=e.focusBorder??e["button.background"]??e["badge.background"];if(!r)return null;const o=B(n),a=B(r),t=N(n),s=t?.12:.08,c=[o[0]*(1-s)+a[0]*s,o[1]*(1-s)+a[1]*s,o[2]*(1-s)+a[2]*s],u=B(e["editor.foreground"]??(t?"#ffffff":"#000000"));let g=[...a];const f=4.5,d=20,l=b=>k(b,o)>=f&&k(b,c)>=3,p=[...g];for(let b=0;b<d&&!l(g);b++){const i=(b+1)/d;g=[p[0]*(1-i)+u[0]*i,p[1]*(1-i)+u[1]*i,p[2]*(1-i)+u[2]*i]}return{accent:m(M(...c)),accentForeground:m(M(...g))}}function q(e,n){const r={};for(const[i,R]of X){if(r[R])continue;const I=e[i];I&&(r[R]=m(I))}const o=j(e);o&&(r["--accent"]=o.accent,r["--accent-foreground"]=o.accentForeground);const a=e["editor.foreground"],t=e["editor.background"];if(a&&t){const i=[t];e["sideBar.background"]&&i.push(e["sideBar.background"]),e["editorWidget.background"]&&i.push(e["editorWidget.background"]),r["--muted-foreground"]=K({fgHex:a,bgHexes:i,descriptionHex:e.descriptionForeground});const R=e["tab.inactiveBackground"]??e["sideBar.background"]??t,I=N(t);r["--muted"]=Y(R,t,I);const A=[t,e["editorWidget.background"],e["dropdown.background"],e["sideBar.background"]].filter(S=>!!S),P=e["panel.border"]??e["editorGroup.border"],D=e["input.border"]??e["input.background"]??P??t;r["--input"]=$(D,A,I);const W=e.focusBorder??e["button.background"]??P??t;r["--ring"]=$(W,A,I);const y=B(a),w=B(t);{const S=[y[0]*.6+w[0]*.4,y[1]*.6+w[1]*.4,y[2]*.6+w[2]*.4];let C=[...S];const L=4.5,T=20;for(let v=0;v<T&&!(k(C,w)>=L);v++){const h=(v+1)/T;C=[S[0]*(1-h)+y[0]*h,S[1]*(1-h)+y[1]*h,S[2]*(1-h)+y[2]*h]}r["--text-subtle"]=m(M(...C))}{const S=[w[0]*.65+y[0]*.35,w[1]*.65+y[1]*.35,w[2]*.65+y[2]*.35];let C=[...S];const L=2,T=15;for(let v=0;v<T&&!(k(C,w)>=L);v++){const h=(v+1)/T;C=[S[0]*(1-h)+y[0]*h,S[1]*(1-h)+y[1]*h,S[2]*(1-h)+y[2]*h]}r["--text-ghost"]=m(M(...C))}}else e.descriptionForeground&&(r["--muted-foreground"]=m(e.descriptionForeground));t&&(r["--border"]??=O(t),r["--sidebar-border"]??=O(e["sideBar.background"]??t));const s=n?{background:"#1f1f24",foreground:"#f7f7f7",primary:"#009966",primaryForeground:"#171717",secondary:"#1c1c1c",secondaryForeground:"#f7f7f7",muted:"#121217",mutedForeground:"#b8b5c2",accent:"#182c25",accentForeground:"#7de3bd",danger:"#f38b8b",dangerBackground:"#361010",border:"#4d4a52",input:"#121217",ring:"#6eddb4",info:"#72d2fa",infoForeground:"#171717",success:"#22c55e",successForeground:"#171717",warning:"#facc15",warningForeground:"#171717",sidebar:"#0d0d10",sidebarForeground:"#f7f7f7",sidebarAccent:"#242424",sidebarBorder:"#4d4a52"}:{background:"#ffffff",foreground:"#171717",primary:"#007a4d",primaryForeground:"#ffffff",secondary:"#f5f5f5",secondaryForeground:"#171717",muted:"#e8e8e8",mutedForeground:"#474747",accent:"#e7f3ee",accentForeground:"#00663f",danger:"#930b0b",dangerBackground:"#fde7e7",border:"#d9d9d9",input:"#e6e6e6",ring:"#006ac2",info:"#006ac2",infoForeground:"#ffffff",success:"#117a37",successForeground:"#ffffff",warning:"#dc9400",warningForeground:"#171717",sidebar:"#f7f7f8",sidebarForeground:"#171717",sidebarAccent:"#e8e8e8",sidebarBorder:"#d9d9d9"},c=i=>m(s[i]);r["--background"]??=c("background"),r["--foreground"]??=c("foreground"),r["--card"]??=r["--background"],r["--card-foreground"]??=r["--foreground"],r["--popover"]??=r["--card"],r["--popover-foreground"]??=r["--card-foreground"],r["--primary"]??=c("primary"),r["--primary-foreground"]??=c("primaryForeground"),r["--secondary"]??=c("secondary"),r["--secondary-foreground"]??=c("secondaryForeground"),r["--muted"]??=c("muted"),r["--muted-foreground"]??=c("mutedForeground"),r["--accent"]??=c("accent"),r["--accent-foreground"]??=c("accentForeground"),r["--danger"]??=c("danger"),r["--danger-background"]??=c("dangerBackground"),r["--border"]??=c("border"),r["--input"]??=c("input"),r["--ring"]??=c("ring"),r["--info"]=m(e["editorInfo.foreground"]??s.info),r["--info-foreground"]=c("infoForeground"),r["--success"]=m(e["testing.iconPassed"]??e["gitDecoration.addedResourceForeground"]??s.success),r["--success-foreground"]=c("successForeground"),r["--warning"]=m(e["editorWarning.foreground"]??s.warning),r["--warning-foreground"]=c("warningForeground"),r["--sidebar"]??=c("sidebar"),r["--sidebar-foreground"]??=c("sidebarForeground"),r["--sidebar-accent"]=r["--secondary"]??c("sidebarAccent"),r["--sidebar-accent-foreground"]=r["--sidebar-foreground"],r["--sidebar-border"]??=c("sidebarBorder");const u=[["--foreground","--background"],["--card-foreground","--card"],["--popover-foreground","--popover"],["--primary-foreground","--primary"],["--secondary-foreground","--secondary"],["--accent-foreground","--accent"],["--muted-foreground","--muted"],["--info-foreground","--info"],["--success-foreground","--success"],["--warning-foreground","--warning"],["--sidebar-foreground","--sidebar"],["--sidebar-accent-foreground","--sidebar-accent"]];for(const[i,R]of u)r[i]=H(r[i],r[R]);const g=["--danger-background","--background","--card","--popover","--muted","--sidebar"],f=r["--danger"];r["--danger"]=_(f,g.map(i=>r[i]));const d=F(r["--danger"]);g.every(i=>k(d,F(r[i]))>=4.55)||(r["--danger-background"]=r["--background"],r["--danger"]=_(f,g.map(i=>r[i]))),r["--primary-ink"]=_(r["--primary"],[r["--background"],r["--card"]]);const p=r["--warning"],b=[r["--background"],r["--card"]];return r["--warning-ink"]=_(p,[...b,...b.map(i=>V(p,i,.1))]),r}const z=[["terminal.background","background"],["terminal.foreground","foreground"],["terminal.selectionBackground","selectionBackground"],["terminal.selectionForeground","selectionForeground"],["terminalCursor.foreground","cursor"],["terminalCursor.background","cursorAccent"],["terminal.ansiBlack","black"],["terminal.ansiRed","red"],["terminal.ansiGreen","green"],["terminal.ansiYellow","yellow"],["terminal.ansiBlue","blue"],["terminal.ansiMagenta","magenta"],["terminal.ansiCyan","cyan"],["terminal.ansiWhite","white"],["terminal.ansiBrightBlack","brightBlack"],["terminal.ansiBrightRed","brightRed"],["terminal.ansiBrightGreen","brightGreen"],["terminal.ansiBrightYellow","brightYellow"],["terminal.ansiBrightBlue","brightBlue"],["terminal.ansiBrightMagenta","brightMagenta"],["terminal.ansiBrightCyan","brightCyan"],["terminal.ansiBrightWhite","brightWhite"]];function Q(e){const n={};for(const[r,o]of z){const a=e[r];a&&(n[o]=a)}return n}function E(e){return e.replace(/^#/,"")}function U(e,n){const r=n?"vs-dark":"vs",o=[];if(e.tokenColors)for(const t of e.tokenColors){const s=Array.isArray(t.scope)?t.scope:t.scope?[t.scope]:[""];for(const c of s){const u={token:c};t.settings.foreground&&(u.foreground=E(t.settings.foreground)),t.settings.background&&(u.background=E(t.settings.background)),t.settings.fontStyle&&(u.fontStyle=t.settings.fontStyle),o.push(u)}}const a={};if(e.colors)for(const[t,s]of Object.entries(e.colors))a[t]=s;return{base:r,inherit:!0,rules:o,colors:a}}function J(e){let n="",r=0,o=!1;for(;r<e.length;){const a=e[r];if(o){if(a==="\\"){n+=a+(e[r+1]??""),r+=2;continue}a==='"'&&(o=!1),n+=a,r++;continue}if(a==='"'){o=!0,n+=a,r++;continue}if(a==="/"&&e[r+1]==="/"){for(r+=2;r<e.length&&e[r]!==`
|
|
1
|
+
import{bo as x}from"./BAqR9jtB.js";function m(e){const n=e.replace(/^#/,"");let r,o,a;if(n.length===3||n.length===4)r=parseInt(n[0]+n[0],16)/255,o=parseInt(n[1]+n[1],16)/255,a=parseInt(n[2]+n[2],16)/255;else if(n.length===6||n.length===8)r=parseInt(n.slice(0,2),16)/255,o=parseInt(n.slice(2,4),16)/255,a=parseInt(n.slice(4,6),16)/255;else return"0 0% 0%";const t=Math.max(r,o,a),s=Math.min(r,o,a),c=(t+s)/2;let u=0,g=0;if(t!==s){const p=t-s;switch(g=c>.5?p/(2-t-s):p/(t+s),t){case r:u=((o-a)/p+(o<a?6:0))/6;break;case o:u=((a-r)/p+2)/6;break;case a:u=((r-o)/p+4)/6;break}}const f=Math.round(u*360),d=Math.round(g*100),l=Math.round(c*100);return`${f} ${d}% ${l}%`}function N(e){const n=e.replace(/^#/,"");let r,o,a;if(n.length>=6)r=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),a=parseInt(n.slice(4,6),16);else if(n.length>=3)r=parseInt(n[0]+n[0],16),o=parseInt(n[1]+n[1],16),a=parseInt(n[2]+n[2],16);else return!0;return(.299*r+.587*o+.114*a)/255<.5}const X=[["editor.background","--background"],["editor.foreground","--foreground"],["sideBar.background","--sidebar"],["sideBar.foreground","--sidebar-foreground"],["sideBar.border","--sidebar-border"],["editorWidget.background","--card"],["editorWidget.foreground","--card-foreground"],["dropdown.background","--popover"],["dropdown.foreground","--popover-foreground"],["focusBorder","--ring"],["input.background","--input"],["panel.border","--border"],["editorGroup.border","--border"],["button.background","--primary"],["button.foreground","--primary-foreground"],["list.activeSelectionBackground","--secondary"],["list.activeSelectionForeground","--secondary-foreground"],["errorForeground","--danger"],["inputValidation.errorBackground","--danger-background"]];function B(e){const n=e.replace(/^#/,"");return n.length>=6?[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]:n.length>=3?[parseInt(n[0]+n[0],16),parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16)]:[0,0,0]}function M(e,n,r){const o=a=>Math.max(0,Math.min(255,Math.round(a)));return`#${o(e).toString(16).padStart(2,"0")}${o(n).toString(16).padStart(2,"0")}${o(r).toString(16).padStart(2,"0")}`}function G(e,n,r){const[o,a,t]=[e,n,r].map(s=>{const c=s/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)});return .2126*o+.7152*a+.0722*t}function k(e,n){const r=G(...e),o=G(...n),a=Math.max(r,o),t=Math.min(r,o);return(a+.05)/(t+.05)}function F(e){const n=e.match(/^([\d.]+)\s+([\d.]+)%\s+([\d.]+)%$/);if(!n)return[0,0,0];const r=Number(n[1]),o=Number(n[2])/100,a=Number(n[3])/100,t=(1-Math.abs(2*a-1))*o,s=t*(1-Math.abs(r/60%2-1)),c=a-t/2;return(r<60?[t,s,0]:r<120?[s,t,0]:r<180?[0,t,s]:r<240?[0,s,t]:r<300?[s,0,t]:[t,0,s]).map(g=>Math.round((g+c)*255))}function V(e,n,r){const o=F(e),t=F(n).map((s,c)=>s*(1-r)+o[c]*r);return m(M(...t))}function H(e,n){const r=F(e),o=F(n);if(k(r,o)>=4.55)return e;const a=[0,0,0],t=[255,255,255],s=k(a,o)>k(t,o)?a:t;for(let c=1;c<=20;c++){const u=c/20,g=r.map((f,d)=>f*(1-u)+s[d]*u);if(k(g,o)>=4.55)return m(M(...g))}return m(M(...s))}function _(e,n){const r=F(e),o=n.map(F),a=f=>Math.min(...o.map(d=>k(f,d))),t=4.55;if(a(r)>=t)return e;const s=e.match(/^([\d.]+)\s+([\d.]+)%\s+([\d.]+)%$/);if(!s)return e;const c=Number(s[1]);let u,g={value:e,ratio:a(r),distance:0};for(let f=0;f<=100;f++)for(let d=0;d<=100;d++){const l=`${c} ${f}% ${d}%`,p=F(l),b=a(p),i=p.reduce((R,I,A)=>R+(I-r[A])**2,0);b>=t?(!u||i<u.distance)&&(u={value:l,distance:i}):(b>g.ratio||b===g.ratio&&i<g.distance)&&(g={value:l,ratio:b,distance:i})}return u?.value??g.value}function K({fgHex:e,bgHexes:n,descriptionHex:r}){const o=B(e),a=n.map(B);let t;if(r)t=B(r);else{const[f,d,l]=a[0];t=[o[0]*.6+f*.4,o[1]*.6+d*.4,o[2]*.6+l*.4]}const s=4.5,c=20,u=f=>a.every(d=>k(f,d)>=s),g=[...t];for(let f=0;f<c&&!u(t);f++){const d=(f+1)/c;t=[g[0]*(1-d)+o[0]*d,g[1]*(1-d)+o[1]*d,g[2]*(1-d)+o[2]*d]}return m(M(...t))}function Y(e,n,r){const o=B(e),a=B(n),t=G(...o),s=G(...a),c=1.12;if((Math.max(t,s)+.05)/(Math.min(t,s)+.05)>=c)return m(e);const f=t>s||t===s&&!r?[255,255,255]:[0,0,0],d=20;let l=[...o];for(let p=1;p<=d;p++){const b=p/d;l=[o[0]*(1-b)+f[0]*b,o[1]*(1-b)+f[1]*b,o[2]*(1-b)+f[2]*b];const i=G(...l);if((Math.max(i,s)+.05)/(Math.min(i,s)+.05)>=c)break}return m(M(...l))}function O(e){const n=B(e),r=N(e)?[255,255,255]:[0,0,0],o=1.2,a=20;let t=[...n];for(let s=1;s<=a;s++){const c=s/a;if(t=[n[0]*(1-c)+r[0]*c,n[1]*(1-c)+r[1]*c,n[2]*(1-c)+r[2]*c],k(t,n)>=o)break}return m(M(...t))}function $(e,n,r){const o=B(e),a=n.map(B),t=3.1,s=d=>Math.min(...a.map(l=>k(d,l)));if(s(o)>=t)return m(e);const u=r?[255,255,255]:[0,0,0],g=20;let f=[...o];for(let d=1;d<=g;d++){const l=d/g;if(f=[o[0]*(1-l)+u[0]*l,o[1]*(1-l)+u[1]*l,o[2]*(1-l)+u[2]*l],s(f)>=t)break}return m(M(...f))}function j(e){const n=e["editor.background"];if(!n)return null;const r=e.focusBorder??e["button.background"]??e["badge.background"];if(!r)return null;const o=B(n),a=B(r),t=N(n),s=t?.12:.08,c=[o[0]*(1-s)+a[0]*s,o[1]*(1-s)+a[1]*s,o[2]*(1-s)+a[2]*s],u=B(e["editor.foreground"]??(t?"#ffffff":"#000000"));let g=[...a];const f=4.5,d=20,l=b=>k(b,o)>=f&&k(b,c)>=3,p=[...g];for(let b=0;b<d&&!l(g);b++){const i=(b+1)/d;g=[p[0]*(1-i)+u[0]*i,p[1]*(1-i)+u[1]*i,p[2]*(1-i)+u[2]*i]}return{accent:m(M(...c)),accentForeground:m(M(...g))}}function q(e,n){const r={};for(const[i,R]of X){if(r[R])continue;const I=e[i];I&&(r[R]=m(I))}const o=j(e);o&&(r["--accent"]=o.accent,r["--accent-foreground"]=o.accentForeground);const a=e["editor.foreground"],t=e["editor.background"];if(a&&t){const i=[t];e["sideBar.background"]&&i.push(e["sideBar.background"]),e["editorWidget.background"]&&i.push(e["editorWidget.background"]),r["--muted-foreground"]=K({fgHex:a,bgHexes:i,descriptionHex:e.descriptionForeground});const R=e["tab.inactiveBackground"]??e["sideBar.background"]??t,I=N(t);r["--muted"]=Y(R,t,I);const A=[t,e["editorWidget.background"],e["dropdown.background"],e["sideBar.background"]].filter(S=>!!S),P=e["panel.border"]??e["editorGroup.border"],D=e["input.border"]??e["input.background"]??P??t;r["--input"]=$(D,A,I);const W=e.focusBorder??e["button.background"]??P??t;r["--ring"]=$(W,A,I);const y=B(a),w=B(t);{const S=[y[0]*.6+w[0]*.4,y[1]*.6+w[1]*.4,y[2]*.6+w[2]*.4];let C=[...S];const L=4.5,T=20;for(let v=0;v<T&&!(k(C,w)>=L);v++){const h=(v+1)/T;C=[S[0]*(1-h)+y[0]*h,S[1]*(1-h)+y[1]*h,S[2]*(1-h)+y[2]*h]}r["--text-subtle"]=m(M(...C))}{const S=[w[0]*.65+y[0]*.35,w[1]*.65+y[1]*.35,w[2]*.65+y[2]*.35];let C=[...S];const L=2,T=15;for(let v=0;v<T&&!(k(C,w)>=L);v++){const h=(v+1)/T;C=[S[0]*(1-h)+y[0]*h,S[1]*(1-h)+y[1]*h,S[2]*(1-h)+y[2]*h]}r["--text-ghost"]=m(M(...C))}}else e.descriptionForeground&&(r["--muted-foreground"]=m(e.descriptionForeground));t&&(r["--border"]??=O(t),r["--sidebar-border"]??=O(e["sideBar.background"]??t));const s=n?{background:"#1f1f24",foreground:"#f7f7f7",primary:"#009966",primaryForeground:"#171717",secondary:"#1c1c1c",secondaryForeground:"#f7f7f7",muted:"#121217",mutedForeground:"#b8b5c2",accent:"#182c25",accentForeground:"#7de3bd",danger:"#f38b8b",dangerBackground:"#361010",border:"#4d4a52",input:"#121217",ring:"#6eddb4",info:"#72d2fa",infoForeground:"#171717",success:"#22c55e",successForeground:"#171717",warning:"#facc15",warningForeground:"#171717",sidebar:"#0d0d10",sidebarForeground:"#f7f7f7",sidebarAccent:"#242424",sidebarBorder:"#4d4a52"}:{background:"#ffffff",foreground:"#171717",primary:"#007a4d",primaryForeground:"#ffffff",secondary:"#f5f5f5",secondaryForeground:"#171717",muted:"#e8e8e8",mutedForeground:"#474747",accent:"#e7f3ee",accentForeground:"#00663f",danger:"#930b0b",dangerBackground:"#fde7e7",border:"#d9d9d9",input:"#e6e6e6",ring:"#006ac2",info:"#006ac2",infoForeground:"#ffffff",success:"#117a37",successForeground:"#ffffff",warning:"#dc9400",warningForeground:"#171717",sidebar:"#f7f7f8",sidebarForeground:"#171717",sidebarAccent:"#e8e8e8",sidebarBorder:"#d9d9d9"},c=i=>m(s[i]);r["--background"]??=c("background"),r["--foreground"]??=c("foreground"),r["--card"]??=r["--background"],r["--card-foreground"]??=r["--foreground"],r["--popover"]??=r["--card"],r["--popover-foreground"]??=r["--card-foreground"],r["--primary"]??=c("primary"),r["--primary-foreground"]??=c("primaryForeground"),r["--secondary"]??=c("secondary"),r["--secondary-foreground"]??=c("secondaryForeground"),r["--muted"]??=c("muted"),r["--muted-foreground"]??=c("mutedForeground"),r["--accent"]??=c("accent"),r["--accent-foreground"]??=c("accentForeground"),r["--danger"]??=c("danger"),r["--danger-background"]??=c("dangerBackground"),r["--border"]??=c("border"),r["--input"]??=c("input"),r["--ring"]??=c("ring"),r["--info"]=m(e["editorInfo.foreground"]??s.info),r["--info-foreground"]=c("infoForeground"),r["--success"]=m(e["testing.iconPassed"]??e["gitDecoration.addedResourceForeground"]??s.success),r["--success-foreground"]=c("successForeground"),r["--warning"]=m(e["editorWarning.foreground"]??s.warning),r["--warning-foreground"]=c("warningForeground"),r["--sidebar"]??=c("sidebar"),r["--sidebar-foreground"]??=c("sidebarForeground"),r["--sidebar-accent"]=r["--secondary"]??c("sidebarAccent"),r["--sidebar-accent-foreground"]=r["--sidebar-foreground"],r["--sidebar-border"]??=c("sidebarBorder");const u=[["--foreground","--background"],["--card-foreground","--card"],["--popover-foreground","--popover"],["--primary-foreground","--primary"],["--secondary-foreground","--secondary"],["--accent-foreground","--accent"],["--muted-foreground","--muted"],["--info-foreground","--info"],["--success-foreground","--success"],["--warning-foreground","--warning"],["--sidebar-foreground","--sidebar"],["--sidebar-accent-foreground","--sidebar-accent"]];for(const[i,R]of u)r[i]=H(r[i],r[R]);const g=["--danger-background","--background","--card","--popover","--muted","--sidebar"],f=r["--danger"];r["--danger"]=_(f,g.map(i=>r[i]));const d=F(r["--danger"]);g.every(i=>k(d,F(r[i]))>=4.55)||(r["--danger-background"]=r["--background"],r["--danger"]=_(f,g.map(i=>r[i]))),r["--primary-ink"]=_(r["--primary"],[r["--background"],r["--card"]]);const p=r["--warning"],b=[r["--background"],r["--card"]];return r["--warning-ink"]=_(p,[...b,...b.map(i=>V(p,i,.1))]),r}const z=[["terminal.background","background"],["terminal.foreground","foreground"],["terminal.selectionBackground","selectionBackground"],["terminal.selectionForeground","selectionForeground"],["terminalCursor.foreground","cursor"],["terminalCursor.background","cursorAccent"],["terminal.ansiBlack","black"],["terminal.ansiRed","red"],["terminal.ansiGreen","green"],["terminal.ansiYellow","yellow"],["terminal.ansiBlue","blue"],["terminal.ansiMagenta","magenta"],["terminal.ansiCyan","cyan"],["terminal.ansiWhite","white"],["terminal.ansiBrightBlack","brightBlack"],["terminal.ansiBrightRed","brightRed"],["terminal.ansiBrightGreen","brightGreen"],["terminal.ansiBrightYellow","brightYellow"],["terminal.ansiBrightBlue","brightBlue"],["terminal.ansiBrightMagenta","brightMagenta"],["terminal.ansiBrightCyan","brightCyan"],["terminal.ansiBrightWhite","brightWhite"]];function Q(e){const n={};for(const[r,o]of z){const a=e[r];a&&(n[o]=a)}return n}function E(e){return e.replace(/^#/,"")}function U(e,n){const r=n?"vs-dark":"vs",o=[];if(e.tokenColors)for(const t of e.tokenColors){const s=Array.isArray(t.scope)?t.scope:t.scope?[t.scope]:[""];for(const c of s){const u={token:c};t.settings.foreground&&(u.foreground=E(t.settings.foreground)),t.settings.background&&(u.background=E(t.settings.background)),t.settings.fontStyle&&(u.fontStyle=t.settings.fontStyle),o.push(u)}}const a={};if(e.colors)for(const[t,s]of Object.entries(e.colors))a[t]=s;return{base:r,inherit:!0,rules:o,colors:a}}function J(e){let n="",r=0,o=!1;for(;r<e.length;){const a=e[r];if(o){if(a==="\\"){n+=a+(e[r+1]??""),r+=2;continue}a==='"'&&(o=!1),n+=a,r++;continue}if(a==='"'){o=!0,n+=a,r++;continue}if(a==="/"&&e[r+1]==="/"){for(r+=2;r<e.length&&e[r]!==`
|
|
2
2
|
`;)r++;continue}if(a==="/"&&e[r+1]==="*"){for(r+=2;r<e.length&&!(e[r]==="*"&&e[r+1]==="/");)r++;r+=2;continue}n+=a,r++}return n=n.replace(/,(\s*[}\]])/g,"$1"),n}function rr(e){if(!e||typeof e!="object")throw new Error("Invalid theme: expected an object");const n=e;if(!n.colors&&!n.tokenColors)throw new Error('Invalid theme: must contain "colors" or "tokenColors"');const r=n.colors??{};let o;return n.type==="light"||n.type==="hc-light"?o=!1:n.type==="dark"||n.type==="hc-black"?o=!0:r["editor.background"]?o=N(r["editor.background"]):o=!0,{name:n.name??x.settings_themeImport_fallbackName_label(),type:o?"dark":"light",cssVariables:q(r,o),monacoTheme:U(n,o),terminalColors:Q(r),rawColors:{...r}}}export{rr as p,J as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as xt}from"./
|
|
1
|
+
import{p as xt}from"./CM7ZaQP_.js";import{aZ as gt,U as $t,Y as bt,b0 as wt,V as Ct,a_ as vt,b as s,ay as O,aX as Dt,B as kt,r as Tt,q as U,W as Z,O as At,a6 as ot}from"./Bpy6Muvw.js";import{p as Bt}from"./BxiJOwnz.js";var rt=s(()=>({domains:new Map,transitions:[]}),"createDefaultData"),H=rt(),St=s(()=>H.domains,"getDomains"),Mt=s(()=>H.transitions,"getTransitions"),zt=s(t=>{if(t)for(const e of t){const n=e.domain,a=(e.items??[]).map(c=>({label:c.label}));H.domains.set(n,{name:n,items:a})}},"setDomains"),Lt=s(t=>{t&&(H.transitions=t.filter(e=>e.from===e.to?(O.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=s(()=>U({...At.cynefin,...Z().cynefin}),"getConfig"),Pt=s(()=>{Tt(),H=rt()},"clear"),G={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:vt,getAccTitle:Ct,setDiagramTitle:wt,getDiagramTitle:bt,getAccDescription:$t,setAccDescription:gt},Wt=s(t=>{xt(t,G),G.setDomains(t.domains),G.setTransitions(t.transitions)},"populate"),It={parse:s(async t=>{const e=await Bt("cynefin",t);O.debug(e),Wt(e)},"parse")};function E(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}s(E,"seededRandom");function st(t){let e=0;for(let n=0;n<t.length;n++){const a=t.charCodeAt(n);e=(e<<5)-e+a,e|=0}return e}s(st,"hashString");function it(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:st(e)}s(it,"resolveSeed");function ct(t,e,n,a){const c=t/2,m=a??t*.015,v=7,I=e/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*17)*m*2-m;d.push({x:c+p,y:o*I})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.y+i.y)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*31+7),R=p.x+h,V=f,_=i.x-h;D+=` C${R},${V} ${_},${f} ${i.x},${i.y}`}return D}s(ct,"generateFoldPath");function lt(t,e,n,a){const c=e/2,m=a??e*.015,v=7,I=t/v,d=[];for(let o=0;o<=v;o++){const p=E(n+o*23)*m*2-m;d.push({x:o*I,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let o=0;o<d.length-1;o++){const p=d[o],i=d[o+1],f=(p.x+i.x)/2,b=o%2===0?1:-1,h=m*1.5*b*E(n+o*37+11),R=f,V=p.y+h,_=f,z=i.y-h;D+=` C${R},${V} ${_},${z} ${i.x},${i.y}`}return D}s(lt,"generateHorizontalBoundary");function dt(t,e){const n=t/2,a=e*.5,c=e,m=t*.03;return[`M${n},${a}`,`C${n+m},${a+(c-a)*.2}`,`${n-m*1.5},${a+(c-a)*.55}`,`${n+m*.5},${a+(c-a)*.75}`,`C${n-m},${a+(c-a)*.85}`,`${n+m*.3},${a+(c-a)*.95}`,`${n},${c}`].join(" ")}s(dt,"generateCliffPath");function ft(t,e,n,a){return[`M${t-n},${e}`,`A${n},${a} 0 1,1 ${t+n},${e}`,`A${n},${a} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}s(ft,"generateConfusionPath");var at={complex:{model:"Probe → Sense → Respond",practice:"Emergent Practices"},complicated:{model:"Sense → Analyse → Respond",practice:"Good Practices"},clear:{model:"Sense → Categorise → Respond",practice:"Best Practices"},chaotic:{model:"Act → Sense → Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Rt=s((t,e)=>{const n=t/2,a=e/2;return{complex:{cx:n/2,cy:a/2,x:0,y:0,w:n,h:a},complicated:{cx:n+n/2,cy:a/2,x:n,y:0,w:n,h:a},chaotic:{cx:n/2,cy:a+a/2,x:0,y:a,w:n,h:a},clear:{cx:n+n/2,cy:a+a/2,x:n,y:a,w:n,h:a},confusion:{cx:n,cy:a,x:n*.7,y:a*.7,w:n*.6,h:a*.6}}},"getDomainLayouts"),Vt=s(()=>{const t=ot(),e=Z();return U(t,e.themeVariables).cynefin},"getCynefinDomainColors"),q=3,_t=s((t,e,n,a)=>{const c=a.db,m=c.getDomains(),v=c.getTransitions(),I=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),o=c.getConfig(),p=Vt();O.debug("Rendering Cynefin diagram");const i=o.width,f=o.height,b=o.padding,h=o.showDomainDescriptions,R=o.boundaryAmplitude,V=i+b*2,_=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=Dt(e);kt(k,_,V,o.useMaxWidth??!0),k.attr("viewBox",`0 0 ${V} ${_}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);const T=k.append("g").attr("transform",`translate(${b}, ${b})`),F=Rt(i,f),Q=it(o.seed,e),mt=T.append("g").attr("class","cynefin-backgrounds"),X=["complex","complicated","chaotic","clear"];for(const l of X){const r=F[l];mt.append("rect").attr("class","cynefinDomain").attr("x",r.x).attr("y",r.y).attr("width",r.w).attr("height",r.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}const j=T.append("g").attr("class","cynefin-boundaries");j.append("path").attr("class","cynefinBoundary").attr("d",ct(i,f,Q,R)).attr("fill","none"),j.append("path").attr("class","cynefinBoundary").attr("d",lt(i,f,Q+100,R)).attr("fill","none"),j.append("path").attr("class","cynefinCliff").attr("d",dt(i,f)).attr("fill","none");const pt=i*.15,yt=f*.15;T.append("path").attr("class","cynefinConfusion").attr("d",ft(i/2,f/2,pt,yt)).attr("fill",z.confusion).attr("fill-opacity",.5);const J=T.append("g").attr("class","cynefin-labels");for(const l of X){const r=F[l];J.append("text").attr("class","cynefinDomainLabel").attr("x",r.cx).attr("y",h?r.cy-30:r.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(J.append("text").attr("class","cynefinDomainLabel").attr("x",i/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){const l=T.append("g").attr("class","cynefin-subtitles");for(const r of X){const u=F[r],y=at[r];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",i/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(at.confusion.practice)}const K=T.append("g").attr("class","cynefin-items"),A=26,tt=10,ut=["complex","complicated","chaotic","clear","confusion"];for(const l of ut){const r=m.get(l);if(!r||r.items.length===0)continue;const u=F[l],y=l==="confusion";let L=r.items,N=0;y&&r.items.length>q&&(N=r.items.length-q,L=r.items.slice(0,q));let B;if(y){const g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{const w=B+S*(A+4),M=K.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label);let $=g.label.length*7;const x=P.node();if(x&&typeof x.getBBox=="function"){const Y=x.getBBox();Y.width>0&&($=Y.width)}const C=$+tt*2,W=u.cx-C/2;M.attr("transform",`translate(${W}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",A/2)}),N>0){const g=B+L.length*(A+4),S=`+${N} more`,w=K.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S);let P=S.length*7;const $=M.node();if($&&typeof $.getBBox=="function"){const W=$.getBBox();W.width>0&&(P=W.width)}const x=P+tt*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){const l=k.select("defs").empty()?k.append("defs"):k.select("defs"),r=`cynefin-arrow-${e}`;l.append("marker").attr("id",r).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");const u=T.append("g").attr("class","cynefin-arrows");v.forEach(y=>{const L=F[y.from],N=F[y.to];if(!L||!N)return;if(y.from===y.to){O.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}const B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),W=C*.15,Y=-x/C,ht=$/C,et=M+Y*W,nt=P+ht*W;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${et},${nt} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${r})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",et).attr("y",nt-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}I&&T.append("text").attr("class","cynefinTitle").attr("x",i/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(I)},"draw"),Ft={draw:_t},Et=s(()=>{const t=ot(),e=Z();return U(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=s(()=>{const t=Et();return`
|
|
2
2
|
.cynefinDomain {
|
|
3
3
|
stroke: none;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Z as ce,ai as q,ar as Ce}from"./SAR1HpYu.js";import{bU as Le,cS as le,cj as ue,ci as ve}from"./li27w4Od.js";import{Hm as p,Af as we,bA as be,c as Fe,Jp as de,i0 as me,bM as ke,Ca as z,AG as Ge,f0 as Pe,yM as xe,dY as Ee,eY as fe,dX as _e,zc as Ve,J3 as Ue,uW as Be}from"./DaA44xVk.js";import{aB as Ae,dB as he,A as H,P as ge,ax as K}from"./BMoOyvL9.js";import{ax as $e}from"./D7b_n5fi.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BJzHxIyr.js";import{n as Q}from"./DNPjjQTW.js";import"./DYhIMPy1.js";import{bo as n}from"./BV49_RX-.js";import"./DU64vtBR.js";import"./C9Ba8Wsx.js";import"./CiN55CeC.js";import{R as Re}from"./BvFAWM27.js";import{L as Ye}from"./D8dE5NKO.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
|
|
1
|
+
var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Z as ce,ai as q,ar as Ce}from"./i92hRJko.js";import{bU as Le,cS as le,cj as ue,ci as ve}from"./BCDWZbwh.js";import{Hp as p,Ai as we,bA as be,c as Fe,Js as de,i2 as me,bM as ke,Cd as z,AJ as Ge,f0 as Pe,yP as xe,dY as Ee,eY as fe,dX as _e,zf as Ve,J6 as Ue,uZ as Be}from"./BSwWMzab.js";import{aB as Ae,dB as he,A as H,P as ge,ax as K}from"./DY6JypjK.js";import{ax as $e}from"./C9gP-gRX.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BJzHxIyr.js";import{n as Q}from"./Bc-8qHYh.js";import"./DYhIMPy1.js";import{bo as n}from"./BAqR9jtB.js";import"./BPk16bSc.js";import"./DiCMHWTR.js";import"./7ZJvg7ev.js";import{R as Re}from"./BvFAWM27.js";import{L as Ye}from"./D8dE5NKO.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as l,bq as i,by as m,b as u}from"./
|
|
1
|
+
import{t as l,bq as i,by as m,b as u}from"./BAqR9jtB.js";import{bs as f,bI as _,c5 as b,a7 as g,ay as h,W as v,bn as y,aA as o}from"./DYhIMPy1.js";import{s as z}from"./DiCMHWTR.js";import{ac as C}from"./C9gP-gRX.js";function S(s,t){if(new.target)return l({component:S,...s});f(t,!0);let a=i(t,"size",7,"default"),r=i(t,"children",7);_(C,b(()=>a()));var c={get size(){return a()},set size(e="default"){a(e),o()},get children(){return r()},set children(e){r(e),o()},$set:m,$on:(e,d)=>u(t,e,d)},n=g(),p=h(n);return z(p,r),v(s,n),y(c)}export{S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as n}from"./
|
|
1
|
+
import{g as p,r as u,d as n}from"./B1Rrvp0b.js";import{p as f}from"./CM7ZaQP_.js";import{b as a,ay as o}from"./Bpy6Muvw.js";import{M as c,c as d}from"./BxiJOwnz.js";var v=d().RailroadAbnf.parser.LangiumParser,i=a(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=a(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=a(e=>{if(e.includes("*")){const[t,s]=e.split("*"),l=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:l,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=a(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=a(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return i(e.element);case"AbnfOptionalGroup":return{type:"optional",element:i(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=a(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=a(e=>{f(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(P(r)))},"populateDb"),R={parse:a(e=>{n.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:n}},w={parser:R,db:n,renderer:u,styles:p};export{w as diagram};
|