@intent-hq/web 2.350.1 → 2.352.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 (275) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/assets/0.Dgd1ZLTR.css +1 -0
  3. package/web/app/immutable/chunks/{BboZoGK5.js → -lzAI0Yg.js} +2 -2
  4. package/web/app/immutable/chunks/{C-Tv9xzP.js → 3DUg3Vrc.js} +1 -1
  5. package/web/app/immutable/chunks/{UiRD2HCB.js → 42Hi6Nev.js} +1 -1
  6. package/web/app/immutable/chunks/{DFxm2U6S.js → 4dL6nLyL.js} +1 -1
  7. package/web/app/immutable/chunks/{XM11aLg9.js → 4fLmPVdQ.js} +1 -1
  8. package/web/app/immutable/chunks/{DT77V-dl.js → 4gwN8kRi.js} +1 -1
  9. package/web/app/immutable/chunks/{B_EJ_ROK.js → 61CqOAVf.js} +3 -3
  10. package/web/app/immutable/chunks/{C9CjIm-I.js → 6J2j9GGS.js} +1 -1
  11. package/web/app/immutable/chunks/{BV_qZ-Kq.js → 6cjeTxFJ.js} +1 -1
  12. package/web/app/immutable/chunks/{B0tZqpMw.js → 6dKWFbhS.js} +1 -1
  13. package/web/app/immutable/chunks/{CrGdgRLR.js → 9cOnZvFz.js} +1 -1
  14. package/web/app/immutable/chunks/{BsAcT-SB.js → 9zOi9r5I.js} +1 -1
  15. package/web/app/immutable/chunks/A4OD-mjJ.js +1 -0
  16. package/web/app/immutable/chunks/{Xn8V9ehY.js → AnpLuuuk.js} +1 -1
  17. package/web/app/immutable/chunks/{DZ-cwX5R.js → B1s_9zgm.js} +2 -2
  18. package/web/app/immutable/chunks/{Ctvf1zqH.js → B32BlPhm.js} +1 -1
  19. package/web/app/immutable/chunks/{BKf74O20.js → B3I1nFXA.js} +1 -1
  20. package/web/app/immutable/chunks/{WydNOMQI.js → B3Wey9bw.js} +1 -1
  21. package/web/app/immutable/chunks/{BT9NukZQ.js → B48wzP5i.js} +1 -1
  22. package/web/app/immutable/chunks/{DKPFCCGK.js → B4qnea7H.js} +1 -1
  23. package/web/app/immutable/chunks/{BJTb0iPR.js → B58e63dk.js} +1 -1
  24. package/web/app/immutable/chunks/{B25aSyPj.js → B5oIPQ5b.js} +1 -1
  25. package/web/app/immutable/chunks/{ChdL62OI.js → B6eIRRKX.js} +2 -2
  26. package/web/app/immutable/chunks/{Cw94LfJC.js → B6lWPidK.js} +1 -1
  27. package/web/app/immutable/chunks/{BASTKLI1.js → B7oLLIgw.js} +4 -4
  28. package/web/app/immutable/chunks/{BQAE7Cab.js → B82ywBwW.js} +1 -1
  29. package/web/app/immutable/chunks/{BmxmL68T.js → B87_3X7t.js} +1 -1
  30. package/web/app/immutable/chunks/{71jcCmFL.js → B8PxK7sP.js} +1 -1
  31. package/web/app/immutable/chunks/{C5_BSKQx.js → B8u7Bszh.js} +1 -1
  32. package/web/app/immutable/chunks/{BCFqTXC5.js → B9Ccf4_O.js} +1 -1
  33. package/web/app/immutable/chunks/{CEa8rngJ.js → BA4kNZus.js} +1 -1
  34. package/web/app/immutable/chunks/{DYdDm8qg.js → BAj9Av-i.js} +1 -1
  35. package/web/app/immutable/chunks/{CClSMHHc.js → BAkYMES1.js} +1 -1
  36. package/web/app/immutable/chunks/{LeGktTWT.js → BAp1A2ZH.js} +1 -1
  37. package/web/app/immutable/chunks/{CMvvA2dm.js → BEpQx2rq.js} +1 -1
  38. package/web/app/immutable/chunks/{BXpSvmYd.js → BGkKDEs0.js} +1 -1
  39. package/web/app/immutable/chunks/{vCsRAP9U.js → BIQ14Jou.js} +1 -1
  40. package/web/app/immutable/chunks/{D7v0ZhmL.js → BJ4sw9rR.js} +1 -1
  41. package/web/app/immutable/chunks/{BaneMq5E.js → BM7Fn-M6.js} +1 -1
  42. package/web/app/immutable/chunks/{CtUmTl5D.js → BMQBnpVJ.js} +1 -1
  43. package/web/app/immutable/chunks/BMYSQl-k.js +19 -0
  44. package/web/app/immutable/chunks/{B4ny9Nap.js → BO5Pq4fi.js} +1 -1
  45. package/web/app/immutable/chunks/{CIFYvyWz.js → BQYuNS07.js} +1 -1
  46. package/web/app/immutable/chunks/{BCahpYtg.js → BQpZAVZ0.js} +1 -1
  47. package/web/app/immutable/chunks/{D7KOa2cM.js → BR9y4bsr.js} +2 -2
  48. package/web/app/immutable/chunks/{Dw7Mfzwn.js → BROObX9U.js} +1 -1
  49. package/web/app/immutable/chunks/{CFE62qf4.js → BReF7PxO.js} +1 -1
  50. package/web/app/immutable/chunks/{Cbr15rLJ.js → BS0GmsgM.js} +1 -1
  51. package/web/app/immutable/chunks/BUAFIktJ.js +1 -0
  52. package/web/app/immutable/chunks/{32pNLDLJ.js → BXyNrc2B.js} +1 -1
  53. package/web/app/immutable/chunks/BYO1ou6X.js +1 -0
  54. package/web/app/immutable/chunks/{CEHfILB1.js → B_sYr-qY.js} +1 -1
  55. package/web/app/immutable/chunks/{Cwzl8GTd.js → BeeeYKV6.js} +1 -1
  56. package/web/app/immutable/chunks/{dt-eIcjK.js → Bfba9qCM.js} +1 -1
  57. package/web/app/immutable/chunks/{6oPcdkTg.js → BfmiyhX4.js} +1 -1
  58. package/web/app/immutable/chunks/{CJeZnjZ2.js → BgOj6lPu.js} +1 -1
  59. package/web/app/immutable/chunks/{B8WU5ocP.js → BgasfqLM.js} +1 -1
  60. package/web/app/immutable/chunks/{CKe6gKEB.js → BhzNHo5H.js} +1 -1
  61. package/web/app/immutable/chunks/{BpfVRpLO.js → Bi2Crhsq.js} +1 -1
  62. package/web/app/immutable/chunks/{DDlZNhW-.js → BlsliAvk.js} +1 -1
  63. package/web/app/immutable/chunks/{DukC1Pxj.js → Bmm9qguf.js} +1 -1
  64. package/web/app/immutable/chunks/{2B0vRGaJ.js → BnfhlAnU.js} +1 -1
  65. package/web/app/immutable/chunks/{To-GU1hI.js → BodHilN5.js} +1 -1
  66. package/web/app/immutable/chunks/{BHpSEINq.js → BotG4DRY.js} +1 -1
  67. package/web/app/immutable/chunks/{Dw4yJGUy.js → Bs7PlXA3.js} +1 -1
  68. package/web/app/immutable/chunks/{2rtvtln4.js → BszXPYBq.js} +1 -1
  69. package/web/app/immutable/chunks/{286xXFLf.js → Buh7J53B.js} +1 -1
  70. package/web/app/immutable/chunks/{B-DRVFcy.js → Bvd0DfwC.js} +1 -1
  71. package/web/app/immutable/chunks/{BLiGayBi.js → Bw0E8NsL.js} +1 -1
  72. package/web/app/immutable/chunks/{CBTiE17j.js → Bz6dDdb9.js} +1 -1
  73. package/web/app/immutable/chunks/{CeeT1t7l.js → BzNn-vV2.js} +1 -1
  74. package/web/app/immutable/chunks/{Ci4xycon.js → C-_Lx3Nm.js} +1 -1
  75. package/web/app/immutable/chunks/C-d_8VyS.js +2 -0
  76. package/web/app/immutable/chunks/{DPiLMhQg.js → C12ljpSn.js} +1 -1
  77. package/web/app/immutable/chunks/{B8kZnhwO.js → C1WXXen7.js} +1 -1
  78. package/web/app/immutable/chunks/{D4xoTssJ.js → C1X9EbCK.js} +3 -3
  79. package/web/app/immutable/chunks/{BOMdRVXl.js → C1l_AdDU.js} +1 -1
  80. package/web/app/immutable/chunks/{BC51na55.js → C2Y-3LOO.js} +1 -1
  81. package/web/app/immutable/chunks/{DMJnRVJf.js → C4rL7fPq.js} +1 -1
  82. package/web/app/immutable/chunks/C5H4Pe0T.js +1 -0
  83. package/web/app/immutable/chunks/{DJnP7chT.js → C79qeQUX.js} +1 -1
  84. package/web/app/immutable/chunks/{CPFtOnI7.js → C7lasS44.js} +1 -1
  85. package/web/app/immutable/chunks/{DxR7IJ2x.js → CDFph9XW.js} +1 -1
  86. package/web/app/immutable/chunks/{BDh1WR6p.js → CDJiCuQl.js} +1 -1
  87. package/web/app/immutable/chunks/{Ccm9-f52.js → CDhg3msv.js} +2 -2
  88. package/web/app/immutable/chunks/{BaXl9G_p.js → CDvr6QES.js} +1 -1
  89. package/web/app/immutable/chunks/{UkpeErAx.js → CGtiJZ6Q.js} +2 -2
  90. package/web/app/immutable/chunks/{B2r-op5b.js → CGuBCqy6.js} +1 -1
  91. package/web/app/immutable/chunks/{C-8EePTi.js → CH2B1dsg.js} +1 -1
  92. package/web/app/immutable/chunks/{C7LjhbvI.js → CLL457e6.js} +1 -1
  93. package/web/app/immutable/chunks/{B99vgEcA.js → CLi8c-Jc.js} +1 -1
  94. package/web/app/immutable/chunks/{BhO09u_O.js → CMbQPqLg.js} +1 -1
  95. package/web/app/immutable/chunks/{BzSSQl6R.js → CMeXe72Y.js} +1 -1
  96. package/web/app/immutable/chunks/{EBvHmS3f.js → CNgwOiTE.js} +1 -1
  97. package/web/app/immutable/chunks/{Bp_k45o-.js → COO6ldt4.js} +1 -1
  98. package/web/app/immutable/chunks/{DDmVz0zj.js → CPY58-tp.js} +1 -1
  99. package/web/app/immutable/chunks/CPjC-KKN.js +1 -0
  100. package/web/app/immutable/chunks/{Ca33AaL6.js → CRZhk1kc.js} +1 -1
  101. package/web/app/immutable/chunks/{B_7vJcZK.js → CRrFC3B8.js} +1 -1
  102. package/web/app/immutable/chunks/{D3wOVtz4.js → CSDwAwlx.js} +1 -1
  103. package/web/app/immutable/chunks/{4M32Nrru.js → CUHqJ1Vg.js} +4 -4
  104. package/web/app/immutable/chunks/{2cru8yuU.js → CUolE7JW.js} +1 -1
  105. package/web/app/immutable/chunks/{7uJhY2Ro.js → CVxBES9o.js} +1 -1
  106. package/web/app/immutable/chunks/CWr4n77L.js +13 -0
  107. package/web/app/immutable/chunks/{DLbCIONA.js → CYYbdMIM.js} +1 -1
  108. package/web/app/immutable/chunks/{BEVux-ca.js → CYqtKpzf.js} +1 -1
  109. package/web/app/immutable/chunks/{DW8-b4qF.js → CZ8DhcrQ.js} +1 -1
  110. package/web/app/immutable/chunks/{Bb07ib28.js → CZd1y8kW.js} +1 -1
  111. package/web/app/immutable/chunks/{DEu6gDAW.js → CZkLaz_S.js} +3 -3
  112. package/web/app/immutable/chunks/{DG7MHKfi.js → CZwN60O3.js} +1 -1
  113. package/web/app/immutable/chunks/{CBVEFL-b.js → C_Q5e0bX.js} +1 -1
  114. package/web/app/immutable/chunks/{BMcc0dQQ.js → CaZWRaBD.js} +1 -1
  115. package/web/app/immutable/chunks/{C7uOzB-k.js → CacD4jQL.js} +1 -1
  116. package/web/app/immutable/chunks/{kXBIZrMa.js → CbBwTVsV.js} +1 -1
  117. package/web/app/immutable/chunks/{RMrXit9I.js → CbIRB05A.js} +37 -37
  118. package/web/app/immutable/chunks/{xEQudZps.js → Cbew16AD.js} +1 -1
  119. package/web/app/immutable/chunks/Ce8ODqPP.js +1 -0
  120. package/web/app/immutable/chunks/{Cs2fCAnT.js → Cep-BDRS.js} +1 -1
  121. package/web/app/immutable/chunks/{Cjw1QvKa.js → CfdX4Lfl.js} +1 -1
  122. package/web/app/immutable/chunks/{CUiOtEey.js → CgbHaDpG.js} +1 -1
  123. package/web/app/immutable/chunks/{DBwXC8Tc.js → ChYZv5SJ.js} +1 -1
  124. package/web/app/immutable/chunks/{C2olseF2.js → Ci51i12B.js} +1 -1
  125. package/web/app/immutable/chunks/{BkMQXe7-.js → Cjd2lqUF.js} +1 -1
  126. package/web/app/immutable/chunks/{DxrW2EIL.js → CltuTtDv.js} +1 -1
  127. package/web/app/immutable/chunks/{2yJgo8xz.js → CmSGn2AH.js} +1 -1
  128. package/web/app/immutable/chunks/{Dr7kBzFG.js → CmpBd6Tg.js} +1 -1
  129. package/web/app/immutable/chunks/{ChmnWquS.js → CnTu6sc6.js} +1 -1
  130. package/web/app/immutable/chunks/{DsLKXQ10.js → Cnntv_QI.js} +1 -1
  131. package/web/app/immutable/chunks/{rEoZFmiI.js → Co5bimwo.js} +1 -1
  132. package/web/app/immutable/chunks/{iP2vS2hx.js → CrxGBxMK.js} +1 -1
  133. package/web/app/immutable/chunks/{CKR2Jwr3.js → Cs1vro6u.js} +1 -1
  134. package/web/app/immutable/chunks/{CfcmMMGe.js → Cx8Xjey1.js} +3 -3
  135. package/web/app/immutable/chunks/{qVFwsb4j.js → CzoxGXV9.js} +1 -1
  136. package/web/app/immutable/chunks/{CUEflbxf.js → D0ArSCdC.js} +1 -1
  137. package/web/app/immutable/chunks/{BtEQs3u_.js → D0fcdSwZ.js} +3 -3
  138. package/web/app/immutable/chunks/{nwgFD7pR.js → D16yE-CH.js} +2 -2
  139. package/web/app/immutable/chunks/{CbVK4mzc.js → D1PZlLC_.js} +1 -1
  140. package/web/app/immutable/chunks/{C82N7Ttz.js → D1nX-Mgh.js} +1 -1
  141. package/web/app/immutable/chunks/{CH0shWeP.js → D1z1qVWr.js} +1 -1
  142. package/web/app/immutable/chunks/{BgCDi7PA.js → D4uvglha.js} +1 -1
  143. package/web/app/immutable/chunks/{zDp2t9TD.js → D529OnQb.js} +1 -1
  144. package/web/app/immutable/chunks/{vQ6gxb4d.js → D5fTH_R4.js} +1 -1
  145. package/web/app/immutable/chunks/{Cifu9mi9.js → D62BIRhv.js} +1 -1
  146. package/web/app/immutable/chunks/{DJBAuZjD.js → D6eYnkBB.js} +1 -1
  147. package/web/app/immutable/chunks/{DhNmiaLk.js → D76YpzZQ.js} +1 -1
  148. package/web/app/immutable/chunks/{BK62I-uA.js → D7LYGcjf.js} +1 -1
  149. package/web/app/immutable/chunks/{D897Deqj.js → D8Uhwh7R.js} +1 -1
  150. package/web/app/immutable/chunks/{7fznLbVZ.js → D8eSz7L_.js} +1 -1
  151. package/web/app/immutable/chunks/{Csp7pCXT.js → DBGsU6bn.js} +1 -1
  152. package/web/app/immutable/chunks/{DNZhZg57.js → DCOf4rfq.js} +1 -1
  153. package/web/app/immutable/chunks/{CIwCBz4N.js → DD4J0jul.js} +1 -1
  154. package/web/app/immutable/chunks/{BjYS0G-V.js → DE-3_OpQ.js} +1 -1
  155. package/web/app/immutable/chunks/{DVWomJ3M.js → DEo3brV5.js} +2 -2
  156. package/web/app/immutable/chunks/{Dt_3gVf3.js → DEo5mzFE.js} +4 -4
  157. package/web/app/immutable/chunks/{BVg1wXVp.js → DF7SJcHw.js} +1 -1
  158. package/web/app/immutable/chunks/{B79m0-as.js → DFbFLnMx.js} +1 -1
  159. package/web/app/immutable/chunks/{SW-tnZ5e.js → DHnebSEV.js} +1 -1
  160. package/web/app/immutable/chunks/DJnc5r8U.js +1 -0
  161. package/web/app/immutable/chunks/{B3aPtdPQ.js → DLHLuX0B.js} +1 -1
  162. package/web/app/immutable/chunks/{B_Iojn2B.js → DMVl8bez.js} +1 -1
  163. package/web/app/immutable/chunks/{DwJJFAxY.js → DNBLhM9P.js} +1 -1
  164. package/web/app/immutable/chunks/{DZ9bPwU4.js → DQuLjWyg.js} +1 -1
  165. package/web/app/immutable/chunks/{DMF8Xnwn.js → DR5IxY_q.js} +1 -1
  166. package/web/app/immutable/chunks/{DM6SW5ie.js → DRDTrHX3.js} +1 -1
  167. package/web/app/immutable/chunks/{C6DrVy6-.js → DS2QhtLm.js} +1 -1
  168. package/web/app/immutable/chunks/{_s2xW34N.js → DTNUQDFX.js} +1 -1
  169. package/web/app/immutable/chunks/{BCazrMx2.js → DUy6xMdY.js} +1 -1
  170. package/web/app/immutable/chunks/{DldD9pcf.js → DV_c4cZz.js} +1 -1
  171. package/web/app/immutable/chunks/{cHlEaLvO.js → DVdgjGW2.js} +1 -1
  172. package/web/app/immutable/chunks/{D41iEHKy.js → DXBnJ5oH.js} +1 -1
  173. package/web/app/immutable/chunks/{ClDVqtGb.js → DXIggtiA.js} +1 -1
  174. package/web/app/immutable/chunks/{Cvv8aJ4r.js → Da2MW7PY.js} +1 -1
  175. package/web/app/immutable/chunks/{CsbrChhH.js → Da7V4qRA.js} +1 -1
  176. package/web/app/immutable/chunks/{BXSSv3Oq.js → DaVLGnNn.js} +1 -1
  177. package/web/app/immutable/chunks/{Bv8FuKnx.js → Db2Jl7w7.js} +1 -1
  178. package/web/app/immutable/chunks/{DZlVkf9Y.js → Dbd3M4VX.js} +4 -4
  179. package/web/app/immutable/chunks/{C1862fgG.js → Dcd40P4V.js} +1 -1
  180. package/web/app/immutable/chunks/{CEI59WUF.js → DdSHHwG-.js} +1 -1
  181. package/web/app/immutable/chunks/{d34yYkdR.js → DeLItg2s.js} +1 -1
  182. package/web/app/immutable/chunks/{DWqOehs6.js → DevaRANM.js} +3 -3
  183. package/web/app/immutable/chunks/{BmMUMiCr.js → Dfo7IcH5.js} +1 -1
  184. package/web/app/immutable/chunks/{H_Nm449K.js → DgGohlQK.js} +1 -1
  185. package/web/app/immutable/chunks/{D2JEXCBC.js → DhPqduTn.js} +1 -1
  186. package/web/app/immutable/chunks/{CbVZZ75K.js → DifK42p0.js} +1 -1
  187. package/web/app/immutable/chunks/{kWL2GjPN.js → DjaIRWIW.js} +1 -1
  188. package/web/app/immutable/chunks/{CrlYwLEr.js → DkkZo56B.js} +1 -1
  189. package/web/app/immutable/chunks/{CNCNgnPl.js → DlNogvkm.js} +1 -1
  190. package/web/app/immutable/chunks/{BNuxEAQs.js → DlySFqed.js} +1 -1
  191. package/web/app/immutable/chunks/{CtH7YJ1N.js → DoWpanLy.js} +1 -1
  192. package/web/app/immutable/chunks/{BaMaQsqR.js → DrPWazGq.js} +1 -1
  193. package/web/app/immutable/chunks/{fvaRaafM.js → DsPTvO1D.js} +1 -1
  194. package/web/app/immutable/chunks/{CM0lKKPd.js → DyLYtK5N.js} +1 -1
  195. package/web/app/immutable/chunks/{BJpI9lmh.js → Dzmm4LX6.js} +2 -2
  196. package/web/app/immutable/chunks/{eIlGg2ZH.js → EbPgJF03.js} +1 -1
  197. package/web/app/immutable/chunks/{YeEGAsBO.js → GVSL2sGk.js} +1 -1
  198. package/web/app/immutable/chunks/{CyRJV2Ki.js → HZ9TCfKK.js} +1 -1
  199. package/web/app/immutable/chunks/{D6kv6T9Z.js → HpSr1h8y.js} +1 -1
  200. package/web/app/immutable/chunks/{xCXPOQKs.js → HtolvgCH.js} +1 -1
  201. package/web/app/immutable/chunks/{CK2a86W3.js → IH85nSha.js} +1 -1
  202. package/web/app/immutable/chunks/{Ari-xzJB.js → IsZH9joj.js} +1 -1
  203. package/web/app/immutable/chunks/{CxxiwOxz.js → JxvzDmDF.js} +1 -1
  204. package/web/app/immutable/chunks/{C7NptMs7.js → Kn9ZbRDu.js} +1 -1
  205. package/web/app/immutable/chunks/{D4gEzra-.js → OXVbQQSu.js} +1 -1
  206. package/web/app/immutable/chunks/{BE9VuWVi.js → OyCLeO1d.js} +1 -1
  207. package/web/app/immutable/chunks/{qT7g0XeC.js → Qg7vTeHw.js} +1 -1
  208. package/web/app/immutable/chunks/{CFMV5ANe.js → Qpp-eumr.js} +1 -1
  209. package/web/app/immutable/chunks/{9_2ZyZ9L.js → SAoHFFQz.js} +1 -1
  210. package/web/app/immutable/chunks/{CjFrzDwu.js → WSPGY2Jm.js} +1 -1
  211. package/web/app/immutable/chunks/{BxE0TK4z.js → XHXZbc0Q.js} +1 -1
  212. package/web/app/immutable/chunks/{BRWlAcla.js → XJEHWeE3.js} +1 -1
  213. package/web/app/immutable/chunks/{DzPN4aFg.js → _L5AdDNH.js} +1 -1
  214. package/web/app/immutable/chunks/{mxwa8yTT.js → bl5nff1M.js} +1 -1
  215. package/web/app/immutable/chunks/{BJeKKdy7.js → ceF1L-gS.js} +1 -1
  216. package/web/app/immutable/chunks/{1WcgIxhR.js → fEnLQxJ4.js} +1 -1
  217. package/web/app/immutable/chunks/{2GRAEVbl.js → gWBpiwO7.js} +1 -1
  218. package/web/app/immutable/chunks/{DlTJT3V9.js → hQlemDzn.js} +1 -1
  219. package/web/app/immutable/chunks/{BwgrW8yQ.js → hRTaoCvf.js} +1 -1
  220. package/web/app/immutable/chunks/{CzZDc-Ii.js → hmNmIDzu.js} +1 -1
  221. package/web/app/immutable/chunks/{CxF8YFum.js → hwFphMxp.js} +1 -1
  222. package/web/app/immutable/chunks/{CV5WtbgW.js → i4rQF8gq.js} +1 -1
  223. package/web/app/immutable/chunks/{BSSsvY4I.js → iYz7qSVO.js} +2 -2
  224. package/web/app/immutable/chunks/{D68W4EG9.js → iqwxOx7o.js} +1 -1
  225. package/web/app/immutable/chunks/{Y5hz4Ndf.js → j5tG0B2t.js} +1 -1
  226. package/web/app/immutable/chunks/{DVpbdNgF.js → jK-m9hL8.js} +1 -1
  227. package/web/app/immutable/chunks/{gq1gp-va.js → jOuwgRm6.js} +1 -1
  228. package/web/app/immutable/chunks/{B3groEj8.js → lwGMtA_8.js} +1 -1
  229. package/web/app/immutable/chunks/{rbrWRnHh.js → sbDqysXr.js} +1 -1
  230. package/web/app/immutable/chunks/{D3v_P2Uq.js → tSZXsoGb.js} +1 -1
  231. package/web/app/immutable/chunks/{D3HUOTfX.js → vJ7Dp7-k.js} +1 -1
  232. package/web/app/immutable/chunks/{hHmUU40X.js → vSkHI-FK.js} +2 -2
  233. package/web/app/immutable/chunks/{BBYhh_eX.js → vgvfRyJV.js} +1 -1
  234. package/web/app/immutable/chunks/{fE-kcmYj.js → vj4vOyOm.js} +1 -1
  235. package/web/app/immutable/chunks/{LIrM5l7a.js → xeIBXGKb.js} +1 -1
  236. package/web/app/immutable/chunks/{BxUPDfJ4.js → xpT8lZyG.js} +2 -2
  237. package/web/app/immutable/chunks/{CaGPKvrg.js → ztG-0WIA.js} +1 -1
  238. package/web/app/immutable/entry/{app.B3zmyQo-.js → app.RSzHSDgw.js} +3 -3
  239. package/web/app/immutable/entry/start.BVuekftv.js +1 -0
  240. package/web/app/immutable/nodes/{0.kC9p1Qyh.js → 0.Da435p_w.js} +1 -1
  241. package/web/app/immutable/nodes/{1.CbKQgLbJ.js → 1.D1nY11Eo.js} +1 -1
  242. package/web/app/immutable/nodes/{10.nkEgxR4t.js → 10.C15wfgwX.js} +1 -1
  243. package/web/app/immutable/nodes/{11.BNBCl9Ko.js → 11.TMR29QT0.js} +1 -1
  244. package/web/app/immutable/nodes/{12.BriSlPZC.js → 12.Dkcg23hr.js} +1 -1
  245. package/web/app/immutable/nodes/{13.QpfX0_5g.js → 13.BANT9s8o.js} +3 -3
  246. package/web/app/immutable/nodes/{14.ZJqXSGiE.js → 14.DChhRykH.js} +1 -1
  247. package/web/app/immutable/nodes/{15.DdEMX_Kl.js → 15.BXSdgmt8.js} +1 -1
  248. package/web/app/immutable/nodes/{16.rtMs5JTy.js → 16.Cp3myrhK.js} +1 -1
  249. package/web/app/immutable/nodes/{17.DDfq3IKN.js → 17.AJ0Z4n7s.js} +1 -1
  250. package/web/app/immutable/nodes/{18.Cds1TQEe.js → 18.BYytq5r4.js} +2 -2
  251. package/web/app/immutable/nodes/{2.TMV-VJam.js → 2.B_tahnsH.js} +4 -4
  252. package/web/app/immutable/nodes/{3.Dy6_DOyf.js → 3.l2wlNZto.js} +1 -1
  253. package/web/app/immutable/nodes/{4.CSClZLtr.js → 4.DSLW-lsR.js} +1 -1
  254. package/web/app/immutable/nodes/{5.B2fm04nD.js → 5.DaH-2DbB.js} +1 -1
  255. package/web/app/immutable/nodes/{6.wppAoRAf.js → 6.CWNY9M3R.js} +1 -1
  256. package/web/app/immutable/nodes/{7.BJEQzlNN.js → 7.DI6SUPGK.js} +1 -1
  257. package/web/app/immutable/nodes/8.j51qyATM.js +14 -0
  258. package/web/app/immutable/nodes/9.C4rF4IYL.js +39 -0
  259. package/web/app/version.json +1 -1
  260. package/web/generated/paraglide.js +49 -49
  261. package/web/index.html +19 -19
  262. package/web/app/immutable/assets/0.C6uvaa87.css +0 -1
  263. package/web/app/immutable/chunks/B1uWzETW.js +0 -1
  264. package/web/app/immutable/chunks/B45FOkqf.js +0 -13
  265. package/web/app/immutable/chunks/CcIb5dHQ.js +0 -2
  266. package/web/app/immutable/chunks/D2rxIP2b.js +0 -1
  267. package/web/app/immutable/chunks/DGQ1ECsI.js +0 -1
  268. package/web/app/immutable/chunks/DZgyzAfw.js +0 -1
  269. package/web/app/immutable/chunks/H2SodBVA.js +0 -1
  270. package/web/app/immutable/chunks/Hc3ynozM.js +0 -1
  271. package/web/app/immutable/chunks/_1y9QH1k.js +0 -1
  272. package/web/app/immutable/chunks/f_NG7JPv.js +0 -19
  273. package/web/app/immutable/entry/start.DL1A5aV6.js +0 -1
  274. package/web/app/immutable/nodes/8.bO4mjRsC.js +0 -14
  275. package/web/app/immutable/nodes/9.Dz8XAzvL.js +0 -39
@@ -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"./CfcmMMGe.js";import{bY as Le,cX as le,co as ue,cn as ve}from"./CsbrChhH.js";import{Iv as p,Bd as we,bx as be,e as Fe,Ky as de,i8 as me,bJ as ke,D8 as z,BC as Ge,f6 as Pe,zI as xe,dT as Ee,f2 as fe,dS as _e,Ab as Ve,Kc as Ue,vQ as Be}from"./BSSsvY4I.js";import{aC as Ae,dG as he,A as H,P as ge,ay as K}from"./CbVK4mzc.js";import{h as $e}from"./DZ-cwX5R.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./CK2a86W3.js";import"./DYhIMPy1.js";import{bo as n}from"./DGQ1ECsI.js";import"./Bp_k45o-.js";import"./ChmnWquS.js";import"./B_7vJcZK.js";import{R as Re}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,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
1
+ var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Z as ce,ai as q,ar as Ce}from"./Cx8Xjey1.js";import{bY as Le,cX as le,co as ue,cn as ve}from"./Da7V4qRA.js";import{Iv as p,Bd as we,bx as be,e as Fe,Ky as de,i8 as me,bJ as ke,D8 as z,BC as Ge,f6 as Pe,zI as xe,dT as Ee,f2 as fe,dS as _e,Ab as Ve,Kc as Ue,vQ as Be}from"./iYz7qSVO.js";import{aC as Ae,dG as he,A as H,P as ge,ay as K}from"./D1PZlLC_.js";import{h as $e}from"./B1s_9zgm.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./IH85nSha.js";import"./DYhIMPy1.js";import{bo as n}from"./BUAFIktJ.js";import"./COO6ldt4.js";import"./CnTu6sc6.js";import"./CRrFC3B8.js";import{R as Re}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,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/vj4vOyOm.js","/app/immutable/chunks/iYz7qSVO.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D8Uhwh7R.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CnTu6sc6.js","/app/immutable/chunks/BUAFIktJ.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/ggQuSgBM.js","/app/immutable/chunks/CmSGn2AH.js","/app/immutable/chunks/CacD4jQL.js","/app/immutable/chunks/CRZhk1kc.js","/app/immutable/chunks/D1PZlLC_.js","/app/immutable/chunks/CfdX4Lfl.js","/app/immutable/chunks/BgOj6lPu.js","/app/immutable/chunks/Bvd0DfwC.js","/app/immutable/chunks/COO6ldt4.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/vJ7Dp7-k.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/B1s_9zgm.js","/app/immutable/chunks/BXyNrc2B.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/Bz6dDdb9.js","/app/immutable/chunks/DCOf4rfq.js","/app/immutable/chunks/Bmm9qguf.js","/app/immutable/chunks/DJ8_lZZl.js","/app/immutable/chunks/D_Kq1QRo.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/CZwN60O3.js","/app/immutable/chunks/SAoHFFQz.js","/app/immutable/chunks/-lzAI0Yg.js","/app/immutable/chunks/lwGMtA_8.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/DEo3brV5.js","/app/immutable/chunks/C_Q5e0bX.js","/app/immutable/chunks/C2Y-3LOO.js","/app/immutable/chunks/Ct1WxQS6.js","/app/immutable/chunks/CC7to1B5.js"])))=>i.map(i=>d[i]);
2
+ import{Iv as l,nx as k,ny as S,iP as Ce,a6 as Ee,e as m,rg as Be,nk as Me,nl as Re,cB as We,aV as Y,gM as Pe,v3 as ue,E$ as Oe,hY as Te,F$ as Fe,CC as Ke,bv as Q,px as fe,i as Le,CU as Ve,uk as He}from"./iYz7qSVO.js";import{n as _e}from"./IH85nSha.js";import{d as Ne,b9 as oe,cD as se,cG as De,aT as Ue,ba as Ge,A as qe}from"./D1PZlLC_.js";import{d as xe}from"./BAkYMES1.js";import{h as x}from"./WFvSJ9zU.js";import{u as R,a3 as Ye,ch as $e,B as Xe,O as je,C as ze,K as Je}from"./DBGsU6bn.js";import{bo as o,_ as $}from"./BUAFIktJ.js";import{cA as Qe,bf as Ze,cD as en,ci as nn,bl as tn,cY as rn,cX as an,bU as on,c_ as sn,aa as cn,a8 as dn,c5 as ln,ac as un,bW as fn,b4 as gn,aD as bn}from"./CfdX4Lfl.js";import{c5 as pn,w as mn,t as hn}from"./CZ8DhcrQ.js";import{I as kn,z as _n}from"./ggQuSgBM.js";import{c as yn}from"./ChTqQfQN.js";import{i as wn}from"./DJ8_lZZl.js";import{a as In}from"./BdWqymET.js";import{d as h}from"./DV_c4cZz.js";import{t as W}from"./DCOf4rfq.js";import{g as vn}from"./CacD4jQL.js";import{a as ge}from"./DR5IxY_q.js";function Sn(e,n){return!e.daemonVersion||!n?!1:Ne(e.daemonVersion,n)==="older"}function An(e,n,t){return!Sn(e,t)||e.updateSupported!==!0?!1:n?.includes(e.id)??!1}function Cn(e){return`machine-rail:update:${e}`}function En(e,n){const t=e?k(e,Cn(n)):void 0;return!!t&&t.phase!=="settled"}const Bt=l.createSelector(e=>e.machineRail?.enabled??!1),Mt=l.createSelector(e=>{const{machineIds:n,selectedId:t,pendingId:r,degradedIds:a}=e.machineRail,s=e.connections.windowBackendId,i=n.map(c=>{const d=k(e.connections.connections,c)??null,u=d?null:k(e.guestSessions.sessions,c)??null,f=u?e.guestSessions.connectedIds.includes(c)?"connected":c===r?"connecting":"disconnected":!d||d.status==="connecting"?"connecting":d.status==="connected"?"connected":"disconnected";return{id:c,record:d,guest:u,selected:s?c===s:c===t,own:c===s,status:f,offline:d!==null||u!==null?f!=="connected":!1,degraded:f==="connected"&&a.includes(c),updatable:d!==null&&An(d,e.connections.connectedIds,e.connections.pinnedVersion),updating:En(e.connections.workflows,c),pending:c===r&&c!==s}});return[...i.filter(c=>!c.guest),...i.filter(c=>c.guest)]}),Rt=l.createSelector(e=>{const n=new Set(e.machineRail.machineIds);return S(e.connections.connections).filter(t=>!t.displayOnly&&t.daemonMode!=="node"&&!n.has(t.id))}),Wt=l.createSelector(e=>{const n=e.machineRail;if(!n?.enabled)return null;const t=r=>!k(e.connections.connections,r)&&!!e.guestSessions&&k(e.guestSessions.sessions,r)!==void 0;return _e(n.machineIds,n.selectedId,t)??""}),Pt=l.createSelector(e=>{const n=new Set(e.machineRail.machineIds);return S(e.guestSessions.sessions).filter(t=>!n.has(t.id))}),Ot=l.createSelector(e=>{const{enabled:n,selectedId:t}=e.machineRail;return!n||t===""||t===e.connections.windowBackendId});let be=null;const Tt=l.createSelector(e=>{const n=k(e.connections.connections,e.connections.windowBackendId),t={enabled:e.machineRail?.enabled??!1,tint:xe(n?.accent,n?.isLocal??!0),opaque:!(e.userPreferences?.shellTransparencyEnabled??!0),theme:`${e.theme?.name}:${e.theme?.activePresetId}:${e.theme?.hasCustomTheme}`},r=be;return r&&r.enabled===t.enabled&&r.tint===t.tint&&r.opaque===t.opaque&&r.theme===t.theme?r:(be=t,t)});function Ft(e,n){const t=n.trim().toLowerCase();if(e==="github")return!t||t==="github.com"?"github.com":null;if(!t)return"gitlab.com";if(/[\s/@?#\\]/.test(t)||t.includes("://"))return null;try{const r=new URL(`https://${t}`);return!r.hostname||r.username||r.password||r.pathname!=="/"?null:r.host}catch{return null}}const Kt=l.createSelector(e=>e.nodes.paste),Lt=l.createSelector(e=>e.nodes.highlightId),Vt=l.createSelector(e=>e.userPreferences?.labsRemoteAgentsEnabled!==!0?"labs-off":e.remoteMachines?.supported!==!0?"backend-unsupported":e.remoteMachines.claimInvites===!0?null:"invites-unsupported"),Ht=l.createSelector(e=>e.userPreferences?.labsRemoteAgentsEnabled!==!0?"labs-off":e.remoteMachines?.supported===!0?null:"backend-unsupported"),Nt=l.createSelector(e=>e.desktopControl),Dt=l.createSelector(e=>e.desktopControl.osPermissions),Ut=l.createSelector(e=>e.desktopControl.osPermissionsChecking===!0),Gt=l.createSelector((e,n,t)=>e.desktopControl.byKey[Ce(n,t)]),qt=l.createSelector(e=>!e.workspaceEvents.subscriptionPending&&e.workspaceEvents.subscriptionGeneration>0),Bn=l.createSelector(e=>oe.select(e).manageHostMembers?se.select(e):null),xt=l.createSelector(e=>e.hostMembership),Yt=l.createSelector(e=>S(e.hostMembership.members)),$t=l.createSelector(e=>S(e.hostMembership.invites)),Mn=l.createSelector(e=>{const{target:n,withheld:t}=e.hostMembership,r=Bn.select(e);return n&&!t&&r===n.context&&oe.select(e).authenticatedDevices?JSON.stringify([n.session,r]):null}),Xt=l.createSelector(e=>{const n=Mn.select(e),t=e.hostMembership.presence;return n&&t.session===n?t:null}),jt=l.createSelector(e=>e.invitationAccountSearch),zt=l.createSelector(e=>S(e.invitationAccountSearch.results)),Jt=l.createSelector(e=>De.select(e)?.capabilities.invitationAccountSearch===!0),Qt=l.createSelector(e=>({backendId:vn(e),connectionsReady:!e.connections||e.connections.hasReceivedList,model:e.model,providerSettings:e.providerSettings})),ye=l.createSelector((e,n)=>k(e.settingsEvents.forms,n)),Zt=l.createSelector((e,n,t)=>{const r=ye.select(e,n);return r?k(r.operations,t):void 0}),M=l.createSelector((e,n)=>{const t=k(e.settingsEvents.forms,n.formId);return t?.sessionId===n.sessionId?t:void 0}),er=l.createSelector((e,n,t)=>{const r=M.select(e,n);return r?k(r.entries,t):void 0}),nr=l.createSelector((e,n)=>{const t=M.select(e,n);return Object.fromEntries((t?S(t.entries):[]).map(r=>[r.path,r]))}),Rn=l.createSelector((e,n,t)=>{const r=M.select(e,n);return r?k(r.operations,t):void 0}),tr=l.createSelector((e,n)=>{if(M.select(e,n)?.kind==="collaboration-machine-name"&&(!Ue.select(e)||!Ge.select(e)||se.select(e)!==n.sessionId))return!1;const r=Rn.select(e,n,n.resource);return r?.requestId===n.requestId&&r.status==="pending"}),rr=l.createSelector((e,n)=>{const t=M.select(e,n);return t?S(t.operations).find(r=>r.error)?.error??"":""}),I=new Map;function ar(e,n,t){Z(e);const r={sessionId:n,requestIds:{},value:{token:"",qrDataUrl:""},receive:t};return I.set(e,r),()=>{I.get(e)===r&&Z(e)}}function or(e){const n=I.get(e.formId);n?.sessionId===e.sessionId&&(e.resource==="save"&&(delete n.requestIds.load,delete n.requestIds.qr,n.value={...n.value,qrDataUrl:""},n.receive(n.value)),n.requestIds[e.resource]=e.requestId)}function sr(e,n){const t=I.get(e.formId);t?.sessionId!==e.sessionId||t.requestIds[e.resource]!==e.requestId||(t.value={...t.value,...n},t.receive(t.value))}function ir(e){const n=I.get(e.formId);return n?.sessionId===e.sessionId?n.value.token:""}function Z(e,n){const t=I.get(e);!t||n!==void 0&&t.sessionId!==n||(I.delete(e),t.value={token:"",qrDataUrl:""},t.receive(t.value))}function cr(){for(const e of I.keys())Z(e)}function dr(e){const n=I.get(e.formId);return n?.sessionId===e.sessionId?n.value.pairingUri??"":""}const lr=x("personalDevices/pairingRequested"),ur=l.createSelector(e=>oe.select(e).personalPairing?se.select(e):null);function fr(e,n,t){const r=R(n.isLocal?t:n.fingerprint);return r?e.find(a=>R(a.fingerprint)===r)??null:null}function gr(e,n,t){const r=R(e.fingerprint);return r?R(t)===r?Ee:n.find(a=>!a.isLocal&&R(a.fingerprint)===r)?.id??null:null}function br(e){return!e||e.state==="revoked"}const Wn=8;function pr(e,n){return n&&e.nodeProtocol!==void 0&&e.nodeProtocol<Wn}const U=new Map;function mr(e,n,t){const r=U.get(e)??new Map;r.set(n,t),U.set(e,r)}function hr(e,n){return U.get(e)?.get(n)??null}function kr(e){U.delete(e)}const Pn="workspace:";function y(e){return e.agentId??`${Pn}${e.wsId}`}function ee(e){if(!e)return!1;const n=e.status;return n===m.Completed||n===m.Error||n===m.Deleted?!1:e.isProcessing===!0||e.isStreaming===!0||e.isResponding===!0||n===m.Active||n===m.Processing}function On(e){const n=e.status;return n===m.Completed||n===m.Error||n===m.Deleted?!1:e.isProcessing===!0||e.isStreaming===!0||e.isResponding===!0||e.isWaitingOnTool===!0||e.activationState===qe.ACTIVATING||n===m.Active||n===m.Processing||n===m.Waiting}function we(e){if(!e||e.status===m.Deleted)return null;const n=Me(e)?.kind??null;return n==="blocker"?"blocker":pn(e)?"question":n==="discussion"?"discussion":null}function ie(e){return we(e)!==null}function Ie(e){return e?.status===m.Error}function ve(e){return e!==void 0&&e.status!==m.Deleted}function Tn(e){return!e||e.status===m.Deleted?!1:!Ie(e)&&!ie(e)&&!On(e)}function pe(e){if(!e)return 0;const n=new Date(e).getTime();return Number.isFinite(n)?n:0}function ne(e){if(!e)return 0;const n=Re(e);return pe(n!==null?n:e.lastActivity)}function Fn(e,n){return ne(n)-ne(e)}function Kn(e,n){const t=new Map;for(const r of n){const a=ne(e.agentSessions.byAgentId[r.agentId]),s=t.get(r.wsId);(!s||a>s.time)&&t.set(r.wsId,{entry:r,time:a})}return[...t.values()].map(r=>r.entry)}function ce(e){return e.tabState.workspaceStacks.flat().flatMap(n=>{const t=k(e.workspace.workspaces,n);return t!==void 0&&Be(t)?[t]:[]})}function Ln(e){return new Map(ce(e).map((n,t)=>[n.id,t]))}function v(e,n,t,r="top-level"){return ce(e).flatMap(a=>{const s=e.workspaceAgents.byWorkspaceId[a.id],i=(r==="all"?s?.agentIds:s?.foregroundAgentIds)??[],c=[];for(const d of i){const u=String(d),f=e.agentSessions.byAgentId[u];f&&n(f,u)&&c.push({entry:{wsId:a.id,agentId:u},session:f})}return t&&c.sort((d,u)=>t(d.session,u.session)),c.map(d=>d.entry)})}function Vn(e){const n=ce(e).filter(i=>i.attention==="unread").map(i=>i.id),t=new Set(n),r=v(e,ve).filter(i=>t.has(i.wsId)),a=new Map;for(const i of r){if(e.agentSessions.byAgentId[i.agentId]?.hasUnread!==!0)continue;const c=a.get(i.wsId)??[];c.push(i),a.set(i.wsId,c)}const s=new Map(Kn(e,r).map(i=>[i.wsId,i]));return n.flatMap(i=>{const c=a.get(i);if(c!==void 0)return c.map(u=>({...u,clearsWorkspace:!1}));const d=s.get(i);return[d!==void 0?{...d,clearsWorkspace:!0}:{wsId:i,agentId:null,clearsWorkspace:!0}]})}function Hn(){return wn(kn.WINDOW.CYCLE_FOCUS)}const K=yn("HardwareConsoleActionKeyRegistry"),Nn=["overview","agents","context","changes","files"],X=["planning","agents-row","changes","review"],me=new Map;function b(e){const n=e.workspaceId;return typeof n!="string"||n.length===0||n===Le?null:n}function te(e,n){return e.workspaceAgents.byWorkspaceId[n]?.activeAgentId??null}function Dn(e,n){const r=(e.workspaceAgents.byWorkspaceId[n]?.agentIds??[]).some(c=>e.agentSessions.byAgentId[c]!==void 0),a=X.filter(c=>c!=="agents-row"||r),s=me.get(n)??-1,i=a.find(c=>X.indexOf(c)>s)??a[0];return me.set(n,X.indexOf(i)),i}function Un(e){const{state:n}=e,t=b(e),r=t===null?null:te(n,t);return r===null?null:String(r)}function P(e,n){return e.hardwareConsole.cycleScopeByFamily[n]}function Gn(e){return v(e,ee,Fn,P(e,"cycle-in-progress-agents"))}const qn={blocker:0,question:1,discussion:2,unread:3};function j(e){const n=Vn(e),t=v(e,ie,void 0,P(e,"cycle-attention-agents")),r={blocker:[],question:[],discussion:[]};for(const c of t){const d=we(e.agentSessions.byAgentId[c.agentId]);d!==null&&r[d].push(c)}const a=new Map,s=[["blocker",r.blocker],["question",r.question],["discussion",r.discussion],["unread",n]],i=[];for(const[c,d]of s)for(const u of d){const f=y(u);a.has(f)||(a.set(f,qn[c]),i.push(u))}return{entries:i,rankByStopKey:a,attentionAgentIds:new Set(t.map(c=>c.agentId)),workspaceClearingWsIds:new Set(n.filter(c=>c.clearsWorkspace).map(c=>c.wsId))}}function xn(e,n,t){e.dispatch(Ve(n,t)),e.dispatch(He(n,{agentId:t})),e.focusComposer(t)}const z=new Map;function re(e,n){return e[0]-n[0]||e[1]-n[1]||e[2]-n[2]}function Se(e,n,t,r){const a=(r===null?void 0:t.get(r))??0,s=(d,u)=>[d,u>=a?0:1,u],i=d=>s(n(d),t.get(d.wsId)??0);return{ordered:e.map((d,u)=>({entry:d,index:u,key:i(d)})).sort((d,u)=>re(d.key,u.key)||d.index-u.index).map(d=>d.entry),keyOf:i,anchorTab:a}}function ae(e,n,t,r){const a=t(n),s=new Set(e.slice(e.indexOf(n)+1).filter(i=>i.wsId===n.wsId&&t(i)===a).map(y));return{entry:n,rank:a,laterOnTab:s,anchorWsId:r}}function Yn(e){const{entries:n,rankOf:t,tabIndex:r,cursor:a,currentWsId:s,focused:i}=e,c=s!==null&&r.has(s)?s:null,d=a===void 0?void 0:r.get(a.entry.wsId),u=a!==void 0&&d!==void 0&&(a.anchorWsId===null||r.has(a.anchorWsId))?a.anchorWsId:c,{ordered:f,keyOf:A,anchorTab:p}=Se(n,t,r,u),C=g=>g.wsId===s&&(g.agentId===null||g.agentId===i);let _;if(a===void 0)_=f.findIndex(g=>!C(g));else{const g=y(a.entry);let E=f.findIndex(w=>y(w)===g);if(E===-1&&a.entry.agentId===null&&(E=f.findIndex(w=>w.wsId===a.entry.wsId&&t(w)===a.rank)),E!==-1)_=E+1;else if(d!==void 0){const w=d,T=[a.rank,w>=p?0:1,w];_=f.findIndex(de=>{const le=re(A(de),T);return le>0||le===0&&a.laterOnTab.has(y(de))})}else{const w=[a.rank,0,p];_=f.findIndex(T=>!C(T)&&re(A(T),w)>=0)}}const O=f[_===-1||_>=f.length?0:_];return{next:O,cursor:ae(f,O,t,u)}}const F=new Map,J=new Map;function B(e){return{id:e.id,get label(){return e.getLabel()},icon:e.icon,isAvailable({state:n}){return e.collect(n).length>0},getUnavailableHint(){return e.getEmptyHint()},execute(n){const{state:t}=n,r=(J.get(e.id)??0)+1;J.set(e.id,r);const a=e.collect(t);if(a.length===0)return;const s=e.rankOf?.(t)??(()=>0),i=F.get(e.id);F.delete(e.id);const c=i===void 0?-1:a.findIndex(g=>y(g)===i),d=Un(n);if(c===-1&&a.length===1&&(a[0].agentId!==null?a[0].agentId===d:a[0].wsId===b(n))){const g=b(n);z.set(e.id,ae(a,a[0],s,g)),a[0].agentId===null&&n.dispatch(fe(a[0].wsId)),n.showHint(e.getSingleCandidateHint());return}const f=Ln(t),A=z.get(e.id);let p,C;if(c!==-1){p=a[c];const g=A!==void 0?A.anchorWsId:b(n),{ordered:E}=Se(a,s,f,g);C=ae(E,p,s,g)}else({next:p,cursor:C}=Yn({entries:a,rankOf:s,tabIndex:f,cursor:A,currentWsId:b(n),focused:d}));const _=y(p);try{p.wsId!==b(n)&&n.showWorkspace(p.wsId).catch(g=>{K.warn("Failed to switch workspace for cycle step",{actionId:e.id,workspaceId:p.wsId,stopKey:_,error:g}),J.get(e.id)===r&&F.set(e.id,_)}),p.agentId!==null?xn(n,p.wsId,p.agentId):n.dispatch(fe(p.wsId))}catch(g){throw F.set(e.id,_),g}z.set(e.id,C);const O=e.countRemaining?.(t,a,p)??a.length-1;n.dispatch(Q(e.getHudLabel?.(O)??e.getLabel()))}}}const Ae=[B({id:"cycle-workspace-agents",icon:dn,getLabel:()=>o.hardwareConsole_actionKey_cycleWorkspaceAgents_label(),getEmptyHint:()=>o.hardwareConsole_actionKey_noAgents_message(),getSingleCandidateHint:()=>o.hardwareConsole_actionKey_noOtherAgents_message(),collect:e=>v(e,ve)}),B({id:"cycle-in-progress-agents",icon:ln,getLabel:()=>o.hardwareConsole_actionKey_cycleInProgressAgents_label(),getEmptyHint:()=>o.hardwareConsole_actionKey_noInProgressAgents_message(),getSingleCandidateHint:()=>o.hardwareConsole_actionKey_noOtherInProgressAgents_message(),collect:Gn}),B({id:"cycle-attention-agents",icon:un,getLabel:()=>o.hardwareConsole_actionKey_cycleAttentionAgents_label(),getEmptyHint:()=>o.hardwareConsole_actionKey_noAttentionAgents_message(),getSingleCandidateHint:()=>o.hardwareConsole_actionKey_noOtherAttentionAgents_message(),collect:e=>v(e,ie,void 0,P(e,"cycle-attention-agents"))}),B({id:"cycle-idle-agents",icon:fn,getLabel:()=>o.hardwareConsole_actionKey_cycleIdleAgents_label(),getEmptyHint:()=>o.hardwareConsole_actionKey_noIdleAgents_message(),getSingleCandidateHint:()=>o.hardwareConsole_actionKey_noOtherIdleAgents_message(),collect:e=>v(e,Tn,void 0,P(e,"cycle-idle-agents"))}),B({id:"cycle-unread-agents",icon:gn,getLabel:()=>o.hardwareConsole_actionKey_cycleUnreadAgents_label(),getEmptyHint:()=>o.hardwareConsole_actionKey_noUnreadAgents_message(),getSingleCandidateHint:()=>o.hardwareConsole_actionKey_noOtherUnreadAgents_message(),getHudLabel:e=>e===0?o.hardwareConsole_actionKey_cycleUnreadAgents_label():e===1?o.hardwareConsole_actionKey_cycleUnreadAgents_hudRemaining_one({count:e}):o.hardwareConsole_actionKey_cycleUnreadAgents_hudRemaining_many({count:e}),countRemaining:(e,n,t)=>{const{attentionAgentIds:r,workspaceClearingWsIds:a}=j(e),s=y(t);return n.filter(i=>y(i)===s?!1:i.agentId!==null&&r.has(i.agentId)||!a.has(i.wsId)?!0:i.wsId!==t.wsId).length},collect:e=>j(e).entries,rankOf:e=>{const{rankByStopKey:n}=j(e);return t=>n.get(y(t))??0}}),B({id:"cycle-failed-agents",icon:bn,getLabel:()=>o.hardwareConsole_actionKey_cycleFailedAgents_label(),getEmptyHint:()=>o.hardwareConsole_actionKey_noFailedAgents_message(),getSingleCandidateHint:()=>o.hardwareConsole_actionKey_noOtherFailedAgents_message(),collect:e=>v(e,Ie,void 0,P(e,"cycle-failed-agents"))}),{id:"stop-agent",get label(){return o.hardwareConsole_actionKey_stopAgent_label()},icon:Qe,isAvailable(e){const{state:n}=e,t=b(e);if(t===null)return!1;const r=te(n,t);return r!==null&&ee(n.agentSessions.byAgentId[r])},execute(e){const{state:n,dispatch:t}=e,r=b(e);if(r===null)return;const a=te(n,r);a===null||!ee(n.agentSessions.byAgentId[a])||(t(We(a)),e.focusComposer(a))}},{id:"see-spec",get label(){return o.hardwareConsole_actionKey_seeSpec_label()},icon:Ze,isAvailable(e){return b(e)!==null},execute(e){const{state:n,dispatch:t}=e,r=b(e);if(r===null)return;const a=Object.values(n.panelLayout.byWorkspaceId[r]?.panels??{});for(const s of a){const i=s.tabs.find(c=>c.id===s.activeTabId);if(i?.type==="note"&&i.noteId===Y){t(Pe(r,i.id,s.id));return}}if(a.length===1){t(ue(r,Y,{openInAdjacentPanel:!0,sourcePanelId:a[0].id}));return}t(ue(r,Y))}},{id:"toggle-sidebar-tabs",get label(){return o.hardwareConsole_actionKey_toggleSidebarTabs_label()},icon:en,isAvailable(e){return b(e)!==null},execute(e){const{state:n,dispatch:t}=e,r=b(e);if(r===null)return;const a=n.sidebarNav.multiSelectTabOrder.length>0?n.sidebarNav.multiSelectTabOrder:[...Nn],s=n.sidebarNav.multiSelectSelectedTabIdsByWorkspaceId[r]??[],i=s.length===1?a.indexOf(s[0]):-1;t(Oe(r,[a[(i+1)%a.length]]))}},{id:"new-agent",get label(){return o.hardwareConsole_actionKey_newAgent_label()},icon:nn,isAvailable(e){return b(e)!==null},execute(e){const{dispatch:n}=e,t=b(e);t!==null&&n(Te(t))}},{id:"new-workspace",get label(){return o.hardwareConsole_actionKey_newWorkspace_label()},icon:tn,isAvailable(){return!0},execute({state:e,dispatch:n}){n(Fe(!e.sidebarNav.showCreateModal))}},{id:"switch-window-layouts",get label(){return o.hardwareConsole_actionKey_switchWindowLayouts_label()},icon:rn,isAvailable(e){return b(e)!==null},execute(e){const{state:n,showHint:t}=e,r=b(e);if(r===null)return;const a=Dn(n,r);Promise.all([$(()=>import("./vj4vOyOm.js").then(s=>s.p),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),$(()=>import("./CRZhk1kc.js"),__vite__mapDeps([14,15,10,6,8,3,1,2,4,5,7,9,11,16,17,18,19,20,21,22,23,24,25,26,27]),import.meta.url)]).then(([{getPanelLayoutManager:s},{applyContentPreset:i}])=>i(a,s(r),{workspaceId:r,containerWidth:window.innerWidth,containerHeight:window.innerHeight})).then(s=>{s||t(o.hardwareConsole_actionKey_switchWindowLayouts_notApplicable_hint())}).catch(s=>{K.error("Failed to apply layout preset",{presetId:a,wsId:r,error:s})})}},{id:"cycle-open-windows",get label(){return o.hardwareConsole_actionKey_cycleOpenWindows_label()},icon:an,isAvailable(){return _n()},execute(e){const n=e.state.machineRail;if(n?.enabled){const t=e.state.guestSessions?.sessions,r=_e(n.machineIds,n.selectedId,i=>!!t&&k(t,i)!==void 0);if(!r){e.showHint(o.hardwareConsole_actionKey_noOtherMachines_message());return}const a=e.state.connections?.connections,s=a?k(a,r):void 0;e.dispatch(Ke(r)),e.dispatch(Q(s?s.isLocal?mn(s):hn(s):r));return}Hn().then(t=>{t?.cycled?e.dispatch(Q(o.hardwareConsole_actionKey_cycleOpenWindows_label())):e.showHint(o.hardwareConsole_actionKey_noOtherOpenWindows_message())}).catch(t=>{K.error("Failed to cycle open windows",{error:t})})}},{id:"push-to-talk",get label(){return o.hardwareConsole_actionKey_pushToTalk_label()},icon:on,isAvailable(){return je()},getUnavailableHint(){return o.hardwareConsole_ptt_unavailable_message()},execute(e){if(!Je()&&Ye(e.state.voiceSettings)==="unavailable"){$e();return}Xe(e)},executeUp(e){ze(e)}},{id:"close-tab",get label(){return o.hardwareConsole_actionKey_closeTab_label()},icon:sn,isAvailable(){return!0},execute(e){const n=window.location.pathname;$(async()=>{const{closeActiveTab:t}=await import("./Bmm9qguf.js");return{closeActiveTab:t}},__vite__mapDeps([28,29,11,6,30,31,1,2,3,4,5,7,8,9,10,32,12,13,33,34,35,36,15,16,17,18,19,20,21,22,23,24,25,26,27,37,38,39,40,41]),import.meta.url).then(({closeActiveTab:t})=>{t(n,e.navigate)===null&&e.showHint(o.hardwareConsole_actionKey_closeTab_nothingToClose_hint())}).catch(t=>{K.error("Failed to close the active tab",{error:t})})}},{id:"none",get label(){return o.hardwareConsole_actionKey_none_label()},icon:cn,isAvailable(){return!1},execute(){}}];function _r(e){const n=Ae.find(t=>t.id===e);if(!n)throw new Error(`Unknown action key action: ${e}`);return n}function yr(e){return e.map(n=>{const t=n==="none"?null:Ae.find(r=>r.id===n)??null;return{icon:t?.icon??null,get label(){return t?.label??null}}})}const $n=[{usagePage:1,usage:2},{usagePage:1,usage:1},{usagePage:1,usage:5}];function wr(e){return e.length===0?"unknown":e.some(t=>$n.some(r=>r.usagePage===t.usagePage&&r.usage===t.usage))||e.length>=5?"usb":"bluetooth"}const G=new In("HardwareConsoleCodexProbe"),Xn="KV_OAI_";function jn(e){if(typeof e!="object"||e===null)return null;const n=e.version;return typeof n=="string"?n:null}function zn(e){if(typeof e!="object"||e===null)return{batteryPercent:null,isCharging:!1};const n=e,t=n.battery;return{batteryPercent:typeof t=="number"&&Number.isFinite(t)?t:null,isCharging:n.is_charging===!0}}function Jn(e){const n=e instanceof Error?e.message:String(e);return/method not found|-32601|404/i.test(n)}async function Qn(e){try{await e.call("v.oai.thstatus",[])}catch(n){return Jn(n)?"unsupported-firmware":(G.warn("Codex-mode probe (v.oai.thstatus) failed",{error:String(n)}),"unknown")}try{const n=await e.call("fs.read",{file:"keymap.json"}),t=typeof n?.data=="string"?n.data:null;return t===null?"unknown":t.includes(Xn)?"ready":"no-codex-layer"}catch(n){return G.warn("Codex-layer probe (fs.read keymap.json) failed",{error:String(n)}),"unknown"}}async function Ir(e){const[n,t,r]=await Promise.all([e.call("sys.version").catch(a=>(G.warn("sys.version failed",{error:String(a)}),null)),e.call("device.status").catch(a=>(G.warn("device.status failed",{error:String(a)}),null)),Qn(e)]);return{firmwareVersion:jn(n),...zn(t),codexMode:r}}const vr=["elevenlabs","openai"],L="voice.provider",q={elevenlabs:"voice.elevenlabs.apiKey",openai:"voice.openai.apiKey"},V="voice.openai.model",Zn=["gpt-4o-transcribe","gpt-4o-mini-transcribe","whisper-1"],et="gpt-4o-transcribe",H="voice.language",nt="",Sr=["en","zh","es","hi","ar","pt","fr","de","ja","ko","ru","it","nl","pl","tr","vi","id","th","sv","da","nb","fi","cs","el","he","hu","ro","uk"],N="voice.vocabulary",D="voice.workspaceVocabulary.maxTerms",tt=0,rt=100,at=50;function ot(e){return typeof e=="number"&&Number.isInteger(e)&&e>=tt&&e<=rt}function st(e){return e==="elevenlabs"||e==="openai"}function it(e){return Zn.includes(e)}function he(e){return typeof e=="string"&&e.length>0}function ct(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")?e:null}async function Ar(){const[e,n,t,r,a,s,i]=await Promise.all([h.settings.get(L),h.settings.get(q.elevenlabs),h.settings.get(q.openai),h.settings.get(N),h.settings.get(V),h.settings.get(H),h.settings.get(D)]);return{available:e!==null,provider:st(e?.value)?e.value:"elevenlabs",keyConfigured:{elevenlabs:he(n?.value),openai:he(t?.value)},vocabulary:ct(r?.value),openaiModel:a===null?null:it(a.value)?a.value:et,language:s===null?null:typeof s.value=="string"?s.value.trim().toLowerCase():nt,workspaceVocabularyMaxTerms:i===null?null:ot(i.value)?i.value:at}}async function Cr(e){if(!(await h.settings.update([{path:L,value:e}])).some(t=>t.path===L))throw new Error(`settings.update did not apply ${L}`)}async function Er(e){if(!(await h.settings.update([{path:V,value:e}])).some(t=>t.path===V))throw new Error(`settings.update did not apply ${V}`)}async function Br(e){if(!(await h.settings.update([{path:H,value:e}])).some(t=>t.path===H))throw new Error(`settings.update did not apply ${H}`)}async function Mr(e){if(!(await h.settings.update([{path:N,value:e}])).some(t=>t.path===N))throw new Error(`settings.update did not apply ${N}`)}async function Rr(e){if(!(await h.settings.update([{path:D,value:e}])).some(t=>t.path===D))throw new Error(`settings.update did not apply ${D}`)}async function Wr(e,n){const t=n.trim();if(!t)throw new Error("API key must not be empty");await h.settings.update([{path:q[e],value:t}])}async function Pr(e){const n=q[e];if(await h.settings.reset(n)===null)throw new Error(`settings.reset failed for ${n}`)}const Or=["workspace-mcp"],Tr=/^[a-zA-Z0-9._-]+$/,Fr=64;function Kr(e,n){const{machine:t,backend:r}=n;switch(e.code){case"unsupported-backend":return o.remoteMachines_failure_unsupportedBackend_error({backend:r});case"same-machine":return o.remoteMachines_failure_sameMachine_error({machine:t});case"not-owner":return o.remoteMachines_failure_notOwner_error({machine:t});case"machine-not-connected":return o.remoteMachines_failure_notConnected_error({machine:t});case"listener-off":return o.remoteMachines_failure_listenerOff_error({machine:t});case"machine-update-required":return e.update==="backend"?o.remoteMachines_failure_updateBackend_error({machine:t,backend:r}):e.machineVersion&&e.backendVersion?o.remoteMachines_failure_updateMachineVersions_error({machine:t,machineVersion:e.machineVersion,backendVersion:e.backendVersion}):o.remoteMachines_failure_updateMachine_error({machine:t});case"machine-unreachable":{const a=e.unconfirmedStops?.length??0;if(a===0)return o.remoteMachines_failure_unreachable_error({machine:t,backend:r});const s=W(a);return a===1?o.remoteMachines_failure_unconfirmedStops_error_one({count:s,machine:t,backend:r}):o.remoteMachines_failure_unconfirmedStops_error_many({count:s,machine:t,backend:r})}case"machine-in-use":{const a=e.runningAgents??0;return a===1?o.remoteMachines_failure_inUse_error_one({count:W(a),machine:t}):o.remoteMachines_failure_inUse_error_many({count:W(a),machine:t})}case"failed":return o.remoteMachines_failure_generic_error({message:e.message??o.workspace_transfer_unknown_error()})}}function Lr(e){return e.code==="machine-in-use"?"stop-agents":e.code==="machine-unreachable"&&(e.unconfirmedStops?.length??0)>0?"retry-stop-agents":null}function Vr(e,n){switch(e.state){case"revoked":return o.remoteMachines_state_revoked_description({machine:n.machine});case"unreachable":return o.remoteMachines_state_unreachable_description(n);case"update-required":return o.remoteMachines_failure_updateMachine_error({machine:n.machine});default:return null}}function Hr(e,n){switch(e.state){case"revoked":return{label:o.remoteMachines_state_revoked_label(),color:"red"};case"unreachable":return{label:o.remoteMachines_state_unreachable_label(),color:"amber"};case"update-required":return{label:o.remoteMachines_state_updateRequired_label(),color:"amber"};default:return{label:o.remoteMachines_state_available_label({backend:n}),color:"green"}}}function Nr(e){return e===1?o.remoteMachines_agents_running_one({count:W(e)}):o.remoteMachines_agents_running_many({count:W(e)})}const dt=l.createSelector((e,n)=>{const t=M.select(e,n)?.values;return{enabled:t?.enabled===!0,persistedPort:typeof t?.persistedPort=="number"?t.persistedPort:5181,port:typeof t?.port=="number"?t.port:null,certFingerprint:typeof t?.certFingerprint=="string"?t.certFingerprint:"",localIps:Array.isArray(t?.localIps)?t.localIps:[],availableIps:Array.isArray(t?.availableIps)?t.availableIps:null,bindIps:Array.isArray(t?.bindIps)?t.bindIps:[],bindAddressSupported:t?.bindAddressSupported===!0,tunnelEnabled:t?.tunnelEnabled===!0,tunnelOnly:t?.tunnelOnly===!0,tunnelSupported:t?.tunnelSupported===!0,tcAddress:typeof t?.tcAddress=="string"?t.tcAddress:""}}),Dr=l.createSelector((e,n)=>dt.select(e,ye.select(e,n)??{formId:n,sessionId:""})),Ur=x("rtkSettings/requested"),Gr=x("rtkSettings/installStarted"),qr=x("pushSettings/requested"),ke=[{id:"dracula",label:"Dracula",previewColors:{dark:["#282a36","#f8f8f2","#bd93f9","#ff79c6"],light:["#f8f8f2","#282a36","#9580ff","#ff80bf"]},dark:{name:"Dracula",type:"dark",colors:{"editor.background":"#282a36","editor.foreground":"#f8f8f2","sideBar.background":"#21222c","sideBar.foreground":"#f8f8f2","editorWidget.background":"#282a36","editorWidget.foreground":"#f8f8f2","dropdown.background":"#282a36","dropdown.foreground":"#f8f8f2",focusBorder:"#6272a4","input.background":"#21222c","panel.border":"#44475a","button.background":"#bd93f9","button.foreground":"#282a36","badge.background":"#bd93f9","badge.foreground":"#282a36","list.activeSelectionBackground":"#44475a","list.activeSelectionForeground":"#f8f8f2","tab.inactiveBackground":"#21222c",descriptionForeground:"#6272a4",errorForeground:"#ff5555","terminal.background":"#282a36","terminal.foreground":"#f8f8f2","terminal.ansiBlack":"#21222c","terminal.ansiRed":"#ff5555","terminal.ansiGreen":"#50fa7b","terminal.ansiYellow":"#f1fa8c","terminal.ansiBlue":"#bd93f9","terminal.ansiMagenta":"#ff79c6","terminal.ansiCyan":"#8be9fd","terminal.ansiWhite":"#f8f8f2"}},light:{name:"Dracula Light",type:"light",colors:{"editor.background":"#f8f8f2","editor.foreground":"#282a36","sideBar.background":"#eaeaeb","sideBar.foreground":"#282a36","editorWidget.background":"#f8f8f2","editorWidget.foreground":"#282a36","dropdown.background":"#f8f8f2","dropdown.foreground":"#282a36",focusBorder:"#9580ff","input.background":"#eaeaeb","panel.border":"#d4d4d6","button.background":"#9580ff","button.foreground":"#f8f8f2","badge.background":"#9580ff","badge.foreground":"#f8f8f2","list.activeSelectionBackground":"#d4d4d6","list.activeSelectionForeground":"#282a36","tab.inactiveBackground":"#eaeaeb",descriptionForeground:"#6272a4",errorForeground:"#ff5555","terminal.background":"#f8f8f2","terminal.foreground":"#282a36","terminal.ansiBlack":"#282a36","terminal.ansiRed":"#e13535","terminal.ansiGreen":"#2a9f4a","terminal.ansiYellow":"#c4a000","terminal.ansiBlue":"#7c6dd8","terminal.ansiMagenta":"#e06cb0","terminal.ansiCyan":"#2aacbd","terminal.ansiWhite":"#f8f8f2"}}},{id:"nord",label:"Nord",previewColors:{dark:["#2e3440","#d8dee9","#88c0d0","#81a1c1"],light:["#eceff4","#2e3440","#5e81ac","#88c0d0"]},dark:{name:"Nord",type:"dark",colors:{"editor.background":"#2e3440","editor.foreground":"#d8dee9","sideBar.background":"#1b2029","sideBar.foreground":"#d8dee9","editorWidget.background":"#2e3440","editorWidget.foreground":"#d8dee9","dropdown.background":"#3b4252","dropdown.foreground":"#d8dee9",focusBorder:"#88c0d0","input.background":"#3b4252","panel.border":"#3b4252","button.background":"#88c0d0","button.foreground":"#2e3440","badge.background":"#88c0d0","badge.foreground":"#2e3440","list.activeSelectionBackground":"#3b4252","list.activeSelectionForeground":"#d8dee9","tab.inactiveBackground":"#2e3440",descriptionForeground:"#7b88a1",errorForeground:"#bf616a","terminal.background":"#2e3440","terminal.foreground":"#d8dee9","terminal.ansiBlack":"#3b4252","terminal.ansiRed":"#bf616a","terminal.ansiGreen":"#a3be8c","terminal.ansiYellow":"#ebcb8b","terminal.ansiBlue":"#81a1c1","terminal.ansiMagenta":"#b48ead","terminal.ansiCyan":"#88c0d0","terminal.ansiWhite":"#e5e9f0"}},light:{name:"Nord Light",type:"light",colors:{"editor.background":"#eceff4","editor.foreground":"#2e3440","sideBar.background":"#e5e9f0","sideBar.foreground":"#2e3440","editorWidget.background":"#eceff4","editorWidget.foreground":"#2e3440","dropdown.background":"#eceff4","dropdown.foreground":"#2e3440",focusBorder:"#5e81ac","input.background":"#e5e9f0","panel.border":"#d8dee9","button.background":"#5e81ac","button.foreground":"#eceff4","badge.background":"#5e81ac","badge.foreground":"#eceff4","list.activeSelectionBackground":"#d8dee9","list.activeSelectionForeground":"#2e3440","tab.inactiveBackground":"#e5e9f0",descriptionForeground:"#7b88a1",errorForeground:"#bf616a","terminal.background":"#eceff4","terminal.foreground":"#2e3440","terminal.ansiBlack":"#2e3440","terminal.ansiRed":"#bf616a","terminal.ansiGreen":"#a3be8c","terminal.ansiYellow":"#d08770","terminal.ansiBlue":"#5e81ac","terminal.ansiMagenta":"#b48ead","terminal.ansiCyan":"#88c0d0","terminal.ansiWhite":"#e5e9f0"}}},{id:"rose-pine",label:"Rosé Pine",previewColors:{dark:["#191724","#e0def4","#c4a7e7","#ebbcba"],light:["#faf4ed","#575279","#907aa9","#d7827e"]},dark:{name:"Rosé Pine",type:"dark",colors:{"editor.background":"#191724","editor.foreground":"#e0def4","sideBar.background":"#1f1d2e","sideBar.foreground":"#e0def4","editorWidget.background":"#191724","editorWidget.foreground":"#e0def4","dropdown.background":"#1f1d2e","dropdown.foreground":"#e0def4",focusBorder:"#c4a7e7","input.background":"#1f1d2e","panel.border":"#26233a","button.background":"#c4a7e7","button.foreground":"#191724","badge.background":"#c4a7e7","badge.foreground":"#191724","list.activeSelectionBackground":"#26233a","list.activeSelectionForeground":"#e0def4","tab.inactiveBackground":"#1f1d2e",descriptionForeground:"#908caa",errorForeground:"#eb6f92","terminal.background":"#191724","terminal.foreground":"#e0def4","terminal.ansiBlack":"#26233a","terminal.ansiRed":"#eb6f92","terminal.ansiGreen":"#9ccfd8","terminal.ansiYellow":"#f6c177","terminal.ansiBlue":"#31748f","terminal.ansiMagenta":"#c4a7e7","terminal.ansiCyan":"#9ccfd8","terminal.ansiWhite":"#e0def4"}},light:{name:"Rosé Pine Dawn",type:"light",colors:{"editor.background":"#faf4ed","editor.foreground":"#575279","sideBar.background":"#f2e9e1","sideBar.foreground":"#575279","editorWidget.background":"#faf4ed","editorWidget.foreground":"#575279","dropdown.background":"#faf4ed","dropdown.foreground":"#575279",focusBorder:"#907aa9","input.background":"#f2e9e1","panel.border":"#dfdad9","button.background":"#907aa9","button.foreground":"#faf4ed","badge.background":"#907aa9","badge.foreground":"#faf4ed","list.activeSelectionBackground":"#dfdad9","list.activeSelectionForeground":"#575279","tab.inactiveBackground":"#f2e9e1",descriptionForeground:"#9893a5",errorForeground:"#b4637a","terminal.background":"#faf4ed","terminal.foreground":"#575279","terminal.ansiBlack":"#575279","terminal.ansiRed":"#b4637a","terminal.ansiGreen":"#56949f","terminal.ansiYellow":"#ea9d34","terminal.ansiBlue":"#286983","terminal.ansiMagenta":"#907aa9","terminal.ansiCyan":"#56949f","terminal.ansiWhite":"#f2e9e1"}}},{id:"tokyo-night",label:"Tokyo Night",previewColors:{dark:["#1a1b26","#a9b1d6","#7aa2f7","#bb9af7"],light:["#d5d6db","#343b58","#34548a","#5a4a78"]},dark:{name:"Tokyo Night",type:"dark",colors:{"editor.background":"#1a1b26","editor.foreground":"#a9b1d6","sideBar.background":"#1f2335","sideBar.foreground":"#a9b1d6","editorWidget.background":"#1a1b26","editorWidget.foreground":"#a9b1d6","dropdown.background":"#1f2335","dropdown.foreground":"#a9b1d6",focusBorder:"#7aa2f7","input.background":"#1f2335","panel.border":"#292e42","button.background":"#7aa2f7","button.foreground":"#1a1b26","badge.background":"#7aa2f7","badge.foreground":"#1a1b26","list.activeSelectionBackground":"#292e42","list.activeSelectionForeground":"#a9b1d6","tab.inactiveBackground":"#1f2335",descriptionForeground:"#565f89",errorForeground:"#f7768e","terminal.background":"#1a1b26","terminal.foreground":"#a9b1d6","terminal.ansiBlack":"#414868","terminal.ansiRed":"#f7768e","terminal.ansiGreen":"#9ece6a","terminal.ansiYellow":"#e0af68","terminal.ansiBlue":"#7aa2f7","terminal.ansiMagenta":"#bb9af7","terminal.ansiCyan":"#7dcfff","terminal.ansiWhite":"#c0caf5"}},light:{name:"Tokyo Night Light",type:"light",colors:{"editor.background":"#d5d6db","editor.foreground":"#343b58","sideBar.background":"#cbccd1","sideBar.foreground":"#343b58","editorWidget.background":"#d5d6db","editorWidget.foreground":"#343b58","dropdown.background":"#d5d6db","dropdown.foreground":"#343b58",focusBorder:"#34548a","input.background":"#cbccd1","panel.border":"#c0c1c6","button.background":"#34548a","button.foreground":"#d5d6db","badge.background":"#34548a","badge.foreground":"#d5d6db","list.activeSelectionBackground":"#c0c1c6","list.activeSelectionForeground":"#343b58","tab.inactiveBackground":"#cbccd1",descriptionForeground:"#6a6e82",errorForeground:"#8c4351","terminal.background":"#d5d6db","terminal.foreground":"#343b58","terminal.ansiBlack":"#343b58","terminal.ansiRed":"#8c4351","terminal.ansiGreen":"#33635c","terminal.ansiYellow":"#8f5e15","terminal.ansiBlue":"#34548a","terminal.ansiMagenta":"#5a4a78","terminal.ansiCyan":"#0f4b6e","terminal.ansiWhite":"#d5d6db"}}},{id:"solarized",label:"Solarized",previewColors:{dark:["#002b36","#839496","#268bd2","#2aa198"],light:["#fdf6e3","#657b83","#268bd2","#2aa198"]},dark:{name:"Solarized Dark",type:"dark",colors:{"editor.background":"#002b36","editor.foreground":"#839496","sideBar.background":"#001e26","sideBar.foreground":"#839496","editorWidget.background":"#002b36","editorWidget.foreground":"#839496","dropdown.background":"#002b36","dropdown.foreground":"#839496",focusBorder:"#268bd2","input.background":"#001e26","panel.border":"#073642","button.background":"#268bd2","button.foreground":"#fdf6e3","badge.background":"#268bd2","badge.foreground":"#fdf6e3","list.activeSelectionBackground":"#073642","list.activeSelectionForeground":"#839496","tab.inactiveBackground":"#001e26",descriptionForeground:"#586e75",errorForeground:"#dc322f","terminal.background":"#002b36","terminal.foreground":"#839496","terminal.ansiBlack":"#073642","terminal.ansiRed":"#dc322f","terminal.ansiGreen":"#859900","terminal.ansiYellow":"#b58900","terminal.ansiBlue":"#268bd2","terminal.ansiMagenta":"#d33682","terminal.ansiCyan":"#2aa198","terminal.ansiWhite":"#eee8d5"}},light:{name:"Solarized Light",type:"light",colors:{"editor.background":"#fdf6e3","editor.foreground":"#657b83","sideBar.background":"#EDE8D4","sideBar.foreground":"#657b83","editorWidget.background":"#fdf6e3","editorWidget.foreground":"#657b83","dropdown.background":"#fdf6e3","dropdown.foreground":"#657b83",focusBorder:"#268bd2","input.background":"#eee8d5","panel.border":"#eee8d5","button.background":"#268bd2","button.foreground":"#fdf6e3","badge.background":"#268bd2","badge.foreground":"#fdf6e3","list.activeSelectionBackground":"#eee8d5","list.activeSelectionForeground":"#657b83","tab.inactiveBackground":"#eee8d5",descriptionForeground:"#93a1a1",errorForeground:"#dc322f","terminal.background":"#fdf6e3","terminal.foreground":"#657b83","terminal.ansiBlack":"#073642","terminal.ansiRed":"#dc322f","terminal.ansiGreen":"#859900","terminal.ansiYellow":"#b58900","terminal.ansiBlue":"#268bd2","terminal.ansiMagenta":"#d33682","terminal.ansiCyan":"#2aa198","terminal.ansiWhite":"#eee8d5"}}},{id:"github",label:"GitHub",previewColors:{dark:["#0d1117","#e6edf3","#58a6ff","#bc8cff"],light:["#ffffff","#24292f","#0969da","#8250df"]},dark:{name:"GitHub Dark",type:"dark",colors:{"editor.background":"#0d1117","editor.foreground":"#e6edf3","sideBar.background":"#010409","sideBar.foreground":"#e6edf3","editorWidget.background":"#0d1117","editorWidget.foreground":"#e6edf3","dropdown.background":"#0d1117","dropdown.foreground":"#e6edf3",focusBorder:"#58a6ff","input.background":"#010409","panel.border":"#21262d","button.background":"#58a6ff","button.foreground":"#0d1117","badge.background":"#58a6ff","badge.foreground":"#0d1117","list.activeSelectionBackground":"#21262d","list.activeSelectionForeground":"#e6edf3","tab.inactiveBackground":"#010409",descriptionForeground:"#8b949e",errorForeground:"#f85149","terminal.background":"#0d1117","terminal.foreground":"#e6edf3","terminal.ansiBlack":"#484f58","terminal.ansiRed":"#ff7b72","terminal.ansiGreen":"#3fb950","terminal.ansiYellow":"#d29922","terminal.ansiBlue":"#58a6ff","terminal.ansiMagenta":"#bc8cff","terminal.ansiCyan":"#39d2c0","terminal.ansiWhite":"#b1bac4"}},light:{name:"GitHub Light",type:"light",colors:{"editor.background":"#ffffff","editor.foreground":"#24292f","sideBar.background":"#f6f8fa","sideBar.foreground":"#24292f","editorWidget.background":"#ffffff","editorWidget.foreground":"#24292f","dropdown.background":"#ffffff","dropdown.foreground":"#24292f",focusBorder:"#0969da","input.background":"#f6f8fa","panel.border":"#d0d7de","button.background":"#0969da","button.foreground":"#ffffff","badge.background":"#0969da","badge.foreground":"#ffffff","list.activeSelectionBackground":"#ddf4ff","list.activeSelectionForeground":"#24292f","tab.inactiveBackground":"#f6f8fa",descriptionForeground:"#57606a",errorForeground:"#cf222e","terminal.background":"#ffffff","terminal.foreground":"#24292f","terminal.ansiBlack":"#24292f","terminal.ansiRed":"#cf222e","terminal.ansiGreen":"#116329","terminal.ansiYellow":"#4d2d00","terminal.ansiBlue":"#0969da","terminal.ansiMagenta":"#8250df","terminal.ansiCyan":"#1b7c83","terminal.ansiWhite":"#6e7781"}}},{id:"high-contrast",label:"High Contrast",previewColors:{dark:["#000000","#ffffff","#60a5fa","#f87171"],light:["#ffffff","#111111","#2563eb","#dc2626"]},dark:{name:"High Contrast Dark",type:"dark",colors:{"editor.background":"#000000","editor.foreground":"#ffffff","sideBar.background":"#111111","sideBar.foreground":"#ffffff","editorWidget.background":"#000000","editorWidget.foreground":"#ffffff","dropdown.background":"#000000","dropdown.foreground":"#ffffff",focusBorder:"#60a5fa","input.background":"#0a0a0a","panel.border":"#6b7280","button.background":"#60a5fa","button.foreground":"#000000","badge.background":"#60a5fa","badge.foreground":"#000000","list.activeSelectionBackground":"#1e3a5f","list.activeSelectionForeground":"#ffffff","tab.inactiveBackground":"#111111",descriptionForeground:"#d1d5db",errorForeground:"#f87171","terminal.background":"#000000","terminal.foreground":"#ffffff","terminal.ansiBlack":"#4b5563","terminal.ansiRed":"#f87171","terminal.ansiGreen":"#4ade80","terminal.ansiYellow":"#facc15","terminal.ansiBlue":"#60a5fa","terminal.ansiMagenta":"#c084fc","terminal.ansiCyan":"#22d3ee","terminal.ansiWhite":"#ffffff"}},light:{name:"High Contrast Light",type:"light",colors:{"editor.background":"#ffffff","editor.foreground":"#111111","sideBar.background":"#ededed","sideBar.foreground":"#111111","editorWidget.background":"#ffffff","editorWidget.foreground":"#111111","dropdown.background":"#ffffff","dropdown.foreground":"#111111",focusBorder:"#2563eb","input.background":"#f5f5f5","panel.border":"#4b5563","button.background":"#2563eb","button.foreground":"#ffffff","badge.background":"#2563eb","badge.foreground":"#ffffff","list.activeSelectionBackground":"#dbeafe","list.activeSelectionForeground":"#111111","tab.inactiveBackground":"#ededed",descriptionForeground:"#374151",errorForeground:"#dc2626","terminal.background":"#ffffff","terminal.foreground":"#111111","terminal.ansiBlack":"#111111","terminal.ansiRed":"#dc2626","terminal.ansiGreen":"#15803d","terminal.ansiYellow":"#a16207","terminal.ansiBlue":"#2563eb","terminal.ansiMagenta":"#7c3aed","terminal.ansiCyan":"#0e7490","terminal.ansiWhite":"#e5e7eb"}}}];function lt(){const e=new Map(ge.map(t=>[t.id,t.label])),n=new Map(ke.map(t=>[t.id,t.label]));for(const{id:t,label:r}of ke)if(e.get(t)!==r)throw new Error(`Theme preset ${t} (${r}) is missing from the shared manifest`);for(const{id:t,label:r}of ge)if(n.get(t)!==r)throw new Error(`Theme preset manifest entry ${t} (${r}) is missing from renderer presets`)}lt();export{Bn as $,Ae as A,Cn as B,hr as C,dr as D,ir as E,sr as F,ar as G,Hr as H,Kr as I,Lr as J,Vr as K,mr as L,Fr as M,Gr as N,Ur as O,Nr as P,Wr as Q,Or as R,Nt as S,Gt as T,qt as U,Sr as V,Dt as W,Ut as X,Lt as Y,$t as Z,Yt as _,Tr as a,xt as a0,Xt as a1,Mn as a2,zt as a3,jt as a4,Jt as a5,Ot as a6,Rt as a7,Bt as a8,Pt as a9,Mt as aa,Wt as ab,Vt as ac,Kt as ad,Ht as ae,ur as af,Tt as ag,M as ah,ye as ai,nr as aj,er as ak,rr as al,Rn as am,Zt as an,tr as ao,Qt as ap,dt as aq,Dr as ar,ie as as,Br as at,Er as au,Cr as av,Mr as aw,Rr as ax,ke as ay,nt as b,Zn as c,vr as d,rt as e,tt as f,yr as g,or as h,br as i,An as j,Ft as k,cr as l,kr as m,Pr as n,Z as o,gr as p,Hn as q,_r as r,wr as s,Sn as t,Ar as u,fr as v,pr as w,lr as x,Ir as y,qr as z};
@@ -1 +1 @@
1
- import{t as a3,bq as p,by as t3,b as s3}from"./DGQ1ECsI.js";import{bs as r3,a5 as o3,aD as t,bA as I,b_ as f,W as m,bn as l3,c9 as l,bV as L,aA as u,ay as i3,bS as n3,aw as S,bz as c3,bl as N,bO as Z,aB as v,bH as A}from"./DYhIMPy1.js";import{i as B}from"./B-DRVFcy.js";import{z as f3}from"./D7KOa2cM.js";import{f as _,g as x,s as F}from"./Bp_k45o-.js";import{F as m3,aP as v3,aH as g3,aY as p3,cq as u3,al as d3}from"./Cjw1QvKa.js";var h3=v("<div></div>"),b3=v('<span class="type-caption absolute text-subtle font-medium"> </span>'),w3=v("<img/> <!>",1),C3=v('<span class="type-caption text-subtle font-medium"> </span>'),_3=v("<div><!></div>");function x3(y,i){if(new.target)return a3({component:x3,...y});r3(i,!0);let r=p(i,"iconName",7),n=p(i,"label",7),o=p(i,"size",7,20),d=p(i,"class",7,"");const j={redis:"redis",mongodb:"mongodb",circleci:"circleci",vercel:"vercel",railway:"railway",convex:"convex",snowflake:"snowflake",sentry:"sentry",figma:"figma",github:"github",linear:"linear"},D={figma:"https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Figma-logo.svg/960px-Figma-logo.svg.png",playwright:"https://ray.run/playwright-brand-assets/playwright-logo.svg"},q={context7:'<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 0C26.2091 0 28 1.79086 28 4V24C28 26.2091 26.2091 28 24 28H4C1.79086 28 0 26.2091 0 24V4C0 1.79086 1.79086 0 4 0H24ZM8.58008 15.2559C8.58008 17.8621 7.95482 19.3557 6.33398 21.1885V22.7783H11.6309V21.1045H8.17773C9.66098 19.3776 10.5723 17.5019 10.5723 15.2559H8.58008ZM17.4268 15.2559C17.4268 17.5019 18.338 19.3776 19.8213 21.1045H16.3672V22.7783H21.6641V21.1885C20.0433 19.3558 19.4189 17.862 19.4189 15.2559H17.4268ZM6.33398 6.80957C7.95495 8.64244 8.58008 10.137 8.58008 12.7432H10.5713C10.5713 10.4972 9.66094 8.62143 8.17773 6.89453H11.6309V5.2207H6.33398V6.80957ZM16.3672 5.2207V6.89453H19.8213C18.338 8.62145 17.4268 10.4972 17.4268 12.7432H19.4189C19.4189 10.137 20.0432 8.64242 21.6641 6.80957V5.2207H16.3672Z" fill="black"/></svg>',slack:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path d="M27.255 80.719c0 7.33-5.978 13.317-13.309 13.317C6.616 94.036.63 88.049.63 80.719s5.987-13.317 13.317-13.317h13.309zm6.709 0c0-7.33 5.987-13.317 13.317-13.317s13.317 5.986 13.317 13.317v33.335c0 7.33-5.986 13.317-13.317 13.317-7.33 0-13.317-5.987-13.317-13.317zm0 0" fill="#de1c59"/><path d="M47.281 27.255c-7.33 0-13.317-5.978-13.317-13.309C33.964 6.616 39.951.63 47.281.63s13.317 5.987 13.317 13.317v13.309zm0 6.709c7.33 0 13.317 5.987 13.317 13.317s-5.986 13.317-13.317 13.317H13.946C6.616 60.598.63 54.612.63 47.281c0-7.33 5.987-13.317 13.317-13.317zm0 0" fill="#35c5f0"/><path d="M100.745 47.281c0-7.33 5.978-13.317 13.309-13.317 7.33 0 13.317 5.987 13.317 13.317s-5.987 13.317-13.317 13.317h-13.309zm-6.709 0c0 7.33-5.987 13.317-13.317 13.317s-13.317-5.986-13.317-13.317V13.946C67.402 6.616 73.388.63 80.719.63c7.33 0 13.317 5.987 13.317 13.317zm0 0" fill="#2eb57d"/><path d="M80.719 100.745c7.33 0 13.317 5.978 13.317 13.309 0 7.33-5.987 13.317-13.317 13.317s-13.317-5.987-13.317-13.317v-13.309zm0-6.709c-7.33 0-13.317-5.987-13.317-13.317s5.986-13.317 13.317-13.317h33.335c7.33 0 13.317 5.986 13.317 13.317 0 7.33-5.987 13.317-13.317 13.317zm0 0" fill="#ebb02e"/></svg>'},E=new Set(["context7","github","linear"]),h={brain:d3,server:u3,database:p3,cloud:g3,default:v3},z=l(()=>j[r().toLowerCase()]),U=l(()=>h[r().toLowerCase()]||h.default),H=l(()=>q[r().toLowerCase()]||null),M=l(()=>E.has(r().toLowerCase()));let b=L(!1),V=L(!1);const k=l(()=>D[r().toLowerCase()]||(t(z)?`https://cdn.simpleicons.org/${t(z)}`:null));function W(){A(b,!0)}function O(){A(V,!0)}var P={get iconName(){return r()},set iconName(e){r(e),u()},get label(){return n()},set label(e){n(e),u()},get size(){return o()},set size(e=20){o(e),u()},get class(){return d()},set class(e=""){d(e),u()},$set:t3,$on:(e,a)=>s3(i,e,a)},c=_3(),Y=o3(c);{var G=e=>{var a=h3();f3(a,()=>t(H),!0),I(a),f(()=>_(a,1,`w-full h-full flex items-center justify-center [&>svg]:w-full [&>svg]:h-full ${t(M)?"dark:invert":""}`)),m(e,a)},J=e=>{var a=w3(),s=i3(a);let g;var T=n3(s,2);{var X=w=>{var C=b3(),$=N(C,!0);f(e3=>{x(C,`font-size: ${o()*.45}px;`),Z($,e3)},[()=>n().charAt(0)]),m(w,C)};B(T,w=>{t(b)||w(X)})}f(()=>{F(s,"src",t(k)),F(s,"alt",n()),g=_(s,1,`w-full h-full object-contain ${t(M)?"dark:invert":""}`,null,g,{"opacity-0":!t(b)})}),S("load",s,W),S("error",s,O),c3(s),m(e,a)},K=e=>{{let a=l(()=>o()*.7);m3(e,{get icon(){return t(U)},class:"text-ghost",get style(){return`font-size: ${t(a)??""}px;`}})}},Q=l(()=>h[r().toLowerCase()]),R=e=>{var a=C3(),s=N(a,!0);f(g=>{x(a,`font-size: ${o()*.45}px;`),Z(s,g)},[()=>n().charAt(0)]),m(e,a)};B(Y,e=>{t(H)?e(G):t(k)&&!t(V)?e(J,1):t(Q)?e(K,2):e(R,-1)})}return I(c),f(()=>{_(c,1,`flex items-center justify-center shrink-0 ${d()??""}`),x(c,`width: ${o()??""}px; height: ${o()??""}px;`)}),m(y,c),l3(P)}export{x3 as M};
1
+ import{t as a3,bq as p,by as t3,b as s3}from"./BUAFIktJ.js";import{bs as r3,a5 as o3,aD as t,bA as I,b_ as f,W as m,bn as l3,c9 as l,bV as L,aA as u,ay as i3,bS as n3,aw as S,bz as c3,bl as N,bO as Z,aB as v,bH as A}from"./DYhIMPy1.js";import{i as B}from"./Bvd0DfwC.js";import{z as f3}from"./BR9y4bsr.js";import{f as _,g as x,s as F}from"./COO6ldt4.js";import{F as m3,aP as v3,aH as g3,aY as p3,cq as u3,al as d3}from"./CfdX4Lfl.js";var h3=v("<div></div>"),b3=v('<span class="type-caption absolute text-subtle font-medium"> </span>'),w3=v("<img/> <!>",1),C3=v('<span class="type-caption text-subtle font-medium"> </span>'),_3=v("<div><!></div>");function x3(y,i){if(new.target)return a3({component:x3,...y});r3(i,!0);let r=p(i,"iconName",7),n=p(i,"label",7),o=p(i,"size",7,20),d=p(i,"class",7,"");const j={redis:"redis",mongodb:"mongodb",circleci:"circleci",vercel:"vercel",railway:"railway",convex:"convex",snowflake:"snowflake",sentry:"sentry",figma:"figma",github:"github",linear:"linear"},D={figma:"https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Figma-logo.svg/960px-Figma-logo.svg.png",playwright:"https://ray.run/playwright-brand-assets/playwright-logo.svg"},q={context7:'<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 0C26.2091 0 28 1.79086 28 4V24C28 26.2091 26.2091 28 24 28H4C1.79086 28 0 26.2091 0 24V4C0 1.79086 1.79086 0 4 0H24ZM8.58008 15.2559C8.58008 17.8621 7.95482 19.3557 6.33398 21.1885V22.7783H11.6309V21.1045H8.17773C9.66098 19.3776 10.5723 17.5019 10.5723 15.2559H8.58008ZM17.4268 15.2559C17.4268 17.5019 18.338 19.3776 19.8213 21.1045H16.3672V22.7783H21.6641V21.1885C20.0433 19.3558 19.4189 17.862 19.4189 15.2559H17.4268ZM6.33398 6.80957C7.95495 8.64244 8.58008 10.137 8.58008 12.7432H10.5713C10.5713 10.4972 9.66094 8.62143 8.17773 6.89453H11.6309V5.2207H6.33398V6.80957ZM16.3672 5.2207V6.89453H19.8213C18.338 8.62145 17.4268 10.4972 17.4268 12.7432H19.4189C19.4189 10.137 20.0432 8.64242 21.6641 6.80957V5.2207H16.3672Z" fill="black"/></svg>',slack:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path d="M27.255 80.719c0 7.33-5.978 13.317-13.309 13.317C6.616 94.036.63 88.049.63 80.719s5.987-13.317 13.317-13.317h13.309zm6.709 0c0-7.33 5.987-13.317 13.317-13.317s13.317 5.986 13.317 13.317v33.335c0 7.33-5.986 13.317-13.317 13.317-7.33 0-13.317-5.987-13.317-13.317zm0 0" fill="#de1c59"/><path d="M47.281 27.255c-7.33 0-13.317-5.978-13.317-13.309C33.964 6.616 39.951.63 47.281.63s13.317 5.987 13.317 13.317v13.309zm0 6.709c7.33 0 13.317 5.987 13.317 13.317s-5.986 13.317-13.317 13.317H13.946C6.616 60.598.63 54.612.63 47.281c0-7.33 5.987-13.317 13.317-13.317zm0 0" fill="#35c5f0"/><path d="M100.745 47.281c0-7.33 5.978-13.317 13.309-13.317 7.33 0 13.317 5.987 13.317 13.317s-5.987 13.317-13.317 13.317h-13.309zm-6.709 0c0 7.33-5.987 13.317-13.317 13.317s-13.317-5.986-13.317-13.317V13.946C67.402 6.616 73.388.63 80.719.63c7.33 0 13.317 5.987 13.317 13.317zm0 0" fill="#2eb57d"/><path d="M80.719 100.745c7.33 0 13.317 5.978 13.317 13.309 0 7.33-5.987 13.317-13.317 13.317s-13.317-5.987-13.317-13.317v-13.309zm0-6.709c-7.33 0-13.317-5.987-13.317-13.317s5.986-13.317 13.317-13.317h33.335c7.33 0 13.317 5.986 13.317 13.317 0 7.33-5.987 13.317-13.317 13.317zm0 0" fill="#ebb02e"/></svg>'},E=new Set(["context7","github","linear"]),h={brain:d3,server:u3,database:p3,cloud:g3,default:v3},z=l(()=>j[r().toLowerCase()]),U=l(()=>h[r().toLowerCase()]||h.default),H=l(()=>q[r().toLowerCase()]||null),M=l(()=>E.has(r().toLowerCase()));let b=L(!1),V=L(!1);const k=l(()=>D[r().toLowerCase()]||(t(z)?`https://cdn.simpleicons.org/${t(z)}`:null));function W(){A(b,!0)}function O(){A(V,!0)}var P={get iconName(){return r()},set iconName(e){r(e),u()},get label(){return n()},set label(e){n(e),u()},get size(){return o()},set size(e=20){o(e),u()},get class(){return d()},set class(e=""){d(e),u()},$set:t3,$on:(e,a)=>s3(i,e,a)},c=_3(),Y=o3(c);{var G=e=>{var a=h3();f3(a,()=>t(H),!0),I(a),f(()=>_(a,1,`w-full h-full flex items-center justify-center [&>svg]:w-full [&>svg]:h-full ${t(M)?"dark:invert":""}`)),m(e,a)},J=e=>{var a=w3(),s=i3(a);let g;var T=n3(s,2);{var X=w=>{var C=b3(),$=N(C,!0);f(e3=>{x(C,`font-size: ${o()*.45}px;`),Z($,e3)},[()=>n().charAt(0)]),m(w,C)};B(T,w=>{t(b)||w(X)})}f(()=>{F(s,"src",t(k)),F(s,"alt",n()),g=_(s,1,`w-full h-full object-contain ${t(M)?"dark:invert":""}`,null,g,{"opacity-0":!t(b)})}),S("load",s,W),S("error",s,O),c3(s),m(e,a)},K=e=>{{let a=l(()=>o()*.7);m3(e,{get icon(){return t(U)},class:"text-ghost",get style(){return`font-size: ${t(a)??""}px;`}})}},Q=l(()=>h[r().toLowerCase()]),R=e=>{var a=C3(),s=N(a,!0);f(g=>{x(a,`font-size: ${o()*.45}px;`),Z(s,g)},[()=>n().charAt(0)]),m(e,a)};B(Y,e=>{t(H)?e(G):t(k)&&!t(V)?e(J,1):t(Q)?e(K,2):e(R,-1)})}return I(c),f(()=>{_(c,1,`flex items-center justify-center shrink-0 ${d()??""}`),x(c,`width: ${o()??""}px; height: ${o()??""}px;`)}),m(y,c),l3(P)}export{x3 as M};