@intent-hq/web 2.388.0 → 2.389.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{CThyVptW.js → -MOfUnWK.js} +1 -1
- package/web/app/immutable/chunks/{C9UZoxqu.js → -iNNNnZP.js} +1 -1
- package/web/app/immutable/chunks/{CPR6kk_T.js → 1biRkLeO.js} +1 -1
- package/web/app/immutable/chunks/{BfhtD4DE.js → 2TDNGwi2.js} +1 -1
- package/web/app/immutable/chunks/{CJ6d7atw.js → 56loFVfQ.js} +1 -1
- package/web/app/immutable/chunks/{Az9cm1af.js → 958SNXkw.js} +1 -1
- package/web/app/immutable/chunks/{cOfTiXUW.js → 96V4v2iI.js} +1 -1
- package/web/app/immutable/chunks/{CgkqJVb4.js → B-tK7hOH.js} +1 -1
- package/web/app/immutable/chunks/B2_6AX8w.js +2 -0
- package/web/app/immutable/chunks/B3FnJcLx.js +3 -0
- package/web/app/immutable/chunks/{DjpNk5RK.js → B5N8LmEF.js} +1 -1
- package/web/app/immutable/chunks/{1EMxL5fo.js → B6dUCFoz.js} +1 -1
- package/web/app/immutable/chunks/{BM_biE0y.js → B7-Rf8Ja.js} +1 -1
- package/web/app/immutable/chunks/{B5M97fab.js → B7zssCpp.js} +1 -1
- package/web/app/immutable/chunks/{o2-I6h0N.js → B8rKVMLL.js} +1 -1
- package/web/app/immutable/chunks/{BlDw7Cnz.js → B9vHutcJ.js} +5 -5
- package/web/app/immutable/chunks/{Bggsay0U.js → BGniv2IE.js} +1 -1
- package/web/app/immutable/chunks/{4o_ZQ4nq.js → BGrimfDs.js} +1 -1
- package/web/app/immutable/chunks/{D81tH0Kz.js → BHy9cRzo.js} +1 -1
- package/web/app/immutable/chunks/{D9tGn9lI.js → BIFBPuAO.js} +1 -1
- package/web/app/immutable/chunks/{BG4hSkx5.js → BId1zNus.js} +1 -1
- package/web/app/immutable/chunks/{BHMZ-wPE.js → BNJ3edFz.js} +1 -1
- package/web/app/immutable/chunks/{DkXzy_Gt.js → BNu0Ucwh.js} +1 -1
- package/web/app/immutable/chunks/{BexVHAqu.js → BOVEEbKv.js} +1 -1
- package/web/app/immutable/chunks/{CAvh8i5c.js → BOyjfrDv.js} +1 -1
- package/web/app/immutable/chunks/{B9dzo0Kz.js → BPQFiQQc.js} +2 -2
- package/web/app/immutable/chunks/{FkijJXdh.js → BPcs9j0t.js} +1 -1
- package/web/app/immutable/chunks/{BQDKsQdE.js → BPmcj0VV.js} +1 -1
- package/web/app/immutable/chunks/{CRTEJPHA.js → BR1TNOav.js} +1 -1
- package/web/app/immutable/chunks/{ts9pKvJh.js → BRKRnHX6.js} +1 -1
- package/web/app/immutable/chunks/BSXmccL1.js +411 -0
- package/web/app/immutable/chunks/{C-9CUgEH.js → BUo-3nO7.js} +2 -2
- package/web/app/immutable/chunks/{yOonr4tS.js → BWfc0sSK.js} +1 -1
- package/web/app/immutable/chunks/B_EaOuZ7.js +1 -0
- package/web/app/immutable/chunks/{B3Jjdo5U.js → B_QbDMuF.js} +2 -2
- package/web/app/immutable/chunks/{DIdR5gOD.js → BaH6sH1s.js} +1 -1
- package/web/app/immutable/chunks/{BCG_mh8x.js → Bb98JhKr.js} +3 -3
- package/web/app/immutable/chunks/{Dz9x1eR4.js → BbYWP3Ow.js} +1 -1
- package/web/app/immutable/chunks/BbhtQrkZ.js +6 -0
- package/web/app/immutable/chunks/{D5a_4V3Z.js → BbrUifYV.js} +1 -1
- package/web/app/immutable/chunks/{CFwpAHza.js → Bc1CpNLz.js} +1 -1
- package/web/app/immutable/chunks/{D3tfczF3.js → BdrLG-E0.js} +1 -1
- package/web/app/immutable/chunks/{XTW5roGp.js → BfnPC1r8.js} +1 -1
- package/web/app/immutable/chunks/{UJ0k3Qud.js → BhCMc9G0.js} +1 -1
- package/web/app/immutable/chunks/{DJCr4XPV.js → BiYZcl7D.js} +1 -1
- package/web/app/immutable/chunks/{Ca8LQU_k.js → BiZ5HCfj.js} +1 -1
- package/web/app/immutable/chunks/BjDM3rxu.js +2 -0
- package/web/app/immutable/chunks/{CvpYq92u.js → BjVkuF0t.js} +1 -1
- package/web/app/immutable/chunks/BkqNdsh1.js +2 -0
- package/web/app/immutable/chunks/{BMyJogTr.js → BksTLNI4.js} +1 -1
- package/web/app/immutable/chunks/{DPhsGkGk.js → BniyCzQ9.js} +1 -1
- package/web/app/immutable/chunks/{BuPCiCZt.js → BouO3S3L.js} +1 -1
- package/web/app/immutable/chunks/{BUCW0wKH.js → BpMXdC4H.js} +1 -1
- package/web/app/immutable/chunks/{CZ6MUIg2.js → Bq2Q6gce.js} +1 -1
- package/web/app/immutable/chunks/{D9zIaPA4.js → BqCpnQY_.js} +1 -1
- package/web/app/immutable/chunks/{Cj3bM-Zt.js → BqXtiIKZ.js} +1 -1
- package/web/app/immutable/chunks/{k9WXffYo.js → BrMDTgLg.js} +1 -1
- package/web/app/immutable/chunks/{CSeQ6fVV.js → BsY6roFy.js} +1 -1
- package/web/app/immutable/chunks/{Ci82uJM3.js → BtmHyUSg.js} +1 -1
- package/web/app/immutable/chunks/{nxvUsKcZ.js → BvDFX1mj.js} +1 -1
- package/web/app/immutable/chunks/{0PlO4O3i.js → BvZOajsk.js} +1 -1
- package/web/app/immutable/chunks/{Cah19Qux.js → Bviyt-Xy.js} +1 -1
- package/web/app/immutable/chunks/{CcNxrHIL.js → ByyFoG6W.js} +1 -1
- package/web/app/immutable/chunks/{DYu0VnZ5.js → BzWT_wQw.js} +1 -1
- package/web/app/immutable/chunks/{B49CUktc.js → C-HR_nje.js} +1 -1
- package/web/app/immutable/chunks/C1_cc_jh.js +2 -0
- package/web/app/immutable/chunks/{B3K7_JP4.js → C2UL5Ler.js} +13 -13
- package/web/app/immutable/chunks/{bMZUbxIs.js → C3dytrTL.js} +1 -1
- package/web/app/immutable/chunks/{CLO80vIO.js → C4wGdw9l.js} +1 -1
- package/web/app/immutable/chunks/C5YfJpVq.js +2 -0
- package/web/app/immutable/chunks/{j5i4TEa8.js → C6RhewOE.js} +1 -1
- package/web/app/immutable/chunks/C9Sx9tb_.js +1 -0
- package/web/app/immutable/chunks/{B2KfKpOG.js → CDwhmkPo.js} +1 -1
- package/web/app/immutable/chunks/{pI1-Ias6.js → CG1puMxA.js} +7 -7
- package/web/app/immutable/chunks/{Bfu4Gbpb.js → CHaC_gXH.js} +3 -3
- package/web/app/immutable/chunks/{B6blQkaw.js → CJ7X12Bw.js} +1 -1
- package/web/app/immutable/chunks/{DDeZr78m.js → CKxZ8tlS.js} +1 -1
- package/web/app/immutable/chunks/{BZljJ1HD.js → CQlYR8ss.js} +53 -53
- package/web/app/immutable/chunks/CRSiOiSR.js +1 -0
- package/web/app/immutable/chunks/{D_jbKDL6.js → CTFqJlwB.js} +1 -1
- package/web/app/immutable/chunks/{big6nIIy.js → CTflyKHO.js} +1 -1
- package/web/app/immutable/chunks/{Cr0pYxvG.js → CUeJC-BW.js} +1 -1
- package/web/app/immutable/chunks/{D8vs9kOP.js → CUsiQpqx.js} +1 -1
- package/web/app/immutable/chunks/{DipTZipA.js → CVWwz1Ss.js} +1 -1
- package/web/app/immutable/chunks/CVtmf86l.js +4 -0
- package/web/app/immutable/chunks/{BCO6MiJi.js → CWsj4Hb7.js} +1 -1
- package/web/app/immutable/chunks/CY1uQ_EK.js +1 -0
- package/web/app/immutable/chunks/{Cq_g40U8.js → CYxt6gzD.js} +1 -1
- package/web/app/immutable/chunks/CbGsjkOn.js +2 -0
- package/web/app/immutable/chunks/{BfBRsDbv.js → CbwlFeZe.js} +1 -1
- package/web/app/immutable/chunks/CcDyBqhb.js +2 -0
- package/web/app/immutable/chunks/{CSIMWELR.js → CeaP52uL.js} +1 -1
- package/web/app/immutable/chunks/{DypPlx7r.js → Cekr5Jry.js} +1 -1
- package/web/app/immutable/chunks/{DsBP9KJQ.js → CfYmMj5F.js} +1 -1
- package/web/app/immutable/chunks/{CPOCLD3T.js → CgGsxeG7.js} +1 -1
- package/web/app/immutable/chunks/{Dk9NNzZE.js → Ch6a7ELM.js} +7 -7
- package/web/app/immutable/chunks/{DVqkJDVT.js → ChXsVZci.js} +8 -8
- package/web/app/immutable/chunks/{7-8cUxTO.js → Chj-azz7.js} +1 -1
- package/web/app/immutable/chunks/{D3lPsVN4.js → CiRuCsUo.js} +1 -1
- package/web/app/immutable/chunks/{Cm3tXeMM.js → Cj89j1C-.js} +1 -1
- package/web/app/immutable/chunks/{lVUEwTET.js → CjPEI4fg.js} +1 -1
- package/web/app/immutable/chunks/{s59tMRX6.js → ClbQbaTd.js} +1 -1
- package/web/app/immutable/chunks/{Db1LGTgG.js → CmR2cnYT.js} +1 -1
- package/web/app/immutable/chunks/{DJz92Kg0.js → Cn4A9AjR.js} +1 -1
- package/web/app/immutable/chunks/CnNk48uP.js +1 -0
- package/web/app/immutable/chunks/{FUsdAFUM.js → CoGKQKFb.js} +1 -1
- package/web/app/immutable/chunks/{C4K5_BxH.js → Cp5royN1.js} +1 -1
- package/web/app/immutable/chunks/{DUbMVsk9.js → CpQ2QLnc.js} +1 -1
- package/web/app/immutable/chunks/{Bl0JLobe.js → CrpG0ldr.js} +1 -1
- package/web/app/immutable/chunks/{CONcCUKk.js → Crz8kvLc.js} +1 -1
- package/web/app/immutable/chunks/{D7wcXEUr.js → Cs6KI4dy.js} +1 -1
- package/web/app/immutable/chunks/{DTxjOiRH.js → Ctp-YfoS.js} +3 -3
- package/web/app/immutable/chunks/{COujhQNX.js → Cu11OjbU.js} +4 -4
- package/web/app/immutable/chunks/{B0fKMUbz.js → CwEjDuJ3.js} +1 -1
- package/web/app/immutable/chunks/{DthwyZkm.js → CyDuWtxr.js} +1 -1
- package/web/app/immutable/chunks/{CWwM8FRm.js → CzJm3Kxa.js} +1 -1
- package/web/app/immutable/chunks/{Dre9I3wQ.js → D-19S-7Z.js} +1 -1
- package/web/app/immutable/chunks/{BMOvHKEB.js → D1CvgUga.js} +1 -1
- package/web/app/immutable/chunks/{ekoFDkzg.js → D2YDfFKv.js} +1 -1
- package/web/app/immutable/chunks/{BYTf4lKv.js → D3R31YXQ.js} +1 -1
- package/web/app/immutable/chunks/{fvo80nOp.js → D4d1iyeR.js} +1 -1
- package/web/app/immutable/chunks/{DqYxTMZw.js → D4ytz2EC.js} +1 -1
- package/web/app/immutable/chunks/{gMSGQkcm.js → D5WcE_P_.js} +1 -1
- package/web/app/immutable/chunks/{CdcEumin.js → D6m95MWL.js} +1 -1
- package/web/app/immutable/chunks/D78ptBES.js +5 -0
- package/web/app/immutable/chunks/{Du8gfHWh.js → D7QZQ0zf.js} +1 -1
- package/web/app/immutable/chunks/{CIlqNohY.js → D7b2VLAz.js} +1 -1
- package/web/app/immutable/chunks/{BbUT7tLT.js → D915og2m.js} +1 -1
- package/web/app/immutable/chunks/{Ojuc-F9K.js → DA_7jaWc.js} +3 -3
- package/web/app/immutable/chunks/{D_ht3M25.js → DAoh5LIP.js} +1 -1
- package/web/app/immutable/chunks/{BLv7f62Z.js → DAwK7LKd.js} +1 -1
- package/web/app/immutable/chunks/{BR5drfgy.js → DCLLUF6K.js} +1 -1
- package/web/app/immutable/chunks/{DwYVNqD8.js → DCs992HX.js} +1 -1
- package/web/app/immutable/chunks/DFh0CfhB.js +1 -0
- package/web/app/immutable/chunks/{Bzh81gre.js → DIvSo5Nm.js} +1 -1
- package/web/app/immutable/chunks/{Do_lk8OO.js → DJ9ILql1.js} +1 -1
- package/web/app/immutable/chunks/{BL19ZvCq.js → DJ_B6Tb0.js} +5 -5
- package/web/app/immutable/chunks/{UxV1HNfb.js → DLnFsCgA.js} +28 -28
- package/web/app/immutable/chunks/{Q6zM48G9.js → DMomDPVD.js} +4 -4
- package/web/app/immutable/chunks/{DnEc5FO1.js → DMrzeQEi.js} +1 -1
- package/web/app/immutable/chunks/{2KaAZLR-.js → DNnyE4a4.js} +1 -1
- package/web/app/immutable/chunks/{BgGvUY8M.js → DPhH7vBg.js} +1 -1
- package/web/app/immutable/chunks/{BkPn8_Se.js → DQVuWRan.js} +22 -22
- package/web/app/immutable/chunks/{C6aNGAOC.js → DQw0Iiac.js} +2 -2
- package/web/app/immutable/chunks/{B5XUeaKM.js → DRD4T4u0.js} +2 -2
- package/web/app/immutable/chunks/{B0Uv1AyY.js → DRND1Lha.js} +1 -1
- package/web/app/immutable/chunks/{xQhx6K61.js → DSjchUEk.js} +1 -1
- package/web/app/immutable/chunks/DWt5yjbU.js +2 -0
- package/web/app/immutable/chunks/{DMxa_WW_.js → DXY_Cr2S.js} +2 -2
- package/web/app/immutable/chunks/{DxMjS0Pm.js → DYcuijJl.js} +1 -1
- package/web/app/immutable/chunks/{Dkwq1aon.js → DZOkhMcO.js} +1 -1
- package/web/app/immutable/chunks/{BOROOVR9.js → DZiUi6tE.js} +1 -1
- package/web/app/immutable/chunks/{B4p5jAE9.js → DaQPP3_d.js} +1 -1
- package/web/app/immutable/chunks/{DX9jQ0PS.js → DaWmj23r.js} +1 -1
- package/web/app/immutable/chunks/{JNgcLoIR.js → Db4jRBl0.js} +1 -1
- package/web/app/immutable/chunks/{DmyX6ZHD.js → Dd-LQrG1.js} +1 -1
- package/web/app/immutable/chunks/{KlB4Fhnb.js → DdNhEgdc.js} +1 -1
- package/web/app/immutable/chunks/{CZU3aMzM.js → DfheqyY9.js} +1 -1
- package/web/app/immutable/chunks/{DH-IPuJJ.js → Dfp6ssYD.js} +1 -1
- package/web/app/immutable/chunks/{DUfqsoW8.js → Dgc0jIMe.js} +1 -1
- package/web/app/immutable/chunks/{rarafMnz.js → DiBpIS7p.js} +1 -1
- package/web/app/immutable/chunks/{DU_cYENL.js → DjbX62Cx.js} +5 -5
- package/web/app/immutable/chunks/{D3CypRQj.js → DlWizs9I.js} +1 -1
- package/web/app/immutable/chunks/{AuPnYXvq.js → Dm9VEl_l.js} +1 -1
- package/web/app/immutable/chunks/{loi-djHu.js → DnhCnCMz.js} +1 -1
- package/web/app/immutable/chunks/{Cl88aId_.js → Dp7Hm0g0.js} +1 -1
- package/web/app/immutable/chunks/{BwGrKGev.js → DpCic98X.js} +1 -1
- package/web/app/immutable/chunks/{KHaGo8p4.js → Dqi2LMpO.js} +2 -2
- package/web/app/immutable/chunks/{DjVRdKmG.js → DtXgUHCj.js} +1 -1
- package/web/app/immutable/chunks/{BtXBr5gW.js → DuaPhBil.js} +1 -1
- package/web/app/immutable/chunks/{g0WwLJKD.js → DxyD9o0t.js} +1 -1
- package/web/app/immutable/chunks/Dz-zX_Ts.js +1 -0
- package/web/app/immutable/chunks/{B1B2tR2P.js → EAuFbzCr.js} +1 -1
- package/web/app/immutable/chunks/{DbRN_fBN.js → GnUYJfg_.js} +1 -1
- package/web/app/immutable/chunks/{GMS9kh4f.js → IvX_QTkj.js} +2 -2
- package/web/app/immutable/chunks/J2YvrN12.js +13 -0
- package/web/app/immutable/chunks/{HA0DfJ2t.js → JZ-O0OQl.js} +1 -1
- package/web/app/immutable/chunks/{wKnHEtxm.js → Jg5r77fy.js} +1 -1
- package/web/app/immutable/chunks/{ChgSqVu2.js → KZwZoyIt.js} +1 -1
- package/web/app/immutable/chunks/{CgXlgTpj.js → KnkAG0HD.js} +1 -1
- package/web/app/immutable/chunks/{Csg_svg6.js → Ll0WtNFW.js} +1 -1
- package/web/app/immutable/chunks/{BqymqbDk.js → MzHad0-m.js} +1 -1
- package/web/app/immutable/chunks/{CahSXEZY.js → OIB4u9ZA.js} +1 -1
- package/web/app/immutable/chunks/{C_nSNvQ3.js → OtJAfUmG.js} +2 -2
- package/web/app/immutable/chunks/{CSKrS9aV.js → PX_tznAF.js} +1 -1
- package/web/app/immutable/chunks/{B-DC5RDK.js → R-UFG3MB.js} +1 -1
- package/web/app/immutable/chunks/{DugE9z8T.js → RWuDgH63.js} +1 -1
- package/web/app/immutable/chunks/{CZkav0tO.js → Rtit513z.js} +2 -2
- package/web/app/immutable/chunks/{BhvXSFFd.js → TB9r2XJy.js} +2 -2
- package/web/app/immutable/chunks/{CS2-6GJW.js → TBtn8giw.js} +1 -1
- package/web/app/immutable/chunks/{CgpdwzlC.js → UZYqZZXR.js} +1 -1
- package/web/app/immutable/chunks/{CFArS1mZ.js → UsyUyHOM.js} +2 -2
- package/web/app/immutable/chunks/{DnebYpJB.js → X0RLj3lE.js} +1 -1
- package/web/app/immutable/chunks/{CBq8Km8c.js → X6hYTxgn.js} +1 -1
- package/web/app/immutable/chunks/_UjuBCOJ.js +1 -0
- package/web/app/immutable/chunks/{klTuOngC.js → aZdb_rCN.js} +1 -1
- package/web/app/immutable/chunks/{pXRM_ktM.js → cTFeOFQC.js} +4 -4
- package/web/app/immutable/chunks/{BohdTsJs.js → cmil589m.js} +1 -1
- package/web/app/immutable/chunks/{CTDDNWu2.js → etz9IKpr.js} +1 -1
- package/web/app/immutable/chunks/{yvk0NmWm.js → fKOcHw3K.js} +1 -1
- package/web/app/immutable/chunks/{sKA-ObYb.js → hkJYqn41.js} +1 -1
- package/web/app/immutable/chunks/{D5b9qBIq.js → i5FUlYpy.js} +1 -1
- package/web/app/immutable/chunks/{C0AUQZ53.js → iTNhB2TC.js} +1 -1
- package/web/app/immutable/chunks/{CJubsryt.js → j5mPVG9_.js} +5 -5
- package/web/app/immutable/chunks/{Psr77Z1X.js → kzuAnGps.js} +1 -1
- package/web/app/immutable/chunks/{DOXxx9SZ.js → lei6Hlse.js} +1 -1
- package/web/app/immutable/chunks/{WULeRaWs.js → lskgWJFV.js} +1 -1
- package/web/app/immutable/chunks/lzi3tV-r.js +1 -0
- package/web/app/immutable/chunks/{DREHsvwt.js → nxtepGjE.js} +1 -1
- package/web/app/immutable/chunks/{Dz_XrTI6.js → pe4pVEc5.js} +1 -1
- package/web/app/immutable/chunks/{CuL2i1ch.js → pfX_M-aK.js} +1 -1
- package/web/app/immutable/chunks/{Bm0gGnEs.js → qhd9g-fv.js} +1 -1
- package/web/app/immutable/chunks/{D66KCqXw.js → r3TSpOm2.js} +1 -1
- package/web/app/immutable/chunks/{dSWRjbXG.js → rEuNpCjM.js} +1 -1
- package/web/app/immutable/chunks/{alqbgjrN.js → rdKijoRw.js} +1 -1
- package/web/app/immutable/chunks/{DnOdQmdW.js → sPwEr0L4.js} +2 -2
- package/web/app/immutable/chunks/{CihSsq_c.js → tCg_s90g.js} +1 -1
- package/web/app/immutable/chunks/tqn1yslZ.js +12 -0
- package/web/app/immutable/chunks/{BVaTfwe9.js → uvhZkGDU.js} +2 -2
- package/web/app/immutable/chunks/{DkdNV_U4.js → vj8NdGWd.js} +1 -1
- package/web/app/immutable/chunks/{BmVm-Xb9.js → vpQRVk8F.js} +1 -1
- package/web/app/immutable/chunks/{DPA7Wx7i.js → yqU168vt.js} +1 -1
- package/web/app/immutable/entry/app.CD-KpBFY.js +4 -0
- package/web/app/immutable/entry/start.BtJunRGi.js +1 -0
- package/web/app/immutable/nodes/{0.CZkIfk8Y.js → 0.BTKBksQU.js} +1 -1
- package/web/app/immutable/nodes/{1.DsBryxJC.js → 1.CDH50XYo.js} +1 -1
- package/web/app/immutable/nodes/{10.BouqyFdq.js → 10.BSK1ezgF.js} +18 -18
- package/web/app/immutable/nodes/{11.DVteTP5Z.js → 11.BkTyY8lh.js} +4 -4
- package/web/app/immutable/nodes/{13.ptNmqZph.js → 13.jK1i4wo4.js} +1 -1
- package/web/app/immutable/nodes/{14.C60Y_MCU.js → 14.DdHtnE9x.js} +1 -1
- package/web/app/immutable/nodes/{15.vdYCFIAo.js → 15.CRngZgh2.js} +1 -1
- package/web/app/immutable/nodes/{16.BHeY8GWk.js → 16.DFPLVaTv.js} +1 -1
- package/web/app/immutable/nodes/{17.De1hIcCz.js → 17.Dylz7DBe.js} +1 -1
- package/web/app/immutable/nodes/{18.CSiSULsM.js → 18.CxblUMg0.js} +1 -1
- package/web/app/immutable/nodes/{19.BzhIGKWf.js → 19.CI9f3oHV.js} +2 -2
- package/web/app/immutable/nodes/{2.DrLLJODs.js → 2.BPIXyW9K.js} +11 -11
- package/web/app/immutable/nodes/{20.C1njt326.js → 20.CXw8Twm7.js} +1 -1
- package/web/app/immutable/nodes/{3.CwnUfLZi.js → 3.CjIzds8z.js} +1 -1
- package/web/app/immutable/nodes/{4.BKuWUXgs.js → 4.BzXxqxag.js} +1 -1
- package/web/app/immutable/nodes/5.B54vgJ_P.js +1 -0
- package/web/app/immutable/nodes/{6.B0Ra98Z1.js → 6.plJT8OLe.js} +2 -2
- package/web/app/immutable/nodes/{7.fJBI0akH.js → 7.DSDH5hqz.js} +1 -1
- package/web/app/immutable/nodes/{8.CGqCPOoO.js → 8.B7U72PdE.js} +1 -1
- package/web/app/immutable/nodes/{9.D1ubXHAz.js → 9.BY44vZ0i.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +12 -12
- package/web/app/immutable/chunks/66ia1joD.js +0 -5
- package/web/app/immutable/chunks/8HAvvSzV.js +0 -411
- package/web/app/immutable/chunks/AprTGyyw.js +0 -2
- package/web/app/immutable/chunks/B7eueH-o.js +0 -12
- package/web/app/immutable/chunks/BTlwEESv.js +0 -2
- package/web/app/immutable/chunks/BYLBGCLl.js +0 -1
- package/web/app/immutable/chunks/BZCMFrfO.js +0 -1
- package/web/app/immutable/chunks/BhyNZfPE.js +0 -2
- package/web/app/immutable/chunks/BnRr64jv.js +0 -1
- package/web/app/immutable/chunks/CCfiEL_H.js +0 -3
- package/web/app/immutable/chunks/CEFRvkrn.js +0 -2
- package/web/app/immutable/chunks/CFPxKCYR.js +0 -1
- package/web/app/immutable/chunks/CJDEvb-Q.js +0 -2
- package/web/app/immutable/chunks/CKQfIyvh.js +0 -1
- package/web/app/immutable/chunks/CLwSZ8qQ.js +0 -1
- package/web/app/immutable/chunks/CaF73o7d.js +0 -13
- package/web/app/immutable/chunks/CeQeE8PY.js +0 -1
- package/web/app/immutable/chunks/Cgj3WZRk.js +0 -1
- package/web/app/immutable/chunks/Csw_wMoM.js +0 -2
- package/web/app/immutable/chunks/CxkFheMN.js +0 -1
- package/web/app/immutable/chunks/DmkTrs6I.js +0 -2
- package/web/app/immutable/chunks/DypB-Dwi.js +0 -1
- package/web/app/immutable/chunks/lNtFAHH9.js +0 -4
- package/web/app/immutable/chunks/nRNuB5kp.js +0 -2
- package/web/app/immutable/chunks/oOxvDsoj.js +0 -6
- package/web/app/immutable/entry/app.BszOT5UA.js +0 -4
- package/web/app/immutable/entry/start.BtnupdoQ.js +0 -1
- package/web/app/immutable/nodes/5.DBOSwfI-.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{t as oe,bo as st,bm as
|
|
2
|
-
hover:shadow transition-all cursor-pointer ${t(A)??""}`},get style(){return`width: 180px; height: 180px; anchor-name: --agent-hierarchy-${n().agentId??""};`},get onclick(){return v()},get onmouseenter(){return b()},get onmouseleave(){return N()},children:(D,Tt)=>{var Rt=an(),Lt=Yt(Rt),me=L(Lt);aa(me,{get agentId(){return n().agentId},variant:"emphasized",get state(){return t(
|
|
3
|
-
${t(f).subject??""}`)),_(Y,
|
|
1
|
+
import{t as oe,bo as st,bm as Q,bw as ie,bs as $t,bq as Me,b as ce}from"./CLAmm_T1.js";import{bs as le,a5 as L,bS as C,ay as Yt,aD as t,bA as $,bl as H,b_ as k,bO as B,W as _,bn as de,c9 as y,aA as rt,aB as F,bV as Mt,br as _a,aw as Be,aj as Ne,bH as V,ai as ya,be as Ia,b$ as xa,bf as wa,aC as he,a7 as De}from"./3SdAC2_C.js";import{i as at}from"./BFgvMDua.js";import{I as ea,g as jt,i as Se}from"./B1CKzIA2.js";import{f as Xt,g as ne,s as gt,c as se}from"./CcJmuwXr.js";import{b as ba}from"./Dn334wJv.js";import{f as Ut}from"./nxtepGjE.js";import"./TB9r2XJy.js";import{A as aa,b as na,a as sa}from"./BhCMc9G0.js";import"./BwNrQXlF.js";import{ax as ra,aO as oa,az as Aa,aA as ka,aB as We,ar as ia,b as $a,w as Ta,dN as Ca,a_ as Na,aC as Sa}from"./C2UL5Ler.js";import{R as Oa}from"./96V4v2iI.js";import{F as pe,bB as Fa,bg as Ra,aC as Ma,aW as Wa,cE as Ba}from"./DPttSllj.js";import{H as Da}from"./CfQcMKZg.js";import{A as La}from"./9YT9B_ti.js";import{N as Ea}from"./DjbX62Cx.js";import{f as Pa}from"./BfnPC1r8.js";import{i as St,JH as Fe,n_ as Ga,fV as za,c7 as ja,sG as Ha,v1 as Ka}from"./B9vHutcJ.js";import"./BBFoj-dS.js";function qa(e){return e.type==="agent"}const Xa=180,Ya=180;var Le=F('<div class="activity-pill shrink-0 text-xs px-3 py-1.5 bg-muted/60 border border-border rounded-lg text-subtle max-w-32 truncate"><!> </div>'),Ua=F('<div class="text-ui text-subtle line-clamp-2 leading-tight px-1"> </div>'),Va=F('<div><div class="flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div> <!> <!></div>'),Qa=F('<div class="text-sm text-primary-ink flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div>'),Oe=F('<span class="text-xs text-subtle"> </span>'),Za=F('<span class="status-pill text-xs px-1.5 py-0.5 bg-muted/80 rounded-md text-subtle truncate max-w-[130px]"> </span>'),Ja=F('<div class="text-ui text-subtle truncate w-full px-1 leading-tight"> </div>'),tn=F('<div class="flex flex-col items-center gap-1"><div class="flex items-center justify-center gap-1.5"><!> <!></div> <!></div>'),en=F('<div class="text-sm text-subtle line-clamp-3 leading-tight"> </div>'),an=F('<div class="avatar-wrapper h-9 w-12 flex items-center justify-center bg-background rounded-full"><!></div> <span class="font-semibold text-center leading-tight line-clamp-2"> </span> <div class="status-footer mt-auto pt-2 w-full text-center"><!></div>',1),nn=F('<div class="agent-card-wrapper flex items-center gap-3 shadow"><!> <!> <!></div>');function ca(e,a){if(new.target)return oe({component:ca,...e});le(a,!0);const s=()=>$t(_t,"$attentionRequest$",o),g=()=>$t(it,"$agentSession$",o),u=()=>$t(x,"$agentIsResponding$",o),c=()=>$t(ct,"$agentIsWaitingForOtherAgents$",o),d=()=>$t(P,"$agentIsWaiting$",o),i=()=>$t(I,"$agentIsThinking$",o),[o,l]=Me();let n=st(a,"agent",7),p=st(a,"activeFile",7),R=st(a,"activeNote",7),h=st(a,"agentNames",7),v=st(a,"onclick",7),b=st(a,"onmouseenter",7),N=st(a,"onmouseleave",7);const x=ra(n().agentId),it=oa(n().agentId),E=y(()=>!n().waitingForAgentIds||n().waitingForAgentIds.length===0?[]:n().waitingForAgentIds.map(A=>h()?.get(A)||Q.agentOverview_hierarchyCard_agent_fallback()).slice(0,2)),I=Aa(n().agentId),P=ka(n().agentId),ct=We(n().agentId),_t=ia(n().agentId),Ot=y(()=>{const A={attentionKind:s()?.kind??null};return g()?na(g(),A):sa({status:n().status,isResponding:u(),isWaitingForOtherAgents:c()},{...A,isCompleted:n().status==="completed",isFailed:n().status==="failed"})});var Bt={get agent(){return n()},set agent(A){n(A),rt()},get activeFile(){return p()},set activeFile(A){p(A),rt()},get activeNote(){return R()},set activeNote(A){R(A),rt()},get agentNames(){return h()},set agentNames(A){h(A),rt()},get onclick(){return v()},set onclick(A){v(A),rt()},get onmouseenter(){return b()},set onmouseenter(A){b(A),rt()},get onmouseleave(){return N()},set onmouseleave(A){N(A),rt()},$set:ie,$on:(A,D)=>ce(a,A,D)},ht=nn(),bt=L(ht);{var Ht=A=>{var D=Le(),Tt=L(D);pe(Tt,{get icon(){return Ra},size:"xs",class:"inline"});var Rt=C(Tt);$(D),k(()=>B(Rt,` ${p()??""}`)),_(A,D)};at(bt,A=>{p()&&u()&&A(Ht)})}var Ft=C(bt,2);{let A=y(()=>d()?"border-primary-ink border-2":"");Ut(Ft,{variant:"ghost",type:"button",get class(){return`agent-card flex flex-col items-center px-2.5 py-4 bg-card border border-border
|
|
2
|
+
hover:shadow transition-all cursor-pointer ${t(A)??""}`},get style(){return`width: 180px; height: 180px; anchor-name: --agent-hierarchy-${n().agentId??""};`},get onclick(){return v()},get onmouseenter(){return b()},get onmouseleave(){return N()},children:(D,Tt)=>{var Rt=an(),Lt=Yt(Rt),me=L(Lt);aa(me,{get agentId(){return n().agentId},variant:"emphasized",get state(){return t(Ot)},get specialist(){return n().specialist}}),$(Lt);var Zt=C(Lt,2),_e=H(Zt,!0),Jt=C(Zt,2),te=L(Jt);{var ye=ft=>{var r=Va(),f=L(r),M=L(f);{let z=y(()=>s().kind==="blocker"?Ma:Wa);pe(M,{get icon(){return t(z)},size:"xs"})}var W=C(M,2),m=H(W,!0);$(f);var K=C(f,2);{var nt=z=>{var It=Ua(),ot=H(It,!0);k(()=>B(ot,s().reason)),_(z,It)};at(K,z=>{s().reason&&z(nt)})}var S=C(K,2);{var G=z=>{Oa(z,{get date(){return s().timestamp},class:"text-ui text-ghost"})};at(S,z=>{s().timestamp&&z(G)})}$(r),k(z=>{Xt(r,1,`text-sm flex flex-col items-center gap-0.5 ${s().kind==="blocker"?"text-red-500":"text-warning-ink"}`),B(m,z)},[()=>s().kind==="blocker"?Q.chat_agentCard_attentionBlocker_label():Q.chat_agentCard_attentionDiscussion_label()]),_(ft,r)},yt=ft=>{var r=Qa(),f=L(r);pe(f,{get icon(){return Fa},size:"xs",class:"animate-pulse"});var M=C(f,2),W=H(M,!0);$(r),k(m=>B(W,m),[()=>Q.agentOverview_hierarchyCard_waitingFor_label({names:t(E).join(", ")})]),_(ft,r)},Ie=ft=>{const r=y(()=>n().activeToolName?$a(n().activeToolName,n().activeToolInput||{}):null),f=y(()=>t(r)&&!t(r).hidden?t(r):null);var M=tn(),W=L(M),m=L(W);ea(m,{size:14});var K=C(m,2);{var nt=Y=>{var Z=Oe(),pt=H(Z,!0);k(Et=>B(pt,Et),[()=>Q.agentOverview_hierarchyCard_thinking_label()]),_(Y,Z)},S=Y=>{var Z=Za(),pt=H(Z);k(()=>B(pt,`${t(f).verb??""}
|
|
3
|
+
${t(f).subject??""}`)),_(Y,Z)},G=Y=>{var Z=Oe(),pt=H(Z);k(()=>B(pt,`${t(f).verb??""}...`)),_(Y,Z)},z=Y=>{var Z=Oe(),pt=H(Z,!0);k(Et=>B(pt,Et),[()=>Q.agentOverview_hierarchyCard_responding_label()]),_(Y,Z)};at(K,Y=>{i()?Y(nt):t(f)&&t(f).subject?Y(S,1):t(f)?Y(G,2):Y(z,-1)})}$(W);var It=C(W,2);{var ot=Y=>{var Z=Ja(),pt=H(Z,!0);k(()=>B(pt,n().lastResponse)),_(Y,Z)};at(It,Y=>{!t(f)&&n().lastResponse&&Y(ot)})}$(M),_(ft,M)},xe=ft=>{var r=en(),f=H(r,!0);k(()=>B(f,n().lastResponse)),_(ft,r)};at(te,ft=>{s()?ft(ye):c()?ft(yt,1):u()||i()?ft(Ie,2):n().lastResponse&&ft(xe,3)})}$(Jt),k(()=>B(_e,n().name)),_(D,Rt)},$$slots:{default:!0}})}var ge=C(Ft,2);{var Dt=A=>{var D=Le(),Tt=L(D);pe(Tt,{get icon(){return Ba},size:"xs",class:"inline"});var Rt=C(Tt);$(D),k(Lt=>B(Rt,` ${Lt??""}`),[()=>Q.agentOverview_hierarchyCard_note_label()]),_(A,D)};at(ge,A=>{R()&&u()&&A(Dt)})}$(ht),_(e,ht);var Qt=de(Bt);return l(),Qt}const sn=50;var rn=F('<span class="sr-only"> </span> <!>',1);function Re(e,a){if(new.target)return oe({component:Re,...e});le(a,!0);const s=()=>$t(R,"$attentionRequest$",c),g=()=>$t(h,"$agentSession$",c),u=()=>$t(p,"$agentIsWaitingForOtherAgents$",c),[c,d]=Me();let i=st(a,"agent",7),o=st(a,"onclick",7),l=st(a,"onmouseenter",7),n=st(a,"onmouseleave",7);const p=We(i().agentId),R=ia(i().agentId),h=oa(i().agentId),v=y(()=>{const x={attentionKind:s()?.kind??null};return g()?na(g(),x):sa({status:i().status,isResponding:i().status==="responding",isWaitingForOtherAgents:u()},{...x,isCompleted:i().status==="completed",isFailed:i().status==="failed"})});var b={get agent(){return i()},set agent(x){i(x),rt()},get onclick(){return o()},set onclick(x){o(x),rt()},get onmouseenter(){return l()},set onmouseenter(x){l(x),rt()},get onmouseleave(){return n()},set onmouseleave(x){n(x),rt()},$set:ie,$on:(x,it)=>ce(a,x,it)};Ut(e,{variant:"ghost",type:"button",class:"background-agent-card relative flex flex-col items-center justify-center gap-1 rounded-full bg-sidebar hover:bg-muted/70 transition-colors cursor-pointer p-2",get style(){return`width: 50px; min-height: 50px; anchor-name: --agent-hierarchy-${i().agentId??""};`},get onclick(){return o()},get onmouseenter(){return l()},get onmouseleave(){return n()},children:(x,it)=>{var E=rn(),I=Yt(E),P=H(I,!0),ct=C(I,2);aa(ct,{get agentId(){return i().agentId},size:32,get state(){return t(v)},get specialist(){return i().specialist}}),k(()=>B(P,i().name)),_(x,E)},$$slots:{default:!0}});var N=de(b);return d(),N}var re=he('<path fill="none"></path>'),on=F('<div class="batch-group-box relative z-10 bg-background border border-border rounded-xl"></div>'),cn=F('<svg class="connector-svg" style="overflow: visible; display: block;"><!><!></svg> <div class="children-items-row flex items-start justify-center"></div>',1),ln=F('<div class="children-wrapper flex flex-col items-center"></div>'),dn=F('<div class="agent-tree-node flex flex-col items-center"><div class="agent-card-wrapper relative z-10"><!></div> <!></div>'),gn=F('<div class="absolute inset-0 flex items-center justify-center"><div class="text-center text-subtle"><p class="text-lg font-medium"> </p> <p class="text-sm mt-1"> </p></div></div>'),un=F('<div class="utility-corral border border-dashed border-border rounded-lg p-3 min-w-20"><div class="corral-label text-xs text-subtle font-medium mb-2 text-center"> </div> <div class="corral-agents flex flex-col items-center gap-2"></div></div>'),fn=F('<div class="utility-corrals flex flex-col gap-4"></div>'),pn=F('<div class="text-xs text-subtle capitalize"> </div>'),vn=F('<span class="px-1.5 py-0.5 text-ui font-medium bg-muted text-subtle rounded"> </span>'),hn=F('<span class="text-warning-ink"> </span>'),mn=F('<span class="text-primary-ink"> </span>'),_n=F('<span class="text-green-500"> </span>'),yn=F('<span class="text-red-500"> </span>'),In=F("<span> </span>"),xn=F('<div class="text-xs text-subtle line-clamp-3 border-t border-border pt-2 mt-2"> </div>'),wn=F('<div class="text-xs text-subtle flex items-center gap-1"><!> <span> </span></div>'),bn=F('<div class="p-3 space-y-2"><div class="flex items-center gap-2"><!> <div class="flex-1 min-w-0"><div class="font-medium text-sm truncate"> </div> <!></div> <!></div> <div class="text-xs text-subtle"><!></div> <div class="text-xs text-subtle"> </div> <!> <!></div>'),An=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"></line></svg>'),kn=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>'),$n=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"></path></svg>'),Tn=F('<div class="canvas-content absolute inset-0 flex items-center justify-center p-8 svelte-13q5gm4"><div class="hierarchy-wrapper flex items-start gap-8"><!> <div class="main-hierarchy flex flex-col items-center gap-4"><div class="hierarchy-container flex flex-col items-center gap-4"><div class="roots-row flex justify-center"></div></div></div></div> <!></div> <div class="zoom-controls absolute bottom-4 right-4 flex items-center gap-1 bg-card border border-border rounded-lg shadow-sm p-1"><!> <!> <!> <div class="w-px h-6 bg-border mx-1"></div> <!></div> <div class="absolute bottom-4 left-4 text-xs text-subtle"> </div>',1),Cn=F('<div class="agent-hierarchy-graph relative w-full h-full overflow-hidden bg-background svelte-13q5gm4"><!></div>');function la(e,a){if(new.target)return oe({component:la,...e});le(a,!0);const s=(r,f=wa,M)=>{const W=y(()=>f().agent.isBackground),m=y(()=>f().children.length>0),K=y(()=>t(m)&&f().children[0]?.agent.isBackground?sn:Xa),nt=y(()=>16),S=y(()=>60),G=y(()=>t(m)?Rt(f().children,t(K),i):[]),z=y(()=>(()=>{const O=[];for(let q=0;q<t(G).length;q+=Tt)O.push(t(G).slice(q,q+Tt));return O})()),It=y(()=>t(z).map(O=>O.reduce((q,J)=>q+J.width,0)+Math.max(0,O.length-1)*i)),ot=y(()=>Math.max(...t(It),0));var Y=dn(),Z=L(Y),pt=L(Z);{var Et=O=>{Re(O,{get agent(){return f().agent},onclick:q=>te(f().agent,q),onmouseenter:()=>x(f().agent.agentId),onmouseleave:it})},we=O=>{ca(O,{get agent(){return f().agent},get activeFile(){return f().activeFile},get activeNote(){return f().activeNote},get agentNames(){return t(Lt)},onclick:q=>te(f().agent,q),onmouseenter:()=>x(f().agent.agentId),onmouseleave:it})};at(pt,O=>{t(W)?O(Et):O(we,-1)})}$(Z);var be=C(Z,2);{var U=O=>{const q=y(()=>f().agent.status==="waiting"?f().agent.waitingForAgentIds||[]:[]),J=y(()=>t(q).length>0),et=y(()=>t(S)/2);var xt=ln();jt(xt,21,()=>t(z),Se,(Kt,At,Ct)=>{const Pt=y(()=>t(It)[Ct]),ee=y(()=>(t(ot)-t(Pt))/2),Ae=y(()=>(()=>{let ut=0;return t(At).map(j=>{const Nt=ut+j.width/2;return ut+=j.width+i,Nt})})());var ue=cn(),Gt=Yt(ue);gt(Gt,"height",t(S));var qt=L(Gt);{var ke=ut=>{var j=re();k(()=>{gt(j,"d",`M ${t(ot)/2} -${Ya} L ${t(ot)/2} ${t(S)/3}`),gt(j,"stroke",t(J)?"var(--primary-ink)":"currentColor"),Xt(j,0,se(t(J)?"":"text-border")),gt(j,"stroke-width",t(J)?2:1)}),_(ut,j)},$e=ut=>{var j=re();k(()=>{gt(j,"d",`M ${t(ot)/2} 0 L ${t(ot)/2} ${t(S)/3}`),gt(j,"stroke",t(J)?"var(--primary-ink)":"currentColor"),Xt(j,0,se(t(J)?"":"text-border")),gt(j,"stroke-width",t(J)?2:1)}),_(ut,j)};at(qt,ut=>{Ct>0?ut(ke):ut($e,-1)})}var Te=C(qt);jt(Te,17,()=>t(At),Se,(ut,j,Nt)=>{const vt=y(()=>t(ee)+t(Ae)[Nt]),lt=y(()=>t(ot)/2),zt=y(()=>t(j).type==="batch"?t(j).children.some(wt=>t(q).includes(wt.agent.agentId)):t(q).includes(t(j).child.agent.agentId)),mt=y(()=>t(zt)?"var(--color-primary)":"currentColor"),kt=y(()=>t(zt)?"":"text-border"),w=y(()=>t(zt)?2:1),T=y(()=>t(j).type==="batch"?t(S)-A:t(S)),tt=y(()=>Math.abs(t(vt)-t(lt))),X=y(()=>Math.min(t(nt),t(tt)/2));var fe=De(),Ce=Yt(fe);{var va=wt=>{var dt=re();k(()=>{gt(dt,"d",`M ${t(lt)??""} ${t(S)/3} L ${t(lt)??""} ${t(T)??""}`),gt(dt,"stroke",t(mt)),Xt(dt,0,se(t(kt)),"svelte-13q5gm4"),gt(dt,"stroke-width",t(w))}),_(wt,dt)},ha=wt=>{var dt=re();k(()=>{gt(dt,"d",`M ${t(lt)??""} ${t(S)/3}
|
|
4
4
|
L ${t(lt)??""} ${t(et)-t(X)}
|
|
5
5
|
Q ${t(lt)??""} ${t(et)??""}, ${t(lt)-t(X)} ${t(et)??""}
|
|
6
6
|
L ${t(vt)+t(X)} ${t(et)??""}
|
|
@@ -10,5 +10,5 @@ import{t as oe,bo as st,bm as Z,bw as ie,bs as $t,bq as Me,b as ce}from"./CLAmm_
|
|
|
10
10
|
Q ${t(lt)??""} ${t(et)??""}, ${t(lt)+t(X)} ${t(et)??""}
|
|
11
11
|
L ${t(vt)-t(X)} ${t(et)??""}
|
|
12
12
|
Q ${t(vt)??""} ${t(et)??""}, ${t(vt)??""} ${t(et)+t(X)}
|
|
13
|
-
L ${t(vt)??""} ${t(T)??""}`),gt(dt,"stroke",t(mt)),Xt(dt,0,se(t(kt)),"svelte-13q5gm4"),gt(dt,"stroke-width",t(w))}),_(wt,dt)};at(Ce,wt=>{t(tt)<1?wt(va):t(vt)<t(lt)?wt(ha,1):wt(ma,-1)})}_(ut,fe)}),$(Gt);var ae=C(Gt,2);jt(ae,21,()=>t(At),Se,(ut,j)=>{var Nt=De(),vt=Yt(Nt);{var lt=mt=>{var kt=on();jt(kt,21,()=>t(j).children,w=>w.agent.agentId,(w,T)=>{s(w,()=>t(T))}),$(kt),k(()=>ne(kt,`padding: 10px; margin-top: -10px; display: grid; grid-template-columns: repeat(${t(j).cols??""}, auto); gap: 12px;`)),_(mt,kt)},zt=mt=>{s(mt,()=>t(j).child)};at(vt,mt=>{t(j).type==="batch"?mt(lt):mt(zt,-1)})}_(ut,Nt)}),$(ae),k(()=>{gt(Gt,"width",t(ot)),ne(ae,`gap: 12px; width: ${t(ot)??""}px;`)}),_(Ht,ue)}),$(xt),k(()=>ne(xt,`width: ${t(ot)??""}px;`)),_(F,xt)};at(be,F=>{t(m)&&F(U)})}$(Y),_(r,Y)};let g=st(a,"agents",7),u=st(a,"edges",7),c=st(a,"onAgentClick",7),d=st(a,"onFocus",7);const i=12,o=[{id:"git",label:"Git",types:["commit-message","pr-description"]},{id:"review",label:Z.agentOverview_hierarchyGraph_reviewCorral_label(),types:["code-review","code-walkthrough"]}];let l=Mt(1),n=Mt(0),p=Mt(0),R=Mt(!1),h=Mt(_a({x:0,y:0})),v=Mt(null),b=Mt(null),N=Mt(null);function x(r){t(N)&&clearTimeout(t(N)),V(b,r,!0)}function it(){t(N)&&(clearTimeout(t(N)),V(N,null)),V(b,null)}const E=y(()=>t(b)?g().find(r=>r.agentId===t(b)):null),I=.25,P=2,ct=.1;function _t(r){if(r.preventDefault(),r.ctrlKey||r.metaKey){const f=-r.deltaY*.001,M=Math.min(P,Math.max(I,t(l)*(1+f)));if(t(v)){const W=t(v).getBoundingClientRect(),m=r.clientX-W.left,H=r.clientY-W.top,nt=M/t(l);V(n,m-(m-t(n))*nt),V(p,H-(H-t(p))*nt)}V(l,M,!0)}else V(n,t(n)-r.deltaX),V(p,t(p)-r.deltaY)}function Ft(r){const f=r.target,M=f.closest(".agent-hierarchy-graph")&&!f.closest(".agent-card")&&!f.closest(".bg-agent-card")&&!f.closest(".zoom-controls");(r.button===1||r.button===0&&(r.shiftKey||M))&&(V(R,!0),V(h,{x:r.clientX,y:r.clientY},!0),r.preventDefault()),r.button===0&&d()?.()}function Bt(r){if(!t(R))return;const f=r.clientX-t(h).x,M=r.clientY-t(h).y;V(n,t(n)+f),V(p,t(p)+M),V(h,{x:r.clientX,y:r.clientY},!0)}function ht(){V(R,!1)}function bt(){V(l,Math.min(P,t(l)+ct),!0)}function Kt(){V(l,Math.max(I,t(l)-ct),!0)}function Ot(){V(l,1),V(n,0),V(p,0)}function ge(){V(l,.8),V(n,0),V(p,0)}const Dt=y(()=>Math.round(t(l)*100)),Zt=5e3,A=10,D=4,Tt=6;function Rt(r,f,M){if(r.length===0)return[];const W=[],m=new Map;for(const S of r){const G=S.agent.delegationBatchId;G&&(m.has(G)||m.set(G,[]),m.get(G).push(S))}const H=new Set;for(const S of r){const G=S.agent.delegationBatchId;if(G)H.has(G)||(H.add(G),W.push(m.get(G)));else{const z=W[W.length-1];if(z&&!z[0].agent.delegationBatchId){const It=new Date(z[z.length-1].agent.createdAt).getTime();if(new Date(S.agent.createdAt).getTime()-It<=Zt){z.push(S);continue}}W.push([S])}}const nt=f+M;return W.map(S=>{if(S.length===1)return{type:"single",child:S[0],width:f};const G=Math.min(Math.ceil(Math.sqrt(S.length)),D),z=Math.ceil(S.length/G);return{type:"batch",children:S,cols:G,rows:z,width:G*nt-M+A*2}})}const Lt=y(()=>{const r=new Map;for(const f of g())r.set(f.agentId,f.name);return r}),me=new Set(o.flatMap(r=>[...r.types])),Qt=y(()=>{const r=[];for(const f of o){const M=new Set(f.types),W=g().filter(m=>m.agentType&&M.has(m.agentType));W.length>0&&r.push({id:f.id,label:f.label,agents:W})}return r}),_e=y(()=>g().filter(r=>!r.agentType||!me.has(r.agentType))),Jt=y(()=>{const r=new Map,f=[];for(const m of t(_e))r.set(m.agentId,{agent:m,children:[],activeFile:void 0,activeNote:void 0});const M=u().filter(m=>m.isActive);for(const m of M){const H=m.sourceId.replace("agent-",""),nt=r.get(H);nt&&(m.type==="file-read"||m.type==="file-write"?nt.activeFile=m.targetId.replace("file-","").split("/").pop():(m.type==="note-read"||m.type==="note-write")&&(nt.activeNote=m.targetId.replace("note-","")))}for(const[,m]of r){const H=m.agent.parentAgentId;H&&r.has(H)?r.get(H).children.push(m):f.push(m)}const W=(m,H)=>new Date(m.agent.createdAt).getTime()-new Date(H.agent.createdAt).getTime();for(const[,m]of r)m.children.sort(W);return f.sort(W),f});function te(r,f){c()?.(r.agentId,r.name,f)}var ye={get agents(){return g()},set agents(r){g(r),rt()},get edges(){return u()},set edges(r){u(r),rt()},get onAgentClick(){return c()},set onAgentClick(r){c(r),rt()},get onFocus(){return d()},set onFocus(r){d(r),rt()},$set:ie,$on:(r,f)=>ce(a,r,f)},yt=Cn(),Ie=L(yt);{var xe=r=>{var f=gn(),M=L(f),W=L(M),m=K(W,!0),H=C(W,2),nt=K(H,!0);$(M),$(f),k((S,G)=>{B(m,S),B(nt,G)},[()=>Z.agentOverview_hierarchyGraph_noAgents_title(),()=>Z.agentOverview_hierarchyGraph_noAgents_description()]),_(r,f)},ft=r=>{var f=Tn(),M=Yt(f),W=L(M),m=L(W);{var H=U=>{var F=fn();jt(F,21,()=>t(Qt),q=>q.id,(q,J)=>{var et=un(),xt=L(et),Ht=K(xt,!0),At=C(xt,2);jt(At,21,()=>t(J).agents,Ct=>Ct.agentId,(Ct,Pt)=>{Re(Ct,{get agent(){return t(Pt)},onclick:ee=>te(t(Pt),ee),onmouseenter:()=>x(t(Pt).agentId),onmouseleave:it})}),$(At),$(et),k(()=>B(Ht,t(J).label)),_(q,et)}),$(F),_(U,F)};at(m,U=>{t(Qt).length>0&&U(H)})}var nt=C(m,2),S=L(nt),G=L(S);ne(G,"gap: 12px;"),jt(G,21,()=>t(Jt),U=>U.agent.agentId,(U,F)=>{s(U,()=>t(F))}),$(G),$(S),$(nt),$(W);var z=C(W,2);{var It=U=>{{let F=y(()=>"--agent-hierarchy-"+t(b));Da(U,{get anchor(){return t(F)},position:"top",absolute:!0,children:(q,J)=>{var et=bn(),xt=L(et),Ht=L(xt);La(Ht,{variant:"emphasized",get agentId(){return t(E).agentId}});var At=C(Ht,2),Ct=L(At),Pt=K(Ct,!0),ee=C(Ct,2);{var Ae=w=>{var T=pn(),tt=K(T,!0);k(X=>B(tt,X),[()=>t(E).specialist.replace("-"," ")]),_(w,T)};at(ee,w=>{t(E).specialist&&w(Ae)})}$(At);var ue=C(At,2);{var Gt=w=>{var T=vn(),tt=K(T,!0);k(X=>B(tt,X),[()=>Z.agentOverview_hierarchyGraph_background_badge()]),_(w,T)};at(ue,w=>{t(E).isBackground&&w(Gt)})}$(xt);var qt=C(xt,2),ke=L(qt);{var $e=w=>{var T=hn(),tt=K(T);k(X=>B(tt,`● ${X??""}`),[()=>Z.agentOverview_hierarchyGraph_statusWaiting_label()]),_(w,T)},Te=w=>{var T=mn(),tt=K(T);k(X=>B(tt,`● ${X??""}`),[()=>Z.agentOverview_hierarchyGraph_statusResponding_label()]),_(w,T)},ae=w=>{var T=_n(),tt=K(T);k(X=>B(tt,`● ${X??""}`),[()=>Z.agentOverview_hierarchyGraph_statusCompleted_label()]),_(w,T)},ut=w=>{var T=yn(),tt=K(T);k(X=>B(tt,`● ${X??""}`),[()=>Z.agentOverview_hierarchyGraph_statusFailed_label()]),_(w,T)},j=w=>{var T=In(),tt=K(T);k(X=>B(tt,`● ${X??""}`),[()=>Z.agentOverview_hierarchyGraph_statusIdle_label()]),_(w,T)};at(ke,w=>{t(E).status==="waiting"?w($e):t(E).status==="responding"?w(Te,1):t(E).status==="completed"?w(ae,2):t(E).status==="failed"?w(ut,3):w(j,-1)})}$(qt);var Nt=C(qt,2),vt=K(Nt,!0),lt=C(Nt,2);{var zt=w=>{var T=xn(),tt=K(T,!0);k(()=>B(tt,t(E).lastResponse)),_(w,T)};at(lt,w=>{t(E).lastResponse&&w(zt)})}var mt=C(lt,2);{var kt=w=>{var T=wn(),tt=L(T);ea(tt,{size:12});var X=C(tt,2),fe=K(X,!0);$(T),k(Ce=>B(fe,Ce),[()=>Z.agentOverview_hierarchyGraph_usingTool_label({tool:t(E).activeToolName})]),_(w,T)};at(mt,w=>{t(E).activeToolName&&w(kt)})}$(et),k(w=>{B(Pt,t(E).name),B(vt,w)},[()=>Z.agentOverview_hierarchyGraph_created_label({time:Ea(t(E).createdAt)})]),_(q,et)},$$slots:{default:!0}})}};at(z,U=>{t(E)&&U(It)})}$(M);var ot=C(M,2),Y=L(ot);{let U=y(()=>Z.agentOverview_hierarchyGraph_zoomOut_tooltip());Ut(Y,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:Kt,get title(){return t(U)},children:(F,q)=>{var J=An();_(F,J)},$$slots:{default:!0}})}var Q=C(Y,2);{let U=y(()=>Z.agentOverview_hierarchyGraph_resetZoom_tooltip());Ut(Q,{variant:"ghost",type:"button",class:"zoom-percent w-12 h-8 flex items-center justify-center text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors",onclick:Ot,get title(){return t(U)},children:(F,q)=>{Ia();var J=xa();k(()=>B(J,`${t(Dt)??""}%`)),_(F,J)},$$slots:{default:!0}})}var pt=C(Q,2);{let U=y(()=>Z.agentOverview_hierarchyGraph_zoomIn_tooltip());Ut(pt,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:bt,get title(){return t(U)},children:(F,q)=>{var J=kn();_(F,J)},$$slots:{default:!0}})}var Et=C(pt,4);{let U=y(()=>Z.agentOverview_hierarchyGraph_fitToView_tooltip());Ut(Et,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:ge,get title(){return t(U)},children:(F,q)=>{var J=$n();_(F,J)},$$slots:{default:!0}})}$(ot);var we=C(ot,2),be=K(we,!0);k(U=>{ne(M,`transform: translate(${t(n)??""}px, ${t(p)??""}px) scale(${t(l)??""}); transform-origin: center center;`),B(be,U)},[()=>Z.agentOverview_hierarchyGraph_panHint_label()]),_(r,f)};at(Ie,r=>{t(Jt).length===0?r(xe):r(ft,-1)})}return $(yt),ba(yt,r=>V(v,r),()=>t(v)),Be("wheel",yt,_t),Ne("mousedown",yt,Ft),Ne("mousemove",yt,Bt),Ne("mouseup",yt,ht),Be("mouseleave",yt,ht),_(e,yt),de(ye)}ya(["mousedown","mousemove","mouseup"]);const Ee=new Set(["str-replace-editor","save-file","remove-files","str_replace_editor"]),Pe=new Set(["create_note","update_note","set_note_content","add_to_note","append_to_note","edit_note","edit_note_lines","update_note_metadata","read_note","view_note","delete_note"]),Nn=new Set(["read_note","view_note","list_note_tasks"]),Ge=new Set(["add_tasks","update_tasks","view_tasklist","reorganize_tasklist"]),Sn=new Set(["view_tasklist"]),ze=new Set(["delegate_task","create_sub_agent","create_agent"]),Fn=5e3;function On(e,a=!1){if(!e)return"idle";if(e.status===St.Completed)return"completed";if(e.status===St.Error||e.status===St.Deleted)return"failed";if(a||da(e))return"responding";if(ga(e.status))return"idle";if(e.messages&&e.messages.length>0){const s=[...e.messages].reverse().find(g=>g.role==="assistant");if(s&&(s.isStreaming||s.streamingComplete===!1))return"responding"}switch(e.status){case St.Active:return"idle";case St.Pending:case St.Idle:return"idle";case St.Processing:return a?"responding":"idle";case St.Waiting:return"waiting";default:return"idle"}}function da(e){return!!(e.isProcessing||e.isStreaming||e.isResponding)}function ga(e){return e===St.Idle||e==="idle"}function Rn(e){const a={};if(!e)return a;if(e.lastAgentResponse){const s=Ta(e.lastAgentResponse);s&&(a.lastResponse=s)}return ga(e.status)&&!da(e)||e.isStreaming&&e.lastToolUse?.name&&(a.activeToolName=e.lastToolUse.name,a.activeToolInput=e.lastToolUse.input||{}),a}function Wt(e){return(e.name||e.toolName||"").toLowerCase()}function Vt(e){return"input"in e&&e.input?e.input:"arguments"in e&&e.arguments?e.arguments:"parameters"in e&&e.parameters?e.parameters:{}}function Mn(e){const a=e.toLowerCase();if(Ee.has(e))return!0;for(const s of Ee)if(a.startsWith(s.toLowerCase()))return!0;return!!(a.startsWith("edit ")||a.startsWith("save ")||a.startsWith("create "))}function ua(e){const a=e.toLowerCase();return!!(a.startsWith("read `")&&!a.includes("read `.`")||a.startsWith("view")||a==="view")}function je(e){if(Pe.has(e))return!0;for(const a of Pe)if(e.startsWith(a))return!0;return!1}function Wn(e){return e==="save-file"?"create":e==="remove-files"?"delete":"modify"}function Ke(e){return e==="create_note"?"create":Nn.has(e)?"read":"write"}function He(e){if(Ge.has(e))return!0;for(const a of Ge)if(e.startsWith(a))return!0;return!1}function qe(e){return e==="add_tasks"?"create":Sn.has(e)?"read":"update"}function fa(e){if(e==="."||e==="./"||e.endsWith("/"))return!0;const s=(e.split("/").pop()||e).lastIndexOf(".");return s===-1||s===0}function Bn(e){const a=e.match(/`([^`]+)`/);if(a&&a[1]){const s=a[1];return fa(s)?null:s}return null}function Xe(e,a){const s=e.path||e.file_path||e.filePath;return typeof s=="string"?fa(s)?null:s:a?Bn(a):null}function Ye(e){const a=e.noteId||e.note_id||e.title;return typeof a=="string"?a:null}function Ue(e){return Mn(e)||ua(e)}function Ve(e){return ua(e)?"read":Wn(e)}function Dn(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!Ue(i))continue;const o=Vt(d),l=Xe(o,d.name||d.toolName);!l||g.has(l)||(g.add(l),s.push({path:l,type:Ve(i),timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!Ue(i))continue;const o=Vt(d),l=Xe(o,d.name);!l||g.has(l)||(g.add(l),s.push({path:l,type:Ve(i),timestamp:c}))}}return s}function Ln(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!je(i))continue;const o=Vt(d),l=Ye(o);!l||g.has(l)||(g.add(l),s.push({noteId:l,title:o.title||l,action:Ke(i),timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!je(i))continue;const o=Vt(d),l=Ye(o);!l||g.has(l)||(g.add(l),s.push({noteId:l,title:o.title||l,action:Ke(i),timestamp:c}))}}return s}function Ze(e){const a=[],s=e.tasks;if(Array.isArray(s)){for(const g of s)if(typeof g=="object"&&g!==null){const u=g,c=u.name;c&&a.push({taskId:`task-${c.toLowerCase().replace(/\s+/g,"-").slice(0,30)}`,name:c,description:u.description,state:u.state})}}if(Array.isArray(s)){for(const g of s)if(typeof g=="object"&&g!==null){const u=g,c=u.task_id;c&&!a.some(d=>d.taskId===c)&&a.push({taskId:c,name:u.name||c,description:u.description,state:u.state})}}return a}function Qe(e){if(!e)return"not_started";const a=e.toLowerCase();return a==="complete"||a==="completed"||a==="done"?"complete":a==="in_progress"||a==="in-progress"||a==="started"?"in_progress":a==="cancelled"||a==="canceled"?"cancelled":"not_started"}function En(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!He(i))continue;const o=Vt(d),l=qe(i),n=Ze(o);for(const p of n)g.has(p.taskId)||(g.add(p.taskId),s.push({taskId:p.taskId,name:p.name,description:p.description,state:Qe(p.state),action:l,timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!He(i))continue;const o=Vt(d),l=qe(i),n=Ze(o);for(const p of n)g.has(p.taskId)||(g.add(p.taskId),s.push({taskId:p.taskId,name:p.name,description:p.description,state:Qe(p.state),action:l,timestamp:c}))}}return s}function Je(e){if(ze.has(e))return!0;for(const a of ze)if(e.startsWith(a))return!0;return!1}function ta(e){if(!e)return null;const a=e.match(/Agent ID:\s*(\S+)/i);return a?a[1]:null}function ve(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.filter(a=>a&&typeof a=="object"&&a.type==="text"&&a.text).map(a=>a.text).join(`
|
|
14
|
-
`);if(e&&typeof e=="object"){const a=e;if(typeof a.text=="string")return a.text;if(typeof a.content=="string")return a.content}return""}function Pn(e,a){const s=new Map,g=new Map;let u=0;for(const c of e){const d=[];if(c.contentBlocks&&Array.isArray(c.contentBlocks)){for(const i of c.contentBlocks)if(i.type==="tool_use"&&i.name){const o=Wt(i);Je(o)&&i.id&&d.push(i.id)}}if(c.toolCalls&&Array.isArray(c.toolCalls))for(const i of c.toolCalls){const o=Wt(i);if(Je(o)){const l=i.id;l&&!d.includes(l)&&d.push(l)}}if(d.length>1){const i=`${a}-batch-${u}`;for(const o of d)g.set(o,i);u++}}for(const c of e){if(c.contentBlocks&&Array.isArray(c.contentBlocks)){for(const d of c.contentBlocks)if(d.type==="tool_result"&&d.tool_use_id){const i=d.tool_use_id,o=g.get(i);if(o){const l=ve(d.text)||ve(d.content)||ve(d.output),n=ta(l);n&&s.set(n,o)}}}if(c.toolCalls&&Array.isArray(c.toolCalls))for(const d of c.toolCalls){const i=d.id;if(!i)continue;const o=g.get(i);if(!o)continue;const l=d.result;if(l){const n=ve(l),p=ta(n);p&&s.set(p,o)}}}return s}function Gn(e){const a={id:e.id,timestamp:e.timestamp,agentId:e.actor?.id||"",agentName:e.actor?.name};if(e.type==="agent:created"){const s=e.data;return{...a,type:"agent-created",agentId:s?.agentId||a.agentId,agentName:s?.agentName||a.agentName,parentAgentId:s?.createdByAgentId}}if(e.type==="agent:idle"){const s=e.data;return{...a,type:"agent-idle",agentId:s?.agentId||a.agentId,parentAgentId:s?.parentAgentId}}if(e.type==="file:changed"&&e.actor?.type==="agent"){const s=e.data,g=s?.action,u=g==="create"||g==="modify"||g==="delete",c=s?.relativePath;return{...a,type:u?"file-write":"file-read",targetId:s?.path||c,targetName:c?.split("/").pop()}}if(e.type?.startsWith("note:")&&e.actor?.type==="agent"){const s=e.data,g=e.type==="note:created"||e.type==="note:updated";return{...a,type:g?"note-write":"note-read",targetId:s?.noteId,targetName:s?.title}}if(e.type==="agent:tool:call"){const s=e.data,g=s?.toolName?.toLowerCase()||"";if(g.includes("read")&&s?.filesModified?.[0])return{...a,type:"file-read",targetId:s.filesModified[0],targetName:s.filesModified[0].split("/").pop()};if((g.includes("write")||g.includes("edit"))&&s?.filesModified?.[0])return{...a,type:"file-write",targetId:s.filesModified[0],targetName:s.filesModified[0].split("/").pop()}}return null}function zn(e,a){const s=e.workspaceEvents.byWorkspaceId[a]?.events??[],g=[];for(const u of s){const c=Gn(u);c&&g.push(c)}return g.sort((u,c)=>new Date(u.timestamp).getTime()-new Date(c.timestamp).getTime())}function jn(e){return e.length===0?new Date().toISOString():new Date(Math.max(...e.map(a=>new Date(a.timestamp).getTime()))).toISOString()}const Kn=Oe.createSelector((e,a)=>{const s=zn(e,a),g=jn(s),u=Ca.select(e,a),c={};for(const o of Na.select(e,a))c[String(o.id)]=o;const d=e.workspaceNotes.byWorkspaceId[a],i=new Map;if(d)for(const o of Ga(d.notes))i.set(o.id,o);return Hn(s,c,g,!0,u,e,i)});function Hn(e,a,s,g,u,c,d){const i=new Date(s).getTime(),o=new Map;for(const I of u)o.set(I.path,I);const l=I=>d?.get(I)?.title||I,n=e.filter(I=>new Date(I.timestamp).getTime()<=i),p=[],R=[],h=new Map,v=new Set,b=[];let N=null;for(const[I,P]of Object.entries(a))if(za(P)==="topLevel"){N=I;break}for(const[I,P]of Object.entries(a)){if(h.has(I))continue;const ct=ja(P),_t=Rn(P),Ft=ra.select(c,I),Bt=We.select(c,I),ht=P.waitingForAgentIds;let bt=On(P,Ft);Bt?bt="waiting":(Ft||bt==="idle"&&_t.activeToolName)&&(bt="responding");const Kt={id:`agent-${I}`,type:"agent",agentId:I,name:P.name||"Agent",isCoordinator:I===N,isBackground:P.isBackground||!1,status:bt,specialist:P.metadata?.specialist||null,parentAgentId:ct,createdAt:String(P.createdAt||s),waitingForAgentIds:ht,activeToolName:_t.activeToolName,activeToolInput:_t.activeToolInput,lastResponse:_t.lastResponse,agentType:P.metadata?.agentType||null,x:0,y:0,vx:0,vy:0};if(h.set(I,Kt),p.push(Kt),ct&&a[ct]){const D=`del-${ct}-${I}`;v.has(D)||(v.add(D),b.push({key:D,sourceRawId:ct,targetRawId:I,edge:{id:D,type:"delegation",sourceId:`agent-${ct}`,targetId:`agent-${I}`,parentAgentId:ct,childAgentId:I,timestamp:String(P.createdAt||s),isActive:!1}}))}const Ot=P.messages||[];let Dt=Dn(Ot,s).map(D=>({...D,additions:o.get(D.path)?.additions,deletions:o.get(D.path)?.deletions}));Dt.length===0&&P.fileChanges&&P.fileChanges.length>0&&(Dt=P.fileChanges.map(D=>({path:D.path,type:D.type,timestamp:String(D.timestamp||s),additions:o.get(D.path)?.additions,deletions:o.get(D.path)?.deletions}))),qn(Dt,I,o,h,p,v,b,s);const Zt=Ln(Ot,s);Xn(Zt,I,l,h,p,v,b);const A=En(Ot,s);Yn(A,I,h,p,v,b)}for(const[I,P]of Object.entries(a)){const ct=P.messages||[];if(ct.length===0)continue;const _t=Pn(ct,I);if(_t.size!==0)for(const[Ft,Bt]of _t){const ht=h.get(Ft);ht&&ht.type==="agent"&&(ht.delegationBatchId=Bt)}}Un(n,g,i,a,o,l,h,p,v,b),Vn(p,u,a,N,h,v,R,g,s,c);for(const I of b)h.has(I.sourceRawId)&&h.has(I.targetRawId)&&R.push(I.edge);const x=e.map(I=>new Date(I.timestamp).getTime()),it=x.length>0?new Date(Math.min(...x)).toISOString():s,E=x.length>0?new Date(Math.max(...x)).toISOString():s;return{nodes:p,edges:R,currentTime:s,isLive:g,minTime:it,maxTime:E}}function qn(e,a,s,g,u,c,d,i){for(const o of e){const l=o.path;if(!l)continue;const n=o.type==="read",p=n?"file-read":"file-write",R=`file-${l}`;if(!g.has(l)){const v={id:R,type:"file",path:l,fileName:l.split("/").pop()||"",lastAction:o.type==="delete"?"delete":n?"read":"write",lastActionTimestamp:o.timestamp||i,x:0,y:0,vx:0,vy:0};g.set(l,v),u.push(v)}const h=`${p}-${a}-${l}`;if(!c.has(h)){c.add(h);const v=n?void 0:s.get(l);let b=n?void 0:o.additions??v?.additions,N=n?void 0:o.deletions??v?.deletions;if(!n&&b===void 0&&N===void 0){const x=l.split("").reduce((it,E)=>it+E.charCodeAt(0),0);o.type==="create"?(b=x%80+20,N=0):o.type==="modify"?(b=x%50+5,N=x%20+2):(b=x%30+3,N=x%15+1)}d.push({key:h,sourceRawId:a,targetRawId:l,edge:{id:h,type:p,sourceId:`agent-${a}`,targetId:R,agentId:a,filePath:l,timestamp:o.timestamp||i,isActive:!1,additions:b,deletions:N}})}}}function Xn(e,a,s,g,u,c,d){for(const i of e){const o=i.noteId,l=`note-${o}`;if(!g.has(o)){const R={id:l,type:"note",noteId:o,title:s(o),lastAction:i.action,lastActionTimestamp:i.timestamp,x:0,y:0,vx:0,vy:0};g.set(o,R),u.push(R)}const n=i.action==="read"?"note-read":"note-write",p=`${n}-${a}-${o}`;c.has(p)||(c.add(p),d.push({key:p,sourceRawId:a,targetRawId:o,edge:{id:p,type:n,sourceId:`agent-${a}`,targetId:l,agentId:a,noteId:o,timestamp:i.timestamp,isActive:!1}}))}}function Yn(e,a,s,g,u,c){for(const d of e){const i=d.taskId,o=`task-${i}`;if(!s.has(i)){const p={id:o,type:"task",taskId:i,name:d.name,description:d.description,state:d.state||"not_started",lastAction:d.action,lastActionTimestamp:d.timestamp,x:0,y:0,vx:0,vy:0};s.set(i,p),g.push(p)}const l=d.action==="create"?"task-create":"task-update",n=`${l}-${a}-${i}`;u.has(n)||(u.add(n),c.push({key:n,sourceRawId:a,targetRawId:i,edge:{id:n,type:l,sourceId:`agent-${a}`,targetId:o,agentId:a,taskId:i,timestamp:d.timestamp,isActive:!1}}))}}function Un(e,a,s,g,u,c,d,i,o,l){for(const n of e){const p=new Date(n.timestamp).getTime(),R=s-p<Fn;if((n.type==="agent-created"||n.type==="agent-idle")&&n.parentAgentId){const h=`del-${n.parentAgentId}-${n.agentId}`;o.has(h)||(o.add(h),l.push({key:h,sourceRawId:n.parentAgentId,targetRawId:n.agentId,edge:{id:h,type:"delegation",sourceId:`agent-${n.parentAgentId}`,targetId:`agent-${n.agentId}`,parentAgentId:n.parentAgentId,childAgentId:n.agentId,timestamp:n.timestamp,isActive:R}}))}if((n.type==="file-read"||n.type==="file-write")&&n.targetId){const h=`file-${n.targetId}`;if(!d.has(n.targetId)){const b={id:h,type:"file",path:n.targetId,fileName:n.targetName||n.targetId.split("/").pop()||"",lastAction:n.type==="file-write"?"write":"read",lastActionTimestamp:n.timestamp,x:0,y:0,vx:0,vy:0};d.set(n.targetId,b),i.push(b)}const v=`${n.type}-${n.agentId}-${n.targetId}`;if(!o.has(v)){o.add(v);const b=n.type==="file-write"?u.get(n.targetId):void 0;let N=b?.additions,x=b?.deletions;if(n.type==="file-write"&&N===void 0&&x===void 0){const it=n.targetId.split("").reduce((E,I)=>E+I.charCodeAt(0),0);N=it%50+5,x=it%20+2}l.push({key:v,sourceRawId:n.agentId,targetRawId:n.targetId,edge:{id:v,type:n.type,sourceId:`agent-${n.agentId}`,targetId:h,agentId:n.agentId,filePath:n.targetId,timestamp:n.timestamp,isActive:R,additions:N,deletions:x}})}}if((n.type==="note-read"||n.type==="note-write")&&n.targetId){const h=`note-${n.targetId}`;if(!d.has(n.targetId)){const b={id:h,type:"note",noteId:n.targetId,title:c(n.targetId)||n.targetName||n.targetId,lastAction:n.type==="note-write"?"write":"read",lastActionTimestamp:n.timestamp,x:0,y:0,vx:0,vy:0};d.set(n.targetId,b),i.push(b)}const v=`${n.type}-${n.agentId}-${n.targetId}`;o.has(v)||(o.add(v),l.push({key:v,sourceRawId:n.agentId,targetRawId:n.targetId,edge:{id:v,type:n.type,sourceId:`agent-${n.agentId}`,targetId:h,agentId:n.agentId,noteId:n.targetId,timestamp:n.timestamp,isActive:R}}))}}}function Vn(e,a,s,g,u,c,d,i,o,l){if(e.some(h=>h.type==="file")||a.length===0)return;const p=[];for(const h of Object.keys(s)){const v=Sa.select(l,h);v&&(v.additions>0||v.deletions>0)&&p.push(h)}const R=p.length>0?p[0]:g;if(!(!R||!u.has(R)))for(const h of a){const v=h.path;if(!v)continue;const b=`file-${v}`;if(!u.has(v)){const N={id:b,type:"file",path:v,fileName:v.split("/").pop()||"",lastAction:h.action?.toLowerCase()==="delete"?"delete":"write",lastActionTimestamp:o,x:0,y:0,vx:0,vy:0};u.set(v,N),e.push(N);const x=`file-write-${R}-${v}`;c.has(x)||(c.add(x),d.push({id:x,type:"file-write",sourceId:`agent-${R}`,targetId:b,agentId:R,filePath:v,timestamp:o,isActive:i,additions:h.additions,deletions:h.deletions}))}}}var Zn=O('<div class="agent-overview-panel flex flex-col h-full bg-background overflow-auto svelte-1337n58"><!></div>');function pa(e,a){if(new.target)return oe({component:pa,...e});le(a,!0);const s=()=>$t(i,"$graphState$",g),[g,u]=Me();let c=st(a,"workspaceId",7),d=st(a,"onFocus",7);const i=Kn(c());Oe.dispatch(Ka(c()));function o(v,b,N){const x=N.metaKey||N.ctrlKey,it=Pa(N.target);Oe.dispatch(Ha(c(),{agentId:v,sourcePanelId:it,openInAdjacentPanel:x}))}const l=y(()=>s().nodes.filter(v=>qa(v)));var n={get workspaceId(){return c()},set workspaceId(v){c(v),rt()},get onFocus(){return d()},set onFocus(v){d(v),rt()},$set:ie,$on:(v,b)=>ce(a,v,b)},p=Zn(),R=L(p);la(R,{get agents(){return t(l)},get edges(){return s().edges},onAgentClick:o,get onFocus(){return d()}}),$(p),_(e,p);var h=de(n);return u(),h}function Qn(e,a){if(new.target)return oe({component:Qn,...e});le(a,!0);let s=st(a,"workspaceId",7),g=st(a,"onFocus",7);var u={get workspaceId(){return s()},set workspaceId(c){s(c),rt()},get onFocus(){return g()},set onFocus(c){g(c),rt()},$set:ie,$on:(c,d)=>ce(a,c,d)};return pa(e,{get workspaceId(){return s()},get onFocus(){return g()}}),de(u)}export{Qn as default};
|
|
13
|
+
L ${t(vt)??""} ${t(T)??""}`),gt(dt,"stroke",t(mt)),Xt(dt,0,se(t(kt)),"svelte-13q5gm4"),gt(dt,"stroke-width",t(w))}),_(wt,dt)};at(Ce,wt=>{t(tt)<1?wt(va):t(vt)<t(lt)?wt(ha,1):wt(ma,-1)})}_(ut,fe)}),$(Gt);var ae=C(Gt,2);jt(ae,21,()=>t(At),Se,(ut,j)=>{var Nt=De(),vt=Yt(Nt);{var lt=mt=>{var kt=on();jt(kt,21,()=>t(j).children,w=>w.agent.agentId,(w,T)=>{s(w,()=>t(T))}),$(kt),k(()=>ne(kt,`padding: 10px; margin-top: -10px; display: grid; grid-template-columns: repeat(${t(j).cols??""}, auto); gap: 12px;`)),_(mt,kt)},zt=mt=>{s(mt,()=>t(j).child)};at(vt,mt=>{t(j).type==="batch"?mt(lt):mt(zt,-1)})}_(ut,Nt)}),$(ae),k(()=>{gt(Gt,"width",t(ot)),ne(ae,`gap: 12px; width: ${t(ot)??""}px;`)}),_(Kt,ue)}),$(xt),k(()=>ne(xt,`width: ${t(ot)??""}px;`)),_(O,xt)};at(be,O=>{t(m)&&O(U)})}$(Y),_(r,Y)};let g=st(a,"agents",7),u=st(a,"edges",7),c=st(a,"onAgentClick",7),d=st(a,"onFocus",7);const i=12,o=[{id:"git",label:"Git",types:["commit-message","pr-description"]},{id:"review",label:Q.agentOverview_hierarchyGraph_reviewCorral_label(),types:["code-review","code-walkthrough"]}];let l=Mt(1),n=Mt(0),p=Mt(0),R=Mt(!1),h=Mt(_a({x:0,y:0})),v=Mt(null),b=Mt(null),N=Mt(null);function x(r){t(N)&&clearTimeout(t(N)),V(b,r,!0)}function it(){t(N)&&(clearTimeout(t(N)),V(N,null)),V(b,null)}const E=y(()=>t(b)?g().find(r=>r.agentId===t(b)):null),I=.25,P=2,ct=.1;function _t(r){if(r.preventDefault(),r.ctrlKey||r.metaKey){const f=-r.deltaY*.001,M=Math.min(P,Math.max(I,t(l)*(1+f)));if(t(v)){const W=t(v).getBoundingClientRect(),m=r.clientX-W.left,K=r.clientY-W.top,nt=M/t(l);V(n,m-(m-t(n))*nt),V(p,K-(K-t(p))*nt)}V(l,M,!0)}else V(n,t(n)-r.deltaX),V(p,t(p)-r.deltaY)}function Ot(r){const f=r.target,M=f.closest(".agent-hierarchy-graph")&&!f.closest(".agent-card")&&!f.closest(".bg-agent-card")&&!f.closest(".zoom-controls");(r.button===1||r.button===0&&(r.shiftKey||M))&&(V(R,!0),V(h,{x:r.clientX,y:r.clientY},!0),r.preventDefault()),r.button===0&&d()?.()}function Bt(r){if(!t(R))return;const f=r.clientX-t(h).x,M=r.clientY-t(h).y;V(n,t(n)+f),V(p,t(p)+M),V(h,{x:r.clientX,y:r.clientY},!0)}function ht(){V(R,!1)}function bt(){V(l,Math.min(P,t(l)+ct),!0)}function Ht(){V(l,Math.max(I,t(l)-ct),!0)}function Ft(){V(l,1),V(n,0),V(p,0)}function ge(){V(l,.8),V(n,0),V(p,0)}const Dt=y(()=>Math.round(t(l)*100)),Qt=5e3,A=10,D=4,Tt=6;function Rt(r,f,M){if(r.length===0)return[];const W=[],m=new Map;for(const S of r){const G=S.agent.delegationBatchId;G&&(m.has(G)||m.set(G,[]),m.get(G).push(S))}const K=new Set;for(const S of r){const G=S.agent.delegationBatchId;if(G)K.has(G)||(K.add(G),W.push(m.get(G)));else{const z=W[W.length-1];if(z&&!z[0].agent.delegationBatchId){const It=new Date(z[z.length-1].agent.createdAt).getTime();if(new Date(S.agent.createdAt).getTime()-It<=Qt){z.push(S);continue}}W.push([S])}}const nt=f+M;return W.map(S=>{if(S.length===1)return{type:"single",child:S[0],width:f};const G=Math.min(Math.ceil(Math.sqrt(S.length)),D),z=Math.ceil(S.length/G);return{type:"batch",children:S,cols:G,rows:z,width:G*nt-M+A*2}})}const Lt=y(()=>{const r=new Map;for(const f of g())r.set(f.agentId,f.name);return r}),me=new Set(o.flatMap(r=>[...r.types])),Zt=y(()=>{const r=[];for(const f of o){const M=new Set(f.types),W=g().filter(m=>m.agentType&&M.has(m.agentType));W.length>0&&r.push({id:f.id,label:f.label,agents:W})}return r}),_e=y(()=>g().filter(r=>!r.agentType||!me.has(r.agentType))),Jt=y(()=>{const r=new Map,f=[];for(const m of t(_e))r.set(m.agentId,{agent:m,children:[],activeFile:void 0,activeNote:void 0});const M=u().filter(m=>m.isActive);for(const m of M){const K=m.sourceId.replace("agent-",""),nt=r.get(K);nt&&(m.type==="file-read"||m.type==="file-write"?nt.activeFile=m.targetId.replace("file-","").split("/").pop():(m.type==="note-read"||m.type==="note-write")&&(nt.activeNote=m.targetId.replace("note-","")))}for(const[,m]of r){const K=m.agent.parentAgentId;K&&r.has(K)?r.get(K).children.push(m):f.push(m)}const W=(m,K)=>new Date(m.agent.createdAt).getTime()-new Date(K.agent.createdAt).getTime();for(const[,m]of r)m.children.sort(W);return f.sort(W),f});function te(r,f){c()?.(r.agentId,r.name,f)}var ye={get agents(){return g()},set agents(r){g(r),rt()},get edges(){return u()},set edges(r){u(r),rt()},get onAgentClick(){return c()},set onAgentClick(r){c(r),rt()},get onFocus(){return d()},set onFocus(r){d(r),rt()},$set:ie,$on:(r,f)=>ce(a,r,f)},yt=Cn(),Ie=L(yt);{var xe=r=>{var f=gn(),M=L(f),W=L(M),m=H(W,!0),K=C(W,2),nt=H(K,!0);$(M),$(f),k((S,G)=>{B(m,S),B(nt,G)},[()=>Q.agentOverview_hierarchyGraph_noAgents_title(),()=>Q.agentOverview_hierarchyGraph_noAgents_description()]),_(r,f)},ft=r=>{var f=Tn(),M=Yt(f),W=L(M),m=L(W);{var K=U=>{var O=fn();jt(O,21,()=>t(Zt),q=>q.id,(q,J)=>{var et=un(),xt=L(et),Kt=H(xt,!0),At=C(xt,2);jt(At,21,()=>t(J).agents,Ct=>Ct.agentId,(Ct,Pt)=>{Re(Ct,{get agent(){return t(Pt)},onclick:ee=>te(t(Pt),ee),onmouseenter:()=>x(t(Pt).agentId),onmouseleave:it})}),$(At),$(et),k(()=>B(Kt,t(J).label)),_(q,et)}),$(O),_(U,O)};at(m,U=>{t(Zt).length>0&&U(K)})}var nt=C(m,2),S=L(nt),G=L(S);ne(G,"gap: 12px;"),jt(G,21,()=>t(Jt),U=>U.agent.agentId,(U,O)=>{s(U,()=>t(O))}),$(G),$(S),$(nt),$(W);var z=C(W,2);{var It=U=>{{let O=y(()=>"--agent-hierarchy-"+t(b));Da(U,{get anchor(){return t(O)},position:"top",absolute:!0,children:(q,J)=>{var et=bn(),xt=L(et),Kt=L(xt);La(Kt,{variant:"emphasized",get agentId(){return t(E).agentId}});var At=C(Kt,2),Ct=L(At),Pt=H(Ct,!0),ee=C(Ct,2);{var Ae=w=>{var T=pn(),tt=H(T,!0);k(X=>B(tt,X),[()=>t(E).specialist.replace("-"," ")]),_(w,T)};at(ee,w=>{t(E).specialist&&w(Ae)})}$(At);var ue=C(At,2);{var Gt=w=>{var T=vn(),tt=H(T,!0);k(X=>B(tt,X),[()=>Q.agentOverview_hierarchyGraph_background_badge()]),_(w,T)};at(ue,w=>{t(E).isBackground&&w(Gt)})}$(xt);var qt=C(xt,2),ke=L(qt);{var $e=w=>{var T=hn(),tt=H(T);k(X=>B(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusWaiting_label()]),_(w,T)},Te=w=>{var T=mn(),tt=H(T);k(X=>B(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusResponding_label()]),_(w,T)},ae=w=>{var T=_n(),tt=H(T);k(X=>B(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusCompleted_label()]),_(w,T)},ut=w=>{var T=yn(),tt=H(T);k(X=>B(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusFailed_label()]),_(w,T)},j=w=>{var T=In(),tt=H(T);k(X=>B(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusIdle_label()]),_(w,T)};at(ke,w=>{t(E).status==="waiting"?w($e):t(E).status==="responding"?w(Te,1):t(E).status==="completed"?w(ae,2):t(E).status==="failed"?w(ut,3):w(j,-1)})}$(qt);var Nt=C(qt,2),vt=H(Nt,!0),lt=C(Nt,2);{var zt=w=>{var T=xn(),tt=H(T,!0);k(()=>B(tt,t(E).lastResponse)),_(w,T)};at(lt,w=>{t(E).lastResponse&&w(zt)})}var mt=C(lt,2);{var kt=w=>{var T=wn(),tt=L(T);ea(tt,{size:12});var X=C(tt,2),fe=H(X,!0);$(T),k(Ce=>B(fe,Ce),[()=>Q.agentOverview_hierarchyGraph_usingTool_label({tool:t(E).activeToolName})]),_(w,T)};at(mt,w=>{t(E).activeToolName&&w(kt)})}$(et),k(w=>{B(Pt,t(E).name),B(vt,w)},[()=>Q.agentOverview_hierarchyGraph_created_label({time:Ea(t(E).createdAt)})]),_(q,et)},$$slots:{default:!0}})}};at(z,U=>{t(E)&&U(It)})}$(M);var ot=C(M,2),Y=L(ot);{let U=y(()=>Q.agentOverview_hierarchyGraph_zoomOut_tooltip());Ut(Y,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:Ht,get title(){return t(U)},children:(O,q)=>{var J=An();_(O,J)},$$slots:{default:!0}})}var Z=C(Y,2);{let U=y(()=>Q.agentOverview_hierarchyGraph_resetZoom_tooltip());Ut(Z,{variant:"ghost",type:"button",class:"zoom-percent w-12 h-8 flex items-center justify-center text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors",onclick:Ft,get title(){return t(U)},children:(O,q)=>{Ia();var J=xa();k(()=>B(J,`${t(Dt)??""}%`)),_(O,J)},$$slots:{default:!0}})}var pt=C(Z,2);{let U=y(()=>Q.agentOverview_hierarchyGraph_zoomIn_tooltip());Ut(pt,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:bt,get title(){return t(U)},children:(O,q)=>{var J=kn();_(O,J)},$$slots:{default:!0}})}var Et=C(pt,4);{let U=y(()=>Q.agentOverview_hierarchyGraph_fitToView_tooltip());Ut(Et,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:ge,get title(){return t(U)},children:(O,q)=>{var J=$n();_(O,J)},$$slots:{default:!0}})}$(ot);var we=C(ot,2),be=H(we,!0);k(U=>{ne(M,`transform: translate(${t(n)??""}px, ${t(p)??""}px) scale(${t(l)??""}); transform-origin: center center;`),B(be,U)},[()=>Q.agentOverview_hierarchyGraph_panHint_label()]),_(r,f)};at(Ie,r=>{t(Jt).length===0?r(xe):r(ft,-1)})}return $(yt),ba(yt,r=>V(v,r),()=>t(v)),Be("wheel",yt,_t),Ne("mousedown",yt,Ot),Ne("mousemove",yt,Bt),Ne("mouseup",yt,ht),Be("mouseleave",yt,ht),_(e,yt),de(ye)}ya(["mousedown","mousemove","mouseup"]);const Ee=new Set(["str-replace-editor","save-file","remove-files","str_replace_editor"]),Pe=new Set(["create_note","update_note","set_note_content","add_to_note","append_to_note","edit_note","edit_note_lines","update_note_metadata","read_note","view_note","delete_note"]),Nn=new Set(["read_note","view_note","list_note_tasks"]),Ge=new Set(["add_tasks","update_tasks","view_tasklist","reorganize_tasklist"]),Sn=new Set(["view_tasklist"]),ze=new Set(["delegate_task","create_sub_agent","create_agent"]),On=5e3;function Fn(e,a=!1){if(!e)return"idle";if(e.status===St.Completed)return"completed";if(e.status===St.Error||e.status===St.Deleted)return"failed";if(a||da(e))return"responding";if(ga(e.status))return"idle";if(e.messages&&e.messages.length>0){const s=[...e.messages].reverse().find(g=>g.role==="assistant");if(s&&(s.isStreaming||s.streamingComplete===!1))return"responding"}switch(e.status){case St.Active:return"idle";case St.Pending:case St.Idle:return"idle";case St.Processing:return a?"responding":"idle";case St.Waiting:return"waiting";default:return"idle"}}function da(e){return!!(e.isProcessing||e.isStreaming||e.isResponding)}function ga(e){return e===St.Idle||e==="idle"}function Rn(e){const a={};if(!e)return a;if(e.lastAgentResponse){const s=Ta(e.lastAgentResponse);s&&(a.lastResponse=s)}return ga(e.status)&&!da(e)||e.isStreaming&&e.lastToolUse?.name&&(a.activeToolName=e.lastToolUse.name,a.activeToolInput=e.lastToolUse.input||{}),a}function Wt(e){return(e.name||e.toolName||"").toLowerCase()}function Vt(e){return"input"in e&&e.input?e.input:"arguments"in e&&e.arguments?e.arguments:"parameters"in e&&e.parameters?e.parameters:{}}function Mn(e){const a=e.toLowerCase();if(Ee.has(e))return!0;for(const s of Ee)if(a.startsWith(s.toLowerCase()))return!0;return!!(a.startsWith("edit ")||a.startsWith("save ")||a.startsWith("create "))}function ua(e){const a=e.toLowerCase();return!!(a.startsWith("read `")&&!a.includes("read `.`")||a.startsWith("view")||a==="view")}function je(e){if(Pe.has(e))return!0;for(const a of Pe)if(e.startsWith(a))return!0;return!1}function Wn(e){return e==="save-file"?"create":e==="remove-files"?"delete":"modify"}function He(e){return e==="create_note"?"create":Nn.has(e)?"read":"write"}function Ke(e){if(Ge.has(e))return!0;for(const a of Ge)if(e.startsWith(a))return!0;return!1}function qe(e){return e==="add_tasks"?"create":Sn.has(e)?"read":"update"}function fa(e){if(e==="."||e==="./"||e.endsWith("/"))return!0;const s=(e.split("/").pop()||e).lastIndexOf(".");return s===-1||s===0}function Bn(e){const a=e.match(/`([^`]+)`/);if(a&&a[1]){const s=a[1];return fa(s)?null:s}return null}function Xe(e,a){const s=e.path||e.file_path||e.filePath;return typeof s=="string"?fa(s)?null:s:a?Bn(a):null}function Ye(e){const a=e.noteId||e.note_id||e.title;return typeof a=="string"?a:null}function Ue(e){return Mn(e)||ua(e)}function Ve(e){return ua(e)?"read":Wn(e)}function Dn(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!Ue(i))continue;const o=Vt(d),l=Xe(o,d.name||d.toolName);!l||g.has(l)||(g.add(l),s.push({path:l,type:Ve(i),timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!Ue(i))continue;const o=Vt(d),l=Xe(o,d.name);!l||g.has(l)||(g.add(l),s.push({path:l,type:Ve(i),timestamp:c}))}}return s}function Ln(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!je(i))continue;const o=Vt(d),l=Ye(o);!l||g.has(l)||(g.add(l),s.push({noteId:l,title:o.title||l,action:He(i),timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!je(i))continue;const o=Vt(d),l=Ye(o);!l||g.has(l)||(g.add(l),s.push({noteId:l,title:o.title||l,action:He(i),timestamp:c}))}}return s}function Qe(e){const a=[],s=e.tasks;if(Array.isArray(s)){for(const g of s)if(typeof g=="object"&&g!==null){const u=g,c=u.name;c&&a.push({taskId:`task-${c.toLowerCase().replace(/\s+/g,"-").slice(0,30)}`,name:c,description:u.description,state:u.state})}}if(Array.isArray(s)){for(const g of s)if(typeof g=="object"&&g!==null){const u=g,c=u.task_id;c&&!a.some(d=>d.taskId===c)&&a.push({taskId:c,name:u.name||c,description:u.description,state:u.state})}}return a}function Ze(e){if(!e)return"not_started";const a=e.toLowerCase();return a==="complete"||a==="completed"||a==="done"?"complete":a==="in_progress"||a==="in-progress"||a==="started"?"in_progress":a==="cancelled"||a==="canceled"?"cancelled":"not_started"}function En(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!Ke(i))continue;const o=Vt(d),l=qe(i),n=Qe(o);for(const p of n)g.has(p.taskId)||(g.add(p.taskId),s.push({taskId:p.taskId,name:p.name,description:p.description,state:Ze(p.state),action:l,timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!Ke(i))continue;const o=Vt(d),l=qe(i),n=Qe(o);for(const p of n)g.has(p.taskId)||(g.add(p.taskId),s.push({taskId:p.taskId,name:p.name,description:p.description,state:Ze(p.state),action:l,timestamp:c}))}}return s}function Je(e){if(ze.has(e))return!0;for(const a of ze)if(e.startsWith(a))return!0;return!1}function ta(e){if(!e)return null;const a=e.match(/Agent ID:\s*(\S+)/i);return a?a[1]:null}function ve(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.filter(a=>a&&typeof a=="object"&&a.type==="text"&&a.text).map(a=>a.text).join(`
|
|
14
|
+
`);if(e&&typeof e=="object"){const a=e;if(typeof a.text=="string")return a.text;if(typeof a.content=="string")return a.content}return""}function Pn(e,a){const s=new Map,g=new Map;let u=0;for(const c of e){const d=[];if(c.contentBlocks&&Array.isArray(c.contentBlocks)){for(const i of c.contentBlocks)if(i.type==="tool_use"&&i.name){const o=Wt(i);Je(o)&&i.id&&d.push(i.id)}}if(c.toolCalls&&Array.isArray(c.toolCalls))for(const i of c.toolCalls){const o=Wt(i);if(Je(o)){const l=i.id;l&&!d.includes(l)&&d.push(l)}}if(d.length>1){const i=`${a}-batch-${u}`;for(const o of d)g.set(o,i);u++}}for(const c of e){if(c.contentBlocks&&Array.isArray(c.contentBlocks)){for(const d of c.contentBlocks)if(d.type==="tool_result"&&d.tool_use_id){const i=d.tool_use_id,o=g.get(i);if(o){const l=ve(d.text)||ve(d.content)||ve(d.output),n=ta(l);n&&s.set(n,o)}}}if(c.toolCalls&&Array.isArray(c.toolCalls))for(const d of c.toolCalls){const i=d.id;if(!i)continue;const o=g.get(i);if(!o)continue;const l=d.result;if(l){const n=ve(l),p=ta(n);p&&s.set(p,o)}}}return s}function Gn(e){const a={id:e.id,timestamp:e.timestamp,agentId:e.actor?.id||"",agentName:e.actor?.name};if(e.type==="agent:created"){const s=e.data;return{...a,type:"agent-created",agentId:s?.agentId||a.agentId,agentName:s?.agentName||a.agentName,parentAgentId:s?.createdByAgentId}}if(e.type==="agent:idle"){const s=e.data;return{...a,type:"agent-idle",agentId:s?.agentId||a.agentId,parentAgentId:s?.parentAgentId}}if(e.type==="file:changed"&&e.actor?.type==="agent"){const s=e.data,g=s?.action,u=g==="create"||g==="modify"||g==="delete",c=s?.relativePath;return{...a,type:u?"file-write":"file-read",targetId:s?.path||c,targetName:c?.split("/").pop()}}if(e.type?.startsWith("note:")&&e.actor?.type==="agent"){const s=e.data,g=e.type==="note:created"||e.type==="note:updated";return{...a,type:g?"note-write":"note-read",targetId:s?.noteId,targetName:s?.title}}if(e.type==="agent:tool:call"){const s=e.data,g=s?.toolName?.toLowerCase()||"";if(g.includes("read")&&s?.filesModified?.[0])return{...a,type:"file-read",targetId:s.filesModified[0],targetName:s.filesModified[0].split("/").pop()};if((g.includes("write")||g.includes("edit"))&&s?.filesModified?.[0])return{...a,type:"file-write",targetId:s.filesModified[0],targetName:s.filesModified[0].split("/").pop()}}return null}function zn(e,a){const s=e.workspaceEvents.byWorkspaceId[a]?.events??[],g=[];for(const u of s){const c=Gn(u);c&&g.push(c)}return g.sort((u,c)=>new Date(u.timestamp).getTime()-new Date(c.timestamp).getTime())}function jn(e){return e.length===0?new Date().toISOString():new Date(Math.max(...e.map(a=>new Date(a.timestamp).getTime()))).toISOString()}const Hn=Fe.createSelector((e,a)=>{const s=zn(e,a),g=jn(s),u=Ca.select(e,a),c={};for(const o of Na.select(e,a))c[String(o.id)]=o;const d=e.workspaceNotes.byWorkspaceId[a],i=new Map;if(d)for(const o of Ga(d.notes))i.set(o.id,o);return Kn(s,c,g,!0,u,e,i)});function Kn(e,a,s,g,u,c,d){const i=new Date(s).getTime(),o=new Map;for(const I of u)o.set(I.path,I);const l=I=>d?.get(I)?.title||I,n=e.filter(I=>new Date(I.timestamp).getTime()<=i),p=[],R=[],h=new Map,v=new Set,b=[];let N=null;for(const[I,P]of Object.entries(a))if(za(P)==="topLevel"){N=I;break}for(const[I,P]of Object.entries(a)){if(h.has(I))continue;const ct=ja(P),_t=Rn(P),Ot=ra.select(c,I),Bt=We.select(c,I),ht=P.waitingForAgentIds;let bt=Fn(P,Ot);Bt?bt="waiting":(Ot||bt==="idle"&&_t.activeToolName)&&(bt="responding");const Ht={id:`agent-${I}`,type:"agent",agentId:I,name:P.name||"Agent",isCoordinator:I===N,isBackground:P.isBackground||!1,status:bt,specialist:P.metadata?.specialist||null,parentAgentId:ct,createdAt:String(P.createdAt||s),waitingForAgentIds:ht,activeToolName:_t.activeToolName,activeToolInput:_t.activeToolInput,lastResponse:_t.lastResponse,agentType:P.metadata?.agentType||null,x:0,y:0,vx:0,vy:0};if(h.set(I,Ht),p.push(Ht),ct&&a[ct]){const D=`del-${ct}-${I}`;v.has(D)||(v.add(D),b.push({key:D,sourceRawId:ct,targetRawId:I,edge:{id:D,type:"delegation",sourceId:`agent-${ct}`,targetId:`agent-${I}`,parentAgentId:ct,childAgentId:I,timestamp:String(P.createdAt||s),isActive:!1}}))}const Ft=P.messages||[];let Dt=Dn(Ft,s).map(D=>({...D,additions:o.get(D.path)?.additions,deletions:o.get(D.path)?.deletions}));Dt.length===0&&P.fileChanges&&P.fileChanges.length>0&&(Dt=P.fileChanges.map(D=>({path:D.path,type:D.type,timestamp:String(D.timestamp||s),additions:o.get(D.path)?.additions,deletions:o.get(D.path)?.deletions}))),qn(Dt,I,o,h,p,v,b,s);const Qt=Ln(Ft,s);Xn(Qt,I,l,h,p,v,b);const A=En(Ft,s);Yn(A,I,h,p,v,b)}for(const[I,P]of Object.entries(a)){const ct=P.messages||[];if(ct.length===0)continue;const _t=Pn(ct,I);if(_t.size!==0)for(const[Ot,Bt]of _t){const ht=h.get(Ot);ht&&ht.type==="agent"&&(ht.delegationBatchId=Bt)}}Un(n,g,i,a,o,l,h,p,v,b),Vn(p,u,a,N,h,v,R,g,s,c);for(const I of b)h.has(I.sourceRawId)&&h.has(I.targetRawId)&&R.push(I.edge);const x=e.map(I=>new Date(I.timestamp).getTime()),it=x.length>0?new Date(Math.min(...x)).toISOString():s,E=x.length>0?new Date(Math.max(...x)).toISOString():s;return{nodes:p,edges:R,currentTime:s,isLive:g,minTime:it,maxTime:E}}function qn(e,a,s,g,u,c,d,i){for(const o of e){const l=o.path;if(!l)continue;const n=o.type==="read",p=n?"file-read":"file-write",R=`file-${l}`;if(!g.has(l)){const v={id:R,type:"file",path:l,fileName:l.split("/").pop()||"",lastAction:o.type==="delete"?"delete":n?"read":"write",lastActionTimestamp:o.timestamp||i,x:0,y:0,vx:0,vy:0};g.set(l,v),u.push(v)}const h=`${p}-${a}-${l}`;if(!c.has(h)){c.add(h);const v=n?void 0:s.get(l);let b=n?void 0:o.additions??v?.additions,N=n?void 0:o.deletions??v?.deletions;if(!n&&b===void 0&&N===void 0){const x=l.split("").reduce((it,E)=>it+E.charCodeAt(0),0);o.type==="create"?(b=x%80+20,N=0):o.type==="modify"?(b=x%50+5,N=x%20+2):(b=x%30+3,N=x%15+1)}d.push({key:h,sourceRawId:a,targetRawId:l,edge:{id:h,type:p,sourceId:`agent-${a}`,targetId:R,agentId:a,filePath:l,timestamp:o.timestamp||i,isActive:!1,additions:b,deletions:N}})}}}function Xn(e,a,s,g,u,c,d){for(const i of e){const o=i.noteId,l=`note-${o}`;if(!g.has(o)){const R={id:l,type:"note",noteId:o,title:s(o),lastAction:i.action,lastActionTimestamp:i.timestamp,x:0,y:0,vx:0,vy:0};g.set(o,R),u.push(R)}const n=i.action==="read"?"note-read":"note-write",p=`${n}-${a}-${o}`;c.has(p)||(c.add(p),d.push({key:p,sourceRawId:a,targetRawId:o,edge:{id:p,type:n,sourceId:`agent-${a}`,targetId:l,agentId:a,noteId:o,timestamp:i.timestamp,isActive:!1}}))}}function Yn(e,a,s,g,u,c){for(const d of e){const i=d.taskId,o=`task-${i}`;if(!s.has(i)){const p={id:o,type:"task",taskId:i,name:d.name,description:d.description,state:d.state||"not_started",lastAction:d.action,lastActionTimestamp:d.timestamp,x:0,y:0,vx:0,vy:0};s.set(i,p),g.push(p)}const l=d.action==="create"?"task-create":"task-update",n=`${l}-${a}-${i}`;u.has(n)||(u.add(n),c.push({key:n,sourceRawId:a,targetRawId:i,edge:{id:n,type:l,sourceId:`agent-${a}`,targetId:o,agentId:a,taskId:i,timestamp:d.timestamp,isActive:!1}}))}}function Un(e,a,s,g,u,c,d,i,o,l){for(const n of e){const p=new Date(n.timestamp).getTime(),R=s-p<On;if((n.type==="agent-created"||n.type==="agent-idle")&&n.parentAgentId){const h=`del-${n.parentAgentId}-${n.agentId}`;o.has(h)||(o.add(h),l.push({key:h,sourceRawId:n.parentAgentId,targetRawId:n.agentId,edge:{id:h,type:"delegation",sourceId:`agent-${n.parentAgentId}`,targetId:`agent-${n.agentId}`,parentAgentId:n.parentAgentId,childAgentId:n.agentId,timestamp:n.timestamp,isActive:R}}))}if((n.type==="file-read"||n.type==="file-write")&&n.targetId){const h=`file-${n.targetId}`;if(!d.has(n.targetId)){const b={id:h,type:"file",path:n.targetId,fileName:n.targetName||n.targetId.split("/").pop()||"",lastAction:n.type==="file-write"?"write":"read",lastActionTimestamp:n.timestamp,x:0,y:0,vx:0,vy:0};d.set(n.targetId,b),i.push(b)}const v=`${n.type}-${n.agentId}-${n.targetId}`;if(!o.has(v)){o.add(v);const b=n.type==="file-write"?u.get(n.targetId):void 0;let N=b?.additions,x=b?.deletions;if(n.type==="file-write"&&N===void 0&&x===void 0){const it=n.targetId.split("").reduce((E,I)=>E+I.charCodeAt(0),0);N=it%50+5,x=it%20+2}l.push({key:v,sourceRawId:n.agentId,targetRawId:n.targetId,edge:{id:v,type:n.type,sourceId:`agent-${n.agentId}`,targetId:h,agentId:n.agentId,filePath:n.targetId,timestamp:n.timestamp,isActive:R,additions:N,deletions:x}})}}if((n.type==="note-read"||n.type==="note-write")&&n.targetId){const h=`note-${n.targetId}`;if(!d.has(n.targetId)){const b={id:h,type:"note",noteId:n.targetId,title:c(n.targetId)||n.targetName||n.targetId,lastAction:n.type==="note-write"?"write":"read",lastActionTimestamp:n.timestamp,x:0,y:0,vx:0,vy:0};d.set(n.targetId,b),i.push(b)}const v=`${n.type}-${n.agentId}-${n.targetId}`;o.has(v)||(o.add(v),l.push({key:v,sourceRawId:n.agentId,targetRawId:n.targetId,edge:{id:v,type:n.type,sourceId:`agent-${n.agentId}`,targetId:h,agentId:n.agentId,noteId:n.targetId,timestamp:n.timestamp,isActive:R}}))}}}function Vn(e,a,s,g,u,c,d,i,o,l){if(e.some(h=>h.type==="file")||a.length===0)return;const p=[];for(const h of Object.keys(s)){const v=Sa.select(l,h);v&&(v.additions>0||v.deletions>0)&&p.push(h)}const R=p.length>0?p[0]:g;if(!(!R||!u.has(R)))for(const h of a){const v=h.path;if(!v)continue;const b=`file-${v}`;if(!u.has(v)){const N={id:b,type:"file",path:v,fileName:v.split("/").pop()||"",lastAction:h.action?.toLowerCase()==="delete"?"delete":"write",lastActionTimestamp:o,x:0,y:0,vx:0,vy:0};u.set(v,N),e.push(N);const x=`file-write-${R}-${v}`;c.has(x)||(c.add(x),d.push({id:x,type:"file-write",sourceId:`agent-${R}`,targetId:b,agentId:R,filePath:v,timestamp:o,isActive:i,additions:h.additions,deletions:h.deletions}))}}}var Qn=F('<div class="agent-overview-panel flex flex-col h-full bg-background overflow-auto svelte-1337n58"><!></div>');function pa(e,a){if(new.target)return oe({component:pa,...e});le(a,!0);const s=()=>$t(i,"$graphState$",g),[g,u]=Me();let c=st(a,"workspaceId",7),d=st(a,"onFocus",7);const i=Hn(c());Fe.dispatch(Ha(c()));function o(v,b,N){const x=N.metaKey||N.ctrlKey,it=Pa(N.target);Fe.dispatch(Ka(c(),{agentId:v,sourcePanelId:it,openInAdjacentPanel:x}))}const l=y(()=>s().nodes.filter(v=>qa(v)));var n={get workspaceId(){return c()},set workspaceId(v){c(v),rt()},get onFocus(){return d()},set onFocus(v){d(v),rt()},$set:ie,$on:(v,b)=>ce(a,v,b)},p=Qn(),R=L(p);la(R,{get agents(){return t(l)},get edges(){return s().edges},onAgentClick:o,get onFocus(){return d()}}),$(p),_(e,p);var h=de(n);return u(),h}function Zn(e,a){if(new.target)return oe({component:Zn,...e});le(a,!0);let s=st(a,"workspaceId",7),g=st(a,"onFocus",7);var u={get workspaceId(){return s()},set workspaceId(c){s(c),rt()},get onFocus(){return g()},set onFocus(c){g(c),rt()},$set:ie,$on:(c,d)=>ce(a,c,d)};return pa(e,{get workspaceId(){return s()},get onFocus(){return g()}}),de(u)}export{Zn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as
|
|
1
|
+
import{C as M}from"./B5aYN90J.js";import{a as v}from"./BdWqymET.js";import{f as D}from"./BbhtQrkZ.js";import{JH as o,EB as E,DY as _,m as A,vr as O,v1 as C,gb as H,De as L,Dw as P,FB as R,Di as B}from"./B9vHutcJ.js";import{ba as p}from"./C2UL5Ler.js";import{d as x}from"./B0Z-1lwJ.js";import{n as F}from"./DWt5yjbU.js";import{o as W,e as q}from"./Bc1CpNLz.js";const u=new v("OpenMessage"),S=150,y=15e3,N=2,Y=[150,400,800,1500,3e3],G=M;let g;function k(e){return new Promise(t=>setTimeout(t,e))}function m(e,t){const s=o.state,n=s.agentSessions?.byAgentId[e]?.messages,a=s.agentSessions?.historySegmentsByAgentId?.[e]?.messages;return!!(n?.some(r=>r.id===t)||a?.some(r=>r.id===t))}function T(e,t){const s=o.state,n=s.agentSessions?.historySegmentsByAgentId?.[e];n?.detachedFromTail!==!0||n.messages.some(r=>r.id===t)||!s.agentSessions?.byAgentId[e]?.messages?.some(r=>r.id===t)||o.dispatch(H(e))}function K(e){return o.state.chatState?.byAgentId[e]?.transcriptHydration}async function $(e,t,s){const n=Date.now()+y;let a=0;for(;Date.now()<n;){if(s.aborted)return!1;if(m(e,t))return!0;if(a>=N&&K(e)==="settled"&&!p.select(o.state,e).initialHistoryPending)return!1;a++,await k(S)}return!s.aborted&&m(e,t)}async function I(e,t,s,n){const a=Date.now()+y;for(;p.select(o.state,e).initialHistoryPending;){if(n?.aborted||Date.now()>=a)return!1;await k(S)}const r=o.state.agentSessions?.byAgentId[e];if(!r||n?.aborted)return!1;if(m(e,t))return T(e,t),!0;s??=r.workspaceId;const l=p.select(o.state,e);let c={nextToken:l.scrollbackOlderToken,prevToken:l.scrollbackGapToken,olderAnchorId:l.scrollbackOlderTokenAnchorId};o.dispatch(L(e,"seek"));const d=p.select(o.state,e).scrollbackDiscardEpoch,f=()=>!!o.state.agentSessions?.byAgentId[e]&&p.select(o.state,e).scrollbackDiscardEpoch===d;try{const i=await D.agents.getConversation(e,G,void 0,t,void 0,s);return n?.aborted||!f()||!i.messages.some(h=>h.id===t)?!1:(o.dispatch(P(e,i.messages,i.messages[0]?.seq)),i.nextToken===null&&o.dispatch(R(e)),c={nextToken:i.nextToken,prevToken:i.prevToken,olderAnchorId:i.messages[0]?.id??null},m(e,t))}catch(i){return u.warn("[seekConversationToMessage] Seek fetch failed (message may no longer exist)",{agentId:e,messageId:t,error:i}),!1}finally{f()&&o.dispatch(B(e,c))}}async function ee(e){if(e.signal?.aborted)return;g?.abort(),g=new AbortController;const t=e.signal?AbortSignal.any([g.signal,e.signal]):g.signal,{workspaceId:s,agentId:n,messageId:a,query:r,targetTabId:l}=e;u.info("[openMessage] Deep-opening conversation at message",{workspaceId:s,agentId:n,messageId:a});const c=s===A;c&&!e.contentAlreadyOpen&&(o.dispatch(E(n)),o.dispatch(_(A,n)),o.dispatch(O("chief")));const d=c?"/":q(s);if(!e.contentAlreadyOpen&&typeof window<"u"&&window.location.pathname!==d){try{c?await F(d):await W(s)}catch(w){u.warn("[openMessage] Workspace navigation failed",{workspaceId:s,error:w});return}if(t.aborted)return;if(window.location.pathname!==d){u.warn("[openMessage] Workspace navigation was not confirmed",{workspaceId:s});return}}!e.contentAlreadyOpen&&!c&&o.dispatch(C(s,{agentId:n}));const f=await $(n,a,t);f&&T(n,a);const i=f||await I(n,a,s,t);if(t.aborted)return;if(!i){u.warn("[openMessage] Message not found; conversation opened at tail",{agentId:n,messageId:a});return}const h=`open-message-${Date.now()}-${Math.random().toString(36).slice(2)}`,b={agentId:n,messageId:a,query:r,targetTabId:l,requestId:h,signal:t};for(const w of Y)setTimeout(()=>{t.aborted||x("chat:open-message",b)},w)}export{ee as openMessage,I as seekConversationToMessage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var G_=Object.defineProperty;var Ng=n=>{throw TypeError(n)};var V_=(n,r,a)=>r in n?G_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Js=(n,r,a)=>V_(n,typeof r!="symbol"?r+"":r,a),K_=(n,r,a)=>r.has(n)||Ng("Cannot "+a);var Ao=(n,r,a)=>(K_(n,r,"read from private field"),a?a.call(n):r.get(n)),Bg=(n,r,a)=>r.has(n)?Ng("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as fn,bo as X,bw as vn,bp as pf,b as hn,bm as u,bq as Nr,bs as ge,br as Li}from"./CLAmm_T1.js";import{bs as mn,a5 as I,bf as fs,bA as b,W as p,bn as _n,aA as Z,aB as E,ca as ae,a7 as Wt,ay as ye,aD as e,cd as Bn,c9 as o,bS as m,bl as de,be as pn,b_ as L,bO as j,c5 as ot,bH as w,bV as _e,bj as qs,bk as ro,b$ as dn,ai as Ud,aj as ps,bo as Vl,br as Tr,c0 as Ot,cb as ql,ak as Q_,aw as bi,a as J_}from"./3SdAC2_C.js";import{i as B}from"./BFgvMDua.js";import{k as Ci}from"./CIbfGsF-.js";import{g as On,i as Y_,I as eo,p as Lo,e as Eo}from"./B1CKzIA2.js";import{n as Bt,l as ma,c as to,j as Wg,k as Do,h as X_}from"./CfNIzRu8.js";import{b as ff,e as zd,f as xe,s as Ue,c as jt,g as gs}from"./CcJmuwXr.js";import{b as Z_}from"./goTpbPhD.js";import{b as _r}from"./Dn334wJv.js";import{m as ew,U as tw,Z as nw,X as rw,Y as aw,I as Ug,o as sw,l as ow,a2 as iw,x as zg,$ as lw,a0 as jg,r as cw,s as dw}from"./UxV1HNfb.js";import{JG as F,fp as uw,eX as gw,f4 as pw,eY as fw,f2 as vw,f1 as hw,e_ as mw,f0 as _w,eZ as ww,rv as bw,c7 as yw,i as ki,Jf as Iw,Dm as vf,Dr as Sw,Dt as Gg,Dq as $w,Ds as kw,vE as xw,vG as Cw,Cz as hf,cq as Pw,co as Rw,BI as Aw,bF as Tw,Ad as Mw,Co as id,v0 as Ew,cr as Vg,dC as qw,dD as Lw,Cy as Hw,em as Ow,CS as Dw,CR as Fw,CW as Nw,CV as Bw,cR as Ww,cU as Uw,nD as zw,es as jw,wS as Gw,CX as Vw,wU as Kw,CY as Qw,cV as Jw,cW as Yw,nL as Xw,Ar as Zw,IB as eb,Aq as tb,DD as nb,wn as rb,wo as ab,z9 as sb,zd as ld,wj as ob,wk as ib,rT as lb,rg as cb,re as db,f$ as ub,HZ as gb,Lu as pb,GW as fb,go as vb,p3 as hb,Ju as mb,ok as _b,Ac as wb,fu as Kg,r3 as Qg,fn as bb,fm as yb,tC as Ib,g4 as Jg,rf as Sb,ff as $b,Cj as kb,m as xb,nM as Cb,zR as Pb,z7 as Rb,EJ as Ab,Ey as Yg,xi as Tb,xj as Xg,u$ as Zg,p4 as Mb,DP as Eb,gk as qb,g2 as Lb,eV as Hb,cN as Ob,Ag as Db,Lz as Fb,CE as Nb,LR as Bb,y3 as Wb,gb as Ub,fe as zb,cM as jb,cJ as Gb,cI as Vb,vs as Kb,xp as Qb,xn as Jb,cG as Yb,cF as Xb,zf as Zb,za as ey,xo as ty}from"./BlDw7Cnz.js";import{a as jd}from"./CC7to1B5.js";import{aM as ny,aL as ry,bg as ay,a7 as sy,aD as oy,aO as iy,M as mf,a0 as _f,b8 as ly,b2 as cy,as as ep,P as yl,b0 as tp,a$ as np,a_ as rp}from"./pXRM_ktM.js";import{l as wf,G as dy,I as Rd,at as uy,b1 as Ll,a9 as bf,S as gy,aW as cd,aq as py,aJ as fy,C as vy,z as yf,s as hy,A as my,v as _y,a$ as wy,aH as If,aG as Sf,aI as by,j as ap,aM as dd,aT as sp,aS as Il,aU as op,Q as ip,d as yy,e as Iy,ax as Sy,V as lp,aE as $y,c as ky,m as xy,aV as cp,ap as Cy,aw as dp,a as Py,aA as Ry,ad as up,aD as Ay,aX as gp,a_ as pp,n as fp,ae as Ty,R as My,ay as vp,am as Ey,O as qy,as as Ly,h as Hy,q as Oy,$ as ud,_ as Dy,aC as hp,a8 as Fy,f as Ny,i as By,a6 as Wy,ac as Uy}from"./DU_cYENL.js";import{f as zy,o as jy,E as Gy,C as Vy,m as Ky,a2 as mp,aa as Qy,K as Jy,e as Yy,y as Xy}from"./oOxvDsoj.js";import{g as Ri}from"./DypB-Dwi.js";import{dX as Bl,cU as $f,O as kf,W as Zy,bv as eI,aF as xf,dI as Cf,aU as qo,e9 as tI,dx as Pf,aw as Gd,dW as Vd,aN as Rf,cP as nI,V as ha,a3 as Xs,B as rI,a7 as aI,a4 as sI,M as oI,a6 as iI,ar as lI,aG as Af,aO as Hl,b6 as cI,ay as Tf,r as dI,n as Ad,H as uI,dZ as gI,aQ as pI,aK as fI,c9 as vI,aW as hI,bM as mI,bK as _I,bL as wI,c8 as bI,c7 as yI,cN as II,cM as SI,aS as $I,bb as kI,bd as xI,bg as CI,bc as PI,bl as RI,bf as AI,be as TI,bh as MI,bi as EI,bk as qI,bj as LI,ax as HI,cj as OI,ck as DI,dw as FI,dv as NI,a$ as BI,G as WI,b3 as UI,cf as zI,C as _p,d1 as jI,ba as ds,b$ as GI,X as VI,bq as KI,E as QI,ad as JI,t as YI,cX as XI,d4 as wp,Q as bp,du as ZI,cQ as gd}from"./B3K7_JP4.js";import{u as Mf,a as Sl,ag as eS,x as tS,ad as Ef,af as nS,ac as qf,a4 as rS,F as yp,D as aS,e as sS,n as oS,s as iS,m as lS,Y as cS,k as dS}from"./DMxa_WW_.js";import{a2 as uS,b5 as gS,cM as pS,a_ as fS,b4 as vS,c2 as hS,c9 as mS,w as _S,x as wS,cd as bS}from"./BZljJ1HD.js";import{n as yS,P as Lf,F as IS,ai as SS,r as $S,ac as kS}from"./BBFoj-dS.js";import{I as xS,s as CS,H as Ip}from"./Bqd7fdCF.js";import{e as PS}from"./CL3a4Hm1.js";import{e as RS,f as AS}from"./CZr8f1ch.js";import{s as TS,o as Zs,b as MS,g as Wl,d as ES,l as yi}from"./CIyUrgF0.js";import{a5 as qS,a7 as LS,D as HS,N as OS,ac as Sp,X as Hf,i as DS,r as ur,v as Ai,u as ea,p as xi,x as wr,S as Kd,m as Kl,s as Ho,y as Ti,o as ao,n as so,t as $p,aa as oo,w as io,a9 as Qd,q as _a,z as Oo,J as Td,_ as kp,g as FS,F as NS,U as Of,I as Df,a8 as Ff,a6 as Ol,O as BS,E as Nf,V as WS,A as US,b as zS,ab as jS,ad as $l,G as GS,e as pd,l as VS,C as KS,f as Ys,j as xp,H as us,Q as QS,d as kl,c as JS,a as Cp,h as YS,L as XS,Y as Pp,a4 as fd,a1 as Rp,a0 as ZS,a3 as Ap,$ as Tp,T as e$,B as t$,k as n$,a2 as r$,K as a$,R as s$,P as o$,W as i$}from"./pI1-Ias6.js";import{m as l$}from"./Dms_DO28.js";import{g as Bf}from"./CZU3aMzM.js";import{b as c$}from"./B9dzo0Kz.js";import{g as d$}from"./CPOCLD3T.js";import{a as u$}from"./DnebYpJB.js";import{q as Wf,d as gr,r as g$,e as Ul,j as p$,g as Md,i as f$,f as Ed,c as v$,A as h$,O as Mp,k as m$}from"./BCG_mh8x.js";import{P as _$}from"./KlB4Fhnb.js";import{e as w$}from"./Cm0Qloca.js";import{b as b$,a as y$,g as I$,c as S$,i as $$}from"./BCO6MiJi.js";import{R as k$,g as x$,W as xl,c as C$}from"./D3tfczF3.js";import"./C4jSaPCg.js";import"./CEE0831H.js";import{t as Mi}from"./BwNrQXlF.js";import{F as P$,h as R$}from"./BhvXSFFd.js";import"./CgrVbtN0.js";import{C as A$,e as Dr,L as T$,l as Ql,d as Jl,K as Yl,h as Jd,M as Xl,S as Fa}from"./DmyX6ZHD.js";import{D as M$}from"./D5b9qBIq.js";import{f as Ep}from"./B_vpadVO.js";import"./DU3vNstz.js";import{i as Uf}from"./BjLb7AHW.js";import{h as qp,i as Lp,g as Hp,P as Op,C as E$,m as Dl,R as q$}from"./cOfTiXUW.js";import{f as $t,ae as L$}from"./DREHsvwt.js";import{F as gt,bs as H$,cd as O$,aw as Na,a2 as zf,c9 as D$,bf as F$,be as N$,bg as B$,aO as Dp,aj as vd,aB as hd,bB as jf,d3 as zl,cF as W$,aM as Fp,cb as Np,cK as jl,bu as U$,aS as z$,d0 as j$,a8 as Gf,ac as G$,ag as V$,cr as K$,ba as Q$,aC as Vf,cT as Bp,cz as J$,ax as Y$,cD as X$,c3 as Z$}from"./DPttSllj.js";import{c as Kf}from"./ChTqQfQN.js";import"./Dz9x1eR4.js";import{c as Tt}from"./BwH4Bvte.js";import{a4 as Qf,bf as ek,aq as tk,k as nk,X as rk,V as ak,a1 as sk,Y as ok,bv as ik,U as lk,a0 as ck,ag as dk}from"./CZkav0tO.js";import{d as Gl,f as uk,e as gk}from"./XTW5roGp.js";import{A as pk}from"./9YT9B_ti.js";import{D as fk}from"./lVUEwTET.js";import"./sKA-ObYb.js";import{a as vk,C as hk}from"./CTDDNWu2.js";import"./DtzJzV-4.js";import{C as mk}from"./BUCW0wKH.js";import{h as qd,r as _k,a as wk}from"./BhyNZfPE.js";import{s as bk}from"./BtXBr5gW.js";import{I as yk,a as Jf}from"./DX9jQ0PS.js";import{L as Ik}from"./DjpNk5RK.js";import{g as Sk,f as $k,b as kk}from"./C6aNGAOC.js";import{s as Ei,g as Yn,i as xk,j as Ck,e as Wp,r as Up,f as Pk,d as Rk,a as md,h as Ak}from"./BfBRsDbv.js";import{i as zp,a as Tk}from"./Bu13V5mO.js";import{seekConversationToMessage as jp}from"./Psr77Z1X.js";import{l as Xt,o as _d,h as Yd,n as Ld,q as Mk}from"./Cu5e4npY.js";import{o as Ek}from"./DmkTrs6I.js";import{A as Yf}from"./j5i4TEa8.js";import{b as Xf}from"./UJ0k3Qud.js";import{h as qk,f as Zf,w as Lk,g as Hk,Q as Ok,O as Dk,M as Fk,l as ev,m as Nk,J as tv,s as nv}from"./BVaTfwe9.js";import{selectCurrentWorkspaceTabId as wd}from"./klTuOngC.js";import{o as Bk}from"./CFwpAHza.js";import{d as Wk}from"./B0Z-1lwJ.js";import{P as Uk}from"./CS2-6GJW.js";import{g as zk}from"./CahSXEZY.js";import{H as rv,M as jk,y as Gk,J as Vk,g as Kk,i as Qk,u as Jk,e as av,c as sv,d as Yk}from"./DYu0VnZ5.js";import{c as Xk,h as Xd,f as ov,Q as Zk}from"./CgXlgTpj.js";import{t as ex}from"./DAsc1V4f.js";import{s as tx}from"./BsieX9dN.js";import{i as iv}from"./KHaGo8p4.js";import{d as nx,i as rx,r as ax}from"./4o_ZQ4nq.js";import{g as sx}from"./Cq_g40U8.js";var ox=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ix=E("<div><!></div>");function lv(n,r){if(new.target)return fn({component:lv,...n});mn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=pf(r,ox);var v={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:vn,$on:(f,P)=>hn(r,f,P)},g=ix();ff(g,f=>({"data-slot":"card-header",class:f,...l}),[()=>zd("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",mk,i())]);var _=I(g);return Mi(_,()=>c()??fs),b(g),_r(g,f=>a(f),()=>a()),p(n,g),_n(v)}var lx=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),cx=E("<div><!></div>");function cv(n,r){if(new.target)return fn({component:cv,...n});mn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=pf(r,lx);var v={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:vn,$on:(f,P)=>hn(r,f,P)},g=cx();ff(g,f=>({"data-slot":"card-title",class:f,...l}),[()=>zd("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var _=I(g);return Mi(_,()=>c()??fs),b(g),_r(g,f=>a(f),()=>a()),p(n,g),_n(v)}const Cl=xS.CHAT_MEDIA,bd=TS().min(1).max(512);Zs({workspaceId:bd,agentId:bd,draftId:Wl(),principalId:bd,media:MS(yS).min(1).max(20)}).strict();const dx=Zs({sessionId:Wl()}).strict();dx.extend({control:ES("action",[Zs({action:yi("readiness")}).strict(),Zs({action:yi("export"),request:RS}).strict(),Zs({action:yi("transcribe"),request:AS}).strict(),Zs({action:yi("release"),jobId:Wl()}).strict(),Zs({action:yi("adopt"),jobId:Wl()}).strict()])}).strict();function Zd(n,r,a,i=async(c,l)=>typeof window>"u"||CS(window)!=="electron"?{ok:!1,error:"unavailable"}:PS().invoke(c,l)){let c=null,l=null,v=!1;async function g(){v=!0,a.removeEventListener("abort",_);const k=c;c=null,k&&await i(Cl.CLOSE,{sessionId:k}).catch(()=>{})}const _=()=>{g()};a.addEventListener("abort",_,{once:!0});const f=()=>{if(v||a.aborted||!r())throw new Error("media-send-retired")};async function P(){if(f(),c)return c;if(l)return l;l=(async()=>{const k=await i(Cl.BEGIN,n);if(!k.ok)throw new Error("media-export-unavailable");c=k.value.sessionId;try{return f(),c}catch(W){throw await g(),W}})();try{return await l}finally{l=null}}async function S(k){const W=await P();f();const O=await i(Cl.CONTROL,{sessionId:W,control:k});return f(),O}return{service:{exportMedia:k=>S({action:"export",request:k}),adoptMediaJob:k=>S({action:"adopt",jobId:k}),transcribeMedia:k=>S({action:"transcribe",request:k}),releaseMediaJob:async k=>c?await i(Cl.CONTROL,{sessionId:c,control:{action:"release",jobId:k}}):{ok:!0,value:void 0}},dispose:g,readiness:()=>S({action:"readiness"})}}const yd=new Set;async function ux(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),c=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:v,agentId:g}=i,_=Ri(F.state),f=Bl.select(F.state,v),P=$f.select(F.state),S=wf(),q=JSON.stringify([_,v,g]);if(!_||!f||!P||l.wsId!==v||yd.has(q))return!1;yd.add(q);const k=new AbortController,W=()=>k.abort();a.addEventListener("abort",W,{once:!0});const O=()=>!a.aborted&&!k.signal.aborted&&Ri(F.state)===_&&Bl.select(F.state,v)===f&&bf(S)&&r.isCurrentDraft(i),T=F.getReadableState().subscribe(()=>{O()||k.abort()});let D=null;try{if(!O()||uS(c))return!1;const K=Mf(i.attachments),se=Lf(IS(v,g),K,c.map(fe=>({contextItemId:fe.id,attachmentId:fe.attachmentId,path:fe.path}))),C=new Set([...se.images,...se.clips].map(fe=>fe.contextItemId));if(K.some(([fe])=>!C.has(fe))||se.images.some(fe=>fe.mediaError)||se.clips.some(fe=>fe.mediaError)||!SS(l.text,se))throw new Error("invalid-evidence");if(D=n.warm?.take(i,k.signal)??null,!await r.flushDraft(i)||!O())return!1;const x=await zy.agents.get(g,v);if(!O())return!1;if(!x||x.workspaceId!==v||x.retiredAt||x.pendingDeleteAt||x.status==="deleted")throw new Error("unavailable");const Q=se.clips.flatMap(fe=>fe.media?[fe.media]:[]);Q.length&&!D&&(D=Zd({workspaceId:v,agentId:g,draftId:crypto.randomUUID(),principalId:P.principal.id,media:Q},O,k.signal));const pe=dy(c,se),Te=Rd(pe),he=await uy({workspaceId:v,agentId:g,evidence:se,clickedItems:c,sendItems:pe,clickedPayload:{...l,contextItems:pe,imageBlocks:Te.imageBlocks,fileBlocks:Te.fileBlocks},binding:S,service:D?.service??null,current:O,onRecord:()=>{}});return!he||!O()?!1:Ll(F,g,he)}catch{return O()&&F.dispatch(uw(g,u.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",W),await D?.dispose(),yd.delete(q)}}const dv=1e4,Gp={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function Vp(n){return qS(n.messageMetadata)}function gx(n,r){if(n.some(Vp)){const a=n[0];return a&&!Vp(a)&&Kp(a,r)?[a.id]:[]}return n.filter(a=>Kp(a,r)).map(a=>a.id)}function px(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function Kp(n,r){return!n.requeuedAfterFailure&&LS(n,r)}function fx(n,r){const{busy:a,queue:i,delivered:c,now:l}=r,v=r.blocked||r.interrupted,g=r.timeoutMs??dv;let _=n.prediction;if(_){const k=new Set(i.map(D=>D.id)),W=_.ids.filter(D=>k.has(D)&&!c.has(D)),O=l-_.startedAt>=g,T=n.wasBusy&&!a;!W.length||O||v&&!a||T?_=null:W.length!==_.ids.length&&(_={..._,ids:W})}const f=n.wasBusy&&!a,P=n.wasBusy?n.busySince:a?l:null,S=n.wasBusy&&n.preempted||P!==null&&r.directSendAt!==null&&r.directSendAt>P;if(!_&&f&&!v&&!S){const k=gx(i,l).filter(W=>!c.has(W));k.length&&(_={ids:k,startedAt:l})}const q={wasBusy:a,busySince:a?P:null,preempted:a&&S,prediction:_};return n.wasBusy===q.wasBusy&&n.busySince===q.busySince&&n.preempted===q.preempted&&n.prediction===q.prediction?n:q}class vx{constructor(){Js(this,"previousWorkspaceId",null);Js(this,"_isRebinding",!1);Js(this,"_generation",0);Js(this,"_rebindPromise",null);Js(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let c;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(v=>{c=setTimeout(()=>v(!0),i)})]);if(clearTimeout(c),l)return!1}return!0}}function hx(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Qp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var mx=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function uv(n,r){if(new.target)return fn({component:uv,...n});mn(r,!0);const a=()=>ge(P,"$typing$",i),[i,c]=Nr();let l=X(r,"workspaceId",7),v=X(r,"agentId",7),g=X(r,"class",7,"");const _=Bn(""),f=Bn("");ae(()=>{_.set(l())}),ae(()=>{f.set(v())});const P=gS(_,f),S=o(()=>w$(a()));var q={get workspaceId(){return l()},set workspaceId(D){l(D),Z()},get agentId(){return v()},set agentId(D){v(D),Z()},get class(){return g()},set class(D=""){g(D),Z()},$set:vn,$on:(D,K)=>hn(r,D,K)},k=Wt(),W=ye(k);{var O=D=>{var K=mx(),se=I(K),C=I(se);_$(C,{get people(){return a()},size:12,decorative:!0}),b(se);var x=m(se,2),Q=de(x,!0);pn(2),b(K),L(()=>{xe(K,1,`${Wf} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${g()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),j(Q,e(S))}),p(D,K)};B(W,D=>{e(S)&&D(O)})}p(n,k);var T=_n(q);return c(),T}const _x=50,wx=5e3,bx=500,yx=()=>({authority:()=>Ri(F.state),persistSnapshot:py,dispatch:n=>F.dispatch(n),ownerView:n=>fy.withStore(F)(n)});function Ix(n){const r=n.store??yx(),a=crypto.randomUUID();let i=_e(!1),c=_e(!1),l=_e(!1),v=null,g=null,_=0,f=!1,P=null,S=null,q=null,k=0,W=null,O=null;const T={};let D,K=_e([]),se=null,C=0,x="",Q=0,pe="";const Te=()=>{const N=n.workspaceId(),R=n.agentId();if(!N||!R||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||f)return null;const qe=n.inputValue(),H=fe(),Y=D?.shared,J=Y?.workspaceId===N&&Y.agentId===R?Y.lifetime:null,Se=JSON.stringify([re,N,R,k,J,H.map(z=>[z.id,z.attachmentId,z.path])]);Se!==pe&&(pe=Se,Q+=1);const He=JSON.stringify([re,N,R,qe,H,k]);return He!==x&&(x=He,C+=1),{authority:re,ownerId:a,workspaceId:N,agentId:R,text:qe,attachments:JSON.parse(JSON.stringify(H)),generation:C,attachmentEpoch:Q}};let he=null;const fe=()=>eS(n.contextItems(),tS(n.contextItems(),e(K))),Le=N=>{if(D=N,!N||f)return;const R=N.restore;if(O&&R?.requestId===O.requestId&&R.status!=="pending"){const{apply:H}=O;O=null,w(c,!1),R.status==="restored"&&w(K,R.draft?.attachments??[]),H(R)}const re=N.shared;if(re&&!e(c)&&g===`${re.workspaceId}\0${re.agentId}`){const H=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(se!==H){se=H;const Y=he??v,J=Y&&n.inputValue()===Y.text&&JSON.stringify(fe())===Y.attachmentsJson;re.origin===a?he={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:J&&(_+=1,q&&clearTimeout(q),w(K,re.snapshot.attachments),he=v={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(K))},n.setInputValue(re.snapshot.text),n.setContextItems(Sl(e(K))),n.applyEditorContent(re.snapshot.text))}}ot(Te);const qe=[];for(const H of N.saves){if(H.status==="pending")continue;qe.push(H.id);const Y=T[H.id];delete T[H.id],Y?.(H)}qe.length>0&&queueMicrotask(()=>r.dispatch(vw(a,qe)))},ue=(N,R,re)=>{const qe=crypto.randomUUID();O={requestId:qe,apply:re},w(c,!0),r.dispatch(mw(a,qe,N,R))},oe=()=>{O&&(O=null,w(c,!1),r.dispatch(ww(a)))},Me=()=>{const N=W;N&&(W=null,r.dispatch(_w(a)),D?.saves.some(R=>R.id===N)||delete T[N])};r.dispatch(gw(a));const ie=r.ownerView(a).subscribe(N=>ot(()=>Le(N))),ee=()=>{S&&(clearTimeout(S),S=null),w(l,!1)},Ae=()=>{W&&(W=null,r.dispatch(hw(a)))};ae(()=>{const N=n.active?.()??!0,R=n.workspaceId(),re=n.agentId();if(!N){ot(()=>{_+=1,g=null,oe(),P&&clearTimeout(P),P=null,ee(),q&&clearTimeout(q),q=null,w(i,!1),Ae()});return}if(!R||!re)return;const qe=`${R}\0${re}`;if(g===qe)return;const H=g!==null;g=qe;const Y=++_;ot(()=>{v=null,he=null,se=null,w(K,[]),P&&clearTimeout(P),ee(),q&&(clearTimeout(q),q=null),H&&(Ae(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const J=gy(R,re);if(J){w(K,J.attachments),w(i,!1);const He=n.contextItems().length>0,z=J.text,Ie=JSON.stringify(J.attachments);n.setInputValue(J.text),He||n.setContextItems(Sl(J.attachments)),n.applyEditorContent(J.text),v={text:J.text,attachmentsJson:Ie},ue(R,re,Ce=>{if(Ce.status!=="restored")return;const De=Ce.draft;if(f||!(n.active?.()??!0)||g!==qe||_!==Y)return;const at=De?.text??"",lt=De?.attachments??[],Oe=JSON.stringify(lt);cd(R,re,{text:at,attachments:lt});const $e=n.inputValue()===z&&JSON.stringify(fe())===Ie;He||!$e||(at!==z&&(n.setInputValue(at),n.applyEditorContent(at)),Oe!==Ie&&n.setContextItems(Sl(lt)),v={text:at,attachmentsJson:Oe})});return}w(i,!0),S=setTimeout(()=>{S=null,(n.active?.()??!0)&&w(l,!0)},bx),P=setTimeout(()=>{(n.active?.()??!0)&&(w(i,!1),ee())},wx);const Se=()=>{!(n.active?.()??!0)||g!==qe||_!==Y||(P&&clearTimeout(P),w(i,!1),ee())};ue(R,re,He=>{if(He.status!=="restored"){Se();return}const z=He.draft;if(f||!(n.active?.()??!0)||g!==qe||_!==Y)return;const Ie=!!n.inputValue();if(!Ie&&z?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(Sl(z.attachments)),!Ie&&z?.text&&(n.setInputValue(z.text),q=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===z.text&&n.applyEditorContent(z.text)},_x)),v===null){const Ce=z?.text??"",De=z?.attachments??[];v={text:Ce,attachmentsJson:JSON.stringify(De)},cd(R,re,{text:Ce,attachments:De})}Se()})})}),ae(()=>{const N=n.active?.()??!0,R=n.workspaceId(),re=n.agentId(),qe=e(i);if(!N){ot(Me);return}if(!R||!re)return;const H=n.inputValue(),Y=fe();if(ot(Te),ot(Me),qe||v===null&&!H&&Y.length===0)return;const J=JSON.stringify(Y);if(v!==null&&v.text===H&&v.attachmentsJson===J)return;JSON.stringify(e(K))!==J&&w(K,Y);const Se=`${R}\0${re}`,He=k,z=crypto.randomUUID();T[z]=Ie=>{if(n.active?.()??!0){if(Ie.status==="saved"){g===Se&&k===He&&(v={text:H,attachmentsJson:J});return}n.onSaveError?.(new Error(Ie.error))}},ot(()=>{W=z,r.dispatch(pw(a,z,{authority:r.authority?.()??void 0,workspaceId:R,agentId:re,text:H,attachments:Y,rollback:v?{text:v.text,attachments:JSON.parse(v.attachmentsJson)}:null}))})}),ae(()=>()=>{f=!0,P&&clearTimeout(P),S&&clearTimeout(S),q&&clearTimeout(q),Ae(),ie(),r.dispatch(fw(a))});const Ee=N=>{const R=Te();return R!==null&&R.authority===N.authority&&R.ownerId===N.ownerId&&R.workspaceId===N.workspaceId&&R.agentId===N.agentId&&R.generation===N.generation&&R.text===N.text&&JSON.stringify(R.attachments)===JSON.stringify(N.attachments)};return{captureDraft:Te,isCurrentDraft:Ee,updateAttachmentScreen(N,R,re){return!Ee(N)||!N.attachments.some(qe=>qe.id===R)?null:(w(K,N.attachments.map(qe=>qe.id===R?{...qe,screen:structuredClone(re)}:qe)),Te())},async flushDraft(N){if(!Ee(N))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,N.workspaceId,N.agentId,N,N.authority),Ee(N)},get restorePending(){return e(c)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(_+=1,k+=1,oe(),P&&(clearTimeout(P),P=null),q&&(clearTimeout(q),q=null),w(i,!1),ee(),Me(),g!==null){const[N,R]=g.split("\0");cd(N,R,{text:"",attachments:[]}),he=null,w(K,[]),v={text:"",attachmentsJson:"[]"}}}}}function qi(n){if(!n)return null;const r=Lf(JSON.stringify([n.workspaceId,n.agentId]),Mf(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(c=>c.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function Sx(n,r,a){const i=F.state.principal.snapshot,c=()=>Ri(F.state)===n.authority&&a.isCurrentDraft(n);if(!i||!c()||!await a.flushDraft(n)||!c())return{ready:!1};const l=new AbortController,v=Zd({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},c,l.signal);try{const g=await v.readiness();return!c()||!g.ok?{ready:!1}:g.value.find(_=>_.sourceId===r.source.id)??{ready:!1}}finally{await v.dispose()}}function Jp(n){let r=_e(null),a=_e(!1),i=_e(!1),c=null,l=!0,v=0,g=null;qs(()=>{l=!1,v++}),ae(()=>{const S=n.capture();e(r)&&(!S||S.authority!==e(r).capture.authority||S.ownerId!==e(r).capture.ownerId||S.workspaceId!==e(r).capture.workspaceId||S.agentId!==e(r).capture.agentId||S.attachmentEpoch!==e(r).capture.attachmentEpoch)&&w(r,null)});async function _(S){if(n.disabled()||e(a))return;const q=n.drafts.captureDraft(),k=qi(q),W=k?.clips.find(K=>K.contextItemId===S);if(!q||!W?.media||!k)return;const O=vy({workspaceId:q.workspaceId,agentId:q.agentId,clip:W,evidence:k,marks:k.marks}),T=yf(q.workspaceId,W.path);if(!O||!T)return;const D=++v;c=document.activeElement instanceof HTMLElement?document.activeElement:null,w(a,!0),w(i,!1);try{if(await n.beforeOpen?.(),!l||v!==D||!n.drafts.isCurrentDraft(q))return;const K=await(n.prepareOutput??Sx)(q,W.media,n.drafts);if(!l||v!==D||!n.drafts.isCurrentDraft(q))return;const{attachmentPath:se,...C}=O;w(r,{capture:q,contextItemId:S,snapshot:{...C,openId:crypto.randomUUID(),mediaUrl:T,output:K,deleteReady:!0}})}catch{l&&v===D&&w(i,!0)}finally{l&&v===D&&w(a,!1)}}async function f(S){const q=crypto.randomUUID(),k=e(r),W=n.drafts.captureDraft();if(!k||!W||W.authority!==k.capture.authority||W.ownerId!==k.capture.ownerId||W.workspaceId!==k.capture.workspaceId||W.agentId!==k.capture.agentId||W.attachmentEpoch!==k.capture.attachmentEpoch)return{requestId:q,result:"stale-source"};const O=qi(W),T=O?.clips.find(Q=>Q.contextItemId===k.contextItemId);if(!O||!T?.media)return{requestId:q,result:"stale-source"};const K=g?.openId===k.snapshot.openId&&g.inputRevision===S.revision&&JSON.stringify(g.media)===JSON.stringify(T.media)?{...S,revision:T.media.saved?.revision??0}:S,se=$S(T.media,{openId:k.snapshot.openId,...k.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:W.workspaceId,agentId:W.agentId},sourceId:S.sourceId,sourceRevision:S.sourceRevision,expectedEditRevision:K.revision,edit:K});if(se.status!=="saved")return{requestId:q,result:se.status==="invalid-edit"?"failed":se.status};const C=kS({...O,clips:O.clips.map(Q=>Q.id===T.id?{...Q,media:se.media}:Q)})[k.contextItemId],x=n.drafts.updateAttachmentScreen(W,k.contextItemId,C);if(!x)return{requestId:q,result:"stale-source"};g={openId:k.snapshot.openId,media:se.media,inputRevision:S.revision};try{if(!n.drafts.isCurrentDraft(x))return{requestId:q,result:"stale-source"};await n.drafts.flushDraft(x);const Q=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==k.snapshot.openId||!Q||Q.attachmentEpoch!==k.capture.attachmentEpoch||Q.authority!==x.authority||Q.ownerId!==x.ownerId||Q.workspaceId!==x.workspaceId||Q.agentId!==x.agentId||JSON.stringify(Q.attachments.find(pe=>pe.id===k.contextItemId)?.screen)!==JSON.stringify(C)?{requestId:q,result:"stale-source"}:(g=null,{requestId:q,result:"saved",saved:se.media.saved??void 0})}catch{return{requestId:q,result:"failed"}}}function P(S){return n.disabled()||!n.onRemove(S)?!1:(e(r)?.contextItemId===S&&w(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:_,save:f,remove:P,close(){w(r,null)},restoreFocus(){c?.isConnected&&c.focus()}}}var $x=E('<p role="alert"> </p>'),kx=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),xx=E("<!> <!> <!>",1);function gv(n,r){if(new.target)return fn({component:gv,...n});mn(r,!0);let a=X(r,"capture",7),i=X(r,"drafts",7),c=X(r,"disabled",7,!1),l=X(r,"onRemove",7),v=X(r,"controllerFactory",7,Jp),g=X(r,"beforeOpen",7),_=X(r,"onReviewChange",7);const f=ot(()=>v()({drafts:i(),capture:()=>a(),disabled:()=>c(),onRemove:C=>l()(C),beforeOpen:()=>g()?.()??Promise.resolve()}));ae(()=>{const C=f.opening,x=f.session;ot(()=>_()?.(C,x?.snapshot.output?.ready?{openId:x.snapshot.openId,capture:x.capture}:null))});const P=o(hy),S=o(()=>qi(a())),q=o(()=>e(S)?.clips.map(C=>({id:C.contextItemId,kind:"clip",owner:"evidence",duration:Ep(C.durationMs),recording:!1,url:a()?yf(a().workspaceId,C.path):void 0,...C.media?.saved?{summary:my(C.media.saved)}:{}}))??[]);let k=_e(null);var W={get capture(){return a()},set capture(C){a(C),Z()},get drafts(){return i()},set drafts(C){i(C),Z()},get disabled(){return c()},set disabled(C=!1){c(C),Z()},get onRemove(){return l()},set onRemove(C){l(C),Z()},get controllerFactory(){return v()},set controllerFactory(C=Jp){v(C),Z()},get beforeOpen(){return g()},set beforeOpen(C){g(C),Z()},get onReviewChange(){return _()},set onReviewChange(C){_(C),Z()},$set:vn,$on:(C,x)=>hn(r,C,x)},O=xx(),T=ye(O);{let C=o(()=>c()||f.opening);HS(T,{get items(){return e(q)},get labels(){return e(P)},get disabled(){return e(C)},onEdit:x=>void f.open(x),onMarkUp:x=>void f.open(x),get onRemove(){return f.remove}})}var D=m(T,2);{var K=C=>{var x=$x(),Q=de(x,!0);L(pe=>j(Q,pe),[()=>u.dock_captureEditor_saveFailed_label()]),p(C,x)};B(D,C=>{f.problem&&C(K)})}var se=m(D,2);{let C=o(()=>!!f.session),x=o(()=>u.dock_captureEditor_recording_title({duration:f.session?Ep(f.session.snapshot.durationMs??0):""}));A$(se,{get open(){return e(C)},size:"editor",showCloseButton:!1,get title(){return e(x)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>f.close(),onCloseAutoFocus:Q=>{Q.preventDefault(),f.restoreFocus()},get contentRef(){return e(k)},set contentRef(Q){w(k,Q,!0)},children:(Q,pe)=>{var Te=Wt(),he=ye(Te);{var fe=Le=>{var ue=Wt(),oe=ye(ue);Ci(oe,()=>f.session.snapshot.openId,Me=>{var ie=kx(),ee=I(ie);M$(ee,{get snapshot(){return f.session.snapshot},get shortcutDialog(){return e(k)},onClose:()=>f.close(),get onSave(){return f.save},onDelete:async()=>!!f.session&&f.remove(f.session.contextItemId)}),b(ie),p(Me,ie)}),p(Le,ue)};B(he,Le=>{f.session&&Le(fe)})}p(Q,Te)},$$slots:{default:!0}})}return p(n,O),_n(W)}const Pl=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function Cx(n){let r=_e(!1),a=_e(!1),i=_e(null),c=!1,l=0,v=null,g=null;async function _(S){S.abort.abort(),S.slot?.cancel(),await S.native?.dispose()}async function f(){l++;const S=g;g=null,S&&await _(S)}ro(()=>{const S=()=>{w(r,document.hasFocus(),!0)};return S(),window.addEventListener("focus",S),window.addEventListener("blur",S),()=>{window.removeEventListener("focus",S),window.removeEventListener("blur",S)}});const P=F.getReadableState().subscribe(()=>{g&&!g.current()&&f()});return qs(()=>{c=!0,P(),f()}),ae(()=>{const S=n.capture(),q=S?Pl(S):"",k=e(r)&&!e(a)&&(n.active()||e(i)?.key===q);ot(()=>{if(!k||!S){f();return}if(g?.key===q)return;if(v===q){f();return}f();const O=qi(S)?.clips.flatMap(Te=>!Te.mediaError&&Te.media?[Te.media]:[])??[],T=O[0],D=F.state.principal.snapshot,K=Bl.select(F.state,S.workspaceId);if(!T||!D||!K||n.drafts.gateActive)return;const se=wf(),C=new AbortController,x=()=>!c&&!C.signal.aborted&&Ri(F.state)===S.authority&&Bl.select(F.state,S.workspaceId)===K&&bf(se)&&!!n.capture()&&Pl(n.capture())===q,Q={key:q,capture:S,abort:C,native:null,slot:null,current:x};g=Q;const pe=l;n.drafts.flushDraft(S).then(async Te=>{if(!(g!==Q||pe!==l||!x())){if(!Te){v=q,await f();return}Q.native=Zd({workspaceId:S.workspaceId,agentId:S.agentId,draftId:crypto.randomUUID(),principalId:D.principal.id,media:structuredClone(O)},x,C.signal),Q.slot=_y(Q.native.service),v=q,Q.slot.warm(q,T,x)}}).catch(()=>{g===Q&&f()})})}),{cancel:f,async beforeEditorOpen(){w(a,!0),v=null,await f()},editorState(S,q){w(a,S,!0);const k=q?Pl(q.capture):null;q&&e(i)?.openId!==q.openId&&(v=null),w(i,q&&k?{openId:q.openId,key:k}:null)},take(S,q){const k=g;if(!k?.native||!k.slot||k.key!==Pl(S)||!k.current())return f(),null;g=null,l++;const W=k.native,O=k.slot,T=()=>k.abort.abort();return q.addEventListener("abort",T,{once:!0}),q.aborted&&T(),{service:{...W.service,takePreparedRecording:D=>O.take(k.key,D,()=>!q.aborted&&k.current())},async dispose(){q.removeEventListener("abort",T),await _(k)}}}}}var Px=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function pv(n,r){if(new.target)return fn({component:pv,...n});mn(r,!1);var a={$set:vn,$on:(v,g)=>hn(r,v,g)};Uf();var i=Px(),c=I(i),l=de(c,!0);return b(i),L(v=>j(l,v),[()=>u.chat_draftGate_loading_label()]),p(n,i),_n(a)}var Rx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function Hd(n,r){if(new.target)return fn({component:Hd,...n});mn(r,!1);var a={$set:vn,$on:(v,g)=>hn(r,v,g)};Uf();var i=Rx(),c=m(I(i),2),l=de(c,!0);return pn(2),b(i),L((v,g)=>{Ue(i,"aria-label",v),j(l,g)},[()=>u.chat_newMessagesDivider_label(),()=>u.chat_newMessagesDivider_label()]),p(n,i),_n(a)}function Ax(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function Tx(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function Mx(n,r){return r&&n.includes(r)?r:null}function Yp(n,r,a){return r-n<=a}const Ex=.2;function Xp(n,r,a){const i=Math.max(0,a-r),c=n-Ex*r;return Math.min(Math.max(0,c),i)}function qx(n,r,a){return n!==null&&a&&n===r}function Lx(n){return n?bw(n)&&yw(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function Hx(n){const r=[],a=new Set;let i,c;for(const D of n.messages){if(D.agentId&&D.agentId!==n.agentId){i=void 0,c=void 0;continue}if(a.has(D.id))continue;a.add(D.id),n.breakBeforeMessageIds?.has(D.id)&&(i=void 0,c=void 0);const K=OS(D);if(K?.kind!=="turn-failure")c=void 0;else{const se=i?.seq!==void 0&&D.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(D.seq)&&D.seq===i.seq+1;(!c||!se)&&(c={key:JSON.stringify([n.agentId,"notice",D.id]),anchorMessageId:D.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(c)),c.records.push({messageId:D.id,reason:K.reason,timestamp:D.timestamp}),c.recordedFailureCount+=1}i=D}const l=new Map;for(const D of n.queue){if(!D.requeuedAfterFailure)continue;const K=D.turnId||void 0,se=JSON.stringify([n.agentId,K?"turn":"queue",K??D.id]);let C=l.get(se);C||(C={key:se,correlation:K?"turn":"queue-entry",turnId:K,queueIds:[],state:"queued"},l.set(se,C)),C.queueIds.includes(D.id)||C.queueIds.push(D.id)}const v=[...l.values()],g=n.session?.id===n.agentId?n.session:void 0,_=g?.status===ki.Error,f=n.transientError||_&&g.stopReason||null,P=_&&!f,S=_&&(!n.transientError||n.transientError===g.stopReason)?g.stopReasonTimestamp:void 0,q=S?Sp(S):null,k=q&&f&&f===g?.stopReason?r.flatMap(D=>D.records).filter(D=>D.reason===f&&Sp(D.timestamp)===q):[],W=k.length===1?k[0].messageId:void 0,T=(g?kf(g):!1)?"attempting":v.length?"queued":f||P?"action-needed":"inactive";return{history:r,queueRecovery:v,current:{state:T,error:f,needsFallbackReason:P,timestamp:S,noticeId:W}}}function Ox(n,r){const a=n.hiddenTail[0]?.id,i=Hx({...r,messages:[...n.groups.flatMap(g=>g.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),c=i.current.noticeId,l=i.history.map(g=>({...g,records:g.records.filter(_=>_.messageId!==c)})).filter(g=>g.records.length>0),v=new Set(l.map(g=>g.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(g=>[g.records[0].messageId,g])),collapsedMessageIds:new Set(i.history.flatMap(g=>g.records.map(_=>_.messageId).filter(_=>!v.has(_))))}}var Dx=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),Fx=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),Nx=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),Bx=E('<div class="mb-5"><!></div>'),Wx=E('<p data-testid="agent-welcome-description"> </p> <!>',1),Ux=E("<!> <!>",1),zx=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),jx=E("<!> <span> </span>",1),Gx=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function fv(n,r){if(new.target)return fn({component:fv,...n});mn(r,!0);const a=()=>ge(k,"$userOverrides$",v),i=()=>ge(q,"$specialists$",v),c=()=>ge(D,"$isGitHubAuth$",v),l=()=>ge(K,"$recentSpecialistIds$",v),[v,g]=Nr();let _=X(r,"onSpecialistChange",7),f=X(r,"session",7),P=X(r,"workspaceId",7);const S=Bn(P()??"");ae(()=>S.set(P()??""));const q=Qf(S),k=ek();ae(()=>{a()});const W=o(()=>{if(!f()||Zy(f()))return null;const N=f().metadata?.specialist||f().agentMetadata?.specialist;return N&&i().find(R=>R.id===N)||null});async function O(N){N?await Gl({specialist:N,hash:"specialists"}):await Gl({view:"create-specialist"})}let T=_e(!1);const D=tk(),K=pS(),se=o(()=>Iw(nk(i(),c()),l()));let C=_e(!1);const x=o(()=>u.chat_regularAgentWelcome_generalDescription_label()),Q=o(()=>e(W)?.name??u.chat_shared_general_fallback()),pe=o(()=>e(W)?.description??u.chat_shared_noSpecializedBehavior_label()),Te=o(()=>e(W)?e(W).defaultBehaviorPrompt||"":e(x));var he={get onSpecialistChange(){return _()},set onSpecialistChange(N){_(N),Z()},get session(){return f()},set session(N){f(N),Z()},get workspaceId(){return P()},set workspaceId(N){P(N),Z()},$set:vn,$on:(N,R)=>hn(r,N,R)},fe=Gx(),Le=I(fe);{var ue=N=>{var R=Bx(),re=I(R);fk(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(C)},set open(Y){w(C,Y,!0)},trigger:(Y,J)=>{let Se=()=>(J?.()).props;{let He=o(()=>zd("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));$t(Y,Li(Se,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(He)},"data-testid":"specialist-picker-trigger",children:(z,Ie)=>{var Ce=Dx(),De=ye(Ce),at=I(De);{let ze=o(()=>e(W)?.id??null),Ze=o(()=>e(W)?.icon??null);pk(at,{agentId:"blank",variant:"emphasized",get specialist(){return e(ze)},get icon(){return e(Ze)}})}b(De);var lt=m(De,2),Oe=I(lt),$e=de(Oe,!0),V=m(Oe,2),ne=de(V,!0);b(lt);var Fe=m(lt,2),me=I(Fe);gt(me,{get icon(){return Na},size:10}),b(Fe),L(()=>{j($e,e(Q)),j(ne,e(pe))}),p(z,Ce)},$$slots:{default:!0}}))}},content:Y=>{var J=Nx(),Se=I(J),He=I(Se),z=de(He,!0),Ie=m(He,2),Ce=de(Ie,!0);b(Se);var De=m(Se,2),at=I(De);{let $e=o(()=>e(W)?.id??null);ew(at,{get specialists(){return e(se)},get value(){return e($e)},onchange:V=>{w(C,!1),_()?.(V)}})}b(De);var lt=m(De,2),Oe=I(lt);Tt(Oe,()=>Dr,($e,V)=>{V($e,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{w(C,!1),O()},children:(ne,Fe)=>{var me=Fx(),ze=ye(me),Ze=I(ze);gt(Ze,{get icon(){return O$},size:12}),b(ze);var ut=m(ze,2),mt=de(ut,!0);L(dt=>j(mt,dt),[()=>u.chat_regularAgentWelcome_createSpecialist_label()]),p(ne,me)},$$slots:{default:!0}})}),b(lt),b(J),L(($e,V)=>{j(z,$e),j(Ce,V)},[()=>u.workspace_createAgentSection_specialists_label(),()=>u.workspace_createAgentSection_specialists_description()]),p(Y,J)},$$slots:{trigger:!0,content:!0}}),b(R),p(N,R)};B(Le,N=>{_()&&N(ue)})}var oe=m(Le,2);{var Me=N=>{var R=Wt(),re=ye(R);{let qe=o(()=>u.chat_specialistSelector_prompt_label());Tt(re,()=>hk,(H,Y)=>{Y(H,{class:"mb-3",role:"region",get"aria-label"(){return e(qe)},children:(J,Se)=>{var He=Ux(),z=ye(He);Tt(z,()=>lv,(Ce,De)=>{De(Ce,{children:(at,lt)=>{var Oe=Wt(),$e=ye(Oe);Tt($e,()=>cv,(V,ne)=>{ne(V,{class:"type-caption font-medium",children:(Fe,me)=>{pn();var ze=dn();L(Ze=>j(ze,Ze),[()=>u.chat_specialistSelector_prompt_label()]),p(Fe,ze)},$$slots:{default:!0}})}),p(at,Oe)},$$slots:{default:!0}})});var Ie=m(z,2);Tt(Ie,()=>vk,(Ce,De)=>{De(Ce,{children:(at,lt)=>{var Oe=Wx(),$e=ye(Oe),V=de($e,!0),ne=m($e,2);$t(ne,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>w(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(Fe,me)=>{pn();var ze=dn();L(Ze=>j(ze,Ze),[()=>e(T)?u.chat_regularAgentWelcome_showLess_label():u.chat_regularAgentWelcome_showMore_label()]),p(Fe,ze)},$$slots:{default:!0}}),L(()=>{xe($e,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),j(V,e(Te))}),p(at,Oe)},$$slots:{default:!0}})}),p(J,He)},$$slots:{default:!0}})})}p(N,R)},ie=N=>{var R=zx(),re=de(R,!0);L(()=>j(re,e(Te))),p(N,R)};B(oe,N=>{e(W)?N(Me):N(ie,-1)})}var ee=m(oe,2);{var Ae=N=>{$t(N,{variant:"ghost-light",size:"sm",onclick:()=>O(e(W).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(R,re)=>{var qe=jx(),H=ye(qe);gt(H,{get icon(){return H$},size:12,class:"opacity-60"});var Y=m(H,2),J=de(Y,!0);L(Se=>j(J,Se),[()=>u.chat_regularAgentWelcome_customize_label()]),p(R,qe)},$$slots:{default:!0}})};B(ee,N=>{e(W)&&N(Ae)})}b(fe),p(n,fe);var Ee=_n(he);return g(),Ee}var Vx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),Kx=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Qx=E('<span class="type-caption"> </span>'),Jx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Yx=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function eu(n,r){if(new.target)return fn({component:eu,...n});mn(r,!0);let a=X(r,"prompts",7),i=X(r,"onSelect",7),c=X(r,"onEdit",7),l=X(r,"compact",7,!1),v=X(r,"showShortcutHints",7,!1),g=X(r,"reserveShortcutHintSpace",7,!1),_=X(r,"workspaceId",7);const P=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",S=p$.replace("text-ui","type-caption");function q(x){i()(x)}function k(x,Q){x.key!=="Enter"&&x.key!==" "||(x.preventDefault(),q(Q))}function W(x,Q){x.preventDefault(),x.stopPropagation(),qd(Q,{workspaceId:_(),event:x})}function O(x,Q){(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),qd(Q,{workspaceId:_(),event:x}))}function T(x){return x<3}var D={get prompts(){return a()},set prompts(x){a(x),Z()},get onSelect(){return i()},set onSelect(x){i(x),Z()},get onEdit(){return c()},set onEdit(x){c(x),Z()},get compact(){return l()},set compact(x=!1){l(x),Z()},get showShortcutHints(){return v()},set showShortcutHints(x=!1){v(x),Z()},get reserveShortcutHintSpace(){return g()},set reserveShortcutHintSpace(x=!1){g(x),Z()},get workspaceId(){return _()},set workspaceId(x){_(x),Z()},$set:vn,$on:(x,Q)=>hn(r,x,Q)},K=Wt(),se=ye(K);{var C=x=>{var Q=Yx(),pe=I(Q);{const Te=(fe,Le)=>{let ue=()=>(Le?.()).item,oe=()=>(Le?.()).index;const Me=o(()=>ay(ue())),ie=o(()=>e(Me)[0]?.type==="text"?e(Me)[0].content:"");var ee=Jx(),Ae=I(ee),Ee=I(Ae);gt(Ee,{get icon(){return zf},size:16,get class(){return gr}}),b(Ae);var N=m(Ae,2),R=I(N),re=de(R,!0),qe=m(R);On(qe,17,()=>e(Me).slice(e(ie)?1:0),Y_,(z,Ie)=>{var Ce=Wt(),De=ye(Ce);{var at=Oe=>{const $e=o(()=>ry(e(Ie).url));var V=Vx(),ne=de(V,!0);L(()=>{Ue(V,"href",e($e)),Ue(V,"title",e($e)),j(ne,e(Ie).label)}),ps("click",V,Fe=>W(Fe,e($e))),ps("keydown",V,Fe=>O(Fe,e($e))),p(Oe,V)},lt=Oe=>{var $e=dn();L(()=>j($e,e(Ie).content)),p(Oe,$e)};B(De,Oe=>{e(Ie).type==="link"?Oe(at):Oe(lt,-1)})}p(z,Ce)}),b(N);var H=m(N,2);{var Y=z=>{var Ie=Kx();let Ce;var De=de(Ie);L(()=>{Ce=xe(Ie,1,`${S??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!v()}),Ue(Ie,"aria-hidden",v()?void 0:"true"),Ue(Ie,"data-hint-visible",v()),j(De,`${P}${oe()+1}`)}),p(z,Ie)},J=o(()=>T(oe())&&(v()||g()));B(H,z=>{e(J)&&z(Y)})}var Se=m(H,2);{var He=z=>{L$(z,{side:"top",delayDuration:300,trigger:De=>{{let at=o(()=>u.chat_suggestedPrompts_editInInput_ariaLabel());$t(De,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:lt=>{lt.stopPropagation(),c()(ue())},get"aria-label"(){return e(at)},children:(lt,Oe)=>{gt(lt,{get icon(){return D$},size:"xs"})},$$slots:{default:!0}})}},content:De=>{var at=Qx(),lt=de(at,!0);L(Oe=>j(lt,Oe),[()=>u.chat_suggestedPrompts_edit_tooltip()]),p(De,at)},$$slots:{trigger:!0,content:!0}})};B(Se,z=>{c()&&z(He)})}b(ee),L(z=>{xe(ee,1,`${Wf} ${g$} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),xe(Ae,1,`${Ul??""} mt-px self-start`),Ue(R,"aria-label",z),j(re,e(ie))},[()=>ny(ue())]),ps("click",R,z=>{z.stopPropagation(),q(ue())}),ps("keydown",R,z=>k(z,ue())),p(fe,ee)};let he=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");T$(pe,{get items(){return a()},virtualize:!1,onActivate:q,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(he)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Te,$$slots:{row:!0}})}b(Q),Bt(1,Q,()=>ma,()=>({tier:"fast",y:0,scale:1})),Bt(2,Q,()=>to,()=>({tier:"fast"})),p(x,Q)};B(se,x=>{a().length>0&&x(C)})}return p(n,K),_n(D)}Ud(["click","keydown"]);var Xx=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function vv(n,r){if(new.target)return fn({component:vv,...n});mn(r,!0);let a=X(r,"onSelect",7),i=X(r,"compact",7,!1);const c=o(()=>[{label:u.chat_chiefEmptyState_assignedPrs_label(),prompt:u.chat_chiefEmptyState_assignedPrs_prompt()},{label:u.chat_chiefEmptyState_staleWorkspaces_label(),prompt:u.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:u.chat_chiefEmptyState_agentPerformance_label(),prompt:u.chat_chiefEmptyState_agentPerformance_prompt()},{label:u.chat_chiefEmptyState_morningBrief_label(),prompt:u.chat_chiefEmptyState_morningBrief_prompt()},{label:u.chat_chiefEmptyState_randomTheme_label(),prompt:u.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(c).map(q=>q.label));function v(q){const k=e(c).find(W=>W.label===q);k&&a()(k.prompt)}var g={get onSelect(){return a()},set onSelect(q){a(q),Z()},get compact(){return i()},set compact(q=!1){i(q),Z()},$set:vn,$on:(q,k)=>hn(r,q,k)},_=Xx(),f=I(_),P=de(f,!0),S=m(f,2);return eu(S,{get prompts(){return e(l)},onSelect:v,get compact(){return i()}}),b(_),L(q=>j(P,q),[()=>u.chat_chiefEmptyState_intro_label()]),p(n,_),_n(g)}const tu=2e3,Zx=4e3,e1=Zx-tu-2;function t1(n,r=tu){const a=[];let i=0;for(let c=n.length-1;c>=0&&i<r;c-=1){const l=n[c];if(l.role!=="user"&&l.role!=="assistant")continue;const v=(l.contentBlocks??[]).filter(_=>_.type==="text").map(_=>_.text||_.content||"").join(""),g=(l.role==="assistant"?tw(v).cleanedContent:v).trim();g&&(a.unshift({role:l.role,text:g}),i+=g.length)}return a}function n1(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
|
|
1
|
+
var G_=Object.defineProperty;var Ng=n=>{throw TypeError(n)};var V_=(n,r,a)=>r in n?G_(n,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[r]=a;var Js=(n,r,a)=>V_(n,typeof r!="symbol"?r+"":r,a),K_=(n,r,a)=>r.has(n)||Ng("Cannot "+a);var Ao=(n,r,a)=>(K_(n,r,"read from private field"),a?a.call(n):r.get(n)),Bg=(n,r,a)=>r.has(n)?Ng("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,a);import{t as fn,bo as X,bw as vn,bp as pf,b as hn,bm as u,bq as Nr,bs as ge,br as Li}from"./CLAmm_T1.js";import{bs as mn,a5 as I,bf as fs,bA as b,W as p,bn as _n,aA as Z,aB as E,ca as ae,a7 as Wt,ay as ye,aD as e,cd as Bn,c9 as o,bS as m,bl as de,be as pn,b_ as L,bO as j,c5 as ot,bH as w,bV as _e,bj as qs,bk as ro,b$ as dn,ai as Ud,aj as ps,bo as Vl,br as Tr,c0 as Ot,cb as ql,ak as Q_,aw as bi,a as J_}from"./3SdAC2_C.js";import{i as B}from"./BFgvMDua.js";import{k as Ci}from"./CIbfGsF-.js";import{g as On,i as Y_,I as eo,p as Lo,e as Eo}from"./B1CKzIA2.js";import{n as Bt,l as ma,c as to,j as Wg,k as Do,h as X_}from"./CfNIzRu8.js";import{b as ff,e as zd,f as xe,s as Ue,c as jt,g as gs}from"./CcJmuwXr.js";import{b as Z_}from"./goTpbPhD.js";import{b as _r}from"./Dn334wJv.js";import{m as ew,U as tw,Z as nw,X as rw,Y as aw,I as Ug,o as sw,l as ow,a2 as iw,x as zg,$ as lw,a0 as jg,r as cw,s as dw}from"./DLnFsCgA.js";import{JH as F,fp as uw,eX as gw,f4 as pw,eY as fw,f2 as vw,f1 as hw,e_ as mw,f0 as _w,eZ as ww,rw as bw,c7 as yw,i as ki,Jg as Iw,Dn as vf,Ds as Sw,Du as Gg,Dr as $w,Dt as kw,vF as xw,vH as Cw,CA as hf,cq as Pw,co as Rw,BJ as Aw,bF as Tw,Ae as Mw,Cp as id,v1 as Ew,cr as Vg,dC as qw,dD as Lw,Cz as Hw,em as Ow,CT as Dw,CS as Fw,CX as Nw,CW as Bw,cR as Ww,cU as Uw,nE as zw,es as jw,wT as Gw,CY as Vw,wV as Kw,CZ as Qw,cV as Jw,cW as Yw,nM as Xw,As as Zw,IC as eb,Ar as tb,DE as nb,wo as rb,wp as ab,za as sb,ze as ld,wk as ob,wl as ib,rU as lb,rh as cb,rf as db,f$ as ub,H_ as gb,Lv as pb,GX as fb,go as vb,p4 as hb,Jv as mb,ol as _b,Ad as wb,fu as Kg,r4 as Qg,fn as bb,fm as yb,tD as Ib,g4 as Jg,rg as Sb,ff as $b,Ck as kb,m as xb,nN as Cb,zS as Pb,z8 as Rb,EK as Ab,Ez as Yg,xj as Tb,xk as Xg,v0 as Zg,p5 as Mb,DQ as Eb,gk as qb,g2 as Lb,eV as Hb,cN as Ob,Ah as Db,LA as Fb,CF as Nb,LS as Bb,y4 as Wb,gb as Ub,fe as zb,cM as jb,cJ as Gb,cI as Vb,vt as Kb,xq as Qb,xo as Jb,cG as Yb,cF as Xb,zg as Zb,zb as ey,xp as ty}from"./B9vHutcJ.js";import{a as jd}from"./CC7to1B5.js";import{aM as ny,aL as ry,bg as ay,a7 as sy,aD as oy,aO as iy,M as mf,a0 as _f,b8 as ly,b2 as cy,as as ep,P as yl,b0 as tp,a$ as np,a_ as rp}from"./cTFeOFQC.js";import{l as wf,G as dy,I as Rd,at as uy,b1 as Ll,a9 as bf,S as gy,aW as cd,aq as py,aJ as fy,C as vy,z as yf,s as hy,A as my,v as _y,a$ as wy,aH as If,aG as Sf,aI as by,j as ap,aM as dd,aT as sp,aS as Il,aU as op,Q as ip,d as yy,e as Iy,ax as Sy,V as lp,aE as $y,c as ky,m as xy,aV as cp,ap as Cy,aw as dp,a as Py,aA as Ry,ad as up,aD as Ay,aX as gp,a_ as pp,n as fp,ae as Ty,R as My,ay as vp,am as Ey,O as qy,as as Ly,h as Hy,q as Oy,$ as ud,_ as Dy,aC as hp,a8 as Fy,f as Ny,i as By,a6 as Wy,ac as Uy}from"./DjbX62Cx.js";import{f as zy,o as jy,E as Gy,C as Vy,m as Ky,a2 as mp,aa as Qy,K as Jy,e as Yy,y as Xy}from"./BbhtQrkZ.js";import{a as Ri}from"./_UjuBCOJ.js";import{dX as Bl,cU as $f,O as kf,W as Zy,bv as eI,aF as xf,dI as Cf,aU as qo,e9 as tI,dx as Pf,aw as Gd,dW as Vd,aN as Rf,cP as nI,V as ha,a3 as Xs,B as rI,a7 as aI,a4 as sI,M as oI,a6 as iI,ar as lI,aG as Af,aO as Hl,b6 as cI,ay as Tf,r as dI,n as Ad,H as uI,dZ as gI,aQ as pI,aK as fI,c9 as vI,aW as hI,bM as mI,bK as _I,bL as wI,c8 as bI,c7 as yI,cN as II,cM as SI,aS as $I,bb as kI,bd as xI,bg as CI,bc as PI,bl as RI,bf as AI,be as TI,bh as MI,bi as EI,bk as qI,bj as LI,ax as HI,cj as OI,ck as DI,dw as FI,dv as NI,a$ as BI,G as WI,b3 as UI,cf as zI,C as _p,d1 as jI,ba as ds,b$ as GI,X as VI,bq as KI,E as QI,ad as JI,t as YI,cX as XI,d4 as wp,Q as bp,du as ZI,cQ as gd}from"./C2UL5Ler.js";import{u as Mf,a as Sl,ag as eS,x as tS,ad as Ef,af as nS,ac as qf,a4 as rS,F as yp,D as aS,e as sS,n as oS,s as iS,m as lS,Y as cS,k as dS}from"./DXY_Cr2S.js";import{a2 as uS,b5 as gS,cN as pS,a_ as fS,b4 as vS,c3 as hS,ca as mS,w as _S,x as wS,ce as bS}from"./CQlYR8ss.js";import{n as yS,P as Lf,F as IS,ai as SS,r as $S,ac as kS}from"./BBFoj-dS.js";import{I as xS,s as CS,H as Ip}from"./Bqd7fdCF.js";import{e as PS}from"./CL3a4Hm1.js";import{e as RS,f as AS}from"./CZr8f1ch.js";import{s as TS,o as Zs,b as MS,g as Wl,d as ES,l as yi}from"./CIyUrgF0.js";import{a5 as qS,a7 as LS,D as HS,N as OS,ac as Sp,X as Hf,i as DS,r as ur,v as Ai,u as ea,p as xi,x as wr,S as Kd,m as Kl,s as Ho,y as Ti,o as ao,n as so,t as $p,aa as oo,w as io,a9 as Qd,q as _a,z as Oo,J as Td,_ as kp,g as FS,F as NS,U as Of,I as Df,a8 as Ff,a6 as Ol,O as BS,E as Nf,V as WS,A as US,b as zS,ab as jS,ad as $l,G as GS,e as pd,l as VS,C as KS,f as Ys,j as xp,H as us,Q as QS,d as kl,c as JS,a as Cp,h as YS,L as XS,Y as Pp,a4 as fd,a1 as Rp,a0 as ZS,a3 as Ap,$ as Tp,T as e$,B as t$,k as n$,a2 as r$,K as a$,R as s$,P as o$,W as i$}from"./CG1puMxA.js";import{m as l$}from"./Dms_DO28.js";import{g as Bf}from"./DfheqyY9.js";import{b as c$}from"./BPQFiQQc.js";import{g as d$}from"./CgGsxeG7.js";import{a as u$}from"./X0RLj3lE.js";import{q as Wf,d as gr,r as g$,e as Ul,j as p$,g as Md,i as f$,f as Ed,c as v$,A as h$,O as Mp,k as m$}from"./Bb98JhKr.js";import{P as _$}from"./DdNhEgdc.js";import{e as w$}from"./Cm0Qloca.js";import{b as b$,a as y$,g as I$,c as S$,i as $$}from"./CWsj4Hb7.js";import{R as k$,g as x$,W as xl,c as C$}from"./BdrLG-E0.js";import"./C4jSaPCg.js";import"./CEE0831H.js";import{t as Mi}from"./BwNrQXlF.js";import{F as P$,h as R$}from"./TB9r2XJy.js";import"./CgrVbtN0.js";import{C as A$,e as Dr,L as T$,l as Ql,d as Jl,K as Yl,h as Jd,M as Xl,S as Fa}from"./Dd-LQrG1.js";import{D as M$}from"./i5FUlYpy.js";import{f as Ep}from"./B_vpadVO.js";import"./DU3vNstz.js";import{i as Uf}from"./BjLb7AHW.js";import{h as qp,i as Lp,g as Hp,P as Op,C as E$,m as Dl,R as q$}from"./96V4v2iI.js";import{f as $t,ae as L$}from"./nxtepGjE.js";import{F as gt,bs as H$,cd as O$,aw as Na,a2 as zf,c9 as D$,bf as F$,be as N$,bg as B$,aO as Dp,aj as vd,aB as hd,bB as jf,d3 as zl,cF as W$,aM as Fp,cb as Np,cK as jl,bu as U$,aS as z$,d0 as j$,a8 as Gf,ac as G$,ag as V$,cr as K$,ba as Q$,aC as Vf,cT as Bp,cz as J$,ax as Y$,cD as X$,c3 as Z$}from"./DPttSllj.js";import{c as Kf}from"./ChTqQfQN.js";import"./BbYWP3Ow.js";import{c as Tt}from"./BwH4Bvte.js";import{a4 as Qf,bf as ek,aq as tk,k as nk,X as rk,V as ak,a1 as sk,Y as ok,bv as ik,U as lk,a0 as ck,ag as dk}from"./Rtit513z.js";import{d as Gl,f as uk,e as gk}from"./BfnPC1r8.js";import{A as pk}from"./9YT9B_ti.js";import{D as fk}from"./CjPEI4fg.js";import"./hkJYqn41.js";import{a as vk,C as hk}from"./etz9IKpr.js";import"./DtzJzV-4.js";import{C as mk}from"./BpMXdC4H.js";import{h as qd,r as _k,a as wk}from"./CcDyBqhb.js";import{s as bk}from"./DuaPhBil.js";import{I as yk,a as Jf}from"./DaWmj23r.js";import{L as Ik}from"./B5N8LmEF.js";import{g as Sk,f as $k,b as kk}from"./DQw0Iiac.js";import{s as Ei,g as Yn,i as xk,j as Ck,e as Wp,r as Up,f as Pk,d as Rk,a as md,h as Ak}from"./CbwlFeZe.js";import{i as zp,a as Tk}from"./Bu13V5mO.js";import{seekConversationToMessage as jp}from"./kzuAnGps.js";import{l as Xt,o as _d,h as Yd,n as Ld,q as Mk}from"./Cu5e4npY.js";import{o as Ek}from"./B2_6AX8w.js";import{A as Yf}from"./C6RhewOE.js";import{b as Xf}from"./BhCMc9G0.js";import{h as qk,f as Zf,w as Lk,g as Hk,Q as Ok,O as Dk,M as Fk,l as ev,m as Nk,J as tv,s as nv}from"./uvhZkGDU.js";import{selectCurrentWorkspaceTabId as wd}from"./aZdb_rCN.js";import{o as Bk}from"./Bc1CpNLz.js";import{d as Wk}from"./B0Z-1lwJ.js";import{P as Uk}from"./TBtn8giw.js";import{g as zk}from"./OIB4u9ZA.js";import{H as rv,M as jk,y as Gk,J as Vk,g as Kk,i as Qk,u as Jk,e as av,c as sv,d as Yk}from"./BzWT_wQw.js";import{c as Xk,h as Xd,f as ov,Q as Zk}from"./KnkAG0HD.js";import{t as ex}from"./DAsc1V4f.js";import{s as tx}from"./BsieX9dN.js";import{i as iv}from"./Dqi2LMpO.js";import{d as nx,i as rx,r as ax}from"./BGrimfDs.js";import{g as sx}from"./CYxt6gzD.js";var ox=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),ix=E("<div><!></div>");function lv(n,r){if(new.target)return fn({component:lv,...n});mn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=pf(r,ox);var v={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:vn,$on:(f,P)=>hn(r,f,P)},g=ix();ff(g,f=>({"data-slot":"card-header",class:f,...l}),[()=>zd("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-x-4 gap-y-1.5 pt-4 pb-2 has-data-[slot=card-action]:grid-cols-[minmax(0,1fr)_auto]",mk,i())]);var _=I(g);return Mi(_,()=>c()??fs),b(g),_r(g,f=>a(f),()=>a()),p(n,g),_n(v)}var lx=new Set(["$$slots","$$events","$$legacy","ref","class","children"]),cx=E("<div><!></div>");function cv(n,r){if(new.target)return fn({component:cv,...n});mn(r,!0);let a=X(r,"ref",15,null),i=X(r,"class",7),c=X(r,"children",7),l=pf(r,lx);var v={get ref(){return a()},set ref(f=null){a(f),Z()},get class(){return i()},set class(f){i(f),Z()},get children(){return c()},set children(f){c(f),Z()},$set:vn,$on:(f,P)=>hn(r,f,P)},g=cx();ff(g,f=>({"data-slot":"card-title",class:f,...l}),[()=>zd("type-title min-w-0 break-words font-semibold leading-tight text-foreground",i())]);var _=I(g);return Mi(_,()=>c()??fs),b(g),_r(g,f=>a(f),()=>a()),p(n,g),_n(v)}const Cl=xS.CHAT_MEDIA,bd=TS().min(1).max(512);Zs({workspaceId:bd,agentId:bd,draftId:Wl(),principalId:bd,media:MS(yS).min(1).max(20)}).strict();const dx=Zs({sessionId:Wl()}).strict();dx.extend({control:ES("action",[Zs({action:yi("readiness")}).strict(),Zs({action:yi("export"),request:RS}).strict(),Zs({action:yi("transcribe"),request:AS}).strict(),Zs({action:yi("release"),jobId:Wl()}).strict(),Zs({action:yi("adopt"),jobId:Wl()}).strict()])}).strict();function Zd(n,r,a,i=async(c,l)=>typeof window>"u"||CS(window)!=="electron"?{ok:!1,error:"unavailable"}:PS().invoke(c,l)){let c=null,l=null,v=!1;async function g(){v=!0,a.removeEventListener("abort",_);const k=c;c=null,k&&await i(Cl.CLOSE,{sessionId:k}).catch(()=>{})}const _=()=>{g()};a.addEventListener("abort",_,{once:!0});const f=()=>{if(v||a.aborted||!r())throw new Error("media-send-retired")};async function P(){if(f(),c)return c;if(l)return l;l=(async()=>{const k=await i(Cl.BEGIN,n);if(!k.ok)throw new Error("media-export-unavailable");c=k.value.sessionId;try{return f(),c}catch(W){throw await g(),W}})();try{return await l}finally{l=null}}async function S(k){const W=await P();f();const O=await i(Cl.CONTROL,{sessionId:W,control:k});return f(),O}return{service:{exportMedia:k=>S({action:"export",request:k}),adoptMediaJob:k=>S({action:"adopt",jobId:k}),transcribeMedia:k=>S({action:"transcribe",request:k}),releaseMediaJob:async k=>c?await i(Cl.CONTROL,{sessionId:c,control:{action:"release",jobId:k}}):{ok:!0,value:void 0}},dispose:g,readiness:()=>S({action:"readiness"})}}const yd=new Set;async function ux(n){const{drafts:r,signal:a}=n,i=structuredClone(n.capture),c=structuredClone(n.items),l=structuredClone(n.payload),{workspaceId:v,agentId:g}=i,_=Ri(F.state),f=Bl.select(F.state,v),P=$f.select(F.state),S=wf(),q=JSON.stringify([_,v,g]);if(!_||!f||!P||l.wsId!==v||yd.has(q))return!1;yd.add(q);const k=new AbortController,W=()=>k.abort();a.addEventListener("abort",W,{once:!0});const O=()=>!a.aborted&&!k.signal.aborted&&Ri(F.state)===_&&Bl.select(F.state,v)===f&&bf(S)&&r.isCurrentDraft(i),T=F.getReadableState().subscribe(()=>{O()||k.abort()});let D=null;try{if(!O()||uS(c))return!1;const K=Mf(i.attachments),se=Lf(IS(v,g),K,c.map(fe=>({contextItemId:fe.id,attachmentId:fe.attachmentId,path:fe.path}))),C=new Set([...se.images,...se.clips].map(fe=>fe.contextItemId));if(K.some(([fe])=>!C.has(fe))||se.images.some(fe=>fe.mediaError)||se.clips.some(fe=>fe.mediaError)||!SS(l.text,se))throw new Error("invalid-evidence");if(D=n.warm?.take(i,k.signal)??null,!await r.flushDraft(i)||!O())return!1;const x=await zy.agents.get(g,v);if(!O())return!1;if(!x||x.workspaceId!==v||x.retiredAt||x.pendingDeleteAt||x.status==="deleted")throw new Error("unavailable");const Q=se.clips.flatMap(fe=>fe.media?[fe.media]:[]);Q.length&&!D&&(D=Zd({workspaceId:v,agentId:g,draftId:crypto.randomUUID(),principalId:P.principal.id,media:Q},O,k.signal));const pe=dy(c,se),Te=Rd(pe),he=await uy({workspaceId:v,agentId:g,evidence:se,clickedItems:c,sendItems:pe,clickedPayload:{...l,contextItems:pe,imageBlocks:Te.imageBlocks,fileBlocks:Te.fileBlocks},binding:S,service:D?.service??null,current:O,onRecord:()=>{}});return!he||!O()?!1:Ll(F,g,he)}catch{return O()&&F.dispatch(uw(g,u.dock_conversation_sendFailed_error())),!1}finally{T(),a.removeEventListener("abort",W),await D?.dispose(),yd.delete(q)}}const dv=1e4,Gp={wasBusy:!1,busySince:null,preempted:!1,prediction:null};function Vp(n){return qS(n.messageMetadata)}function gx(n,r){if(n.some(Vp)){const a=n[0];return a&&!Vp(a)&&Kp(a,r)?[a.id]:[]}return n.filter(a=>Kp(a,r)).map(a=>a.id)}function px(n){let r=null;for(const a of n)(a.status==="preparing"||a.status==="sending")&&a.createdAt>(r??-1/0)&&(r=a.createdAt);return r}function Kp(n,r){return!n.requeuedAfterFailure&&LS(n,r)}function fx(n,r){const{busy:a,queue:i,delivered:c,now:l}=r,v=r.blocked||r.interrupted,g=r.timeoutMs??dv;let _=n.prediction;if(_){const k=new Set(i.map(D=>D.id)),W=_.ids.filter(D=>k.has(D)&&!c.has(D)),O=l-_.startedAt>=g,T=n.wasBusy&&!a;!W.length||O||v&&!a||T?_=null:W.length!==_.ids.length&&(_={..._,ids:W})}const f=n.wasBusy&&!a,P=n.wasBusy?n.busySince:a?l:null,S=n.wasBusy&&n.preempted||P!==null&&r.directSendAt!==null&&r.directSendAt>P;if(!_&&f&&!v&&!S){const k=gx(i,l).filter(W=>!c.has(W));k.length&&(_={ids:k,startedAt:l})}const q={wasBusy:a,busySince:a?P:null,preempted:a&&S,prediction:_};return n.wasBusy===q.wasBusy&&n.busySince===q.busySince&&n.preempted===q.preempted&&n.prediction===q.prediction?n:q}class vx{constructor(){Js(this,"previousWorkspaceId",null);Js(this,"_isRebinding",!1);Js(this,"_generation",0);Js(this,"_rebindPromise",null);Js(this,"_rebindResolve",null)}recordMount(r){return this.previousWorkspaceId=r,r}wasWorkspaceChangedDuringMount(r){return this.previousWorkspaceId!==r}shouldRebind(r){return!r||this.previousWorkspaceId===null?!1:r!==this.previousWorkspaceId}recordRebind(r){this.previousWorkspaceId=r}hasWorkspaceChanged(r){return r!==this.previousWorkspaceId}get trackedWorkspaceId(){return this.previousWorkspaceId}get isRebinding(){return this._isRebinding}startRebind(){return this._generation++,this._isRebinding=!0,this._rebindResolve?.(),this._rebindPromise=new Promise(r=>{this._rebindResolve=r}),this._generation}endRebind(r){r!==void 0&&r!==this._generation||(this._isRebinding=!1,this._rebindResolve?.(),this._rebindPromise=null,this._rebindResolve=null)}async waitForRebind(r=5e3){if(!this._isRebinding||!this._rebindPromise)return!1;const a=Date.now()+r;for(;this._isRebinding&&this._rebindPromise;){const i=a-Date.now();if(i<=0)return!1;let c;const l=await Promise.race([this._rebindPromise.then(()=>!1),new Promise(v=>{c=setTimeout(()=>v(!0),i)})]);if(clearTimeout(c),l)return!1}return!0}}function hx(n,r){return!(n?.tabType!=="agent"||n.agentId!==r.agentId||!r.isActive||n.workspaceId&&n.workspaceId!==r.workspaceId||r.panelId&&(n.source!=="dictation"&&!r.isPanelFocused||n.panelId&&n.panelId!==r.panelId))}function Qp(n){const r=typeof n=="string"?n:n&&typeof n=="object"&&typeof n.script=="string"?n.script:void 0;return r||void 0}var mx=E('<div role="status" aria-live="polite" data-presence-typing-indicator=""><span class="inline-flex min-w-[var(--operational-leading-slot-size)] shrink-0 items-center justify-center svelte-lm4khl"><!></span> <span class="min-w-0 truncate svelte-lm4khl"> </span> <span class="inline-flex shrink-0 items-center gap-0.5 svelte-lm4khl" aria-hidden="true"><span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.2s"></span> <span class="typing-dot size-1 rounded-full bg-current svelte-lm4khl" style="animation-delay: 0.4s"></span></span></div>');function uv(n,r){if(new.target)return fn({component:uv,...n});mn(r,!0);const a=()=>ge(P,"$typing$",i),[i,c]=Nr();let l=X(r,"workspaceId",7),v=X(r,"agentId",7),g=X(r,"class",7,"");const _=Bn(""),f=Bn("");ae(()=>{_.set(l())}),ae(()=>{f.set(v())});const P=gS(_,f),S=o(()=>w$(a()));var q={get workspaceId(){return l()},set workspaceId(D){l(D),Z()},get agentId(){return v()},set agentId(D){v(D),Z()},get class(){return g()},set class(D=""){g(D),Z()},$set:vn,$on:(D,K)=>hn(r,D,K)},k=Wt(),W=ye(k);{var O=D=>{var K=mx(),se=I(K),C=I(se);_$(C,{get people(){return a()},size:12,decorative:!0}),b(se);var x=m(se,2),Q=de(x,!0);pn(2),b(K),L(()=>{xe(K,1,`${Wf} flex h-4 min-w-0 items-center gap-[var(--operational-leading-gap)] px-[var(--operational-row-inline-padding)] font-family-child font-normal text-muted-foreground text-[11px] leading-4 ${g()??""} /* a11y-ignore: user-requested compact typing status in the composer gap */`,"svelte-lm4khl"),j(Q,e(S))}),p(D,K)};B(W,D=>{e(S)&&D(O)})}p(n,k);var T=_n(q);return c(),T}const _x=50,wx=5e3,bx=500,yx=()=>({authority:()=>Ri(F.state),persistSnapshot:py,dispatch:n=>F.dispatch(n),ownerView:n=>fy.withStore(F)(n)});function Ix(n){const r=n.store??yx(),a=crypto.randomUUID();let i=_e(!1),c=_e(!1),l=_e(!1),v=null,g=null,_=0,f=!1,P=null,S=null,q=null,k=0,W=null,O=null;const T={};let D,K=_e([]),se=null,C=0,x="",Q=0,pe="";const Te=()=>{const N=n.workspaceId(),R=n.agentId();if(!N||!R||!(n.active?.()??!0))return null;const re=r.authority?.();if(!re||f)return null;const qe=n.inputValue(),H=fe(),Y=D?.shared,J=Y?.workspaceId===N&&Y.agentId===R?Y.lifetime:null,Se=JSON.stringify([re,N,R,k,J,H.map(z=>[z.id,z.attachmentId,z.path])]);Se!==pe&&(pe=Se,Q+=1);const He=JSON.stringify([re,N,R,qe,H,k]);return He!==x&&(x=He,C+=1),{authority:re,ownerId:a,workspaceId:N,agentId:R,text:qe,attachments:JSON.parse(JSON.stringify(H)),generation:C,attachmentEpoch:Q}};let he=null;const fe=()=>eS(n.contextItems(),tS(n.contextItems(),e(K))),Le=N=>{if(D=N,!N||f)return;const R=N.restore;if(O&&R?.requestId===O.requestId&&R.status!=="pending"){const{apply:H}=O;O=null,w(c,!1),R.status==="restored"&&w(K,R.draft?.attachments??[]),H(R)}const re=N.shared;if(re&&!e(c)&&g===`${re.workspaceId}\0${re.agentId}`){const H=JSON.stringify([re.provenance,re.workspaceId,re.agentId,re.lifetime,re.revision]);if(se!==H){se=H;const Y=he??v,J=Y&&n.inputValue()===Y.text&&JSON.stringify(fe())===Y.attachmentsJson;re.origin===a?he={text:re.snapshot.text,attachmentsJson:JSON.stringify(re.snapshot.attachments)}:J&&(_+=1,q&&clearTimeout(q),w(K,re.snapshot.attachments),he=v={text:re.snapshot.text,attachmentsJson:JSON.stringify(e(K))},n.setInputValue(re.snapshot.text),n.setContextItems(Sl(e(K))),n.applyEditorContent(re.snapshot.text))}}ot(Te);const qe=[];for(const H of N.saves){if(H.status==="pending")continue;qe.push(H.id);const Y=T[H.id];delete T[H.id],Y?.(H)}qe.length>0&&queueMicrotask(()=>r.dispatch(vw(a,qe)))},ue=(N,R,re)=>{const qe=crypto.randomUUID();O={requestId:qe,apply:re},w(c,!0),r.dispatch(mw(a,qe,N,R))},oe=()=>{O&&(O=null,w(c,!1),r.dispatch(ww(a)))},Me=()=>{const N=W;N&&(W=null,r.dispatch(_w(a)),D?.saves.some(R=>R.id===N)||delete T[N])};r.dispatch(gw(a));const ie=r.ownerView(a).subscribe(N=>ot(()=>Le(N))),ee=()=>{S&&(clearTimeout(S),S=null),w(l,!1)},Ae=()=>{W&&(W=null,r.dispatch(hw(a)))};ae(()=>{const N=n.active?.()??!0,R=n.workspaceId(),re=n.agentId();if(!N){ot(()=>{_+=1,g=null,oe(),P&&clearTimeout(P),P=null,ee(),q&&clearTimeout(q),q=null,w(i,!1),Ae()});return}if(!R||!re)return;const qe=`${R}\0${re}`;if(g===qe)return;const H=g!==null;g=qe;const Y=++_;ot(()=>{v=null,he=null,se=null,w(K,[]),P&&clearTimeout(P),ee(),q&&(clearTimeout(q),q=null),H&&(Ae(),n.setInputValue(""),n.contextItemsAreScoped||n.setContextItems([]),n.applyEditorContent(""));const J=gy(R,re);if(J){w(K,J.attachments),w(i,!1);const He=n.contextItems().length>0,z=J.text,Ie=JSON.stringify(J.attachments);n.setInputValue(J.text),He||n.setContextItems(Sl(J.attachments)),n.applyEditorContent(J.text),v={text:J.text,attachmentsJson:Ie},ue(R,re,Ce=>{if(Ce.status!=="restored")return;const De=Ce.draft;if(f||!(n.active?.()??!0)||g!==qe||_!==Y)return;const at=De?.text??"",lt=De?.attachments??[],Oe=JSON.stringify(lt);cd(R,re,{text:at,attachments:lt});const $e=n.inputValue()===z&&JSON.stringify(fe())===Ie;He||!$e||(at!==z&&(n.setInputValue(at),n.applyEditorContent(at)),Oe!==Ie&&n.setContextItems(Sl(lt)),v={text:at,attachmentsJson:Oe})});return}w(i,!0),S=setTimeout(()=>{S=null,(n.active?.()??!0)&&w(l,!0)},bx),P=setTimeout(()=>{(n.active?.()??!0)&&(w(i,!1),ee())},wx);const Se=()=>{!(n.active?.()??!0)||g!==qe||_!==Y||(P&&clearTimeout(P),w(i,!1),ee())};ue(R,re,He=>{if(He.status!=="restored"){Se();return}const z=He.draft;if(f||!(n.active?.()??!0)||g!==qe||_!==Y)return;const Ie=!!n.inputValue();if(!Ie&&z?.attachments?.length&&n.contextItems().length===0&&n.setContextItems(Sl(z.attachments)),!Ie&&z?.text&&(n.setInputValue(z.text),q=setTimeout(()=>{(n.active?.()??!0)&&n.inputValue()===z.text&&n.applyEditorContent(z.text)},_x)),v===null){const Ce=z?.text??"",De=z?.attachments??[];v={text:Ce,attachmentsJson:JSON.stringify(De)},cd(R,re,{text:Ce,attachments:De})}Se()})})}),ae(()=>{const N=n.active?.()??!0,R=n.workspaceId(),re=n.agentId(),qe=e(i);if(!N){ot(Me);return}if(!R||!re)return;const H=n.inputValue(),Y=fe();if(ot(Te),ot(Me),qe||v===null&&!H&&Y.length===0)return;const J=JSON.stringify(Y);if(v!==null&&v.text===H&&v.attachmentsJson===J)return;JSON.stringify(e(K))!==J&&w(K,Y);const Se=`${R}\0${re}`,He=k,z=crypto.randomUUID();T[z]=Ie=>{if(n.active?.()??!0){if(Ie.status==="saved"){g===Se&&k===He&&(v={text:H,attachmentsJson:J});return}n.onSaveError?.(new Error(Ie.error))}},ot(()=>{W=z,r.dispatch(pw(a,z,{authority:r.authority?.()??void 0,workspaceId:R,agentId:re,text:H,attachments:Y,rollback:v?{text:v.text,attachments:JSON.parse(v.attachmentsJson)}:null}))})}),ae(()=>()=>{f=!0,P&&clearTimeout(P),S&&clearTimeout(S),q&&clearTimeout(q),Ae(),ie(),r.dispatch(fw(a))});const Ee=N=>{const R=Te();return R!==null&&R.authority===N.authority&&R.ownerId===N.ownerId&&R.workspaceId===N.workspaceId&&R.agentId===N.agentId&&R.generation===N.generation&&R.text===N.text&&JSON.stringify(R.attachments)===JSON.stringify(N.attachments)};return{captureDraft:Te,isCurrentDraft:Ee,updateAttachmentScreen(N,R,re){return!Ee(N)||!N.attachments.some(qe=>qe.id===R)?null:(w(K,N.attachments.map(qe=>qe.id===R?{...qe,screen:structuredClone(re)}:qe)),Te())},async flushDraft(N){if(!Ee(N))return!1;if(!r.persistSnapshot)throw new Error("draft-shared-transport-unavailable");return await r.persistSnapshot(a,N.workspaceId,N.agentId,N,N.authority),Ee(N)},get restorePending(){return e(c)},get gateActive(){return e(i)},get gateVisible(){return e(l)},invalidatePendingRestore(){if(_+=1,k+=1,oe(),P&&(clearTimeout(P),P=null),q&&(clearTimeout(q),q=null),w(i,!1),ee(),Me(),g!==null){const[N,R]=g.split("\0");cd(N,R,{text:"",attachments:[]}),he=null,w(K,[]),v={text:"",attachmentsJson:"[]"}}}}}function qi(n){if(!n)return null;const r=Lf(JSON.stringify([n.workspaceId,n.agentId]),Mf(n.attachments),n.attachments.map(a=>({contextItemId:a.id,attachmentId:a.attachmentId,path:a.path})));return{...r,clips:r.clips.filter(a=>{const i=n.attachments.find(c=>c.id===a.contextItemId);return!!a.media&&!a.mediaError&&!!i&&a.path===i.path})}}async function Sx(n,r,a){const i=F.state.principal.snapshot,c=()=>Ri(F.state)===n.authority&&a.isCurrentDraft(n);if(!i||!c()||!await a.flushDraft(n)||!c())return{ready:!1};const l=new AbortController,v=Zd({workspaceId:n.workspaceId,agentId:n.agentId,principalId:i.principal.id,draftId:crypto.randomUUID(),media:[r]},c,l.signal);try{const g=await v.readiness();return!c()||!g.ok?{ready:!1}:g.value.find(_=>_.sourceId===r.source.id)??{ready:!1}}finally{await v.dispose()}}function Jp(n){let r=_e(null),a=_e(!1),i=_e(!1),c=null,l=!0,v=0,g=null;qs(()=>{l=!1,v++}),ae(()=>{const S=n.capture();e(r)&&(!S||S.authority!==e(r).capture.authority||S.ownerId!==e(r).capture.ownerId||S.workspaceId!==e(r).capture.workspaceId||S.agentId!==e(r).capture.agentId||S.attachmentEpoch!==e(r).capture.attachmentEpoch)&&w(r,null)});async function _(S){if(n.disabled()||e(a))return;const q=n.drafts.captureDraft(),k=qi(q),W=k?.clips.find(K=>K.contextItemId===S);if(!q||!W?.media||!k)return;const O=vy({workspaceId:q.workspaceId,agentId:q.agentId,clip:W,evidence:k,marks:k.marks}),T=yf(q.workspaceId,W.path);if(!O||!T)return;const D=++v;c=document.activeElement instanceof HTMLElement?document.activeElement:null,w(a,!0),w(i,!1);try{if(await n.beforeOpen?.(),!l||v!==D||!n.drafts.isCurrentDraft(q))return;const K=await(n.prepareOutput??Sx)(q,W.media,n.drafts);if(!l||v!==D||!n.drafts.isCurrentDraft(q))return;const{attachmentPath:se,...C}=O;w(r,{capture:q,contextItemId:S,snapshot:{...C,openId:crypto.randomUUID(),mediaUrl:T,output:K,deleteReady:!0}})}catch{l&&v===D&&w(i,!0)}finally{l&&v===D&&w(a,!1)}}async function f(S){const q=crypto.randomUUID(),k=e(r),W=n.drafts.captureDraft();if(!k||!W||W.authority!==k.capture.authority||W.ownerId!==k.capture.ownerId||W.workspaceId!==k.capture.workspaceId||W.agentId!==k.capture.agentId||W.attachmentEpoch!==k.capture.attachmentEpoch)return{requestId:q,result:"stale-source"};const O=qi(W),T=O?.clips.find(Q=>Q.contextItemId===k.contextItemId);if(!O||!T?.media)return{requestId:q,result:"stale-source"};const K=g?.openId===k.snapshot.openId&&g.inputRevision===S.revision&&JSON.stringify(g.media)===JSON.stringify(T.media)?{...S,revision:T.media.saved?.revision??0}:S,se=$S(T.media,{openId:k.snapshot.openId,...k.snapshot.output?.version===2?{outputVersion:2}:{},pair:{workspaceId:W.workspaceId,agentId:W.agentId},sourceId:S.sourceId,sourceRevision:S.sourceRevision,expectedEditRevision:K.revision,edit:K});if(se.status!=="saved")return{requestId:q,result:se.status==="invalid-edit"?"failed":se.status};const C=kS({...O,clips:O.clips.map(Q=>Q.id===T.id?{...Q,media:se.media}:Q)})[k.contextItemId],x=n.drafts.updateAttachmentScreen(W,k.contextItemId,C);if(!x)return{requestId:q,result:"stale-source"};g={openId:k.snapshot.openId,media:se.media,inputRevision:S.revision};try{if(!n.drafts.isCurrentDraft(x))return{requestId:q,result:"stale-source"};await n.drafts.flushDraft(x);const Q=n.drafts.captureDraft();return!l||e(r)?.snapshot.openId!==k.snapshot.openId||!Q||Q.attachmentEpoch!==k.capture.attachmentEpoch||Q.authority!==x.authority||Q.ownerId!==x.ownerId||Q.workspaceId!==x.workspaceId||Q.agentId!==x.agentId||JSON.stringify(Q.attachments.find(pe=>pe.id===k.contextItemId)?.screen)!==JSON.stringify(C)?{requestId:q,result:"stale-source"}:(g=null,{requestId:q,result:"saved",saved:se.media.saved??void 0})}catch{return{requestId:q,result:"failed"}}}function P(S){return n.disabled()||!n.onRemove(S)?!1:(e(r)?.contextItemId===S&&w(r,null),!0)}return{get session(){return e(r)},get opening(){return e(a)},get problem(){return e(i)},open:_,save:f,remove:P,close(){w(r,null)},restoreFocus(){c?.isConnected&&c.focus()}}}var $x=E('<p role="alert"> </p>'),kx=E('<div class="recording-editor-surface svelte-cdb16"><!></div>'),xx=E("<!> <!> <!>",1);function gv(n,r){if(new.target)return fn({component:gv,...n});mn(r,!0);let a=X(r,"capture",7),i=X(r,"drafts",7),c=X(r,"disabled",7,!1),l=X(r,"onRemove",7),v=X(r,"controllerFactory",7,Jp),g=X(r,"beforeOpen",7),_=X(r,"onReviewChange",7);const f=ot(()=>v()({drafts:i(),capture:()=>a(),disabled:()=>c(),onRemove:C=>l()(C),beforeOpen:()=>g()?.()??Promise.resolve()}));ae(()=>{const C=f.opening,x=f.session;ot(()=>_()?.(C,x?.snapshot.output?.ready?{openId:x.snapshot.openId,capture:x.capture}:null))});const P=o(hy),S=o(()=>qi(a())),q=o(()=>e(S)?.clips.map(C=>({id:C.contextItemId,kind:"clip",owner:"evidence",duration:Ep(C.durationMs),recording:!1,url:a()?yf(a().workspaceId,C.path):void 0,...C.media?.saved?{summary:my(C.media.saved)}:{}}))??[]);let k=_e(null);var W={get capture(){return a()},set capture(C){a(C),Z()},get drafts(){return i()},set drafts(C){i(C),Z()},get disabled(){return c()},set disabled(C=!1){c(C),Z()},get onRemove(){return l()},set onRemove(C){l(C),Z()},get controllerFactory(){return v()},set controllerFactory(C=Jp){v(C),Z()},get beforeOpen(){return g()},set beforeOpen(C){g(C),Z()},get onReviewChange(){return _()},set onReviewChange(C){_(C),Z()},$set:vn,$on:(C,x)=>hn(r,C,x)},O=xx(),T=ye(O);{let C=o(()=>c()||f.opening);HS(T,{get items(){return e(q)},get labels(){return e(P)},get disabled(){return e(C)},onEdit:x=>void f.open(x),onMarkUp:x=>void f.open(x),get onRemove(){return f.remove}})}var D=m(T,2);{var K=C=>{var x=$x(),Q=de(x,!0);L(pe=>j(Q,pe),[()=>u.dock_captureEditor_saveFailed_label()]),p(C,x)};B(D,C=>{f.problem&&C(K)})}var se=m(D,2);{let C=o(()=>!!f.session),x=o(()=>u.dock_captureEditor_recording_title({duration:f.session?Ep(f.session.snapshot.durationMs??0):""}));A$(se,{get open(){return e(C)},size:"editor",showCloseButton:!1,get title(){return e(x)},escapeKeydownBehavior:"ignore",dismissOnInteractOutside:!1,onClose:()=>f.close(),onCloseAutoFocus:Q=>{Q.preventDefault(),f.restoreFocus()},get contentRef(){return e(k)},set contentRef(Q){w(k,Q,!0)},children:(Q,pe)=>{var Te=Wt(),he=ye(Te);{var fe=Le=>{var ue=Wt(),oe=ye(ue);Ci(oe,()=>f.session.snapshot.openId,Me=>{var ie=kx(),ee=I(ie);M$(ee,{get snapshot(){return f.session.snapshot},get shortcutDialog(){return e(k)},onClose:()=>f.close(),get onSave(){return f.save},onDelete:async()=>!!f.session&&f.remove(f.session.contextItemId)}),b(ie),p(Me,ie)}),p(Le,ue)};B(he,Le=>{f.session&&Le(fe)})}p(Q,Te)},$$slots:{default:!0}})}return p(n,O),_n(W)}const Pl=n=>JSON.stringify([n.authority,n.ownerId,n.workspaceId,n.agentId,n.attachmentEpoch,n.attachments]);function Cx(n){let r=_e(!1),a=_e(!1),i=_e(null),c=!1,l=0,v=null,g=null;async function _(S){S.abort.abort(),S.slot?.cancel(),await S.native?.dispose()}async function f(){l++;const S=g;g=null,S&&await _(S)}ro(()=>{const S=()=>{w(r,document.hasFocus(),!0)};return S(),window.addEventListener("focus",S),window.addEventListener("blur",S),()=>{window.removeEventListener("focus",S),window.removeEventListener("blur",S)}});const P=F.getReadableState().subscribe(()=>{g&&!g.current()&&f()});return qs(()=>{c=!0,P(),f()}),ae(()=>{const S=n.capture(),q=S?Pl(S):"",k=e(r)&&!e(a)&&(n.active()||e(i)?.key===q);ot(()=>{if(!k||!S){f();return}if(g?.key===q)return;if(v===q){f();return}f();const O=qi(S)?.clips.flatMap(Te=>!Te.mediaError&&Te.media?[Te.media]:[])??[],T=O[0],D=F.state.principal.snapshot,K=Bl.select(F.state,S.workspaceId);if(!T||!D||!K||n.drafts.gateActive)return;const se=wf(),C=new AbortController,x=()=>!c&&!C.signal.aborted&&Ri(F.state)===S.authority&&Bl.select(F.state,S.workspaceId)===K&&bf(se)&&!!n.capture()&&Pl(n.capture())===q,Q={key:q,capture:S,abort:C,native:null,slot:null,current:x};g=Q;const pe=l;n.drafts.flushDraft(S).then(async Te=>{if(!(g!==Q||pe!==l||!x())){if(!Te){v=q,await f();return}Q.native=Zd({workspaceId:S.workspaceId,agentId:S.agentId,draftId:crypto.randomUUID(),principalId:D.principal.id,media:structuredClone(O)},x,C.signal),Q.slot=_y(Q.native.service),v=q,Q.slot.warm(q,T,x)}}).catch(()=>{g===Q&&f()})})}),{cancel:f,async beforeEditorOpen(){w(a,!0),v=null,await f()},editorState(S,q){w(a,S,!0);const k=q?Pl(q.capture):null;q&&e(i)?.openId!==q.openId&&(v=null),w(i,q&&k?{openId:q.openId,key:k}:null)},take(S,q){const k=g;if(!k?.native||!k.slot||k.key!==Pl(S)||!k.current())return f(),null;g=null,l++;const W=k.native,O=k.slot,T=()=>k.abort.abort();return q.addEventListener("abort",T,{once:!0}),q.aborted&&T(),{service:{...W.service,takePreparedRecording:D=>O.take(k.key,D,()=>!q.aborted&&k.current())},async dispose(){q.removeEventListener("abort",T),await _(k)}}}}}var Px=E('<div role="status" class="px-3 py-1.5 text-xs text-muted-foreground" data-testid="chat-draft-loading-gate"><span> </span></div>');function pv(n,r){if(new.target)return fn({component:pv,...n});mn(r,!1);var a={$set:vn,$on:(v,g)=>hn(r,v,g)};Uf();var i=Px(),c=I(i),l=de(c,!0);return b(i),L(v=>j(l,v),[()=>u.chat_draftGate_loading_label()]),p(n,i),_n(a)}var Rx=E('<div data-new-messages-divider="" class="type-caption font-family-child my-6 flex items-center gap-2 px-2" role="separator"><div class="h-px flex-1 bg-border"></div> <span class="whitespace-nowrap px-1 font-medium text-foreground"> </span> <div class="h-px flex-1 bg-border"></div></div>');function Hd(n,r){if(new.target)return fn({component:Hd,...n});mn(r,!1);var a={$set:vn,$on:(v,g)=>hn(r,v,g)};Uf();var i=Rx(),c=m(I(i),2),l=de(c,!0);return pn(2),b(i),L((v,g)=>{Ue(i,"aria-label",v),j(l,g)},[()=>u.chat_newMessagesDivider_label(),()=>u.chat_newMessagesDivider_label()]),p(n,i),_n(a)}function Ax(n,r){if(!r||n.length===0)return null;const a=n.indexOf(r);return a===-1||a===n.length-1?null:r}function Tx(n,r,a){if(!r||n.length===0)return"none";const i=n.indexOf(r);return i===n.length-1?"none":i!==-1?"marker-loaded":a.complete?a.truncated?"marker-beyond-window":"none":"marker-pending"}function Mx(n,r){return r&&n.includes(r)?r:null}function Yp(n,r,a){return r-n<=a}const Ex=.2;function Xp(n,r,a){const i=Math.max(0,a-r),c=n-Ex*r;return Math.min(Math.max(0,c),i)}function qx(n,r,a){return n!==null&&a&&n===r}function Lx(n){return n?bw(n)&&yw(n)!==null&&typeof n.metadata?.taskNoteId=="string":!1}function Hx(n){const r=[],a=new Set;let i,c;for(const D of n.messages){if(D.agentId&&D.agentId!==n.agentId){i=void 0,c=void 0;continue}if(a.has(D.id))continue;a.add(D.id),n.breakBeforeMessageIds?.has(D.id)&&(i=void 0,c=void 0);const K=OS(D);if(K?.kind!=="turn-failure")c=void 0;else{const se=i?.seq!==void 0&&D.seq!==void 0&&Number.isSafeInteger(i.seq)&&Number.isSafeInteger(D.seq)&&D.seq===i.seq+1;(!c||!se)&&(c={key:JSON.stringify([n.agentId,"notice",D.id]),anchorMessageId:D.id,correlation:"unavailable",records:[],recordedFailureCount:0},r.push(c)),c.records.push({messageId:D.id,reason:K.reason,timestamp:D.timestamp}),c.recordedFailureCount+=1}i=D}const l=new Map;for(const D of n.queue){if(!D.requeuedAfterFailure)continue;const K=D.turnId||void 0,se=JSON.stringify([n.agentId,K?"turn":"queue",K??D.id]);let C=l.get(se);C||(C={key:se,correlation:K?"turn":"queue-entry",turnId:K,queueIds:[],state:"queued"},l.set(se,C)),C.queueIds.includes(D.id)||C.queueIds.push(D.id)}const v=[...l.values()],g=n.session?.id===n.agentId?n.session:void 0,_=g?.status===ki.Error,f=n.transientError||_&&g.stopReason||null,P=_&&!f,S=_&&(!n.transientError||n.transientError===g.stopReason)?g.stopReasonTimestamp:void 0,q=S?Sp(S):null,k=q&&f&&f===g?.stopReason?r.flatMap(D=>D.records).filter(D=>D.reason===f&&Sp(D.timestamp)===q):[],W=k.length===1?k[0].messageId:void 0,T=(g?kf(g):!1)?"attempting":v.length?"queued":f||P?"action-needed":"inactive";return{history:r,queueRecovery:v,current:{state:T,error:f,needsFallbackReason:P,timestamp:S,noticeId:W}}}function Ox(n,r){const a=n.hiddenTail[0]?.id,i=Hx({...r,messages:[...n.groups.flatMap(g=>g.messages),...n.hiddenTail],breakBeforeMessageIds:new Set(a?[a]:[])}),c=i.current.noticeId,l=i.history.map(g=>({...g,records:g.records.filter(_=>_.messageId!==c)})).filter(g=>g.records.length>0),v=new Set(l.map(g=>g.records[0].messageId));return{...i,runsByAnchor:new Map(l.map(g=>[g.records[0].messageId,g])),collapsedMessageIds:new Set(i.history.flatMap(g=>g.records.map(_=>_.messageId).filter(_=>!v.has(_))))}}var Dx=E('<div class="flex size-10 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <div class="min-w-0 flex-1"><div class="type-body truncate font-medium text-foreground"> </div> <div class="type-caption mt-0.5 line-clamp-2 text-muted-foreground"> </div></div> <div class="flex size-7 shrink-0 items-center justify-center rounded-md bg-muted/50 text-muted-foreground transition-colors group-hover:bg-muted"><!></div>',1),Fx=E('<div class="flex size-9 shrink-0 items-center justify-center rounded-md bg-muted/50"><!></div> <span class="type-body font-medium"> </span>',1),Nx=E('<div><div class="border-b border-border bg-muted/20 px-4 py-3"><p class="type-body font-medium text-foreground"> </p> <p class="type-caption mt-0.5 text-muted-foreground"> </p></div> <div class="max-h-[21rem] overflow-y-auto p-2"><!></div> <div class="border-t border-border bg-popover p-2"><!></div></div>'),Bx=E('<div class="mb-5"><!></div>'),Wx=E('<p data-testid="agent-welcome-description"> </p> <!>',1),Ux=E("<!> <!>",1),zx=E('<p class="mb-3 px-4 text-sm text-subtle leading-relaxed whitespace-pre-wrap" data-testid="agent-welcome-description"> </p>'),jx=E("<!> <span> </span>",1),Gx=E('<div class="mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-4 pb-6 pt-4 text-subtle"><!> <!> <!></div>');function fv(n,r){if(new.target)return fn({component:fv,...n});mn(r,!0);const a=()=>ge(k,"$userOverrides$",v),i=()=>ge(q,"$specialists$",v),c=()=>ge(D,"$isGitHubAuth$",v),l=()=>ge(K,"$recentSpecialistIds$",v),[v,g]=Nr();let _=X(r,"onSpecialistChange",7),f=X(r,"session",7),P=X(r,"workspaceId",7);const S=Bn(P()??"");ae(()=>S.set(P()??""));const q=Qf(S),k=ek();ae(()=>{a()});const W=o(()=>{if(!f()||Zy(f()))return null;const N=f().metadata?.specialist||f().agentMetadata?.specialist;return N&&i().find(R=>R.id===N)||null});async function O(N){N?await Gl({specialist:N,hash:"specialists"}):await Gl({view:"create-specialist"})}let T=_e(!1);const D=tk(),K=pS(),se=o(()=>Iw(nk(i(),c()),l()));let C=_e(!1);const x=o(()=>u.chat_regularAgentWelcome_generalDescription_label()),Q=o(()=>e(W)?.name??u.chat_shared_general_fallback()),pe=o(()=>e(W)?.description??u.chat_shared_noSpecializedBehavior_label()),Te=o(()=>e(W)?e(W).defaultBehaviorPrompt||"":e(x));var he={get onSpecialistChange(){return _()},set onSpecialistChange(N){_(N),Z()},get session(){return f()},set session(N){f(N),Z()},get workspaceId(){return P()},set workspaceId(N){P(N),Z()},$set:vn,$on:(N,R)=>hn(r,N,R)},fe=Gx(),Le=I(fe);{var ue=N=>{var R=Bx(),re=I(R);fk(re,{class:"block w-full",align:"start",side:"bottom",contentClass:"w-[min(28rem,calc(100vw-2rem))]",get open(){return e(C)},set open(Y){w(C,Y,!0)},trigger:(Y,J)=>{let Se=()=>(J?.()).props;{let He=o(()=>zd("group flex h-auto min-h-(--control-height-medium) w-full cursor-pointer items-center gap-3 whitespace-normal rounded-lg border border-border bg-card px-4 py-3 text-left shadow-xs transition-colors","hover:border-input hover:bg-accent/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"));$t(Y,Li(Se,{type:"button",variant:"plain",wrapContent:!1,get class(){return e(He)},"data-testid":"specialist-picker-trigger",children:(z,Ie)=>{var Ce=Dx(),De=ye(Ce),at=I(De);{let ze=o(()=>e(W)?.id??null),Ze=o(()=>e(W)?.icon??null);pk(at,{agentId:"blank",variant:"emphasized",get specialist(){return e(ze)},get icon(){return e(Ze)}})}b(De);var lt=m(De,2),Oe=I(lt),$e=de(Oe,!0),V=m(Oe,2),ne=de(V,!0);b(lt);var Fe=m(lt,2),me=I(Fe);gt(me,{get icon(){return Na},size:10}),b(Fe),L(()=>{j($e,e(Q)),j(ne,e(pe))}),p(z,Ce)},$$slots:{default:!0}}))}},content:Y=>{var J=Nx(),Se=I(J),He=I(Se),z=de(He,!0),Ie=m(He,2),Ce=de(Ie,!0);b(Se);var De=m(Se,2),at=I(De);{let $e=o(()=>e(W)?.id??null);ew(at,{get specialists(){return e(se)},get value(){return e($e)},onchange:V=>{w(C,!1),_()?.(V)}})}b(De);var lt=m(De,2),Oe=I(lt);Tt(Oe,()=>Dr,($e,V)=>{V($e,{class:"flex h-auto w-full cursor-pointer items-center gap-3 whitespace-normal rounded-md px-3 py-2 text-left text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",onSelect:()=>{w(C,!1),O()},children:(ne,Fe)=>{var me=Fx(),ze=ye(me),Ze=I(ze);gt(Ze,{get icon(){return O$},size:12}),b(ze);var ut=m(ze,2),mt=de(ut,!0);L(dt=>j(mt,dt),[()=>u.chat_regularAgentWelcome_createSpecialist_label()]),p(ne,me)},$$slots:{default:!0}})}),b(lt),b(J),L(($e,V)=>{j(z,$e),j(Ce,V)},[()=>u.workspace_createAgentSection_specialists_label(),()=>u.workspace_createAgentSection_specialists_description()]),p(Y,J)},$$slots:{trigger:!0,content:!0}}),b(R),p(N,R)};B(Le,N=>{_()&&N(ue)})}var oe=m(Le,2);{var Me=N=>{var R=Wt(),re=ye(R);{let qe=o(()=>u.chat_specialistSelector_prompt_label());Tt(re,()=>hk,(H,Y)=>{Y(H,{class:"mb-3",role:"region",get"aria-label"(){return e(qe)},children:(J,Se)=>{var He=Ux(),z=ye(He);Tt(z,()=>lv,(Ce,De)=>{De(Ce,{children:(at,lt)=>{var Oe=Wt(),$e=ye(Oe);Tt($e,()=>cv,(V,ne)=>{ne(V,{class:"type-caption font-medium",children:(Fe,me)=>{pn();var ze=dn();L(Ze=>j(ze,Ze),[()=>u.chat_specialistSelector_prompt_label()]),p(Fe,ze)},$$slots:{default:!0}})}),p(at,Oe)},$$slots:{default:!0}})});var Ie=m(z,2);Tt(Ie,()=>vk,(Ce,De)=>{De(Ce,{children:(at,lt)=>{var Oe=Wx(),$e=ye(Oe),V=de($e,!0),ne=m($e,2);$t(ne,{type:"button",variant:"link",get"aria-expanded"(){return e(T)},onclick:()=>w(T,!e(T)),class:"text-xs text-muted-foreground hover:text-foreground transition-colors mt-2 cursor-pointer",children:(Fe,me)=>{pn();var ze=dn();L(Ze=>j(ze,Ze),[()=>e(T)?u.chat_regularAgentWelcome_showLess_label():u.chat_regularAgentWelcome_showMore_label()]),p(Fe,ze)},$$slots:{default:!0}}),L(()=>{xe($e,1,`text-sm text-subtle leading-relaxed whitespace-pre-wrap break-words ${e(T)?"":"line-clamp-6"}`),j(V,e(Te))}),p(at,Oe)},$$slots:{default:!0}})}),p(J,He)},$$slots:{default:!0}})})}p(N,R)},ie=N=>{var R=zx(),re=de(R,!0);L(()=>j(re,e(Te))),p(N,R)};B(oe,N=>{e(W)?N(Me):N(ie,-1)})}var ee=m(oe,2);{var Ae=N=>{$t(N,{variant:"ghost-light",size:"sm",onclick:()=>O(e(W).id),class:"inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-foreground transition-colors cursor-pointer pl-1.5 mr-auto",children:(R,re)=>{var qe=jx(),H=ye(qe);gt(H,{get icon(){return H$},size:12,class:"opacity-60"});var Y=m(H,2),J=de(Y,!0);L(Se=>j(J,Se),[()=>u.chat_regularAgentWelcome_customize_label()]),p(R,qe)},$$slots:{default:!0}})};B(ee,N=>{e(W)&&N(Ae)})}b(fe),p(n,fe);var Ee=_n(he);return g(),Ee}var Vx=E('<a class="cursor-pointer underline underline-offset-2 hover:opacity-80" data-suggested-prompt-link=""> </a>'),Kx=E('<kbd data-suggested-prompt-hint=""> </kbd>'),Qx=E('<span class="type-caption"> </span>'),Jx=E('<div role="presentation" data-typography-role="body" data-suggested-prompt-row=""><span data-suggested-prompt-icon=""><!></span> <span class="min-w-0 flex-1 text-pretty" data-suggested-prompt-label=""><span role="button" tabindex="0" class="focus-visible:outline-none" data-suggested-prompt-text=""> </span><!></span> <!> <!></div>'),Yx=E('<div class="flex flex-col" data-testid="suggested-prompts-surface"><!></div>');function eu(n,r){if(new.target)return fn({component:eu,...n});mn(r,!0);let a=X(r,"prompts",7),i=X(r,"onSelect",7),c=X(r,"onEdit",7),l=X(r,"compact",7,!1),v=X(r,"showShortcutHints",7,!1),g=X(r,"reserveShortcutHintSpace",7,!1),_=X(r,"workspaceId",7);const P=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC")?"⌃":"Alt+",S=p$.replace("text-ui","type-caption");function q(x){i()(x)}function k(x,Q){x.key!=="Enter"&&x.key!==" "||(x.preventDefault(),q(Q))}function W(x,Q){x.preventDefault(),x.stopPropagation(),qd(Q,{workspaceId:_(),event:x})}function O(x,Q){(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),x.stopPropagation(),qd(Q,{workspaceId:_(),event:x}))}function T(x){return x<3}var D={get prompts(){return a()},set prompts(x){a(x),Z()},get onSelect(){return i()},set onSelect(x){i(x),Z()},get onEdit(){return c()},set onEdit(x){c(x),Z()},get compact(){return l()},set compact(x=!1){l(x),Z()},get showShortcutHints(){return v()},set showShortcutHints(x=!1){v(x),Z()},get reserveShortcutHintSpace(){return g()},set reserveShortcutHintSpace(x=!1){g(x),Z()},get workspaceId(){return _()},set workspaceId(x){_(x),Z()},$set:vn,$on:(x,Q)=>hn(r,x,Q)},K=Wt(),se=ye(K);{var C=x=>{var Q=Yx(),pe=I(Q);{const Te=(fe,Le)=>{let ue=()=>(Le?.()).item,oe=()=>(Le?.()).index;const Me=o(()=>ay(ue())),ie=o(()=>e(Me)[0]?.type==="text"?e(Me)[0].content:"");var ee=Jx(),Ae=I(ee),Ee=I(Ae);gt(Ee,{get icon(){return zf},size:16,get class(){return gr}}),b(Ae);var N=m(Ae,2),R=I(N),re=de(R,!0),qe=m(R);On(qe,17,()=>e(Me).slice(e(ie)?1:0),Y_,(z,Ie)=>{var Ce=Wt(),De=ye(Ce);{var at=Oe=>{const $e=o(()=>ry(e(Ie).url));var V=Vx(),ne=de(V,!0);L(()=>{Ue(V,"href",e($e)),Ue(V,"title",e($e)),j(ne,e(Ie).label)}),ps("click",V,Fe=>W(Fe,e($e))),ps("keydown",V,Fe=>O(Fe,e($e))),p(Oe,V)},lt=Oe=>{var $e=dn();L(()=>j($e,e(Ie).content)),p(Oe,$e)};B(De,Oe=>{e(Ie).type==="link"?Oe(at):Oe(lt,-1)})}p(z,Ce)}),b(N);var H=m(N,2);{var Y=z=>{var Ie=Kx();let Ce;var De=de(Ie);L(()=>{Ce=xe(Ie,1,`${S??""} mt-px inline-flex h-5 items-center self-start border-0 bg-transparent p-0 font-sans font-normal text-muted-foreground! opacity-100`,null,Ce,{invisible:!v()}),Ue(Ie,"aria-hidden",v()?void 0:"true"),Ue(Ie,"data-hint-visible",v()),j(De,`${P}${oe()+1}`)}),p(z,Ie)},J=o(()=>T(oe())&&(v()||g()));B(H,z=>{e(J)&&z(Y)})}var Se=m(H,2);{var He=z=>{L$(z,{side:"top",delayDuration:300,trigger:De=>{{let at=o(()=>u.chat_suggestedPrompts_editInInput_ariaLabel());$t(De,{type:"button",variant:"ghost-light",size:"icon-xs",iconOnly:!0,class:"absolute right-0.5 top-[calc(var(--operational-leading-half-slot-size)+var(--space-1)*0.5+1px)] shrink-0 -translate-y-1/2 rounded opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100",onclick:lt=>{lt.stopPropagation(),c()(ue())},get"aria-label"(){return e(at)},children:(lt,Oe)=>{gt(lt,{get icon(){return D$},size:"xs"})},$$slots:{default:!0}})}},content:De=>{var at=Qx(),lt=de(at,!0);L(Oe=>j(lt,Oe),[()=>u.chat_suggestedPrompts_edit_tooltip()]),p(De,at)},$$slots:{trigger:!0,content:!0}})};B(Se,z=>{c()&&z(He)})}b(ee),L(z=>{xe(ee,1,`${Wf} ${g$} group relative flex cursor-pointer items-center gap-[var(--operational-leading-gap)] rounded-sm border border-transparent bg-transparent px-1.5 py-0.5 text-left opacity-100 pr-9 transition-colors hover:text-foreground has-[[data-suggested-prompt-text]:focus-visible]:outline-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-offset-2 has-[[data-suggested-prompt-text]:focus-visible]:outline-ring`),xe(Ae,1,`${Ul??""} mt-px self-start`),Ue(R,"aria-label",z),j(re,e(ie))},[()=>ny(ue())]),ps("click",R,z=>{z.stopPropagation(),q(ue())}),ps("keydown",R,z=>k(z,ue())),p(fe,ee)};let he=o(()=>l()?"[&>div>div:last-child]:gap-0":"[&>div>div:last-child]:gap-0.5");T$(pe,{get items(){return a()},virtualize:!1,onActivate:q,get class(){return`overflow-visible! [&>div>div:last-child]:flex [&>div>div:last-child]:flex-col ${e(he)??""}`},"data-testid":"suggested-prompts-list",get"data-compact"(){return l()},row:Te,$$slots:{row:!0}})}b(Q),Bt(1,Q,()=>ma,()=>({tier:"fast",y:0,scale:1})),Bt(2,Q,()=>to,()=>({tier:"fast"})),p(x,Q)};B(se,x=>{a().length>0&&x(C)})}return p(n,K),_n(D)}Ud(["click","keydown"]);var Xx=E('<section class="pb-6 pt-6"><p class="type-body mb-5 max-w-[36rem] px-1.5 text-pretty text-muted-foreground"> </p> <!></section>');function vv(n,r){if(new.target)return fn({component:vv,...n});mn(r,!0);let a=X(r,"onSelect",7),i=X(r,"compact",7,!1);const c=o(()=>[{label:u.chat_chiefEmptyState_assignedPrs_label(),prompt:u.chat_chiefEmptyState_assignedPrs_prompt()},{label:u.chat_chiefEmptyState_staleWorkspaces_label(),prompt:u.chat_chiefEmptyState_staleWorkspaces_prompt()},{label:u.chat_chiefEmptyState_agentPerformance_label(),prompt:u.chat_chiefEmptyState_agentPerformance_prompt()},{label:u.chat_chiefEmptyState_morningBrief_label(),prompt:u.chat_chiefEmptyState_morningBrief_prompt()},{label:u.chat_chiefEmptyState_randomTheme_label(),prompt:u.chat_chiefEmptyState_randomTheme_prompt()}]),l=o(()=>e(c).map(q=>q.label));function v(q){const k=e(c).find(W=>W.label===q);k&&a()(k.prompt)}var g={get onSelect(){return a()},set onSelect(q){a(q),Z()},get compact(){return i()},set compact(q=!1){i(q),Z()},$set:vn,$on:(q,k)=>hn(r,q,k)},_=Xx(),f=I(_),P=de(f,!0),S=m(f,2);return eu(S,{get prompts(){return e(l)},onSelect:v,get compact(){return i()}}),b(_),L(q=>j(P,q),[()=>u.chat_chiefEmptyState_intro_label()]),p(n,_),_n(g)}const tu=2e3,Zx=4e3,e1=Zx-tu-2;function t1(n,r=tu){const a=[];let i=0;for(let c=n.length-1;c>=0&&i<r;c-=1){const l=n[c];if(l.role!=="user"&&l.role!=="assistant")continue;const v=(l.contentBlocks??[]).filter(_=>_.type==="text").map(_=>_.text||_.content||"").join(""),g=(l.role==="assistant"?tw(v).cleanedContent:v).trim();g&&(a.unshift({role:l.role,text:g}),i+=g.length)}return a}function n1(n,r){const a=n.map(l=>`${l.role==="user"?"User":"Assistant"}: ${l.text}`).join(`
|
|
2
2
|
|
|
3
3
|
`).slice(-tu),i=r.map(l=>l.trim()).filter(Boolean);if(i.length===0)return a;const c=`Suggested prompts:
|
|
4
4
|
${i.map(l=>`- ${l}`).join(`
|