@intent-hq/web 2.327.1 → 2.327.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/assets/0.BHoek2bX.css +1 -0
  3. package/web/app/immutable/assets/BrowserTabType.DojB6H-_.css +1 -0
  4. package/web/app/immutable/chunks/{-M5ArFu9.js → -ntpqjUQ.js} +1 -1
  5. package/web/app/immutable/chunks/{BNaHRmzO.js → 1JDc8gDP.js} +1 -1
  6. package/web/app/immutable/chunks/{BG0wXYTP.js → 2BNczbc1.js} +1 -1
  7. package/web/app/immutable/chunks/{D12HgGYA.js → 2Yr7qZy-.js} +1 -1
  8. package/web/app/immutable/chunks/{DlJbQHTT.js → 2bCqOBlF.js} +2 -2
  9. package/web/app/immutable/chunks/{LsGMNfQF.js → 6eTaxSHq.js} +1 -1
  10. package/web/app/immutable/chunks/{NOdC8P9f.js → 7nLxl2IJ.js} +1 -1
  11. package/web/app/immutable/chunks/{0LhXCP94.js → 7rjdCDDK.js} +1 -1
  12. package/web/app/immutable/chunks/{QHP8cHaW.js → 95PmebfY.js} +1 -1
  13. package/web/app/immutable/chunks/{XNWMykPO.js → 9iFKJfkz.js} +1 -1
  14. package/web/app/immutable/chunks/{CWc2npkj.js → 9taqgPH1.js} +1 -1
  15. package/web/app/immutable/chunks/{Br4R2ugZ.js → Am8TuXrW.js} +1 -1
  16. package/web/app/immutable/chunks/{KeVqoPE3.js → AuTI2CWB.js} +1 -1
  17. package/web/app/immutable/chunks/{BYcS-OAO.js → Aw3-65IC.js} +1 -1
  18. package/web/app/immutable/chunks/{DMqElfxm.js → B-B22ZmQ.js} +1 -1
  19. package/web/app/immutable/chunks/{BkbuDEW6.js → B-LxAE4l.js} +1 -1
  20. package/web/app/immutable/chunks/{2NEwynpS.js → B-mVY4KG.js} +1 -1
  21. package/web/app/immutable/chunks/{fqXfkYA3.js → B1nmZwVF.js} +1 -1
  22. package/web/app/immutable/chunks/{BkHD8RFf.js → B4Qf0RS5.js} +1 -1
  23. package/web/app/immutable/chunks/{CiOl9c9q.js → B4Rscrf6.js} +1 -1
  24. package/web/app/immutable/chunks/{Bh1wyaG7.js → B5kBEM9z.js} +1 -1
  25. package/web/app/immutable/chunks/{DGOeaTcp.js → B6ZEHAgn.js} +1 -1
  26. package/web/app/immutable/chunks/{Cg5C1MrF.js → BBYPPwon.js} +1 -1
  27. package/web/app/immutable/chunks/{BMeZr_ZY.js → BCBkAQhq.js} +1 -1
  28. package/web/app/immutable/chunks/{BX1HymTE.js → BDUVRWqe.js} +3 -3
  29. package/web/app/immutable/chunks/{Ddd4tibk.js → BFQmpH-Y.js} +1 -1
  30. package/web/app/immutable/chunks/{Bz8cPQaz.js → BGUHg5o_.js} +1 -1
  31. package/web/app/immutable/chunks/{DLGpFr8e.js → BIfN-lxi.js} +1 -1
  32. package/web/app/immutable/chunks/{B-r2QfY2.js → BJFbczXI.js} +1 -1
  33. package/web/app/immutable/chunks/{CpBlZvWi.js → BJpbRkma.js} +1 -1
  34. package/web/app/immutable/chunks/{BjM8_HSR.js → BK3YE2GB.js} +1 -1
  35. package/web/app/immutable/chunks/{BfF3Bko_.js → BMmC4e8Y.js} +1 -1
  36. package/web/app/immutable/chunks/{BTBcxnN8.js → BOY33UBS.js} +4 -4
  37. package/web/app/immutable/chunks/{nWTC446c.js → BOod2-vo.js} +1 -1
  38. package/web/app/immutable/chunks/{Ct_B1TOh.js → BQKilZql.js} +1 -1
  39. package/web/app/immutable/chunks/{64lOi4Xe.js → BTxVcBTE.js} +1 -1
  40. package/web/app/immutable/chunks/{CveDKSFg.js → BUU84hQY.js} +1 -1
  41. package/web/app/immutable/chunks/{CRTNdBBv.js → BUcg736f.js} +1 -1
  42. package/web/app/immutable/chunks/{CFBUnCgB.js → BV4AHhCq.js} +1 -1
  43. package/web/app/immutable/chunks/{DOb8Kchl.js → BXo80d0I.js} +1 -1
  44. package/web/app/immutable/chunks/BYCQnKWG.js +227 -0
  45. package/web/app/immutable/chunks/{B30-sYDS.js → B_oexMWu.js} +1 -1
  46. package/web/app/immutable/chunks/{CQFSvKTc.js → BaUvfuFA.js} +1 -1
  47. package/web/app/immutable/chunks/BbEZgkca.js +2 -0
  48. package/web/app/immutable/chunks/{CW3DpzM0.js → BbiJIN_E.js} +1 -1
  49. package/web/app/immutable/chunks/{B7ookV3M.js → BclymnXe.js} +1 -1
  50. package/web/app/immutable/chunks/Bdee7uP3.js +1 -0
  51. package/web/app/immutable/chunks/{BWUOkr40.js → BedviAdk.js} +1 -1
  52. package/web/app/immutable/chunks/{Cg9SqQ7c.js → BerYBtY0.js} +1 -1
  53. package/web/app/immutable/chunks/{DkUbh_iD.js → BgiA9PsC.js} +2 -2
  54. package/web/app/immutable/chunks/{DAJaDZx7.js → Bhff3giG.js} +1 -1
  55. package/web/app/immutable/chunks/{BShEFC79.js → BiYl2nZq.js} +3 -3
  56. package/web/app/immutable/chunks/{Dbo0LK0t.js → Bil-5-Mv.js} +1 -1
  57. package/web/app/immutable/chunks/{DzVbP61K.js → BirvpWBa.js} +1 -1
  58. package/web/app/immutable/chunks/{B_KuwYoa.js → BlmamAqo.js} +1 -1
  59. package/web/app/immutable/chunks/{BdSGNHEM.js → BmnlV2jU.js} +1 -1
  60. package/web/app/immutable/chunks/{COnSiP7q.js → Bn-dz7cW.js} +1 -1
  61. package/web/app/immutable/chunks/{BzaZqOK5.js → BnxF3EEm.js} +1 -1
  62. package/web/app/immutable/chunks/{CHajdz2j.js → Bq9BF2kT.js} +1 -1
  63. package/web/app/immutable/chunks/{Bqp-VB-g.js → BrXRAcqE.js} +1 -1
  64. package/web/app/immutable/chunks/{CNJgwoNk.js → BsesepNZ.js} +1 -1
  65. package/web/app/immutable/chunks/{Dq6j0-2d.js → BvDDdxJ_.js} +1 -1
  66. package/web/app/immutable/chunks/{Dh9hsi3V.js → BvULLTwA.js} +2 -2
  67. package/web/app/immutable/chunks/{_ANEY4lF.js → Bw8BPAST.js} +1 -1
  68. package/web/app/immutable/chunks/{BOAArWys.js → BwVx_Xm9.js} +1 -1
  69. package/web/app/immutable/chunks/{CARGil7N.js → BwY7DKzU.js} +1 -1
  70. package/web/app/immutable/chunks/{CloK0EEY.js → BxRFeUGV.js} +1 -1
  71. package/web/app/immutable/chunks/{BV2NfA3h.js → Byv1V5rF.js} +1 -1
  72. package/web/app/immutable/chunks/{B2pW1Srg.js → C-am1GTe.js} +1 -1
  73. package/web/app/immutable/chunks/{u2JaOdc9.js → C0AexULD.js} +1 -1
  74. package/web/app/immutable/chunks/{Cz0WCDEU.js → C1TwLTiC.js} +1 -1
  75. package/web/app/immutable/chunks/{DDbIukDL.js → C1vc2ZF2.js} +1 -1
  76. package/web/app/immutable/chunks/{CAKIN9jR.js → C2vxCrLD.js} +1 -1
  77. package/web/app/immutable/chunks/{CY7bNGyv.js → C3g8Ux-E.js} +15 -15
  78. package/web/app/immutable/chunks/{BsC5Vdmg.js → C4ih-xND.js} +2 -2
  79. package/web/app/immutable/chunks/{CE6SftSb.js → C5SMJxa0.js} +2 -2
  80. package/web/app/immutable/chunks/{VU4R1gKj.js → C5bHHEee.js} +1 -1
  81. package/web/app/immutable/chunks/{DJ4-kbB4.js → C5mH9Vrl.js} +1 -1
  82. package/web/app/immutable/chunks/{DffOpxnk.js → C6-cGH2l.js} +1 -1
  83. package/web/app/immutable/chunks/{XEwS43QE.js → C6LN2Lq-.js} +1 -1
  84. package/web/app/immutable/chunks/{BIDHVOHc.js → C7eFRIGF.js} +1 -1
  85. package/web/app/immutable/chunks/{DA0d2_fu.js → C9-oKvmU.js} +1 -1
  86. package/web/app/immutable/chunks/{ncAOXs0r.js → CAL5qbag.js} +1 -1
  87. package/web/app/immutable/chunks/{DTWWM1mF.js → CB-J-0bJ.js} +1 -1
  88. package/web/app/immutable/chunks/{BSGuytEP.js → CBEZBV7x.js} +1 -1
  89. package/web/app/immutable/chunks/{Bay8SY9e.js → CDFRtA1F.js} +1 -1
  90. package/web/app/immutable/chunks/{0FIzxpig.js → CFXA-WTd.js} +1 -1
  91. package/web/app/immutable/chunks/{CVrziC3b.js → CHb5dSdm.js} +1 -1
  92. package/web/app/immutable/chunks/{BsOdwfJ2.js → CIno4eJd.js} +1 -1
  93. package/web/app/immutable/chunks/{DoUTd6YZ.js → CJvik4ry.js} +1 -1
  94. package/web/app/immutable/chunks/{DQtJDu2z.js → CKjldRop.js} +1 -1
  95. package/web/app/immutable/chunks/{7t1XfqI3.js → CLDLGPLG.js} +1 -1
  96. package/web/app/immutable/chunks/{Dqktyx17.js → CLbcqiJX.js} +1 -1
  97. package/web/app/immutable/chunks/{JKgT3h6U.js → CNZwPZBB.js} +1 -1
  98. package/web/app/immutable/chunks/CNdlzZOD.js +1 -0
  99. package/web/app/immutable/chunks/{B1HL5ujX.js → COPJQClu.js} +1 -1
  100. package/web/app/immutable/chunks/{CJNRFxp-.js → COyObFie.js} +1 -1
  101. package/web/app/immutable/chunks/{h64QYX68.js → CPzusSaQ.js} +1 -1
  102. package/web/app/immutable/chunks/{Djac9356.js → CSk0KPBP.js} +1 -1
  103. package/web/app/immutable/chunks/CTMsT2IU.js +13 -0
  104. package/web/app/immutable/chunks/{xMXcl1K_.js → CTc1mqQ1.js} +1 -1
  105. package/web/app/immutable/chunks/{Bv_Vppnv.js → CW87SeGI.js} +1 -1
  106. package/web/app/immutable/chunks/{3ltPZd_n.js → CW9PUdij.js} +1 -1
  107. package/web/app/immutable/chunks/{CR_DZSId.js → CWXjKpBJ.js} +1 -1
  108. package/web/app/immutable/chunks/{D_3K3qbV.js → CXCbFJ1d.js} +1 -1
  109. package/web/app/immutable/chunks/{BXYIlyr0.js → CYgFtonv.js} +1 -1
  110. package/web/app/immutable/chunks/{BPU4W-ai.js → C_4hXDel.js} +1 -1
  111. package/web/app/immutable/chunks/{BTS44Ia3.js → Ca3Yads8.js} +4 -4
  112. package/web/app/immutable/chunks/{DPkc4abw.js → CaaDYQm4.js} +5 -5
  113. package/web/app/immutable/chunks/{D4V2xQ2J.js → CcSZNfbk.js} +1 -1
  114. package/web/app/immutable/chunks/{CS6MUgvJ.js → CdhZKdub.js} +1 -1
  115. package/web/app/immutable/chunks/{BX3vzTpn.js → CdlZ8r5v.js} +1 -1
  116. package/web/app/immutable/chunks/{CLKUBIbV.js → CeL4K7HS.js} +1 -1
  117. package/web/app/immutable/chunks/{BIlDYPC_.js → ChyK3c5O.js} +1 -1
  118. package/web/app/immutable/chunks/{C_GLszen.js → Ciht8P3-.js} +1 -1
  119. package/web/app/immutable/chunks/{CAqh5rmU.js → ClBnJ15C.js} +1 -1
  120. package/web/app/immutable/chunks/{BB6ApKQZ.js → ClHpwdNk.js} +1 -1
  121. package/web/app/immutable/chunks/{BhpvRaEf.js → Co3V5w5D.js} +1 -1
  122. package/web/app/immutable/chunks/{BLE555FN.js → ColHxoku.js} +4 -4
  123. package/web/app/immutable/chunks/{C2eGBEPE.js → CpOX1cm0.js} +4 -4
  124. package/web/app/immutable/chunks/{BRua-6UM.js → CpPVAOg5.js} +1 -1
  125. package/web/app/immutable/chunks/{SFeFj2Mb.js → CqnfptVg.js} +1 -1
  126. package/web/app/immutable/chunks/{OcoLTaau.js → CrN8CpnY.js} +1 -1
  127. package/web/app/immutable/chunks/{B90oo4Fg.js → CtRuzEKN.js} +1 -1
  128. package/web/app/immutable/chunks/{BbM6p2an.js → CuF24etW.js} +1 -1
  129. package/web/app/immutable/chunks/{C1vG2W_v.js → CuimWTUN.js} +1 -1
  130. package/web/app/immutable/chunks/{BBkcKcU8.js → CvG8wNT6.js} +1 -1
  131. package/web/app/immutable/chunks/{C6ibAYOP.js → Cw26kBCe.js} +1 -1
  132. package/web/app/immutable/chunks/{CbNg55gb.js → Cwdoe-yo.js} +1 -1
  133. package/web/app/immutable/chunks/{CfViy2AB.js → Cy1SRgRj.js} +1 -1
  134. package/web/app/immutable/chunks/{BBuOsJY_.js → CypQ6Hrf.js} +1 -1
  135. package/web/app/immutable/chunks/{BEDYQfP7.js → CzSCQAr8.js} +1 -1
  136. package/web/app/immutable/chunks/{Bz7DX0NE.js → CzxoHP9X.js} +1 -1
  137. package/web/app/immutable/chunks/{CAhkQWjW.js → D-YrUZis.js} +1 -1
  138. package/web/app/immutable/chunks/{COhk9eQe.js → D0OfnhNR.js} +3 -3
  139. package/web/app/immutable/chunks/{CFMVBWPg.js → D19QPbvx.js} +3 -3
  140. package/web/app/immutable/chunks/{Dhe30u3B.js → D1ynivqZ.js} +1 -1
  141. package/web/app/immutable/chunks/{DSXweTPQ.js → D3NOBSUZ.js} +3 -3
  142. package/web/app/immutable/chunks/{DvIxHqlz.js → D4fSLYwV.js} +1 -1
  143. package/web/app/immutable/chunks/{DY34YAUg.js → D4wUHJ-V.js} +1 -1
  144. package/web/app/immutable/chunks/{EsKpz1xg.js → D4wVqBkS.js} +1 -1
  145. package/web/app/immutable/chunks/{BEWET3uQ.js → D6NxvjAo.js} +2 -2
  146. package/web/app/immutable/chunks/{B7UZ3osx.js → D6R6bmhK.js} +1 -1
  147. package/web/app/immutable/chunks/{He8rzvWn.js → D7NWkz7l.js} +1 -1
  148. package/web/app/immutable/chunks/{DVTqQKPY.js → D7jA8MQK.js} +1 -1
  149. package/web/app/immutable/chunks/{BIJpUOPV.js → D8iLOeUT.js} +1 -1
  150. package/web/app/immutable/chunks/{DRWb3sje.js → D9E32u14.js} +1 -1
  151. package/web/app/immutable/chunks/{BuVVc2l9.js → DAXKoZjm.js} +1 -1
  152. package/web/app/immutable/chunks/{CnoeAOCE.js → DCo2M5nt.js} +1 -1
  153. package/web/app/immutable/chunks/{COyOtekU.js → DF5OSHTI.js} +1 -1
  154. package/web/app/immutable/chunks/{C3DbH19I.js → DFghII67.js} +1 -1
  155. package/web/app/immutable/chunks/{B3FUftaT.js → DFxg8FPE.js} +1 -1
  156. package/web/app/immutable/chunks/{om7e-2Da.js → DGuIJztL.js} +1 -1
  157. package/web/app/immutable/chunks/{g2wqtBd2.js → DIh4SQwA.js} +1 -1
  158. package/web/app/immutable/chunks/{B_68BQEQ.js → DKz0oh_l.js} +1 -1
  159. package/web/app/immutable/chunks/DLrZLCmS.js +1 -0
  160. package/web/app/immutable/chunks/{DPsk7Xmu.js → DQfuBwT8.js} +1 -1
  161. package/web/app/immutable/chunks/{D3HFKabi.js → DSwaqM2D.js} +1 -1
  162. package/web/app/immutable/chunks/{BVSo0mI7.js → DT-w4ZA3.js} +1 -1
  163. package/web/app/immutable/chunks/{Dfqtr6u5.js → DTOenBGo.js} +1 -1
  164. package/web/app/immutable/chunks/{CZq5__sk.js → DULzeUbw.js} +1 -1
  165. package/web/app/immutable/chunks/{Du-ii3l_.js → DVe2mCXY.js} +1 -1
  166. package/web/app/immutable/chunks/{EYJPT7ez.js → DVnJa0eT.js} +1 -1
  167. package/web/app/immutable/chunks/{Bu6O9iBY.js → DXmMVRov.js} +1 -1
  168. package/web/app/immutable/chunks/{D7UcpeiI.js → DZzTUgIA.js} +1 -1
  169. package/web/app/immutable/chunks/{Bwb9opno.js → D_TIL4Xc.js} +1 -1
  170. package/web/app/immutable/chunks/{DVWkN6zJ.js → D_fIP8PG.js} +1 -1
  171. package/web/app/immutable/chunks/{A8xzSidY.js → D_kdhP8o.js} +1 -1
  172. package/web/app/immutable/chunks/{DSTlg4w0.js → DacYbmEF.js} +1 -1
  173. package/web/app/immutable/chunks/{Cy-COy2y.js → DbYMKWAI.js} +2 -2
  174. package/web/app/immutable/chunks/{CXJnOaE2.js → Dd-c6aT7.js} +1 -1
  175. package/web/app/immutable/chunks/{BkFZSZBw.js → DeB-Py0k.js} +1 -1
  176. package/web/app/immutable/chunks/{COC8ycoj.js → DeQzn7pT.js} +1 -1
  177. package/web/app/immutable/chunks/Debl1LJu.js +1 -0
  178. package/web/app/immutable/chunks/{4MDpT4VG.js → DgtgAyRj.js} +1 -1
  179. package/web/app/immutable/chunks/{CtSt73sJ.js → DguixOqZ.js} +1 -1
  180. package/web/app/immutable/chunks/{D2jjmu4v.js → DhAAH4rU.js} +1 -1
  181. package/web/app/immutable/chunks/{b9Vr5sSO.js → DhJNH_hq.js} +1 -1
  182. package/web/app/immutable/chunks/{Dml3pCbo.js → DkPB5Gyi.js} +1 -1
  183. package/web/app/immutable/chunks/{CfMhquYs.js → DkcUxSHK.js} +1 -1
  184. package/web/app/immutable/chunks/{CIdiIwVr.js → Dmq2MLxr.js} +1 -1
  185. package/web/app/immutable/chunks/{DQW3vv7z.js → Do9PiZ5P.js} +2 -2
  186. package/web/app/immutable/chunks/{w57SWl6G.js → DoKuqfYA.js} +1 -1
  187. package/web/app/immutable/chunks/{IN5H29V-.js → DoV4Ngwf.js} +1 -1
  188. package/web/app/immutable/chunks/Dp0wSsDS.js +2 -0
  189. package/web/app/immutable/chunks/{B1LjZG7N.js → DpJ6ItFS.js} +1 -1
  190. package/web/app/immutable/chunks/DqIdPWw6.js +1 -0
  191. package/web/app/immutable/chunks/{zfZ9LSKu.js → DqLpc8uk.js} +1 -1
  192. package/web/app/immutable/chunks/{DEylYCps.js → Dr-K85Pz.js} +1 -1
  193. package/web/app/immutable/chunks/{CdmW6laI.js → DrH3w3jB.js} +1 -1
  194. package/web/app/immutable/chunks/{BtodRLK5.js → DsvlGcLM.js} +1 -1
  195. package/web/app/immutable/chunks/{B7bvyyYD.js → DuXpPbhO.js} +1 -1
  196. package/web/app/immutable/chunks/{B7UjoaT4.js → DugVvFNn.js} +1 -1
  197. package/web/app/immutable/chunks/{C_rSlxHm.js → DvnDAxdo.js} +1 -1
  198. package/web/app/immutable/chunks/{BgtLN2kD.js → DwkxcWNI.js} +3 -3
  199. package/web/app/immutable/chunks/{CUBPdQc3.js → Es_LZ_6E.js} +1 -1
  200. package/web/app/immutable/chunks/{vpJZSAdN.js → Fb6bTqJy.js} +1 -1
  201. package/web/app/immutable/chunks/{BACH6cFH.js → Gh0Bk6WC.js} +1 -1
  202. package/web/app/immutable/chunks/{1cW9cCot.js → HVSUZ4Kq.js} +1 -1
  203. package/web/app/immutable/chunks/{BCLA-ClZ.js → HdOtmFfs.js} +1 -1
  204. package/web/app/immutable/chunks/{-YfVx6Lr.js → HpcR9-ZP.js} +1 -1
  205. package/web/app/immutable/chunks/{BwBvFc9f.js → IsBHRTqp.js} +1 -1
  206. package/web/app/immutable/chunks/{YqIGmKYo.js → KuKwSJYu.js} +1 -1
  207. package/web/app/immutable/chunks/{CTygu5pv.js → LknVBIaq.js} +1 -1
  208. package/web/app/immutable/chunks/{DDBvEq_9.js → M0UFWl_S.js} +1 -1
  209. package/web/app/immutable/chunks/{tLxzRwgx.js → M47n670V.js} +1 -1
  210. package/web/app/immutable/chunks/{UyxlQTVj.js → MgRcWC-F.js} +1 -1
  211. package/web/app/immutable/chunks/{91je9Py3.js → OhUwMaQy.js} +1 -1
  212. package/web/app/immutable/chunks/{C43voWK4.js → Ou2B083h.js} +3 -3
  213. package/web/app/immutable/chunks/{DdwmoVU4.js → Ph7T0qF8.js} +1 -1
  214. package/web/app/immutable/chunks/{cP091E7D.js → Q-FVgluz.js} +1 -1
  215. package/web/app/immutable/chunks/{Be_ON1DI.js → RgXiUiyX.js} +1 -1
  216. package/web/app/immutable/chunks/{DxO0RaOm.js → X6OEIYik.js} +1 -1
  217. package/web/app/immutable/chunks/{G424GJSb.js → XKfxOi0c.js} +1 -1
  218. package/web/app/immutable/chunks/{CToUKfVS.js → YcWsBw0J.js} +1 -1
  219. package/web/app/immutable/chunks/{DI2RXiNP.js → ZynkSP7B.js} +1 -1
  220. package/web/app/immutable/chunks/{7Nb-tEer.js → _tv07_-D.js} +1 -1
  221. package/web/app/immutable/chunks/{CrYKIqze.js → b0njYmMP.js} +1 -1
  222. package/web/app/immutable/chunks/{C89aUqor.js → b8_D7H9k.js} +1 -1
  223. package/web/app/immutable/chunks/{CRgWqp0Q.js → bkMlvHq9.js} +1 -1
  224. package/web/app/immutable/chunks/{CM-bTlQg.js → dd8yLL6Y.js} +1 -1
  225. package/web/app/immutable/chunks/{BKGMAISF.js → dinOFH6z.js} +1 -1
  226. package/web/app/immutable/chunks/{DYv6YVU6.js → ewlOsRgS.js} +1 -1
  227. package/web/app/immutable/chunks/{XgnGQLkv.js → fSndiqme.js} +1 -1
  228. package/web/app/immutable/chunks/{Ct-dlzru.js → ffjPpoAP.js} +1 -1
  229. package/web/app/immutable/chunks/{ChHo_2Kq.js → gnxdhh79.js} +1 -1
  230. package/web/app/immutable/chunks/{BiQ0kKJZ.js → jD6u_pUu.js} +1 -1
  231. package/web/app/immutable/chunks/jxb5pgpW.js +19 -0
  232. package/web/app/immutable/chunks/{CnFIAIdG.js → l7AMrk83.js} +1 -1
  233. package/web/app/immutable/chunks/{0GcDPFAS.js → marbulK7.js} +1 -1
  234. package/web/app/immutable/chunks/{CwaJlHvl.js → n9Db8fQb.js} +1 -1
  235. package/web/app/immutable/chunks/{BwfrxhET.js → qB-JaQGy.js} +1 -1
  236. package/web/app/immutable/chunks/{D1tS2Sh2.js → se5GXd0p.js} +1 -1
  237. package/web/app/immutable/chunks/{Boy3njow.js → tVWh__3e.js} +1 -1
  238. package/web/app/immutable/chunks/{CCqeKXhI.js → uxNvmxnz.js} +1 -1
  239. package/web/app/immutable/chunks/{DvXSnwEo.js → vxH9TB8u.js} +1 -1
  240. package/web/app/immutable/chunks/{Duo9To9j.js → wOsjtdPJ.js} +1 -1
  241. package/web/app/immutable/chunks/{BsmdqgDs.js → xNaKu_mj.js} +1 -1
  242. package/web/app/immutable/entry/{app.C8ZhaB4m.js → app.CUk63TN3.js} +3 -3
  243. package/web/app/immutable/entry/start.ByRHyT3-.js +1 -0
  244. package/web/app/immutable/nodes/{0.BDAB8VWB.js → 0.D4UmpUyl.js} +1 -1
  245. package/web/app/immutable/nodes/{1.CVUy-46P.js → 1.DTuLvyGe.js} +1 -1
  246. package/web/app/immutable/nodes/{10.B-f9eiav.js → 10.yW5YYZcV.js} +1 -1
  247. package/web/app/immutable/nodes/{11.CS_mVYvl.js → 11.fqpT905Q.js} +1 -1
  248. package/web/app/immutable/nodes/{12.DWOozFK_.js → 12.B-WFagfi.js} +1 -1
  249. package/web/app/immutable/nodes/{13.CRnWHlMu.js → 13.knDmuG_H.js} +3 -3
  250. package/web/app/immutable/nodes/{14.BvXwRXk_.js → 14.CtAbrlVb.js} +1 -1
  251. package/web/app/immutable/nodes/{15.CvF4Yj4G.js → 15.5d-87wXx.js} +1 -1
  252. package/web/app/immutable/nodes/{16.CbnUh4xL.js → 16.BcAEiIYy.js} +1 -1
  253. package/web/app/immutable/nodes/{17.2vxzrHyO.js → 17.S_DWC10F.js} +2 -2
  254. package/web/app/immutable/nodes/{2.Bqgsv7WD.js → 2.D-iQ8fmd.js} +11 -11
  255. package/web/app/immutable/nodes/{3.BMV3o2AW.js → 3.CQKvVdrW.js} +1 -1
  256. package/web/app/immutable/nodes/{4.DS2WiQYi.js → 4.Dq9WSzj3.js} +1 -1
  257. package/web/app/immutable/nodes/{5.Cev1tKbw.js → 5.C2b8MeJP.js} +2 -2
  258. package/web/app/immutable/nodes/{6.Cx-CL8qG.js → 6.DZyVWynY.js} +1 -1
  259. package/web/app/immutable/nodes/{7.DQIGXkGA.js → 7.BNPj2Hjb.js} +1 -1
  260. package/web/app/immutable/nodes/{8.CwodZ6Q4.js → 8.CYaF3iZ7.js} +4 -4
  261. package/web/app/immutable/nodes/{9.BqamPD8c.js → 9.D9yeuWg6.js} +16 -16
  262. package/web/app/version.json +1 -1
  263. package/web/generated/paraglide.js +49 -49
  264. package/web/index.html +20 -20
  265. package/web/app/immutable/assets/0.B58gYYGv.css +0 -1
  266. package/web/app/immutable/assets/BrowserTabType.Dm5f_Y-q.css +0 -1
  267. package/web/app/immutable/chunks/BcdAyX4K.js +0 -2
  268. package/web/app/immutable/chunks/BkBjviLd.js +0 -1
  269. package/web/app/immutable/chunks/C6HefDtf.js +0 -19
  270. package/web/app/immutable/chunks/CUNfV-oG.js +0 -227
  271. package/web/app/immutable/chunks/DSks1Sd3.js +0 -2
  272. package/web/app/immutable/chunks/Df216rki.js +0 -1
  273. package/web/app/immutable/chunks/DwfohDpO.js +0 -1
  274. package/web/app/immutable/chunks/HNL944mw.js +0 -1
  275. package/web/app/immutable/chunks/O0uPRDIU.js +0 -13
  276. package/web/app/immutable/chunks/syxE6N1N.js +0 -1
  277. package/web/app/immutable/entry/start.CcpVYiXq.js +0 -1
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/D-YrUZis.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/CNdlzZOD.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BJpbRkma.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DsvlGcLM.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/DIh4SQwA.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/DrH3w3jB.js","/app/immutable/chunks/DwkxcWNI.js","/app/immutable/chunks/9iFKJfkz.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/b0njYmMP.js","/app/immutable/chunks/CrN8CpnY.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/Gh0Bk6WC.js","/app/immutable/chunks/DVe2mCXY.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/C6LN2Lq-.js"])))=>i.map(i=>d[i]);
2
+ var L=Object.defineProperty;var $=(t,e,a)=>e in t?L(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var T=(t,e,a)=>$(t,typeof e!="symbol"?e+"":e,a);import{Ig as l,lP as K,m8 as w,nz as b,ny as S,aT as G,oI as V,bg as H,mi as z,mg as j,mf as q,GE as X}from"./BJpbRkma.js";import{cE as Z,c6 as J,dA as Q,b as Y,N as ee,J as te,u as ae,dO as ne,dN as se,g as re,T as x,Q as ie,dp as oe,dr as ce}from"./BsesepNZ.js";import{bo as n,_ as le}from"./CNdlzZOD.js";import{ak as de,cP as R}from"./CdlZ8r5v.js";import{k as p,w as A}from"./YcWsBw0J.js";import"./DYhIMPy1.js";import"./9iFKJfkz.js";import"./DIh4SQwA.js";import"./DwkxcWNI.js";import"./ChTqQfQN.js";import"./CqnfptVg.js";import{a as _e}from"./BJzHxIyr.js";function ze(t){return t.type==="image"&&typeof t.data=="string"&&typeof t.mimeType=="string"}function je(t){return t.type==="file"&&typeof t.fileName=="string"&&t.fileName.length>0&&typeof t.attachmentId=="string"&&t.attachmentId.length>0}const I=l.createSelector((t,e)=>t.browser.byWorkspaceId[e]??K),qe=l.createSelector((t,e)=>t.browser.byWorkspaceId[e]),Xe=l.createSelector((t,e)=>I.select(t,e).recentUrls),Ze=l.createSelector((t,e,a)=>{const s=I.select(t,e).pendingZoomByTabId[a];return s&&s.length>0?s:null}),Je=l.createSelector((t,e)=>Object.values(I.select(t,e).pendingElementCaptures)),Qe=l.createSelector((t,e)=>t.workspaceNotes.byWorkspaceId[e]??w),Ye=l.createSelector((t,e)=>t.workspaceNotes.byWorkspaceId[e]?.loading??!1),et=l.createSelector((t,e)=>t.workspaceNotes.byWorkspaceId[e]?.selectedNoteId??null),tt=l.createSelector((t,e)=>t.workspaceNotes.byWorkspaceId[e]?.newlyCreatedNoteId??null),at=l.createSelector((t,e,a)=>t.workspaceNotes.byWorkspaceId[e]?.pendingContentByNoteId[a]===!0),nt=l.createSelector(t=>t.presence.windowVisible),st=l.createSelector((t,e,a)=>b(t.workspaceNotes.byWorkspaceId[e]?.contentViews??w.contentViews).some(s=>s.noteId===a)),rt=l.createSelector((t,e,a)=>S(t.workspaceNotes.byWorkspaceId[e]?.contentViews??w.contentViews,a)),it=l.createSelector((t,e,a)=>S(t.workspaceNotes.byWorkspaceId[e]?.workspaceRoots??w.workspaceRoots,a)),ot=l.createSelector((t,e,a)=>{const s=S(t.workspaceNotes.byWorkspaceId[e]?.presenceViews??w.presenceViews,a);return s?{...s,viewers:b(s.viewers)}:void 0}),ct=l.createSelector((t,e,a)=>{if(!e||!a)return;const s=t.workspaceNotes.byWorkspaceId[e];if(s)return S(s.notes,a)}),lt=l.createSelector((t,e)=>{const a=t.workspaceNotes.byWorkspaceId[e];if(a)return S(a.notes,G)}),dt=l.createSelector((t,e)=>{if(!e)return[];const a=t.workspaceNotes.byWorkspaceId[e];return a?b(a.notes):[]}),_t=l.createSelector((t,e)=>t.workspaceNotes.byWorkspaceId[e]?.noteVersions??null),ue=l.createSelector(t=>t.knownRepos.repos),pe=l.createSelector(t=>b(ue.select(t))),ut=l.createSelector(t=>t.knownRepos.loaded);function me(t,e){const a=new Map;if(e)for(const s of e)s.owner&&s.name&&s.path&&a.set(s.path,{owner:s.owner,name:s.name});for(const s of t)s.repositoryPath&&s.repositoryOwner&&s.repositoryName&&a.set(s.repositoryPath,{owner:s.repositoryOwner,name:s.repositoryName});return a}function ve(t,e,a=n.workspace_grouping_unknownRepository_label()){if(t.repositoryOwner&&t.repositoryName)return{key:`${t.repositoryOwner}/${t.repositoryName}`,label:`${t.repositoryOwner}/${t.repositoryName}`,isGithub:!0,owner:t.repositoryOwner};if(t.repositoryPath){const s=e.get(t.repositoryPath);return s?{key:`${s.owner}/${s.name}`,label:`${s.owner}/${s.name}`,isGithub:!0,owner:s.owner}:{key:t.repositoryPath,label:t.repositoryPath.split("/").pop()||t.repositoryPath,isGithub:!1}}return t.repositoryName&&!t.repositoryOwner?{key:t.repositoryName,label:t.repositoryName,isGithub:!1}:{key:a,label:a,isGithub:!1}}function ye(t,e){const a=e.get(t.path),s=a?.owner??t.owner,r=a?.name??t.name;return s?{key:`${s}/${r}`,label:`${s}/${r}`,isGithub:!0,owner:s}:{key:t.path,label:t.name,isGithub:!1}}function be({workspaces:t,knownRepos:e,repoPathLookup:a,includeKnownRepos:s}){const r=new Map;if(s)for(const i of e){const c=ye(i,a);r.has(c.key)||r.set(c.key,{...c,repoPath:i.path,name:c.isGithub?c.label.split("/").pop():i.name,workspaces:[]})}for(const i of t){const c=ve(i,a);let d=r.get(c.key);d||(d={...c,repoPath:i.repositoryPath,name:i.repositoryName??(c.isGithub?c.label.split("/").pop():c.label),workspaces:[]},r.set(c.key,d)),d.workspaces.push(i)}return Array.from(r.values())}const ge=l.createSelector(t=>t.homeWorkspaces),pt=l.createSelector((t,e)=>t.homeWorkspaces?.previewAgentIds?.[e]??null),mt=l.createSelector(t=>t.workspace.error),fe=l.createSelector(t=>{const e=Z.select(t)?.principal.id,a=t.connections?.hasReceivedList?t.connections.windowBackendId:null;return e&&a?V(a,e):null}),vt=l.createSelector(t=>{const{repoKey:e}=ge.select(t);if(!e)return;const a=J.select(t),s=Q.select(t).filter(i=>i.status!==H.Deleted&&!i.pendingDeleteAt),r=a?[]:pe.select(t);return be({workspaces:s,knownRepos:r,repoPathLookup:me(s,r),includeKnownRepos:!a}).find(i=>i.key===e)}),E=Object.freeze({}),M=l.createSelector(t=>{const e=fe.select(t);return e&&t.homeWorkspaces?.persistenceScope===e?t.homeWorkspaces.setAside??E:E}),yt=l.createSelector(t=>Object.entries(M.select(t)).sort(([,e],[,a])=>e.at-a.at).map(([e])=>e)),bt=l.createSelector((t,e)=>!!M.select(t)[e]),gt=l.createSelector(t=>t.connections?.hasReceivedList?t.connections.windowBackendId??null:null);function ft(t,e){return t.filter(a=>a.imageData&&a.imageMimeType||a.attachmentId||a.sourcePath||a.type==="folder"&&a.path||a.type==="selection"&&a.content).map(a=>({id:a.id,type:a.type,label:a.label,...a.description!==void 0?{description:a.description}:{},...a.content!==void 0?{content:a.content}:{},...a.path!==void 0?{path:a.path}:{},...a.imageData!==void 0?{imageData:a.imageData}:{},...a.imageMimeType!==void 0?{imageMimeType:a.imageMimeType}:{},...a.attachmentId!==void 0?{attachmentId:a.attachmentId}:{},...a.attachmentMimeType!==void 0?{attachmentMimeType:a.attachmentMimeType}:{},...a.attachmentSize!==void 0?{attachmentSize:a.attachmentSize}:{},...a.sourcePath!==void 0&&!a.attachmentId?{sourcePath:a.sourcePath}:{},...(a.placementStatus==="placing"||a.placementStatus==="failed")&&!a.attachmentId?{placementStatus:"failed"}:{},...e?.[a.id]!==void 0?{screen:e[a.id]}:{}}))}function ht(t){return t.flatMap(e=>e.screen!==void 0?[[e.id,e.screen]]:[])}function kt(t){return t.map(e=>({id:e.id,type:e.type||"file",label:e.label,...e.description!==void 0?{description:e.description}:{},...e.content!==void 0?{content:e.content}:{},...e.path!==void 0?{path:e.path}:{},...e.imageData!==void 0?{imageData:e.imageData}:{},...e.imageMimeType!==void 0?{imageMimeType:e.imageMimeType}:{},...e.imageMimeType&&!de(e.imageMimeType)?{placementFileName:e.label}:{},...e.attachmentId!==void 0?{attachmentId:e.attachmentId}:{},...e.attachmentMimeType!==void 0?{attachmentMimeType:e.attachmentMimeType}:{},...e.attachmentSize!==void 0?{attachmentSize:e.attachmentSize}:{},...e.sourcePath!==void 0?{sourcePath:e.sourcePath}:{},...e.placementStatus==="failed"&&e.attachmentId===void 0?{placementStatus:"failed"}:{}}))}function wt(t,e){const a=r=>JSON.stringify([r.attachmentId??null,r.sourcePath??null,r.path??null,r.imageData??null,r.imageMimeType??null]),s=new Map(e.map(r=>[r.id,r]));return Object.fromEntries(t.flatMap(r=>{const i=s.get(r.id);return i?.screen!==void 0&&a(i)===a(r)?[[r.id,i.screen]]:[]}))}const f=l.createSelector((t,e)=>t.transientUi.byWorkspaceId[e]??z),St=l.createSelector((t,e,a)=>{const s=f.select(t,e).composerContextByAgentId?.[a];return s?b(s):[]}),Nt=l.createSelector((t,e)=>f.select(t,e).composerContextByAgentId??{});l.createSelector((t,e)=>f.select(t,e).sidebarActiveTab);const Tt=l.createSelector((t,e)=>f.select(t,e).viewedFiles),he=l.createSelector((t,e,a)=>f.select(t,e).noteViewModeByNoteId[a]??"editor"),At=l.createSelector((t,e,a)=>he.select(t,e,a)==="raw"),It=l.createSelector((t,e,a)=>f.select(t,e).chatDrafts[a]??"");function o(t,e=40){return!t||t.length<=e?t:t.slice(0,e-1)+"…"}function m(t,e){const a=t.actor?.name;return a&&a!=="System"?o(a,30):e??n.events_activity_agent_fallback()}function ke(t){return t&&t.charAt(0).toLowerCase()+t.slice(1)}function k(t){const e=t.split("/"),a=e.pop()||t,s=e.join("/");return{filename:a,directory:s}}const we={"file:changed":t=>{const e=t.data,a=e?.path?o(k(e.path).filename,35):n.events_activity_file_fallback(),s=m(t,""),r=e?.action,i=r==="create"?n.events_activity_verbCreated_label():r==="delete"?n.events_activity_verbDeleted_label():r==="rename"?n.events_activity_verbRenamed_label():n.events_activity_verbUpdated_label();return s?n.events_activity_actorVerbFile_label({actor:s,verb:i,filename:a}):n.events_activity_verbFile_label({verb:i.charAt(0).toUpperCase()+i.slice(1),filename:a})},"file:created":t=>{const e=t.data,a=e?.path?o(k(e.path).filename,35):n.events_activity_file_fallback(),s=m(t,"");return s?n.events_activity_actorCreatedFile_label({actor:s,filename:a}):n.events_activity_createdFile_label({filename:a})},"file:deleted":t=>{const e=t.data,a=e?.path?o(k(e.path).filename,35):n.events_activity_file_fallback(),s=m(t,"");return s?n.events_activity_actorDeletedFile_label({actor:s,filename:a}):n.events_activity_deletedFile_label({filename:a})},"file:renamed":t=>{const e=t.data,a=e?.path?o(k(e.path).filename,30):n.events_activity_file_fallback(),s=e?.oldPath?o(k(e.oldPath).filename,20):null,r=m(t,"");return s?r?n.events_activity_actorRenamedFileArrow_label({actor:r,oldFilename:s,filename:a}):n.events_activity_renamedFileArrow_label({oldFilename:s,filename:a}):r?n.events_activity_actorRenamedFile_label({actor:r,filename:a}):n.events_activity_renamedFile_label({filename:a})},"note:created":t=>{const e=t.data,a=o(e?.title||e?.name||n.events_activity_note_fallback(),35),s=m(t,"");return s?n.events_activity_actorCreatedNote_label({actor:s,title:a}):n.events_activity_createdNote_label({title:a})},"note:updated":t=>{const e=t.data,a=o(e?.title||e?.name||n.events_activity_note_fallback(),35),s=m(t,"");return s?n.events_activity_actorUpdatedNote_label({actor:s,title:a}):n.events_activity_updatedNote_label({title:a})},"note:deleted":t=>{const e=t.data,a=o(e?.title||e?.name||n.events_activity_note_fallback(),35),s=m(t,"");return s?n.events_activity_actorDeletedNote_label({actor:s,title:a}):n.events_activity_deletedNote_label({title:a})},"git:commit":t=>{const a=t.data?.message;if(a){const s=a.length>40?`${a.slice(0,37)}...`:a;return n.events_activity_committed_label({message:s})}return n.events_activity_madeCommit_label()},"git:push":()=>n.events_activity_pushedChanges_label(),"git:pull":()=>n.events_activity_pulledChanges_label(),"git:branch":t=>{const e=t.data,a=e?.branch||e?.name;return a?n.events_activity_switchedTo_label({branch:a}):n.events_activity_changedBranch_label()},"git:merge":t=>{const e=t.data,a=e?.branch||e?.source;return a?n.events_activity_merged_label({branch:a}):n.events_activity_mergedBranches_label()},"agent:started":t=>{const e=t.data,a=o(t.actor?.name||e?.name||e?.agentName||e?.taskTitle||"",35);return a?n.events_activity_startedWorking_label({name:a}):n.events_activity_agentStarted_label()},"agent:completed":t=>{const e=t.data,a=o(t.actor?.name||e?.name||e?.agentName||"",35);return a?n.events_activity_nameCompleted_label({name:a}):n.events_activity_agentCompleted_label()},"agent:failed":t=>{const e=t.data,a=o(t.actor?.name||e?.name||e?.agentName||"",35);return a?n.events_activity_nameFailed_label({name:a}):n.events_activity_agentFailed_label()},"agent:deleted":t=>{const e=t.data,a=o(t.actor?.name||e?.name||e?.agentName||"",35);return a?n.events_activity_deletedName_label({name:a}):n.events_activity_agentDeleted_label()},"agent:message":t=>{const e=o(m(t,""),30);return e?n.events_activity_nameSentMessage_label({name:e}):n.events_activity_agentSentMessage_label()},"agent:idle":t=>{const e=t.data,a=o(t.actor?.name||e?.name||e?.agentName||"",35);return a?n.events_activity_nameFinished_label({name:a}):n.events_activity_agentFinished_label()},"agent:status-changed":t=>{const e=t.data,a=o(t.actor?.name||e?.name||e?.agentName||"",30),s=e?.status||e?.newStatus,r=a||n.events_activity_agent_fallback();switch(s){case"idle":return n.events_activity_nameFinished_label({name:r});case"responding":case"streaming":case"thinking":return n.events_activity_nameIsWorking_label({name:r});case"waiting":case"waiting_for_input":return n.events_activity_nameIsWaiting_label({name:r});case"completed":case"done":return n.events_activity_nameCompleted_label({name:r});case"error":case"failed":return n.events_activity_nameEncounteredError_label({name:r});default:return s?n.events_activity_nameIsStatus_label({name:r,status:s}):n.events_activity_nameStatusChanged_label({name:r})}},"agent:tool:call":t=>{const e=t.data,a=o(e?.title||e?.input?._acpTitle||"",40);if(a)return a;const s=e?.toolName||e?.name||"",r=Y(s),i=ee(r)||te(s,e?.input??{})?"":o(r,25),c=o(m(t,""),25);if(i&&c)return n.events_activity_actorUsedTool_label({actor:c,toolName:i});if(i)return n.events_activity_usedTool_label({toolName:i});switch(e?.toolKind){case"file":return n.events_activity_toolKindFile_label();case"search":return n.events_activity_toolKindSearch_label();case"terminal":return n.events_activity_toolKindTerminal_label();case"git":return n.events_activity_toolKindGit_label();case"note":return n.events_activity_toolKindNote_label();default:return n.events_activity_usedATool_label()}},"agent:created":t=>{const e=t.data,a=String(e?.agentName||e?.name||""),s=/^agent$/i.test(a.trim())?"":o(a,20),r=o(m(t,""),20);return s&&r?n.events_activity_creatorCreatedAgent_label({creator:r,agentName:s}):s?n.events_activity_createdAgentName_label({agentName:s}):r?n.events_activity_creatorCreatedAnAgent_label({creator:r}):n.events_activity_createdNewAgent_label()},"agent:renamed":t=>{const e=t.data,a=o(e?.name||"",30);return a?n.events_activity_renamedAgentTo_label({name:a}):n.events_activity_renamedAgent_label()},"agent:updated":t=>{const e=t.data,a=o(t.actor?.name||e?.agentName||"",25);if(typeof e?.modelId=="string"&&e.modelId){const s=o(e.modelId,25);return a?n.events_activity_nameModelSet_label({name:a,model:s}):n.events_activity_agentModelSet_label({model:s})}return e?.completionReportCleared?a?n.events_activity_clearedNameReport_label({name:a}):n.events_activity_clearedAgentReport_label():a?n.events_activity_nameSettingsUpdated_label({name:a}):n.events_activity_agentSettingsUpdated_label()},"agent:restored":t=>{const e=t.data,a=o(t.actor?.name||e?.name||e?.agentName||"",30);return a?n.events_activity_restoredName_label({name:a}):n.events_activity_agentRestored_label()},"agent:permission:request":t=>{const e=t.data,a=o(e?.agentName||t.actor?.name||"",20),s=o(e?.title||"",35);return a&&s?n.events_activity_agentAskedTo_label({agentName:a,title:ke(s)}):s?n.events_activity_permissionRequested_label({title:s}):n.events_activity_agentAskedPermission_label()},"agent:permission:resolved":t=>t.data?.outcome?.outcome==="cancelled"?n.events_activity_permissionDismissed_label():n.events_activity_permissionAnswered_label(),"agent:user-message:sent":t=>{const e=t.data,a=o(e?.agentName||e?.toAgentName||"",25);return a?n.events_activity_youMessagedName_label({agentName:a}):n.events_activity_youSentMessage_label()},"task:status-changed":t=>{const e=t.data,a=e?.taskName||e?.noteTitle||"",s=e?.newStatus||e?.status,r=o(m(t,""),25);let i="none",c=n.events_activity_statusUpdated_label();if(s){const d=s.toLowerCase().replace(/_/g," ");d==="complete"||d==="completed"||d==="done"?(i="complete",c=n.events_activity_statusComplete_label()):d==="in progress"||d==="in_progress"?(i="in-progress",c=n.events_activity_statusInProgress_label()):d==="cancelled"||d==="canceled"?(i="cancelled",c=n.events_activity_statusCancelled_label()):(i="other",c=d)}if(a&&a!=="task")switch(i){case"complete":return n.events_activity_completedTask_label({taskName:a});case"in-progress":return n.events_activity_startedTask_label({taskName:a});case"cancelled":return n.events_activity_cancelledTask_label({taskName:a});default:return n.events_activity_markedTaskStatus_label({status:c,taskName:a})}return r?n.events_activity_actorUpdatedTaskStatus_label({actor:r}):n.events_activity_taskMarked_label({status:c})},"task:ready-tasks-changed":t=>{const e=t.data,a=Array.isArray(e?.readyTaskIds)?e.readyTaskIds.length:e?.count||e?.taskCount;return typeof a=="number"?a===0?n.events_activity_noTasksReady_label():a===1?n.events_activity_oneTaskReadyToStart_label():n.events_activity_tasksReadyToStart_label({count:a}):n.events_activity_readyTasksUpdated_label()},"task:agent-linked":t=>{const e=t.data,a=e?.link?.taskText||e?.taskKey||"";return a?n.events_activity_agentAssignedToTask_label({taskText:a}):n.events_activity_agentAssignedToATask_label()},"task:agent-unlinked":t=>{const a=t.data?.taskKey||"";return a?n.events_activity_agentUnassignedFromTask_label({taskText:a}):n.events_activity_agentUnassignedFromATask_label()},"pr:linked":t=>{const a=t.data?.prNumber;return a?n.events_activity_linkedPrNumber_label({prNumber:a}):n.events_activity_linkedPr_label()},"pr:updated":t=>{const e=t.data,a=e?.prNumber,s=typeof e?.prStatus=="string"?e.prStatus.toLowerCase():"";return a&&s?s==="draft"?n.events_activity_prIsDraft_label({prNumber:a}):n.events_activity_prIsStatus_label({prNumber:a,status:s}):a?n.events_activity_prNumberUpdated_label({prNumber:a}):n.events_activity_prUpdated_label()},"pr:unlinked":()=>n.events_activity_prUnlinked_label(),"terminal:command":t=>{const a=t.data?.command,s=o(m(t,""),25);if(a){const r=o(a,25);return s?n.events_activity_actorRanCommand_label({actor:s,command:r}):n.events_activity_ranCommandName_label({command:r})}return s?n.events_activity_actorRanACommand_label({actor:s}):n.events_activity_ranCommand_label()},"terminal:exit":t=>{const a=t.data?.exitCode;return typeof a=="number"&&a!==0?n.events_activity_terminalExitedCode_label({exitCode:a}):n.events_activity_terminalSessionEnded_label()},"terminal:title":t=>{const e=t.data,a=o(e?.title||"",35);return a?n.events_activity_terminalRunningTitle_label({title:a}):n.events_activity_terminalTitleChanged_label()},"script:state":t=>{const e=t.data,a=o(e?.scriptId||"",25),s=e?.status,r=a||n.events_activity_script_fallback();switch(s){case"running":return n.events_activity_scriptStarted_label({name:r});case"stopped":{const i=e?.exitCode;return typeof i=="number"&&i!==0?n.events_activity_scriptFailedExit_label({name:r,exitCode:i}):n.events_activity_scriptStopped_label({name:r})}case"error":return e?.error?n.events_activity_scriptErroredDetail_label({name:r,error:o(e.error,30)}):n.events_activity_scriptErrored_label({name:r});default:return s?n.events_activity_scriptIsStatus_label({name:r,status:s}):n.events_activity_scriptStateChanged_label({name:r})}},"test:started":t=>{const e=t.data,a=o(e?.testName||e?.testSuite||"",30),s=o(m(t,""),25);return a?s?n.events_activity_actorStartedTesting_label({actor:s,testName:a}):n.events_activity_startedTestingName_label({testName:a}):s?n.events_activity_actorStartedTests_label({actor:s}):n.events_activity_startedTests_label()},"test:completed":t=>{const e=t.data,a=e?.status,s=o(e?.testName||e?.testSuite||"",30);return a==="passed"?s?n.events_activity_testsPassedName_label({testName:s}):n.events_activity_testsPassed_label():a==="failed"?s?n.events_activity_testsFailedName_label({testName:s}):n.events_activity_testsFailed_label():s?n.events_activity_testsCompletedName_label({testName:s}):n.events_activity_testsCompleted_label()},"build:started":t=>{const e=t.data,a=o(e?.target||"",30),s=o(m(t,""),25);return a?s?n.events_activity_actorStartedBuilding_label({actor:s,target:a}):n.events_activity_startedBuildingTarget_label({target:a}):s?n.events_activity_actorStartedBuild_label({actor:s}):n.events_activity_startedBuild_label()},"build:completed":t=>{const e=t.data,a=e?.status,s=o(e?.target||"",30);return a==="success"?s?n.events_activity_buildSucceededTarget_label({target:s}):n.events_activity_buildSucceeded_label():a==="failed"?s?n.events_activity_buildFailedTarget_label({target:s}):n.events_activity_buildFailed_label():s?n.events_activity_buildCompletedTarget_label({target:s}):n.events_activity_buildCompleted_label()},"workspace:created":t=>{const e=t.data,a=o(e?.workspace?.title||e?.name||"",35);return a?n.events_activity_createdWorkspaceName_label({name:a}):n.events_activity_createdWorkspace_label()},"workspace:updated":t=>{const e=t.data,a=e?.changes??{};if(typeof a.title=="string"&&a.title)return n.events_activity_renamedWorkspaceTo_label({title:o(a.title,30)});if(typeof a.statusMessage=="string")return a.statusMessage?n.events_activity_workspaceStatus_label({statusMessage:o(a.statusMessage,40)}):n.events_activity_clearedWorkspaceStatus_label();if(typeof a.status=="string"&&a.status)return n.events_activity_workspaceMarkedStatus_label({status:a.status.toLowerCase()});if(typeof a.branch=="string"&&a.branch)return n.events_activity_branchSetTo_label({branch:o(a.branch,30)});if(typeof a.baseRef=="string"&&a.baseRef)return n.events_activity_baseBranchSetTo_label({baseRef:o(a.baseRef,30)});const s={baseCommitSha:n.events_activity_fieldBaseCommit_label(),statusMessage:n.events_activity_fieldStatusMessage_label(),lastActivity:n.events_activity_fieldActivityTime_label(),repositoryPath:n.events_activity_fieldRepositoryPath_label(),repositoryOwner:n.events_activity_fieldRepositoryOwner_label(),repositoryName:n.events_activity_fieldRepositoryName_label(),worktreePath:n.events_activity_fieldWorktreePath_label(),setupScript:n.events_activity_fieldSetupScript_label(),skipWorktree:n.events_activity_fieldWorktreeSetting_label()},r=Object.keys(a).filter(c=>c!=="workspaceId");if(r.length>0){const c=r.map(d=>s[d]??d);return n.events_activity_changedWorkspaceFields_label({fields:o(c.join(", "),35)})}const i=o(e?.name||"",35);return i?n.events_activity_updatedWorkspaceName_label({name:i}):n.events_activity_updatedWorkspace_label()},"workspace:deleted":t=>{const e=t.data,a=o(e?.name||"",35);return a?n.events_activity_deletedWorkspaceName_label({name:a}):n.events_activity_deletedWorkspace_label()},"workspace:opened":t=>{const e=t.data,a=o(e?.name||"",35);return a?n.events_activity_openedName_label({name:a}):n.events_activity_openedWorkspace_label()},"workspace:closed":t=>{const e=t.data,a=o(e?.name||"",35);return a?n.events_activity_closedName_label({name:a}):n.events_activity_closedWorkspace_label()},"workspace:activity":t=>{const e=t.data,a=o(e?.description||"",40);return a||n.events_activity_workspaceActivity_label()},"spec:updated":t=>{const e=t.data,a=o(e?.section||"",30),s=o(m(t,""),25);return a?s?n.events_activity_actorUpdatedSpecSection_label({actor:s,section:a}):n.events_activity_updatedSpecSection_label({section:a}):s?n.events_activity_actorUpdatedSpec_label({actor:s}):n.events_activity_updatedSpec_label()},"goal:updated":t=>{const e=o(m(t,""),30);return e?n.events_activity_actorUpdatedGoal_label({actor:e}):n.events_activity_updatedGoal_label()},"comment:added":t=>{const e=t.data,a=o(t.actor?.name||e?.author||e?.authorName||"",30),s=o(e?.preview||e?.text||"",25);return a&&s?n.events_activity_authorCommentedPreview_label({author:a,preview:s}):a?n.events_activity_authorCommented_label({author:a}):s?n.events_activity_commentPreview_label({preview:s}):n.events_activity_commentAdded_label()},"agent:message:sent":t=>{const e=t.data,a=o(t.actor?.name||e?.fromAgentName||n.events_activity_agent_fallback(),25),s=o(e?.toAgentName||"",25);return s?n.events_activity_fromMessagedTo_label({fromName:a,toName:s}):n.events_activity_fromSentMessage_label({fromName:a})},"agent:message:received":t=>{const e=t.data,a=o(e?.fromAgentName||"",25),s=o(t.actor?.name||e?.toAgentName||n.events_activity_agent_fallback(),25);return a?n.events_activity_receivedMessageFrom_label({toName:s,fromName:a}):n.events_activity_receivedAMessage_label({toName:s})},"agent:message:delivery-failed":t=>{const e=t.data,a=o(e?.toAgentName||e?.agentName||"",25);return a?n.events_activity_messageToNameFailed_label({toName:a}):n.events_activity_messageDeliveryFailed_label()},"agent:subscribed":t=>{const e=t.data,a=o(t.actor?.name||e?.agentName||n.events_activity_agent_fallback(),30),s=e?.eventTypes;return s?.length===1?n.events_activity_watchingCategoryEvents_label({name:a,category:s[0].split(":")[0]}):s?.length>1?n.events_activity_watchingForUpdates_label({name:a}):n.events_activity_startedWatching_label({name:a})},"agent:unsubscribed":t=>{const e=t.data,a=o(t.actor?.name||e?.agentName||n.events_activity_agent_fallback(),30);return n.events_activity_stoppedWatching_label({name:a})},"agent:woken-by-subscription":t=>{const e=t.data,a=o(t.actor?.name||e?.agentName||n.events_activity_agent_fallback(),30),s=e?.eventCount||1;return s===1?n.events_activity_nameResumed_label({name:a}):n.events_activity_nameResumedEvents_label({name:a,count:s})},"agent:resumed":t=>{const e=t.data,a=o(t.actor?.name||e?.agentName||e?.name||"",35);return a?n.events_activity_nameResumed_label({name:a}):n.events_activity_agentResumed_label()},"comment:resolved":t=>t.data?.resolved===!1?n.events_activity_reopenedCommentThread_label():n.events_activity_resolvedCommentThread_label(),"git:clone:done":t=>{const e=t.data,a=o(e?.repository||e?.repo||e?.url||"",35);return a?n.events_activity_clonedRepo_label({repo:a}):n.events_activity_repositoryCloned_label()},"settings:changed":t=>{const e=t.data,a=Array.isArray(e?.changes)?e.changes.map(s=>s?.path).filter(Boolean):[];return a.length===1?n.events_activity_changedSetting_label({path:o(a[0],35)}):a.length>1?n.events_activity_changedSettingsCount_label({count:a.length}):n.events_activity_settingsChanged_label()},"skills:changed":()=>n.events_activity_skillsChanged_label(),"mcp:notification":t=>{const e=t.data,a=o(e?.serverName||e?.server||"",25);return a?n.events_activity_updateFromServer_label({server:a}):n.events_activity_mcpNotification_label()},"mcp.servers:status-changed":()=>n.events_activity_mcpStatusChanged_label(),"github:auth-changed":t=>{const a=t.data?.status;return a==="authenticated"||a==="success"?n.events_activity_githubSignedIn_label():a==="signed-out"||a==="expired"?n.events_activity_githubSignInExpired_label():n.events_activity_githubAuthChanged_label()},"workspace:context-changed":()=>n.events_activity_workspaceContextUpdated_label()};function Ct(t){if(!t?.type)return n.events_activity_unknownActivity_label();const e=we[t.type];if(e)try{return e(t)}catch{}const a=t.type.split(":");if(a.length>=2){const[s,r]=a;return`${s.charAt(0).toUpperCase()+s.slice(1)} ${r}`}return t.type.replace(/[_:]/g," ")}function Wt({currentScrollTop:t,targetTop:e,containerTop:a,headerBottom:s}){const r=Math.max(a,s??a);return t+e-r}function F(t){const e=t.trimStart();return e.startsWith("[WORKSPACE EVENTS]")||e.startsWith("[TASK WAKE]")||e.startsWith("[AGENT MESSAGE]")}function Se(t,e){return t.metadata?.type?!0:F(e)}function Ne(t,e){return R(ae(t,e)).replace(/\s+/g," ").trim()}function Et(t,e){const a=new Set,s=[];for(const r of t){if(r.role!=="user"||a.has(r.id))continue;const i=re(r);if(Se(r,i))continue;const c=Ne(r,e);c&&(a.add(r.id),s.push({id:r.id,text:c}))}return s}function Pt(t){const e=new Set,a=[];for(const s of t){if(e.has(s.id)||s.metadata?.type||F(s.preview))continue;const r=R(ne(se(s.preview,s.metadata),s.metadata)).replace(/\s+/g," ").trim();r&&(e.add(s.id),a.push({id:s.id,text:r}))}return a}function xt(t,e){const a=new Map(e.map(i=>[i.id,i])),s=t.map(i=>a.get(i.id)??i),r=new Set(t.map(i=>i.id));for(const i of e)r.has(i.id)||s.push(i);return s}const g=new _e("ReversibleActions");class Te{constructor(){T(this,"pendingActions",new Map);T(this,"completedActions",new Map)}async execute(e){const a=e.duration??15,s=e.id||globalThis.crypto.randomUUID(),r=e.immediate??!0,i=e.showCountdown??!1;if(r&&!i)try{if(await e.action()===!1)return!1;this.completedActions.set(s,e);let c=!1;const d=e.onUndo;if(d){const u=p.warning(e.message,A({duration:a*1e3,action:{label:n.ui_reversibleActions_undo_label(),onClick:async()=>{try{c=!0,await d(),this.completedActions.delete(s),p.dismiss(u)}catch(_){g.error("Failed to undo action:",_ instanceof Error?_:new Error(String(_))),p.error(n.ui_reversibleActions_undoFailed_error())}}}},{pauseOnHover:!1}))}else p.success(e.message);return setTimeout(async()=>{if(!c&&e.onExpire)try{await e.onExpire()}catch(u){g.error("Failed to execute onExpire callback:",u instanceof Error?u:new Error(String(u)))}this.completedActions.delete(s)},a*1e3),!0}catch(c){return g.error("Failed to execute action:",c instanceof Error?c:new Error(String(c))),p.error(n.ui_reversibleActions_failed_error({message:c instanceof Error?c.message:n.ui_reversibleActions_unknownError_label()})),!1}else return i?new Promise(c=>{let d=a,u;const _=async()=>{clearInterval(u),this.pendingActions.delete(s);try{await e.action(),p.success(n.ui_reversibleActions_completed_message({message:e.message})),c(!0)}catch(h){g.error("Failed to execute action:",h instanceof Error?h:new Error(String(h))),p.error(n.ui_reversibleActions_failed_error({message:h instanceof Error?h.message:n.ui_reversibleActions_unknownError_label()})),c(!1)}},y=()=>{clearTimeout(W),clearInterval(u),this.pendingActions.delete(s),p.info(n.ui_reversibleActions_cancelled_message()),c(!1)},v=A({duration:a*1e3},{pauseOnHover:!1}),O=p.warning(n.ui_reversibleActions_countdown_message({message:e.message,seconds:d}),{...v,action:{label:n.ui_reversibleActions_cancel_label(),onClick:y},onDismiss:y,onAutoClose:_});u=setInterval(()=>{d--,d>0&&p.warning(n.ui_reversibleActions_countdown_message({message:e.message,seconds:d}),{...v,id:O,duration:d*1e3,action:{label:n.ui_reversibleActions_cancel_label(),onClick:y},onDismiss:y,onAutoClose:_})},1e3);const W=setTimeout(_,a*1e3);this.pendingActions.set(s,{timeout:W,action:e})}):new Promise(c=>{const d=async()=>{clearTimeout(y),this.pendingActions.delete(s);try{await e.action(),p.success(n.ui_reversibleActions_completed_message({message:e.message})),c(!0)}catch(v){g.error("Failed to execute action:",v instanceof Error?v:new Error(String(v))),p.error(n.ui_reversibleActions_failed_error({message:v instanceof Error?v.message:n.ui_reversibleActions_unknownError_label()})),c(!1)}},u=()=>{clearTimeout(y),this.pendingActions.delete(s),p.info(n.ui_reversibleActions_cancelled_message()),c(!1)},_=async()=>{this.pendingActions.delete(s);try{e.onExpire&&await e.onExpire()}catch(v){g.error("Failed to execute onExpire callback:",v instanceof Error?v:new Error(String(v)))}p.info(n.ui_reversibleActions_expired_message()),c(!1)};p.info(`${e.message}`,A({duration:a*1e3,action:{label:n.ui_reversibleActions_execute_label(),onClick:d},onDismiss:u,onAutoClose:d},{pauseOnHover:!1}));const y=setTimeout(_,a*1e3);this.pendingActions.set(s,{timeout:y,action:e})})}cancel(e){const a=this.pendingActions.get(e);return a?(clearTimeout(a.timeout),this.pendingActions.delete(e),p.info(n.ui_reversibleActions_cancelled_message()),!0):!1}cancelAll(){for(const[e,{timeout:a}]of this.pendingActions)clearTimeout(a);this.pendingActions.clear(),this.pendingActions.size>0&&p.info(n.ui_reversibleActions_allCancelled_message())}getPendingActions(){return Array.from(this.pendingActions.keys())}}const U=new Te;async function Rt(t,e,a,s={}){return U.execute({id:globalThis.crypto.randomUUID(),message:n.ui_reversibleActions_deleted_message({itemName:t}),action:e,onUndo:a,onExpire:s.onExpire,immediate:s.immediate??!0,showCountdown:s.showCountdown??!1,duration:s.duration??15})}async function Mt(t,e,a,s,r,i={}){return U.execute({id:globalThis.crypto.randomUUID(),message:n.ui_reversibleActions_renamed_message({itemType:t,newName:a}),action:s,onUndo:r,immediate:!0,showCountdown:!1,duration:i.duration??15})}const Ae=/\x1b\[[0-9;?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[@-Z\\-_]/g,Ie=/\x1b(\[[0-9;?]*[ -/]*|\][^\x07\x1b]*)?$/;function Ft(t){let e="";for(const r of t.chunks)e+=r.text;if(e==="")return[];e=e.replace(Ie,"").replace(Ae,"");const a=/\r?\n$/.test(e);a||(e=e.replace(/\r$/,""));const s=e.split(/\r?\n/).map(r=>{const i=r.lastIndexOf("\r");return i===-1?r:r.slice(i+1)});return a&&s[s.length-1]===""&&s.pop(),s}const Ce="No output yet.",We=/^\[(?:showing last \d+ of )?\d+ lines\]$/;function Ut(t){if(!t||t.trim()===Ce)return[];const e=t.replace(/\r?\n$/,"").split(/\r?\n/);return We.test(e[0]??"")&&e.shift(),e.length===1&&e[0]===""?[]:e}function P(t,e,a){const r=e.find(c=>String(c.id)===t)?.name?.trim();if(r)return r;const i=a?.trim();return i||D(t)}function D(t){return t.length>14?`${t.slice(0,14)}…`:t}function Dt(t,e,a){const s=new Map,r={ownerAgentId:null,ownerName:null,entries:[]},i=(d,u)=>{let _=s.get(d);return _?_.ownerName===D(d)&&(_.ownerName=P(d,a,u)):(_={ownerAgentId:d,ownerName:P(d,a,u),entries:[]},s.set(d,_)),_};for(const{tab:d,panelId:u,active:_}of t)(d.ownerAgentId?i(d.ownerAgentId,d.ownerAgentName):r).entries.push({tab:d,panelId:u,active:_,hidden:!1});for(const d of e){if(d.type!=="browser")continue;(d.ownerAgentId?i(d.ownerAgentId,d.ownerAgentName):r).entries.push({tab:d,active:!1,hidden:!0})}const c=[...s.values()];return r.entries.length>0&&c.push(r),c}const Ee=new Set(["in_progress","review_required"]),Pe=new Set(["cancelled"]);function Bt(t){if(!t)return new Set;const e=new Set,a=new RegExp(x.source,"g");for(const s of t.matchAll(a)){const r=s[2];r&&e.add(r)}return e}function Ot(t){if(!t)return[];const e=[],a=new RegExp(x.source,"g");for(const s of t.matchAll(a)){const r=s[2];r&&!e.includes(r)&&e.push(r)}return e}const Lt=l.createSelector((t,e)=>t.workspaceTasks.byWorkspaceId[e]??j);l.createSelector((t,e)=>t.workspaceTasks.byWorkspaceId[e]?.loading??!1);l.createSelector((t,e)=>t.workspaceTasks.byWorkspaceId[e]?.error??null);const $t=l.createSelector((t,e)=>t.workspaceTasks.byWorkspaceId[e]?.initialized??!1),Kt=l.createSelector(t=>Object.entries(t.workspaceTasks.byWorkspaceId).filter(([,e])=>e.demandIds.length>0).map(([e])=>e)),Gt=l.createSelector((t,e)=>{const a=t.workspaceTasks.byWorkspaceId[e];return!!a?.demandIds.length&&!a.loading&&(!a.initialized||a.stale)}),Vt=l.createSelector((t,e)=>{const a=t.workspaceTasks.byWorkspaceId[e];return a?b(a.tasks):[]}),Ht=l.createSelector((t,e)=>t.workspaceTasks.byWorkspaceId[e]?.stats??q);l.createSelector((t,e)=>{const a=t.workspaceTasks.byWorkspaceId[e];if(!a)return[];const s=[],r=[],i=[];for(const c of b(a.tasks))Pe.has(c.status)||(Ee.has(c.status)?s.push(c):c.status==="complete"?i.push(c):r.push(c));return[...s,...r,...i]});const N=new Map;function xe(t){const e=N.get(t);if(e)return e;const a=le(async()=>{const{appClient:s}=await import("./D-YrUZis.js").then(r=>r.p);return{appClient:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]),import.meta.url).then(({appClient:s})=>s.workspaces.get(t)).catch(()=>null).finally(()=>{N.get(t)===a&&N.delete(t)});return N.set(t,a),a}function C(t){return oe.select(l.state,t)}async function B(t){const e=await xe(t);return e&&l.dispatch(X(e,{detailRead:!0})),C(t)}function zt(t){return ce.select(l.state,t)?Promise.resolve(C(t)):B(t)}function jt(t){const e=C(t);return ie(e)?B(t):Promise.resolve(e)}export{it as $,It as A,St as B,Kt as C,qe as D,Pe as E,at as F,st as G,fe as H,Ee as I,pt as J,gt as K,M as L,yt as M,mt as N,bt as O,vt as P,ge as Q,At as R,pe as S,ut as T,tt as U,ct as V,rt as W,ot as X,_t as Y,he as Z,nt as _,kt as a,Ye as a0,Je as a1,Ze as a2,et as a3,lt as a4,Tt as a5,Nt as a6,Qe as a7,Ht as a8,Vt as a9,$t as aa,Gt as ab,Lt as ac,ft as ad,me as b,jt as c,Rt as d,zt as e,Ot as f,Bt as g,Ct as h,Wt as i,Ne as j,Et as k,Pt as l,Dt as m,be as n,je as o,ze as p,xt as q,ht as r,Mt as s,P as t,wt as u,U as v,Ut as w,Ft as x,dt as y,Xe as z};
@@ -1 +1 @@
1
- import{bv as f}from"./DYhIMPy1.js";import{W as o}from"./Du-ii3l_.js";import{bo as u}from"./syxE6N1N.js";import{k as b}from"./CToUKfVS.js";import"./XNWMykPO.js";import"./g2wqtBd2.js";import"./BgtLN2kD.js";import"./ChTqQfQN.js";import"./SFeFj2Mb.js";import"./CpBlZvWi.js";function l(){return globalThis.electronAPI??null}function i(r){const e=r?.enabled;return typeof e=="boolean"?e:null}const v=f(!1,r=>{const e=l();if(!e)return;let t=!0,s=!1;const c=e.on(o.DOCK_LAB_CHANGED,a=>{if(!t)return;const n=i(a);n!==null&&(s=!0,r(n))});return e.invoke(o.GET_DOCK_LAB,{}).then(a=>{const n=i(a);t&&!s&&n!==null&&r(n)}).catch(()=>{}),()=>{t=!1,e.offById(o.DOCK_LAB_CHANGED,c)}});async function d(r){const e=l();if(!e)return!1;try{const t=await e.invoke(o.SET_DOCK_LAB,{enabled:r});if(i(t)===r)return!0}catch{}return b.error(u.settings_gitWorkspace_saveError()),!1}async function y(r){await d(r)}export{v as d,d as r,y as s};
1
+ import{bv as f}from"./DYhIMPy1.js";import{W as o}from"./DVe2mCXY.js";import{bo as u}from"./CNdlzZOD.js";import{k as b}from"./YcWsBw0J.js";import"./9iFKJfkz.js";import"./DIh4SQwA.js";import"./DwkxcWNI.js";import"./ChTqQfQN.js";import"./CqnfptVg.js";import"./BJpbRkma.js";function l(){return globalThis.electronAPI??null}function i(r){const e=r?.enabled;return typeof e=="boolean"?e:null}const v=f(!1,r=>{const e=l();if(!e)return;let t=!0,s=!1;const c=e.on(o.DOCK_LAB_CHANGED,a=>{if(!t)return;const n=i(a);n!==null&&(s=!0,r(n))});return e.invoke(o.GET_DOCK_LAB,{}).then(a=>{const n=i(a);t&&!s&&n!==null&&r(n)}).catch(()=>{}),()=>{t=!1,e.offById(o.DOCK_LAB_CHANGED,c)}});async function d(r){const e=l();if(!e)return!1;try{const t=await e.invoke(o.SET_DOCK_LAB,{enabled:r});if(i(t)===r)return!0}catch{}return b.error(u.settings_gitWorkspace_saveError()),!1}async function y(r){await d(r)}export{v as d,d as r,y as s};
@@ -0,0 +1 @@
1
+ import{oA as o}from"./BJpbRkma.js";import{aC as r}from"./BsesepNZ.js";function c(n,e){if(!e)return!0;const t=r.select(n,e);return!!t&&!o(t)}export{c};
@@ -1 +1 @@
1
- var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Z as ce,ai as q,ar as Ce}from"./CFMVBWPg.js";import{bU as Le,cS as le,cj as ue,ci as ve}from"./BX3vzTpn.js";import{Ig as p,AY as we,bw as be,c as Fe,Ki as de,ia as me,bI as ke,CT as z,Bl as Ge,f5 as Pe,zr as xe,dS as Ee,f1 as fe,dR as _e,zV as Ve,JY as Ue,vE as Be}from"./CpBlZvWi.js";import{aC as Ae,dE as he,A as H,P as ge,ay as K}from"./CNJgwoNk.js";import{ax as $e}from"./BgtLN2kD.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BJzHxIyr.js";import{k as Q}from"./CToUKfVS.js";import"./DYhIMPy1.js";import{bo as n}from"./syxE6N1N.js";import"./XNWMykPO.js";import"./g2wqtBd2.js";import"./SFeFj2Mb.js";import{R as Re}from"./BvFAWM27.js";import{L as Ye}from"./D8dE5NKO.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
1
+ var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Z as ce,ai as q,ar as Ce}from"./D19QPbvx.js";import{bU as Le,cS as le,cj as ue,ci as ve}from"./CdlZ8r5v.js";import{Ig as p,AY as we,bw as be,c as Fe,Ki as de,ia as me,bI as ke,CT as z,Bl as Ge,f5 as Pe,zr as xe,dS as Ee,f1 as fe,dR as _e,zV as Ve,JY as Ue,vE as Be}from"./BJpbRkma.js";import{aC as Ae,dE as he,A as H,P as ge,ay as K}from"./BsesepNZ.js";import{ax as $e}from"./DwkxcWNI.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BJzHxIyr.js";import{k as Q}from"./YcWsBw0J.js";import"./DYhIMPy1.js";import{bo as n}from"./CNdlzZOD.js";import"./9iFKJfkz.js";import"./DIh4SQwA.js";import"./CqnfptVg.js";import{R as Re}from"./BvFAWM27.js";import{L as Ye}from"./D8dE5NKO.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
@@ -1,4 +1,4 @@
1
- import{p as z}from"./DSTlg4w0.js";import{b as f,q as B,aX as E,B as F,ay as $,a_ as P,V as A,b0 as W,Y as _,U as N,aZ as Y,W as L,O as M,r as O}from"./BTBcxnN8.js";import{p as I}from"./0FIzxpig.js";var U=M.packet,u,C=(u=class{constructor(){this.packet=[],this.setAccTitle=P,this.getAccTitle=A,this.setDiagramTitle=W,this.getDiagramTitle=_,this.getAccDescription=N,this.setAccDescription=Y}getConfig(){const t=B({...U,...L().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){O(),this.packet=[]}},f(u,"PacketDB"),u),X=1e4,j=f((e,t)=>{z(e,t);let r=-1,s=[],i=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:o,bits:d,label:g}of e.blocks){if(a!==void 0&&o!==void 0&&o<a)throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${o??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(o??=a+(d??1)-1,d??=o-a+1,r=o,$.debug(`Packet block ${a} - ${r} with label ${g}`);s.length<=l+1&&t.getPacket().length<X;){const[c,p]=q({start:a,end:o,bits:d,label:g},i,l);if(s.push(c),c.end+1===i*l&&(t.pushWord(s),s=[],i++),!p)break;({start:a,end:o,bits:d,label:g}=p)}}t.pushWord(s)},"populate"),q=f((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const s=t*r-1,i=t*r;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},"getNextFittingBlock"),S={parser:{yy:void 0},parse:f(async e=>{const t=await I("packet",e),r=S.parser?.yy;if(!(r instanceof C))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");$.debug(t),j(t,r)},"parse")},G=f((e,t,r,s)=>{const i=s.db,l=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:d,bitsPerRow:g}=l,c=i.getPacket(),p=i.getDiagramTitle(),m=a+o,n=m*(c.length+1)-(p?0:a),h=d*g+2,k=E(t);k.attr("viewBox",`0 0 ${h} ${n}`),F(k,n,h,l.useMaxWidth);for(const[x,b]of c.entries())H(k,b,x,l);k.append("text").text(p).attr("x",h/2).attr("y",n-m/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),H=f((e,t,r,{rowHeight:s,paddingX:i,paddingY:l,bitWidth:a,bitsPerRow:o,showBits:d,bitOrder:g})=>{const c=e.append("g"),p=r*(s+l)+l,m=g==="descending";for(const n of t){const h=n.end-n.start+1,k=n.start%o,b=(m?o-k-h:k)*a+1,w=h*a-i;if(c.append("rect").attr("x",b).attr("y",p).attr("width",w).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",b+w/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(n.label),!d)continue;const[D,T]=m?[n.end,n.start]:[n.start,n.end],v=h===1,y=p-2;c.append("text").attr("x",b+(v?w/2:0)).attr("y",y).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",v?"middle":"start").text(D),v||c.append("text").attr("x",b+w).attr("y",y).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(T)}},"drawWord"),K={draw:G},V={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Z=f(({packet:e}={})=>{const t=B(V,e);return`
1
+ import{p as z}from"./DacYbmEF.js";import{b as f,q as B,aX as E,B as F,ay as $,a_ as P,V as A,b0 as W,Y as _,U as N,aZ as Y,W as L,O as M,r as O}from"./BOY33UBS.js";import{p as I}from"./CFXA-WTd.js";var U=M.packet,u,C=(u=class{constructor(){this.packet=[],this.setAccTitle=P,this.getAccTitle=A,this.setDiagramTitle=W,this.getDiagramTitle=_,this.getAccDescription=N,this.setAccDescription=Y}getConfig(){const t=B({...U,...L().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){O(),this.packet=[]}},f(u,"PacketDB"),u),X=1e4,j=f((e,t)=>{z(e,t);let r=-1,s=[],i=1;const{bitsPerRow:l}=t.getConfig();for(let{start:a,end:o,bits:d,label:g}of e.blocks){if(a!==void 0&&o!==void 0&&o<a)throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);if(a??=r+1,a!==r+1)throw new Error(`Packet block ${a} - ${o??a} is not contiguous. It should start from ${r+1}.`);if(d===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(o??=a+(d??1)-1,d??=o-a+1,r=o,$.debug(`Packet block ${a} - ${r} with label ${g}`);s.length<=l+1&&t.getPacket().length<X;){const[c,p]=q({start:a,end:o,bits:d,label:g},i,l);if(s.push(c),c.end+1===i*l&&(t.pushWord(s),s=[],i++),!p)break;({start:a,end:o,bits:d,label:g}=p)}}t.pushWord(s)},"populate"),q=f((e,t,r)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*r)return[e,void 0];const s=t*r-1,i=t*r;return[{start:e.start,end:s,label:e.label,bits:s-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},"getNextFittingBlock"),S={parser:{yy:void 0},parse:f(async e=>{const t=await I("packet",e),r=S.parser?.yy;if(!(r instanceof C))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");$.debug(t),j(t,r)},"parse")},G=f((e,t,r,s)=>{const i=s.db,l=i.getConfig(),{rowHeight:a,paddingY:o,bitWidth:d,bitsPerRow:g}=l,c=i.getPacket(),p=i.getDiagramTitle(),m=a+o,n=m*(c.length+1)-(p?0:a),h=d*g+2,k=E(t);k.attr("viewBox",`0 0 ${h} ${n}`),F(k,n,h,l.useMaxWidth);for(const[x,b]of c.entries())H(k,b,x,l);k.append("text").text(p).attr("x",h/2).attr("y",n-m/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),H=f((e,t,r,{rowHeight:s,paddingX:i,paddingY:l,bitWidth:a,bitsPerRow:o,showBits:d,bitOrder:g})=>{const c=e.append("g"),p=r*(s+l)+l,m=g==="descending";for(const n of t){const h=n.end-n.start+1,k=n.start%o,b=(m?o-k-h:k)*a+1,w=h*a-i;if(c.append("rect").attr("x",b).attr("y",p).attr("width",w).attr("height",s).attr("class","packetBlock"),c.append("text").attr("x",b+w/2).attr("y",p+s/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(n.label),!d)continue;const[D,T]=m?[n.end,n.start]:[n.start,n.end],v=h===1,y=p-2;c.append("text").attr("x",b+(v?w/2:0)).attr("y",y).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",v?"middle":"start").text(D),v||c.append("text").attr("x",b+w).attr("y",y).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(T)}},"drawWord"),K={draw:G},V={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},Z=f(({packet:e}={})=>{const t=B(V,e);return`
2
2
  .packetByte {
3
3
  font-size: ${t.byteFontSize};
4
4
  }
@@ -1 +1 @@
1
- import{aR as z,aP as Q,b4 as Z,a0 as J}from"./DYhIMPy1.js";import{B as ee}from"./syxE6N1N.js";import{s as i,o as c,c as u,_ as T,n as k,l as N,u as te,r as oe,e as H,b as y,d as ae}from"./CIyUrgF0.js";const se=Symbol("NaN");function we(e,t,a){z&&Q();var o=new ee(e),s=!Z();J(()=>{var n=t();n!==n&&(n=se),s&&n!==null&&typeof n=="object"&&(n={}),o.ensure(n,a)})}const ne="0.0.0-browser";function re(e){const t=e?.electronAPI;return!t||t.versions?.electron===ne?"web":"electron"}function K(){return typeof window>"u"?"web":re(window)}function Ge(){return K()==="electron"}function ie(e){const t=e==="electron";return{windowChrome:t,nativeDialogs:t,shellIntegration:t,externalEditors:t,browserPanel:t,autoUpdate:t,deeplinks:t,nativeNotifications:t,ssh:t}}function ce(){return ie(K())}function De(e){return ce()[e]}const Pe={DEV_CONSOLE:{OPEN:"dev-console:open",CONNECT:"dev-console:connect",READ:"dev-console:read",RECORD:"dev-console:record",CLEAR:"dev-console:clear",SELECT:"dev-console:select",LINKS_STATUS:"dev-console:links-status",LINKS_START:"dev-console:links-start",LINKS_STOP:"dev-console:links-stop",LINKS_READ:"dev-console:links-read",LINKS_RECORD:"dev-console:links-record"},WORKSPACE:{LIST:"workspace:list",CREATE:"workspace:create",GET:"workspace:get",GET_CURRENT:"workspace:get-current",GET_BY_ID:"workspace:get-by-id",GET_ROOT:"workspace:get-root",OPEN:"workspace:open",CLOSE:"workspace:close",SAVE:"workspace:save",UPDATE:"workspace:update",DELETE:"workspace:delete",ACTIVATE:"workspace:activate",ARCHIVE:"workspace:archive",UNARCHIVE:"workspace:unarchive",CLEANUP:"workspace:cleanup",RENAME:"workspace:rename",EXPORT:"workspace:export",IMPORT:"workspace:import",GET_METADATA:"workspace:get-metadata",UPDATE_METADATA:"workspace:update-metadata",GET_RECENT:"workspace:get-recent",CLEAR_RECENT:"workspace:clear-recent",GET_STATS:"workspace:get-stats",VALIDATE:"workspace:validate",REPAIR:"workspace:repair",BACKUP:"workspace:backup",RESTORE:"workspace:restore",GET_SETTINGS:"workspace:get-settings",UPDATE_SETTINGS:"workspace:update-settings",TRIGGER_CHECK:"workspace:trigger-check",LIST_FILES:"workspace:list-files",TEST_WATCHER:"workspace:test-watcher",FIND_REPOSITORIES:"workspace:find-repositories",UPDATE_SPEC_WATCHER_TIMESTAMP:"workspace:update-spec-watcher-timestamp",UPDATE_CURRENT_CONTEXT:"workspace:update-current-context",SEARCH_IN_FILES:"workspace:search-in-files",GET_RECENT_REPOSITORIES:"workspace:get-recent-repositories",ADD_RECENT_REPOSITORY:"workspace:add-recent-repository",CLEAR_RECENT_REPOSITORIES:"workspace:clear-recent-repositories",REMOVE_RECENT_REPOSITORY:"workspace:remove-recent-repository",UPDATE_GIT_INFO:"workspace:update_git_info",GET_SETTINGS_ALT:"workspace:getSettings",UPDATE_SETTINGS_ALT:"workspace:updateSettings",LOAD_RULES:"workspace:load-rules",RENAME_BRANCH:"workspace:rename-branch",GET_HOVER_STATUS:"workspace:get-hover-status",GET_DIFF_SUMMARY:"workspace:get-diff-summary",GET_GIT_SUMMARY:"workspace:get-git-summary",GET_TASKS:"workspace:get-tasks"},AGENT:{LOAD_INITIAL_CONFIG:"agent:load-initial-config",AVAILABLE:"agent:available",RESUME:"agent:resume",CLEANUP:"agent:cleanup",GET_USER_RULES:"agent:get-user-rules",GET_SPECIALIZATION_RULES:"agent:get-specialization-rules",TRACK_STARTED:"agent:track-started",TRACK_COMPLETED:"agent:track-completed",TRACK_ERROR:"agent:track-error",CREATE:"agent:create",CIRCUIT_BREAKER_RESET:"agent:circuit-breaker:reset",SEND_MESSAGE:"agent:send-message",STOP:"agent:stop",SEND:"agent:send",GET_SESSION:"agent:get-session",LIST_SESSIONS:"agent:list-sessions",DELETE_SESSION:"agent:delete-session",RENAME:"agent:rename",SET_PRIORITY:"agent:set-priority",SUBSCRIBE_UPDATES:"agent:subscribe-updates",UNSUBSCRIBE_UPDATES:"agent:unsubscribe-updates",GET_SUGGESTIONS:"agent:get-suggestions",APPLY_SUGGESTION:"agent:apply-suggestion",GET_COMPLETIONS:"agent:get-completions",VALIDATE_INPUT:"agent:validate-input",FORMAT_OUTPUT:"agent:format-output",GET_SHORTCUTS:"agent:get-shortcuts",ADD_SHORTCUT:"agent:add-shortcut",REMOVE_SHORTCUT:"agent:remove-shortcut",EXECUTE_SHORTCUT:"agent:execute-shortcut",GET_PLUGINS:"agent:get-plugins",INSTALL_PLUGIN:"agent:install-plugin",UNINSTALL_PLUGIN:"agent:uninstall-plugin",ENABLE_PLUGIN:"agent:enable-plugin",DISABLE_PLUGIN:"agent:disable-plugin",GET_PLUGIN_SETTINGS:"agent:get-plugin-settings",UPDATE_PLUGIN_SETTINGS:"agent:update-plugin-settings",EXECUTE_PLUGIN_ACTION:"agent:execute-plugin-action",GET_WEBHOOKS:"agent:get-webhooks",ADD_WEBHOOK:"agent:add-webhook",REMOVE_WEBHOOK:"agent:remove-webhook",TEST_WEBHOOK:"agent:test-webhook",GET_INTEGRATIONS:"agent:get-integrations",CONNECT_INTEGRATION:"agent:connect-integration",DISCONNECT_INTEGRATION:"agent:disconnect-integration",SYNC_INTEGRATION:"agent:sync-integration",GET_INTEGRATION_STATUS:"agent:get-integration-status",GET_INTEGRATION_DATA:"agent:get-integration-data",UPDATE_INTEGRATION_SETTINGS:"agent:update-integration-settings",TEST_INTEGRATION:"agent:test-integration",GET_WORKFLOWS:"agent:get-workflows",CREATE_WORKFLOW:"agent:create-workflow",UPDATE_WORKFLOW:"agent:update-workflow",DELETE_WORKFLOW:"agent:delete-workflow",EXECUTE_WORKFLOW:"agent:execute-workflow",PAUSE_WORKFLOW:"agent:pause-workflow",RESUME_WORKFLOW:"agent:resume-workflow",CANCEL_WORKFLOW:"agent:cancel-workflow",GET_WORKFLOW_STATUS:"agent:get-workflow-status",GET_WORKFLOW_HISTORY:"agent:get-workflow-history",EXPORT_WORKFLOW:"agent:export-workflow",IMPORT_WORKFLOW:"agent:import-workflow",VALIDATE_WORKFLOW:"agent:validate-workflow",OPTIMIZE_WORKFLOW:"agent:optimize-workflow",GET_WORKFLOW_METRICS:"agent:get-workflow-metrics",GET_WORKFLOW_LOGS:"agent:get-workflow-logs",CLEAR_WORKFLOW_LOGS:"agent:clear-workflow-logs",SCHEDULE_WORKFLOW:"agent:schedule-workflow",UNSCHEDULE_WORKFLOW:"agent:unschedule-workflow",GET_SCHEDULED_WORKFLOWS:"agent:get-scheduled-workflows",GET_WORKFLOW_TRIGGERS:"agent:get-workflow-triggers",ADD_WORKFLOW_TRIGGER:"agent:add-workflow-trigger",REMOVE_WORKFLOW_TRIGGER:"agent:remove-workflow-trigger",TEST_WORKFLOW_TRIGGER:"agent:test-workflow-trigger",GET_WORKFLOW_VARIABLES:"agent:get-workflow-variables",SET_WORKFLOW_VARIABLES:"agent:set-workflow-variables",GET_WORKFLOW_DEPENDENCIES:"agent:get-workflow-dependencies",RESOLVE_WORKFLOW_DEPENDENCIES:"agent:resolve-workflow-dependencies",GET_WORKFLOW_PERMISSIONS:"agent:get-workflow-permissions",SET_WORKFLOW_PERMISSIONS:"agent:set-workflow-permissions",SHARE_WORKFLOW:"agent:share-workflow",UNSHARE_WORKFLOW:"agent:unshare-workflow",CLONE_WORKFLOW:"agent:clone-workflow",MERGE_WORKFLOWS:"agent:merge-workflows",DIFF_WORKFLOWS:"agent:diff-workflows",GET_WORKFLOW_VERSIONS:"agent:get-workflow-versions",RESTORE_WORKFLOW_VERSION:"agent:restore-workflow-version",TAG_WORKFLOW_VERSION:"agent:tag-workflow-version",GET_WORKFLOW_TAGS:"agent:get-workflow-tags",REMOVE_WORKFLOW_TAG:"agent:remove-workflow-tag",SET_MODEL:"agent:set-model"},EVENTS:{QUERY:"events:query",SUBSCRIBE:"events:subscribe",UNSUBSCRIBE:"events:unsubscribe",EMIT:"events:emit",GET_LAST_EVENT:"events:getLastEvent",GET_STATISTICS:"events:getStatistics",GET_AGENT_SUBSCRIPTIONS:"events:get-agent-subscriptions",UNSUBSCRIBE_AGENT:"events:unsubscribe-agent"},AUGGIE:{INSTALL:"auggie:install",AUTHENTICATE:"auggie:authenticate",GET_MODELS:"auggie:get-models",GET_CONFIG:"auggie:get-config",UPDATE_CONFIG:"auggie:update-config",GET_LATEST_SESSION:"auggie:get-latest-session",EXTRACT_FILE_CHANGES:"auggie:extract-file-changes",GET_PATH:"auggie:get-path",GET_USER_INFO:"auggie:get-user-info",UNINSTALL_MCP_CLAUDE_CODE:"auggie:uninstall-mcp-claude-code",UNINSTALL_MCP_CODEX:"auggie:uninstall-mcp-codex",UNINSTALL_MCP_OPENCODE:"auggie:uninstall-mcp-opencode",UNINSTALL_MCP_CORTEX:"auggie:uninstall-mcp-cortex",UNINSTALL_MCP_PI:"auggie:uninstall-mcp-pi",UNINSTALL_MCP_DROID:"auggie:uninstall-mcp-droid"},OPENCODE:{GET_MODELS:"opencode:get-models"},CLAUDE_CODE:{GET_MODELS:"claude-code:get-models"},CODEX:{GET_MODELS:"codex:get-models"},CORTEX:{GET_MODELS:"cortex:get-models"},PI:{GET_MODELS:"pi:get-models"},DROID:{GET_MODELS:"droid:get-models"},GROK:{GET_MODELS:"grok:get-models"},UNSLOTH:{GET_MODELS:"unsloth:get-models"},ANTIGRAVITY:{GET_MODELS:"antigravity:get-models"},PROVIDERS:{GET_AVAILABILITY:"providers:get-availability",PREPARE_ADAPTERS:"providers:prepare-adapters",GET_PATHS:"providers:get-paths",CHECK_SINGLE:"providers:check-single"},FILE:{READ:"file:read",READ_CHUNK:"file:read-chunk",HASH:"file:hash",WRITE:"file:write",DELETE:"file:delete",EXISTS:"file:exists",LIST:"file:list",COPY:"file:copy",MOVE:"file:move",GET_INFO:"file:get-info",READ_DIR_WITH_STATS:"file:readDirWithStats",GET_GITIGNORE_PATTERNS:"file:getGitignorePatterns",READ_BATCH:"file:read-batch",MKDIR:"file:mkdir",GET_GIT_STATUS:"file:getGitStatus",GET_TREE_WITH_SIZES:"file:getTreeWithSizes",GET_DIRECTORY_STATUS:"file:getDirectoryStatus",DOWNLOAD:"file:download",DOWNLOAD_ATTACHMENT:"file:download-attachment"},PRIMITIVES:{CODEBASE_SEARCH:"codebase:search",TERMINAL_RUN:"terminal:runCommand",TERMINAL_KILL:"terminal:killProcess",TERMINAL_SUBSCRIBE:"terminal:subscribeOutput",AGENT_RUN:"agent:runAction"},SYSTEM:{GET_INFO:"system:get-info",GET_RESOURCES:"system:get-resources",OPEN_EXTERNAL:"system:open-external",SHOW_ITEM_IN_FOLDER:"system:show-item-in-folder",WRITE_CLIPBOARD:"system:write-clipboard",BEEP:"system:beep",HOME_DIRECTORY:"system:home-directory",EXECUTE_COMMAND:"system:execute-command",EXECUTE_COMMAND_STREAMING:"system:execute-command-streaming",CHECK_GIT:"system:check-git",CHECK_NODE:"system:check-node",CHECK_GH:"system:check-gh",CHECK_RTK:"system:check-rtk",LIST_FONTS:"system:list-fonts"},APP:{SET_BADGE:"app:set-badge",SET_LANGUAGE_PREFERENCE:"app:set-language-preference",VERSION:"app:version",GET_VERSION:"app:get-version",NAME:"app:name",PATH:"app:path",ROOT:"app:root",UI_NAVIGATE:"app:ui:navigate",UI_HIGHLIGHT:"app:ui:highlight",HISTORY_NAVIGATE:"app:history-navigate"},QUIT_CONFIRMATION:{SHOW:"quit-confirmation:show",ACK:"quit-confirmation:ack",RESPONSE:"quit-confirmation:response",DISMISS:"quit-confirmation:dismiss"},COLLABORATION_AUTH:{POLICY:"collaboration-auth:policy",OPEN:"collaboration-auth:open",SHOW:"collaboration-auth:show",ACTION:"collaboration-auth:action",DISMISS:"collaboration-auth:dismiss"},INVITE_CONSENT:{SHOW:"invite-consent:show",ACK:"invite-consent:ack",RESPONSE:"invite-consent:response",DISMISS:"invite-consent:dismiss"},INVITE_PROGRESS:{SHOW:"invite-progress:show",UPDATE:"invite-progress:update",ACK:"invite-progress:ack",RESPONSE:"invite-progress:response",DISMISS:"invite-progress:dismiss"},INVITE_NOTICE:{SHOW:"invite-notice:show",ACK:"invite-notice:ack",RESPONSE:"invite-notice:response",DISMISS:"invite-notice:dismiss"},WINDOW:{RELOAD:"window:reload",TOGGLE_DEVTOOLS:"window:toggle-devtools",MINIMIZE:"window:minimize",MAXIMIZE:"window:maximize",CLOSE:"window:close",CREATE:"window:create",OPEN_NEW:"window:open-new",SET_THEME:"window:set-theme",SET_TRANSLUCENCY:"window:set-translucency",GET_ZOOM_FACTOR:"window:get-zoom-factor",SET_TITLE:"window:set-title",SET_IN_WORKSPACE:"window:set-in-workspace",SET_OPEN_WORKSPACE_TABS:"window:set-open-workspace-tabs",SET_BROWSER_FOCUSED:"window:set-browser-focused",SET_FULL_SCREEN:"window:set-full-screen",GET_FULL_SCREEN:"window:get-full-screen",SET_DOCK_POINTER_REGION:"window:set-dock-pointer-region",FOCUS_DOCK:"window:focus-dock",GET_DOCK_PLACEMENT:"window:get-dock-placement",UPDATE_DOCK_PLACEMENT:"window:update-dock-placement",SHOW_DOCK_MENU:"window:show-dock-menu",ACTIVATE_APP:"window:activate-app",SWITCH_DOCK_BACKEND:"window:switch-dock-backend",DOCK_BACKEND_SWITCH_FAILED:"window:dock-backend-switch-failed",DOCK_PLACEMENT_CHANGED:"window:dock-placement-changed",DOCK_POINTER_PRESENCE_CHANGED:"window:dock-pointer-presence-changed",DOCK_SHOWN:"window:dock-shown",DOCK_RENDERER_READY:"window:dock-renderer-ready",GET_DOCK_LAB:"window:get-dock-lab",SET_DOCK_LAB:"window:set-dock-lab",DOCK_LAB_CHANGED:"window:dock-lab-changed",CYCLE_FOCUS:"window:cycle-focus"},DOCK_CONTEXT:{GET:"dock-context:get",CHANGED:"dock-context:changed"},DOCK_SHORTCUTS:{GET:"dock-shortcuts:get",SET:"dock-shortcuts:set",CAPTURE:"dock-shortcuts:capture",CHANGED:"dock-shortcuts:changed"},CHAT_MEDIA:{BEGIN:"chat-media:begin",CONTROL:"chat-media:control",CLOSE:"chat-media:close"},DOCK_EVIDENCE:{BEGIN:"dock-evidence:begin",CAPTURE:"dock-evidence:capture",CANCEL:"dock-evidence:cancel",CONTROL:"dock-evidence:control",EVENT:"dock-evidence:event"},DOCK_ANNOTATION:{READY:"dock-annotation:ready",POINTER:"dock-annotation:pointer",GESTURE:"dock-annotation:gesture",GET_STILL:"dock-annotation:get-still",STATE:"dock-annotation:state",TOOLBAR:"dock-annotation:toolbar",SIGNAL:"dock-annotation:signal"},DOCK_CAPTURE_EDITOR:{OPEN:"dock-capture-editor:open",GET:"dock-capture-editor:get",CLOSE:"dock-capture-editor:close",DELETE:"dock-capture-editor:delete",DELETE_REQUESTED:"dock-capture-editor:delete-requested",DELETE_RESULT:"dock-capture-editor:delete-result",DISCARD:"dock-capture-editor:discard",KEEP:"dock-capture-editor:keep",CHANGED:"dock-capture-editor:changed",CONFIRM_DISCARD:"dock-capture-editor:confirm-discard",SAVE:"dock-capture-editor:save",SAVE_REQUESTED:"dock-capture-editor:save-requested",RETAKE:"dock-capture-editor:retake",RETAKE_REQUESTED:"dock-capture-editor:retake-requested",HOLD_BEGIN:"dock-capture-editor:hold-begin",HOLD_END:"dock-capture-editor:hold-end",HOLD_SHOW:"dock-capture-editor:hold-show",ATTACHED:"dock-capture-editor:attached",ATTACH_RETURN:"dock-capture-editor:attach-return",RETAKE_RESULT:"dock-capture-editor:retake-result",TRANSCRIPT_UPDATE:"dock-capture-editor:transcript-update",NOTE_DICTATION:"dock-capture-editor:note-dictation",NOTE_DICTATION_REQUESTED:"dock-capture-editor:note-dictation-requested",NOTE_DICTATION_TEXT:"dock-capture-editor:note-dictation-text",NOTE_DICTATION_UPDATE:"dock-capture-editor:note-dictation-update",WAVEFORM_UPDATE:"dock-capture-editor:waveform-update",SAVE_RESULT:"dock-capture-editor:save-result"},DOCK_MEDIA:{CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"},POWER:{GET_BATTERY_STATE:"power:get-battery-state",BATTERY_CHANGED:"power:battery-changed"},TERMINAL:{CREATE_WITH_COMMAND:"terminal:createWithCommand",PROFESSIONAL_CREATE:"terminal:professional:create",PROFESSIONAL_LIST:"terminal:professional:list",PROFESSIONAL_WRITE:"terminal:professional:write",PROFESSIONAL_RESIZE:"terminal:professional:resize",PROFESSIONAL_INFO:"terminal:professional:info",PROFESSIONAL_REFRESH:"terminal:professional:refresh",PROFESSIONAL_DISPOSE:"terminal:professional:dispose",PROFESSIONAL_GET_BUFFER:"terminal:professional:get-buffer"},GIT:{STATUS:"git:status",STATUS_CHANGED:"git:status-changed",AUTH_REQUIRED:"git:auth-required",KEYCHAIN_ACCESS_WARNING:"git:keychain-access-warning",KEYCHAIN_CONSENT_RESPOND:"git:keychain-consent-respond",CHECK_KEYCHAIN_RISK:"git:check-keychain-risk",DIFF:"git:diff",NUMSTAT:"git:numstat",COMMIT:"git:commit",COMMIT_DETAILS:"git:commit-details",PUSH:"git:push",PULL:"git:pull",BRANCH:"git:branch",CHECKOUT:"git:checkout",LOG:"git:log",HISTORY:"git:history",GET_BRANCHES:"git:getBranches",STAGE:"git:stage",UNSTAGE:"git:unstage",STAGE_HUNK:"git:stage-hunk",UNSTAGE_HUNK:"git:unstage-hunk",DISCARD:"git:discard",REMOVE_LOCK:"git:removeLock",SHOW_FILE:"git:show-file",FILE_HISTORY:"git:file-history",RENAME_BRANCH:"git:rename-branch",PULL_BRANCH:"git:pullBranch",GET_BRANCH_STATUS:"git:getBranchStatus",GET_REMOTES:"git:getRemotes",FETCH:"git:fetch"},CONFIG:{GET:"config:get",SET:"config:set",DELETE:"config:delete",GET_ALL:"config:get-all",RESET:"config:reset"},SETTINGS:{GET:"settings:get",SET:"settings:set",GET_ALL:"settings:getAll",UPDATE:"settings:update"},FEATURE_CODES:{ACTIVATE:"feature-codes:activate",GET_ACTIVE:"feature-codes:get-active",DEACTIVATE:"feature-codes:deactivate",RESTART_APP:"feature-codes:restart-app"},USER_MCP:{AUTHENTICATE:"user-mcp:authenticate",CHECK_AUTH:"user-mcp:check-auth",TEST_CONNECTION:"user-mcp:test-connection"},NOTIFICATION:{TEST:"notification:test",REQUEST_PERMISSION:"notification:requestPermission",SHOW:"notification:show"},DIALOG:{MESSAGE:"dialog:message",OPEN:"dialog:open"},VOICE:{LOCAL_AVAILABLE:"voice:local-available",TRANSCRIBE_LOCAL:"voice:transcribe-local",REQUEST_LOCAL_AUTHORIZATION:"voice:request-local-authorization"},SHELL:{OPEN:"shell:open",OPEN_PATH:"shell:openPath",OPEN_EXTERNAL:"shell:openExternal",TRASH_ITEM:"shell:trashItem",SHOW_ITEM_IN_FOLDER:"shell:showItemInFolder"},EDITOR:{GET_SELECTION:"editor:get-selection"},EXTERNAL_EDITORS:{DETECT_INSTALLED:"external-editors:detect-installed",OPEN:"external-editors:open",OPEN_WITH_OTHER:"external-editors:open-with-other"},FIRST_VISIT:{LOAD:"first-visit-state:load",SAVE:"first-visit-state:save",DELETE:"first-visit-state:delete",EXISTS:"first-visit-state:exists"},PANEL_LAYOUT:{LOAD:"panel-layout:load",SAVE:"panel-layout:save"},BROWSER:{REGISTER_TAB:"browser:register-tab",UNREGISTER_TAB:"browser:unregister-tab",REPORT_TAB_BOUNDS:"browser:report-tab-bounds",SET_TAB_VIEWPORT:"browser:set-tab-viewport",OPEN_DEVTOOLS_PANEL:"browser:open-devtools-panel",EXEC:"browser:exec",RESOLVE_URL:"browser:resolve-url",FOCUS_TAB:"browser:focus-tab",SHOW_TAB:"browser:show-tab",LIST_TABS_REQUEST:"browser:list-tabs-request",HOST_WORKSPACE:"browser:host-workspace",CAPTURE_DRAWING:"browser:capture-drawing",AGENT_DRAWING:"browser:agent-drawing",BACKGROUND_HOSTED_WORKSPACES:"browser:background-hosted-workspaces",LIST_TABS_RESPONSE:"browser:list-tabs-response",OPEN_TAB:"browser:open-tab",DIAGNOSE_TAB:"browser:diagnose-tab",CLOSE_TAB:"browser:close-tab",TAB_NAVIGATED:"browser:tab-navigated",TAB_OWNER_CHANGED:"browser:tab-owner-changed",CLEAR_AGENT_TABS:"browser:clear-agent-tabs"},FILE_TRACKING:{AGENT_FILE_CHANGED:"file-tracking:agent-file-changed"},STREAMING:{START:"streaming:start",STOP:"streaming:stop",PAUSE:"streaming:pause",RESUME:"streaming:resume",GET_STATS:"streaming:get-stats"},AGENT_CONFIG:{GET:"agent-config:get",UPDATE:"agent-config:update",RESET:"agent-config:reset"},LOG:{TRACK_FILE_CHANGE:"log:track-file-change",TRACK_AGENT_EVENT:"log:track-agent-event",TRACK_MCP_CALL:"log:track-mcp-call",PATHS:"log:paths",READ:"log:read",CLEAR:"log:clear",SUMMARY:"log:summary",EXPORT_DEBUG_BUNDLE:"log:export-debug-bundle",PERSIST_RENDERER_LOGS:"log:persist-renderer-logs"},USER_RULES:{GET:"user-rules:get",SET:"user-rules:set",DELETE:"user-rules:delete",GET_ALL:"user-rules:get-all",GET_FORMATTED:"user-rules:get-formatted",SET_ENABLED:"user-rules:set-enabled",EXPORT:"user-rules:export",IMPORT:"user-rules:import",GET_COMBINED_PROMPT:"user-rules:get-combined-prompt",UPDATE:"user-rules:update",GET_BY_TYPE:"user-rules:get-by-type",GET_FORMATTED_BY_TYPE:"user-rules:get-formatted-by-type",UPDATE_BY_TYPE:"user-rules:update-by-type",SET_ENABLED_BY_TYPE:"user-rules:set-enabled-by-type",DELETE_BY_TYPE:"user-rules:delete-by-type",EXPORT_BY_TYPE:"user-rules:export-by-type"},VSCODE:{OPEN:"vscode:open",OPEN_FILE:"vscode:openFile",OPEN_DIFF:"vscode:open-diff",OPEN_GIT_DIFF:"vscode:open-git-diff"},JETBRAINS:{OPEN:"jetbrains:open"},XCODE:{OPEN:"xcode:open"},DEEP_LINK:{HANDLE:"deep-link:handle",CONSUME_PENDING:"deep-link:consume-pending"},LEGACY:{GET_HOME_DIRECTORY:"get_home_directory"},RULES:{LIST:"rules:list",LOAD_WORKSPACE:"rules:load-workspace",GET_CONTEXT:"rules:get-context"},CONFIG_RULES:{GET_ALL:"config:getAll"},USER_ACTIVITY:{MARK_NOTE_READ:"user-activity:mark-note-read",GET_NOTE_READ_STATUS:"user-activity:get-note-read-status",GET_UNREAD_NOTE_IDS:"user-activity:get-unread-note-ids"},GIT_TRACKING:{GET_STATE:"git-tracking:get-state",GET_SYNC_STATUS:"git-tracking:get-sync-status",SYNC:"git-tracking:sync",GET_FILE_DIFF:"git-tracking:get-file-diff",IS_GITHUB_AUTHENTICATED:"git-tracking:is-github-authenticated",GET_GITHUB_BRANCHES:"git-tracking:get-github-branches",GET_PULL_REQUESTS:"git-tracking:get-pull-requests",SEARCH_PULL_REQUESTS:"git-tracking:search-pull-requests",GET_PULL_REQUEST:"git-tracking:get-pull-request",CREATE_PULL_REQUEST:"git-tracking:create-pull-request",GET_GITHUB_ISSUES:"git-tracking:get-github-issues",SEARCH_GITHUB_ISSUES:"git-tracking:search-github-issues",LIST_RELATED_REPOS:"git-tracking:list-related-repos",GET_REMOTE_URL:"git-tracking:get-remote-url",GET_CHECK_RUNS:"git-tracking:get-check-runs",GET_PR_REVIEWS:"git-tracking:get-pr-reviews"},GITHUB_AUTH:{IS_AUTHENTICATED:"github-auth:is-authenticated",GET_USER:"github-auth:get-user",START_AUTH:"github-auth:start",POLL_FOR_TOKEN:"github-auth:poll",CANCEL_AUTH:"github-auth:cancel",LOGOUT:"github-auth:logout",GET_AUTH_STATE:"github-auth:get-auth-state",GET_STATUS:"github-auth:get-status",LIST_REPOS:"github-auth:list-repos",SEARCH_REPOS:"github-auth:search-repos",SEARCH_USERS:"github-auth:search-users"},FORGE_AUTH:{GET_STATUS:"forge-auth:get-status",CONNECT:"forge-auth:connect",CANCEL_AUTH:"forge-auth:cancel",REVOKE:"forge-auth:revoke",GET_USER:"forge-auth:get-user"},LINEAR_AUTH:{IS_AUTHENTICATED:"linear-auth:is-authenticated",START_AUTH:"linear-auth:start-auth",CANCEL_AUTH:"linear-auth:cancel-auth",LOGOUT:"linear-auth:logout",GET_AUTH_STATE:"linear-auth:get-auth-state",GET_STATUS:"linear-auth:get-status",FETCH_MY_ISSUES:"linear-auth:fetch-my-issues",SEARCH_ISSUES:"linear-auth:search-issues"},SENTRY_AUTH:{IS_AUTHENTICATED:"sentry-auth:is-authenticated",SAVE_CONFIG:"sentry-auth:save-config",GET_AUTH_STATE:"sentry-auth:get-auth-state",LOGOUT:"sentry-auth:logout",FETCH_PROJECTS:"sentry-auth:fetch-projects",FETCH_ISSUES:"sentry-auth:fetch-issues",SEARCH_ISSUES:"sentry-auth:search-issues",GET_ISSUE:"sentry-auth:get-issue"},OBSERVABILITY_EXT:{},AGENT_TESTING:{RUN:"agent-testing:run",GET_REPORT:"agent-testing:get-report",GET_AGENT_REPORTS:"agent-testing:get-agent-reports",CLEANUP:"agent-testing:cleanup"},DEBUG:{TRIGGER_BACKEND_RESUME:"debug:trigger-backend-resume",LIST_AGENTS:"debug:list-agents"},SETUP_SCRIPTS:{GENERATE:"setup-scripts:generate",READ_REPO_CONFIG:"setup-scripts:read-repo-config",DETECT_TYPE:"setup-scripts:detect-type",GENERATE_WITH_AGENT:"setup-scripts:generate-with-agent",STOP_AGENT:"setup-scripts:stop-agent",STREAM_CHUNK:"setup-scripts:stream-chunk",STREAM_COMPLETE:"setup-scripts:stream-complete",STREAM_ERROR:"setup-scripts:stream-error"},GIT_EXT:{IS_REPOSITORY:"git:isRepository",GET_AUTO_COMMIT_STATUS:"git:get-auto-commit-status",GET_BACKGROUND_OPS_STATUS:"git:background-ops-status"},ACCEPT_CHANGES:{CHECK_PATH_HAS_CHANGES:"accept-changes:check-path-has-changes"},CHAT_EXPORT:{CHAT_TO_HTML:"export:chat-to-html"},FILE_EXT:{},COMMENTS_EXT:{},WORKSPACE_EXT:{},AGENT_LAUNCH:{},AGENT_CONTEXT:{GET:"agent-context:get"},RECOVERY:{NEEDS_RECOVERY:"recovery:needs-recovery",MARK_STREAMING:"recovery:mark-streaming",MARK_COMPLETE:"recovery:mark-complete",CLEAR_STREAMING:"recovery:clear-streaming",CHECK_NEEDS_RECOVERY:"recovery:check-needs-recovery",GET_STATUS:"recovery:get-status",CREATE_CHECKPOINT:"recovery:create-checkpoint",RESTORE_CHECKPOINT:"recovery:restore-checkpoint",RECOVER_SESSION:"recovery:recover-session",GET_STATS:"recovery:get-stats"},STORAGE:{SAVE:"storage:save",DELETE:"storage:delete"},AUTO_UPDATE:{CHECK_MANUAL:"auto-update:check-manual",DOWNLOAD:"auto-update:download",INSTALL:"auto-update:install",GET_STATE:"auto-update:get-state",SET_CHANNEL:"auto-update:set-channel",SET_SHARE_STATISTICS:"auto-update:set-share-statistics",STATUS_CHANGED:"auto-update:status-changed",PROGRESS:"auto-update:progress",ERROR:"auto-update:error",UP_TO_DATE:"auto-update:up-to-date",SHOW_TOAST:"auto-update:show-toast"},RELEASE_NOTES:{GET:"release-notes:get",GET_PENDING:"release-notes:get-pending",DISMISS:"release-notes:dismiss",SHOW:"release-notes:show",CLOSE:"release-notes:close"},PIP:{OPEN:"pip:open",CLOSE:"pip:close",CLOSE_ALL_FOR_WORKSPACE:"pip:close-all-for-workspace"},BROWSER_ACCESS:{GET_STATE:"browser-access:get-state",SET_ENABLED:"browser-access:set-enabled",SET_PORT:"browser-access:set-port",RESET_KEY:"browser-access:reset-key",CREATE_SIGN_IN_CODE:"browser-access:create-sign-in-code"},WEBSOCKET_API:{GET_STATUS:"websocket-api:get-status",SET_ENABLED:"websocket-api:set-enabled",REGENERATE_TOKEN:"websocket-api:regenerate-token",SET_DISCOVERY:"websocket-api:set-discovery"},TOKEN_USAGE:{GET:"token-usage:get",CHANGED:"token-usage:changed"},BACKEND:{DESKTOP_PERMISSIONS:"backend:desktop-permissions",DESKTOP_OS_PERMISSIONS:"backend:desktop-os-permissions",REQUEST:"backend:request",PR_MONITOR:{READY:"backend:pr-monitor:ready",CAPTURE:"backend:pr-monitor:capture",REQUEST:"backend:pr-monitor:request",RELEASE:"backend:pr-monitor:release",RETIRED:"backend:pr-monitor:retired",NOTIFICATION:"backend:pr-monitor:notification"},NATIVE_REVIEW:{PREPARE:"backend:native-review:prepare",EXECUTE:"backend:native-review:execute",RECONCILE:"backend:native-review:reconcile",RELEASE:"backend:native-review:release",RETIRED:"backend:native-review:retired"},REPOSITORY_SELECTION:{CAPTURE:"backend:repository-selection:capture",CONFIRM:"backend:repository-selection:confirm",RECONCILE:"backend:repository-selection:reconcile",RELEASE:"backend:repository-selection:release",RETIRED:"backend:repository-selection:retired"},REPOSITORY_CHECKOUT:{CAPTURE:"backend:repository-checkout:capture",REQUEST:"backend:repository-checkout:request",RELEASE:"backend:repository-checkout:release",RETIRED:"backend:repository-checkout:retired"},REPOSITORY_RESOURCE:{CAPTURE:"backend:repository-resource:capture",DETAIL:"backend:repository-resource:detail",RELEASE:"backend:repository-resource:release",RETIRED:"backend:repository-resource:retired"},REPOSITORY:{CAPTURE:"backend:repository:capture",RETIRED:"backend:repository:retired",REQUEST:"backend:repository:request",RELEASE:"backend:repository:release"},SUBSCRIBE:"backend:subscribe",UNSUBSCRIBE:"backend:unsubscribe",GET_STATUS:"backend:get-status",NODE_CAPABILITIES:"backend:node-capabilities",READ_PRINCIPAL:"backend:read-principal",NOTIFICATION:"backend:notification",STATUS:"backend:status",SPAWN_SIDECAR:"backend:spawn-sidecar",OPEN_LOCAL_AND_SPAWN:"backend:open-local-and-spawn",GET_SIDECAR_RUN_LOG:"backend:get-sidecar-run-log",RESTART_ORPHANED_SIDECAR:"backend:restart-orphaned-sidecar"},CONNECTIONS:{LIST:"connections:list",CAPTURE_FINGERPRINT:"connections:capture-fingerprint",ADD:"connections:add",UPDATE:"connections:update",TEST:"connections:test",ROTATE_SECRET:"connections:rotate-secret",GET_TUNNEL:"connections:get-tunnel",SET_TUNNEL:"connections:set-tunnel",OPEN:"connections:open",FORGET:"connections:forget",PAIR_LINK_INSPECT:"connections:pair-link-inspect",PAIR_LINK_COMMIT:"connections:pair-link-commit",PAIR_LINK_DISCARD:"connections:pair-link-discard",UPDATE_BACKEND:"connections:update-backend",CHANGED:"connections:changed",CERT_MISMATCH:"connections:cert-mismatch",CERT_WARNINGS:"connections:cert-warnings",PROTOCOL_MISMATCH:"connections:protocol-mismatch",AUTH_REJECTED:"connections:auth-rejected",SYNC_GET_STATE:"connections:sync-get-state",SYNC_SET_ENABLED:"connections:sync-set-enabled",SYNC_STATUS_CHANGED:"connections:sync-status-changed",PUBLISH_SELF:"connections:publish-self",SELF_PUBLISHED_STATE:"connections:self-published-state",REFRESH_SELF:"connections:refresh-self",UNPUBLISH_SELF:"connections:unpublish-self"},GUEST_SESSIONS:{LIST:"guest-sessions:list",LEAVE:"guest-sessions:leave",LEAVE_WORKSPACE:"guest-sessions:leave-workspace",CHANGED:"guest-sessions:changed"},MACHINE_RAIL:{GET_STATE:"machine-rail:get-state",SELECT:"machine-rail:select",ADD:"machine-rail:add",REMOVE:"machine-rail:remove",REORDER:"machine-rail:reorder",SET_ENABLED:"machine-rail:set-enabled",CHANGED:"machine-rail:changed",FORWARD_TOAST:"machine-rail:forward-toast",TOAST:"machine-rail:toast",SHOWN:"machine-rail:shown",READY:"machine-rail:ready",HEALTH:"machine-rail:health"},PRESENCE:{REPORT:"presence:report"},TRANSFER:{START:"transfer:start",FINALIZE:"transfer:finalize",CANCEL:"transfer:cancel",PROGRESS:"transfer:progress",IMPORT_START:"transfer:import-start",IMPORT_CANCEL:"transfer:import-cancel",IMPORT_PROGRESS:"transfer:import-progress"},REMOTE_MACHINES:{EXPOSE:"remote-machines:expose",UNEXPOSE:"remote-machines:unexpose",MACHINE_FINGERPRINT:"remote-machines:machine-fingerprint",INVITE_INSPECT:"remote-machines:invite-inspect",INVITE_CLAIM:"remote-machines:invite-claim",INVITE_DISCARD:"remote-machines:invite-discard"},MACHINE_SETUP:{SSH_DEFAULTS:"machine-setup:ssh-defaults",SSH_START:"machine-setup:ssh-start",SSH_TRUST:"machine-setup:ssh-trust",SSH_CANCEL:"machine-setup:ssh-cancel",SSH_EVENT:"machine-setup:ssh-event"},HARDWARE_CONSOLE:{CLEAR_LIGHTING:"hardware-console:clear-lighting",CLEAR_LIGHTING_DONE:"hardware-console:clear-lighting-done",GET_OWNER_STATUS:"hardware-console:get-owner-status",OWNER_CHANGED:"hardware-console:owner-changed"}},g={"global.command-palette":"mod+shift+p","global.settings":"mod+,","global.keyboard-shortcuts":"mod+?","global.command-palette-alt":"mod+k","global.toggle-spaces":"mod+o","global.new-space":"mod+n","global.search":"mod+f","global.next-space":"ctrl+tab","global.previous-space":"ctrl+shift+tab","global.next-space-alt":"mod+shift+]","global.previous-space-alt":"mod+shift+[","navigation.go-to-tab":"mod+1-9","navigation.new-tab":"mod+t","navigation.close-tab":"mod+w","navigation.close-space-tab":"mod+shift+w","navigation.reopen-tab":"mod+shift+t","navigation.move-space-tab-left":"mod+alt+shift+left","navigation.move-space-tab-right":"mod+alt+shift+right","workspace.new-agent":"mod+alt+a","workspace.new-note":"mod+alt+n","workspace.new-terminal":"mod+alt+t","workspace.new-browser":"mod+alt+b","workspace.set-aside":"mod+shift+s","chat.send":"enter","chat.force-send":"mod+enter","chat.new-line":"shift+enter","chat.focus-input":"/","chat.mention-context":"@","editor.go-to-line":"mod+g","editor.save":"mod+s","editor.undo":"mod+z","editor.redo":"mod+shift+z","editor.toggle-task-list":"mod+shift+9","editor.toggle-word-wrap":"alt+z","editor.copy":"mod+c","editor.select-all":"mod+a","panel.toggle-sidebar":"mod+b","panel.create-column-right":"mod+\\","panel.focus-next-column":"mod+alt+right","panel.maximize":"mod+shift+m","panel.focus-previous-column":"mod+alt+left","panel.next-pane":"mod+]","panel.previous-pane":"mod+[","panel.move-pane-next-column":"mod+alt+pagedown","panel.move-pane-previous-column":"mod+alt+pageup","panel.copy-browser-url":"mod+shift+c","leader.navigate-panels":"h/j/k/l","leader.resize-panels":"H/J/K/L","leader.split-right":"%","leader.toggle-zoom":"z","leader.close-panel":"x","leader.next-previous-panel":"o/p","leader.equalize-sizes":"=","leader.jump-to-panel":"q + 1-9","leader.cycle-layout":"space","dock.focus":"ctrl+shift+d","dock.capture":"ctrl+shift+s","dock.record":"ctrl+shift+r"},L=["mod","ctrl","alt","shift"],D={mod:"mod",cmd:"mod",command:"mod",meta:"mod",control:"ctrl",ctrl:"ctrl",option:"alt",alt:"alt",shift:"shift"},M={escape:"esc",return:"enter",arrowup:"up",arrowdown:"down",arrowleft:"left",arrowright:"right",pgup:"pageup",pgdn:"pagedown"," ":"space"},Ee=new Set(["backspace","delete","down","end","enter","esc","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","home","left","pagedown","pageup","right","space","tab","up"]),Te=new Set(["alt","control","meta","shift"]),v={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=","{":"[","}":"]","|":"\\",":":";",'"':"'","<":",",">":".","?":"/"},le=Object.fromEntries(Object.entries(v).map(([e,t])=>[t,e]));function Ue(e,t){if(Te.has(e.key.toLowerCase())||!t&&e.metaKey)return null;let a=e.key;e.altKey&&e.code?.startsWith("Key")?a=e.code.slice(3):e.altKey&&e.code?.startsWith("Digit")&&(a=e.code.slice(5));const o=[];return(t&&e.metaKey||!t&&e.ctrlKey)&&o.push("mod"),t&&e.ctrlKey&&o.push("ctrl"),e.altKey&&o.push("alt"),e.shiftKey&&o.push("shift"),o.push(a),w(o.join("+"))}function de(e){return Object.prototype.hasOwnProperty.call(g,e)}function m(e){const t=e.trim();if(!t||t.includes("/"))return null;const a=t.split("+").map(r=>r.trim()).filter(Boolean);if(a.length===0)return null;const o=new Set;for(const r of a.slice(0,-1)){const E=D[r.toLowerCase()];if(!E||o.has(E))return null;o.add(E)}const s=a.at(-1)??"";if(D[s.toLowerCase()])return null;const n=M[s.toLowerCase()]??s.toLowerCase();return n.length===1||Ee.has(n)?{key:n,mod:o.has("mod"),ctrl:o.has("ctrl"),alt:o.has("alt"),shift:o.has("shift")}:null}function w(e){const t=e.trim();if(t.includes("/")){const r=t.split("/").map(d=>d.trim()),E=r[0]??"",l=E.includes("+")?`${E.slice(0,E.lastIndexOf("+"))}+`:"",p=r.map((d,I)=>{const _=I>0&&l&&!d.includes("+")?l+d:d,C=_.slice(_.lastIndexOf("+")+1),h=m(/^[A-Z]$/.test(C)?`${_.slice(0,-1)}shift+${C.toLowerCase()}`:_);return h?[...L.filter(j=>h[j]),h.key].join("+"):null});return p.some(d=>!d)?null:p.join("/")}const a=t.match(/^(.*\+)?([1-8])-9$/i);if(a){const r=m(`${a[1]??""}${a[2]}`);if(!r)return null;const E=L.filter(l=>r[l]);return`${E.length?`${E.join("+")}+`:""}${a[2]}-9`}const o=t.match(/^(.+?)\s+\+\s+([1-8]-9)$/);if(o){const r=w(o[1]);return r?`${r} + ${o[2]}`:null}const s=m(e);return s?[...L.filter(r=>s[r]),s.key].join("+"):null}function be(e,t){const a=g[e],o=t.includes("+")?`${t.slice(0,t.lastIndexOf("+"))}+`:"",s=a.match(/^(.+?)\s+\+\s+([1-8]-9)$/);if(s)return`${t} + ${s[2]}`;const n=a.match(/^(?:.*\+)?([1-8]-9)$/);return n?`${o}${n[1]}`:a.includes("/")?`${o}${a}`:t}function He(e){return e.match(/^(.+?)\s+\+\s+[1-8]-9$/)?.[1]??null}function Se(e){const t=e.match(/^(.*\+)?([1-8])-9$/);if(t){const n=t[1]??"";return Array.from({length:10-Number(t[2])},(r,E)=>`${n}${Number(t[2])+E}`)}const a=e.split("/"),o=a[0]??"",s=o.includes("+")?`${o.slice(0,o.lastIndexOf("+"))}+`:"";return a.map((n,r)=>{const E=n.trim(),l=r>0&&s&&!E.includes("+")?s+E:E;return/^[A-Z]$/.test(l)?`shift+${l.toLowerCase()}`:l==="space"?"space":l})}function ue(e,t,a){return Se(t).findIndex(o=>_e(e,o,a))}function _e(e,t,a){const o=m(t);if(!o)return!1;const s=M[e.key.toLowerCase()]??e.key.toLowerCase(),n=o.key.length===1&&'~!@#$%^&*()_+{}|:"<>?'.includes(o.key);return new Set([s,v[s],e.shiftKey?le[s]:void 0]).has(o.key)&&e.metaKey===(o.mod&&a)&&e.ctrlKey===(o.ctrl||o.mod&&!a)&&e.altKey===o.alt&&e.shiftKey===(o.shift||n)}function ye(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[a,o]of Object.entries(e)){if(!de(a)||typeof o!="string")continue;const s=w(o);s&&s!==g[a]&&(t[a]=s)}return t}function Ke(e,t){return t[e]??g[e]}function Me(e,t,a,o){return a(e)!==g[e]?!1:Object.keys(g).some(s=>{if(s===e||s.startsWith("leader."))return!1;const n=a(s);return n===g[s]?!1:ue(t,n,o)>=0})}function R(e){if(/[\u0000-\u0020\u007f\\]/.test(e))return null;const t=/^https:\/\/([^/?#]+)([^?#]*)/i.exec(e);if(!t||/[@%]/.test(t[1]))return null;try{const a=new URL(e);if(a.protocol!=="https:"||a.username||a.password)return null;const o=t[2].replace(/\/$/,""),s=o?o.slice(1).split("/"):[];return s.some(n=>!/^[A-Za-z0-9_.-]+$/.test(n)||n==="."||n==="..")?null:{url:a,path:s}}catch{return null}}function G(e){const t=R(e);return!!t&&!t.url.search&&!t.url.hash&&e===t.url.origin+(t.path.length?`/${t.path.join("/")}`:"")}function ve(e,t){if(!G(t))return null;const a=R(e),o=R(t);if(!a||!o||o.url.origin!==a.url.origin||!o.path.every((n,r)=>a.path[r]===n))return null;const s=a.path.slice(o.path.length);return s.length<2||s[0]==="groups"||s.includes("-")?null:{provider:"gitlab",instanceBaseUrl:t,projectPath:s.join("/")}}function ge(e,t){const a=R(e);if(!a)return null;let o=null;for(const s of t){if(s.provider!=="gitlab"||!G(s.instanceBaseUrl))continue;const n=R(s.instanceBaseUrl);if(!n||n.url.origin!==a.url.origin||!n.path.every((C,h)=>a.path[h]===C))continue;const r=a.path.slice(n.path.length),E=r.indexOf("-");if(E<2||r[0]==="groups")continue;const[l,p,...d]=r.slice(E+1),I=l==="merge_requests"?"merge-request":l==="issues"?"issue":null;if(!I||!/^[1-9]\d*$/.test(p??"")||!Number.isSafeInteger(Number(p))||d.length&&(I!=="merge-request"||d.length!==1||!["diffs","commits","pipelines"].includes(d[0])))continue;const _={repository:{provider:"gitlab",instanceBaseUrl:s.instanceBaseUrl,projectPath:r.slice(0,E).join("/")},kind:I,number:Number(p)};if(o&&JSON.stringify(o)!==JSON.stringify(_))return null;o=_}return o}function We(e){const t=R(e);return t?ge(e,[{provider:"gitlab",instanceBaseUrl:t.url.origin}])!==null:!1}const W="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",F="([01]\\d|2[0-3]):[0-5]\\d(:[0-5]\\d(\\.\\d+)?)?",pe=new RegExp(`^${W}T${F}(Z)$`),Ae=new RegExp(`^${W}T${F}(Z|([+-]\\d{2}:?\\d{2}))$`);function P(e={}){return i().regex(e.offset?Ae:pe,e.message??"Invalid datetime")}function B(e="Invalid url"){return i().refine(t=>URL.canParse(t),e)}const U=i().regex(/^(0|[1-9][0-9]*)$/).refine(e=>/^(0|[1-9][0-9]*)$/.test(e)&&BigInt(e)<=18446744073709551615n),Fe=c({target:T(["local","remote"]),checkout:T(["shared","worktree","isolated"]),os:T(["linux","macos"]).optional(),nodeId:i().min(1).optional(),exclusive:u().optional()}).strict().refine(e=>e.target!=="remote"||e.checkout==="isolated").refine(e=>!e.exclusive||e.target==="remote"&&e.checkout==="isolated");function b(e){return e==="e2b"||e==="cloud"}const x=c({target:T(["local","remote","e2b","cloud"]).optional(),checkout:T(["shared","worktree","isolated"]).optional(),os:T(["linux","macos"]).optional(),arch:T(["x86_64","aarch64"]).optional(),nodeId:i().min(1).refine(e=>new TextEncoder().encode(e).length<=128).optional(),exclusive:u().optional(),cloudMachineId:i().min(1).refine(e=>new TextEncoder().encode(e).length<=64).optional()}).strict(),Be=x.refine(e=>e.target!=="remote"||(e.checkout??"isolated")==="isolated").refine(e=>e.cloudMachineId===void 0||b(e.target)).refine(e=>!b(e.target)||(e.checkout??"isolated")==="isolated"&&!e.os&&!e.arch&&!e.nodeId&&!e.exclusive).refine(e=>!e.exclusive||e.target!=="local"&&(e.checkout??"isolated")==="isolated"),Re=x.extend({target:T(["local","remote","e2b","cloud"]),checkout:T(["shared","worktree","isolated"])}).refine(e=>e.target!=="remote"||e.checkout==="isolated").refine(e=>!e.exclusive||e.target!=="local"&&e.checkout==="isolated"),Oe=c({id:i().min(1),assignmentEpoch:U,captureRevision:U,capturedAt:P({offset:!0}),committedAt:P({offset:!0})}),Ie=c({state:T(["pending","running","completed","failed","skipped"]),exitCode:k().int().optional(),error:i().optional(),startedAt:i().optional(),finishedAt:i().optional(),output:i().optional(),outputTruncated:u().optional()}),xe=c({nodeId:i().min(1).optional(),leaseId:i().min(1).optional(),nodeName:i().min(1).optional(),placement:Re.optional(),effectiveIsolation:T(["pending","isolated","shared","worktree","direct","cow"]).optional(),nodeState:T(["ready","offline","incompatible","removed"]).optional(),checkpoint:Oe.optional(),placementError:c({code:i(),detail:i()}).optional(),cloudStart:c({step:i().min(1)}).passthrough().optional().catch(void 0),setup:Ie.optional().catch(void 0),nodePath:i().optional()}),S=i().min(1),A=B().refine(e=>{const t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}),V=A.refine(e=>G(e)),Y=k().int().nonnegative().max(Number.MAX_SAFE_INTEGER),O=i().max(1024).regex(/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)+$/).refine(e=>e.split("/").every(t=>t!=="."&&t!=="..")),f=i().regex(/^[0-9a-fA-F]{40}$/),$=c({checkoutId:S,revision:S}).strict(),Ve=c({provider:N("gitlab"),instanceBaseUrl:V.optional()}).strict(),Ye=$.extend({provider:N("gitlab"),instanceBaseUrl:V,expiresAfterMs:Y}).strict(),X=c({projectPath:O,name:i(),namespace:i(),webUrl:A,cloneUrl:A,defaultBranch:S.optional(),ownerAvatarUrl:B().pipe(A).optional().catch(void 0)}).strict(),he=c({name:S,commitSha:f,protected:u().optional()}).strict(),Ne=c({query:i().trim().refine(e=>new TextEncoder().encode(e).length<=256&&!/[\u0000-\u001f\u007f]/.test(e)).optional(),cursor:S.optional(),limit:k().int().positive().max(100).optional()}).strict(),$e=te([c({projectPath:O}).strict(),c({url:A}).strict()]),Xe=Ne.extend({projectPath:O,cached:u().optional()}).strict(),Ce=$.extend({projectPath:O,branch:S,commitSha:f,mode:T(["direct","cached"])}).strict(),qe=Ce.omit({mode:!0}).strict(),je=c({projectPath:O,branch:S,commitSha:f,config:oe(i(),H()).nullable(),exists:u()}).strict().refine(e=>e.exists===(e.config!==null)),ze=c({items:y(X),nextCursor:S.optional()}).strict(),Qe=c({project:X,contextUrl:A.optional()}).strict(),Ze=c({items:y(he),nextCursor:S.optional(),defaultBranch:S.optional(),cached:u()}).strict(),Je=c({projectPath:O,branch:S,commitSha:f,cached:u()}).strict(),q=c({status:N("unavailable"),reason:T(["disabled","not-connected","access-denied","rate-limited","unreachable","retired","not-found","invalid-target","empty-repository","branch-changed"]),retryAfterMs:Y.optional()}).strict();function et(e){return ae("status",[c({status:N("ready"),value:e}).strict(),q])}function tt(e,t){if(c({status:T(["ready","unavailable"])}).passthrough().parse(t).status==="unavailable")return q.parse(t);const o=c({status:N("ready"),value:H()}).strict().parse(t);return{status:"ready",value:e.parse(o.value)}}export{Oe as A,Me as B,Xe as C,We as D,de as E,P as F,we as G,_e as H,Pe as I,ue as J,w as K,tt as L,ve as M,ge as N,Ke as O,ye as P,Ue as Q,g as S,xe as a,Be as b,Fe as c,Ze as d,Ve as e,Ye as f,Ne as g,Qe as h,$e as i,X as j,ze as k,qe as l,je as m,Ce as n,Je as o,be as p,ie as q,et as r,re as s,Se as t,K as u,He as v,De as w,G as x,b as y,Ge as z};
1
+ import{aR as z,aP as Q,b4 as Z,a0 as J}from"./DYhIMPy1.js";import{B as ee}from"./CNdlzZOD.js";import{s as i,o as c,c as u,_ as T,n as k,l as N,u as te,r as oe,e as H,b as y,d as ae}from"./CIyUrgF0.js";const se=Symbol("NaN");function we(e,t,a){z&&Q();var o=new ee(e),s=!Z();J(()=>{var n=t();n!==n&&(n=se),s&&n!==null&&typeof n=="object"&&(n={}),o.ensure(n,a)})}const ne="0.0.0-browser";function re(e){const t=e?.electronAPI;return!t||t.versions?.electron===ne?"web":"electron"}function K(){return typeof window>"u"?"web":re(window)}function Ge(){return K()==="electron"}function ie(e){const t=e==="electron";return{windowChrome:t,nativeDialogs:t,shellIntegration:t,externalEditors:t,browserPanel:t,autoUpdate:t,deeplinks:t,nativeNotifications:t,ssh:t}}function ce(){return ie(K())}function De(e){return ce()[e]}const Pe={DEV_CONSOLE:{OPEN:"dev-console:open",CONNECT:"dev-console:connect",READ:"dev-console:read",RECORD:"dev-console:record",CLEAR:"dev-console:clear",SELECT:"dev-console:select",LINKS_STATUS:"dev-console:links-status",LINKS_START:"dev-console:links-start",LINKS_STOP:"dev-console:links-stop",LINKS_READ:"dev-console:links-read",LINKS_RECORD:"dev-console:links-record"},WORKSPACE:{LIST:"workspace:list",CREATE:"workspace:create",GET:"workspace:get",GET_CURRENT:"workspace:get-current",GET_BY_ID:"workspace:get-by-id",GET_ROOT:"workspace:get-root",OPEN:"workspace:open",CLOSE:"workspace:close",SAVE:"workspace:save",UPDATE:"workspace:update",DELETE:"workspace:delete",ACTIVATE:"workspace:activate",ARCHIVE:"workspace:archive",UNARCHIVE:"workspace:unarchive",CLEANUP:"workspace:cleanup",RENAME:"workspace:rename",EXPORT:"workspace:export",IMPORT:"workspace:import",GET_METADATA:"workspace:get-metadata",UPDATE_METADATA:"workspace:update-metadata",GET_RECENT:"workspace:get-recent",CLEAR_RECENT:"workspace:clear-recent",GET_STATS:"workspace:get-stats",VALIDATE:"workspace:validate",REPAIR:"workspace:repair",BACKUP:"workspace:backup",RESTORE:"workspace:restore",GET_SETTINGS:"workspace:get-settings",UPDATE_SETTINGS:"workspace:update-settings",TRIGGER_CHECK:"workspace:trigger-check",LIST_FILES:"workspace:list-files",TEST_WATCHER:"workspace:test-watcher",FIND_REPOSITORIES:"workspace:find-repositories",UPDATE_SPEC_WATCHER_TIMESTAMP:"workspace:update-spec-watcher-timestamp",UPDATE_CURRENT_CONTEXT:"workspace:update-current-context",SEARCH_IN_FILES:"workspace:search-in-files",GET_RECENT_REPOSITORIES:"workspace:get-recent-repositories",ADD_RECENT_REPOSITORY:"workspace:add-recent-repository",CLEAR_RECENT_REPOSITORIES:"workspace:clear-recent-repositories",REMOVE_RECENT_REPOSITORY:"workspace:remove-recent-repository",UPDATE_GIT_INFO:"workspace:update_git_info",GET_SETTINGS_ALT:"workspace:getSettings",UPDATE_SETTINGS_ALT:"workspace:updateSettings",LOAD_RULES:"workspace:load-rules",RENAME_BRANCH:"workspace:rename-branch",GET_HOVER_STATUS:"workspace:get-hover-status",GET_DIFF_SUMMARY:"workspace:get-diff-summary",GET_GIT_SUMMARY:"workspace:get-git-summary",GET_TASKS:"workspace:get-tasks"},AGENT:{LOAD_INITIAL_CONFIG:"agent:load-initial-config",AVAILABLE:"agent:available",RESUME:"agent:resume",CLEANUP:"agent:cleanup",GET_USER_RULES:"agent:get-user-rules",GET_SPECIALIZATION_RULES:"agent:get-specialization-rules",TRACK_STARTED:"agent:track-started",TRACK_COMPLETED:"agent:track-completed",TRACK_ERROR:"agent:track-error",CREATE:"agent:create",CIRCUIT_BREAKER_RESET:"agent:circuit-breaker:reset",SEND_MESSAGE:"agent:send-message",STOP:"agent:stop",SEND:"agent:send",GET_SESSION:"agent:get-session",LIST_SESSIONS:"agent:list-sessions",DELETE_SESSION:"agent:delete-session",RENAME:"agent:rename",SET_PRIORITY:"agent:set-priority",SUBSCRIBE_UPDATES:"agent:subscribe-updates",UNSUBSCRIBE_UPDATES:"agent:unsubscribe-updates",GET_SUGGESTIONS:"agent:get-suggestions",APPLY_SUGGESTION:"agent:apply-suggestion",GET_COMPLETIONS:"agent:get-completions",VALIDATE_INPUT:"agent:validate-input",FORMAT_OUTPUT:"agent:format-output",GET_SHORTCUTS:"agent:get-shortcuts",ADD_SHORTCUT:"agent:add-shortcut",REMOVE_SHORTCUT:"agent:remove-shortcut",EXECUTE_SHORTCUT:"agent:execute-shortcut",GET_PLUGINS:"agent:get-plugins",INSTALL_PLUGIN:"agent:install-plugin",UNINSTALL_PLUGIN:"agent:uninstall-plugin",ENABLE_PLUGIN:"agent:enable-plugin",DISABLE_PLUGIN:"agent:disable-plugin",GET_PLUGIN_SETTINGS:"agent:get-plugin-settings",UPDATE_PLUGIN_SETTINGS:"agent:update-plugin-settings",EXECUTE_PLUGIN_ACTION:"agent:execute-plugin-action",GET_WEBHOOKS:"agent:get-webhooks",ADD_WEBHOOK:"agent:add-webhook",REMOVE_WEBHOOK:"agent:remove-webhook",TEST_WEBHOOK:"agent:test-webhook",GET_INTEGRATIONS:"agent:get-integrations",CONNECT_INTEGRATION:"agent:connect-integration",DISCONNECT_INTEGRATION:"agent:disconnect-integration",SYNC_INTEGRATION:"agent:sync-integration",GET_INTEGRATION_STATUS:"agent:get-integration-status",GET_INTEGRATION_DATA:"agent:get-integration-data",UPDATE_INTEGRATION_SETTINGS:"agent:update-integration-settings",TEST_INTEGRATION:"agent:test-integration",GET_WORKFLOWS:"agent:get-workflows",CREATE_WORKFLOW:"agent:create-workflow",UPDATE_WORKFLOW:"agent:update-workflow",DELETE_WORKFLOW:"agent:delete-workflow",EXECUTE_WORKFLOW:"agent:execute-workflow",PAUSE_WORKFLOW:"agent:pause-workflow",RESUME_WORKFLOW:"agent:resume-workflow",CANCEL_WORKFLOW:"agent:cancel-workflow",GET_WORKFLOW_STATUS:"agent:get-workflow-status",GET_WORKFLOW_HISTORY:"agent:get-workflow-history",EXPORT_WORKFLOW:"agent:export-workflow",IMPORT_WORKFLOW:"agent:import-workflow",VALIDATE_WORKFLOW:"agent:validate-workflow",OPTIMIZE_WORKFLOW:"agent:optimize-workflow",GET_WORKFLOW_METRICS:"agent:get-workflow-metrics",GET_WORKFLOW_LOGS:"agent:get-workflow-logs",CLEAR_WORKFLOW_LOGS:"agent:clear-workflow-logs",SCHEDULE_WORKFLOW:"agent:schedule-workflow",UNSCHEDULE_WORKFLOW:"agent:unschedule-workflow",GET_SCHEDULED_WORKFLOWS:"agent:get-scheduled-workflows",GET_WORKFLOW_TRIGGERS:"agent:get-workflow-triggers",ADD_WORKFLOW_TRIGGER:"agent:add-workflow-trigger",REMOVE_WORKFLOW_TRIGGER:"agent:remove-workflow-trigger",TEST_WORKFLOW_TRIGGER:"agent:test-workflow-trigger",GET_WORKFLOW_VARIABLES:"agent:get-workflow-variables",SET_WORKFLOW_VARIABLES:"agent:set-workflow-variables",GET_WORKFLOW_DEPENDENCIES:"agent:get-workflow-dependencies",RESOLVE_WORKFLOW_DEPENDENCIES:"agent:resolve-workflow-dependencies",GET_WORKFLOW_PERMISSIONS:"agent:get-workflow-permissions",SET_WORKFLOW_PERMISSIONS:"agent:set-workflow-permissions",SHARE_WORKFLOW:"agent:share-workflow",UNSHARE_WORKFLOW:"agent:unshare-workflow",CLONE_WORKFLOW:"agent:clone-workflow",MERGE_WORKFLOWS:"agent:merge-workflows",DIFF_WORKFLOWS:"agent:diff-workflows",GET_WORKFLOW_VERSIONS:"agent:get-workflow-versions",RESTORE_WORKFLOW_VERSION:"agent:restore-workflow-version",TAG_WORKFLOW_VERSION:"agent:tag-workflow-version",GET_WORKFLOW_TAGS:"agent:get-workflow-tags",REMOVE_WORKFLOW_TAG:"agent:remove-workflow-tag",SET_MODEL:"agent:set-model"},EVENTS:{QUERY:"events:query",SUBSCRIBE:"events:subscribe",UNSUBSCRIBE:"events:unsubscribe",EMIT:"events:emit",GET_LAST_EVENT:"events:getLastEvent",GET_STATISTICS:"events:getStatistics",GET_AGENT_SUBSCRIPTIONS:"events:get-agent-subscriptions",UNSUBSCRIBE_AGENT:"events:unsubscribe-agent"},AUGGIE:{INSTALL:"auggie:install",AUTHENTICATE:"auggie:authenticate",GET_MODELS:"auggie:get-models",GET_CONFIG:"auggie:get-config",UPDATE_CONFIG:"auggie:update-config",GET_LATEST_SESSION:"auggie:get-latest-session",EXTRACT_FILE_CHANGES:"auggie:extract-file-changes",GET_PATH:"auggie:get-path",GET_USER_INFO:"auggie:get-user-info",UNINSTALL_MCP_CLAUDE_CODE:"auggie:uninstall-mcp-claude-code",UNINSTALL_MCP_CODEX:"auggie:uninstall-mcp-codex",UNINSTALL_MCP_OPENCODE:"auggie:uninstall-mcp-opencode",UNINSTALL_MCP_CORTEX:"auggie:uninstall-mcp-cortex",UNINSTALL_MCP_PI:"auggie:uninstall-mcp-pi",UNINSTALL_MCP_DROID:"auggie:uninstall-mcp-droid"},OPENCODE:{GET_MODELS:"opencode:get-models"},CLAUDE_CODE:{GET_MODELS:"claude-code:get-models"},CODEX:{GET_MODELS:"codex:get-models"},CORTEX:{GET_MODELS:"cortex:get-models"},PI:{GET_MODELS:"pi:get-models"},DROID:{GET_MODELS:"droid:get-models"},GROK:{GET_MODELS:"grok:get-models"},UNSLOTH:{GET_MODELS:"unsloth:get-models"},ANTIGRAVITY:{GET_MODELS:"antigravity:get-models"},PROVIDERS:{GET_AVAILABILITY:"providers:get-availability",PREPARE_ADAPTERS:"providers:prepare-adapters",GET_PATHS:"providers:get-paths",CHECK_SINGLE:"providers:check-single"},FILE:{READ:"file:read",READ_CHUNK:"file:read-chunk",HASH:"file:hash",WRITE:"file:write",DELETE:"file:delete",EXISTS:"file:exists",LIST:"file:list",COPY:"file:copy",MOVE:"file:move",GET_INFO:"file:get-info",READ_DIR_WITH_STATS:"file:readDirWithStats",GET_GITIGNORE_PATTERNS:"file:getGitignorePatterns",READ_BATCH:"file:read-batch",MKDIR:"file:mkdir",GET_GIT_STATUS:"file:getGitStatus",GET_TREE_WITH_SIZES:"file:getTreeWithSizes",GET_DIRECTORY_STATUS:"file:getDirectoryStatus",DOWNLOAD:"file:download",DOWNLOAD_ATTACHMENT:"file:download-attachment"},PRIMITIVES:{CODEBASE_SEARCH:"codebase:search",TERMINAL_RUN:"terminal:runCommand",TERMINAL_KILL:"terminal:killProcess",TERMINAL_SUBSCRIBE:"terminal:subscribeOutput",AGENT_RUN:"agent:runAction"},SYSTEM:{GET_INFO:"system:get-info",GET_RESOURCES:"system:get-resources",OPEN_EXTERNAL:"system:open-external",SHOW_ITEM_IN_FOLDER:"system:show-item-in-folder",WRITE_CLIPBOARD:"system:write-clipboard",BEEP:"system:beep",HOME_DIRECTORY:"system:home-directory",EXECUTE_COMMAND:"system:execute-command",EXECUTE_COMMAND_STREAMING:"system:execute-command-streaming",CHECK_GIT:"system:check-git",CHECK_NODE:"system:check-node",CHECK_GH:"system:check-gh",CHECK_RTK:"system:check-rtk",LIST_FONTS:"system:list-fonts"},APP:{SET_BADGE:"app:set-badge",SET_LANGUAGE_PREFERENCE:"app:set-language-preference",VERSION:"app:version",GET_VERSION:"app:get-version",NAME:"app:name",PATH:"app:path",ROOT:"app:root",UI_NAVIGATE:"app:ui:navigate",UI_HIGHLIGHT:"app:ui:highlight",HISTORY_NAVIGATE:"app:history-navigate"},QUIT_CONFIRMATION:{SHOW:"quit-confirmation:show",ACK:"quit-confirmation:ack",RESPONSE:"quit-confirmation:response",DISMISS:"quit-confirmation:dismiss"},COLLABORATION_AUTH:{POLICY:"collaboration-auth:policy",OPEN:"collaboration-auth:open",SHOW:"collaboration-auth:show",ACTION:"collaboration-auth:action",DISMISS:"collaboration-auth:dismiss"},INVITE_CONSENT:{SHOW:"invite-consent:show",ACK:"invite-consent:ack",RESPONSE:"invite-consent:response",DISMISS:"invite-consent:dismiss"},INVITE_PROGRESS:{SHOW:"invite-progress:show",UPDATE:"invite-progress:update",ACK:"invite-progress:ack",RESPONSE:"invite-progress:response",DISMISS:"invite-progress:dismiss"},INVITE_NOTICE:{SHOW:"invite-notice:show",ACK:"invite-notice:ack",RESPONSE:"invite-notice:response",DISMISS:"invite-notice:dismiss"},WINDOW:{RELOAD:"window:reload",TOGGLE_DEVTOOLS:"window:toggle-devtools",MINIMIZE:"window:minimize",MAXIMIZE:"window:maximize",CLOSE:"window:close",CREATE:"window:create",OPEN_NEW:"window:open-new",SET_THEME:"window:set-theme",SET_TRANSLUCENCY:"window:set-translucency",GET_ZOOM_FACTOR:"window:get-zoom-factor",SET_TITLE:"window:set-title",SET_IN_WORKSPACE:"window:set-in-workspace",SET_OPEN_WORKSPACE_TABS:"window:set-open-workspace-tabs",SET_BROWSER_FOCUSED:"window:set-browser-focused",SET_FULL_SCREEN:"window:set-full-screen",GET_FULL_SCREEN:"window:get-full-screen",SET_DOCK_POINTER_REGION:"window:set-dock-pointer-region",FOCUS_DOCK:"window:focus-dock",GET_DOCK_PLACEMENT:"window:get-dock-placement",UPDATE_DOCK_PLACEMENT:"window:update-dock-placement",SHOW_DOCK_MENU:"window:show-dock-menu",ACTIVATE_APP:"window:activate-app",SWITCH_DOCK_BACKEND:"window:switch-dock-backend",DOCK_BACKEND_SWITCH_FAILED:"window:dock-backend-switch-failed",DOCK_PLACEMENT_CHANGED:"window:dock-placement-changed",DOCK_POINTER_PRESENCE_CHANGED:"window:dock-pointer-presence-changed",DOCK_SHOWN:"window:dock-shown",DOCK_RENDERER_READY:"window:dock-renderer-ready",GET_DOCK_LAB:"window:get-dock-lab",SET_DOCK_LAB:"window:set-dock-lab",DOCK_LAB_CHANGED:"window:dock-lab-changed",CYCLE_FOCUS:"window:cycle-focus"},DOCK_CONTEXT:{GET:"dock-context:get",CHANGED:"dock-context:changed"},DOCK_SHORTCUTS:{GET:"dock-shortcuts:get",SET:"dock-shortcuts:set",CAPTURE:"dock-shortcuts:capture",CHANGED:"dock-shortcuts:changed"},CHAT_MEDIA:{BEGIN:"chat-media:begin",CONTROL:"chat-media:control",CLOSE:"chat-media:close"},DOCK_EVIDENCE:{BEGIN:"dock-evidence:begin",CAPTURE:"dock-evidence:capture",CANCEL:"dock-evidence:cancel",CONTROL:"dock-evidence:control",EVENT:"dock-evidence:event"},DOCK_ANNOTATION:{READY:"dock-annotation:ready",POINTER:"dock-annotation:pointer",GESTURE:"dock-annotation:gesture",GET_STILL:"dock-annotation:get-still",STATE:"dock-annotation:state",TOOLBAR:"dock-annotation:toolbar",SIGNAL:"dock-annotation:signal"},DOCK_CAPTURE_EDITOR:{OPEN:"dock-capture-editor:open",GET:"dock-capture-editor:get",CLOSE:"dock-capture-editor:close",DELETE:"dock-capture-editor:delete",DELETE_REQUESTED:"dock-capture-editor:delete-requested",DELETE_RESULT:"dock-capture-editor:delete-result",DISCARD:"dock-capture-editor:discard",KEEP:"dock-capture-editor:keep",CHANGED:"dock-capture-editor:changed",CONFIRM_DISCARD:"dock-capture-editor:confirm-discard",SAVE:"dock-capture-editor:save",SAVE_REQUESTED:"dock-capture-editor:save-requested",RETAKE:"dock-capture-editor:retake",RETAKE_REQUESTED:"dock-capture-editor:retake-requested",HOLD_BEGIN:"dock-capture-editor:hold-begin",HOLD_END:"dock-capture-editor:hold-end",HOLD_SHOW:"dock-capture-editor:hold-show",ATTACHED:"dock-capture-editor:attached",ATTACH_RETURN:"dock-capture-editor:attach-return",RETAKE_RESULT:"dock-capture-editor:retake-result",TRANSCRIPT_UPDATE:"dock-capture-editor:transcript-update",NOTE_DICTATION:"dock-capture-editor:note-dictation",NOTE_DICTATION_REQUESTED:"dock-capture-editor:note-dictation-requested",NOTE_DICTATION_TEXT:"dock-capture-editor:note-dictation-text",NOTE_DICTATION_UPDATE:"dock-capture-editor:note-dictation-update",WAVEFORM_UPDATE:"dock-capture-editor:waveform-update",SAVE_RESULT:"dock-capture-editor:save-result"},DOCK_MEDIA:{CLIPBOARD_WRITE:"dock-media:clipboard-write",CLIPBOARD_READ:"dock-media:clipboard-read",MENU:"dock-media:menu"},POWER:{GET_BATTERY_STATE:"power:get-battery-state",BATTERY_CHANGED:"power:battery-changed"},TERMINAL:{CREATE_WITH_COMMAND:"terminal:createWithCommand",PROFESSIONAL_CREATE:"terminal:professional:create",PROFESSIONAL_LIST:"terminal:professional:list",PROFESSIONAL_WRITE:"terminal:professional:write",PROFESSIONAL_RESIZE:"terminal:professional:resize",PROFESSIONAL_INFO:"terminal:professional:info",PROFESSIONAL_REFRESH:"terminal:professional:refresh",PROFESSIONAL_DISPOSE:"terminal:professional:dispose",PROFESSIONAL_GET_BUFFER:"terminal:professional:get-buffer"},GIT:{STATUS:"git:status",STATUS_CHANGED:"git:status-changed",AUTH_REQUIRED:"git:auth-required",KEYCHAIN_ACCESS_WARNING:"git:keychain-access-warning",KEYCHAIN_CONSENT_RESPOND:"git:keychain-consent-respond",CHECK_KEYCHAIN_RISK:"git:check-keychain-risk",DIFF:"git:diff",NUMSTAT:"git:numstat",COMMIT:"git:commit",COMMIT_DETAILS:"git:commit-details",PUSH:"git:push",PULL:"git:pull",BRANCH:"git:branch",CHECKOUT:"git:checkout",LOG:"git:log",HISTORY:"git:history",GET_BRANCHES:"git:getBranches",STAGE:"git:stage",UNSTAGE:"git:unstage",STAGE_HUNK:"git:stage-hunk",UNSTAGE_HUNK:"git:unstage-hunk",DISCARD:"git:discard",REMOVE_LOCK:"git:removeLock",SHOW_FILE:"git:show-file",FILE_HISTORY:"git:file-history",RENAME_BRANCH:"git:rename-branch",PULL_BRANCH:"git:pullBranch",GET_BRANCH_STATUS:"git:getBranchStatus",GET_REMOTES:"git:getRemotes",FETCH:"git:fetch"},CONFIG:{GET:"config:get",SET:"config:set",DELETE:"config:delete",GET_ALL:"config:get-all",RESET:"config:reset"},SETTINGS:{GET:"settings:get",SET:"settings:set",GET_ALL:"settings:getAll",UPDATE:"settings:update"},FEATURE_CODES:{ACTIVATE:"feature-codes:activate",GET_ACTIVE:"feature-codes:get-active",DEACTIVATE:"feature-codes:deactivate",RESTART_APP:"feature-codes:restart-app"},USER_MCP:{AUTHENTICATE:"user-mcp:authenticate",CHECK_AUTH:"user-mcp:check-auth",TEST_CONNECTION:"user-mcp:test-connection"},NOTIFICATION:{TEST:"notification:test",REQUEST_PERMISSION:"notification:requestPermission",SHOW:"notification:show"},DIALOG:{MESSAGE:"dialog:message",OPEN:"dialog:open"},VOICE:{LOCAL_AVAILABLE:"voice:local-available",TRANSCRIBE_LOCAL:"voice:transcribe-local",REQUEST_LOCAL_AUTHORIZATION:"voice:request-local-authorization"},SHELL:{OPEN:"shell:open",OPEN_PATH:"shell:openPath",OPEN_EXTERNAL:"shell:openExternal",TRASH_ITEM:"shell:trashItem",SHOW_ITEM_IN_FOLDER:"shell:showItemInFolder"},EDITOR:{GET_SELECTION:"editor:get-selection"},EXTERNAL_EDITORS:{DETECT_INSTALLED:"external-editors:detect-installed",OPEN:"external-editors:open",OPEN_WITH_OTHER:"external-editors:open-with-other"},FIRST_VISIT:{LOAD:"first-visit-state:load",SAVE:"first-visit-state:save",DELETE:"first-visit-state:delete",EXISTS:"first-visit-state:exists"},PANEL_LAYOUT:{LOAD:"panel-layout:load",SAVE:"panel-layout:save"},BROWSER:{REGISTER_TAB:"browser:register-tab",UNREGISTER_TAB:"browser:unregister-tab",REPORT_TAB_BOUNDS:"browser:report-tab-bounds",SET_TAB_VIEWPORT:"browser:set-tab-viewport",OPEN_DEVTOOLS_PANEL:"browser:open-devtools-panel",EXEC:"browser:exec",RESOLVE_URL:"browser:resolve-url",FOCUS_TAB:"browser:focus-tab",SHOW_TAB:"browser:show-tab",LIST_TABS_REQUEST:"browser:list-tabs-request",HOST_WORKSPACE:"browser:host-workspace",CAPTURE_DRAWING:"browser:capture-drawing",AGENT_DRAWING:"browser:agent-drawing",BACKGROUND_HOSTED_WORKSPACES:"browser:background-hosted-workspaces",LIST_TABS_RESPONSE:"browser:list-tabs-response",OPEN_TAB:"browser:open-tab",DIAGNOSE_TAB:"browser:diagnose-tab",CLOSE_TAB:"browser:close-tab",TAB_NAVIGATED:"browser:tab-navigated",TAB_OWNER_CHANGED:"browser:tab-owner-changed",CLEAR_AGENT_TABS:"browser:clear-agent-tabs"},FILE_TRACKING:{AGENT_FILE_CHANGED:"file-tracking:agent-file-changed"},STREAMING:{START:"streaming:start",STOP:"streaming:stop",PAUSE:"streaming:pause",RESUME:"streaming:resume",GET_STATS:"streaming:get-stats"},AGENT_CONFIG:{GET:"agent-config:get",UPDATE:"agent-config:update",RESET:"agent-config:reset"},LOG:{TRACK_FILE_CHANGE:"log:track-file-change",TRACK_AGENT_EVENT:"log:track-agent-event",TRACK_MCP_CALL:"log:track-mcp-call",PATHS:"log:paths",READ:"log:read",CLEAR:"log:clear",SUMMARY:"log:summary",EXPORT_DEBUG_BUNDLE:"log:export-debug-bundle",PERSIST_RENDERER_LOGS:"log:persist-renderer-logs"},USER_RULES:{GET:"user-rules:get",SET:"user-rules:set",DELETE:"user-rules:delete",GET_ALL:"user-rules:get-all",GET_FORMATTED:"user-rules:get-formatted",SET_ENABLED:"user-rules:set-enabled",EXPORT:"user-rules:export",IMPORT:"user-rules:import",GET_COMBINED_PROMPT:"user-rules:get-combined-prompt",UPDATE:"user-rules:update",GET_BY_TYPE:"user-rules:get-by-type",GET_FORMATTED_BY_TYPE:"user-rules:get-formatted-by-type",UPDATE_BY_TYPE:"user-rules:update-by-type",SET_ENABLED_BY_TYPE:"user-rules:set-enabled-by-type",DELETE_BY_TYPE:"user-rules:delete-by-type",EXPORT_BY_TYPE:"user-rules:export-by-type"},VSCODE:{OPEN:"vscode:open",OPEN_FILE:"vscode:openFile",OPEN_DIFF:"vscode:open-diff",OPEN_GIT_DIFF:"vscode:open-git-diff"},JETBRAINS:{OPEN:"jetbrains:open"},XCODE:{OPEN:"xcode:open"},DEEP_LINK:{HANDLE:"deep-link:handle",CONSUME_PENDING:"deep-link:consume-pending"},LEGACY:{GET_HOME_DIRECTORY:"get_home_directory"},RULES:{LIST:"rules:list",LOAD_WORKSPACE:"rules:load-workspace",GET_CONTEXT:"rules:get-context"},CONFIG_RULES:{GET_ALL:"config:getAll"},USER_ACTIVITY:{MARK_NOTE_READ:"user-activity:mark-note-read",GET_NOTE_READ_STATUS:"user-activity:get-note-read-status",GET_UNREAD_NOTE_IDS:"user-activity:get-unread-note-ids"},GIT_TRACKING:{GET_STATE:"git-tracking:get-state",GET_SYNC_STATUS:"git-tracking:get-sync-status",SYNC:"git-tracking:sync",GET_FILE_DIFF:"git-tracking:get-file-diff",IS_GITHUB_AUTHENTICATED:"git-tracking:is-github-authenticated",GET_GITHUB_BRANCHES:"git-tracking:get-github-branches",GET_PULL_REQUESTS:"git-tracking:get-pull-requests",SEARCH_PULL_REQUESTS:"git-tracking:search-pull-requests",GET_PULL_REQUEST:"git-tracking:get-pull-request",CREATE_PULL_REQUEST:"git-tracking:create-pull-request",GET_GITHUB_ISSUES:"git-tracking:get-github-issues",SEARCH_GITHUB_ISSUES:"git-tracking:search-github-issues",LIST_RELATED_REPOS:"git-tracking:list-related-repos",GET_REMOTE_URL:"git-tracking:get-remote-url",GET_CHECK_RUNS:"git-tracking:get-check-runs",GET_PR_REVIEWS:"git-tracking:get-pr-reviews"},GITHUB_AUTH:{IS_AUTHENTICATED:"github-auth:is-authenticated",GET_USER:"github-auth:get-user",START_AUTH:"github-auth:start",POLL_FOR_TOKEN:"github-auth:poll",CANCEL_AUTH:"github-auth:cancel",LOGOUT:"github-auth:logout",GET_AUTH_STATE:"github-auth:get-auth-state",GET_STATUS:"github-auth:get-status",LIST_REPOS:"github-auth:list-repos",SEARCH_REPOS:"github-auth:search-repos",SEARCH_USERS:"github-auth:search-users"},FORGE_AUTH:{GET_STATUS:"forge-auth:get-status",CONNECT:"forge-auth:connect",CANCEL_AUTH:"forge-auth:cancel",REVOKE:"forge-auth:revoke",GET_USER:"forge-auth:get-user"},LINEAR_AUTH:{IS_AUTHENTICATED:"linear-auth:is-authenticated",START_AUTH:"linear-auth:start-auth",CANCEL_AUTH:"linear-auth:cancel-auth",LOGOUT:"linear-auth:logout",GET_AUTH_STATE:"linear-auth:get-auth-state",GET_STATUS:"linear-auth:get-status",FETCH_MY_ISSUES:"linear-auth:fetch-my-issues",SEARCH_ISSUES:"linear-auth:search-issues"},SENTRY_AUTH:{IS_AUTHENTICATED:"sentry-auth:is-authenticated",SAVE_CONFIG:"sentry-auth:save-config",GET_AUTH_STATE:"sentry-auth:get-auth-state",LOGOUT:"sentry-auth:logout",FETCH_PROJECTS:"sentry-auth:fetch-projects",FETCH_ISSUES:"sentry-auth:fetch-issues",SEARCH_ISSUES:"sentry-auth:search-issues",GET_ISSUE:"sentry-auth:get-issue"},OBSERVABILITY_EXT:{},AGENT_TESTING:{RUN:"agent-testing:run",GET_REPORT:"agent-testing:get-report",GET_AGENT_REPORTS:"agent-testing:get-agent-reports",CLEANUP:"agent-testing:cleanup"},DEBUG:{TRIGGER_BACKEND_RESUME:"debug:trigger-backend-resume",LIST_AGENTS:"debug:list-agents"},SETUP_SCRIPTS:{GENERATE:"setup-scripts:generate",READ_REPO_CONFIG:"setup-scripts:read-repo-config",DETECT_TYPE:"setup-scripts:detect-type",GENERATE_WITH_AGENT:"setup-scripts:generate-with-agent",STOP_AGENT:"setup-scripts:stop-agent",STREAM_CHUNK:"setup-scripts:stream-chunk",STREAM_COMPLETE:"setup-scripts:stream-complete",STREAM_ERROR:"setup-scripts:stream-error"},GIT_EXT:{IS_REPOSITORY:"git:isRepository",GET_AUTO_COMMIT_STATUS:"git:get-auto-commit-status",GET_BACKGROUND_OPS_STATUS:"git:background-ops-status"},ACCEPT_CHANGES:{CHECK_PATH_HAS_CHANGES:"accept-changes:check-path-has-changes"},CHAT_EXPORT:{CHAT_TO_HTML:"export:chat-to-html"},FILE_EXT:{},COMMENTS_EXT:{},WORKSPACE_EXT:{},AGENT_LAUNCH:{},AGENT_CONTEXT:{GET:"agent-context:get"},RECOVERY:{NEEDS_RECOVERY:"recovery:needs-recovery",MARK_STREAMING:"recovery:mark-streaming",MARK_COMPLETE:"recovery:mark-complete",CLEAR_STREAMING:"recovery:clear-streaming",CHECK_NEEDS_RECOVERY:"recovery:check-needs-recovery",GET_STATUS:"recovery:get-status",CREATE_CHECKPOINT:"recovery:create-checkpoint",RESTORE_CHECKPOINT:"recovery:restore-checkpoint",RECOVER_SESSION:"recovery:recover-session",GET_STATS:"recovery:get-stats"},STORAGE:{SAVE:"storage:save",DELETE:"storage:delete"},AUTO_UPDATE:{CHECK_MANUAL:"auto-update:check-manual",DOWNLOAD:"auto-update:download",INSTALL:"auto-update:install",GET_STATE:"auto-update:get-state",SET_CHANNEL:"auto-update:set-channel",SET_SHARE_STATISTICS:"auto-update:set-share-statistics",STATUS_CHANGED:"auto-update:status-changed",PROGRESS:"auto-update:progress",ERROR:"auto-update:error",UP_TO_DATE:"auto-update:up-to-date",SHOW_TOAST:"auto-update:show-toast"},RELEASE_NOTES:{GET:"release-notes:get",GET_PENDING:"release-notes:get-pending",DISMISS:"release-notes:dismiss",SHOW:"release-notes:show",CLOSE:"release-notes:close"},PIP:{OPEN:"pip:open",CLOSE:"pip:close",CLOSE_ALL_FOR_WORKSPACE:"pip:close-all-for-workspace"},BROWSER_ACCESS:{GET_STATE:"browser-access:get-state",SET_ENABLED:"browser-access:set-enabled",SET_PORT:"browser-access:set-port",RESET_KEY:"browser-access:reset-key",CREATE_SIGN_IN_CODE:"browser-access:create-sign-in-code"},WEBSOCKET_API:{GET_STATUS:"websocket-api:get-status",SET_ENABLED:"websocket-api:set-enabled",REGENERATE_TOKEN:"websocket-api:regenerate-token",SET_DISCOVERY:"websocket-api:set-discovery"},TOKEN_USAGE:{GET:"token-usage:get",CHANGED:"token-usage:changed"},BACKEND:{DESKTOP_PERMISSIONS:"backend:desktop-permissions",DESKTOP_OS_PERMISSIONS:"backend:desktop-os-permissions",REQUEST:"backend:request",PR_MONITOR:{READY:"backend:pr-monitor:ready",CAPTURE:"backend:pr-monitor:capture",REQUEST:"backend:pr-monitor:request",RELEASE:"backend:pr-monitor:release",RETIRED:"backend:pr-monitor:retired",NOTIFICATION:"backend:pr-monitor:notification"},NATIVE_REVIEW:{PREPARE:"backend:native-review:prepare",EXECUTE:"backend:native-review:execute",RECONCILE:"backend:native-review:reconcile",RELEASE:"backend:native-review:release",RETIRED:"backend:native-review:retired"},REPOSITORY_SELECTION:{CAPTURE:"backend:repository-selection:capture",CONFIRM:"backend:repository-selection:confirm",RECONCILE:"backend:repository-selection:reconcile",RELEASE:"backend:repository-selection:release",RETIRED:"backend:repository-selection:retired"},REPOSITORY_CHECKOUT:{CAPTURE:"backend:repository-checkout:capture",REQUEST:"backend:repository-checkout:request",RELEASE:"backend:repository-checkout:release",RETIRED:"backend:repository-checkout:retired"},REPOSITORY_RESOURCE:{CAPTURE:"backend:repository-resource:capture",DETAIL:"backend:repository-resource:detail",RELEASE:"backend:repository-resource:release",RETIRED:"backend:repository-resource:retired"},REPOSITORY:{CAPTURE:"backend:repository:capture",RETIRED:"backend:repository:retired",REQUEST:"backend:repository:request",RELEASE:"backend:repository:release"},SUBSCRIBE:"backend:subscribe",UNSUBSCRIBE:"backend:unsubscribe",GET_STATUS:"backend:get-status",NODE_CAPABILITIES:"backend:node-capabilities",READ_PRINCIPAL:"backend:read-principal",NOTIFICATION:"backend:notification",STATUS:"backend:status",SPAWN_SIDECAR:"backend:spawn-sidecar",OPEN_LOCAL_AND_SPAWN:"backend:open-local-and-spawn",GET_SIDECAR_RUN_LOG:"backend:get-sidecar-run-log",RESTART_ORPHANED_SIDECAR:"backend:restart-orphaned-sidecar"},CONNECTIONS:{LIST:"connections:list",CAPTURE_FINGERPRINT:"connections:capture-fingerprint",ADD:"connections:add",UPDATE:"connections:update",TEST:"connections:test",ROTATE_SECRET:"connections:rotate-secret",GET_TUNNEL:"connections:get-tunnel",SET_TUNNEL:"connections:set-tunnel",OPEN:"connections:open",FORGET:"connections:forget",PAIR_LINK_INSPECT:"connections:pair-link-inspect",PAIR_LINK_COMMIT:"connections:pair-link-commit",PAIR_LINK_DISCARD:"connections:pair-link-discard",UPDATE_BACKEND:"connections:update-backend",CHANGED:"connections:changed",CERT_MISMATCH:"connections:cert-mismatch",CERT_WARNINGS:"connections:cert-warnings",PROTOCOL_MISMATCH:"connections:protocol-mismatch",AUTH_REJECTED:"connections:auth-rejected",SYNC_GET_STATE:"connections:sync-get-state",SYNC_SET_ENABLED:"connections:sync-set-enabled",SYNC_STATUS_CHANGED:"connections:sync-status-changed",PUBLISH_SELF:"connections:publish-self",SELF_PUBLISHED_STATE:"connections:self-published-state",REFRESH_SELF:"connections:refresh-self",UNPUBLISH_SELF:"connections:unpublish-self"},GUEST_SESSIONS:{LIST:"guest-sessions:list",LEAVE:"guest-sessions:leave",LEAVE_WORKSPACE:"guest-sessions:leave-workspace",CHANGED:"guest-sessions:changed"},MACHINE_RAIL:{GET_STATE:"machine-rail:get-state",SELECT:"machine-rail:select",ADD:"machine-rail:add",REMOVE:"machine-rail:remove",REORDER:"machine-rail:reorder",SET_ENABLED:"machine-rail:set-enabled",CHANGED:"machine-rail:changed",FORWARD_TOAST:"machine-rail:forward-toast",TOAST:"machine-rail:toast",SHOWN:"machine-rail:shown",READY:"machine-rail:ready",HEALTH:"machine-rail:health"},PRESENCE:{REPORT:"presence:report"},TRANSFER:{START:"transfer:start",FINALIZE:"transfer:finalize",CANCEL:"transfer:cancel",PROGRESS:"transfer:progress",IMPORT_START:"transfer:import-start",IMPORT_CANCEL:"transfer:import-cancel",IMPORT_PROGRESS:"transfer:import-progress"},REMOTE_MACHINES:{EXPOSE:"remote-machines:expose",UNEXPOSE:"remote-machines:unexpose",MACHINE_FINGERPRINT:"remote-machines:machine-fingerprint",INVITE_INSPECT:"remote-machines:invite-inspect",INVITE_CLAIM:"remote-machines:invite-claim",INVITE_DISCARD:"remote-machines:invite-discard"},MACHINE_SETUP:{SSH_DEFAULTS:"machine-setup:ssh-defaults",SSH_START:"machine-setup:ssh-start",SSH_TRUST:"machine-setup:ssh-trust",SSH_CANCEL:"machine-setup:ssh-cancel",SSH_EVENT:"machine-setup:ssh-event"},HARDWARE_CONSOLE:{CLEAR_LIGHTING:"hardware-console:clear-lighting",CLEAR_LIGHTING_DONE:"hardware-console:clear-lighting-done",GET_OWNER_STATUS:"hardware-console:get-owner-status",OWNER_CHANGED:"hardware-console:owner-changed"}},g={"global.command-palette":"mod+shift+p","global.settings":"mod+,","global.keyboard-shortcuts":"mod+?","global.command-palette-alt":"mod+k","global.toggle-spaces":"mod+o","global.new-space":"mod+n","global.search":"mod+f","global.next-space":"ctrl+tab","global.previous-space":"ctrl+shift+tab","global.next-space-alt":"mod+shift+]","global.previous-space-alt":"mod+shift+[","navigation.go-to-tab":"mod+1-9","navigation.new-tab":"mod+t","navigation.close-tab":"mod+w","navigation.close-space-tab":"mod+shift+w","navigation.reopen-tab":"mod+shift+t","navigation.move-space-tab-left":"mod+alt+shift+left","navigation.move-space-tab-right":"mod+alt+shift+right","workspace.new-agent":"mod+alt+a","workspace.new-note":"mod+alt+n","workspace.new-terminal":"mod+alt+t","workspace.new-browser":"mod+alt+b","workspace.set-aside":"mod+shift+s","chat.send":"enter","chat.force-send":"mod+enter","chat.new-line":"shift+enter","chat.focus-input":"/","chat.mention-context":"@","editor.go-to-line":"mod+g","editor.save":"mod+s","editor.undo":"mod+z","editor.redo":"mod+shift+z","editor.toggle-task-list":"mod+shift+9","editor.toggle-word-wrap":"alt+z","editor.copy":"mod+c","editor.select-all":"mod+a","panel.toggle-sidebar":"mod+b","panel.create-column-right":"mod+\\","panel.focus-next-column":"mod+alt+right","panel.maximize":"mod+shift+m","panel.focus-previous-column":"mod+alt+left","panel.next-pane":"mod+]","panel.previous-pane":"mod+[","panel.move-pane-next-column":"mod+alt+pagedown","panel.move-pane-previous-column":"mod+alt+pageup","panel.copy-browser-url":"mod+shift+c","leader.navigate-panels":"h/j/k/l","leader.resize-panels":"H/J/K/L","leader.split-right":"%","leader.toggle-zoom":"z","leader.close-panel":"x","leader.next-previous-panel":"o/p","leader.equalize-sizes":"=","leader.jump-to-panel":"q + 1-9","leader.cycle-layout":"space","dock.focus":"ctrl+shift+d","dock.capture":"ctrl+shift+s","dock.record":"ctrl+shift+r"},L=["mod","ctrl","alt","shift"],D={mod:"mod",cmd:"mod",command:"mod",meta:"mod",control:"ctrl",ctrl:"ctrl",option:"alt",alt:"alt",shift:"shift"},M={escape:"esc",return:"enter",arrowup:"up",arrowdown:"down",arrowleft:"left",arrowright:"right",pgup:"pageup",pgdn:"pagedown"," ":"space"},Ee=new Set(["backspace","delete","down","end","enter","esc","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","home","left","pagedown","pageup","right","space","tab","up"]),Te=new Set(["alt","control","meta","shift"]),v={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=","{":"[","}":"]","|":"\\",":":";",'"':"'","<":",",">":".","?":"/"},le=Object.fromEntries(Object.entries(v).map(([e,t])=>[t,e]));function Ue(e,t){if(Te.has(e.key.toLowerCase())||!t&&e.metaKey)return null;let a=e.key;e.altKey&&e.code?.startsWith("Key")?a=e.code.slice(3):e.altKey&&e.code?.startsWith("Digit")&&(a=e.code.slice(5));const o=[];return(t&&e.metaKey||!t&&e.ctrlKey)&&o.push("mod"),t&&e.ctrlKey&&o.push("ctrl"),e.altKey&&o.push("alt"),e.shiftKey&&o.push("shift"),o.push(a),w(o.join("+"))}function de(e){return Object.prototype.hasOwnProperty.call(g,e)}function m(e){const t=e.trim();if(!t||t.includes("/"))return null;const a=t.split("+").map(r=>r.trim()).filter(Boolean);if(a.length===0)return null;const o=new Set;for(const r of a.slice(0,-1)){const E=D[r.toLowerCase()];if(!E||o.has(E))return null;o.add(E)}const s=a.at(-1)??"";if(D[s.toLowerCase()])return null;const n=M[s.toLowerCase()]??s.toLowerCase();return n.length===1||Ee.has(n)?{key:n,mod:o.has("mod"),ctrl:o.has("ctrl"),alt:o.has("alt"),shift:o.has("shift")}:null}function w(e){const t=e.trim();if(t.includes("/")){const r=t.split("/").map(d=>d.trim()),E=r[0]??"",l=E.includes("+")?`${E.slice(0,E.lastIndexOf("+"))}+`:"",p=r.map((d,I)=>{const _=I>0&&l&&!d.includes("+")?l+d:d,C=_.slice(_.lastIndexOf("+")+1),h=m(/^[A-Z]$/.test(C)?`${_.slice(0,-1)}shift+${C.toLowerCase()}`:_);return h?[...L.filter(j=>h[j]),h.key].join("+"):null});return p.some(d=>!d)?null:p.join("/")}const a=t.match(/^(.*\+)?([1-8])-9$/i);if(a){const r=m(`${a[1]??""}${a[2]}`);if(!r)return null;const E=L.filter(l=>r[l]);return`${E.length?`${E.join("+")}+`:""}${a[2]}-9`}const o=t.match(/^(.+?)\s+\+\s+([1-8]-9)$/);if(o){const r=w(o[1]);return r?`${r} + ${o[2]}`:null}const s=m(e);return s?[...L.filter(r=>s[r]),s.key].join("+"):null}function be(e,t){const a=g[e],o=t.includes("+")?`${t.slice(0,t.lastIndexOf("+"))}+`:"",s=a.match(/^(.+?)\s+\+\s+([1-8]-9)$/);if(s)return`${t} + ${s[2]}`;const n=a.match(/^(?:.*\+)?([1-8]-9)$/);return n?`${o}${n[1]}`:a.includes("/")?`${o}${a}`:t}function He(e){return e.match(/^(.+?)\s+\+\s+[1-8]-9$/)?.[1]??null}function Se(e){const t=e.match(/^(.*\+)?([1-8])-9$/);if(t){const n=t[1]??"";return Array.from({length:10-Number(t[2])},(r,E)=>`${n}${Number(t[2])+E}`)}const a=e.split("/"),o=a[0]??"",s=o.includes("+")?`${o.slice(0,o.lastIndexOf("+"))}+`:"";return a.map((n,r)=>{const E=n.trim(),l=r>0&&s&&!E.includes("+")?s+E:E;return/^[A-Z]$/.test(l)?`shift+${l.toLowerCase()}`:l==="space"?"space":l})}function ue(e,t,a){return Se(t).findIndex(o=>_e(e,o,a))}function _e(e,t,a){const o=m(t);if(!o)return!1;const s=M[e.key.toLowerCase()]??e.key.toLowerCase(),n=o.key.length===1&&'~!@#$%^&*()_+{}|:"<>?'.includes(o.key);return new Set([s,v[s],e.shiftKey?le[s]:void 0]).has(o.key)&&e.metaKey===(o.mod&&a)&&e.ctrlKey===(o.ctrl||o.mod&&!a)&&e.altKey===o.alt&&e.shiftKey===(o.shift||n)}function ye(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[a,o]of Object.entries(e)){if(!de(a)||typeof o!="string")continue;const s=w(o);s&&s!==g[a]&&(t[a]=s)}return t}function Ke(e,t){return t[e]??g[e]}function Me(e,t,a,o){return a(e)!==g[e]?!1:Object.keys(g).some(s=>{if(s===e||s.startsWith("leader."))return!1;const n=a(s);return n===g[s]?!1:ue(t,n,o)>=0})}function R(e){if(/[\u0000-\u0020\u007f\\]/.test(e))return null;const t=/^https:\/\/([^/?#]+)([^?#]*)/i.exec(e);if(!t||/[@%]/.test(t[1]))return null;try{const a=new URL(e);if(a.protocol!=="https:"||a.username||a.password)return null;const o=t[2].replace(/\/$/,""),s=o?o.slice(1).split("/"):[];return s.some(n=>!/^[A-Za-z0-9_.-]+$/.test(n)||n==="."||n==="..")?null:{url:a,path:s}}catch{return null}}function G(e){const t=R(e);return!!t&&!t.url.search&&!t.url.hash&&e===t.url.origin+(t.path.length?`/${t.path.join("/")}`:"")}function ve(e,t){if(!G(t))return null;const a=R(e),o=R(t);if(!a||!o||o.url.origin!==a.url.origin||!o.path.every((n,r)=>a.path[r]===n))return null;const s=a.path.slice(o.path.length);return s.length<2||s[0]==="groups"||s.includes("-")?null:{provider:"gitlab",instanceBaseUrl:t,projectPath:s.join("/")}}function ge(e,t){const a=R(e);if(!a)return null;let o=null;for(const s of t){if(s.provider!=="gitlab"||!G(s.instanceBaseUrl))continue;const n=R(s.instanceBaseUrl);if(!n||n.url.origin!==a.url.origin||!n.path.every((C,h)=>a.path[h]===C))continue;const r=a.path.slice(n.path.length),E=r.indexOf("-");if(E<2||r[0]==="groups")continue;const[l,p,...d]=r.slice(E+1),I=l==="merge_requests"?"merge-request":l==="issues"?"issue":null;if(!I||!/^[1-9]\d*$/.test(p??"")||!Number.isSafeInteger(Number(p))||d.length&&(I!=="merge-request"||d.length!==1||!["diffs","commits","pipelines"].includes(d[0])))continue;const _={repository:{provider:"gitlab",instanceBaseUrl:s.instanceBaseUrl,projectPath:r.slice(0,E).join("/")},kind:I,number:Number(p)};if(o&&JSON.stringify(o)!==JSON.stringify(_))return null;o=_}return o}function We(e){const t=R(e);return t?ge(e,[{provider:"gitlab",instanceBaseUrl:t.url.origin}])!==null:!1}const W="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",F="([01]\\d|2[0-3]):[0-5]\\d(:[0-5]\\d(\\.\\d+)?)?",pe=new RegExp(`^${W}T${F}(Z)$`),Ae=new RegExp(`^${W}T${F}(Z|([+-]\\d{2}:?\\d{2}))$`);function P(e={}){return i().regex(e.offset?Ae:pe,e.message??"Invalid datetime")}function B(e="Invalid url"){return i().refine(t=>URL.canParse(t),e)}const U=i().regex(/^(0|[1-9][0-9]*)$/).refine(e=>/^(0|[1-9][0-9]*)$/.test(e)&&BigInt(e)<=18446744073709551615n),Fe=c({target:T(["local","remote"]),checkout:T(["shared","worktree","isolated"]),os:T(["linux","macos"]).optional(),nodeId:i().min(1).optional(),exclusive:u().optional()}).strict().refine(e=>e.target!=="remote"||e.checkout==="isolated").refine(e=>!e.exclusive||e.target==="remote"&&e.checkout==="isolated");function b(e){return e==="e2b"||e==="cloud"}const x=c({target:T(["local","remote","e2b","cloud"]).optional(),checkout:T(["shared","worktree","isolated"]).optional(),os:T(["linux","macos"]).optional(),arch:T(["x86_64","aarch64"]).optional(),nodeId:i().min(1).refine(e=>new TextEncoder().encode(e).length<=128).optional(),exclusive:u().optional(),cloudMachineId:i().min(1).refine(e=>new TextEncoder().encode(e).length<=64).optional()}).strict(),Be=x.refine(e=>e.target!=="remote"||(e.checkout??"isolated")==="isolated").refine(e=>e.cloudMachineId===void 0||b(e.target)).refine(e=>!b(e.target)||(e.checkout??"isolated")==="isolated"&&!e.os&&!e.arch&&!e.nodeId&&!e.exclusive).refine(e=>!e.exclusive||e.target!=="local"&&(e.checkout??"isolated")==="isolated"),Re=x.extend({target:T(["local","remote","e2b","cloud"]),checkout:T(["shared","worktree","isolated"])}).refine(e=>e.target!=="remote"||e.checkout==="isolated").refine(e=>!e.exclusive||e.target!=="local"&&e.checkout==="isolated"),Oe=c({id:i().min(1),assignmentEpoch:U,captureRevision:U,capturedAt:P({offset:!0}),committedAt:P({offset:!0})}),Ie=c({state:T(["pending","running","completed","failed","skipped"]),exitCode:k().int().optional(),error:i().optional(),startedAt:i().optional(),finishedAt:i().optional(),output:i().optional(),outputTruncated:u().optional()}),xe=c({nodeId:i().min(1).optional(),leaseId:i().min(1).optional(),nodeName:i().min(1).optional(),placement:Re.optional(),effectiveIsolation:T(["pending","isolated","shared","worktree","direct","cow"]).optional(),nodeState:T(["ready","offline","incompatible","removed"]).optional(),checkpoint:Oe.optional(),placementError:c({code:i(),detail:i()}).optional(),cloudStart:c({step:i().min(1)}).passthrough().optional().catch(void 0),setup:Ie.optional().catch(void 0),nodePath:i().optional()}),S=i().min(1),A=B().refine(e=>{const t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}),V=A.refine(e=>G(e)),Y=k().int().nonnegative().max(Number.MAX_SAFE_INTEGER),O=i().max(1024).regex(/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)+$/).refine(e=>e.split("/").every(t=>t!=="."&&t!=="..")),f=i().regex(/^[0-9a-fA-F]{40}$/),$=c({checkoutId:S,revision:S}).strict(),Ve=c({provider:N("gitlab"),instanceBaseUrl:V.optional()}).strict(),Ye=$.extend({provider:N("gitlab"),instanceBaseUrl:V,expiresAfterMs:Y}).strict(),X=c({projectPath:O,name:i(),namespace:i(),webUrl:A,cloneUrl:A,defaultBranch:S.optional(),ownerAvatarUrl:B().pipe(A).optional().catch(void 0)}).strict(),he=c({name:S,commitSha:f,protected:u().optional()}).strict(),Ne=c({query:i().trim().refine(e=>new TextEncoder().encode(e).length<=256&&!/[\u0000-\u001f\u007f]/.test(e)).optional(),cursor:S.optional(),limit:k().int().positive().max(100).optional()}).strict(),$e=te([c({projectPath:O}).strict(),c({url:A}).strict()]),Xe=Ne.extend({projectPath:O,cached:u().optional()}).strict(),Ce=$.extend({projectPath:O,branch:S,commitSha:f,mode:T(["direct","cached"])}).strict(),qe=Ce.omit({mode:!0}).strict(),je=c({projectPath:O,branch:S,commitSha:f,config:oe(i(),H()).nullable(),exists:u()}).strict().refine(e=>e.exists===(e.config!==null)),ze=c({items:y(X),nextCursor:S.optional()}).strict(),Qe=c({project:X,contextUrl:A.optional()}).strict(),Ze=c({items:y(he),nextCursor:S.optional(),defaultBranch:S.optional(),cached:u()}).strict(),Je=c({projectPath:O,branch:S,commitSha:f,cached:u()}).strict(),q=c({status:N("unavailable"),reason:T(["disabled","not-connected","access-denied","rate-limited","unreachable","retired","not-found","invalid-target","empty-repository","branch-changed"]),retryAfterMs:Y.optional()}).strict();function et(e){return ae("status",[c({status:N("ready"),value:e}).strict(),q])}function tt(e,t){if(c({status:T(["ready","unavailable"])}).passthrough().parse(t).status==="unavailable")return q.parse(t);const o=c({status:N("ready"),value:H()}).strict().parse(t);return{status:"ready",value:e.parse(o.value)}}export{Oe as A,Me as B,Xe as C,We as D,de as E,P as F,we as G,_e as H,Pe as I,ue as J,w as K,tt as L,ve as M,ge as N,Ke as O,ye as P,Ue as Q,g as S,xe as a,Be as b,Fe as c,Ze as d,Ve as e,Ye as f,Ne as g,Qe as h,$e as i,X as j,ze as k,qe as l,je as m,Ce as n,Je as o,be as p,ie as q,et as r,re as s,Se as t,K as u,He as v,De as w,G as x,b as y,Ge as z};