@intent-hq/web 2.330.0 → 2.331.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/{CEA4WprY.js → -K8wVqNz.js} +1 -1
- package/web/app/immutable/chunks/{CNEXeIWq.js → 01xZ54YC.js} +2 -2
- package/web/app/immutable/chunks/{DsmIFgBW.js → 0BYYiVms.js} +1 -1
- package/web/app/immutable/chunks/{BWBt_0S9.js → 1bECqo-j.js} +1 -1
- package/web/app/immutable/chunks/{dhHWeHB7.js → 3QqszLYa.js} +1 -1
- package/web/app/immutable/chunks/{CGWrDwo6.js → 4XNONbWq.js} +1 -1
- package/web/app/immutable/chunks/{vrmnmJTo.js → 4dgb2d4o.js} +1 -1
- package/web/app/immutable/chunks/{CmgsU15D.js → 4q6E5opn.js} +1 -1
- package/web/app/immutable/chunks/{DrdCoP-L.js → 5CRwyeUL.js} +2 -2
- package/web/app/immutable/chunks/{CrJDbXeR.js → 5mKZ17P9.js} +1 -1
- package/web/app/immutable/chunks/{0W7Jbq6n.js → 61i9Nc66.js} +1 -1
- package/web/app/immutable/chunks/{DpFreuz_.js → 72TQselO.js} +1 -1
- package/web/app/immutable/chunks/{DH_PNr-8.js → 79sYHzZU.js} +1 -1
- package/web/app/immutable/chunks/{r_PLSAE7.js → 8mBhsgHs.js} +1 -1
- package/web/app/immutable/chunks/{Dvh0fZaP.js → 9DtejLvs.js} +1 -1
- package/web/app/immutable/chunks/{Dr4yXXs1.js → 9SVo7XCQ.js} +1 -1
- package/web/app/immutable/chunks/{CFP6h_yj.js → A67C19bI.js} +1 -1
- package/web/app/immutable/chunks/{4rPACIPc.js → AUoP55vG.js} +1 -1
- package/web/app/immutable/chunks/{Cn1b85JG.js → ArzfqCkr.js} +1 -1
- package/web/app/immutable/chunks/{ClUsr6sz.js → B-3aWyWM.js} +1 -1
- package/web/app/immutable/chunks/{Ck1t7lzU.js → B0CAZcrL.js} +1 -1
- package/web/app/immutable/chunks/{V-pYlOFT.js → B0do3DVm.js} +1 -1
- package/web/app/immutable/chunks/{DrQfmm9r.js → B0hlE4IJ.js} +1 -1
- package/web/app/immutable/chunks/{F5JMTljA.js → B0ztGBdw.js} +1 -1
- package/web/app/immutable/chunks/{DoVePPmG.js → B4--vvYs.js} +1 -1
- package/web/app/immutable/chunks/{ikj2reaR.js → B4585dIt.js} +1 -1
- package/web/app/immutable/chunks/{CAmF3PXk.js → B66L8YEe.js} +1 -1
- package/web/app/immutable/chunks/{ByQ08O_R.js → B6hMBAzw.js} +1 -1
- package/web/app/immutable/chunks/{D7CwqOyk.js → B7pBUSNy.js} +1 -1
- package/web/app/immutable/chunks/{Cx-79P8l.js → B8Qavkks.js} +1 -1
- package/web/app/immutable/chunks/{BICcGRy9.js → B9PO2UZy.js} +1 -1
- package/web/app/immutable/chunks/{CfG5iS_N.js → B9vJwMca.js} +1 -1
- package/web/app/immutable/chunks/{DlOjrEkG.js → BADXJ9gY.js} +1 -1
- package/web/app/immutable/chunks/{DiCGl5kq.js → BBIyvTX5.js} +3 -3
- package/web/app/immutable/chunks/{z4RHZh7P.js → BD5-GbKS.js} +1 -1
- package/web/app/immutable/chunks/{CBoIo15V.js → BD9kDOxT.js} +1 -1
- package/web/app/immutable/chunks/{Bi15WK7m.js → BEisWjsh.js} +1 -1
- package/web/app/immutable/chunks/{BF3lDslR.js → BEtQ8T77.js} +1 -1
- package/web/app/immutable/chunks/{kNiuD9tS.js → BHKTKUUz.js} +1 -1
- package/web/app/immutable/chunks/{YSPfcYKn.js → BHhmm7k4.js} +1 -1
- package/web/app/immutable/chunks/{C9R-YW9d.js → BHuNDg-W.js} +1 -1
- package/web/app/immutable/chunks/{C_nJgshO.js → BJWZv5Sk.js} +1 -1
- package/web/app/immutable/chunks/{CMnxgVrV.js → BL-QaGSE.js} +1 -1
- package/web/app/immutable/chunks/{DOqguBrF.js → BLwfMBUc.js} +1 -1
- package/web/app/immutable/chunks/{1BCEBCxj.js → BMEM9WGe.js} +1 -1
- package/web/app/immutable/chunks/{Cpc4w0Bm.js → BNQhz-c4.js} +1 -1
- package/web/app/immutable/chunks/{Dqy2jMvN.js → BPu-f3m6.js} +1 -1
- package/web/app/immutable/chunks/{B9ylxCBv.js → BRxNa3zf.js} +1 -1
- package/web/app/immutable/chunks/{BNC-J9Pl.js → BU2dz_aB.js} +1 -1
- package/web/app/immutable/chunks/{D3VNRPKq.js → BVZOiDhO.js} +4 -4
- package/web/app/immutable/chunks/{BSVIIPqo.js → BXKILicD.js} +1 -1
- package/web/app/immutable/chunks/{CFcAdFFD.js → BX_A8Fz4.js} +1 -1
- package/web/app/immutable/chunks/BXdz7Mej.js +1 -0
- package/web/app/immutable/chunks/BXyIWb9p.js +1 -0
- package/web/app/immutable/chunks/{-CNzmNt8.js → BZ_DkSCc.js} +1 -1
- package/web/app/immutable/chunks/{CJ0z1v-C.js → B_X9fjxm.js} +1 -1
- package/web/app/immutable/chunks/{D2jMyaf8.js → Bd4BZaTp.js} +1 -1
- package/web/app/immutable/chunks/{Cm3D0ZVR.js → Be7sI0Wr.js} +1 -1
- package/web/app/immutable/chunks/{DCHEHwiS.js → Bkcm6WO0.js} +1 -1
- package/web/app/immutable/chunks/{BLZx5Jln.js → Bkeityp2.js} +1 -1
- package/web/app/immutable/chunks/{BLYi9_ai.js → Bl2M7dQb.js} +1 -1
- package/web/app/immutable/chunks/{jho6TGJn.js → Blawqk8W.js} +1 -1
- package/web/app/immutable/chunks/{BVEChIvV.js → Bncjw5PN.js} +2 -2
- package/web/app/immutable/chunks/{jonfRsD6.js → BqjPyYOt.js} +1 -1
- package/web/app/immutable/chunks/BrQIXt6A.js +1 -0
- package/web/app/immutable/chunks/{dWvje8eu.js → Bs48vxzD.js} +1 -1
- package/web/app/immutable/chunks/{CB2xLjY4.js → BsKm9b4M.js} +1 -1
- package/web/app/immutable/chunks/{DwAHzX3q.js → Bss6gHyN.js} +1 -1
- package/web/app/immutable/chunks/{Bbr8E1-T.js → BtYbNvgG.js} +1 -1
- package/web/app/immutable/chunks/{QF0bJN4h.js → BtjBnfiA.js} +1 -1
- package/web/app/immutable/chunks/{B4nCDPQA.js → BulkbkYU.js} +1 -1
- package/web/app/immutable/chunks/{BFeR9qbJ.js → BurMbBp5.js} +1 -1
- package/web/app/immutable/chunks/{lOSCBcaC.js → Bvupquu5.js} +1 -1
- package/web/app/immutable/chunks/{B5nDENeQ.js → BxX3m2UX.js} +1 -1
- package/web/app/immutable/chunks/{D8tsE2-F.js → By8Sq-ft.js} +1 -1
- package/web/app/immutable/chunks/{CTf3pgnM.js → ByQXhpKS.js} +1 -1
- package/web/app/immutable/chunks/{bXZvOnOg.js → C-5H7e4K.js} +1 -1
- package/web/app/immutable/chunks/{C376IId1.js → C-gRduKt.js} +1 -1
- package/web/app/immutable/chunks/{BQVyHt6n.js → C02TD_sM.js} +1 -1
- package/web/app/immutable/chunks/{rw7bge4F.js → C05u3DrM.js} +1 -1
- package/web/app/immutable/chunks/C1LegaQy.js +1 -0
- package/web/app/immutable/chunks/{BN9lTuka.js → C1uebkkA.js} +1 -1
- package/web/app/immutable/chunks/{D7e2XTJl.js → C23vUV7W.js} +1 -1
- package/web/app/immutable/chunks/{Crq31h4w.js → C2dNFWEv.js} +1 -1
- package/web/app/immutable/chunks/{9JfuDVAI.js → C2winPI_.js} +1 -1
- package/web/app/immutable/chunks/{CsfPzyL6.js → C4byWn93.js} +1 -1
- package/web/app/immutable/chunks/{DShjTjco.js → C6VOY2Ed.js} +1 -1
- package/web/app/immutable/chunks/{CTPvu81o.js → C8xZ0qNv.js} +1 -1
- package/web/app/immutable/chunks/{BXQHI4eX.js → C9dmGIaz.js} +1 -1
- package/web/app/immutable/chunks/{91BV6KFP.js → CBsVLKPu.js} +1 -1
- package/web/app/immutable/chunks/{BlCPsgO4.js → CC8PUB7z.js} +2 -2
- package/web/app/immutable/chunks/{DRuEOkw4.js → CCxHAHqB.js} +1 -1
- package/web/app/immutable/chunks/{rj2N2X77.js → CD3weFBA.js} +1 -1
- package/web/app/immutable/chunks/{DUJSEf2g.js → CDYYgEuj.js} +2 -2
- package/web/app/immutable/chunks/{0VQsaIc5.js → CDksRI-c.js} +1 -1
- package/web/app/immutable/chunks/{BQpK3CeI.js → CFukky70.js} +1 -1
- package/web/app/immutable/chunks/{bmdvISxl.js → CH4TOBlm.js} +1 -1
- package/web/app/immutable/chunks/{B9GX4VRk.js → CIBo29o4.js} +1 -1
- package/web/app/immutable/chunks/{BasqomxX.js → CKOIJ0IP.js} +1 -1
- package/web/app/immutable/chunks/{fm9pZz0d.js → CLUAF-ra.js} +3 -3
- package/web/app/immutable/chunks/{CBAaIsiA.js → CNMI-zGd.js} +1 -1
- package/web/app/immutable/chunks/{XA_y_9lT.js → CNbjMDZm.js} +48 -48
- package/web/app/immutable/chunks/{BcNmLUvA.js → CO_V-6EQ.js} +1 -1
- package/web/app/immutable/chunks/{CqYT7Dd6.js → CPO35toG.js} +1 -1
- package/web/app/immutable/chunks/{CyvkPwON.js → CPa4nnG1.js} +1 -1
- package/web/app/immutable/chunks/{B2Pgyqsq.js → CPiRiDCt.js} +1 -1
- package/web/app/immutable/chunks/{DwJV5y_l.js → CPizSuTO.js} +1 -1
- package/web/app/immutable/chunks/{fthv3J-S.js → CURSeRFX.js} +1 -1
- package/web/app/immutable/chunks/{CY94okR1.js → CY6hJTg2.js} +1 -1
- package/web/app/immutable/chunks/{BveuvcUn.js → CYl6Lvh4.js} +3 -3
- package/web/app/immutable/chunks/{g6g5zZQD.js → CZb8tVz5.js} +1 -1
- package/web/app/immutable/chunks/{56Ve4phw.js → C_9ekWa1.js} +4 -4
- package/web/app/immutable/chunks/{FZGh-nAC.js → CaHWmzVB.js} +1 -1
- package/web/app/immutable/chunks/{CRl3Fhij.js → CbCE1pwF.js} +1 -1
- package/web/app/immutable/chunks/{B2ywnjG_.js → CdqUGZeZ.js} +1 -1
- package/web/app/immutable/chunks/{C2scFn3X.js → Cf7_9vnO.js} +1 -1
- package/web/app/immutable/chunks/{Bx0bz20m.js → Ch0hL0V-.js} +3 -3
- package/web/app/immutable/chunks/{C9eE8ZXy.js → ChIqxVTs.js} +1 -1
- package/web/app/immutable/chunks/{D84UKAzR.js → CiLnzvU7.js} +1 -1
- package/web/app/immutable/chunks/{cYR0zuXX.js → CjMEl34P.js} +1 -1
- package/web/app/immutable/chunks/{C0wuuFa7.js → Cl0TebPK.js} +1 -1
- package/web/app/immutable/chunks/{CkAAitlR.js → CloY0vJA.js} +1 -1
- package/web/app/immutable/chunks/{4Tv95AMr.js → CnAtabD8.js} +1 -1
- package/web/app/immutable/chunks/{CCQJkGZ_.js → CoeEqCAd.js} +1 -1
- package/web/app/immutable/chunks/{Bx30GctV.js → CqoECVux.js} +1 -1
- package/web/app/immutable/chunks/{DwIsNA5R.js → CrKYeBTQ.js} +1 -1
- package/web/app/immutable/chunks/{aUxeG-_E.js → Cv1ykEZ5.js} +1 -1
- package/web/app/immutable/chunks/{BmS-LVXj.js → CvJKDv5e.js} +1 -1
- package/web/app/immutable/chunks/{DYfj3lcw.js → CvTcUzFW.js} +1 -1
- package/web/app/immutable/chunks/{8t0Gx_mY.js → CvurNR1W.js} +3 -3
- package/web/app/immutable/chunks/{Ddaozz5f.js → CwWxAoHb.js} +1 -1
- package/web/app/immutable/chunks/{D7_Jc752.js → Cwey7ct7.js} +1 -1
- package/web/app/immutable/chunks/{Bsz0mK8i.js → CxEB7RsJ.js} +1 -1
- package/web/app/immutable/chunks/{D-W1GPTx.js → Cxjclr_4.js} +1 -1
- package/web/app/immutable/chunks/{BGq45CP4.js → CzHSdjMD.js} +1 -1
- package/web/app/immutable/chunks/{DomfbKVx.js → D-TU-2ME.js} +1 -1
- package/web/app/immutable/chunks/{BdJ2kTDg.js → D-mqBiUo.js} +1 -1
- package/web/app/immutable/chunks/{CTld-PL6.js → D-uhCX3w.js} +1 -1
- package/web/app/immutable/chunks/{CRSENXWv.js → D09nC1GH.js} +1 -1
- package/web/app/immutable/chunks/{83fIOp0Q.js → D1gMVCw_.js} +1 -1
- package/web/app/immutable/chunks/{Mne-RwlA.js → D1pAML4P.js} +1 -1
- package/web/app/immutable/chunks/{B4W05Glr.js → D22O0lQY.js} +1 -1
- package/web/app/immutable/chunks/{DSKeLath.js → D2gfYd_D.js} +1 -1
- package/web/app/immutable/chunks/{DC8fssXE.js → D5iylRNB.js} +1 -1
- package/web/app/immutable/chunks/{Qos47XEo.js → D6_4An9q.js} +1 -1
- package/web/app/immutable/chunks/{5YCHxLN1.js → D9352X9R.js} +1 -1
- package/web/app/immutable/chunks/{B-RrcP34.js → DAeWNQ3N.js} +1 -1
- package/web/app/immutable/chunks/{BiuqRP28.js → DAnMADno.js} +1 -1
- package/web/app/immutable/chunks/{SrKv1_3m.js → DCfwli1b.js} +1 -1
- package/web/app/immutable/chunks/{BBGX-ci7.js → DFxm7j9Z.js} +1 -1
- package/web/app/immutable/chunks/{CCagIz8d.js → DHoMpHTR.js} +1 -1
- package/web/app/immutable/chunks/{B8TzQVK2.js → DJI9bjVo.js} +1 -1
- package/web/app/immutable/chunks/{C6jc4Pti.js → DKgDFDH4.js} +1 -1
- package/web/app/immutable/chunks/{s5wpRW1P.js → DLDsTWl7.js} +1 -1
- package/web/app/immutable/chunks/{CK_EC_Zv.js → DLDwz3Jk.js} +3 -3
- package/web/app/immutable/chunks/{DEkMLJNk.js → DNd6DGz3.js} +1 -1
- package/web/app/immutable/chunks/{C9ey9TZx.js → DNjAbZct.js} +1 -1
- package/web/app/immutable/chunks/{DJ7wLorJ.js → DPrS1NlO.js} +1 -1
- package/web/app/immutable/chunks/{AGFKnm2P.js → DQ9yqoWl.js} +1 -1
- package/web/app/immutable/chunks/{D9dP_Ett.js → DQpdaJ6T.js} +1 -1
- package/web/app/immutable/chunks/{B_wPEBaI.js → DRJOZJ6-.js} +1 -1
- package/web/app/immutable/chunks/{DrIarztw.js → DSkFz5VN.js} +1 -1
- package/web/app/immutable/chunks/{BmYE6Ue_.js → DU1KIlN0.js} +1 -1
- package/web/app/immutable/chunks/{SI5c1abe.js → DVFTLZww.js} +2 -2
- package/web/app/immutable/chunks/{BPdm-e1q.js → DVnXSrnX.js} +1 -1
- package/web/app/immutable/chunks/{5lnJq6sM.js → DW-ALZ6y.js} +1 -1
- package/web/app/immutable/chunks/{Dax0jHgN.js → DWKuJ6Hr.js} +1 -1
- package/web/app/immutable/chunks/{Bjuqq3Zd.js → DWx1UA63.js} +1 -1
- package/web/app/immutable/chunks/{D6A4AOD2.js → DXDOTLs_.js} +1 -1
- package/web/app/immutable/chunks/{DAWb2dTK.js → DXhnL_QC.js} +1 -1
- package/web/app/immutable/chunks/{DsaheIX7.js → DZif8G3V.js} +1 -1
- package/web/app/immutable/chunks/{GdXyc5RW.js → DZzjO28f.js} +1 -1
- package/web/app/immutable/chunks/{e0dgj-dl.js → DcSenGcU.js} +1 -1
- package/web/app/immutable/chunks/{BJYSsWSU.js → DeAvGdvh.js} +1 -1
- package/web/app/immutable/chunks/{Bg7GBSBQ.js → DeJsl-aZ.js} +1 -1
- package/web/app/immutable/chunks/{DkXjvKmg.js → Dfltx80e.js} +1 -1
- package/web/app/immutable/chunks/{CPgenjJJ.js → DhabgDm5.js} +1 -1
- package/web/app/immutable/chunks/{BbcTTSnr.js → DiLbGQuc.js} +1 -1
- package/web/app/immutable/chunks/{nXIZY1Eq.js → DkvlYl1r.js} +1 -1
- package/web/app/immutable/chunks/Dm58JeH4.js +4 -0
- package/web/app/immutable/chunks/{CPi21vJ2.js → DnMyotqB.js} +1 -1
- package/web/app/immutable/chunks/{BlRn68PY.js → Doc9Z9QQ.js} +1 -1
- package/web/app/immutable/chunks/{CsAyqppV.js → Dp5CK5E2.js} +2 -2
- package/web/app/immutable/chunks/{HxrVoImD.js → DpZbkRU1.js} +2 -2
- package/web/app/immutable/chunks/{743JVs4Q.js → DsYe-lzR.js} +1 -1
- package/web/app/immutable/chunks/{DCR2yORR.js → DstArZ_G.js} +1 -1
- package/web/app/immutable/chunks/{CGoCQMYw.js → Du45nhw1.js} +1 -1
- package/web/app/immutable/chunks/{kHRHwI-x.js → DuqO5YYx.js} +1 -1
- package/web/app/immutable/chunks/{DCMUMliQ.js → Dv-MAuki.js} +1 -1
- package/web/app/immutable/chunks/{wFOLz40M.js → Dw6H-2WQ.js} +4 -4
- package/web/app/immutable/chunks/{D8VQPXfA.js → DxQllgk1.js} +1 -1
- package/web/app/immutable/chunks/{CuQGJ_Hl.js → DxXHe9XL.js} +1 -1
- package/web/app/immutable/chunks/{DBXDrA8G.js → Dz4zGm0b.js} +1 -1
- package/web/app/immutable/chunks/{CLLGUAol.js → DzrG6LRJ.js} +1 -1
- package/web/app/immutable/chunks/{Cu6_o9yH.js → ENk3kCNh.js} +1 -1
- package/web/app/immutable/chunks/{ecK2Rz_W.js → Ebo0jR7g.js} +1 -1
- package/web/app/immutable/chunks/{tIh0qGP0.js → Hqp9lhkv.js} +1 -1
- package/web/app/immutable/chunks/{DAyLQqmH.js → IS3lk0hL.js} +1 -1
- package/web/app/immutable/chunks/{5EQzwjFU.js → K6c57sYm.js} +1 -1
- package/web/app/immutable/chunks/{ErrYu-1b.js → LjFrXSKU.js} +1 -1
- package/web/app/immutable/chunks/LuyeE9EP.js +1 -0
- package/web/app/immutable/chunks/{Bbtr-1K4.js → LywjnD7L.js} +1 -1
- package/web/app/immutable/chunks/{DEBEHaOd.js → MHMez6vJ.js} +1 -1
- package/web/app/immutable/chunks/{BOCcnpyu.js → NbM9xEi7.js} +1 -1
- package/web/app/immutable/chunks/NqHwC243.js +1 -0
- package/web/app/immutable/chunks/{BRz9UwkY.js → OQFffAXE.js} +2 -2
- package/web/app/immutable/chunks/{R1PIrMEo.js → Q7GICaZA.js} +4 -4
- package/web/app/immutable/chunks/{1kZYk73E.js → RWrc-xf9.js} +1 -1
- package/web/app/immutable/chunks/{_vwL6Rxf.js → S4yHrePv.js} +1 -1
- package/web/app/immutable/chunks/{CN_bicqw.js → TGii5dZx.js} +1 -1
- package/web/app/immutable/chunks/{BUH1cXWe.js → TpzTLNOD.js} +1 -1
- package/web/app/immutable/chunks/{CHyrfJgg.js → TwGZmfYW.js} +1 -1
- package/web/app/immutable/chunks/{CKdLa-Uz.js → VjR26_WS.js} +1 -1
- package/web/app/immutable/chunks/{YNVJCvyF.js → XJvRRqZY.js} +2 -2
- package/web/app/immutable/chunks/{B86uOqdH.js → Z2gbRxA0.js} +1 -1
- package/web/app/immutable/chunks/{CXgjAj37.js → ZUCHJs0z.js} +1 -1
- package/web/app/immutable/chunks/{CnNF86D9.js → aZx3cD8V.js} +1 -1
- package/web/app/immutable/chunks/{HBVhNaGe.js → at5Op_FE.js} +1 -1
- package/web/app/immutable/chunks/{CYnvHqAo.js → c-xC05gO.js} +3 -3
- package/web/app/immutable/chunks/{BFbSkULM.js → dJyv-siL.js} +1 -1
- package/web/app/immutable/chunks/{wqG7RsMr.js → dmvnbvsQ.js} +1 -1
- package/web/app/immutable/chunks/{B0TS4hgi.js → ediMbqWo.js} +1 -1
- package/web/app/immutable/chunks/{BM3phmDM.js → gVaQ50Mb.js} +1 -1
- package/web/app/immutable/chunks/{X60wq_Gr.js → hiFoK9HW.js} +1 -1
- package/web/app/immutable/chunks/{DccM5_Kz.js → ho_wzPgZ.js} +1 -1
- package/web/app/immutable/chunks/{0RMdFti5.js → jkBt9jHY.js} +1 -1
- package/web/app/immutable/chunks/{Bvvd2zh3.js → kG7yHiIe.js} +1 -1
- package/web/app/immutable/chunks/{BmuAz9YM.js → lAsY7teh.js} +1 -1
- package/web/app/immutable/chunks/{BFOOw1dI.js → n4HRXsWs.js} +1 -1
- package/web/app/immutable/chunks/{BsjwOa8m.js → nY6Ai7XD.js} +1 -1
- package/web/app/immutable/chunks/{CbdCK_T5.js → qYwSdo-K.js} +3 -3
- package/web/app/immutable/chunks/{P80wVyai.js → rKiAyfMI.js} +1 -1
- package/web/app/immutable/chunks/{ij7Gv2VI.js → sisoY2vh.js} +1 -1
- package/web/app/immutable/chunks/{Bq6o_ftd.js → uO0IO955.js} +1 -1
- package/web/app/immutable/chunks/{r4Kn8ryM.js → x8V1qvZr.js} +1 -1
- package/web/app/immutable/chunks/{Ba12nCEG.js → xOOK71rW.js} +1 -1
- package/web/app/immutable/chunks/{Dhqi7cA-.js → zuDkoDer.js} +1 -1
- package/web/app/immutable/entry/{app.DGPhT6bY.js → app.S5CWPbDK.js} +3 -3
- package/web/app/immutable/entry/start.DinkqhBP.js +1 -0
- package/web/app/immutable/nodes/{0.BC-jKADe.js → 0.B4U_qChs.js} +1 -1
- package/web/app/immutable/nodes/{1.BElbRM6L.js → 1.pNWMoj9V.js} +1 -1
- package/web/app/immutable/nodes/{10.BhzQgaxP.js → 10.CaBIMNie.js} +1 -1
- package/web/app/immutable/nodes/{11.AT9-T1cz.js → 11.xKpwCHv6.js} +1 -1
- package/web/app/immutable/nodes/{12.UnKFeRcB.js → 12.B4sH0GII.js} +1 -1
- package/web/app/immutable/nodes/{13.CPShrjOW.js → 13.CfDkqDId.js} +3 -3
- package/web/app/immutable/nodes/{14.lrSpZ_2D.js → 14.BI8ewYLs.js} +1 -1
- package/web/app/immutable/nodes/{15.DITl_gdk.js → 15.DDXz42ax.js} +1 -1
- package/web/app/immutable/nodes/{16.SMwU6zOj.js → 16.Cxa0f4JH.js} +1 -1
- package/web/app/immutable/nodes/{17.EkpTyH-y.js → 17.UGEWL_p3.js} +2 -2
- package/web/app/immutable/nodes/{2.eUJUH-2K.js → 2.-Qf9E2iv.js} +5 -5
- package/web/app/immutable/nodes/{3.CqDcm_5y.js → 3.DLT-Yg27.js} +1 -1
- package/web/app/immutable/nodes/{4.DNZQQAL_.js → 4.DmcEH-RC.js} +1 -1
- package/web/app/immutable/nodes/{5.kCfkqAT0.js → 5.BFD4xsaH.js} +1 -1
- package/web/app/immutable/nodes/{6.CzeBG3TF.js → 6.RyyedfVo.js} +1 -1
- package/web/app/immutable/nodes/{7.C_teQRRk.js → 7.C0oAoj9c.js} +1 -1
- package/web/app/immutable/nodes/8.1ulerr0C.js +14 -0
- package/web/app/immutable/nodes/{9.BgUq0jQt.js → 9.fVLpMpdp.js} +5 -5
- package/web/app/version.json +1 -1
- package/web/generated/paraglide.js +49 -49
- package/web/index.html +19 -19
- package/web/app/immutable/chunks/8obSPONn.js +0 -1
- package/web/app/immutable/chunks/B5YXY4gT.js +0 -1
- package/web/app/immutable/chunks/BfxAliuB.js +0 -1
- package/web/app/immutable/chunks/CijnEJw0.js +0 -1
- package/web/app/immutable/chunks/Cq3jmim-.js +0 -1
- package/web/app/immutable/chunks/DWwdvItj.js +0 -4
- package/web/app/immutable/chunks/DWzc_C3M.js +0 -1
- package/web/app/immutable/entry/start.C2NOsCgx.js +0 -1
- package/web/app/immutable/nodes/8.Dro0M0JS.js +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as Ie}from"./Bsz0mK8i.js";import{aZ as Me,U as Be,V as Ve,a_ as Ye,b as d,X as Ot,ay as de,B as Fe,h as Ue,al as je,o as Nt,b5 as ze,aV as me,aW as Jt,bi as We,z as te,n as pe}from"./D3VNRPKq.js";var jt=(function(){var t=d(function(_t,m,x,E){for(x=x||{},E=_t.length;E--;x[_t[E]]=m);return x},"o"),e=[1,24],a=[1,25],i=[1,26],u=[1,27],r=[1,28],n=[1,63],l=[1,64],s=[1,65],h=[1,66],y=[1,67],p=[1,68],g=[1,69],v=[1,29],w=[1,30],N=[1,31],O=[1,32],P=[1,33],I=[1,34],X=[1,35],q=[1,36],H=[1,37],Q=[1,38],K=[1,39],G=[1,40],Z=[1,41],J=[1,42],$=[1,43],tt=[1,44],et=[1,45],nt=[1,46],st=[1,47],at=[1,48],rt=[1,50],it=[1,51],ot=[1,52],lt=[1,53],ct=[1,54],ut=[1,55],ht=[1,56],dt=[1,57],pt=[1,58],ft=[1,59],yt=[1,60],kt=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Pt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],S=[1,82],T=[1,83],k=[1,84],C=[1,85],R=[12,14,42],oe=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],xt=[12,33],qt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ht={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:d(function(m,x,E,_,D,o,Dt){var f=o.length-1;switch(D){case 3:_.setDirection("TB");break;case 4:_.setDirection("BT");break;case 5:_.setDirection("RL");break;case 6:_.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_.setC4Type(o[f-3]);break;case 19:_.setTitle(o[f].substring(6)),this.$=o[f].substring(6);break;case 20:_.setAccDescription(o[f].substring(15)),this.$=o[f].substring(15);break;case 21:this.$=o[f].trim(),_.setTitle(this.$);break;case 22:case 23:this.$=o[f].trim(),_.setAccDescription(this.$);break;case 28:o[f].splice(2,0,"ENTERPRISE"),_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 29:o[f].splice(2,0,"SYSTEM"),_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 30:_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 31:o[f].splice(2,0,"CONTAINER"),_.addContainerBoundary(...o[f]),this.$=o[f];break;case 32:_.addDeploymentNode("node",...o[f]),this.$=o[f];break;case 33:_.addDeploymentNode("nodeL",...o[f]),this.$=o[f];break;case 34:_.addDeploymentNode("nodeR",...o[f]),this.$=o[f];break;case 35:_.popBoundaryParseStack();break;case 39:_.addPersonOrSystem("person",...o[f]),this.$=o[f];break;case 40:_.addPersonOrSystem("external_person",...o[f]),this.$=o[f];break;case 41:_.addPersonOrSystem("system",...o[f]),this.$=o[f];break;case 42:_.addPersonOrSystem("system_db",...o[f]),this.$=o[f];break;case 43:_.addPersonOrSystem("system_queue",...o[f]),this.$=o[f];break;case 44:_.addPersonOrSystem("external_system",...o[f]),this.$=o[f];break;case 45:_.addPersonOrSystem("external_system_db",...o[f]),this.$=o[f];break;case 46:_.addPersonOrSystem("external_system_queue",...o[f]),this.$=o[f];break;case 47:_.addContainer("container",...o[f]),this.$=o[f];break;case 48:_.addContainer("container_db",...o[f]),this.$=o[f];break;case 49:_.addContainer("container_queue",...o[f]),this.$=o[f];break;case 50:_.addContainer("external_container",...o[f]),this.$=o[f];break;case 51:_.addContainer("external_container_db",...o[f]),this.$=o[f];break;case 52:_.addContainer("external_container_queue",...o[f]),this.$=o[f];break;case 53:_.addComponent("component",...o[f]),this.$=o[f];break;case 54:_.addComponent("component_db",...o[f]),this.$=o[f];break;case 55:_.addComponent("component_queue",...o[f]),this.$=o[f];break;case 56:_.addComponent("external_component",...o[f]),this.$=o[f];break;case 57:_.addComponent("external_component_db",...o[f]),this.$=o[f];break;case 58:_.addComponent("external_component_queue",...o[f]),this.$=o[f];break;case 60:_.addRel("rel",...o[f]),this.$=o[f];break;case 61:_.addRel("birel",...o[f]),this.$=o[f];break;case 62:_.addRel("rel_u",...o[f]),this.$=o[f];break;case 63:_.addRel("rel_d",...o[f]),this.$=o[f];break;case 64:_.addRel("rel_l",...o[f]),this.$=o[f];break;case 65:_.addRel("rel_r",...o[f]),this.$=o[f];break;case 66:_.addRel("rel_b",...o[f]),this.$=o[f];break;case 67:o[f].splice(0,1),_.addRel("rel",...o[f]),this.$=o[f];break;case 68:_.updateElStyle("update_el_style",...o[f]),this.$=o[f];break;case 69:_.updateRelStyle("update_rel_style",...o[f]),this.$=o[f];break;case 70:_.updateLayoutConfig("update_layout_config",...o[f]),this.$=o[f];break;case 71:this.$=[o[f]];break;case 72:o[f].unshift(o[f-1]),this.$=o[f];break;case 73:case 75:this.$=o[f].trim();break;case 74:let vt={};vt[o[f-1].trim()]=o[f].trim(),this.$=vt;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:70,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:71,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:72,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:73,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{14:[1,74]},t(kt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:n,36:l,37:s,38:h,39:y,40:p,41:g,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt}),t(kt,[2,14]),t(Xt,[2,16],{12:[1,76]}),t(kt,[2,36],{12:[1,77]}),t(Pt,[2,19]),t(Pt,[2,20]),{25:[1,78]},{27:[1,79]},t(Pt,[2,23]),{35:80,75:81,76:S,77:T,79:k,80:C},{35:86,75:81,76:S,77:T,79:k,80:C},{35:87,75:81,76:S,77:T,79:k,80:C},{35:88,75:81,76:S,77:T,79:k,80:C},{35:89,75:81,76:S,77:T,79:k,80:C},{35:90,75:81,76:S,77:T,79:k,80:C},{35:91,75:81,76:S,77:T,79:k,80:C},{35:92,75:81,76:S,77:T,79:k,80:C},{35:93,75:81,76:S,77:T,79:k,80:C},{35:94,75:81,76:S,77:T,79:k,80:C},{35:95,75:81,76:S,77:T,79:k,80:C},{35:96,75:81,76:S,77:T,79:k,80:C},{35:97,75:81,76:S,77:T,79:k,80:C},{35:98,75:81,76:S,77:T,79:k,80:C},{35:99,75:81,76:S,77:T,79:k,80:C},{35:100,75:81,76:S,77:T,79:k,80:C},{35:101,75:81,76:S,77:T,79:k,80:C},{35:102,75:81,76:S,77:T,79:k,80:C},{35:103,75:81,76:S,77:T,79:k,80:C},{35:104,75:81,76:S,77:T,79:k,80:C},t(R,[2,59]),{35:105,75:81,76:S,77:T,79:k,80:C},{35:106,75:81,76:S,77:T,79:k,80:C},{35:107,75:81,76:S,77:T,79:k,80:C},{35:108,75:81,76:S,77:T,79:k,80:C},{35:109,75:81,76:S,77:T,79:k,80:C},{35:110,75:81,76:S,77:T,79:k,80:C},{35:111,75:81,76:S,77:T,79:k,80:C},{35:112,75:81,76:S,77:T,79:k,80:C},{35:113,75:81,76:S,77:T,79:k,80:C},{35:114,75:81,76:S,77:T,79:k,80:C},{35:115,75:81,76:S,77:T,79:k,80:C},{20:116,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{12:[1,118],33:[1,117]},{35:119,75:81,76:S,77:T,79:k,80:C},{35:120,75:81,76:S,77:T,79:k,80:C},{35:121,75:81,76:S,77:T,79:k,80:C},{35:122,75:81,76:S,77:T,79:k,80:C},{35:123,75:81,76:S,77:T,79:k,80:C},{35:124,75:81,76:S,77:T,79:k,80:C},{35:125,75:81,76:S,77:T,79:k,80:C},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(kt,[2,15]),t(Xt,[2,17],{21:22,19:130,22:e,23:a,24:i,26:u,28:r}),t(kt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:a,24:i,26:u,28:r,34:n,36:l,37:s,38:h,39:y,40:p,41:g,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt}),t(Pt,[2,21]),t(Pt,[2,22]),t(R,[2,39]),t(oe,[2,71],{75:81,35:132,76:S,77:T,79:k,80:C}),t(Bt,[2,73]),{78:[1,133]},t(Bt,[2,75]),t(Bt,[2,76]),t(R,[2,40]),t(R,[2,41]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(R,[2,52]),t(R,[2,53]),t(R,[2,54]),t(R,[2,55]),t(R,[2,56]),t(R,[2,57]),t(R,[2,58]),t(R,[2,60]),t(R,[2,61]),t(R,[2,62]),t(R,[2,63]),t(R,[2,64]),t(R,[2,65]),t(R,[2,66]),t(R,[2,67]),t(R,[2,68]),t(R,[2,69]),t(R,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(xt,[2,28]),t(xt,[2,29]),t(xt,[2,30]),t(xt,[2,31]),t(xt,[2,32]),t(xt,[2,33]),t(xt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Xt,[2,18]),t(kt,[2,38]),t(oe,[2,72]),t(Bt,[2,74]),t(R,[2,24]),t(R,[2,35]),t(qt,[2,25]),t(qt,[2,26],{12:[1,138]}),t(qt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:d(function(m,x){if(x.recoverable)this.trace(m);else{var E=new Error(m);throw E.hash=x,E}},"parseError"),parse:d(function(m){var x=this,E=[0],_=[],D=[null],o=[],Dt=this.table,f="",vt=0,le=0,De=2,ce=1,Ne=o.slice.call(arguments,1),A=Object.create(this.lexer),Et={yy:{}};for(var Qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Qt)&&(Et.yy[Qt]=this.yy[Qt]);A.setInput(m,Et.yy),Et.yy.lexer=A,Et.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var Kt=A.yylloc;o.push(Kt);var Ae=A.options&&A.options.ranges;typeof Et.yy.parseError=="function"?this.parseError=Et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Le(B){E.length=E.length-2*B,D.length=D.length-B,o.length=o.length-B}d(Le,"popStack");function ue(){var B;return B=_.pop()||A.lex()||ce,typeof B!="number"&&(B instanceof Array&&(_=B,B=_.pop()),B=x.symbols_[B]||B),B}d(ue,"lex");for(var M,St,V,Gt,Ct={},Yt,z,he,Ft;;){if(St=E[E.length-1],this.defaultActions[St]?V=this.defaultActions[St]:((M===null||typeof M>"u")&&(M=ue()),V=Dt[St]&&Dt[St][M]),typeof V>"u"||!V.length||!V[0]){var Zt="";Ft=[];for(Yt in Dt[St])this.terminals_[Yt]&&Yt>De&&Ft.push("'"+this.terminals_[Yt]+"'");A.showPosition?Zt="Parse error on line "+(vt+1)+`:
|
|
1
|
+
import{e as Ie}from"./CxEB7RsJ.js";import{aZ as Me,U as Be,V as Ve,a_ as Ye,b as d,X as Ot,ay as de,B as Fe,h as Ue,al as je,o as Nt,b5 as ze,aV as me,aW as Jt,bi as We,z as te,n as pe}from"./BVZOiDhO.js";var jt=(function(){var t=d(function(_t,m,x,E){for(x=x||{},E=_t.length;E--;x[_t[E]]=m);return x},"o"),e=[1,24],a=[1,25],i=[1,26],u=[1,27],r=[1,28],n=[1,63],l=[1,64],s=[1,65],h=[1,66],y=[1,67],p=[1,68],g=[1,69],v=[1,29],w=[1,30],N=[1,31],O=[1,32],P=[1,33],I=[1,34],X=[1,35],q=[1,36],H=[1,37],Q=[1,38],K=[1,39],G=[1,40],Z=[1,41],J=[1,42],$=[1,43],tt=[1,44],et=[1,45],nt=[1,46],st=[1,47],at=[1,48],rt=[1,50],it=[1,51],ot=[1,52],lt=[1,53],ct=[1,54],ut=[1,55],ht=[1,56],dt=[1,57],pt=[1,58],ft=[1,59],yt=[1,60],kt=[14,42],Xt=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Pt=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],S=[1,82],T=[1,83],k=[1,84],C=[1,85],R=[12,14,42],oe=[12,14,33,42],Bt=[12,14,33,42,76,77,79,80],xt=[12,33],qt=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ht={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:d(function(m,x,E,_,D,o,Dt){var f=o.length-1;switch(D){case 3:_.setDirection("TB");break;case 4:_.setDirection("BT");break;case 5:_.setDirection("RL");break;case 6:_.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:_.setC4Type(o[f-3]);break;case 19:_.setTitle(o[f].substring(6)),this.$=o[f].substring(6);break;case 20:_.setAccDescription(o[f].substring(15)),this.$=o[f].substring(15);break;case 21:this.$=o[f].trim(),_.setTitle(this.$);break;case 22:case 23:this.$=o[f].trim(),_.setAccDescription(this.$);break;case 28:o[f].splice(2,0,"ENTERPRISE"),_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 29:o[f].splice(2,0,"SYSTEM"),_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 30:_.addPersonOrSystemBoundary(...o[f]),this.$=o[f];break;case 31:o[f].splice(2,0,"CONTAINER"),_.addContainerBoundary(...o[f]),this.$=o[f];break;case 32:_.addDeploymentNode("node",...o[f]),this.$=o[f];break;case 33:_.addDeploymentNode("nodeL",...o[f]),this.$=o[f];break;case 34:_.addDeploymentNode("nodeR",...o[f]),this.$=o[f];break;case 35:_.popBoundaryParseStack();break;case 39:_.addPersonOrSystem("person",...o[f]),this.$=o[f];break;case 40:_.addPersonOrSystem("external_person",...o[f]),this.$=o[f];break;case 41:_.addPersonOrSystem("system",...o[f]),this.$=o[f];break;case 42:_.addPersonOrSystem("system_db",...o[f]),this.$=o[f];break;case 43:_.addPersonOrSystem("system_queue",...o[f]),this.$=o[f];break;case 44:_.addPersonOrSystem("external_system",...o[f]),this.$=o[f];break;case 45:_.addPersonOrSystem("external_system_db",...o[f]),this.$=o[f];break;case 46:_.addPersonOrSystem("external_system_queue",...o[f]),this.$=o[f];break;case 47:_.addContainer("container",...o[f]),this.$=o[f];break;case 48:_.addContainer("container_db",...o[f]),this.$=o[f];break;case 49:_.addContainer("container_queue",...o[f]),this.$=o[f];break;case 50:_.addContainer("external_container",...o[f]),this.$=o[f];break;case 51:_.addContainer("external_container_db",...o[f]),this.$=o[f];break;case 52:_.addContainer("external_container_queue",...o[f]),this.$=o[f];break;case 53:_.addComponent("component",...o[f]),this.$=o[f];break;case 54:_.addComponent("component_db",...o[f]),this.$=o[f];break;case 55:_.addComponent("component_queue",...o[f]),this.$=o[f];break;case 56:_.addComponent("external_component",...o[f]),this.$=o[f];break;case 57:_.addComponent("external_component_db",...o[f]),this.$=o[f];break;case 58:_.addComponent("external_component_queue",...o[f]),this.$=o[f];break;case 60:_.addRel("rel",...o[f]),this.$=o[f];break;case 61:_.addRel("birel",...o[f]),this.$=o[f];break;case 62:_.addRel("rel_u",...o[f]),this.$=o[f];break;case 63:_.addRel("rel_d",...o[f]),this.$=o[f];break;case 64:_.addRel("rel_l",...o[f]),this.$=o[f];break;case 65:_.addRel("rel_r",...o[f]),this.$=o[f];break;case 66:_.addRel("rel_b",...o[f]),this.$=o[f];break;case 67:o[f].splice(0,1),_.addRel("rel",...o[f]),this.$=o[f];break;case 68:_.updateElStyle("update_el_style",...o[f]),this.$=o[f];break;case 69:_.updateRelStyle("update_rel_style",...o[f]),this.$=o[f];break;case 70:_.updateLayoutConfig("update_layout_config",...o[f]),this.$=o[f];break;case 71:this.$=[o[f]];break;case 72:o[f].unshift(o[f-1]),this.$=o[f];break;case 73:case 75:this.$=o[f].trim();break;case 74:let vt={};vt[o[f-1].trim()]=o[f].trim(),this.$=vt;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:70,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:71,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:72,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{13:73,19:20,20:21,21:22,22:e,23:a,24:i,26:u,28:r,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{14:[1,74]},t(kt,[2,13],{43:23,29:49,30:61,32:62,20:75,34:n,36:l,37:s,38:h,39:y,40:p,41:g,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt}),t(kt,[2,14]),t(Xt,[2,16],{12:[1,76]}),t(kt,[2,36],{12:[1,77]}),t(Pt,[2,19]),t(Pt,[2,20]),{25:[1,78]},{27:[1,79]},t(Pt,[2,23]),{35:80,75:81,76:S,77:T,79:k,80:C},{35:86,75:81,76:S,77:T,79:k,80:C},{35:87,75:81,76:S,77:T,79:k,80:C},{35:88,75:81,76:S,77:T,79:k,80:C},{35:89,75:81,76:S,77:T,79:k,80:C},{35:90,75:81,76:S,77:T,79:k,80:C},{35:91,75:81,76:S,77:T,79:k,80:C},{35:92,75:81,76:S,77:T,79:k,80:C},{35:93,75:81,76:S,77:T,79:k,80:C},{35:94,75:81,76:S,77:T,79:k,80:C},{35:95,75:81,76:S,77:T,79:k,80:C},{35:96,75:81,76:S,77:T,79:k,80:C},{35:97,75:81,76:S,77:T,79:k,80:C},{35:98,75:81,76:S,77:T,79:k,80:C},{35:99,75:81,76:S,77:T,79:k,80:C},{35:100,75:81,76:S,77:T,79:k,80:C},{35:101,75:81,76:S,77:T,79:k,80:C},{35:102,75:81,76:S,77:T,79:k,80:C},{35:103,75:81,76:S,77:T,79:k,80:C},{35:104,75:81,76:S,77:T,79:k,80:C},t(R,[2,59]),{35:105,75:81,76:S,77:T,79:k,80:C},{35:106,75:81,76:S,77:T,79:k,80:C},{35:107,75:81,76:S,77:T,79:k,80:C},{35:108,75:81,76:S,77:T,79:k,80:C},{35:109,75:81,76:S,77:T,79:k,80:C},{35:110,75:81,76:S,77:T,79:k,80:C},{35:111,75:81,76:S,77:T,79:k,80:C},{35:112,75:81,76:S,77:T,79:k,80:C},{35:113,75:81,76:S,77:T,79:k,80:C},{35:114,75:81,76:S,77:T,79:k,80:C},{35:115,75:81,76:S,77:T,79:k,80:C},{20:116,29:49,30:61,32:62,34:n,36:l,37:s,38:h,39:y,40:p,41:g,43:23,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt},{12:[1,118],33:[1,117]},{35:119,75:81,76:S,77:T,79:k,80:C},{35:120,75:81,76:S,77:T,79:k,80:C},{35:121,75:81,76:S,77:T,79:k,80:C},{35:122,75:81,76:S,77:T,79:k,80:C},{35:123,75:81,76:S,77:T,79:k,80:C},{35:124,75:81,76:S,77:T,79:k,80:C},{35:125,75:81,76:S,77:T,79:k,80:C},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(kt,[2,15]),t(Xt,[2,17],{21:22,19:130,22:e,23:a,24:i,26:u,28:r}),t(kt,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:a,24:i,26:u,28:r,34:n,36:l,37:s,38:h,39:y,40:p,41:g,44:v,45:w,46:N,47:O,48:P,49:I,50:X,51:q,52:H,53:Q,54:K,55:G,56:Z,57:J,58:$,59:tt,60:et,61:nt,62:st,63:at,64:rt,65:it,66:ot,67:lt,68:ct,69:ut,70:ht,71:dt,72:pt,73:ft,74:yt}),t(Pt,[2,21]),t(Pt,[2,22]),t(R,[2,39]),t(oe,[2,71],{75:81,35:132,76:S,77:T,79:k,80:C}),t(Bt,[2,73]),{78:[1,133]},t(Bt,[2,75]),t(Bt,[2,76]),t(R,[2,40]),t(R,[2,41]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(R,[2,52]),t(R,[2,53]),t(R,[2,54]),t(R,[2,55]),t(R,[2,56]),t(R,[2,57]),t(R,[2,58]),t(R,[2,60]),t(R,[2,61]),t(R,[2,62]),t(R,[2,63]),t(R,[2,64]),t(R,[2,65]),t(R,[2,66]),t(R,[2,67]),t(R,[2,68]),t(R,[2,69]),t(R,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(xt,[2,28]),t(xt,[2,29]),t(xt,[2,30]),t(xt,[2,31]),t(xt,[2,32]),t(xt,[2,33]),t(xt,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(Xt,[2,18]),t(kt,[2,38]),t(oe,[2,72]),t(Bt,[2,74]),t(R,[2,24]),t(R,[2,35]),t(qt,[2,25]),t(qt,[2,26],{12:[1,138]}),t(qt,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:d(function(m,x){if(x.recoverable)this.trace(m);else{var E=new Error(m);throw E.hash=x,E}},"parseError"),parse:d(function(m){var x=this,E=[0],_=[],D=[null],o=[],Dt=this.table,f="",vt=0,le=0,De=2,ce=1,Ne=o.slice.call(arguments,1),A=Object.create(this.lexer),Et={yy:{}};for(var Qt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Qt)&&(Et.yy[Qt]=this.yy[Qt]);A.setInput(m,Et.yy),Et.yy.lexer=A,Et.yy.parser=this,typeof A.yylloc>"u"&&(A.yylloc={});var Kt=A.yylloc;o.push(Kt);var Ae=A.options&&A.options.ranges;typeof Et.yy.parseError=="function"?this.parseError=Et.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Le(B){E.length=E.length-2*B,D.length=D.length-B,o.length=o.length-B}d(Le,"popStack");function ue(){var B;return B=_.pop()||A.lex()||ce,typeof B!="number"&&(B instanceof Array&&(_=B,B=_.pop()),B=x.symbols_[B]||B),B}d(ue,"lex");for(var M,St,V,Gt,Ct={},Yt,z,he,Ft;;){if(St=E[E.length-1],this.defaultActions[St]?V=this.defaultActions[St]:((M===null||typeof M>"u")&&(M=ue()),V=Dt[St]&&Dt[St][M]),typeof V>"u"||!V.length||!V[0]){var Zt="";Ft=[];for(Yt in Dt[St])this.terminals_[Yt]&&Yt>De&&Ft.push("'"+this.terminals_[Yt]+"'");A.showPosition?Zt="Parse error on line "+(vt+1)+`:
|
|
2
2
|
`+A.showPosition()+`
|
|
3
3
|
Expecting `+Ft.join(", ")+", got '"+(this.terminals_[M]||M)+"'":Zt="Parse error on line "+(vt+1)+": Unexpected "+(M==ce?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(Zt,{text:A.match,token:this.terminals_[M]||M,line:A.yylineno,loc:Kt,expected:Ft})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+St+", token: "+M);switch(V[0]){case 1:E.push(M),D.push(A.yytext),o.push(A.yylloc),E.push(V[1]),M=null,le=A.yyleng,f=A.yytext,vt=A.yylineno,Kt=A.yylloc;break;case 2:if(z=this.productions_[V[1]][1],Ct.$=D[D.length-z],Ct._$={first_line:o[o.length-(z||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(z||1)].first_column,last_column:o[o.length-1].last_column},Ae&&(Ct._$.range=[o[o.length-(z||1)].range[0],o[o.length-1].range[1]]),Gt=this.performAction.apply(Ct,[f,le,vt,Et.yy,V[1],D,o].concat(Ne)),typeof Gt<"u")return Gt;z&&(E=E.slice(0,-1*z*2),D=D.slice(0,-1*z),o=o.slice(0,-1*z)),E.push(this.productions_[V[1]][0]),D.push(Ct.$),o.push(Ct._$),he=Dt[E[E.length-2]][E[E.length-1]],E.push(he);break;case 3:return!0}}return!0},"parse")},Pe=(function(){var _t={EOF:1,parseError:d(function(x,E){if(this.yy.parser)this.yy.parser.parseError(x,E);else throw new Error(x)},"parseError"),setInput:d(function(m,x){return this.yy=x||this.yy||{},this._input=m,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:d(function(){var m=this._input[0];this.yytext+=m,this.yyleng++,this.offset++,this.match+=m,this.matched+=m;var x=m.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),m},"input"),unput:d(function(m){var x=m.length,E=m.split(/(?:\r\n?|\n)/g);this._input=m+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var _=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),E.length-1&&(this.yylineno-=E.length-1);var D=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:E?(E.length===_.length?this.yylloc.first_column:0)+_[_.length-E.length].length-E[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:d(function(m){this.unput(this.match.slice(m))},"less"),pastInput:d(function(){var m=this.matched.substr(0,this.matched.length-this.match.length);return(m.length>20?"...":"")+m.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var m=this.match;return m.length<20&&(m+=this._input.substr(0,20-m.length)),(m.substr(0,20)+(m.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var m=this.pastInput(),x=new Array(m.length+1).join("-");return m+this.upcomingInput()+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as e,ay as s,aX as o,B as i}from"./
|
|
1
|
+
import{b as e,ay as s,aX as o,B as i}from"./BVZOiDhO.js";import{p as g}from"./kG7yHiIe.js";var p={parse:e(async r=>{const a=await g("info",r);s.debug(a)},"parse")},v={version:"12.3.0"},d=e(()=>v.version,"getVersion"),m={getVersion:d},c=e((r,a,n)=>{s.debug(`rendering info diagram
|
|
2
2
|
`+r);const t=o(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),f={draw:c},b={parser:p,db:m,renderer:f};export{b as diagram};
|
|
@@ -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"./BveuvcUn.js";import{bX as Le,cW as le,cn as ue,cm as ve}from"./1kZYk73E.js";import{Ii as p,A_ as we,bw as be,c as Fe,Kl as de,i8 as me,bI as ke,CV as z,Bn as Ge,f5 as Pe,zt as xe,dS as Ee,f1 as fe,dR as _e,zX as Ve,J$ as Ue,vE as Be}from"./DomfbKVx.js";import{aC as Ae,dE as he,A as H,P as Re,ay as K}from"./DkXjvKmg.js";import{ax as $e}from"./CYnvHqAo.js";import{c as Y}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./BLYi9_ai.js";import"./DYhIMPy1.js";import{bo as n}from"./8obSPONn.js";import"./Crq31h4w.js";import"./CXgjAj37.js";import"./CFP6h_yj.js";import{R as ge}from"./BvFAWM27.js";import{L as We}from"./CSiaiLHL.js";function Ye(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,g)=>{const R=Math.floor(g/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},R)})}),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 W 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=Y("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=ge.DEFAULT_ATTEMPTS,retryDelay:a=ge.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:g=this.defaultShouldRetry}=t;let R=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(R=h,v.error(`[${e}] Attempt ${d} failed`,{error:R.message,attempt:d,maxAttempts:r+1,context:f}),u?.(R,d),d<=r&&g(R)){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"}: ${R?.message}`,P=J(R?.message||n.agent_errorBoundary_generic_error()),N=R?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new W(P,D.OPERATION_FAILED,{originalError:R?.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 W(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 W?[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 W(`${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(g=>e(g)))).forEach((g,R)=>{if(g.status==="fulfilled")c.push(g.value);else{const d=g.reason;if(E.push({item:u[R],error:d}),v.error(`[${l}] Batch item failed`,{item:u[R],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=Y("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=Y("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 g=c.message.toLowerCase();if(g.includes("interrupted")||g.includes("cancelled")||g.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(g.includes("no available models")||g.includes("all models exhausted")||g.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 R=Math.random()*.2*E,d=Math.min(E+R,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 We({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=Y("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,g,R=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),g,R))};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 R=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)R.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)R.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?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:R,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=Ye(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,Ye 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"./CYl6Lvh4.js";import{bX as Le,cW as le,cn as ue,cm as ve}from"./RWrc-xf9.js";import{Ii as p,A_ as we,bw as be,c as Fe,Kl as de,i8 as me,bI as ke,CV as z,Bn as Ge,f5 as Pe,zt as xe,dS as Ee,f1 as fe,dR as _e,zX as Ve,J$ as Ue,vE as Be}from"./D-TU-2ME.js";import{aC as Ae,dE as he,A as H,P as Re,ay as K}from"./Dfltx80e.js";import{ax as $e}from"./c-xC05gO.js";import{c as Y}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./Bl2M7dQb.js";import"./DYhIMPy1.js";import{bo as n}from"./NqHwC243.js";import"./C2dNFWEv.js";import"./ZUCHJs0z.js";import"./A67C19bI.js";import{R as ge}from"./BvFAWM27.js";import{L as We}from"./CSiaiLHL.js";function Ye(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,g)=>{const R=Math.floor(g/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},R)})}),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 W 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=Y("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=ge.DEFAULT_ATTEMPTS,retryDelay:a=ge.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:g=this.defaultShouldRetry}=t;let R=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(R=h,v.error(`[${e}] Attempt ${d} failed`,{error:R.message,attempt:d,maxAttempts:r+1,context:f}),u?.(R,d),d<=r&&g(R)){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"}: ${R?.message}`,P=J(R?.message||n.agent_errorBoundary_generic_error()),N=R?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new W(P,D.OPERATION_FAILED,{originalError:R?.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 W(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 W?[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 W(`${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(g=>e(g)))).forEach((g,R)=>{if(g.status==="fulfilled")c.push(g.value);else{const d=g.reason;if(E.push({item:u[R],error:d}),v.error(`[${l}] Batch item failed`,{item:u[R],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=Y("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=Y("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 g=c.message.toLowerCase();if(g.includes("interrupted")||g.includes("cancelled")||g.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(g.includes("no available models")||g.includes("all models exhausted")||g.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 R=Math.random()*.2*E,d=Math.min(E+R,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 We({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=Y("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,g,R=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),g,R))};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 R=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)R.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)R.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?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:R,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=Ye(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,Ye as r,Lt as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var vo=Object.defineProperty;var bo=(e,t,i)=>t in e?vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var v=(e,t,i)=>bo(e,typeof t!="symbol"?t+"":t,i);import{t as ir,bq as M,a_ as we,by as nr,b as rr,bu as dn,bs as So,bo as $e}from"./
|
|
1
|
+
var vo=Object.defineProperty;var bo=(e,t,i)=>t in e?vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var v=(e,t,i)=>bo(e,typeof t!="symbol"?t+"":t,i);import{t as ir,bq as M,a_ as we,by as nr,b as rr,bu as dn,bs as So,bo as $e}from"./NqHwC243.js";import{bs as or,a5 as De,ay as hn,bS as Xe,aD as C,bA as ke,b_ as Me,bO as rt,W as le,bl as Xt,be as Hi,bn as sr,c9 as ne,aA as I,b$ as ar,aB as ge,ai as yo,bV as Te,br as Co,ca as je,bH as Y,c5 as dt,bk as xo,bj as Lo,aj as wo,c0 as fn}from"./DYhIMPy1.js";import{n as ko,p as Eo,v as un,w as pi,u as cn}from"./C2dNFWEv.js";import{b as Ro}from"./p7znhYIU.js";import{b as pn}from"./BaIAhI85.js";import{h as Ao,c as Ye,w as lr,N as O,O as Jt,b2 as Qe,a as dr,j as hr,P as Je,H as fr,i as ur,ab as cr,U as Ho,f as To,e as pr,T as Do,g as Mo,S as Io,a4 as Ze,a3 as Ve,C as Fo,G as gr,F as No,I as Po,A as At,ah as zo,$ as Ht,ad as Tt,v as St,a1 as Ti,s as J,r as Ue,an as wt,D as Uo,d as _o,aa as mr,b as gn,u as mn,aI as Oo,ap as ct,ac as Bo,K as Le,M as Ut,L as Vo,a0 as Dt,E as Wo,al as vr,a6 as Go,a2 as vn,t as br,af as ft,a5 as kt,ae as ot,ag as Sr,B as gi,a9 as mi,k as $o,aH as bn}from"./CYl6Lvh4.js";import{F as vi,c3 as jo,be as qo,at as Ko,as as Xo}from"./B66L8YEe.js";import{f as Di}from"./c-xC05gO.js";import{g as Yo}from"./B-3aWyWM.js";import{c as Qo}from"./A67C19bI.js";import{P as Jo}from"./Dw6H-2WQ.js";import{t as Sn}from"./72TQselO.js";class Zo extends Ao{constructor(){super(...arguments),this.tokenize=ts}equals(t,i,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
|
|
2
2
|
`))&&(t=t.trim()),(!n.newlineIsToken||!i.includes(`
|
|
3
3
|
`))&&(i=i.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
|
|
4
4
|
`)&&(t=t.slice(0,-1)),i.endsWith(`
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{Ii as n,nH as w,nx as g,nw as v,m2 as ee,qo as te,i7 as re,v3 as ze,jA as Je,CJ as Ke,uA as Ye,nO as Ee,m5 as se,p_ as Xe,m4 as Ze,lJ as Qe,aM as de,lT as et,lZ as tt,Fg as rt,CH as st,z4 as at,nM as nt,m7 as ot}from"./DomfbKVx.js";import{b as ct,p as it,F as lt,z as ut}from"./cYR0zuXX.js";import{aW as J,aS as ae,cB as _,cE as pe,cm as dt,dp as L,cC as Re,aT as pt,dj as mt,o as me,O as ft,dl as ht,c2 as St,ak as gt,au as yt,ad as bt,bB as kt,cy as vt,cW as wt,ck as It,bC as _t}from"./DkXjvKmg.js";import{w as Ct}from"./Dqy2jMvN.js";import{ag as At,cM as Et,aW as Rt,au as Tt,p as Pt}from"./1kZYk73E.js";import{g as Ot}from"./DC8fssXE.js";import{bo as p,_ as H}from"./8obSPONn.js";import{i as k}from"./DBXDrA8G.js";import{I as Wt}from"./BcNmLUvA.js";import{c as Te}from"./ChTqQfQN.js";import{k as Nt}from"./743JVs4Q.js";import{L as O}from"./B8TzQVK2.js";import{ad as xt,j as Mt,h as W,a6 as Lt,o as Dt}from"./BVEChIvV.js";import{w as Ut}from"./ClUsr6sz.js";import{r as M}from"./uXuxG9cN.js";import{aN as jt,O as Gt,R as Ft,x as qt}from"./BfxAliuB.js";import{bs as fe,bt as he,ax as Pe}from"./CYnvHqAo.js";import{d as Ht,o as Se,l as ge,s as ye}from"./CIyUrgF0.js";const ls=n.createSelector(e=>e.workspaceShare.open),us=n.createSelector(e=>e.workspaceShare.workspaceId),ds=n.createSelector(e=>{const{open:t,workspaceId:r,session:s}=e.workspaceShare;return t&&r?{workspaceId:r,session:s}:null}),ne=n.createSelector(e=>{const{open:t,workspaceId:r,withheld:s}=e.workspaceShare;return!t||!r||s||w(e.workspaceShare,r).inviteWithheld?!1:J.select(e,r)}),ps=n.createSelector(e=>e.workspaceShare.createRequest),ms=n.createSelector(e=>e.workspaceShare.mutationGeneration),fs=n.createSelector(e=>e.workspaceShare.workspaceTitle),hs=n.createSelector(e=>g(e.workspaceShare.members)),Ss=n.createSelector((e,t)=>v(e.workspaceShare.members,t)!==void 0),gs=n.createSelector(e=>e.workspaceShare.open&&e.workspaceShare.workspaceId&&!e.workspaceShare.withheld&&!w(e.workspaceShare,e.workspaceShare.workspaceId).inviteWithheld?g(e.workspaceShare.invites).filter(t=>t.workspaceId===e.workspaceShare.workspaceId):[]),ys=n.createSelector(e=>{const{principals:t,members:r}=e.workspaceShare;return g(t).filter(s=>!v(r,s.principalId)&&(s.hostRole===void 0||s.hostRole==="guest"))}),bs=n.createSelector(e=>e.workspaceShare.guestCount),ks=n.createSelector(e=>e.workspaceShare.guestLimit),vs=n.createSelector(e=>e.workspaceShare.loadStatus==="loading"),ws=n.createSelector(e=>e.workspaceShare.loadError),Is=n.createSelector(e=>e.workspaceShare.creating),_s=n.createSelector(e=>e.workspaceShare.createError),Cs=n.createSelector(e=>e.workspaceShare.createdLink),As=n.createSelector(e=>e.workspaceShare.revokingInviteId),Es=n.createSelector(e=>e.workspaceShare.removingPrincipalId),Rs=n.createSelector(e=>e.workspaceShare.addingPrincipalId),Ts=n.createSelector(e=>e.workspaceShare.actionError),Ps=n.createSelector((e,t)=>w(e.workspaceShare,t).loadStatus!=="idle"),Os=n.createSelector((e,t)=>t?g(w(e.workspaceShare,t).members):[]),Ws=n.createSelector((e,t)=>!!t&&!w(e.workspaceShare,t).withheld&&J.select(e,t));n.createSelector((e,t)=>!!t&&w(e.workspaceShare,t).withheld);const Ns=n.createSelector((e,t)=>t?w(e.workspaceShare,t).removingPrincipalId:null);n.createSelector((e,t)=>t?w(e.workspaceShare,t).removeError:null);const xs=n.createSelector(e=>e.workspaceShare.integrationAuth),Ms=n.createSelector(e=>e.workspaceShare.ownerForgeMissing),K=n.createSelector(e=>ne.select(e)&&ae.select(e)&&e.workspaceShare.sharingContext!==null&&e.workspaceShare.sharingContext===_.select(e)),$t=n.createSelector(e=>K.select(e)?e.workspaceShare.sharingEnabled:null),Ls=n.createSelector(e=>K.select(e)&&e.workspaceShare.sharingChecking),Bt=n.createSelector(e=>K.select(e)&&e.workspaceShare.sharingEnabling),Vt=n.createSelector(e=>K.select(e)?e.workspaceShare.sharingError:null),Ds=n.createSelector(e=>{if(!ne.select(e))return!1;const t=e.workspaceShare;return!t.integrationAuthLoaded||ae.select(e)&&$t.select(e)===null&&Vt.select(e)===null&&!Bt.select(e)?!0:g(t.members).length===0&&(t.loadStatus==="idle"||t.loadStatus==="loading")}),Us=n.createSelector(e=>ne.select(e)&&!!e.workspaceShare.workspaceId&&(ae.select(e)||(be.select(e)?be.select(e)===pe.select(e)?.principal.id:dt.select(e,e.workspaceShare.workspaceId)))&&pe.select(e)?.capabilities.workspaceGuestRoles===!0),js=n.createSelector(e=>e.workspaceShare.pendingRolePrincipalIds),Gs=n.createSelector(e=>e.workspaceShare.roleErrors),be=n.createSelector(e=>{const t=e.workspaceShare.workspaceId;return t?L.select(e,t)?.ownerPrincipalId??null:null}),zt=n.createSelector(e=>{const t=_.select(e),r=ct.select(e);return{context:t,workspaceIds:t?r.filter(s=>J.select(e,s)):[]}}),Fs=n.createSelector((e,t)=>{const r=w(e.workspaceShare,t);return{context:r.inviteContext,generation:r.inviteGeneration,withheld:r.inviteWithheld}}),Jt=[],Kt=n.createSelector((e,t)=>{const r=_.select(e),s=w(e.workspaceShare,t);if(!r||s.inviteContext!==r||s.inviteWithheld||!J.select(e,t))return Jt;const a=e.presence?.context===r?e.presence.members[t]:void 0,o=new Set(a?g(a).flatMap(i=>i.identity?[JSON.stringify([i.identity.provider,i.identity.host.toLowerCase(),i.identity.externalUserId])]:[]):[]),c=new Set;return g(e.workspaceShare.invites).filter(i=>{if(i.workspaceId!==t||!i.pinLogin?.trim()||i.revokedAt||i.redeemedAt&&!i.reusable||!(Date.parse(i.expiresAt)>s.inviteReceivedAt))return!1;const l=i.pinIdentity??(i.pinGithubUserId!==void 0?{provider:"github",host:"github.com",externalUserId:String(i.pinGithubUserId)}:null);if(a&&i.redeemedByPrincipalId&&v(a,i.redeemedByPrincipalId))return!1;if(!l)return!0;const m=JSON.stringify([l.provider,l.host.toLowerCase(),l.externalUserId]);return o.has(m)||c.has(m)?!1:(c.add(m),!0)})}),qs=n.createSelector(e=>{const r=zt.select(e).workspaceIds.flatMap(s=>Kt.select(e,s).map(a=>Date.parse(a.expiresAt)));return r.length?Math.min(...r):null});function Hs(e){return Object.entries(e).some(([t,r])=>r.available&&Ct(t,r.authenticated))}const $s=n.createSelector(e=>e.hostRequirements.git),Bs=n.createSelector(e=>e.hostRequirements.node),Vs=n.createSelector(e=>e.hostRequirements.gh),zs=n.createSelector(e=>e.hostRequirements.checking),Js=n.createSelector(e=>e.hostRequirements.hasCheckedOnce);function Oe(e){const t=e.gitlabAuth?.statusFailed===!0;return At({labsEnabled:e.userPreferences?.labsPlainFolderWorkspacesEnabled===!0,protocolVersion:e.daemonHealth?.stats?.protocolVersion,githubConnected:e.githubAuth?.isAuthenticated===!0,githubSettled:e.githubAuth?.statusSettled===!0,githubFailed:e.githubAuth?.statusFailed===!0,gitlabConnected:e.gitlabAuth?.isConfigured===!0,gitlabSettled:e.gitlabAuth?.statusReady===!0||t,gitlabFailed:t})}const Ks=n.createSelector(Oe),Ys=n.createSelector(e=>e.hostRequirements.node.ok&&(e.hostRequirements.git.available||Oe(e))),Xs=n.createSelector(e=>{const t=e.hostRequirements.providerCli;return t?{context:t.context,warnings:g(t.warnings)}:void 0}),Zs="22.0.0";function Yt(e){return e.length>15?`${e.slice(0,15)}…`:e}function B(e){return e.name?.trim()||Yt(e.clientId)}function Qs(e){const{eligibleClients:t,ownClientId:r,driving:s,pinnedClientId:a}=e,o=t.find(l=>l.clientId===r&&l.connected),c=s!==null&&!s.connected,i=!s||s.clientId===r;return{mode:c?"offline":i?"here":"elsewhere",hostName:s?B(s):o?B(o):"",canSwitchHere:!!(o&&a!==r)}}const ea=n.createSelector(e=>e?.browserClients?.ownClientId??null),ta=n.createSelector(e=>e?.browserClients?.ownClientIdConfirmed===!0);n.createSelector(e=>g(e.browserClients.liveClients));const ra=n.createSelector((e,t)=>t?e?.browserClients?.byWorkspaceId[t]?.liveClientsLoaded??!1:e?.browserClients?.liveClientsLoaded??!1);n.createSelector((e,t)=>v(e.browserClients.liveClients,t));const sa=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??ee).browserClient),aa=n.createSelector((e,t)=>{const r=e?.browserClients?.byWorkspaceId[t];return r?.pinnedClientId!==void 0||r?.browserClient!=null});function Q(e){const t=e.prettyHostname??e.hostname??e.name;return{clientId:e.clientId,...t!==void 0?{name:t}:{},connected:!0}}const na=n.createSelector((e,t)=>{const r=e?.browserClients??te,s=r.byWorkspaceId[t]?.liveClients??re(),a=g(s).filter(y=>y.capabilities.browserExec===!0).map(Q),o=(r.byWorkspaceId[t]??ee).browserClient,c=r.byWorkspaceId[t],i=c?.pinnedClientId!==void 0?c.pinnedClientId:o?.source==="workspace"?o.clientId:null,l=i===null?Ot(o):void 0;let m=null;if(o?.resolved){const y=v(s,o.resolved.clientId);m=y?Q(y):{...o.resolved,connected:!0}}else o?.source==="workspace"?m={clientId:o.clientId,connected:!1}:l&&(m={clientId:l.clientId,connected:!1});return{eligibleClients:a,ownClientId:r.ownClientId??"",routedVia:o?.source==="default"?l?.via:void 0,driving:m,pinnedClientId:i}}),oa=n.createSelector((e,t)=>{const r=e?.browserClients??te;if(!r.ownClientId||!r.ownClientIdConfirmed)return!1;const s=r.byWorkspaceId[t]?.liveClients??re(),a=v(s,r.ownClientId);return a!==void 0&&a.capabilities.browserExec!==!0}),ca=n.createSelector((e,t,r)=>{const s=e?.browserClients??te,a=r?s.byWorkspaceId[r]?.liveClients??re():s.liveClients,o=r?s.byWorkspaceId[r]?.liveClientsLoaded:s.liveClientsLoaded,c=v(a,t);return c?{name:B(Q(c)),connected:!0}:{name:B({clientId:t}),connected:!o}}),ia=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??ee).tabsRevision),la=n.createSelector(e=>Object.entries(e.browserClients?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),x=new Map;function ua(e,t){return x.set(e,t),()=>{x.get(e)===t&&x.delete(e)}}async function da(e){const t=x.get(e);return t?t():null}function pa(e){x.delete(e)}const We="From repo config",ma="repo-config";function fa(e,t){return t==="repo-config"?p.workspace_setupScriptEditor_fromRepoConfig_name():t==="custom"?p.workspace_setupScriptEditor_custom_name():e}function Ne(e){if(!e||typeof e!="object"||Array.isArray(e))return{setupScript:null};const t=e.setupScript;return{setupScript:typeof t=="string"&&t.trim().length>0?t:null}}function Xt(e){let t;try{t=JSON.parse(e)}catch{return null}return Ne(t).setupScript}async function ha(e){if(!e)return null;try{const t=await k(Wt.SETUP_SCRIPTS.READ_REPO_CONFIG,{repoPath:e}),r=t?.success?t.data?.content:null;return typeof r=="string"?Xt(r):null}catch{return null}}async function Sa(e,t,r){if(!e||!t)return null;try{const{appClient:s}=await H(async()=>{const{appClient:o}=await import("./DC8fssXE.js").then(c=>c.p);return{appClient:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url),a=await s.integrations.githubRepoConfig(e,t,r);return Ne(a.config).setupScript}catch{return null}}function ga(e){const t=e.setupScript.trim();return t?e.setupScriptNameSource==="repo-config"&&e.setupScriptName===We&&e.repoConfigScriptRepo===e.repoPath&&t===(e.repoConfigScript??"").trim()?void 0:t:e.explicitChoice?"cd .":void 0}function ya(e){const{repoConfigScript:t,lastUsed:r,genericTemplate:s}=e;return t?{content:t,name:We,source:"repo-config"}:r?{content:r.content,name:r.nameSource==="repo-config"?"Custom":r.name,source:r.nameSource==="repo-config"?"custom":r.nameSource??"named"}:s?{content:s.content,name:s.name,source:"named"}:{content:"",name:"Custom",source:"custom"}}const xe="setup-scripts:last-used-by-repo",Me="setup-scripts:recent-by-repo",V=20,Le=10,Zt=["repo-config","custom","named"];function oe(e,t){return t?`${e}\0${t}`:e}function De(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.name=="string"&&typeof t.content=="string"&&t.content.trim().length>0&&typeof t.usedAt=="string"&&(t.nameSource===void 0||Zt.includes(t.nameSource))}function z(){try{const e=localStorage.getItem(xe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const r={};for(const[s,a]of Object.entries(t))s&&De(a)&&(r[s]=a);return r}catch{return{}}}function Ue(){try{const e=localStorage.getItem(Me);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const r={};for(const[s,a]of Object.entries(t)){if(!s||!Array.isArray(a))continue;const o=a.filter(De);o.length>0&&(r[s]=o)}return r}catch{return{}}}function Qt(e,t){return e.name===t.name&&(e.nameSource??"named")===(t.nameSource??"named")&&e.content.trim()===t.content.trim()}function je(e){return[...e].sort((t,r)=>r.usedAt.localeCompare(t.usedAt))}function Ge(e){const t=[];for(const r of e)t.some(s=>Qt(s,r))||t.push(r);return t}function ba(e,t){if(!e)return[];const r=oe(e,t),s=Ue()[r]??[],a=z()[r];return Ge(je(a?[...s,a]:s)).slice(0,Le).map(c=>({name:c.name,content:c.content,nameSource:c.nameSource??"named",usedAt:c.usedAt}))}function er(e,t,r){try{const s=Ue(),a=s[e]??(r?[r]:[]);s[e]=Ge([t,...je(a)]).slice(0,Le);const o=Object.entries(s);o.length>V&&(o.sort(([,c],[,i])=>i[0].usedAt.localeCompare(c[0].usedAt)),o.length=V),localStorage.setItem(Me,JSON.stringify(Object.fromEntries(o)))}catch{}}function ka(e,t){if(!e)return;const r=z()[oe(e,t)];return r?{name:r.name,content:r.content,nameSource:r.nameSource??"named"}:void 0}function va(e,t,r){const s=t.content.trim();if(!e||!s)return;const a=oe(e,r),o={name:t.name,content:s,usedAt:new Date().toISOString(),nameSource:t.nameSource??"named"};er(a,o,z()[a]);try{const c=z();c[a]=o;const i=Object.entries(c);i.length>V&&(i.sort(([,l],[,m])=>m.usedAt.localeCompare(l.usedAt)),i.length=V),localStorage.setItem(xe,JSON.stringify(Object.fromEntries(i)))}catch{}}const j=Te("ProviderAvailabilityClient");let A=null;async function wa(){if(typeof window>"u")return j.debug("Skipping provider availability check - not in browser environment"),ke();const e=Re.select(n.state);if(A&&A.connection===e)return j.debug("Joining in-flight provider availability request"),A.promise;const t={},r=(async()=>{try{j.debug("Checking provider availability via IPC");const s=await k(Nt.GET_AVAILABILITY);if(!s.success)throw new Error(s.error||"Failed to get provider availability");const a=s.data??ke();return j.debug("Provider availability fetched",{hasAnyProvider:a.hasAnyProvider,auggie:a.providers.auggie.available,claudeCode:a.providers.claudeCode.available,codex:a.providers.codex.available,cortex:a.providers.cortex.available,mock:a.providers.mock?.available??!1,opencode:a.providers.opencode.available,droid:a.providers.droid?.available??!1,grok:a.providers.grok?.available??!1,unsloth:a.providers.unsloth?.available??!1}),a}finally{A?.token===t&&(A=null)}})();return A={connection:e,token:t,promise:r},r}function ke(){return{hasAnyProvider:!1,providers:{auggie:{available:!1},claudeCode:{available:!1},codex:{available:!1},cortex:{available:!1},mock:{available:!1},opencode:{available:!1},pi:{available:!1},droid:{available:!1},grok:{available:!1},unsloth:{available:!1}}}}const tr={async isAuthenticated(e){try{return await k(O.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async getAuthState(e=!1,t){try{return await k(O.GET_AUTH_STATE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return{isAuthenticated:!1,requiresDaemonAuth:!0}}},async getStatus(e){try{return await k(O.GET_STATUS,...e===void 0?[]:[{workspaceId:e}])}catch{return{isConfigured:!1,oauthUrl:""}}},async fetchMyIssues(e="assigned",t){return(await this.fetchMyIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async fetchMyIssuesPage(e="assigned",t){try{return await k(O.FETCH_MY_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async searchIssuesPage(e,t){try{return await k(O.SEARCH_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}}},Ia=Object.freeze(Object.defineProperty({__proto__:null,linearAuthClient:tr},Symbol.toStringTag,{value:"Module"})),I={IS_AUTHENTICATED:"sentry-auth:is-authenticated",SAVE_CONFIG:"sentry-auth:save-config",GET_AUTH_STATE:"sentry-auth:get-auth-state",LOGOUT:"sentry-auth:logout",FETCH_PROJECTS:"sentry-auth:fetch-projects",FETCH_ISSUES:"sentry-auth:fetch-issues",SEARCH_ISSUES:"sentry-auth:search-issues",GET_ISSUE:"sentry-auth:get-issue"},rr={async isAuthenticated(e){try{return await k(I.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async saveConfig(e,t){return await k(I.SAVE_CONFIG,{organization:e,apiToken:t})},async getAuthState(e){try{return await k(I.GET_AUTH_STATE,...e===void 0?[]:[{workspaceId:e}])}catch{return{isAuthenticated:!1}}},async logout(){await k(I.LOGOUT)},async fetchProjects(e){try{return await k(I.FETCH_PROJECTS,...e===void 0?[]:[{workspaceId:e}])}catch{return[]}},async fetchIssues(e){return(await this.fetchIssuesPage(e)).issues},async fetchIssuesPage(e){try{return await k(I.FETCH_ISSUES,e)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t)).issues},async searchIssuesPage(e,t,r){try{return await k(I.SEARCH_ISSUES,{query:e,project:t,...r})}catch{return{issues:[],nextToken:null}}},async getIssue(e,t){try{return await k(I.GET_ISSUE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return null}}},_a=Object.freeze(Object.defineProperty({__proto__:null,sentryAuthClient:rr},Symbol.toStringTag,{value:"Module"})),ce=n.createSelector(e=>{const t=_.select(e);return!t||!pt.select(e)?null:JSON.stringify([t,e.hostExecution.generation,e.repositoryCheckout.authorityGeneration,e.gitlabAuth.host,e.gitlabAuth.instanceBaseUrl,e.gitlabAuth.statusReady,e.gitlabAuth.isConfigured,e.gitlabAuth.user])}),Y=n.createSelector((e,t)=>v(e.repositoryCheckout.forms,t)??null),Ca=n.createSelector((e,t)=>{const r=Y.select(e,t);return r?.admission===ce.select(e)&&r.status==="ready"?g(r.projects):[]}),Aa=n.createSelector((e,t)=>{const r=Y.select(e,t);return r?.admission===ce.select(e)&&r.status==="ready"?g(r.branches):[]}),sr=n.createSelector((e,t)=>{const r=Y.select(e,t);return!r||r.status!=="ready"||r.admission!==ce.select(e)||!r.capture||!r.project||!r.branch?null:{checkoutId:r.capture.checkoutId,revision:r.capture.revision,projectPath:r.project.projectPath,branch:r.branch.name,commitSha:r.branch.commitSha,mode:r.mode}}),Ea=n.createSelector((e,t)=>{const r=sr.select(e,t);return!!r&&(r.mode==="direct"||Y.select(e,t)?.warmStatus==="ready")}),Ra="__new-workspace__",Ta="__initializer__",Pa="compact-workspace-initializer-state-prompt",Oa="onboarding-prompt",G=20*1024*1024,ve=Te("NewWorkspaceDraft");function Wa(e,t){if(e.length>G)return ve.warn("Draft text exceeds the size guard; skipping persistence",{textLength:e.length,limit:G}),null;const r=xt(t);if(r.length===0)return{text:e};const s=[];let a=e.length+2,o=0;for(const c of r){const i=JSON.stringify(c).length+1;if(a+i>G){o+=1;continue}s.push(c),a+=i}return o>0&&ve.warn("Draft attachments exceed the size guard; persisting the ones that fit",{limit:G,attachmentCount:r.length,droppedCount:o}),s.length>0?{text:e,attachments:s}:{text:e}}const ar="host.providerAuthStatus";function nr(e={}){const t={};return e.workspaceId&&(t.workspaceId=e.workspaceId),typeof e.providerId=="string"&&e.providerId.length>0&&(t.providerId=e.providerId),typeof e.force=="boolean"&&(t.force=e.force),t}function or(e,t){const r=t.toLowerCase(),s=e.toLowerCase();return r.startsWith(s)?/^(['’]s\s+organization)?$/.test(r.slice(s.length)):!1}function cr(e){const{email:t,orgName:r}=e??{};return t&&r?or(t,r)?t:`${t} · ${r}`:t||r||void 0}function ir(e){const t={};for(const r of e?.providers??[]){const s={authenticated:r.authenticated??void 0},a=cr(r.identity);a!==void 0&&(s.authDetails=a),r.identity?.email&&(s.email=r.identity.email),t[r.id]=s}return t}const lr=6e4,R=new Map,F=new Map,E=new Map;let $=0,Fe=0;const ur=e=>JSON.stringify([Re.select(n.state),Fe,e.workspaceId??null,e.providerId??"*"]);function dr(e){if(e.method!=="events.event"||!e.params)return;const t=e.params,s=(t.event&&typeof t.event=="object"?t.event:t).type;return typeof s=="string"?s:void 0}function X(e){if($+=1,e)for(const t of R.keys()){const[,,,r]=JSON.parse(t);(r===e||r==="*")&&R.delete(t)}else R.clear()}typeof fe=="function"&&fe(e=>{["provider:auth-changed","host:execution-context-changed"].includes(dr(e)??"")&&X()});typeof he=="function"&&he(()=>{Fe+=1,X()});function pr(e={}){const t=ur(e);if(e.force)X(e.providerId);else{const o=R.get(t);if(o&&o.expiresAt>Date.now())return Promise.resolve(o.verdicts);o&&R.delete(t)}const r=F.get(t);if(!e.force&&r?.generation===$)return r.promise;if(r){const o=E.get(t);if(o)return o.force||=e.force===!0,o.promise;let c;const i=r.promise.catch(()=>({})).then(()=>(E.get(t)===c&&E.delete(t),pr({...e,force:c.force}))).finally(()=>{E.get(t)===c&&E.delete(t)});return c={force:e.force===!0,promise:i},E.set(t,c),i}const s=$,a=Pe(ar,nr(e)).then(ir).then(o=>(s===$&&R.set(t,{verdicts:o,expiresAt:Date.now()+lr}),o)).finally(()=>{F.get(t)?.promise===a&&F.delete(t)});return F.set(t,{generation:s,promise:a}),a}function Na(e,t=e,r="default",s,a){if(!Ut.select(n.state))return;const o=a??it.select(n.state,t)??lt.select(n.state,t)[0];if(!o)return;const c=ut.select(n.state,t,o),i={type:"discussion",title:s??(r==="new"?p.workspace_discussion_new_title():p.workspace_discussion_title()),workspaceId:e,closable:!0,data:{conversationId:r}},l=c?.tabs.find(m=>ze(m,i));r==="new"&&n.dispatch(Je(e)),n.dispatch(l?Ke(t,l.id,o):Ye(t,i,o,void 0,!0,void 0,!0))}function xa(e,t){return e.name?.trim()?e.name.trim():e.kind==="workspace"?e.id&&e.id!=="default"?p.workspace_discussion_conversation_title():p.workspace_discussion_title():e.participants.filter(s=>s.principalId!==t).map(s=>s.displayName||s.login||p.workspace_discussion_unknownAuthor_label()).join(", ")||p.workspace_discussion_group_title()}const mr=n.createSelector((e,t,r)=>{const s=Ee(e.repositoryContext,t);return r!==null&&s.binding===r?s:null});n.createSelector((e,t,r)=>{const s=mr.select(e,t.workspaceId,r);return s?.status==="ready"?v(s.roots,M(t))?.context:void 0});const Ma=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission)return null;const r=Ee(e.repositoryContext,t.workspaceId),s=r.ownership;return!s||s.demandId!==t.demandId||s.admission!==t.admission||s.request.workspaceId!==t.workspaceId?null:{status:r.status,scope:r.scope,revision:r.revision,roots:r.status==="ready"?g(r.roots).map(a=>a.context):[],unavailableReason:r.unavailableReason}}),La=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission)return null;const r=e.repositoryContext.selectionEdits,s=r?v(r,t.editId):void 0;return s&&s.status!=="closed"&&s.owner.admission===t.admission&&M(s.owner.root)===M(t.root)?s:null}),Da=n.createSelector((e,t)=>{const r=e.repositoryContext.selectionEdits;return!!r&&g(r).some(s=>s.owner.root.workspaceId===t&&s.owner.admission===_.select(e)&&(s.status==="capturing"||s.status==="pending"&&(!s.observation||s.observation.attempt?.status==="pending")))}),Ua=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission||t.hostContext===null||mt.select(e,t.root.workspaceId)!==t.hostContext)return null;const r=e.repositoryContext.nativeReviewAttempts,s=r?v(r,t.attemptId):void 0;return s&&s.status!=="closed"&&s.owner.admission===t.admission&&s.owner.hostContext===t.hostContext&&M(s.owner.root)===M(t.root)?s:null}),ja=n.createSelector((e,t)=>e.repositoryContext.nativeReviewAttempts?v(e.repositoryContext.nativeReviewAttempts,t):void 0),fr=["venv",".venv","virtualenv","node_modules","google-cloud-sdk","__pycache__",".pytest_cache",".mypy_cache",".ruff_cache",".tox",".nox"];function hr(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function Sr(e){const t=new Set(fr);return hr(e).some(r=>t.has(r))}const gr=new Set(["lastActivity","statusMessage","statusImageAssetId"]),yr=new Set([".git",".playwright-cli",".svelte-kit",".vite",".turbo",".cache",".parcel-cache",".next",".nuxt",".output","build","coverage","dist","playwright-report","target","test-results"]);function br(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function kr(e){if(!e.type.startsWith("file:"))return null;const t=e.data,r=t?.relativePath??t?.path??t?.filePath;return typeof r=="string"&&r.length>0?r:null}function vr(e){const t=kr(e);return!t||Sr(t)?!1:!br(t).some(r=>yr.has(r))}function wr(e){if(e.type==="workspace:displayStatus-changed")return!0;if(e.type!=="workspace:updated")return!1;const t=e.data;if(!t?.changes||typeof t.changes!="object"||Array.isArray(t.changes))return!1;const r=Object.keys(t.changes).filter(s=>s!=="workspaceId");return r.length>0&&r.every(s=>gr.has(s))}function f(e){return typeof e=="string"?e.trim():""}function T(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function we(e){const t=T(e.data),r=f(t.agentId)||f(e.sessionId),s=f(t.messageId);return r&&s?JSON.stringify([r,s]):""}function Ir(e){const t=T(e.data),r={workspaceId:e.workspaceId,closable:!0},s=a=>a?{...r,type:"note",noteId:a,title:f(t.title)||f(t.noteTitle)||p.layout_tabTypes_note_title()}:null;switch(e.type){case"note:created":case"note:updated":case"comment:added":case"comment:resolved":return s(f(t.noteId));case"task:status-changed":return s(f(t.noteId)||f(t.linkedNoteId));case"spec:updated":case"goal:updated":return s("spec");case"agent:created":case"agent:renamed":case"agent:restored":case"agent:updated":case"agent:message":case"agent:user-message:sent":{const a=f(t.agentId)||f(e.sessionId);return a?{...r,type:"agent",agentId:a,title:f(t.agentName)||p.layout_tabTypes_agent_title()}:null}case"file:changed":{const a=f(t.path)||f(t.relativePath);return a&&t.action!=="delete"?{...r,type:"file",filePath:a,title:a.split(/[\\/]/).pop()||a}:null}case"git:commit":{const a=f(t.commit),o=f(t.gitRootId);return a?{...r,type:"changes",title:p.layout_tabTypes_changes_title(),data:{commitHash:a,...o?{gitRootId:o}:{}}}:null}default:return null}}function Ie(e,t){const r=T(e.data),s=Object.fromEntries(Object.entries(r).filter(([,c])=>typeof c=="string")),a=c=>t?p.workspace_peopleActivity_actorAction_label({name:t,action:c}):c;switch(e.type){case"note:created":case"note:updated":case"note:deleted":case"spec:updated":case"goal:updated":return W({...e,actor:{...e.actor,name:t},data:s});case"agent:created":case"agent:renamed":case"agent:deleted":case"agent:restored":case"git:commit":case"git:push":case"git:pull":case"git:branch":case"git:merge":return a(W({...e,actor:{...e.actor,name:void 0},data:s}));case"agent:updated":return f(r.modelId)||r.completionReportCleared===!0?a(W({...e,actor:{...e.actor,name:void 0},data:r})):null;case"file:changed":return vr(e)?W({...e,actor:{...e.actor,name:t},data:{path:f(r.path)||f(r.relativePath),action:f(r.action)}}):null;case"comment:added":return t?p.events_activity_authorCommented_label({author:t}):p.workspace_peopleActivity_commented_label();case"comment:resolved":return r.resolved===!1?a(p.events_activity_reopenedCommentThread_label()):r.resolved===!0?a(p.events_activity_resolvedCommentThread_label()):null;case"agent:message":case"agent:user-message:sent":{const c=f(r.agentName)||f(r.toAgentName);return a(c?p.workspace_peopleActivity_messagedAgent_label({agent:c}):p.workspace_peopleActivity_sentMessage_label())}case"task:status-changed":return a(W({...e,actor:{...e.actor,name:void 0},data:{taskName:f(r.taskName)||f(r.noteTitle),newStatus:f(r.newStatus)||f(r.status)}}));case"workspace:created":return a(p.events_activity_createdWorkspace_label());case"workspace:updated":{if(wr(e))return null;const c=T(r.changes);if(Object.keys(c).filter(l=>l!=="workspaceId").length===0)return null;const i=f(c.title);return a(i?p.events_activity_renamedWorkspaceTo_label({title:i}):p.events_activity_updatedWorkspace_label())}default:return null}}function N(e,t){const r=f(e);return r===t||/^(user|you|system|unknown|anonymous|local user)$/i.test(r)?"":r}function _r(e,t,r,s){const a=new Map(r.map(u=>[u.principalId,u])),o=new Map;for(const u of t){if(u.workspaceId!==e||u.type!=="agent:last-message")continue;const d=T(u.data),h=me({role:d.role==="user"?"user":"system",author:d.author,metadata:d.metadata}),S=we(u);if(!h||!S||typeof d.lastUserMessage!="string")continue;const b=Mt({id:f(d.messageId),role:"user",timestamp:u.timestamp,contentBlocks:[{type:"text",text:d.lastUserMessage}],author:h,metadata:d.metadata},s);b&&o.set(S,b)}const c=new Set,i=new Set,l=[];let m=0;for(const u of t){if(u.workspaceId!==e||!f(u.id)||c.has(u.id))continue;const d=Date.parse(u.timestamp);if(!Number.isFinite(d)){m++;continue}const h=T(u.data),S=u.type==="agent:message",b=S?me({role:h.role==="user"?"user":"system",author:h.author,metadata:h.metadata}):null;if(S?!b:u.actor?.type!=="user"){S&&h.role==="user"&&u.actor?.type==="user"&&ft(h.metadata)&&l.push({row:null,timestamp:d,segment:m});continue}const Ve=S?f(h.messageId):"",P=S?we(u):"";if(P&&i.has(P))continue;const C=f(u.actor?.id),Z=C?a.get(C):void 0,D=b?N(b.displayName,b.principalId??"")||N(b.login,b.principalId??""):N(u.actor.name,C)||N(Z?.displayName,C)||N(Z?.login,C),le=Ie(u,"");if(!le)continue;if(!D){l.push({row:null,timestamp:d,segment:m});continue}const U=S?o.get(P)??null:null,ue=U?p.workspace_peopleActivity_actorAction_label({name:D,action:U}):Ie(u,D);ue&&(c.add(u.id),P&&i.add(P),l.push({timestamp:d,segment:m,row:{id:u.id,name:D,principalId:b?f(b.principalId)||null:C||null,avatarUrl:b?b.avatarUrl:Z?.avatarUrl??null,label:ue,actionLabel:U??le,continuation:!1,timestamp:u.timestamp,destination:Ir(u),messageId:Ve||null,messagePreview:U}}))}l.sort((u,d)=>d.timestamp-u.timestamp);const y=[];for(const[u,d]of l.entries()){if(!d.row)continue;const h=l[u-1],S=h?h.timestamp-d.timestamp:NaN;d.row.continuation=!!(d.row.principalId&&h?.row?.principalId===d.row.principalId&&h.segment===d.segment&&Number.isFinite(S)&&S>=0&&S<=15*6e4),y.push(d.row)}return y}const Ga=n.createSelector(e=>e.workspaceEvents.subscriptionAttempt),Fa=n.createSelector(e=>e.workspaceEvents.subscriptionGeneration),Cr=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??se).events),qa=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??se).nextToken),Ha=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]?.peopleRequestId??null)!==null),$a=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleError??null),Ba=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleInitialized??!1),qe=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??se).peopleStreams),Va=n.createSelector((e,t)=>Object.values(qe.select(e,t)).every(r=>r.initialized&&r.nextToken===null)),za=n.createSelector((e,t,r)=>{const s=Cr.select(e,t),o=_r(t,s,Et.select(e,t),L.select(e,t)?.ownerPrincipalId)[r-1]?.timestamp,c=qe.select(e,t);return["user","message"].filter(i=>{const l=c[i];if(!l.initialized)return!0;if(l.nextToken===null)return!1;const m=s.find(y=>y.id===l.oldestEventId)?.timestamp;return!o||!m||!(Date.parse(m)<=Date.parse(o))})}),Ja=n.createSelector((e,t)=>{const r=[],s=new Set,a=new Set,o=c=>{const i=c.block.attachmentId??c.id;if(!s.has(i)){if(!c.block.attachmentId&&c.block.data&&!c.block.dataTruncated){const l=`${c.block.mimeType}/${c.block.data}`;if(a.has(l))return;a.add(l)}s.add(i),r.push(c)}};for(const[c,i]of Object.entries(Lt.select(e,t)))for(const l of g(i))l.imageData&&l.imageMimeType?o({id:`draft/${c}/${l.id}`,name:l.label,block:{type:"image",data:l.imageData,mimeType:l.imageMimeType}}):l.type==="file"&&(l.attachmentId||l.placementStatus)&&o({id:`draft/${c}/${l.id}`,name:l.label,placementStatus:l.placementStatus,block:{type:l.attachmentMimeType?.startsWith("image/")?"image":"file",attachmentId:l.attachmentId,mimeType:l.attachmentMimeType,fileName:l.label,size:l.attachmentSize}});for(const c of ht.select(e,t)){const i=St.select(e,c),l=[...gt.select(e,c),...yt.select(e,c)];for(const m of l)if(m.role==="user")for(const[y,u]of(m.contentBlocks??[]).entries()){if(u.type!=="image"&&!Dt(u))continue;const d=u.id?i?.[Xe(m.id,u.id)]:void 0,h=d?.status==="loaded"?d.block:u;o({id:`${c}/${m.id}/${u.id??y}`,name:h.fileName,block:h,agentId:c,messageId:m.id,hydration:d})}}return r}),Ar=n.createSelector((e,t)=>e.context.byWorkspaceId[t]??Ze),Er=n.createSelector((e,t)=>g(Ar.select(e,t).items)),Ka=n.createSelector((e,t)=>Er.select(e,t).filter(r=>!r.parentNoteId)),Ya=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedAgentIds??He),Xa=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedFilePaths??He),He={},Za=n.createSelector((e,t,r)=>{const s=e.gitWrite.byWorkspaceId[t]?.operations;return s?v(s,r):void 0}),$e=n.createSelector((e,t)=>{const r=e.gitWrite.byWorkspaceId[t]?.operations;return r?g(r):[]}),Qa=n.createSelector((e,t)=>$e.select(e,t).some(r=>r.status==="queued"||r.status==="running")),en=n.createSelector((e,t)=>$e.select(e,t).filter(r=>r.operation.kind==="partialCommit"&&(r.status==="queued"||r.status==="running")));function _e(e){return e.title||`PR #${e.number}`}const ie=n.createSelector((e,t)=>{const r=e.gitRoots?.byWorkspaceId?.[t];return r?g(r.gitRoots):[]});function Rr(e){return{key:"primary",isPrimary:!0,path:e.worktreePath??e.path,branch:e.branch,repoOwner:e.repositoryOwner,repoName:e.repositoryName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests}}function Tr(e){return{key:e.id,isPrimary:!1,path:e.path,branch:e.branch,repoOwner:e.repoOwner,repoName:e.repoName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests,gitRoot:e}}const tn=n.createSelector((e,t)=>{const r=L.select(e,t),s=ie.select(e,t).map(Tr);return r?[Rr(r),...s]:s}),rn=n.createSelector((e,t)=>ie.select(e,t).length>0),sn=n.createSelector(e=>Object.entries(e.gitRoots?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),Pr=n.createSelector((e,t,r)=>v((e.acceptWorkflow.byWorkspaceId[t]??Qe).operations,r)),an=n.createSelector((e,t,r)=>Pr.select(e,t,r)?.status==="running"),nn=n.createSelector((e,t)=>e.acceptWorkflow.byWorkspaceId[t]?.mergeDrawerOpen??!1),on=n.createSelector((e,t)=>{const r=bt.select(e,t)?.hasRemote??!1,s=L.select(e,t)?.pullRequests?.some(a=>a.status===de.Open||a.status===de.Draft)??!1;return{squash:!1,viaPR:r&&s,pushAfter:r,...e.acceptWorkflow.byWorkspaceId[t]?.mergeOptions}}),cn=n.createSelector(e=>Object.keys(e.acceptWorkflow.byWorkspaceId).filter(t=>e.acceptWorkflow.byWorkspaceId[t].observerRequested)),ln=n.createSelector((e,t)=>{const r=L.select(e,t),s=kt.select(e,t),a=vt.select(e,t),o=r?.repositoryOwner&&r.repositoryName?`${r.repositoryOwner}/${r.repositoryName}`:void 0,c=Rt(Tt(r?.pullRequests,r?.activePullRequest,(i,l)=>Pt(i,r?.repositoryOwner,r?.repositoryName,l),_e,o),wt.select(e,t),o,ie.select(e,t),_e).own;return{visible:(e.acceptWorkflow.byWorkspaceId[t]?.consumerCount??0)>0,ready:_t.select(e,t),owner:!It.select(e,t),authenticated:jt.select(e),pushedCount:s.filter(i=>i.isPushed).length,hasRemote:a.hasRemote,clearReset:a.hasResetToTrunk&&c.some(i=>i.status!=="merged"),clearMerge:!!(a.mergeHeadSha&&s[0]?.hash&&a.mergeHeadSha!==s[0].hash)}}),un=n.createSelector((e,t,r)=>e.bgExecutor?.byWorkspaceId[t]?.executors[r]??et),Or=n.createSelector((e,t)=>e.prWorkflow.byWorkspaceId[t]??tt);n.createSelector((e,t,r)=>Or.select(e,t).operations[r]);const dn=n.createSelector(e=>Object.keys(e.noteReadTracking.unreadNoteIds)),pn=n.createSelector(e=>e.noteReadTracking.readRecords),Wr="host.providerTestPrompt",Nr=Ht("ok",[Se({ok:ge(!0)}).passthrough(),Se({ok:ge(!1),reason:ye().min(1),message:ye()}).passthrough()]),xr=3e5;async function mn(e){const t=await Pe(Wr,{providerId:e.providerId,...e.model?{model:e.model}:{}},{timeoutMs:xr}),r=Nr.parse(t);return(r.ok||r.reason==="auth-required")&&X(e.providerId),r}const Mr=-1,Lr=/^remote-script-lost:\s*/,Dr=["idle","starting","running","restarting","exited"],Ce=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Ae=e=>typeof e=="string"&&e.trim().length>0;function Ur(e){return Ce(e)&&Ae(e.remoteAgentId)&&Ae(e.nodeId)&&Ce(e.runtime)&&Dr.includes(e.runtime.status)}function fn(e){return Array.isArray(e.machineRuns)?e.machineRuns.filter(Ur):[]}function hn(e,t,r){const s=Gt(e.nodeId,r)??{nodeId:e.nodeId,name:p.remoteAgent_location_unknownMachine(),platform:null,state:"ready"};if(r&&r.id===e.nodeId)return s;const a=t?.nodeId===e.nodeId?t:null;return{...s,name:a?.nodeName?.trim()||s.name,platform:Ft(a?.placement?.os,a?.placement?.arch)}}function jr(e){return e.status==="exited"&&e.exitCode===Mr}function Gr(e){const t=e.error?.trim().replace(Lr,"").trim();switch(t){case"the machine disconnected":return p.scripts_remote_lostDisconnected_label();case"the machine was removed":return p.scripts_remote_lostRemoved_label();case"the agent was deleted":return p.scripts_remote_lostAgentDeleted_label();case"the agent was stopped for good":return p.scripts_remote_lostAgentStopped_label();default:return t||p.scripts_remote_lostReason_fallback()}}function Sn(e){if(jr(e))return{kind:"lost",label:p.scripts_remote_lost_tooltip({reason:Gr(e)})};const t=qt(e);switch(t){case"running":return{kind:t,label:p.terminal_quakeOverlay_status_running()};case"restarting":return{kind:t,label:p.workspace_devScripts_restarting_label()};case"idle":return{kind:t,label:p.terminal_quakeOverlay_status_idle()};case"succeeded":return{kind:t,label:p.terminal_quakeOverlay_status_exitedZero()};case"failed":return{kind:t,label:p.terminal_quakeOverlay_status_errorCode({code:e.exitCode??1})};case"stopped":return{kind:t,label:p.terminal_quakeOverlay_status_stoppedSignal({signal:(e.exitCode??128)-128})};default:return{kind:t,label:p.terminal_quakeOverlay_status_exited()}}}const q=e=>typeof e=="string"&&e.length>0,Fr=/\bremote-script-agent-ending:/;function gn(e){return!!e&&Fr.test(e)}function yn(e){if(!e||typeof e!="object")return null;const t=e.data;if(!t||typeof t!="object")return null;const r=t,s=e instanceof Error&&e.message?{message:e.message}:{};return r.code==="machine-update-required"?{success:!1,code:"machine-update-required",update:r.update==="backend"?"backend":"machine",...q(r.machineVersion)?{machineVersion:r.machineVersion}:{},...q(r.backendVersion)?{backendVersion:r.backendVersion}:{},...s}:r.code==="machine-unreachable"?{success:!1,code:"machine-unreachable",attempts:Array.isArray(r.attempts)?r.attempts.flatMap(o=>{const c=o??{};return q(c.route)&&q(c.error)?[{route:c.route,error:c.error}]:[]}):[],...s}:null}function bn(e){const r=e.filter(a=>a.runtime.status==="running"&&a.runtime.detectedUrl?.trim()).sort((a,o)=>(o.runtime.startedAt??"").localeCompare(a.runtime.startedAt??""))[0],s=r?.runtime.detectedUrl?.trim();return!r||!s?null:{scriptId:r.id,name:r.name,url:s}}const qr={status:"idle",error:null},Hr=n.createSelector((e,t)=>e.workspaceLifecycle.loadByWorkspaceId[t]??qr);n.createSelector((e,t)=>Hr.select(e,t).error);const kn=n.createSelector((e,t)=>v(e.workspace.workspaces,t)??e.workspace.pendingCreations[t]),Be=n.createSelector((e,t)=>e.workspaceLifecycle.sessionPhaseByWorkspaceId[t]),$r=e=>e==="hydrated"||e==="live",vn=n.createSelector((e,t)=>{const r=Be.select(e,t);return r==="hydrated"||r==="live"}),wn=n.createSelector(e=>{const t=e.workspaceLifecycle.sessionPhaseByWorkspaceId;return Object.keys(t).filter(r=>$r(t[r]))}),In=n.createSelector((e,t)=>Be.select(e,t)==="live");function _n(e){const{selectedProviderId:t,activeProviderId:r,recommitActive:s,dispatch:a}=e;if(t&&!(!s&&t===r))return a(rt({providerId:t,enabled:!0})),a(st(t)),a(at()),t}function Cn(e){const t=[];for(const r of e){let s={};if(r.metadata)try{s=JSON.parse(r.metadata)}catch{}const a=[];if(a.push(`[${r.identifier}] ${r.title}`),r.url&&a.push(`URL: ${r.url}`),r.description&&a.push(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/D5iylRNB.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/NqHwC243.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/D-TU-2ME.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BurMbBp5.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/ZUCHJs0z.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CO_V-6EQ.js","/app/immutable/chunks/c-xC05gO.js","/app/immutable/chunks/C2dNFWEv.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/D1pAML4P.js","/app/immutable/chunks/BJWZv5Sk.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/C-gRduKt.js","/app/immutable/chunks/DsYe-lzR.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BulkbkYU.js","/app/immutable/chunks/DLDwz3Jk.js","/app/immutable/chunks/Bs48vxzD.js","/app/immutable/chunks/DLDsTWl7.js","/app/immutable/chunks/CnAtabD8.js","/app/immutable/chunks/BBIyvTX5.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/B-3aWyWM.js","/app/immutable/chunks/CZb8tVz5.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/CNMI-zGd.js","/app/immutable/chunks/C1LegaQy.js","/app/immutable/chunks/Bl2M7dQb.js","/app/immutable/chunks/72TQselO.js","/app/immutable/chunks/A67C19bI.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/B66L8YEe.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/Dfltx80e.js","/app/immutable/chunks/Dz4zGm0b.js","/app/immutable/chunks/BPu-f3m6.js","/app/immutable/chunks/CjMEl34P.js","/app/immutable/chunks/CDYYgEuj.js","/app/immutable/chunks/K6c57sYm.js","/app/immutable/chunks/Bncjw5PN.js","/app/immutable/chunks/RWrc-xf9.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Ii as n,nH as w,nx as g,nw as v,m2 as ee,qo as te,i7 as re,v3 as ze,jA as Je,CJ as Ke,uA as Ye,nO as Ee,m5 as se,p_ as Xe,m4 as Ze,lJ as Qe,aM as de,lT as et,lZ as tt,Fg as rt,CH as st,z4 as at,nM as nt,m7 as ot}from"./D-TU-2ME.js";import{b as ct,p as it,F as lt,z as ut}from"./CjMEl34P.js";import{aW as J,aS as ae,cB as _,cE as pe,cm as dt,dp as L,cC as Re,aT as pt,dj as mt,o as me,O as ft,dl as ht,c2 as St,ak as gt,au as yt,ad as bt,bB as kt,cy as vt,cW as wt,ck as It,bC as _t}from"./Dfltx80e.js";import{w as Ct}from"./BPu-f3m6.js";import{ag as At,cM as Et,aW as Rt,au as Tt,p as Pt}from"./RWrc-xf9.js";import{g as Ot}from"./D5iylRNB.js";import{bo as p,_ as H}from"./NqHwC243.js";import{i as k}from"./Dz4zGm0b.js";import{I as Wt}from"./CO_V-6EQ.js";import{c as Te}from"./ChTqQfQN.js";import{k as Nt}from"./DsYe-lzR.js";import{L as O}from"./DJI9bjVo.js";import{ad as xt,j as Mt,h as W,a6 as Lt,o as Dt}from"./Bncjw5PN.js";import{w as Ut}from"./B-3aWyWM.js";import{r as M}from"./uXuxG9cN.js";import{aN as jt,O as Gt,R as Ft,x as qt}from"./C1LegaQy.js";import{bs as fe,bt as he,ax as Pe}from"./c-xC05gO.js";import{d as Ht,o as Se,l as ge,s as ye}from"./CIyUrgF0.js";const ls=n.createSelector(e=>e.workspaceShare.open),us=n.createSelector(e=>e.workspaceShare.workspaceId),ds=n.createSelector(e=>{const{open:t,workspaceId:r,session:s}=e.workspaceShare;return t&&r?{workspaceId:r,session:s}:null}),ne=n.createSelector(e=>{const{open:t,workspaceId:r,withheld:s}=e.workspaceShare;return!t||!r||s||w(e.workspaceShare,r).inviteWithheld?!1:J.select(e,r)}),ps=n.createSelector(e=>e.workspaceShare.createRequest),ms=n.createSelector(e=>e.workspaceShare.mutationGeneration),fs=n.createSelector(e=>e.workspaceShare.workspaceTitle),hs=n.createSelector(e=>g(e.workspaceShare.members)),Ss=n.createSelector((e,t)=>v(e.workspaceShare.members,t)!==void 0),gs=n.createSelector(e=>e.workspaceShare.open&&e.workspaceShare.workspaceId&&!e.workspaceShare.withheld&&!w(e.workspaceShare,e.workspaceShare.workspaceId).inviteWithheld?g(e.workspaceShare.invites).filter(t=>t.workspaceId===e.workspaceShare.workspaceId):[]),ys=n.createSelector(e=>{const{principals:t,members:r}=e.workspaceShare;return g(t).filter(s=>!v(r,s.principalId)&&(s.hostRole===void 0||s.hostRole==="guest"))}),bs=n.createSelector(e=>e.workspaceShare.guestCount),ks=n.createSelector(e=>e.workspaceShare.guestLimit),vs=n.createSelector(e=>e.workspaceShare.loadStatus==="loading"),ws=n.createSelector(e=>e.workspaceShare.loadError),Is=n.createSelector(e=>e.workspaceShare.creating),_s=n.createSelector(e=>e.workspaceShare.createError),Cs=n.createSelector(e=>e.workspaceShare.createdLink),As=n.createSelector(e=>e.workspaceShare.revokingInviteId),Es=n.createSelector(e=>e.workspaceShare.removingPrincipalId),Rs=n.createSelector(e=>e.workspaceShare.addingPrincipalId),Ts=n.createSelector(e=>e.workspaceShare.actionError),Ps=n.createSelector((e,t)=>w(e.workspaceShare,t).loadStatus!=="idle"),Os=n.createSelector((e,t)=>t?g(w(e.workspaceShare,t).members):[]),Ws=n.createSelector((e,t)=>!!t&&!w(e.workspaceShare,t).withheld&&J.select(e,t));n.createSelector((e,t)=>!!t&&w(e.workspaceShare,t).withheld);const Ns=n.createSelector((e,t)=>t?w(e.workspaceShare,t).removingPrincipalId:null);n.createSelector((e,t)=>t?w(e.workspaceShare,t).removeError:null);const xs=n.createSelector(e=>e.workspaceShare.integrationAuth),Ms=n.createSelector(e=>e.workspaceShare.ownerForgeMissing),K=n.createSelector(e=>ne.select(e)&&ae.select(e)&&e.workspaceShare.sharingContext!==null&&e.workspaceShare.sharingContext===_.select(e)),$t=n.createSelector(e=>K.select(e)?e.workspaceShare.sharingEnabled:null),Ls=n.createSelector(e=>K.select(e)&&e.workspaceShare.sharingChecking),Bt=n.createSelector(e=>K.select(e)&&e.workspaceShare.sharingEnabling),Vt=n.createSelector(e=>K.select(e)?e.workspaceShare.sharingError:null),Ds=n.createSelector(e=>{if(!ne.select(e))return!1;const t=e.workspaceShare;return!t.integrationAuthLoaded||ae.select(e)&&$t.select(e)===null&&Vt.select(e)===null&&!Bt.select(e)?!0:g(t.members).length===0&&(t.loadStatus==="idle"||t.loadStatus==="loading")}),Us=n.createSelector(e=>ne.select(e)&&!!e.workspaceShare.workspaceId&&(ae.select(e)||(be.select(e)?be.select(e)===pe.select(e)?.principal.id:dt.select(e,e.workspaceShare.workspaceId)))&&pe.select(e)?.capabilities.workspaceGuestRoles===!0),js=n.createSelector(e=>e.workspaceShare.pendingRolePrincipalIds),Gs=n.createSelector(e=>e.workspaceShare.roleErrors),be=n.createSelector(e=>{const t=e.workspaceShare.workspaceId;return t?L.select(e,t)?.ownerPrincipalId??null:null}),zt=n.createSelector(e=>{const t=_.select(e),r=ct.select(e);return{context:t,workspaceIds:t?r.filter(s=>J.select(e,s)):[]}}),Fs=n.createSelector((e,t)=>{const r=w(e.workspaceShare,t);return{context:r.inviteContext,generation:r.inviteGeneration,withheld:r.inviteWithheld}}),Jt=[],Kt=n.createSelector((e,t)=>{const r=_.select(e),s=w(e.workspaceShare,t);if(!r||s.inviteContext!==r||s.inviteWithheld||!J.select(e,t))return Jt;const a=e.presence?.context===r?e.presence.members[t]:void 0,o=new Set(a?g(a).flatMap(i=>i.identity?[JSON.stringify([i.identity.provider,i.identity.host.toLowerCase(),i.identity.externalUserId])]:[]):[]),c=new Set;return g(e.workspaceShare.invites).filter(i=>{if(i.workspaceId!==t||!i.pinLogin?.trim()||i.revokedAt||i.redeemedAt&&!i.reusable||!(Date.parse(i.expiresAt)>s.inviteReceivedAt))return!1;const l=i.pinIdentity??(i.pinGithubUserId!==void 0?{provider:"github",host:"github.com",externalUserId:String(i.pinGithubUserId)}:null);if(a&&i.redeemedByPrincipalId&&v(a,i.redeemedByPrincipalId))return!1;if(!l)return!0;const m=JSON.stringify([l.provider,l.host.toLowerCase(),l.externalUserId]);return o.has(m)||c.has(m)?!1:(c.add(m),!0)})}),qs=n.createSelector(e=>{const r=zt.select(e).workspaceIds.flatMap(s=>Kt.select(e,s).map(a=>Date.parse(a.expiresAt)));return r.length?Math.min(...r):null});function Hs(e){return Object.entries(e).some(([t,r])=>r.available&&Ct(t,r.authenticated))}const $s=n.createSelector(e=>e.hostRequirements.git),Bs=n.createSelector(e=>e.hostRequirements.node),Vs=n.createSelector(e=>e.hostRequirements.gh),zs=n.createSelector(e=>e.hostRequirements.checking),Js=n.createSelector(e=>e.hostRequirements.hasCheckedOnce);function Oe(e){const t=e.gitlabAuth?.statusFailed===!0;return At({labsEnabled:e.userPreferences?.labsPlainFolderWorkspacesEnabled===!0,protocolVersion:e.daemonHealth?.stats?.protocolVersion,githubConnected:e.githubAuth?.isAuthenticated===!0,githubSettled:e.githubAuth?.statusSettled===!0,githubFailed:e.githubAuth?.statusFailed===!0,gitlabConnected:e.gitlabAuth?.isConfigured===!0,gitlabSettled:e.gitlabAuth?.statusReady===!0||t,gitlabFailed:t})}const Ks=n.createSelector(Oe),Ys=n.createSelector(e=>e.hostRequirements.node.ok&&(e.hostRequirements.git.available||Oe(e))),Xs=n.createSelector(e=>{const t=e.hostRequirements.providerCli;return t?{context:t.context,warnings:g(t.warnings)}:void 0}),Zs="22.0.0";function Yt(e){return e.length>15?`${e.slice(0,15)}…`:e}function B(e){return e.name?.trim()||Yt(e.clientId)}function Qs(e){const{eligibleClients:t,ownClientId:r,driving:s,pinnedClientId:a}=e,o=t.find(l=>l.clientId===r&&l.connected),c=s!==null&&!s.connected,i=!s||s.clientId===r;return{mode:c?"offline":i?"here":"elsewhere",hostName:s?B(s):o?B(o):"",canSwitchHere:!!(o&&a!==r)}}const ea=n.createSelector(e=>e?.browserClients?.ownClientId??null),ta=n.createSelector(e=>e?.browserClients?.ownClientIdConfirmed===!0);n.createSelector(e=>g(e.browserClients.liveClients));const ra=n.createSelector((e,t)=>t?e?.browserClients?.byWorkspaceId[t]?.liveClientsLoaded??!1:e?.browserClients?.liveClientsLoaded??!1);n.createSelector((e,t)=>v(e.browserClients.liveClients,t));const sa=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??ee).browserClient),aa=n.createSelector((e,t)=>{const r=e?.browserClients?.byWorkspaceId[t];return r?.pinnedClientId!==void 0||r?.browserClient!=null});function Q(e){const t=e.prettyHostname??e.hostname??e.name;return{clientId:e.clientId,...t!==void 0?{name:t}:{},connected:!0}}const na=n.createSelector((e,t)=>{const r=e?.browserClients??te,s=r.byWorkspaceId[t]?.liveClients??re(),a=g(s).filter(y=>y.capabilities.browserExec===!0).map(Q),o=(r.byWorkspaceId[t]??ee).browserClient,c=r.byWorkspaceId[t],i=c?.pinnedClientId!==void 0?c.pinnedClientId:o?.source==="workspace"?o.clientId:null,l=i===null?Ot(o):void 0;let m=null;if(o?.resolved){const y=v(s,o.resolved.clientId);m=y?Q(y):{...o.resolved,connected:!0}}else o?.source==="workspace"?m={clientId:o.clientId,connected:!1}:l&&(m={clientId:l.clientId,connected:!1});return{eligibleClients:a,ownClientId:r.ownClientId??"",routedVia:o?.source==="default"?l?.via:void 0,driving:m,pinnedClientId:i}}),oa=n.createSelector((e,t)=>{const r=e?.browserClients??te;if(!r.ownClientId||!r.ownClientIdConfirmed)return!1;const s=r.byWorkspaceId[t]?.liveClients??re(),a=v(s,r.ownClientId);return a!==void 0&&a.capabilities.browserExec!==!0}),ca=n.createSelector((e,t,r)=>{const s=e?.browserClients??te,a=r?s.byWorkspaceId[r]?.liveClients??re():s.liveClients,o=r?s.byWorkspaceId[r]?.liveClientsLoaded:s.liveClientsLoaded,c=v(a,t);return c?{name:B(Q(c)),connected:!0}:{name:B({clientId:t}),connected:!o}}),ia=n.createSelector((e,t)=>(e?.browserClients?.byWorkspaceId[t]??ee).tabsRevision),la=n.createSelector(e=>Object.entries(e.browserClients?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),x=new Map;function ua(e,t){return x.set(e,t),()=>{x.get(e)===t&&x.delete(e)}}async function da(e){const t=x.get(e);return t?t():null}function pa(e){x.delete(e)}const We="From repo config",ma="repo-config";function fa(e,t){return t==="repo-config"?p.workspace_setupScriptEditor_fromRepoConfig_name():t==="custom"?p.workspace_setupScriptEditor_custom_name():e}function Ne(e){if(!e||typeof e!="object"||Array.isArray(e))return{setupScript:null};const t=e.setupScript;return{setupScript:typeof t=="string"&&t.trim().length>0?t:null}}function Xt(e){let t;try{t=JSON.parse(e)}catch{return null}return Ne(t).setupScript}async function ha(e){if(!e)return null;try{const t=await k(Wt.SETUP_SCRIPTS.READ_REPO_CONFIG,{repoPath:e}),r=t?.success?t.data?.content:null;return typeof r=="string"?Xt(r):null}catch{return null}}async function Sa(e,t,r){if(!e||!t)return null;try{const{appClient:s}=await H(async()=>{const{appClient:o}=await import("./D5iylRNB.js").then(c=>c.p);return{appClient:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url),a=await s.integrations.githubRepoConfig(e,t,r);return Ne(a.config).setupScript}catch{return null}}function ga(e){const t=e.setupScript.trim();return t?e.setupScriptNameSource==="repo-config"&&e.setupScriptName===We&&e.repoConfigScriptRepo===e.repoPath&&t===(e.repoConfigScript??"").trim()?void 0:t:e.explicitChoice?"cd .":void 0}function ya(e){const{repoConfigScript:t,lastUsed:r,genericTemplate:s}=e;return t?{content:t,name:We,source:"repo-config"}:r?{content:r.content,name:r.nameSource==="repo-config"?"Custom":r.name,source:r.nameSource==="repo-config"?"custom":r.nameSource??"named"}:s?{content:s.content,name:s.name,source:"named"}:{content:"",name:"Custom",source:"custom"}}const xe="setup-scripts:last-used-by-repo",Me="setup-scripts:recent-by-repo",V=20,Le=10,Zt=["repo-config","custom","named"];function oe(e,t){return t?`${e}\0${t}`:e}function De(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return typeof t.name=="string"&&typeof t.content=="string"&&t.content.trim().length>0&&typeof t.usedAt=="string"&&(t.nameSource===void 0||Zt.includes(t.nameSource))}function z(){try{const e=localStorage.getItem(xe);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const r={};for(const[s,a]of Object.entries(t))s&&De(a)&&(r[s]=a);return r}catch{return{}}}function Ue(){try{const e=localStorage.getItem(Me);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const r={};for(const[s,a]of Object.entries(t)){if(!s||!Array.isArray(a))continue;const o=a.filter(De);o.length>0&&(r[s]=o)}return r}catch{return{}}}function Qt(e,t){return e.name===t.name&&(e.nameSource??"named")===(t.nameSource??"named")&&e.content.trim()===t.content.trim()}function je(e){return[...e].sort((t,r)=>r.usedAt.localeCompare(t.usedAt))}function Ge(e){const t=[];for(const r of e)t.some(s=>Qt(s,r))||t.push(r);return t}function ba(e,t){if(!e)return[];const r=oe(e,t),s=Ue()[r]??[],a=z()[r];return Ge(je(a?[...s,a]:s)).slice(0,Le).map(c=>({name:c.name,content:c.content,nameSource:c.nameSource??"named",usedAt:c.usedAt}))}function er(e,t,r){try{const s=Ue(),a=s[e]??(r?[r]:[]);s[e]=Ge([t,...je(a)]).slice(0,Le);const o=Object.entries(s);o.length>V&&(o.sort(([,c],[,i])=>i[0].usedAt.localeCompare(c[0].usedAt)),o.length=V),localStorage.setItem(Me,JSON.stringify(Object.fromEntries(o)))}catch{}}function ka(e,t){if(!e)return;const r=z()[oe(e,t)];return r?{name:r.name,content:r.content,nameSource:r.nameSource??"named"}:void 0}function va(e,t,r){const s=t.content.trim();if(!e||!s)return;const a=oe(e,r),o={name:t.name,content:s,usedAt:new Date().toISOString(),nameSource:t.nameSource??"named"};er(a,o,z()[a]);try{const c=z();c[a]=o;const i=Object.entries(c);i.length>V&&(i.sort(([,l],[,m])=>m.usedAt.localeCompare(l.usedAt)),i.length=V),localStorage.setItem(xe,JSON.stringify(Object.fromEntries(i)))}catch{}}const j=Te("ProviderAvailabilityClient");let A=null;async function wa(){if(typeof window>"u")return j.debug("Skipping provider availability check - not in browser environment"),ke();const e=Re.select(n.state);if(A&&A.connection===e)return j.debug("Joining in-flight provider availability request"),A.promise;const t={},r=(async()=>{try{j.debug("Checking provider availability via IPC");const s=await k(Nt.GET_AVAILABILITY);if(!s.success)throw new Error(s.error||"Failed to get provider availability");const a=s.data??ke();return j.debug("Provider availability fetched",{hasAnyProvider:a.hasAnyProvider,auggie:a.providers.auggie.available,claudeCode:a.providers.claudeCode.available,codex:a.providers.codex.available,cortex:a.providers.cortex.available,mock:a.providers.mock?.available??!1,opencode:a.providers.opencode.available,droid:a.providers.droid?.available??!1,grok:a.providers.grok?.available??!1,unsloth:a.providers.unsloth?.available??!1}),a}finally{A?.token===t&&(A=null)}})();return A={connection:e,token:t,promise:r},r}function ke(){return{hasAnyProvider:!1,providers:{auggie:{available:!1},claudeCode:{available:!1},codex:{available:!1},cortex:{available:!1},mock:{available:!1},opencode:{available:!1},pi:{available:!1},droid:{available:!1},grok:{available:!1},unsloth:{available:!1}}}}const tr={async isAuthenticated(e){try{return await k(O.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async getAuthState(e=!1,t){try{return await k(O.GET_AUTH_STATE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return{isAuthenticated:!1,requiresDaemonAuth:!0}}},async getStatus(e){try{return await k(O.GET_STATUS,...e===void 0?[]:[{workspaceId:e}])}catch{return{isConfigured:!1,oauthUrl:""}}},async fetchMyIssues(e="assigned",t){return(await this.fetchMyIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async fetchMyIssuesPage(e="assigned",t){try{return await k(O.FETCH_MY_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t===void 0?void 0:{workspaceId:t})).issues},async searchIssuesPage(e,t){try{return await k(O.SEARCH_ISSUES,e,t)}catch{return{issues:[],nextToken:null}}}},Ia=Object.freeze(Object.defineProperty({__proto__:null,linearAuthClient:tr},Symbol.toStringTag,{value:"Module"})),I={IS_AUTHENTICATED:"sentry-auth:is-authenticated",SAVE_CONFIG:"sentry-auth:save-config",GET_AUTH_STATE:"sentry-auth:get-auth-state",LOGOUT:"sentry-auth:logout",FETCH_PROJECTS:"sentry-auth:fetch-projects",FETCH_ISSUES:"sentry-auth:fetch-issues",SEARCH_ISSUES:"sentry-auth:search-issues",GET_ISSUE:"sentry-auth:get-issue"},rr={async isAuthenticated(e){try{return await k(I.IS_AUTHENTICATED,...e===void 0?[]:[{workspaceId:e}])}catch{return!1}},async saveConfig(e,t){return await k(I.SAVE_CONFIG,{organization:e,apiToken:t})},async getAuthState(e){try{return await k(I.GET_AUTH_STATE,...e===void 0?[]:[{workspaceId:e}])}catch{return{isAuthenticated:!1}}},async logout(){await k(I.LOGOUT)},async fetchProjects(e){try{return await k(I.FETCH_PROJECTS,...e===void 0?[]:[{workspaceId:e}])}catch{return[]}},async fetchIssues(e){return(await this.fetchIssuesPage(e)).issues},async fetchIssuesPage(e){try{return await k(I.FETCH_ISSUES,e)}catch{return{issues:[],nextToken:null}}},async searchIssues(e,t){return(await this.searchIssuesPage(e,t)).issues},async searchIssuesPage(e,t,r){try{return await k(I.SEARCH_ISSUES,{query:e,project:t,...r})}catch{return{issues:[],nextToken:null}}},async getIssue(e,t){try{return await k(I.GET_ISSUE,e,...t===void 0?[]:[{workspaceId:t}])}catch{return null}}},_a=Object.freeze(Object.defineProperty({__proto__:null,sentryAuthClient:rr},Symbol.toStringTag,{value:"Module"})),ce=n.createSelector(e=>{const t=_.select(e);return!t||!pt.select(e)?null:JSON.stringify([t,e.hostExecution.generation,e.repositoryCheckout.authorityGeneration,e.gitlabAuth.host,e.gitlabAuth.instanceBaseUrl,e.gitlabAuth.statusReady,e.gitlabAuth.isConfigured,e.gitlabAuth.user])}),Y=n.createSelector((e,t)=>v(e.repositoryCheckout.forms,t)??null),Ca=n.createSelector((e,t)=>{const r=Y.select(e,t);return r?.admission===ce.select(e)&&r.status==="ready"?g(r.projects):[]}),Aa=n.createSelector((e,t)=>{const r=Y.select(e,t);return r?.admission===ce.select(e)&&r.status==="ready"?g(r.branches):[]}),sr=n.createSelector((e,t)=>{const r=Y.select(e,t);return!r||r.status!=="ready"||r.admission!==ce.select(e)||!r.capture||!r.project||!r.branch?null:{checkoutId:r.capture.checkoutId,revision:r.capture.revision,projectPath:r.project.projectPath,branch:r.branch.name,commitSha:r.branch.commitSha,mode:r.mode}}),Ea=n.createSelector((e,t)=>{const r=sr.select(e,t);return!!r&&(r.mode==="direct"||Y.select(e,t)?.warmStatus==="ready")}),Ra="__new-workspace__",Ta="__initializer__",Pa="compact-workspace-initializer-state-prompt",Oa="onboarding-prompt",G=20*1024*1024,ve=Te("NewWorkspaceDraft");function Wa(e,t){if(e.length>G)return ve.warn("Draft text exceeds the size guard; skipping persistence",{textLength:e.length,limit:G}),null;const r=xt(t);if(r.length===0)return{text:e};const s=[];let a=e.length+2,o=0;for(const c of r){const i=JSON.stringify(c).length+1;if(a+i>G){o+=1;continue}s.push(c),a+=i}return o>0&&ve.warn("Draft attachments exceed the size guard; persisting the ones that fit",{limit:G,attachmentCount:r.length,droppedCount:o}),s.length>0?{text:e,attachments:s}:{text:e}}const ar="host.providerAuthStatus";function nr(e={}){const t={};return e.workspaceId&&(t.workspaceId=e.workspaceId),typeof e.providerId=="string"&&e.providerId.length>0&&(t.providerId=e.providerId),typeof e.force=="boolean"&&(t.force=e.force),t}function or(e,t){const r=t.toLowerCase(),s=e.toLowerCase();return r.startsWith(s)?/^(['’]s\s+organization)?$/.test(r.slice(s.length)):!1}function cr(e){const{email:t,orgName:r}=e??{};return t&&r?or(t,r)?t:`${t} · ${r}`:t||r||void 0}function ir(e){const t={};for(const r of e?.providers??[]){const s={authenticated:r.authenticated??void 0},a=cr(r.identity);a!==void 0&&(s.authDetails=a),r.identity?.email&&(s.email=r.identity.email),t[r.id]=s}return t}const lr=6e4,R=new Map,F=new Map,E=new Map;let $=0,Fe=0;const ur=e=>JSON.stringify([Re.select(n.state),Fe,e.workspaceId??null,e.providerId??"*"]);function dr(e){if(e.method!=="events.event"||!e.params)return;const t=e.params,s=(t.event&&typeof t.event=="object"?t.event:t).type;return typeof s=="string"?s:void 0}function X(e){if($+=1,e)for(const t of R.keys()){const[,,,r]=JSON.parse(t);(r===e||r==="*")&&R.delete(t)}else R.clear()}typeof fe=="function"&&fe(e=>{["provider:auth-changed","host:execution-context-changed"].includes(dr(e)??"")&&X()});typeof he=="function"&&he(()=>{Fe+=1,X()});function pr(e={}){const t=ur(e);if(e.force)X(e.providerId);else{const o=R.get(t);if(o&&o.expiresAt>Date.now())return Promise.resolve(o.verdicts);o&&R.delete(t)}const r=F.get(t);if(!e.force&&r?.generation===$)return r.promise;if(r){const o=E.get(t);if(o)return o.force||=e.force===!0,o.promise;let c;const i=r.promise.catch(()=>({})).then(()=>(E.get(t)===c&&E.delete(t),pr({...e,force:c.force}))).finally(()=>{E.get(t)===c&&E.delete(t)});return c={force:e.force===!0,promise:i},E.set(t,c),i}const s=$,a=Pe(ar,nr(e)).then(ir).then(o=>(s===$&&R.set(t,{verdicts:o,expiresAt:Date.now()+lr}),o)).finally(()=>{F.get(t)?.promise===a&&F.delete(t)});return F.set(t,{generation:s,promise:a}),a}function Na(e,t=e,r="default",s,a){if(!Ut.select(n.state))return;const o=a??it.select(n.state,t)??lt.select(n.state,t)[0];if(!o)return;const c=ut.select(n.state,t,o),i={type:"discussion",title:s??(r==="new"?p.workspace_discussion_new_title():p.workspace_discussion_title()),workspaceId:e,closable:!0,data:{conversationId:r}},l=c?.tabs.find(m=>ze(m,i));r==="new"&&n.dispatch(Je(e)),n.dispatch(l?Ke(t,l.id,o):Ye(t,i,o,void 0,!0,void 0,!0))}function xa(e,t){return e.name?.trim()?e.name.trim():e.kind==="workspace"?e.id&&e.id!=="default"?p.workspace_discussion_conversation_title():p.workspace_discussion_title():e.participants.filter(s=>s.principalId!==t).map(s=>s.displayName||s.login||p.workspace_discussion_unknownAuthor_label()).join(", ")||p.workspace_discussion_group_title()}const mr=n.createSelector((e,t,r)=>{const s=Ee(e.repositoryContext,t);return r!==null&&s.binding===r?s:null});n.createSelector((e,t,r)=>{const s=mr.select(e,t.workspaceId,r);return s?.status==="ready"?v(s.roots,M(t))?.context:void 0});const Ma=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission)return null;const r=Ee(e.repositoryContext,t.workspaceId),s=r.ownership;return!s||s.demandId!==t.demandId||s.admission!==t.admission||s.request.workspaceId!==t.workspaceId?null:{status:r.status,scope:r.scope,revision:r.revision,roots:r.status==="ready"?g(r.roots).map(a=>a.context):[],unavailableReason:r.unavailableReason}}),La=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission)return null;const r=e.repositoryContext.selectionEdits,s=r?v(r,t.editId):void 0;return s&&s.status!=="closed"&&s.owner.admission===t.admission&&M(s.owner.root)===M(t.root)?s:null}),Da=n.createSelector((e,t)=>{const r=e.repositoryContext.selectionEdits;return!!r&&g(r).some(s=>s.owner.root.workspaceId===t&&s.owner.admission===_.select(e)&&(s.status==="capturing"||s.status==="pending"&&(!s.observation||s.observation.attempt?.status==="pending")))}),Ua=n.createSelector((e,t)=>{if(t.admission===null||_.select(e)!==t.admission||t.hostContext===null||mt.select(e,t.root.workspaceId)!==t.hostContext)return null;const r=e.repositoryContext.nativeReviewAttempts,s=r?v(r,t.attemptId):void 0;return s&&s.status!=="closed"&&s.owner.admission===t.admission&&s.owner.hostContext===t.hostContext&&M(s.owner.root)===M(t.root)?s:null}),ja=n.createSelector((e,t)=>e.repositoryContext.nativeReviewAttempts?v(e.repositoryContext.nativeReviewAttempts,t):void 0),fr=["venv",".venv","virtualenv","node_modules","google-cloud-sdk","__pycache__",".pytest_cache",".mypy_cache",".ruff_cache",".tox",".nox"];function hr(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function Sr(e){const t=new Set(fr);return hr(e).some(r=>t.has(r))}const gr=new Set(["lastActivity","statusMessage","statusImageAssetId"]),yr=new Set([".git",".playwright-cli",".svelte-kit",".vite",".turbo",".cache",".parcel-cache",".next",".nuxt",".output","build","coverage","dist","playwright-report","target","test-results"]);function br(e){return e.replace(/\\/g,"/").split("/").filter(t=>t.length>0&&t!==".")}function kr(e){if(!e.type.startsWith("file:"))return null;const t=e.data,r=t?.relativePath??t?.path??t?.filePath;return typeof r=="string"&&r.length>0?r:null}function vr(e){const t=kr(e);return!t||Sr(t)?!1:!br(t).some(r=>yr.has(r))}function wr(e){if(e.type==="workspace:displayStatus-changed")return!0;if(e.type!=="workspace:updated")return!1;const t=e.data;if(!t?.changes||typeof t.changes!="object"||Array.isArray(t.changes))return!1;const r=Object.keys(t.changes).filter(s=>s!=="workspaceId");return r.length>0&&r.every(s=>gr.has(s))}function f(e){return typeof e=="string"?e.trim():""}function T(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function we(e){const t=T(e.data),r=f(t.agentId)||f(e.sessionId),s=f(t.messageId);return r&&s?JSON.stringify([r,s]):""}function Ir(e){const t=T(e.data),r={workspaceId:e.workspaceId,closable:!0},s=a=>a?{...r,type:"note",noteId:a,title:f(t.title)||f(t.noteTitle)||p.layout_tabTypes_note_title()}:null;switch(e.type){case"note:created":case"note:updated":case"comment:added":case"comment:resolved":return s(f(t.noteId));case"task:status-changed":return s(f(t.noteId)||f(t.linkedNoteId));case"spec:updated":case"goal:updated":return s("spec");case"agent:created":case"agent:renamed":case"agent:restored":case"agent:updated":case"agent:message":case"agent:user-message:sent":{const a=f(t.agentId)||f(e.sessionId);return a?{...r,type:"agent",agentId:a,title:f(t.agentName)||p.layout_tabTypes_agent_title()}:null}case"file:changed":{const a=f(t.path)||f(t.relativePath);return a&&t.action!=="delete"?{...r,type:"file",filePath:a,title:a.split(/[\\/]/).pop()||a}:null}case"git:commit":{const a=f(t.commit),o=f(t.gitRootId);return a?{...r,type:"changes",title:p.layout_tabTypes_changes_title(),data:{commitHash:a,...o?{gitRootId:o}:{}}}:null}default:return null}}function Ie(e,t){const r=T(e.data),s=Object.fromEntries(Object.entries(r).filter(([,c])=>typeof c=="string")),a=c=>t?p.workspace_peopleActivity_actorAction_label({name:t,action:c}):c;switch(e.type){case"note:created":case"note:updated":case"note:deleted":case"spec:updated":case"goal:updated":return W({...e,actor:{...e.actor,name:t},data:s});case"agent:created":case"agent:renamed":case"agent:deleted":case"agent:restored":case"git:commit":case"git:push":case"git:pull":case"git:branch":case"git:merge":return a(W({...e,actor:{...e.actor,name:void 0},data:s}));case"agent:updated":return f(r.modelId)||r.completionReportCleared===!0?a(W({...e,actor:{...e.actor,name:void 0},data:r})):null;case"file:changed":return vr(e)?W({...e,actor:{...e.actor,name:t},data:{path:f(r.path)||f(r.relativePath),action:f(r.action)}}):null;case"comment:added":return t?p.events_activity_authorCommented_label({author:t}):p.workspace_peopleActivity_commented_label();case"comment:resolved":return r.resolved===!1?a(p.events_activity_reopenedCommentThread_label()):r.resolved===!0?a(p.events_activity_resolvedCommentThread_label()):null;case"agent:message":case"agent:user-message:sent":{const c=f(r.agentName)||f(r.toAgentName);return a(c?p.workspace_peopleActivity_messagedAgent_label({agent:c}):p.workspace_peopleActivity_sentMessage_label())}case"task:status-changed":return a(W({...e,actor:{...e.actor,name:void 0},data:{taskName:f(r.taskName)||f(r.noteTitle),newStatus:f(r.newStatus)||f(r.status)}}));case"workspace:created":return a(p.events_activity_createdWorkspace_label());case"workspace:updated":{if(wr(e))return null;const c=T(r.changes);if(Object.keys(c).filter(l=>l!=="workspaceId").length===0)return null;const i=f(c.title);return a(i?p.events_activity_renamedWorkspaceTo_label({title:i}):p.events_activity_updatedWorkspace_label())}default:return null}}function N(e,t){const r=f(e);return r===t||/^(user|you|system|unknown|anonymous|local user)$/i.test(r)?"":r}function _r(e,t,r,s){const a=new Map(r.map(u=>[u.principalId,u])),o=new Map;for(const u of t){if(u.workspaceId!==e||u.type!=="agent:last-message")continue;const d=T(u.data),h=me({role:d.role==="user"?"user":"system",author:d.author,metadata:d.metadata}),S=we(u);if(!h||!S||typeof d.lastUserMessage!="string")continue;const b=Mt({id:f(d.messageId),role:"user",timestamp:u.timestamp,contentBlocks:[{type:"text",text:d.lastUserMessage}],author:h,metadata:d.metadata},s);b&&o.set(S,b)}const c=new Set,i=new Set,l=[];let m=0;for(const u of t){if(u.workspaceId!==e||!f(u.id)||c.has(u.id))continue;const d=Date.parse(u.timestamp);if(!Number.isFinite(d)){m++;continue}const h=T(u.data),S=u.type==="agent:message",b=S?me({role:h.role==="user"?"user":"system",author:h.author,metadata:h.metadata}):null;if(S?!b:u.actor?.type!=="user"){S&&h.role==="user"&&u.actor?.type==="user"&&ft(h.metadata)&&l.push({row:null,timestamp:d,segment:m});continue}const Ve=S?f(h.messageId):"",P=S?we(u):"";if(P&&i.has(P))continue;const C=f(u.actor?.id),Z=C?a.get(C):void 0,D=b?N(b.displayName,b.principalId??"")||N(b.login,b.principalId??""):N(u.actor.name,C)||N(Z?.displayName,C)||N(Z?.login,C),le=Ie(u,"");if(!le)continue;if(!D){l.push({row:null,timestamp:d,segment:m});continue}const U=S?o.get(P)??null:null,ue=U?p.workspace_peopleActivity_actorAction_label({name:D,action:U}):Ie(u,D);ue&&(c.add(u.id),P&&i.add(P),l.push({timestamp:d,segment:m,row:{id:u.id,name:D,principalId:b?f(b.principalId)||null:C||null,avatarUrl:b?b.avatarUrl:Z?.avatarUrl??null,label:ue,actionLabel:U??le,continuation:!1,timestamp:u.timestamp,destination:Ir(u),messageId:Ve||null,messagePreview:U}}))}l.sort((u,d)=>d.timestamp-u.timestamp);const y=[];for(const[u,d]of l.entries()){if(!d.row)continue;const h=l[u-1],S=h?h.timestamp-d.timestamp:NaN;d.row.continuation=!!(d.row.principalId&&h?.row?.principalId===d.row.principalId&&h.segment===d.segment&&Number.isFinite(S)&&S>=0&&S<=15*6e4),y.push(d.row)}return y}const Ga=n.createSelector(e=>e.workspaceEvents.subscriptionAttempt),Fa=n.createSelector(e=>e.workspaceEvents.subscriptionGeneration),Cr=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??se).events),qa=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??se).nextToken),Ha=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]?.peopleRequestId??null)!==null),$a=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleError??null),Ba=n.createSelector((e,t)=>e.workspaceEvents.byWorkspaceId[t]?.peopleInitialized??!1),qe=n.createSelector((e,t)=>(e.workspaceEvents.byWorkspaceId[t]??se).peopleStreams),Va=n.createSelector((e,t)=>Object.values(qe.select(e,t)).every(r=>r.initialized&&r.nextToken===null)),za=n.createSelector((e,t,r)=>{const s=Cr.select(e,t),o=_r(t,s,Et.select(e,t),L.select(e,t)?.ownerPrincipalId)[r-1]?.timestamp,c=qe.select(e,t);return["user","message"].filter(i=>{const l=c[i];if(!l.initialized)return!0;if(l.nextToken===null)return!1;const m=s.find(y=>y.id===l.oldestEventId)?.timestamp;return!o||!m||!(Date.parse(m)<=Date.parse(o))})}),Ja=n.createSelector((e,t)=>{const r=[],s=new Set,a=new Set,o=c=>{const i=c.block.attachmentId??c.id;if(!s.has(i)){if(!c.block.attachmentId&&c.block.data&&!c.block.dataTruncated){const l=`${c.block.mimeType}/${c.block.data}`;if(a.has(l))return;a.add(l)}s.add(i),r.push(c)}};for(const[c,i]of Object.entries(Lt.select(e,t)))for(const l of g(i))l.imageData&&l.imageMimeType?o({id:`draft/${c}/${l.id}`,name:l.label,block:{type:"image",data:l.imageData,mimeType:l.imageMimeType}}):l.type==="file"&&(l.attachmentId||l.placementStatus)&&o({id:`draft/${c}/${l.id}`,name:l.label,placementStatus:l.placementStatus,block:{type:l.attachmentMimeType?.startsWith("image/")?"image":"file",attachmentId:l.attachmentId,mimeType:l.attachmentMimeType,fileName:l.label,size:l.attachmentSize}});for(const c of ht.select(e,t)){const i=St.select(e,c),l=[...gt.select(e,c),...yt.select(e,c)];for(const m of l)if(m.role==="user")for(const[y,u]of(m.contentBlocks??[]).entries()){if(u.type!=="image"&&!Dt(u))continue;const d=u.id?i?.[Xe(m.id,u.id)]:void 0,h=d?.status==="loaded"?d.block:u;o({id:`${c}/${m.id}/${u.id??y}`,name:h.fileName,block:h,agentId:c,messageId:m.id,hydration:d})}}return r}),Ar=n.createSelector((e,t)=>e.context.byWorkspaceId[t]??Ze),Er=n.createSelector((e,t)=>g(Ar.select(e,t).items)),Ka=n.createSelector((e,t)=>Er.select(e,t).filter(r=>!r.parentNoteId)),Ya=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedAgentIds??He),Xa=n.createSelector((e,t)=>e.agentLock.byWorkspaceId[t]?.lockedFilePaths??He),He={},Za=n.createSelector((e,t,r)=>{const s=e.gitWrite.byWorkspaceId[t]?.operations;return s?v(s,r):void 0}),$e=n.createSelector((e,t)=>{const r=e.gitWrite.byWorkspaceId[t]?.operations;return r?g(r):[]}),Qa=n.createSelector((e,t)=>$e.select(e,t).some(r=>r.status==="queued"||r.status==="running")),en=n.createSelector((e,t)=>$e.select(e,t).filter(r=>r.operation.kind==="partialCommit"&&(r.status==="queued"||r.status==="running")));function _e(e){return e.title||`PR #${e.number}`}const ie=n.createSelector((e,t)=>{const r=e.gitRoots?.byWorkspaceId?.[t];return r?g(r.gitRoots):[]});function Rr(e){return{key:"primary",isPrimary:!0,path:e.worktreePath??e.path,branch:e.branch,repoOwner:e.repositoryOwner,repoName:e.repositoryName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests}}function Tr(e){return{key:e.id,isPrimary:!1,path:e.path,branch:e.branch,repoOwner:e.repoOwner,repoName:e.repoName,prNumber:e.prNumber,prUrl:e.prUrl,prStatus:e.prStatus,pullRequests:e.pullRequests,gitRoot:e}}const tn=n.createSelector((e,t)=>{const r=L.select(e,t),s=ie.select(e,t).map(Tr);return r?[Rr(r),...s]:s}),rn=n.createSelector((e,t)=>ie.select(e,t).length>0),sn=n.createSelector(e=>Object.entries(e.gitRoots?.byWorkspaceId??{}).filter(([,t])=>Object.keys(t.consumers??{}).length>0).map(([t])=>t)),Pr=n.createSelector((e,t,r)=>v((e.acceptWorkflow.byWorkspaceId[t]??Qe).operations,r)),an=n.createSelector((e,t,r)=>Pr.select(e,t,r)?.status==="running"),nn=n.createSelector((e,t)=>e.acceptWorkflow.byWorkspaceId[t]?.mergeDrawerOpen??!1),on=n.createSelector((e,t)=>{const r=bt.select(e,t)?.hasRemote??!1,s=L.select(e,t)?.pullRequests?.some(a=>a.status===de.Open||a.status===de.Draft)??!1;return{squash:!1,viaPR:r&&s,pushAfter:r,...e.acceptWorkflow.byWorkspaceId[t]?.mergeOptions}}),cn=n.createSelector(e=>Object.keys(e.acceptWorkflow.byWorkspaceId).filter(t=>e.acceptWorkflow.byWorkspaceId[t].observerRequested)),ln=n.createSelector((e,t)=>{const r=L.select(e,t),s=kt.select(e,t),a=vt.select(e,t),o=r?.repositoryOwner&&r.repositoryName?`${r.repositoryOwner}/${r.repositoryName}`:void 0,c=Rt(Tt(r?.pullRequests,r?.activePullRequest,(i,l)=>Pt(i,r?.repositoryOwner,r?.repositoryName,l),_e,o),wt.select(e,t),o,ie.select(e,t),_e).own;return{visible:(e.acceptWorkflow.byWorkspaceId[t]?.consumerCount??0)>0,ready:_t.select(e,t),owner:!It.select(e,t),authenticated:jt.select(e),pushedCount:s.filter(i=>i.isPushed).length,hasRemote:a.hasRemote,clearReset:a.hasResetToTrunk&&c.some(i=>i.status!=="merged"),clearMerge:!!(a.mergeHeadSha&&s[0]?.hash&&a.mergeHeadSha!==s[0].hash)}}),un=n.createSelector((e,t,r)=>e.bgExecutor?.byWorkspaceId[t]?.executors[r]??et),Or=n.createSelector((e,t)=>e.prWorkflow.byWorkspaceId[t]??tt);n.createSelector((e,t,r)=>Or.select(e,t).operations[r]);const dn=n.createSelector(e=>Object.keys(e.noteReadTracking.unreadNoteIds)),pn=n.createSelector(e=>e.noteReadTracking.readRecords),Wr="host.providerTestPrompt",Nr=Ht("ok",[Se({ok:ge(!0)}).passthrough(),Se({ok:ge(!1),reason:ye().min(1),message:ye()}).passthrough()]),xr=3e5;async function mn(e){const t=await Pe(Wr,{providerId:e.providerId,...e.model?{model:e.model}:{}},{timeoutMs:xr}),r=Nr.parse(t);return(r.ok||r.reason==="auth-required")&&X(e.providerId),r}const Mr=-1,Lr=/^remote-script-lost:\s*/,Dr=["idle","starting","running","restarting","exited"],Ce=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Ae=e=>typeof e=="string"&&e.trim().length>0;function Ur(e){return Ce(e)&&Ae(e.remoteAgentId)&&Ae(e.nodeId)&&Ce(e.runtime)&&Dr.includes(e.runtime.status)}function fn(e){return Array.isArray(e.machineRuns)?e.machineRuns.filter(Ur):[]}function hn(e,t,r){const s=Gt(e.nodeId,r)??{nodeId:e.nodeId,name:p.remoteAgent_location_unknownMachine(),platform:null,state:"ready"};if(r&&r.id===e.nodeId)return s;const a=t?.nodeId===e.nodeId?t:null;return{...s,name:a?.nodeName?.trim()||s.name,platform:Ft(a?.placement?.os,a?.placement?.arch)}}function jr(e){return e.status==="exited"&&e.exitCode===Mr}function Gr(e){const t=e.error?.trim().replace(Lr,"").trim();switch(t){case"the machine disconnected":return p.scripts_remote_lostDisconnected_label();case"the machine was removed":return p.scripts_remote_lostRemoved_label();case"the agent was deleted":return p.scripts_remote_lostAgentDeleted_label();case"the agent was stopped for good":return p.scripts_remote_lostAgentStopped_label();default:return t||p.scripts_remote_lostReason_fallback()}}function Sn(e){if(jr(e))return{kind:"lost",label:p.scripts_remote_lost_tooltip({reason:Gr(e)})};const t=qt(e);switch(t){case"running":return{kind:t,label:p.terminal_quakeOverlay_status_running()};case"restarting":return{kind:t,label:p.workspace_devScripts_restarting_label()};case"idle":return{kind:t,label:p.terminal_quakeOverlay_status_idle()};case"succeeded":return{kind:t,label:p.terminal_quakeOverlay_status_exitedZero()};case"failed":return{kind:t,label:p.terminal_quakeOverlay_status_errorCode({code:e.exitCode??1})};case"stopped":return{kind:t,label:p.terminal_quakeOverlay_status_stoppedSignal({signal:(e.exitCode??128)-128})};default:return{kind:t,label:p.terminal_quakeOverlay_status_exited()}}}const q=e=>typeof e=="string"&&e.length>0,Fr=/\bremote-script-agent-ending:/;function gn(e){return!!e&&Fr.test(e)}function yn(e){if(!e||typeof e!="object")return null;const t=e.data;if(!t||typeof t!="object")return null;const r=t,s=e instanceof Error&&e.message?{message:e.message}:{};return r.code==="machine-update-required"?{success:!1,code:"machine-update-required",update:r.update==="backend"?"backend":"machine",...q(r.machineVersion)?{machineVersion:r.machineVersion}:{},...q(r.backendVersion)?{backendVersion:r.backendVersion}:{},...s}:r.code==="machine-unreachable"?{success:!1,code:"machine-unreachable",attempts:Array.isArray(r.attempts)?r.attempts.flatMap(o=>{const c=o??{};return q(c.route)&&q(c.error)?[{route:c.route,error:c.error}]:[]}):[],...s}:null}function bn(e){const r=e.filter(a=>a.runtime.status==="running"&&a.runtime.detectedUrl?.trim()).sort((a,o)=>(o.runtime.startedAt??"").localeCompare(a.runtime.startedAt??""))[0],s=r?.runtime.detectedUrl?.trim();return!r||!s?null:{scriptId:r.id,name:r.name,url:s}}const qr={status:"idle",error:null},Hr=n.createSelector((e,t)=>e.workspaceLifecycle.loadByWorkspaceId[t]??qr);n.createSelector((e,t)=>Hr.select(e,t).error);const kn=n.createSelector((e,t)=>v(e.workspace.workspaces,t)??e.workspace.pendingCreations[t]),Be=n.createSelector((e,t)=>e.workspaceLifecycle.sessionPhaseByWorkspaceId[t]),$r=e=>e==="hydrated"||e==="live",vn=n.createSelector((e,t)=>{const r=Be.select(e,t);return r==="hydrated"||r==="live"}),wn=n.createSelector(e=>{const t=e.workspaceLifecycle.sessionPhaseByWorkspaceId;return Object.keys(t).filter(r=>$r(t[r]))}),In=n.createSelector((e,t)=>Be.select(e,t)==="live");function _n(e){const{selectedProviderId:t,activeProviderId:r,recommitActive:s,dispatch:a}=e;if(t&&!(!s&&t===r))return a(rt({providerId:t,enabled:!0})),a(st(t)),a(at()),t}function Cn(e){const t=[];for(const r of e){let s={};if(r.metadata)try{s=JSON.parse(r.metadata)}catch{}const a=[];if(a.push(`[${r.identifier}] ${r.title}`),r.url&&a.push(`URL: ${r.url}`),r.description&&a.push(`
|
|
3
3
|
Description:
|
|
4
4
|
${r.description}`),s.state&&a.push(`Status: ${s.state}`),s.teamName&&a.push(`Team: ${s.teamName}`),s.priority!==void 0){const o=["No priority","Urgent","High","Medium","Low"];a.push(`Priority: ${o[s.priority]||s.priority}`)}s.assignee&&a.push(`Assignee: ${s.assignee}`),t.push({type:r.itemType||"unknown",provider:r.provider,identifier:r.identifier,title:r.title,url:r.url,content:a.join(`
|
|
5
|
-
`),metadata:s})}return t}function An(e){const t=[];for(const r of e){if(r.type!=="file")continue;let s=r.meta?.fullPath||r.meta?.path||"";if(!s&&r.id?.startsWith("file-")){const a=r.id.slice(5);(a.startsWith("/")||/^[A-Za-z]:/.test(a))&&(s=a)}if(!s&&r.uri)if(r.uri.startsWith("devspace://file/"))try{s=decodeURIComponent(r.uri.slice(16))}catch{}else r.uri.startsWith("file:")&&(s=r.uri.slice(5));s||(s=r.label||r.meta?.name||""),t.push({type:"file",path:s,title:r.label})}return t}async function En(e,t){const r=[];for(const s of e){if(s.type==="terminal")try{const{terminalManager:a}=await H(async()=>{const{terminalManager:l}=await import("./
|
|
5
|
+
`),metadata:s})}return t}function An(e){const t=[];for(const r of e){if(r.type!=="file")continue;let s=r.meta?.fullPath||r.meta?.path||"";if(!s&&r.id?.startsWith("file-")){const a=r.id.slice(5);(a.startsWith("/")||/^[A-Za-z]:/.test(a))&&(s=a)}if(!s&&r.uri)if(r.uri.startsWith("devspace://file/"))try{s=decodeURIComponent(r.uri.slice(16))}catch{}else r.uri.startsWith("file:")&&(s=r.uri.slice(5));s||(s=r.label||r.meta?.name||""),t.push({type:"file",path:s,title:r.label})}return t}async function En(e,t){const r=[];for(const s of e){if(s.type==="terminal")try{const{terminalManager:a}=await H(async()=>{const{terminalManager:l}=await import("./DLDwz3Jk.js").then(m=>m.c);return{terminalManager:l}},__vite__mapDeps([25,3,2,20,21,12,8,0,1,4,5,6,7,9,10,11,13,14,15,16,17,18,19,22,23,24,26,27,28,29,30,31,32,33,34]),import.meta.url),o=s.meta?.workspaceId||"",c=s.id??"",i=await a.getBufferContent(c,o);i&&r.push({type:"terminal",content:i,title:s.label,metadata:{terminalName:s.label,terminalId:c}})}catch(a){t?.warn("[OnboardingContext] Failed to read terminal buffer:",a)}if(s.type==="script")try{const{selectScriptById:a,selectScriptRuntime:o}=await H(async()=>{const{selectScriptById:S,selectScriptRuntime:b}=await import("./CNMI-zGd.js");return{selectScriptById:S,selectScriptRuntime:b}},__vite__mapDeps([35,4,5,3,6,7,8,9,2,10,11,12,36,37,14,15,13,16,17,18,19,38,39,40,41,42,43,44,45,23,32,46,21,20,47,48,24,1,49]),import.meta.url),{readScriptContextOutputLines:c}=await H(async()=>{const{readScriptContextOutputLines:S}=await import("./K6c57sYm.js");return{readScriptContextOutputLines:S}},__vite__mapDeps([50,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,51,45,41,32,38,52,36,37,39,40,42,43,44,46,47,48,49,35]),import.meta.url),i=s.meta?.workspaceId||"",l=s.id??"",m=n.state,y=await c(m,i,l),u=a.select(m,i,l),d=o.select(m,i,l);let h=`Script: ${u?.name||s.label}
|
|
6
6
|
`;if(h+=`Command: ${u?.command||"unknown"}
|
|
7
7
|
`,h+=`Status: ${d.status}`,d.exitCode!==null&&d.exitCode!==void 0&&(h+=` (exit code: ${d.exitCode})`),h+=`
|
|
8
8
|
`,d.detectedUrl&&(h+=`URL: ${d.detectedUrl}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as Yt,bq as v,bo as F,a_ as me,by as Zt,bu as Xe,bs as Jt,b as Qt}from"./
|
|
1
|
+
import{t as Yt,bq as v,bo as F,a_ as me,by as Zt,bu as Xe,bs as Jt,b as Qt}from"./NqHwC243.js";import{bs as en,c5 as Ye,ca as xe,aD as t,bH as H,a5 as M,bA as R,W as L,bn as tn,c9 as d,bV as ae,cd as pt,c6 as nn,aA as m,bS as O,b_ as K,bl as Ze,bO as Y,aB as T,b$ as Pe,be as sn,a7 as an,ay as Je}from"./DYhIMPy1.js";import{n as on,v as rn,p as ln}from"./C2dNFWEv.js";import{f as cn}from"./CjMEl34P.js";import{j as dn}from"./DstArZ_G.js";import{Ii as Se,nU as fn,z1 as un,rX as bt,nW as hn,a5 as kt}from"./D-TU-2ME.js";import{bM as gn,dp as vn}from"./Dfltx80e.js";import{c as mn}from"./ChTqQfQN.js";import{c as Lt,h as He,D as pn}from"./Cf7_9vnO.js";import{F as _t,b6 as wt}from"./B66L8YEe.js";import{f as Qe}from"./c-xC05gO.js";import{t as Re}from"./BD9kDOxT.js";import{t as bn}from"./72TQselO.js";import{g as kn}from"./DzrG6LRJ.js";function _n(q,c,oe,Ie=1){const We=Lt(q,c,oe,"","",{context:3}),re=new Set,pe=new Set,Z=wn(Ie)-1,De=We.split(`
|
|
2
2
|
`);let s=0,I=0,le=!1;for(const B of De)if(B.startsWith("@@")){le=!0;const J=B.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);J&&(I=parseInt(J[1],10),s=parseInt(J[2],10))}else le&&(B.startsWith("+")?(re.add(s+Z),s++):B.startsWith("-")?(pe.add(I+Z),I++):B.startsWith(" ")&&(s++,I++));return{additions:re,deletions:pe}}function wn(q){return Number.isFinite(q)&&q>1?Math.floor(q):1}var Ln=T("<div><!> <!></div>"),Cn=T('<div class="diff-skeleton svelte-1f4chm"><div class="diff-skeleton-header svelte-1f4chm"><!> <!></div> <div class="diff-skeleton-content svelte-1f4chm"></div></div>'),yn=T('<div class="error-state svelte-1f4chm"><!> <span class="text-danger text-sm ml-2"> </span></div>'),xn=T('<div class="error-state svelte-1f4chm"><!> <span class="text-subtle text-sm ml-2"> </span></div>'),Pn=T('<div class="empty-state svelte-1f4chm"><span class="text-subtle text-sm"><!></span></div>'),Sn=T('<span class="icon">+</span> ',1),Hn=T('<span class="icon">−</span> ',1),Rn=T('<div class="selection-action-bar svelte-1f4chm"><span class="selection-info"> </span> <!> <!></div>'),In=T('<div class="diff-wrapper svelte-1f4chm"><!> <div class="diff-content svelte-1f4chm"><!></div></div>'),Wn=T('<div class="tracked-change-diff-viewer svelte-1f4chm"><!></div>');function Dn(q,c){if(new.target)return Yt({component:Dn,...q});en(c,!0);const oe=()=>Xe(yt,"$read$",re),Ie=()=>Xe(Rt,"$workspace$",re),We=()=>Xe(It,"$workingTreeFileContentStore",re),[re,pe]=Jt(),Z=mn("TrackedChangeDiffViewer"),De=2*1024*1024;let s=v(c,"change",7),I=v(c,"active",7,!0),le=v(c,"workspaceId",7),B=v(c,"viewMode",7,"unified"),J=v(c,"showHeader",7,!1),Ne=v(c,"foldUnchanged",7,!0),Me=v(c,"lineWrapping",7,!1),U=v(c,"onStageHunk",7),A=v(c,"onUnstageHunk",7),et=v(c,"onOpenCommit",7),Ue=v(c,"refreshKey",7),Ae=v(c,"branchBaseRef",7),Ee=v(c,"branchBaseCommitSha",7),ge=v(c,"useProvidedContent",7,!1),ce=v(c,"allowHeadReads",7,!0),Fe=v(c,"canReadHeadFiles",7),W=v(c,"lineOffset",7,1),tt=v(c,"lineStageIndicators",7),Oe=v(c,"annotations",23,()=>[]),Te=v(c,"renderAnnotation",7),Be=v(c,"virtualizer",7),G=v(c,"gitRootId",7,void 0),be=v(c,"gitRootPath",7,void 0);const de=Ye(()=>le())??kn()?.workspaceId??"",Ct=Math.random().toString(36).substring(2,8),$e=`tracked-diff:${crypto.randomUUID()}`,yt=gn(de,$e),Q=d(()=>oe()?.result?.kind==="trackedDiff"?oe().result:void 0),ke=d(()=>oe()?.loading??!0),nt=d(()=>oe()?.error??null),ze=d(()=>(t(Q)?.oldContent.length??0)+(t(Q)?.newContent.length??0)>De),$=d(()=>t(ze)?"":t(Q)?.oldContent??""),V=d(()=>t(ze)?"":t(Q)?.newContent??""),ee=d(()=>ct(s()?.relativePath||s()?.file||"")),it=d(()=>t(Q)?.chunk?.chunks.length?At(t(Q).chunk,t(ee)):""),xt=d(()=>!t($)&&!t(V)&&!t(it)),Pt=d(()=>!!s()?.gitlink||!!t(Q)?.gitlink),st=d(()=>W()>1?`
|
|
3
3
|
`.repeat(W()-1):""),St=d(()=>t(st)+t($)),Ht=d(()=>t(st)+t(V));let _=ae(null),je=ae(null),_e=null,we=ae(!1);const Rt=vn(de),at=pt(void 0),ot=pt(""),It=dn(ot,at),rt=d(Ie),te=d(()=>be()||t(rt)?.worktreePath||t(rt)?.repositoryPath||""),Le=d(()=>s()?.relativePath||s()?.file||"file"),Wt=d(()=>Ut(t(Le)));let Ce=ae(null),lt=ae("");function ct(e){if(!e.startsWith("/")||!t(te))return e;const i=t(te).endsWith("/")?t(te).slice(0,-1):t(te);if(e.startsWith(i+"/"))return e.slice(i.length+1);if(e.startsWith(i)){const a=e.slice(i.length);return a.startsWith("/")?a.slice(1):a}return e}function Dt(e){return e?e.startsWith("/")?e:t(te)?`${t(te)}/${e}`:null:null}const dt=d(()=>W()>1),Nt=d(()=>t(dt)?`${t(Le)}:${He(t($))}:off${W()}`:void 0),Mt=d(()=>t(dt)?`${t(Le)}:${He(t(V))}:off${W()}`:void 0);function Ut(e){const i=e.split(".").pop()?.toLowerCase();return i?{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",py:"python",rs:"rust",go:"go",rb:"ruby",java:"java",kt:"kotlin",swift:"swift",cs:"csharp",cpp:"cpp",c:"c",h:"c",hpp:"cpp",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",md:"markdown",html:"html",css:"css",scss:"scss",sql:"sql",sh:"bash",bash:"bash",zsh:"bash",svelte:"svelte",vue:"vue"}[i]:void 0}function At(e,i){const a=`a/${i}`,o=`b/${i}`,u=[`diff --git ${a} ${o}`,`--- ${a}`,`+++ ${o}`];for(const r of e.chunks){u.push(`@@ -${r.oldStart},${r.oldLines} +${r.newStart},${r.newLines} @@`);for(const h of r.lines){const l=h.type===kt.Addition?"+":h.type===kt.Deletion?"-":" ",g=h.content.endsWith(`
|
|
4
4
|
`)?h.content.slice(0,-1):h.content;u.push(`${l}${g}`)}}return u.join(`
|