@intent-hq/web 2.343.2 → 2.345.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{wjBrDDKR.js → -6JGlnE4.js} +1 -1
  3. package/web/app/immutable/chunks/{4GiF-64P.js → -7ARPWgR.js} +1 -1
  4. package/web/app/immutable/chunks/{DHP1DFPI.js → -SwunqO3.js} +1 -1
  5. package/web/app/immutable/chunks/{Af7wRQM_.js → 1MWULgfl.js} +1 -1
  6. package/web/app/immutable/chunks/{ByiJOZiZ.js → 2xvAjJNs.js} +1 -1
  7. package/web/app/immutable/chunks/{C-3coqYU.js → 34C5M9lk.js} +1 -1
  8. package/web/app/immutable/chunks/{oYQw_s1S.js → 5MLUIYhU.js} +1 -1
  9. package/web/app/immutable/chunks/{DbNMpEC8.js → 6Zmm5CZL.js} +1 -1
  10. package/web/app/immutable/chunks/{CbeK0M7M.js → 7teYU7wH.js} +1 -1
  11. package/web/app/immutable/chunks/{CFLZAMP_.js → 8XhHIJcn.js} +1 -1
  12. package/web/app/immutable/chunks/{BW73Ve1a.js → 9HNwwiNt.js} +1 -1
  13. package/web/app/immutable/chunks/{CicdOSYm.js → A0r9TbR7.js} +2 -2
  14. package/web/app/immutable/chunks/{DWQSi293.js → A34-FDia.js} +1 -1
  15. package/web/app/immutable/chunks/{BycXuHIq.js → A8JjhnEv.js} +1 -1
  16. package/web/app/immutable/chunks/{Czmjmrib.js → B0a-wzQr.js} +1 -1
  17. package/web/app/immutable/chunks/{C0g2TqGQ.js → B0biUQQF.js} +9 -9
  18. package/web/app/immutable/chunks/{CiTK-_b6.js → B203wRvP.js} +1 -1
  19. package/web/app/immutable/chunks/{DQR5oUDY.js → B3kzQQLK.js} +1 -1
  20. package/web/app/immutable/chunks/{CusCKZ30.js → B3lXnLB8.js} +2 -2
  21. package/web/app/immutable/chunks/{Cdx0eFWC.js → B4ilKCwe.js} +1 -1
  22. package/web/app/immutable/chunks/{C91dOInA.js → B5tGFpkq.js} +1 -1
  23. package/web/app/immutable/chunks/{XkS41G1k.js → B7w_8Qom.js} +1 -1
  24. package/web/app/immutable/chunks/{qdwxdMJ_.js → B9Hetctu.js} +1 -1
  25. package/web/app/immutable/chunks/{CBnORL1F.js → B9x-giji.js} +3 -3
  26. package/web/app/immutable/chunks/{DU0nfy_y.js → BA3fud46.js} +1 -1
  27. package/web/app/immutable/chunks/{O6f99o2k.js → BAxqzRwc.js} +1 -1
  28. package/web/app/immutable/chunks/{B4sr0yPI.js → BBL1FO1t.js} +1 -1
  29. package/web/app/immutable/chunks/{L_S2h6Yw.js → BC2xxkKo.js} +1 -1
  30. package/web/app/immutable/chunks/{BJJ1m47o.js → BCASO_bV.js} +1 -1
  31. package/web/app/immutable/chunks/{DSnERXrp.js → BF-IM3Qf.js} +1 -1
  32. package/web/app/immutable/chunks/{BiVahgoJ.js → BGX6W-wu.js} +1 -1
  33. package/web/app/immutable/chunks/{tcxAslUm.js → BI7MYBTt.js} +1 -1
  34. package/web/app/immutable/chunks/{DaaneYTG.js → BIEvH8pu.js} +1 -1
  35. package/web/app/immutable/chunks/{BSpir4qY.js → BIlaJXMS.js} +1 -1
  36. package/web/app/immutable/chunks/{MgErAKgQ.js → BKYCO_49.js} +2 -2
  37. package/web/app/immutable/chunks/{BmB6-2Ft.js → BL8tUtYB.js} +1 -1
  38. package/web/app/immutable/chunks/{BBlRLBe7.js → BMMoYJAn.js} +1 -1
  39. package/web/app/immutable/chunks/{CnJe4S2a.js → BMm9sGZ6.js} +1 -1
  40. package/web/app/immutable/chunks/{KJX0Kw6L.js → BP5uyQTv.js} +3 -3
  41. package/web/app/immutable/chunks/{DGYr0_ON.js → BP7CI4Qx.js} +1 -1
  42. package/web/app/immutable/chunks/{a1r6BT-e.js → BTWq1_ry.js} +1 -1
  43. package/web/app/immutable/chunks/{B-00FHnf.js → BUGXi07N.js} +1 -1
  44. package/web/app/immutable/chunks/{B5_270cz.js → BUdcKH65.js} +1 -1
  45. package/web/app/immutable/chunks/{D9ajM8uP.js → BVPvh88-.js} +1 -1
  46. package/web/app/immutable/chunks/{DAYo95RN.js → BVt_T8ao.js} +1 -1
  47. package/web/app/immutable/chunks/{quYX3pdL.js → BVviSubD.js} +1 -1
  48. package/web/app/immutable/chunks/{DXozNEH9.js → BX3QD7rd.js} +1 -1
  49. package/web/app/immutable/chunks/{n5fDR6Ys.js → BXTuZcZW.js} +1 -1
  50. package/web/app/immutable/chunks/{fCEIPyv5.js → BXeiKdwz.js} +1 -1
  51. package/web/app/immutable/chunks/{B_frQYKx.js → BYFJ74nm.js} +1 -1
  52. package/web/app/immutable/chunks/{DBSA3jai.js → BYMNRS4c.js} +1 -1
  53. package/web/app/immutable/chunks/{Ciqm_fPa.js → BYU1cTbO.js} +2 -2
  54. package/web/app/immutable/chunks/{CN6xxeS_.js → BYtSPAAW.js} +1 -1
  55. package/web/app/immutable/chunks/{Dyra2UkJ.js → BZLRqiW7.js} +1 -1
  56. package/web/app/immutable/chunks/{B7_gjxTl.js → BZcpShp8.js} +1 -1
  57. package/web/app/immutable/chunks/{CpWbjqtx.js → BabPi6C5.js} +1 -1
  58. package/web/app/immutable/chunks/{Bs3KgIll.js → Bb-m1QhD.js} +1 -1
  59. package/web/app/immutable/chunks/{BJO4jUAG.js → BbNk8c_P.js} +1 -1
  60. package/web/app/immutable/chunks/{84AlJNR3.js → Bba6So1V.js} +1 -1
  61. package/web/app/immutable/chunks/{ihu83Gf7.js → Bc5_gcpq.js} +1 -1
  62. package/web/app/immutable/chunks/{B1ywot0G.js → Bc6DihnT.js} +4 -4
  63. package/web/app/immutable/chunks/{B_a_b8VS.js → BdCclrfD.js} +1 -1
  64. package/web/app/immutable/chunks/{Wsz69q6g.js → BdD2ADMz.js} +1 -1
  65. package/web/app/immutable/chunks/{ClTZNeVO.js → BdkEw9JP.js} +1 -1
  66. package/web/app/immutable/chunks/{C0v3RBBR.js → BfZCAeqU.js} +1 -1
  67. package/web/app/immutable/chunks/{DIHT0C7u.js → BgX4ALX_.js} +3 -3
  68. package/web/app/immutable/chunks/{BgN4cuBh.js → BhMsVKL2.js} +1 -1
  69. package/web/app/immutable/chunks/{uI0ZG7MM.js → Bj3n1RUK.js} +1 -1
  70. package/web/app/immutable/chunks/{D8lUkQ-B.js → Bk2z5Cd0.js} +1 -1
  71. package/web/app/immutable/chunks/{1VG8gLVS.js → BkNc2eFX.js} +4 -4
  72. package/web/app/immutable/chunks/{DOqpTP8b.js → BkbQGifa.js} +1 -1
  73. package/web/app/immutable/chunks/BlZYlbA9.js +1 -0
  74. package/web/app/immutable/chunks/{nmrokYzj.js → BmP1Wws6.js} +1 -1
  75. package/web/app/immutable/chunks/{4NM3BVdw.js → BoCZH6mk.js} +1 -1
  76. package/web/app/immutable/chunks/{kHCC2X2-.js → BqQiAH0O.js} +1 -1
  77. package/web/app/immutable/chunks/{Bv5I7YDM.js → BqRoJfH0.js} +1 -1
  78. package/web/app/immutable/chunks/{BM1KP-FJ.js → BqqN40AD.js} +1 -1
  79. package/web/app/immutable/chunks/{d_IAf8cB.js → BrRRz1w6.js} +1 -1
  80. package/web/app/immutable/chunks/{D-aNPvuh.js → Bs26_0Q5.js} +2 -2
  81. package/web/app/immutable/chunks/{xNZ_GbEJ.js → BuTNFoR8.js} +1 -1
  82. package/web/app/immutable/chunks/{CeizKDc4.js → BvZrnx87.js} +1 -1
  83. package/web/app/immutable/chunks/{DxztdKvh.js → Bvc8qRhk.js} +1 -1
  84. package/web/app/immutable/chunks/{DcFwDOMt.js → BwSA3fCS.js} +1 -1
  85. package/web/app/immutable/chunks/{XvLHDIL-.js → ByCIOkhM.js} +1 -1
  86. package/web/app/immutable/chunks/{NnMVp6ZM.js → ByTOmivs.js} +1 -1
  87. package/web/app/immutable/chunks/{WvxOnEzW.js → ByuX26Ym.js} +4 -4
  88. package/web/app/immutable/chunks/{Bwjn3GNi.js → Bywuf0q4.js} +1 -1
  89. package/web/app/immutable/chunks/{Cn3xolhp.js → C-M7eh_Z.js} +1 -1
  90. package/web/app/immutable/chunks/C-MmtmWQ.js +1 -0
  91. package/web/app/immutable/chunks/{BHt8CzB9.js → C-ZPZDJB.js} +1 -1
  92. package/web/app/immutable/chunks/{Pat1u3oY.js → C0p8rhDn.js} +1 -1
  93. package/web/app/immutable/chunks/{CDFRnJ8k.js → C1nHAGLu.js} +1 -1
  94. package/web/app/immutable/chunks/{B9qFB97l.js → C3SYquhf.js} +1 -1
  95. package/web/app/immutable/chunks/C4dCVzfY.js +2 -0
  96. package/web/app/immutable/chunks/{DIumxlqP.js → C52Qm4vO.js} +1 -1
  97. package/web/app/immutable/chunks/{CdN2Ihv_.js → C5AlgdZ0.js} +1 -1
  98. package/web/app/immutable/chunks/{-a8kGB-5.js → C6WI65lc.js} +1 -1
  99. package/web/app/immutable/chunks/{D8gunWV0.js → C8AARFCw.js} +2 -2
  100. package/web/app/immutable/chunks/{CjZIABEV.js → C8BVjzNA.js} +1 -1
  101. package/web/app/immutable/chunks/{CvmMeam2.js → C8dU7SM3.js} +2 -2
  102. package/web/app/immutable/chunks/{-PfxOD5O.js → CAOA5kev.js} +2 -2
  103. package/web/app/immutable/chunks/{CNsCzECr.js → CBqGKeYg.js} +1 -1
  104. package/web/app/immutable/chunks/{BAR7XkP3.js → CEQZVenN.js} +1 -1
  105. package/web/app/immutable/chunks/{Cgm3wI9t.js → CG3imlyr.js} +1 -1
  106. package/web/app/immutable/chunks/{DV6k5cHH.js → CJ58g2zu.js} +1 -1
  107. package/web/app/immutable/chunks/{_RGinDCt.js → CKzqOQI8.js} +1 -1
  108. package/web/app/immutable/chunks/{Cn19T3na.js → CL2hu5s-.js} +1 -1
  109. package/web/app/immutable/chunks/{BjcX_fOv.js → CN-2rfdx.js} +1 -1
  110. package/web/app/immutable/chunks/{BnZdkxbc.js → CNIUwMPp.js} +1 -1
  111. package/web/app/immutable/chunks/{BRhVB6Sv.js → COrK0goa.js} +1 -1
  112. package/web/app/immutable/chunks/{DuIazAmY.js → CRQGIXhv.js} +1 -1
  113. package/web/app/immutable/chunks/{Bk2hJ8Ly.js → CSdIXJpO.js} +1 -1
  114. package/web/app/immutable/chunks/{C3MZ_izG.js → CVYjvOCP.js} +1 -1
  115. package/web/app/immutable/chunks/{CuXCq1os.js → CVoXekIe.js} +3 -3
  116. package/web/app/immutable/chunks/{DWiPdXwB.js → CW13jkE8.js} +1 -1
  117. package/web/app/immutable/chunks/{BA55iEBB.js → CWE4oREl.js} +1 -1
  118. package/web/app/immutable/chunks/{BQAjCr1w.js → CWQrbZgx.js} +1 -1
  119. package/web/app/immutable/chunks/CWT4x6lB.js +2 -0
  120. package/web/app/immutable/chunks/{CzQCBVm9.js → CW_fORnH.js} +1 -1
  121. package/web/app/immutable/chunks/{MZ6PO-qe.js → CXNfY5OA.js} +1 -1
  122. package/web/app/immutable/chunks/{B2pRmyv7.js → CYEd8dKU.js} +1 -1
  123. package/web/app/immutable/chunks/{BW1LTGV1.js → CYf2hryc.js} +1 -1
  124. package/web/app/immutable/chunks/{B1SJZtm3.js → CaGwo1Kh.js} +1 -1
  125. package/web/app/immutable/chunks/{CpXorioa.js → CaXjFtDt.js} +1 -1
  126. package/web/app/immutable/chunks/{BEyWfhqM.js → CaxyE6o_.js} +1 -1
  127. package/web/app/immutable/chunks/{CWIcIgSm.js → CbCgON3R.js} +1 -1
  128. package/web/app/immutable/chunks/{L30ES58t.js → CcXuSxXv.js} +1 -1
  129. package/web/app/immutable/chunks/{CVBmzjKd.js → CeT1zT46.js} +1 -1
  130. package/web/app/immutable/chunks/{CwRpBR2e.js → CeswpNyE.js} +1 -1
  131. package/web/app/immutable/chunks/{B461Cu-8.js → Cfj3Lc6y.js} +1 -1
  132. package/web/app/immutable/chunks/{DwSYIDzZ.js → CgQ2Q_uI.js} +1 -1
  133. package/web/app/immutable/chunks/{yl6pDKiQ.js → CgW9XFcu.js} +1 -1
  134. package/web/app/immutable/chunks/{D60l1rCk.js → ChY17Glq.js} +2 -2
  135. package/web/app/immutable/chunks/{nM9_StK8.js → Chj7QpdD.js} +1 -1
  136. package/web/app/immutable/chunks/{BYgJjg0e.js → Cjpu4SJA.js} +1 -1
  137. package/web/app/immutable/chunks/{BjnZ1Xf3.js → Ck9ZyE1n.js} +1 -1
  138. package/web/app/immutable/chunks/CkSjvO0_.js +1 -0
  139. package/web/app/immutable/chunks/{By0eqGj-.js → CoLl8pQb.js} +1 -1
  140. package/web/app/immutable/chunks/{CD6GiPmw.js → CpLvDQcH.js} +1 -1
  141. package/web/app/immutable/chunks/{DPBk4F6a.js → CpadbTI2.js} +45 -45
  142. package/web/app/immutable/chunks/{DdjlRG5U.js → CrfXhNNb.js} +1 -1
  143. package/web/app/immutable/chunks/CsxVJm8Y.js +1 -0
  144. package/web/app/immutable/chunks/{CInXeVe5.js → CteSc0c_.js} +1 -1
  145. package/web/app/immutable/chunks/{CxLPEkg7.js → CuhrgDBI.js} +1 -1
  146. package/web/app/immutable/chunks/{BgzyvwGo.js → CvWyDJGm.js} +1 -1
  147. package/web/app/immutable/chunks/{DkvJR80T.js → Cv_J2c72.js} +1 -1
  148. package/web/app/immutable/chunks/{DRSdBoB7.js → CzVyzyWv.js} +2 -2
  149. package/web/app/immutable/chunks/{DuG2OZjB.js → D3I0DcnM.js} +1 -1
  150. package/web/app/immutable/chunks/{DZmMN74z.js → D3mUsAm9.js} +1 -1
  151. package/web/app/immutable/chunks/{Bzblbh-D.js → D419Hgek.js} +1 -1
  152. package/web/app/immutable/chunks/{-v5-bXWK.js → D6Wx8h-l.js} +4 -4
  153. package/web/app/immutable/chunks/{CSveVSnU.js → D6YDmdhV.js} +2 -2
  154. package/web/app/immutable/chunks/{CHhGO97x.js → D6yqDOhs.js} +1 -1
  155. package/web/app/immutable/chunks/{BFqED1Hh.js → D8Ohjkn4.js} +2 -2
  156. package/web/app/immutable/chunks/{PDh5csw9.js → DATvyyct.js} +1 -1
  157. package/web/app/immutable/chunks/{rElTuGMj.js → DAoagkbK.js} +1 -1
  158. package/web/app/immutable/chunks/{5a7lyWYQ.js → DCDhq2rq.js} +1 -1
  159. package/web/app/immutable/chunks/{blPVVvA0.js → DDMEgpvU.js} +4 -4
  160. package/web/app/immutable/chunks/{DiAIgif8.js → DDfvytcD.js} +1 -1
  161. package/web/app/immutable/chunks/{Dkh7OUxN.js → DEjP-x_s.js} +1 -1
  162. package/web/app/immutable/chunks/DFF9daPQ.js +13 -0
  163. package/web/app/immutable/chunks/{D2pPI0H2.js → DInreQbI.js} +2 -2
  164. package/web/app/immutable/chunks/{R9ODE8FL.js → DLJVFWjT.js} +3 -3
  165. package/web/app/immutable/chunks/{hX9Crt6i.js → DLqztIqC.js} +1 -1
  166. package/web/app/immutable/chunks/{C3bwGgmD.js → DPDCu-py.js} +1 -1
  167. package/web/app/immutable/chunks/{ivrPoCwd.js → DPR3VaPZ.js} +1 -1
  168. package/web/app/immutable/chunks/{DVH2puba.js → DSf8k2cE.js} +1 -1
  169. package/web/app/immutable/chunks/DTQYcznv.js +1 -0
  170. package/web/app/immutable/chunks/{CMO4ot9F.js → DU8kuP6M.js} +1 -1
  171. package/web/app/immutable/chunks/{SrezSe0o.js → DW36BCXj.js} +1 -1
  172. package/web/app/immutable/chunks/{CdqlgErf.js → DXCE75Ih.js} +1 -1
  173. package/web/app/immutable/chunks/{htyZQ7p9.js → DXDMhDlS.js} +1 -1
  174. package/web/app/immutable/chunks/{C1h34H4x.js → DYk0s6f0.js} +1 -1
  175. package/web/app/immutable/chunks/{zWI60sec.js → DYmPPjiq.js} +1 -1
  176. package/web/app/immutable/chunks/{BBC8ZwBc.js → DZmwTozc.js} +1 -1
  177. package/web/app/immutable/chunks/{BBKQVY9d.js → DZxSFexp.js} +1 -1
  178. package/web/app/immutable/chunks/{D89Fvz2g.js → D_2_kcuU.js} +1 -1
  179. package/web/app/immutable/chunks/{CgLCO0VS.js → DbK3CxeL.js} +1 -1
  180. package/web/app/immutable/chunks/{CmSDhJgU.js → Dc64E_SR.js} +1 -1
  181. package/web/app/immutable/chunks/{BnrnoFjd.js → DdSX2jjJ.js} +1 -1
  182. package/web/app/immutable/chunks/{HLKPZgVy.js → Ddw98WmY.js} +1 -1
  183. package/web/app/immutable/chunks/{gsElU_36.js → De4z9gHo.js} +1 -1
  184. package/web/app/immutable/chunks/{ozzjQyCh.js → Dk6iNNLu.js} +1 -1
  185. package/web/app/immutable/chunks/{ZjzfSXHu.js → DkQ7I_3J.js} +5 -5
  186. package/web/app/immutable/chunks/{D2Ntkwf_.js → DlHB0ULA.js} +2 -2
  187. package/web/app/immutable/chunks/{b-gQtgOb.js → Dlag9Uxb.js} +4 -4
  188. package/web/app/immutable/chunks/{C8j358_U.js → DnpnDt-B.js} +1 -1
  189. package/web/app/immutable/chunks/{D0GCx3sO.js → DpHl7r8K.js} +1 -1
  190. package/web/app/immutable/chunks/{DVYqzV0n.js → DpMTpLDQ.js} +1 -1
  191. package/web/app/immutable/chunks/{CfPxdWJl.js → DpsFFL7J.js} +1 -1
  192. package/web/app/immutable/chunks/{D7QiNhGR.js → Dq3RHtWu.js} +1 -1
  193. package/web/app/immutable/chunks/{CERb2-2E.js → Dq3leYTy.js} +1 -1
  194. package/web/app/immutable/chunks/{CXm95Q2a.js → Dq6CuXZE.js} +1 -1
  195. package/web/app/immutable/chunks/{Ct-2wSQ6.js → DqJ-M21G.js} +1 -1
  196. package/web/app/immutable/chunks/{CjtYlgpc.js → DqvXXMrh.js} +1 -1
  197. package/web/app/immutable/chunks/{D__R5V-4.js → Drt5qRI8.js} +1 -1
  198. package/web/app/immutable/chunks/{CUp3pS17.js → Ds3Wirif.js} +41 -41
  199. package/web/app/immutable/chunks/{GVckKXJ5.js → Dsmvkh8d.js} +1 -1
  200. package/web/app/immutable/chunks/{Djb279-4.js → DtKh4Q6Q.js} +1 -1
  201. package/web/app/immutable/chunks/{Czqd0ZZn.js → DwKUz42C.js} +1 -1
  202. package/web/app/immutable/chunks/{TsEB3aw-.js → Dwyq6WEC.js} +1 -1
  203. package/web/app/immutable/chunks/{CMQoXdpQ.js → Dx41gQiN.js} +1 -1
  204. package/web/app/immutable/chunks/{4gxaObsl.js → DxNbgJ8X.js} +2 -2
  205. package/web/app/immutable/chunks/{l6o3Xx95.js → Dz4sFk1c.js} +1 -1
  206. package/web/app/immutable/chunks/{BCXwgWax.js → DzHHkfB1.js} +1 -1
  207. package/web/app/immutable/chunks/{JTj2pw56.js → EbDWf2Y-.js} +1 -1
  208. package/web/app/immutable/chunks/{tHDPdTwr.js → Ek5W6pp5.js} +1 -1
  209. package/web/app/immutable/chunks/{DJuVbNrB.js → GETqdV-9.js} +1 -1
  210. package/web/app/immutable/chunks/{ViWKv_qM.js → H60Tbroe.js} +1 -1
  211. package/web/app/immutable/chunks/{SxNmK2GR.js → HvBMlLJP.js} +3 -3
  212. package/web/app/immutable/chunks/JzAjTSJP.js +1 -0
  213. package/web/app/immutable/chunks/{BXTPVho9.js → PPmweWGv.js} +2 -2
  214. package/web/app/immutable/chunks/{YRBYMsQ5.js → PrJr0a2j.js} +1 -1
  215. package/web/app/immutable/chunks/{BDo7DlDu.js → PwvNS9aJ.js} +1 -1
  216. package/web/app/immutable/chunks/{CfaMHdWP.js → RvvsGyv8.js} +1 -1
  217. package/web/app/immutable/chunks/{BBAp8oIt.js → UYKGMt9K.js} +1 -1
  218. package/web/app/immutable/chunks/{BxQzYe9E.js → VyOfhH-C.js} +1 -1
  219. package/web/app/immutable/chunks/{CjXLe_MO.js → X8W_BfF4.js} +1 -1
  220. package/web/app/immutable/chunks/{Ct8owPqN.js → XIXbmV8F.js} +1 -1
  221. package/web/app/immutable/chunks/{lsICrwNh.js → X_y6HQmR.js} +1 -1
  222. package/web/app/immutable/chunks/{CIX0DuRO.js → XzMpMF29.js} +1 -1
  223. package/web/app/immutable/chunks/{DnTKe3X-.js → YNoNxkXn.js} +2 -2
  224. package/web/app/immutable/chunks/{BCQ-e5LR.js → ZI2UcNVx.js} +1 -1
  225. package/web/app/immutable/chunks/{BUY1W-f0.js → _xNtAuSN.js} +1 -1
  226. package/web/app/immutable/chunks/{Cftldgk7.js → aETzmnsD.js} +1 -1
  227. package/web/app/immutable/chunks/{CZNjFz9H.js → fZqvRnJh.js} +1 -1
  228. package/web/app/immutable/chunks/{B10JrSzM.js → finAdq6c.js} +1 -1
  229. package/web/app/immutable/chunks/{C4Jo6GXP.js → gURPJ1oX.js} +1 -1
  230. package/web/app/immutable/chunks/{Dab1wvUg.js → j5aoAM0N.js} +1 -1
  231. package/web/app/immutable/chunks/{CyGN0Rwg.js → m18NZZRr.js} +1 -1
  232. package/web/app/immutable/chunks/{DIyuJ_GU.js → m3ndyWcI.js} +1 -1
  233. package/web/app/immutable/chunks/{BIY2S7K4.js → n58mTCVv.js} +1 -1
  234. package/web/app/immutable/chunks/{CHFUz5Rr.js → oilydQC6.js} +1 -1
  235. package/web/app/immutable/chunks/{iMyDpxOV.js → oxLL7zSC.js} +1 -1
  236. package/web/app/immutable/chunks/{Ba7k-40o.js → p3fN-Vr3.js} +1 -1
  237. package/web/app/immutable/chunks/{C-s9_soQ.js → s_GzTTEG.js} +1 -1
  238. package/web/app/immutable/chunks/{DVN2Xze9.js → t_3vjEsA.js} +1 -1
  239. package/web/app/immutable/chunks/{CHGTw2Bl.js → xOJeCqJf.js} +1 -1
  240. package/web/app/immutable/chunks/{juUcLrve.js → zN8eBYty.js} +1 -1
  241. package/web/app/immutable/entry/{app.9r9RhFng.js → app.Ci0fqF_i.js} +3 -3
  242. package/web/app/immutable/entry/start.DzDtsQrC.js +1 -0
  243. package/web/app/immutable/nodes/{0._MOrvR24.js → 0.BJcKF537.js} +1 -1
  244. package/web/app/immutable/nodes/{1.DVvUSeXg.js → 1.Dj_1C4wl.js} +1 -1
  245. package/web/app/immutable/nodes/{10.DIleurXr.js → 10.DTBkzFBQ.js} +1 -1
  246. package/web/app/immutable/nodes/{11.CPz1gfx7.js → 11.C9N9_Xb9.js} +1 -1
  247. package/web/app/immutable/nodes/{12.IWuvbIEt.js → 12.CqRfopX4.js} +1 -1
  248. package/web/app/immutable/nodes/{13.K9ySk2sQ.js → 13.CscEwLVK.js} +3 -3
  249. package/web/app/immutable/nodes/{14.BR3FpNbu.js → 14.BDOAvRMB.js} +1 -1
  250. package/web/app/immutable/nodes/{15.MdkxIvV5.js → 15.BWtoiI44.js} +1 -1
  251. package/web/app/immutable/nodes/{16.CKCeF79S.js → 16.Cfgb0nOQ.js} +1 -1
  252. package/web/app/immutable/nodes/{17.DNzYNnAu.js → 17.yV85i6g8.js} +2 -2
  253. package/web/app/immutable/nodes/{2.DJLdbLzb.js → 2.B_fHdNW9.js} +11 -11
  254. package/web/app/immutable/nodes/{3.BgL634Ss.js → 3.CzW2JK5A.js} +1 -1
  255. package/web/app/immutable/nodes/4.DP65YvXF.js +1 -0
  256. package/web/app/immutable/nodes/{5.sL-y10DG.js → 5.ivE-5gZP.js} +2 -2
  257. package/web/app/immutable/nodes/{6.Ci8BcEFn.js → 6.58wOdki0.js} +1 -1
  258. package/web/app/immutable/nodes/{7.BxPcDZ4n.js → 7.9Khb1Buc.js} +1 -1
  259. package/web/app/immutable/nodes/{8.DfInEKdf.js → 8.omc6d3jg.js} +12 -12
  260. package/web/app/immutable/nodes/{9.ChF6BmYv.js → 9._4FUjrca.js} +20 -20
  261. package/web/app/version.json +1 -1
  262. package/web/generated/paraglide.js +9 -9
  263. package/web/index.html +19 -19
  264. package/web/app/immutable/chunks/BAf7ckig.js +0 -1
  265. package/web/app/immutable/chunks/BCmtMsc3.js +0 -1
  266. package/web/app/immutable/chunks/BMQaU_PE.js +0 -2
  267. package/web/app/immutable/chunks/C2V9igbA.js +0 -1
  268. package/web/app/immutable/chunks/CGWRZzdk.js +0 -1
  269. package/web/app/immutable/chunks/CVc7LcaQ.js +0 -13
  270. package/web/app/immutable/chunks/DQJminLw.js +0 -1
  271. package/web/app/immutable/chunks/DrtMUjoh.js +0 -2
  272. package/web/app/immutable/chunks/FQr_NSnS.js +0 -1
  273. package/web/app/immutable/entry/start.C8tteIq6.js +0 -1
  274. package/web/app/immutable/nodes/4.CR0sD7s6.js +0 -1
@@ -1,4 +1,4 @@
1
- var $l=Object.defineProperty;var Ol=(r,t,n)=>t in r?$l(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n;var kn=(r,t,n)=>Ol(r,typeof t!="symbol"?t+"":t,n);import{t as It,br as g,a_ as B,bz as St,b as Tt,bp as f,bt as Kn,bv as dr,bu as ql,bs as ha}from"./CGWRZzdk.js";import{ai as aa,bs as Ct,ca as sr,aD as e,bH as j,ay as xe,bS as T,a7 as Rt,W as u,a5 as z,bA as R,bn as At,c9 as s,bV as we,aA as m,b_ as $,aj as Sr,aB as I,be as gr,b$ as Or,bO as J,bf as or,c0 as Cn,bl as oe,bj as jn,c6 as Dl,bo as za,br as Yr,am as Dn,ax as Bn,bk as as,aw as va,bz as ss,cb as ms,c5 as Ha,aC as xr,cd as _o,bv as Bl}from"./DYhIMPy1.js";import{n as Tr,u as te,v as ze,g as _n,s as ps,w as _a,j as kt,l as ar,p as Yn,I as Fl,i as ya,r as zl,o as eo,X as _i,q as Wl,S as Hl,C as Ul}from"./BjnZ1Xf3.js";import{I as Kt,F as qa,c as ea,j as jl,s as yi,p as to,y as Vl,u as Kl,t as $r,g as oa,B as ws,E as os,S as Gl}from"./BM1KP-FJ.js";import{b as cn}from"./BaIAhI85.js";import{f as Xe,bj as Ql,am as ro,bt as Zl,bx as xs,bL as Jl}from"./KJX0Kw6L.js";import"./C-s9_soQ.js";import"./CzQCBVm9.js";import"./ClTZNeVO.js";import{s as Ln}from"./BEyWfhqM.js";import{F as jt,a0 as zs,bc as Tn,cF as no,aq as bi,aV as wi,aG as Xl,c4 as Yl,a2 as is,aJ as ed,cI as td,cH as rd,$ as vs,as as ao,I as yo,af as nd,bq as ad,aO as sd,aT as od,bF as id,ak as ld,cx as dd,ay as bo,aL as wo,bX as ks,aE as Ua,cR as cd,c6 as ud,bj as fd,b as gd,ck as md,ac as pd,b6 as Is,cm as xa,cA as vd,a as hd}from"./By0eqGj-.js";import{c as xi,A as _d,x as yd}from"./HLKPZgVy.js";import{b as Ss,V as xo}from"./ozzjQyCh.js";import{a as ki,b7 as Pr,A as Ga,ao as Ii,s as bd,n as Si,d as wd,I as xd,R as kd,ax as Id,a0 as Sd}from"./b-gQtgOb.js";import{bX as Ti,j as Qa,a6 as Ws,al as ls,F as Td,au as Za,aN as Cd,aQ as ko}from"./CUp3pS17.js";import{t as ia,o as Ad}from"./gsElU_36.js";import{c3 as Ja,aC as Da,cQ as Ci,cS as Vn,bU as hs,j as Md,cJ as Ai,cP as _s,cO as Mi,cM as Pi,g as Nn,aa as Pd,ab as Rd,ax as Ed,s as Nd,K as Ld,W as Io,v as Ri,dO as $d,at as Od,k as qd,u as Ts,a6 as Dd,n as Bd,O as Fd,o as zd,S as Wd,R as Hd,a0 as Ud,q as Ei,r as Ni,l as jd,cT as Vd,a4 as Kd,D as Gd,x as Qd,V as So}from"./C0g2TqGQ.js";import{Ix as yt,oz as Zd,t9 as Xa,no as To,v1 as Li,v3 as $i,rn as Jd,xZ as ds,uk as Oi,nj as qi,bd as Ya,x_ as Xd,q1 as Yd,sG as ec,uW as Di,ni as tc,mp as rc,g as nc,yq as ac,yn as sc,yp as oc}from"./CicdOSYm.js";import{a2 as ic,x as Cs,a0 as lc,O as As,V as dc,_ as cc,j as uc,o as ka,M as fa,p as fc,F as gc,u as mc,s as pc,L as Ms,J as vc,y as hc,K as _c,Z as Ma,Q as ja,N as Co,m as Ao,E as yc,c as Ps,B as Mo,z as bc,v as Po,H as Pa,P as wc,G as xc,i as kc,R as Ic,T as Sc,A as Tc,g as Cc,b as Ac,D as Mc,f as Pc,e as Rc,a as Ec,C as Nc,h as Lc,U as Bi,a3 as $c,t as Oc,k as qc,d as Ro}from"./R9ODE8FL.js";import{i as Dc,e as Bc}from"./DaaneYTG.js";import{g as Rs}from"./BvFAWM27.js";import{M as Ia,C as Ra}from"./WvxOnEzW.js";import{C as Eo}from"./rElTuGMj.js";import"./-a8kGB-5.js";import{P as Fc}from"./ivrPoCwd.js";import"./B_frQYKx.js";import{c as Fi}from"./ChTqQfQN.js";import{S as zc}from"./CInXeVe5.js";import{D as No,M as Wc}from"./B1ywot0G.js";import{b as Hc,s as na,c as cs}from"./D0GCx3sO.js";import{O as es,y as Es,E as Ns,B as Ls,N as Uc,m as jc,l as Vc,d as us,C as Lo,f as Kc,e as Gc,g as Qc}from"./uI0ZG7MM.js";import{a as zi,s as $o}from"./BsieX9dN.js";import{f as Zc}from"./BdWqymET.js";import{c as dn}from"./BAf7ckig.js";import{P as Jc}from"./fCEIPyv5.js";import{v as $s,t as Os,K as Oo,h as Xc}from"./D60l1rCk.js";import{R as Hs,C as ys,k as Yc,h as eu,g as tu,i as qo,P as ru}from"./CxLPEkg7.js";import"./DVYqzV0n.js";import{R as Do,x as Na,o as Wi}from"./MgErAKgQ.js";import{B as nu}from"./DuIazAmY.js";import{o as Hi,r as au,e as su}from"./DSnERXrp.js";import{o as Ui}from"./D-aNPvuh.js";import{g as so}from"./zWI60sec.js";import{a as ou,M as iu}from"./B10JrSzM.js";import{c as Sa}from"./nmrokYzj.js";import{A as lu}from"./BBlRLBe7.js";import{f as du,d as cu}from"./CpWbjqtx.js";import{a8 as uu,N as fu,Y as gu,K as Bo,X as mu,v as pu}from"./-v5-bXWK.js";import{a as vu}from"./CC7to1B5.js";import{G as hu}from"./DHP1DFPI.js";import{S as _u}from"./Wsz69q6g.js";import{u as yu,a as bu,c as Fo,S as wu}from"./DfxQWSVU.js";import{T as Us}from"./BgzyvwGo.js";import"./BjcX_fOv.js";import{g as xu}from"./B461Cu-8.js";import{a as ku}from"./CmSDhJgU.js";import{b as Iu}from"./CWIcIgSm.js";import{b as zo}from"./p7znhYIU.js";import{g as Su,i as Tu,a as Cu}from"./hX9Crt6i.js";import{n as Wo,o as Ho,b as ma,s as Ta,_ as qs,e as Au}from"./CIyUrgF0.js";import{aW as Un,B as Mu}from"./CvmMeam2.js";import{x as Pu}from"./BAR7XkP3.js";import{c as Ru}from"./D2pPI0H2.js";function Eu(r){if(!r||typeof r!="object")return null;const t=r;if(t.type!=="script_monitor_wake"||t.source!=="system")return null;const{scriptName:n,scriptId:a,runId:o,monitorId:i,workspaceId:d,reason:c}=t;if(typeof n!="string"||typeof a!="string"||!a||typeof o!="string"||!o||typeof i!="string"||!i||typeof d!="string"||!d||c!=="finished"&&c!=="ttl-expired"&&c!=="output-match"&&c!=="line-count")return null;const h=t.trigger;return{scriptName:n,scriptId:a,runId:o,monitorId:i,workspaceId:d,reason:c,...c==="output-match"&&typeof h?.matchedLine=="string"?{matchedLine:h.matchedLine}:{}}}function Nu(r){return r?.type==="script_monitor_wake"&&!("remoteAgentId"in r)}function Lu(r,t,n,a=!1){if(!r||!t)return{edit:!1,remove:!1,sendNow:!1};const o=r.messageMetadata?.fromPrincipalId??r.author?.principalId,i=uu(r)&&r.author?.principalId!==null&&o===t;return{edit:i,remove:i||t===n||a,sendNow:(i||a)&&!ji(r)}}function Ca(r,t){if(t)return r.find(n=>n.editing&&n.editingMessageId?n.editingMessageId===t:n.id===t)}function ji(r){return Nu(r.messageMetadata)&&typeof r.messageMetadata?.monitorId=="string"}function Uo(r,t=Date.now()){const n=r.messageMetadata,a=n?.fromPrincipalId,o=n&&Object.hasOwn(n,"humanAuthor")&&!(typeof a=="string"&&a.length>0),i=r.holdKind!==void 0&&Date.parse(r.holdUntil??"")>t;return!r.editing&&!i&&!o&&!ji(r)}const j_="pl-3.5! pr-2!";var $u=I('<span class="tile-remove-slot svelte-d8pwpf"><!></span>'),jo=I('<span class="attachment-status svelte-d8pwpf"> </span>'),Ou=I('<div class="file-image tile svelte-d8pwpf" data-kind="file"><!> <!> <div class="tile-actions svelte-d8pwpf"><!> <!></div></div>'),qu=I("<!><span> </span>",1),Du=I('<img alt="" draggable="false"/>'),Bu=I('<span class="summary svelte-d8pwpf" data-clip-summary=""> </span>'),Fu=I('<span class="clip svelte-d8pwpf"><span class="record-dot svelte-d8pwpf" aria-hidden="true"></span><span class="duration svelte-d8pwpf"> </span><!></span>'),zu=I('<div class="tile svelte-d8pwpf"><!> <!> <div class="tile-actions svelte-d8pwpf"><!> <!></div></div>'),Wu=I('<div class="attachment-row svelte-d8pwpf" role="group" data-dock-media-attachments=""></div>'),Hu=I("<!> <!> <!>",1),Uu=I('<img draggable="false" class="svelte-d8pwpf"/>'),ju=I('<video controls="" playsinline="" class="svelte-d8pwpf"></video>',2),Vu=I('<div class="media-viewer svelte-d8pwpf"><!></div>'),Ku=I("<!> <!>",1);function Gu(r,t){if(new.target)return It({component:Gu,...r});Ct(t,!0);const n=(O,ye=or,pe=or)=>{var A=$u(),ge=z(A);Xe(ge,{variant:"secondary",size:"icon-sm",class:"tile-action tile-remove",get disabled(){return i()},get"aria-label"(){return pe()},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return pe()},onclick:()=>q(ye()),children:(Te,Be)=>{Ss(Te,{glyph:"x"})},$$slots:{default:!0}}),R(A),u(O,A)};let a=g(t,"items",7),o=g(t,"labels",7),i=g(t,"disabled",7,!1),d=g(t,"onMarkUp",7),c=g(t,"onEdit",7),h=g(t,"onRemove",7),v=g(t,"onRetry",7),b=g(t,"onCopy",7),k=g(t,"onMenu",7);const N=O=>O.owner==="attachment"?2:{image:0,clip:1,file:2}[O.kind],Y=s(()=>[...a()].sort((O,ye)=>N(O)-N(ye)));let S=we(null),D=we(!1),ie=we(null),X=null;const M=s(()=>a().find(O=>O.id===e(ie)));sr(()=>{(!e(M)||e(M).kind==="image"&&!W(e(M)))&&j(D,!1)});function W(O){return O.kind==="image"&&O.status!=="placing"&&O.status!=="failed"&&O.url.trim().length>0}function E(O){return O.kind==="image"?o().image(O.markCount):O.kind==="clip"?O.summary?`${o().clip(O.duration)} ${O.summary}`:o().clip(O.duration):O.name}function ne(O,ye){if(!(i()||O.kind==="file"||O.kind==="image"&&!W(O)||O.kind==="clip"&&(!O.url||O.recording))){if((O.kind==="clip"||O.kind==="image")&&c()){c()(O.id);return}X=ye,j(ie,O.id,!0),j(D,!0)}}async function q(O){i()||(e(ie)===O&&j(D,!1),h()(O),await Cn(),(!document.activeElement||document.activeElement===document.body)&&e(S)?.querySelector("button:not(:disabled)")?.focus())}function F(O){const ye=a().find(pe=>pe.id===O);i()||!ye||!W(ye)||(j(D,!1),c()?c()(O):d()(O))}function ae(O,ye){O.key!=="Delete"||i()||(O.preventDefault(),O.stopPropagation(),q(ye))}function C(O){return O.status==="placing"||O.status==="failed"?!1:O.kind==="image"?!!O.file||W(O):O.kind==="clip"&&!O.recording&&!!O.url}function ee(O,ye){const pe=Ql()?O.metaKey:O.ctrlKey,A=O.key.toLowerCase();if(pe&&!O.shiftKey&&!O.altKey&&(A==="c"||A==="x")){if(!b()||!C(ye)||(O.preventDefault(),O.stopPropagation(),A==="x"&&i()))return;b()(ye.id,A==="x");return}ae(O,ye.id)}function le(O,ye){!k()||!C(ye)||(O.preventDefault(),k()(ye.id))}var me={get items(){return a()},set items(O){a(O),m()},get labels(){return o()},set labels(O){o(O),m()},get disabled(){return i()},set disabled(O=!1){i(O),m()},get onMarkUp(){return d()},set onMarkUp(O){d(O),m()},get onEdit(){return c()},set onEdit(O){c(O),m()},get onRemove(){return h()},set onRemove(O){h(O),m()},get onRetry(){return v()},set onRetry(O){v(O),m()},get onCopy(){return b()},set onCopy(O){b(O),m()},get onMenu(){return k()},set onMenu(O){k(O),m()},$set:St,$on:(O,ye)=>Tt(t,O,ye)},_e=Ku(),Re=xe(_e);{var Le=O=>{var ye=Wu();Tr(ye,21,()=>e(Y),pe=>pe.id,(pe,A)=>{var ge=Rt(),Te=xe(ge);{var Be=P=>{var Q=Ou(),re=z(Q);{let G=s(()=>i()||e(A).status==="placing");ki(re,{get id(){return e(A).id},get name(){return e(A).file.name},get type(){return e(A).file.imageMimeType},get imageData(){return e(A).file.imageData},get imageMimeType(){return e(A).file.imageMimeType},variant:"thumbnail",thumbnailClass:"size-full",class:"size-full",get disabled(){return e(G)},get placementStatus(){return e(A).status},get placementError(){return e(A).error}})}var se=T(re,2);{var ce=G=>{var Ee=jo(),De=oe(Ee,!0);$(()=>{te(Ee,"data-failed",e(A).status==="failed"||void 0),te(Ee,"role",e(A).status==="failed"?"alert":"status"),te(Ee,"title",e(A).error),J(De,e(A).status==="failed"?e(A).error??o().attachmentFailed:o().attachmentPending)}),u(G,Ee)};B(se,G=>{e(A).status&&G(ce)})}var w=T(se,2),Se=z(w);{var Ae=G=>{Xe(G,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return o().retry},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return o().retry},onclick:()=>v()?.(e(A).id),children:(Ee,De)=>{jt(Ee,{get icon(){return zs},size:16})},$$slots:{default:!0}})};B(Se,G=>{e(A).status==="failed"&&v()&&G(Ae)})}var L=T(Se,2);{let G=s(()=>f.chat_attachmentPreview_remove_ariaLabel({name:e(A).file.name}));n(L,()=>e(A).id,()=>e(G))}R(w),R(Q),$(()=>te(Q,"data-attachment-id",e(A).id)),Sr("keydown",Q,G=>ee(G,e(A))),Sr("contextmenu",Q,G=>le(G,e(A))),Kt(1,Q,()=>qa,()=>({tier:"fast",y:3,scale:.98})),Kt(2,Q,()=>ea,()=>({tier:"fast"})),u(P,Q)},Ce=P=>{const Q=s(()=>e(A).kind==="image"&&!W(e(A))&&e(A).status!=="failed");var re=zu(),se=z(re);{var ce=ve=>{Xe(ve,{type:"button",variant:"ghost",wrapContent:!1,class:"open-tile file",get"aria-label"(){return e(A).name},get disabled(){return i()},onkeydown:Oe=>ae(Oe,e(A).id),children:(Oe,U)=>{var ue=qu(),ot=xe(ue);jt(ot,{get icon(){return Tn},size:20});var xt=T(ot),mt=oe(xt,!0);$(()=>J(mt,e(A).name)),u(Oe,ue)},$$slots:{default:!0}})},w=ve=>{{let Oe=s(()=>E(e(A))),U=s(()=>i()||e(A).kind==="clip"&&(e(A).recording||!e(A).url));Xe(ve,{type:"button",variant:"ghost",wrapContent:!1,class:"open-tile",get"aria-label"(){return e(Oe)},get disabled(){return e(U)},onkeydown:ue=>ee(ue,e(A)),onclick:ue=>{ue.currentTarget instanceof HTMLElement&&ne(e(A),ue.currentTarget)},children:(ue,ot)=>{var xt=Rt(),mt=xe(xt);{var Ft=je=>{var bt=Du();$(()=>te(bt,"src",e(A).url)),u(je,bt)},pt=je=>{var bt=Fu(),at=T(z(bt)),dt=oe(at,!0),$e=T(at);{var ft=K=>{var _=Bu(),he=oe(_,!0);$(()=>J(he,e(A).summary)),u(K,_)};B($e,K=>{e(A).summary&&K(ft)})}R(bt),$(()=>J(dt,e(A).duration)),u(je,bt)};B(mt,je=>{e(A).kind==="image"?je(Ft):je(pt,-1)})}u(ue,xt)},$$slots:{default:!0}})}},Se=s(()=>e(A).kind!=="image"||W(e(A)));B(se,ve=>{e(A).kind==="file"?ve(ce):e(Se)&&ve(w,1)})}var Ae=T(se,2);{var L=ve=>{var Oe=jo(),U=oe(Oe,!0);$(()=>{te(Oe,"data-failed",e(A).status==="failed"||void 0),te(Oe,"role",e(A).status==="failed"?"alert":"status"),te(Oe,"title",e(A).error),J(U,e(A).status==="failed"?e(A).error??o().attachmentFailed:o().attachmentPending)}),u(ve,Oe)};B(Ae,ve=>{(e(A).status||e(Q))&&ve(L)})}var G=T(Ae,2),Ee=z(G);{var De=ve=>{Xe(ve,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return o().retry},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return o().retry},onclick:()=>v()?.(e(A).id),children:(Oe,U)=>{jt(Oe,{get icon(){return zs},size:16})},$$slots:{default:!0}})},Je=ve=>{{let Oe=s(()=>c()?o().edit:o().markUp),U=s(()=>c()?o().edit:o().markUp);Xe(ve,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return e(Oe)},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return e(U)},onclick:()=>F(e(A).id),children:(ue,ot)=>{Ss(ue,{glyph:"pencil"})},$$slots:{default:!0}})}},Ge=s(()=>W(e(A))),Bt=ve=>{{let Oe=s(()=>c()?o().edit:o().play),U=s(()=>c()?o().edit:o().play);Xe(ve,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return e(Oe)},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return e(U)},onclick:ue=>{ue.currentTarget instanceof HTMLElement&&ne(e(A),ue.currentTarget)},children:(ue,ot)=>{{let xt=s(()=>c()?"pencil":"play");Ss(ue,{get glyph(){return e(xt)}})}},$$slots:{default:!0}})}};B(Ee,ve=>{e(A).status==="failed"&&v()?ve(De):e(Ge)?ve(Je,1):e(A).kind==="clip"&&!e(A).recording&&e(A).url&&ve(Bt,2)})}var ke=T(Ee,2);n(ke,()=>e(A).id,()=>o().remove),R(G),R(re),$(()=>{te(re,"data-kind",e(A).kind),te(re,"data-attachment-id",e(A).id),te(re,"aria-busy",e(Q)||void 0)}),Sr("contextmenu",re,ve=>le(ve,e(A))),Kt(1,re,()=>qa,()=>({tier:"fast",y:3,scale:.98})),Kt(2,re,()=>ea,()=>({tier:"fast"})),u(P,re)};B(Te,P=>{e(A).kind==="image"&&e(A).file?P(Be):P(Ce,-1)})}u(pe,ge)}),R(ye),cn(ye,pe=>j(S,pe),()=>e(S)),$(()=>te(ye,"aria-label",o().attachments)),u(O,ye)};B(Re,O=>{e(Y).length&&O(Le)})}var Ke=T(Re,2);{const O=pe=>{var A=Rt(),ge=xe(A);{var Te=Be=>{var Ce=Hu(),P=xe(Ce);{var Q=w=>{Xe(w,{variant:"primary",get disabled(){return i()},onclick:()=>e(M)&&F(e(M).id),children:(Se,Ae)=>{gr();var L=Or();$(()=>J(L,o().markUp)),u(Se,L)},$$slots:{default:!0}})},re=s(()=>W(e(M)));B(P,w=>{e(re)&&w(Q)})}var se=T(P,2);Xe(se,{variant:"secondary",get disabled(){return i()},onclick:()=>e(M)&&q(e(M).id),children:(w,Se)=>{gr();var Ae=Or();$(()=>J(Ae,o().remove)),u(w,Ae)},$$slots:{default:!0}});var ce=T(se,2);Xe(ce,{variant:"ghost-light",onclick:()=>{j(D,!1)},children:(w,Se)=>{gr();var Ae=Or();$(()=>J(Ae,o().done)),u(w,Ae)},$$slots:{default:!0}}),u(Be,Ce)};B(ge,Be=>{e(M)&&e(M).kind!=="file"&&Be(Te)})}u(pe,A)};let ye=s(()=>e(M)?E(e(M)):o().attachments);xi(Ke,{get title(){return e(ye)},size:"wide",showCloseButton:!1,onCloseAutoFocus:pe=>{pe.preventDefault(),X?.isConnected?X.focus():e(S)?.querySelector("button:not(:disabled)")?.focus()},get open(){return e(D)},set open(pe){j(D,pe,!0)},footer:O,children:(pe,A)=>{var ge=Rt(),Te=xe(ge);{var Be=Ce=>{var P=Vu(),Q=z(P);{var re=w=>{var Se=Uu();$(Ae=>{te(Se,"src",e(M).url),te(Se,"alt",Ae)},[()=>E(e(M))]),u(w,Se)},se=s(()=>e(M).kind==="image"&&W(e(M))),ce=w=>{var Se=ju();$(Ae=>{te(Se,"src",e(M).url),te(Se,"aria-label",Ae)},[()=>E(e(M))]),u(w,Se)};B(Q,w=>{e(se)?w(re):e(M).kind==="clip"&&e(M).url&&w(ce,1)})}R(P),u(Ce,P)};B(Te,Ce=>{e(M)&&e(M).kind!=="file"&&Ce(Be)})}u(pe,ge)},$$slots:{footer:!0,default:!0}})}return u(r,_e),At(me)}aa(["keydown","contextmenu"]);var Qu=I("<!> ",1),Zu=I('<div class="flex flex-col gap-2 px-4 py-3 bg-muted/30 border border-border rounded-lg my-4"><div class="flex items-center justify-between gap-2"><div class="flex items-center gap-2"><div class="shrink-0 text-subtle"><!></div> <div class="font-medium text-sm"> </div></div> <div class="flex items-center gap-1"><!> <!></div></div> <div class="text-xs text-subtle"> </div> <pre class="text-xs bg-background/50 rounded p-2 overflow-x-auto max-h-40 overflow-y-auto font-mono"> </pre></div>');function Vi(r,t){if(new.target)return It({component:Vi,...r});Ct(t,!0);let n=g(t,"name",7),a=g(t,"description",7),o=g(t,"content",7),i=g(t,"onUseScript",7),d=we(!1);function c(){navigator.clipboard.writeText(o()),j(d,!0),setTimeout(()=>{j(d,!1)},2e3)}function h(){i()?.({name:n(),description:a(),content:o()})}var v={get name(){return n()},set name(C){n(C),m()},get description(){return a()},set description(C){a(C),m()},get content(){return o()},set content(C){o(C),m()},get onUseScript(){return i()},set onUseScript(C){i(C),m()},$set:St,$on:(C,ee)=>Tt(t,C,ee)},b=Zu(),k=z(b),N=z(k),Y=z(N),S=z(Y);jt(S,{get icon(){return no},size:"sm"}),R(Y);var D=T(Y,2),ie=oe(D,!0);R(N);var X=T(N,2),M=z(X);Xe(M,{variant:"ghost-light",size:"sm",onclick:c,class:"h-7 px-2",children:(C,ee)=>{var le=Qu(),me=xe(le);{let Re=s(()=>e(d)?bi:wi);jt(me,{get icon(){return e(Re)},class:"mr-1"})}var _e=T(me);$(Re=>J(_e,` ${Re??""}`),[()=>e(d)?f.chat_shared_copied_label():f.chat_shared_copy_label()]),u(C,le)},$$slots:{default:!0}});var W=T(M,2);{var E=C=>{Xe(C,{variant:"ghost-light",size:"sm",onclick:h,class:"h-7 px-2",children:(ee,le)=>{gr();var me=Or();$(_e=>J(me,_e),[()=>f.chat_setupScriptCard_useScript_label()]),u(ee,me)},$$slots:{default:!0}})};B(W,C=>{i()&&C(E)})}R(X),R(k);var ne=T(k,2),q=oe(ne,!0),F=T(ne,2),ae=oe(F,!0);return R(b),$(()=>{J(ie,n()),J(q,a()),J(ae,o())}),u(r,b),At(v)}const wr={toolStart:/(?:\x1B\[\d+m)?🔧\s+(?:Tool call:\s+)?(.+?)(?:\x1B\[0m)?$/,toolDetail:/(?:[└├]─\s+(.+)$|^\s{3,}(.+)$)/,toolResult:/(?:\x1B\[\d+m)?📋\s+Tool result:\s+(.+?)(?:\x1B\[0m)?$/,toolSuccess:/[✓✔✅]\s+(.+)$/,toolError:/[❌✗❎]\s+(.+)$/,sessionInfo:/[Ss]ession:\s*([a-f0-9-]+)/,resumedSession:/📂?\s*Resumed session/i,assistantMarker:/🤖/,systemMarker:/💻/,userMarker:/👤/,thinkingMarker:/🤔\s*Thinking/i,waitingMarker:/^⏳\s+Running/i,indexingProgress:/^Indexing:\s*\[.*\]\s*\d+%/,agentDigest:/<agent_digest>([\s\S]*?)<\/agent_digest>/,setupScript:/<setup_script\s+name="([^"]+)"\s+description="([^"]+)">([\s\S]*?)<\/setup_script>/};class Ju{constructor(){kn(this,"buffer","");kn(this,"currentToolName",null);kn(this,"currentToolId",null);kn(this,"lastToolId",null);kn(this,"currentToolParams",[]);kn(this,"currentToolResultContent",[]);kn(this,"inToolResult",!1);kn(this,"inCodeBlock",!1);kn(this,"codeBlockLanguage","");kn(this,"codeBlockContent","");kn(this,"characterBuffer","");kn(this,"inCharacterMode",!1);kn(this,"emittedToolIds",new Set)}parseChunk(t){if(this.isMarkerLine(t.trim())){const o=[];if(this.inToolResult&&this.currentToolResultContent.length>0){const c=this.currentToolResultContent.some(v=>v.startsWith("❌")||v.startsWith("Error:")),h=this.currentToolResultContent.map(v=>v.replace(/^❌\s*/,"").replace(/^Error:\s*/,"")).join(`
1
+ var $l=Object.defineProperty;var Ol=(r,t,n)=>t in r?$l(r,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[t]=n;var kn=(r,t,n)=>Ol(r,typeof t!="symbol"?t+"":t,n);import{t as It,br as g,a_ as B,bz as St,b as Tt,bp as f,bt as Kn,bv as dr,bu as ql,bs as ha}from"./DTQYcznv.js";import{ai as aa,bs as Ct,ca as sr,aD as e,bH as j,ay as xe,bS as T,a7 as Rt,W as u,a5 as z,bA as R,bn as At,c9 as s,bV as we,aA as m,b_ as $,aj as Sr,aB as I,be as gr,b$ as Or,bO as J,bf as or,c0 as Cn,bl as oe,bj as jn,c6 as Dl,bo as za,br as Yr,am as Dn,ax as Bn,bk as as,aw as va,bz as ss,cb as ms,c5 as Ha,aC as xr,cd as _o,bv as Bl}from"./DYhIMPy1.js";import{n as Tr,u as te,v as ze,g as _n,s as ps,w as _a,j as kt,l as ar,p as Yn,I as Fl,i as ya,r as zl,o as eo,X as _i,q as Wl,S as Hl,C as Ul}from"./Ck9ZyE1n.js";import{I as Kt,F as qa,c as ea,j as jl,s as yi,p as to,y as Vl,u as Kl,t as $r,g as oa,B as ws,E as os,S as Gl}from"./BqqN40AD.js";import{b as cn}from"./BaIAhI85.js";import{f as Xe,bj as Ql,am as ro,bt as Zl,bx as xs,bL as Jl}from"./BP5uyQTv.js";import"./s_GzTTEG.js";import"./CW_fORnH.js";import"./BdkEw9JP.js";import{s as Ln}from"./CaxyE6o_.js";import{F as jt,a0 as zs,bc as Tn,cF as no,aq as bi,aV as wi,aG as Xl,c4 as Yl,a2 as is,aJ as ed,cI as td,cH as rd,$ as vs,as as ao,I as yo,af as nd,bq as ad,aO as sd,aT as od,bF as id,ak as ld,cx as dd,ay as bo,aL as wo,bX as ks,aE as Ua,cR as cd,c6 as ud,bj as fd,b as gd,ck as md,ac as pd,b6 as Is,cm as xa,cA as vd,a as hd}from"./CoLl8pQb.js";import{c as xi,A as _d,x as yd}from"./Ddw98WmY.js";import{b as Ss,V as xo}from"./Dk6iNNLu.js";import{a as ki,b7 as Pr,A as Ga,ao as Ii,s as bd,n as Si,d as wd,I as xd,R as kd,ax as Id,a0 as Sd}from"./Dlag9Uxb.js";import{bX as Ti,j as Qa,a6 as Ws,al as ls,F as Td,au as Za,aN as Cd,aQ as ko}from"./Ds3Wirif.js";import{t as ia,o as Ad}from"./De4z9gHo.js";import{c3 as Ja,aC as Da,cQ as Ci,cS as Vn,bU as hs,j as Md,cJ as Ai,cP as _s,cO as Mi,cM as Pi,g as Nn,aa as Pd,ab as Rd,ax as Ed,s as Nd,K as Ld,W as Io,v as Ri,dO as $d,at as Od,k as qd,u as Ts,a6 as Dd,n as Bd,O as Fd,o as zd,S as Wd,R as Hd,a0 as Ud,q as Ei,r as Ni,l as jd,cT as Vd,a4 as Kd,D as Gd,x as Qd,V as So}from"./B0biUQQF.js";import{Iz as yt,oz as Zd,t9 as Xa,no as To,v1 as Li,v3 as $i,rn as Jd,x$ as ds,uk as Oi,nj as qi,bd as Ya,y0 as Xd,q1 as Yd,sG as ec,uW as Di,ni as tc,mp as rc,g as nc,ys as ac,yp as sc,yr as oc}from"./A0r9TbR7.js";import{a2 as ic,x as Cs,a0 as lc,O as As,V as dc,_ as cc,j as uc,o as ka,M as fa,p as fc,F as gc,u as mc,s as pc,L as Ms,J as vc,y as hc,K as _c,Z as Ma,Q as ja,N as Co,m as Ao,E as yc,c as Ps,B as Mo,z as bc,v as Po,H as Pa,P as wc,G as xc,i as kc,R as Ic,T as Sc,A as Tc,g as Cc,b as Ac,D as Mc,f as Pc,e as Rc,a as Ec,C as Nc,h as Lc,U as Bi,a3 as $c,t as Oc,k as qc,d as Ro}from"./DLJVFWjT.js";import{i as Dc,e as Bc}from"./BIEvH8pu.js";import{g as Rs}from"./BvFAWM27.js";import{M as Ia,C as Ra}from"./ByuX26Ym.js";import{C as Eo}from"./DAoagkbK.js";import"./C6WI65lc.js";import{P as Fc}from"./DPR3VaPZ.js";import"./BYFJ74nm.js";import{c as Fi}from"./ChTqQfQN.js";import{S as zc}from"./CteSc0c_.js";import{D as No,M as Wc}from"./Bc6DihnT.js";import{b as Hc,s as na,c as cs}from"./DpHl7r8K.js";import{O as es,y as Es,E as Ns,B as Ls,N as Uc,m as jc,l as Vc,d as us,C as Lo,f as Kc,e as Gc,g as Qc}from"./Bj3n1RUK.js";import{a as zi,s as $o}from"./BsieX9dN.js";import{f as Zc}from"./BdWqymET.js";import{c as dn}from"./JzAjTSJP.js";import{P as Jc}from"./BXeiKdwz.js";import{v as $s,t as Os,K as Oo,h as Xc}from"./ChY17Glq.js";import{R as Hs,C as ys,k as Yc,h as eu,g as tu,i as qo,P as ru}from"./CuhrgDBI.js";import"./DpMTpLDQ.js";import{R as Do,x as Na,o as Wi}from"./BKYCO_49.js";import{B as nu}from"./CRQGIXhv.js";import{o as Hi,r as au,e as su}from"./BF-IM3Qf.js";import{o as Ui}from"./Bs26_0Q5.js";import{g as so}from"./DYmPPjiq.js";import{a as ou,M as iu}from"./finAdq6c.js";import{c as Sa}from"./BmP1Wws6.js";import{A as lu}from"./BMMoYJAn.js";import{f as du,d as cu}from"./BabPi6C5.js";import{a8 as uu,N as fu,Y as gu,K as Bo,X as mu,v as pu}from"./D6Wx8h-l.js";import{a as vu}from"./CC7to1B5.js";import{G as hu}from"./-SwunqO3.js";import{S as _u}from"./BdD2ADMz.js";import{u as yu,a as bu,c as Fo,S as wu}from"./DfxQWSVU.js";import{T as Us}from"./CvWyDJGm.js";import"./CN-2rfdx.js";import{g as xu}from"./Cfj3Lc6y.js";import{a as ku}from"./Dc64E_SR.js";import{b as Iu}from"./CbCgON3R.js";import{b as zo}from"./p7znhYIU.js";import{g as Su,i as Tu,a as Cu}from"./DLqztIqC.js";import{n as Wo,o as Ho,b as ma,s as Ta,_ as qs,e as Au}from"./CIyUrgF0.js";import{aW as Un,B as Mu}from"./C8dU7SM3.js";import{x as Pu}from"./CEQZVenN.js";import{c as Ru}from"./DInreQbI.js";function Eu(r){if(!r||typeof r!="object")return null;const t=r;if(t.type!=="script_monitor_wake"||t.source!=="system")return null;const{scriptName:n,scriptId:a,runId:o,monitorId:i,workspaceId:d,reason:c}=t;if(typeof n!="string"||typeof a!="string"||!a||typeof o!="string"||!o||typeof i!="string"||!i||typeof d!="string"||!d||c!=="finished"&&c!=="ttl-expired"&&c!=="output-match"&&c!=="line-count")return null;const h=t.trigger;return{scriptName:n,scriptId:a,runId:o,monitorId:i,workspaceId:d,reason:c,...c==="output-match"&&typeof h?.matchedLine=="string"?{matchedLine:h.matchedLine}:{}}}function Nu(r){return r?.type==="script_monitor_wake"&&!("remoteAgentId"in r)}function Lu(r,t,n,a=!1){if(!r||!t)return{edit:!1,remove:!1,sendNow:!1};const o=r.messageMetadata?.fromPrincipalId??r.author?.principalId,i=uu(r)&&r.author?.principalId!==null&&o===t;return{edit:i,remove:i||t===n||a,sendNow:(i||a)&&!ji(r)}}function Ca(r,t){if(t)return r.find(n=>n.editing&&n.editingMessageId?n.editingMessageId===t:n.id===t)}function ji(r){return Nu(r.messageMetadata)&&typeof r.messageMetadata?.monitorId=="string"}function Uo(r,t=Date.now()){const n=r.messageMetadata,a=n?.fromPrincipalId,o=n&&Object.hasOwn(n,"humanAuthor")&&!(typeof a=="string"&&a.length>0),i=r.holdKind!==void 0&&Date.parse(r.holdUntil??"")>t;return!r.editing&&!i&&!o&&!ji(r)}const j_="pl-3.5! pr-2!";var $u=I('<span class="tile-remove-slot svelte-d8pwpf"><!></span>'),jo=I('<span class="attachment-status svelte-d8pwpf"> </span>'),Ou=I('<div class="file-image tile svelte-d8pwpf" data-kind="file"><!> <!> <div class="tile-actions svelte-d8pwpf"><!> <!></div></div>'),qu=I("<!><span> </span>",1),Du=I('<img alt="" draggable="false"/>'),Bu=I('<span class="summary svelte-d8pwpf" data-clip-summary=""> </span>'),Fu=I('<span class="clip svelte-d8pwpf"><span class="record-dot svelte-d8pwpf" aria-hidden="true"></span><span class="duration svelte-d8pwpf"> </span><!></span>'),zu=I('<div class="tile svelte-d8pwpf"><!> <!> <div class="tile-actions svelte-d8pwpf"><!> <!></div></div>'),Wu=I('<div class="attachment-row svelte-d8pwpf" role="group" data-dock-media-attachments=""></div>'),Hu=I("<!> <!> <!>",1),Uu=I('<img draggable="false" class="svelte-d8pwpf"/>'),ju=I('<video controls="" playsinline="" class="svelte-d8pwpf"></video>',2),Vu=I('<div class="media-viewer svelte-d8pwpf"><!></div>'),Ku=I("<!> <!>",1);function Gu(r,t){if(new.target)return It({component:Gu,...r});Ct(t,!0);const n=(O,ye=or,pe=or)=>{var A=$u(),ge=z(A);Xe(ge,{variant:"secondary",size:"icon-sm",class:"tile-action tile-remove",get disabled(){return i()},get"aria-label"(){return pe()},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return pe()},onclick:()=>q(ye()),children:(Te,Be)=>{Ss(Te,{glyph:"x"})},$$slots:{default:!0}}),R(A),u(O,A)};let a=g(t,"items",7),o=g(t,"labels",7),i=g(t,"disabled",7,!1),d=g(t,"onMarkUp",7),c=g(t,"onEdit",7),h=g(t,"onRemove",7),v=g(t,"onRetry",7),b=g(t,"onCopy",7),k=g(t,"onMenu",7);const N=O=>O.owner==="attachment"?2:{image:0,clip:1,file:2}[O.kind],Y=s(()=>[...a()].sort((O,ye)=>N(O)-N(ye)));let S=we(null),D=we(!1),ie=we(null),X=null;const M=s(()=>a().find(O=>O.id===e(ie)));sr(()=>{(!e(M)||e(M).kind==="image"&&!W(e(M)))&&j(D,!1)});function W(O){return O.kind==="image"&&O.status!=="placing"&&O.status!=="failed"&&O.url.trim().length>0}function E(O){return O.kind==="image"?o().image(O.markCount):O.kind==="clip"?O.summary?`${o().clip(O.duration)} ${O.summary}`:o().clip(O.duration):O.name}function ne(O,ye){if(!(i()||O.kind==="file"||O.kind==="image"&&!W(O)||O.kind==="clip"&&(!O.url||O.recording))){if((O.kind==="clip"||O.kind==="image")&&c()){c()(O.id);return}X=ye,j(ie,O.id,!0),j(D,!0)}}async function q(O){i()||(e(ie)===O&&j(D,!1),h()(O),await Cn(),(!document.activeElement||document.activeElement===document.body)&&e(S)?.querySelector("button:not(:disabled)")?.focus())}function F(O){const ye=a().find(pe=>pe.id===O);i()||!ye||!W(ye)||(j(D,!1),c()?c()(O):d()(O))}function ae(O,ye){O.key!=="Delete"||i()||(O.preventDefault(),O.stopPropagation(),q(ye))}function C(O){return O.status==="placing"||O.status==="failed"?!1:O.kind==="image"?!!O.file||W(O):O.kind==="clip"&&!O.recording&&!!O.url}function ee(O,ye){const pe=Ql()?O.metaKey:O.ctrlKey,A=O.key.toLowerCase();if(pe&&!O.shiftKey&&!O.altKey&&(A==="c"||A==="x")){if(!b()||!C(ye)||(O.preventDefault(),O.stopPropagation(),A==="x"&&i()))return;b()(ye.id,A==="x");return}ae(O,ye.id)}function le(O,ye){!k()||!C(ye)||(O.preventDefault(),k()(ye.id))}var me={get items(){return a()},set items(O){a(O),m()},get labels(){return o()},set labels(O){o(O),m()},get disabled(){return i()},set disabled(O=!1){i(O),m()},get onMarkUp(){return d()},set onMarkUp(O){d(O),m()},get onEdit(){return c()},set onEdit(O){c(O),m()},get onRemove(){return h()},set onRemove(O){h(O),m()},get onRetry(){return v()},set onRetry(O){v(O),m()},get onCopy(){return b()},set onCopy(O){b(O),m()},get onMenu(){return k()},set onMenu(O){k(O),m()},$set:St,$on:(O,ye)=>Tt(t,O,ye)},_e=Ku(),Re=xe(_e);{var Le=O=>{var ye=Wu();Tr(ye,21,()=>e(Y),pe=>pe.id,(pe,A)=>{var ge=Rt(),Te=xe(ge);{var Be=P=>{var Q=Ou(),re=z(Q);{let G=s(()=>i()||e(A).status==="placing");ki(re,{get id(){return e(A).id},get name(){return e(A).file.name},get type(){return e(A).file.imageMimeType},get imageData(){return e(A).file.imageData},get imageMimeType(){return e(A).file.imageMimeType},variant:"thumbnail",thumbnailClass:"size-full",class:"size-full",get disabled(){return e(G)},get placementStatus(){return e(A).status},get placementError(){return e(A).error}})}var se=T(re,2);{var ce=G=>{var Ee=jo(),De=oe(Ee,!0);$(()=>{te(Ee,"data-failed",e(A).status==="failed"||void 0),te(Ee,"role",e(A).status==="failed"?"alert":"status"),te(Ee,"title",e(A).error),J(De,e(A).status==="failed"?e(A).error??o().attachmentFailed:o().attachmentPending)}),u(G,Ee)};B(se,G=>{e(A).status&&G(ce)})}var w=T(se,2),Se=z(w);{var Ae=G=>{Xe(G,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return o().retry},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return o().retry},onclick:()=>v()?.(e(A).id),children:(Ee,De)=>{jt(Ee,{get icon(){return zs},size:16})},$$slots:{default:!0}})};B(Se,G=>{e(A).status==="failed"&&v()&&G(Ae)})}var L=T(Se,2);{let G=s(()=>f.chat_attachmentPreview_remove_ariaLabel({name:e(A).file.name}));n(L,()=>e(A).id,()=>e(G))}R(w),R(Q),$(()=>te(Q,"data-attachment-id",e(A).id)),Sr("keydown",Q,G=>ee(G,e(A))),Sr("contextmenu",Q,G=>le(G,e(A))),Kt(1,Q,()=>qa,()=>({tier:"fast",y:3,scale:.98})),Kt(2,Q,()=>ea,()=>({tier:"fast"})),u(P,Q)},Ce=P=>{const Q=s(()=>e(A).kind==="image"&&!W(e(A))&&e(A).status!=="failed");var re=zu(),se=z(re);{var ce=ve=>{Xe(ve,{type:"button",variant:"ghost",wrapContent:!1,class:"open-tile file",get"aria-label"(){return e(A).name},get disabled(){return i()},onkeydown:Oe=>ae(Oe,e(A).id),children:(Oe,U)=>{var ue=qu(),ot=xe(ue);jt(ot,{get icon(){return Tn},size:20});var xt=T(ot),mt=oe(xt,!0);$(()=>J(mt,e(A).name)),u(Oe,ue)},$$slots:{default:!0}})},w=ve=>{{let Oe=s(()=>E(e(A))),U=s(()=>i()||e(A).kind==="clip"&&(e(A).recording||!e(A).url));Xe(ve,{type:"button",variant:"ghost",wrapContent:!1,class:"open-tile",get"aria-label"(){return e(Oe)},get disabled(){return e(U)},onkeydown:ue=>ee(ue,e(A)),onclick:ue=>{ue.currentTarget instanceof HTMLElement&&ne(e(A),ue.currentTarget)},children:(ue,ot)=>{var xt=Rt(),mt=xe(xt);{var Ft=je=>{var bt=Du();$(()=>te(bt,"src",e(A).url)),u(je,bt)},pt=je=>{var bt=Fu(),at=T(z(bt)),dt=oe(at,!0),$e=T(at);{var ft=K=>{var _=Bu(),he=oe(_,!0);$(()=>J(he,e(A).summary)),u(K,_)};B($e,K=>{e(A).summary&&K(ft)})}R(bt),$(()=>J(dt,e(A).duration)),u(je,bt)};B(mt,je=>{e(A).kind==="image"?je(Ft):je(pt,-1)})}u(ue,xt)},$$slots:{default:!0}})}},Se=s(()=>e(A).kind!=="image"||W(e(A)));B(se,ve=>{e(A).kind==="file"?ve(ce):e(Se)&&ve(w,1)})}var Ae=T(se,2);{var L=ve=>{var Oe=jo(),U=oe(Oe,!0);$(()=>{te(Oe,"data-failed",e(A).status==="failed"||void 0),te(Oe,"role",e(A).status==="failed"?"alert":"status"),te(Oe,"title",e(A).error),J(U,e(A).status==="failed"?e(A).error??o().attachmentFailed:o().attachmentPending)}),u(ve,Oe)};B(Ae,ve=>{(e(A).status||e(Q))&&ve(L)})}var G=T(Ae,2),Ee=z(G);{var De=ve=>{Xe(ve,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return o().retry},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return o().retry},onclick:()=>v()?.(e(A).id),children:(Oe,U)=>{jt(Oe,{get icon(){return zs},size:16})},$$slots:{default:!0}})},Je=ve=>{{let Oe=s(()=>c()?o().edit:o().markUp),U=s(()=>c()?o().edit:o().markUp);Xe(ve,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return e(Oe)},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return e(U)},onclick:()=>F(e(A).id),children:(ue,ot)=>{Ss(ue,{glyph:"pencil"})},$$slots:{default:!0}})}},Ge=s(()=>W(e(A))),Bt=ve=>{{let Oe=s(()=>c()?o().edit:o().play),U=s(()=>c()?o().edit:o().play);Xe(ve,{variant:"primary",size:"icon-sm",class:"tile-action",get disabled(){return i()},get"aria-label"(){return e(Oe)},tooltipContentClass:"dock-chrome-tooltip",get tooltip(){return e(U)},onclick:ue=>{ue.currentTarget instanceof HTMLElement&&ne(e(A),ue.currentTarget)},children:(ue,ot)=>{{let xt=s(()=>c()?"pencil":"play");Ss(ue,{get glyph(){return e(xt)}})}},$$slots:{default:!0}})}};B(Ee,ve=>{e(A).status==="failed"&&v()?ve(De):e(Ge)?ve(Je,1):e(A).kind==="clip"&&!e(A).recording&&e(A).url&&ve(Bt,2)})}var ke=T(Ee,2);n(ke,()=>e(A).id,()=>o().remove),R(G),R(re),$(()=>{te(re,"data-kind",e(A).kind),te(re,"data-attachment-id",e(A).id),te(re,"aria-busy",e(Q)||void 0)}),Sr("contextmenu",re,ve=>le(ve,e(A))),Kt(1,re,()=>qa,()=>({tier:"fast",y:3,scale:.98})),Kt(2,re,()=>ea,()=>({tier:"fast"})),u(P,re)};B(Te,P=>{e(A).kind==="image"&&e(A).file?P(Be):P(Ce,-1)})}u(pe,ge)}),R(ye),cn(ye,pe=>j(S,pe),()=>e(S)),$(()=>te(ye,"aria-label",o().attachments)),u(O,ye)};B(Re,O=>{e(Y).length&&O(Le)})}var Ke=T(Re,2);{const O=pe=>{var A=Rt(),ge=xe(A);{var Te=Be=>{var Ce=Hu(),P=xe(Ce);{var Q=w=>{Xe(w,{variant:"primary",get disabled(){return i()},onclick:()=>e(M)&&F(e(M).id),children:(Se,Ae)=>{gr();var L=Or();$(()=>J(L,o().markUp)),u(Se,L)},$$slots:{default:!0}})},re=s(()=>W(e(M)));B(P,w=>{e(re)&&w(Q)})}var se=T(P,2);Xe(se,{variant:"secondary",get disabled(){return i()},onclick:()=>e(M)&&q(e(M).id),children:(w,Se)=>{gr();var Ae=Or();$(()=>J(Ae,o().remove)),u(w,Ae)},$$slots:{default:!0}});var ce=T(se,2);Xe(ce,{variant:"ghost-light",onclick:()=>{j(D,!1)},children:(w,Se)=>{gr();var Ae=Or();$(()=>J(Ae,o().done)),u(w,Ae)},$$slots:{default:!0}}),u(Be,Ce)};B(ge,Be=>{e(M)&&e(M).kind!=="file"&&Be(Te)})}u(pe,A)};let ye=s(()=>e(M)?E(e(M)):o().attachments);xi(Ke,{get title(){return e(ye)},size:"wide",showCloseButton:!1,onCloseAutoFocus:pe=>{pe.preventDefault(),X?.isConnected?X.focus():e(S)?.querySelector("button:not(:disabled)")?.focus()},get open(){return e(D)},set open(pe){j(D,pe,!0)},footer:O,children:(pe,A)=>{var ge=Rt(),Te=xe(ge);{var Be=Ce=>{var P=Vu(),Q=z(P);{var re=w=>{var Se=Uu();$(Ae=>{te(Se,"src",e(M).url),te(Se,"alt",Ae)},[()=>E(e(M))]),u(w,Se)},se=s(()=>e(M).kind==="image"&&W(e(M))),ce=w=>{var Se=ju();$(Ae=>{te(Se,"src",e(M).url),te(Se,"aria-label",Ae)},[()=>E(e(M))]),u(w,Se)};B(Q,w=>{e(se)?w(re):e(M).kind==="clip"&&e(M).url&&w(ce,1)})}R(P),u(Ce,P)};B(Te,Ce=>{e(M)&&e(M).kind!=="file"&&Ce(Be)})}u(pe,ge)},$$slots:{footer:!0,default:!0}})}return u(r,_e),At(me)}aa(["keydown","contextmenu"]);var Qu=I("<!> ",1),Zu=I('<div class="flex flex-col gap-2 px-4 py-3 bg-muted/30 border border-border rounded-lg my-4"><div class="flex items-center justify-between gap-2"><div class="flex items-center gap-2"><div class="shrink-0 text-subtle"><!></div> <div class="font-medium text-sm"> </div></div> <div class="flex items-center gap-1"><!> <!></div></div> <div class="text-xs text-subtle"> </div> <pre class="text-xs bg-background/50 rounded p-2 overflow-x-auto max-h-40 overflow-y-auto font-mono"> </pre></div>');function Vi(r,t){if(new.target)return It({component:Vi,...r});Ct(t,!0);let n=g(t,"name",7),a=g(t,"description",7),o=g(t,"content",7),i=g(t,"onUseScript",7),d=we(!1);function c(){navigator.clipboard.writeText(o()),j(d,!0),setTimeout(()=>{j(d,!1)},2e3)}function h(){i()?.({name:n(),description:a(),content:o()})}var v={get name(){return n()},set name(C){n(C),m()},get description(){return a()},set description(C){a(C),m()},get content(){return o()},set content(C){o(C),m()},get onUseScript(){return i()},set onUseScript(C){i(C),m()},$set:St,$on:(C,ee)=>Tt(t,C,ee)},b=Zu(),k=z(b),N=z(k),Y=z(N),S=z(Y);jt(S,{get icon(){return no},size:"sm"}),R(Y);var D=T(Y,2),ie=oe(D,!0);R(N);var X=T(N,2),M=z(X);Xe(M,{variant:"ghost-light",size:"sm",onclick:c,class:"h-7 px-2",children:(C,ee)=>{var le=Qu(),me=xe(le);{let Re=s(()=>e(d)?bi:wi);jt(me,{get icon(){return e(Re)},class:"mr-1"})}var _e=T(me);$(Re=>J(_e,` ${Re??""}`),[()=>e(d)?f.chat_shared_copied_label():f.chat_shared_copy_label()]),u(C,le)},$$slots:{default:!0}});var W=T(M,2);{var E=C=>{Xe(C,{variant:"ghost-light",size:"sm",onclick:h,class:"h-7 px-2",children:(ee,le)=>{gr();var me=Or();$(_e=>J(me,_e),[()=>f.chat_setupScriptCard_useScript_label()]),u(ee,me)},$$slots:{default:!0}})};B(W,C=>{i()&&C(E)})}R(X),R(k);var ne=T(k,2),q=oe(ne,!0),F=T(ne,2),ae=oe(F,!0);return R(b),$(()=>{J(ie,n()),J(q,a()),J(ae,o())}),u(r,b),At(v)}const wr={toolStart:/(?:\x1B\[\d+m)?🔧\s+(?:Tool call:\s+)?(.+?)(?:\x1B\[0m)?$/,toolDetail:/(?:[└├]─\s+(.+)$|^\s{3,}(.+)$)/,toolResult:/(?:\x1B\[\d+m)?📋\s+Tool result:\s+(.+?)(?:\x1B\[0m)?$/,toolSuccess:/[✓✔✅]\s+(.+)$/,toolError:/[❌✗❎]\s+(.+)$/,sessionInfo:/[Ss]ession:\s*([a-f0-9-]+)/,resumedSession:/📂?\s*Resumed session/i,assistantMarker:/🤖/,systemMarker:/💻/,userMarker:/👤/,thinkingMarker:/🤔\s*Thinking/i,waitingMarker:/^⏳\s+Running/i,indexingProgress:/^Indexing:\s*\[.*\]\s*\d+%/,agentDigest:/<agent_digest>([\s\S]*?)<\/agent_digest>/,setupScript:/<setup_script\s+name="([^"]+)"\s+description="([^"]+)">([\s\S]*?)<\/setup_script>/};class Ju{constructor(){kn(this,"buffer","");kn(this,"currentToolName",null);kn(this,"currentToolId",null);kn(this,"lastToolId",null);kn(this,"currentToolParams",[]);kn(this,"currentToolResultContent",[]);kn(this,"inToolResult",!1);kn(this,"inCodeBlock",!1);kn(this,"codeBlockLanguage","");kn(this,"codeBlockContent","");kn(this,"characterBuffer","");kn(this,"inCharacterMode",!1);kn(this,"emittedToolIds",new Set)}parseChunk(t){if(this.isMarkerLine(t.trim())){const o=[];if(this.inToolResult&&this.currentToolResultContent.length>0){const c=this.currentToolResultContent.some(v=>v.startsWith("❌")||v.startsWith("Error:")),h=this.currentToolResultContent.map(v=>v.replace(/^❌\s*/,"").replace(/^Error:\s*/,"")).join(`
2
2
  `);o.push({type:"tool_result",content:h,metadata:{toolId:this.currentToolId,isError:c}}),this.lastToolId=this.currentToolId,this.currentToolId=null,this.inToolResult=!1,this.currentToolResultContent=[]}const i=t.indexOf("🤖"),d=t.substring(i+2);if(this.inCharacterMode=!0,this.characterBuffer="",d&&d.trim()&&d!==`
3
3
  `){const c=d.replace(/^\n/,"");c&&(this.characterBuffer=c)}return o}if(this.inCharacterMode){if(t.trim()===""&&this.characterBuffer==="")return[];if(t.includes(`
4
4
  `)&&this.characterBuffer.length>0){const o=t.substring(0,t.indexOf(`
@@ -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"./CuXCq1os.js";import{bY as Le,cX as le,co as ue,cn as ve}from"./CUp3pS17.js";import{Ix as p,Bc as we,bv as be,c as Fe,KB as de,i7 as me,bH as ke,D7 as z,BB as Ge,f4 as Pe,zG as xe,dR as Ee,f0 as fe,dQ as _e,A9 as Ve,Kf as Ue,vQ as Be}from"./CicdOSYm.js";import{aC as Ae,dG as he,A as H,P as Re,ay as K}from"./C0g2TqGQ.js";import{ax as $e}from"./KJX0Kw6L.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./CxLPEkg7.js";import"./DYhIMPy1.js";import{bp as n}from"./CGWRZzdk.js";import"./BjnZ1Xf3.js";import"./BEyWfhqM.js";import"./DVYqzV0n.js";import{R as ge}from"./BvFAWM27.js";import{L as Ye}from"./CSiaiLHL.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,g)=>{const R=Math.floor(g/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},R)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=ge.DEFAULT_ATTEMPTS,retryDelay:a=ge.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:g=this.defaultShouldRetry}=t;let R=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(R=h,v.error(`[${e}] Attempt ${d} failed`,{error:R.message,attempt:d,maxAttempts:r+1,context:f}),u?.(R,d),d<=r&&g(R)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${R?.message}`,P=J(R?.message||n.agent_errorBoundary_generic_error()),N=R?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:R?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(g=>e(g)))).forEach((g,R)=>{if(g.status==="fulfilled")c.push(g.value);else{const d=g.reason;if(E.push({item:u[R],error:d}),v.error(`[${l}] Batch item failed`,{item:u[R],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const g=c.message.toLowerCase();if(g.includes("interrupted")||g.includes("cancelled")||g.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(g.includes("no available models")||g.includes("all models exhausted")||g.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const R=Math.random()*.2*E,d=Math.min(E+R,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,g,R=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),g,R))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const R=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)R.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)R.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:R,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
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"./CVoXekIe.js";import{bY as Le,cX as le,co as ue,cn as ve}from"./Ds3Wirif.js";import{Iz as p,Be as we,bv as be,c as Fe,KD as de,i7 as me,bH as ke,D9 as z,BD as Ge,f4 as Pe,zI as xe,dR as Ee,f0 as fe,dQ as _e,Ab as Ve,Kh as Ue,vQ as Be}from"./A0r9TbR7.js";import{aC as Ae,dG as he,A as H,P as Re,ay as K}from"./B0biUQQF.js";import{ax as $e}from"./BP5uyQTv.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./CuhrgDBI.js";import"./DYhIMPy1.js";import{bp as n}from"./DTQYcznv.js";import"./Ck9ZyE1n.js";import"./CaxyE6o_.js";import"./DpMTpLDQ.js";import{R as ge}from"./BvFAWM27.js";import{L as Ye}from"./CSiaiLHL.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,g)=>{const R=Math.floor(g/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},R)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=ge.DEFAULT_ATTEMPTS,retryDelay:a=ge.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:g=this.defaultShouldRetry}=t;let R=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(R=h,v.error(`[${e}] Attempt ${d} failed`,{error:R.message,attempt:d,maxAttempts:r+1,context:f}),u?.(R,d),d<=r&&g(R)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${R?.message}`,P=J(R?.message||n.agent_errorBoundary_generic_error()),N=R?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:R?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(g=>e(g)))).forEach((g,R)=>{if(g.status==="fulfilled")c.push(g.value);else{const d=g.reason;if(E.push({item:u[R],error:d}),v.error(`[${l}] Batch item failed`,{item:u[R],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const g=c.message.toLowerCase();if(g.includes("interrupted")||g.includes("cancelled")||g.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(g.includes("no available models")||g.includes("all models exhausted")||g.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const R=Math.random()*.2*E,d=Math.min(E+R,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,g,R=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),g,R))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const R=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)R.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)R.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:R,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
@@ -1 +1 @@
1
- import{J as h}from"./CUp3pS17.js";import{c as v}from"./ChTqQfQN.js";import{bt as d}from"./KJX0Kw6L.js";const g=v("AttachmentImageUrl");function y(n,t){const r=t.split("/").filter(e=>e.length>0).map(e=>encodeURIComponent(e)).join("/");return`workspace-file://${n}/${r}`}const u=new Map,a=new Map;let f=0,m=!1;function p(){m||(m=!0,d(()=>{f+=1,u.clear(),a.clear()}))}function A(n,t){u.delete(`${n}/${t}`)}function F(n,t,r){p();let e=!1,i=!1,o=!1;async function l(){if(!e){if(i){o=!0;return}i=!0;try{const c=await $(n,t);e||r(c)}finally{i=!1,o&&(o=!1,l())}}}const s=d(()=>{l()});return l(),{imageFailed(){e||(A(n,t),r(null))},dispose(){e=!0,s()}}}function $(n,t){p();const r=f,e=`${n}/${t}`,i=u.get(e);if(i)return Promise.resolve(i);const o=a.get(e);if(o)return o;const l=(async()=>{try{const s=await h({attachmentId:t,workspaceId:n});if(r!==f)return null;if(!s.exists)return g.warn("Attachment file missing on disk",{attachmentId:t}),null;const c=y(n,s.path);return u.set(e,c),c}catch(s){return g.warn("Failed to resolve attachment image",{attachmentId:t,error:s}),null}finally{r===f&&a.delete(e)}})();return a.set(e,l),l}export{A as e,F as o,$ as r};
1
+ import{J as h}from"./Ds3Wirif.js";import{c as v}from"./ChTqQfQN.js";import{bt as d}from"./BP5uyQTv.js";const g=v("AttachmentImageUrl");function y(n,t){const r=t.split("/").filter(e=>e.length>0).map(e=>encodeURIComponent(e)).join("/");return`workspace-file://${n}/${r}`}const u=new Map,a=new Map;let f=0,m=!1;function p(){m||(m=!0,d(()=>{f+=1,u.clear(),a.clear()}))}function A(n,t){u.delete(`${n}/${t}`)}function F(n,t,r){p();let e=!1,i=!1,o=!1;async function l(){if(!e){if(i){o=!0;return}i=!0;try{const c=await $(n,t);e||r(c)}finally{i=!1,o&&(o=!1,l())}}}const s=d(()=>{l()});return l(),{imageFailed(){e||(A(n,t),r(null))},dispose(){e=!0,s()}}}function $(n,t){p();const r=f,e=`${n}/${t}`,i=u.get(e);if(i)return Promise.resolve(i);const o=a.get(e);if(o)return o;const l=(async()=>{try{const s=await h({attachmentId:t,workspaceId:n});if(r!==f)return null;if(!s.exists)return g.warn("Attachment file missing on disk",{attachmentId:t}),null;const c=y(n,s.path);return u.set(e,c),c}catch(s){return g.warn("Failed to resolve attachment image",{attachmentId:t,error:s}),null}finally{r===f&&a.delete(e)}})();return a.set(e,l),l}export{A as e,F as o,$ as r};
@@ -1 +1 @@
1
- import{b as s}from"./B1ywot0G.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I};
1
+ import{b as s}from"./Bc6DihnT.js";var t,e=(t=class{constructor(i){this.init=i,this.records=this.init()}reset(){this.records=this.init()}},s(t,"ImperativeState"),t);export{e as I};
@@ -1 +1 @@
1
- import{l as e}from"./DIHT0C7u.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],a={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[["<!--","-->"],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},m={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@commentHtml"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{a as conf,m as language};
1
+ import{l as e}from"./BgX4ALX_.js";const t=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],a={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:["{{!--","--}}"]},brackets:[["<!--","-->"],["<",">"],["{{","}}"],["{","}"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"}],onEnterRules:[{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:new RegExp(`<(?!(?:${t.join("|")}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,"i"),action:{indentAction:e.IndentAction.Indent}}]},m={defaultToken:"",tokenPostfix:"",tokenizer:{root:[[/\{\{!--/,"comment.block.start.handlebars","@commentBlock"],[/\{\{!/,"comment.start.handlebars","@comment"],[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.root"}],[/<!DOCTYPE/,"metatag.html","@doctype"],[/<!--/,"comment.html","@commentHtml"],[/(<)(\w+)(\/>)/,["delimiter.html","tag.html","delimiter.html"]],[/(<)(script)/,["delimiter.html",{token:"tag.html",next:"@script"}]],[/(<)(style)/,["delimiter.html",{token:"tag.html",next:"@style"}]],[/(<)([:\w]+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/(<\/)(\w+)/,["delimiter.html",{token:"tag.html",next:"@otherTag"}]],[/</,"delimiter.html"],[/\{/,"delimiter.html"],[/[^<{]+/]],doctype:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/[^>]+/,"metatag.content.html"],[/>/,"metatag.html","@pop"]],comment:[[/\}\}/,"comment.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentBlock:[[/--\}\}/,"comment.block.end.handlebars","@pop"],[/./,"comment.content.handlebars"]],commentHtml:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.comment"}],[/-->/,"comment.html","@pop"],[/[^-]+/,"comment.content.html"],[/./,"comment.content.html"]],otherTag:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.otherTag"}],[/\/?>/,"delimiter.html","@pop"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.script"}],[/type/,"attribute.name","@scriptAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],scriptAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterType"}],[/=/,"delimiter","@scriptAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@scriptWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.text/javascript",nextEmbedded:"text/javascript"}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.scriptWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@scriptEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:"@rematch",next:"@pop"}]],scriptEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.scriptEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/script/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],style:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.style"}],[/type/,"attribute.name","@styleAfterType"],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,["delimiter.html","tag.html",{token:"delimiter.html",next:"@pop"}]]],styleAfterType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterType"}],[/=/,"delimiter","@styleAfterTypeEquals"],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleAfterTypeEquals:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleAfterTypeEquals"}],[/"([^"]*)"/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/'([^']*)'/,{token:"attribute.value",switchTo:"@styleWithCustomType.$1"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.text/css",nextEmbedded:"text/css"}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleWithCustomType:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInSimpleState.styleWithCustomType.$S2"}],[/>/,{token:"delimiter.html",next:"@styleEmbedded.$S2",nextEmbedded:"$S2"}],[/"([^"]*)"/,"attribute.value"],[/'([^']*)'/,"attribute.value"],[/[\w\-]+/,"attribute.name"],[/=/,"delimiter"],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:"@rematch",next:"@pop"}]],styleEmbedded:[[/\{\{/,{token:"@rematch",switchTo:"@handlebarsInEmbeddedState.styleEmbedded.$S2",nextEmbedded:"@pop"}],[/<\/style/,{token:"@rematch",next:"@pop",nextEmbedded:"@pop"}]],handlebarsInSimpleState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3"}],{include:"handlebarsRoot"}],handlebarsInEmbeddedState:[[/\{\{\{?/,"delimiter.handlebars"],[/\}\}\}?/,{token:"delimiter.handlebars",switchTo:"@$S2.$S3",nextEmbedded:"$S3"}],{include:"handlebarsRoot"}],handlebarsRoot:[[/"[^"]*"/,"string.handlebars"],[/[#/][^\s}]+/,"keyword.helper.handlebars"],[/else\b/,"keyword.helper.handlebars"],[/[\s]+/],[/[^}]/,"variable.parameter.handlebars"]]}};export{a as conf,m as language};
@@ -1 +1 @@
1
- import{Ix as r,aX as n}from"./CicdOSYm.js";import{r as a}from"./BEyWfhqM.js";import{bp as o}from"./CGWRZzdk.js";const l=r.createSelector(e=>e.userPreferences.agentRulesEditor),S=r.createSelector(e=>{const t=l.select(e);return t.content.trim()!==t.originalContent.trim()}),d=r.createSelector(e=>e.userPreferences.agentFontStyle);r.createSelector(e=>{switch(e.userPreferences.agentFontStyle){case"sans":return"Sans-serif";case"monospace":return"Monospace";default:return"Sans-serif"}});const P=r.createSelector(e=>e.userPreferences.agentFontStyle==="monospace"),b=r.createSelector(e=>e.userPreferences.updateChannel),h=r.createSelector(e=>e.userPreferences.spellcheckEnabled),p=r.createSelector(e=>e.userPreferences.zoomFactor),m=r.createSelector(e=>e.userPreferences.showArchived),y=r.createSelector(e=>e.userPreferences.groupByRepo),E=r.createSelector(e=>e.userPreferences.hasCompletedProviderSetup),g=r.createSelector(e=>e.userPreferences?.showReasoningBlocks??!1),F=r.createSelector(e=>e.userPreferences?.chatAuroraEnabled??!0),A=r.createSelector(e=>e.userPreferences?.chatContentWidth??"full"),C=r.createSelector(e=>e.userPreferences?.collapseToolRuns??!1),k=r.createSelector(e=>e.userPreferences?.shellTransparencyEnabled??!0),v=r.createSelector(e=>e.userPreferences?.menuBarAutoHide??!1),L=r.createSelector(e=>e.userPreferences?.reduceMotionOnBattery??!1),R=r.createSelector(e=>e.userPreferences?.pauseAnimationsWhenUnfocused??!1),M=r.createSelector(e=>e.userPreferences?.labsSettingsVisible??!1),T=r.createSelector(e=>e.userPreferences?.labsMultiplayerEnabled??!0),w=r.createSelector(e=>e.userPreferences?.preferencesHydrated===!0),B=r.createSelector(e=>e.userPreferences?.nativeReviewEnabled===!0),D=r.createSelector(e=>e.userPreferences?.labsRemoteAgentsEnabled===!0),N=r.createSelector(e=>e.userPreferences?.labsPlainFolderWorkspacesEnabled===!0),O=r.createSelector(e=>e.userPreferences?.labsBrowserAccessEnabled===!0),W=r.createSelector(e=>e.userPreferences?.labsTabGroupsEnabled===!0),H=r.createSelector(e=>e.userPreferences?.labsCloudMachinesEnabled===!0),U=r.createSelector(e=>e.userPreferences?.labsSshMachineSetupEnabled===!0),_=r.createSelector(e=>1/e.userPreferences.zoomFactor),V=r.createSelector(e=>e.userPreferences.noteFontStyle);r.createSelector(e=>{switch(e.userPreferences.noteFontStyle){case"sans":return"Sans-serif";case"serif":return"Serif";case"monospace":return"Monospace";default:return"Sans-serif"}});const I=r.createSelector(e=>e.userPreferences.noteFontStyle==="monospace"),G=r.createSelector(e=>e.userPreferences.codeFontFamily),x=r.createSelector(e=>{const{codeFontFamily:t}=e.userPreferences;return t==="system-default"?n:`'${t}', monospace`});r.createSelector(e=>{const{codeFontFamily:t}=e.userPreferences;return t==="system-default"?o.settings_fonts_systemDefault_label():t});const z=r.createSelector(e=>{const{systemFonts:t}=e.userPreferences,c=[{value:"system-default",get label(){return o.settings_fonts_systemDefault_label()},fontFamily:n}];for(const s of t)c.push({value:s,label:s,fontFamily:`'${s}', monospace`});return c}),$=r.createSelector(e=>e.userPreferences.enabled),j=r.createSelector(e=>e.userPreferences.soundEnabled),q=r.createSelector(e=>e.userPreferences.soundOnlyWhenUnfocused),J=r.createSelector(e=>e.userPreferences.volume),K=r.createSelector(e=>({editId:e.userPreferences.pendingNotificationVolumeEditId,hydrationEpoch:e.userPreferences.notificationVolumeHydrationEpoch})),Q=r.createSelector(e=>e.userPreferences.activityLogPresets),X=r.createSelector(e=>e.userPreferences.languagePreference),Y=r.createSelector(e=>e.userPreferences?.githubLinkDefaultAction??"show-choices"),Z=r.createSelector(e=>e.userPreferences.shortcutOverrides),ee=r.createSelector(e=>a(e.userPreferences.languagePreference)),re=r.createSelector(e=>e.userPreferences.dockShortcuts??null),te=r.createSelector(e=>e.userPreferences.dockShortcutPending??!1),se=r.createSelector(e=>e.userPreferences.dockShortcutCaptureToken??null),ce=r.createSelector(e=>e.userPreferences.dockShortcutError??null);export{U as A,W as B,X as C,v as D,B as E,V as F,$ as G,J as H,K as I,R as J,L as K,ee as L,k as M,Z as N,m as O,g as P,j as Q,q as R,h as S,b as T,w as U,p as V,d as a,l as b,S as c,F as d,A as e,G as f,x as g,z as h,C as i,_ as j,se as k,ce as l,te as m,re as n,Y as o,y as p,E as q,P as r,Q as s,I as t,O as u,H as v,T as w,N as x,D as y,M as z};
1
+ import{Iz as r,aX as n}from"./A0r9TbR7.js";import{r as a}from"./CaxyE6o_.js";import{bp as o}from"./DTQYcznv.js";const l=r.createSelector(e=>e.userPreferences.agentRulesEditor),S=r.createSelector(e=>{const t=l.select(e);return t.content.trim()!==t.originalContent.trim()}),d=r.createSelector(e=>e.userPreferences.agentFontStyle);r.createSelector(e=>{switch(e.userPreferences.agentFontStyle){case"sans":return"Sans-serif";case"monospace":return"Monospace";default:return"Sans-serif"}});const P=r.createSelector(e=>e.userPreferences.agentFontStyle==="monospace"),b=r.createSelector(e=>e.userPreferences.updateChannel),h=r.createSelector(e=>e.userPreferences.spellcheckEnabled),p=r.createSelector(e=>e.userPreferences.zoomFactor),m=r.createSelector(e=>e.userPreferences.showArchived),y=r.createSelector(e=>e.userPreferences.groupByRepo),E=r.createSelector(e=>e.userPreferences.hasCompletedProviderSetup),g=r.createSelector(e=>e.userPreferences?.showReasoningBlocks??!1),F=r.createSelector(e=>e.userPreferences?.chatAuroraEnabled??!0),A=r.createSelector(e=>e.userPreferences?.chatContentWidth??"full"),C=r.createSelector(e=>e.userPreferences?.collapseToolRuns??!1),k=r.createSelector(e=>e.userPreferences?.shellTransparencyEnabled??!0),v=r.createSelector(e=>e.userPreferences?.menuBarAutoHide??!1),L=r.createSelector(e=>e.userPreferences?.reduceMotionOnBattery??!1),R=r.createSelector(e=>e.userPreferences?.pauseAnimationsWhenUnfocused??!1),M=r.createSelector(e=>e.userPreferences?.labsSettingsVisible??!1),T=r.createSelector(e=>e.userPreferences?.labsMultiplayerEnabled??!0),w=r.createSelector(e=>e.userPreferences?.preferencesHydrated===!0),B=r.createSelector(e=>e.userPreferences?.nativeReviewEnabled===!0),D=r.createSelector(e=>e.userPreferences?.labsRemoteAgentsEnabled===!0),N=r.createSelector(e=>e.userPreferences?.labsPlainFolderWorkspacesEnabled===!0),O=r.createSelector(e=>e.userPreferences?.labsBrowserAccessEnabled===!0),W=r.createSelector(e=>e.userPreferences?.labsTabGroupsEnabled===!0),H=r.createSelector(e=>e.userPreferences?.labsCloudMachinesEnabled===!0),U=r.createSelector(e=>e.userPreferences?.labsSshMachineSetupEnabled===!0),_=r.createSelector(e=>1/e.userPreferences.zoomFactor),V=r.createSelector(e=>e.userPreferences.noteFontStyle);r.createSelector(e=>{switch(e.userPreferences.noteFontStyle){case"sans":return"Sans-serif";case"serif":return"Serif";case"monospace":return"Monospace";default:return"Sans-serif"}});const I=r.createSelector(e=>e.userPreferences.noteFontStyle==="monospace"),G=r.createSelector(e=>e.userPreferences.codeFontFamily),z=r.createSelector(e=>{const{codeFontFamily:t}=e.userPreferences;return t==="system-default"?n:`'${t}', monospace`});r.createSelector(e=>{const{codeFontFamily:t}=e.userPreferences;return t==="system-default"?o.settings_fonts_systemDefault_label():t});const x=r.createSelector(e=>{const{systemFonts:t}=e.userPreferences,c=[{value:"system-default",get label(){return o.settings_fonts_systemDefault_label()},fontFamily:n}];for(const s of t)c.push({value:s,label:s,fontFamily:`'${s}', monospace`});return c}),$=r.createSelector(e=>e.userPreferences.enabled),j=r.createSelector(e=>e.userPreferences.soundEnabled),q=r.createSelector(e=>e.userPreferences.soundOnlyWhenUnfocused),J=r.createSelector(e=>e.userPreferences.volume),K=r.createSelector(e=>({editId:e.userPreferences.pendingNotificationVolumeEditId,hydrationEpoch:e.userPreferences.notificationVolumeHydrationEpoch})),Q=r.createSelector(e=>e.userPreferences.activityLogPresets),X=r.createSelector(e=>e.userPreferences.languagePreference),Y=r.createSelector(e=>e.userPreferences?.githubLinkDefaultAction??"show-choices"),Z=r.createSelector(e=>e.userPreferences.shortcutOverrides),ee=r.createSelector(e=>a(e.userPreferences.languagePreference)),re=r.createSelector(e=>e.userPreferences.dockShortcuts??null),te=r.createSelector(e=>e.userPreferences.dockShortcutPending??!1),se=r.createSelector(e=>e.userPreferences.dockShortcutCaptureToken??null),ce=r.createSelector(e=>e.userPreferences.dockShortcutError??null);export{U as A,W as B,X as C,v as D,B as E,V as F,$ as G,J as H,K as I,R as J,L as K,ee as L,k as M,Z as N,m as O,g as P,j as Q,q as R,h as S,b as T,w as U,p as V,d as a,l as b,S as c,F as d,A as e,G as f,z as g,x as h,C as i,_ as j,se as k,ce as l,te as m,re as n,Y as o,y as p,E as q,P as r,Q as s,I as t,O as u,H as v,T as w,N as x,D as y,M as z};
@@ -1 +1 @@
1
- import{o as y,e as I,s as S,g as A}from"./B10JrSzM.js";function U(){return!0}const o=new Date().toISOString(),d=[{id:"mock-ws-1",title:"Example Project",branch:"feature/demo",baseRef:"main",changesets:[],timeline:[],conversationInfo:[],status:"Active",createdAt:o,updatedAt:o,lastActivity:o,repositoryPath:"/Users/demo/projects/example",repositoryOwner:"demo",repositoryName:"example-project",tags:[],agentSummary:{agentIds:["agent-1"]}},{id:"mock-ws-2",title:"Design System",branch:"feature/tokens",baseRef:"main",changesets:[],timeline:[],conversationInfo:[],status:"Active",createdAt:o,updatedAt:o,lastActivity:o,repositoryPath:"/Users/demo/projects/design-system",repositoryOwner:"demo",repositoryName:"design-system",tags:[]}],g=[{path:"workspaceInitializer.state",label:"Workspace initializer state",description:"Browser-preview workspace initializer state.",category:"workspace",type:"object",defaultValue:{},value:{hydrated:!0}},{path:"hardwareConsole.state",label:"Hardware console state",description:"Browser-preview hardware console state.",category:"hardwareConsole",type:"object",defaultValue:{},value:{}},{path:"rtk.enabled",label:"RTK enabled",description:"Use RTK compressed command output.",category:"tools",type:"boolean",defaultValue:!1,value:!1,origin:"default"}];let l=0;function C(t){const e=g.find(a=>a.path===t);if(!e)return m("INVALID_PARAMS",-32602,`Browser mock: setting "${String(t)}" not found`);const{value:r,origin:s,...i}=e;return{path:e.path,value:r,definition:i,...s?{origin:s}:{},revision:l}}function M(t){return Array.isArray(t)?Object.fromEntries(t.filter(e=>typeof e=="string").map(e=>[e,{available:!1}])):{}}let w=0,B=0;const R=crypto.randomUUID(),p=Symbol("browser-mock-error");function m(t,e,r){return{[p]:{code:t,message:r,data:{code:t},rpcCode:e}}}function T(t){return typeof t=="object"&&t!==null&&p in t}function W(t,e){if(t==="workspace.list")return{workspaces:d};if(t==="workspace.get"){const r=d.find(s=>s.id===e?.workspaceId);return r?{workspace:r}:m("INVALID_PARAMS",-32602,`Browser mock: workspace "${String(e?.workspaceId)}" not found`)}if(t==="task.listAgentLinks")return{links:[],linksByNoteId:{}};if(t==="workspace.getTokenUsage")return{tokenUsage:{byAgentId:{},totals:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0},byModel:{},byAgentModel:[],lastScanAt:null}};if(t==="workspace.getContext")return{items:[]};if(t==="script.list")return{scripts:[]};if(t==="terminal.list")return{terminals:[],daemonBootId:R};if(t==="terminal.create")return{terminalId:`browser-mock-terminal-${++B}`};if(t==="terminal.write"||t==="terminal.resize"||t==="terminal.kill")return{ok:!0};if(t==="terminal.getBuffer")return{terminalId:String(e?.terminalId??""),data:""};if(t==="terminal.readOutput")return"";if(t==="agent.listActive")return{streams:[]};if(t==="prMonitor.list")return{monitors:[]};if(t==="gitRoot.list")return{gitRoots:[]};if(t==="file.tree")return[];if(t==="file-tracking.getChanges")return{changes:[],truncated:!1,totalCount:0};if(t==="file-tracking.loadCommits")return{commits:[],boundarySha:null,nextToken:null};if(t==="repo.list")return{repos:[]};if(t==="settings.list")return{settings:g,revision:l};if(t==="settings.get")return C(e?.path);if(t==="settings.update"){const r=Array.isArray(e?.changes)?e.changes:[],s=[];for(const i of r){if(typeof i!="object"||i===null)continue;const{path:a,value:c}=i,u=g.find(v=>v.path===a);u&&(u.value=c,s.push({path:u.path,value:c,...u.origin?{origin:u.origin}:{}}))}return s.length>0&&(l+=1),{applied:s,revision:l}}if(t==="host.checkAuggie"||t==="host.findBinary")return{available:!1};if(t==="host.toolAvailability")return{tools:M(e?.tools)};if(t==="host.providerAuthStatus")return{providers:[]};if(t==="host.providerDiscovery")return{providers:[]};if(t==="system.status")return{running:!0,listenMode:"browser-mock",version:"0.0.0-browser",protocolVersion:"0.0.0-browser",host:{os:"browser",arch:"browser",locality:"local"}};if(t==="agent.list")return{agents:[],retiredCount:0};if(t==="agent.listInterrupted")return{agents:[]};if(t==="models.list")return{models:[]};if(t==="skill.list")return{skills:[]};if(t==="search.fileNames")return{files:[]};if(t==="comment.list")return{threads:[]};if(t==="task.list")return{tasks:[],stats:{total:0,completed:0,inProgress:0}};if(t==="note.list")return{notes:[]};if(t==="git.status")return{branch:"",ahead:0,behind:0,diverged:!1,files:[],hasUncommittedChanges:!1,hasUntrackedFiles:!1};if(t==="event.query")return e?.paginate===!0||typeof e?.nextToken=="string"?{items:[],nextToken:null}:[];if(t==="events.subscribe")return{subscriptionId:`browser-mock-sub-${++w}`};if(t==="events.unsubscribe")return{}}function O(t,e){if(t==="backend:request"){const r=e?.method;if(typeof r!="string"||r.length===0)return{ok:!1,error:{code:"INVALID_PARAMS",message:"method is required"}};const s=W(r,e?.params);return T(s)?{ok:!1,error:s[p]}:s!==void 0?{ok:!0,result:s}:{ok:!1,error:{code:"NOT_IMPLEMENTED",message:`Browser mock: backend method "${r}" not implemented`}}}if(t==="backend:subscribe")return{ok:!0,result:{subscriptionId:`browser-mock-sub-${++w}`}};if(t==="backend:unsubscribe")return{ok:!0,result:{}};if(t==="backend:get-status"){const r=A();if(r)return{status:r.getStatus(),daemonStartup:r.getStartupState(),transport:{mode:"external-ws",target:r.getTarget()}};const s=I();return s?{status:"connecting",transport:{mode:"external-ws",target:S(s)}}:{status:"connected",transport:"browser-mock"}}}function P(t,e){const r=O(t,e);return r!==void 0?r:t==="workspace:list"?{success:!0,data:d}:t==="workspace:get-recent-repositories"?{success:!0,data:[]}:t==="workspace:get-settings"||t==="workspace:getSettings"?{success:!0,data:{}}:t==="app:version"||t==="app:get-version"?{success:!0,data:"0.0.0-browser"}:t==="system:get-info"?{success:!0,data:{platform:"browser",arch:"wasm",hostname:"localhost"}}:t==="providers:get-models"?{success:!0,data:[]}:t==="providers:get-availability"?{success:!0,data:{}}:t==="providers:get-paths"?{success:!0,data:{}}:t==="feature-codes:get-active"?{features:[]}:t==="config:get"||t==="config:get-all"||t==="config:getAll"?{success:!0,data:{}}:t==="settings:get"||t==="settings:getAll"?{success:!0,data:{}}:t==="auto-update:get-state"?{success:!0,data:{channel:"stable",status:"idle"}}:t.startsWith("window:")?{success:!0}:t==="panel-layout:load"?{success:!0,data:null}:t==="first-visit-state:load"?{success:!0,data:null}:t==="rules:list"||t==="rules:load-workspace"?{success:!0,data:[]}:t.startsWith("specialists:")?{success:!0,data:[]}:t.startsWith("user-rules:")?{success:!0,data:t.includes("get-all")?[]:""}:t.startsWith("git:")?{success:!0,data:null}:t.startsWith("persistence:")||t.startsWith("storage:")?{success:!0,data:null}:t.startsWith("notes:")?{success:!0,data:t.includes("list")?[]:null}:t.startsWith("agent:")?{success:!0,data:null}:t.startsWith("log:")?{success:!0,data:null}:t.startsWith("user-mcp:")||t.startsWith("mcp:")?{success:!0,data:t.includes("list")?[]:null}:t==="skills:list"?{success:!0,data:[]}:t.includes("-auth:")||t.includes("auth:")?{success:!0,data:{authenticated:!1}}:t.startsWith("dialog:")?{success:!0,data:{canceled:!0,filePaths:[]}}:(console.debug(`[BrowserMock] Unhandled IPC channel: ${t}`),{success:!1,error:`Browser mock: channel "${t}" not implemented`})}const n=[];function f(t,e){for(const r of[...n])r.channel===t&&r.callback(e)}let k=0;const x={invoke:async(t,e)=>(console.warn(`[BrowserMock] Serving MOCK response for IPC channel '${t}' — this is dev-only mock data, not a real bridge`),P(t,e)),send:(t,...e)=>{},on:(t,e)=>{const r=`browser-mock-${++k}`;return n.push({id:r,channel:t,callback:e}),r},off:(t,e)=>{},offById:(t,e)=>{const r=n.findIndex(s=>s.id===e);r!==-1&&n.splice(r,1)},removeAllListeners:t=>{for(let e=n.length-1;e>=0;e--)n[e].channel===t&&n.splice(e,1)},once:(t,e)=>{const r=`browser-mock-${++k}`,s=(...i)=>{e(...i);const a=n.findIndex(c=>c.id===r);a!==-1&&n.splice(a,1)};n.push({id:r,channel:t,callback:s})},getPathForFile:t=>"",platform:"darwin",arch:"arm64",versions:{node:"20.0.0",chrome:"120.0.0",electron:"0.0.0-browser"}};function D(){return typeof window>"u"||window.electronAPI?!1:(console.warn("[BrowserMock] Installing mock electronAPI for browser-mode rendering — all IPC responses are DEV MOCKS"),window.electronAPI=x,_(),!0)}let b=!1;function _(){if(b)return;b=!0;let t=null,e=null,r=null;y(s=>{t?.(),e?.(),r?.(),t=s.onStatusChange(i=>{f("backend:status",{status:i,daemonStartup:s.getStartupState(),transport:{mode:"external-ws",target:s.getTarget()}})}),r=s.onStartupChange(i=>{f("backend:status",{status:s.getStatus(),daemonStartup:i,transport:{mode:"external-ws",target:s.getTarget()}})}),e=s.onReconnected(()=>{f("backend:status",{status:"connected",reconnected:!0,transport:{mode:"external-ws",target:s.getTarget()}})})})}D();export{D as installBrowserMock,U as isBrowserMockEnabled};
1
+ import{o as y,e as I,s as S,g as A}from"./finAdq6c.js";function U(){return!0}const o=new Date().toISOString(),d=[{id:"mock-ws-1",title:"Example Project",branch:"feature/demo",baseRef:"main",changesets:[],timeline:[],conversationInfo:[],status:"Active",createdAt:o,updatedAt:o,lastActivity:o,repositoryPath:"/Users/demo/projects/example",repositoryOwner:"demo",repositoryName:"example-project",tags:[],agentSummary:{agentIds:["agent-1"]}},{id:"mock-ws-2",title:"Design System",branch:"feature/tokens",baseRef:"main",changesets:[],timeline:[],conversationInfo:[],status:"Active",createdAt:o,updatedAt:o,lastActivity:o,repositoryPath:"/Users/demo/projects/design-system",repositoryOwner:"demo",repositoryName:"design-system",tags:[]}],g=[{path:"workspaceInitializer.state",label:"Workspace initializer state",description:"Browser-preview workspace initializer state.",category:"workspace",type:"object",defaultValue:{},value:{hydrated:!0}},{path:"hardwareConsole.state",label:"Hardware console state",description:"Browser-preview hardware console state.",category:"hardwareConsole",type:"object",defaultValue:{},value:{}},{path:"rtk.enabled",label:"RTK enabled",description:"Use RTK compressed command output.",category:"tools",type:"boolean",defaultValue:!1,value:!1,origin:"default"}];let l=0;function C(t){const e=g.find(a=>a.path===t);if(!e)return m("INVALID_PARAMS",-32602,`Browser mock: setting "${String(t)}" not found`);const{value:r,origin:s,...i}=e;return{path:e.path,value:r,definition:i,...s?{origin:s}:{},revision:l}}function M(t){return Array.isArray(t)?Object.fromEntries(t.filter(e=>typeof e=="string").map(e=>[e,{available:!1}])):{}}let w=0,B=0;const R=crypto.randomUUID(),p=Symbol("browser-mock-error");function m(t,e,r){return{[p]:{code:t,message:r,data:{code:t},rpcCode:e}}}function T(t){return typeof t=="object"&&t!==null&&p in t}function W(t,e){if(t==="workspace.list")return{workspaces:d};if(t==="workspace.get"){const r=d.find(s=>s.id===e?.workspaceId);return r?{workspace:r}:m("INVALID_PARAMS",-32602,`Browser mock: workspace "${String(e?.workspaceId)}" not found`)}if(t==="task.listAgentLinks")return{links:[],linksByNoteId:{}};if(t==="workspace.getTokenUsage")return{tokenUsage:{byAgentId:{},totals:{inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheCreationTokens:0},byModel:{},byAgentModel:[],lastScanAt:null}};if(t==="workspace.getContext")return{items:[]};if(t==="script.list")return{scripts:[]};if(t==="terminal.list")return{terminals:[],daemonBootId:R};if(t==="terminal.create")return{terminalId:`browser-mock-terminal-${++B}`};if(t==="terminal.write"||t==="terminal.resize"||t==="terminal.kill")return{ok:!0};if(t==="terminal.getBuffer")return{terminalId:String(e?.terminalId??""),data:""};if(t==="terminal.readOutput")return"";if(t==="agent.listActive")return{streams:[]};if(t==="prMonitor.list")return{monitors:[]};if(t==="gitRoot.list")return{gitRoots:[]};if(t==="file.tree")return[];if(t==="file-tracking.getChanges")return{changes:[],truncated:!1,totalCount:0};if(t==="file-tracking.loadCommits")return{commits:[],boundarySha:null,nextToken:null};if(t==="repo.list")return{repos:[]};if(t==="settings.list")return{settings:g,revision:l};if(t==="settings.get")return C(e?.path);if(t==="settings.update"){const r=Array.isArray(e?.changes)?e.changes:[],s=[];for(const i of r){if(typeof i!="object"||i===null)continue;const{path:a,value:c}=i,u=g.find(v=>v.path===a);u&&(u.value=c,s.push({path:u.path,value:c,...u.origin?{origin:u.origin}:{}}))}return s.length>0&&(l+=1),{applied:s,revision:l}}if(t==="host.checkAuggie"||t==="host.findBinary")return{available:!1};if(t==="host.toolAvailability")return{tools:M(e?.tools)};if(t==="host.providerAuthStatus")return{providers:[]};if(t==="host.providerDiscovery")return{providers:[]};if(t==="system.status")return{running:!0,listenMode:"browser-mock",version:"0.0.0-browser",protocolVersion:"0.0.0-browser",host:{os:"browser",arch:"browser",locality:"local"}};if(t==="agent.list")return{agents:[],retiredCount:0};if(t==="agent.listInterrupted")return{agents:[]};if(t==="models.list")return{models:[]};if(t==="skill.list")return{skills:[]};if(t==="search.fileNames")return{files:[]};if(t==="comment.list")return{threads:[]};if(t==="task.list")return{tasks:[],stats:{total:0,completed:0,inProgress:0}};if(t==="note.list")return{notes:[]};if(t==="git.status")return{branch:"",ahead:0,behind:0,diverged:!1,files:[],hasUncommittedChanges:!1,hasUntrackedFiles:!1};if(t==="event.query")return e?.paginate===!0||typeof e?.nextToken=="string"?{items:[],nextToken:null}:[];if(t==="events.subscribe")return{subscriptionId:`browser-mock-sub-${++w}`};if(t==="events.unsubscribe")return{}}function O(t,e){if(t==="backend:request"){const r=e?.method;if(typeof r!="string"||r.length===0)return{ok:!1,error:{code:"INVALID_PARAMS",message:"method is required"}};const s=W(r,e?.params);return T(s)?{ok:!1,error:s[p]}:s!==void 0?{ok:!0,result:s}:{ok:!1,error:{code:"NOT_IMPLEMENTED",message:`Browser mock: backend method "${r}" not implemented`}}}if(t==="backend:subscribe")return{ok:!0,result:{subscriptionId:`browser-mock-sub-${++w}`}};if(t==="backend:unsubscribe")return{ok:!0,result:{}};if(t==="backend:get-status"){const r=A();if(r)return{status:r.getStatus(),daemonStartup:r.getStartupState(),transport:{mode:"external-ws",target:r.getTarget()}};const s=I();return s?{status:"connecting",transport:{mode:"external-ws",target:S(s)}}:{status:"connected",transport:"browser-mock"}}}function P(t,e){const r=O(t,e);return r!==void 0?r:t==="workspace:list"?{success:!0,data:d}:t==="workspace:get-recent-repositories"?{success:!0,data:[]}:t==="workspace:get-settings"||t==="workspace:getSettings"?{success:!0,data:{}}:t==="app:version"||t==="app:get-version"?{success:!0,data:"0.0.0-browser"}:t==="system:get-info"?{success:!0,data:{platform:"browser",arch:"wasm",hostname:"localhost"}}:t==="providers:get-models"?{success:!0,data:[]}:t==="providers:get-availability"?{success:!0,data:{}}:t==="providers:get-paths"?{success:!0,data:{}}:t==="feature-codes:get-active"?{features:[]}:t==="config:get"||t==="config:get-all"||t==="config:getAll"?{success:!0,data:{}}:t==="settings:get"||t==="settings:getAll"?{success:!0,data:{}}:t==="auto-update:get-state"?{success:!0,data:{channel:"stable",status:"idle"}}:t.startsWith("window:")?{success:!0}:t==="panel-layout:load"?{success:!0,data:null}:t==="first-visit-state:load"?{success:!0,data:null}:t==="rules:list"||t==="rules:load-workspace"?{success:!0,data:[]}:t.startsWith("specialists:")?{success:!0,data:[]}:t.startsWith("user-rules:")?{success:!0,data:t.includes("get-all")?[]:""}:t.startsWith("git:")?{success:!0,data:null}:t.startsWith("persistence:")||t.startsWith("storage:")?{success:!0,data:null}:t.startsWith("notes:")?{success:!0,data:t.includes("list")?[]:null}:t.startsWith("agent:")?{success:!0,data:null}:t.startsWith("log:")?{success:!0,data:null}:t.startsWith("user-mcp:")||t.startsWith("mcp:")?{success:!0,data:t.includes("list")?[]:null}:t==="skills:list"?{success:!0,data:[]}:t.includes("-auth:")||t.includes("auth:")?{success:!0,data:{authenticated:!1}}:t.startsWith("dialog:")?{success:!0,data:{canceled:!0,filePaths:[]}}:(console.debug(`[BrowserMock] Unhandled IPC channel: ${t}`),{success:!1,error:`Browser mock: channel "${t}" not implemented`})}const n=[];function f(t,e){for(const r of[...n])r.channel===t&&r.callback(e)}let k=0;const x={invoke:async(t,e)=>(console.warn(`[BrowserMock] Serving MOCK response for IPC channel '${t}' — this is dev-only mock data, not a real bridge`),P(t,e)),send:(t,...e)=>{},on:(t,e)=>{const r=`browser-mock-${++k}`;return n.push({id:r,channel:t,callback:e}),r},off:(t,e)=>{},offById:(t,e)=>{const r=n.findIndex(s=>s.id===e);r!==-1&&n.splice(r,1)},removeAllListeners:t=>{for(let e=n.length-1;e>=0;e--)n[e].channel===t&&n.splice(e,1)},once:(t,e)=>{const r=`browser-mock-${++k}`,s=(...i)=>{e(...i);const a=n.findIndex(c=>c.id===r);a!==-1&&n.splice(a,1)};n.push({id:r,channel:t,callback:s})},getPathForFile:t=>"",platform:"darwin",arch:"arm64",versions:{node:"20.0.0",chrome:"120.0.0",electron:"0.0.0-browser"}};function D(){return typeof window>"u"||window.electronAPI?!1:(console.warn("[BrowserMock] Installing mock electronAPI for browser-mode rendering — all IPC responses are DEV MOCKS"),window.electronAPI=x,_(),!0)}let b=!1;function _(){if(b)return;b=!0;let t=null,e=null,r=null;y(s=>{t?.(),e?.(),r?.(),t=s.onStatusChange(i=>{f("backend:status",{status:i,daemonStartup:s.getStartupState(),transport:{mode:"external-ws",target:s.getTarget()}})}),r=s.onStartupChange(i=>{f("backend:status",{status:s.getStatus(),daemonStartup:i,transport:{mode:"external-ws",target:s.getTarget()}})}),e=s.onReconnected(()=>{f("backend:status",{status:"connected",reconnected:!0,transport:{mode:"external-ws",target:s.getTarget()}})})})}D();export{D as installBrowserMock,U as isBrowserMockEnabled};