@intent-hq/web 2.343.1 → 2.343.2
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/assets/0.BtTQsuHZ.css +1 -0
- package/web/app/immutable/assets/DiagramPresentation.C2GLYoBN.css +1 -0
- package/web/app/immutable/chunks/{BsDPTTmM.js → -PfxOD5O.js} +2 -2
- package/web/app/immutable/chunks/{BrNDzmoP.js → -a8kGB-5.js} +1 -1
- package/web/app/immutable/chunks/{r9qRR0z6.js → -v5-bXWK.js} +3 -3
- package/web/app/immutable/chunks/{CJlP-cGG.js → 1VG8gLVS.js} +4 -4
- package/web/app/immutable/chunks/{iGTwwZkZ.js → 4GiF-64P.js} +1 -1
- package/web/app/immutable/chunks/{B5tMdivj.js → 4gxaObsl.js} +2 -2
- package/web/app/immutable/chunks/{DYLHdssA.js → 5a7lyWYQ.js} +1 -1
- package/web/app/immutable/chunks/{DW4-9u0G.js → 84AlJNR3.js} +1 -1
- package/web/app/immutable/chunks/{BvXEM_ru.js → Af7wRQM_.js} +1 -1
- package/web/app/immutable/chunks/{D7Ydchf3.js → B-00FHnf.js} +1 -1
- package/web/app/immutable/chunks/B1ywot0G.js +344 -0
- package/web/app/immutable/chunks/{Cu8zpbs5.js → B2pRmyv7.js} +1 -1
- package/web/app/immutable/chunks/{D_n6c_yZ.js → B461Cu-8.js} +1 -1
- package/web/app/immutable/chunks/{BdI_W2oB.js → B4sr0yPI.js} +1 -1
- package/web/app/immutable/chunks/{ClQaWwZN.js → B5_270cz.js} +1 -1
- package/web/app/immutable/chunks/{BWar5Ve4.js → B7_gjxTl.js} +1 -1
- package/web/app/immutable/chunks/{CGAWDKVf.js → B9qFB97l.js} +1 -1
- package/web/app/immutable/chunks/{CJ557C-o.js → BAR7XkP3.js} +3 -3
- package/web/app/immutable/chunks/BAf7ckig.js +1 -0
- package/web/app/immutable/chunks/{CB2VdHhb.js → BBAp8oIt.js} +1 -1
- package/web/app/immutable/chunks/{BSJHYrig.js → BBC8ZwBc.js} +1 -1
- package/web/app/immutable/chunks/{m1QfmWoj.js → BBKQVY9d.js} +1 -1
- package/web/app/immutable/chunks/{C3Z0swGN.js → BBlRLBe7.js} +1 -1
- package/web/app/immutable/chunks/{DMte7IXf.js → BCQ-e5LR.js} +1 -1
- package/web/app/immutable/chunks/{N8Bwwvnf.js → BCXwgWax.js} +1 -1
- package/web/app/immutable/chunks/{kae1oT68.js → BCmtMsc3.js} +1 -1
- package/web/app/immutable/chunks/{DoWkfKYp.js → BDo7DlDu.js} +1 -1
- package/web/app/immutable/chunks/{D7rZCWdO.js → BFqED1Hh.js} +1 -1
- package/web/app/immutable/chunks/{Cx2Zr_EY.js → BHt8CzB9.js} +1 -1
- package/web/app/immutable/chunks/{kIGC16c9.js → BIY2S7K4.js} +1 -1
- package/web/app/immutable/chunks/{_wUGU0fc.js → BJJ1m47o.js} +1 -1
- package/web/app/immutable/chunks/{uXJ_E75I.js → BJO4jUAG.js} +1 -1
- package/web/app/immutable/chunks/{BOTuR8YM.js → BM1KP-FJ.js} +1 -1
- package/web/app/immutable/chunks/{L-Y-TBRM.js → BMQaU_PE.js} +1 -1
- package/web/app/immutable/chunks/{Dogvf-Iu.js → BQAjCr1w.js} +1 -1
- package/web/app/immutable/chunks/{C4omy0Us.js → BRhVB6Sv.js} +1 -1
- package/web/app/immutable/chunks/{wiuyjoXz.js → BUY1W-f0.js} +1 -1
- package/web/app/immutable/chunks/{DM_Dhcp5.js → BXTPVho9.js} +2 -2
- package/web/app/immutable/chunks/{C_AhBHEv.js → BYgJjg0e.js} +1 -1
- package/web/app/immutable/chunks/{v2vpkl1z.js → B_a_b8VS.js} +1 -1
- package/web/app/immutable/chunks/{CQLYGyEz.js → B_frQYKx.js} +1 -1
- package/web/app/immutable/chunks/{CrUW7uHI.js → BgN4cuBh.js} +1 -1
- package/web/app/immutable/chunks/{BfIFD0ql.js → BgzyvwGo.js} +1 -1
- package/web/app/immutable/chunks/{U7UFkZSE.js → BiVahgoJ.js} +1 -1
- package/web/app/immutable/chunks/{BgEFdEVh.js → BjcX_fOv.js} +1 -1
- package/web/app/immutable/chunks/{B70m4__L.js → BjnZ1Xf3.js} +2 -2
- package/web/app/immutable/chunks/{C1fHwcnr.js → Bk2hJ8Ly.js} +1 -1
- package/web/app/immutable/chunks/{BGvipfx2.js → BmB6-2Ft.js} +1 -1
- package/web/app/immutable/chunks/{CFK6lvfY.js → BnZdkxbc.js} +1 -1
- package/web/app/immutable/chunks/{I0uVE7V8.js → BnrnoFjd.js} +1 -1
- package/web/app/immutable/chunks/{BtXKsHf_.js → Bs3KgIll.js} +1 -1
- package/web/app/immutable/chunks/{BsjKNm-k.js → Bv5I7YDM.js} +1 -1
- package/web/app/immutable/chunks/{DbnF6Yok.js → Bwjn3GNi.js} +1 -1
- package/web/app/immutable/chunks/{Bka1VG1N.js → BxQzYe9E.js} +1 -1
- package/web/app/immutable/chunks/{Dlo7xxGg.js → By0eqGj-.js} +1 -1
- package/web/app/immutable/chunks/{AzBoScJz.js → ByiJOZiZ.js} +1 -1
- package/web/app/immutable/chunks/{BAyUfXYZ.js → Bzblbh-D.js} +1 -1
- package/web/app/immutable/chunks/{DuHksFog.js → C-s9_soQ.js} +1 -1
- package/web/app/immutable/chunks/{BqkRycEV.js → C0g2TqGQ.js} +1 -1
- package/web/app/immutable/chunks/{Ci-yONgL.js → C0v3RBBR.js} +1 -1
- package/web/app/immutable/chunks/{35fhULrG.js → C1h34H4x.js} +1 -1
- package/web/app/immutable/chunks/C2V9igbA.js +1 -0
- package/web/app/immutable/chunks/{BP2y3sRZ.js → C3bwGgmD.js} +1 -1
- package/web/app/immutable/chunks/{CHylN0y-.js → C4Jo6GXP.js} +1 -1
- package/web/app/immutable/chunks/{BXXxFrPj.js → C8j358_U.js} +1 -1
- package/web/app/immutable/chunks/{BoX75a7M.js → C91dOInA.js} +1 -1
- package/web/app/immutable/chunks/{CZt5ZBg4.js → CBnORL1F.js} +3 -3
- package/web/app/immutable/chunks/{DoNhrjWd.js → CD6GiPmw.js} +1 -1
- package/web/app/immutable/chunks/{CfJdaoIE.js → CDFRnJ8k.js} +1 -1
- package/web/app/immutable/chunks/{B0IMKrn3.js → CERb2-2E.js} +1 -1
- package/web/app/immutable/chunks/{C2Rkb1O5.js → CHFUz5Rr.js} +1 -1
- package/web/app/immutable/chunks/{CXHfGIt6.js → CHGTw2Bl.js} +1 -1
- package/web/app/immutable/chunks/{DHTa3FGv.js → CHhGO97x.js} +1 -1
- package/web/app/immutable/chunks/{C4Ninryq.js → CInXeVe5.js} +1 -1
- package/web/app/immutable/chunks/{DIL0XcL6.js → CMO4ot9F.js} +1 -1
- package/web/app/immutable/chunks/{BIGnKucK.js → CMQoXdpQ.js} +1 -1
- package/web/app/immutable/chunks/{ZN-mesLP.js → CN6xxeS_.js} +1 -1
- package/web/app/immutable/chunks/{BmmYJ5hU.js → CNsCzECr.js} +1 -1
- package/web/app/immutable/chunks/{C2NHyJHV.js → CSveVSnU.js} +1 -1
- package/web/app/immutable/chunks/{DJL0zbbT.js → CUp3pS17.js} +1 -1
- package/web/app/immutable/chunks/{D0TlsaAe.js → CVBmzjKd.js} +1 -1
- package/web/app/immutable/chunks/{DFkJzID4.js → CVc7LcaQ.js} +3 -3
- package/web/app/immutable/chunks/{DtxfuyBv.js → CWIcIgSm.js} +1 -1
- package/web/app/immutable/chunks/{DZiSQoCc.js → CXm95Q2a.js} +1 -1
- package/web/app/immutable/chunks/{CBq9ao8v.js → CZNjFz9H.js} +1 -1
- package/web/app/immutable/chunks/{CVEBue1Q.js → CbeK0M7M.js} +1 -1
- package/web/app/immutable/chunks/{Bgfnbjb4.js → CdN2Ihv_.js} +1 -1
- package/web/app/immutable/chunks/{D-2cdK33.js → CdqlgErf.js} +1 -1
- package/web/app/immutable/chunks/{DtVlaWMd.js → Cdx0eFWC.js} +1 -1
- package/web/app/immutable/chunks/{BaA_OrGq.js → CeizKDc4.js} +1 -1
- package/web/app/immutable/chunks/{DDaNHu84.js → CfPxdWJl.js} +1 -1
- package/web/app/immutable/chunks/{rPOaqvb6.js → Cftldgk7.js} +1 -1
- package/web/app/immutable/chunks/{1JAPG9y2.js → Cgm3wI9t.js} +1 -1
- package/web/app/immutable/chunks/{BjGmqNpS.js → CiTK-_b6.js} +1 -1
- package/web/app/immutable/chunks/{CnZcDXmL.js → CicdOSYm.js} +2 -2
- package/web/app/immutable/chunks/{Ptn6pOdb.js → Ciqm_fPa.js} +1 -1
- package/web/app/immutable/chunks/{CAHBBl9S.js → CjXLe_MO.js} +1 -1
- package/web/app/immutable/chunks/{C-DRfJcG.js → CjZIABEV.js} +1 -1
- package/web/app/immutable/chunks/{BayXe-e8.js → CjtYlgpc.js} +1 -1
- package/web/app/immutable/chunks/{w-1KkHyd.js → ClTZNeVO.js} +1 -1
- package/web/app/immutable/chunks/{BHekbKzn.js → CmSDhJgU.js} +1 -1
- package/web/app/immutable/chunks/{DwXYzqBQ.js → Cn19T3na.js} +1 -1
- package/web/app/immutable/chunks/{DrI6m-rY.js → Cn3xolhp.js} +1 -1
- package/web/app/immutable/chunks/{BpQOBsoR.js → CnJe4S2a.js} +1 -1
- package/web/app/immutable/chunks/{DwZUZouP.js → CpWbjqtx.js} +1 -1
- package/web/app/immutable/chunks/{DGznsmsL.js → CpXorioa.js} +1 -1
- package/web/app/immutable/chunks/{9kqz7dDm.js → Ct-2wSQ6.js} +1 -1
- package/web/app/immutable/chunks/{BXNFvqQr.js → CuXCq1os.js} +3 -3
- package/web/app/immutable/chunks/{BrU4OT9R.js → CusCKZ30.js} +2 -2
- package/web/app/immutable/chunks/{CVGmnzrp.js → CvmMeam2.js} +1 -1
- package/web/app/immutable/chunks/{C76q11mm.js → CwRpBR2e.js} +1 -1
- package/web/app/immutable/chunks/{CIwcmzpw.js → CxLPEkg7.js} +1 -1
- package/web/app/immutable/chunks/{BUUgD57b.js → CyGN0Rwg.js} +1 -1
- package/web/app/immutable/chunks/{QoUsFhvz.js → CzQCBVm9.js} +1 -1
- package/web/app/immutable/chunks/{D58P1mNO.js → Czmjmrib.js} +1 -1
- package/web/app/immutable/chunks/{BziNoOeQ.js → Czqd0ZZn.js} +1 -1
- package/web/app/immutable/chunks/{_0BFM6IU.js → D-aNPvuh.js} +2 -2
- package/web/app/immutable/chunks/{Bdd_Up9A.js → D0GCx3sO.js} +1 -1
- package/web/app/immutable/chunks/{DFq9n5nW.js → D2Ntkwf_.js} +1 -1
- package/web/app/immutable/chunks/D2pPI0H2.js +12 -0
- package/web/app/immutable/chunks/{atiG7mlf.js → D60l1rCk.js} +2 -2
- package/web/app/immutable/chunks/{DohG5a1a.js → D7QiNhGR.js} +1 -1
- package/web/app/immutable/chunks/{BHxqvJ6p.js → D89Fvz2g.js} +1 -1
- package/web/app/immutable/chunks/{DarHRPPY.js → D8gunWV0.js} +2 -2
- package/web/app/immutable/chunks/{COjSVIHG.js → D8lUkQ-B.js} +1 -1
- package/web/app/immutable/chunks/{CIR7skK5.js → D9ajM8uP.js} +1 -1
- package/web/app/immutable/chunks/{0sFbw5Xt.js → DAYo95RN.js} +1 -1
- package/web/app/immutable/chunks/{Bhmm0Csf.js → DHP1DFPI.js} +1 -1
- package/web/app/immutable/chunks/{Cvz-9_40.js → DIumxlqP.js} +1 -1
- package/web/app/immutable/chunks/{CeNWJyWT.js → DIyuJ_GU.js} +1 -1
- package/web/app/immutable/chunks/{DEipLocY.js → DJuVbNrB.js} +1 -1
- package/web/app/immutable/chunks/{CIQcnDuR.js → DOqpTP8b.js} +1 -1
- package/web/app/immutable/chunks/{DjI8eVMr.js → DPBk4F6a.js} +45 -45
- package/web/app/immutable/chunks/DQJminLw.js +1 -0
- package/web/app/immutable/chunks/{WQOeAOAl.js → DQR5oUDY.js} +1 -1
- package/web/app/immutable/chunks/{C-3x67fn.js → DRSdBoB7.js} +2 -2
- package/web/app/immutable/chunks/{HZ3QrylZ.js → DSnERXrp.js} +1 -1
- package/web/app/immutable/chunks/{Dp7jUSi9.js → DU0nfy_y.js} +1 -1
- package/web/app/immutable/chunks/{DxMdBYgz.js → DV6k5cHH.js} +1 -1
- package/web/app/immutable/chunks/{CCv3Lx_U.js → DVH2puba.js} +1 -1
- package/web/app/immutable/chunks/{DbboHfqH.js → DVN2Xze9.js} +1 -1
- package/web/app/immutable/chunks/{D2hN829h.js → DVYqzV0n.js} +1 -1
- package/web/app/immutable/chunks/{X4cuG_zB.js → DWiPdXwB.js} +1 -1
- package/web/app/immutable/chunks/{CepAUbyM.js → DXozNEH9.js} +1 -1
- package/web/app/immutable/chunks/{DRp_Nj0f.js → DaaneYTG.js} +1 -1
- package/web/app/immutable/chunks/{BaEEaJBP.js → Dab1wvUg.js} +1 -1
- package/web/app/immutable/chunks/{CsjdKc-0.js → DbNMpEC8.js} +1 -1
- package/web/app/immutable/chunks/{Dyc_CyAW.js → DdjlRG5U.js} +1 -1
- package/web/app/immutable/chunks/{Ci9pTyYA.js → DiAIgif8.js} +1 -1
- package/web/app/immutable/chunks/{DZGCpHpr.js → Djb279-4.js} +1 -1
- package/web/app/immutable/chunks/{CC401ReW.js → Dkh7OUxN.js} +1 -1
- package/web/app/immutable/chunks/{CDFewoTI.js → DnTKe3X-.js} +1 -1
- package/web/app/immutable/chunks/{wJj3WeBH.js → DrtMUjoh.js} +2 -2
- package/web/app/immutable/chunks/{BIqsMOOo.js → DuG2OZjB.js} +1 -1
- package/web/app/immutable/chunks/{BpLC2eO9.js → DuIazAmY.js} +1 -1
- package/web/app/immutable/chunks/{Dv_vjHi2.js → DxztdKvh.js} +1 -1
- package/web/app/immutable/chunks/FQr_NSnS.js +1 -0
- package/web/app/immutable/chunks/{p3CrvZe2.js → GVckKXJ5.js} +1 -1
- package/web/app/immutable/chunks/{DTVdw8r4.js → HLKPZgVy.js} +1 -1
- package/web/app/immutable/chunks/{z5uPT3dt.js → JTj2pw56.js} +1 -1
- package/web/app/immutable/chunks/{B422XfSt.js → KJX0Kw6L.js} +3 -3
- package/web/app/immutable/chunks/{D2waAEN7.js → L30ES58t.js} +1 -1
- package/web/app/immutable/chunks/{DA06uG-a.js → L_S2h6Yw.js} +1 -1
- package/web/app/immutable/chunks/{DJ0uFT5X.js → MZ6PO-qe.js} +1 -1
- package/web/app/immutable/chunks/{G8V-Z8rX.js → MgErAKgQ.js} +2 -2
- package/web/app/immutable/chunks/{Bc5tOdcb.js → NnMVp6ZM.js} +1 -1
- package/web/app/immutable/chunks/{CckzaWai.js → O6f99o2k.js} +1 -1
- package/web/app/immutable/chunks/{DySlMfKo.js → PDh5csw9.js} +1 -1
- package/web/app/immutable/chunks/{OrocR3hK.js → Pat1u3oY.js} +1 -1
- package/web/app/immutable/chunks/{TvbL6LZd.js → R9ODE8FL.js} +3 -3
- package/web/app/immutable/chunks/{DnouH0RQ.js → SrezSe0o.js} +1 -1
- package/web/app/immutable/chunks/{BPPRSM7X.js → SxNmK2GR.js} +3 -3
- package/web/app/immutable/chunks/{DWcJHqWX.js → TsEB3aw-.js} +1 -1
- package/web/app/immutable/chunks/{BYONj21e.js → ViWKv_qM.js} +1 -1
- package/web/app/immutable/chunks/{CHVKhAgJ.js → Wsz69q6g.js} +1 -1
- package/web/app/immutable/chunks/{BIIYAsFZ.js → WvxOnEzW.js} +4 -4
- package/web/app/immutable/chunks/{DJh_DDe7.js → XkS41G1k.js} +1 -1
- package/web/app/immutable/chunks/{CCaHJZV8.js → XvLHDIL-.js} +1 -1
- package/web/app/immutable/chunks/{Dnv7wJSL.js → ZjzfSXHu.js} +1 -1
- package/web/app/immutable/chunks/{DpjBemXH.js → _RGinDCt.js} +1 -1
- package/web/app/immutable/chunks/{DyhEd_D5.js → a1r6BT-e.js} +1 -1
- package/web/app/immutable/chunks/{Ae-1QeEg.js → b-gQtgOb.js} +4 -4
- package/web/app/immutable/chunks/{juKvR8YJ.js → blPVVvA0.js} +4 -4
- package/web/app/immutable/chunks/{D__c4Yl1.js → d_IAf8cB.js} +1 -1
- package/web/app/immutable/chunks/{CgFIU5ie.js → fCEIPyv5.js} +1 -1
- package/web/app/immutable/chunks/{C2uZ_VhE.js → gsElU_36.js} +1 -1
- package/web/app/immutable/chunks/{BznnhLs6.js → htyZQ7p9.js} +1 -1
- package/web/app/immutable/chunks/{v2YVbizz.js → iMyDpxOV.js} +1 -1
- package/web/app/immutable/chunks/{CgdsufvB.js → ihu83Gf7.js} +1 -1
- package/web/app/immutable/chunks/{DXw-WTZY.js → ivrPoCwd.js} +1 -1
- package/web/app/immutable/chunks/{51PCa81S.js → juUcLrve.js} +1 -1
- package/web/app/immutable/chunks/kHCC2X2-.js +1 -0
- package/web/app/immutable/chunks/{JIxwOKX_.js → lsICrwNh.js} +1 -1
- package/web/app/immutable/chunks/{BSDp34Kf.js → n5fDR6Ys.js} +1 -1
- package/web/app/immutable/chunks/{BytoSt_Z.js → nM9_StK8.js} +1 -1
- package/web/app/immutable/chunks/{DtbQslHZ.js → oYQw_s1S.js} +1 -1
- package/web/app/immutable/chunks/{nlN0b4Kg.js → ozzjQyCh.js} +1 -1
- package/web/app/immutable/chunks/{Bx3b0rPd.js → qdwxdMJ_.js} +1 -1
- package/web/app/immutable/chunks/{DMXJ8RT1.js → quYX3pdL.js} +1 -1
- package/web/app/immutable/chunks/{BANxp4gx.js → rElTuGMj.js} +1 -1
- package/web/app/immutable/chunks/{OmpkRRYb.js → tHDPdTwr.js} +1 -1
- package/web/app/immutable/chunks/{D8eBy-8s.js → uI0ZG7MM.js} +1 -1
- package/web/app/immutable/chunks/{iAu7Aj29.js → wjBrDDKR.js} +1 -1
- package/web/app/immutable/chunks/{BIjcjB3s.js → xNZ_GbEJ.js} +1 -1
- package/web/app/immutable/chunks/{BJ9asJd9.js → yl6pDKiQ.js} +1 -1
- package/web/app/immutable/chunks/{ClN0hrCD.js → zWI60sec.js} +1 -1
- package/web/app/immutable/entry/app.9r9RhFng.js +4 -0
- package/web/app/immutable/entry/start.C8tteIq6.js +1 -0
- package/web/app/immutable/nodes/{0.maNxDgKk.js → 0._MOrvR24.js} +1 -1
- package/web/app/immutable/nodes/{1.CrUOCJzJ.js → 1.DVvUSeXg.js} +1 -1
- package/web/app/immutable/nodes/{10.DAHzIxDn.js → 10.DIleurXr.js} +1 -1
- package/web/app/immutable/nodes/{11.QGXqc7LC.js → 11.CPz1gfx7.js} +1 -1
- package/web/app/immutable/nodes/{12.Deg0J99J.js → 12.IWuvbIEt.js} +1 -1
- package/web/app/immutable/nodes/{13.DYahTbd4.js → 13.K9ySk2sQ.js} +1 -1
- package/web/app/immutable/nodes/{14.DqcYIHGs.js → 14.BR3FpNbu.js} +1 -1
- package/web/app/immutable/nodes/{15.fBsD-rf2.js → 15.MdkxIvV5.js} +1 -1
- package/web/app/immutable/nodes/{16.BB4D0sXM.js → 16.CKCeF79S.js} +1 -1
- package/web/app/immutable/nodes/{17.C504DyaY.js → 17.DNzYNnAu.js} +2 -2
- package/web/app/immutable/nodes/2.DJLdbLzb.js +13 -0
- package/web/app/immutable/nodes/{3.C7nQO7Qp.js → 3.BgL634Ss.js} +1 -1
- package/web/app/immutable/nodes/{4.DOK8Tw7p.js → 4.CR0sD7s6.js} +1 -1
- package/web/app/immutable/nodes/{5.ubLsJnyC.js → 5.sL-y10DG.js} +1 -1
- package/web/app/immutable/nodes/{6.CyCRzMDW.js → 6.Ci8BcEFn.js} +1 -1
- package/web/app/immutable/nodes/{7.Bg70Q16x.js → 7.BxPcDZ4n.js} +1 -1
- package/web/app/immutable/nodes/{8.BvaAzEQm.js → 8.DfInEKdf.js} +10 -10
- package/web/app/immutable/nodes/{9.DO468RMT.js → 9.ChF6BmYv.js} +5 -5
- package/web/app/version.json +1 -1
- package/web/index.html +16 -16
- package/web/app/immutable/assets/0.DZzKp2Fe.css +0 -1
- package/web/app/immutable/assets/DiagramPresentation.Bfi3xHm0.css +0 -1
- package/web/app/immutable/chunks/BvpPy--g.js +0 -1
- package/web/app/immutable/chunks/CAXcxCRW.js +0 -12
- package/web/app/immutable/chunks/CO2d8RwC.js +0 -1
- package/web/app/immutable/chunks/CQpQeUin.js +0 -1
- package/web/app/immutable/chunks/CTjSHpOw.js +0 -344
- package/web/app/immutable/chunks/DvnMaoHD.js +0 -1
- package/web/app/immutable/chunks/qiTOR0DK.js +0 -1
- package/web/app/immutable/entry/app.F35RZd_b.js +0 -4
- package/web/app/immutable/entry/start.Dg01C9a0.js +0 -1
- package/web/app/immutable/nodes/2.ByX1NsE4.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{oz as o}from"./CicdOSYm.js";import{aC as r}from"./C0g2TqGQ.js";function c(n,e){if(!e)return!0;const t=r.select(n,e);return!!t&&!o(t)}export{c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as Re,br as i,a_ as Z,bp as n,bz as Fe,bv as Oe,bt as Wt,b as Ue}from"./CGWRZzdk.js";import{ai as Kt,bo as Vt,bs as je,bV as P,br as Qt,ca as _e,aD as e,bj as Gt,bH as a,c5 as nt,a5 as z,bl as N,bS as c,bA as O,b_ as D,bO as h,W as m,bn as ze,c9 as _,aA as d,ay as V,a7 as Be,aB as B,bf as rt,aj as Jt,be as X,b$ as Y}from"./DYhIMPy1.js";import{b as Xt}from"./BaIAhI85.js";import{u as at,n as Yt,j as Zt,l as lt,v as en,p as tn}from"./B70m4__L.js";import"./DuHksFog.js";import"./QoUsFhvz.js";import"./BEyWfhqM.js";import{f as K}from"./B422XfSt.js";import"./w-1KkHyd.js";import{s as nn,c as rn}from"./DTVdw8r4.js";import{x as ve,Ix as W,hH as pe,sc as an,hK as st}from"./CnZcDXmL.js";import{C as ln,b as sn,T as on,c as cn,S as dn}from"./iAu7Aj29.js";import{I as Ae}from"./D_n6c_yZ.js";import"./C4omy0Us.js";import"./CgFIU5ie.js";import"./C2uZ_VhE.js";import"./ChTqQfQN.js";import"./BgEFdEVh.js";import{o as un}from"./DIP3ex32.js";import{ag as fn,aQ as _n,aH as pn,F as vn}from"./CVGmnzrp.js";import{i as bn,p as gn}from"./X4cuG_zB.js";var mn=B('<span class="size-4 rounded-full border border-muted-foreground/60 bg-background" aria-hidden="true"></span>'),hn=B('<span aria-hidden="true"></span>'),xn=B('<p class="text-xs text-subtle"> </p> <p class="text-xs text-subtle"> <a class="text-primary-ink hover:underline">github.com/intent-hq/intentd</a> </p>',1),yn=B('<div class="space-y-1"><label class="text-xs text-subtle" for="connect-name"> </label> <!></div> <div class="flex min-w-0 items-end gap-4" data-connect-appearance=""><fieldset class="min-w-0 flex-1 space-y-1"><legend class="text-xs text-subtle"> </legend> <div class="flex flex-wrap gap-1"></div></fieldset> <!></div> <div class="space-y-1"><label class="text-xs text-subtle" for="connect-host"> </label> <!> <!></div> <div class="space-y-1"><label class="text-xs text-subtle" for="connect-port"> </label> <!></div> <div class="space-y-1"><label class="text-xs text-subtle" for="connect-token"> </label> <!></div> <!> <!> <!>',1),kn=B('<div class="space-y-1"><span class="text-xs text-subtle"> </span> <p class="font-mono text-xs break-all bg-muted/50 rounded p-2"> </p></div>'),Cn=B('<p class="text-xs text-danger" role="alert"> </p>'),An=B('<div class="space-y-4"><p class="text-sm text-subtle" role="status" aria-live="polite"> </p> <!> <!></div>');function ct(M,l){const p=Vt();if(new.target)return Re({component:ct,...M});je(l,!0);const g=()=>Oe(dt,"$workflow$",T),R=()=>Oe(pt,"$hostManagesConnections$",T),w=()=>Oe(_t,"$syncState$",T),[T,F]=Wt(),q=(t,o=rt)=>{{const b=(de,ue=rt)=>{{let J=_(()=>({...ue(),entry:o(),controlId:o().id}));dn(de,{get entry(){return o()},get context(){return e(J)}})}};let ne=_(()=>`${o().id}-field`);nn(t,{get id(){return e(ne)},get label(){return o().label},get description(){return o().description},get htmlFor(){return o().id},get disabled(){return e(ce)},get busy(){return e(ce)},compact:!0,class:"grid-cols-[minmax(0,1fr)_auto] items-start py-0 first:pt-0 last:pb-0 [&_[data-field-control]]:w-auto",control:b,$$slots:{control:!0}})}};let $=i(l,"active",7),x=i(l,"step",15,"details"),U=i(l,"busy",15,!1),j=i(l,"canContinue",15,!1),L=i(l,"firstInput",15,null),s=i(l,"prefillHost",7,null),y=i(l,"prefillPort",7,null),I=i(l,"prefillLabel",7,null),H=i(l,"prefillAccent",7,void 0),r=i(l,"defaultAccent",7,ve),k=i(l,"showHelp",7,!0),C=i(l,"onDone",7);const v="5181",S="https://github.com/intent-hq/intentd";function Me(t){t.preventDefault(),un(S)}let A=P(""),ee=P(Qt(ve)),se=P("auto"),E=P(""),Q=P(v),G=P(""),te=P(null),be=P(!0),oe=P(!0),ge=P("");const dt=fn(p),ce=_(()=>!!g()&&g().phase!=="settled");_e(()=>{U(e(ce))});const qe=_(()=>{const t=g()?.outcome;return t?.kind==="error"||t?.kind==="syncError"?t.message:t?.kind==="secretUnavailable"?n.modals_connect_secretUnavailable_error():t?.kind==="captureRejected"?t.statusCode===403?n.modals_connect_wsApiDisabled_error():n.modals_connect_tokenRejected_error():null});Gt(()=>W.dispatch(pe(p))),_e(()=>{const t=g()?.outcome;t?.kind==="captured"?(a(ge,t.fingerprint,!0),x("confirm"),W.dispatch(pe(p))):t?.kind==="done"&&nt(()=>{we(),C()()})});const ut=_(()=>cn(H()===void 0?r():H())),ft=typeof window<"u"&&window.electronAPI?.platform==="darwin",_t=_n(),pt=pn(),Se=_(()=>!R()&&(w()?.supported??ft)),vt=_(()=>w()?.enabled??!1),bt=_(()=>({kind:"switch",id:"connect-detect-hosts",label:n.modals_connect_detectHosts_label(),description:n.modals_connect_detectHosts_description(),get:()=>e(be),set:t=>{a(be,t,!0)}})),gt=_(()=>({kind:"switch",id:"connect-save-to-icloud",label:n.modals_connect_saveToICloud_label(),description:n.modals_connect_saveToICloud_description(),get:()=>e(oe),set:t=>{a(oe,t,!0)}})),ie=_(()=>Number(e(Q).trim())),We=_(()=>e(A).trim().length>0&&e(E).trim().length>0&&Number.isInteger(e(ie))&&e(ie)>0&&e(ie)<=65535&&e(G).trim().length>0&&!e(ce));_e(()=>{j(e(We))});function we(){x("details"),a(A,""),a(ee,r(),!0),a(se,"auto"),a(E,""),a(Q,v),a(G,""),a(te,null),a(be,!0),a(oe,!0),a(ge,""),W.dispatch(pe(p))}function mt(t){const o=t.clipboardData?.getData("text")??"";if(!bn(o))return;const b=gn(o);b&&(t.preventDefault(),b.hosts.length>0&&a(E,b.hosts[0],!0),b.port!==null&&a(Q,String(b.port),!0),b.token&&a(G,b.token,!0),a(te,b.tcAddress,!0))}function ht(){a(te,vn(e(E))?e(E).trim():null,!0)}function xt(){e(We)&&W.dispatch(st(p,{kind:"capture",params:{host:e(E).trim(),port:e(ie),token:e(G).trim()}}))}function yt(){if(e(Se)&&!e(vt)&&e(oe)){W.dispatch(pe(p)),x("syncConfirm");return}Ie(e(Se)&&!e(oe))}function Ie(t,o={}){const b=e(E).trim();W.dispatch(st(p,{kind:"connect",enableSync:o.enableSyncAfterAdd===!0,params:{label:e(A).trim(),accent:e(ee),deviceIcon:e(se),host:b,port:e(ie),fingerprint:e(ge),token:e(G).trim(),...e(te)?{tcAddress:e(te)}:{},detectHosts:e(be),...t?{syncExcluded:!0}:{}}}))}function kt(){Ie(!1,{enableSyncAfterAdd:!0})}function Ct(){Ie(!0)}function At(){x("details"),W.dispatch(pe(p))}const me="w-full px-3 py-2 bg-background border border-border rounded text-foreground text-sm focus:outline-none focus:border-primary-ink";function St(t){return t===null?n.settings_devices_accentNone_label():{blue:n.settings_devices_accentBlue_label(),indigo:n.settings_devices_accentIndigo_label(),violet:n.settings_devices_accentViolet_label(),rose:n.settings_devices_accentRose_label(),orange:n.settings_devices_accentOrange_label(),emerald:n.settings_devices_accentEmerald_label(),teal:n.settings_devices_accentTeal_label()}[t]}_e(()=>{if($()&&x()==="details"&&L()){const t=L();requestAnimationFrame(()=>t.focus())}});let He=!1;_e(()=>{const t=$()&&!He,o=!$()&&He;He=$(),o&&nt(we),t&&(I()&&e(A)===""&&a(A,I()),a(ee,H()===void 0?r():H(),!0),s()&&e(E)===""&&a(E,s()),y()!=null&&e(Q)===v&&a(Q,String(y()),!0),W.dispatch(an()))});var wt={reset:we,capture:xt,confirm:yt,enableSyncAndAdd:kt,declineSync:Ct,back:At,get active(){return $()},set active(t){$(t),d()},get step(){return x()},set step(t="details"){x(t),d()},get busy(){return U()},set busy(t=!1){U(t),d()},get canContinue(){return j()},set canContinue(t=!1){j(t),d()},get firstInput(){return L()},set firstInput(t=null){L(t),d()},get prefillHost(){return s()},set prefillHost(t=null){s(t),d()},get prefillPort(){return y()},set prefillPort(t=null){y(t),d()},get prefillLabel(){return I()},set prefillLabel(t=null){I(t),d()},get prefillAccent(){return H()},set prefillAccent(t=void 0){H(t),d()},get defaultAccent(){return r()},set defaultAccent(t=ve){r(t),d()},get showHelp(){return k()},set showHelp(t=!0){k(t),d()},get onDone(){return C()},set onDone(t){C(t),d()},$set:Fe,$on:(t,o)=>Ue(l,t,o)},he=An(),Ke=z(he),It=N(Ke,!0),Ve=c(Ke,2);{var Ht=t=>{var o=yn(),b=V(o),ne=z(b),de=N(ne,!0),ue=c(ne,2);{let u=_(()=>n.modals_connect_name_placeholder());Ae(ue,{id:"connect-name",type:"text",get placeholder(){return e(u)},class:me,autocomplete:"off",get ref(){return L()},set ref(f){L(f)},get value(){return e(A)},set value(f){a(A,f,!0)}})}O(b);var J=c(b,2),Pe=z(J),Qe=z(Pe),Tt=N(Qe,!0),Ge=c(Qe,2);Yt(Ge,21,()=>e(ut),tn,(u,f)=>{{let re=_(()=>lt("flex size-8 cursor-pointer items-center justify-center rounded-full border bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e(f)===e(ee)?"border-foreground shadow-[0_0_0_2px_var(--color-background),0_0_0_4px_var(--color-foreground)]":"border-border hover:border-input")),fe=_(()=>n.modals_connect_accentOption_ariaLabel({color:St(e(f))})),ae=_(()=>e(f)===e(ee));K(u,{type:"button",variant:"plain",get class(){return e(re)},get"aria-label"(){return e(fe)},get"aria-pressed"(){return e(ae)},onclick:()=>a(ee,e(f),!0),children:(xe,ye)=>{var ke=Be(),Te=V(ke);{var Ee=le=>{var Ce=mn();m(le,Ce)},Ne=le=>{var Ce=hn();D(qt=>en(Ce,1,qt),[()=>Zt(lt("size-4 rounded-full",ln[e(f)]))]),m(le,Ce)};Z(Te,le=>{e(f)===null?le(Ee):le(Ne,-1)})}m(xe,ke)},$$slots:{default:!0}})}}),O(Ge),O(Pe);var Et=c(Pe,2);{let u=_(()=>({deviceIcon:e(se)}));sn(Et,{get record(){return e(u)},portal:!0,contentClass:"z-[calc(var(--layer-modal)+1)]",get value(){return e(se)},set value(f){a(se,f,!0)}})}O(J);var $e=c(J,2),Je=z($e),Nt=N(Je,!0),Xe=c(Je,2);{let u=_(()=>n.modals_connect_host_placeholder());Ae(Xe,{id:"connect-host",type:"text",get placeholder(){return e(u)},class:me,autocorrect:"off",autocapitalize:"off",spellcheck:"false",onpaste:mt,oninput:ht,get value(){return e(E)},set value(f){a(E,f,!0)}})}var Ot=c(Xe,2);{let u=_(()=>e(te)!==null);on(Ot,{get relevant(){return e(u)}})}O($e);var De=c($e,2),Ye=z(De),Rt=N(Ye,!0),Ft=c(Ye,2);{let u=_(()=>n.modals_connect_port_placeholder());Ae(Ft,{id:"connect-port",type:"text",inputmode:"numeric",get placeholder(){return e(u)},class:me,autocorrect:"off",autocapitalize:"off",spellcheck:"false",get value(){return e(Q)},set value(f){a(Q,f,!0)}})}O(De);var Le=c(De,2),Ze=z(Le),Ut=N(Ze,!0),jt=c(Ze,2);{let u=_(()=>n.modals_connect_token_placeholder());Ae(jt,{id:"connect-token",type:"password",get placeholder(){return e(u)},class:me,autocorrect:"off",autocapitalize:"off",spellcheck:"false",get value(){return e(G)},set value(f){a(G,f,!0)}})}O(Le);var et=c(Le,2);q(et,()=>e(bt));var tt=c(et,2);{var zt=u=>{q(u,()=>e(gt))};Z(tt,u=>{e(Se)&&u(zt)})}var Bt=c(tt,2);{var Mt=u=>{var f=xn(),re=V(f),fe=N(re,!0),ae=c(re,2),xe=z(ae),ye=c(xe);at(ye,"href",S);var ke=c(ye);O(ae),D((Te,Ee,Ne)=>{h(fe,Te),h(xe,`${Ee??""} `),h(ke,` ${Ne??""}`)},[()=>n.modals_connect_whereToFind_help(),()=>n.modals_connect_headless_before(),()=>n.modals_connect_headless_after()]),Jt("click",ye,Me),m(u,f)};Z(Bt,u=>{k()&&u(Mt)})}D((u,f,re,fe,ae)=>{h(de,u),h(Tt,f),h(Nt,re),h(Rt,fe),h(Ut,ae)},[()=>n.modals_connect_name_label(),()=>n.settings_devices_accent_label(),()=>n.modals_connect_host_label(),()=>n.modals_connect_port_label(),()=>n.modals_connect_token_label()]),m(t,o)},Pt=t=>{var o=kn(),b=z(o),ne=N(b,!0),de=c(b,2),ue=N(de,!0);O(o),D(J=>{h(ne,J),h(ue,e(ge))},[()=>n.modals_connect_fingerprint_label()]),m(t,o)};Z(Ve,t=>{x()==="details"?t(Ht):x()==="confirm"&&t(Pt,1)})}var $t=c(Ve,2);{var Dt=t=>{var o=Cn(),b=N(o,!0);D(()=>h(b,e(qe))),m(t,o)};Z($t,t=>{e(qe)&&t(Dt)})}O(he),D(t=>{at(he,"aria-busy",e(ce)),h(It,t)},[()=>x()==="details"?n.modals_connect_details_description():x()==="confirm"?n.modals_connect_confirmStep_description():n.modals_connect_enableSync_description()]),m(M,he);var Lt=ze(wt);return F(),Lt}Kt(["click"]);var ot=B("<!> <!>",1),Sn=B("<!> <!> <!>",1);function it(M,l){if(new.target)return Re({component:it,...M});je(l,!0);let p=i(l,"step",7),g=i(l,"busy",7),R=i(l,"canContinue",7),w=i(l,"form",7),T=i(l,"detailsSecondaryLabel",23,()=>n.modals_connect_cancel_label()),F=i(l,"onDetailsSecondary",7);var q={get step(){return p()},set step(s){p(s),d()},get busy(){return g()},set busy(s){g(s),d()},get canContinue(){return R()},set canContinue(s){R(s),d()},get form(){return w()},set form(s){w(s),d()},get detailsSecondaryLabel(){return T()},set detailsSecondaryLabel(s=n.modals_connect_cancel_label()){T(s),d()},get onDetailsSecondary(){return F()},set onDetailsSecondary(s){F(s),d()},$set:Fe,$on:(s,y)=>Ue(l,s,y)},$=Be(),x=V($);{var U=s=>{var y=ot(),I=V(y);K(I,{variant:"ghost",get disabled(){return g()},get onclick(){return F()},children:(r,k)=>{X();var C=Y();D(()=>h(C,T())),m(r,C)},$$slots:{default:!0}});var H=c(I,2);{let r=_(()=>!R());K(H,{variant:"secondary",onclick:()=>w()?.capture(),get disabled(){return e(r)},children:(k,C)=>{X();var v=Y();D(S=>h(v,S),[()=>g()?n.modals_connect_connecting_label():n.modals_connect_continue_label()]),m(k,v)},$$slots:{default:!0}})}m(s,y)},j=s=>{var y=ot(),I=V(y);K(I,{variant:"ghost",onclick:()=>w()?.back(),get disabled(){return g()},children:(r,k)=>{X();var C=Y();D(v=>h(C,v),[()=>n.modals_connect_back_label()]),m(r,C)},$$slots:{default:!0}});var H=c(I,2);K(H,{variant:"secondary",onclick:()=>w()?.confirm(),get disabled(){return g()},children:(r,k)=>{X();var C=Y();D(v=>h(C,v),[()=>g()?n.modals_connect_connecting_label():n.modals_connect_confirm_label()]),m(r,C)},$$slots:{default:!0}}),m(s,y)},L=s=>{var y=Sn(),I=V(y);K(I,{variant:"ghost",onclick:()=>w()?.back(),get disabled(){return g()},children:(k,C)=>{X();var v=Y();D(S=>h(v,S),[()=>n.modals_connect_back_label()]),m(k,v)},$$slots:{default:!0}});var H=c(I,2);K(H,{variant:"ghost",onclick:()=>w()?.declineSync(),get disabled(){return g()},children:(k,C)=>{X();var v=Y();D(S=>h(v,S),[()=>n.modals_connect_enableSync_decline_label()]),m(k,v)},$$slots:{default:!0}});var r=c(H,2);K(r,{variant:"secondary",onclick:()=>w()?.enableSyncAndAdd(),get disabled(){return g()},children:(k,C)=>{X();var v=Y();D(S=>h(v,S),[()=>g()?n.modals_connect_connecting_label():n.modals_connect_enableSync_confirm_label()]),m(k,v)},$$slots:{default:!0}}),m(s,y)};Z(x,s=>{p()==="details"?s(U):p()==="confirm"?s(j,1):s(L,-1)})}return m(M,$),ze(q)}function wn(M,l){if(new.target)return Re({component:wn,...M});je(l,!0);let p=i(l,"open",15,!1),g=i(l,"prefillHost",7,null),R=i(l,"prefillPort",7,null),w=i(l,"prefillLabel",7,null),T=i(l,"prefillAccent",7,void 0),F=i(l,"defaultAccent",7,ve),q=P(void 0),$=P("details"),x=P(!1),U=P(!1),j=P(null);function L(){p(!1)}var s={get open(){return p()},set open(r=!1){p(r),d()},get prefillHost(){return g()},set prefillHost(r=null){g(r),d()},get prefillPort(){return R()},set prefillPort(r=null){R(r),d()},get prefillLabel(){return w()},set prefillLabel(r=null){w(r),d()},get prefillAccent(){return T()},set prefillAccent(r=void 0){T(r),d()},get defaultAccent(){return F()},set defaultAccent(r=ve){F(r),d()},$set:Fe,$on:(r,k)=>Ue(l,r,k)},y=Be(),I=V(y);{var H=r=>{{const k=S=>{it(S,{get step(){return e($)},get busy(){return e(x)},get canContinue(){return e(U)},get form(){return e(q)},onDetailsSecondary:L})};let C=_(()=>n.modals_connect_title()),v=_(()=>n.modals_connect_close_ariaLabel());rn(r,{get title(){return e(C)},get closeLabel(){return e(v)},get busy(){return e(x)},get initialFocus(){return e(j)},onClose:L,dismissOnInteractOutside:!1,get open(){return p()},set open(S){p(S)},footer:k,children:(S,Me)=>{Xt(ct(S,{get active(){return p()},get prefillHost(){return g()},get prefillPort(){return R()},get prefillLabel(){return w()},get prefillAccent(){return T()},get defaultAccent(){return F()},onDone:L,get step(){return e($)},set step(A){a($,A,!0)},get busy(){return e(x)},set busy(A){a(x,A,!0)},get canContinue(){return e(U)},set canContinue(A){a(U,A,!0)},get firstInput(){return e(j)},set firstInput(A){a(j,A,!0)}}),A=>a(q,A,!0),()=>e(q))},$$slots:{footer:!0,default:!0}})}};Z(I,r=>{p()&&r(H)})}return m(M,y),ze(s)}export{it as C,ct as a,wn as b};
|
|
1
|
+
import{t as Re,br as i,a_ as Z,bp as n,bz as Fe,bv as Oe,bt as Wt,b as Ue}from"./CGWRZzdk.js";import{ai as Kt,bo as Vt,bs as je,bV as P,br as Qt,ca as _e,aD as e,bj as Gt,bH as a,c5 as nt,a5 as z,bl as N,bS as c,bA as O,b_ as D,bO as h,W as m,bn as ze,c9 as _,aA as d,ay as V,a7 as Be,aB as B,bf as rt,aj as Jt,be as X,b$ as Y}from"./DYhIMPy1.js";import{b as Xt}from"./BaIAhI85.js";import{u as at,n as Yt,j as Zt,l as lt,v as en,p as tn}from"./BjnZ1Xf3.js";import"./C-s9_soQ.js";import"./CzQCBVm9.js";import"./BEyWfhqM.js";import{f as K}from"./KJX0Kw6L.js";import"./ClTZNeVO.js";import{s as nn,c as rn}from"./HLKPZgVy.js";import{x as ve,Ix as W,hH as pe,sc as an,hK as st}from"./CicdOSYm.js";import{C as ln,b as sn,T as on,c as cn,S as dn}from"./wjBrDDKR.js";import{I as Ae}from"./B461Cu-8.js";import"./BRhVB6Sv.js";import"./fCEIPyv5.js";import"./gsElU_36.js";import"./ChTqQfQN.js";import"./BjcX_fOv.js";import{o as un}from"./DIP3ex32.js";import{ag as fn,aQ as _n,aH as pn,F as vn}from"./CvmMeam2.js";import{i as bn,p as gn}from"./DWiPdXwB.js";var mn=B('<span class="size-4 rounded-full border border-muted-foreground/60 bg-background" aria-hidden="true"></span>'),hn=B('<span aria-hidden="true"></span>'),xn=B('<p class="text-xs text-subtle"> </p> <p class="text-xs text-subtle"> <a class="text-primary-ink hover:underline">github.com/intent-hq/intentd</a> </p>',1),yn=B('<div class="space-y-1"><label class="text-xs text-subtle" for="connect-name"> </label> <!></div> <div class="flex min-w-0 items-end gap-4" data-connect-appearance=""><fieldset class="min-w-0 flex-1 space-y-1"><legend class="text-xs text-subtle"> </legend> <div class="flex flex-wrap gap-1"></div></fieldset> <!></div> <div class="space-y-1"><label class="text-xs text-subtle" for="connect-host"> </label> <!> <!></div> <div class="space-y-1"><label class="text-xs text-subtle" for="connect-port"> </label> <!></div> <div class="space-y-1"><label class="text-xs text-subtle" for="connect-token"> </label> <!></div> <!> <!> <!>',1),kn=B('<div class="space-y-1"><span class="text-xs text-subtle"> </span> <p class="font-mono text-xs break-all bg-muted/50 rounded p-2"> </p></div>'),Cn=B('<p class="text-xs text-danger" role="alert"> </p>'),An=B('<div class="space-y-4"><p class="text-sm text-subtle" role="status" aria-live="polite"> </p> <!> <!></div>');function ct(M,l){const p=Vt();if(new.target)return Re({component:ct,...M});je(l,!0);const g=()=>Oe(dt,"$workflow$",T),R=()=>Oe(pt,"$hostManagesConnections$",T),w=()=>Oe(_t,"$syncState$",T),[T,F]=Wt(),q=(t,o=rt)=>{{const b=(de,ue=rt)=>{{let J=_(()=>({...ue(),entry:o(),controlId:o().id}));dn(de,{get entry(){return o()},get context(){return e(J)}})}};let ne=_(()=>`${o().id}-field`);nn(t,{get id(){return e(ne)},get label(){return o().label},get description(){return o().description},get htmlFor(){return o().id},get disabled(){return e(ce)},get busy(){return e(ce)},compact:!0,class:"grid-cols-[minmax(0,1fr)_auto] items-start py-0 first:pt-0 last:pb-0 [&_[data-field-control]]:w-auto",control:b,$$slots:{control:!0}})}};let $=i(l,"active",7),x=i(l,"step",15,"details"),U=i(l,"busy",15,!1),j=i(l,"canContinue",15,!1),L=i(l,"firstInput",15,null),s=i(l,"prefillHost",7,null),y=i(l,"prefillPort",7,null),I=i(l,"prefillLabel",7,null),H=i(l,"prefillAccent",7,void 0),r=i(l,"defaultAccent",7,ve),k=i(l,"showHelp",7,!0),C=i(l,"onDone",7);const v="5181",S="https://github.com/intent-hq/intentd";function Me(t){t.preventDefault(),un(S)}let A=P(""),ee=P(Qt(ve)),se=P("auto"),E=P(""),Q=P(v),G=P(""),te=P(null),be=P(!0),oe=P(!0),ge=P("");const dt=fn(p),ce=_(()=>!!g()&&g().phase!=="settled");_e(()=>{U(e(ce))});const qe=_(()=>{const t=g()?.outcome;return t?.kind==="error"||t?.kind==="syncError"?t.message:t?.kind==="secretUnavailable"?n.modals_connect_secretUnavailable_error():t?.kind==="captureRejected"?t.statusCode===403?n.modals_connect_wsApiDisabled_error():n.modals_connect_tokenRejected_error():null});Gt(()=>W.dispatch(pe(p))),_e(()=>{const t=g()?.outcome;t?.kind==="captured"?(a(ge,t.fingerprint,!0),x("confirm"),W.dispatch(pe(p))):t?.kind==="done"&&nt(()=>{we(),C()()})});const ut=_(()=>cn(H()===void 0?r():H())),ft=typeof window<"u"&&window.electronAPI?.platform==="darwin",_t=_n(),pt=pn(),Se=_(()=>!R()&&(w()?.supported??ft)),vt=_(()=>w()?.enabled??!1),bt=_(()=>({kind:"switch",id:"connect-detect-hosts",label:n.modals_connect_detectHosts_label(),description:n.modals_connect_detectHosts_description(),get:()=>e(be),set:t=>{a(be,t,!0)}})),gt=_(()=>({kind:"switch",id:"connect-save-to-icloud",label:n.modals_connect_saveToICloud_label(),description:n.modals_connect_saveToICloud_description(),get:()=>e(oe),set:t=>{a(oe,t,!0)}})),ie=_(()=>Number(e(Q).trim())),We=_(()=>e(A).trim().length>0&&e(E).trim().length>0&&Number.isInteger(e(ie))&&e(ie)>0&&e(ie)<=65535&&e(G).trim().length>0&&!e(ce));_e(()=>{j(e(We))});function we(){x("details"),a(A,""),a(ee,r(),!0),a(se,"auto"),a(E,""),a(Q,v),a(G,""),a(te,null),a(be,!0),a(oe,!0),a(ge,""),W.dispatch(pe(p))}function mt(t){const o=t.clipboardData?.getData("text")??"";if(!bn(o))return;const b=gn(o);b&&(t.preventDefault(),b.hosts.length>0&&a(E,b.hosts[0],!0),b.port!==null&&a(Q,String(b.port),!0),b.token&&a(G,b.token,!0),a(te,b.tcAddress,!0))}function ht(){a(te,vn(e(E))?e(E).trim():null,!0)}function xt(){e(We)&&W.dispatch(st(p,{kind:"capture",params:{host:e(E).trim(),port:e(ie),token:e(G).trim()}}))}function yt(){if(e(Se)&&!e(vt)&&e(oe)){W.dispatch(pe(p)),x("syncConfirm");return}Ie(e(Se)&&!e(oe))}function Ie(t,o={}){const b=e(E).trim();W.dispatch(st(p,{kind:"connect",enableSync:o.enableSyncAfterAdd===!0,params:{label:e(A).trim(),accent:e(ee),deviceIcon:e(se),host:b,port:e(ie),fingerprint:e(ge),token:e(G).trim(),...e(te)?{tcAddress:e(te)}:{},detectHosts:e(be),...t?{syncExcluded:!0}:{}}}))}function kt(){Ie(!1,{enableSyncAfterAdd:!0})}function Ct(){Ie(!0)}function At(){x("details"),W.dispatch(pe(p))}const me="w-full px-3 py-2 bg-background border border-border rounded text-foreground text-sm focus:outline-none focus:border-primary-ink";function St(t){return t===null?n.settings_devices_accentNone_label():{blue:n.settings_devices_accentBlue_label(),indigo:n.settings_devices_accentIndigo_label(),violet:n.settings_devices_accentViolet_label(),rose:n.settings_devices_accentRose_label(),orange:n.settings_devices_accentOrange_label(),emerald:n.settings_devices_accentEmerald_label(),teal:n.settings_devices_accentTeal_label()}[t]}_e(()=>{if($()&&x()==="details"&&L()){const t=L();requestAnimationFrame(()=>t.focus())}});let He=!1;_e(()=>{const t=$()&&!He,o=!$()&&He;He=$(),o&&nt(we),t&&(I()&&e(A)===""&&a(A,I()),a(ee,H()===void 0?r():H(),!0),s()&&e(E)===""&&a(E,s()),y()!=null&&e(Q)===v&&a(Q,String(y()),!0),W.dispatch(an()))});var wt={reset:we,capture:xt,confirm:yt,enableSyncAndAdd:kt,declineSync:Ct,back:At,get active(){return $()},set active(t){$(t),d()},get step(){return x()},set step(t="details"){x(t),d()},get busy(){return U()},set busy(t=!1){U(t),d()},get canContinue(){return j()},set canContinue(t=!1){j(t),d()},get firstInput(){return L()},set firstInput(t=null){L(t),d()},get prefillHost(){return s()},set prefillHost(t=null){s(t),d()},get prefillPort(){return y()},set prefillPort(t=null){y(t),d()},get prefillLabel(){return I()},set prefillLabel(t=null){I(t),d()},get prefillAccent(){return H()},set prefillAccent(t=void 0){H(t),d()},get defaultAccent(){return r()},set defaultAccent(t=ve){r(t),d()},get showHelp(){return k()},set showHelp(t=!0){k(t),d()},get onDone(){return C()},set onDone(t){C(t),d()},$set:Fe,$on:(t,o)=>Ue(l,t,o)},he=An(),Ke=z(he),It=N(Ke,!0),Ve=c(Ke,2);{var Ht=t=>{var o=yn(),b=V(o),ne=z(b),de=N(ne,!0),ue=c(ne,2);{let u=_(()=>n.modals_connect_name_placeholder());Ae(ue,{id:"connect-name",type:"text",get placeholder(){return e(u)},class:me,autocomplete:"off",get ref(){return L()},set ref(f){L(f)},get value(){return e(A)},set value(f){a(A,f,!0)}})}O(b);var J=c(b,2),Pe=z(J),Qe=z(Pe),Tt=N(Qe,!0),Ge=c(Qe,2);Yt(Ge,21,()=>e(ut),tn,(u,f)=>{{let re=_(()=>lt("flex size-8 cursor-pointer items-center justify-center rounded-full border bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e(f)===e(ee)?"border-foreground shadow-[0_0_0_2px_var(--color-background),0_0_0_4px_var(--color-foreground)]":"border-border hover:border-input")),fe=_(()=>n.modals_connect_accentOption_ariaLabel({color:St(e(f))})),ae=_(()=>e(f)===e(ee));K(u,{type:"button",variant:"plain",get class(){return e(re)},get"aria-label"(){return e(fe)},get"aria-pressed"(){return e(ae)},onclick:()=>a(ee,e(f),!0),children:(xe,ye)=>{var ke=Be(),Te=V(ke);{var Ee=le=>{var Ce=mn();m(le,Ce)},Ne=le=>{var Ce=hn();D(qt=>en(Ce,1,qt),[()=>Zt(lt("size-4 rounded-full",ln[e(f)]))]),m(le,Ce)};Z(Te,le=>{e(f)===null?le(Ee):le(Ne,-1)})}m(xe,ke)},$$slots:{default:!0}})}}),O(Ge),O(Pe);var Et=c(Pe,2);{let u=_(()=>({deviceIcon:e(se)}));sn(Et,{get record(){return e(u)},portal:!0,contentClass:"z-[calc(var(--layer-modal)+1)]",get value(){return e(se)},set value(f){a(se,f,!0)}})}O(J);var $e=c(J,2),Je=z($e),Nt=N(Je,!0),Xe=c(Je,2);{let u=_(()=>n.modals_connect_host_placeholder());Ae(Xe,{id:"connect-host",type:"text",get placeholder(){return e(u)},class:me,autocorrect:"off",autocapitalize:"off",spellcheck:"false",onpaste:mt,oninput:ht,get value(){return e(E)},set value(f){a(E,f,!0)}})}var Ot=c(Xe,2);{let u=_(()=>e(te)!==null);on(Ot,{get relevant(){return e(u)}})}O($e);var De=c($e,2),Ye=z(De),Rt=N(Ye,!0),Ft=c(Ye,2);{let u=_(()=>n.modals_connect_port_placeholder());Ae(Ft,{id:"connect-port",type:"text",inputmode:"numeric",get placeholder(){return e(u)},class:me,autocorrect:"off",autocapitalize:"off",spellcheck:"false",get value(){return e(Q)},set value(f){a(Q,f,!0)}})}O(De);var Le=c(De,2),Ze=z(Le),Ut=N(Ze,!0),jt=c(Ze,2);{let u=_(()=>n.modals_connect_token_placeholder());Ae(jt,{id:"connect-token",type:"password",get placeholder(){return e(u)},class:me,autocorrect:"off",autocapitalize:"off",spellcheck:"false",get value(){return e(G)},set value(f){a(G,f,!0)}})}O(Le);var et=c(Le,2);q(et,()=>e(bt));var tt=c(et,2);{var zt=u=>{q(u,()=>e(gt))};Z(tt,u=>{e(Se)&&u(zt)})}var Bt=c(tt,2);{var Mt=u=>{var f=xn(),re=V(f),fe=N(re,!0),ae=c(re,2),xe=z(ae),ye=c(xe);at(ye,"href",S);var ke=c(ye);O(ae),D((Te,Ee,Ne)=>{h(fe,Te),h(xe,`${Ee??""} `),h(ke,` ${Ne??""}`)},[()=>n.modals_connect_whereToFind_help(),()=>n.modals_connect_headless_before(),()=>n.modals_connect_headless_after()]),Jt("click",ye,Me),m(u,f)};Z(Bt,u=>{k()&&u(Mt)})}D((u,f,re,fe,ae)=>{h(de,u),h(Tt,f),h(Nt,re),h(Rt,fe),h(Ut,ae)},[()=>n.modals_connect_name_label(),()=>n.settings_devices_accent_label(),()=>n.modals_connect_host_label(),()=>n.modals_connect_port_label(),()=>n.modals_connect_token_label()]),m(t,o)},Pt=t=>{var o=kn(),b=z(o),ne=N(b,!0),de=c(b,2),ue=N(de,!0);O(o),D(J=>{h(ne,J),h(ue,e(ge))},[()=>n.modals_connect_fingerprint_label()]),m(t,o)};Z(Ve,t=>{x()==="details"?t(Ht):x()==="confirm"&&t(Pt,1)})}var $t=c(Ve,2);{var Dt=t=>{var o=Cn(),b=N(o,!0);D(()=>h(b,e(qe))),m(t,o)};Z($t,t=>{e(qe)&&t(Dt)})}O(he),D(t=>{at(he,"aria-busy",e(ce)),h(It,t)},[()=>x()==="details"?n.modals_connect_details_description():x()==="confirm"?n.modals_connect_confirmStep_description():n.modals_connect_enableSync_description()]),m(M,he);var Lt=ze(wt);return F(),Lt}Kt(["click"]);var ot=B("<!> <!>",1),Sn=B("<!> <!> <!>",1);function it(M,l){if(new.target)return Re({component:it,...M});je(l,!0);let p=i(l,"step",7),g=i(l,"busy",7),R=i(l,"canContinue",7),w=i(l,"form",7),T=i(l,"detailsSecondaryLabel",23,()=>n.modals_connect_cancel_label()),F=i(l,"onDetailsSecondary",7);var q={get step(){return p()},set step(s){p(s),d()},get busy(){return g()},set busy(s){g(s),d()},get canContinue(){return R()},set canContinue(s){R(s),d()},get form(){return w()},set form(s){w(s),d()},get detailsSecondaryLabel(){return T()},set detailsSecondaryLabel(s=n.modals_connect_cancel_label()){T(s),d()},get onDetailsSecondary(){return F()},set onDetailsSecondary(s){F(s),d()},$set:Fe,$on:(s,y)=>Ue(l,s,y)},$=Be(),x=V($);{var U=s=>{var y=ot(),I=V(y);K(I,{variant:"ghost",get disabled(){return g()},get onclick(){return F()},children:(r,k)=>{X();var C=Y();D(()=>h(C,T())),m(r,C)},$$slots:{default:!0}});var H=c(I,2);{let r=_(()=>!R());K(H,{variant:"secondary",onclick:()=>w()?.capture(),get disabled(){return e(r)},children:(k,C)=>{X();var v=Y();D(S=>h(v,S),[()=>g()?n.modals_connect_connecting_label():n.modals_connect_continue_label()]),m(k,v)},$$slots:{default:!0}})}m(s,y)},j=s=>{var y=ot(),I=V(y);K(I,{variant:"ghost",onclick:()=>w()?.back(),get disabled(){return g()},children:(r,k)=>{X();var C=Y();D(v=>h(C,v),[()=>n.modals_connect_back_label()]),m(r,C)},$$slots:{default:!0}});var H=c(I,2);K(H,{variant:"secondary",onclick:()=>w()?.confirm(),get disabled(){return g()},children:(r,k)=>{X();var C=Y();D(v=>h(C,v),[()=>g()?n.modals_connect_connecting_label():n.modals_connect_confirm_label()]),m(r,C)},$$slots:{default:!0}}),m(s,y)},L=s=>{var y=Sn(),I=V(y);K(I,{variant:"ghost",onclick:()=>w()?.back(),get disabled(){return g()},children:(k,C)=>{X();var v=Y();D(S=>h(v,S),[()=>n.modals_connect_back_label()]),m(k,v)},$$slots:{default:!0}});var H=c(I,2);K(H,{variant:"ghost",onclick:()=>w()?.declineSync(),get disabled(){return g()},children:(k,C)=>{X();var v=Y();D(S=>h(v,S),[()=>n.modals_connect_enableSync_decline_label()]),m(k,v)},$$slots:{default:!0}});var r=c(H,2);K(r,{variant:"secondary",onclick:()=>w()?.enableSyncAndAdd(),get disabled(){return g()},children:(k,C)=>{X();var v=Y();D(S=>h(v,S),[()=>g()?n.modals_connect_connecting_label():n.modals_connect_enableSync_confirm_label()]),m(k,v)},$$slots:{default:!0}}),m(s,y)};Z(x,s=>{p()==="details"?s(U):p()==="confirm"?s(j,1):s(L,-1)})}return m(M,$),ze(q)}function wn(M,l){if(new.target)return Re({component:wn,...M});je(l,!0);let p=i(l,"open",15,!1),g=i(l,"prefillHost",7,null),R=i(l,"prefillPort",7,null),w=i(l,"prefillLabel",7,null),T=i(l,"prefillAccent",7,void 0),F=i(l,"defaultAccent",7,ve),q=P(void 0),$=P("details"),x=P(!1),U=P(!1),j=P(null);function L(){p(!1)}var s={get open(){return p()},set open(r=!1){p(r),d()},get prefillHost(){return g()},set prefillHost(r=null){g(r),d()},get prefillPort(){return R()},set prefillPort(r=null){R(r),d()},get prefillLabel(){return w()},set prefillLabel(r=null){w(r),d()},get prefillAccent(){return T()},set prefillAccent(r=void 0){T(r),d()},get defaultAccent(){return F()},set defaultAccent(r=ve){F(r),d()},$set:Fe,$on:(r,k)=>Ue(l,r,k)},y=Be(),I=V(y);{var H=r=>{{const k=S=>{it(S,{get step(){return e($)},get busy(){return e(x)},get canContinue(){return e(U)},get form(){return e(q)},onDetailsSecondary:L})};let C=_(()=>n.modals_connect_title()),v=_(()=>n.modals_connect_close_ariaLabel());rn(r,{get title(){return e(C)},get closeLabel(){return e(v)},get busy(){return e(x)},get initialFocus(){return e(j)},onClose:L,dismissOnInteractOutside:!1,get open(){return p()},set open(S){p(S)},footer:k,children:(S,Me)=>{Xt(ct(S,{get active(){return p()},get prefillHost(){return g()},get prefillPort(){return R()},get prefillLabel(){return w()},get prefillAccent(){return T()},get defaultAccent(){return F()},onDone:L,get step(){return e($)},set step(A){a($,A,!0)},get busy(){return e(x)},set busy(A){a(x,A,!0)},get canContinue(){return e(U)},set canContinue(A){a(U,A,!0)},get firstInput(){return e(j)},set firstInput(A){a(j,A,!0)}}),A=>a(q,A,!0),()=>e(q))},$$slots:{footer:!0,default:!0}})}};Z(I,r=>{p()&&r(H)})}return m(M,y),ze(s)}export{it as C,ct as a,wn as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as q,br as n,a_ as g,bz as D,bs as E,b as F}from"./CGWRZzdk.js";import{bs as G,a5 as s,bS as p,bA as i,W as o,bn as I,aA as d,aB as v}from"./DYhIMPy1.js";import{s as c}from"./BEyWfhqM.js";import{i as J,l as K}from"./
|
|
1
|
+
import{t as q,br as n,a_ as g,bz as D,bs as E,b as F}from"./CGWRZzdk.js";import{bs as G,a5 as s,bS as p,bA as i,W as o,bn as I,aA as d,aB as v}from"./DYhIMPy1.js";import{s as c}from"./BEyWfhqM.js";import{i as J,l as K}from"./BjnZ1Xf3.js";var L=new Set(["$$slots","$$events","$$legacy","title","description","counter","leading","actions","class"]),M=v('<div class="flex shrink-0 items-center"><!></div>'),O=v('<div data-slot="screen-header-counter" class="type-caption mb-1 text-muted-foreground"><!></div>'),Q=v('<div data-slot="screen-header-description" class="mt-1 text-sm text-muted-foreground"><!></div>'),R=v('<div data-slot="screen-header-actions" class="flex shrink-0 items-center gap-1"><!></div>'),T=v('<header><!> <div class="min-w-0 flex-1"><!> <div data-slot="screen-header-title" class="min-w-0"><!></div> <!></div> <!></header>');function U(y,a){if(new.target)return q({component:U,...y});G(a,!0);let h=n(a,"title",7),l=n(a,"description",7),_=n(a,"counter",7),u=n(a,"leading",7),m=n(a,"actions",7),b=n(a,"class",7),A=E(a,L);var C={get title(){return h()},set title(e){h(e),d()},get description(){return l()},set description(e){l(e),d()},get counter(){return _()},set counter(e){_(e),d()},get leading(){return u()},set leading(e){u(e),d()},get actions(){return m()},set actions(e){m(e),d()},get class(){return b()},set class(e){b(e),d()},$set:D,$on:(e,t)=>F(a,e,t)},f=T();J(f,e=>({"data-slot":"screen-header",class:e,...A}),[()=>K("flex min-w-0 shrink-0 items-start gap-3 px-5 pt-5",b())]);var S=s(f);{var z=e=>{var t=M(),r=s(t);c(r,u),i(t),o(e,t)};g(S,e=>{u()&&e(z)})}var x=p(S,2),k=s(x);{var B=e=>{var t=O(),r=s(t);c(r,_),i(t),o(e,t)};g(k,e=>{_()&&e(B)})}var w=p(k,2),H=s(w);c(H,h),i(w);var N=p(w,2);{var P=e=>{var t=Q(),r=s(t);c(r,l),i(t),o(e,t)};g(N,e=>{l()&&e(P)})}i(x);var W=p(x,2);{var j=e=>{var t=R(),r=s(t);c(r,m),i(t),o(e,t)};g(W,e=>{m()&&e(j)})}return i(f),o(y,f),I(C)}export{U as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as o,X as ot,aH as ut,aX as dt,i as yt,r as ft,z as pt,b0 as it,V as gt,a_ as kt,U as mt,aZ as wt,Y as _t,B as bt}from"./
|
|
1
|
+
import{b as o,X as ot,aH as ut,aX as dt,i as yt,r as ft,z as pt,b0 as it,V as gt,a_ as kt,U as mt,aZ as wt,Y as _t,B as bt}from"./B1ywot0G.js";var J=(function(){var e=o(function(T,t,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],u=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,c,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(n[w-1].length,n[w].trim());break;case 16:c.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(u,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],c=[],p=[null],n=[],v=this.table,w="",I=0,$=0,L=2,A=1,V=n.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(S.yy[B]=this.yy[B]);b.setInput(t,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;n.push(R);var U=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Y(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(Y,"popStack");function tt(){var P;return P=c.pop()||b.lex()||A,typeof P!="number"&&(P instanceof Array&&(c=P,P=c.pop()),P=s.symbols_[P]||P),P}o(tt,"lex");for(var M,W,N,K,z={},G,C,et,X;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=tt()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var q="";X=[];for(G in v[W])this.terminals_[G]&&G>L&&X.push("'"+this.terminals_[G]+"'");b.showPosition?q="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
3
|
Expecting `+X.join(", ")+", got '"+(this.terminals_[M]||M)+"'":q="Parse error on line "+(I+1)+": Unexpected "+(M==A?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(q,{text:b.match,token:this.terminals_[M]||M,line:b.yylineno,loc:R,expected:X})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(N[0]){case 1:i.push(M),p.push(b.yytext),n.push(b.yylloc),i.push(N[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(C=this.productions_[N[1]][1],z.$=p[p.length-C],z._$={first_line:n[n.length-(C||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(C||1)].first_column,last_column:n[n.length-1].last_column},U&&(z._$.range=[n[n.length-(C||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(z,[w,$,I,S.yy,N[1],p,n].concat(V)),typeof K<"u")return K;C&&(i=i.slice(0,-1*C*2),p=p.slice(0,-1*C),n=n.slice(0,-1*C)),i.push(this.productions_[N[1]][0]),p.push(z.$),n.push(z._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var T={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,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:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var c=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),i.length-1&&(this.yylineno-=i.length-1);var p=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:i?(i.length===c.length?this.yylloc.first_column:0)+c[c.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as le,br as u,a_ as D,bz as ce,b as ve}from"./CGWRZzdk.js";import{bs as de,ca as fe,aD as e,a5 as H,bS as ue,bA as L,bH as K,b_ as S,W as T,bn as ge,bV as P,c9 as x,aA as g,a7 as me,ay as he,bl as pe,bO as be,aB as z}from"./DYhIMPy1.js";import{v as X,u as c,n as _e,w as R}from"./
|
|
1
|
+
import{t as le,br as u,a_ as D,bz as ce,b as ve}from"./CGWRZzdk.js";import{bs as de,ca as fe,aD as e,a5 as H,bS as ue,bA as L,bH as K,b_ as S,W as T,bn as ge,bV as P,c9 as x,aA as g,a7 as me,ay as he,bl as pe,bO as be,aB as z}from"./DYhIMPy1.js";import{v as X,u as c,n as _e,w as R}from"./BjnZ1Xf3.js";import{s as ke}from"./BEyWfhqM.js";import{b as we}from"./BaIAhI85.js";import{t as j}from"./BM1KP-FJ.js";import{A as xe}from"./b-gQtgOb.js";import{s as We}from"./MgErAKgQ.js";function Ie(W){const{itemCount:a,maxVisible:v,availableWidth:r,surface:s,overlap:b,overflowOverlap:d}=W;if(r<=0)return 0;const _=s-b,m=Math.min(a,Math.max(0,v)),y=i=>i===0?0:s+(i-1)*_;if(a<=m&&y(a)<=r)return a;for(let i=m;i>=0;i-=1){const A=a-i;if(y(i)+(A>0?W.measureOverflowText(A)-(i>0?d:0):0)<=r)return i}return 0}function ye(W,a=r=>requestAnimationFrame(r),v=r=>cancelAnimationFrame(r)){let r,s;return{set(b){if(r=b,s!==void 0)return;let d=!1;const _=a(()=>{d=!0,s=void 0;const m=r;r=void 0,W(m)});d||(s=_)},cancel(){s!==void 0&&(v(s),s=void 0),r=void 0}}}const Ae=20,Ce=12;let O,J;const Q=new Map;var Te=z('<span data-agent-avatar-stack-item=""><!></span>'),Oe=z('<span class="agent-avatar-stack-track svelte-1nk9fhe"></span>'),Ve=z('<span class="agent-avatar-stack-overflow svelte-1nk9fhe" data-agent-avatar-overflow=""> </span>'),Me=z('<span data-agent-avatar-stack="" data-agent-avatar-stack-overlap="later-on-top"><!> <!></span>');function Se(W,a){if(new.target)return le({component:Se,...W});de(a,!0);let v=u(a,"items",7),r=u(a,"maxVisible",7,3),s=u(a,"adaptive",7,!1),b=u(a,"align",7,"end"),d=u(a,"variant",7,"card-stack"),_=u(a,"interactive",7,!1),m=u(a,"overflowId",7),y=u(a,"overflowTestId",7),i=u(a,"itemContent",7),A=u(a,"class",7,""),I=P(void 0),F=P(void 0);const h=x(()=>We[d()]),U=x(()=>s()&&e(F)!==void 0?Ie({itemCount:v().length,maxVisible:r(),availableWidth:e(F),surface:e(h).surface,overlap:e(h).overlap,overflowOverlap:e(h).overlap,measureOverflowText:t=>Math.max(e(h).surface,$(t)+Ce)}):void 0),Y=x(()=>Math.min(v().length,Math.max(0,s()?e(U)??r():r()))),k=x(()=>v().slice(0,e(Y))),E=x(()=>Math.max(0,v().length-e(k).length)),N=x(()=>e(h).surface-e(h).overlap),Z=x(()=>e(k).length===0?0:e(h).surface+(e(k).length-1)*e(N));function $(t){const n=`+${j(t)}`,o=Q.get(n);if(o!==void 0)return o;if(O===void 0&&(O=document.createElement("canvas").getContext("2d")),!O||!e(I))return Ae;J??=`500 12px ${getComputedStyle(e(I)).fontFamily}`,O.font=J;const l=O.measureText(n).width;return Q.set(n,l),l}fe(()=>{if(!s()||!e(I)||typeof ResizeObserver>"u")return;const t=ye(o=>{K(F,o,!0)}),n=new ResizeObserver(o=>{const l=o[o.length-1];t.set(l.borderBoxSize?.[0]?.inlineSize??l.contentRect.width)});return n.observe(e(I)),()=>{n.disconnect(),t.cancel()}});var ee={get items(){return v()},set items(t){v(t),g()},get maxVisible(){return r()},set maxVisible(t=3){r(t),g()},get adaptive(){return s()},set adaptive(t=!1){s(t),g()},get align(){return b()},set align(t="end"){b(t),g()},get variant(){return d()},set variant(t="card-stack"){d(t),g()},get interactive(){return _()},set interactive(t=!1){_(t),g()},get overflowId(){return m()},set overflowId(t){m(t),g()},get overflowTestId(){return y()},set overflowTestId(t){y(t),g()},get itemContent(){return i()},set itemContent(t){i(t),g()},get class(){return A()},set class(t=""){A(t),g()},$set:ce,$on:(t,n)=>ve(a,t,n)},p=Me();let q;var B=H(p);{var te=t=>{var n=Oe();let o;_e(n,23,()=>e(k),l=>l.key,(l,w,V)=>{var f=Te();let G;var re=H(f);{var se=C=>{var M=me(),oe=he(M);ke(oe,i,()=>e(w)),T(C,M)},ie=C=>{{let M=x(()=>e(w).state??"idle");xe(C,{get agentId(){return e(w).agentId},get specialist(){return e(w).specialist},get icon(){return e(w).icon},get state(){return e(M)},get variant(){return d()},class:"agent-avatar-stack-surface"})}};D(re,C=>{i()?C(se):C(ie,-1)})}L(f),S(()=>{G=X(f,1,"agent-avatar-stack-item svelte-1nk9fhe",null,G,{"agent-avatar-stack-item--before-overflow":e(E)>0&&e(V)===e(k).length-1}),R(f,`inset-inline-start: ${e(V)*e(N)}px; z-index: ${e(V)+1};`),c(f,"data-agent-avatar-stack-index",e(V)),c(f,"data-agent-avatar-stack-key",e(w).key),c(f,"data-agent-avatar-stack-agent-id",e(w).agentId),c(f,"data-agent-avatar-stack-specialist",e(w).specialist??void 0),c(f,"aria-hidden",_()?void 0:"true")}),T(l,f)}),L(n),S(()=>o=R(n,"",o,{width:`${e(Z)}px`})),T(t,n)};D(B,t=>{e(k).length>0&&t(te)})}var ae=ue(B,2);{var ne=t=>{var n=Ve(),o=pe(n);S(l=>{c(n,"id",m()),R(n,`margin-inline-start: ${e(k).length>0?-e(h).overlap:0}px; z-index: ${e(k).length+1};`),c(n,"data-testid",y()),be(o,`+${l??""}`)},[()=>j(e(E))]),T(t,n)};D(ae,t=>{e(E)>0&&t(ne)})}return L(p),we(p,t=>K(I,t),()=>e(I)),S(()=>{q=X(p,1,`agent-avatar-stack ${A()??""}`,"svelte-1nk9fhe",q,{"agent-avatar-stack--adaptive":s(),"agent-avatar-stack--start":b()==="start"}),c(p,"data-agent-avatar-stack-align",b()),c(p,"data-avatar-variant",d()),c(p,"data-agent-avatar-stack-clear-space",e(h).ring),c(p,"aria-hidden",!_()&&!m()?"true":void 0)}),T(W,p),ge(ee)}export{Se as A};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Ix as g,rn as b,Ia as S}from"./
|
|
1
|
+
import{Ix as g,rn as b,Ia as S}from"./CicdOSYm.js";import{V as A,bk as _}from"./CvmMeam2.js";import{bv as k}from"./C0g2TqGQ.js";import{bM as y,bI as w}from"./5a7lyWYQ.js";import{bp as n}from"./CGWRZzdk.js";import{t as I}from"./BM1KP-FJ.js";const z=g.createSelector(e=>e.backgroundAgentSettings.defaultModel),B=g.createSelector(e=>e.backgroundAgentSettings.typeOverrides),G=g.createSelector(e=>e.backgroundAgentSettings.defaultReasoningEffort),W=g.createSelector(e=>e.backgroundAgentSettings.typeReasoningEffortOverrides),j=g.createSelector(e=>e.backgroundAgentSettings);function r(e){return{category:"settings",...e}}const f=[{id:"new-workspace",tab:"",label:"New workspace",route:"/workspace/new",category:"navigation",description:"Create-workspace flow."},r({id:"utility-default-model",tab:"providers",hashAliases:["utility-default-model","default-model","quickActions.defaultModel","backgroundAgents.defaultModel"],scrollSelector:"#utility-default-model",highlightSelector:'[data-highlight-id="utility-default-model"]',label:"Settings: Default model",route:"/settings?tab=providers#utility-default-model",description:"Default AI behavior model selection."}),r({id:"global-instructions",tab:"agent-behavior",hashAliases:["global-instructions","agents","specialists","all-agents"],scrollSelector:"#global-instructions",highlightSelector:'[data-highlight-id="global-instructions"]',label:"Settings: Agent Behavior",route:"/settings?tab=agent-behavior#global-instructions",description:"Global agent instructions and defaults."}),r({id:"create-specialist",tab:"specialists",hashAliases:["create-specialist"],scrollSelector:"#create-specialist",highlightSelector:'[data-highlight-id="create-specialist"]',label:"Settings: Create specialist",route:"/settings?tab=specialists&view=create-specialist#create-specialist",description:"Create-specialist entry point."}),r({id:"providers",tab:"providers",hashAliases:["providers"],scrollSelector:"#providers",highlightSelector:'[data-highlight-id="providers"]',label:"Settings: AI coding CLIs",route:"/settings?tab=providers#providers",description:"Provider/account selector settings."}),r({id:"integrations",tab:"connections",hashAliases:["integrations"],scrollSelector:"#integrations",highlightSelector:'[data-highlight-id="integrations"]',label:"Settings: Connections",route:"/settings?tab=connections#integrations",description:"Connected integrations settings."}),r({id:"devices",tab:"devices",hashAliases:["devices","machines"],scrollSelector:"#devices",highlightSelector:"#devices",label:"Settings: Machines",route:"/settings?tab=devices#devices",description:"Saved remote machine settings."}),r({id:"mobile",tab:"mobile",hashAliases:["mobile"],scrollSelector:"#mobile",highlightSelector:'[data-highlight-id="mobile"]',label:"Settings: Mobile",route:"/settings?tab=mobile#mobile",description:"Remote access and Intent Mobile pairing."}),r({id:"guest-sessions",tab:"collaboration",hashAliases:["collaboration","guest-sessions","sharing"],scrollSelector:"#collaboration",highlightSelector:"#collaboration",label:"Settings: Collaboration",route:"/settings?tab=collaboration#collaboration",description:"Host membership, workspace guests and joined hosts."}),r({id:"websocket-api",tab:"mobile",hashAliases:["websocket-api","remote-access"],scrollSelector:"#websocket-api",highlightSelector:'[data-highlight-id="websocket-api"]',label:"Settings: Remote Access",route:"/settings?tab=mobile#websocket-api",description:"Remote access (WebSocket API) settings."}),...[["voice","Voice Dictation","Voice dictation settings.","input"],["keyboard-shortcuts","Keyboard Shortcuts","Keyboard shortcuts reference.","input"],["mcp-servers","MCP Servers","MCP server configuration.","connections"],["plugins","Plugins","App-wide Agent Plugins.","connections"],["git-workspace","Git & Workspace","Git and workspace defaults.","setup"],["git","Git","Git defaults.","setup"],["shell","Shell","Shell and CLI optimization settings.","setup"],["workspace","Workspace","Workspace defaults.","setup"],["cli-optimization","CLI Optimization","RTK/CLI optimization settings.","setup"],["workspace-api","Tool Output & Retention","Tool output size and retention settings.","advanced"],["notifications","Notifications","Notification preferences.","app-behavior"],["updates","Updates","Application update preferences.","app-behavior"],["open-in","Open In","External editor/app launch preferences.","app-behavior"],["github-link-action","GitHub Links","GitHub issue and pull request link behavior.","app-behavior"],["agent-features","Agent Features","Agent feature settings.","agent-behavior"],["font-style","Font style","Font style settings.","display"],["language","Language","Application language settings.","display"],["labs","Labs","Experimental feature switches.","advanced"],["agent-backend","Agent Backend","Agent backend settings.","advanced"],["connection","Connection","Daemon connection details.","advanced"],["hardware","Hardware","Hardware integration settings.","advanced"],["developer","Developer","Development-only settings.","advanced"]].map(([e,t,i,a])=>r({id:e,tab:a,hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=${a}#${e}`,description:i})),r({id:"appearance",tab:"display",hashAliases:["appearance","theme"],scrollSelector:"#theme",highlightSelector:'[data-highlight-id="appearance"]',label:"Settings: Appearance",route:"/settings?tab=display#theme",description:"Theme mode controls."}),...[["color-theme","Color theme","Color theme selection."],["note-font","Notes font","Notes/spec font style."],["agent-chat-font","Agent chat font","Agent chat font style."],["code-font","Code font","Code editor and diff font."]].map(([e,t,i])=>r({id:e,tab:"display",hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=display#${e}`,description:i})),r({id:"general",tab:"advanced",hashAliases:["general","reset"],scrollSelector:"#reset",highlightSelector:'[data-highlight-id="general"]',label:"Settings: Advanced",route:"/settings?tab=advanced#reset",description:"Advanced settings and reset controls."}),{id:"workspace-card",tab:"",hashAliases:["workspace-card"],highlightSelector:'[data-highlight-id^="workspace-"]',label:"Workspace card",category:"workspace",description:"A workspace card on workspace list surfaces.",dynamic:!0,idPattern:"workspace-{workspaceId}"},{id:"specialist-entry",tab:"specialists",highlightSelector:'[data-highlight-id^="specialist-"]',label:"Specialist entry",route:"/settings?tab=specialists&specialist={specialistId}#specialist-{specialistId}",category:"specialist",description:"A specific specialist row in settings.",dynamic:!0,idPattern:"specialist-{specialistId}"}];function m(e){const t=e.indexOf("#"),i=t>=0?e.slice(t+1):e;return decodeURIComponent(i.replace(/^#/,"")).trim()}function P(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(e,t){if(!t.match(/\{[^}]+\}/g)?.length)return e===t;const a=t.split(/\{[^}]+\}/g).map(P).join("[^/]+");return new RegExp(`^${a}$`).test(e)}function R(e){const t=m(e);if(!t)return;const i=f.find(o=>o.id===t||o.hashAliases?.includes(t));if(i)return i;const a=f.find(o=>o.route&&o.dynamic&&o.idPattern&&M(t,o.idPattern));return a?{...a,id:t}:void 0}function T(e){try{return new URL(e,"app://intent").pathname||"/"}catch{const t=e.indexOf("?"),i=e.indexOf("#");let a=e.length;return t>=0&&(a=Math.min(a,t)),i>=0&&(a=Math.min(a,i)),e.slice(0,a)||"/"}}const E=new Set(f.flatMap(e=>e.route?[T(e.route)]:[])),C=[/^\/workspace\/[^/]+$/,/^\/agent\/[^/]+$/];function F(e){if(typeof e!="string")return!1;const t=e.trim();if(!t)return!1;if(t.startsWith("intent://"))return!0;let i,a;try{const o=new URL(t,"app://intent");if(o.protocol!=="app:")return!1;i=o.pathname||"/",a=m(o.hash)}catch{return!1}return E.has(i)?a?!!R(a):!0:C.some(o=>o.test(i))}const U=g.createSelector(e=>{const t=new Map,i=(s,c)=>{const d=t.get(s)??new Set;d.add(c),t.set(s,d)},a=k.select(e),o=A.select(e),h=_.select(e)[o];h&&o&&i(o,n.settings_providers_inUseDefaultModel_label({model:h})),b(o)&&!h&&i(o,n.settings_providers_inUseDefaultProvider_label());const u=e.backgroundAgentSettings?.providerId;u&&b(u)&&i(u,n.settings_providers_inUseQuickActions_label());for(const s of y.select(e)){const c=w.select(e,s.id),d=s.source?{project:n.settings_providers_pinSourceProject_label(),user:n.settings_providers_pinSourceUser_label(),bundled:n.settings_providers_pinSourceBundled_label(),builtin:n.settings_providers_pinSourceBuiltin_label(),"electron-store":n.settings_providers_pinSourceLegacy_label()}[s.source]:void 0,p=l=>d&&c?n.settings_providers_inUseSourcePath_label({reason:l,source:d,path:c}):d?n.settings_providers_inUseSource_label({reason:l,source:d}):c?n.settings_providers_inUsePath_label({reason:l,path:c}):l;if(s.codingAgent&&i(s.codingAgent,p(n.settings_providers_inUseSpecialistAgent_label({name:s.name}))),s.modelOptions?.forEach((l,v)=>{l.provider&&b(l.provider)&&i(l.provider,p(n.settings_providers_inUseSpecialistModelOption_label({name:s.name,position:I(v+1)})))}),s.defaultModel)if(s.defaultModel.includes(":")){const l=S(s.defaultModel).providerId??a;i(l,p(n.settings_providers_inUseSpecialistModel_label({name:s.name,model:s.defaultModel})))}else s.codingAgent||i(a,p(n.settings_providers_inUseSpecialistModel_label({name:s.name,model:s.defaultModel})))}return Object.fromEntries([...t].map(([s,c])=>[s,[...c].join(`
|
|
2
2
|
`)]))});g.createSelector((e,t)=>U.select(e)[t]??null);const O=[{id:"dracula",label:"Dracula"},{id:"nord",label:"Nord"},{id:"rose-pine",label:"Rosé Pine"},{id:"tokyo-night",label:"Tokyo Night"},{id:"solarized",label:"Solarized"},{id:"github",label:"GitHub"},{id:"high-contrast",label:"High Contrast"}],q=O.map(({id:e})=>e);export{q as T,O as a,G as b,j as c,B as d,W as e,U as f,F as i,R as r,z as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as O,br as m,a_ as y,bz as R,b as T,bp as C}from"./CGWRZzdk.js";import{bs as U,a7 as Y,ay as q,W as s,bn as J,aA as v,be as p,b$ as f,b_ as u,bO as d,a5 as z,bA as L,bS as Q,aD as V,aB as A,c9 as X,aG as Z,bI as tt}from"./DYhIMPy1.js";import{E as P}from"./
|
|
1
|
+
import{t as O,br as m,a_ as y,bz as R,b as T,bp as C}from"./CGWRZzdk.js";import{bs as U,a7 as Y,ay as q,W as s,bn as J,aA as v,be as p,b$ as f,b_ as u,bO as d,a5 as z,bA as L,bS as Q,aD as V,aB as A,c9 as X,aG as Z,bI as tt}from"./DYhIMPy1.js";import{E as P}from"./HLKPZgVy.js";import{I as et}from"./BjnZ1Xf3.js";import"./BRhVB6Sv.js";import{f as S}from"./KJX0Kw6L.js";import{F as at,$ as ot,bL as st}from"./By0eqGj-.js";import"./BEyWfhqM.js";import{e as nt,b as rt}from"./DuG2OZjB.js";var it=A('<span aria-hidden="true"><!></span>'),lt=A('<div class="flex flex-wrap justify-center gap-2"><!> <!></div>');function ct(g,n){if(new.target)return O({component:ct,...g});U(n,!0);let o=m(n,"view",7),b=m(n,"canMove",7,!1),w=m(n,"waiting",7,!1),h=m(n,"onWait",7),x=m(n,"onMove",7);var E={get view(){return o()},set view(t){o(t),v()},get canMove(){return b()},set canMove(t=!1){b(t),v()},get waiting(){return w()},set waiting(t=!1){w(t),v()},get onWait(){return h()},set onWait(t){h(t),v()},get onMove(){return x()},set onMove(t){x(t),v()},$set:R,$on:(t,k)=>T(n,t,k)},H=Y(),I=q(H);{var B=t=>{P(t,{class:"h-full min-h-0",density:"compact","data-workspace-home-panel-notice":"starting",icon:_=>{var r=it(),e=z(r);et(e,{size:16}),L(r),s(_,r)},title:_=>{p();var r=f();u(e=>d(r,e),[()=>C.workspaceHome_starting_label()]),s(_,r)},$$slots:{icon:!0,title:!0}})},F=t=>{P(t,{class:"h-full",get"data-workspace-home-panel-notice"(){return o().state},icon:e=>{{let a=X(()=>o().state==="moving"?ot:st);at(e,{get icon(){return V(a)},class:"size-5"})}},title:e=>{p();var a=f();u(l=>d(a,l),[()=>rt(o().state==="moving"?"moving":"detached")]),s(e,a)},description:e=>{p();var a=f();u(l=>d(a,l),[()=>nt(o())]),s(e,a)},actions:e=>{var a=lt(),l=z(a);{var D=i=>{S(i,{variant:"outline",size:"sm",get disabled(){return w()},onclick:()=>h()?.(),children:(M,N)=>{p();var c=f();u(W=>d(c,W),[()=>C.workspaceHome_wait_label()]),s(M,c)},$$slots:{default:!0}})};y(l,i=>{o().canWait&&i(D)})}var G=Q(l,2);{var K=i=>{S(i,{variant:"outline",size:"sm",onclick:()=>x()?.(),children:(M,N)=>{p();var c=f();u(W=>d(c,W),[()=>C.workspaceHome_move_label()]),s(M,c)},$$slots:{default:!0}})};y(G,i=>{b()&&i(K)})}L(a),s(e,a)},$$slots:{icon:!0,title:!0,description:!0,actions:!0}})};y(I,t=>{o().starting?t(B):t(F,-1)})}return s(g,H),J(E)}const $=Symbol("workspace-home-panel");function wt(g){tt($,g)}function ht(){return Z($)}export{ct as W,ht as g,wt as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as mt,br as w,a_ as D,bz as dt,bt as ut,b as ft,bv as _,bp as T}from"./CGWRZzdk.js";import{bs as gt,ca as A,aD as e,bj as vt,a7 as b,ay as m,W as d,bn as _t,c9 as c,cd as O,aA as k,bS as bt,aB as $t}from"./DYhIMPy1.js";import{G as j}from"./
|
|
1
|
+
import{t as mt,br as w,a_ as D,bz as dt,bt as ut,b as ft,bv as _,bp as T}from"./CGWRZzdk.js";import{bs as gt,ca as A,aD as e,bj as vt,a7 as b,ay as m,W as d,bn as _t,c9 as c,cd as O,aA as k,bS as bt,aB as $t}from"./DYhIMPy1.js";import{G as j}from"./DHP1DFPI.js";import{c as z}from"./nmrokYzj.js";import{as as It,cN as St}from"./By0eqGj-.js";import{dl as ht,dK as wt}from"./C0g2TqGQ.js";import{S as kt,c as Ct}from"./DrtMUjoh.js";import{selectScriptById as xt,selectCanDeleteScript as yt}from"./DQR5oUDY.js";import"./BjnZ1Xf3.js";import"./BEyWfhqM.js";import"./KJX0Kw6L.js";import"./fCEIPyv5.js";import{M as G}from"./DIumxlqP.js";import{g as Dt}from"./DfN8_dcw.js";import{T as Tt}from"./blPVVvA0.js";import{l as At,d as Bt}from"./DuG2OZjB.js";import{Ix as B,CC as Vt,uS as Wt,gK as Rt}from"./CicdOSYm.js";var Ht=$t("<!> <!>",1);function Kt(V,i){if(new.target)return mt({component:Kt,...V});gt(i,!0);const $=()=>_(J,"$fullContext$",u),N=()=>_(U,"$canDeleteScript$",u),P=()=>_(L,"$scriptContext$",u),q=()=>_(Q,"$script$",u),W=()=>_(X,"$homeView$",u),[u,E]=ut(),F=t=>{var r=b(),n=m(r);{var f=g=>{var S=Ht(),M=m(S);{let v=c(()=>T.workspace_shell_showInBottomBar_tooltip());z(M,()=>G,(h,y)=>{y(h,{get icon(){return It},get label(){return e(v)},onclick:Z,"data-move-to-bottom-bar":!0})})}var ot=bt(M,2);{var nt=v=>{var h=b(),y=m(h);{let ct=c(()=>T.scripts_delete_label()),it=c(()=>N()?void 0:T.scripts_delete_disabled_description());z(y,()=>G,(lt,pt)=>{pt(lt,{get icon(){return St},get label(){return e(ct)},destructive:!0,get disabledReason(){return e(it)},onclick:Y})})}d(v,h)};D(ot,v=>{e(s)&&v(nt)})}d(g,S)};D(n,g=>{$()&&g(f)})}d(t,r)};let o=w(i,"tab",7),a=w(i,"workspaceId",7),C=w(i,"layoutId",7),l=w(i,"isActive",7);const I=c(()=>o().terminalId),s=c(()=>o().scriptId),R=Dt(),p=O(""),x=O("");A(()=>p.set(a())),A(()=>x.set(e(s)??""));const J=ht(p),L=wt(p),Q=xt(p,x),U=yt(p,x),X=At(p);let H=!0;vt(()=>{H=!1});function Y(){if(!e(s))return;const t=a(),r=e(s),n=o().id;return Ct(t,r,()=>H&&l()&&a()===t&&e(s)===r&&o().id===n)}function Z(){$()&&(e(s)&&B.dispatch(Vt(a(),e(s))),B.dispatch(Wt(a(),e(I))),B.dispatch(Rt(C()??a(),o().id)))}A(()=>{if(!(!R||!l()))return R.registerActions({actions:F})});var tt={get tab(){return o()},set tab(t){o(t),k()},get workspaceId(){return a()},set workspaceId(t){a(t),k()},get layoutId(){return C()},set layoutId(t){C(t),k()},get isActive(){return l()},set isActive(t){l(t),k()},$set:dt,$on:(t,r)=>ft(i,t,r)},K=b(),et=m(K);{var rt=t=>{var r=b(),n=m(r);j(n,()=>e(s),f=>{{let g=c(()=>W()?.unavailable===!0),S=c(()=>Bt(W()));kt(f,{get scriptId(){return e(s)},get workspaceId(){return a()},class:"h-full",get runDisabled(){return e(g)},get runDisabledReason(){return e(S)}})}}),d(t,r)},at=t=>{var r=b(),n=m(r);j(n,()=>e(I),f=>{Tt(f,{get terminalId(){return e(I)},get workspaceId(){return a()},class:"h-full"})}),d(t,r)};D(et,t=>{e(s)&&l()&&P()&&($()||q())?t(rt):e(I)&&l()&&$()&&t(at,1)})}d(V,K);var st=_t(tt);return E(),st}export{Kt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as z}from"./
|
|
1
|
+
import{p as z}from"./DJuVbNrB.js";import{b as f,q as B,aX as E,B as F,ay as $,a_ as P,V as A,b0 as W,Y as _,U as N,aZ as Y,W as L,O as M,r as O}from"./B1ywot0G.js";import{p as I}from"./DkvJR80T.js";var U=M.packet,u,C=(u=class{constructor(){this.packet=[],this.setAccTitle=P,this.getAccTitle=A,this.setDiagramTitle=W,this.getDiagramTitle=_,this.getAccDescription=N,this.setAccDescription=Y}getConfig(){const t=B({...U,...L().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){O(),this.packet=[]}},f(u,"PacketDB"),u),X=1e4,j=f((e,t)=>{z(e,t);let r=-1,s=[],i=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:o,bits:d,label:g}of e.blocks){if(a!==void 0&&o!==void 0&&o<a)throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${o??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(o??=a+(d??1)-1,d??=o-a+1,r=o,$.debug(`Packet block ${a} - ${r} with label ${g}`);s.length<=l+1&&t.getPacket().length<X;){const[c,p]=q({start:a,end:o,bits:d,label:g},i,l);if(s.push(c),c.end+1===i*l&&(t.pushWord(s),s=[],i++),!p)break;({start:a,end:o,bits:d,label:g}=p)}}t.pushWord(s)},"populate"),q=f((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const s=t*r-1,i=t*r;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},"getNextFittingBlock"),S={parser:{yy:void 0},parse:f(async e=>{const t=await I("packet",e),r=S.parser?.yy;if(!(r instanceof C))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");$.debug(t),j(t,r)},"parse")},G=f((e,t,r,s)=>{const i=s.db,l=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:d,bitsPerRow:g}=l,c=i.getPacket(),p=i.getDiagramTitle(),m=a+o,n=m*(c.length+1)-(p?0:a),h=d*g+2,k=E(t);k.attr("viewBox",`0 0 ${h} ${n}`),F(k,n,h,l.useMaxWidth);for(const[x,b]of c.entries())H(k,b,x,l);k.append("text").text(p).attr("x",h/2).attr("y",n-m/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),H=f((e,t,r,{rowHeight:s,paddingX:i,paddingY:l,bitWidth:a,bitsPerRow:o,showBits:d,bitOrder:g})=>{const c=e.append("g"),p=r*(s+l)+l,m=g==="descending";for(const n of t){const h=n.end-n.start+1,k=n.start%o,b=(m?o-k-h:k)*a+1,w=h*a-i;if(c.append("rect").attr("x",b).attr("y",p).attr("width",w).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",b+w/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(n.label),!d)continue;const[D,T]=m?[n.end,n.start]:[n.start,n.end],v=h===1,y=p-2;c.append("text").attr("x",b+(v?w/2:0)).attr("y",y).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",v?"middle":"start").text(D),v||c.append("text").attr("x",b+w).attr("y",y).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(T)}},"drawWord"),K={draw:G},V={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Z=f(({packet:e}={})=>{const t=B(V,e);return`
|
|
2
2
|
.packetByte {
|
|
3
3
|
font-size: ${t.byteFontSize};
|
|
4
4
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{t as D,br as d,a_ as P,bz as b,b as x}from"./CGWRZzdk.js";import{bs as S,a7 as z,ay as A,W as C,bn as M,aA as m,aD as i,c9 as c}from"./DYhIMPy1.js";import{D as f,M as B}from"./
|
|
1
|
+
import{t as D,br as d,a_ as P,bz as b,b as x}from"./CGWRZzdk.js";import{bs as S,a7 as z,ay as A,W as C,bn as M,aA as m,aD as i,c9 as c}from"./DYhIMPy1.js";import{D as f,M as B}from"./B1ywot0G.js";import{S as N,p as W}from"./CInXeVe5.js";import{N as $}from"./CUp3pS17.js";import{Ix as j,v1 as E,bd as J}from"./CicdOSYm.js";import{x as K}from"./MgErAKgQ.js";import{a0 as O}from"./C0g2TqGQ.js";function R(l,s){if(new.target)return D({component:R,...l});S(s,!0);let o=d(s,"kind",7),t=d(s,"source",7),a=d(s,"workspaceId",7);const g=new $,p=c(()=>{if(o()==="mermaid")return null;const e=g.parseMarkdown(`\`\`\`ws-block:diagram
|
|
2
2
|
${t()}
|
|
3
3
|
\`\`\``)[0],r=e?.primitive.type==="diagram"?JSON.stringify(e.primitive):t();return W(r,!0)});function k(e,r){if(!a()||!r.target)return;const n={openInAdjacentPanel:e.metaKey||e.ctrlKey,sourcePanelId:e.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0};r.type==="file"?j.dispatch(E(a(),r.target,n)):r.type==="note"&&K(O(r.target,a()),{...n,workspaceId:J(a()),event:e})}var w={get kind(){return o()},set kind(e){o(e),m()},get source(){return t()},set source(e){t(e),m()},get workspaceId(){return a()},set workspaceId(e){a(e),m()},$set:b,$on:(e,r)=>x(s,e,r)},u=z(),y=A(u);{var I=e=>{f(e,{kind:"mermaid",rendererOwnsActions:!0,children:(r,n)=>{B(r,{get code(){return t()},showExportButton:!0})},$$slots:{default:!0}})},v=e=>{f(e,{kind:"custom",children:(r,n)=>{{let _=c(()=>i(p)?.diagram??null),h=c(()=>i(p)?.error);N(r,{get diagram(){return i(_)},get source(){return t()},get sourceError(){return i(h)},onBindingClick:k})}},$$slots:{default:!0}})};P(y,e=>{o()==="mermaid"?e(I):e(v,-1)})}return C(l,u),M(w)}export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as o,r as l,d as t}from"./
|
|
1
|
+
import{g as o,r as l,d as t}from"./CbeK0M7M.js";import{p as m}from"./DJuVbNrB.js";import{b as n,ay as s}from"./B1ywot0G.js";import{M as p,d as u}from"./DkvJR80T.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),y=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),g={parse:n(e=>{t.clear(),s.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const i=r.value;s.debug("[Railroad Parser] Parsed rules:",i.rules.length),y(i),s.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},h={parser:g,db:t,renderer:l,styles:o};export{h as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{nu as P,nF as g,Ix as h,uM as d,uR as p,uO as y,gK as v,gl as f,gM as m,gL as A,A5 as u,A4 as L,CX as S,Cx as F,CA as C,A8 as z,tn as O,B7 as x,tg as B,to as M,tp as R,gC as _,gN as H,go as K,gn as j,Kv as D,Kt as E,Ku as V,Kc as U,ne as q,Ib as G,gE as N,tl as J,Kq as W,Ks as X,AZ as Z,J5 as $,AR as Q,c_ as Y,od as ss,of as es,oe as ts,og as as,DH as is,hR as os,yH as cs,f_ as T,i5 as rs,h$ as hs,qx as ls}from"./
|
|
1
|
+
import{nu as P,nF as g,Ix as h,uM as d,uR as p,uO as y,gK as v,gl as f,gM as m,gL as A,A5 as u,A4 as L,CX as S,Cx as F,CA as C,A8 as z,tn as O,B7 as x,tg as B,to as M,tp as R,gC as _,gN as H,go as K,gn as j,Kv as D,Kt as E,Ku as V,Kc as U,ne as q,Ib as G,gE as N,tl as J,Kq as W,Ks as X,AZ as Z,J5 as $,AR as Q,c_ as Y,od as ss,of as es,oe as ts,og as as,DH as is,hR as os,yH as cs,f_ as T,i5 as rs,h$ as hs,qx as ls}from"./CicdOSYm.js";import{bp as ns}from"./CGWRZzdk.js";import{F as ds,e as ps,z as us,p as I,v as Is,G as b,J as bs}from"./CnJe4S2a.js";function ws(i,s,e,t){const a=s?.activeTabId;if(!s||!a||!s.tabs.some(c=>c.id===a))return null;const o=t?P(t).map(g):i.map(c=>[c]),r=o.findIndex(c=>c.includes(s.id));if(r<0)return null;const n=o[r+(e==="next"?1:-1)]?.[0];return n?{kind:"neighbor",tabId:a,targetPanelId:n}:o.length>=4||s.tabs.length<2&&o[r].length<2?null:{kind:"edge",tabId:a,position:e==="next"?"after":"before"}}class k{constructor(s){this.workspaceId=s}get state(){return h.state}dispatch(s){h.dispatch(s)}getPanelIds(){return ds.select(this.state,this.workspaceId)}getAllTabs(){return ps.select(this.state,this.workspaceId)}getPanel(s){return us.select(this.state,this.workspaceId,s)??null}getOtherPanelId(){const s=this.getPanelIds();if(s.length<2)return null;const e=I.select(this.state,this.workspaceId);return s.find(t=>t!==e)??null}openTab(s,e){if(e){this.dispatch(d(this.workspaceId,s,e));return}this.dispatch(p(this.workspaceId,s))}openUserTab(s,e){const t=e??I.select(this.state,this.workspaceId)??void 0;if(t){this.dispatch(d(this.workspaceId,s,t,void 0,!0));return}this.dispatch(p(this.workspaceId,s,{force:!0}))}openTabInAdjacentOrSplit(s,e,t){this.dispatch(y(this.workspaceId,s,e,t))}openBrowserPanel(s,e,t,a){const o={type:"browser",title:ns.layout_tabTypes_browser_title(),browserUrl:s??"about:blank",...a===void 0?{}:{browserRequestedUrl:a},contextItemId:e,closable:!0};this.openTabInAdjacentOrSplit(o,t)}closeTab(s,e){this.dispatch(v(this.workspaceId,s,e))}closeActiveTab(s){this.dispatch(f(this.workspaceId,s))}closeTabsByType(s,e,t){this.dispatch(m(this.workspaceId,s,e,t))}closeTabsByAgentId(s){this.dispatch(A(this.workspaceId,s))}reopenClosedTab(s,e){this.dispatch(u(this.workspaceId,void 0,s,e))}reopenLastClosed(){const s=Is.select(this.state,this.workspaceId);s?.kind==="column"?this.dispatch(L(this.workspaceId)):s?.kind==="tab"&&this.dispatch(u(this.workspaceId))}setActiveTab(s,e){this.dispatch(S(this.workspaceId,s,e))}selectNextTab(s){this.dispatch(F(this.workspaceId,s))}selectPreviousTab(s){this.dispatch(C(this.workspaceId,s))}reorderTabs(s,e,t){this.dispatch(z(this.workspaceId,s,e,t))}moveTabToPanel(s,e,t,a){this.dispatch(O(this.workspaceId,s,e,t,a))}moveActivePaneToColumn(s,e){const t=ws(this.getPanelIds(),this.getPanel(s),e,b.select(this.state,this.workspaceId));return t?(t.kind==="neighbor"?this.moveTabToPanel(t.tabId,s,t.targetPanelId):this.moveTabToSplitLevel(t.tabId,s,[],t.position,"horizontal"),!0):!1}canMoveActivePaneVertically(s,e){return x(b.select(this.state,this.workspaceId),this.getPanel(s),e)!==null}moveActivePaneVertically(s,e){return this.canMoveActivePaneVertically(s,e)?(this.dispatch(B(this.workspaceId,s,e)),!0):!1}moveTabToSplit(s,e,t,a){this.dispatch(M(this.workspaceId,s,e,t,a))}moveTabToSplitLevel(s,e,t,a,o){this.dispatch(R(this.workspaceId,s,e,t,a,o))}closeOtherTabs(s,e){this.dispatch(_(this.workspaceId,s,e))}closeTabsToRight(s,e){this.dispatch(H(this.workspaceId,s,e))}closeAllTabs(s){this.dispatch(K(this.workspaceId,s))}closeAllOthersEverywhere(s,e){this.dispatch(j(this.workspaceId,s,e))}updateTabTitle(s,e){this.dispatch(D(this.workspaceId,s,e))}updateTabBrowserUrl(s,e){this.dispatch(E(this.workspaceId,s,e))}updateTabFavicon(s,e){this.dispatch(V(this.workspaceId,s,e))}updateFileTabPath(s,e){this.dispatch(U(this.workspaceId,s,e))}focusPanel(s){this.dispatch(q(this.workspaceId,s))}splitPanel(s,e,t){this.dispatch(G(this.workspaceId,s,e,t))}closePanel(s){this.dispatch(N(this.workspaceId,s))}movePanel(s,e,t){this.dispatch(J(this.workspaceId,s,e,t))}updateSizes(s,e){this.dispatch(W(this.workspaceId,s,e))}updateSplitSizes(s,e){this.dispatch(X(this.workspaceId,s,e))}resizeRootDivider(s,e){this.dispatch(Z(this.workspaceId,s,e))}toggleExpandPanel(s){this.dispatch($(this.workspaceId,s))}resetLayout(){this.dispatch(Q(this.workspaceId))}applyPreset(s){this.dispatch(Y(this.workspaceId,s))}goBack(){this.dispatch(ss(this.workspaceId))}goForward(){this.dispatch(es(this.workspaceId))}goBackInFocusHistory(){this.dispatch(ts(this.workspaceId))}goForwardInFocusHistory(){this.dispatch(as(this.workspaceId))}setDeferSpecTab(s){this.dispatch(is(this.workspaceId,s))}consumePendingFocus(s){this.dispatch(os(this.workspaceId,s))}reconcileStaleAgentTabs(s,e,t){const a=Array.isArray(s)?s:Array.from(s);this.dispatch(cs(this.workspaceId,a,e,t))}clearLayout(){this.dispatch(T(this.workspaceId))}createGridLayout(s){return this.dispatch(rs(this.workspaceId,s)),this.getPanelIds()}batchMutations(s){return s()}initializeLayout(s){const e=s??hs();this.dispatch(ls(this.workspaceId,e))}cyclePresets(){const s=bs.select(this.state,this.workspaceId),e=Object.keys(s).length;e<=1?this.applyPreset("split-horizontal"):e===2?this.applyPreset("three-column"):this.applyPreset("single")}}const l=new Map;function Ts(i){let s=l.get(i);return s||(s=new k(i),l.set(i,s)),s}function ks(i){return!0}function Ps(i){l.delete(i)}function w(i){h.dispatch(T(i))}const fs=Object.freeze(Object.defineProperty({__proto__:null,PanelLayoutAdapter:k,clearPanelLayoutAdapter:Ps,clearPanelLayoutFn:w,clearPanelLayoutForWorkspace:w,getPanelLayoutManager:Ts,hasPanelLayoutManager:ks},Symbol.toStringTag,{value:"Module"}));export{Ps as c,Ts as g,ks as h,fs as p,ws as r};
|
|
@@ -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"./BXNFvqQr.js";import{bY as Le,cX as le,co as ue,cn as ve}from"./DJL0zbbT.js";import{Ix as p,Bc as we,bv as be,c as Fe,KB as de,i7 as me,bH as ke,D7 as z,BB as Ge,f4 as Pe,zG as xe,dR as Ee,f0 as fe,dQ as _e,A9 as Ve,Kf as Ue,vQ as Be}from"./CnZcDXmL.js";import{aC as Ae,dG as he,A as H,P as Re,ay as K}from"./BqkRycEV.js";import{ax as $e}from"./B422XfSt.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./CIwcmzpw.js";import"./DYhIMPy1.js";import{bp as n}from"./CGWRZzdk.js";import"./B70m4__L.js";import"./BEyWfhqM.js";import"./D2hN829h.js";import{R as ge}from"./BvFAWM27.js";import{L as Ye}from"./CSiaiLHL.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,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 Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=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 Y(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 Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(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=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const 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 Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,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=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
|
|
1
|
+
var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Z as ce,ai as q,ar as Ce}from"./CuXCq1os.js";import{bY as Le,cX as le,co as ue,cn as ve}from"./CUp3pS17.js";import{Ix as p,Bc as we,bv as be,c as Fe,KB as de,i7 as me,bH as ke,D7 as z,BB as Ge,f4 as Pe,zG as xe,dR as Ee,f0 as fe,dQ as _e,A9 as Ve,Kf as Ue,vQ as Be}from"./CicdOSYm.js";import{aC as Ae,dG as he,A as H,P as Re,ay as K}from"./C0g2TqGQ.js";import{ax as $e}from"./KJX0Kw6L.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./CxLPEkg7.js";import"./DYhIMPy1.js";import{bp as n}from"./CGWRZzdk.js";import"./BjnZ1Xf3.js";import"./BEyWfhqM.js";import"./DVYqzV0n.js";import{R as ge}from"./BvFAWM27.js";import{L as Ye}from"./CSiaiLHL.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,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 Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=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 Y(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 Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(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=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const 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 Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,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=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
|